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 should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/Perl/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # with additional metaconfig patches from https://github.com/Perl/metaconfig
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
386 d_attribute_always_inline=''
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_visibility=''
395 d_attribute_warn_unused_result=''
396 d_printf_format_null=''
398 d_non_int_bitfields=''
399 d_builtin_choose_expr=''
401 d_builtin_add_overflow=''
402 d_builtin_mul_overflow=''
403 d_builtin_sub_overflow=''
404 d_c99_variadic_macros=''
453 endhostent_r_proto=''
459 endprotoent_r_proto=''
465 endservent_r_proto=''
521 d_getenv_preserves_other_thread=''
540 gethostbyaddr_r_proto=''
542 gethostbyname_r_proto=''
544 gethostent_r_proto=''
557 getnetbyaddr_r_proto=''
559 getnetbyname_r_proto=''
573 d_getprotobyname_r=''
574 getprotobyname_r_proto=''
575 d_getprotobynumber_r=''
576 getprotobynumber_r_proto=''
578 getprotoent_r_proto=''
590 getservbyname_r_proto=''
592 getservbyport_r_proto=''
594 getservent_r_proto=''
627 d_lc_monetary_2008=''
632 d_libm_lib_version=''
640 d_localtime_r_needs_tzset=''
648 d_long_double_style_ieee=''
649 d_long_double_style_ieee_doubledouble=''
650 d_long_double_style_ieee_extended=''
651 d_long_double_style_ieee_std=''
652 d_long_double_style_vax=''
665 d_malloc_good_size=''
667 d_malloc_usable_size=''
710 d_thread_safe_nl_langinfo_l=''
724 d_old_pthread_create_joinable=''
725 old_pthread_create_joinable=''
727 d_pthread_attr_setscope=''
773 sethostent_r_proto=''
778 d_setlocale_accepts_any_locale_name=''
792 setprotoent_r_proto=''
804 setservent_r_proto=''
817 d_siginfo_si_errno=''
820 d_siginfo_si_status=''
822 d_siginfo_si_value=''
834 d_ipv6_mreq_source=''
845 d_sockaddr_storage=''
864 perl_static_inline=''
869 d_stdio_ptr_lval_nochange_cnt=''
870 d_stdio_ptr_lval_sets_cnt=''
956 default_inc_excludes_dot=''
1022 d_gdbm_ndbm_h_uses_prototypes=''
1023 d_gdbmndbm_h_uses_prototypes=''
1025 d_ndbm_h_uses_prototypes=''
1096 d_inc_version_list=''
1098 inc_version_list_init=''
1106 installusrbinperl=''
1122 ignore_versioned_solibs=''
1138 d_double_has_negative_zero=''
1139 d_double_has_subnormals=''
1140 d_double_style_cray=''
1141 d_double_style_ibm=''
1142 d_double_style_ieee=''
1143 d_double_style_vax=''
1194 d_perl_otherlibdirs=''
1202 api_versionstring=''
1208 version_patchlevel_string=''
1212 d_nv_preserves_uv=''
1213 d_nv_zero_is_allbits_zero=''
1224 nv_overflows_integers_at=''
1225 nv_preserves_uv_bits=''
1302 installsitehtml1dir=''
1305 installsitehtml3dir=''
1312 installsiteman1dir=''
1315 installsiteman3dir=''
1320 installsitescript=''
1340 d_stdio_stream_array=''
1341 stdio_stream_array=''
1360 usekernprocpathname=''
1361 ccflags_uselargefiles=''
1362 ldflags_uselargefiles=''
1363 libswanted_uselargefiles=''
1372 usensgetexecutablepath=''
1384 installvendorarch=''
1391 installvendorhtml1dir=''
1393 vendorhtml1direxp=''
1394 installvendorhtml3dir=''
1396 vendorhtml3direxp=''
1402 installvendorman1dir=''
1405 installvendorman3dir=''
1412 installvendorscript=''
1423 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1426 : We must find out about Eunice early
1428 if test -f /etc/unixtovms; then
1429 eunicefix=/etc/unixtovms
1431 if test -f /etc/unixtovms.exe; then
1432 eunicefix=/etc/unixtovms.exe
1435 : Set executable suffix now -- needed before hints available
1436 if test -f "/libs/version.library"; then
1439 elif test -f "/system/gnu_library/bin/ar.pm"; then
1442 elif test -n "$DJGPP"; then
1445 elif test -f /kern/cookiejar; then
1448 elif test -d c:/. -o -n "$is_os2" ; then
1455 : Possible local include directories to search.
1456 : Set locincpth to "" in a hint file to defeat local include searches.
1457 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1458 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1460 : no include file wanted by default
1463 : Enable -DEBUGGING and -DDEBUGGING from the command line
1467 : Trailing extension. Override this in a hint file, if needed.
1468 : Extra object files, if any, needed on this platform.
1471 : change the next line if compiling for Xenix/286 on Xenix/386
1472 xlibpth='/usr/lib/386 /lib/386'
1473 : Possible local library directories to search.
1474 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1475 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1477 : general looking path for locating libraries
1478 glibpth="/lib /usr/lib $xlibpth"
1479 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1480 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1481 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1482 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1484 : Private path used by Configure to find libraries. Its value
1485 : is prepended to libpth. This variable takes care of special
1486 : machines, like the mips. Usually, it should be empty.
1489 : default library list
1491 : some systems want to use only the non-versioned libso:s
1492 ignore_versioned_solibs=''
1496 : set useposix=false in your hint file to disable the POSIX extension.
1498 : set useopcode=false in your hint file to disable the Opcode extension.
1500 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1503 ccflags_uselargefiles=''
1504 ldflags_uselargefiles=''
1505 libswanted_uselargefiles=''
1506 : set usemultiplicity on the Configure command line to enable multiplicity.
1507 : set usesocks on the Configure command line to enable socks.
1509 : set usethreads on the Configure command line to enable threads.
1510 usereentrant='undef'
1511 : List of libraries we want.
1512 : If anyone needs extra -lxxx, put those in a hint file.
1513 libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld"
1514 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1515 : We probably want to search /usr/shlib before most other libraries.
1516 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1517 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1518 glibpth="/usr/shlib $glibpth"
1519 : Do not use vfork unless overridden by a hint file.
1522 : Find the basic shell for Bourne shell scripts
1526 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1529 if test -f "$xxx"; then
1532 : Build up a list and do a single loop so we can 'break' out.
1533 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1534 for xxx in sh bash ksh pdksh ash; do
1536 try="$try ${p}/${xxx}"
1540 if test -f "$xxx"; then
1543 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1546 elif test -f "$xxx.exe"; then
1557 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1559 Usually it's in /bin/sh. How did you even get this far?
1560 Please report this issue at https://github.com/Perl/perl5/issues
1561 and we'll try to straighten this all out.
1567 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1568 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1571 : see if sh knows # comments
1572 if `$sh -c '#' >/dev/null 2>&1`; then
1576 test -f $xcat$_exe || xcat=/usr/bin/cat
1577 if test ! -f $xcat$_exe; then
1578 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1579 if test -f $p/cat$_exe; then
1584 if test ! -f $xcat$_exe; then
1585 echo "Can't find cat anywhere!"
1589 echo "#!$xcat" >sharp
1592 ./sharp > today 2>/dev/null
1593 if test -s today; then
1596 echo "#! $xcat" > sharp
1599 ./sharp > today 2>/dev/null
1600 if test -s today; then
1608 echo "Your $sh doesn't grok # comments--I will strip them later on."
1611 echo "exec grep -v '^[ ]*#'" >spitshell
1613 $eunicefix spitshell
1614 spitshell=`pwd`/spitshell
1616 echo "I presume that if # doesn't work, #! won't work either!"
1621 : figure out how to guarantee sh startup
1623 '') startsh=${sharpbang}${sh} ;;
1635 : echo "Yup, it does."
1637 echo "Hmm... '$startsh' does not guarantee sh startup..."
1638 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1642 : Save command line options in file UU/cmdline.opt for later use in
1643 : generating config.sh.
1644 cat > cmdline.opt <<EOSH
1645 : Configure command line arguments.
1654 cat >>cmdline.opt <<EOSH
1655 config_arg$argn='$arg'
1657 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1660 arg_exp=`cat cmdl.opt`
1661 args_exp="$args_exp$args_sep'$arg_exp'"
1662 argn=`expr $argn + 1`
1667 : produce awk script to parse command line options
1668 cat >options.awk <<'EOF'
1670 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1672 len = length(optstr);
1673 for (i = 1; i <= len; i++) {
1674 c = substr(optstr, i, 1);
1675 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1686 if (substr(str, 1, 1) != "-") {
1687 printf("'%s'\n", str);
1691 for (i = 2; i <= len; i++) {
1692 c = substr(str, i, 1);
1694 printf("-%s\n", substr(str, i));
1700 printf("'%s'\n", substr(str, i + 1));
1713 : process the command line options
1714 set X `for arg in "$@"; do echo "X$arg"; done |
1715 sed -e s/X// | awk -f options.awk`
1720 : set up default values
1729 rm -f optdef.sh posthint.sh
1730 cat >optdef.sh <<EOS
1736 while test $# -gt 0; do
1738 -d) shift; fastread=yes;;
1739 -e) shift; alldone=cont;;
1743 if test -r "$1"; then
1746 echo "$me: cannot read config file $1." >&2
1752 -h) shift; error=true;;
1753 -r) shift; reuseval=true;;
1754 -s) shift; silent=true; realsilent=true;;
1755 -E) shift; alldone=exit;;
1756 -K) shift; knowitall=true;;
1758 -S) shift; silent=true; extractsh=true;;
1763 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1764 echo "$me: ignoring -D $1" >&2
1767 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1768 *) echo "$1='define'" >> optdef.sh;;
1775 *=) echo "$1" >> optdef.sh;;
1777 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1778 echo "$me: ignoring -U $1" >&2
1780 *) echo "$1='undef'" >> optdef.sh;;
1791 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1795 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1796 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1802 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1803 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1804 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1805 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1806 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1807 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1813 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1815 echo "$yyy=''" >> posthint.sh ;;
1820 echo "$yyy='$zzz'" >> posthint.sh ;;
1822 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1824 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1829 echo "$yyy=$zzz" >> posthint.sh ;;
1830 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1834 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1837 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1845 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1846 [-U symbol] [-U symbol=] [-A command:symbol...]
1847 -d : use defaults for all answers.
1848 -e : go on without questioning past the production of config.sh.
1849 -f : specify an alternate default configuration file.
1850 -h : print this help message and exit (with an error status).
1851 -r : reuse C symbols value if possible (skips costly nm extraction).
1852 -s : silent mode, only echoes questions and essential information.
1853 -D : define symbol to have some value:
1854 -D symbol symbol gets the value 'define'
1855 -D symbol='some value' symbol is set to 'some value'
1856 common used examples (see INSTALL for more info):
1857 -Duse64bitint use 64bit integers
1858 -Duse64bitall use 64bit integers and pointers
1859 -Dusethreads use thread support
1860 -Dinc_version_list=none do not include older perl trees in @INC
1861 -DEBUGGING=none DEBUGGING options
1862 -Dcc=gcc choose your compiler
1863 -Dprefix=/opt/perl5 choose your destination
1864 -E : stop at the end of questions, after having produced config.sh.
1865 -K : do not use unless you know what you are doing.
1866 -O : ignored for backward compatibility
1867 -S : perform variable substitutions on all .SH files (can mix with -f)
1868 -U : undefine symbol:
1869 -U symbol symbol gets the value 'undef'
1870 -U symbol= symbol gets completely empty
1872 -A : manipulate symbol after the platform specific hints have been applied:
1873 -A append:symbol=value append value to symbol
1874 -A symbol=value like append:, but with a separating space
1875 -A define:symbol=value define symbol to have value
1876 -A clear:symbol define symbol to be ''
1877 -A define:symbol define symbol to be 'define'
1878 -A eval:symbol=value define symbol to be eval of value
1879 -A prepend:symbol=value prepend value to symbol
1880 -A undef:symbol define symbol to be 'undef'
1881 -A undef:symbol= define symbol to be ''
1882 e.g.: -A prepend:libswanted='cl pthread '
1883 -A ccflags=-DSOME_MACRO
1884 -V : print version number and exit (with a zero status).
1891 case "$fastread$alldone" in
1894 case "$extractsh" in
1897 if test ! -t 0; then
1898 echo "Say 'sh Configure', not 'sh <Configure'"
1908 true) exec 1>/dev/null;;
1911 : run the defines and the undefines, if any, but leave the file out there...
1913 grep '\\' optdef.sh >/dev/null 2>&1
1914 if test $? = 0; then
1915 echo "Configure does not support \\ in -D arguments"
1919 : create the posthint manipulation script and leave the file out there...
1924 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1925 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1926 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1927 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1928 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1931 : Some greps do not return status, grrr.
1932 echo "grimblepritz" >grimble
1933 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1935 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1941 : the following should work in any shell
1945 echo "AGH! Grep doesn't return a status. Attempting remedial action." >&4
1946 cat >contains <<'EOSS'
1947 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1953 : Find the path to the source tree
1956 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1960 *) src=`cd ../$src && pwd` ;;
1973 if test -f $rsrc/Configure && \
1974 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1976 : found it, so we are ok.
1979 for src in . .. ../.. ../../.. ../../../..; do
1980 if test -f ../$src/Configure && \
1981 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1992 Sorry, I can't seem to locate the source dir for $package. Please start
1993 Configure with an explicit path -- i.e. /some/path/Configure.
2001 echo "Sources for $package found in \"$src\"." >&4
2005 : script used to extract .SH files with variable substitutions
2006 cat >extract <<'EOS'
2008 echo "Doing variable substitutions on .SH files..."
2009 if test -f MANIFEST; then
2010 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
2012 echo "(Looking for .SH files under the source directory.)"
2013 set x `(cd "$src"; find . -name "*.SH" -print)`
2017 0) set x `(cd "$src"; echo *.SH)`; shift;;
2019 if test ! -f "$src/$1"; then
2025 while test $name; do
2026 if test ! -d "$name"; then
2027 create="$name $create";
2028 name=`echo $name | sed -e "s|^[^/]*$||"`;
2029 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2034 for file in $create; do
2043 dir=`expr X$file : 'X\(.*\)/'`
2044 file=`expr X$file : 'X.*/\(.*\)'`
2045 (cd "$dir" && . ./$file)
2055 dir=`expr X$file : 'X\(.*\)/'`
2056 file=`expr X$file : 'X.*/\(.*\)'`
2057 (set x $dir; shift; eval $mkdir_p)
2058 sh <"$src/$dir/$file"
2067 if test -f "$src/config_h.SH"; then
2068 if test ! -f config.h; then
2069 : oops, they left it out of MANIFEST, probably, so do it anyway.
2070 . "$src/config_h.SH"
2075 : extract files and exit if asked to do so
2076 case "$extractsh" in
2078 case "$realsilent" in
2082 case "$config_sh" in
2083 '') config_sh='config.sh';;
2086 echo "Fetching answers from $config_sh..."
2093 echo "Extraction done."
2098 : Eunice requires " " instead of "", can you believe it
2101 echo "Beginning of configuration questions for $package."
2103 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2105 : first determine how to suppress newline on echo command
2107 echo "Checking echo to see how to suppress newlines..."
2108 (echo "hi there\c" ; echo " ") >.echotmp
2109 if $contains c .echotmp >/dev/null 2>&1 ; then
2120 echo $n "The star should be here-->$c"
2124 : Now test for existence of everything in MANIFEST
2126 if test -f "$rsrc/MANIFEST"; then
2127 echo "First let's make sure your kit is complete. Checking..." >&4
2128 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2129 (split -l 50 2>/dev/null || split -50)
2132 for filelist in x??; do
2133 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2134 >/dev/null 2>>"$tmppwd/missing")
2136 if test -s missing; then
2140 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2142 You have the option of continuing the configuration process, despite the
2143 distinct possibility that your kit is damaged, by typing 'y'es. If you
2144 do, don't blame me if something goes wrong. I advise you to type 'n'o
2145 and contact the author (https://github.com/Perl/perl5/issues).
2148 echo $n "Continue? [n] $c" >&4
2152 echo "Continuing..." >&4
2156 echo "ABORTING..." >&4
2161 echo "Looks good..."
2164 echo "There is no MANIFEST file. I hope your kit is complete !"
2168 : Find the appropriate value for a newline for tr
2169 if test -n "$DJGPP"; then
2172 if test X"$trnl" = X; then
2173 case "`echo foo | tr '\n' x 2>/dev/null`" in
2177 if test X"$trnl" = X; then
2178 case "`echo foo | tr '\012' x 2>/dev/null`" in
2179 foox) trnl='\012' ;;
2182 if test X"$trnl" = X; then
2183 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2184 fooxy) trnl='\n\r' ;;
2187 if test X"$trnl" = X; then
2190 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2196 : compute the number of columns on the terminal for proper question formatting
2201 : set up the echo used in my read
2202 myecho="case \"\$xxxm\" in
2203 '') echo $n \"\$rp $c\" >&4;;
2205 '') echo $n \"[\$xxxm] $c\";;
2207 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2209 echo $n \"[\$xxxm] $c\" >&4
2211 echo $n \"\$rp [\$xxxm] $c\" >&4
2217 : now set up to do reads with possible shell escape and default assignment
2224 case "\$fastread" in
2225 yes) case "\$dflt" in
2228 case "\$silent-\$rp" in
2233 *) case "\$silent" in
2234 true) case "\$rp" in
2239 while expr "X\$ans" : "X!" >/dev/null; do
2243 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2251 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2260 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2265 echo "(OK, I'll run with -d after this question.)" >&4
2268 echo "*** Sorry, \$1 not supported yet." >&4
2278 echo "*** Substitution done -- please confirm."
2280 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2285 echo "*** Error -- try again."
2292 case "\$ans\$xxxm\$nostick" in
2298 counter=\`echo \$counter | awk '{ print --\$0 }'\`
2299 if [ \$counter = 0 ]; then
2301 echo >&4 Too many attempts asking the same question. Giving up.
2310 : create .config dir to save info across Configure sessions
2311 test -d ../.config || mkdir ../.config
2312 cat >../.config/README <<EOF
2313 This directory created by Configure to save information that should
2314 persist across sessions for $package.
2316 You may safely delete it if you wish.
2319 : See if we are using a devel version and want that
2320 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2323 usedevel="$define" ;;
2324 *) case "$xversion" in
2327 *** WHOA THERE!!! ***
2329 This is an UNSTABLE DEVELOPMENT release.
2330 The version of this $package distribution is $xversion, that is, odd,
2331 (as opposed to even) and that signifies a development release.
2332 If you want a maintenance release, you want an even-numbered version.
2334 Do ***NOT*** install this into production use.
2335 Data corruption and crashes are possible.
2337 It is most seriously suggested that you do not continue any further
2338 unless you want to help in developing and debugging Perl.
2340 If you *still* want to build perl, you can answer 'y' now,
2341 or pass -Dusedevel to Configure.
2344 rp='Do you really want to continue?'
2348 [yY]) echo >&4 "Okay, continuing."
2349 usedevel="$define" ;;
2350 *) echo >&4 "Okay, bye."
2361 case "$versiononly" in
2362 '') versiononly="$define" ;;
2364 case "$installusrbinperl" in
2365 '') installusrbinperl="$undef" ;;
2370 : general instructions
2373 user=`(logname) 2>/dev/null`
2375 '') user=`whoami 2>&1`;;
2377 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2380 rp='Would you like to see the instructions?'
2391 This installation shell script will examine your system and ask you questions
2392 to determine how the perl5 package should be installed. If you get
2393 stuck on a question, you may use a ! shell escape to start a subshell or
2394 execute a command. Many of the questions will have default answers in square
2395 brackets; typing carriage return will give you the default.
2397 On some of the questions which ask for file or directory names you are allowed
2398 to use the ~name construct to specify the login directory belonging to "name",
2399 even if you don't have a shell which knows about that. Questions where this is
2400 allowed will be marked "(~name ok)".
2404 dflt='Type carriage return to continue'
2408 The prompter used in this script allows you to use shell variables and
2409 backticks in your answers. You may use $1, $2, etc... to refer to the words
2410 in the default answer, as if the default line was a set of arguments given to a
2411 script shell. This means you may also use $* to repeat the whole default line,
2412 so you do not have to re-type everything to add something to the default.
2414 Every time there is a substitution, you will have to confirm. If there is an
2415 error (e.g. an unmatched backtick), the default answer will remain unchanged
2416 and you will be prompted again.
2418 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2419 the questions and use the computed defaults (or the previous answers if there
2420 was already a config.sh file). Type 'Configure -h' for a list of options.
2421 You may also start interactively and then answer '& -d' at any prompt to turn
2422 on the non-interactive behaviour for the remainder of the execution.
2428 Much effort has been expended to ensure that this shell script will run on any
2429 Unix system. If despite that it blows up on yours, your best bet is to edit
2430 Configure and run it again. If you can't run Configure for some reason,
2431 you'll have to generate a config.sh file by hand. Whatever problems you
2432 have, let me (https://github.com/Perl/perl5/issues) know how I blew it.
2434 This installation script affects things in two ways:
2436 1) it may do direct variable substitutions on some of the files included
2438 2) it builds a config.h file for inclusion in C programs. You may edit
2439 any of these files as the need arises after running this script.
2441 If you make a mistake on a question, there is no easy way to back up to it
2442 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2443 files. Configure will offer to let you do this before it runs the SH files.
2446 dflt='Type carriage return to continue'
2448 case "$firsttime" in
2449 true) echo $user >>../.config/instruct;;
2453 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2454 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2455 if test "X$sysroot" = X; then
2460 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2461 # _sysroot is used in places where we need --sysroot=foo
2462 # but using the rest of the flags could cause issues.
2463 _sysroot="--sysroot=$sysroot";
2467 ccflags="$ccflags $_sysroot"
2472 ldflags="$ldflags $_sysroot"
2477 cppflags="$cppflags $_sysroot"
2479 # lddlflags updated below in lddlflags section;
2480 # same with cccdlflags
2484 # Adjust some defaults to also use $sysroot
2485 for var in xlibpth loclibpth locincpth glibpth; do
2488 for path in $xxx; do
2489 eval $var=\"\$$var $sysroot$path\"
2495 : find out where common programs are
2497 echo "Locating common programs..." >&4
2510 if test -d \$dir/\$thing; then
2516 for thisthing in \$dir/\$thing; do
2517 : just loop through to pick last item
2519 if test -f \$thisthing; then
2522 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2525 elif test -f \$dir/\$thing.exe; then
2526 if test -n "$DJGPP"; then
2527 echo \$dir/\$thing.exe
2528 elif test "$eunicefix" != ":"; then
2529 : on Eunice apparently
2582 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2583 pth="$pth $sysroot/lib $sysroot/usr/lib"
2584 for file in $loclist; do
2588 if test -f "$xxx"; then
2591 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2592 xxx=`./loc $file $file $pth`
2595 '') xxx=`./loc $file $file $pth`;;
2596 *) xxx=`./loc $xxx $xxx $pth`;;
2598 eval $file=$xxx$_exe
2602 echo $file is in $xxx.
2605 echo $file is in $xxx.
2608 echo "I don't know where '$file' is, and my life depends on it." >&4
2609 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2615 echo "Don't worry if any of the following aren't found..."
2617 for file in $trylist; do
2621 if test -f "$xxx"; then
2624 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2625 xxx=`./loc $file $file $pth`
2628 '') xxx=`./loc $file $file $pth`;;
2629 *) xxx=`./loc $xxx $xxx $pth`;;
2631 eval $file=$xxx$_exe
2635 echo $file is in $xxx.
2638 echo $file is in $xxx.
2641 echo "I don't see $file out there, $say."
2648 echo "Substituting grep for egrep."
2655 *) if $less -R </dev/null >/dev/null 2>&1; then
2656 echo "Substituting less -R for less."
2664 echo "Substituting cp for ln."
2673 echo "I can't find make or gmake, and my life depends on it." >&4
2674 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2682 *) # We can't have osname yet.
2683 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2684 # Assume that gmake, if found, is definitely GNU make
2685 # and prefer it over the system make.
2686 echo "Substituting gmake for make."
2694 echo "Hopefully test is built into your sh."
2697 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2698 echo "Using the test built into your sh."
2706 echo "Hopefully echo is built into your sh."
2711 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2712 $echo $n "hi there$c" >foo1
2713 echo $n "hi there$c" >foo2
2714 if cmp foo1 foo2 >/dev/null 2>&1; then
2715 echo "They are compatible. In fact, they may be identical."
2722 They are not compatible! You are probably running ksh on a non-USG system.
2723 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2724 have echo built in and we may have to run some Bourne shell scripts. That
2725 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2728 $echo $n "The star should be here-->$c"
2735 # This question was auctioned at YAPC::Europe-2007 in Vienna
2736 # I never promised you could answer it. I only auctioned the question.
2738 The following message is sponsored by
2740 Dresden.pm<--The stars should be here.
2742 Dear Perl user, system administrator or package
2743 maintainer, the Perl community sends greetings to
2744 you. Do you (emblematical) greet back [Y/n]? n
2748 : Check what type of C compiler we use
2752 cat <<'EOSC' >>trygcc
2757 int main(int argc, char *argv[]) {
2761 if $cc -o try $ccflags $ldflags try.c; then
2764 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2770 # Skip this test because it gives a false match on output like:
2771 # ./trygcc: line 23: cc: command not found
2772 # case "`$cc -v -c try.c 2>&1`" in
2773 # *gcc*) trygcc=no ;;
2775 if $test X"$trygcc" = Xyes; then
2776 if gcc -o try -c try.c; then
2778 echo "You seem to have a working gcc, though." >&4
2779 # Switching compilers may undo the work of hints files.
2780 # The most common problem is -D_REENTRANT for threads.
2781 # This heuristic catches that case, but gets false positives
2782 # if -Dusethreads was not actually specified. Better to
2783 # bail out here with a useful message than fail
2784 # mysteriously later. Should we perhaps just try to
2785 # re-invoke Configure -Dcc=gcc config_args ?
2786 if $test -f usethreads.cbu; then
2789 *** However, any setting of the C compiler flags (e.g. for thread support)
2790 *** will be lost. It may be necessary for you to restart Configure and
2791 *** add -Dcc=gcc to your Configure command line.
2794 rp="Would you like to go ahead and try gcc anyway?"
2797 rp="Would you like to use it?"
2800 if $test -f myread; then
2803 if $test -f UU/myread; then
2806 echo "Cannot find myread, sorry. Aborting." >&4
2811 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2824 cat <<'EOSC' >>checkcc
2829 int main(int argc, char *argv[]) {
2833 if $cc -o try $ccflags $ldflags try.c; then
2836 if $test X"$despair" = Xyes; then
2837 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2840 You need to find a working C compiler.
2841 Either (purchase and) install the C compiler supplied by your OS vendor,
2842 or for a free C compiler try http://gcc.gnu.org/
2843 I cannot continue any further, aborting.
2852 : determine whether symbolic links are supported
2855 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2856 echo "Symbolic links are supported." >&4
2859 echo "Symbolic links are NOT supported." >&4
2864 : determine whether symbolic links are supported
2868 echo "Checking how to test for symbolic links..." >&4
2870 if $test "X$issymlink" = X; then
2872 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2873 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2875 if test $? = 0; then
2878 echo "Your builtin 'test -h' may be broken." >&4
2881 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2884 if test -f "$p/$test"; then
2893 echo "Trying external '$test -h'." >&4
2894 issymlink="$test -h"
2895 if $test ! -h sym >/dev/null 2>&1; then
2896 echo "External '$test -h' is broken, too." >&4
2904 if $test "X$issymlink" = X; then
2905 if $test -L sym 2>/dev/null; then
2906 issymlink="$test -L"
2907 echo "The builtin '$test -L' worked." >&4
2910 if $test "X$issymlink" != X; then
2911 echo "You can test for symbolic links with '$issymlink'." >&4
2913 echo "I do not know how you can test for symbolic links." >&4
2917 *) echo "No symbolic links, so not testing for their testing..." >&4
2921 : Make symlinks util
2922 case "$mksymlinks" in
2925 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2928 *) case "$lns:$issymlink" in
2929 *"ln"*" -s:"*"test -"?)
2930 echo "Creating the symbolic links..." >&4
2932 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2942 print "# dir = ", dir, "file = ", file
2943 mf[dir] = mf[dir]" "source"/"dir"/"file;
2946 if (d != ".") { print("mkdir -p "d) }
2947 print("ln -sf "mf[d]" "d);
2949 }' source="$src" > UU/mksymlinks.$$
2953 if test ! -d t/base; then
2954 echo "Failed to create the subdirectories. Aborting." >&4
2958 if test ! -f t/base/lex.t; then
2959 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2962 if test ! -f win32/win32.c; then
2963 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2968 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2976 : Check for Cross-Compilation
2977 if $test "X$targethost" = "X"; then
2980 if $test "X$targetenv" = "X"; then
2983 case "$usecrosscompile" in
2985 $echo "Cross-compiling..."
2988 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2989 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2990 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2991 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2992 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2993 # leave out ld, choosing it is more complex
2994 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2995 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2996 # We are in a weird spot. Just before us, some values
2997 # were 'saved', to be restored after the hints are
2998 # run. This means that the changes we made to ar,
2999 # nm and ranlib will get reverted.
3000 # To avoid that, we hijack the saving mechanism and
3001 # have it save our new values.
3002 for file in ar nm ranlib; do
3004 eval $file=$xxx$_exe
3009 case "$targetarch" in
3010 '') echo "Targetarch not defined." >&4; croak=y ;;
3011 *) echo "Using targetarch $targetarch." >&4 ;;
3013 case "$targethost" in
3014 '') echo "Targethost not defined." >&4; croak=n ;;
3015 *) echo "Using targethost $targethost." >&4
3020 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
3022 : compile a host miniperl and generate_uudmap, unless we got passed them
3023 if $test "X$hostperl" = X; then
3024 echo "Building host miniperl and generate_uudmap binaries" >&4
3032 $src/Configure -des -Dusedevel -Dmksymlinks
3034 case "$hostgenerate" in
3035 '') $make generate_uudmap
3036 hostgenerate=$src/host/generate_uudmap
3038 "$undef") hostgenerate=''
3041 hostperl=$src/host/miniperl
3044 hostosname=`$hostperl -le 'print $^O'`
3047 usecrosscompile="$undef"
3051 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3052 case "$targethost" in
3053 '') echo "Checking for cross-compile" >&4
3054 case "$usecrosscompile$multiarch" in
3055 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3056 if [ -f Makefile ]; then
3058 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3060 echo "Configure done."
3064 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3071 *) echo "Using targethost $targethost." >&4
3073 /*) run=$src/Cross/run
3074 targetmkdir=$src/Cross/mkdir
3076 from=$src/Cross/from
3078 *) pwd=`$test -f ../Configure & cd ..; pwd`
3080 targetmkdir=$pwd/Cross/mkdir
3082 from=$pwd/Cross/from
3085 case "$targetrun" in
3086 '') targetrun=ssh ;;
3091 case "$targetfrom" in
3092 '') targetfrom=scp ;;
3096 from=$from-$targetfrom
3097 case "$targetdir" in
3099 echo "Guessing targetdir $targetdir." >&4
3102 case "$targetuser" in
3104 echo "Guessing targetuser $targetuser." >&4
3107 case "$targetport" in
3109 echo "Guessing targetport $targetport." >&4
3112 case "$targetfrom" in
3116 case "$targetrun" in
3136 '') cwd=$targetdir ;;
3141 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3147 *) echo "Unknown targetrun '$targetrun'" >&4
3151 case "$targetmkdir" in
3153 cat >$targetmkdir <<EOF
3155 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3157 $chmod a+rx $targetmkdir
3159 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3171 $targetmkdir \`dirname \$f\`
3172 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3175 $targetmkdir $targetdir/\`dirname \$f\`
3176 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3189 $mkdir -p $targetdir/\`dirname \$f\`
3190 $cp \$f $targetdir/\$f || exit 1
3193 $targetmkdir $targetdir/\`dirname \$f\`
3194 $cp \$f $targetdir/\$f || exit 1
3201 *) echo "Unknown targetto '$targetto'" >&4
3205 case "$targetfrom" in
3212 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3217 cp) cat >$from <<EOF
3222 cp $targetdir/\$f . || exit 1
3227 *) echo "Unknown targetfrom '$targetfrom'" >&4
3231 if $test ! -f $run; then
3232 echo "Target 'run' script '$run' not found." >&4
3236 if $test ! -f $to; then
3237 echo "Target 'to' script '$to' not found." >&4
3241 if $test ! -f $from; then
3242 echo "Target 'from' script '$from' not found." >&4
3246 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3250 Using '$run' for remote execution,
3251 and '$from' and '$to'
3252 for remote file transfer.
3258 usecrosscompile="$undef"
3263 : see whether [:lower:] and [:upper:] are supported character classes
3265 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3267 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3271 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3272 # (0xd9 and 0xe2), therefore that is a nice testing point.
3273 if test "X$up" = X -o "X$low" = X; then
3274 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3280 if test "X$up" = X -o "X$low" = X; then
3281 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3287 if test "X$up" = X -o "X$low" = X; then
3288 case "`echo RS | od -x 2>/dev/null`" in
3290 echo "Hey, this might be EBCDIC." >&4
3291 if test "X$up" = X -o "X$low" = X; then
3292 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3293 rs) up='[A-IJ-RS-Z]'
3298 if test "X$up" = X -o "X$low" = X; then
3299 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3309 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3311 echo "Using $up and $low to convert case." >&4
3314 echo "I don't know how to translate letters from upper to lower case." >&4
3315 echo "Your tr is not acting any way I know of." >&4
3319 : set up the translation script tr, must be called with ./tr of course
3323 '[A-Z][a-z]') exec $tr '$up' '$low';;
3324 '[a-z][A-Z]') exec $tr '$low' '$up';;
3331 : Try to determine whether config.sh was made on this system
3332 case "$config_sh" in
3334 myuname=`$uname -a 2>/dev/null`
3335 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3336 # Downcase everything to avoid ambiguity.
3337 # Remove slashes and single quotes so we can use parts of this in
3338 # directory and file names.
3339 # Remove newlines so myuname is sane to use elsewhere.
3340 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3341 # because the A-Z/a-z are not consecutive.
3342 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3343 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3344 newmyuname="$myuname"
3346 case "$knowitall" in
3348 if test -f ../config.sh; then
3349 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3350 eval "`grep myuname= ../config.sh`"
3352 if test "X$myuname" = "X$newmyuname"; then
3360 : Get old answers from old config file if Configure was run on the
3361 : same system, otherwise use the hints.
3364 if test -f config.sh; then
3366 rp="I see a config.sh file. Shall I use it to set the defaults?"
3369 n*|N*) echo "OK, I'll ignore it."
3370 mv config.sh config.sh.old
3371 myuname="$newmyuname"
3373 *) echo "Fetching default answers from your old config.sh file..." >&4
3381 : Older versions did not always set $sh. Catch re-use of such
3391 if test ! -f config.sh; then
3394 First time through, eh? I have some defaults handy for some systems
3395 that need some extra help getting the Configure answers right:
3398 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3400 : Half the following guesses are probably wrong... If you have better
3401 : tests or hints, please send them to https://github.com/Perl/perl5/issues
3402 : The metaconfig authors would also appreciate a copy...
3403 $test -f /irix && osname=irix
3404 $test -f /xenix && osname=sco_xenix
3405 $test -f /dynix && osname=dynix
3406 $test -f /dnix && osname=dnix
3407 $test -f /lynx.os && osname=lynxos
3408 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3409 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3410 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3411 $test -f /bin/mips && /bin/mips && osname=mips
3412 $test -d /usr/apollo/bin && osname=apollo
3413 $test -f /etc/saf/_sactab && osname=svr4
3414 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3415 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3416 $test -f /sys/utilities/MultiView && osname=amigaos
3417 if $test -d /MachTen -o -d /MachTen_Folder; then
3419 if $test -x /sbin/version; then
3420 osvers=`/sbin/version | $awk '{print $2}' |
3421 $sed -e 's/[A-Za-z]$//'`
3422 elif $test -x /usr/etc/version; then
3423 osvers=`/usr/etc/version | $awk '{print $2}' |
3424 $sed -e 's/[A-Za-z]$//'`
3430 $test -f /sys/posix.dll &&
3431 $test -f /usr/bin/what &&
3432 set X `/usr/bin/what /sys/posix.dll` &&
3433 $test "$3" = UWIN &&
3437 if $test -f $uname; then
3445 umips) osname=umips ;;
3448 [23]100) osname=mips ;;
3450 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3451 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3454 elif $test -f /etc/kconfig; then
3456 if test "$lns" = "$ln -s"; then
3458 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3460 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3467 if test -n "$DJGPP"; then
3476 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3478 # oslevel can fail with:
3479 # oslevel: Unable to acquire lock.
3480 *not\ found) osvers="$4"."$3" ;;
3481 '<3240'|'<>3240') osvers=3.2.0 ;;
3482 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3483 '=3250'|'>3250') osvers=3.2.5 ;;
3487 bitrig) osname=bitrig
3490 bsd386) osname=bsd386
3493 cygwin*) osname=cygwin
3496 *dc.osx) osname=dcosx
3502 domainos) osname=apollo
3508 dragonfly) osname=dragonfly
3510 [0-9]*) osvers="$3" ;;
3514 dynixptx*) osname=dynixptx
3515 osvers=`echo "$4"|sed 's/^v//'`
3517 freebsd) osname=freebsd
3519 genix) osname=genix ;;
3523 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3536 $test -f /system/lib/libandroid.so && osname=linux-android
3543 netbsd*) osname=netbsd
3546 news-os) osvers="$3"
3548 4*) osname=newsos4 ;;
3552 nonstop-ux) osname=nonstopux ;;
3553 openbsd) osname=openbsd
3559 POSIX-BC | posix-bc ) osname=posix-bc
3562 powerux | power_ux | powermax_os | powermaxos | \
3563 powerunix | power_unix) osname=powerux
3569 solaris) osname=solaris
3571 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3578 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3582 titanos) osname=titanos
3591 ultrix) osname=ultrix
3594 osf1|mls+) case "$5" in
3597 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3600 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3603 hp*) osname=hp_osf1 ;;
3604 mips) osname=mips_osf1 ;;
3607 # UnixWare 7.1.2 is known as Open UNIX 8
3608 openunix|unixware) osname=svr5
3616 $2) case "$osname" in
3620 : svr4.x or possibly later
3630 if test -f /stand/boot ; then
3631 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3632 if test -n "$INITPROG" -a -f "$INITPROG"; then
3633 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3634 if test -n "$isesix"; then
3642 *) if test -f /etc/systemid; then
3644 set `echo $3 | $sed 's/\./ /g'` $4
3645 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3647 elif $test -f $src/hints/sco_$1_$2.sh; then
3649 elif $test -f $src/hints/sco_$1.sh; then
3654 '') : Still unknown. Probably a generic Sys V.
3663 *) case "$osname" in
3664 '') : Still unknown. Probably a generic BSD.
3672 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3673 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3674 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3677 $rm -f UU/kernel.what
3678 elif test -d c:/. -o -n "$is_os2" ; then
3685 case "$targetarch" in
3688 case "$targetarch" in
3690 # Will load qnx.sh, which should change osname to nto
3695 # Catch arm-linux-androideabi, mipsel-linux-android,
3696 # and i686-linux-android
3697 osname=linux-android
3701 # Something like arm-linux-gnueabihf is really just
3708 # XXX perhaps we should just assume
3709 # osvers to be 2, or maybe take the value
3710 # from targetarch. Using $run before the
3711 # hints are run is somewhat icky.
3712 set X `$run $uname -a 2>/dev/null`
3715 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3720 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3727 : Now look for a hint file osname_osvers, unless one has been
3728 : specified already.
3731 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3732 : Also try without trailing minor version numbers.
3733 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3734 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3735 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3736 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3739 *) case "$osvers" in
3742 *) if $test -f $src/hints/$file.sh ; then
3744 elif $test -f $src/hints/$xfile.sh ; then
3746 elif $test -f $src/hints/$xxfile.sh ; then
3748 elif $test -f $src/hints/$xxxfile.sh ; then
3750 elif $test -f $src/hints/$xxxxfile.sh ; then
3752 elif $test -f "$src/hints/${osname}.sh" ; then
3761 if $test -f Policy.sh ; then
3764 none) dflt="Policy" ;;
3765 *) dflt="Policy $dflt" ;;
3770 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3774 if $test -f Policy.sh ; then
3777 There's also a Policy hint file available, which should make the
3778 site-specific (policy) questions easier to answer.
3785 You may give one or more space-separated answers, or "none" if appropriate.
3786 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3787 previous run of Configure, you may specify it as well as or instead of
3788 OS-specific hints. If hints are provided for your OS, you should use them:
3789 although Perl can probably be built without hints on many platforms, using
3790 hints often improve performance and may enable features that Configure can't
3791 set up on its own. If there are no hints that match your OS, specify "none";
3792 DO NOT give a wrong version or a wrong OS.
3796 rp="Which of these apply, if any?"
3799 for file in $tans; do
3800 if $test X$file = XPolicy -a -f Policy.sh; then
3802 $cat Policy.sh >> UU/config.sh
3803 elif $test -f $src/hints/$file.sh; then
3804 . $src/hints/$file.sh
3805 $cat $src/hints/$file.sh >> UU/config.sh
3806 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3809 : Give one chance to correct a possible typo.
3810 echo "$file.sh does not exist"
3812 rp="hint to use instead?"
3814 for file in $ans; do
3815 if $test -f "$src/hints/$file.sh"; then
3816 . $src/hints/$file.sh
3817 $cat $src/hints/$file.sh >> UU/config.sh
3818 elif $test X$ans = X -o X$ans = Xnone ; then
3821 echo "$file.sh does not exist -- ignored."
3828 : Remember our hint file for later.
3829 if $test -f "$src/hints/$file.sh" ; then
3839 echo "Fetching default answers from $config_sh..." >&4
3843 cp $config_sh config.sh 2>/dev/null
3855 : Restore computed paths
3856 for file in $loclist $trylist; do
3857 eval $file="\$_$file"
3862 Configure uses the operating system name and version to set some defaults.
3863 The default value is probably right if the name rings a bell. Otherwise,
3864 since spelling matters for me, either accept the default or answer "none"
3871 ''|' '|none) dflt=none ;;
3872 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3875 *) dflt="$osname" ;;
3877 rp="Operating system name?"
3881 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3887 ''|' '|none) dflt=none ;;
3888 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3889 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3891 ''|' ') dflt=none ;;
3896 *) dflt="$osvers" ;;
3898 rp="Operating system version?"
3908 : who configured the system
3909 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3912 cf_by=`(logname) 2>/dev/null`
3915 cf_by=`(whoami) 2>/dev/null`
3917 "") cf_by=unknown ;;
3922 : decide how portable to be. Allow command line overrides.
3923 case "$d_portable" in
3925 *) d_portable="$define" ;;
3928 : set up shell script to do ~ expansion
3934 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3937 if $test -f /bin/csh; then
3938 /bin/csh -f -c "glob \$1"
3943 name=\`$expr x\$1 : '..\([^/]*\)'\`
3944 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3945 if $test ! -d "\$dir"; then
3947 echo "\$me: can't locate home directory for: \$name" >&2
3952 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3968 : now set up to get a file name
3972 cat <<'EOSC' >>getfile
3988 : getfile will accept an answer from the comma-separated list
3989 : enclosed in parentheses even if it does not meet other criteria.
3990 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3991 fn=`echo $fn | sed 's/(.*)//'`
3997 loc_file=`expr $fn : '.*:\(.*\)'`
3998 fn=`expr $fn : '\(.*\):.*'`
4006 */*) fullpath=true;;
4015 *e*) exp_file=true;;
4018 *p*) nopath_ok=true;;
4023 *d*) type='Directory';;
4024 *l*) type='Locate';;
4029 Locate) what='File';;
4034 case "$d_portable" in
4042 while test "$type"; do
4047 true) rp="$rp (~name ok)";;
4050 if test -f UU/getfile.ok && \
4051 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4070 value=`UU/filexp $ans`
4073 if test "$ans" != "$value"; then
4074 echo "(That expands to $value on this system.)"
4088 /*) value="$ansexp" ;;
4089 [a-zA-Z]:/*) value="$ansexp" ;;
4094 echo "I shall only accept a full path name, as in /bin/ls." >&4
4095 echo "Use a ! shell escape if you wish to check pathnames." >&4
4098 echo "Please give a full path name, starting with slash." >&4
4101 echo "Note that using ~name is ok provided it expands well." >&4
4114 for fp in $gfpth; do
4115 if test "X$fp" = X.; then
4120 if test -f "$pf"; then
4122 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4124 echo "($value is not a plain file, but that's ok.)"
4127 if test X"$type" = X; then
4134 for fp in $gfpth; do
4135 if test "X$fp" = X.; then
4140 direxp="$fp/$ansexp"
4142 if test -d "$direxp"; then
4150 if test -d "$ansexp"; then
4151 echo "(Looking for $loc_file in directory $value.)"
4152 value="$value/$loc_file"
4153 ansexp="$ansexp/$loc_file"
4155 if test -f "$ansexp"; then
4158 case "$nopath_ok" in
4159 true) case "$value" in
4161 *) echo "Assuming $value will be in people's path."
4177 if test "$fastread" = yes; then
4182 rp="$what $value doesn't exist. Use that name anyway?"
4201 test "X$gfpthkeep" != Xy && gfpth=""
4204 : determine root of directory hierarchy where package will be installed.
4206 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4213 By default, $package will be installed in $dflt/bin, manual pages
4214 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4215 installation directories. Typically this is something like /usr/local.
4216 If you wish to have binaries under /usr/bin but other parts of the
4217 installation under /usr/local, that's ok: you will be prompted
4218 separately for each of the installation directories, the prefix being
4219 only used to set the defaults.
4223 rp='Installation prefix to use?'
4230 *) oldprefix="$prefix";;
4236 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4242 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4244 *) prefixexp="$ansexp"
4247 : allow them to override the AFS root
4250 *) afsroot=$afsroot ;;
4256 $define|true) afs=true ;;
4257 $undef|false) afs=false ;;
4258 *) if $test -d $afsroot; then
4266 echo "AFS may be running... I'll be extra cautious then..." >&4
4268 echo "AFS does not seem to be running..." >&4
4271 : determine installation prefix for where package is to be installed.
4275 Since you are running AFS, I need to distinguish the directory in which
4276 files will reside from the directory in which they are installed (and from
4277 which they are presumably copied to the former directory by occult means).
4280 case "$installprefix" in
4281 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4282 *) dflt="$installprefix";;
4287 In some special cases, particularly when building $package for distribution,
4288 it is convenient to distinguish the directory in which files should be
4289 installed from the directory ($prefix) in which they will
4290 eventually reside. For most users, these two directories are the same.
4293 case "$installprefix" in
4295 *) dflt=$installprefix;;
4299 rp='What installation prefix should I use for installing files?'
4301 installprefix="$ans"
4302 installprefixexp="$ansexp"
4304 : Perform the prefixexp/installprefixexp correction if necessary
4305 cat <<EOS >installprefix
4308 cat <<'EOSC' >>installprefix
4309 : Change installation prefix, if necessary.
4310 if $test X"$prefix" != X"$installprefix"; then
4311 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4313 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4316 chmod +x installprefix
4317 $eunicefix installprefix
4319 : Set variables such as privlib and privlibexp from the output of ./getfile
4320 : performing the prefixexp/installprefixexp correction if necessary.
4321 cat <<EOS >setprefixvar
4324 cat <<'EOSC' >>setprefixvar
4325 eval "${prefixvar}=\"\$ans\""
4326 eval "${prefixvar}exp=\"\$ansexp\""
4329 chmod +x setprefixvar
4330 $eunicefix setprefixvar
4332 : set up the script used to warn in case of inconsistency
4341 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4343 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4344 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4349 echo "*** WHOA THERE!!! ***" >&4
4350 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4353 rp=" Keep the $hint value?"
4356 y) td=$was; tu=$was;;
4360 : function used to set '$1' to '$val'
4361 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4363 $define$undef) . ./whoa; eval "$var=\$td";;
4364 $undef$define) . ./whoa; eval "$var=\$tu";;
4365 *) eval "$var=$val";;
4368 : Do we want threads support and if so, what type
4369 case "$usethreads" in
4370 $define|true|[yY]*) dflt='y';;
4371 *) # Catch case where user specified ithreads but
4372 # forgot -Dusethreads (A.D. 4/2002)
4373 case "$useithreads" in
4374 *$define*) dflt='y';;
4381 Perl can be built to offer a form of threading support on some systems
4382 To do so, Configure can be run with -Dusethreads.
4384 Note that Perl built with threading support runs slightly slower
4385 and uses slightly more memory than plain Perl.
4387 If this doesn't make any sense to you, just accept the default '$dflt'.
4389 rp='Build a threading Perl?'
4392 y|Y) val="$define" ;;
4398 useithreads="$usethreads"
4400 case "$d_oldpthreads" in
4401 '') : Configure tests would be welcome here. For now, assume undef.
4403 *) val="$d_oldpthreads" ;;
4409 : Look for a hint-file generated 'call-back-unit'. If the
4410 : user has specified that a threading perl is to be built,
4411 : we may need to set or change some other defaults.
4412 if $test -f usethreads.cbu; then
4413 echo "Your platform has some specific hints regarding threaded builds, using them..."
4416 case "$usethreads" in
4417 "$define"|true|[yY]*)
4419 (Your platform does not have any specific hints for threaded builds.
4420 Assuming POSIX threads, then.)
4426 : Check if multiplicity is required
4429 Perl can be built so that multiple Perl interpreters can coexist
4430 within the same Perl executable.
4433 case "$useithreads" in
4436 This multiple interpreter support is required for interpreter-based threads.
4440 *) case "$usemultiplicity" in
4441 $define|true|[yY]*) dflt='y';;
4445 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4446 rp='Build Perl for multiplicity?'
4449 y|Y) val="$define" ;;
4457 : Check if morebits is requested
4458 case "$usemorebits" in
4459 "$define"|true|[yY]*)
4460 use64bitint="$define"
4461 uselongdouble="$define"
4462 usemorebits="$define"
4464 *) usemorebits="$undef"
4468 : Determine the C compiler to be used
4474 rp="Use which C compiler?"
4478 : See whether they have no cc but they do have gcc
4480 if $test -f cc.cbu; then
4485 : make some quick guesses about what we are up against
4487 $echo $n "Hmm... $c"
4497 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4498 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4500 echo "Looks kind of like an OSF/1 system, but we'll see..."
4502 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4503 xxx=`./loc addbib blurfl $pth`
4504 if $test -f $xxx; then
4505 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4509 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4510 echo "Looks kind of like an extended USG system, but we'll see..."
4512 echo "Looks kind of like a USG system, but we'll see..."
4516 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4517 echo "Looks kind of like a BSD system, but we'll see..."
4521 echo "Looks kind of like a Version 7 system, but we'll see..."
4524 case "$eunicefix" in
4527 There is, however, a strange, musty smell in the air that reminds me of
4528 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4532 : it so happens the Eunice I know will not run shell scripts in Unix format
4536 echo "Congratulations. You aren't running Eunice."
4540 : Detect OS2. The p_ variable is set above in the Head.U unit.
4541 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4542 : semicolon as a patch separator
4547 I have the feeling something is not exactly right, however...don't tell me...
4548 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4549 (Or you may be running DOS with DJGPP.)
4554 if test -f /xenix; then
4555 echo "Actually, this looks more like a XENIX system..."
4560 echo "It's not Xenix..."
4565 if test -f /venix; then
4566 echo "Actually, this looks more like a VENIX system..."
4573 echo "Nor is it Venix..."
4576 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4577 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4580 : Check if we are using GNU gcc and what its version is
4582 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4586 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4588 printf("%s\n", __VERSION__);
4590 printf("%s\n", "1");
4596 if $cc -o try $ccflags $ldflags try.c; then
4597 gccversion=`$run ./try`
4598 case "$gccversion" in
4599 '') echo "You are not using GNU cc." ;;
4600 *) echo "You are using GNU cc $gccversion."
4606 echo "*** WHOA THERE!!! ***" >&4
4607 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4608 case "$knowitall" in
4610 echo " You'd better start hunting for one and let me know about it." >&4
4616 case "$gccversion" in
4617 1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4619 case "$gccversion" in
4620 '') gccosandvers='' ;;
4621 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4622 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4624 case "$gccosandvers" in
4625 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4626 $osname$osvers) ;; # looking good
4627 $osname*) cat <<EOM >&4
4629 *** WHOA THERE!!! ***
4631 Your gcc has not been compiled for the exact release of
4632 your operating system ($gccosandvers versus $osname$osvers).
4634 In general it is a good idea to keep gcc synchronized with
4635 the operating system because otherwise serious problems
4636 may ensue when trying to compile software, like Perl.
4638 I'm trying to be optimistic here, though, and will continue.
4639 If later during the configuration and build icky compilation
4640 problems appear (headerfile conflicts being the most common
4641 manifestation), I suggest reinstalling the gcc to match
4642 your operating system release.
4646 *) gccosandvers='' ;; # failed to parse, better be silent
4654 # gcc 3.* complain about adding -Idirectories that they already know about,
4655 # so we will take those off from locincpth.
4656 case "$gccversion" in
4658 echo "int main(){}">try.c
4659 for incdir in $locincpth; do
4660 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4661 grep '^c[cp]p*[01]: warning: changing search order '`
4662 if test "X$warn" != X; then
4663 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4669 # gcc 4.9 by default does some optimizations that break perl.
4670 # see ticket 121505.
4672 # The -fwrapv disables those optimizations (and probably others,) so
4673 # for gcc 4.9 (and later, since the optimizations probably won't go
4674 # away), add -fwrapv unless the user requests -fno-wrapv, which
4675 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4676 # which turns the overflows -fwrapv ignores into runtime errors.
4677 case "$gccversion" in
4678 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4680 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4681 *) ccflags="$ccflags -fwrapv" ;;
4685 # Really old versions of gcc default to C89 and will error for this code.
4686 # See if the compiler (gcc or otherwise) needs a flag to compile C99 code
4687 # Initialisations in for loops seem to be the particular problem
4688 # (Does this syntax conflict with something else that was valid C89?)
4689 # We also add a declaration after a statement to detect whether the compiler
4690 # (or the user supplied -Accflags) consider such declarations to be errors.
4691 # This causes 'Configure with -Accflags="-Werror=declaration-after-statement"'
4692 # to fail hard and early.
4694 # Annoyingly -std=c99 will cause gcc to tell glibc not to define prototypes for
4695 # syscall, drand48 etc when including <unistd.h>, which messes up our build.
4696 # I guess we *could* loop round trying -std=c99 first with checks both for the
4697 # prototype found and the code compiling (because -std=gnu99 might do other
4698 # things we don't want, particularly on non-GCC compilers) but
4699 # 1) We would need to check for the prototype first (without any flags)
4700 # 2) We would still end up with most Linux systems either being -std=gnu99
4701 # or "" (no flag), and so both common options would not rigorously check our
4702 # portability to other platforms.
4703 # So it doesn't seem worth the complexity and chance of different failure.
4704 $cat >try.c <<'EOCP'
4705 int main(int argc, char **argv) {
4707 /* This is deliberately a declaration after a statement. */
4708 unsigned long long count = 0;
4709 for (char **p = argv; *p; ++p) {
4712 return count == 1 ? 0 : argc;
4716 for flag in '' '-std=gnu99' '-std=c99'; do
4717 if $cc -o try $flag $ccflags $ldflags try.c 2>/dev/null && ./try; then
4723 '') echo "Your C compiler doesn't need any special flags to compile C99 code"
4725 no) echo >&4 "Your C compiler doesn't seem to be able to compile C99 code"
4726 rp='Do you really want to continue?'
4730 [yY]) echo >&4 "Okay, continuing." ;;
4734 *) echo "Your C compiler needs $c99_for to compile C99 code"
4735 ccflags="$c99_for $ccflags"
4740 : What should the include directory be ?
4741 : Use sysroot if set, so findhdr looks in the right place.
4743 $echo $n "Hmm... $c"
4744 dflt="$sysroot/usr/include"
4747 if $test -f /bin/mips && /bin/mips; then
4748 echo "Looks like a MIPS system..."
4749 $cat >usr.c <<'EOCP'
4750 #ifdef SYSTYPE_BSD43
4754 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4755 dflt='/bsd43/usr/include'
4759 mips_type='System V'
4761 $rm -f usr.c usr.out
4762 echo "and you're compiling with the $mips_type compiler and libraries."
4766 echo "Doesn't look like a MIPS system."
4776 case "$xxx_prompt" in
4779 rp='Where are the include files you want to use?'
4787 : see how we invoke the C preprocessor
4789 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4790 cat <<'EOT' >testcpp.c
4796 if test ! -f cppstdin; then
4797 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4798 # AIX cc -E doesn't show the absolute headerfile
4799 # locations but we'll cheat by using the -M flag.
4800 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4802 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4805 echo "Keeping your $hint cppstdin wrapper."
4808 wrapper=`pwd`/cppstdin
4812 if $test "X$cppstdin" != "X" && \
4813 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4814 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4816 echo "You used to use $cppstdin $cppminus so we'll use that again."
4818 '') echo "But let's see if we can live without a wrapper..." ;;
4820 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4821 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4823 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4826 echo "(However, $cpprun $cpplast does not work, let's see...)"
4834 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4841 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4842 $cc -E <testcpp.c >testcpp.out 2>&1; \
4843 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4844 echo "Yup, it does."
4845 x_cpp="$cc $cppflags -E"
4847 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4848 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4849 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4850 echo "Yup, it does."
4851 x_cpp="$cc $cppflags -E"
4853 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4854 $cc -P <testcpp.c >testcpp.out 2>&1; \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4856 echo "Yipee, that works!"
4857 x_cpp="$cc $cppflags -P"
4859 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4860 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4862 echo "At long last!"
4863 x_cpp="$cc $cppflags -P"
4865 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4866 $cpp <testcpp.c >testcpp.out 2>&1; \
4867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 x_cpp="$cpp $cppflags"
4871 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4872 $cpp - <testcpp.c >testcpp.out 2>&1; \
4873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4874 echo "Hooray, it works! I was beginning to wonder."
4875 x_cpp="$cpp $cppflags"
4877 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4878 $wrapper <testcpp.c >testcpp.out 2>&1; \
4879 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 rp="No dice. I can't find a C preprocessor. Name one:"
4889 $x_cpp <testcpp.c >testcpp.out 2>&1
4890 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4891 echo "OK, that will do." >&4
4893 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4908 echo "Perhaps can we force $cc -E using a wrapper..."
4909 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4910 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4916 echo "Nope, we'll have to live without it..."
4930 "$wrapper"|'cppstdin') ;;
4931 *) $rm -f $wrapper;;
4933 $rm -f testcpp.c testcpp.out
4935 : Adjust cppfilter for path component separator
4937 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4938 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4942 : Use gcc to determine libpth and incpth
4943 # If using gcc or clang, we can get better values for libpth, incpth
4944 # and usrinc directly from the compiler.
4945 # Note that ccname for clang is also gcc.
4948 realpath=`which realpath 2>/dev/null | sed 's/no realpath in.*//'`
4949 $echo 'extern int foo;' > try.c
4950 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4953 if $test $# -gt 0; then
4956 */realpath) i=`$realpath $i` ;;
4959 j="`$echo $i | $sed 's,/include[^/]*,/lib,'`"
4960 if $test -d $j; then
4961 inclibpth="$inclibpth $j"
4964 incpth="`$echo $incpth | $sed 's/^ //'`"
4965 for xxx in $inclibpth $loclibpth $plibpth $glibpth; do
4966 if $test -d $xxx; then
4968 */realpath) xxx=`$realpath $xxx` ;;
4972 *) libpth="$libpth $xxx";;
4976 libpth="`$echo $libpth | $sed 's/^ //'`"
4980 '') for i in $incpth; do
4981 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4989 case "$usecrosscompile" in
4992 '') echo "Incpth not defined." >&4; croak=y ;;
4993 *) echo "Using incpth '$incpth'." >&4 ;;
4996 '') echo "Libpth not defined." >&4; croak=y ;;
4997 *) echo "Using libpth '$libpth'." >&4 ;;
5000 '') echo "Usrinc not defined." >&4; croak=y ;;
5001 *) echo "Using usrinc $usrinc." >&4 ;;
5005 if test "X$sysroot" = X; then
5006 echo "Cannot continue, aborting." >&4; exit 1
5008 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5017 : Default value for incpth is just usrinc
5019 '') incpth="$usrinc";;
5022 : Set private lib path
5025 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5030 '') dlist="$loclibpth $plibpth $glibpth";;
5031 *) dlist="$libpth";;
5034 : Now check and see which directories actually exist, avoiding duplicates
5037 if $test -d $xxx; then
5040 *) libpth="$libpth $xxx";;
5046 Some systems have incompatible or broken versions of libraries. Among
5047 the directories listed in the question below, please remove any you
5048 know not to be holding relevant libraries, and add any that are needed.
5049 Say "none" for none.
5053 if test "X$sysroot" != X; then
5055 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5068 rp="Directories to use for library searches?"
5075 : compute shared library extension
5078 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5088 On some systems, shared libraries may be available. Answer 'none' if
5089 you want to suppress searching of shared libraries for the remainder
5090 of this configuration.
5093 rp='What is the file extension used for shared libraries?'
5097 : Does target system insist that shared library basenames are unique
5100 Some dynamic loaders assume that the *basename* of shared library filenames
5101 are globally unique. We'll default this to undef as we assume your system
5102 is not this weird. Set to defined if you're on one of them.
5107 rp='Make shared library basenames unique?'
5110 y|Y) val="$define" ;;
5113 set d_libname_unique
5116 : Define several unixisms.
5117 : Hints files or command line option can be used to override them.
5118 : The convoluted testing is in case hints files set either the old
5121 '') case "$exe_ext" in
5123 *) _exe="$exe_ext" ;;
5128 '') case "$lib_ext" in
5135 '') case "$obj_ext" in
5142 '') case "$path_sep" in
5153 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5155 : Which makefile gets called first. This is used by make depend.
5156 case "$firstmakefile" in
5157 '') firstmakefile='makefile';;
5160 : Check is we will use socks
5162 $define|true|[yY]*) dflt='y';;
5167 Perl can be built to use the SOCKS proxy protocol library. To do so,
5168 Configure must be run with -Dusesocks. If you use SOCKS you also need
5169 to use the PerlIO abstraction layer, this will be implicitly selected.
5171 If this doesn't make any sense to you, just accept the default '$dflt'.
5173 rp='Build Perl for SOCKS?'
5176 y|Y) val="$define" ;;
5182 : Check for uselongdouble support
5184 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5187 case "$uselongdouble" in
5188 $define|true|[yY]*) dflt='y';;
5193 Perl can be built to take advantage of long doubles which
5194 (if available) may give more accuracy and range for floating point numbers.
5196 If this doesn't make any sense to you, just accept the default '$dflt'.
5198 rp='Try to use long doubles if available?'
5201 y|Y) val="$define" ;;
5207 case "$uselongdouble" in
5208 true|[yY]*) uselongdouble="$define" ;;
5211 : Look for a hint-file generated 'call-back-unit'. If the
5212 : user has specified that long doubles should be used,
5213 : we may need to set or change some other defaults.
5214 if $test -f uselongdouble.cbu; then
5215 echo "Your platform has some specific hints regarding long doubles, using them..."
5216 . ./uselongdouble.cbu
5218 case "$uselongdouble" in
5221 (Your platform does not have any specific hints for long doubles.)
5227 : Check if quadmath is requested
5228 case "$usequadmath" in
5229 "$define"|true|[yY]*) usequadmath="$define" ;;
5230 *) usequadmath="$undef" ;;
5233 : Fail if both uselongdouble and usequadmath are requested
5234 case "$usequadmath:$uselongdouble" in
5238 *** You requested the use of the quadmath library and use
5239 *** of long doubles.
5241 *** Please select one or the other.
5247 : Looking for optional libraries
5249 echo "Checking for optional libraries..." >&4
5254 case "$libswanted" in
5255 '') libswanted='c_s';;
5258 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5260 case "$usecbacktrace" in
5261 "$define") libswanted="$libswanted bfd" ;;
5263 case "$usequadmath" in
5264 "$define") libswanted="$libswanted quadmath" ;;
5270 for thisdir in $libpth $xlibpth; do
5271 test -d $thisdir && libspath="$libspath $thisdir"
5273 for thislib in $libswanted; do
5274 for thisdir in $libspath; do
5276 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5277 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5278 $test -f "$xxx" && eval $libscheck
5279 $test -f "$xxx" && libstyle=shared
5280 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5281 $test -f "$xxx" && eval $libscheck
5282 $test -f "$xxx" && libstyle=shared
5284 if test ! -f "$xxx"; then
5285 xxx=$thisdir/lib$thislib.$so$_a
5286 $test -f "$xxx" && eval $libscheck
5287 $test -f "$xxx" && libstyle="import"
5289 if test ! -f "$xxx"; then
5290 xxx=$thisdir/$thislib.$so$_a
5291 $test -f "$xxx" && eval $libscheck
5292 $test -f "$xxx" && libstyle="import"
5294 if test ! -f "$xxx"; then
5295 xxx=$thisdir/lib$thislib.$so
5296 $test -f "$xxx" && eval $libscheck
5297 $test -f "$xxx" && libstyle=shared
5299 if test ! -f "$xxx"; then
5300 xxx=$thisdir/lib$thislib$_a
5301 $test -f "$xxx" && eval $libscheck
5302 $test -f "$xxx" && libstyle=static
5304 if test ! -f "$xxx"; then
5305 xxx=$thisdir/$thislib$_a
5306 $test -f "$xxx" && eval $libscheck
5307 $test -f "$xxx" && libstyle=static
5309 if test ! -f "$xxx"; then
5310 xxx=$thisdir/lib${thislib}_s$_a
5311 $test -f "$xxx" && eval $libscheck
5312 $test -f "$xxx" && libstyle=static
5313 $test -f "$xxx" && thislib=${thislib}_s
5315 if test ! -f "$xxx"; then
5316 xxx=$thisdir/Slib$thislib$_a
5317 $test -f "$xxx" && eval $libscheck
5318 $test -f "$xxx" && libstyle=static
5320 if $test -f "$xxx"; then
5322 shared) echo "Found -l$thislib (shared)." ;;
5323 static) echo "Found -l$thislib." ;;
5324 *) echo "Found -l$thislib ($libstyle)." ;;
5328 *) dflt="$dflt -l$thislib"
5329 libsfound="$libsfound $xxx"
5331 libsfiles="$libsfiles $yyy"
5332 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5333 case " $libsdirs " in
5335 *) libsdirs="$libsdirs $yyy" ;;
5342 if $test ! -f "$xxx"; then
5343 echo "No -l$thislib."
5354 ' '|'') dflt='none';;
5359 In order to compile $package on your machine, a number of libraries
5360 are usually needed. Include any other special libraries here as well.
5361 Say "none" for none. The default list is almost always right.
5365 rp="What libraries to use?"
5372 : determine optimization, if desired, or use for debug flag also
5374 ' '|$undef) dflt='none';;
5376 *) dflt="$optimize";;
5380 By default, $package compiles with the -O flag to use the optimizer.
5381 Alternately, you might want to use the symbolic debugger, which uses
5382 the -g flag (on traditional Unix systems). Either flag can be
5383 specified here. To use neither flag, specify the word "none".
5386 rp="What optimizer/debugger flag should be used?"
5390 'none') optimize=" ";;
5393 : Check what DEBUGGING is required from the command line
5394 : -DEBUGGING or -DDEBUGGING or
5395 : -DEBUGGING=both = -g + -DDEBUGGING
5396 : -DEBUGGING=-g or -Doptimize=-g = -g
5397 : -DEBUGGING=none or -UDEBUGGING =
5398 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5401 *) DEBUGGING=$EBUGGING ;;
5404 case "$DEBUGGING" in
5408 *) optimize="$optimize -g" ;;
5412 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5420 case "$DEBUGGING" in
5421 both|$define) dflt='-DDEBUGGING'
5424 : argument order is deliberate, as the flag will start with - which set could
5425 : think is an option
5426 checkccflag='check=$1; flag=$2; callback=$3;
5428 echo "Checking if your compiler accepts $flag" >&4;
5429 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5430 echo "int main(void) { return 0; }" > gcctest.c;
5431 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5432 echo "Yes, it does." >&4;
5433 if $test -s gcctest.out ; then
5434 echo "But your platform does not like it:";
5439 echo "Leaving current flags $ccflags alone." >&4
5441 *) dflt="$dflt $flag";
5447 echo "Nope, it does not, but that is ok." >&4;
5451 : We will not override a previous value, but we might want to
5452 : augment a hint file
5454 default|recommended)
5455 case "$gccversion" in
5456 1.*) dflt="$dflt -fpcc-struct-return" ;;
5458 case "$optimize:$DEBUGGING" in
5459 *-g*:old) dflt="$dflt -DDEBUGGING";;
5461 case "$gccversion" in
5462 2.*) if $test -d /etc/conf/kconfig.d &&
5463 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5465 # Interactive Systems (ISC) POSIX mode.
5470 case "$gccversion" in
5473 ?*) set strict-aliasing -fno-strict-aliasing
5477 # For gcc, adding -pipe speeds up compilations for some, but apparently
5478 # some assemblers can't read from stdin. (It also slows down compilations
5479 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5480 case "$gccversion" in
5486 # on x86_64 (at least) we require an extra library (libssp) in the
5487 # link command line. This library is not named, so I infer that it is
5488 # an implementation detail that may change. Hence the safest approach
5489 # is to add the flag to the flags passed to the compiler at link time,
5490 # as that way the compiler can do the right implementation dependant
5493 *-fno-stack-protector*)
5494 echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1
5496 *) case "$gccversion" in
5497 ?*) set stack-protector-strong -fstack-protector-strong
5500 *-fstack-protector-strong*) ;; # It got added.
5501 *) # Try the plain/older -fstack-protector.
5502 set stack-protector -fstack-protector
5512 case "$mips_type" in
5513 *BSD*|'') inclwanted="$locincpth $usrinc";;
5514 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5516 for thisincl in $inclwanted; do
5517 if $test -d $thisincl; then
5518 if $test x$thisincl != x$usrinc; then
5520 *" -I$thisincl "*);;
5521 *) dflt="$dflt -I$thisincl ";;
5527 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5529 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5537 *) dflt="$dflt -D$2";;
5541 set signal.h LANGUAGE_C; eval $inctest
5545 ccflags="$ccflags -DSOCKS"
5550 default|recommended) dflt="$ccflags $dflt" ;;
5551 *) dflt="$ccflags";;
5560 Your C compiler may want other flags. For this question you should include
5561 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5562 but you should NOT include libraries or ld flags like -lwhatever. If you
5563 want $package to honor its debug switch, you should include -DDEBUGGING here.
5564 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5566 To use no flags, specify the word "none".
5572 rp="Any additional cc flags?"
5579 : the following weeds options from ccflags that are of no interest to cpp
5581 '') cppflags="$ccflags" ;;
5582 *) set X $ccflags; shift
5583 case " $cppflags " in
5584 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5585 *) cppflags="$cppflags $ccflags" ;;
5589 case "$gccversion" in
5590 1.*) cppflags="$cppflags -D__GNUC__"
5592 case "$mips_type" in
5594 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5600 echo "Let me guess what the preprocessor flags are..." >&4
5614 *) ftry="$previous $flag";;
5616 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5617 >cpp1.out 2>/dev/null && \
5618 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5619 >cpp2.out 2>/dev/null && \
5620 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5621 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5623 cppflags="$cppflags $ftry"
5633 *-*) echo "They appear to be: $cppflags";;
5635 $rm -f cpp.c cpp?.out
5639 : flags used in final linking phase
5641 '') if ./venix; then
5647 *-posix*) dflt="$dflt -posix" ;;
5650 *) dflt="$ldflags";;
5652 # See note above about -fstack-protector
5654 *-fstack-protector-strong*)
5656 *-fstack-protector-strong*) ;; # Don't add it again
5657 *) dflt="$dflt -fstack-protector-strong" ;;
5660 *-fstack-protector*)
5662 *-fstack-protector*) ;; # Don't add it again
5663 *) dflt="$dflt -fstack-protector" ;;
5668 : Try to guess additional flags to pick up local libraries.
5669 for thislibdir in $libpth; do
5670 case " $loclibpth " in
5673 *"-L$thislibdir "*) ;;
5674 *) dflt="$dflt -L$thislibdir" ;;
5686 Your C linker may need flags. For this question you should
5687 include -L/whatever and any other flags used by the C linker, but you
5688 should NOT include libraries like -lwhatever.
5690 Make sure you include the appropriate -L/path flags if your C linker
5691 does not normally search all of the directories you specified above,
5694 To use no flags, specify the word "none".
5698 rp="Any additional ld flags (NOT including libraries)?"
5704 rmlist="$rmlist pdp11"
5708 echo "Checking your choice of C compiler and flags for coherency..." >&4
5709 $cat > try.c <<'EOF'
5711 int main() { printf("Ok\n"); return(0); }
5713 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5715 $cat >try.msg <<'EOM'
5716 I've tried to compile and run the following simple program:
5719 $cat try.c >> try.msg
5721 $cat >> try.msg <<EOM
5728 and I got the following output:
5732 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5733 if $sh -c "$run ./try " >>try.msg 2>&1; then
5737 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5740 echo "The program compiled OK, but exited with status $?." >>try.msg
5741 rp="You have a problem. Shall I abort Configure"
5745 echo "I can't compile the test program." >>try.msg
5746 rp="You have a BIG problem. Shall I abort Configure"
5752 case "$knowitall" in
5754 echo "(The supplied flags or libraries might be incorrect.)"
5762 *) echo "Ok. Stopping Configure." >&4
5767 n) echo "OK, that should do.";;
5769 $rm_try gcctest gcctest.out
5771 : define a shorthand compile call
5775 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5776 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4;
5780 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5781 : define a shorthand compile call for compilations that should be ok.
5785 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5787 : stub, used only to satisfy other units
5790 : check for lengths of integral types
5794 echo "Checking to see how big your integers are..." >&4
5804 printf("intsize=%d;\n", (int)sizeof(int));
5805 printf("longsize=%d;\n", (int)sizeof(long));
5806 printf("shortsize=%d;\n", (int)sizeof(short));
5811 if eval $compile_ok && $run ./try > /dev/null; then
5813 echo "Your integers are $intsize bytes long."
5814 echo "Your long integers are $longsize bytes long."
5815 echo "Your short integers are $shortsize bytes long."
5819 Help! I can't compile and run the intsize test program: please enlighten me!
5820 (This is probably a misconfiguration in your system or libraries, and
5821 you really ought to fix it. Still, I'll try anyway.)
5825 rp="What is the size of an integer (in bytes)?"
5829 rp="What is the size of a long integer (in bytes)?"
5833 rp="What is the size of a short integer (in bytes)?"
5841 : check for long long
5843 echo "Checking to see if you have long long..." >&4
5844 echo 'int main() { long long x = 7; return 0; }' > try.c
5846 if eval $compile; then
5848 echo "You have long long."
5851 echo "You do not have long long."
5857 : check for length of long long
5858 case "${d_longlong}${longlongsize}" in
5861 echo "Checking to see how big your long longs are..." >&4
5862 $cat >try.c <<'EOCP'
5866 printf("%d\n", (int)sizeof(long long));
5871 if eval $compile_ok; then
5872 longlongsize=`$run ./try`
5873 echo "Your long longs are $longlongsize bytes long."
5877 echo "(I can't seem to compile the test program. Guessing...)"
5878 rp="What is the size of a long long (in bytes)?"
5882 if $test "X$longsize" = "X$longlongsize"; then
5883 echo "(That isn't any different from an ordinary long.)"
5889 : determine filename position in cpp output
5891 echo "Computing filename position in cpp output for #include directives..." >&4
5893 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5898 vos) testaccess=-e ;;
5901 echo '#include <stdio.h>' > foo.c
5904 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5905 $grep '^[ ]*#.*stdio\.h' | \
5906 while read cline; do
5909 while $test \$# -gt 0; do
5910 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5915 pos=\`expr \$pos + 1\`
5929 *) pos="${fieldn}th";;
5931 echo "Your cpp writes the filename in the $pos field of the line."
5933 : locate header file
5938 for usrincdir in $incpth
5940 if test -f \$usrincdir/\$wanted; then
5941 echo "\$usrincdir/\$wanted"
5945 awkprg='{ print \$$fieldn }'
5946 echo "#include <\$wanted>" > foo\$\$.c
5947 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5948 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5949 while read cline; do
5950 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5952 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5953 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5958 # status = 0: grep returned 0 lines, case statement not executed
5959 # status = 1: headerfile found
5960 # status = 2: while loop executed, no headerfile found
5964 if test \$status -eq 1; then
5971 : define an alternate in-header-list? function
5972 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5973 cont=true; xxf="echo \"<\$1> found.\" >&4";
5974 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5975 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5977 case $# in 4) instead=instead;; *) instead="at last";; esac;
5978 while $test "$cont"; do
5980 var=$2; eval "was=\$$2";
5981 if $test "$xxx" && $test -r "$xxx";
5983 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5986 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5987 set $yyy; shift; shift; yyy=$@;
5988 case $# in 0) cont="";;
5989 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5990 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5991 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5992 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5996 do set $yyy; var=$2; eval "was=\$$2";
5997 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5998 set $yyy; shift; shift; yyy=$@;
6001 : see if inttypes.h is available
6002 : we want a real compile instead of Inhdr because some systems
6003 : have an inttypes.h which includes non-existent headers
6006 #include <inttypes.h>
6008 static int32_t foo32 = 0x12345678;
6012 if eval $compile; then
6013 echo "<inttypes.h> found." >&4
6016 echo "<inttypes.h> NOT found." >&4
6025 echo "Checking to see if you have int64_t..." >&4
6027 #include <sys/types.h>
6028 #$i_inttypes I_INTTYPES
6030 #include <inttypes.h>
6032 int main() { int64_t x = 7; }
6035 if eval $compile; then
6037 echo "You have int64_t."
6040 echo "You do not have int64_t."
6046 : Check if 64bit ints have a quad type
6048 echo "Checking which 64-bit integer type we could use..." >&4
6054 val='"unsigned int"'
6059 *) case "$longsize" in
6063 val='"unsigned long"'
6068 *) case "$d_longlong:$longlongsize" in
6073 val='"unsigned long long"'
6078 *) case "$d_int64_t" in
6097 '') echo "Alas, no 64-bit integer types in sight." >&4
6100 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6105 : Do we want 64bit support
6106 case "$uselonglong" in
6107 "$define"|true|[yY]*)
6110 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6112 use64bitint="$define"
6115 case "$use64bits" in
6116 "$define"|true|[yY]*)
6119 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6121 use64bitint="$define"
6124 case "$use64bitints" in
6125 "$define"|true|[yY]*)
6128 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6130 use64bitint="$define"
6133 case "$use64bitsint" in
6134 "$define"|true|[yY]*)
6137 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6139 use64bitint="$define"
6142 case "$uselonglongs" in
6143 "$define"|true|[yY]*)
6146 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6148 use64bitint="$define"
6151 case "$use64bitsall" in
6152 "$define"|true|[yY]*)
6155 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6157 use64bitall="$define"
6162 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6164 case "$use64bitall" in
6165 "$define"|true|[yY]*) use64bitint="$define" ;;
6171 You have natively 64-bit long integers.
6175 *) case "$use64bitint" in
6176 "$define"|true|[yY]*) dflt='y';;
6185 Perl can be built to take advantage of 64-bit integer types
6186 on some systems. To do so, Configure can be run with -Duse64bitint.
6187 Choosing this option will most probably introduce binary incompatibilities.
6189 If this doesn't make any sense to you, just accept the default '$dflt'.
6190 (The default has been chosen based on your configuration.)
6192 rp='Try to use 64-bit integers, if available?'
6195 [yY]*) val="$define" ;;
6203 case "$use64bitall" in
6204 "$define"|true|[yY]*) dflt='y' ;;
6205 *) case "$longsize" in
6213 You may also choose to try maximal 64-bitness. It means using as much
6214 64-bitness as possible on the platform. This in turn means even more
6215 binary incompatibilities. On the other hand, your platform may not
6216 have any more 64-bitness available than what you already have chosen.
6218 If this doesn't make any sense to you, just accept the default '$dflt'.
6219 (The default has been chosen based on your configuration.)
6221 rp='Try to use maximal 64-bit support, if available?'
6224 [yY]*) val="$define" ;;
6229 case "$use64bitall" in
6231 case "$use64bitint" in
6235 Since you have chosen a maximally 64-bit build, I'm also turning on
6236 the use of 64-bit integers.
6238 use64bitint="$define" ;;
6243 : Look for a hint-file generated 'call-back-unit'. If the
6244 : user has specified that a 64-bit perl is to be built,
6245 : we may need to set or change some other defaults.
6246 if $test -f use64bitint.cbu; then
6247 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6250 case "$use64bitint" in
6251 "$define"|true|[yY]*)
6252 : This test was common to all the OpenBSD forks, and seems harmless for
6255 echo "Checking if your C library has broken 64-bit functions..." >&4
6258 typedef $uquadtype myULL;
6265 {4294967303.15, 4294967303ULL},
6266 {4294967294.2, 4294967294ULL},
6267 {4294967295.7, 4294967295ULL},
6270 for (p = test; p->u; p++) {
6271 myULL x = (myULL)p->d;
6282 if eval $compile_ok; then
6283 libcquad=`$run ./try`
6284 echo "Your C library's 64-bit functions are $libcquad."
6286 echo "(I can't seem to compile the test program.)"
6287 echo "Assuming that your C library's 64-bit functions are ok."
6296 *** You have a C library with broken 64-bit functions.
6297 *** 64-bit support does not work reliably in this configuration.
6298 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6299 *** Cannot continue, aborting.
6306 4) case "$archname64" in
6307 '') archname64=64int ;;
6314 : Look for a hint-file generated 'call-back-unit'. If the
6315 : user has specified that a maximally 64-bit perl is to be built,
6316 : we may need to set or change some other defaults.
6317 if $test -f use64bitall.cbu; then
6318 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6321 case "$use64bitall" in
6322 "$define"|true|[yY]*)
6324 4) case "$archname64" in
6325 ''|64int) archname64=64all ;;
6332 case "$d_quad:$use64bitint" in
6336 *** You have chosen to use 64-bit integers,
6337 *** but none can be found.
6338 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6339 *** Cannot continue, aborting.
6346 : Check if we are using the GNU C library
6348 echo "Checking for GNU C Library..." >&4
6350 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6351 alone are insufficient to distinguish different versions, such as
6352 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6353 libc version 2.1.0. A. Dougherty, June 3, 2002.
6359 # ifdef __GLIBC_MINOR__
6360 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6361 # include <gnu/libc-version.h>
6362 printf("%s\n", gnu_get_libc_version());
6364 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6367 printf("%d\n", __GLIBC__);
6376 if eval $compile_ok && $run ./try > glibc.ver; then
6378 gnulibc_version=`$cat glibc.ver`
6379 echo "You are using the GNU C Library version $gnulibc_version"
6383 echo "You are not using the GNU C Library"
6389 : see if nm is to be used to determine whether a symbol is defined or not
6393 case "$d_gnulibc" in
6396 echo "nm probably won't work on the GNU C Library." >&4
6402 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6404 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6405 echo "'nm' won't be sufficient on this system." >&4
6411 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6412 if $test $dflt -gt 20; then
6422 true|$define) dflt=y;;
6429 I can use $nm to extract the symbols from your C libraries. This
6430 is a time consuming task which may generate huge output on the disk (up
6431 to 3 megabytes) but that should make the symbols extraction faster. The
6432 alternative is to skip the 'nm' extraction part and to compile a small
6433 test program instead to determine whether each symbol is present. If
6434 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6435 this may be the best solution.
6437 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6440 rp="Shall I use $nm to extract C symbols from the libraries?"
6443 [Nn]*) usenm=false;;
6452 : nm options which may be necessary
6454 '') if $test -f /mach_boot; then
6456 elif $test -d /usr/ccs/lib; then
6457 nm_opt='-p' # Solaris (and SunOS?)
6458 elif $test -f /dgux; then
6460 elif $test -f /lib64/rld; then
6461 nm_opt='-p' # 64-bit Irix
6467 : nm options which may be necessary for shared libraries but illegal
6468 : for archive libraries. Thank you, Linux.
6469 case "$nm_so_opt" in
6470 '') case "$myuname" in
6472 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6473 nm_so_opt='--dynamic'
6480 : Figure out where the libc is located
6483 : get list of predefined functions in a handy place
6488 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6494 *) for thislib in $libs; do
6497 : Handle C library specially below.
6500 thislib=`echo $thislib | $sed -e 's/^-l//'`
6501 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6503 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6505 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6507 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6509 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6511 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6513 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6518 libnames="$libnames $try"
6520 *) libnames="$libnames $thislib" ;;
6529 for xxx in $libpth; do
6530 $test -r $1 || set $xxx/libc.$so
6531 : The messy sed command sorts on library version numbers.
6533 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6534 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6536 s/[0-9][0-9]*/0000&/g
6537 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6540 $sort | $sed -e 's/^.* //'`
6543 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6544 $test -r $1 || set $sysroot/lib/libsys_s$_a
6550 if $test -r "$1"; then
6551 echo "Your (shared) C library seems to be in $1."
6553 elif $test -r /lib/libc && $test -r /lib/clib; then
6554 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6556 libc='/lib/clib /lib/libc'
6557 if $test -r /lib/syslib; then
6558 echo "(Your math library is in /lib/syslib.)"
6559 libc="$libc /lib/syslib"
6561 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6562 echo "Your C library seems to be in $libc, as you said before."
6563 elif $test -r $incpath/usr/lib/libc$_a; then
6564 libc=$incpath/usr/lib/libc$_a;
6565 echo "Your C library seems to be in $libc. That's fine."
6566 elif $test -r /lib/libc$_a; then
6568 echo "Your C library seems to be in $libc. You're normal."
6570 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6572 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6573 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6574 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6576 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6578 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6581 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6583 if $test -r "$tans"; then
6584 echo "Your C library seems to be in $tans, of all places."
6590 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6594 If the guess above is wrong (which it might be if you're using a strange
6595 compiler, or your machine supports multiple models), you can override it here.
6600 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6602 I can't seem to find your C library. I've looked in the following places:
6605 $sed 's/^/ /' libpath
6608 None of these seems to contain your C library. I need to get its name...
6613 rp='Where is your C library?'
6618 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6619 set X `cat libnames`
6622 case $# in 1) xxx=file; esac
6623 echo "Extracting names from the following $xxx for later perusal:" >&4
6625 $sed 's/^/ /' libnames >&4
6627 $echo $n "This may take a while...$c" >&4
6631 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6632 *) $nm $nm_opt $file 2>/dev/null;;
6637 $grep fprintf libc.tmp > libc.ptf
6638 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6639 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6641 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6645 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6649 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6653 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6666 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6670 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6674 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6678 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6682 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6690 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6694 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6699 $nm -p $* 2>/dev/null >libc.tmp
6700 $grep fprintf libc.tmp > libc.ptf
6701 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6702 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6708 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6710 if $ar t $libc > libc.tmp && \
6711 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6713 for thisname in $libnames $libc; do
6714 $ar t $thisname >>libc.tmp
6716 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6718 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6719 for thisname in $libnames $libc; do
6720 $ar tv $thisname >>libc.tmp
6721 emximp -o tmp.imp $thisname \
6723 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6724 < tmp.imp >>libc.tmp
6727 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6730 echo "$ar didn't seem to work right." >&4
6731 echo "Maybe this is a Cray...trying bld instead..." >&4
6733 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6736 for thisname in $libnames; do
6738 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6739 $ar t $thisname >>libc.tmp
6743 echo "That didn't work either. Giving up." >&4
6753 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6754 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6756 *) if $test -f /lib/syscalls.exp; then
6758 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6759 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6760 /lib/syscalls.exp >>libc.list
6766 $rm -f libnames libpath
6768 : Check if we are using C++
6770 echo "Checking for C++..." >&4
6771 $cat >try.c <<'EOCP'
6783 if eval $compile_ok && $run ./try; then
6785 echo "You are using a C++ compiler."
6788 echo "You are not using a C++ compiler."
6794 : is a C symbol defined?
6797 -v) tf=libc.tmp; tdc="";;
6798 -a) tf=libc.tmp; tdc="[]";;
6799 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6801 case "$d_cplusplus" in
6802 $define) extern_C="extern \"C\"" ;;
6803 *) extern_C="extern" ;;
6806 case "$reuseval-$4" in
6808 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6813 if $test "$runnm" = true; then
6814 if $contains $tlook $tf >/dev/null 2>&1; then
6816 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6817 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6818 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6819 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6823 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6824 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6830 $define) tval=true;;
6837 : define an is-in-libc? function
6838 inlibc='echo " "; td=$define; tu=$undef;
6839 sym=$1; var=$2; eval "was=\$$2";
6841 case "$reuseval$was" in
6851 echo "$sym() found." >&4;
6852 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6854 echo "$sym() NOT found." >&4;
6855 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6859 $define) echo "$sym() found." >&4;;
6860 *) echo "$sym() NOT found." >&4;;
6864 : check for length of double
6866 case "$doublesize" in
6868 echo "Checking to see how big your double precision numbers are..." >&4
6878 printf("%d\n", (int)sizeof(double));
6883 if eval $compile_ok; then
6884 doublesize=`$run ./try`
6885 echo "Your double is $doublesize bytes long."
6888 echo "(I can't seem to compile the test program. Guessing...)"
6889 rp="What is the size of a double precision number (in bytes)?"
6897 : check for long doubles
6899 echo "Checking to see if you have long double..." >&4
6900 echo 'int main() { long double x = 7.0; }' > try.c
6902 if eval $compile; then
6904 echo "You have long double." >&4
6907 echo "You do not have long double." >&4
6913 : see if ldexpl exists
6917 : check for length of long double
6918 case "${d_longdbl}${longdblsize}" in
6921 echo "Checking to see how big your long doubles are..." >&4
6922 $cat >try.c <<'EOCP'
6926 printf("%d\n", sizeof(long double));
6931 if eval $compile; then
6932 longdblsize=`$run ./try`
6933 echo "Your long doubles are $longdblsize bytes long." >&4
6937 echo "(I can't seem to compile the test program. Guessing...)" >&4
6938 rp="What is the size of a long double (in bytes)?"
6942 if $test "X$doublesize" = "X$longdblsize"; then
6943 echo "That isn't any different from an ordinary double." >&4
6944 echo "I'll keep your setting anyway, but you may see some" >&4
6945 echo "harmless compilation warnings." >&4
6951 $echo "Checking the kind of long doubles you have..." >&4
6952 case "$d_longdbl" in
6956 #define LONGDBLSIZE $longdblsize
6957 #define DOUBLESIZE $doublesize
6963 static const long double d = -0.1L;
6965 unsigned const char* b = (unsigned const char*)(&d);
6966 #if DOUBLESIZE == LONGDBLSIZE
6967 printf("0\n"); /* if it floats like double */
6970 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6971 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6972 /* IEEE 754 128-bit little-endian */
6976 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6977 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6982 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6983 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6984 * cannot be trusted. */
6985 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6986 if (b[0] == 0xCD && b[9] == 0xBF) {
6987 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6988 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6989 * Also known as "extended precision". */
6993 if (b[0] == 0xBF && b[9] == 0xCD) {
6994 /* Is there ever big-endian 80-bit, really?
6996 * The Motorola 68881 had another "extended precision" format:
6997 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6998 * for total of 96 bits of bytes. The zero bits were unused.
6999 * See "M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL" for more details.
7000 * If it ever becomes relevant, this format should be allocated a
7001 * new doublekind code since it is quite different from the Intel x87.
7007 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7008 /* software "double double", the 106 is 53+53.
7009 * but irix thinks it is 107. */
7010 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7011 /* double double 128-bit fully little-endian,
7012 * little-endian doubles in little-endian order,
7013 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7017 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7018 /* double double 128-bit fully big-endian,
7019 * big-endian doubles in big-endian order,
7020 * e.g. PPC/Power and MIPS:
7021 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7025 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7026 /* double double 128-bit mixed endian.
7027 * little-endian doubles in big-endian order,
7029 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7033 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7034 /* double double 128-bit mixed endian,
7035 * big-endian doubles in little-endian order,
7036 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7041 /* We are largely making this up because it may well be
7042 * that the VAX format H was never made available to C,
7043 * only to Fortran. */
7044 #if LONGDBLSIZE == 16 && defined(__vax__)
7045 if (b[0] == 0xFD && b[15] == 0x99) {
7046 /* VAX format H, PDP-11 mixed endian. */
7051 printf("-1\n"); /* unknown */
7056 if eval $compile; then
7057 longdblkind=`$run ./try`
7064 case "$longdblkind" in
7065 0) echo "Your long doubles are doubles." >&4 ;;
7066 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7067 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7068 3) echo "You have x86 80-bit little endian long doubles." >&4 ;;
7069 4) echo "You have x86 80-bit big endian long doubles." >&4 ;;
7070 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >&4 ;;
7071 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >&4 ;;
7072 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >&4 ;;
7073 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >&4 ;;
7074 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >&4 ;;
7075 *) echo "Cannot figure out your long double." >&4 ;;
7077 d_long_double_style_ieee=$undef
7078 d_long_double_style_ieee_std=$undef
7079 d_long_double_style_ieee_extended=$undef
7080 d_long_double_style_ieee_doubledouble=$undef
7081 d_long_double_style_vax=$undef
7082 case "$longdblkind" in
7083 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7085 case "$longdblkind" in
7086 1|2) d_long_double_style_ieee_std=$define ;;
7088 case "$longdblkind" in
7089 3|4) d_long_double_style_ieee_extended=$define ;;
7091 case "$longdblkind" in
7092 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7094 case "$longdblkind" in
7095 9) d_long_double_style_vax=$define ;;
7099 : get the patchlevel
7101 echo "Getting the current patchlevel..." >&4
7102 if $test -r $rsrc/patchlevel.h;then
7103 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
7104 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
7105 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7106 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
7107 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
7108 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7109 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
7118 $echo "(You do not have patchlevel.h. Eek.)"
7120 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
7121 version_patchlevel_string="version $patchlevel subversion $subversion"
7122 case "$perl_patchlevel" in
7124 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
7125 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
7129 $echo "(You have $package $version_patchlevel_string.)"
7133 : XXX Should be a Configure test for double-dots in filenames.
7134 version=`echo $revision $patchlevel $subversion | \
7135 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7136 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7137 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7140 version=`echo $revision $patchlevel $subversion | \
7141 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7142 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7143 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7146 : Special case the 5.005_xx maintenance series, which used 5.005
7147 : without any subversion label as a subdirectory in $sitelib
7148 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
7149 api_versionstring='5.005'
7152 : determine the architecture name
7154 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7155 tarch=`arch`"-$osname"
7156 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7157 if uname -m > tmparch 2>&1 ; then
7158 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7159 -e 's/$/'"-$osname/" tmparch`
7167 case "$myarchname" in
7170 echo "(Your architecture name used to be $myarchname.)"
7174 case "$targetarch" in
7176 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7181 *) dflt="$archname";;
7183 rp='What is your architecture name'
7187 : optionally add API version to the architecture for versioned archlibs
7188 case "$useversionedarchname" in
7189 $define|true|[yY]*) dflt='y';;
7192 rp='Add the Perl API version to your archname?'
7195 y|Y) useversionedarchname="$define" ;;
7196 *) useversionedarchname="$undef" ;;
7198 case "$useversionedarchname" in
7201 *-$api_versionstring)
7202 echo "...and architecture name already has -$api_versionstring" >&4
7205 archname="$archname-$api_versionstring"
7206 echo "...setting architecture name to $archname." >&4
7212 case "$usethreads" in
7214 echo "Threads selected." >&4
7216 *-thread*) echo "...and architecture name already has -thread." >&4
7218 *) archname="$archname-thread"
7219 echo "...setting architecture name to $archname." >&4
7224 case "$usemultiplicity" in
7226 echo "Multiplicity selected." >&4
7228 *-multi*) echo "...and architecture name already has -multi." >&4
7230 *) archname="$archname-multi"
7231 echo "...setting architecture name to $archname." >&4
7236 case "$use64bitint$use64bitall" in
7238 case "$archname64" in
7240 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7243 case "$use64bitint" in
7244 "$define") echo "64 bit integers selected." >&4 ;;
7246 case "$use64bitall" in
7247 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7250 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7252 *) archname="$archname-$archname64"
7253 echo "...setting architecture name to $archname." >&4
7259 case "$uselongdouble" in
7261 echo "Long doubles selected." >&4
7262 case "$longdblsize" in
7264 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7268 *-ld*) echo "...and architecture name already has -ld." >&4
7270 *) archname="$archname-ld"
7271 echo "...setting architecture name to $archname." >&4
7278 case "$usequadmath" in
7280 echo "quadmath selected." >&4
7282 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7284 *) archname="$archname-quadmath"
7285 echo "...setting architecture name to $archname." >&4
7290 if $test -f archname.cbu; then
7291 echo "Your platform has some specific hints for architecture name, using them..."
7295 : set the prefixit variable, to compute a suitable default value
7296 prefixit='case "$3" in
7298 case "$oldprefix" in
7299 "") eval "$1=\"\$$2\"";;
7306 ""|" "|none) eval "$1=\"\$$2\"";;
7312 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7314 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7315 /*-$oldprefix/*|\~*-$oldprefix/*)
7316 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7317 *) eval "$1=\"\$$2\"";;
7321 : determine installation style
7322 : For now, try to deduce it from prefix unless it is already set.
7323 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7324 case "$installstyle" in
7325 '') case "$prefix" in
7326 *perl*) dflt='lib';;
7327 *) dflt='lib/perl5' ;;
7330 *) dflt="$installstyle" ;;
7332 : Probably not worth prompting for this since we prompt for all
7333 : the directories individually, and the prompt would be too long and
7337 : determine where public executables go
7342 rp='Pathname where the public executables will reside?'
7344 if $test "X$ansexp" != "X$binexp"; then
7348 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7349 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7350 : this via initialinstalllocation
7353 case "$userelocatableinc" in
7354 $define|true|[yY]*) dflt='y' ;;
7359 Would you like to build Perl so that the installation is relocatable, so that
7360 library paths in @INC are determined relative to the path of the perl binary?
7361 This is not advised for system Perl installs, or if you need to run setid
7362 scripts or scripts under taint mode.
7364 If this doesn't make any sense to you, just accept the default '$dflt'.
7366 rp='Use relocatable @INC?'
7369 y|Y) val="$define" ;;
7372 set userelocatableinc
7375 initialinstalllocation="$binexp"
7376 : Default prefix is now "up one level from where the binaries are"
7377 case "$userelocatableinc" in
7383 installprefixexp=".../.."
7387 : determine where private library files go
7388 : Usual default is /usr/local/lib/perl5/$version.
7389 : Also allow things like /opt/perl/lib/$version, since
7390 : /opt/perl/lib/perl5... would be redundant.
7391 : The default "style" setting is made in installstyle.U
7392 case "$installstyle" in
7393 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7394 *) set dflt privlib lib/$version ;;
7399 There are some auxiliary files for $package that need to be put into a
7400 private library directory that is accessible by everyone.
7405 rp='Pathname where the private library files will reside?'
7410 : set the prefixup variable, to restore leading tilda escape
7411 prefixup='case "$prefixexp" in
7413 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7416 : determine where public architecture dependent libraries go
7419 : privlib default is /usr/local/lib/$package/$version
7420 : archlib default is /usr/local/lib/$package/$version/$archname
7421 : privlib may have an optional trailing /share.
7422 tdflt=`echo $privlib | $sed 's,/share$,,'`
7423 tdflt=$tdflt/$archname
7432 $spackage contains architecture-dependent library files. If you are
7433 sharing libraries in a heterogeneous environment, you might store
7434 these files in a separate location. Otherwise, you can just include
7435 them with the rest of the public library files.
7440 rp='Where do you want to put the public architecture-dependent libraries?'
7444 if $test X"$archlib" = X"$privlib"; then
7450 : see if setuid scripts can be secure
7453 Some kernels have a bug that prevents setuid #! scripts from being
7454 secure. Some sites have disabled setuid #! scripts because of this.
7456 First let's decide if your kernel supports secure setuid #! scripts.
7457 (If setuid #! scripts would be secure but have been disabled anyway,
7458 don't say that they are secure if asked.)
7463 if $test -d /dev/fd; then
7464 echo "#!$ls" >reflect
7465 chmod +x,u+s reflect
7466 ./reflect >flect 2>&1
7467 if $contains "/dev/fd" flect >/dev/null; then
7468 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7472 If you are not sure if they are secure, I can check but I'll need a
7473 username and password different from the one you are using right now.
7474 If you don't have such a username or don't want me to test, simply
7478 rp='Other username to test security of setuid scripts with?'
7483 case "$d_suidsafe" in
7484 '') echo "I'll assume setuid scripts are *not* secure." >&4
7487 echo "Well, the $hint value is *not* secure." >&4
7489 *) echo "Well, the $hint value *is* secure." >&4
7494 $rm -f reflect flect
7495 echo "#!$ls" >reflect
7496 chmod +x,u+s reflect
7499 echo '"su" will (probably) prompt you for '"$ans's password."
7500 su $ans -c './reflect >flect'
7501 if $contains "/dev/fd" flect >/dev/null; then
7502 echo "Okay, it looks like setuid scripts are secure." >&4
7505 echo "I don't think setuid scripts are secure." >&4
7510 rp='Does your kernel have *secure* setuid scripts?'
7513 [yY]*) val="$define";;
7518 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7519 echo "(That's for file descriptors, not floppy disks.)"
7525 $rm -f reflect flect
7527 : now see if they want to do setuid emulation
7528 if $test $patchlevel -lt 11; then
7531 case "$d_suidsafe" in
7534 echo "No need to emulate SUID scripts since they are secure here." >&4
7538 Some systems have disabled setuid scripts, especially systems where
7539 setuid scripts cannot be secure. On systems where setuid scripts have
7540 been disabled, the setuid/setgid bits on scripts are currently
7541 useless. It is possible for $package to detect those bits and emulate
7542 setuid/setgid in a secure fashion. This emulation will only work if
7543 setuid scripts have been disabled in your kernel.
7547 "$define") dflt=y ;;
7550 rp="Do you want to do setuid/setgid emulation?"
7553 [yY]*) val="$define";;
7565 SUID emulation has been removed for 5.12
7566 Please re-run Configure without -Dd_dosuid
7575 : Find perl5.005 or later.
7576 echo "Looking for a previously installed perl5.005 or later... "
7578 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7579 : Check if this perl is recent and can load a simple module
7580 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7583 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7593 '') echo "None found. That's ok.";;
7594 *) echo "Using $perl5." ;;
7597 : Set the siteprefix variables
7600 After $package is installed, you may wish to install various
7601 add-on modules and utilities. Typically, these add-ons will
7602 be installed under $prefix with the rest
7603 of this package. However, you may wish to install such add-ons
7604 elsewhere under a different prefix.
7606 If you do not wish to put everything under a single prefix, that's
7607 ok. You will be prompted for the individual locations; this siteprefix
7608 is only used to suggest the defaults.
7610 The default should be fine for most people.
7614 rp='Installation prefix to use for add-on modules and utilities?'
7615 : XXX Here might be another good place for an installstyle setting.
7616 case "$siteprefix" in
7618 *) dflt=$siteprefix ;;
7621 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7623 case "$siteprefix" in
7627 *) oldsiteprefix="$prefix";;
7632 siteprefixexp="$ansexp"
7634 : determine where site specific libraries go.
7635 : Usual default is /usr/local/lib/perl5/site_perl/$version
7636 : The default "style" setting is made in installstyle.U
7637 : XXX No longer works with Prefixit stuff.
7638 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7640 '') case "$installstyle" in
7641 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7642 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7650 The installation process will create a directory for
7651 site-specific extensions and modules. Most users find it convenient
7652 to place all site-specific files in this directory rather than in the
7653 main distribution directory.
7657 rp='Pathname for the site-specific library files?'
7661 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7663 : Determine list of previous versions to include in @INC
7664 $cat > getverlist <<EOPL
7669 my \$api_versionstring = "$api_versionstring";
7670 my \$version = "$version";
7671 my \$stem = "$sitelib_stem";
7672 my \$archname = "$archname";
7674 $cat >> getverlist <<'EOPL'
7675 # The list found is stored twice for each entry: the original name, and
7676 # the binary broken down version into pack "s>s>s>", so sorting is easy
7677 # and unambiguous. This will work for all versions that have a maximum
7678 # of three digit per group separate by '.'s or '_'s. Names are extended
7679 # with ".0.0" to ensure at least three elements for the pack.
7680 # -- H.Merijn Brand (m)'06 23-10-2006
7682 my @inc_version_list;
7684 # XXX Redo to do opendir/readdir?
7687 ;@candidates = map {
7688 [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*");
7689 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7695 my ($pversion, $aversion, $vsn5005) = map {
7696 pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7697 foreach my $d (@candidates) {
7698 if ($d->[1] lt $pversion) {
7699 if ($d->[1] ge $aversion) {
7700 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7702 elsif ($d->[1] ge $vsn5005) {
7703 unshift(@inc_version_list, grep { -d } $d->[0]);
7707 # Skip newer version. I.e. don't look in
7708 # 5.7.0 if we're installing 5.6.1.
7712 if (@inc_version_list) {
7713 print join(' ', @inc_version_list);
7716 # Blank space to preserve value for next Configure run.
7721 case "$inc_version_list" in
7722 '') if test -x "$perl5$exe_ext"; then
7723 dflt=`$perl5 getverlist`
7728 $undef) dflt='none' ;;
7729 *) eval dflt=\"$inc_version_list\" ;;
7732 ''|' ') dflt=none ;;
7739 In order to ease the process of upgrading, this version of perl
7740 can be configured to use modules built and installed with earlier
7741 versions of perl that were installed under $prefix. Specify here
7742 the list of earlier versions that this version of perl should check.
7743 If Configure detected no earlier versions of perl installed under
7744 $prefix, then the list will be empty. Answer 'none' to tell perl
7745 to not search earlier versions.
7747 The default should almost always be sensible, so if you're not sure,
7748 just accept the default.
7751 rp='List of earlier versions to include in @INC?'
7754 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7755 *) inc_version_list="$ans" ;;
7757 case "$inc_version_list" in
7759 inc_version_list_init='0'
7760 d_inc_version_list="$undef"
7762 *) inc_version_list_init=`echo $inc_version_list |
7763 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7764 d_inc_version_list="$define"
7769 : see if malloc/malloc.h has to be included
7770 set malloc/malloc.h i_mallocmalloc
7773 : see if this is a malloc.h system
7774 : we want a real compile instead of Inhdr because some systems have a
7775 : malloc.h that just gives a compile error saying to use stdlib.h instead
7780 #$i_mallocmalloc I_MALLOCMALLOC
7781 #ifdef I_MALLOCMALLOC
7782 # include <malloc/malloc.h>
7785 int main () { return 0; }
7788 if eval $compile; then
7789 echo "<malloc.h> found." >&4
7792 echo "<malloc.h> NOT found." >&4
7799 : check for length of pointer
7803 echo "Checking to see how big your pointers are..." >&4
7812 printf("%d\n", (int)sizeof(void *));
7817 if eval $compile_ok; then
7818 ptrsize=`$run ./try`
7819 echo "Your pointers are $ptrsize bytes long."
7822 echo "(I can't seem to compile the test program. Guessing...)" >&4
7823 rp="What is the size of a pointer (in bytes)?"
7830 case "$use64bitall" in
7831 "$define"|true|[yY]*)
7835 *** You have chosen a maximally 64-bit build,
7836 *** but your pointers are only 4 bytes wide.
7837 *** Please rerun Configure without -Duse64bitall.
7842 *** Since you have quads, you could possibly try with -Duse64bitint.
7847 *** Cannot continue, aborting.
7857 : determine whether to use malloc wrapping
7859 case "$usemallocwrap" in
7860 [yY]*|true|$define) dflt='y' ;;
7861 [nN]*|false|$undef) dflt='n' ;;
7862 *) case "$usedevel" in
7863 [yY]*|true|$define) dflt='y' ;;
7868 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7870 usemallocwrap="$ans"
7873 usemallocwrap="$define" ;;
7875 usemallocwrap="$undef" ;;
7878 : determine which malloc to compile in
7880 case "$usemymalloc" in
7881 [yY]*|true|$define) dflt='y' ;;
7882 [nN]*|false|$undef) dflt='n' ;;
7883 *) case "$ptrsize" in
7887 if test "$useithreads" = "$define"; then dflt='n'; fi
7890 rp="Do you wish to attempt to use the malloc that comes with $package?"
7896 mallocsrc='malloc.c'
7897 mallocobj="malloc$_o"
7898 d_mymalloc="$define"
7901 : Remove malloc from list of libraries to use
7902 echo "Removing unneeded -lmalloc from library list" >&4
7903 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7906 echo "libs = $libs" >&4
7918 : compute the return types of malloc and free
7920 case "$malloctype" in
7925 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7932 echo "Your system uses $freetype free(), it would seem." >&4
7934 : determine where site specific architecture-dependent libraries go.
7935 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7936 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7937 : sitelib may have an optional trailing /share.
7939 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7940 dflt="$dflt/$archname"
7945 set sitearch sitearch none
7949 The installation process will also create a directory for
7950 architecture-dependent site-specific extensions and modules.
7954 rp='Pathname for the site-specific architecture-dependent library files?'
7958 if $test X"$sitearch" = X"$sitelib"; then
7961 d_sitearch="$define"
7964 : Set the vendorprefix variables
7967 The installation process will also create a directory for
7968 vendor-supplied add-ons. Vendors who supply perl with their system
7969 may find it convenient to place all vendor-supplied files in this
7970 directory rather than in the main distribution directory. This will
7971 ease upgrades between binary-compatible maintenance versions of perl.
7973 Of course you may also use these directories in whatever way you see
7974 fit. For example, you might use them to access modules shared over a
7975 company-wide network.
7977 The default answer should be fine for most people.
7978 This causes further questions about vendor add-ons to be skipped
7979 and no vendor-specific directories will be configured for perl.
7982 rp='Do you want to configure vendor-specific add-on directories?'
7983 case "$usevendorprefix" in
7984 define|true|[yY]*) dflt=y ;;
7985 *) : User may have set vendorprefix directly on Configure command line.
7986 case "$vendorprefix" in
7995 rp='Installation prefix to use for vendor-supplied add-ons?'
7996 case "$vendorprefix" in
7997 '') dflt="$prefix" ;;
7998 *) dflt=$vendorprefix ;;
8001 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
8003 case "$vendorprefix" in
8007 *) oldvendorprefix="$prefix";;
8011 usevendorprefix="$define"
8013 vendorprefixexp="$ansexp"
8015 *) usevendorprefix="$undef"
8021 : Set the vendorlib variables
8022 case "$vendorprefix" in
8023 '') d_vendorlib="$undef"
8027 *) d_vendorlib="$define"
8028 : determine where vendor-supplied modules go.
8029 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8030 case "$vendorlib" in
8032 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8033 case "$installstyle" in
8034 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8035 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8038 *) dflt="$vendorlib"
8042 rp='Pathname for the vendor-supplied library files?'
8045 vendorlibexp="$ansexp"
8048 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8052 : Set the vendorarch variables
8053 case "$vendorprefix" in
8054 '') d_vendorarch="$undef"
8058 *) d_vendorarch="$define"
8059 : determine where vendor-supplied architecture-dependent libraries go.
8060 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8061 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8062 : vendorlib may have an optional trailing /share.
8063 case "$vendorarch" in
8064 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8065 dflt="$dflt/$archname"
8067 *) dflt="$vendorarch" ;;
8070 rp='Pathname for vendor-supplied architecture-dependent files?'
8073 vendorarchexp="$ansexp"
8076 prefixvar=vendorarch
8078 if $test X"$vendorarch" = X"$vendorlib"; then
8079 d_vendorarch="$undef"
8081 d_vendorarch="$define"
8084 : Final catch-all directories to search
8087 Lastly, you can have perl look in other directories for extensions and
8088 modules in addition to those already specified.
8089 These directories will be searched after
8093 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8094 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8096 case "$otherlibdirs" in
8097 ''|' ') dflt='none' ;;
8098 *) dflt="$otherlibdirs" ;;
8101 Enter a colon-separated set of extra paths to include in perl's @INC
8102 search path, or enter 'none' for no extra paths.
8106 rp='Colon-separated list of additional directories for perl to search?'
8109 ' '|''|none) otherlibdirs=' ' ;;
8110 *) otherlibdirs="$ans" ;;
8112 case "$otherlibdirs" in
8116 set d_perl_otherlibdirs
8120 dflt_dtrace='/usr/sbin/dtrace'
8121 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8125 Perl can be built to support DTrace on platforms that support it.
8126 DTrace is a diagnosis and performance analysis tool from Sun.
8128 If this doesn't make any sense to you, just accept the default.
8132 case "$usedtrace" in
8142 dflt_dtrace=$usedtrace
8149 rp='Support DTrace if available?'
8152 y|Y) val="$define" ;;
8158 test "X$usedtrace" != "X$define" && break
8161 rp='Where is the dtrace executable?'
8170 if $dtrace -h -s ../perldtrace.d \
8171 -o perldtrace.tmp >/dev/null 2>&1 \
8172 && rm -f perldtrace.tmp
8175 echo "Good: your $dtrace knows about the -h flag."
8179 *** $me: Fatal Error: $dtrace doesn't support -h flag
8181 *** Your installed dtrace doesn't support the -h switch to compile a D
8182 *** program into a C header. Can't continue.
8194 *** $me: Fatal Error: $dtrace not found.
8201 echo "*** $dtrace was not found."
8207 : See if we want extra modules installed
8214 Perl can be built with extra modules or bundles of modules which
8215 will be fetched from the CPAN and installed alongside Perl.
8217 Notice that you will need access to the CPAN; either via the Internet,
8218 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8219 be asked later to configure the CPAN.pm module which will in turn do
8220 the installation of the rest of the extra modules or bundles.)
8222 Notice also that if the modules require any external software such as
8223 libraries and headers (the libz library and the zlib.h header for the
8224 Compress::Zlib module, for example) you MUST have any such software
8225 already installed, this configuration process will NOT install such
8228 If this doesn't make any sense to you, just accept the default '$dflt'.
8230 rp='Install any extra modules (y or n)?'
8236 Please list any extra modules or bundles to be installed from CPAN,
8237 with spaces between the names. The names can be in any format the
8238 'install' command of CPAN.pm will understand. (Answer 'none',
8239 without the quotes, to install no extra modules or bundles.)
8249 $rm -f ../extras.lst
8251 *) echo "(Saving the list of extras for later...)"
8252 echo "$extras" > ../extras.lst
8260 : determine where html pages for programs go
8261 set html1dir html1dir none
8265 If you wish to install html files for programs in $spackage, indicate
8266 the appropriate directory here. To skip installing html files,
8270 ''|none|$undef|' ') dflt=none ;;
8271 *) dflt=$html1dir ;;
8274 rp="Directory for the main $spackage html pages?"
8278 : Use ' ' for none so value is preserved next time through Configure
8279 $test X"$html1dir" = "X" && html1dir=' '
8281 : determine where html pages for libraries and modules go
8282 set html3dir html3dir none
8286 If you wish to install html files for modules associated with $spackage,
8287 indicate the appropriate directory here. To skip installing html files,
8290 : There is no obvious default. If they have specified html1dir, then
8291 : try to key off that, possibly changing .../html1 into .../html3.
8293 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8294 *) dflt=$html3dir ;;
8297 rp="Directory for the $spackage module html pages?"
8301 : Use ' ' for none so value is preserved next time through Configure
8302 $test X"$html3dir" = "X" && html3dir=' '
8304 : determine whether to install perl also as /usr/bin/perl
8307 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8309 Many scripts expect perl to be installed as /usr/bin/perl.
8311 If you want to, I can install the perl you are about to compile
8312 as /usr/bin/perl (in addition to $bin/perl).
8314 if test -f /usr/bin/perl; then
8317 However, please note that because you already have a /usr/bin/perl,
8318 overwriting that with a new Perl would very probably cause problems.
8319 Therefore I'm assuming you don't want to do that (unless you insist).
8322 case "$installusrbinperl" in
8323 "$define"|[yY]*) dflt='y';;
8329 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8332 case "$installusrbinperl" in
8333 "$undef"|[nN]*) dflt='n';;
8337 rp="Do you want to install perl as /usr/bin/perl?"
8340 [yY]*) val="$define";;
8346 set installusrbinperl
8349 : see if dlopen exists
8351 xxx_ccflags="$ccflags"
8353 : with g++ one needs -shared to get is-in-libc to work for dlopen
8354 case "$gccversion" in
8357 *) case "$d_cplusplus" in
8358 "$define") ccflags="$ccflags -shared" ;;
8365 ccflags="$xxx_ccflags"
8367 : see if this is a unistd.h system
8368 set unistd.h i_unistd
8371 : determine which dynamic loading, if any, to compile in
8373 dldir="ext/DynaLoader"
8386 $define) dflt='y' ;;
8388 : Does a dl_xxx.xs file exist for this operating system
8389 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8392 rp="Do you wish to use dynamic loading?"
8399 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8400 dflt="$dldir/dl_${osname}.xs"
8401 elif $test "$d_dlopen" = "$define" ; then
8402 dflt="$dldir/dl_dlopen.xs"
8407 *) dflt="$dldir/$dlsrc"
8410 echo "The following dynamic loading files are available:"
8411 : Can not go over to $dldir because getfile has path hard-coded in.
8412 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8413 rp="Source file to use for dynamic loading"
8419 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8423 Some systems may require passing special flags to $cc -c to
8424 compile modules that will be used to create a shared library.
8425 To use no flags, say "none".
8428 case "$cccdlflags" in
8429 '') case "$gccversion" in
8430 '') case "$osname" in
8432 irix*) dflt='-KPIC' ;;
8433 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8434 sunos) dflt='-pic' ;;
8438 *) case "$osname" in
8439 darwin) dflt='none' ;;
8440 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8445 *) dflt="$cccdlflags" ;;
8452 # If -Dsysroot was specified, now's the time to add it
8454 if test "X$sysroot" != X; then
8455 case "$gccversion" in
8460 dflt="$dflt --sysroot=$sysroot" ;;
8470 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8473 none) cccdlflags=' ' ;;
8474 *) cccdlflags="$ans" ;;
8479 Some systems use ld to create libraries that can be dynamically loaded,
8480 while other systems (such as those using ELF) use $cc.
8484 : Determine if this is ELF
8486 /* Test for whether ELF binaries are produced */
8498 int i = open("a.out",O_RDONLY);
8501 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8502 exit(0); /* succeed (yes, it is ELF) */
8506 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8512 '') if $test $bin_ELF = "$define"; then
8514 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8518 echo "I'll use ld to build dynamic libraries."
8526 rp="What command should be used to create dynamic libraries?"
8532 Some systems may require passing special flags to $ld to create a
8533 library that can be dynamically loaded. If your ld flags include
8534 -L/other/path options to locate libraries outside your loader's normal
8535 search path, you may need to specify those -L options here as well. To
8536 use no flags, say "none".
8539 case "$lddlflags" in
8540 '') case "$osname" in
8541 haiku) dflt='-shared' ;;
8543 case "$gccversion" in
8544 '') dflt="$dflt +vnocompatwarnings" ;;
8547 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8548 solaris) # See [perl #66604].
8549 # On Solaris 11, gcc -m64 on amd64
8550 # appears not to understand -G. gcc versions at
8551 # least as old as 3.4.3 support -shared, so just
8552 # use that with Solaris 11 and later, but keep
8553 # the old behavior for older Solaris versions.
8554 case "$gccversion" in
8556 *) case "$osvers" in
8557 2.?|2.10) dflt='-G' ;;
8558 *) dflt='-shared' ;;
8563 sunos) dflt='-assert nodefinitions' ;;
8564 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8568 *) dflt="$lddlflags" ;;
8571 : Only do this for gcc, since, for example, qcc has no concept
8573 if $test "X$sysroot" != X; then
8574 case "$gccversion" in
8576 *) dflt="$dflt --sysroot=$sysroot" ;;
8580 : Try to guess additional flags to pick up local libraries.
8581 : Be careful not to append to a plain 'none'
8585 for thisflag in $ldflags; do
8590 *) dflt="$dflt $thisflag" ;;
8597 ''|' ') dflt='none' ;;
8601 *-fstack-protector-strong*)
8603 *-fstack-protector-strong*) ;; # Don't add it again
8604 *) dflt="$dflt -fstack-protector-strong" ;;
8607 *-fstack-protector*)
8609 *-fstack-protector*) ;; # Don't add it again
8610 *) dflt="$dflt -fstack-protector" ;;
8615 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8618 none) lddlflags=' ' ;;
8619 *) lddlflags="$ans" ;;
8624 Some systems may require passing special flags to $cc to indicate that
8625 the resulting executable will use dynamic linking. To use no flags,
8629 case "$ccdlflags" in
8630 '') case "$osname" in
8631 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8632 sunos) dflt='none' ;;
8636 *) dflt="$ccdlflags" ;;
8638 rp="Any special flags to pass to $cc to use dynamic linking?"
8641 none) ccdlflags=' ' ;;
8642 *) ccdlflags="$ans" ;;
8654 ld_can_script="$undef"
8655 case "$bin_ELF$usedl" in
8657 # Abuse try.h and a.out names for neat cleanup
8669 if $cc $cccdlflags $ccdlflags $ccflags \
8670 $ldflags $lddlflags -o a.out try.c \
8671 -Wl,--version-script=try.h >/dev/null 2>&1 \
8672 && $test -s a.out ; then
8673 echo "ld supports scripting" >&4
8674 ld_can_script="$define"
8676 echo "ld does not support scripting" >&4
8682 : Do we want a shared libperl?
8686 # No dynamic loading being used, so don't bother even to prompt.
8689 *) case "$useshrplib" in
8690 '') case "$osname" in
8691 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8693 also='Building a shared libperl is required for dynamic loading to work on your system.'
8707 The perl executable is normally obtained by linking perlmain.c with
8708 libperl${_a}, any static extensions (usually just DynaLoader), and
8709 any other libraries needed on this system (such as -lm, etc.). Since
8710 your system supports dynamic loading, it is probably possible to build
8711 a shared libperl.$so. If you will have more than one executable linked
8712 to libperl.$so, this will significantly reduce the size of each
8713 executable, but it may have a noticeable effect on performance. The
8714 default is probably sensible for your system.
8718 rp="Build a shared libperl.$so (y/n)"
8722 useshrplib='true' ;;
8723 *) useshrplib='false' ;;
8728 case "$useshrplib" in
8730 case "$userelocatableinc" in
8732 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8733 echo "See INSTALL for an explanation why that won't work." >&4
8739 # Figure out a good name for libperl.so. Since it gets stored in
8740 # a version-specific architecture-dependent library, the version
8741 # number isn't really that important, except for making cc/ld happy.
8743 # A name such as libperl.so.10.1
8744 majmin="libperl.$so.$patchlevel.$subversion"
8745 # A name such as libperl.so.100
8746 majonly=`echo $patchlevel $subversion |
8747 $awk '{printf "%d%02d", $1, $2}'`
8748 majonly=libperl.$so.$majonly
8749 # I'd prefer to keep the os-specific stuff here to a minimum, and
8750 # rely on figuring it out from the naming of libc.
8751 case "${osname}${osvers}" in
8752 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8755 cygwin*) # ld links now against the dll directly
8756 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8757 majonly=`echo $patchlevel $subversion |
8758 $awk '{printf "%03d%03d", $1, $2}'`
8759 majonly=cygperl5.$majonly.$so
8762 *) # Try to guess based on whether libc has major.minor.
8764 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8765 *libc.$so.[0-9]*) dflt=$majonly ;;
8766 *) dflt=libperl.$so ;;
8776 I need to select a good name for the shared libperl. If your system uses
8777 library names with major and minor numbers, then you might want something
8778 like $majmin. Alternatively, if your system uses a single version
8779 number for shared libraries, then you might want to use $majonly.
8780 Or, your system might be quite happy with a simple libperl.$so.
8782 Since the shared libperl will get installed into a version-specific
8783 architecture-dependent directory, the version number of the shared perl
8784 library probably isn't important, so the default should be o.k.
8787 rp='What name do you want to give to the shared libperl?'
8790 echo "Ok, I'll use $libperl"
8793 libperl="libperl${_a}"
8797 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8801 WARNING: Use of the shrpdir variable for the installation location of
8802 the shared $libperl is not supported. It was never documented and
8803 will not work in this version. Let me (https://github.com/Perl/perl5/issues)
8804 know of any problems this may cause.
8810 But your current setting of $shrpdir is
8811 the default anyway, so it's harmless.
8816 Further, your current attempted setting of $shrpdir
8817 conflicts with the value of $archlibexp/CORE
8818 that installperl will use.
8825 # How will the perl executable find the installed shared $libperl?
8826 # Add $xxx to ccdlflags.
8827 # If we can't figure out a command-line option, use $shrpenv to
8828 # set env LD_RUN_PATH. The main perl makefile uses this.
8829 shrpdir=$archlibexp/CORE
8832 if "$useshrplib"; then
8835 # We'll set it in Makefile.SH...
8840 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8841 xxx="-Wl,-R$shrpdir"
8843 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8844 xxx="-Wl,-rpath,$shrpdir"
8847 # hpux doesn't like the default, either.
8848 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8851 # cygwin needs only ldlibpth
8854 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8860 # Only add $xxx if it isn't already in ccdlflags.
8861 case " $ccdlflags " in
8863 *) ccdlflags="$ccdlflags $xxx"
8866 Adding $xxx to the flags
8867 passed to $ld so that the perl executable will find the
8868 installed shared $libperl.
8876 # Fix ccdlflags in AIX for building external extensions.
8877 # (For building Perl itself bare -bE:perl.exp is needed,
8878 # Makefile.SH takes care of this.)
8880 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8882 # Respect a hint or command-line value.
8884 '') shrpenv="$tmp_shrpenv" ;;
8886 case "$ldlibpthname" in
8887 '') ldlibpthname=LD_LIBRARY_PATH ;;
8888 none) ldlibpthname='' ;;
8891 : determine where manual pages are on this system
8895 syspath='/usr/share/man/man1 /usr/man/man1'
8896 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8897 syspath="$syspath /usr/man/u_man/man1"
8898 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8899 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8900 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8901 sysman=`./loc . /usr/man/man1 $syspath`
8904 if $test -d "$sysman"; then
8905 echo "System manual is in $sysman." >&4
8907 echo "Could not find manual pages in source form." >&4
8910 : determine where manual pages go
8911 set man1dir man1dir none
8915 $spackage has manual pages available in source form.
8919 echo "However, you don't have nroff, so they're probably useless to you."
8921 '') man1dir="none";;
8924 echo "If you don't want the manual sources installed, answer 'none'."
8929 lookpath="$prefixexp/share/man/man1"
8930 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8931 lookpath="$lookpath $prefixexp/man/p_man/man1"
8932 lookpath="$lookpath $prefixexp/man/u_man/man1"
8933 lookpath="$lookpath $prefixexp/man/man.1"
8935 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8936 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8946 rp="Where do the main $spackage manual pages (source) go?"
8948 if $test "X$man1direxp" != "X$ansexp"; then
8959 : What suffix to use on installed man pages
8966 rp="What suffix should be used for the main $spackage man pages?"
8968 '') case "$man1dir" in
8982 *) dflt="$man1ext";;
8989 : see if we can have long filenames
8991 first=123456789abcdef
8993 if (echo hi >$first) 2>/dev/null; then
8994 if $test -f 123456789abcde; then
8995 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8998 echo 'You can have filenames longer than 14 characters.'>&4
9003 You can't have filenames longer than 14 chars.
9004 You can't even think about them!
9010 $rm -rf 123456789abcde*
9012 : determine where library module manual pages go
9013 set man3dir man3dir none
9017 $spackage has manual pages for many of the library modules.
9023 However, you don't have nroff, so they're probably useless to you.
9026 '') man3dir="none";;
9030 case "$d_flexfnam" in
9033 However, your system can't handle the long file names like File::Basename.3.
9036 '') man3dir="none";;
9040 echo "If you don't want the manual sources installed, answer 'none'."
9041 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9043 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9044 if $test -d "$privlib/man/man3"; then
9047 WARNING: Previous versions of perl installed man3 pages into
9048 $privlib/man/man3. This version will suggest a
9049 new default of $dflt.
9053 rp='Do you wish to preserve the old behavior?(y/n)'
9056 y*) dflt="$privlib/man/man3" ;;
9061 *) dflt="$man3dir" ;;
9068 rp="Where do the $package library man pages (source) go?"
9078 : What suffix to use on installed man pages
9084 rp="What suffix should be used for the $package library man pages?"
9086 '') case "$man3dir" in
9100 *) dflt="$man3ext";;
9107 : see if we have to deal with yellow pages, now NIS.
9108 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9114 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9122 rp='Are you getting the hosts file via yellow pages?'
9125 y*) hostcat='ypcat hosts';;
9126 *) hostcat='cat /etc/hosts';;
9132 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9135 '') test -f /etc/group && groupcat='cat /etc/group';;
9138 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9141 : now get the host name
9143 echo "Figuring out host name..." >&4
9144 case "$myhostname" in
9146 echo 'Maybe "hostname" will work...'
9147 if tans=`sh -c hostname 2>&1` ; then
9155 if $test "$cont"; then
9157 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9158 if tans=`cat /etc/systemid 2>&1` ; then
9160 phostname='cat /etc/systemid'
9161 echo "Whadyaknow. Xenix always was a bit strange..."
9164 elif $test -r /etc/systemid; then
9165 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9168 if $test "$cont"; then
9169 echo 'No, maybe "uuname -l" will work...'
9170 if tans=`sh -c 'uuname -l' 2>&1` ; then
9172 phostname='uuname -l'
9174 echo 'Strange. Maybe "uname -n" will work...'
9175 if tans=`sh -c 'uname -n' 2>&1` ; then
9177 phostname='uname -n'
9179 echo 'Oh well, maybe I can mine it out of whoami.h...'
9180 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9181 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9182 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9184 case "$myhostname" in
9185 '') echo "Does this machine have an identity crisis or something?"
9188 echo "Well, you said $myhostname before..."
9189 phostname='echo $myhostname';;
9195 case "$myhostname" in
9196 '') myhostname=noname ;;
9198 : you do not want to know about this
9203 if $test "$myhostname" ; then
9205 rp='Your host name appears to be "'$myhostname'".'" Right?"
9213 : bad guess or no guess
9214 while $test "X$myhostname" = X ; do
9216 rp="Please type the (one word) name of your host:"
9221 : translate upper to lower if necessary
9222 case "$myhostname" in
9224 echo "(Normalizing case in your host name)"
9225 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9229 case "$myhostname" in
9231 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9232 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9233 echo "(Trimming domain name from host name--host name is now $myhostname)"
9235 *) case "$mydomain" in
9238 test "X$hostcat" = "Xypcat hosts" &&
9239 ypmatch "$myhostname" hosts 2>/dev/null |\
9240 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9243 test "X$hostcat" != "X" &&
9244 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9245 /[ ]$myhostname[ . ]/p" > hosts
9248 if $test -f hosts; then
9249 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9250 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9251 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9252 hosts | $sort | $uniq | \
9253 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9254 case `$echo X$dflt` in
9255 X*\ *) echo "(Several hosts in the database matched hostname)"
9258 X.) echo "(You do not have fully-qualified names in the hosts database)"
9262 echo "(I cannot locate a hosts database anywhere)"
9267 tans=`./loc resolv.conf X /etc /usr/etc`
9268 if $test -f "$tans"; then
9269 echo "(Attempting domain name extraction from $tans)"
9270 dflt=.`$sed -n -e 's/ / /g' \
9271 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9274 .) dflt=.`$sed -n -e 's/ / /g' \
9275 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9283 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9284 dflt=.`sh -c domainname 2>/dev/null`
9287 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9291 case "$dflt$osname" in
9292 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9293 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9297 .) echo "(Lost all hope -- silly guess then)"
9303 *) dflt="$mydomain";;
9307 rp="What is your domain name?"
9317 : translate upper to lower if necessary
9320 echo "(Normalizing case in your domain name)"
9321 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9325 : a little sanity check here
9326 case "$phostname" in
9329 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9330 $myhostname$mydomain|$myhostname) ;;
9332 case "$phostname" in
9334 echo "(That doesn't agree with your whoami.h file, by the way.)"
9337 echo "(That doesn't agree with your $phostname command, by the way.)"
9345 : determine the e-mail address of the user who is running us
9348 I need to get your e-mail address in Internet format if possible, i.e.
9349 something like user@host.domain. Please answer accurately since I have
9350 no easy means to double check it. The default value provided below
9351 is most probably close to reality but may not be valid from outside
9352 your organization...
9356 while test "$cont"; do
9357 case "$MAILDOMAIN" in
9359 if $test -s /etc/mailname; then
9360 maildomain=`$cat /etc/mailname`
9362 maildomain="$myhostname$mydomain"
9365 *) maildomain="$MAILDOMAIN";;
9368 '') dflt="$cf_by@$maildomain";;
9369 *) dflt="$cf_email";;
9371 rp='What is your e-mail address?'
9377 rp='Address does not look like an Internet one. Use it anyway?'
9391 : Ask e-mail of administrator
9394 If you or somebody else will be maintaining perl at your site, please
9395 fill in the correct e-mail address here so that they may be contacted
9396 if necessary. You may enter "none" for no administrator.
9399 case "$perladmin" in
9400 '') dflt="$cf_email";;
9401 *) dflt="$perladmin";;
9403 rp='Perl administrator e-mail address'
9407 : determine whether to use a version number suffix for installed binaries
9410 Do you want to use a version number suffix for installed binaries? This
9411 will install 'perl$version' instead of 'perl', and likewise for other
9412 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9413 to be installed side-by-side. Unless you are a developer, you probably
9414 do *not* want to do this.
9416 case "$versiononly" in
9417 "$define"|[Yy]*|true) dflt='y' ;;
9420 rp="Do you want to use a version number suffix for installed binaries?"
9423 [yY]*) val="$define";;
9429 case "$versiononly" in
9430 "$define") inc_version_list=''
9431 inc_version_list_init=0
9435 : figure out how to guarantee perl startup
9436 : XXX Note that this currently takes advantage of the bug that binexp ignores
9437 : the Configure -Dinstallprefix setting, which in turn means that under
9438 : relocatable @INC, initialinstalllocation is what binexp started as.
9439 case "$startperl" in
9441 case "$sharpbang" in
9445 I can use the #! construct to start perl on your system. This will
9446 make startup of perl scripts faster, but may cause problems if you
9447 want to share those scripts and perl is not in a standard place
9448 ($initialinstalllocation/perl) on all your platforms. The alternative
9449 is to force a shell by starting the script with a single ':' character.
9452 case "$versiononly" in
9453 "$define") dflt="$initialinstalllocation/perl$version";;
9454 *) dflt="$initialinstalllocation/perl";;
9456 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9459 none) startperl=": # use perl";;
9460 *) startperl="#!$ans"
9461 if $test 30 -lt `echo "$ans" | wc -c`; then
9464 WARNING: Some systems limit the #! command to 32 characters.
9465 If you experience difficulty running Perl scripts with #!, try
9466 installing Perl in a directory with a shorter pathname.
9472 *) startperl=": # use perl"
9477 echo "I'll use $startperl to start perl scripts."
9479 : figure best path for perl in scripts
9482 case "$versiononly" in
9483 "$define") perlpath="$initialinstalllocation/perl$version";;
9484 *) perlpath="$initialinstalllocation/perl";;
9486 case "$startperl" in
9491 I will use the "eval 'exec'" idiom to start Perl on your system.
9492 I can use the full path of your Perl binary for this purpose, but
9493 doing so may cause problems if you want to share those scripts and
9494 Perl is not always in a standard place ($initialinstalllocation/perl).
9497 dflt="$initialinstalllocation/perl"
9498 rp="What path shall I use in \"eval 'exec'\"?"
9505 case "$startperl" in
9507 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9510 : determine where public executable scripts go
9511 set scriptdir scriptdir
9513 case "$scriptdir" in
9516 : guess some guesses
9517 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9518 $test -d /usr/share/bin && dflt=/usr/share/bin
9519 $test -d /usr/local/script && dflt=/usr/local/script
9520 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9521 $test -d $prefixexp/script && dflt=$prefixexp/script
9525 *) dflt="$scriptdir"
9530 Some installations have a separate directory just for executable scripts so
9531 that they can mount it across multiple architectures but keep the scripts in
9532 one spot. You might, for example, have a subdirectory of /usr/share for this.
9533 Or you might just lump your scripts in with all your other executables.
9537 rp='Where do you keep publicly executable scripts?'
9539 if $test "X$ansexp" != "X$scriptdirexp"; then
9545 : A little fix up for an irregularly named variable.
9546 installscript="$installscriptdir"
9548 : determine where add-on public executables go
9550 '') dflt=$siteprefix/bin ;;
9554 rp='Pathname where the add-on public executables should be installed?'
9559 : determine where add-on html pages go
9560 : There is no standard location, so try to copy the previously-selected
9561 : directory structure for the core html pages.
9562 case "$sitehtml1dir" in
9563 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9564 *) dflt=$sitehtml1dir ;;
9567 ''|' ') dflt=none ;;
9570 rp='Pathname where the site-specific html pages should be installed?'
9572 prefixvar=sitehtml1dir
9575 : determine where add-on library html pages go
9576 : There is no standard location, so try to copy the previously-selected
9577 : directory structure for the core html pages.
9578 case "$sitehtml3dir" in
9579 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9580 *) dflt=$sitehtml3dir ;;
9583 ''|' ') dflt=none ;;
9586 rp='Pathname where the site-specific library html pages should be installed?'
9588 prefixvar=sitehtml3dir
9591 : determine where add-on manual pages go
9592 case "$siteman1dir" in
9593 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9594 *) dflt=$siteman1dir ;;
9597 ''|' ') dflt=none ;;
9600 rp='Pathname where the site-specific manual pages should be installed?'
9602 prefixvar=siteman1dir
9605 : determine where add-on library man pages go
9606 case "$siteman3dir" in
9607 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9608 *) dflt=$siteman3dir ;;
9611 ''|' ') dflt=none ;;
9614 rp='Pathname where the site-specific library manual pages should be installed?'
9616 prefixvar=siteman3dir
9619 : determine where add-on public executable scripts go
9620 case "$sitescript" in
9621 '') dflt=$siteprefix/script
9622 $test -d $dflt || dflt=$sitebin ;;
9623 *) dflt="$sitescript" ;;
9626 rp='Pathname where add-on public executable scripts should be installed?'
9628 prefixvar=sitescript
9631 : see if backtrace exists
9632 set backtrace d_backtrace
9635 : Check if C backtrace is actually supported.
9636 case "$usecbacktrace" in
9637 "") usecbacktrace=$undef ;;
9639 case "$d_backtrace" in
9643 echo "This system does not support backtrace" >&4
9644 usecbacktrace=$undef
9650 : Check if faststdio is requested and available
9651 case "$usefaststdio" in
9652 $define|true|[yY]*|'')
9653 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9663 Perl can be built to use 'fast stdio', which means using the stdio
9664 library but also directly manipulating the stdio buffers to enable
9665 faster I/O. Using stdio is better for backward compatibility (especially
9666 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9667 interface has been preferred instead of stdio.
9669 If this doesn't make any sense to you, just accept the default '$dflt'.
9671 rp='Use the "fast stdio" if available?'
9674 y|Y) val="$define" ;;
9680 : define an is-a-typedef? function
9681 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9683 "") inclist="sys/types.h";;
9685 eval "varval=\$$var";
9689 for inc in $inclist; do
9690 echo "#include <$inc>" >>temp.c;
9692 echo "#ifdef $type" >> temp.c;
9693 echo "printf(\"We have $type\");" >> temp.c;
9694 echo "#endif" >> temp.c;
9695 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9696 if $contains $type temp.E >/dev/null 2>&1; then
9702 *) eval "$var=\$varval";;
9705 : define an is-a-typedef? function that prompts if the type is not available.
9706 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9708 "") inclist="sys/types.h";;
9710 eval "varval=\$$var";
9714 for inc in $inclist; do
9715 echo "#include <$inc>" >>temp.c;
9717 echo "#ifdef $type" >> temp.c;
9718 echo "printf(\"We have $type\");" >> temp.c;
9719 echo "#endif" >> temp.c;
9720 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9722 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9723 if $contains $type temp.E >/dev/null 2>&1; then
9724 echo "$type found." >&4;
9727 echo "$type NOT found." >&4;
9733 *) eval "$var=\$varval";;
9736 : see what type lseek is declared as in the kernel
9737 rp="What is the type used for lseek's offset on this system?"
9738 set off_t lseektype long stdio.h sys/types.h
9742 echo "Checking to see how big your file offsets are..." >&4
9744 #include <sys/types.h>
9748 printf("%d\n", (int)sizeof($lseektype));
9753 if eval $compile_ok; then
9754 lseeksize=`$run ./try`
9755 echo "Your file offsets are $lseeksize bytes long."
9759 echo "(I can't seem to compile the test program. Guessing...)"
9760 rp="What is the size of your file offsets (in bytes)?"
9766 : see what type file positions are declared as in the library
9767 rp="What is the type for file position used by fsetpos()?"
9768 set fpos_t fpostype long stdio.h sys/types.h
9771 : Check size for Fpos_t
9774 *_t) zzz="$fpostype" ;;
9777 echo "Checking the size of $zzz..." >&4
9779 #include <sys/types.h>
9786 printf("%d\n", (int)sizeof($fpostype));
9791 if eval $compile_ok; then
9795 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9798 echo "Your $zzz is $fpossize bytes long."
9804 echo "(I can't compile the test program. Guessing...)" >&4
9805 rp="What is the size of your file positions (in bytes)?"
9810 : Check for large file support
9811 # Backward compatibility (uselfs is deprecated).
9813 "$define"|true|[yY]*)
9816 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9818 uselargefiles="$define"
9822 case "$lseeksize:$fpossize" in
9825 You can have files larger than 2 gigabytes.
9828 *) case "$uselargefiles" in
9829 "$undef"|false|[nN]*) dflt='n' ;;
9834 Perl can be built to understand large files (files larger than 2 gigabytes)
9835 on some systems. To do so, Configure can be run with -Duselargefiles.
9837 If this doesn't make any sense to you, just accept the default '$dflt'.
9839 rp='Try to understand large files, if available?'
9842 y|Y) val="$define" ;;
9849 : Look for a hint-file generated 'call-back-unit'. If the
9850 : user has specified that a large files perl is to be built,
9851 : we may need to set or change some other defaults.
9852 if $test -f uselargefiles.cbu; then
9853 echo "Your platform has some specific hints regarding large file builds, using them..."
9854 . ./uselargefiles.cbu
9856 case "$uselargefiles" in
9858 if $test -f uselargefiles.cbu; then
9860 echo "Rechecking to see how big your file offsets are..." >&4
9862 #include <sys/types.h>
9866 printf("%d\n", (int)sizeof($lseektype));
9871 if eval $compile_ok; then
9872 lseeksize=`$run ./try`
9873 $echo "Your file offsets are now $lseeksize bytes long."
9877 echo "(I can't seem to compile the test program. Guessing...)"
9878 rp="What is the size of your file offsets (in bytes)?"
9883 *_t) zzz="$fpostype" ;;
9886 $echo $n "Rechecking the size of $zzz...$c" >&4
9888 #include <sys/types.h>
9895 printf("%d\n", (int)sizeof($fpostype));
9900 if eval $compile_ok; then
9905 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9908 echo " $fpossize bytes." >&4
9914 echo "(I can't compile the test program. Guessing...)" >&4
9915 rp="What is the size of your file positions (in bytes)?"
9924 : Check if we want perlio
9927 : Set the vendorbin variables
9928 case "$vendorprefix" in
9929 '') d_vendorbin="$undef"
9933 *) d_vendorbin="$define"
9934 : determine where vendor-supplied executables go.
9935 case "$vendorbin" in
9936 '') dflt=$vendorprefix/bin ;;
9937 *) dflt="$vendorbin" ;;
9940 rp='Pathname for the vendor-supplied executables directory?'
9943 vendorbinexp="$ansexp"
9949 : Set the vendorhtml1dir variables
9950 case "$vendorprefix" in
9951 '') vendorhtml1dir=''
9952 vendorhtml1direxp=''
9954 *) : determine where vendor-supplied html pages go.
9955 : There is no standard location, so try to copy the previously-selected
9956 : directory structure for the core html pages.
9957 : XXX Better default suggestions would be welcome.
9958 case "$vendorhtml1dir" in
9959 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9960 *) dflt=$vendorhtml1dir ;;
9963 ''|' ') dflt=none ;;
9966 rp='Pathname for the vendor-supplied html pages?'
9968 vendorhtml1dir="$ans"
9969 vendorhtml1direxp="$ansexp"
9972 : Use ' ' for none so value is preserved next time through Configure
9973 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9974 prefixvar=vendorhtml1dir
9977 : Set the vendorhtml3dir variables
9978 case "$vendorprefix" in
9979 '') vendorhtml3dir=''
9980 vendorhtml3direxp=''
9982 *) : determine where vendor-supplied module html pages go.
9983 : There is no standard location, so try to copy the previously-selected
9984 : directory structure for the core html pages.
9985 : XXX Better default suggestions would be welcome.
9986 case "$vendorhtml3dir" in
9987 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9988 *) dflt=$vendorhtml3dir ;;
9991 ''|' ') dflt=none ;;
9994 rp='Pathname for the vendor-supplied html pages?'
9996 vendorhtml3dir="$ans"
9997 vendorhtml3direxp="$ansexp"
10000 : Use ' ' for none so value is preserved next time through Configure
10001 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10002 prefixvar=vendorhtml3dir
10005 : Set the vendorman1dir variables
10006 case "$vendorprefix" in
10007 '') vendorman1dir=''
10008 vendorman1direxp=''
10010 *) : determine where vendor-supplied manual pages go.
10011 case "$vendorman1dir" in
10012 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10013 *) dflt=$vendorman1dir ;;
10016 ''|' ') dflt=none ;;
10019 rp='Pathname for the vendor-supplied manual section 1 pages?'
10021 vendorman1dir="$ans"
10022 vendorman1direxp="$ansexp"
10025 : Use ' ' for none so value is preserved next time through Configure
10026 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10027 prefixvar=vendorman1dir
10030 : Set the vendorman3dir variables
10031 case "$vendorprefix" in
10032 '') vendorman3dir=''
10033 vendorman3direxp=''
10035 *) : determine where vendor-supplied module manual pages go.
10036 case "$vendorman3dir" in
10037 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10038 *) dflt=$vendorman3dir ;;
10041 ''|' ') dflt=none ;;
10044 rp='Pathname for the vendor-supplied manual section 3 pages?'
10046 vendorman3dir="$ans"
10047 vendorman3direxp="$ansexp"
10050 : Use ' ' for none so value is preserved next time through Configure
10051 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10052 prefixvar=vendorman3dir
10055 : Set the vendorscript variables
10056 case "$vendorprefix" in
10057 '') d_vendorscript="$undef"
10061 *) d_vendorscript="$define"
10062 : determine where vendor-supplied scripts go.
10063 case "$vendorscript" in
10064 '') dflt=$vendorprefix/script
10065 $test -d $dflt || dflt=$vendorbin ;;
10066 *) dflt="$vendorscript" ;;
10070 The installation process will create a directory for
10071 vendor-supplied scripts.
10075 rp='Pathname for the vendor-supplied scripts directory?'
10077 vendorscript="$ans"
10078 vendorscriptexp="$ansexp"
10081 prefixvar=vendorscript
10084 : see if qgcvt exists
10088 : Check what kind of doubles your system has
10089 $echo "Checking the kind of doubles you have..." >&4
10091 #$i_stdlib I_STDLIB
10092 #define DOUBLESIZE $doublesize
10094 #include <stdlib.h>
10097 static const double d = -0.1;
10099 unsigned const char* b = (unsigned const char*)(&d);
10100 #if DOUBLESIZE == 4
10101 if (b[0] == 0xCD && b[3] == 0xBD) {
10102 /* IEEE 754 32-bit little-endian */
10106 if (b[0] == 0xBD && b[3] == 0xCD) {
10107 /* IEEE 754 32-bit big-endian */
10111 if (b[0] == 0xCC && b[3] == 0xCC) {
10112 /* VAX format F, 32-bit PDP-style mixed endian. */
10116 if (b[0] == 0xC0 && b[3] == 0x9A) {
10117 /* IBM single 32-bit */
10122 #if DOUBLESIZE == 8
10123 if (b[0] == 0x9A && b[7] == 0xBF) {
10124 /* IEEE 754 64-bit little-endian */
10128 if (b[0] == 0xBF && b[7] == 0x9A) {
10129 /* IEEE 754 64-bit big-endian */
10133 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10134 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10135 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10136 * 99 99 b9 bf 9a 99 99 99 */
10140 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10141 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10142 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10143 * 99 99 99 9a bf b9 99 99 */
10147 if (b[0] == 0xCC && b[7] == 0xCC) {
10148 /* VAX format D, 64-bit PDP-style mixed endian. */
10152 if (b[0] == 0xD9 && b[7] == 0x99) {
10153 /* VAX format G, 64-bit PDP-style mixed endian. */
10157 if (b[0] == 0xC0 && b[7] == 0x9A) {
10158 /* IBM double 64-bit */
10162 if (b[0] == 0xBF && b[7] == 0xCD) {
10163 /* CRAY single 64-bit */
10168 #if DOUBLESIZE == 16
10169 if (b[0] == 0x9A && b[15] == 0xBF) {
10170 /* IEEE 754 128-bit little-endian */
10174 if (b[0] == 0xBF && b[15] == 0x9A) {
10175 /* IEEE 754 128-bit big-endian */
10180 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10181 * Whether those environments can still build Perl is debatable. */
10182 printf("-1\n"); /* unknown */
10187 if eval $compile; then
10188 doublekind=`$run ./try`
10192 case "$doublekind" in
10193 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10194 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10195 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10196 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10197 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10198 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10199 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10200 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10201 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10202 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10203 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10204 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10205 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10206 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10207 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10209 d_double_style_ieee=$undef
10210 d_double_style_vax=$undef
10211 d_double_style_ibm=$undef
10212 d_double_style_cray=$undef
10213 case "$doublekind" in
10214 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10215 9|10|11) d_double_style_vax=$define ;;
10216 12|13) d_double_style_ibm=$define ;;
10217 14) d_double_style_cray=$define ;;
10219 case "$d_double_style_ieee" in
10221 d_double_has_inf=$define
10222 d_double_has_nan=$define
10223 d_double_has_negative_zero=$define
10224 d_double_has_subnormals=$define
10227 d_double_has_inf=$undef
10228 d_double_has_nan=$undef
10229 d_double_has_negative_zero=$undef
10230 d_double_has_subnormals=$undef
10235 : Check print/scan long double stuff
10238 if $test X"$d_longdbl" = X"$define"; then
10240 echo "Checking how to print long doubles..." >&4
10242 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10243 $cat >try.c <<'EOCP'
10244 #include <sys/types.h>
10247 double d = 123.456;
10248 printf("%.3f\n", d);
10252 if eval $compile; then
10256 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10257 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10258 echo "We will use %f."
10264 if $test X"$sPRIfldbl" = X; then
10265 $cat >try.c <<'EOCP'
10266 #include <sys/types.h>
10269 long double d = 123.456;
10270 printf("%.3Lf\n", d);
10274 if eval $compile; then
10278 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10279 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10280 echo "We will use %Lf."
10286 if $test X"$sPRIfldbl" = X; then
10287 $cat >try.c <<'EOCP'
10288 #include <sys/types.h>
10291 long double d = 123.456;
10292 printf("%.3llf\n", d);
10296 if eval $compile; then
10300 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10301 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10302 echo "We will use %llf."
10308 if $test X"$sPRIfldbl" = X; then
10309 $cat >try.c <<'EOCP'
10310 #include <sys/types.h>
10313 long double d = 123.456;
10314 printf("%.3lf\n", d);
10318 if eval $compile; then
10322 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10323 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10324 echo "We will use %lf."
10330 if $test X"$sPRIfldbl" = X; then
10331 echo "Cannot figure out how to print long doubles." >&4
10333 sSCNfldbl=$sPRIfldbl # expect consistency
10340 case "$sPRIfldbl" in
10341 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10342 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10343 d_SCNfldbl="$undef";
10345 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10346 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10347 d_SCNfldbl="$define";
10351 : Before committing on uselongdouble, see whether that looks sane.
10352 if $test "$uselongdouble" = "$define"; then
10355 echo "Checking if your long double math functions work right..." >&4
10360 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10363 case "$osname:$gccversion" in
10364 aix:) saveccflags="$ccflags"
10365 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10368 if eval $compile_ok; then
10372 3) echo "Your long double math functions are working correctly." >&4 ;;
10373 *) echo "Your long double math functions are broken, not using long doubles." >&4
10374 uselongdouble=$undef
10378 case "$osname:$gccversion" in
10379 aix:) ccflags="$saveccflags" ;; # restore
10383 : Check how to convert floats to strings.
10385 if test "X$d_Gconvert" = X; then
10388 echo "Checking for an efficient way to convert floats to strings."
10390 case "$uselongdouble" in
10391 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10393 case "$d_longdbl" in
10394 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10396 case "$d_PRIgldbl" in
10397 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10400 #ifdef TRY_gconvert
10401 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10402 const char *myname = "gconvert";
10405 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10406 const char *myname = "gcvt";
10409 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10410 const char *myname = "qgcvt";
10411 #define DOUBLETYPE long double
10414 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10415 #ifdef HAS_PRIgldbl
10416 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10418 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10421 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10423 const char *myname = "sprintf";
10427 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10428 #define DOUBLETYPE long double
10430 #define DOUBLETYPE double
10436 #$i_stdlib I_STDLIB
10438 #include <stdlib.h>
10440 #include <string.h>
10442 void checkit(const char *expect, char *got)
10444 if (strcmp(expect, got)) {
10445 printf("%s oddity: Expected %s, got %s\n",
10446 myname, expect, got);
10451 void lencheck(int expect, int got)
10453 if (expect != got) {
10454 printf("%s length mismatch: Expected %d, got %d\n",
10455 myname, expect, got);
10465 /* This must be 1st test on (which?) platform */
10466 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10467 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10468 checkit("0.1", buf);
10470 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10471 checkit("0.01", buf);
10473 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10474 checkit("0.001", buf);
10476 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10477 checkit("0.0001", buf);
10479 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10480 if (strlen(buf) > 5)
10481 checkit("9e-005", buf); /* for Microsoft ?? */
10483 checkit("9e-05", buf);
10485 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10488 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10489 checkit("1.1", buf);
10491 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10492 checkit("1.01", buf);
10494 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10495 checkit("1.001", buf);
10497 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10498 checkit("1.0001", buf);
10500 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10501 checkit("1.00001", buf);
10503 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10504 checkit("1.000001", buf);
10506 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10509 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10510 checkit("-1", buf);
10512 /* Some Linux gcvt's give 1.e+5 here. */
10513 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10514 checkit("100000", buf);
10516 /* Some Linux gcvt's give -1.e+5 here. */
10517 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10518 checkit("-100000", buf);
10520 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10521 checkit("123.456", buf);
10523 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10524 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10525 /* 34 should be enough to scare even long double
10526 * places into using the e notation. */
10527 if (strlen(buf) > 5)
10528 checkit("1e+034", buf); /* for Microsoft */
10530 checkit("1e+34", buf);
10532 /* Test for an Ubuntu/Debian bug in gcvt and qgcvt. See: *
10533 * https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1899553 */
10535 Gconvert((DOUBLETYPE)0.4, 53, 0, buf);
10536 lencheck(55, (int)strlen(buf));
10538 /* For Perl, if you add additional tests here, also add them to
10539 * t/base/num.t for benefit of platforms not using Configure or
10540 * overriding d_Gconvert */
10545 : first add preferred functions to our list
10547 for xxx_convert in $gconvert_preference; do
10548 case $xxx_convert in
10549 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10550 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10553 : then add any others
10554 for xxx_convert in gconvert gcvt sprintf; do
10555 case "$xxx_list" in
10557 *) xxx_list="$xxx_list $xxx_convert" ;;
10561 case "$d_longdbl$uselongdouble" in
10563 : again, add preferred functions to our list first
10565 for xxx_convert in $gconvert_ld_preference; do
10566 case $xxx_convert in
10567 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10568 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10571 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10572 for xxx_convert in qgcvt sprintf $xxx_list; do
10573 case "$xxx_ld_list" in
10574 $xxx_convert*|*" $xxx_convert"*) ;;
10575 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10578 : if sprintf cannot do long doubles, move it to the end
10579 if test "$d_PRIgldbl" != "$define"; then
10580 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10582 : if no qgcvt, remove it
10583 if test "$d_qgcvt" != "$define"; then
10584 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10587 xxx_list="$xxx_ld_list"
10591 for xxx_convert in $xxx_list; do
10592 echo "Trying $xxx_convert..."
10593 $rm -f try try$_o core
10594 set try -DTRY_$xxx_convert
10595 if eval $compile; then
10596 echo "$xxx_convert() found." >&4
10597 if $run ./try; then
10598 echo "I'll use $xxx_convert to convert floats into a string." >&4
10601 echo "...But $xxx_convert didn't work as I expected."
10605 echo "$xxx_convert NOT found." >&4
10610 if test X$xxx_convert = X; then
10611 echo "*** WHOA THERE!!! ***" >&4
10612 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10613 xxx_convert=sprintf
10616 case "$xxx_convert" in
10617 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10618 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10619 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10620 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10621 "$define$define$define")
10622 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10623 "$define$define$undef")
10624 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10625 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10633 : see if _fwalk exists
10637 : see if accept4 exists
10638 set accept4 d_accept4
10641 : Initialize h_fcntl
10644 : Initialize h_sysfile
10647 : access call always available on UNIX
10648 set access d_access
10651 : locate the flags for 'access()'
10652 case "$d_access" in
10655 $cat >access.c <<EOCP
10656 #include <sys/types.h>
10661 #include <sys/file.h>
10664 #include <unistd.h>
10666 #$i_stdlib I_STDLIB
10668 #include <stdlib.h>
10674 : check sys/file.h first, no particular reason here
10675 if $test `./findhdr sys/file.h` && \
10676 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10678 echo "<sys/file.h> defines the *_OK access constants." >&4
10679 elif $test `./findhdr fcntl.h` && \
10680 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10682 echo "<fcntl.h> defines the *_OK access constants." >&4
10683 elif $test `./findhdr unistd.h` && \
10684 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10685 echo "<unistd.h> defines the *_OK access constants." >&4
10687 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10693 : see if accessx exists
10694 set accessx d_accessx
10697 : see if acosh exists
10701 : see if aintl exists
10705 : see if alarm exists
10709 : see if 64bit time functions exists
10711 set ctime64 d_ctime64
10714 set localtime64 d_localtime64
10717 set gmtime64 d_gmtime64
10720 set mktime64 d_mktime64
10723 set difftime64 d_difftime64
10726 set asctime64 d_asctime64
10729 : see if POSIX threads are available
10730 set pthread.h i_pthread
10733 : define a function to check prototypes
10734 $cat > protochk <<EOSH
10737 optimize="$optimize"
10741 usethreads=$usethreads
10742 i_pthread=$i_pthread
10743 pthread_h_first=$pthread_h_first
10746 $cat >> protochk <<'EOSH'
10751 while test $# -ge 2; do
10753 $define) echo "#include <$2>" >> try.c ;;
10754 literal) echo "$2" >> try.c ;;
10756 # Extra magic for the benefit of systems that need pthread.h
10757 # to be included early to correctly detect threadsafe functions.
10758 # Such functions must guarantee themselves, though, that the usethreads
10759 # and i_pthread have been defined, before calling protochk.
10760 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10761 echo "#include <pthread.h>" >> try.c
10766 cat >> try.c <<'EOCP'
10767 #define _(args) args
10769 echo "$foo" >> try.c
10770 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10771 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10777 $eunicefix protochk
10779 : Define hasproto macro for Configure internal use
10780 hasproto='varname=$1; func=$2; shift; shift;
10781 while $test $# -ge 2; do
10783 $define) echo "#include <$2>";;
10784 literal) echo "$2" ;;
10788 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10789 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10790 echo "$func() prototype found.";
10793 echo "$func() prototype NOT found.";
10800 : see if sys/types.h has to be included
10801 set sys/types.h i_systypes
10804 : see if sys/select.h has to be included
10805 set sys/select.h i_sysselct
10808 : Define hasfield macro for Configure internal use
10809 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10810 while $test $# -ge 2; do
10812 $define) echo "#include <$2>";;
10816 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10818 if eval $compile; then
10827 : see if we should include sys/time.h
10830 if test "X$timeincl" = X; then
10831 echo "Testing to see if we should include <sys/time.h>." >&4
10832 $echo $n "I'm now running the test program...$c"
10834 #include <sys/types.h>
10837 #ifdef SYSTIMEKERNEL
10840 #include <sys/time.h>
10843 #include <sys/select.h>
10845 #$i_stdlib I_STDLIB
10847 #include <stdlib.h>
10853 struct timeval bar;
10856 struct timezone tzp;
10858 if (foo.tm_sec == foo.tm_sec)
10861 if (bar.tv_sec == bar.tv_sec)
10868 for s_timezone in '-DS_TIMEZONE' ''; do
10870 for s_timeval in '-DS_TIMEVAL' ''; do
10871 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10872 for i_systime in '-DI_SYSTIME' ''; do
10875 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10876 if eval $compile; then
10877 set X $i_systime $i_systimek $sysselect $s_timeval
10881 $echo $n "Succeeded with $flags$c"
10892 *SYSTIMEKERNEL*) i_systimek="$define"
10893 timeincl=`./findhdr sys/time.h`
10894 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10895 *) i_systimek="$undef";;
10898 *I_SYSTIME*) i_systime="$define"
10899 timeincl=`./findhdr sys/time.h`" $timeincl"
10900 echo "We'll include <sys/time.h>." >&4;;
10901 *) i_systime="$undef";;
10905 : see if struct tm knows about tm_zone
10906 case "$i_systime$i_time" in
10909 echo "Checking to see if your struct tm has tm_zone field..." >&4
10910 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10918 case "$d_tm_tm_zone" in
10919 "$define") echo "Yes, it does." ;;
10920 *) echo "No, it doesn't." ;;
10922 : see if struct tm knows about tm_gmtoff
10923 case "$i_systime$i_time" in
10926 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10927 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10935 case "$d_tm_tm_gmtoff" in
10936 "$define") echo "Yes, it does." ;;
10937 *) echo "No, it doesn't." ;;
10940 : see if asctime_r exists
10941 set asctime_r d_asctime_r
10943 case "$d_asctime_r" in
10945 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10946 case "$d_asctime_r_proto:$usethreads" in
10947 ":define") d_asctime_r_proto=define
10948 set d_asctime_r_proto asctime_r $hdrs
10952 case "$d_asctime_r_proto" in
10954 case "$asctime_r_proto" in
10955 ''|0) try='char* asctime_r(const struct tm*, char*);'
10956 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10958 case "$asctime_r_proto" in
10959 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10960 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10962 case "$asctime_r_proto" in
10963 ''|0) try='int asctime_r(const struct tm*, char*);'
10964 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10966 case "$asctime_r_proto" in
10967 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10968 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10970 case "$asctime_r_proto" in
10971 ''|0) d_asctime_r=undef
10973 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10974 * ) case "$asctime_r_proto" in
10975 REENTRANT_PROTO*) ;;
10976 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10978 echo "Prototype: $try" ;;
10981 *) case "$usethreads" in
10982 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10989 *) asctime_r_proto=0
10993 : see if asinh exists
10997 : see if atanh exists
11001 : see if atolf exists
11005 : see if atoll exists
11009 : See if a file contains compiler warnings
11010 : See if a file contains compiler warnings
11013 cat >compiler_warning <<EOSS
11014 # Sample for aix ('.5' indicates the column number in the line):
11015 # "op.h", line 203.5: 1506-159 (E) Bit field type specified for op_type
11016 # Since the word 'warning' isn't present, use a fairly rigorous match of what
11017 # warning messages look like
11018 # " o p . h ", line 203 . 5 : 1506 - 159 ( E )
11019 $grep -E "^\\"[A-Za-z][A-Za-z0-9_]*\.[ch]\\", line [1-9][0-9]*[.][1-9][0-9]*: [1-9][0-9]*-[1-9][0-9]* \([EW][)] " "\$1"
11021 compiler_warning=./compiler_warning
11022 chmod +x $compiler_warning
11024 # Maybe a colon after the 'warning' would be appropriate
11025 *) compiler_warning="$contains -i warning"
11029 : Look for GCC-style attribute format
11030 case "$d_attribute_format" in
11033 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11034 $cat >attrib.c <<'EOCP'
11036 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11038 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11039 if $compiler_warning attrib.out >/dev/null 2>&1; then
11040 echo "Your C compiler doesn't support __attribute__((format))."
11043 echo "Your C compiler supports __attribute__((format))."
11047 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11051 *) val="$d_attribute_format" ;;
11053 set d_attribute_format
11057 : Look for GCC-style attribute format with null format allowed
11058 case "$d_printf_format_null" in
11059 '') case "$d_attribute_format" in
11062 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11063 $cat >attrib.c <<EOCP
11065 #$i_stdlib I_STDLIB
11067 #include <stdlib.h>
11069 #$i_inttypes I_INTTYPES
11071 #include <inttypes.h>
11074 #define intptr_t int
11076 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11077 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11078 int main () { exit(null_printf(NULL)); }
11080 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11081 : run the executable in case it produces a run-time warning
11082 if $run ./attrib >>attrib.out 2>&1; then
11083 if $compiler_warning attrib.out >/dev/null 2>&1; then
11084 echo "Your C compiler doesn't allow __printf__ format to be null."
11087 echo "Your C compiler allows __printf__ format to be null."
11091 echo "Your C compiler executable failed with __printf__ format null."
11095 echo "Your C compiler fails with __printf__ format null."
11102 *) val="$d_printf_format_null" ;;
11104 set d_printf_format_null
11108 : Look for GCC-style attribute malloc
11109 case "$d_attribute_malloc" in
11112 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11113 $cat >attrib.c <<'EOCP'
11115 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11117 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11118 if $compiler_warning attrib.out >/dev/null 2>&1; then
11119 echo "Your C compiler doesn't support __attribute__((malloc))."
11122 echo "Your C compiler supports __attribute__((malloc))."
11126 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11130 *) val="$d_attribute_malloc" ;;
11132 set d_attribute_malloc
11136 : Look for GCC-style attribute nonnull
11137 case "$d_attribute_nonnull" in
11140 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11141 $cat >attrib.c <<'EOCP'
11143 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11145 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11146 if $compiler_warning attrib.out >/dev/null 2>&1; then
11147 echo "Your C compiler doesn't support __attribute__((nonnull))."
11150 echo "Your C compiler supports __attribute__((nonnull))."
11154 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11158 *) val="$d_attribute_nonnull" ;;
11160 set d_attribute_nonnull
11164 : Look for GCC-style attribute noreturn
11165 case "$d_attribute_noreturn" in
11168 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11169 $cat >attrib.c <<'EOCP'
11171 void fall_over_dead( void ) __attribute__((noreturn));
11173 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11174 if $compiler_warning attrib.out >/dev/null 2>&1; then
11175 echo "Your C compiler doesn't support __attribute__((noreturn))."
11178 echo "Your C compiler supports __attribute__((noreturn))."
11182 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11186 *) val="$d_attribute_noreturn" ;;
11188 set d_attribute_noreturn
11192 : Look for GCC-style attribute pure
11193 case "$d_attribute_pure" in
11196 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11197 $cat >attrib.c <<'EOCP'
11199 int square( int n ) __attribute__((pure));
11201 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11202 if $compiler_warning attrib.out >/dev/null 2>&1; then
11203 echo "Your C compiler doesn't support __attribute__((pure))."
11206 echo "Your C compiler supports __attribute__((pure))."
11210 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11214 *) val="$d_attribute_pure" ;;
11216 set d_attribute_pure
11220 : Look for GCC-style attribute unused
11221 case "$d_attribute_unused" in
11224 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11225 $cat >attrib.c <<'EOCP'
11227 int do_something( int dummy __attribute__((unused)), int n );
11229 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11230 if $compiler_warning attrib.out >/dev/null 2>&1; then
11231 echo "Your C compiler doesn't support __attribute__((unused))."
11234 echo "Your C compiler supports __attribute__((unused))."
11238 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11242 *) val="$d_attribute_unused" ;;
11244 set d_attribute_unused
11248 : Look for GCC-style attribute deprecated
11249 case "$d_attribute_deprecated" in
11252 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11253 $cat >attrib.c <<'EOCP'
11255 int I_am_deprecated(void) __attribute__((deprecated));
11257 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11258 if $compiler_warning attrib.out >/dev/null 2>&1; then
11259 echo "Your C compiler doesn't support __attribute__((deprecated))."
11262 echo "Your C compiler supports __attribute__((deprecated))."
11266 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11270 *) val="$d_attribute_deprecated" ;;
11272 set d_attribute_deprecated
11276 : Look for GCC-style attribute warn_unused_result
11277 case "$d_attribute_warn_unused_result" in
11280 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11281 $cat >attrib.c <<'EOCP'
11283 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11285 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11286 if $compiler_warning attrib.out >/dev/null 2>&1; then
11287 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11290 echo "Your C compiler supports __attribute__((warn_unused_result))."
11294 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11298 *) val="$d_attribute_warn_unused_result" ;;
11300 set d_attribute_warn_unused_result
11304 : Look for GCC-style attribute always_inline
11305 case "$d_attribute_always_inline" in
11308 echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
11309 $cat >attrib.c <<'EOCP'
11311 static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
11313 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11314 if $compiler_warning attrib.out >/dev/null 2>&1; then
11315 echo "Your C compiler doesn't support __attribute__((always_inline))."
11318 echo "Your C compiler supports __attribute__((always_inline))."
11322 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11326 *) val="$d_attribute_always_inline" ;;
11328 set d_attribute_always_inline
11332 : Look for GCC-style attribute visibility
11333 case "$d_attribute_visibility" in
11336 echo "Checking whether your compiler can handle __attribute__((visibility)) ..." >&4
11337 $cat >attrib.c <<'EOCP'
11339 __attribute__((visibility("hidden"))) int I_will_be_hidden(void);
11341 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11342 if $compiler_warning attrib.out >/dev/null 2>&1; then
11343 echo "Your C compiler doesn't support __attribute__((visibility))."
11346 echo "Your C compiler supports __attribute__((visibility))."
11350 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11354 *) val="$d_attribute_visibility" ;;
11356 set d_attribute_visibility
11360 : see if getpgrp exists
11361 set getpgrp d_getpgrp
11364 case "$d_getpgrp" in
11367 echo "Checking to see which flavor of getpgrp is in use..."
11370 #$i_unistd I_UNISTD
11371 #include <sys/types.h>
11373 # include <unistd.h>
11375 #$i_stdlib I_STDLIB
11377 #include <stdlib.h>
11381 if (getuid() == 0) {
11382 printf("(I see you are running Configure as super-user...)\n");
11385 #ifdef TRY_BSD_PGRP
11386 if (getpgrp(1) == 0)
11395 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11396 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11398 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11399 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11402 echo "I can't seem to compile and run the test program."
11404 xxx="a USG one, i.e. you use getpgrp()."
11406 # SVR4 systems can appear rather BSD-ish.
11407 case "$i_unistd" in
11409 xxx="a BSD one, i.e. you use getpgrp(pid)."
11413 xxx="probably a USG one, i.e. you use getpgrp()."
11418 echo "Assuming your getpgrp is $xxx" >&4
11427 : see if setpgrp exists
11428 set setpgrp d_setpgrp
11431 case "$d_setpgrp" in
11434 echo "Checking to see which flavor of setpgrp is in use..."
11437 #$i_unistd I_UNISTD
11438 #include <sys/types.h>
11440 # include <unistd.h>
11442 #$i_stdlib I_STDLIB
11444 #include <stdlib.h>
11448 if (getuid() == 0) {
11449 printf("(I see you are running Configure as super-user...)\n");
11452 #ifdef TRY_BSD_PGRP
11453 if (-1 == setpgrp(1, 1))
11456 if (setpgrp() != -1)
11462 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11463 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11465 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11466 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11469 echo "(I can't seem to compile and run the test program.)"
11471 xxx="a USG one, i.e. you use setpgrp()."
11473 # SVR4 systems can appear rather BSD-ish.
11474 case "$i_unistd" in
11476 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11480 xxx="probably a USG one, i.e. you use setpgrp()."
11485 echo "Assuming your setpgrp is $xxx" >&4
11494 : Look for GCC-style __builtin_add_overflow
11495 case "$d_builtin_add_overflow" in
11498 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11499 $cat >try.c <<'EOCP'
11501 const unsigned int uint_max = ~0u;
11502 int target_int = 0;
11503 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11506 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11509 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11516 if eval $compile && $run ./try; then
11517 echo "Your C compiler supports __builtin_add_overflow."
11520 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11524 *) val="$d_builtin_add_overflow" ;;
11527 set d_builtin_add_overflow
11531 : Look for GCC-style __builtin_sub_overflow
11532 case "$d_builtin_sub_overflow" in
11535 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11536 $cat >try.c <<'EOCP'
11538 const unsigned int uint_max = ~0u;
11539 int target_int = 0;
11540 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11543 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11546 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11553 if eval $compile && $run ./try; then
11554 echo "Your C compiler supports __builtin_sub_overflow."
11557 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11561 *) val="$d_builtin_sub_overflow" ;;
11564 set d_builtin_sub_overflow
11568 : Look for GCC-style __builtin_mul_overflow
11569 case "$d_builtin_mul_overflow" in
11572 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11573 $cat >try.c <<'EOCP'
11575 const unsigned int uint_max = ~0u;
11576 int target_int = 0;
11577 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11580 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11583 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11590 if eval $compile && $run ./try; then
11591 echo "Your C compiler supports __builtin_mul_overflow."
11594 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11598 *) val="$d_builtin_mul_overflow" ;;
11601 set d_builtin_mul_overflow
11605 : Look for GCC-style __builtin_choose_expr
11606 case "$d_builtin_choose_expr" in
11609 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11610 $cat >try.c <<'EOCP'
11611 #include <assert.h>
11612 #include <stdlib.h>
11615 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11618 assert( SYRINX(1) == 2112 );
11619 assert( SYRINX(1) != 5150 );
11620 assert( SYRINX(0) == 5150 );
11621 assert( SYRINX(0) != 2112 );
11622 puts( "All good!" );
11628 if eval $compile && $run ./try; then
11629 echo "Your C compiler supports __builtin_choose_expr."
11632 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11636 *) val="$d_builtin_choose_expr" ;;
11639 set d_builtin_choose_expr
11643 : Look for GCC-style __builtin_expect
11644 case "$d_builtin_expect" in
11647 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11648 $cat >try.c <<'EOCP'
11651 if ( __builtin_expect(n, 0) ) n = 1;
11652 /* Remember shell exit code truth is 0, C truth is non-zero */
11657 if eval $compile && $run ./try; then
11658 echo "Your C compiler supports __builtin_expect."
11661 echo "Your C compiler doesn't seem to understand __builtin_expect."
11665 *) val="$d_builtin_expect" ;;
11668 set d_builtin_expect
11672 : see if the Compiler supports C99 variadic macros
11673 echo "Checking for C99 variadic macros." >&4
11676 #include <stdarg.h>
11678 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11682 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11688 if eval $compile && $run ./try 2>&1 >/dev/null; then
11689 case "`$run ./try`" in
11691 echo "You have C99 variadic macros." >&4
11692 d_c99_variadic_macros="$define"
11695 echo "You don't have functional C99 variadic macros." >&4
11696 d_c99_variadic_macros="$undef"
11700 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11701 d_c99_variadic_macros="$undef"
11705 : see if signal is declared as pointer to function returning int or void
11707 xxx=`./findhdr signal.h`
11708 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11709 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11710 echo "You have int (*signal())() instead of void." >&4
11712 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11713 echo "You have void (*signal())()." >&4
11715 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11716 echo "You have int (*signal())() instead of void." >&4
11718 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11719 echo "You have void (*signal())()." >&4
11722 case "$d_voidsig" in
11724 echo "I can't determine whether signal handler returns void or int..." >&4
11726 rp="What type does your signal handler return?"
11729 v*) val="$define";;
11733 echo "As you already told me, signal handler returns void." >&4
11736 *) echo "As you already told me, signal handler returns int." >&4
11743 case "$d_voidsig" in
11744 "$define") signal_t="void";;
11745 *) signal_t="int";;
11749 : check for ability to cast large floats to 32-bit ints.
11751 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11752 if $test "$intsize" -ge 4; then
11759 #$i_stdlib I_STDLIB
11761 #include <stdlib.h>
11763 #include <sys/types.h>
11764 #include <signal.h>
11765 $signal_t blech(int s) { exit(3); }
11772 signal(SIGFPE, blech);
11774 /* Don't let compiler optimize the test away. Store the number
11775 in a writable string for gcc to pass to sscanf under HP-UX.
11777 sprintf(str, "2147483647");
11778 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11782 /* x86 processors will probably give 0x8000 0000, which is a
11783 sign change. We don't want that. We want to mimic SPARC
11784 behavior here, which is to preserve the sign and give
11787 if (i32 != ($xxx) f)
11793 if eval $compile_ok; then
11794 $run ./try 2>/dev/null
11797 echo "(I can't seem to compile the test program--assuming it can't)"
11802 echo "Yup, it can."
11805 echo "Nope, it can't."
11812 : check for ability to cast negative floats to unsigned
11814 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11817 #$i_stdlib I_STDLIB
11819 #include <stdlib.h>
11821 #include <sys/types.h>
11822 #include <signal.h>
11823 $signal_t blech(int s) { exit(7); }
11824 $signal_t blech_in_list(int s) { exit(4); }
11825 unsigned long dummy_long(unsigned long p) { return p; }
11826 unsigned int dummy_int(unsigned int p) { return p; }
11827 unsigned short dummy_short(unsigned short p) { return p; }
11831 unsigned long along;
11833 unsigned short ashort;
11837 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11838 a direct f = -123. assignment. gcc-2.8.0 reportedly
11839 optimized the whole file away
11841 /* Store the number in a writable string for gcc to pass to
11842 sscanf under HP-UX.
11844 sprintf(str, "-123");
11845 sscanf(str, "%lf", &f); /* f = -123.; */
11847 signal(SIGFPE, blech);
11848 along = (unsigned long)f;
11849 aint = (unsigned int)f;
11850 ashort = (unsigned short)f;
11851 if (along != (unsigned long)-123)
11853 if (aint != (unsigned int)-123)
11855 if (ashort != (unsigned short)-123)
11857 sprintf(str, "1073741824.");
11858 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11861 along = (unsigned long)f;
11862 if (along != 0x80000000)
11866 along = (unsigned long)f;
11867 if (along != 0x7fffffff)
11871 along = (unsigned long)f;
11872 if (along != 0x80000001)
11876 signal(SIGFPE, blech_in_list);
11877 sprintf(str, "123.");
11878 sscanf(str, "%lf", &f); /* f = 123.; */
11879 along = dummy_long((unsigned long)f);
11880 aint = dummy_int((unsigned int)f);
11881 ashort = dummy_short((unsigned short)f);
11882 if (along != (unsigned long)123)
11884 if (aint != (unsigned int)123)
11886 if (ashort != (unsigned short)123)
11893 if eval $compile_ok; then
11894 $run ./try 2>/dev/null
11897 echo "(I can't seem to compile the test program--assuming it can't)"
11900 case "$castflags" in
11902 echo "Yup, it can."
11905 echo "Nope, it can't."
11912 : see if cbrt exists
11916 : see if chown exists
11920 : see if chroot exists
11921 set chroot d_chroot
11924 : see if chsize exists
11925 set chsize d_chsize
11928 : see if class exists
11932 : see if clearenv exists
11933 set clearenv d_clearenv
11936 : Define hasstruct macro for Configure internal use
11937 hasstruct='varname=$1; struct=$2; shift; shift;
11938 while $test $# -ge 2; do
11940 $define) echo "#include <$2>";;
11944 echo "int main () { struct $struct foo; }" >> try.c;
11946 if eval $compile; then
11955 : see whether socket exists
11959 $echo $n "Hmm... $c" >&4
11960 if set socket val -f d_socket; eval $csym; $val; then
11961 echo "Looks like you have Berkeley networking support." >&4
11963 if set setsockopt val -f; eval $csym; $val; then
11966 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11967 d_oldsock="$define"
11970 if $contains socklib libc.list >/dev/null 2>&1; then
11971 echo "Looks like you have Berkeley networking support." >&4
11973 : we will have to assume that it supports the 4.2 BSD interface
11976 echo "You don't have Berkeley networking in libc$_a..." >&4
11977 if test "X$d_socket" = "X$define"; then
11978 echo "...but you seem to believe that you have sockets." >&4
11980 for net in net socket
11982 if test -f $sysroot/usr/lib/lib$net$_a; then
11983 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11984 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11985 if $contains socket libc.list >/dev/null 2>&1; then
11990 echo "...but the Wollongong group seems to have hacked it in." >&4
11991 sockethdr="-I$sysroot/usr/netinclude"
11994 echo "Found Berkeley sockets interface in lib$net." >&4
11995 if $contains setsockopt libc.list >/dev/null 2>&1; then
11998 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11999 d_oldsock="$define"
12005 if test "X$d_socket" != "X$define"; then
12006 echo "or anywhere else I see." >&4
12014 : see if socketpair exists
12015 set socketpair d_sockpair
12019 echo "Checking the availability sa_len in the sock struct ..." >&4
12021 #include <sys/types.h>
12022 #include <sys/socket.h>
12024 struct sockaddr sa;
12025 return (sa.sa_len);
12029 set try; if eval $compile; then
12032 set d_sockaddr_sa_len; eval $setvar
12035 echo "Checking the availability struct sockaddr_in6 ..." >&4
12037 #include <sys/types.h>
12038 #include <sys/socket.h>
12039 #include <netinet/in.h>
12041 struct sockaddr_in6 sin6;
12042 return (sin6.sin6_family);
12046 set try; if eval $compile; then
12049 set d_sockaddr_in6; eval $setvar
12052 echo "Checking the availability struct sockaddr_storage ..." >&4
12054 #include <sys/types.h>
12055 #include <sys/socket.h>
12056 #include <netinet/in.h>
12058 struct sockaddr_storage sastor;
12059 return (sastor.ss_family);
12063 set try; if eval $compile; then
12066 set d_sockaddr_storage; eval $setvar
12069 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12071 #include <sys/types.h>
12072 #include <sys/socket.h>
12073 #include <netinet/in.h>
12075 struct sockaddr_in6 sin6;
12076 return (sin6.sin6_scope_id);
12080 set try; if eval $compile; then
12083 set d_sin6_scope_id; eval $setvar
12086 echo "Checking the availability struct ip_mreq ..." >&4
12088 #include <sys/types.h>
12089 #include <sys/socket.h>
12090 #include <netinet/in.h>
12092 struct ip_mreq mreq;
12093 return (mreq.imr_multiaddr.s_addr);
12097 set try; if eval $compile; then
12100 set d_ip_mreq; eval $setvar
12103 echo "Checking the availability struct ip_mreq_source ..." >&4
12105 #include <sys/types.h>
12106 #include <sys/socket.h>
12107 #include <netinet/in.h>
12109 struct ip_mreq_source mreq;
12110 return (mreq.imr_multiaddr.s_addr);
12114 set try; if eval $compile; then
12117 set d_ip_mreq_source; eval $setvar
12120 echo "Checking the availability struct ipv6_mreq ..." >&4
12122 #include <sys/types.h>
12123 #include <sys/socket.h>
12124 #include <netinet/in.h>
12126 struct ipv6_mreq mreq;
12127 return (mreq.ipv6mr_interface);
12131 set try; if eval $compile; then
12134 set d_ipv6_mreq; eval $setvar
12137 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12139 #include <sys/types.h>
12140 #include <sys/socket.h>
12141 #include <netinet/in.h>
12143 struct ipv6_mreq_source mreq;
12144 return (mreq.imr_multiaddr.s_addr);
12148 set try; if eval $compile; then
12151 set d_ipv6_mreq_source; eval $setvar
12154 echo "Checking the availability of certain socket constants..." >&4
12155 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12156 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12158 #include <sys/types.h>
12159 #include <sys/socket.h>
12165 set try; if eval $compile; then
12168 set d_${enum}; eval $setvar
12172 : see if this is a sys/uio.h system
12173 set sys/uio.h i_sysuio
12176 : Check for cmsghdr support
12178 echo "Checking to see if your system supports struct cmsghdr..." >&4
12179 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12181 case "$d_cmsghdr_s" in
12182 "$define") echo "Yes, it does." ;;
12183 *) echo "No, it doesn't." ;;
12186 : see if copysign exists
12187 set copysign d_copysign
12190 : see if copysignl exists
12191 set copysignl d_copysignl
12194 : see if crypt exists
12199 $define) cryptlib='' ;;
12200 *) if set crypt val -f d_crypt; eval $csym; $val; then
12201 echo 'crypt() found.' >&4
12205 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12206 if $test -z "$cryptlib"; then
12207 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12211 if $test -z "$cryptlib"; then
12212 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12216 if $test -z "$cryptlib"; then
12217 cryptlib=`./loc libcrypt$_a "" $libpth`
12221 if $test -z "$cryptlib"; then
12222 echo 'crypt() NOT found.' >&4
12233 : see if this is a crypt.h system
12234 set crypt.h i_crypt
12237 : see if crypt_r exists
12238 set crypt_r d_crypt_r
12240 case "$d_crypt_r" in
12242 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12243 case "$d_crypt_r_proto:$usethreads" in
12244 ":define") d_crypt_r_proto=define
12245 set d_crypt_r_proto crypt_r $hdrs
12249 case "$d_crypt_r_proto" in
12251 case "$crypt_r_proto" in
12252 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12253 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12255 case "$crypt_r_proto" in
12256 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12257 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12259 case "$crypt_r_proto" in
12260 ''|0) d_crypt_r=undef
12262 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12263 * ) case "$crypt_r_proto" in
12264 REENTRANT_PROTO*) ;;
12265 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12267 echo "Prototype: $try" ;;
12270 *) case "$usethreads" in
12271 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12282 : get csh whereabouts
12284 'csh') val="$undef" ;;
12285 *) val="$define" ;;
12289 : Respect a hint or command line value for full_csh.
12290 case "$full_csh" in
12291 '') full_csh=$csh ;;
12294 : see if ctermid exists
12295 set ctermid d_ctermid
12298 : see if ctermid_r exists
12299 set ctermid_r d_ctermid_r
12301 case "$d_ctermid_r" in
12303 hdrs="$i_systypes sys/types.h define stdio.h "
12304 case "$d_ctermid_r_proto:$usethreads" in
12305 ":define") d_ctermid_r_proto=define
12306 set d_ctermid_r_proto ctermid_r $hdrs
12310 case "$d_ctermid_r_proto" in
12312 case "$ctermid_r_proto" in
12313 ''|0) try='char* ctermid_r(char*);'
12314 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12316 case "$ctermid_r_proto" in
12317 ''|0) d_ctermid_r=undef
12319 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12320 * ) case "$ctermid_r_proto" in
12321 REENTRANT_PROTO*) ;;
12322 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12324 echo "Prototype: $try" ;;
12327 *) case "$usethreads" in
12328 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12335 *) ctermid_r_proto=0
12339 : see if ctime_r exists
12340 set ctime_r d_ctime_r
12342 case "$d_ctime_r" in
12344 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12345 case "$d_ctime_r_proto:$usethreads" in
12346 ":define") d_ctime_r_proto=define
12347 set d_ctime_r_proto ctime_r $hdrs
12351 case "$d_ctime_r_proto" in
12353 case "$ctime_r_proto" in
12354 ''|0) try='char* ctime_r(const time_t*, char*);'
12355 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12357 case "$ctime_r_proto" in
12358 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12359 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12361 case "$ctime_r_proto" in
12362 ''|0) try='int ctime_r(const time_t*, char*);'
12363 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12365 case "$ctime_r_proto" in
12366 ''|0) try='int ctime_r(const time_t*, char*, int);'
12367 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12369 case "$ctime_r_proto" in
12370 ''|0) d_ctime_r=undef
12372 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12373 * ) case "$ctime_r_proto" in
12374 REENTRANT_PROTO*) ;;
12375 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12377 echo "Prototype: $try" ;;
12380 *) case "$usethreads" in
12381 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12392 : see if cuserid exists
12393 set cuserid d_cuserid
12396 : see if dbm.h is available
12397 : see if dbmclose exists
12398 set dbmclose d_dbmclose
12401 case "$d_dbmclose" in
12411 *) set rpcsvc/dbm.h i_rpcsvcdbm
12416 *) echo "We won't be including <dbm.h>"
12426 : see if prototype for dbminit is available
12428 set d_dbminitproto dbminit $i_dbm dbm.h
12431 : see if difftime exists
12432 set difftime d_difftime
12435 : see if this is a dirent system
12437 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12439 echo "<dirent.h> found." >&4
12442 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12443 echo "<sys/dir.h> found." >&4
12446 xinc=`./findhdr sys/ndir.h`
12448 echo "<dirent.h> NOT found." >&4
12453 : Look for type of directory structure.
12455 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12457 case "$direntrytype" in
12459 case "$i_dirent" in
12460 $define) guess1='struct dirent' ;;
12461 *) guess1='struct direct' ;;
12464 *) guess1="$direntrytype"
12469 'struct dirent') guess2='struct direct' ;;
12470 *) guess2='struct dirent' ;;
12473 if $contains "$guess1" try.c >/dev/null 2>&1; then
12474 direntrytype="$guess1"
12475 echo "Your directory entries are $direntrytype." >&4
12476 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12477 direntrytype="$guess2"
12478 echo "Your directory entries seem to be $direntrytype." >&4
12480 echo "I don't recognize your system's directory entries." >&4
12481 rp="What type is used for directory entries on this system?"
12484 direntrytype="$ans"
12488 : see if the directory entry stores field length
12490 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12491 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12492 echo "Good, your directory entry keeps length information in d_namlen." >&4
12495 echo "Your directory entry does not know about the d_namlen field." >&4
12502 : Look for DIR.dd_fd
12503 case "$i_dirent" in
12505 echo "Checking to see if DIR has a dd_fd member variable" >&4
12507 #$i_stdlib I_STDLIB
12509 #include <stdlib.h>
12511 #include <dirent.h>
12521 if eval $compile; then
12522 echo "Yes, it does."
12525 echo "No, it does not."
12530 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12538 : see if this is an sysdir system
12539 set sys/dir.h i_sysdir
12542 : see if this is an sysndir system
12543 set sys/ndir.h i_sysndir
12548 $cat >dirfd.c <<EOM
12550 #$i_stdlib I_STDLIB
12552 #include <stdlib.h>
12554 #$i_dirent I_DIRENT /**/
12555 #$i_sysdir I_SYS_DIR /**/
12556 #$i_sysndir I_SYS_NDIR /**/
12557 #$i_systypes I_SYS_TYPES /**/
12558 #if defined(I_SYS_TYPES)
12559 #include <sys/types.h>
12561 #if defined(I_DIRENT)
12562 #include <dirent.h>
12565 #include <sys/ndir.h>
12568 #include <sys/dir.h>
12573 DIR *dirp = opendir(".");
12574 if (dirfd(dirp) >= 0)
12582 if eval $compile; then
12586 $define) echo "dirfd() found." >&4 ;;
12587 *) echo "dirfd() NOT found." >&4 ;;
12593 : see if dladdr exists
12594 set dladdr d_dladdr
12597 : see if dlerror exists
12600 set dlerror d_dlerror
12604 : see if dlfcn is available
12605 set dlfcn.h i_dlfcn
12608 : Check what extension to use for shared libs
12613 On a few systems, the dynamically loaded modules that perl generates and uses
12614 will need a different extension than shared libs. The default will probably
12620 *) dflt="$dlext" ;;
12622 rp='What is the extension of dynamically loaded modules'
12631 : Check if dlsym need a leading underscore
12637 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12638 $cat >dyna.c <<'EOM'
12639 void fred (void) { }
12645 #$i_stdlib I_STDLIB
12647 #include <stdlib.h>
12651 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12653 #include <sys/types.h>
12658 extern void fred(void) ;
12667 int mode = RTLD_LAZY ;
12669 handle = dlopen("./dyna.$dlext", mode) ;
12670 if (handle == NULL) {
12675 symbol = dlsym(handle, "fred") ;
12676 if (symbol == NULL) {
12677 /* try putting a leading underscore */
12678 symbol = dlsym(handle, "_fred") ;
12679 if (symbol == NULL) {
12692 : Call the object file tmp-dyna.o in case dlext=o.
12693 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12694 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12695 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12696 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12699 1) echo "Test program failed using dlopen." >&4
12700 echo "Perhaps you should not use dynamic loading." >&4;;
12701 2) echo "Test program failed using dlsym." >&4
12702 echo "Perhaps you should not use dynamic loading." >&4;;
12703 3) echo "dlsym needs a leading underscore" >&4
12705 4) echo "dlsym doesn't need a leading underscore." >&4;;
12708 echo "I can't compile and run the test program." >&4
12709 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12714 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12719 : see if drand48_r exists
12720 set drand48_r d_drand48_r
12722 case "$d_drand48_r" in
12724 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12725 case "$d_drand48_r_proto:$usethreads" in
12726 ":define") d_drand48_r_proto=define
12727 set d_drand48_r_proto drand48_r $hdrs
12731 case "$d_drand48_r_proto" in
12733 case "$drand48_r_proto" in
12734 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12735 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12737 case "$drand48_r_proto" in
12738 ''|0) d_drand48_r=undef
12740 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12741 * ) case "$drand48_r_proto" in
12742 REENTRANT_PROTO*) ;;
12743 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12745 echo "Prototype: $try" ;;
12748 *) case "$usethreads" in
12749 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12756 *) drand48_r_proto=0
12760 : see if prototype for drand48 is available
12762 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12765 : see if dup2 exists
12769 : see if dup3 exists
12773 : see if localeconv_l exists
12774 set localeconv_l d_localeconv_l
12777 : see if this is an xlocale.h system
12778 set xlocale.h i_xlocale
12781 : see if newlocale exists
12782 set newlocale d_newlocale
12785 : see if freelocale exists
12786 set freelocale d_freelocale
12789 : see if uselocale exists
12790 set uselocale d_uselocale
12793 : see if duplocale exists
12794 set duplocale d_duplocale
12797 : see if querylocale exists
12798 set querylocale d_querylocale
12801 : if we have xlocale.h, check whether it is needed
12802 case "$i_xlocale$d_newlocale$xlocale_needed" in
12804 echo "Checking if xlocale.h is needed..." >&4
12806 #include <locale.h>
12809 #include <xlocale.h>
12811 #$d_localeconv_l HAVE_LOCALECONV_L
12813 #ifdef HAVE_LOCALECONV_L
12814 struct lconv *(*lcptr)(locale_t) = localeconv_l;
12818 locale_t lc = newlocale(LC_ALL_MASK, "C", (locale_t)0);
12820 #ifdef HAVE_LOCALECONV_L
12821 /* FreeBSD hides only localeconv_l() in xlocale.h */
12822 struct lconv *lcbuf = localeconv_l(lc);
12823 printf("decimal: %s\n", lcbuf->decimal_point);
12831 if eval $compile && $run ./try > /dev/null 2>&1 ; then
12832 echo "xlocale.h isn't needed" >&4
12833 xlocale_needed=$undef
12835 set try -DTRY_XLOCALE
12836 if eval $compile && $run ./try > /dev/null 2>&1 ; then
12837 xlocale_needed=$define
12838 echo "xlocale.h is needed" >&4
12840 echo "I can't build my test either way" >&4
12841 xlocale_needed=$undef
12846 *) xlocale_needed=$undef ;;
12849 : see if eaccess exists
12850 set eaccess d_eaccess
12853 : see if endgrent exists
12854 set endgrent d_endgrent
12857 : see if this is an grp system
12863 xxx=`./findhdr grp.h`
12864 $cppstdin $cppflags $cppminus < $xxx >$$.h
12866 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12878 set d_grpasswd; eval $setvar
12882 : see if endgrent_r exists
12883 set endgrent_r d_endgrent_r
12885 case "$d_endgrent_r" in
12887 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12888 case "$d_endgrent_r_proto:$usethreads" in
12889 ":define") d_endgrent_r_proto=define
12890 set d_endgrent_r_proto endgrent_r $hdrs
12894 case "$d_endgrent_r_proto" in
12896 case "$endgrent_r_proto" in
12897 ''|0) try='int endgrent_r(FILE**);'
12898 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12900 case "$endgrent_r_proto" in
12901 ''|0) try='void endgrent_r(FILE**);'
12902 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12904 case "$endgrent_r_proto" in
12905 ''|0) d_endgrent_r=undef
12907 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12908 * ) case "$endgrent_r_proto" in
12909 REENTRANT_PROTO*) ;;
12910 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12912 echo "Prototype: $try" ;;
12915 *) case "$usethreads" in
12916 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12923 *) endgrent_r_proto=0
12927 : see if endhostent exists
12928 set endhostent d_endhent
12931 : see if this is a netdb.h system
12932 set netdb.h i_netdb
12935 : see if endhostent_r exists
12936 set endhostent_r d_endhostent_r
12938 case "$d_endhostent_r" in
12940 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12941 case "$d_endhostent_r_proto:$usethreads" in
12942 ":define") d_endhostent_r_proto=define
12943 set d_endhostent_r_proto endhostent_r $hdrs
12947 case "$d_endhostent_r_proto" in
12949 case "$endhostent_r_proto" in
12950 ''|0) try='int endhostent_r(struct hostent_data*);'
12951 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12953 case "$endhostent_r_proto" in
12954 ''|0) try='void endhostent_r(struct hostent_data*);'
12955 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12957 case "$endhostent_r_proto" in
12958 ''|0) d_endhostent_r=undef
12959 endhostent_r_proto=0
12960 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12961 * ) case "$endhostent_r_proto" in
12962 REENTRANT_PROTO*) ;;
12963 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12965 echo "Prototype: $try" ;;
12968 *) case "$usethreads" in
12969 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12971 d_endhostent_r=undef
12972 endhostent_r_proto=0
12976 *) endhostent_r_proto=0
12980 : see if endnetent exists
12981 set endnetent d_endnent
12984 : see if endnetent_r exists
12985 set endnetent_r d_endnetent_r
12987 case "$d_endnetent_r" in
12989 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12990 case "$d_endnetent_r_proto:$usethreads" in
12991 ":define") d_endnetent_r_proto=define
12992 set d_endnetent_r_proto endnetent_r $hdrs
12996 case "$d_endnetent_r_proto" in
12998 case "$endnetent_r_proto" in
12999 ''|0) try='int endnetent_r(struct netent_data*);'
13000 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
13002 case "$endnetent_r_proto" in
13003 ''|0) try='void endnetent_r(struct netent_data*);'
13004 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
13006 case "$endnetent_r_proto" in
13007 ''|0) d_endnetent_r=undef
13008 endnetent_r_proto=0
13009 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
13010 * ) case "$endnetent_r_proto" in
13011 REENTRANT_PROTO*) ;;
13012 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13014 echo "Prototype: $try" ;;
13017 *) case "$usethreads" in
13018 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13020 d_endnetent_r=undef
13021 endnetent_r_proto=0
13025 *) endnetent_r_proto=0
13029 : see if endprotoent exists
13030 set endprotoent d_endpent
13033 : see if endprotoent_r exists
13034 set endprotoent_r d_endprotoent_r
13036 case "$d_endprotoent_r" in
13038 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13039 case "$d_endprotoent_r_proto:$usethreads" in
13040 ":define") d_endprotoent_r_proto=define
13041 set d_endprotoent_r_proto endprotoent_r $hdrs
13045 case "$d_endprotoent_r_proto" in
13047 case "$endprotoent_r_proto" in
13048 ''|0) try='int endprotoent_r(struct protoent_data*);'
13049 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13051 case "$endprotoent_r_proto" in
13052 ''|0) try='void endprotoent_r(struct protoent_data*);'
13053 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13055 case "$endprotoent_r_proto" in
13056 ''|0) d_endprotoent_r=undef
13057 endprotoent_r_proto=0
13058 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13059 * ) case "$endprotoent_r_proto" in
13060 REENTRANT_PROTO*) ;;
13061 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13063 echo "Prototype: $try" ;;
13066 *) case "$usethreads" in
13067 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13069 d_endprotoent_r=undef
13070 endprotoent_r_proto=0
13074 *) endprotoent_r_proto=0
13078 : see if endpwent exists
13079 set endpwent d_endpwent
13082 : see if this is a pwd.h system
13088 xxx=`./findhdr pwd.h`
13089 $cppstdin $cppflags $cppminus < $xxx >$$.h
13091 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13099 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13107 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13115 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13123 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13131 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13139 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13147 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13159 set d_pwquota; eval $setvar
13160 set d_pwage; eval $setvar
13161 set d_pwchange; eval $setvar
13162 set d_pwclass; eval $setvar
13163 set d_pwexpire; eval $setvar
13164 set d_pwcomment; eval $setvar
13165 set d_pwgecos; eval $setvar
13166 set d_pwpasswd; eval $setvar
13170 : see if endpwent_r exists
13171 set endpwent_r d_endpwent_r
13173 case "$d_endpwent_r" in
13175 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13176 case "$d_endpwent_r_proto:$usethreads" in
13177 ":define") d_endpwent_r_proto=define
13178 set d_endpwent_r_proto endpwent_r $hdrs
13182 case "$d_endpwent_r_proto" in
13184 case "$endpwent_r_proto" in
13185 ''|0) try='int endpwent_r(FILE**);'
13186 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13188 case "$endpwent_r_proto" in
13189 ''|0) try='void endpwent_r(FILE**);'
13190 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13192 case "$endpwent_r_proto" in
13193 ''|0) d_endpwent_r=undef
13195 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13196 * ) case "$endpwent_r_proto" in
13197 REENTRANT_PROTO*) ;;
13198 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13200 echo "Prototype: $try" ;;
13203 *) case "$usethreads" in
13204 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13211 *) endpwent_r_proto=0
13215 : see if endservent exists
13216 set endservent d_endsent
13219 : see if endservent_r exists
13220 set endservent_r d_endservent_r
13222 case "$d_endservent_r" in
13224 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13225 case "$d_endservent_r_proto:$usethreads" in
13226 ":define") d_endservent_r_proto=define
13227 set d_endservent_r_proto endservent_r $hdrs
13231 case "$d_endservent_r_proto" in
13233 case "$endservent_r_proto" in
13234 ''|0) try='int endservent_r(struct servent_data*);'
13235 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13237 case "$endservent_r_proto" in
13238 ''|0) try='void endservent_r(struct servent_data*);'
13239 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13241 case "$endservent_r_proto" in
13242 ''|0) d_endservent_r=undef
13243 endservent_r_proto=0
13244 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13245 * ) case "$endservent_r_proto" in
13246 REENTRANT_PROTO*) ;;
13247 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13249 echo "Prototype: $try" ;;
13252 *) case "$usethreads" in
13253 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13255 d_endservent_r=undef
13256 endservent_r_proto=0
13260 *) endservent_r_proto=0
13264 : Locate the flags for 'open()'
13267 #include <sys/types.h>
13272 #include <sys/file.h>
13274 #$i_stdlib I_STDLIB
13276 #include <stdlib.h>
13287 : check sys/file.h first to get FREAD on Sun
13288 if $test `./findhdr sys/file.h` && \
13289 set try -DI_SYS_FILE && eval $compile; then
13291 echo "<sys/file.h> defines the O_* constants..." >&4
13292 if $run ./try; then
13293 echo "and you have the 3 argument form of open()." >&4
13296 echo "but not the 3 argument form of open(). Oh, well." >&4
13299 elif $test `./findhdr fcntl.h` && \
13300 set try -DI_FCNTL && eval $compile; then
13302 echo "<fcntl.h> defines the O_* constants..." >&4
13303 if $run ./try; then
13304 echo "and you have the 3 argument form of open()." >&4
13307 echo "but not the 3 argument form of open(). Oh, well." >&4
13312 echo "I can't find the O_* constant definitions! You got problems." >&4
13318 : see if this is a sys/file.h system
13323 : do we need to include sys/file.h ?
13327 if $h_sysfile; then
13329 echo "We'll be including <sys/file.h>." >&4
13332 echo "We won't be including <sys/file.h>." >&4
13342 : see if fcntl.h is there
13347 : see if we can include fcntl.h
13353 echo "We'll be including <fcntl.h>." >&4
13356 if $h_sysfile; then
13357 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13359 echo "We won't be including <fcntl.h>." >&4
13371 : see if fork exists
13375 : see if pipe exists
13379 : check for non-blocking I/O stuff
13380 case "$h_sysfile" in
13381 true) echo "#include <sys/file.h>" > head.c;;
13384 true) echo "#include <fcntl.h>" > head.c;;
13385 *) echo "#include <sys/fcntl.h>" > head.c;;
13390 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13391 case "$o_nonblock" in
13393 $cat head.c > try.c
13394 $cat >>try.c <<EOCP
13396 #$i_stdlib I_STDLIB
13398 #include <stdlib.h>
13406 printf("O_NONBLOCK\n");
13410 printf("O_NDELAY\n");
13414 printf("FNDELAY\n");
13421 if eval $compile_ok; then
13422 o_nonblock=`$run ./try`
13423 case "$o_nonblock" in
13424 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13425 *) echo "Seems like we can use $o_nonblock.";;
13428 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13431 *) echo "Using $hint value $o_nonblock.";;
13436 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13439 case "$d_fork:$d_pipe:$d_alarm" in
13440 define:define:define)
13441 $cat head.c > try.c
13442 $cat >>try.c <<EOCP
13444 #include <sys/types.h>
13445 #include <signal.h>
13447 #$i_stdlib I_STDLIB
13449 #include <stdlib.h>
13455 #define MY_O_NONBLOCK $o_nonblock
13456 #ifndef errno /* XXX need better Configure test */
13459 #$i_unistd I_UNISTD
13461 #include <unistd.h>
13463 #include <string.h>
13464 $signal_t blech(int x) { exit(3); }
13466 $cat >> try.c <<'EOCP'
13475 ret = pipe(pd); /* Down: child -> parent */
13478 ret = pipe(pu); /* Up: parent -> child */
13482 close(pd[1]); /* Parent reads from pd[0] */
13483 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13485 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13490 signal(SIGALRM, blech);
13492 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13494 sprintf(string, "%d\n", ret);
13495 ret = write(2, string, strlen(string));
13496 if (ret != strlen(string))
13500 if (errno == EAGAIN) {
13501 printf("EAGAIN\n");
13506 if (errno == EWOULDBLOCK)
13507 printf("EWOULDBLOCK\n");
13510 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13513 sleep(2); /* Give it time to close our pipe */
13515 ret = read(pd[0], buf, 1); /* Should read EOF */
13517 sprintf(string, "%d\n", ret);
13518 ret = write(4, string, strlen(string));
13519 if (ret != strlen(string))
13524 close(pd[0]); /* We write to pd[1] */
13525 close(pu[1]); /* We read from pu[0] */
13526 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13529 close(pd[1]); /* Pipe pd is now fully closed! */
13530 exit(0); /* Bye bye, thank you for playing! */
13534 if eval $compile_ok; then
13535 echo "$startsh" >mtry
13536 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13538 $run ./mtry >/dev/null 2>&1
13540 0) eagain=`$cat try.out`;;
13541 1) echo "Could not perform non-blocking setting!";;
13542 2) echo "I did a successful read() for something that was not there!";;
13543 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13544 4) echo "Could not find F_SETFL!";;
13545 *) echo "Something terribly wrong happened during testing.";;
13547 rd_nodata=`$cat try.ret`
13548 echo "A read() system call with no data present returns $rd_nodata."
13549 case "$rd_nodata" in
13552 echo "(That's peculiar, fixing that to be -1.)"
13558 echo "Forcing errno EAGAIN on read() with no data available."
13562 echo "Your read() sets errno to $eagain when no data is available."
13565 status=`$cat try.err`
13567 0) echo "And it correctly returns 0 to signal EOF.";;
13568 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13569 *) echo "However, your read() returns '$status' on EOF??";;
13572 if test "$status" = "$rd_nodata"; then
13573 echo "WARNING: you can't distinguish between EOF and no data!"
13577 echo "I can't compile the test program--assuming errno EAGAIN will do."
13581 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13590 echo "Using $hint value $eagain."
13591 echo "Your read() returns $rd_nodata when no data is present."
13592 case "$d_eofnblk" in
13593 "$define") echo "And you can see EOF because read() returns 0.";;
13594 "$undef") echo "But you can't see EOF status from read() returned value.";;
13596 echo "(Assuming you can't see EOF status from read anyway.)"
13602 $rm_try head.c mtry
13604 : see if erf exists
13608 : see if erfc exists
13612 : see if exp2 exists
13616 : see if expm1 exists
13620 : see if _ptr and _cnt from stdio act std
13623 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13624 echo "(Looks like you have stdio.h from BSD.)"
13625 case "$stdio_ptr" in
13626 '') stdio_ptr='((fp)->_p)'
13629 *) ptr_lval=$d_stdio_ptr_lval;;
13631 case "$stdio_cnt" in
13632 '') stdio_cnt='((fp)->_r)'
13635 *) cnt_lval=$d_stdio_cnt_lval;;
13637 case "$stdio_base" in
13638 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13640 case "$stdio_bufsiz" in
13641 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13643 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13644 echo "(Looks like you have stdio.h from Linux.)"
13645 case "$stdio_ptr" in
13646 '') stdio_ptr='((fp)->_IO_read_ptr)'
13649 *) ptr_lval=$d_stdio_ptr_lval;;
13651 case "$stdio_cnt" in
13652 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13655 *) cnt_lval=$d_stdio_cnt_lval;;
13657 case "$stdio_base" in
13658 '') stdio_base='((fp)->_IO_read_base)';;
13660 case "$stdio_bufsiz" in
13661 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13664 case "$stdio_ptr" in
13665 '') stdio_ptr='((fp)->_ptr)'
13668 *) ptr_lval=$d_stdio_ptr_lval;;
13670 case "$stdio_cnt" in
13671 '') stdio_cnt='((fp)->_cnt)'
13674 *) cnt_lval=$d_stdio_cnt_lval;;
13676 case "$stdio_base" in
13677 '') stdio_base='((fp)->_base)';;
13679 case "$stdio_bufsiz" in
13680 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13684 : test whether _ptr and _cnt really work
13685 echo "Checking how std your stdio is..." >&4
13688 #$i_stdlib I_STDLIB
13690 #include <stdlib.h>
13692 #include <string.h>
13693 #define FILE_ptr(fp) $stdio_ptr
13694 #define FILE_cnt(fp) $stdio_cnt
13696 FILE *fp = fopen("try.c", "r");
13699 18 <= FILE_cnt(fp) &&
13700 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13708 if eval $compile && $to try.c; then
13709 if $run ./try; then
13710 echo "Your stdio acts pretty std."
13713 echo "Your stdio isn't very std."
13716 echo "Your stdio doesn't appear very std."
13720 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13721 # direct buffer manipulation no longer works. The Configure tests
13722 # should be changed to correctly detect this, but until then,
13723 # the following check should at least let perl compile and run.
13724 # (This quick fix should be updated before 5.8.1.)
13725 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13726 # A. Dougherty, June 3, 2002.
13727 case "$d_gnulibc" in
13729 case "$gnulibc_version" in
13733 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13742 : Can _ptr be used as an lvalue?
13743 case "$d_stdstdio$ptr_lval" in
13744 $define$define) val=$define ;;
13747 set d_stdio_ptr_lval
13750 : Can _cnt be used as an lvalue?
13751 case "$d_stdstdio$cnt_lval" in
13752 $define$define) val=$define ;;
13755 set d_stdio_cnt_lval
13759 : test whether setting _ptr sets _cnt as a side effect
13760 d_stdio_ptr_lval_sets_cnt="$undef"
13761 d_stdio_ptr_lval_nochange_cnt="$undef"
13762 case "$d_stdio_ptr_lval$d_stdstdio" in
13764 echo "Checking to see what happens if we set the stdio ptr..." >&4
13767 /* Can we scream? */
13768 /* Eat dust sed :-) */
13769 /* In the buffer space, no one can hear you scream. */
13770 #$i_stdlib I_STDLIB
13772 #include <stdlib.h>
13774 #define FILE_ptr(fp) $stdio_ptr
13775 #define FILE_cnt(fp) $stdio_cnt
13776 #include <sys/types.h>
13778 FILE *fp = fopen("try.c", "r");
13783 puts("Fail even to read");
13786 c = getc(fp); /* Read away the first # */
13788 puts("Fail even to read");
13792 18 <= FILE_cnt(fp) &&
13793 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13795 puts("Fail even to read");
13798 ptr = (char*) FILE_ptr(fp);
13799 cnt = (size_t)FILE_cnt(fp);
13801 FILE_ptr(fp) += 42;
13803 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13804 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13807 if (FILE_cnt(fp) <= 20) {
13808 printf ("Fail (<20 chars to test)");
13811 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13812 puts("Fail compare");
13815 if (cnt == FILE_cnt(fp)) {
13816 puts("Pass_unchanged");
13819 if (FILE_cnt(fp) == (cnt - 42)) {
13820 puts("Pass_changed");
13823 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13829 if eval $compile && $to try.c; then
13830 case `$run ./try` in
13832 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13833 d_stdio_ptr_lval_sets_cnt="$define" ;;
13835 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13836 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13838 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13840 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13843 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13849 : see if _base is also standard
13851 case "$d_stdstdio" in
13855 #$i_stdlib I_STDLIB
13857 #include <stdlib.h>
13859 #define FILE_base(fp) $stdio_base
13860 #define FILE_bufsiz(fp) $stdio_bufsiz
13862 FILE *fp = fopen("try.c", "r");
13865 19 <= FILE_bufsiz(fp) &&
13866 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13873 if eval $compile && $to try.c; then
13874 if $run ./try; then
13875 echo "And its _base field acts std."
13878 echo "But its _base field isn't std."
13881 echo "However, it seems to be lacking the _base field."
13889 : see if fast_stdio exists
13891 case "$d_stdstdio:$d_stdio_ptr_lval" in
13893 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13895 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >&4
13904 : see if fchdir exists
13905 set fchdir d_fchdir
13908 : see if fchmod exists
13909 set fchmod d_fchmod
13912 : check for openat, unlinkat, renameat, linkat, fchmodat
13913 set openat d_openat
13916 set unlinkat d_unlinkat
13919 set renameat d_renameat
13922 set linkat d_linkat
13925 set fchmodat d_fchmodat
13928 : see if fchown exists
13929 set fchown d_fchown
13932 : see if this is an fcntl system
13936 : See if fcntl-based locking works.
13939 #$i_stdlib I_STDLIB
13941 #include <stdlib.h>
13943 #include <unistd.h>
13945 #include <signal.h>
13946 $signal_t blech(int x) { exit(3); }
13948 #if defined(F_SETLK) && defined(F_SETLKW)
13949 struct flock flock;
13951 fd = open("try.c", O_RDONLY);
13952 flock.l_type = F_RDLCK;
13953 flock.l_whence = SEEK_SET;
13954 flock.l_start = flock.l_len = 0;
13955 signal(SIGALRM, blech);
13957 retval = fcntl(fd, F_SETLK, &flock);
13959 (retval < 0 ? exit(2) : exit(0));
13965 echo "Checking if fcntl-based file locking works... "
13969 if eval $compile_ok; then
13970 if $run ./try; then
13971 echo "Yes, it seems to work."
13974 echo "Nope, it didn't work."
13979 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13980 *** This is (almost) impossible.
13981 *** If your NFS lock daemons are not feeling well, something like
13982 *** this may happen, please investigate. Cannot continue, aborting.
13990 echo "I'm unable to compile the test program, so I'll assume not."
13995 echo "Nope, since you don't even have fcntl()."
13998 set d_fcntl_can_lock
14002 : check for fd_set items
14005 Checking to see how well your C compiler handles fd_set and friends ...
14008 #$i_stdlib I_STDLIB
14010 #include <stdlib.h>
14012 #$i_systime I_SYS_TIME
14013 #$i_sysselct I_SYS_SELECT
14014 #$d_socket HAS_SOCKET
14015 #include <sys/types.h>
14017 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14020 #include <sys/time.h>
14022 #ifdef I_SYS_SELECT
14023 #include <sys/select.h>
14032 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14040 if eval $compile; then
14041 d_fds_bits="$define"
14043 echo "Well, your system knows about the normal fd_set typedef..." >&4
14044 if $run ./try; then
14045 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14046 d_fd_macros="$define"
14049 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14051 d_fd_macros="$undef"
14055 Hmm, your compiler has some difficulty with fd_set. Checking further...
14058 if eval $compile; then
14059 d_fds_bits="$undef"
14061 echo "Well, your system has some sort of fd_set available..." >&4
14062 if $run ./try; then
14063 echo "and you have the normal fd_set macros." >&4
14064 d_fd_macros="$define"
14067 but not the normal fd_set macros! Gross! More work for me...
14069 d_fd_macros="$undef"
14072 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14074 d_fds_bits="$undef"
14075 d_fd_macros="$undef"
14080 : see if fdclose exists
14081 set fdclose d_fdclose
14084 : see if fdim exists
14088 : see if fegetround exists
14089 set fegetround d_fegetround
14092 : see if ffs exists
14095 : see if ffsl exists
14099 : see if fgetpos exists
14100 set fgetpos d_fgetpos
14103 : see if finite exists
14104 set finite d_finite
14107 : see if finitel exists
14108 set finitel d_finitel
14111 : see if flock exists
14115 : see if prototype for flock is available
14117 set d_flockproto flock $i_sysfile sys/file.h
14120 : see if fma exists
14124 : see if fmax exists
14128 : see if fmin exists
14132 : see if fp_class exists
14133 set fp_class d_fp_class
14136 : check for fpclassify
14137 echo "Checking to see if you have fpclassify..." >&4
14140 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14143 if eval $compile; then
14145 echo "You have fpclassify."
14148 echo "You do not have fpclassify."
14154 : see if fp_classify exists
14155 set fp_classify d_fp_classify
14158 : see if fp_classl exists
14159 set fp_classl d_fp_classl
14162 : see if pathconf exists
14163 set pathconf d_pathconf
14166 : see if fpathconf exists
14167 set fpathconf d_fpathconf
14170 : see if fpclass exists
14171 set fpclass d_fpclass
14174 : see if fpclassl exists
14175 set fpclassl d_fpclassl
14178 : see if fpgetround exists
14179 set fpgetround d_fpgetround
14182 : check for fpos64_t
14184 echo "Checking to see if you have fpos64_t..." >&4
14187 int main() { fpos64_t x = 7; }
14190 if eval $compile; then
14192 echo "You have fpos64_t."
14195 echo "You do not have fpos64_t."
14196 case "$fpossize" in
14197 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14204 : see if frexpl exists
14205 set frexpl d_frexpl
14208 : see if this is a sys/param system
14209 set sys/param.h i_sysparam
14212 : see if this is a sys/mount.h system
14213 set sys/mount.h i_sysmount
14216 : Check for fs_data_s
14218 echo "Checking to see if your system supports struct fs_data..." >&4
14219 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14221 case "$d_fs_data_s" in
14222 "$define") echo "Yes, it does." ;;
14223 *) echo "No, it doesn't." ;;
14226 : see if fseeko exists
14227 set fseeko d_fseeko
14229 case "$longsize" in
14230 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14233 : see if fsetpos exists
14234 set fsetpos d_fsetpos
14237 : see if fstatfs exists
14238 set fstatfs d_fstatfs
14241 : see if statvfs exists
14242 set statvfs d_statvfs
14245 : see if fstatvfs exists
14246 set fstatvfs d_fstatvfs
14249 : see if fsync exists
14253 : see if ftello exists
14254 set ftello d_ftello
14256 case "$longsize" in
14257 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14260 : check for a working futimes
14263 echo "Checking if you have a working futimes()" >&4
14266 #include <stdlib.h>
14267 #include <sys/time.h>
14270 #include <stdlib.h>
14275 fd = open ("try.c", O_RDWR);
14276 if (-1 == fd) exit (1);
14277 rv = futimes (fd, NULL);
14278 exit (rv == -1 ? errno : 0);
14282 if eval $compile; then
14286 0) echo "Yes, you have" >&4
14287 d_futimes="$define"
14289 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14293 echo "No, it does not (probably harmless)" >&4
14297 : look for gai_strerror
14299 $cat >try.c <<'EOCP'
14300 #include <sys/types.h>
14301 #include <sys/socket.h>
14305 return (gai_strerror (0) ? 0 : 1);
14310 if eval $compile; then
14313 0) echo "A working gai_strerror() found." >&4
14315 *) echo "gai_strerror() found, but it doesn't work" >&4
14319 echo "gai_strerror() NOT found." >&4
14325 : see if ndbm.h is available
14328 : Compatibility location for RedHat 7.1
14329 set gdbm/ndbm.h i_gdbmndbm
14331 : Compatibility location for Debian 4.0
14332 set gdbm-ndbm.h i_gdbm_ndbm
14336 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14337 : see if dbm_open exists
14338 set dbm_open d_dbm_open
14340 case "$d_dbm_open" in
14343 i_gdbmndbm="$undef"
14344 i_gdbm_ndbm="$undef"
14345 echo "We won't be including <ndbm.h>"
14355 ndbm_hdr_protochk='name=$1; hdr=$2;
14356 eval "ihdr=\$""i_$name";
14358 if $test "$ihdr" = "$define"; then
14359 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14360 case "$d_cplusplus" in
14361 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14362 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14365 $define) $echo "Your <$hdr> seems to have prototypes";;
14366 *) $echo "Your <$hdr> does not seem to have prototypes";;
14369 set "d_${name}_h_uses_prototypes";
14373 eval $ndbm_hdr_protochk
14374 set gdbmndbm gdbm/ndbm.h
14375 eval $ndbm_hdr_protochk
14376 set gdbm_ndbm gdbm-ndbm.h
14377 eval $ndbm_hdr_protochk
14379 : see if getaddrinfo exists
14380 set getaddrinfo d_getaddrinfo
14383 : see if getcwd exists
14384 set getcwd d_getcwd
14387 : check for getenv behavior
14388 case "$d_getenv_preserves_other_thread" in
14390 $echo "Checking to see if getenv() preserves a different thread's results" >&4
14392 #$i_stdlib I_STDLIB
14394 # include <stdlib.h>
14397 #include <string.h>
14398 #$i_pthread I_PTHREAD
14400 # include <pthread.h>
14404 thread_start(void * arg)
14406 return (void *) getenv("HOME");
14410 char * main_buffer;
14411 char save_main_buffer[1000];
14412 pthread_t subthread;
14413 pthread_attr_t attr;
14415 main_buffer = getenv("PATH");
14417 /* If too large for our generous allowance, return we couldn't figure it
14419 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
14423 strcpy(save_main_buffer, main_buffer);
14425 if (pthread_attr_init(&attr) != 0) {
14429 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
14433 if (pthread_join(subthread, NULL) != 0) {
14437 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
14442 if eval $compile_ok; then
14446 0) echo "getenv() didn't destroy another thread's buffer" >&4
14449 1) echo "getenv() does destroy another thread's buffer" >&4
14452 *) echo "Couldn't determine if getenv() destroys another thread's return value (code=$rc); assuming it does" >&4
14457 echo "(I can't seem to compile the test program.)" >&4
14458 echo "Assuming that your C library's getenv destroys another thread's return value." >&4
14461 set d_getenv_preserves_other_thread
14467 : see if getespwnam exists
14468 set getespwnam d_getespwnam
14471 : see if getfsstat exists
14472 set getfsstat d_getfsstat
14475 : see if getgrent exists
14476 set getgrent d_getgrent
14479 : see if getgrent_r exists
14480 set getgrent_r d_getgrent_r
14482 case "$d_getgrent_r" in
14484 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14485 case "$d_getgrent_r_proto:$usethreads" in
14486 ":define") d_getgrent_r_proto=define
14487 set d_getgrent_r_proto getgrent_r $hdrs
14491 case "$d_getgrent_r_proto" in
14493 case "$getgrent_r_proto" in
14494 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14495 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14497 case "$getgrent_r_proto" in
14498 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14499 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14501 case "$getgrent_r_proto" in
14502 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14503 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14505 case "$getgrent_r_proto" in
14506 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14507 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14509 case "$getgrent_r_proto" in
14510 ''|0) try='int getgrent_r(struct group*, char*, int);'
14511 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14513 case "$getgrent_r_proto" in
14514 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14515 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14517 case "$getgrent_r_proto" in
14518 ''|0) d_getgrent_r=undef
14520 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14521 * ) case "$getgrent_r_proto" in
14522 REENTRANT_PROTO*) ;;
14523 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14525 echo "Prototype: $try" ;;
14528 *) case "$usethreads" in
14529 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14536 *) getgrent_r_proto=0
14540 : see if getgrgid_r exists
14541 set getgrgid_r d_getgrgid_r
14543 case "$d_getgrgid_r" in
14545 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14546 case "$d_getgrgid_r_proto:$usethreads" in
14547 ":define") d_getgrgid_r_proto=define
14548 set d_getgrgid_r_proto getgrgid_r $hdrs
14552 case "$d_getgrgid_r_proto" in
14554 case "$getgrgid_r_proto" in
14555 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14556 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14558 case "$getgrgid_r_proto" in
14559 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14560 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14562 case "$getgrgid_r_proto" in
14563 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14564 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14566 case "$getgrgid_r_proto" in
14567 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14568 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14570 case "$getgrgid_r_proto" in
14571 ''|0) d_getgrgid_r=undef
14573 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14574 * ) case "$getgrgid_r_proto" in
14575 REENTRANT_PROTO*) ;;
14576 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14578 echo "Prototype: $try" ;;
14581 *) case "$usethreads" in
14582 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14589 *) getgrgid_r_proto=0
14593 : see if getgrnam_r exists
14594 set getgrnam_r d_getgrnam_r
14596 case "$d_getgrnam_r" in
14598 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14599 case "$d_getgrnam_r_proto:$usethreads" in
14600 ":define") d_getgrnam_r_proto=define
14601 set d_getgrnam_r_proto getgrnam_r $hdrs
14605 case "$d_getgrnam_r_proto" in
14607 case "$getgrnam_r_proto" in
14608 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14609 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14611 case "$getgrnam_r_proto" in
14612 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14613 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14615 case "$getgrnam_r_proto" in
14616 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14617 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14619 case "$getgrnam_r_proto" in
14620 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14621 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14623 case "$getgrnam_r_proto" in
14624 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14625 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14627 case "$getgrnam_r_proto" in
14628 ''|0) d_getgrnam_r=undef
14630 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14631 * ) case "$getgrnam_r_proto" in
14632 REENTRANT_PROTO*) ;;
14633 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14635 echo "Prototype: $try" ;;
14638 *) case "$usethreads" in
14639 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14646 *) getgrnam_r_proto=0
14650 : see if gethostbyaddr exists
14651 set gethostbyaddr d_gethbyaddr
14654 : see if gethostbyname exists
14655 set gethostbyname d_gethbyname
14658 : see if gethostent exists
14659 set gethostent d_gethent
14662 : see how we will look up host name
14665 if set gethostname val -f d_gethname; eval $csym; $val; then
14666 echo 'gethostname() found.' >&4
14667 d_gethname="$define"
14670 if set uname val -f d_uname; eval $csym; $val; then
14673 uname() was found, but you're running xenix, and older versions of xenix
14674 have a broken uname(). If you don't really know whether your xenix is old
14675 enough to have a broken system call, use the default answer.
14680 "$define") dflt=n;;
14682 rp='Is your uname() broken?'
14685 n*) d_uname="$define"; call=uname;;
14688 echo 'uname() found.' >&4
14695 case "$d_gethname" in
14696 '') d_gethname="$undef";;
14699 '') d_uname="$undef";;
14701 case "$d_uname$d_gethname" in
14706 Every now and then someone has a $call() that lies about the hostname
14707 but can't be fixed for political or economic reasons. If you wish, I can
14708 pretend $call() isn't there and maybe compute hostname at run-time
14709 thanks to the '$phostname' command.
14712 rp="Shall I ignore $call() from now on?"
14715 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14718 case "$phostname" in
14719 '') aphostname='';;
14720 *) case "$aphostname" in
14722 *) set X $phostname
14726 file=`./loc $file $file $pth`
14727 aphostname=`echo $file $*`
14732 case "$d_uname$d_gethname" in
14735 case "$phostname" in
14737 echo "There will be no way for $package to get your hostname." >&4;;
14739 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14743 case "$d_phostname" in
14744 '') d_phostname="$undef";;
14747 : see if gethostbyaddr_r exists
14748 set gethostbyaddr_r d_gethostbyaddr_r
14750 case "$d_gethostbyaddr_r" in
14752 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14753 case "$d_gethostbyaddr_r_proto:$usethreads" in
14754 ":define") d_gethostbyaddr_r_proto=define
14755 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14759 case "$d_gethostbyaddr_r_proto" in
14761 case "$gethostbyaddr_r_proto" in
14762 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14763 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14765 case "$gethostbyaddr_r_proto" in
14766 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14767 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14769 case "$gethostbyaddr_r_proto" in
14770 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14771 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14773 case "$gethostbyaddr_r_proto" in
14774 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14775 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14777 case "$gethostbyaddr_r_proto" in
14778 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14779 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14781 case "$gethostbyaddr_r_proto" in
14782 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14783 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14785 case "$gethostbyaddr_r_proto" in
14786 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14787 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14789 case "$gethostbyaddr_r_proto" in
14790 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14791 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14793 case "$gethostbyaddr_r_proto" in
14794 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14795 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14797 case "$gethostbyaddr_r_proto" in
14798 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14799 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14801 case "$gethostbyaddr_r_proto" in
14802 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14803 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14805 case "$gethostbyaddr_r_proto" in
14806 ''|0) d_gethostbyaddr_r=undef
14807 gethostbyaddr_r_proto=0
14808 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14809 * ) case "$gethostbyaddr_r_proto" in
14810 REENTRANT_PROTO*) ;;
14811 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14813 echo "Prototype: $try" ;;
14816 *) case "$usethreads" in
14817 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14819 d_gethostbyaddr_r=undef
14820 gethostbyaddr_r_proto=0
14824 *) gethostbyaddr_r_proto=0
14828 : see if gethostbyname_r exists
14829 set gethostbyname_r d_gethostbyname_r
14831 case "$d_gethostbyname_r" in
14833 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14834 case "$d_gethostbyname_r_proto:$usethreads" in
14835 ":define") d_gethostbyname_r_proto=define
14836 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14840 case "$d_gethostbyname_r_proto" in
14842 case "$gethostbyname_r_proto" in
14843 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14844 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14846 case "$gethostbyname_r_proto" in
14847 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14848 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14850 case "$gethostbyname_r_proto" in
14851 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14852 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14854 case "$gethostbyname_r_proto" in
14855 ''|0) d_gethostbyname_r=undef
14856 gethostbyname_r_proto=0
14857 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14858 * ) case "$gethostbyname_r_proto" in
14859 REENTRANT_PROTO*) ;;
14860 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14862 echo "Prototype: $try" ;;
14865 *) case "$usethreads" in
14866 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14868 d_gethostbyname_r=undef
14869 gethostbyname_r_proto=0
14873 *) gethostbyname_r_proto=0
14877 : see if gethostent_r exists
14878 set gethostent_r d_gethostent_r
14880 case "$d_gethostent_r" in
14882 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14883 case "$d_gethostent_r_proto:$usethreads" in
14884 ":define") d_gethostent_r_proto=define
14885 set d_gethostent_r_proto gethostent_r $hdrs
14889 case "$d_gethostent_r_proto" in
14891 case "$gethostent_r_proto" in
14892 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14893 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14895 case "$gethostent_r_proto" in
14896 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14897 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14899 case "$gethostent_r_proto" in
14900 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14901 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14903 case "$gethostent_r_proto" in
14904 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14905 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14907 case "$gethostent_r_proto" in
14908 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14909 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14911 case "$gethostent_r_proto" in
14912 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14913 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14915 case "$gethostent_r_proto" in
14916 ''|0) d_gethostent_r=undef
14917 gethostent_r_proto=0
14918 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14919 * ) case "$gethostent_r_proto" in
14920 REENTRANT_PROTO*) ;;
14921 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14923 echo "Prototype: $try" ;;
14926 *) case "$usethreads" in
14927 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14929 d_gethostent_r=undef
14930 gethostent_r_proto=0
14934 *) gethostent_r_proto=0
14938 : see if prototypes for various gethostxxx netdb.h functions are available
14940 set d_gethostprotos gethostent $i_netdb netdb.h
14943 : see if getitimer exists
14944 set getitimer d_getitimer
14947 : see if getlogin exists
14948 set getlogin d_getlogin
14951 : see if getlogin_r exists
14952 set getlogin_r d_getlogin_r
14954 case "$d_getlogin_r" in
14956 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14957 case "$d_getlogin_r_proto:$usethreads" in
14958 ":define") d_getlogin_r_proto=define
14959 set d_getlogin_r_proto getlogin_r $hdrs
14963 case "$d_getlogin_r_proto" in
14965 case "$getlogin_r_proto" in
14966 ''|0) try='int getlogin_r(char*, size_t);'
14967 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14969 case "$getlogin_r_proto" in
14970 ''|0) try='int getlogin_r(char*, int);'
14971 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14973 case "$getlogin_r_proto" in
14974 ''|0) try='char* getlogin_r(char*, size_t);'
14975 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14977 case "$getlogin_r_proto" in
14978 ''|0) try='char* getlogin_r(char*, int);'
14979 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14981 case "$getlogin_r_proto" in
14982 ''|0) d_getlogin_r=undef
14984 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14985 * ) case "$getlogin_r_proto" in
14986 REENTRANT_PROTO*) ;;
14987 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14989 echo "Prototype: $try" ;;
14992 *) case "$usethreads" in
14993 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
15000 *) getlogin_r_proto=0
15004 : see if getmnt exists
15005 set getmnt d_getmnt
15008 : see if getmntent exists
15009 set getmntent d_getmntent
15012 : see if getnameinfo exists
15013 set getnameinfo d_getnameinfo
15016 : see if getnetbyaddr exists
15017 set getnetbyaddr d_getnbyaddr
15020 : see if getnetbyname exists
15021 set getnetbyname d_getnbyname
15024 : see if getnetent exists
15025 set getnetent d_getnent
15028 : see if getnetbyaddr_r exists
15029 set getnetbyaddr_r d_getnetbyaddr_r
15031 case "$d_getnetbyaddr_r" in
15033 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15034 case "$d_getnetbyaddr_r_proto:$usethreads" in
15035 ":define") d_getnetbyaddr_r_proto=define
15036 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
15040 case "$d_getnetbyaddr_r_proto" in
15042 case "$getnetbyaddr_r_proto" in
15043 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
15044 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
15046 case "$getnetbyaddr_r_proto" in
15047 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
15048 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
15050 case "$getnetbyaddr_r_proto" in
15051 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
15052 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
15054 case "$getnetbyaddr_r_proto" in
15055 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
15056 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
15058 case "$getnetbyaddr_r_proto" in
15059 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
15060 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15062 case "$getnetbyaddr_r_proto" in
15063 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15064 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15066 case "$getnetbyaddr_r_proto" in
15067 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15068 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15070 case "$getnetbyaddr_r_proto" in
15071 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15072 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15074 case "$getnetbyaddr_r_proto" in
15075 ''|0) d_getnetbyaddr_r=undef
15076 getnetbyaddr_r_proto=0
15077 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15078 * ) case "$getnetbyaddr_r_proto" in
15079 REENTRANT_PROTO*) ;;
15080 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15082 echo "Prototype: $try" ;;
15085 *) case "$usethreads" in
15086 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15088 d_getnetbyaddr_r=undef
15089 getnetbyaddr_r_proto=0
15093 *) getnetbyaddr_r_proto=0
15097 : see if getnetbyname_r exists
15098 set getnetbyname_r d_getnetbyname_r
15100 case "$d_getnetbyname_r" in
15102 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15103 case "$d_getnetbyname_r_proto:$usethreads" in
15104 ":define") d_getnetbyname_r_proto=define
15105 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15109 case "$d_getnetbyname_r_proto" in
15111 case "$getnetbyname_r_proto" in
15112 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15113 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15115 case "$getnetbyname_r_proto" in
15116 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15117 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15119 case "$getnetbyname_r_proto" in
15120 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15121 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15123 case "$getnetbyname_r_proto" in
15124 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15125 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15127 case "$getnetbyname_r_proto" in
15128 ''|0) d_getnetbyname_r=undef
15129 getnetbyname_r_proto=0
15130 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15131 * ) case "$getnetbyname_r_proto" in
15132 REENTRANT_PROTO*) ;;
15133 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15135 echo "Prototype: $try" ;;
15138 *) case "$usethreads" in
15139 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15141 d_getnetbyname_r=undef
15142 getnetbyname_r_proto=0
15146 *) getnetbyname_r_proto=0
15150 : see if getnetent_r exists
15151 set getnetent_r d_getnetent_r
15153 case "$d_getnetent_r" in
15155 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15156 case "$d_getnetent_r_proto:$usethreads" in
15157 ":define") d_getnetent_r_proto=define
15158 set d_getnetent_r_proto getnetent_r $hdrs
15162 case "$d_getnetent_r_proto" in
15164 case "$getnetent_r_proto" in
15165 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15166 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15168 case "$getnetent_r_proto" in
15169 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15170 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15172 case "$getnetent_r_proto" in
15173 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15174 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15176 case "$getnetent_r_proto" in
15177 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15178 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15180 case "$getnetent_r_proto" in
15181 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15182 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15184 case "$getnetent_r_proto" in
15185 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15186 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15188 case "$getnetent_r_proto" in
15189 ''|0) d_getnetent_r=undef
15190 getnetent_r_proto=0
15191 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15192 * ) case "$getnetent_r_proto" in
15193 REENTRANT_PROTO*) ;;
15194 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15196 echo "Prototype: $try" ;;
15199 *) case "$usethreads" in
15200 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15202 d_getnetent_r=undef
15203 getnetent_r_proto=0
15207 *) getnetent_r_proto=0
15211 : see if prototypes for various getnetxxx netdb.h functions are available
15213 set d_getnetprotos getnetent $i_netdb netdb.h
15216 : see if getpagesize exists
15217 set getpagesize d_getpagsz
15220 : Optional checks for getprotobyname and getprotobynumber
15222 : see if getprotobyname exists
15223 set getprotobyname d_getpbyname
15226 : see if getprotobynumber exists
15227 set getprotobynumber d_getpbynumber
15230 : see if getprotoent exists
15231 set getprotoent d_getpent
15234 : see if getpgid exists
15235 set getpgid d_getpgid
15238 : see if getpgrp2 exists
15239 set getpgrp2 d_getpgrp2
15242 : see if getppid exists
15243 set getppid d_getppid
15246 : see if getpriority exists
15247 set getpriority d_getprior
15250 : see if getprotobyname_r exists
15251 set getprotobyname_r d_getprotobyname_r
15253 case "$d_getprotobyname_r" in
15255 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15256 case "$d_getprotobyname_r_proto:$usethreads" in
15257 ":define") d_getprotobyname_r_proto=define
15258 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15262 case "$d_getprotobyname_r_proto" in
15264 case "$getprotobyname_r_proto" in
15265 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15266 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15268 case "$getprotobyname_r_proto" in
15269 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15270 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15272 case "$getprotobyname_r_proto" in
15273 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15274 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15276 case "$getprotobyname_r_proto" in
15277 ''|0) d_getprotobyname_r=undef
15278 getprotobyname_r_proto=0
15279 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15280 * ) case "$getprotobyname_r_proto" in
15281 REENTRANT_PROTO*) ;;
15282 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15284 echo "Prototype: $try" ;;
15287 *) case "$usethreads" in
15288 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15290 d_getprotobyname_r=undef
15291 getprotobyname_r_proto=0
15295 *) getprotobyname_r_proto=0
15299 : see if getprotobynumber_r exists
15300 set getprotobynumber_r d_getprotobynumber_r
15302 case "$d_getprotobynumber_r" in
15304 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15305 case "$d_getprotobynumber_r_proto:$usethreads" in
15306 ":define") d_getprotobynumber_r_proto=define
15307 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15311 case "$d_getprotobynumber_r_proto" in
15313 case "$getprotobynumber_r_proto" in
15314 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15315 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15317 case "$getprotobynumber_r_proto" in
15318 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15319 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15321 case "$getprotobynumber_r_proto" in
15322 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15323 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15325 case "$getprotobynumber_r_proto" in
15326 ''|0) d_getprotobynumber_r=undef
15327 getprotobynumber_r_proto=0
15328 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15329 * ) case "$getprotobynumber_r_proto" in
15330 REENTRANT_PROTO*) ;;
15331 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15333 echo "Prototype: $try" ;;
15336 *) case "$usethreads" in
15337 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15339 d_getprotobynumber_r=undef
15340 getprotobynumber_r_proto=0
15344 *) getprotobynumber_r_proto=0
15348 : see if getprotoent_r exists
15349 set getprotoent_r d_getprotoent_r
15351 case "$d_getprotoent_r" in
15353 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15354 case "$d_getprotoent_r_proto:$usethreads" in
15355 ":define") d_getprotoent_r_proto=define
15356 set d_getprotoent_r_proto getprotoent_r $hdrs
15360 case "$d_getprotoent_r_proto" in
15362 case "$getprotoent_r_proto" in
15363 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15364 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15366 case "$getprotoent_r_proto" in
15367 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15368 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15370 case "$getprotoent_r_proto" in
15371 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15372 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15374 case "$getprotoent_r_proto" in
15375 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15376 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15378 case "$getprotoent_r_proto" in
15379 ''|0) d_getprotoent_r=undef
15380 getprotoent_r_proto=0
15381 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15382 * ) case "$getprotoent_r_proto" in
15383 REENTRANT_PROTO*) ;;
15384 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15386 echo "Prototype: $try" ;;
15389 *) case "$usethreads" in
15390 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15392 d_getprotoent_r=undef
15393 getprotoent_r_proto=0
15397 *) getprotoent_r_proto=0
15401 : see if prototypes for various getprotoxxx netdb.h functions are available
15403 set d_getprotoprotos getprotoent $i_netdb netdb.h
15406 : see if getprpwnam exists
15407 set getprpwnam d_getprpwnam
15410 : see if getpwent exists
15411 set getpwent d_getpwent
15414 : see if getpwent_r exists
15415 set getpwent_r d_getpwent_r
15417 case "$d_getpwent_r" in
15419 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15420 case "$d_getpwent_r_proto:$usethreads" in
15421 ":define") d_getpwent_r_proto=define
15422 set d_getpwent_r_proto getpwent_r $hdrs
15426 case "$d_getpwent_r_proto" in
15428 case "$getpwent_r_proto" in
15429 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15430 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15432 case "$getpwent_r_proto" in
15433 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15434 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15436 case "$getpwent_r_proto" in
15437 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15438 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15440 case "$getpwent_r_proto" in
15441 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15442 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15444 case "$getpwent_r_proto" in
15445 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15446 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15448 case "$getpwent_r_proto" in
15449 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15450 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15452 case "$getpwent_r_proto" in
15453 ''|0) d_getpwent_r=undef
15455 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15456 * ) case "$getpwent_r_proto" in
15457 REENTRANT_PROTO*) ;;
15458 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15460 echo "Prototype: $try" ;;
15463 *) case "$usethreads" in
15464 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15471 *) getpwent_r_proto=0
15475 : see if getpwnam_r exists
15476 set getpwnam_r d_getpwnam_r
15478 case "$d_getpwnam_r" in
15480 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15481 case "$d_getpwnam_r_proto:$usethreads" in
15482 ":define") d_getpwnam_r_proto=define
15483 set d_getpwnam_r_proto getpwnam_r $hdrs
15487 case "$d_getpwnam_r_proto" in
15489 case "$getpwnam_r_proto" in
15490 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15491 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15493 case "$getpwnam_r_proto" in
15494 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15495 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15497 case "$getpwnam_r_proto" in
15498 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15499 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15501 case "$getpwnam_r_proto" in
15502 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15503 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15505 case "$getpwnam_r_proto" in
15506 ''|0) d_getpwnam_r=undef
15508 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15509 * ) case "$getpwnam_r_proto" in
15510 REENTRANT_PROTO*) ;;
15511 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15513 echo "Prototype: $try" ;;
15516 *) case "$usethreads" in
15517 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15524 *) getpwnam_r_proto=0
15528 : see if getpwuid_r exists
15529 set getpwuid_r d_getpwuid_r
15531 case "$d_getpwuid_r" in
15533 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15534 case "$d_getpwuid_r_proto:$usethreads" in
15535 ":define") d_getpwuid_r_proto=define
15536 set d_getpwuid_r_proto getpwuid_r $hdrs
15540 case "$d_getpwuid_r_proto" in
15542 case "$getpwuid_r_proto" in
15543 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15544 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15546 case "$getpwuid_r_proto" in
15547 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15548 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15550 case "$getpwuid_r_proto" in
15551 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15552 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15554 case "$getpwuid_r_proto" in
15555 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15556 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15558 case "$getpwuid_r_proto" in
15559 ''|0) d_getpwuid_r=undef
15561 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15562 * ) case "$getpwuid_r_proto" in
15563 REENTRANT_PROTO*) ;;
15564 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15566 echo "Prototype: $try" ;;
15569 *) case "$usethreads" in
15570 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15577 *) getpwuid_r_proto=0
15581 : Optional checks for getsbyname and getsbyport
15583 : see if getservbyname exists
15584 set getservbyname d_getsbyname
15587 : see if getservbyport exists
15588 set getservbyport d_getsbyport
15591 : see if getservent exists
15592 set getservent d_getsent
15595 : see if getservbyname_r exists
15596 set getservbyname_r d_getservbyname_r
15598 case "$d_getservbyname_r" in
15600 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15601 case "$d_getservbyname_r_proto:$usethreads" in
15602 ":define") d_getservbyname_r_proto=define
15603 set d_getservbyname_r_proto getservbyname_r $hdrs
15607 case "$d_getservbyname_r_proto" in
15609 case "$getservbyname_r_proto" in
15610 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15611 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15613 case "$getservbyname_r_proto" in
15614 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15615 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15617 case "$getservbyname_r_proto" in
15618 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15619 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15621 case "$getservbyname_r_proto" in
15622 ''|0) d_getservbyname_r=undef
15623 getservbyname_r_proto=0
15624 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15625 * ) case "$getservbyname_r_proto" in
15626 REENTRANT_PROTO*) ;;
15627 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15629 echo "Prototype: $try" ;;
15632 *) case "$usethreads" in
15633 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15635 d_getservbyname_r=undef
15636 getservbyname_r_proto=0
15640 *) getservbyname_r_proto=0
15644 : see if getservbyport_r exists
15645 set getservbyport_r d_getservbyport_r
15647 case "$d_getservbyport_r" in
15649 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15650 case "$d_getservbyport_r_proto:$usethreads" in
15651 ":define") d_getservbyport_r_proto=define
15652 set d_getservbyport_r_proto getservbyport_r $hdrs
15656 case "$d_getservbyport_r_proto" in
15658 case "$getservbyport_r_proto" in
15659 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15660 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15662 case "$getservbyport_r_proto" in
15663 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15664 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15666 case "$getservbyport_r_proto" in
15667 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15668 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15670 case "$getservbyport_r_proto" in
15671 ''|0) d_getservbyport_r=undef
15672 getservbyport_r_proto=0
15673 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15674 * ) case "$getservbyport_r_proto" in
15675 REENTRANT_PROTO*) ;;
15676 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15678 echo "Prototype: $try" ;;
15681 *) case "$usethreads" in
15682 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15684 d_getservbyport_r=undef
15685 getservbyport_r_proto=0
15689 *) getservbyport_r_proto=0
15693 : see if getservent_r exists
15694 set getservent_r d_getservent_r
15696 case "$d_getservent_r" in
15698 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15699 case "$d_getservent_r_proto:$usethreads" in
15700 ":define") d_getservent_r_proto=define
15701 set d_getservent_r_proto getservent_r $hdrs
15705 case "$d_getservent_r_proto" in
15707 case "$getservent_r_proto" in
15708 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15709 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15711 case "$getservent_r_proto" in
15712 ''|0) try='int getservent_r(struct servent*, char*, int);'
15713 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15715 case "$getservent_r_proto" in
15716 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15717 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15719 case "$getservent_r_proto" in
15720 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15721 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15723 case "$getservent_r_proto" in
15724 ''|0) d_getservent_r=undef
15725 getservent_r_proto=0
15726 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15727 * ) case "$getservent_r_proto" in
15728 REENTRANT_PROTO*) ;;
15729 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15731 echo "Prototype: $try" ;;
15734 *) case "$usethreads" in
15735 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15737 d_getservent_r=undef
15738 getservent_r_proto=0
15742 *) getservent_r_proto=0
15746 : see if prototypes for various getservxxx netdb.h functions are available
15748 set d_getservprotos getservent $i_netdb netdb.h
15751 : see if getspnam exists
15752 set getspnam d_getspnam
15755 : see if this is a shadow.h system
15756 set shadow.h i_shadow
15759 : see if getspnam_r exists
15760 set getspnam_r d_getspnam_r
15762 case "$d_getspnam_r" in
15764 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15765 case "$d_getspnam_r_proto:$usethreads" in
15766 ":define") d_getspnam_r_proto=define
15767 set d_getspnam_r_proto getspnam_r $hdrs
15771 case "$d_getspnam_r_proto" in
15773 case "$getspnam_r_proto" in
15774 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15775 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15777 case "$getspnam_r_proto" in
15778 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15779 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15781 case "$getspnam_r_proto" in
15782 ''|0) d_getspnam_r=undef
15784 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15785 * ) case "$getspnam_r_proto" in
15786 REENTRANT_PROTO*) ;;
15787 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15789 echo "Prototype: $try" ;;
15792 *) case "$usethreads" in
15793 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15800 *) getspnam_r_proto=0
15804 : see if gettimeofday or ftime exists
15805 set gettimeofday d_gettimeod
15807 case "$d_gettimeod" in
15813 val="$undef"; set d_ftime; eval $setvar
15816 case "$d_gettimeod$d_ftime" in
15819 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15823 : see if gmtime_r exists
15824 set gmtime_r d_gmtime_r
15826 case "$d_gmtime_r" in
15828 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15829 case "$d_gmtime_r_proto:$usethreads" in
15830 ":define") d_gmtime_r_proto=define
15831 set d_gmtime_r_proto gmtime_r $hdrs
15835 case "$d_gmtime_r_proto" in
15837 case "$gmtime_r_proto" in
15838 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15839 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15841 case "$gmtime_r_proto" in
15842 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15843 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15845 case "$gmtime_r_proto" in
15846 ''|0) d_gmtime_r=undef
15848 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15849 * ) case "$gmtime_r_proto" in
15850 REENTRANT_PROTO*) ;;
15851 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15853 echo "Prototype: $try" ;;
15856 *) case "$usethreads" in
15857 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15864 *) gmtime_r_proto=0
15868 : see if hasmntopt exists
15869 set hasmntopt d_hasmntopt
15872 : see if this is a netinet/in.h or sys/in.h system
15873 set netinet/in.h i_niin sys/in.h i_sysin
15876 : see if arpa/inet.h has to be included
15877 set arpa/inet.h i_arpainet
15880 : see if htonl --and friends-- exists
15885 : Maybe they are macros.
15888 $cat >htonl.c <<EOM
15890 #include <sys/types.h>
15891 #$i_niin I_NETINET_IN
15893 #$i_arpainet I_ARPA_INET
15894 #ifdef I_NETINET_IN
15895 #include <netinet/in.h>
15898 #include <sys/in.h>
15901 #include <arpa/inet.h>
15904 printf("Defined as a macro.");
15907 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15908 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15910 echo "But it seems to be defined as a macro." >&4
15918 : see if hypot exists
15922 : see if ilogb exists
15926 : see if ilogbl exists
15927 set ilogbl d_ilogbl
15930 : check whether inet_aton exists
15931 set inet_aton d_inetaton
15934 : see if inet_ntop exists
15935 set inet_ntop d_inetntop
15938 : see if inet_pton exists
15939 set inet_pton d_inetpton
15944 $cat >isascii.c <<EOCP
15947 #$i_stdlib I_STDLIB
15949 #include <stdlib.h>
15960 if eval $compile; then
15961 echo "isascii() found." >&4
15964 echo "isascii() NOT found." >&4
15973 $cat >isblank.c <<'EOCP'
15984 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15985 echo "isblank() found." >&4
15988 echo "isblank() NOT found." >&4
15995 : check for isfinite
15996 echo "Checking to see if you have isfinite..." >&4
15999 int main() { return isfinite(0.0); }
16002 if eval $compile; then
16004 echo "You have isfinite."
16007 echo "You do not have isfinite."
16013 : see if isfinitel exists
16014 set isfinitel d_isfinitel
16018 echo "Checking to see if you have isinf..." >&4
16021 int main() { return isinf(0.0); }
16024 if eval $compile; then
16026 echo "You have isinf."
16029 echo "You do not have isinf."
16035 : see if isinfl exists
16036 set isinfl d_isinfl
16040 echo "Checking to see if you have isless..." >&4
16043 int main() { return isless(2.0, 1.0); }
16046 if eval $compile; then
16048 echo "You have isless."
16051 echo "You do not have isless."
16058 echo "Checking to see if you have isnan..." >&4
16061 int main() { return isnan(0.0); }
16064 if eval $compile; then
16066 echo "You have isnan."
16069 echo "You do not have isnan."
16075 : see if isnanl exists
16076 set isnanl d_isnanl
16079 : check for isnormal
16080 echo "Checking to see if you have isnormal..." >&4
16083 int main() { return isnormal(0.0); }
16086 if eval $compile; then
16088 echo "You have isnormal."
16091 echo "You do not have isnormal."
16101 : see if j0l exists
16105 : see if killpg exists
16106 set killpg d_killpg
16109 : see if localeconv exists
16110 set localeconv d_locconv
16113 : see if libc has the POSIX.1-2008 currency locale rules
16114 case "$d_locconv:$d_lc_monetary_2008" in
16117 #include <locale.h>
16119 struct lconv *lc = localeconv();
16120 char int_p_cs_precedes = lc->int_p_cs_precedes;
16125 if eval $compile; then
16126 d_lc_monetary_2008="$define"
16128 d_lc_monetary_2008="$undef"
16134 : see if lchown exists
16136 $cat > try.c <<EOCP
16139 #include <stdlib.h>
16140 #$i_unistd I_UNISTD
16142 # include <unistd.h>
16144 int main(int argc, char *argv[])
16146 if (lchown("./try.c", -1, getgid()) == -1) {
16147 exit(EXIT_FAILURE);
16149 exit(EXIT_SUCCESS);
16153 if eval $compile && ./try; then
16154 $echo "lchown() found." >&4
16157 $echo "lchown() NOT found." >&4
16164 : See if number of significant digits in a double precision number is known
16166 $cat >ldbl_dig.c <<EOM
16167 #include <limits.h>
16170 printf("Contains LDBL_DIG");
16173 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16174 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16175 echo "LDBL_DIG found." >&4
16178 echo "LDBL_DIG NOT found." >&4
16185 : see if lgamma exists
16186 set lgamma d_lgamma
16189 : see if lgamma_r exists
16190 set lgamma_r d_lgamma_r
16193 : check to see if math.h defines _LIB_VERSION
16194 d_libm_lib_version="$undef"
16196 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16198 #include <unistd.h>
16201 int main (int argc, char *argv[])
16203 printf ("%d\n", _LIB_VERSION);
16208 if eval $compile; then
16210 echo "Yes, it does ($foo)" >&4
16211 d_libm_lib_version="$define"
16213 echo "No, it does not (probably harmless)" >&4
16217 : see if link exists
16221 : see if llrint exists
16222 set llrint d_llrint
16225 : see if llrintl exists
16226 set llrintl d_llrintl
16229 : see if llround exists
16230 set llround d_llround
16233 : see if llroundl exists
16234 set llroundl d_llroundl
16237 : see if localtime_r exists
16238 set localtime_r d_localtime_r
16240 case "$d_localtime_r" in
16242 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16243 case "$d_localtime_r_proto:$usethreads" in
16244 ":define") d_localtime_r_proto=define
16245 set d_localtime_r_proto localtime_r $hdrs
16249 case "$d_localtime_r_proto" in
16251 case "$localtime_r_proto" in
16252 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16253 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16255 case "$localtime_r_proto" in
16256 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16257 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16259 case "$localtime_r_proto" in
16260 ''|0) d_localtime_r=undef
16261 localtime_r_proto=0
16262 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16263 * ) case "$localtime_r_proto" in
16264 REENTRANT_PROTO*) ;;
16265 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16267 echo "Prototype: $try" ;;
16270 *) case "$usethreads" in
16271 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16273 d_localtime_r=undef
16274 localtime_r_proto=0
16278 *) localtime_r_proto=0
16282 : see if localtime_r calls tzset
16283 case "$localtime_r_proto" in
16286 /* Does our libc's localtime_r call tzset ?
16287 * return 0 if so, 1 otherwise.
16289 #$i_systypes I_SYS_TYPES
16290 #$i_unistd I_UNISTD
16292 #$i_stdlib I_STDLIB
16293 #$i_malloc I_MALLOC
16295 # include <sys/types.h>
16298 # include <unistd.h>
16304 #include <stdlib.h>
16306 #include <string.h>
16308 # include <malloc.h>
16313 time_t t = time(0L);
16314 char w_tz[]="TZ" "=GMT+5",
16315 e_tz[]="TZ" "=GMT-5",
16316 *tz_e = (char*)malloc(16),
16317 *tz_w = (char*)malloc(16);
16318 struct tm tm_e, tm_w;
16319 memset(&tm_e,'\0',sizeof(struct tm));
16320 memset(&tm_w,'\0',sizeof(struct tm));
16325 localtime_r(&t, &tm_e);
16328 localtime_r(&t, &tm_w);
16330 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16333 free(tz_e);free(tz_w);
16338 if eval $compile; then
16339 if $run ./try; then
16340 d_localtime_r_needs_tzset=undef;
16342 d_localtime_r_needs_tzset=define;
16345 d_localtime_r_needs_tzset=undef;
16349 d_localtime_r_needs_tzset=undef;
16354 : see if lockf exists
16358 : see if log1p exists
16362 : see if log2 exists
16366 : see if logb exists
16370 : see if lrint exists
16374 : see if lrintl exists
16375 set lrintl d_lrintl
16378 : see if lround exists
16379 set lround d_lround
16382 : see if lroundl exists
16383 set lroundl d_lroundl
16386 : see if prototype for lseek is available
16388 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16391 : see if lstat exists
16395 : see if madvise exists
16396 set madvise d_madvise
16399 : see if malloc_size exists
16400 set malloc_size d_malloc_size
16403 : see if malloc_size_good exists
16404 set malloc_good_size d_malloc_good_size
16407 : see if malloc_usable_size exists
16408 set malloc_usable_size d_malloc_usable_size
16411 : see if mblen exists
16415 : see if mbrlen exists
16416 set mbrlen d_mbrlen
16419 : see if mbrtowc exists
16420 set mbrtowc d_mbrtowc
16423 : see if mbstowcs exists
16424 set mbstowcs d_mbstowcs
16427 : see if mbtowc exists
16428 set mbtowc d_mbtowc
16431 : see if memmem exists
16432 : We need both a prototype in string.h and the symbol in libc.
16435 xx1="#$d_gnulibc HAS_GNULIBC"
16436 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16437 xx3='# define _GNU_SOURCE'
16439 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16441 case "$d_memmem_proto" in
16442 define) # see if memmem exists
16443 set memmem d_memmem
16452 : see if memrchr exists
16453 : We need both a prototype in string.h and the symbol in libc.
16456 xx1="#$d_gnulibc HAS_GNULIBC"
16457 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16458 xx3='# define _GNU_SOURCE'
16460 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16462 case "$d_memrchr_proto" in
16463 define) # see if memrchr exists
16464 set memrchr d_memrchr
16473 : see if mkdir exists
16477 : see if mkdtemp exists
16478 set mkdtemp d_mkdtemp
16481 : see if mkfifo exists
16482 set mkfifo d_mkfifo
16485 : see if mkostemp exists
16486 set mkostemp d_mkostemp
16489 : see if mkstemp exists
16490 set mkstemp d_mkstemp
16493 : see if mkstemps exists
16494 set mkstemps d_mkstemps
16497 : see if mktime exists
16498 set mktime d_mktime
16501 : see if sys/mman.h has to be included
16502 set sys/mman.h i_sysmman
16505 : see if mmap exists
16508 : see what shmat returns
16509 : default to something harmless
16511 case "$i_sysmman$d_mmap" in
16513 $cat >mmap.c <<'END'
16514 #include <sys/mman.h>
16517 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16522 echo "and it returns ($mmaptype)." >&4
16526 : see if sqrtl exists
16530 : see if scalbnl exists
16531 set scalbnl d_scalbnl
16534 : see if truncl exists
16535 set truncl d_truncl
16538 : see if modfl exists
16542 : see if prototype for modfl is available
16544 set d_modflproto modfl define math.h
16547 if $test "$uselongdouble" = "$define"; then
16549 if $test "$d_sqrtl" != "$define"; then
16550 message="$message sqrtl"
16552 if $test "$d_modfl" != "$define"; then
16553 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16554 echo "You have both truncl and copysignl, so I can emulate modfl."
16556 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16557 echo "You have both aintl and copysignl, so I can emulate modfl."
16559 message="$message modfl"
16563 if $test "$d_frexpl" != "$define"; then
16564 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16565 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16567 message="$message frexpl"
16570 if $test "$d_ldexpl" != "$define"; then
16571 message="$message ldexpl"
16574 if $test "$message" != ""; then
16577 *** You requested the use of long doubles but you do not seem to have
16578 *** the following mathematical functions needed for long double support:
16580 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16581 *** Cannot continue, aborting.
16589 : see if mprotect exists
16590 set mprotect d_mprotect
16593 : see if msgctl exists
16594 set msgctl d_msgctl
16597 : see if msgget exists
16598 set msgget d_msgget
16601 : see if msgsnd exists
16602 set msgsnd d_msgsnd
16605 : see if msgrcv exists
16606 set msgrcv d_msgrcv
16609 : see how much of the 'msg*(2)' library is present.
16612 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16613 *"$undef"*) h_msg=false;;
16617 case "`ipcs 2>&1`" in
16618 "SVID messages"*"not configured"*)
16619 echo "Your $osname does not have the msg*(2) configured." >&4
16622 set msgctl d_msgctl
16624 set msgget d_msgget
16626 set msgsnd d_msgsnd
16628 set msgrcv d_msgrcv
16634 : we could also check for sys/ipc.h ...
16635 if $h_msg && $test `./findhdr sys/msg.h`; then
16636 echo "You have the full msg*(2) library." >&4
16639 echo "You don't have the full msg*(2) library." >&4
16645 : Check for msghdr_s
16647 echo "Checking to see if your system supports struct msghdr..." >&4
16648 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16650 case "$d_msghdr_s" in
16651 "$define") echo "Yes, it does." ;;
16652 *) echo "No, it doesn't." ;;
16655 : see if msync exists
16659 : see if munmap exists
16660 set munmap d_munmap
16663 : see if nan exists
16667 : see if nanosleep exists
16668 set nanosleep d_nanosleep
16671 : see if nearbyint exists
16672 set nearbyint d_nearbyint
16675 : see if nextafter exists
16676 set nextafter d_nextafter
16679 : see if nexttoward exists
16680 set nexttoward d_nexttoward
16683 : see if nice exists
16687 : see if this is a langinfo.h system
16688 set langinfo.h i_langinfo
16691 : see if nl_langinfo exists
16692 set nl_langinfo d_nl_langinfo
16695 : see if locale.h is available
16696 set locale.h i_locale
16699 : check for nl_langinfo_l item
16702 Checking to see if you have nl_langinfo_l(), and that it is thread-safe
16705 #$i_stdlib I_STDLIB
16707 # include <stdlib.h>
16709 #include <string.h>
16710 #$i_langinfo I_LANGINFO
16712 # include <langinfo.h>
16714 #$i_pthread I_PTHREAD
16716 # include <pthread.h>
16718 #$i_locale I_LOCALE
16720 # include <locale.h>
16724 thread_start(void * arg)
16726 nl_langinfo(RADIXCHAR);
16730 char * main_buffer;
16731 char save_main_buffer[1000];
16732 pthread_t subthread;
16733 pthread_attr_t attr;
16735 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
16737 /* If too large for our generous allowance, just assume we don't have
16739 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
16743 strcpy(save_main_buffer, main_buffer);
16745 if (pthread_attr_init(&attr) != 0) {
16749 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
16753 if (pthread_join(subthread, NULL) != 0) {
16757 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
16760 case "$usethreads" in
16763 if eval $compile; then
16764 echo "Your system has nl_langinfo_l()..." >&4
16765 d_nl_langinfo_l="$define"
16766 echo "$d_nl_langinfo_l" >&4
16767 if $run ./try; then
16768 echo "and it is thread-safe (just as I'd hoped)." >&4
16769 d_thread_safe_nl_langinfo_l="$define"
16770 echo "$d_thread_safe_nl_langinfo_l" >&4
16772 echo "but it isn't thread-safe." >&4
16775 echo "your system does not have nl_langinfo_l()" >&4
16778 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
16780 if test X"$d_nl_langinfo_l" = X; then
16781 d_nl_langinfo_l="$undef"
16783 if test X"$d_thread_safe_nl_langinfo_l" = X; then
16784 d_thread_safe_nl_langinfo_l="$undef"
16788 : Look for non 'int'-sized bitfields
16789 case "$d_non_int_bitfields" in
16792 echo "Checking whether your compiler can handle struct bitfields that aren't 'int' or 'unsigned int' ..." >&4
16793 $cat >try.c <<'EOCP'
16796 unsigned char byte:1;
16797 unsigned short halfword:1;
16800 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16801 if $compiler_warning try.out >/dev/null 2>&1; then
16802 echo "Your C compiler doesn't support struct bitfields that aren't 'int' or 'unsigned int'." >&4
16805 echo "Your C compiler supports struct bitfields besides 'int' and 'unsigned int'." >&4
16809 echo "Your C compiler doesn't seem to understand struct bitfields that aren't 'int' or 'unsigned int' at all." >&4
16813 *) val="$d_non_int_bitfields" ;;
16815 set d_non_int_bitfields
16819 : see if this is a quadmath.h system
16820 set quadmath.h i_quadmath
16823 : Check basic sizes
16825 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16827 case "$use64bitint:$d_quad:$quadtype" in
16830 uvtype="$uquadtype"
16835 uvtype="unsigned long"
16841 case "$uselongdouble:$d_longdbl" in
16843 nvtype="long double"
16844 nvsize=$longdblsize
16851 case "$usequadmath:$i_quadmath" in
16853 nvtype="__float128"
16859 *** You requested the use of the quadmath library, but you
16860 *** do not seem to have the quadmath library installed.
16861 *** Cannot continue, aborting.
16867 define:*) $cat <<EOM >&4
16869 *** You requested the use of the quadmath library, but you
16870 *** do not seem to have the required header, <quadmath.h>.
16872 case "$gccversion" in
16875 *** Your gcc looks a bit old:
16881 *** You are not running a gcc.
16886 *** For the quadmath library you need at least gcc 4.6.
16887 *** Cannot continue, aborting.
16893 $echo "(IV will be "$ivtype", $ivsize bytes)"
16894 $echo "(UV will be "$uvtype", $uvsize bytes)"
16895 $echo "(NV will be "$nvtype", $nvsize bytes)"
16898 #$i_inttypes I_INTTYPES
16900 #include <inttypes.h>
16905 int8_t i = INT8_MAX;
16906 uint8_t u = UINT8_MAX;
16907 printf("int8_t\n");
16910 int16_t i = INT16_MAX;
16911 uint16_t u = UINT16_MAX;
16912 printf("int16_t\n");
16915 int32_t i = INT32_MAX;
16916 uint32_t u = UINT32_MAX;
16917 printf("int32_t\n");
16922 i8type="signed char"
16923 u8type="unsigned char"
16928 '') case "$shortsize" in
16930 u16type="unsigned short"
16938 '') set try -DINT16
16939 if eval $compile; then
16940 case "`$run ./try`" in
16952 '') if $test $shortsize -ge 2; then
16954 u16type="unsigned short"
16962 '') case "$longsize" in
16964 u32type="unsigned long"
16968 *) case "$intsize" in
16970 u32type="unsigned int"
16980 '') set try -DINT32
16981 if eval $compile; then
16982 case "`$run ./try`" in
16994 '') if $test $intsize -ge 4; then
16996 u32type="unsigned int"
17004 '') case "$d_quad:$quadtype" in
17006 i64type="$quadtype"
17007 u64type="$uquadtype"
17015 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
17018 #$i_stdlib I_STDLIB
17020 #include <stdlib.h>
17022 #$i_inttypes I_INTTYPES
17024 #include <inttypes.h>
17026 #include <sys/types.h>
17027 #include <signal.h>
17029 /* volatile so that the compiler has to store it out to memory */
17030 volatile int bletched = 0;
17031 $signal_t blech(int s) { bletched = 1; }
17036 int n = 8 * $uvsize;
17039 signal(SIGFPE, blech);
17042 for (i = 0; i < n; i++) {
17043 u = u << 1 | ($uvtype)1;
17045 if (($uvtype)d != u)
17049 d = ($nvtype)(u - 1);
17050 if (($uvtype)d != (u - 1))
17057 printf("%d\n", ((i == n) ? -n : i));
17063 d_nv_preserves_uv="$undef"
17064 if eval $compile; then
17065 nv_preserves_uv_bits="`$run ./try`"
17067 case "$nv_preserves_uv_bits" in
17069 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
17070 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." >&4
17071 d_nv_preserves_uv="$define"
17073 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." >&4
17074 d_nv_preserves_uv="$undef" ;;
17075 *) $echo "Can't figure out how many bits your NVs preserve." >&4
17076 nv_preserves_uv_bits="0" ;;
17080 $echo "Checking to find the largest integer value your NVs can hold..." >&4
17084 typedef $nvtype NV;
17091 while(count < 256) {
17092 /* volatile so that the compiler has to store it out to memory */
17093 volatile NV up = value + 1.0;
17094 volatile NV negated = -value;
17095 volatile NV down = negated - 1.0;
17096 volatile NV got_up = up - value;
17097 int up_good = got_up == 1.0;
17098 int got_down = down - negated;
17099 int down_good = got_down == -1.0;
17101 if (down_good != up_good) {
17103 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
17104 up_good, (double) got_up, down_good, (double) got_down,
17105 count, (double) value);
17112 fputs("256.0", stdout);
17115 fputs("2.0", stdout);
17121 fputs("*", stdout);
17127 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17128 count, (double) value);
17134 nv_overflows_integers_at='0'
17135 if eval $compile; then
17141 The largest integer your NVs can preserve is equal to $xxx
17143 nv_overflows_integers_at="$xxx"
17146 Cannot determine the largest integer value your NVs can hold, unexpected output
17153 Cannot determine the largest integer value your NVs can hold
17160 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17163 #$i_stdlib I_STDLIB
17165 #include <stdlib.h>
17167 #include <string.h>
17168 #include <sys/types.h>
17169 #include <signal.h>
17171 /* volatile so that the compiler has to store it out to memory */
17172 volatile int bletched = 0;
17173 $signal_t blech(int s) { bletched = 1; }
17176 int checkit($nvtype d, const char *where) {
17178 unsigned char *p = (unsigned char *)v;
17179 unsigned char *end = p + sizeof(d);
17188 p = (unsigned char *)v;
17189 printf("No - %s: 0x", where);
17191 printf ("%02X", *p++);
17196 int main(int argc, char **argv) {
17199 fail += checkit(d, "0.0");
17201 /* The compiler shouldn't be assuming that bletched is 0 */
17204 fail += checkit(d, "bleched");
17207 signal(SIGFPE, blech);
17210 /* Paranoia - the compiler should have no way of knowing that ANSI says
17211 that argv[argc] will always be NULL. Actually, if it did assume this it
17212 would be buggy, as this is C and main() can be called from elsewhere in
17214 d = argv[argc] ? 1 : 0;
17217 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17220 fail += checkit(d, "ternary");
17222 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17225 printf("No - memset doesn't give 0.0\n");
17226 /* This might just blow up: */
17227 printf("(gives %g)\n", d);
17233 printf("No - something bleched\n");
17238 printf("No - %d fail(s)\n", fail);
17247 d_nv_zero_is_allbits_zero="$undef"
17248 if eval $compile; then
17254 0.0 is represented as all bits zero in memory
17256 d_nv_zero_is_allbits_zero="$define"
17259 0.0 is not represented as all bits zero in memory
17261 d_nv_zero_is_allbits_zero="$undef"
17266 0.0 is not represented as all bits zero in memory
17268 d_nv_zero_is_allbits_zero="$undef"
17274 : check for off64_t
17276 echo "Checking to see if you have off64_t..." >&4
17278 #include <sys/types.h>
17279 #include <unistd.h>
17280 int main() { off64_t x = 7; }
17283 if eval $compile; then
17285 echo "You have off64_t."
17288 echo "You do not have off64_t."
17289 case "$lseeksize" in
17290 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17297 : how to create joinable pthreads
17298 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17300 echo "Checking what constant to use for creating joinable pthreads..." >&4
17301 $cat >try.c <<'EOCP'
17302 #include <pthread.h>
17304 int detachstate = JOINABLE;
17307 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17308 if eval $compile; then
17309 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17310 val="$undef" # Yes, undef.
17311 set d_old_pthread_create_joinable
17314 set old_pthread_create_joinable
17317 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17318 if eval $compile; then
17319 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17321 set d_old_pthread_create_joinable
17323 val=PTHREAD_CREATE_UNDETACHED
17324 set old_pthread_create_joinable
17327 set try -DJOINABLE=__UNDETACHED
17328 if eval $compile; then
17329 echo "You seem to use __UNDETACHED." >&4
17331 set d_old_pthread_create_joinable
17334 set old_pthread_create_joinable
17337 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17339 set d_old_pthread_create_joinable
17342 set old_pthread_create_joinable
17349 d_old_pthread_create_joinable="$undef"
17350 old_pthread_create_joinable=""
17353 : see if pause exists
17357 : see if pipe2 exists
17361 : see if poll exists
17365 : see if prctl exists
17369 : see if prctl supports PR_SET_NAME
17370 d_prctl_set_name=$undef
17375 #include <unistd.h>
17377 #include <sys/prctl.h>
17379 int main (int argc, char *argv[])
17381 return (prctl (PR_SET_NAME, "Test"));
17385 if eval $compile_ok && $run ./try; then
17386 echo "Your prctl (PR_SET_NAME, ...) works"
17387 d_prctl_set_name=$define
17393 : see if readlink exists
17394 set readlink d_readlink
17397 : Check if there is a /proc symlink to the abs path of
17398 : the executing program. We will honor hints of d_procselfexe=$undef
17399 : or procselfexe being non-empty, otherwise will try to determine both
17400 : if we have readlink.
17401 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17402 : referenced, and AmigaOS does not have a proc filesystem anyway.
17405 if $test "X$d_procselfexe" = Xundef; then
17407 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17409 elif $test "X$d_readlink" = Xdefine; then
17410 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17411 : and it feels more tidy to avoid an extra level of symlink
17412 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17413 while test $# -gt 0; do
17416 if $issymlink $try; then
17417 $ls -l $try > reflect
17418 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17419 echo "You have $type-like $try."
17420 procselfexe='"'$try'"'
17422 : This will break out of the loop
17432 : backward compatibility for d_hvfork
17433 if test X$d_hvfork != X; then
17434 d_vfork="$d_hvfork"
17437 : see if there is a vfork
17442 d_pseudofork=$undef
17444 : Ok, but do we want to use it. vfork is reportedly unreliable in
17445 : perl on Solaris 2.x, and probably elsewhere.
17449 case "$usevfork" in
17455 Perl can only use a vfork() that doesn't suffer from strict
17456 restrictions on calling functions or modifying global data in
17457 the child. For example, glibc-2.1 contains such a vfork()
17458 that is unsuitable. If your system provides a proper fork()
17459 call, chances are that you do NOT want perl to use vfork().
17462 rp="Do you still want to use vfork()?"
17467 echo "Ok, we won't use vfork()."
17476 $define) usevfork='true';;
17477 *) usevfork='false';;
17480 : see whether the pthread_atfork exists
17482 #include <pthread.h>
17485 #ifdef PTHREAD_ATFORK
17486 pthread_atfork(NULL,NULL,NULL);
17491 : see if pthread_atfork exists
17492 set try -DPTHREAD_ATFORK
17493 if eval $compile; then
17498 case "$usethreads" in
17501 $define) echo 'pthread_atfork found.' >&4 ;;
17502 *) echo 'pthread_atfork NOT found.' >&4 ;;
17505 set d_pthread_atfork
17508 : see if pthread_attr_setscope exists
17509 set pthread_attr_setscope d_pthread_attr_setscope
17512 : see whether the various POSIXish _yields exist
17514 #include <pthread.h>
17520 #ifdef PTHREAD_YIELD
17523 #ifdef PTHREAD_YIELD_NULL
17524 pthread_yield(NULL);
17530 : see if sched_yield exists
17531 set try -DSCHED_YIELD
17532 if eval $compile; then
17534 sched_yield='sched_yield()'
17538 case "$usethreads" in
17541 $define) echo 'sched_yield() found.' >&4 ;;
17542 *) echo 'sched_yield() NOT found.' >&4 ;;
17548 : see if pthread_yield exists
17549 set try -DPTHREAD_YIELD
17550 if eval $compile; then
17552 case "$sched_yield" in
17553 '') sched_yield='pthread_yield()' ;;
17556 set try -DPTHREAD_YIELD_NULL
17557 if eval $compile; then
17559 case "$sched_yield" in
17560 '') sched_yield='pthread_yield(NULL)' ;;
17566 case "$usethreads" in
17569 $define) echo 'pthread_yield() found.' >&4 ;;
17570 *) echo 'pthread_yield() NOT found.' >&4 ;;
17574 set d_pthread_yield
17576 case "$sched_yield" in
17577 '') sched_yield=undef ;;
17581 : check for ptrdiff_t
17583 echo "Checking to see if you have ptrdiff_t..." >&4
17585 #include <stddef.h>
17586 int main() { ptrdiff_t x = 7; }
17589 if eval $compile; then
17591 echo "You have ptrdiff_t."
17594 echo "You do not have ptrdiff_t."
17600 : see if random_r exists
17601 set random_r d_random_r
17603 case "$d_random_r" in
17605 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17606 case "$d_random_r_proto:$usethreads" in
17607 ":define") d_random_r_proto=define
17608 set d_random_r_proto random_r $hdrs
17612 case "$d_random_r_proto" in
17614 case "$random_r_proto" in
17615 ''|0) try='int random_r(int*, struct random_data*);'
17616 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17618 case "$random_r_proto" in
17619 ''|0) try='int random_r(long*, struct random_data*);'
17620 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17622 case "$random_r_proto" in
17623 ''|0) try='int random_r(struct random_data*, int32_t*);'
17624 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17626 case "$random_r_proto" in
17627 ''|0) d_random_r=undef
17629 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17630 * ) case "$random_r_proto" in
17631 REENTRANT_PROTO*) ;;
17632 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17634 echo "Prototype: $try" ;;
17637 *) case "$usethreads" in
17638 define) echo "random_r has no prototype, not using it." >&4 ;;
17645 *) random_r_proto=0
17649 : see if readdir and friends exist
17650 set readdir d_readdir
17652 set seekdir d_seekdir
17654 set telldir d_telldir
17656 set rewinddir d_rewinddir
17659 : see if readdir64_r exists
17660 set readdir64_r d_readdir64_r
17662 case "$d_readdir64_r" in
17664 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17665 case "$d_readdir64_r_proto:$usethreads" in
17666 ":define") d_readdir64_r_proto=define
17667 set d_readdir64_r_proto readdir64_r $hdrs
17671 case "$d_readdir64_r_proto" in
17673 case "$readdir64_r_proto" in
17674 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17675 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17677 case "$readdir64_r_proto" in
17678 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17679 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17681 case "$readdir64_r_proto" in
17682 ''|0) d_readdir64_r=undef
17683 readdir64_r_proto=0
17684 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17685 * ) case "$readdir64_r_proto" in
17686 REENTRANT_PROTO*) ;;
17687 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17689 echo "Prototype: $try" ;;
17692 *) case "$usethreads" in
17693 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17695 d_readdir64_r=undef
17696 readdir64_r_proto=0
17700 *) readdir64_r_proto=0
17704 : see if readdir_r exists
17705 set readdir_r d_readdir_r
17707 case "$d_readdir_r" in
17709 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17710 case "$d_readdir_r_proto:$usethreads" in
17711 ":define") d_readdir_r_proto=define
17712 set d_readdir_r_proto readdir_r $hdrs
17716 case "$d_readdir_r_proto" in
17718 case "$readdir_r_proto" in
17719 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17720 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17722 case "$readdir_r_proto" in
17723 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17724 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17726 case "$readdir_r_proto" in
17727 ''|0) d_readdir_r=undef
17729 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17730 * ) case "$readdir_r_proto" in
17731 REENTRANT_PROTO*) ;;
17732 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17734 echo "Prototype: $try" ;;
17737 *) case "$usethreads" in
17738 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17745 *) readdir_r_proto=0
17749 : see if readv exists
17753 : see if recvmsg exists
17754 set recvmsg d_recvmsg
17757 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17759 if set regcomp val -f d_regcomp; eval $csym; $val; then
17760 echo 'regcomp() found.' >&4
17761 d_regcomp="$define"
17764 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17765 echo 'regcmp() found.' >&4
17769 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17770 echo 're_comp() found, assuming re_exec() also exists.' >&4
17771 d_re_comp="$define"
17776 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17783 : see if remainder exists
17784 set remainder d_remainder
17787 : see if remquo exists
17788 set remquo d_remquo
17791 : see if rename exists
17792 set rename d_rename
17795 : see if rint exists
17799 : see if rmdir exists
17803 : see if round exists
17807 : see if prototype for sbrk is available
17809 set d_sbrkproto sbrk $i_unistd unistd.h
17812 : see if scalbn exists
17813 set scalbn d_scalbn
17816 : see if select exists
17817 set select d_select
17820 : see if semctl exists
17821 set semctl d_semctl
17824 : see if semget exists
17825 set semget d_semget
17828 : see if semop exists
17832 : see how much of the 'sem*(2)' library is present.
17835 case "$d_semctl$d_semget$d_semop" in
17836 *"$undef"*) h_sem=false;;
17840 case "`ipcs 2>&1`" in
17841 "SVID messages"*"not configured"*)
17842 echo "Your $osname does not have the sem*(2) configured." >&4
17845 set semctl d_semctl
17847 set semget d_semget
17855 : we could also check for sys/ipc.h ...
17856 if $h_sem && $test `./findhdr sys/sem.h`; then
17857 echo "You have the full sem*(2) library." >&4
17860 echo "You don't have the full sem*(2) library." >&4
17866 : see whether sys/sem.h defines union semun
17868 $cat > try.c <<'END'
17869 #include <sys/types.h>
17870 #include <sys/ipc.h>
17871 #include <sys/sem.h>
17872 int main () { union semun semun; semun.buf = 0; }
17875 if eval $compile; then
17876 echo "You have union semun in <sys/sem.h>." >&4
17879 echo "You do not have union semun in <sys/sem.h>." >&4
17886 : see how to do semctl IPC_STAT
17890 $cat > tryh.h <<END
17893 # define S_IRUSR S_IREAD
17894 # define S_IWUSR S_IWRITE
17895 # define S_IXUSR S_IEXEC
17897 # define S_IRUSR 0400
17898 # define S_IWUSR 0200
17899 # define S_IXUSR 0100
17901 # define S_IRGRP (S_IRUSR>>3)
17902 # define S_IWGRP (S_IWUSR>>3)
17903 # define S_IXGRP (S_IXUSR>>3)
17904 # define S_IROTH (S_IRUSR>>6)
17905 # define S_IWOTH (S_IWUSR>>6)
17906 # define S_IXOTH (S_IXUSR>>6)
17909 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17910 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17911 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17914 : see whether semctl IPC_STAT can use union semun
17915 case "$d_semctl_semun" in
17919 #include <sys/types.h>
17920 #include <sys/ipc.h>
17921 #include <sys/sem.h>
17922 #include <sys/stat.h>
17929 #$d_union_semun HAS_UNION_SEMUN
17932 #ifndef HAS_UNION_SEMUN
17935 struct semid_ds *buf;
17936 unsigned short *array;
17942 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17943 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17945 struct semid_ds argbuf;
17948 st = semctl(sem, 0, IPC_STAT, arg);
17952 # endif /* IPC_STAT */
17953 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17955 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17956 # endif /* IPC_RMID */
17957 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17959 #endif /* IPC_PRIVATE && ... */
17960 printf("semget failed: errno = %d\n", errno);
17965 if eval $compile; then
17968 semun) val="$define" ;;
17976 case "$d_semctl_semun" in
17978 echo "You can use union semun for semctl IPC_STAT." >&4
17981 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17986 : see whether semctl IPC_STAT can use struct semid_ds pointer
17987 case "$d_semctl_semid_ds" in
17990 $cat > try.c <<'END'
17991 #include <sys/types.h>
17992 #include <sys/ipc.h>
17993 #include <sys/sem.h>
17994 #include <sys/stat.h>
18003 #ifndef HAS_UNION_SEMUN
18006 struct semid_ds *buf;
18007 unsigned short *array;
18011 struct semid_ds argbuf;
18014 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18015 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18019 st = semctl(sem, 0, IPC_STAT, arg);
18021 printf("semid_ds\n");
18023 # endif /* IPC_STAT */
18024 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18026 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18027 # endif /* IPC_RMID */
18028 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18030 #endif /* IPC_PRIVATE && ... */
18031 printf("semget failed: errno = %d\n", errno);
18037 if eval $compile; then
18040 semid_ds) val="$define" ;;
18044 set d_semctl_semid_ds
18048 case "$d_semctl_semid_ds" in
18050 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18052 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18058 # We do not have the full sem*(2) library, so assume we can not
18064 set d_semctl_semid_ds
18070 : see if sendmsg exists
18071 set sendmsg d_sendmsg
18074 : see if setegid exists
18075 set setegid d_setegid
18078 : see if setenv exists
18079 set setenv d_setenv
18082 : see if seteuid exists
18083 set seteuid d_seteuid
18086 : see if setgrent exists
18087 set setgrent d_setgrent
18090 : see if setgrent_r exists
18091 set setgrent_r d_setgrent_r
18093 case "$d_setgrent_r" in
18095 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18096 case "$d_setgrent_r_proto:$usethreads" in
18097 ":define") d_setgrent_r_proto=define
18098 set d_setgrent_r_proto setgrent_r $hdrs
18102 case "$d_setgrent_r_proto" in
18104 case "$setgrent_r_proto" in
18105 ''|0) try='int setgrent_r(FILE**);'
18106 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18108 case "$setgrent_r_proto" in
18109 ''|0) try='void setgrent_r(FILE**);'
18110 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18112 case "$setgrent_r_proto" in
18113 ''|0) d_setgrent_r=undef
18115 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18116 * ) case "$setgrent_r_proto" in
18117 REENTRANT_PROTO*) ;;
18118 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18120 echo "Prototype: $try" ;;
18123 *) case "$usethreads" in
18124 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18131 *) setgrent_r_proto=0
18135 : see if sethostent exists
18136 set sethostent d_sethent
18139 : see if sethostent_r exists
18140 set sethostent_r d_sethostent_r
18142 case "$d_sethostent_r" in
18144 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18145 case "$d_sethostent_r_proto:$usethreads" in
18146 ":define") d_sethostent_r_proto=define
18147 set d_sethostent_r_proto sethostent_r $hdrs
18151 case "$d_sethostent_r_proto" in
18153 case "$sethostent_r_proto" in
18154 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18155 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18157 case "$sethostent_r_proto" in
18158 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18159 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18161 case "$sethostent_r_proto" in
18162 ''|0) d_sethostent_r=undef
18163 sethostent_r_proto=0
18164 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18165 * ) case "$sethostent_r_proto" in
18166 REENTRANT_PROTO*) ;;
18167 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18169 echo "Prototype: $try" ;;
18172 *) case "$usethreads" in
18173 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18175 d_sethostent_r=undef
18176 sethostent_r_proto=0
18180 *) sethostent_r_proto=0
18184 : see if setitimer exists
18185 set setitimer d_setitimer
18188 : see if setlinebuf exists
18189 set setlinebuf d_setlinebuf
18192 : see if this system has wctype.h
18193 set wctype.h i_wctype
18196 : see if towupper exists
18197 set towupper d_towupper
18200 : check for setlocale function and behavior
18201 case "$d_setlocale" in
18205 Checking to see if you have setlocale() and its behavior
18208 #include <stdlib.h>
18209 #include <string.h>
18210 #$i_locale I_LOCALE
18212 # include <locale.h>
18214 #$i_wctype I_WCTYPE
18216 # include <wctype.h>
18220 const char * invalid_name = "\a"; /* This is really invalid! */
18221 int accepts_any_locale_name = 0;
18222 int has_C_UTF8 = 0;
18223 unsigned char bad_setlocale = 255;
18225 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
18226 * disabled. It's hard to imagine an instance where meaningful locale
18227 * handling could be done without LC_CTYPE */
18228 const char * name = setlocale(LC_CTYPE, "C");
18230 if (name == NULL || strcmp(name, "C") != 0) {
18231 exit(bad_setlocale);
18234 name = setlocale(LC_CTYPE, invalid_name);
18235 if (name != NULL) {
18237 /* Let it pass if it accepts the name but gives back one of the C
18239 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
18240 accepts_any_locale_name = 1;
18244 name = setlocale(LC_CTYPE, "C.UTF-8");
18245 if (name != NULL) {
18246 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
18248 #$d_towupper HAS_TOWUPPER
18249 #ifdef HAS_TOWUPPER
18251 /* We assume that if the machine doesn't have the C99 towupper, it
18252 * doesn't have C.UTF-8, even if we successfully changed locales to
18253 * include it. This seems safer even on platforms that didn't accept
18254 * the really invalid name */
18256 if (towupper(y_with_diaeresis) == 0x178) {
18266 /* Currently unused code to determine if LC_ALL with disparate values uses
18267 * category = value pairs or positional, and to determine the separator
18268 * between the categories. We could add code so that if the separator were
18269 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
18270 * every possible ASCII separator would fit in the 5 bits available in the
18271 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
18272 * positional, we probably would want to know the order of the categories.
18273 * Using a file between the C program and the shell script would really be
18274 * require to do that */
18277 unsigned char min_separator = ' ' - 1;
18278 unsigned char separator = min_separator;
18279 int uses_name_value_pair_names = 0;
18281 name = setlocale(LC_ALL, "C");
18282 if (name == NULL || strcmp(name, "C") != 0) {
18283 exit(bad_setlocale);
18289 name = setlocale(LC_CTYPE, "C.UTF-8");
18290 if (name == NULL) {
18291 exit(bad_setlocale);
18293 name = setlocale(LC_ALL, NULL);
18294 if (name == NULL) {
18295 exit(bad_setlocale);
18298 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
18300 uses_name_value_pair_names = 1;
18302 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
18305 separator = *(pos - 1);
18309 pos = strstr(name, "C.UTF-8");
18313 else if (pos == name) {
18314 separator = name[sizeof("C.UTF-8") - 1];
18317 separator = *(pos - 1);
18325 exit( 0 /* (separator - min_separator) << 3
18326 | uses_name_value_pair_names << 2
18329 | accepts_any_locale_name);
18336 case $d_setlocale in
18337 $undef) d_setlocale_accepts_any_locale_name="$undef"
18338 d_has_C_UTF8="false"
18341 if eval $compile; then
18342 echo "Your system has setlocale()..." >&4
18345 0) echo "and it seems sane; you don't have a C.UTF-8 locale" >&4
18346 d_setlocale="$define"
18347 d_setlocale_accepts_any_locale_name="$undef"
18348 d_has_C_UTF8="false"
18350 1) echo "and it seems sane, but accepts any locale name as valid" >&4
18351 d_setlocale="$define"
18352 d_setlocale_accepts_any_locale_name="$define"
18353 d_has_C_UTF8="false"
18355 2) echo "and it seems sane; you have a C.UTF-8 locale" >&4
18356 d_setlocale="$define"
18357 d_setlocale_accepts_any_locale_name="$undef"
18358 d_has_C_UTF8="true"
18360 3) echo "and it seems sane, but accepts any locale name as valid" >&4
18361 d_setlocale="$define"
18362 d_setlocale_accepts_any_locale_name="$define"
18363 d_has_C_UTF8="true"
18365 *) echo "but it doesn't seem to work, so we won't use it." >&4
18366 d_setlocale="$undef"
18367 d_setlocale_accepts_any_locale_name="$undef"
18368 d_has_C_UTF8="false"
18372 echo "your system does not have setlocale()" >&4
18373 d_setlocale="$undef"
18374 d_setlocale_accepts_any_locale_name="$undef"
18375 d_has_C_UTF8="false"
18380 *) val="$d_setlocale"
18383 case "$d_setlocale" in
18384 $undef) echo "There may be other ways to set the locale on your system, so we need to ask:" >&4
18387 rp="Does your system have the C.UTF-8 locale?"
18391 [Yy]*) d_has_C_UTF8="true"
18392 c_utf8_locale=" or C.UTF-8"
18394 *) d_has_C_UTF8="false"
18398 case "$d_setlocale" in
18400 rp="When you set your locale to something besides C$c_utf8_locale, does it do so, or just pretend to?" >&4
18405 d_setlocale_accepts_any_locale_name="$undef"
18407 *) d_setlocale_accepts_any_locale_name="$define"
18411 *) d_setlocale_accepts_any_locale_name="$undef"
18416 : see if setlocale_r exists
18417 set setlocale_r d_setlocale_r
18419 case "$d_setlocale_r" in
18421 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18422 case "$d_setlocale_r_proto:$usethreads" in
18423 ":define") d_setlocale_r_proto=define
18424 set d_setlocale_r_proto setlocale_r $hdrs
18428 case "$d_setlocale_r_proto" in
18430 case "$setlocale_r_proto" in
18431 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18432 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18434 case "$setlocale_r_proto" in
18435 ''|0) d_setlocale_r=undef
18436 setlocale_r_proto=0
18437 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18438 * ) case "$setlocale_r_proto" in
18439 REENTRANT_PROTO*) ;;
18440 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18442 echo "Prototype: $try" ;;
18445 *) case "$usethreads" in
18446 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18448 d_setlocale_r=undef
18449 setlocale_r_proto=0
18453 *) setlocale_r_proto=0
18457 : see if setnetent exists
18458 set setnetent d_setnent
18461 : see if setnetent_r exists
18462 set setnetent_r d_setnetent_r
18464 case "$d_setnetent_r" in
18466 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18467 case "$d_setnetent_r_proto:$usethreads" in
18468 ":define") d_setnetent_r_proto=define
18469 set d_setnetent_r_proto setnetent_r $hdrs
18473 case "$d_setnetent_r_proto" in
18475 case "$setnetent_r_proto" in
18476 ''|0) try='int setnetent_r(int, struct netent_data*);'
18477 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18479 case "$setnetent_r_proto" in
18480 ''|0) try='void setnetent_r(int, struct netent_data*);'
18481 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18483 case "$setnetent_r_proto" in
18484 ''|0) d_setnetent_r=undef
18485 setnetent_r_proto=0
18486 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18487 * ) case "$setnetent_r_proto" in
18488 REENTRANT_PROTO*) ;;
18489 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18491 echo "Prototype: $try" ;;
18494 *) case "$usethreads" in
18495 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18497 d_setnetent_r=undef
18498 setnetent_r_proto=0
18502 *) setnetent_r_proto=0
18506 : see if setprotoent exists
18507 set setprotoent d_setpent
18510 : see if setpgid exists
18511 set setpgid d_setpgid
18514 : see if setpgrp2 exists
18515 set setpgrp2 d_setpgrp2
18518 : see if setpriority exists
18519 set setpriority d_setprior
18522 : see if setproctitle exists
18523 set setproctitle d_setproctitle
18526 : see if setprotoent_r exists
18527 set setprotoent_r d_setprotoent_r
18529 case "$d_setprotoent_r" in
18531 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18532 case "$d_setprotoent_r_proto:$usethreads" in
18533 ":define") d_setprotoent_r_proto=define
18534 set d_setprotoent_r_proto setprotoent_r $hdrs
18538 case "$d_setprotoent_r_proto" in
18540 case "$setprotoent_r_proto" in
18541 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18542 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18544 case "$setprotoent_r_proto" in
18545 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18546 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18548 case "$setprotoent_r_proto" in
18549 ''|0) d_setprotoent_r=undef
18550 setprotoent_r_proto=0
18551 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18552 * ) case "$setprotoent_r_proto" in
18553 REENTRANT_PROTO*) ;;
18554 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18556 echo "Prototype: $try" ;;
18559 *) case "$usethreads" in
18560 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18562 d_setprotoent_r=undef
18563 setprotoent_r_proto=0
18567 *) setprotoent_r_proto=0
18571 : see if setpwent exists
18572 set setpwent d_setpwent
18575 : see if setpwent_r exists
18576 set setpwent_r d_setpwent_r
18578 case "$d_setpwent_r" in
18580 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18581 case "$d_setpwent_r_proto:$usethreads" in
18582 ":define") d_setpwent_r_proto=define
18583 set d_setpwent_r_proto setpwent_r $hdrs
18587 case "$d_setpwent_r_proto" in
18589 case "$setpwent_r_proto" in
18590 ''|0) try='int setpwent_r(FILE**);'
18591 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18593 case "$setpwent_r_proto" in
18594 ''|0) try='void setpwent_r(FILE**);'
18595 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18597 case "$setpwent_r_proto" in
18598 ''|0) d_setpwent_r=undef
18600 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18601 * ) case "$setpwent_r_proto" in
18602 REENTRANT_PROTO*) ;;
18603 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18605 echo "Prototype: $try" ;;
18608 *) case "$usethreads" in
18609 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18616 *) setpwent_r_proto=0
18620 : see if setregid exists
18621 set setregid d_setregid
18623 set setresgid d_setresgid
18626 : see if setreuid exists
18627 set setreuid d_setreuid
18629 set setresuid d_setresuid
18632 : see if setrgid exists
18633 set setrgid d_setrgid
18636 : see if setruid exists
18637 set setruid d_setruid
18640 : see if setservent exists
18641 set setservent d_setsent
18644 : see if setservent_r exists
18645 set setservent_r d_setservent_r
18647 case "$d_setservent_r" in
18649 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18650 case "$d_setservent_r_proto:$usethreads" in
18651 ":define") d_setservent_r_proto=define
18652 set d_setservent_r_proto setservent_r $hdrs
18656 case "$d_setservent_r_proto" in
18658 case "$setservent_r_proto" in
18659 ''|0) try='int setservent_r(int, struct servent_data*);'
18660 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18662 case "$setservent_r_proto" in
18663 ''|0) try='void setservent_r(int, struct servent_data*);'
18664 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18666 case "$setservent_r_proto" in
18667 ''|0) d_setservent_r=undef
18668 setservent_r_proto=0
18669 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18670 * ) case "$setservent_r_proto" in
18671 REENTRANT_PROTO*) ;;
18672 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18674 echo "Prototype: $try" ;;
18677 *) case "$usethreads" in
18678 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18680 d_setservent_r=undef
18681 setservent_r_proto=0
18685 *) setservent_r_proto=0
18689 : see if setsid exists
18690 set setsid d_setsid
18693 : see if setvbuf exists
18694 set setvbuf d_setvbuf
18697 : see if shmctl exists
18698 set shmctl d_shmctl
18701 : see if shmget exists
18702 set shmget d_shmget
18705 : see if shmat exists
18708 : see what shmat returns
18711 $cat >shmat.c <<'END'
18712 #include <sys/shm.h>
18715 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18720 echo "and it returns ($shmattype)." >&4
18721 : see if a prototype for shmat is available
18722 xxx=`./findhdr sys/shm.h`
18723 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18724 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18735 set d_shmatprototype
18738 : see if shmdt exists
18742 : see how much of the 'shm*(2)' library is present.
18745 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18746 *"$undef"*) h_shm=false;;
18750 case "`ipcs 2>&1`" in
18751 "SVID shared memory"*"not configured"*)
18752 echo "Your $osname does not have the shm*(2) configured." >&4
18755 set shmctl d_shmctl
18757 set shmget d_shmget
18767 : we could also check for sys/ipc.h ...
18768 if $h_shm && $test `./findhdr sys/shm.h`; then
18769 echo "You have the full shm*(2) library." >&4
18772 echo "You don't have the full shm*(2) library." >&4
18778 : see if we have sigaction
18780 if set sigaction val -f d_sigaction; eval $csym; $val; then
18781 echo 'sigaction() found.' >&4
18784 #include <sys/types.h>
18785 #include <signal.h>
18786 #$i_stdlib I_STDLIB
18788 #include <stdlib.h>
18792 struct sigaction act, oact;
18794 oact.sa_handler = 0;
18795 /* so that act and oact are used */
18796 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18800 if eval $compile_ok; then
18803 echo "But you don't seem to have a usable struct sigaction." >&4
18807 echo 'sigaction NOT found.' >&4
18810 set d_sigaction; eval $setvar
18813 : see what type pids are declared as in the kernel
18814 rp="What is the type of process ids on this system?"
18815 set pid_t pidtype int stdio.h sys/types.h
18818 : see what type uids are declared as in the kernel
18820 echo "Looking for the type for user ids returned by getuid()."
18821 set uid_t uidtype xxx stdio.h sys/types.h
18825 xxx=`./findhdr sys/user.h`
18826 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18828 unsigned) dflt="$1 $2" ;;
18832 *) dflt="$uidtype";;
18835 uid_t) echo "uid_t found." ;;
18836 *) rp="What is the type for user ids returned by getuid()?"
18842 : Define hasfield_t macro for Configure internal use
18843 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18844 while $test $# -ge 2; do
18846 $define) echo "#include <$2>";;
18850 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18852 if eval $compile; then
18861 : see what siginfo fields we have
18862 case "$d_sigaction" in
18864 echo "Checking if your siginfo_t has si_errno field...">&4
18865 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18868 echo "Checking if your siginfo_t has si_pid field...">&4
18869 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18872 echo "Checking if your siginfo_t has si_uid field...">&4
18873 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18876 echo "Checking if your siginfo_t has si_addr field...">&4
18877 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18880 echo "Checking if your siginfo_t has si_status field...">&4
18881 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18884 echo "Checking if your siginfo_t has si_band field...">&4
18885 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18888 echo "Checking if your siginfo_t has si_value field...">&4
18889 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18892 echo "Checking if your siginfo_t has si_fd field...">&4
18893 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18898 d_siginfo_si_errno="$undef"
18899 d_siginfo_si_pid="$undef"
18900 d_siginfo_si_uid="$undef"
18901 d_siginfo_si_addr="$undef"
18902 d_siginfo_si_status="$undef"
18903 d_siginfo_si_band="$undef"
18904 d_siginfo_si_value="$undef"
18905 d_siginfo_si_fd="$undef"
18909 : see if this is a sunmath.h system
18910 set sunmath.h i_sunmath
18913 : see if signbit exists
18914 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18916 #$i_sunmath I_SUNMATH
18918 #ifdef I_SUNMATH /* Solaris special math library */
18919 # include <sunmath.h>
18922 int main(int argc, char **argv)
18926 if ((signbit(x) == 0) && (signbit(y) != 0))
18934 if eval $compile; then
18935 if $run ./try; then
18939 $echo "Signbit seems to be available, but doesn't work as I expected."
18940 $echo "I won't use it." >&4
18951 : see if sigprocmask exists
18952 set sigprocmask d_sigprocmask
18955 : see if sigsetjmp exists
18957 case "$d_sigsetjmp" in
18960 #include <setjmp.h>
18961 #$i_stdlib I_STDLIB
18963 #include <stdlib.h>
18969 if (sigsetjmp(env,1))
18972 siglongjmp(env, 1);
18977 if eval $compile; then
18978 if $run ./try >/dev/null 2>&1; then
18979 echo "POSIX sigsetjmp found." >&4
18983 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18989 echo "sigsetjmp not found." >&4
18993 *) val="$d_sigsetjmp"
18994 case "$d_sigsetjmp" in
18995 $define) echo "POSIX sigsetjmp found." >&4;;
18996 $undef) echo "sigsetjmp not found." >&4;;
19004 : see if snprintf exists
19005 set snprintf d_snprintf
19008 : see if vsnprintf exists
19009 set vsnprintf d_vsnprintf
19012 case "$d_snprintf-$d_vsnprintf" in
19015 Checking whether your snprintf() and vsnprintf() work okay...
19017 $cat >try.c <<'EOCP'
19018 /* v?snprintf testing logic courtesy of Russ Allbery.
19019 * According to C99:
19020 * - if the buffer is too short it still must be \0-terminated
19021 * - if the buffer is too short the potentially required length
19022 * must be returned and not -1
19023 * - if the buffer is NULL the potentially required length
19024 * must be returned and not -1 or core dump
19027 #include <stdarg.h>
19031 int test (char *format, ...)
19036 va_start (args, format);
19037 count = vsnprintf (buf, sizeof buf, format, args);
19044 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
19045 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
19049 if eval $compile; then
19052 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
19054 Your snprintf() and snprintf() don't seem to be working okay.
19056 d_snprintf="$undef"
19057 d_vsnprintf="$undef"
19061 echo "(I can't seem to compile the test program--assuming they don't)"
19062 d_snprintf="$undef"
19063 d_vsnprintf="$undef"
19069 : see if sockatmark exists
19070 set sockatmark d_sockatmark
19073 : see if prototype for sockatmark is available
19075 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
19078 : see if socks5_init exists
19079 set socks5_init d_socks5_init
19082 : see if srand48_r exists
19083 set srand48_r d_srand48_r
19085 case "$d_srand48_r" in
19087 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19088 case "$d_srand48_r_proto:$usethreads" in
19089 ":define") d_srand48_r_proto=define
19090 set d_srand48_r_proto srand48_r $hdrs
19094 case "$d_srand48_r_proto" in
19096 case "$srand48_r_proto" in
19097 ''|0) try='int srand48_r(long, struct drand48_data*);'
19098 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19100 case "$srand48_r_proto" in
19101 ''|0) d_srand48_r=undef
19103 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19104 * ) case "$srand48_r_proto" in
19105 REENTRANT_PROTO*) ;;
19106 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19108 echo "Prototype: $try" ;;
19111 *) case "$usethreads" in
19112 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19119 *) srand48_r_proto=0
19123 : see if srandom_r exists
19124 set srandom_r d_srandom_r
19126 case "$d_srandom_r" in
19128 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19129 case "$d_srandom_r_proto:$usethreads" in
19130 ":define") d_srandom_r_proto=define
19131 set d_srandom_r_proto srandom_r $hdrs
19135 case "$d_srandom_r_proto" in
19137 case "$srandom_r_proto" in
19138 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19139 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19141 case "$srandom_r_proto" in
19142 ''|0) d_srandom_r=undef
19144 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19145 * ) case "$srandom_r_proto" in
19146 REENTRANT_PROTO*) ;;
19147 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19149 echo "Prototype: $try" ;;
19152 *) case "$usethreads" in
19153 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19160 *) srandom_r_proto=0
19164 : see if prototype for setresgid is available
19166 set d_sresgproto setresgid $i_unistd unistd.h
19169 : see if prototype for setresuid is available
19171 set d_sresuproto setresuid $i_unistd unistd.h
19174 : see if stat exists
19178 : see if sys/stat.h is available
19179 set sys/stat.h i_sysstat
19182 : see if stat knows about block sizes
19184 echo "Checking to see if your struct stat has st_blocks field..." >&4
19185 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19188 : see if this is a sys/vfs.h system
19189 set sys/vfs.h i_sysvfs
19192 : see if this is a sys/statfs.h system
19193 set sys/statfs.h i_sysstatfs
19196 : Check for statfs_s
19198 echo "Checking to see if your system supports struct statfs..." >&4
19199 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
19201 case "$d_statfs_s" in
19202 "$define") echo "Yes, it does." ;;
19203 *) echo "No, it doesn't." ;;
19206 : see if struct statfs knows about f_flags
19207 case "$d_statfs_s" in
19210 echo "Checking to see if your struct statfs has f_flags field..." >&4
19211 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
19215 set d_statfs_f_flags
19219 case "$d_statfs_f_flags" in
19220 "$define") echo "Yes, it does." ;;
19221 *) echo "No, it doesn't." ;;
19224 : see what flavor, if any, of static inline is supported
19226 echo "Checking to see if your system supports static inline..."
19227 $cat > try.c <<'EOCP'
19228 #include <stdlib.h>
19229 extern int f_via_a(int x);
19230 extern int f_via_b(int x);
19231 int main(int argc, char **argv)
19240 return EXIT_SUCCESS;
19243 return EXIT_FAILURE;
19247 $cat > a.c <<'EOCP'
19248 static INLINE int f(int x) {
19259 $cat > b.c <<'EOCP'
19260 extern int f(int x);
19268 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19269 case "$perl_static_inline" in
19270 '') # Check the various possibilities, and break out on success.
19271 # For gcc, prefer __inline__, which will still permit
19272 # cflags.SH to add in -ansi.
19273 case "$gccversion" in
19274 '') xxx="inline __inline__ __inline _inline";;
19275 *) xxx="__inline__ inline __inline _inline";;
19277 for inline in $xxx; do
19278 set try -DINLINE=$inline a.c
19279 if eval $compile && $run ./try; then
19280 # Now make sure there is no external linkage of static
19282 set try -DINLINE=$inline -DUSE_B a.c b.c
19283 if eval $compile && $run ./try; then
19284 $echo "Your compiler supports static $inline, " >&4
19285 $echo "but it also creates an external definition," >&4
19286 $echo "so I won't use it." >&4
19289 $echo "Your compiler supports static $inline." >&4
19291 perl_static_inline="static $inline";
19295 $echo "Your compiler does NOT support static $inline." >&4
19300 *inline*) # Some variant of inline exists.
19301 echo "Keeping your $hint value of $perl_static_inline."
19304 static) # No inline capabilities
19305 echo "Keeping your $hint value of $perl_static_inline."
19308 *) # Unrecognized previous value -- blindly trust the supplied
19309 # value and hope it makes sense. Use old value for
19310 # d_static_inline, if there is one.
19311 echo "Keeping your $hint value of $perl_static_inline."
19312 case "$d_static_inline" in
19314 *) val=$d_static_inline ;;
19318 # Fallback to plain 'static' if nothing worked.
19319 case "$perl_static_inline" in
19321 perl_static_inline="static"
19325 set d_static_inline
19327 $rm -f a.[co] b.[co]
19330 : Check stream access
19332 Checking how to access stdio streams by file descriptor number...
19334 case "$stdio_stream_array" in
19335 '') $cat >try.c <<EOCP
19338 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19342 for s in _iob __iob __sF
19344 set try -DSTDIO_STREAM_ARRAY=$s
19345 if eval $compile; then
19346 case "`$run ./try`" in
19347 yes) stdio_stream_array=$s; break ;;
19353 case "$stdio_stream_array" in
19355 I can't figure out how to access stdio streams by file descriptor number.
19357 d_stdio_stream_array="$undef"
19360 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19362 d_stdio_stream_array="$define"
19366 : see if strcoll exists
19367 set strcoll d_strcoll
19370 : see if strerror_l exists
19371 set strerror_l d_strerror_l
19374 : see if strerror_r exists
19375 set strerror_r d_strerror_r
19377 case "$d_strerror_r" in
19379 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
19380 case "$d_strerror_r_proto:$usethreads" in
19381 ":define") d_strerror_r_proto=define
19382 set d_strerror_r_proto strerror_r $hdrs
19386 case "$d_strerror_r_proto" in
19388 case "$strerror_r_proto" in
19389 ''|0) try='int strerror_r(int, char*, size_t);'
19390 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19392 case "$strerror_r_proto" in
19393 ''|0) try='int strerror_r(int, char*, int);'
19394 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19396 case "$strerror_r_proto" in
19397 ''|0) try='char* strerror_r(int, char*, size_t);'
19398 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19400 case "$strerror_r_proto" in
19401 ''|0) d_strerror_r=undef
19403 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19404 * ) case "$strerror_r_proto" in
19405 REENTRANT_PROTO*) ;;
19406 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19408 echo "Prototype: $try" ;;
19411 *) case "$usethreads" in
19412 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19419 *) strerror_r_proto=0
19423 : see if strftime exists
19424 set strftime d_strftime
19427 : see if strlcat exists
19428 : We need both a prototype in string.h and the symbol in libc.
19431 xx1="#$d_gnulibc HAS_GNULIBC"
19432 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19433 xx3='# define _GNU_SOURCE'
19435 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19437 case "$d_strlcat_proto" in
19438 define) # see if strlcat exists
19439 set strlcat d_strlcat
19448 : see if strlcpy exists
19449 : We need both a prototype in string.h and the symbol in libc.
19452 xx1="#$d_gnulibc HAS_GNULIBC"
19453 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19454 xx3='# define _GNU_SOURCE'
19456 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19458 case "$d_strlcpy_proto" in
19459 define) # see if strlcpy exists
19460 set strlcpy d_strlcpy
19469 : see if strnlen exists
19470 set strnlen d_strnlen
19473 : see if strtod exists
19474 set strtod d_strtod
19477 : see if strtod_l exists
19478 set strtod_l d_strtod_l
19481 : see if strtol exists
19482 set strtol d_strtol
19485 : see if strtold exists
19486 set strtold d_strtold
19489 : see if strtold_l exists
19490 set strtold_l d_strtold_l
19493 : see if strtoll exists
19494 set strtoll d_strtoll
19497 case "$d_longlong-$d_strtoll" in
19500 Checking whether your strtoll() works okay...
19502 $cat >try.c <<'EOCP'
19505 #define strtoll __strtoll
19508 #define strtoll _strtoll
19511 #include <stdlib.h>
19512 static int bad = 0;
19513 void check(const char *s, long long ell, int een) {
19516 gll = strtoll(s, 0, 10);
19517 if (!((gll == ell) && (errno == een)))
19521 check(" 1", 1LL, 0);
19522 check(" 0", 0LL, 0);
19523 check("-1", -1LL, 0);
19524 check("-9223372036854775808", -9223372036854775808LL, 0);
19525 check("-9223372036854775808", -9223372036854775808LL, 0);
19526 check(" 9223372036854775807", 9223372036854775807LL, 0);
19527 check("-9223372036854775808", -9223372036854775808LL, 0);
19528 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19529 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19535 if eval $compile; then
19538 ok) echo "Your strtoll() seems to be working okay." ;;
19540 Your strtoll() doesn't seem to be working okay.
19546 echo "(I can't seem to compile the test program--assuming it doesn't)"
19552 : see if strtoq exists
19553 set strtoq d_strtoq
19556 : see if strtoul exists
19557 set strtoul d_strtoul
19560 case "$d_strtoul" in
19563 Checking whether your strtoul() works okay...
19565 $cat >try.c <<'EOCP'
19566 #include <stdlib.h>
19569 static int bad = 0;
19570 void check(const char *s, unsigned long eul, int een) {
19573 gul = strtoul(s, 0, 10);
19574 if (!((gul == eul) && (errno == een)))
19578 check(" 1", 1L, 0);
19579 check(" 0", 0L, 0);
19581 case "$longsize" in
19583 $cat >>try.c <<'EOCP'
19584 check("18446744073709551615", 18446744073709551615UL, 0);
19585 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19586 #if 0 /* strtoul() for /^-/ strings is undefined. */
19587 check("-1", 18446744073709551615UL, 0);
19588 check("-18446744073709551614", 2, 0);
19589 check("-18446744073709551615", 1, 0);
19590 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19591 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19596 $cat >>try.c <<'EOCP'
19597 check("4294967295", 4294967295UL, 0);
19598 check("4294967296", 4294967295UL, ERANGE);
19599 #if 0 /* strtoul() for /^-/ strings is undefined. */
19600 check("-1", 4294967295UL, 0);
19601 check("-4294967294", 2, 0);
19602 check("-4294967295", 1, 0);
19603 check("-4294967296", 4294967295UL, ERANGE);
19604 check("-4294967297", 4294967295UL, ERANGE);
19609 : Should we write these tests to be more portable by sprintf-ing
19610 : ~0 and then manipulating that char string as input for strtol?
19613 $cat >>try.c <<'EOCP'
19620 if eval $compile; then
19621 case "`$run ./try`" in
19622 ok) echo "Your strtoul() seems to be working okay." ;;
19624 Your strtoul() doesn't seem to be working okay.
19630 echo "(I can't seem to compile the test program--assuming it doesn't)"
19636 : see if strtoull exists
19637 set strtoull d_strtoull
19640 case "$d_longlong-$d_strtoull" in
19643 Checking whether your strtoull() works okay...
19645 $cat >try.c <<'EOCP'
19646 #include <stdlib.h>
19649 #define strtoull __strtoull
19652 static int bad = 0;
19653 void check(const char *s, long long eull, int een) {
19656 gull = strtoull(s, 0, 10);
19657 if (!((gull == eull) && (errno == een)))
19661 check(" 1", 1LL, 0);
19662 check(" 0", 0LL, 0);
19663 check("18446744073709551615", 18446744073709551615ULL, 0);
19664 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19665 #if 0 /* strtoull() for /^-/ strings is undefined. */
19666 check("-1", 18446744073709551615ULL, 0);
19667 check("-18446744073709551614", 2LL, 0);
19668 check("-18446744073709551615", 1LL, 0);
19669 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19670 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19677 if eval $compile; then
19678 case "`$run ./try`" in
19679 ok) echo "Your strtoull() seems to be working okay." ;;
19681 Your strtoull() doesn't seem to be working okay.
19683 d_strtoull="$undef"
19687 echo "(I can't seem to compile the test program--assuming it doesn't)"
19688 d_strtoull="$undef"
19693 : see if strtouq exists
19694 set strtouq d_strtouq
19697 case "$d_strtouq" in
19700 Checking whether your strtouq() works okay...
19702 $cat >try.c <<'EOCP'
19703 #include <stdlib.h>
19706 static int bad = 0;
19707 void check(const char *s, unsigned long long eull, int een) {
19708 unsigned long long gull;
19710 gull = strtouq(s, 0, 10);
19711 if (!((gull == eull) && (errno == een)))
19715 check(" 1", 1LL, 0);
19716 check(" 0", 0LL, 0);
19717 check("18446744073709551615", 18446744073709551615ULL, 0);
19718 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19719 #if 0 /* strtouq() for /^-/ strings is undefined. */
19720 check("-1", 18446744073709551615ULL, 0);
19721 check("-18446744073709551614", 2LL, 0);
19722 check("-18446744073709551615", 1LL, 0);
19723 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19724 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19732 if eval $compile; then
19733 case "`$run ./try`" in
19734 ok) echo "Your strtouq() seems to be working okay." ;;
19736 Your strtouq() doesn't seem to be working okay.
19742 echo "(I can't seem to compile the test program--assuming it doesn't)"
19748 : see if strxfrm exists
19749 set strxfrm d_strxfrm
19752 : see if strxfrm_l exists
19753 set strxfrm_l d_strxfrm_l
19756 : see if symlink exists
19757 set symlink d_symlink
19760 : see if syscall exists
19761 set syscall d_syscall
19764 : see if prototype for syscall is available
19766 set d_syscallproto syscall $i_unistd unistd.h
19769 : see if sysconf exists
19770 set sysconf d_sysconf
19773 : see if sys_errlist[] exists
19775 if test "X$d_syserrlst" = X; then
19776 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19777 echo "You have sys_errlist[], so we could roll our own strerror."
19778 d_syserrlst="$define"
19780 echo "You don't have sys_errlist[], so strerror() is welcome."
19781 d_syserrlst="$undef"
19785 : see if system exists
19786 set system d_system
19789 : see if tcgetpgrp exists
19790 set tcgetpgrp d_tcgetpgrp
19793 : see if tcsetpgrp exists
19794 set tcsetpgrp d_tcsetpgrp
19797 : see if prototype for telldir is available
19799 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19802 : see if tgamma exists
19803 set tgamma d_tgamma
19806 : see what flavor, if any, of thread local storage is supported
19808 echo "Checking to see if your system supports C11 thread local storage..."
19809 $cat > try.c <<'EOCP'
19811 #include <stdlib.h>
19812 #include <pthread.h>
19814 static int plus_one = 1;
19815 static int minus_one = -1;
19817 PROBE_MACRO int *minion;
19819 int callback (const void *a, const void *b) {
19820 int val_a = *minion * *(const int *)a;
19821 int val_b = *minion * *(const int *)b;
19822 return val_a < val_b ? -1 : val_a > val_b;
19827 void *thread_function(void *arg) {
19828 /* thread local variables should start zeroed in each thread. */
19829 if (minion != NULL) {
19830 fprintf(stderr, "__thread variable started with %p, should be NULL\n",
19834 minion = &minus_one;
19838 for (i = 0; i < SIZE; ++i) {
19839 /* "Hash randomisation" - this array isn't in sorted order: */
19840 array[i ^ 5] = i * i;
19843 qsort(array, SIZE, sizeof(int), callback);
19846 for (i = 0; i < SIZE; ++i) {
19847 int want = (SIZE - 1 - i) * (SIZE - 1 - i);
19848 int have = array[i];
19849 if (want != have) {
19851 fprintf(stderr, "array[%u] - want %i, have %i\n", i, want, have);
19860 int main(int argc, char **argv) {
19861 if (minion != NULL) {
19862 fprintf(stderr, "__thread variable started with %p, should be NULL\n",
19867 minion = &plus_one;
19870 int result = pthread_create(&tid, NULL, thread_function, NULL);
19872 fprintf(stderr, "pthread_create failed (%d)\n", result);
19876 result = pthread_join(tid, NULL);
19878 fprintf(stderr, "pthread_join failed (%d)\n", result);
19882 if (minion == NULL) {
19883 fprintf(stderr, "__thread variable should not be NULL\n");
19886 if (!(minion == &plus_one && *minion == 1)) {
19887 fprintf(stderr, "__thread variable should be %d @ %p, not %d @ %p\n",
19888 1, &plus_one, *minion, minion);
19896 # Respect a hint (or previous) value for perl_thread_local, if there is one.
19897 case "$perl_thread_local" in
19898 '') # Check the various possibilities, and break out on success.
19899 for thread_local in _Thread_local __thread; do
19900 set try -DPROBE_MACRO=$thread_local
19901 if eval $compile && $run ./try; then
19902 $echo "Your compiler supports $thread_local." >&4
19904 perl_thread_local="$thread_local";
19907 $echo "Your compiler does NOT support $thread_local." >&4
19911 *thread*|*Thread*) # Some variant of thread local exists.
19912 echo "Keeping your $hint value of $perl_thread_local."
19915 *) # Unrecognized previous value -- blindly trust the supplied
19916 # value and hope it makes sense. Use old value for
19917 # d_thread_local, if there is one.
19918 echo "Keeping your $hint value of $perl_thread_local."
19919 case "$d_thread_local" in
19921 *) val=$d_thread_local ;;
19929 : see if time exists
19931 if test "X$d_time" = X -o X"$timetype" = X; then
19932 if set time val -f d_time; eval $csym; $val; then
19933 echo 'time() found.' >&4
19935 rp="What is the type returned by time() on this system?"
19936 set time_t timetype long stdio.h sys/types.h
19939 echo 'time() not found, hope that will do.' >&4
19947 : see if timegm exists
19948 set timegm d_timegm
19951 : see if this is a sys/times.h system
19952 set sys/times.h i_systimes
19955 : see if times exists
19957 if set times val -f d_times; eval $csym; $val; then
19958 echo 'times() found.' >&4
19961 case "$i_systimes" in
19962 "$define") inc='sys/times.h';;
19964 rp="What is the type returned by times() on this system?"
19965 set clock_t clocktype long stdio.h sys/types.h $inc
19968 echo 'times() NOT found, hope that will do.' >&4
19973 : see if tmpnam_r exists
19974 set tmpnam_r d_tmpnam_r
19976 case "$d_tmpnam_r" in
19978 hdrs="$i_systypes sys/types.h define stdio.h "
19979 case "$d_tmpnam_r_proto:$usethreads" in
19980 ":define") d_tmpnam_r_proto=define
19981 set d_tmpnam_r_proto tmpnam_r $hdrs
19985 case "$d_tmpnam_r_proto" in
19987 case "$tmpnam_r_proto" in
19988 ''|0) try='char* tmpnam_r(char*);'
19989 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19991 case "$tmpnam_r_proto" in
19992 ''|0) d_tmpnam_r=undef
19994 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19995 * ) case "$tmpnam_r_proto" in
19996 REENTRANT_PROTO*) ;;
19997 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19999 echo "Prototype: $try" ;;
20002 *) case "$usethreads" in
20003 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
20010 *) tmpnam_r_proto=0
20014 : see if towlower exists
20015 set towlower d_towlower
20018 : see if trunc exists
20022 : see if truncate exists
20023 set truncate d_truncate
20026 : see if ttyname_r exists
20027 set ttyname_r d_ttyname_r
20029 case "$d_ttyname_r" in
20031 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
20032 case "$d_ttyname_r_proto:$usethreads" in
20033 ":define") d_ttyname_r_proto=define
20034 set d_ttyname_r_proto ttyname_r $hdrs
20038 case "$d_ttyname_r_proto" in
20040 case "$ttyname_r_proto" in
20041 ''|0) try='int ttyname_r(int, char*, size_t);'
20042 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
20044 case "$ttyname_r_proto" in
20045 ''|0) try='int ttyname_r(int, char*, int);'
20046 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
20048 case "$ttyname_r_proto" in
20049 ''|0) try='char* ttyname_r(int, char*, int);'
20050 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
20052 case "$ttyname_r_proto" in
20053 ''|0) d_ttyname_r=undef
20055 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
20056 * ) case "$ttyname_r_proto" in
20057 REENTRANT_PROTO*) ;;
20058 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
20060 echo "Prototype: $try" ;;
20063 *) case "$usethreads" in
20064 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
20071 *) ttyname_r_proto=0
20075 : see if tzname[] exists
20077 if set tzname val -a d_tzname; eval $csym; $val; then
20079 echo 'tzname[] found.' >&4
20082 echo 'tzname[] NOT found.' >&4
20087 : Check if is a multiplatform env
20089 darwin) multiarch="$define" ;;
20091 case "$multiarch" in
20092 ''|[nN]*) multiarch="$undef" ;;
20095 : check for ordering of bytes in a UV
20097 case "$multiarch" in
20100 You seem to be doing a multiarchitecture build,
20101 skipping the byteorder check.
20107 case "$byteorder" in
20110 In the following, larger digits indicate more significance. A big-endian
20111 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
20112 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
20113 machines may have weird orders like 3412. A Cray will report 87654321,
20114 an Alpha will report 12345678. If the test program works the default is
20116 I'm now running the test program...
20120 #$i_stdlib I_STDLIB
20122 #include <stdlib.h>
20124 #$i_inttypes I_INTTYPES
20126 #include <inttypes.h>
20128 #include <sys/types.h>
20129 typedef $uvtype UV;
20139 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
20141 u.l = (UV)0x04030201;
20142 for (i = 0; i < $uvsize; i++)
20143 printf("%c", u.c[i]+'0');
20150 if eval $compile && $run ./try > /dev/null; then
20153 [1-4][1-4][1-4][1-4]|12345678|87654321)
20154 echo "(The test program ran ok.)"
20155 echo "byteorder=$dflt"
20158 ????|????????) echo "(The test program ran ok.)" ;;
20159 *) echo "(The test program didn't run right for some reason.)" ;;
20164 (I can't seem to compile the test program. Guessing big-endian...)
20167 case "$xxx_prompt" in
20169 rp="What is the order of bytes in $uvtype?"
20182 : Checking 32bit alignedness
20185 Checking to see whether you can access character data unalignedly...
20187 case "$d_u32align" in
20188 '') $cat >try.c <<EOCP
20190 #$i_stdlib I_STDLIB
20192 #include <stdlib.h>
20194 #define U32 $u32type
20195 #define BYTEORDER 0x$byteorder
20197 #include <signal.h>
20199 $signal_t bletch(int s) { exit(4); }
20202 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20203 volatile U8 buf[8];
20207 if (sizeof(U32) != 4) {
20208 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20215 signal(SIGBUS, bletch);
20227 for (i = 0; i < 4; i++) {
20228 up = (U32*)(buf + i);
20229 if (! ((*up == 1 << (8*i)) || /* big-endian */
20230 (*up == 1 << (8*(3-i))) /* little-endian */
20234 printf("read failed (%x)\n", *up);
20240 for (i = 0; i < 4; i++) {
20241 up = (U32*)(buf + i);
20243 if (*up != 0xBeef) {
20244 printf("write failed (%x)\n", *up);
20258 if eval $compile_ok; then
20259 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20260 $run ./try 2>&1 >/dev/null
20263 You can access character data pretty unalignedly.
20265 d_u32align="$undef"
20268 It seems that you must access character data in an aligned manner.
20270 d_u32align="$define"
20274 rp='Can you access character data at unaligned addresses?'
20278 [yY]*) d_u32align="$undef" ;;
20279 *) d_u32align="$define" ;;
20286 : see if ualarm exists
20287 set ualarm d_ualarm
20290 : see if umask exists
20294 : see if unordered exists
20295 set unordered d_unordered
20298 : see if unsetenv exists
20299 set unsetenv d_unsetenv
20302 : see if usleep exists
20303 set usleep d_usleep
20306 : see if prototype for usleep is available
20308 set d_usleepproto usleep $i_unistd unistd.h
20311 : see if ustat exists
20315 : see if closedir exists
20316 set closedir d_closedir
20319 case "$d_closedir" in
20322 echo "Checking whether closedir() returns a status..." >&4
20324 #$i_dirent I_DIRENT /**/
20325 #$i_sysdir I_SYS_DIR /**/
20326 #$i_sysndir I_SYS_NDIR /**/
20327 #$i_systypes I_SYS_TYPES /**/
20329 #if defined(I_SYS_TYPES)
20330 #include <sys/types.h>
20332 #if defined(I_DIRENT)
20333 #include <dirent.h>
20336 #include <sys/ndir.h>
20339 #include <sys/dir.h>
20343 int main() { return closedir(opendir(".")); }
20346 if eval $compile_ok; then
20347 if $run ./try > /dev/null 2>&1 ; then
20348 echo "Yes, it does."
20351 echo "No, it doesn't."
20355 echo "(I can't seem to compile the test program--assuming it doesn't)"
20363 set d_void_closedir
20367 : see if there is a wait4
20371 : see if waitpid exists
20372 set waitpid d_waitpid
20375 : see if wcrtomb exists
20376 set wcrtomb d_wcrtomb
20381 $cat >try.c <<'EOCP'
20387 return (wcscmp (s, s) ? 1 : 0);
20392 if eval $compile; then
20395 0) echo "A working wcscmp() found." >&4
20397 *) echo "wcscmp() found, but it doesn't work" >&4
20401 echo "wcscmp() NOT found." >&4
20407 : see if wcstombs exists
20408 set wcstombs d_wcstombs
20413 $cat >try.c <<'EOCP'
20418 wchar_t dst[4], *src = L" ";
20420 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20425 if eval $compile; then
20428 0) echo "A working wcsxfrm() found." >&4
20430 *) echo "wcsxfrm() found, but it doesn't work" >&4
20434 echo "wcsxfrm() NOT found." >&4
20440 : see if wctomb exists
20441 set wctomb d_wctomb
20444 : see if writev exists
20445 set writev d_writev
20448 : check for alignment requirements
20450 case "$alignbytes" in
20451 '') echo "Checking alignment constraints..." >&4
20460 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20465 if eval $compile_ok; then
20469 echo "(I can't seem to compile the test program...)"
20471 case "$multiarch" in
20473 : The usual safe value is 8, but Darwin with -Duselongdouble
20474 : needs 16. Hence, we will take 8 as a minimum, but allow
20475 : Configure to pick a larger value if needed.
20476 if $test "$dflt" -lt 8; then
20478 echo "Setting alignment to 8 for multiarch support.">&4
20483 *) dflt="$alignbytes"
20486 rp="Doubles must be aligned on a how-many-byte boundary?"
20491 : set the base revision
20494 : length of character in bytes. Is always 1, otherwise it is not C
20495 : This used to be a test using sizeof
20498 : Check for the number of bits in a character
20499 case "$charbits" in
20500 '') echo "Checking how long a character is (in bits)..." >&4
20507 for (c = 1, n = 0; c; c <<= 1, n++) ;
20508 printf ("%d\n", n);
20513 if eval $compile_ok; then
20517 echo "(I can't seem to compile the test program. Guessing...)"
20524 rp="What is the length of a character (in bits)?"
20528 case "$charbits" in
20531 Your system has an unsigned character size of $charbits bits, which
20532 is rather unusual (normally it is 8 bits). Perl likely will not work
20533 correctly on your system, with subtle bugs in various places.
20535 rp='Do you really want to continue?'
20539 [yY]) echo >&4 "Okay, continuing." ;;
20544 : how do we concatenate cpp tokens here?
20546 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20547 $cat >cpp_stuff.c <<'EOCP'
20548 #define RCAT(a,b)a/**/b
20549 #define ACAT(a,b)a ## b
20553 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20554 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20555 echo "Oh! Smells like ANSI's been here." >&4
20556 echo "We can catify or stringify, separately or together!"
20558 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20559 echo "Ah, yes! The good old days!" >&4
20560 echo "However, in the good old days we don't know how to stringify and"
20561 echo "catify at the same time."
20565 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20566 You're going to have to edit the values of CAT[2-5] in config.h...
20568 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20572 : see if this is a db.h system
20578 : Check db version.
20580 echo "Checking Berkeley DB version ..." >&4
20582 #include <sys/types.h>
20584 #$i_stdlib I_STDLIB
20586 #include <stdlib.h>
20589 int main(int argc, char *argv[])
20591 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20592 int Major, Minor, Patch ;
20593 unsigned long Version ;
20594 (void)db_version(&Major, &Minor, &Patch) ;
20596 printf("%d %d %d %d %d %d\n",
20597 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20598 Major, Minor, Patch);
20601 printf("You have Berkeley DB Version 2 or greater.\n");
20603 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20604 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20605 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20606 Major, Minor, Patch) ;
20608 /* check that db.h & libdb are compatible */
20609 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20610 printf("db.h and libdb are incompatible.\n") ;
20614 printf("db.h and libdb are compatible.\n") ;
20616 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20617 + DB_VERSION_PATCH ;
20619 /* needs to be >= 2.3.4 */
20620 if (Version < 2003004) {
20621 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20622 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20628 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20633 printf("You have Berkeley DB Version 1.\n");
20634 exit(0); /* DB version < 2: the coast is clear. */
20636 exit(1); /* <db.h> not Berkeley DB? */
20642 if eval $compile_ok && $run ./try; then
20643 echo 'Looks OK.' >&4
20645 db_version_major=$1
20646 db_version_minor=$2
20647 db_version_patch=$3
20649 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20653 : Remove db from list of libraries to use
20654 echo "Removing unusable -ldb from library list" >&4
20655 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20658 echo "libs = $libs" >&4
20668 : Check the return type needed for hash
20670 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20672 #include <sys/types.h>
20675 #ifndef DB_VERSION_MAJOR
20676 u_int32_t hash_cb (const void* ptr, size_t size)
20683 info.hash = hash_cb;
20687 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20688 if $compiler_warning try.out >>/dev/null 2>&1 ; then
20691 db_hashtype='u_int32_t'
20694 : XXX Maybe we should just give up here.
20695 db_hashtype=u_int32_t
20697 echo "Help: I can't seem to compile the db test program." >&4
20698 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20701 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20703 *) db_hashtype=u_int32_t
20708 : Check the return type needed for prefix
20710 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20712 #include <sys/types.h>
20715 #ifndef DB_VERSION_MAJOR
20716 size_t prefix_cb (const DBT *key1, const DBT *key2)
20723 info.prefix = prefix_cb;
20727 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20728 if $compiler_warning try.out >>/dev/null 2>&1 ; then
20729 db_prefixtype='int'
20731 db_prefixtype='size_t'
20734 db_prefixtype='size_t'
20735 : XXX Maybe we should just give up here.
20737 echo "Help: I can't seem to compile the db test program." >&4
20738 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20741 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20743 *) db_prefixtype='size_t'
20747 : Include . in @INC
20750 Historically Perl has provided a final fallback of the current working
20751 directory '.' when searching for a library. This, however, can lead to
20752 problems when a Perl program which loads optional modules is called from
20753 a shared directory. This can lead to executing unexpected code.
20757 # When changing to exclude by default:
20758 case "$default_inc_excludes_dot" in
20759 $undef|false|[nN]*) dflt="n" ;;
20762 # To turn exclude off by default:
20763 #case "$default_inc_excludes_dot" in
20764 # $define|true|[yY]*) dflt="y" ;;
20768 rp='Exclude '.' from @INC by default? '
20771 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20772 *) default_inc_excludes_dot="$define" ;;
20775 : Check what kind of inf/nan your system has
20776 $echo "Checking the kind of infinities and nans you have..." >&4
20777 $echo "(The following tests may crash. That's okay.)" >&4
20779 #define DOUBLESIZE $doublesize
20780 #$d_longdbl HAS_LONG_DOUBLE
20781 #ifdef HAS_LONG_DOUBLE
20782 #define LONG_DOUBLESIZE $longdblsize
20783 #define LONG_DOUBLEKIND $longdblkind
20786 #include <string.h>
20788 /* Note that whether the sign bit is on or off
20789 * for NaN depends on the CPU/FPU, and possibly
20790 * can be affected by the build toolchain.
20792 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20793 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20794 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20795 * (respectively) as opposed to the more usual
20796 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20798 * Pre-IEEE-754 floating point format do not even have inf/nan support
20799 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20800 * to even mention, causing immediate SIGFPE or equivalent: this is
20801 * the case with VAX floating point, for example.
20803 static void bytes(void *v, unsigned int n) {
20804 unsigned char *p = (unsigned char *)v;
20806 for (i = 0; i < n; i++) {
20807 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20810 int main(int argc, char *argv[]) {
20811 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20812 * because some compilers are 'smart' and not only warn but refuse to
20813 * compile such 'illegal' values. */
20814 double dinf = exp(1e9);
20815 double dnan = sqrt(-1.0);
20816 #ifdef HAS_LONG_DOUBLE
20817 long double ldinf = (long double)exp(1e9);
20818 long double ldnan = (long double)sqrt(-1.0);
20819 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20820 /* the 80-bit long doubles might have garbage in their excess bytes */
20821 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20822 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20826 switch (argv[1][0]) {
20827 case '1': bytes(&dinf, sizeof(dinf)); break;
20828 case '2': bytes(&dnan, sizeof(dnan)); break;
20829 #ifdef HAS_LONG_DOUBLE
20830 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20831 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20839 if eval $compile; then
20840 doubleinfbytes=`$run ./try 1`
20841 doublenanbytes=`$run ./try 2`
20842 case "$d_longdbl" in
20844 longdblinfbytes=`$run ./try 3`
20845 longdblnanbytes=`$run ./try 4`
20849 # Defaults in case the above test program failed.
20850 case "$doublekind" in
20851 1) # IEEE 754 32-bit LE
20852 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20853 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20855 2) # IEEE 754 32-bit BE
20856 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20857 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20859 3) # IEEE 754 64-bit LE
20860 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20861 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20863 4) # IEEE 754 64-bit BE
20864 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20865 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20867 5) # IEEE 754 128-bit LE
20868 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20869 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20871 6) # IEEE 754 128-bit BE
20872 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20873 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20875 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20876 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20877 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20879 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20880 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20881 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20883 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20884 doubleinfbytes=$undef
20885 doublenanbytes=$undef
20888 doubleinfbytes=$undef
20889 doublenanbytes=$undef
20892 case "$longdblkind" in
20893 1) # IEEE 754 128-bit LE
20894 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20895 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20897 2) # IEEE 754 128-bit BE
20898 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20899 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20901 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20902 case "$longdblsize" in
20903 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20904 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20905 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20908 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20909 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20912 longdblinfbytes=$undef
20913 longdblnanbytes=$undef
20917 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20918 case "$longdblsize" in
20919 12) # 32-bit system
20920 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20921 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20923 16) # 64-bit system
20924 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20925 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20928 longdblinfbytes=$undef
20929 longdblnanbytes=$undef
20933 5) # 128-bit LE-LE "double double"
20934 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20935 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20937 6) # 128-bit BE-BE "double double"
20938 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20939 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20941 7) # 128-bit LE-BE "double double"
20942 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20943 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20945 8) # 128-bit BE-LE "double double"
20946 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20947 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20949 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20950 longdblinfbytes=$undef
20951 longdblnanbytes=$undef
20954 longdblinfbytes=$undef
20955 longdblnanbytes=$undef
20959 # In case the program crashed the values are empty, turn them undef.
20960 case "$doubleinfbytes" in
20961 '') doubleinfbytes=$undef ;;
20963 case "$doublenanbytes" in
20964 '') doublenanbytes=$undef ;;
20966 case "$longdblinfbytes" in
20967 '') longdblinfbytes=$undef ;;
20969 case "$longdblnanbytes" in
20970 '') longdblnanbytes=$undef ;;
20974 : Check the length of the double mantissa
20975 $echo "Checking how many mantissa bits your doubles have..." >&4
20977 #$i_sunmath I_SUNMATH
20980 # include <sunmath.h>
20982 #ifdef DBL_MANT_DIG
20983 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20986 int main(int argc, char *argv[]) {
20988 printf("%d\n", BITS);
20994 if eval $compile; then
20995 doublemantbits=`$run ./try`
20997 doublemantbits="$undef"
21001 : Check the length of the longdouble mantissa
21002 $echo "Checking how many mantissa bits your long doubles have..." >&4
21004 #$i_sunmath I_SUNMATH
21007 # include <sunmath.h>
21009 #$d_longdbl HAS_LONG_DOUBLE
21010 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
21011 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
21012 /* This format has no implicit bit. Beware, however, that for
21013 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
21014 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
21015 * and the top bit must have been one since 387, zero is plain invalid.
21016 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
21017 # define BITS LDBL_MANT_DIG
21018 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
21019 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
21020 * reason e.g. Irix thinks 107. But in any case, we want only
21021 * the number of real bits, the implicit bits are of no interest. */
21022 # define BITS 2 * (DBL_MANT_DIG - 1)
21024 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
21028 int main(int argc, char *argv[]) {
21030 printf("%d\n", BITS);
21036 if eval $compile; then
21037 longdblmantbits=`$run ./try`
21039 longdblmantbits="$undef"
21043 : Check the length of the NV mantissa
21044 $echo "Checking how many mantissa bits your NVs have..." >&4
21045 if test "X$usequadmath" = "X$define"; then
21046 nvmantbits=112 # 128-1-15
21048 if test "X$nvsize" = "X$doublesize"; then
21049 nvmantbits="$doublemantbits"
21051 if test "X$nvsize" = "X$longdblsize"; then
21052 nvmantbits="$longdblmantbits"
21054 nvmantbits="$undef"
21059 : How can we generate normalized random numbers ?
21061 echo "Using our internal random number implementation..." >&4
21064 *-Dmy_rand=*|*-Dmy_srand=*)
21065 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
21066 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
21067 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
21068 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
21072 randfunc=Perl_drand48
21073 drand01="Perl_drand48()"
21074 seedfunc="Perl_drand48_init"
21078 : Probe whether dtrace builds an object, as newer Illumos requires an input
21079 : object file that uses at least one of the probes defined in the .d file
21080 case "$usedtrace" in
21082 case "$dtracexnolibs" in
21083 $define|true|[yY]*)
21084 dtracexnolibs=$define
21085 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
21088 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21089 dtracexnolibs=$define
21090 echo "Your dtrace accepts -xnolibs"
21091 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21092 dtracexnolibs=$undef
21093 echo "Your dtrace doesn't accept -xnolibs"
21095 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
21100 dtracexnolibs=$undef
21101 $dtrace -h -s ../perldtrace.d -o perldtrace.h
21104 case $dtracexnolibs in
21105 $define) xnolibs=-xnolibs ;;
21109 case "$dtraceobject" in
21110 $define|true|[yY]*)
21111 dtraceobject=$define
21115 #include "perldtrace.h"
21117 PERL_LOADED_FILE("dummy");
21121 dtraceobject=$undef
21122 if $cc -c -o try.o $optimize $ccflags try.c \
21123 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
21124 dtraceobject=$define
21125 echo "Your dtrace builds an object file"
21128 *) dtraceobject=$undef ;;
21130 $rm_try perldtrace.o perldtrace.h
21133 : Determine if this is an EBCDIC system
21135 echo "Determining whether or not we are on an EBCDIC system..." >&4
21136 $cat >try.c <<'EOM'
21139 if ('M'==0xd4) return 0;
21146 if eval $compile_ok; then
21147 if $run ./try; then
21148 echo "You seem to speak EBCDIC." >&4
21151 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21154 echo "I'm unable to compile the test program." >&4
21155 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21161 : Check how to flush
21164 Checking how to flush all pending stdio output...
21166 # I only know how to find the first 32 possibly open files on SunOS.
21167 # See also hints/sunos_4_1.sh and util.c --AD
21169 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21171 $cat >>try.c <<EOCP
21173 #$i_stdlib I_STDLIB
21175 #include <stdlib.h>
21177 #$i_unistd I_UNISTD
21179 # include <unistd.h>
21181 #$d_sysconf HAS_SYSCONF
21182 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21183 #ifdef HAS_STDIO_STREAM_ARRAY
21184 # define STDIO_STREAM_ARRAY $stdio_stream_array
21189 p = fopen("try.out", "w");
21193 # ifdef TRY_FPRINTF
21197 #ifdef TRY_FFLUSH_NULL
21200 #ifdef TRY_FFLUSH_ALL
21202 long open_max = -1;
21203 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21204 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21206 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21207 open_max = sysconf(_SC_OPEN_MAX);
21210 open_max = FOPEN_MAX;
21213 open_max = OPEN_MAX;
21222 # ifdef HAS_STDIO_STREAM_ARRAY
21223 if (open_max > 0) {
21225 for (i = 0; i < open_max; i++)
21226 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21227 STDIO_STREAM_ARRAY[i]._file < open_max &&
21228 STDIO_STREAM_ARRAY[i]._flag)
21229 fflush(&STDIO_STREAM_ARRAY[i]);
21237 : first we have to find out how _not_ to flush
21239 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21241 set try -DTRY_FPUTC
21242 if eval $compile; then
21243 $run ./try 2>/dev/null
21246 if $test ! -s try.out -a "X$code" = X42; then
21252 set try -DTRY_FPRINTF
21253 if eval $compile; then
21254 $run ./try 2>/dev/null
21257 if $test ! -s try.out -a "X$code" = X42; then
21258 output=-DTRY_FPRINTF
21264 : check for fflush NULL behavior
21265 case "$fflushNULL" in
21266 '') set try -DTRY_FFLUSH_NULL $output
21267 if eval $compile; then
21268 $run ./try 2>/dev/null
21271 if $test -s try.out -a "X$code" = X42; then
21272 fflushNULL="`$cat try.out`"
21274 if $test "X$code" != X42; then
21276 (If this test failed, don't worry, we'll try another method shortly.)
21281 $rm -f core try.core core.try.*
21282 case "$fflushNULL" in
21284 Your fflush(NULL) works okay for output streams.
21285 Let's see if it clobbers input pipes...
21287 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21288 # bug that improperly flushes the input end of pipes. So we avoid the
21289 # autoflush on fork/system/exec support for now. :-(
21290 $cat >tryp.c <<EOCP
21293 main(int argc, char **argv)
21299 while ((i = getc(stdin)) != -1
21300 && (*bp++ = i) != '\n'
21301 && bp < &buf[1024])
21304 fprintf(stdout, "%s", buf);
21312 fflushNULL="$define"
21314 if eval $compile; then
21316 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21317 if $test "X$targethost" != X; then
21320 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21322 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21324 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21326 fflush(NULL) seems to behave okay with input streams.
21328 fflushNULL="$define"
21331 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21333 fflushNULL="$undef"
21336 $rm -f core tryp.c tryp.core core.tryp.*
21339 Your fflush(NULL) isn't working (contrary to ANSI C).
21341 fflushNULL="$undef"
21344 Cannot figure out whether your fflush(NULL) works or not.
21345 I'm assuming it doesn't (contrary to ANSI C).
21347 fflushNULL="$undef"
21351 $define|true|[yY]*)
21352 fflushNULL="$define"
21355 fflushNULL="$undef"
21358 : check explicit looping only if NULL did not work, and if the pipe
21359 : bug does not show up on an explicit flush too
21360 case "$fflushNULL" in
21362 $cat >tryp.c <<EOCP
21365 main(int argc, char **argv)
21371 while ((i = getc(stdin)) != -1
21372 && (*bp++ = i) != '\n'
21373 && bp < &buf[1024])
21376 fprintf(stdout, "%s", buf);
21385 if eval $compile; then
21387 if $test "X$targethost" != X; then
21390 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21392 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21394 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21396 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21398 : now check for fflushall behaviour
21399 case "$fflushall" in
21400 '') set try -DTRY_FFLUSH_ALL $output
21401 if eval $compile; then
21403 (Now testing the other method--but note that this also may fail.)
21405 $run ./try 2>/dev/null
21408 if $test -s try.out -a "X$code" = X42; then
21409 fflushall="`$cat try.out`"
21413 case "$fflushall" in
21415 Whew. Flushing explicitly all the stdio streams works.
21417 fflushall="$define"
21420 Sigh. Flushing explicitly all the stdio streams doesn't work.
21425 Cannot figure out whether flushing stdio streams explicitly works or not.
21426 I'm assuming it doesn't.
21432 "$define"|true|[yY]*)
21433 fflushall="$define"
21441 All is futile. Even fflush(stdin) clobbers input pipes!
21448 $rm -f core tryp.c tryp.core core.tryp.*
21450 *) fflushall="$undef"
21454 case "$fflushNULL$fflushall" in
21457 OK, I give up. I cannot figure out how to flush pending stdio output.
21458 We won't be flushing handles at all before fork/exec/popen.
21464 : Store the full pathname to the ar program for use in the C program
21465 : Respect a hint or command line value for full_ar.
21470 : Store the full pathname to the sed program for use in the C program
21473 : see what type gids are declared as in the kernel
21475 echo "Looking for the type for group ids returned by getgid()."
21476 set gid_t gidtype xxx stdio.h sys/types.h
21480 xxx=`./findhdr sys/user.h`
21481 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21483 unsigned) dflt="$1 $2" ;;
21487 *) dflt="$gidtype";;
21490 gid_t) echo "gid_t found." ;;
21491 *) rp="What is the type for group ids returned by getgid()?"
21497 : Check the size of GID
21500 *_t) zzz="$gidtype" ;;
21503 echo "Checking the size of $zzz..." >&4
21505 #include <sys/types.h>
21507 #$i_stdlib I_STDLIB
21509 #include <stdlib.h>
21512 printf("%d\n", (int)sizeof($gidtype));
21517 if eval $compile_ok; then
21521 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21524 echo "Your $zzz is $gidsize bytes long."
21529 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21532 : Check if GID is signed
21535 *_t) zzz="$gidtype" ;;
21538 echo "Checking the sign of $zzz..." >&4
21540 #include <sys/types.h>
21551 if eval $compile; then
21555 echo "(I can't execute the test program--guessing unsigned.)" >&4
21559 1) echo "Your $zzz is unsigned." ;;
21560 -1) echo "Your $zzz is signed." ;;
21566 echo "(I can't compile the test program--guessing unsigned.)" >&4
21569 : Check 64bit sizes
21572 if $test X"$quadtype" != X; then
21574 echo "Checking how to print 64-bit integers..." >&4
21576 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21577 $cat >try.c <<'EOCP'
21578 #include <sys/types.h>
21581 int q = 12345678901;
21582 printf("%ld\n", q);
21586 if eval $compile; then
21590 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21591 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21592 echo "We will use %d."
21598 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21599 $cat >try.c <<'EOCP'
21600 #include <sys/types.h>
21603 long q = 12345678901;
21604 printf("%ld\n", q);
21608 if eval $compile; then
21612 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21613 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21614 echo "We will use %ld."
21620 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21621 $cat >try.c <<'EOCP'
21622 #include <sys/types.h>
21623 #include <inttypes.h>
21626 int64_t q = 12345678901;
21627 printf("%" PRId64 "\n", q);
21631 if eval $compile; then
21635 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21636 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIX64;
21637 echo "We will use the C9X style."
21643 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21645 #include <sys/types.h>
21648 $quadtype q = 12345678901;
21649 printf("%Ld\n", q);
21653 if eval $compile; then
21657 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21658 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21659 echo "We will use %Ld."
21665 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21666 $cat >try.c <<'EOCP'
21667 #include <sys/types.h>
21670 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21671 printf("%lld\n", q);
21675 if eval $compile; then
21679 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21680 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21681 echo "We will use the %lld style."
21687 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21689 #include <sys/types.h>
21692 $quadtype q = 12345678901;
21693 printf("%qd\n", q);
21697 if eval $compile; then
21701 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21702 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21703 echo "We will use %qd."
21709 if $test X"$sPRId64" = X; then
21710 echo "Cannot figure out how to print 64-bit integers." >&4
21717 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21718 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21720 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21721 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21725 : Check format strings for internal types
21727 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21729 if $test X"$ivsize" = X8; then
21730 ivdformat="$sPRId64"
21731 uvuformat="$sPRIu64"
21732 uvoformat="$sPRIo64"
21733 uvxformat="$sPRIx64"
21734 uvXUformat="$sPRIXU64"
21736 if $test X"$ivsize" = X"$longsize"; then
21743 if $test X"$ivsize" = X"$intsize"; then
21751 if $test X"$ivsize" = X"$shortsize"; then
21762 if $test X"$usequadmath" = X"$define"; then
21770 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21771 nveformat="$sPRIeldbl"
21772 nvfformat="$sPRIfldbl"
21773 nvgformat="$sPRIgldbl"
21774 nvEUformat="$sPRIEUldbl"
21775 nvFUformat="$sPRIFUldbl"
21776 nvGUformat="$sPRIGUldbl"
21787 case "$ivdformat" in
21788 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21793 case "$i32dformat" in
21794 '') case "$i32type" in
21809 int_least32_t) : will not happen currently
21810 i32dformat=PRIdLEAST32
21811 u32uformat=PRIuLEAST32
21812 u32oformat=PRIoLEAST32
21813 u32xformat=PRIxLEAST32
21814 u32XUformat=PRIXLEAST32
21826 case "$i32dformat" in
21827 '') echo "$0: Fatal: failed to find format strings for 32-bit integers, cannot continue." >&4
21832 : Check format string for GID
21835 $echo "Checking the format string to be used for gids..." >&4
21838 -1) if $test X"$gidsize" = X"$ivsize"; then
21839 gidformat="$ivdformat"
21841 if $test X"$gidsize" = X"$longsize"; then
21844 if $test X"$gidsize" = X"$intsize"; then
21847 if $test X"$gidsize" = X"$shortsize"; then
21854 *) if $test X"$gidsize" = X"$uvsize"; then
21855 gidformat="$uvuformat"
21857 if $test X"$gidsize" = X"$longsize"; then
21860 if $test X"$gidsize" = X"$intsize"; then
21863 if $test X"$gidsize" = X"$shortsize"; then
21872 : see if getgroups exists
21873 set getgroups d_getgrps
21876 : see if setgroups exists
21877 set setgroups d_setgrps
21880 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21882 case "$d_getgrps$d_setgrps" in
21884 case "$groupstype" in
21885 '') dflt="$gidtype" ;;
21886 *) dflt="$groupstype" ;;
21889 What type of pointer is the second argument to getgroups() and setgroups()?
21890 Usually this is the same as group ids, $gidtype, but not always.
21893 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21897 *) groupstype="$gidtype";;
21900 : check whether make sets MAKE
21902 echo "Checking if your $make program sets \$(MAKE)..." >&4
21903 case "$make_set_make" in
21905 $sed 's/^X //' > testmake.mak << 'EOF'
21907 X @echo 'maketemp="$(MAKE)"'
21909 case "`$make -f testmake.mak 2>/dev/null`" in
21910 *maketemp=*) make_set_make='#' ;;
21911 *) make_set_make="MAKE=$make" ;;
21913 $rm -f testmake.mak
21916 case "$make_set_make" in
21917 '#') echo "Yup, it does.";;
21918 *) echo "Nope, it doesn't.";;
21921 : see what type is used for mode_t
21922 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21923 set mode_t modetype int stdio.h sys/types.h
21926 : see if we need va_copy
21929 #include <stdarg.h>
21931 #include <stdlib.h>
21932 #include <signal.h>
21935 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21937 return vfprintf(f, fmt, *valp);
21941 myvfprintf(FILE *f, const char *fmt, va_list val)
21943 return ivfprintf(f, fmt, &val);
21947 myprintf(char *fmt, ...)
21950 va_start(val, fmt);
21951 return myvfprintf(stdout, fmt, val);
21955 main(int ac, char **av)
21957 signal(SIGSEGV, exit);
21959 signal(SIGBUS, exit);
21962 myprintf("%s%cs all right, then\n", "that", '\'');
21967 if eval $compile && $run ./try 2>&1 >/dev/null; then
21968 case "`$run ./try`" in
21969 "that's all right, then")
21975 yes) echo "It seems that you don't need va_copy()." >&4
21976 need_va_copy="$undef"
21978 *) echo "It seems that va_copy() or similar will be needed." >&4
21979 need_va_copy="$define"
21984 : see what type is used for size_t
21985 rp="What is the type used for the length parameter for string functions?"
21986 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21989 : check for type of arguments to gethostbyaddr.
21990 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21991 case "$d_gethbyaddr" in
21995 Checking to see what type of arguments are accepted by gethostbyaddr().
21997 hdrs="$define sys/types.h
21998 $d_socket sys/socket.h
21999 $i_niin netinet/in.h
22001 $i_unistd unistd.h"
22002 : The first arg can 'char *' or 'void *'
22003 : The second arg is some of integral type
22004 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
22005 for yyy in size_t long int; do
22006 case "$netdb_host_type" in
22007 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
22008 if ./protochk "$try" $hdrs; then
22009 echo "Your system accepts $xxx for the first arg."
22010 echo "...and $yyy for the second arg."
22011 netdb_host_type="$xxx"
22012 netdb_hlen_type="$yyy"
22018 : In case none of those worked, prompt the user.
22019 case "$netdb_host_type" in
22020 '') rp='What is the type for the 1st argument to gethostbyaddr?'
22023 netdb_host_type=$ans
22024 rp='What is the type for the 2nd argument to gethostbyaddr?'
22027 netdb_hlen_type=$ans
22031 *) : no gethostbyaddr, so pick harmless defaults
22032 netdb_host_type='char *'
22033 netdb_hlen_type="$sizetype"
22036 # Remove the "const" if needed. -- but then we'll have a
22038 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
22041 : check for type of argument to gethostbyname.
22042 if test "X$netdb_name_type" = X ; then
22043 case "$d_gethbyname" in
22047 Checking to see what type of argument is accepted by gethostbyname().
22049 hdrs="$define sys/types.h
22050 $d_socket sys/socket.h
22051 $i_niin netinet/in.h
22053 $i_unistd unistd.h"
22054 for xxx in "const char *" "char *"; do
22055 case "$netdb_name_type" in
22056 '') try="$extern_C struct hostent *gethostbyname($xxx);"
22057 if ./protochk "$try" $hdrs; then
22058 echo "Your system accepts $xxx."
22059 netdb_name_type="$xxx"
22064 : In case none of those worked, prompt the user.
22065 case "$netdb_name_type" in
22066 '') rp='What is the type for the 1st argument to gethostbyname?'
22069 netdb_name_type=$ans
22073 *) : no gethostbyname, so pick harmless default
22074 netdb_name_type='char *'
22079 : check for type of 1st argument to getnetbyaddr.
22080 if test "X$netdb_net_type" = X ; then
22081 case "$d_getnbyaddr" in
22085 Checking to see what type of 1st argument is accepted by getnetbyaddr().
22087 hdrs="$define sys/types.h
22088 $d_socket sys/socket.h
22089 $i_niin netinet/in.h
22091 $i_unistd unistd.h"
22092 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
22093 case "$netdb_net_type" in
22094 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
22095 if ./protochk "$try" $hdrs; then
22096 echo "Your system accepts $xxx."
22097 netdb_net_type="$xxx"
22102 : In case none of those worked, prompt the user.
22103 case "$netdb_net_type" in
22104 '') rp='What is the type for the 1st argument to getnetbyaddr?'
22107 netdb_net_type=$ans
22111 *) : no getnetbyaddr, so pick harmless default
22112 netdb_net_type='long'
22116 : locate the preferred pager for this system
22123 [a-zA-Z]:/*) dflt=$pg;;
22127 [a-zA-Z]:/*) dflt=$more;;
22131 [a-zA-Z]:/*) dflt=$less;;
22134 '') dflt=/usr/ucb/more;;
22142 rp='What pager is used on your system?'
22146 : see if ar generates random libraries by itself
22148 echo "Checking how to generate random libraries on your machine..." >&4
22149 echo 'extern int bar2(); int bar1() { return bar2(); }' > bar1.c
22150 echo 'int bar2() { return 2; }' > bar2.c
22152 #$i_stdlib I_STDLIB
22154 #include <stdlib.h>
22158 int main() { printf("%d\n", bar1()); exit(0); }
22160 $cc $ccflags -c bar1.c >/dev/null 2>&1
22161 $cc $ccflags -c bar2.c >/dev/null 2>&1
22162 $cc $ccflags -c foo.c >/dev/null 2>&1
22163 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
22164 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22165 $run ./foobar >/dev/null 2>&1; then
22166 echo "$ar appears to generate random libraries itself."
22168 if [ "X$ranlib" = "X" ]; then
22171 elif $ar s bar$_a >/dev/null 2>&1 &&
22172 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22173 $run ./foobar >/dev/null 2>&1; then
22174 echo "a table of contents needs to be added with '$ar s'."
22177 elif $ar ts bar$_a >/dev/null 2>&1 &&
22178 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22179 $run ./foobar >/dev/null 2>&1; then
22180 echo "a table of contents needs to be added with '$ar ts'."
22187 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22188 $test -f $ranlib || ranlib=''
22191 if $test -n "$ranlib"; then
22192 echo "your system has '$ranlib'; we'll use that."
22195 echo "your system doesn't seem to support random libraries"
22196 echo "so we'll use lorder and tsort to order the libraries."
22203 : Check the max offset that gmtime and localtime accept
22204 echo "Checking max offsets that gmtime () accepts"
22206 case "$sGMTIME_min/$sGMTIME_max" in
22209 #include <sys/types.h>
22217 void gm_check (time_t t, int min_year, int max_year)
22220 if ( tmp == NULL ||
22221 /* Check tm_year overflow */
22222 tmp->tm_year < min_year || tmp->tm_year > max_year)
22233 gm_check (MAXLONG, 69, 0x7fffffff);
22235 if (tmp == NULL || tmp->tm_year < 0) {
22236 for (i = 63; i >= 0; i--) {
22237 time_t x = pt | ((time_t)1 << i);
22238 if (x < 0 || x < pt) continue;
22239 gm_check (x, 69, 0x7fffffff);
22242 printf ("sGMTIME_max=%ld\n", pt);
22251 gm_check (MINLONG, -1900, 70);
22254 for (i = 36; i >= 0; i--) {
22255 time_t x = pt - ((time_t)1 << i);
22256 if (x > 0) continue;
22257 gm_check (x, -1900, 70);
22260 printf ("sGMTIME_min=%ld\n", pt);
22264 int main (int argc, char *argv[])
22266 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22273 if eval $compile; then
22274 eval `$run ./try 2>/dev/null`
22276 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22282 echo "Checking max offsets that localtime () accepts"
22284 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22287 #include <sys/types.h>
22295 void local_check (time_t t, int min_year, int max_year)
22297 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22300 tmp = localtime (&t);
22301 if ( tmp == NULL ||
22302 /* Check tm_year overflow */
22303 tmp->tm_year < min_year || tmp->tm_year > max_year)
22307 } /* local_check */
22314 local_check (MAXLONG, 69, 0x7fffffff);
22316 if (tmp == NULL || tmp->tm_year < 0) {
22317 for (i = 63; i >= 0; i--) {
22318 time_t x = pt | ((time_t)1 << i);
22319 if (x < 0 || x < pt) continue;
22320 local_check (x, 69, 0x7fffffff);
22323 printf ("sLOCALTIME_max=%ld\n", pt);
22332 local_check (MINLONG, -1900, 70);
22335 for (i = 36; i >= 0; i--) {
22336 time_t x = pt - ((time_t)1 << i);
22337 if (x > 0) continue;
22338 local_check (x, -1900, 70);
22341 printf ("sLOCALTIME_min=%ld\n", pt);
22345 int main (int argc, char *argv[])
22353 if eval $compile; then
22354 eval `$run ./try 2>/dev/null`
22356 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22362 : check for type of arguments to select.
22363 case "$selecttype" in
22364 '') case "$d_select" in
22368 Checking to see what type of arguments are accepted by select().
22370 hdrs="$define sys/types.h
22371 $i_systime sys/time.h
22372 $i_sysselct sys/select.h
22373 $d_socket sys/socket.h"
22374 : The first arg can be int, unsigned, or size_t
22375 : The last arg may or may not be 'const'
22377 : void pointer has been seen but using that
22378 : breaks the selectminbits test
22379 for xxx in 'fd_set *' 'int *'; do
22380 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22381 for tmo in 'struct timeval *' 'const struct timeval *'; do
22383 '') try="$extern_C int select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22384 if ./protochk "$try" $hdrs; then
22385 echo "Your system accepts $xxx."
22394 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22395 case "$d_fd_set" in
22396 $define) dflt="fd_set *" ;;
22405 *) : no select, so pick a harmless default
22412 : check for the select 'width'
22413 case "$selectminbits" in
22414 '') safebits=`expr $ptrsize \* 8`
22415 case "$d_select" in
22419 Checking to see on how many bits at a time your select() operates...
22422 #include <sys/types.h>
22424 #$i_systime I_SYS_TIME
22425 #$i_systimek I_SYS_TIME_KERNEL
22430 # ifdef I_SYS_TIME_KERNEL
22433 # include <sys/time.h>
22434 # ifdef I_SYS_TIME_KERNEL
22438 #$i_sysselct I_SYS_SELECT
22439 #ifdef I_SYS_SELECT
22440 #include <sys/select.h>
22442 #$d_socket HAS_SOCKET
22444 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22447 #$i_stdlib I_STDLIB
22449 #include <stdlib.h>
22452 #define S sizeof(*(b))
22454 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22455 #define NBITS (NBYTES * 8)
22457 char *s = (char *)malloc(NBYTES);
22466 fp = fopen("try.c", "r");
22472 b = ($selecttype)s;
22473 for (i = 0; i < NBITS; i++)
22477 select(fd + 1, b, 0, 0, &t);
22478 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22480 printf("%d\n", i + 1);
22485 if eval $compile_ok; then
22486 selectminbits=`$run ./try 2>/dev/null`
22487 case "$selectminbits" in
22489 Cannot figure out on how many bits at a time your select() operates.
22490 I'll play safe and guess it is $safebits bits.
22492 selectminbits=$safebits
22493 bits="$safebits bits"
22496 *) bits="$selectminbits bits" ;;
22498 echo "Your select() operates on $bits at a time." >&4
22500 rp='What is the minimum number of bits your select() operates on?'
22501 case "$byteorder" in
22502 12345678) dflt=64 ;;
22508 selectminbits="$val"
22512 *) : no select, so pick a harmless default
22513 selectminbits=$safebits
22519 : Trace out the files included by signal.h, then look for SIGxxx names.
22520 case "$sig_num_init" in
22522 if [ "X$fieldn" = X ]; then
22523 : Just make some guesses. We check them later.
22524 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22526 xxx=`echo '#include <signal.h>' |
22527 $cppstdin $cppminus $cppflags 2>/dev/null |
22528 $grep '^[ ]*#.*include' |
22529 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22530 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22533 for xx in $xxx /dev/null ; do
22534 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22536 case "$xxxfiles" in
22537 '') xxxfiles=`./findhdr signal.h` ;;
22540 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22541 print substr($2, 4, 20)
22543 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22544 print substr($3, 4, 20)
22546 : Append some common names just in case the awk scan failed.
22547 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22548 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22549 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22550 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22551 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22553 : generate a few handy files for later
22554 $cat > signal.c <<EOCP
22555 #include <sys/types.h>
22556 #include <signal.h>
22557 #$i_stdlib I_STDLIB
22559 #include <stdlib.h>
22564 /* Strange style to avoid deeply-nested #if/#else/#endif */
22567 # define NSIG (_NSIG)
22573 # define NSIG (SIGMAX+1)
22579 # define NSIG (SIG_MAX+1)
22585 # define NSIG (_SIG_MAX+1)
22591 # define NSIG (MAXSIG+1)
22597 # define NSIG (MAX_SIG+1)
22602 # ifdef SIGARRAYSIZE
22603 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22609 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22613 /* Default to some arbitrary number that's big enough to get most
22614 of the common signals.
22620 printf("NSIG %d\n", NSIG);
22626 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22628 printf "#ifdef SIG"; printf $1; printf "\n"
22629 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22630 printf $1; printf ");\n"
22634 printf "#endif /* JUST_NSIG */\n";
22635 printf "exit(0);\n}\n";
22638 $cat >signal.awk <<'EOP'
22639 BEGIN { ndups = 0 }
22640 $1 ~ /^NSIG$/ { nsig = $2 }
22641 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22642 if ($2 > maxsig) { maxsig = $2 }
22643 if (sig_name[$2]) {
22644 dup_name[ndups] = $1
22645 dup_num[ndups] = $2
22657 printf("NSIG %d\n", nsig);
22658 for (n = 1; n < nsig; n++) {
22660 printf("%s %d\n", sig_name[n], sig_num[n])
22663 printf("NUM%d %d\n", n, n)
22666 for (n = 0; n < ndups; n++) {
22667 printf("%s %d\n", dup_name[n], dup_num[n])
22671 $cat >signal_cmd <<EOS
22673 if $test -s signal.lst; then
22674 echo "Using your existing signal.lst file"
22679 $cat >>signal_cmd <<'EOS'
22682 if eval $compile_ok; then
22683 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22684 $uniq | $awk -f signal.awk >signal.lst
22686 echo "(I can't seem be able to compile the whole test program)" >&4
22687 echo "(I'll try it in little pieces.)" >&4
22688 set signal -DJUST_NSIG
22689 if eval $compile_ok; then
22690 $run ./signal$_exe > signal.nsg
22693 echo "I can't seem to figure out how many signals you have." >&4
22694 echo "Guessing 50." >&4
22695 echo 'NSIG 50' > signal.nsg
22697 : Now look at all the signal names, one at a time.
22698 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22699 $cat > signal.c <<EOCP
22700 #include <sys/types.h>
22701 #include <signal.h>
22704 printf("$xx %d\n", SIG${xx});
22709 if eval $compile; then
22710 echo "SIG${xx} found."
22711 $run ./signal$_exe >> signal.ls1
22713 echo "SIG${xx} NOT found."
22716 if $test -s signal.ls1; then
22717 $cat signal.nsg signal.ls1 |
22718 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22722 if $test -s signal.lst; then
22725 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22726 echo 'kill -l' >signal
22727 set X `csh -f <signal`
22731 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22733 echo $@ | $tr ' ' $trnl | \
22734 $awk '{ printf "%s %d\n", $1, ++s; }
22735 END { printf "NSIG %d\n", ++s }' >signal.lst
22737 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22739 chmod a+x signal_cmd
22740 $eunicefix signal_cmd
22744 : generate list of signal names
22745 case "$sig_num_init" in
22748 case "$sig_name_init" in
22750 *) case "$sig_num_init" in
22751 ''|*,*) doinit=yes ;;
22756 echo "Generating a list of signal names and numbers..." >&4
22758 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22759 sig_name=`$awk 'BEGIN { printf "ZERO " }
22760 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22761 sig_num=`$awk 'BEGIN { printf "0 " }
22762 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22763 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22764 !/^NSIG/ { printf "\"%s\", ", $1 }
22765 END { printf "0\n" }' signal.lst`
22766 sig_num_init=`$awk 'BEGIN { printf "0, " }
22767 !/^NSIG/ { printf "%d, ", $2}
22768 END { printf "0\n"}' signal.lst`
22771 echo "The following $sig_count signals are available:"
22773 echo $sig_name | $awk \
22774 'BEGIN { linelen = 0 }
22776 for (i = 1; i <= NF; i++) {
22777 name = "SIG" $i " "
22778 linelen = linelen + length(name)
22779 if (linelen > 70) {
22781 linelen = length(name)
22787 sig_size=`echo $sig_name | awk '{print NF}'`
22788 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22792 : Check size of size
22794 case "$sizetype" in
22795 *_t) zzz="$sizetype" ;;
22796 *) zzz="filesize" ;;
22798 echo "Checking the size of $zzz..." >&4
22800 #include <sys/types.h>
22802 #$i_stdlib I_STDLIB
22804 #include <stdlib.h>
22807 printf("%d\n", (int)sizeof($sizetype));
22812 if eval $compile_ok; then
22816 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22819 echo "Your $zzz size is $sizesize bytes."
22824 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22827 : check for socklen_t
22829 echo "Checking to see if you have socklen_t..." >&4
22831 #include <sys/types.h>
22832 #$d_socket HAS_SOCKET
22834 #include <sys/socket.h>
22836 int main() { socklen_t x = 16; }
22839 if eval $compile; then
22841 echo "You have socklen_t."
22844 echo "You do not have socklen_t."
22845 case "$sizetype" in
22846 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22853 : see if this is a socks.h system
22854 set socks.h i_socks
22857 : check for type of the size argument to socket calls
22858 case "$d_socket" in
22862 Checking to see what type is the last argument of accept().
22865 case "$d_socklen_t" in
22866 "$define") yyy="$yyy socklen_t"
22868 yyy="$yyy $sizetype int long unsigned"
22869 for xxx in $yyy; do
22870 case "$socksizetype" in
22871 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22872 case "$usesocks" in
22874 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22875 echo "Your system accepts '$xxx *' for the last argument of accept()."
22876 socksizetype="$xxx"
22879 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22880 echo "Your system accepts '$xxx *' for the last argument of accept()."
22881 socksizetype="$xxx"
22888 : In case none of those worked, prompt the user.
22889 case "$socksizetype" in
22890 '') rp='What is the type for socket address structure sizes?'
22897 *) : no sockets, so pick relatively harmless default
22902 : see what type is used for signed size_t
22903 set ssize_t ssizetype int stdio.h sys/types.h
22908 #$i_stdlib I_STDLIB
22910 #include <stdlib.h>
22912 #include <sys/types.h>
22913 #define Size_t $sizetype
22914 #define SSize_t $dflt
22917 if (sizeof(Size_t) == sizeof(SSize_t))
22919 else if (sizeof(Size_t) == sizeof(int))
22928 if eval $compile_ok && $run ./try > /dev/null; then
22929 ssizetype=`$run ./try`
22930 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22933 Help! I can't compile and run the ssize_t test program: please enlighten me!
22934 (This is probably a misconfiguration in your system or libraries, and
22935 you really ought to fix it. Still, I'll try anyway.)
22937 I need a type that is the same size as $sizetype, but is guaranteed to
22938 be signed. Common values are ssize_t, int and long.
22941 rp="What signed type is the same size as $sizetype?"
22947 : Check the size of st_dev
22949 $echo "Checking the size of st_dev..." >&4
22950 $cat > try.c <<EOCP
22951 #include <sys/stat.h>
22953 #$i_stdlib I_STDLIB
22955 #include <stdlib.h>
22959 printf("%d\n", (int)sizeof(st.st_dev));
22964 if eval $compile_ok; then
22968 $echo "(I can't execute the test program--guessing $st_dev_size.)" >&4
22970 *) st_dev_size=$val
22971 $echo "Your st_dev is $st_dev_size bytes long."
22976 $echo "(I can't compile the test program--guessing $st_dev_size.)" >&4
22980 : Check if st_dev is signed
22982 $echo "Checking the sign of st_dev..." >&4
22983 $cat > try.c <<EOCP
22984 #include <sys/stat.h>
22989 if (foo.st_dev < 0)
22996 if eval $compile; then
23000 $echo "(I can't execute the test program--guessing unsigned.)" >&4
23002 *) st_dev_sign=$val
23003 case "$st_dev_sign" in
23004 1) $echo "Your st_dev is unsigned." ;;
23005 -1) $echo "Your st_dev is signed." ;;
23011 $echo "(I can't compile the test program--guessing unsigned.)" >&4
23015 : Check the size of st_ino
23017 $echo "Checking the size of st_ino..." >&4
23018 $cat > try.c <<EOCP
23019 #include <sys/stat.h>
23021 #$i_stdlib I_STDLIB
23023 #include <stdlib.h>
23027 printf("%d\n", (int)sizeof(st.st_ino));
23032 if eval $compile_ok; then
23036 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
23038 *) st_ino_size=$val
23039 $echo "Your st_ino is $st_ino_size bytes long."
23044 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
23048 : Check if st_ino is signed
23050 $echo "Checking the sign of st_ino..." >&4
23051 $cat > try.c <<EOCP
23052 #include <sys/stat.h>
23057 if (foo.st_ino < 0)
23064 if eval $compile; then
23068 $echo "(I can't execute the test program--guessing unsigned.)" >&4
23070 *) st_ino_sign=$val
23071 case "$st_ino_sign" in
23072 1) $echo "Your st_ino is unsigned." ;;
23073 -1) $echo "Your st_ino is signed." ;;
23079 $echo "(I can't compile the test program--guessing unsigned.)" >&4
23083 : see what type of char stdio uses.
23085 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
23086 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
23087 echo "Your stdio uses unsigned chars." >&4
23088 stdchar="unsigned char"
23090 echo "Your stdio uses signed chars." >&4
23095 : Check size of UID
23098 *_t) zzz="$uidtype" ;;
23101 echo "Checking the size of $zzz..." >&4
23103 #include <sys/types.h>
23105 #$i_stdlib I_STDLIB
23107 #include <stdlib.h>
23110 printf("%d\n", (int)sizeof($uidtype));
23115 if eval $compile_ok; then
23119 echo "(I can't execute the test program--guessing $uidsize.)" >&4
23122 echo "Your $zzz is $uidsize bytes long."
23127 echo "(I can't compile the test program--guessing $uidsize.)" >&4
23130 : Check if UID is signed
23133 *_t) zzz="$uidtype" ;;
23136 echo "Checking the sign of $zzz..." >&4
23138 #include <sys/types.h>
23149 if eval $compile; then
23153 echo "(I can't execute the test program--guessing unsigned.)" >&4
23157 1) echo "Your $zzz is unsigned." ;;
23158 -1) echo "Your $zzz is signed." ;;
23164 echo "(I can't compile the test program--guessing unsigned.)" >&4
23167 : Check format string for UID
23169 $echo "Checking the format string to be used for uids..." >&4
23172 -1) if $test X"$uidsize" = X"$ivsize"; then
23173 uidformat="$ivdformat"
23175 if $test X"$uidsize" = X"$longsize"; then
23178 if $test X"$uidsize" = X"$intsize"; then
23181 if $test X"$uidsize" = X"$shortsize"; then
23188 *) if $test X"$uidsize" = X"$uvsize"; then
23189 uidformat="$uvuformat"
23191 if $test X"$uidsize" = X"$longsize"; then
23194 if $test X"$uidsize" = X"$intsize"; then
23197 if $test X"$uidsize" = X"$shortsize"; then
23206 : Ask about strict by default.
23207 case "$usedefaultstrict" in
23208 $define|true|[Yy]*)
23218 EXPERIMENTAL: Perl can now be built with strict on by default when not
23219 invoked with -e or -E. This is a diagnostic tool for development.
23221 Unless you are familiar with this feature, you should probably answer 'no'.
23225 rp='Would you like to build perl with strict enabled by default?'
23228 y|Y) val="$define" ;;
23231 set usedefaultstrict
23234 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
23236 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
23237 $cat >try.c <<'EOM'
23238 /* Intentionally a long probe as I'd like to sanity check that the exact
23239 approach is going to work, as thinking it will work, but only having it
23240 part working at runtime is worse than not having it. */
23242 #include <sys/types.h>
23243 #include <sys/sysctl.h>
23244 #include <sys/param.h>
23246 #include <string.h>
23247 #include <stdlib.h>
23248 #include <unistd.h>
23251 main(int argc, char **argv) {
23253 char *argv_leaf = strrchr(argv[0], '/');
23259 mib[1] = KERN_PROC;
23260 mib[2] = KERN_PROC_PATHNAME;
23264 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23268 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23273 if (size < strlen(argv_leaf) + 1) {
23274 fprintf(stderr, "size %lu is too short for a path\n",
23275 (unsigned long) size);
23279 if (size > MAXPATHLEN * MAXPATHLEN) {
23280 fprintf(stderr, "size %lu is too long for a path\n",
23281 (unsigned long) size);
23285 buffer = (char *)malloc(size);
23291 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23296 if (strlen(buffer) + 1 != size) {
23297 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23298 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23303 if (*buffer != '/') {
23304 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23308 if (strstr(buffer, "/./")) {
23309 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23313 if (strstr(buffer, "/../")) {
23314 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23318 buffer_leaf = strrchr(buffer, '/');
23319 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23320 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23332 if eval $compile; then
23333 if $run ./try; then
23334 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23337 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23341 echo "I'm unable to compile the test program." >&4
23342 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23346 set usekernprocpathname
23349 : Determine if we can use _NSGetExecutablePath to find executing program
23351 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23352 $cat >try.c <<'EOM'
23353 /* Intentionally a long probe as I'd like to sanity check that the exact
23354 approach is going to work, as thinking it will work, but only having it
23355 part working at runtime is worse than not having it. */
23356 #include <mach-o/dyld.h>
23358 #include <stdlib.h>
23359 #include <sys/param.h>
23360 #include <string.h>
23363 main(int argc, char **argv) {
23365 uint32_t size = sizeof(buf);
23369 char *argv_leaf = strrchr(argv[0], '/');
23373 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23377 _NSGetExecutablePath(buf, &size);
23378 if (size > MAXPATHLEN * MAXPATHLEN) {
23379 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23380 (unsigned int) size);
23384 buffer = (char *)malloc(size);
23390 result = _NSGetExecutablePath(buffer, &size);
23392 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23393 result, (unsigned int) size);
23397 tidied = realpath(buffer, NULL);
23399 perror("realpath");
23405 if (*tidied != '/') {
23406 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23410 if (strstr(tidied, "/./")) {
23411 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23415 if (strstr(tidied, "/../")) {
23416 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23420 tidied_leaf = strrchr(tidied, '/');
23421 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23422 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23434 if eval $compile; then
23435 if $run ./try; then
23436 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23439 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23442 echo "I'm unable to compile the test program." >&4
23443 echo "I'll assume no _NSGetExecutablePath here." >&4
23446 set usensgetexecutablepath
23449 : Check if site customization support was requested
23450 case "$usesitecustomize" in
23451 $define|true|[Yy]*)
23452 usesitecustomize="$define"
23455 usesitecustomize="$undef"
23459 : determine compiler compiler
23468 if $test -f "$byacc$_exe"; then
23470 comp="byacc or $comp"
23472 if $test -f "$bison$_exe"; then
23473 comp="$comp or bison -y"
23475 rp="Which compiler compiler ($comp) shall I use?"
23484 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23490 : see if this is a bfd.h system
23494 : see if this is an execinfo.h system
23495 set execinfo.h i_execinfo
23498 : see if this is a fenv.h system
23502 : see if this is a fp.h system
23506 : see if this is a fp_class.h system
23507 set fp_class.h i_fp_class
23510 : see if gdbm.h is available
23515 : see if gdbm_open exists
23516 set gdbm_open d_gdbm_open
23518 case "$d_gdbm_open" in
23521 echo "We won't be including <gdbm.h>"
23530 : see if this is a ieeefp.h system
23531 case "$i_ieeefp" in
23532 '' ) set ieeefp.h i_ieeefp
23537 : see if this is a libutil.h system
23538 set libutil.h i_libutil
23541 : see if mach cthreads are available
23542 if test "X$usethreads" = "X$define"; then
23543 set mach/cthreads.h i_machcthr
23546 i_machcthr="$undef"
23549 : see if this is a mntent.h system
23550 set mntent.h i_mntent
23553 : see if net/errno.h is available
23555 set net/errno.h val
23558 : Unfortunately, it causes problems on some systems. Arrgh.
23561 cat > try.c <<'EOM'
23564 #include <net/errno.h>
23570 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23571 echo "We'll be including <net/errno.h>." >&4
23573 echo "We won't be including <net/errno.h>." >&4
23582 : see if netinet/tcp.h is available
23583 set netinet/tcp.h i_netinettcp
23586 : see if this is a poll.h system
23590 : see if this is a prot.h system
23594 : Preprocessor symbols
23596 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23597 $cat <<'EOSH' > Cppsym.know
23598 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23599 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23600 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23601 arch_pwr ardent ARM ARM32 atarist att386 att3b
23602 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23603 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23604 byteorder byte_order
23605 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23606 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23607 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23608 ELF encore EPI EXTENSIONS
23609 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23610 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23611 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23612 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23613 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
23614 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23615 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23616 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23617 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23619 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23620 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23621 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23623 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23624 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23625 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23626 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23627 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23628 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23629 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23630 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23631 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23632 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23633 ns32000 ns32016 ns32332 ns32k nsc32000
23634 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23635 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23636 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23637 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23639 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23640 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23641 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23642 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23643 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23644 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23645 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23646 SYSV4 SYSV5 sysV68 sysV88
23647 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23648 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23649 tower32_800 tower32_850 tss
23650 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23651 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23652 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23653 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23654 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23655 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23657 vax venix VMESA vms
23658 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23659 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23662 # Maybe put other stuff here too.
23663 ./tr '-' '_' <<EOSH >>Cppsym.know
23666 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23667 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23668 $cat Cppsym.know > Cppsym.c
23669 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23670 $rm -f Cppsym.a Cppsym.b Cppsym.c
23671 cat <<EOSH > Cppsym
23673 if $test \$# -gt 0; then
23674 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23675 if $test -s Cppsym.got; then
23682 $tr " " "$trnl" | ./Cppsym.try
23688 cat <<EOSH > Cppsym.try
23690 cat <<'EOCP' > try.c
23693 #define STRINGIFY(a) "a"
23695 #if cpp_stuff == 42
23696 #define StGiFy(a) #a
23697 #define STRINGIFY(a) StGiFy(a)
23699 #if $cpp_stuff != 1 && $cpp_stuff != 42
23700 # include "Bletch: How does this C preprocessor stringify macros?"
23706 cat <<'EOSH' >> Cppsym.try
23708 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23709 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23710 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23711 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23713 echo 'return 0;}' >> try.c
23715 cat <<EOSH >> Cppsym.try
23717 case "$osname-$gccversion" in
23718 irix-) ccflags="\$ccflags -woff 1178" ;;
23719 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23721 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23723 chmod +x Cppsym.try
23724 $eunicefix Cppsym.try
23725 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23726 : Add in any Linux cpp "predefined macros":
23727 case "$osname::$gccversion" in
23728 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23730 rm -f $tHdrH'.h' $tHdrH
23732 # Filter out macro arguments, such as Linux's __INT8_C(c)
23733 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23734 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23735 if [ -s $tHdrH'_cppsym.real' ]; then
23736 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23739 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23742 : now check the C compiler for additional symbols
23743 postprocess_cc_v=''
23745 aix) postprocess_cc_v="|$tr , ' '" ;;
23752 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23755 -D*) echo "\$i" | $sed 's/^-D//;s/['\''\"]//g';;
23756 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23761 postprocess_cc_v=''
23764 ./ccsym > ccsym1.raw
23765 if $test -s ccsym1.raw; then
23766 $sort ccsym1.raw | $uniq >ccsym.raw
23768 mv ccsym1.raw ccsym.raw
23771 $awk '/\=/ { print $0; next }
23772 { print $0"=1" }' ccsym.raw >ccsym.list
23773 $comm -13 Cppsym.true ccsym.list >ccsym.own
23774 $comm -12 Cppsym.true ccsym.list >ccsym.com
23775 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23777 if $test -z ccsym.raw; then
23778 echo "Your C compiler doesn't seem to define any symbols!" >&4
23780 echo "However, your C preprocessor defines the following symbols:"
23783 cppsymbols=`$cat Cppsym.true`
23784 cppsymbols=`echo $cppsymbols`
23785 cppccsymbols="$cppsymbols"
23787 if $test -s ccsym.com; then
23788 echo "Your C compiler and pre-processor define these symbols:"
23789 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23792 cppccsymbols=`$cat ccsym.com`
23793 cppccsymbols=`echo $cppccsymbols`
23794 $test "$silent" || sleep 1
23796 if $test -s ccsym.cpp; then
23797 $test "$also" && echo " "
23798 echo "Your C pre-processor ${also}defines the following symbols:"
23799 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23801 cppsymbols=`$cat ccsym.cpp`
23802 cppsymbols=`echo $cppsymbols`
23803 $test "$silent" || sleep 1
23805 if $test -s ccsym.own; then
23806 $test "$also" && echo " "
23807 echo "Your C compiler ${also}defines the following cpp symbols:"
23808 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23809 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23810 ccsymbols=`$cat ccsym.own`
23811 ccsymbols=`echo $ccsymbols`
23812 $test "$silent" || sleep 1
23816 : add -D_FORTIFY_SOURCE if feasible and not already there
23817 case "$gccversion" in
23818 [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
23819 *-O*) case "$ccflags$cppsymbols" in
23820 *_FORTIFY_SOURCE=*) # Don't add it again.
23821 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23823 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23824 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23828 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23832 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23836 : script used to emit important warnings
23839 if test \$# -gt 0; then
23844 echo "*** WARNING:" >&4
23845 sed -e 's/^/*** /' <msg >&4
23847 cat msg >>config.msg
23848 echo " " >>config.msg
23854 : see if this is a termio system
23858 if $test `./findhdr termios.h`; then
23859 set tcsetattr i_termios
23865 "$define") echo "You have POSIX termios.h... good!" >&4;;
23866 *) if ./Cppsym pyr; then
23867 case "`$run /bin/universe`" in
23868 ucb) if $test `./findhdr sgtty.h`; then
23870 echo "<sgtty.h> found." >&4
23872 echo "System is pyramid with BSD universe."
23873 ./warn "<sgtty.h> not found--you could have problems."
23875 *) if $test `./findhdr termio.h`; then
23877 echo "<termio.h> found." >&4
23879 echo "System is pyramid with USG universe."
23880 ./warn "<termio.h> not found--you could have problems."
23884 if $test `./findhdr termio.h`; then
23885 echo "<termio.h> found." >&4
23887 elif $test `./findhdr sgtty.h`; then
23888 echo "<sgtty.h> found." >&4
23891 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23894 if $test `./findhdr sgtty.h`; then
23895 echo "<sgtty.h> found." >&4
23897 elif $test `./findhdr termio.h`; then
23898 echo "<termio.h> found." >&4
23901 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23905 set i_termio; eval $setvar
23906 val=$val2; set i_sgtty; eval $setvar
23907 val=$val3; set i_termios; eval $setvar
23909 : see if stdbool is available
23910 : we want a real compile instead of Inhdr because some Solaris systems
23911 : have stdbool.h, but it can only be used if the compiler indicates it
23912 : is sufficiently c99-compliant.
23916 #include <stdbool.h>
23921 int main(int argc, char **argv)
23927 if eval $compile; then
23928 echo "<stdbool.h> found." >&4
23931 echo "<stdbool.h> NOT found." >&4
23938 : see if stdint is available
23939 set stdint.h i_stdint
23942 : see if sys/access.h is available
23943 set sys/access.h i_sysaccess
23946 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23947 set sys/filio.h i_sysfilio
23950 if $test `./findhdr sys/ioctl.h`; then
23952 echo '<sys/ioctl.h> found.' >&4
23955 if $test $i_sysfilio = "$define"; then
23956 echo '<sys/ioctl.h> NOT found.' >&4
23958 $test $i_sgtty = "$define" && xxx="sgtty.h"
23959 $test $i_termio = "$define" && xxx="termio.h"
23960 $test $i_termios = "$define" && xxx="termios.h"
23961 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23967 : see if socket ioctl defs are in sys/sockio.h
23969 xxx=`./findhdr sys/sockio.h`
23970 if $test "$xxx"; then
23971 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23973 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23976 echo "No socket ioctls found in <sys/sockio.h>." >&4
23981 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23987 : see if this is a syslog.h system
23988 set syslog.h i_syslog
23991 : see if this is a sys/mode.h system
23992 set sys/mode.h i_sysmode
23995 : see if there is a sys/poll.h file
23996 set sys/poll.h i_syspoll
23999 : see if sys/resource.h has to be included
24000 set sys/resource.h i_sysresrc
24003 : see if sys/security.h is available
24004 set sys/security.h i_syssecrt
24007 : see if this is a sys/statvfs.h system
24008 set sys/statvfs.h i_sysstatvfs
24011 : see if this is a sys/un.h system
24012 set sys/un.h i_sysun
24015 : see if this is a sys/utsname.h system
24016 set sys/utsname.h i_sysutsname
24019 : see if this is a syswait system
24020 set sys/wait.h i_syswait
24023 : see if this is a ustat.h system
24024 set ustat.h i_ustat
24027 : see if this is an utime system
24028 set utime.h i_utime
24031 : see if this is a vfork system
24034 set vfork.h i_vfork
24042 : see if wchar.h is present
24043 set wchar.h i_wchar
24048 echo "Looking for extensions..." >&4
24049 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
24050 : contain old or inaccurate or duplicate values.
24051 nonxs_extensions=''
24053 : We do not use find because it might not be available.
24054 : We do not just use MANIFEST because the user may have dropped
24055 : some additional extensions into the source tree and expect them
24058 : Function to recursively find available extensions, ignoring DynaLoader
24059 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
24060 : In 5.10.1 and later, extensions are stored in directories
24061 : like File-Glob instead of the older File/Glob/.
24065 DynaLoader|dynaload) ;;
24067 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
24068 case "$this_ext" in
24069 Scalar/List/Utils) this_ext="List/Util" ;;
24070 PathTools) this_ext="Cwd" ;;
24072 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
24073 if $contains " $this_ext " "$tdir/$$.tmp"; then
24075 echo "Duplicate directories detected for extension $xxx" >&4;
24076 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
24077 case "$knowitall" in
24085 echo "Ok. Stopping Configure." >&4;
24086 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
24089 echo "Ok. You will need to correct config.sh before running make." >&4;
24091 $ls -1 "$xxx" > "$tdir/$$.tmp";
24092 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
24093 xs_extensions="$xs_extensions $this_ext";
24094 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
24095 xs_extensions="$xs_extensions $this_ext";
24096 elif $test -d "$xxx"; then
24097 nonxs_extensions="$nonxs_extensions $this_ext";
24099 $rm -f "$tdir/$$.tmp";
24107 eval $find_extensions
24111 eval $find_extensions
24115 eval $find_extensions
24116 set X $xs_extensions
24118 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
24119 set X $nonxs_extensions
24121 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
24123 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
24125 : Now see which are supported on this system.
24127 for xxx in $xs_extensions ; do
24131 amigaos) avail_ext="$avail_ext $xxx" ;;
24136 $define) avail_ext="$avail_ext $xxx" ;;
24139 GDBM_File|gdbm_fil)
24141 $define) avail_ext="$avail_ext $xxx" ;;
24145 : XXX Do we need a useipcsysv variable here
24146 case "${d_msg}${d_sem}${d_shm}" in
24147 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
24150 NDBM_File|ndbm_fil)
24153 case "$osname-$use64bitint" in
24156 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
24159 *) avail_ext="$avail_ext $xxx" ;;
24164 ODBM_File|odbm_fil)
24165 case "${i_dbm}${i_rpcsvcdbm}" in
24167 case "$d_cplusplus" in
24168 define) ;; # delete as a function name will not work
24169 *) case "$osname-$use64bitint" in
24172 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
24175 *) avail_ext="$avail_ext $xxx" ;;
24183 case "$useopcode" in
24184 true|define|y) avail_ext="$avail_ext $xxx" ;;
24188 case "$useposix" in
24189 true|define|y) avail_ext="$avail_ext $xxx" ;;
24193 case "$d_socket" in
24194 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24197 I18N/Langinfo|langinfo)
24198 case "$uselanginfo" in
24199 true|define|y) avail_ext="$avail_ext $xxx" ;;
24202 Sys/Syslog|sys/syslog)
24204 amigaos) ;; # not really very useful on AmigaOS
24206 : XXX syslog requires socket
24207 case "$d_socket" in
24208 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24213 threads|threads/shared)
24214 # threads and threads::shared are special cases.
24215 # To stop people from asking "Perl 5.8.0 was supposed
24216 # to have this new fancy threads implementation but my
24217 # perl doesn't have it" and from people trying to
24218 # (re)install the threads module using CPAN.pm and
24219 # CPAN.pm then offering to reinstall Perl 5.8.0,
24220 # the threads.pm and threads/shared.pm will always be
24221 # there, croaking informatively ("you need to rebuild
24222 # all of Perl with threads, sorry") when threads haven't
24223 # been compiled in.
24225 avail_ext="$avail_ext $xxx"
24231 cygwin) avail_ext="$avail_ext $xxx" ;;
24234 XS/APItest|xs/apitest)
24235 # This is just for testing. Skip it unless we have dynamic loading.
24238 $define) avail_ext="$avail_ext $xxx" ;;
24241 XS/Typemap|xs/typemap)
24242 # This is just for testing. Skip it unless we have dynamic loading.
24244 $define) avail_ext="$avail_ext $xxx" ;;
24247 *) avail_ext="$avail_ext $xxx"
24256 case "$onlyextensions" in
24258 *) keepextensions=''
24259 echo "You have requested that only certain extensions be included..." >&4
24260 for i in $onlyextensions; do
24261 case " $avail_ext " in
24263 echo "Keeping extension $i."
24264 keepextensions="$keepextensions $i"
24266 *) echo "Ignoring extension $i." ;;
24269 avail_ext="$keepextensions"
24273 case "$noextensions" in
24275 *) keepextensions=''
24276 echo "You have requested that certain extensions be ignored..." >&4
24277 for i in $avail_ext; do
24278 case " $noextensions " in
24279 *" $i "*) echo "Ignoring extension $i." ;;
24280 *) echo "Keeping extension $i.";
24281 keepextensions="$keepextensions $i"
24285 avail_ext="$keepextensions"
24289 : Now see which nonxs extensions are supported on this system.
24290 : For now assume all are.
24292 for xxx in $nonxs_extensions ; do
24296 *) nonxs_ext="$nonxs_ext $xxx"
24308 A number of extensions are supplied with $package. You may choose to
24309 compile these extensions for dynamic loading (the default), compile
24310 them into the $package executable (static loading), or not include
24311 them at all. Answer "none" to include no extensions.
24312 Note that DynaLoader is always built and need not be mentioned here.
24315 case "$dynamic_ext" in
24317 : Exclude those listed in static_ext
24319 for xxx in $avail_ext; do
24320 case " $static_ext " in
24322 *) dflt="$dflt $xxx" ;;
24329 *) dflt="$dynamic_ext"
24330 # Perhaps we are reusing an old out-of-date config.sh.
24333 if test X"$dynamic_ext" != X"$avail_ext"; then
24335 NOTICE: Your previous config.sh list may be incorrect.
24336 The extensions now available to you are
24338 but the default list from your previous config.sh is
24350 rp="What extensions do you wish to load dynamically?"
24353 none) dynamic_ext=' ' ;;
24354 *) dynamic_ext="$ans" ;;
24357 case "$static_ext" in
24359 : Exclude those already listed in dynamic linking
24361 for xxx in $avail_ext; do
24362 case " $dynamic_ext " in
24364 *) dflt="$dflt $xxx" ;;
24371 *) dflt="$static_ext"
24378 rp="What extensions do you wish to load statically?"
24381 none) static_ext=' ' ;;
24382 *) static_ext="$ans" ;;
24387 A number of extensions are supplied with $package. Answer "none"
24388 to include no extensions.
24389 Note that DynaLoader is always built and need not be mentioned here.
24392 case "$static_ext" in
24393 '') dflt="$avail_ext" ;;
24394 *) dflt="$static_ext"
24395 # Perhaps we are reusing an old out-of-date config.sh.
24398 if test X"$static_ext" != X"$avail_ext"; then
24400 NOTICE: Your previous config.sh list may be incorrect.
24401 The extensions now available to you are
24403 but the default list from your previous config.sh is
24412 : Exclude those that are not xs extensions
24416 rp="What extensions do you wish to include?"
24419 none) static_ext=' ' ;;
24420 *) static_ext="$ans" ;;
24425 # Encode is a special case. If we are building Encode as a static
24426 # extension, we need to explicitly list its subextensions as well.
24427 # For other nested extensions, this is handled automatically by
24428 # the appropriate Makefile.PL.
24429 case " $static_ext " in
24430 *" Encode "*) # Add the subextensions of Encode
24432 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24433 static_ext="$static_ext Encode/$xxx"
24434 known_extensions="$known_extensions Encode/$xxx"
24440 set X $dynamic_ext $static_ext $nonxs_ext
24444 # Sanity check: We require an extension suitable for use with
24445 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24446 # should show up as failures in the test suite, but it's helpful to
24447 # catch them now.) The 'extensions' list is normally sorted
24448 # alphabetically, so we need to accept either
24449 # DB_File ... Fcntl ... IO ....
24450 # or something like
24451 # Fcntl ... NDBM_File ... IO ....
24452 case " $extensions" in
24453 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24454 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24455 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24456 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24457 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24461 : Remove libraries needed only for extensions
24462 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24463 : The exception is SunOS 4.x, which needs them.
24464 case "${osname}X${osvers}" in
24468 *) case "$usedl" in
24469 $define|true|[yY]*)
24470 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24474 *) perllibs="$libs"
24480 : Remove build directory name from cppstdin so it can be used from
24481 : either the present location or the final installed location.
24483 : Get out of the UU directory to get correct path name.
24485 case "$cppstdin" in
24487 echo "Stripping down cppstdin path name"
24493 : end of configuration questions
24495 echo "End of configuration questions."
24498 : back to where it started
24499 if test -d ../UU; then
24503 : configuration may be unconditionally patched via a 'config.arch' file
24504 if $test -f config.arch; then
24505 echo "I see a config.arch file, loading it." >&4
24509 : configuration may be patched via a 'config.over' file
24510 if $test -f config.over; then
24513 rp='I see a config.over file. Do you wish to load it?'
24516 n*) echo "OK, I'll ignore it.";;
24518 echo "Configuration override changes have been loaded."
24523 : in case they want portability, strip down executable paths
24524 case "$d_portable" in
24527 echo "Stripping down executable paths..." >&4
24528 for file in $loclist $trylist; do
24530 eval $file=`basename $temp`
24535 : create config.sh file
24537 echo "Creating config.sh..." >&4
24538 $spitshell <<EOT >config.sh
24541 # This file was produced by running the Configure script. It holds all the
24542 # definitions figured out by Configure. Should you modify one of these values,
24543 # do not forget to propagate your changes by running "Configure -der". You may
24544 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24547 # Package name : $package
24548 # Source directory : $src
24549 # Configuration time: $cf_time
24550 # Configured by : $cf_by
24551 # Target system : $myuname
24554 : Add in command line options if available
24555 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24557 $spitshell <<EOT >>config.sh
24566 Revision='$Revision'
24574 alignbytes='$alignbytes'
24575 aphostname='$aphostname'
24576 api_revision='$api_revision'
24577 api_subversion='$api_subversion'
24578 api_version='$api_version'
24579 api_versionstring='$api_versionstring'
24582 archlibexp='$archlibexp'
24583 archname64='$archname64'
24584 archname='$archname'
24585 archobjs='$archobjs'
24586 asctime_r_proto='$asctime_r_proto'
24595 byteorder='$byteorder'
24597 castflags='$castflags'
24600 cccdlflags='$cccdlflags'
24601 ccdlflags='$ccdlflags'
24603 ccflags_uselargefiles='$ccflags_uselargefiles'
24605 ccsymbols='$ccsymbols'
24606 ccversion='$ccversion'
24608 cf_email='$cf_email'
24610 charbits='$charbits'
24611 charsize='$charsize'
24615 clocktype='$clocktype'
24617 compiler_warning='$compiler_warning'
24618 compress='$compress'
24619 contains='$contains'
24623 cpp_stuff='$cpp_stuff'
24624 cppccsymbols='$cppccsymbols'
24625 cppflags='$cppflags'
24627 cppminus='$cppminus'
24629 cppstdin='$cppstdin'
24630 cppsymbols='$cppsymbols'
24631 crypt_r_proto='$crypt_r_proto'
24632 cryptlib='$cryptlib'
24634 ctermid_r_proto='$ctermid_r_proto'
24635 ctime_r_proto='$ctime_r_proto'
24636 d_Gconvert='$d_Gconvert'
24637 d_PRIEUldbl='$d_PRIEUldbl'
24638 d_PRIFUldbl='$d_PRIFUldbl'
24639 d_PRIGUldbl='$d_PRIGUldbl'
24640 d_PRIXU64='$d_PRIXU64'
24641 d_PRId64='$d_PRId64'
24642 d_PRIeldbl='$d_PRIeldbl'
24643 d_PRIfldbl='$d_PRIfldbl'
24644 d_PRIgldbl='$d_PRIgldbl'
24645 d_PRIi64='$d_PRIi64'
24646 d_PRIo64='$d_PRIo64'
24647 d_PRIu64='$d_PRIu64'
24648 d_PRIx64='$d_PRIx64'
24649 d_SCNfldbl='$d_SCNfldbl'
24650 d__fwalk='$d__fwalk'
24651 d_accept4='$d_accept4'
24652 d_access='$d_access'
24653 d_accessx='$d_accessx'
24657 d_archlib='$d_archlib'
24658 d_asctime64='$d_asctime64'
24659 d_asctime_r='$d_asctime_r'
24664 d_attribute_always_inline='$d_attribute_always_inline'
24665 d_attribute_deprecated='$d_attribute_deprecated'
24666 d_attribute_format='$d_attribute_format'
24667 d_attribute_malloc='$d_attribute_malloc'
24668 d_attribute_nonnull='$d_attribute_nonnull'
24669 d_attribute_noreturn='$d_attribute_noreturn'
24670 d_attribute_pure='$d_attribute_pure'
24671 d_attribute_unused='$d_attribute_unused'
24672 d_attribute_visibility='$d_attribute_visibility'
24673 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24674 d_backtrace='$d_backtrace'
24676 d_bsdgetpgrp='$d_bsdgetpgrp'
24677 d_bsdsetpgrp='$d_bsdsetpgrp'
24678 d_builtin_add_overflow='$d_builtin_add_overflow'
24679 d_builtin_choose_expr='$d_builtin_choose_expr'
24680 d_builtin_expect='$d_builtin_expect'
24681 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24682 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24683 d_c99_variadic_macros='$d_c99_variadic_macros'
24684 d_casti32='$d_casti32'
24685 d_castneg='$d_castneg'
24688 d_chroot='$d_chroot'
24689 d_chsize='$d_chsize'
24691 d_clearenv='$d_clearenv'
24692 d_closedir='$d_closedir'
24693 d_cmsghdr_s='$d_cmsghdr_s'
24694 d_copysign='$d_copysign'
24695 d_copysignl='$d_copysignl'
24696 d_cplusplus='$d_cplusplus'
24698 d_crypt_r='$d_crypt_r'
24700 d_ctermid='$d_ctermid'
24701 d_ctermid_r='$d_ctermid_r'
24702 d_ctime64='$d_ctime64'
24703 d_ctime_r='$d_ctime_r'
24704 d_cuserid='$d_cuserid'
24705 d_dbminitproto='$d_dbminitproto'
24706 d_difftime64='$d_difftime64'
24707 d_difftime='$d_difftime'
24708 d_dir_dd_fd='$d_dir_dd_fd'
24710 d_dirnamlen='$d_dirnamlen'
24711 d_dladdr='$d_dladdr'
24712 d_dlerror='$d_dlerror'
24713 d_dlopen='$d_dlopen'
24714 d_dlsymun='$d_dlsymun'
24715 d_dosuid='$d_dosuid'
24716 d_double_has_inf='$d_double_has_inf'
24717 d_double_has_nan='$d_double_has_nan'
24718 d_double_has_negative_zero='$d_double_has_negative_zero'
24719 d_double_has_subnormals='$d_double_has_subnormals'
24720 d_double_style_cray='$d_double_style_cray'
24721 d_double_style_ibm='$d_double_style_ibm'
24722 d_double_style_ieee='$d_double_style_ieee'
24723 d_double_style_vax='$d_double_style_vax'
24724 d_drand48_r='$d_drand48_r'
24725 d_drand48proto='$d_drand48proto'
24728 d_duplocale='$d_duplocale'
24729 d_eaccess='$d_eaccess'
24730 d_endgrent='$d_endgrent'
24731 d_endgrent_r='$d_endgrent_r'
24732 d_endhent='$d_endhent'
24733 d_endhostent_r='$d_endhostent_r'
24734 d_endnent='$d_endnent'
24735 d_endnetent_r='$d_endnetent_r'
24736 d_endpent='$d_endpent'
24737 d_endprotoent_r='$d_endprotoent_r'
24738 d_endpwent='$d_endpwent'
24739 d_endpwent_r='$d_endpwent_r'
24740 d_endsent='$d_endsent'
24741 d_endservent_r='$d_endservent_r'
24742 d_eofnblk='$d_eofnblk'
24745 d_eunice='$d_eunice'
24748 d_faststdio='$d_faststdio'
24749 d_fchdir='$d_fchdir'
24750 d_fchmod='$d_fchmod'
24751 d_fchmodat='$d_fchmodat'
24752 d_fchown='$d_fchown'
24754 d_fcntl_can_lock='$d_fcntl_can_lock'
24755 d_fd_macros='$d_fd_macros'
24756 d_fd_set='$d_fd_set'
24757 d_fdclose='$d_fdclose'
24759 d_fds_bits='$d_fds_bits'
24760 d_fegetround='$d_fegetround'
24763 d_fgetpos='$d_fgetpos'
24764 d_finite='$d_finite'
24765 d_finitel='$d_finitel'
24766 d_flexfnam='$d_flexfnam'
24768 d_flockproto='$d_flockproto'
24773 d_fp_class='$d_fp_class'
24774 d_fp_classify='$d_fp_classify'
24775 d_fp_classl='$d_fp_classl'
24776 d_fpathconf='$d_fpathconf'
24777 d_fpclass='$d_fpclass'
24778 d_fpclassify='$d_fpclassify'
24779 d_fpclassl='$d_fpclassl'
24780 d_fpgetround='$d_fpgetround'
24781 d_fpos64_t='$d_fpos64_t'
24782 d_freelocale='$d_freelocale'
24783 d_frexpl='$d_frexpl'
24784 d_fs_data_s='$d_fs_data_s'
24785 d_fseeko='$d_fseeko'
24786 d_fsetpos='$d_fsetpos'
24787 d_fstatfs='$d_fstatfs'
24788 d_fstatvfs='$d_fstatvfs'
24790 d_ftello='$d_ftello'
24792 d_futimes='$d_futimes'
24793 d_gai_strerror='$d_gai_strerror'
24794 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24795 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24796 d_getaddrinfo='$d_getaddrinfo'
24797 d_getcwd='$d_getcwd'
24798 d_getenv_preserves_other_thread='$d_getenv_preserves_other_thread'
24799 d_getespwnam='$d_getespwnam'
24800 d_getfsstat='$d_getfsstat'
24801 d_getgrent='$d_getgrent'
24802 d_getgrent_r='$d_getgrent_r'
24803 d_getgrgid_r='$d_getgrgid_r'
24804 d_getgrnam_r='$d_getgrnam_r'
24805 d_getgrps='$d_getgrps'
24806 d_gethbyaddr='$d_gethbyaddr'
24807 d_gethbyname='$d_gethbyname'
24808 d_gethent='$d_gethent'
24809 d_gethname='$d_gethname'
24810 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24811 d_gethostbyname_r='$d_gethostbyname_r'
24812 d_gethostent_r='$d_gethostent_r'
24813 d_gethostprotos='$d_gethostprotos'
24814 d_getitimer='$d_getitimer'
24815 d_getlogin='$d_getlogin'
24816 d_getlogin_r='$d_getlogin_r'
24817 d_getmnt='$d_getmnt'
24818 d_getmntent='$d_getmntent'
24819 d_getnameinfo='$d_getnameinfo'
24820 d_getnbyaddr='$d_getnbyaddr'
24821 d_getnbyname='$d_getnbyname'
24822 d_getnent='$d_getnent'
24823 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24824 d_getnetbyname_r='$d_getnetbyname_r'
24825 d_getnetent_r='$d_getnetent_r'
24826 d_getnetprotos='$d_getnetprotos'
24827 d_getpagsz='$d_getpagsz'
24828 d_getpbyname='$d_getpbyname'
24829 d_getpbynumber='$d_getpbynumber'
24830 d_getpent='$d_getpent'
24831 d_getpgid='$d_getpgid'
24832 d_getpgrp2='$d_getpgrp2'
24833 d_getpgrp='$d_getpgrp'
24834 d_getppid='$d_getppid'
24835 d_getprior='$d_getprior'
24836 d_getprotobyname_r='$d_getprotobyname_r'
24837 d_getprotobynumber_r='$d_getprotobynumber_r'
24838 d_getprotoent_r='$d_getprotoent_r'
24839 d_getprotoprotos='$d_getprotoprotos'
24840 d_getprpwnam='$d_getprpwnam'
24841 d_getpwent='$d_getpwent'
24842 d_getpwent_r='$d_getpwent_r'
24843 d_getpwnam_r='$d_getpwnam_r'
24844 d_getpwuid_r='$d_getpwuid_r'
24845 d_getsbyname='$d_getsbyname'
24846 d_getsbyport='$d_getsbyport'
24847 d_getsent='$d_getsent'
24848 d_getservbyname_r='$d_getservbyname_r'
24849 d_getservbyport_r='$d_getservbyport_r'
24850 d_getservent_r='$d_getservent_r'
24851 d_getservprotos='$d_getservprotos'
24852 d_getspnam='$d_getspnam'
24853 d_getspnam_r='$d_getspnam_r'
24854 d_gettimeod='$d_gettimeod'
24855 d_gmtime64='$d_gmtime64'
24856 d_gmtime_r='$d_gmtime_r'
24857 d_gnulibc='$d_gnulibc'
24858 d_grpasswd='$d_grpasswd'
24859 d_has_C_UTF8='$d_has_C_UTF8'
24860 d_hasmntopt='$d_hasmntopt'
24864 d_ilogbl='$d_ilogbl'
24865 d_inc_version_list='$d_inc_version_list'
24866 d_inetaton='$d_inetaton'
24867 d_inetntop='$d_inetntop'
24868 d_inetpton='$d_inetpton'
24869 d_int64_t='$d_int64_t'
24870 d_ip_mreq='$d_ip_mreq'
24871 d_ip_mreq_source='$d_ip_mreq_source'
24872 d_ipv6_mreq='$d_ipv6_mreq'
24873 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24874 d_isascii='$d_isascii'
24875 d_isblank='$d_isblank'
24876 d_isfinite='$d_isfinite'
24877 d_isfinitel='$d_isfinitel'
24879 d_isinfl='$d_isinfl'
24880 d_isless='$d_isless'
24882 d_isnanl='$d_isnanl'
24883 d_isnormal='$d_isnormal'
24886 d_killpg='$d_killpg'
24887 d_lc_monetary_2008='$d_lc_monetary_2008'
24888 d_lchown='$d_lchown'
24889 d_ldbl_dig='$d_ldbl_dig'
24890 d_ldexpl='$d_ldexpl'
24891 d_lgamma='$d_lgamma'
24892 d_lgamma_r='$d_lgamma_r'
24893 d_libm_lib_version='$d_libm_lib_version'
24894 d_libname_unique='$d_libname_unique'
24896 d_linkat='$d_linkat'
24897 d_llrint='$d_llrint'
24898 d_llrintl='$d_llrintl'
24899 d_llround='$d_llround'
24900 d_llroundl='$d_llroundl'
24901 d_localeconv_l='$d_localeconv_l'
24902 d_localtime64='$d_localtime64'
24903 d_localtime_r='$d_localtime_r'
24904 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24905 d_locconv='$d_locconv'
24910 d_long_double_style_ieee='$d_long_double_style_ieee'
24911 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24912 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24913 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24914 d_long_double_style_vax='$d_long_double_style_vax'
24915 d_longdbl='$d_longdbl'
24916 d_longlong='$d_longlong'
24918 d_lrintl='$d_lrintl'
24919 d_lround='$d_lround'
24920 d_lroundl='$d_lroundl'
24921 d_lseekproto='$d_lseekproto'
24923 d_madvise='$d_madvise'
24924 d_malloc_good_size='$d_malloc_good_size'
24925 d_malloc_size='$d_malloc_size'
24926 d_malloc_usable_size='$d_malloc_usable_size'
24928 d_mbrlen='$d_mbrlen'
24929 d_mbrtowc='$d_mbrtowc'
24930 d_mbstowcs='$d_mbstowcs'
24931 d_mbtowc='$d_mbtowc'
24932 d_memmem='$d_memmem'
24933 d_memrchr='$d_memrchr'
24935 d_mkdtemp='$d_mkdtemp'
24936 d_mkfifo='$d_mkfifo'
24937 d_mkostemp='$d_mkostemp'
24938 d_mkstemp='$d_mkstemp'
24939 d_mkstemps='$d_mkstemps'
24940 d_mktime64='$d_mktime64'
24941 d_mktime='$d_mktime'
24944 d_modflproto='$d_modflproto'
24945 d_mprotect='$d_mprotect'
24947 d_msg_ctrunc='$d_msg_ctrunc'
24948 d_msg_dontroute='$d_msg_dontroute'
24949 d_msg_oob='$d_msg_oob'
24950 d_msg_peek='$d_msg_peek'
24951 d_msg_proxy='$d_msg_proxy'
24952 d_msgctl='$d_msgctl'
24953 d_msgget='$d_msgget'
24954 d_msghdr_s='$d_msghdr_s'
24955 d_msgrcv='$d_msgrcv'
24956 d_msgsnd='$d_msgsnd'
24958 d_munmap='$d_munmap'
24959 d_mymalloc='$d_mymalloc'
24961 d_nanosleep='$d_nanosleep'
24963 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24964 d_nearbyint='$d_nearbyint'
24965 d_newlocale='$d_newlocale'
24966 d_nextafter='$d_nextafter'
24967 d_nexttoward='$d_nexttoward'
24969 d_nl_langinfo='$d_nl_langinfo'
24970 d_nl_langinfo_l='$d_nl_langinfo_l'
24971 d_non_int_bitfields='$d_non_int_bitfields'
24972 d_nv_preserves_uv='$d_nv_preserves_uv'
24973 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24974 d_off64_t='$d_off64_t'
24975 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24976 d_oldpthreads='$d_oldpthreads'
24977 d_oldsock='$d_oldsock'
24979 d_openat='$d_openat'
24980 d_pathconf='$d_pathconf'
24982 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24983 d_phostname='$d_phostname'
24987 d_portable='$d_portable'
24989 d_prctl_set_name='$d_prctl_set_name'
24990 d_printf_format_null='$d_printf_format_null'
24991 d_procselfexe='$d_procselfexe'
24992 d_pseudofork='$d_pseudofork'
24993 d_pthread_atfork='$d_pthread_atfork'
24994 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24995 d_pthread_yield='$d_pthread_yield'
24996 d_ptrdiff_t='$d_ptrdiff_t'
24998 d_pwchange='$d_pwchange'
24999 d_pwclass='$d_pwclass'
25000 d_pwcomment='$d_pwcomment'
25001 d_pwexpire='$d_pwexpire'
25002 d_pwgecos='$d_pwgecos'
25003 d_pwpasswd='$d_pwpasswd'
25004 d_pwquota='$d_pwquota'
25007 d_querylocale='$d_querylocale'
25008 d_random_r='$d_random_r'
25009 d_re_comp='$d_re_comp'
25010 d_readdir64_r='$d_readdir64_r'
25011 d_readdir='$d_readdir'
25012 d_readdir_r='$d_readdir_r'
25013 d_readlink='$d_readlink'
25015 d_recvmsg='$d_recvmsg'
25016 d_regcmp='$d_regcmp'
25017 d_regcomp='$d_regcomp'
25018 d_remainder='$d_remainder'
25019 d_remquo='$d_remquo'
25020 d_rename='$d_rename'
25021 d_renameat='$d_renameat'
25022 d_rewinddir='$d_rewinddir'
25026 d_sbrkproto='$d_sbrkproto'
25027 d_scalbn='$d_scalbn'
25028 d_scalbnl='$d_scalbnl'
25029 d_sched_yield='$d_sched_yield'
25030 d_scm_rights='$d_scm_rights'
25031 d_seekdir='$d_seekdir'
25032 d_select='$d_select'
25034 d_semctl='$d_semctl'
25035 d_semctl_semid_ds='$d_semctl_semid_ds'
25036 d_semctl_semun='$d_semctl_semun'
25037 d_semget='$d_semget'
25039 d_sendmsg='$d_sendmsg'
25040 d_setegid='$d_setegid'
25041 d_setenv='$d_setenv'
25042 d_seteuid='$d_seteuid'
25043 d_setgrent='$d_setgrent'
25044 d_setgrent_r='$d_setgrent_r'
25045 d_setgrps='$d_setgrps'
25046 d_sethent='$d_sethent'
25047 d_sethostent_r='$d_sethostent_r'
25048 d_setitimer='$d_setitimer'
25049 d_setlinebuf='$d_setlinebuf'
25050 d_setlocale='$d_setlocale'
25051 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
25052 d_setlocale_r='$d_setlocale_r'
25053 d_setnent='$d_setnent'
25054 d_setnetent_r='$d_setnetent_r'
25055 d_setpent='$d_setpent'
25056 d_setpgid='$d_setpgid'
25057 d_setpgrp2='$d_setpgrp2'
25058 d_setpgrp='$d_setpgrp'
25059 d_setprior='$d_setprior'
25060 d_setproctitle='$d_setproctitle'
25061 d_setprotoent_r='$d_setprotoent_r'
25062 d_setpwent='$d_setpwent'
25063 d_setpwent_r='$d_setpwent_r'
25064 d_setregid='$d_setregid'
25065 d_setresgid='$d_setresgid'
25066 d_setresuid='$d_setresuid'
25067 d_setreuid='$d_setreuid'
25068 d_setrgid='$d_setrgid'
25069 d_setruid='$d_setruid'
25070 d_setsent='$d_setsent'
25071 d_setservent_r='$d_setservent_r'
25072 d_setsid='$d_setsid'
25073 d_setvbuf='$d_setvbuf'
25076 d_shmatprototype='$d_shmatprototype'
25077 d_shmctl='$d_shmctl'
25079 d_shmget='$d_shmget'
25080 d_sigaction='$d_sigaction'
25081 d_siginfo_si_addr='$d_siginfo_si_addr'
25082 d_siginfo_si_band='$d_siginfo_si_band'
25083 d_siginfo_si_errno='$d_siginfo_si_errno'
25084 d_siginfo_si_fd='$d_siginfo_si_fd'
25085 d_siginfo_si_pid='$d_siginfo_si_pid'
25086 d_siginfo_si_status='$d_siginfo_si_status'
25087 d_siginfo_si_uid='$d_siginfo_si_uid'
25088 d_siginfo_si_value='$d_siginfo_si_value'
25089 d_signbit='$d_signbit'
25090 d_sigprocmask='$d_sigprocmask'
25091 d_sigsetjmp='$d_sigsetjmp'
25092 d_sin6_scope_id='$d_sin6_scope_id'
25093 d_sitearch='$d_sitearch'
25094 d_snprintf='$d_snprintf'
25095 d_sockaddr_in6='$d_sockaddr_in6'
25096 d_sockaddr_sa_len='$d_sockaddr_sa_len'
25097 d_sockaddr_storage='$d_sockaddr_storage'
25098 d_sockatmark='$d_sockatmark'
25099 d_sockatmarkproto='$d_sockatmarkproto'
25100 d_socket='$d_socket'
25101 d_socklen_t='$d_socklen_t'
25102 d_sockpair='$d_sockpair'
25103 d_socks5_init='$d_socks5_init'
25105 d_srand48_r='$d_srand48_r'
25106 d_srandom_r='$d_srandom_r'
25107 d_sresgproto='$d_sresgproto'
25108 d_sresuproto='$d_sresuproto'
25110 d_statblks='$d_statblks'
25111 d_statfs_f_flags='$d_statfs_f_flags'
25112 d_statfs_s='$d_statfs_s'
25113 d_static_inline='$d_static_inline'
25114 d_statvfs='$d_statvfs'
25115 d_stdio_cnt_lval='$d_stdio_cnt_lval'
25116 d_stdio_ptr_lval='$d_stdio_ptr_lval'
25117 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
25118 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
25119 d_stdio_stream_array='$d_stdio_stream_array'
25120 d_stdiobase='$d_stdiobase'
25121 d_stdstdio='$d_stdstdio'
25122 d_strcoll='$d_strcoll'
25123 d_strerror_l='$d_strerror_l'
25124 d_strerror_r='$d_strerror_r'
25125 d_strftime='$d_strftime'
25126 d_strlcat='$d_strlcat'
25127 d_strlcpy='$d_strlcpy'
25128 d_strnlen='$d_strnlen'
25129 d_strtod='$d_strtod'
25130 d_strtod_l='$d_strtod_l'
25131 d_strtol='$d_strtol'
25132 d_strtold='$d_strtold'
25133 d_strtold_l='$d_strtold_l'
25134 d_strtoll='$d_strtoll'
25135 d_strtoq='$d_strtoq'
25136 d_strtoul='$d_strtoul'
25137 d_strtoull='$d_strtoull'
25138 d_strtouq='$d_strtouq'
25139 d_strxfrm='$d_strxfrm'
25140 d_strxfrm_l='$d_strxfrm_l'
25141 d_suidsafe='$d_suidsafe'
25142 d_symlink='$d_symlink'
25143 d_syscall='$d_syscall'
25144 d_syscallproto='$d_syscallproto'
25145 d_sysconf='$d_sysconf'
25146 d_sysernlst='$d_sysernlst'
25147 d_syserrlst='$d_syserrlst'
25148 d_system='$d_system'
25149 d_tcgetpgrp='$d_tcgetpgrp'
25150 d_tcsetpgrp='$d_tcsetpgrp'
25151 d_telldir='$d_telldir'
25152 d_telldirproto='$d_telldirproto'
25153 d_tgamma='$d_tgamma'
25154 d_thread_local='$d_thread_local'
25155 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
25157 d_timegm='$d_timegm'
25159 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
25160 d_tm_tm_zone='$d_tm_tm_zone'
25161 d_tmpnam_r='$d_tmpnam_r'
25162 d_towlower='$d_towlower'
25163 d_towupper='$d_towupper'
25165 d_truncate='$d_truncate'
25166 d_truncl='$d_truncl'
25167 d_ttyname_r='$d_ttyname_r'
25168 d_tzname='$d_tzname'
25169 d_u32align='$d_u32align'
25170 d_ualarm='$d_ualarm'
25173 d_union_semun='$d_union_semun'
25174 d_unlinkat='$d_unlinkat'
25175 d_unordered='$d_unordered'
25176 d_unsetenv='$d_unsetenv'
25177 d_uselocale='$d_uselocale'
25178 d_usleep='$d_usleep'
25179 d_usleepproto='$d_usleepproto'
25181 d_vendorarch='$d_vendorarch'
25182 d_vendorbin='$d_vendorbin'
25183 d_vendorlib='$d_vendorlib'
25184 d_vendorscript='$d_vendorscript'
25186 d_void_closedir='$d_void_closedir'
25187 d_voidsig='$d_voidsig'
25188 d_voidtty='$d_voidtty'
25189 d_vsnprintf='$d_vsnprintf'
25191 d_waitpid='$d_waitpid'
25192 d_wcrtomb='$d_wcrtomb'
25193 d_wcscmp='$d_wcscmp'
25194 d_wcstombs='$d_wcstombs'
25195 d_wcsxfrm='$d_wcsxfrm'
25196 d_wctomb='$d_wctomb'
25197 d_writev='$d_writev'
25200 db_hashtype='$db_hashtype'
25201 db_prefixtype='$db_prefixtype'
25202 db_version_major='$db_version_major'
25203 db_version_minor='$db_version_minor'
25204 db_version_patch='$db_version_patch'
25205 default_inc_excludes_dot='$default_inc_excludes_dot'
25206 direntrytype='$direntrytype'
25209 doubleinfbytes='$doubleinfbytes'
25210 doublekind='$doublekind'
25211 doublemantbits='$doublemantbits'
25212 doublenanbytes='$doublenanbytes'
25213 doublesize='$doublesize'
25215 drand48_r_proto='$drand48_r_proto'
25217 dtraceobject='$dtraceobject'
25218 dtracexnolibs='$dtracexnolibs'
25219 dynamic_ext='$dynamic_ext'
25225 endgrent_r_proto='$endgrent_r_proto'
25226 endhostent_r_proto='$endhostent_r_proto'
25227 endnetent_r_proto='$endnetent_r_proto'
25228 endprotoent_r_proto='$endprotoent_r_proto'
25229 endpwent_r_proto='$endpwent_r_proto'
25230 endservent_r_proto='$endservent_r_proto'
25231 eunicefix='$eunicefix'
25234 extensions='$extensions'
25235 extern_C='$extern_C'
25237 fflushNULL='$fflushNULL'
25238 fflushall='$fflushall'
25240 firstmakefile='$firstmakefile'
25242 fpossize='$fpossize'
25243 fpostype='$fpostype'
25244 freetype='$freetype'
25247 full_csh='$full_csh'
25248 full_sed='$full_sed'
25249 gccansipedantic='$gccansipedantic'
25250 gccosandvers='$gccosandvers'
25251 gccversion='$gccversion'
25252 getgrent_r_proto='$getgrent_r_proto'
25253 getgrgid_r_proto='$getgrgid_r_proto'
25254 getgrnam_r_proto='$getgrnam_r_proto'
25255 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
25256 gethostbyname_r_proto='$gethostbyname_r_proto'
25257 gethostent_r_proto='$gethostent_r_proto'
25258 getlogin_r_proto='$getlogin_r_proto'
25259 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
25260 getnetbyname_r_proto='$getnetbyname_r_proto'
25261 getnetent_r_proto='$getnetent_r_proto'
25262 getprotobyname_r_proto='$getprotobyname_r_proto'
25263 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25264 getprotoent_r_proto='$getprotoent_r_proto'
25265 getpwent_r_proto='$getpwent_r_proto'
25266 getpwnam_r_proto='$getpwnam_r_proto'
25267 getpwuid_r_proto='$getpwuid_r_proto'
25268 getservbyname_r_proto='$getservbyname_r_proto'
25269 getservbyport_r_proto='$getservbyport_r_proto'
25270 getservent_r_proto='$getservent_r_proto'
25271 getspnam_r_proto='$getspnam_r_proto'
25272 gidformat='$gidformat'
25278 gmtime_r_proto='$gmtime_r_proto'
25279 gnulibc_version='$gnulibc_version'
25281 groupcat='$groupcat'
25282 groupstype='$groupstype'
25285 h_sysfile='$h_sysfile'
25288 hostgenerate='$hostgenerate'
25289 hostosname='$hostosname'
25290 hostperl='$hostperl'
25291 html1dir='$html1dir'
25292 html1direxp='$html1direxp'
25293 html3dir='$html3dir'
25294 html3direxp='$html3direxp'
25297 i32dformat='$i32dformat'
25304 i_arpainet='$i_arpainet'
25306 i_bsdioctl='$i_bsdioctl'
25310 i_dirent='$i_dirent'
25312 i_execinfo='$i_execinfo'
25316 i_fp_class='$i_fp_class'
25318 i_gdbm_ndbm='$i_gdbm_ndbm'
25319 i_gdbmndbm='$i_gdbmndbm'
25321 i_ieeefp='$i_ieeefp'
25322 i_inttypes='$i_inttypes'
25323 i_langinfo='$i_langinfo'
25324 i_libutil='$i_libutil'
25325 i_locale='$i_locale'
25326 i_machcthr='$i_machcthr'
25327 i_malloc='$i_malloc'
25328 i_mallocmalloc='$i_mallocmalloc'
25329 i_mntent='$i_mntent'
25332 i_neterrno='$i_neterrno'
25333 i_netinettcp='$i_netinettcp'
25337 i_pthread='$i_pthread'
25339 i_quadmath='$i_quadmath'
25340 i_rpcsvcdbm='$i_rpcsvcdbm'
25342 i_shadow='$i_shadow'
25344 i_stdbool='$i_stdbool'
25345 i_stdint='$i_stdint'
25346 i_stdlib='$i_stdlib'
25347 i_sunmath='$i_sunmath'
25348 i_sysaccess='$i_sysaccess'
25349 i_sysdir='$i_sysdir'
25350 i_sysfile='$i_sysfile'
25351 i_sysfilio='$i_sysfilio'
25353 i_sysioctl='$i_sysioctl'
25354 i_syslog='$i_syslog'
25355 i_sysmman='$i_sysmman'
25356 i_sysmode='$i_sysmode'
25357 i_sysmount='$i_sysmount'
25358 i_sysndir='$i_sysndir'
25359 i_sysparam='$i_sysparam'
25360 i_syspoll='$i_syspoll'
25361 i_sysresrc='$i_sysresrc'
25362 i_syssecrt='$i_syssecrt'
25363 i_sysselct='$i_sysselct'
25364 i_syssockio='$i_syssockio'
25365 i_sysstat='$i_sysstat'
25366 i_sysstatfs='$i_sysstatfs'
25367 i_sysstatvfs='$i_sysstatvfs'
25368 i_systime='$i_systime'
25369 i_systimek='$i_systimek'
25370 i_systimes='$i_systimes'
25371 i_systypes='$i_systypes'
25372 i_sysuio='$i_sysuio'
25374 i_sysutsname='$i_sysutsname'
25375 i_sysvfs='$i_sysvfs'
25376 i_syswait='$i_syswait'
25377 i_termio='$i_termio'
25378 i_termios='$i_termios'
25380 i_unistd='$i_unistd'
25385 i_wctype='$i_wctype'
25386 i_xlocale='$i_xlocale'
25387 ignore_versioned_solibs='$ignore_versioned_solibs'
25388 inc_version_list='$inc_version_list'
25389 inc_version_list_init='$inc_version_list_init'
25393 initialinstalllocation='$initialinstalllocation'
25394 installarchlib='$installarchlib'
25395 installbin='$installbin'
25396 installhtml1dir='$installhtml1dir'
25397 installhtml3dir='$installhtml3dir'
25398 installman1dir='$installman1dir'
25399 installman3dir='$installman3dir'
25400 installprefix='$installprefix'
25401 installprefixexp='$installprefixexp'
25402 installprivlib='$installprivlib'
25403 installscript='$installscript'
25404 installsitearch='$installsitearch'
25405 installsitebin='$installsitebin'
25406 installsitehtml1dir='$installsitehtml1dir'
25407 installsitehtml3dir='$installsitehtml3dir'
25408 installsitelib='$installsitelib'
25409 installsiteman1dir='$installsiteman1dir'
25410 installsiteman3dir='$installsiteman3dir'
25411 installsitescript='$installsitescript'
25412 installstyle='$installstyle'
25413 installusrbinperl='$installusrbinperl'
25414 installvendorarch='$installvendorarch'
25415 installvendorbin='$installvendorbin'
25416 installvendorhtml1dir='$installvendorhtml1dir'
25417 installvendorhtml3dir='$installvendorhtml3dir'
25418 installvendorlib='$installvendorlib'
25419 installvendorman1dir='$installvendorman1dir'
25420 installvendorman3dir='$installvendorman3dir'
25421 installvendorscript='$installvendorscript'
25423 issymlink='$issymlink'
25424 ivdformat='$ivdformat'
25427 known_extensions='$known_extensions'
25430 ld_can_script='$ld_can_script'
25431 lddlflags='$lddlflags'
25433 ldflags_uselargefiles='$ldflags_uselargefiles'
25434 ldlibpthname='$ldlibpthname'
25441 libsdirs='$libsdirs'
25442 libsfiles='$libsfiles'
25443 libsfound='$libsfound'
25444 libspath='$libspath'
25445 libswanted='$libswanted'
25446 libswanted_uselargefiles='$libswanted_uselargefiles'
25452 localtime_r_proto='$localtime_r_proto'
25453 locincpth='$locincpth'
25454 loclibpth='$loclibpth'
25455 longdblinfbytes='$longdblinfbytes'
25456 longdblkind='$longdblkind'
25457 longdblmantbits='$longdblmantbits'
25458 longdblnanbytes='$longdblnanbytes'
25459 longdblsize='$longdblsize'
25460 longlongsize='$longlongsize'
25461 longsize='$longsize'
25465 lseeksize='$lseeksize'
25466 lseektype='$lseektype'
25470 make_set_make='$make_set_make'
25471 mallocobj='$mallocobj'
25472 mallocsrc='$mallocsrc'
25473 malloctype='$malloctype'
25475 man1direxp='$man1direxp'
25478 man3direxp='$man3direxp'
25480 mips_type='$mips_type'
25481 mistrustnm='$mistrustnm'
25483 mmaptype='$mmaptype'
25484 modetype='$modetype'
25486 multiarch='$multiarch'
25488 myarchname='$myarchname'
25489 mydomain='$mydomain'
25490 myhostname='$myhostname'
25493 need_va_copy='$need_va_copy'
25494 netdb_hlen_type='$netdb_hlen_type'
25495 netdb_host_type='$netdb_host_type'
25496 netdb_name_type='$netdb_name_type'
25497 netdb_net_type='$netdb_net_type'
25500 nm_so_opt='$nm_so_opt'
25501 nonxs_ext='$nonxs_ext'
25503 nvEUformat='$nvEUformat'
25504 nvFUformat='$nvFUformat'
25505 nvGUformat='$nvGUformat'
25506 nv_overflows_integers_at='$nv_overflows_integers_at'
25507 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25508 nveformat='$nveformat'
25509 nvfformat='$nvfformat'
25510 nvgformat='$nvgformat'
25511 nvmantbits='$nvmantbits'
25514 o_nonblock='$o_nonblock'
25516 old_pthread_create_joinable='$old_pthread_create_joinable'
25517 optimize='$optimize'
25518 orderlib='$orderlib'
25521 otherlibdirs='$otherlibdirs'
25525 patchlevel='$patchlevel'
25526 path_sep='$path_sep'
25529 perl_patchlevel='$perl_patchlevel'
25530 perl_static_inline='$perl_static_inline'
25531 perl_thread_local='$perl_thread_local'
25532 perladmin='$perladmin'
25533 perllibs='$perllibs'
25534 perlpath='$perlpath'
25536 phostname='$phostname'
25542 prefixexp='$prefixexp'
25544 privlibexp='$privlibexp'
25545 procselfexe='$procselfexe'
25547 quadkind='$quadkind'
25548 quadtype='$quadtype'
25549 randbits='$randbits'
25550 randfunc='$randfunc'
25551 random_r_proto='$random_r_proto'
25552 randseedtype='$randseedtype'
25554 rd_nodata='$rd_nodata'
25555 readdir64_r_proto='$readdir64_r_proto'
25556 readdir_r_proto='$readdir_r_proto'
25557 revision='$revision'
25563 sGMTIME_max='$sGMTIME_max'
25564 sGMTIME_min='$sGMTIME_min'
25565 sLOCALTIME_max='$sLOCALTIME_max'
25566 sLOCALTIME_min='$sLOCALTIME_min'
25567 sPRIEUldbl='$sPRIEUldbl'
25568 sPRIFUldbl='$sPRIFUldbl'
25569 sPRIGUldbl='$sPRIGUldbl'
25570 sPRIXU64='$sPRIXU64'
25572 sPRIeldbl='$sPRIeldbl'
25573 sPRIfldbl='$sPRIfldbl'
25574 sPRIgldbl='$sPRIgldbl'
25579 sSCNfldbl='$sSCNfldbl'
25580 sched_yield='$sched_yield'
25581 scriptdir='$scriptdir'
25582 scriptdirexp='$scriptdirexp'
25584 seedfunc='$seedfunc'
25585 selectminbits='$selectminbits'
25586 selecttype='$selecttype'
25587 sendmail='$sendmail'
25588 setgrent_r_proto='$setgrent_r_proto'
25589 sethostent_r_proto='$sethostent_r_proto'
25590 setlocale_r_proto='$setlocale_r_proto'
25591 setnetent_r_proto='$setnetent_r_proto'
25592 setprotoent_r_proto='$setprotoent_r_proto'
25593 setpwent_r_proto='$setpwent_r_proto'
25594 setservent_r_proto='$setservent_r_proto'
25597 sharpbang='$sharpbang'
25598 shmattype='$shmattype'
25599 shortsize='$shortsize'
25602 sig_count='$sig_count'
25603 sig_name='$sig_name'
25604 sig_name_init='$sig_name_init'
25606 sig_num_init='$sig_num_init'
25607 sig_size='$sig_size'
25608 signal_t='$signal_t'
25609 sitearch='$sitearch'
25610 sitearchexp='$sitearchexp'
25612 sitebinexp='$sitebinexp'
25613 sitehtml1dir='$sitehtml1dir'
25614 sitehtml1direxp='$sitehtml1direxp'
25615 sitehtml3dir='$sitehtml3dir'
25616 sitehtml3direxp='$sitehtml3direxp'
25618 sitelib_stem='$sitelib_stem'
25619 sitelibexp='$sitelibexp'
25620 siteman1dir='$siteman1dir'
25621 siteman1direxp='$siteman1direxp'
25622 siteman3dir='$siteman3dir'
25623 siteman3direxp='$siteman3direxp'
25624 siteprefix='$siteprefix'
25625 siteprefixexp='$siteprefixexp'
25626 sitescript='$sitescript'
25627 sitescriptexp='$sitescriptexp'
25628 sizesize='$sizesize'
25629 sizetype='$sizetype'
25633 sockethdr='$sockethdr'
25634 socketlib='$socketlib'
25635 socksizetype='$socksizetype'
25637 spackage='$spackage'
25638 spitshell='$spitshell'
25639 srand48_r_proto='$srand48_r_proto'
25640 srandom_r_proto='$srandom_r_proto'
25642 ssizetype='$ssizetype'
25643 st_dev_sign='$st_dev_sign'
25644 st_dev_size='$st_dev_size'
25645 st_ino_sign='$st_ino_sign'
25646 st_ino_size='$st_ino_size'
25647 startperl='$startperl'
25649 static_ext='$static_ext'
25651 stdio_base='$stdio_base'
25652 stdio_bufsiz='$stdio_bufsiz'
25653 stdio_cnt='$stdio_cnt'
25654 stdio_filbuf='$stdio_filbuf'
25655 stdio_ptr='$stdio_ptr'
25656 stdio_stream_array='$stdio_stream_array'
25657 strerror_r_proto='$strerror_r_proto'
25659 subversion='$subversion'
25664 targetarch='$targetarch'
25665 targetdir='$targetdir'
25666 targetenv='$targetenv'
25667 targethost='$targethost'
25668 targetmkdir='$targetmkdir'
25669 targetport='$targetport'
25670 targetsh='$targetsh'
25674 timeincl='$timeincl'
25675 timetype='$timetype'
25676 tmpnam_r_proto='$tmpnam_r_proto'
25682 ttyname_r_proto='$ttyname_r_proto'
25685 u32XUformat='$u32XUformat'
25686 u32oformat='$u32oformat'
25689 u32uformat='$u32uformat'
25690 u32xformat='$u32xformat'
25695 uidformat='$uidformat'
25701 uquadtype='$uquadtype'
25702 use64bitall='$use64bitall'
25703 use64bitint='$use64bitint'
25704 usecbacktrace='$usecbacktrace'
25705 usecrosscompile='$usecrosscompile'
25706 usedefaultstrict='$usedefaultstrict'
25707 usedevel='$usedevel'
25709 usedtrace='$usedtrace'
25710 usefaststdio='$usefaststdio'
25711 useithreads='$useithreads'
25712 usekernprocpathname='$usekernprocpathname'
25713 uselanginfo='$uselanginfo'
25714 uselargefiles='$uselargefiles'
25715 uselongdouble='$uselongdouble'
25716 usemallocwrap='$usemallocwrap'
25717 usemorebits='$usemorebits'
25718 usemultiplicity='$usemultiplicity'
25719 usemymalloc='$usemymalloc'
25721 usensgetexecutablepath='$usensgetexecutablepath'
25722 useopcode='$useopcode'
25723 useperlio='$useperlio'
25724 useposix='$useposix'
25725 usequadmath='$usequadmath'
25726 usereentrant='$usereentrant'
25727 userelocatableinc='$userelocatableinc'
25728 useshrplib='$useshrplib'
25729 usesitecustomize='$usesitecustomize'
25730 usesocks='$usesocks'
25731 usethreads='$usethreads'
25732 usevendorprefix='$usevendorprefix'
25733 useversionedarchname='$useversionedarchname'
25734 usevfork='$usevfork'
25737 uvXUformat='$uvXUformat'
25738 uvoformat='$uvoformat'
25741 uvuformat='$uvuformat'
25742 uvxformat='$uvxformat'
25743 vendorarch='$vendorarch'
25744 vendorarchexp='$vendorarchexp'
25745 vendorbin='$vendorbin'
25746 vendorbinexp='$vendorbinexp'
25747 vendorhtml1dir='$vendorhtml1dir'
25748 vendorhtml1direxp='$vendorhtml1direxp'
25749 vendorhtml3dir='$vendorhtml3dir'
25750 vendorhtml3direxp='$vendorhtml3direxp'
25751 vendorlib='$vendorlib'
25752 vendorlib_stem='$vendorlib_stem'
25753 vendorlibexp='$vendorlibexp'
25754 vendorman1dir='$vendorman1dir'
25755 vendorman1direxp='$vendorman1direxp'
25756 vendorman3dir='$vendorman3dir'
25757 vendorman3direxp='$vendorman3direxp'
25758 vendorprefix='$vendorprefix'
25759 vendorprefixexp='$vendorprefixexp'
25760 vendorscript='$vendorscript'
25761 vendorscriptexp='$vendorscriptexp'
25763 version_patchlevel_string='$version_patchlevel_string'
25764 versiononly='$versiononly'
25767 xlocale_needed='$xlocale_needed'
25769 yaccflags='$yaccflags'
25774 : add special variables
25775 $test -f $src/patchlevel.h && \
25776 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25777 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25778 echo "PERL_CONFIG_SH=true" >>config.sh
25780 : propagate old symbols
25781 if $test -f UU/config.sh; then
25782 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25783 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25784 config.sh config.sh UU/oldconfig.sh |\
25785 $sort | $uniq -u >UU/oldsyms
25786 set X `$cat UU/oldsyms`
25792 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25794 echo ": Variables propagated from previous config.sh file." >>config.sh
25795 for sym in `$cat UU/oldsyms`; do
25796 echo " Propagating $hint variable "'$'"$sym..."
25797 eval 'tmp="$'"${sym}"'"'
25799 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25805 : preserve RCS keywords in files with variable substitution, grrr
25808 : Finish up by extracting the .SH files
25811 echo "Stopping at your request, leaving temporary files around."
25821 If you'd like to make any changes to the config.sh file before I begin
25822 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25825 rp="Press return or use a shell escape to edit config.sh:"
25830 *) : in case they cannot read
25831 sh 1>&4 -c "$ans";;
25836 : if this fails, just run all the .SH files by hand
25845 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25852 Now you need to generate make dependencies by running "$make depend".
25853 You might prefer to run it in background: "$make depend > makedepend.out &"
25854 It can take a while, so you might not want to run it right now.
25859 rp="Run $make depend now?"
25863 $make depend && echo "Now you must run '$make'."
25866 echo "You must run '$make depend' then '$make'."
25869 elif test -f [Mm]akefile; then
25871 echo "Now you must run a $make."
25873 echo "Configure done."
25876 if $test -f Policy.sh; then
25879 If you compile $package on a different machine or from a different object
25880 directory, copy the Policy.sh file from this object directory to the
25881 new one before you run Configure -- this will help you with most of
25882 the policy defaults.
25886 if $test -f UU/config.msg; then
25887 echo "Hmm. I also noted the following information while running:"
25889 $cat UU/config.msg >&4
25891 $rm -f kit*isdone ark*isdone