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_warn_unused_result=''
395 d_printf_format_null=''
397 d_builtin_choose_expr=''
399 d_builtin_add_overflow=''
400 d_builtin_mul_overflow=''
401 d_builtin_sub_overflow=''
402 d_c99_variadic_macros=''
451 endhostent_r_proto=''
457 endprotoent_r_proto=''
463 endservent_r_proto=''
535 gethostbyaddr_r_proto=''
537 gethostbyname_r_proto=''
539 gethostent_r_proto=''
552 getnetbyaddr_r_proto=''
554 getnetbyname_r_proto=''
568 d_getprotobyname_r=''
569 getprotobyname_r_proto=''
570 d_getprotobynumber_r=''
571 getprotobynumber_r_proto=''
573 getprotoent_r_proto=''
585 getservbyname_r_proto=''
587 getservbyport_r_proto=''
589 getservent_r_proto=''
622 d_lc_monetary_2008=''
627 d_libm_lib_version=''
635 d_localtime_r_needs_tzset=''
643 d_long_double_style_ieee=''
644 d_long_double_style_ieee_doubledouble=''
645 d_long_double_style_ieee_extended=''
646 d_long_double_style_ieee_std=''
647 d_long_double_style_vax=''
660 d_malloc_good_size=''
662 d_malloc_usable_size=''
703 d_thread_safe_nl_langinfo_l=''
717 d_old_pthread_create_joinable=''
718 old_pthread_create_joinable=''
720 d_pthread_attr_setscope=''
765 sethostent_r_proto=''
770 d_setlocale_accepts_any_locale_name=''
784 setprotoent_r_proto=''
796 setservent_r_proto=''
809 d_siginfo_si_errno=''
812 d_siginfo_si_status=''
814 d_siginfo_si_value=''
826 d_ipv6_mreq_source=''
837 d_sockaddr_storage=''
856 perl_static_inline=''
861 d_stdio_ptr_lval_nochange_cnt=''
862 d_stdio_ptr_lval_sets_cnt=''
945 default_inc_excludes_dot=''
1011 d_gdbm_ndbm_h_uses_prototypes=''
1012 d_gdbmndbm_h_uses_prototypes=''
1014 d_ndbm_h_uses_prototypes=''
1085 d_inc_version_list=''
1087 inc_version_list_init=''
1095 installusrbinperl=''
1111 ignore_versioned_solibs=''
1127 d_double_has_negative_zero=''
1128 d_double_has_subnormals=''
1129 d_double_style_cray=''
1130 d_double_style_ibm=''
1131 d_double_style_ieee=''
1132 d_double_style_vax=''
1183 d_perl_otherlibdirs=''
1191 api_versionstring=''
1197 version_patchlevel_string=''
1201 d_nv_preserves_uv=''
1202 d_nv_zero_is_allbits_zero=''
1213 nv_overflows_integers_at=''
1214 nv_preserves_uv_bits=''
1286 installsitehtml1dir=''
1289 installsitehtml3dir=''
1296 installsiteman1dir=''
1299 installsiteman3dir=''
1304 installsitescript=''
1322 d_stdio_stream_array=''
1323 stdio_stream_array=''
1342 usekernprocpathname=''
1343 ccflags_uselargefiles=''
1344 ldflags_uselargefiles=''
1345 libswanted_uselargefiles=''
1354 usensgetexecutablepath=''
1366 installvendorarch=''
1373 installvendorhtml1dir=''
1375 vendorhtml1direxp=''
1376 installvendorhtml3dir=''
1378 vendorhtml3direxp=''
1384 installvendorman1dir=''
1387 installvendorman3dir=''
1394 installvendorscript=''
1405 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1408 : We must find out about Eunice early
1410 if test -f /etc/unixtovms; then
1411 eunicefix=/etc/unixtovms
1413 if test -f /etc/unixtovms.exe; then
1414 eunicefix=/etc/unixtovms.exe
1417 : Set executable suffix now -- needed before hints available
1418 if test -f "/libs/version.library"; then
1421 elif test -f "/system/gnu_library/bin/ar.pm"; then
1424 elif test -n "$DJGPP"; then
1427 elif test -f /kern/cookiejar; then
1430 elif test -d c:/. -o -n "$is_os2" ; then
1437 : Possible local include directories to search.
1438 : Set locincpth to "" in a hint file to defeat local include searches.
1439 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1440 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1442 : no include file wanted by default
1445 : Enable -DEBUGGING and -DDEBUGGING from the command line
1449 : Trailing extension. Override this in a hint file, if needed.
1450 : Extra object files, if any, needed on this platform.
1453 : change the next line if compiling for Xenix/286 on Xenix/386
1454 xlibpth='/usr/lib/386 /lib/386'
1455 : Possible local library directories to search.
1456 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1457 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1459 : general looking path for locating libraries
1460 glibpth="/lib /usr/lib $xlibpth"
1461 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1462 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1463 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1464 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1466 : Private path used by Configure to find libraries. Its value
1467 : is prepended to libpth. This variable takes care of special
1468 : machines, like the mips. Usually, it should be empty.
1471 : default library list
1473 : some systems want to use only the non-versioned libso:s
1474 ignore_versioned_solibs=''
1478 : set useposix=false in your hint file to disable the POSIX extension.
1480 : set useopcode=false in your hint file to disable the Opcode extension.
1482 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1485 ccflags_uselargefiles=''
1486 ldflags_uselargefiles=''
1487 libswanted_uselargefiles=''
1488 : set usemultiplicity on the Configure command line to enable multiplicity.
1489 : set usesocks on the Configure command line to enable socks.
1491 : set usethreads on the Configure command line to enable threads.
1492 usereentrant='undef'
1493 : List of libraries we want.
1494 : If anyone needs extra -lxxx, put those in a hint file.
1495 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1496 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1497 : We probably want to search /usr/shlib before most other libraries.
1498 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1499 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1500 glibpth="/usr/shlib $glibpth"
1501 : Do not use vfork unless overridden by a hint file.
1504 : Find the basic shell for Bourne shell scripts
1508 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1511 if test -f "$xxx"; then
1514 : Build up a list and do a single loop so we can 'break' out.
1515 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1516 for xxx in sh bash ksh pdksh ash; do
1518 try="$try ${p}/${xxx}"
1522 if test -f "$xxx"; then
1525 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1528 elif test -f "$xxx.exe"; then
1539 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1541 Usually it's in /bin/sh. How did you even get this far?
1542 Please report this issue at https://github.com/Perl/perl5/issues
1543 and we'll try to straighten this all out.
1549 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1550 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1553 : see if sh knows # comments
1554 if `$sh -c '#' >/dev/null 2>&1`; then
1558 test -f $xcat$_exe || xcat=/usr/bin/cat
1559 if test ! -f $xcat$_exe; then
1560 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1561 if test -f $p/cat$_exe; then
1566 if test ! -f $xcat$_exe; then
1567 echo "Can't find cat anywhere!"
1571 echo "#!$xcat" >sharp
1574 ./sharp > today 2>/dev/null
1575 if test -s today; then
1578 echo "#! $xcat" > sharp
1581 ./sharp > today 2>/dev/null
1582 if test -s today; then
1590 echo "Your $sh doesn't grok # comments--I will strip them later on."
1593 echo "exec grep -v '^[ ]*#'" >spitshell
1595 $eunicefix spitshell
1596 spitshell=`pwd`/spitshell
1598 echo "I presume that if # doesn't work, #! won't work either!"
1603 : figure out how to guarantee sh startup
1605 '') startsh=${sharpbang}${sh} ;;
1617 : echo "Yup, it does."
1619 echo "Hmm... '$startsh' does not guarantee sh startup..."
1620 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1624 : Save command line options in file UU/cmdline.opt for later use in
1625 : generating config.sh.
1626 cat > cmdline.opt <<EOSH
1627 : Configure command line arguments.
1636 cat >>cmdline.opt <<EOSH
1637 config_arg$argn='$arg'
1639 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1642 arg_exp=`cat cmdl.opt`
1643 args_exp="$args_exp$args_sep'$arg_exp'"
1644 argn=`expr $argn + 1`
1649 : produce awk script to parse command line options
1650 cat >options.awk <<'EOF'
1652 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1654 len = length(optstr);
1655 for (i = 1; i <= len; i++) {
1656 c = substr(optstr, i, 1);
1657 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1668 if (substr(str, 1, 1) != "-") {
1669 printf("'%s'\n", str);
1673 for (i = 2; i <= len; i++) {
1674 c = substr(str, i, 1);
1676 printf("-%s\n", substr(str, i));
1682 printf("'%s'\n", substr(str, i + 1));
1695 : process the command line options
1696 set X `for arg in "$@"; do echo "X$arg"; done |
1697 sed -e s/X// | awk -f options.awk`
1702 : set up default values
1711 rm -f optdef.sh posthint.sh
1712 cat >optdef.sh <<EOS
1718 while test $# -gt 0; do
1720 -d) shift; fastread=yes;;
1721 -e) shift; alldone=cont;;
1725 if test -r "$1"; then
1728 echo "$me: cannot read config file $1." >&2
1734 -h) shift; error=true;;
1735 -r) shift; reuseval=true;;
1736 -s) shift; silent=true; realsilent=true;;
1737 -E) shift; alldone=exit;;
1738 -K) shift; knowitall=true;;
1740 -S) shift; silent=true; extractsh=true;;
1745 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1746 echo "$me: ignoring -D $1" >&2
1749 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1750 *) echo "$1='define'" >> optdef.sh;;
1757 *=) echo "$1" >> optdef.sh;;
1759 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1760 echo "$me: ignoring -U $1" >&2
1762 *) echo "$1='undef'" >> optdef.sh;;
1773 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1777 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1778 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1784 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1785 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1786 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1787 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1788 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1789 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1795 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1797 echo "$yyy=''" >> posthint.sh ;;
1802 echo "$yyy='$zzz'" >> posthint.sh ;;
1804 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1806 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1811 echo "$yyy=$zzz" >> posthint.sh ;;
1812 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1816 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1819 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1827 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1828 [-U symbol] [-U symbol=] [-A command:symbol...]
1829 -d : use defaults for all answers.
1830 -e : go on without questioning past the production of config.sh.
1831 -f : specify an alternate default configuration file.
1832 -h : print this help message and exit (with an error status).
1833 -r : reuse C symbols value if possible (skips costly nm extraction).
1834 -s : silent mode, only echoes questions and essential information.
1835 -D : define symbol to have some value:
1836 -D symbol symbol gets the value 'define'
1837 -D symbol=value symbol gets the value 'value'
1838 common used examples (see INSTALL for more info):
1839 -Duse64bitint use 64bit integers
1840 -Duse64bitall use 64bit integers and pointers
1841 -Dusethreads use thread support
1842 -Dinc_version_list=none do not include older perl trees in @INC
1843 -DEBUGGING=none DEBUGGING options
1844 -Dcc=gcc choose your compiler
1845 -Dprefix=/opt/perl5 choose your destination
1846 -E : stop at the end of questions, after having produced config.sh.
1847 -K : do not use unless you know what you are doing.
1848 -O : ignored for backward compatibility
1849 -S : perform variable substitutions on all .SH files (can mix with -f)
1850 -U : undefine symbol:
1851 -U symbol symbol gets the value 'undef'
1852 -U symbol= symbol gets completely empty
1854 -A : manipulate symbol after the platform specific hints have been applied:
1855 -A append:symbol=value append value to symbol
1856 -A symbol=value like append:, but with a separating space
1857 -A define:symbol=value define symbol to have value
1858 -A clear:symbol define symbol to be ''
1859 -A define:symbol define symbol to be 'define'
1860 -A eval:symbol=value define symbol to be eval of value
1861 -A prepend:symbol=value prepend value to symbol
1862 -A undef:symbol define symbol to be 'undef'
1863 -A undef:symbol= define symbol to be ''
1864 e.g.: -A prepend:libswanted='cl pthread '
1865 -A ccflags=-DSOME_MACRO
1866 -V : print version number and exit (with a zero status).
1873 case "$fastread$alldone" in
1876 case "$extractsh" in
1879 if test ! -t 0; then
1880 echo "Say 'sh Configure', not 'sh <Configure'"
1890 true) exec 1>/dev/null;;
1893 : run the defines and the undefines, if any, but leave the file out there...
1895 grep '\\' optdef.sh >/dev/null 2>&1
1896 if test $? = 0; then
1897 echo "Configure does not support \\ in -D arguments"
1901 : create the posthint manipulation script and leave the file out there...
1906 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1907 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1908 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1909 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1910 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1913 : Some greps do not return status, grrr.
1914 echo "grimblepritz" >grimble
1915 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1917 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1923 : the following should work in any shell
1927 echo "AGH! Grep doesn't return a status. Attempting remedial action." >&4
1928 cat >contains <<'EOSS'
1929 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1935 : Find the path to the source tree
1938 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1942 *) src=`cd ../$src && pwd` ;;
1955 if test -f $rsrc/Configure && \
1956 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1958 : found it, so we are ok.
1961 for src in . .. ../.. ../../.. ../../../..; do
1962 if test -f ../$src/Configure && \
1963 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1974 Sorry, I can't seem to locate the source dir for $package. Please start
1975 Configure with an explicit path -- i.e. /some/path/Configure.
1983 echo "Sources for $package found in \"$src\"." >&4
1987 : script used to extract .SH files with variable substitutions
1988 cat >extract <<'EOS'
1990 echo "Doing variable substitutions on .SH files..."
1991 if test -f MANIFEST; then
1992 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1994 echo "(Looking for .SH files under the source directory.)"
1995 set x `(cd "$src"; find . -name "*.SH" -print)`
1999 0) set x `(cd "$src"; echo *.SH)`; shift;;
2001 if test ! -f "$src/$1"; then
2007 while test $name; do
2008 if test ! -d "$name"; then
2009 create="$name $create";
2010 name=`echo $name | sed -e "s|^[^/]*$||"`;
2011 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2016 for file in $create; do
2025 dir=`expr X$file : 'X\(.*\)/'`
2026 file=`expr X$file : 'X.*/\(.*\)'`
2027 (cd "$dir" && . ./$file)
2037 dir=`expr X$file : 'X\(.*\)/'`
2038 file=`expr X$file : 'X.*/\(.*\)'`
2039 (set x $dir; shift; eval $mkdir_p)
2040 sh <"$src/$dir/$file"
2049 if test -f "$src/config_h.SH"; then
2050 if test ! -f config.h; then
2051 : oops, they left it out of MANIFEST, probably, so do it anyway.
2052 . "$src/config_h.SH"
2057 : extract files and exit if asked to do so
2058 case "$extractsh" in
2060 case "$realsilent" in
2064 case "$config_sh" in
2065 '') config_sh='config.sh';;
2068 echo "Fetching answers from $config_sh..."
2075 echo "Extraction done."
2080 : Eunice requires " " instead of "", can you believe it
2083 echo "Beginning of configuration questions for $package."
2085 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2087 : first determine how to suppress newline on echo command
2089 echo "Checking echo to see how to suppress newlines..."
2090 (echo "hi there\c" ; echo " ") >.echotmp
2091 if $contains c .echotmp >/dev/null 2>&1 ; then
2102 echo $n "The star should be here-->$c"
2106 : Now test for existence of everything in MANIFEST
2108 if test -f "$rsrc/MANIFEST"; then
2109 echo "First let's make sure your kit is complete. Checking..." >&4
2110 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2111 (split -l 50 2>/dev/null || split -50)
2114 for filelist in x??; do
2115 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2116 >/dev/null 2>>"$tmppwd/missing")
2118 if test -s missing; then
2122 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2124 You have the option of continuing the configuration process, despite the
2125 distinct possibility that your kit is damaged, by typing 'y'es. If you
2126 do, don't blame me if something goes wrong. I advise you to type 'n'o
2127 and contact the author (https://github.com/Perl/perl5/issues).
2130 echo $n "Continue? [n] $c" >&4
2134 echo "Continuing..." >&4
2138 echo "ABORTING..." >&4
2143 echo "Looks good..."
2146 echo "There is no MANIFEST file. I hope your kit is complete !"
2150 : Find the appropriate value for a newline for tr
2151 if test -n "$DJGPP"; then
2154 if test X"$trnl" = X; then
2155 case "`echo foo | tr '\n' x 2>/dev/null`" in
2159 if test X"$trnl" = X; then
2160 case "`echo foo | tr '\012' x 2>/dev/null`" in
2161 foox) trnl='\012' ;;
2164 if test X"$trnl" = X; then
2165 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2166 fooxy) trnl='\n\r' ;;
2169 if test X"$trnl" = X; then
2172 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2178 : compute the number of columns on the terminal for proper question formatting
2183 : set up the echo used in my read
2184 myecho="case \"\$xxxm\" in
2185 '') echo $n \"\$rp $c\" >&4;;
2187 '') echo $n \"[\$xxxm] $c\";;
2189 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2191 echo $n \"[\$xxxm] $c\" >&4
2193 echo $n \"\$rp [\$xxxm] $c\" >&4
2199 : now set up to do reads with possible shell escape and default assignment
2205 case "\$fastread" in
2206 yes) case "\$dflt" in
2209 case "\$silent-\$rp" in
2214 *) case "\$silent" in
2215 true) case "\$rp" in
2220 while expr "X\$ans" : "X!" >/dev/null; do
2224 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2232 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2241 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2246 echo "(OK, I'll run with -d after this question.)" >&4
2249 echo "*** Sorry, \$1 not supported yet." >&4
2259 echo "*** Substitution done -- please confirm."
2261 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2266 echo "*** Error -- try again."
2273 case "\$ans\$xxxm\$nostick" in
2285 : create .config dir to save info across Configure sessions
2286 test -d ../.config || mkdir ../.config
2287 cat >../.config/README <<EOF
2288 This directory created by Configure to save information that should
2289 persist across sessions for $package.
2291 You may safely delete it if you wish.
2294 : See if we are using a devel version and want that
2295 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2298 usedevel="$define" ;;
2299 *) case "$xversion" in
2302 *** WHOA THERE!!! ***
2304 This is an UNSTABLE DEVELOPMENT release.
2305 The version of this $package distribution is $xversion, that is, odd,
2306 (as opposed to even) and that signifies a development release.
2307 If you want a maintenance release, you want an even-numbered version.
2309 Do ***NOT*** install this into production use.
2310 Data corruption and crashes are possible.
2312 It is most seriously suggested that you do not continue any further
2313 unless you want to help in developing and debugging Perl.
2315 If you *still* want to build perl, you can answer 'y' now,
2316 or pass -Dusedevel to Configure.
2319 rp='Do you really want to continue?'
2323 [yY]) echo >&4 "Okay, continuing."
2324 usedevel="$define" ;;
2325 *) echo >&4 "Okay, bye."
2336 case "$versiononly" in
2337 '') versiononly="$define" ;;
2339 case "$installusrbinperl" in
2340 '') installusrbinperl="$undef" ;;
2345 : general instructions
2348 user=`(logname) 2>/dev/null`
2350 '') user=`whoami 2>&1`;;
2352 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2355 rp='Would you like to see the instructions?'
2366 This installation shell script will examine your system and ask you questions
2367 to determine how the perl5 package should be installed. If you get
2368 stuck on a question, you may use a ! shell escape to start a subshell or
2369 execute a command. Many of the questions will have default answers in square
2370 brackets; typing carriage return will give you the default.
2372 On some of the questions which ask for file or directory names you are allowed
2373 to use the ~name construct to specify the login directory belonging to "name",
2374 even if you don't have a shell which knows about that. Questions where this is
2375 allowed will be marked "(~name ok)".
2379 dflt='Type carriage return to continue'
2383 The prompter used in this script allows you to use shell variables and
2384 backticks in your answers. You may use $1, $2, etc... to refer to the words
2385 in the default answer, as if the default line was a set of arguments given to a
2386 script shell. This means you may also use $* to repeat the whole default line,
2387 so you do not have to re-type everything to add something to the default.
2389 Every time there is a substitution, you will have to confirm. If there is an
2390 error (e.g. an unmatched backtick), the default answer will remain unchanged
2391 and you will be prompted again.
2393 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2394 the questions and use the computed defaults (or the previous answers if there
2395 was already a config.sh file). Type 'Configure -h' for a list of options.
2396 You may also start interactively and then answer '& -d' at any prompt to turn
2397 on the non-interactive behaviour for the remainder of the execution.
2403 Much effort has been expended to ensure that this shell script will run on any
2404 Unix system. If despite that it blows up on yours, your best bet is to edit
2405 Configure and run it again. If you can't run Configure for some reason,
2406 you'll have to generate a config.sh file by hand. Whatever problems you
2407 have, let me (https://github.com/Perl/perl5/issues) know how I blew it.
2409 This installation script affects things in two ways:
2411 1) it may do direct variable substitutions on some of the files included
2413 2) it builds a config.h file for inclusion in C programs. You may edit
2414 any of these files as the need arises after running this script.
2416 If you make a mistake on a question, there is no easy way to back up to it
2417 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2418 files. Configure will offer to let you do this before it runs the SH files.
2421 dflt='Type carriage return to continue'
2423 case "$firsttime" in
2424 true) echo $user >>../.config/instruct;;
2428 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2429 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2430 if test "X$sysroot" = X; then
2435 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2436 # _sysroot is used in places where we need --sysroot=foo
2437 # but using the rest of the flags could cause issues.
2438 _sysroot="--sysroot=$sysroot";
2442 ccflags="$ccflags $_sysroot"
2447 ldflags="$ldflags $_sysroot"
2452 cppflags="$cppflags $_sysroot"
2454 # lddlflags updated below in lddlflags section;
2455 # same with cccdlflags
2459 # Adjust some defaults to also use $sysroot
2460 for var in xlibpth loclibpth locincpth glibpth; do
2463 for path in $xxx; do
2464 eval $var=\"\$$var $sysroot$path\"
2470 : find out where common programs are
2472 echo "Locating common programs..." >&4
2485 if test -d \$dir/\$thing; then
2491 for thisthing in \$dir/\$thing; do
2492 : just loop through to pick last item
2494 if test -f \$thisthing; then
2497 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2500 elif test -f \$dir/\$thing.exe; then
2501 if test -n "$DJGPP"; then
2502 echo \$dir/\$thing.exe
2503 elif test "$eunicefix" != ":"; then
2504 : on Eunice apparently
2557 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2558 pth="$pth $sysroot/lib $sysroot/usr/lib"
2559 for file in $loclist; do
2563 if test -f "$xxx"; then
2566 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2567 xxx=`./loc $file $file $pth`
2570 '') xxx=`./loc $file $file $pth`;;
2571 *) xxx=`./loc $xxx $xxx $pth`;;
2573 eval $file=$xxx$_exe
2577 echo $file is in $xxx.
2580 echo $file is in $xxx.
2583 echo "I don't know where '$file' is, and my life depends on it." >&4
2584 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2590 echo "Don't worry if any of the following aren't found..."
2592 for file in $trylist; do
2596 if test -f "$xxx"; then
2599 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2600 xxx=`./loc $file $file $pth`
2603 '') xxx=`./loc $file $file $pth`;;
2604 *) xxx=`./loc $xxx $xxx $pth`;;
2606 eval $file=$xxx$_exe
2610 echo $file is in $xxx.
2613 echo $file is in $xxx.
2616 echo "I don't see $file out there, $say."
2623 echo "Substituting grep for egrep."
2630 *) if $less -R </dev/null >/dev/null 2>&1; then
2631 echo "Substituting less -R for less."
2639 echo "Substituting cp for ln."
2648 echo "I can't find make or gmake, and my life depends on it." >&4
2649 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2657 *) # We can't have osname yet.
2658 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2659 # Assume that gmake, if found, is definitely GNU make
2660 # and prefer it over the system make.
2661 echo "Substituting gmake for make."
2669 echo "Hopefully test is built into your sh."
2672 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2673 echo "Using the test built into your sh."
2681 echo "Hopefully echo is built into your sh."
2686 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2687 $echo $n "hi there$c" >foo1
2688 echo $n "hi there$c" >foo2
2689 if cmp foo1 foo2 >/dev/null 2>&1; then
2690 echo "They are compatible. In fact, they may be identical."
2697 They are not compatible! You are probably running ksh on a non-USG system.
2698 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2699 have echo built in and we may have to run some Bourne shell scripts. That
2700 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2703 $echo $n "The star should be here-->$c"
2710 # This question was auctioned at YAPC::Europe-2007 in Vienna
2711 # I never promised you could answer it. I only auctioned the question.
2713 The following message is sponsored by
2715 Dresden.pm<--The stars should be here.
2717 Dear Perl user, system administrator or package
2718 maintainer, the Perl community sends greetings to
2719 you. Do you (emblematical) greet back [Y/n]? n
2723 : Check what type of C compiler we use
2727 cat <<'EOSC' >>trygcc
2732 int main(int argc, char *argv[]) {
2736 if $cc -o try $ccflags $ldflags try.c; then
2739 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2745 # Skip this test because it gives a false match on output like:
2746 # ./trygcc: line 23: cc: command not found
2747 # case "`$cc -v -c try.c 2>&1`" in
2748 # *gcc*) trygcc=no ;;
2750 if $test X"$trygcc" = Xyes; then
2751 if gcc -o try -c try.c; then
2753 echo "You seem to have a working gcc, though." >&4
2754 # Switching compilers may undo the work of hints files.
2755 # The most common problem is -D_REENTRANT for threads.
2756 # This heuristic catches that case, but gets false positives
2757 # if -Dusethreads was not actually specified. Better to
2758 # bail out here with a useful message than fail
2759 # mysteriously later. Should we perhaps just try to
2760 # re-invoke Configure -Dcc=gcc config_args ?
2761 if $test -f usethreads.cbu; then
2764 *** However, any setting of the C compiler flags (e.g. for thread support)
2765 *** will be lost. It may be necessary for you to restart Configure and
2766 *** add -Dcc=gcc to your Configure command line.
2769 rp="Would you like to go ahead and try gcc anyway?"
2772 rp="Would you like to use it?"
2775 if $test -f myread; then
2778 if $test -f UU/myread; then
2781 echo "Cannot find myread, sorry. Aborting." >&2
2786 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2799 cat <<'EOSC' >>checkcc
2804 int main(int argc, char *argv[]) {
2808 if $cc -o try $ccflags $ldflags try.c; then
2811 if $test X"$despair" = Xyes; then
2812 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2815 You need to find a working C compiler.
2816 Either (purchase and) install the C compiler supplied by your OS vendor,
2817 or for a free C compiler try http://gcc.gnu.org/
2818 I cannot continue any further, aborting.
2827 : determine whether symbolic links are supported
2830 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2831 echo "Symbolic links are supported." >&4
2834 echo "Symbolic links are NOT supported." >&4
2839 : determine whether symbolic links are supported
2843 echo "Checking how to test for symbolic links..." >&4
2845 if $test "X$issymlink" = X; then
2847 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2848 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2850 if test $? = 0; then
2853 echo "Your builtin 'test -h' may be broken." >&4
2856 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2859 if test -f "$p/$test"; then
2868 echo "Trying external '$test -h'." >&4
2869 issymlink="$test -h"
2870 if $test ! -h sym >/dev/null 2>&1; then
2871 echo "External '$test -h' is broken, too." >&4
2879 if $test "X$issymlink" = X; then
2880 if $test -L sym 2>/dev/null; then
2881 issymlink="$test -L"
2882 echo "The builtin '$test -L' worked." >&4
2885 if $test "X$issymlink" != X; then
2886 echo "You can test for symbolic links with '$issymlink'." >&4
2888 echo "I do not know how you can test for symbolic links." >&4
2892 *) echo "No symbolic links, so not testing for their testing..." >&4
2896 : Make symlinks util
2897 case "$mksymlinks" in
2900 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2903 *) case "$lns:$issymlink" in
2904 *"ln"*" -s:"*"test -"?)
2905 echo "Creating the symbolic links..." >&4
2907 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2917 print "# dir = ", dir, "file = ", file
2918 mf[dir] = mf[dir]" "source"/"dir"/"file;
2921 if (d != ".") { print("mkdir -p "d) }
2922 print("ln -sf "mf[d]" "d);
2924 }' source="$src" > UU/mksymlinks.$$
2928 if test ! -d t/base; then
2929 echo "Failed to create the subdirectories. Aborting." >&4
2933 if test ! -f t/base/lex.t; then
2934 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2937 if test ! -f win32/win32.c; then
2938 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2943 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2951 : Check for Cross-Compilation
2952 if $test "X$targethost" = "X"; then
2955 if $test "X$targetenv" = "X"; then
2958 case "$usecrosscompile" in
2960 $echo "Cross-compiling..."
2963 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2964 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2965 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2966 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2967 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2968 # leave out ld, choosing it is more complex
2969 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2970 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2971 # We are in a weird spot. Just before us, some values
2972 # were 'saved', to be restored after the hints are
2973 # run. This means that the changes we made to ar,
2974 # nm and ranlib will get reverted.
2975 # To avoid that, we hijack the saving mechanism and
2976 # have it save our new values.
2977 for file in ar nm ranlib; do
2979 eval $file=$xxx$_exe
2984 case "$targetarch" in
2985 '') echo "Targetarch not defined." >&4; croak=y ;;
2986 *) echo "Using targetarch $targetarch." >&4 ;;
2988 case "$targethost" in
2989 '') echo "Targethost not defined." >&4; croak=n ;;
2990 *) echo "Using targethost $targethost." >&4
2995 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2997 : compile a host miniperl and generate_uudmap, unless we got passed them
2998 if $test "X$hostperl" = X; then
2999 echo "Building host miniperl and generate_uudmap binaries" >&4
3007 $src/Configure -des -Dusedevel -Dmksymlinks
3009 case "$hostgenerate" in
3010 '') $make generate_uudmap
3011 hostgenerate=$src/host/generate_uudmap
3013 "$undef") hostgenerate=''
3016 hostperl=$src/host/miniperl
3019 hostosname=`$hostperl -le 'print $^O'`
3022 usecrosscompile="$undef"
3026 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3027 case "$targethost" in
3028 '') echo "Checking for cross-compile" >&4
3029 case "$usecrosscompile$multiarch" in
3030 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3031 if [ -f Makefile ]; then
3033 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3035 echo "Configure done."
3039 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3046 *) echo "Using targethost $targethost." >&4
3048 /*) run=$src/Cross/run
3049 targetmkdir=$src/Cross/mkdir
3051 from=$src/Cross/from
3053 *) pwd=`$test -f ../Configure & cd ..; pwd`
3055 targetmkdir=$pwd/Cross/mkdir
3057 from=$pwd/Cross/from
3060 case "$targetrun" in
3061 '') targetrun=ssh ;;
3066 case "$targetfrom" in
3067 '') targetfrom=scp ;;
3071 from=$from-$targetfrom
3072 case "$targetdir" in
3074 echo "Guessing targetdir $targetdir." >&4
3077 case "$targetuser" in
3079 echo "Guessing targetuser $targetuser." >&4
3082 case "$targetport" in
3084 echo "Guessing targetport $targetport." >&4
3087 case "$targetfrom" in
3091 case "$targetrun" in
3111 '') cwd=$targetdir ;;
3116 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3122 *) echo "Unknown targetrun '$targetrun'" >&4
3126 case "$targetmkdir" in
3128 cat >$targetmkdir <<EOF
3130 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3132 $chmod a+rx $targetmkdir
3134 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3146 $targetmkdir \`dirname \$f\`
3147 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3150 $targetmkdir $targetdir/\`dirname \$f\`
3151 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3164 $mkdir -p $targetdir/\`dirname \$f\`
3165 $cp \$f $targetdir/\$f || exit 1
3168 $targetmkdir $targetdir/\`dirname \$f\`
3169 $cp \$f $targetdir/\$f || exit 1
3176 *) echo "Unknown targetto '$targetto'" >&4
3180 case "$targetfrom" in
3187 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3192 cp) cat >$from <<EOF
3197 cp $targetdir/\$f . || exit 1
3202 *) echo "Unknown targetfrom '$targetfrom'" >&4
3206 if $test ! -f $run; then
3207 echo "Target 'run' script '$run' not found." >&4
3211 if $test ! -f $to; then
3212 echo "Target 'to' script '$to' not found." >&4
3216 if $test ! -f $from; then
3217 echo "Target 'from' script '$from' not found." >&4
3221 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3225 Using '$run' for remote execution,
3226 and '$from' and '$to'
3227 for remote file transfer.
3233 usecrosscompile="$undef"
3238 : see whether [:lower:] and [:upper:] are supported character classes
3240 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3242 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3246 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3247 # (0xd9 and 0xe2), therefore that is a nice testing point.
3248 if test "X$up" = X -o "X$low" = X; then
3249 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3255 if test "X$up" = X -o "X$low" = X; then
3256 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3262 if test "X$up" = X -o "X$low" = X; then
3263 case "`echo RS | od -x 2>/dev/null`" in
3265 echo "Hey, this might be EBCDIC." >&4
3266 if test "X$up" = X -o "X$low" = X; then
3267 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3268 rs) up='[A-IJ-RS-Z]'
3273 if test "X$up" = X -o "X$low" = X; then
3274 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3284 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3286 echo "Using $up and $low to convert case." >&4
3289 echo "I don't know how to translate letters from upper to lower case." >&4
3290 echo "Your tr is not acting any way I know of." >&4
3294 : set up the translation script tr, must be called with ./tr of course
3298 '[A-Z][a-z]') exec $tr '$up' '$low';;
3299 '[a-z][A-Z]') exec $tr '$low' '$up';;
3306 : Try to determine whether config.sh was made on this system
3307 case "$config_sh" in
3309 myuname=`$uname -a 2>/dev/null`
3310 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3311 # Downcase everything to avoid ambiguity.
3312 # Remove slashes and single quotes so we can use parts of this in
3313 # directory and file names.
3314 # Remove newlines so myuname is sane to use elsewhere.
3315 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3316 # because the A-Z/a-z are not consecutive.
3317 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3318 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3319 newmyuname="$myuname"
3321 case "$knowitall" in
3323 if test -f ../config.sh; then
3324 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3325 eval "`grep myuname= ../config.sh`"
3327 if test "X$myuname" = "X$newmyuname"; then
3335 : Get old answers from old config file if Configure was run on the
3336 : same system, otherwise use the hints.
3339 if test -f config.sh; then
3341 rp="I see a config.sh file. Shall I use it to set the defaults?"
3344 n*|N*) echo "OK, I'll ignore it."
3345 mv config.sh config.sh.old
3346 myuname="$newmyuname"
3348 *) echo "Fetching default answers from your old config.sh file..." >&4
3356 : Older versions did not always set $sh. Catch re-use of such
3366 if test ! -f config.sh; then
3369 First time through, eh? I have some defaults handy for some systems
3370 that need some extra help getting the Configure answers right:
3373 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3375 : Half the following guesses are probably wrong... If you have better
3376 : tests or hints, please send them to https://github.com/Perl/perl5/issues
3377 : The metaconfig authors would also appreciate a copy...
3378 $test -f /irix && osname=irix
3379 $test -f /xenix && osname=sco_xenix
3380 $test -f /dynix && osname=dynix
3381 $test -f /dnix && osname=dnix
3382 $test -f /lynx.os && osname=lynxos
3383 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3384 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3385 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3386 $test -f /bin/mips && /bin/mips && osname=mips
3387 $test -d /usr/apollo/bin && osname=apollo
3388 $test -f /etc/saf/_sactab && osname=svr4
3389 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3390 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3391 $test -f /sys/utilities/MultiView && osname=amigaos
3392 if $test -d /MachTen -o -d /MachTen_Folder; then
3394 if $test -x /sbin/version; then
3395 osvers=`/sbin/version | $awk '{print $2}' |
3396 $sed -e 's/[A-Za-z]$//'`
3397 elif $test -x /usr/etc/version; then
3398 osvers=`/usr/etc/version | $awk '{print $2}' |
3399 $sed -e 's/[A-Za-z]$//'`
3405 $test -f /sys/posix.dll &&
3406 $test -f /usr/bin/what &&
3407 set X `/usr/bin/what /sys/posix.dll` &&
3408 $test "$3" = UWIN &&
3412 if $test -f $uname; then
3420 umips) osname=umips ;;
3423 [23]100) osname=mips ;;
3425 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3426 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3429 elif $test -f /etc/kconfig; then
3431 if test "$lns" = "$ln -s"; then
3433 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3435 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3442 if test -n "$DJGPP"; then
3451 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3453 # oslevel can fail with:
3454 # oslevel: Unable to acquire lock.
3455 *not\ found) osvers="$4"."$3" ;;
3456 '<3240'|'<>3240') osvers=3.2.0 ;;
3457 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3458 '=3250'|'>3250') osvers=3.2.5 ;;
3462 bitrig) osname=bitrig
3465 bsd386) osname=bsd386
3468 cygwin*) osname=cygwin
3471 *dc.osx) osname=dcosx
3477 domainos) osname=apollo
3483 dragonfly) osname=dragonfly
3486 dynixptx*) osname=dynixptx
3487 osvers=`echo "$4"|sed 's/^v//'`
3489 freebsd) osname=freebsd
3491 genix) osname=genix ;;
3495 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3508 $test -f /system/lib/libandroid.so && osname=linux-android
3515 netbsd*) osname=netbsd
3518 news-os) osvers="$3"
3520 4*) osname=newsos4 ;;
3524 nonstop-ux) osname=nonstopux ;;
3525 openbsd) osname=openbsd
3531 POSIX-BC | posix-bc ) osname=posix-bc
3534 powerux | power_ux | powermax_os | powermaxos | \
3535 powerunix | power_unix) osname=powerux
3541 solaris) osname=solaris
3543 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3550 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3554 titanos) osname=titanos
3563 ultrix) osname=ultrix
3566 osf1|mls+) case "$5" in
3569 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3572 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3575 hp*) osname=hp_osf1 ;;
3576 mips) osname=mips_osf1 ;;
3579 # UnixWare 7.1.2 is known as Open UNIX 8
3580 openunix|unixware) osname=svr5
3588 $2) case "$osname" in
3592 : svr4.x or possibly later
3602 if test -f /stand/boot ; then
3603 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3604 if test -n "$INITPROG" -a -f "$INITPROG"; then
3605 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3606 if test -n "$isesix"; then
3614 *) if test -f /etc/systemid; then
3616 set `echo $3 | $sed 's/\./ /g'` $4
3617 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3619 elif $test -f $src/hints/sco_$1_$2.sh; then
3621 elif $test -f $src/hints/sco_$1.sh; then
3626 '') : Still unknown. Probably a generic Sys V.
3635 *) case "$osname" in
3636 '') : Still unknown. Probably a generic BSD.
3644 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3645 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3646 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3649 $rm -f UU/kernel.what
3650 elif test -d c:/. -o -n "$is_os2" ; then
3657 case "$targetarch" in
3660 case "$targetarch" in
3662 # Will load qnx.sh, which should change osname to nto
3667 # Catch arm-linux-androideabi, mipsel-linux-android,
3668 # and i686-linux-android
3669 osname=linux-android
3673 # Something like arm-linux-gnueabihf is really just
3680 # XXX perhaps we should just assume
3681 # osvers to be 2, or maybe take the value
3682 # from targetarch. Using $run before the
3683 # hints are run is somewhat icky.
3684 set X `$run $uname -a 2>/dev/null`
3687 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3692 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3699 : Now look for a hint file osname_osvers, unless one has been
3700 : specified already.
3703 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3704 : Also try without trailing minor version numbers.
3705 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3706 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3707 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3708 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3711 *) case "$osvers" in
3714 *) if $test -f $src/hints/$file.sh ; then
3716 elif $test -f $src/hints/$xfile.sh ; then
3718 elif $test -f $src/hints/$xxfile.sh ; then
3720 elif $test -f $src/hints/$xxxfile.sh ; then
3722 elif $test -f $src/hints/$xxxxfile.sh ; then
3724 elif $test -f "$src/hints/${osname}.sh" ; then
3733 if $test -f Policy.sh ; then
3736 none) dflt="Policy" ;;
3737 *) dflt="Policy $dflt" ;;
3742 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3746 if $test -f Policy.sh ; then
3749 There's also a Policy hint file available, which should make the
3750 site-specific (policy) questions easier to answer.
3757 You may give one or more space-separated answers, or "none" if appropriate.
3758 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3759 previous run of Configure, you may specify it as well as or instead of
3760 OS-specific hints. If hints are provided for your OS, you should use them:
3761 although Perl can probably be built without hints on many platforms, using
3762 hints often improve performance and may enable features that Configure can't
3763 set up on its own. If there are no hints that match your OS, specify "none";
3764 DO NOT give a wrong version or a wrong OS.
3768 rp="Which of these apply, if any?"
3771 for file in $tans; do
3772 if $test X$file = XPolicy -a -f Policy.sh; then
3774 $cat Policy.sh >> UU/config.sh
3775 elif $test -f $src/hints/$file.sh; then
3776 . $src/hints/$file.sh
3777 $cat $src/hints/$file.sh >> UU/config.sh
3778 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3781 : Give one chance to correct a possible typo.
3782 echo "$file.sh does not exist"
3784 rp="hint to use instead?"
3786 for file in $ans; do
3787 if $test -f "$src/hints/$file.sh"; then
3788 . $src/hints/$file.sh
3789 $cat $src/hints/$file.sh >> UU/config.sh
3790 elif $test X$ans = X -o X$ans = Xnone ; then
3793 echo "$file.sh does not exist -- ignored."
3800 : Remember our hint file for later.
3801 if $test -f "$src/hints/$file.sh" ; then
3811 echo "Fetching default answers from $config_sh..." >&4
3815 cp $config_sh config.sh 2>/dev/null
3827 : Restore computed paths
3828 for file in $loclist $trylist; do
3829 eval $file="\$_$file"
3834 Configure uses the operating system name and version to set some defaults.
3835 The default value is probably right if the name rings a bell. Otherwise,
3836 since spelling matters for me, either accept the default or answer "none"
3843 ''|' '|none) dflt=none ;;
3844 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3847 *) dflt="$osname" ;;
3849 rp="Operating system name?"
3853 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3859 ''|' '|none) dflt=none ;;
3860 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3861 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3863 ''|' ') dflt=none ;;
3868 *) dflt="$osvers" ;;
3870 rp="Operating system version?"
3880 : who configured the system
3881 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3884 cf_by=`(logname) 2>/dev/null`
3887 cf_by=`(whoami) 2>/dev/null`
3889 "") cf_by=unknown ;;
3894 : decide how portable to be. Allow command line overrides.
3895 case "$d_portable" in
3897 *) d_portable="$define" ;;
3900 : set up shell script to do ~ expansion
3906 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3909 if $test -f /bin/csh; then
3910 /bin/csh -f -c "glob \$1"
3915 name=\`$expr x\$1 : '..\([^/]*\)'\`
3916 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3917 if $test ! -d "\$dir"; then
3919 echo "\$me: can't locate home directory for: \$name" >&2
3924 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3940 : now set up to get a file name
3944 cat <<'EOSC' >>getfile
3960 : getfile will accept an answer from the comma-separated list
3961 : enclosed in parentheses even if it does not meet other criteria.
3962 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3963 fn=`echo $fn | sed 's/(.*)//'`
3969 loc_file=`expr $fn : '.*:\(.*\)'`
3970 fn=`expr $fn : '\(.*\):.*'`
3978 */*) fullpath=true;;
3987 *e*) exp_file=true;;
3990 *p*) nopath_ok=true;;
3995 *d*) type='Directory';;
3996 *l*) type='Locate';;
4001 Locate) what='File';;
4006 case "$d_portable" in
4014 while test "$type"; do
4019 true) rp="$rp (~name ok)";;
4022 if test -f UU/getfile.ok && \
4023 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4042 value=`UU/filexp $ans`
4045 if test "$ans" != "$value"; then
4046 echo "(That expands to $value on this system.)"
4060 /*) value="$ansexp" ;;
4061 [a-zA-Z]:/*) value="$ansexp" ;;
4066 echo "I shall only accept a full path name, as in /bin/ls." >&4
4067 echo "Use a ! shell escape if you wish to check pathnames." >&4
4070 echo "Please give a full path name, starting with slash." >&4
4073 echo "Note that using ~name is ok provided it expands well." >&4
4086 for fp in $gfpth; do
4087 if test "X$fp" = X.; then
4092 if test -f "$pf"; then
4094 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4096 echo "($value is not a plain file, but that's ok.)"
4099 if test X"$type" = X; then
4106 for fp in $gfpth; do
4107 if test "X$fp" = X.; then
4112 direxp="$fp/$ansexp"
4114 if test -d "$direxp"; then
4122 if test -d "$ansexp"; then
4123 echo "(Looking for $loc_file in directory $value.)"
4124 value="$value/$loc_file"
4125 ansexp="$ansexp/$loc_file"
4127 if test -f "$ansexp"; then
4130 case "$nopath_ok" in
4131 true) case "$value" in
4133 *) echo "Assuming $value will be in people's path."
4149 if test "$fastread" = yes; then
4154 rp="$what $value doesn't exist. Use that name anyway?"
4173 test "X$gfpthkeep" != Xy && gfpth=""
4176 : determine root of directory hierarchy where package will be installed.
4178 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4185 By default, $package will be installed in $dflt/bin, manual pages
4186 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4187 installation directories. Typically this is something like /usr/local.
4188 If you wish to have binaries under /usr/bin but other parts of the
4189 installation under /usr/local, that's ok: you will be prompted
4190 separately for each of the installation directories, the prefix being
4191 only used to set the defaults.
4195 rp='Installation prefix to use?'
4202 *) oldprefix="$prefix";;
4208 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4214 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4216 *) prefixexp="$ansexp"
4219 : allow them to override the AFS root
4222 *) afsroot=$afsroot ;;
4228 $define|true) afs=true ;;
4229 $undef|false) afs=false ;;
4230 *) if $test -d $afsroot; then
4238 echo "AFS may be running... I'll be extra cautious then..." >&4
4240 echo "AFS does not seem to be running..." >&4
4243 : determine installation prefix for where package is to be installed.
4247 Since you are running AFS, I need to distinguish the directory in which
4248 files will reside from the directory in which they are installed (and from
4249 which they are presumably copied to the former directory by occult means).
4252 case "$installprefix" in
4253 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4254 *) dflt="$installprefix";;
4259 In some special cases, particularly when building $package for distribution,
4260 it is convenient to distinguish the directory in which files should be
4261 installed from the directory ($prefix) in which they will
4262 eventually reside. For most users, these two directories are the same.
4265 case "$installprefix" in
4267 *) dflt=$installprefix;;
4271 rp='What installation prefix should I use for installing files?'
4273 installprefix="$ans"
4274 installprefixexp="$ansexp"
4276 : Perform the prefixexp/installprefixexp correction if necessary
4277 cat <<EOS >installprefix
4280 cat <<'EOSC' >>installprefix
4281 : Change installation prefix, if necessary.
4282 if $test X"$prefix" != X"$installprefix"; then
4283 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4285 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4288 chmod +x installprefix
4289 $eunicefix installprefix
4291 : Set variables such as privlib and privlibexp from the output of ./getfile
4292 : performing the prefixexp/installprefixexp correction if necessary.
4293 cat <<EOS >setprefixvar
4296 cat <<'EOSC' >>setprefixvar
4297 eval "${prefixvar}=\"\$ans\""
4298 eval "${prefixvar}exp=\"\$ansexp\""
4301 chmod +x setprefixvar
4302 $eunicefix setprefixvar
4304 : set up the script used to warn in case of inconsistency
4313 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4315 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4316 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4321 echo "*** WHOA THERE!!! ***" >&4
4322 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4325 rp=" Keep the $hint value?"
4328 y) td=$was; tu=$was;;
4332 : function used to set '$1' to '$val'
4333 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4335 $define$undef) . ./whoa; eval "$var=\$td";;
4336 $undef$define) . ./whoa; eval "$var=\$tu";;
4337 *) eval "$var=$val";;
4340 : Do we want threads support and if so, what type
4341 case "$usethreads" in
4342 $define|true|[yY]*) dflt='y';;
4343 *) # Catch case where user specified ithreads but
4344 # forgot -Dusethreads (A.D. 4/2002)
4345 case "$useithreads" in
4346 *$define*) dflt='y';;
4353 Perl can be built to offer a form of threading support on some systems
4354 To do so, Configure can be run with -Dusethreads.
4356 Note that Perl built with threading support runs slightly slower
4357 and uses slightly more memory than plain Perl.
4359 If this doesn't make any sense to you, just accept the default '$dflt'.
4361 rp='Build a threading Perl?'
4364 y|Y) val="$define" ;;
4370 useithreads="$usethreads"
4372 case "$d_oldpthreads" in
4373 '') : Configure tests would be welcome here. For now, assume undef.
4375 *) val="$d_oldpthreads" ;;
4381 : Look for a hint-file generated 'call-back-unit'. If the
4382 : user has specified that a threading perl is to be built,
4383 : we may need to set or change some other defaults.
4384 if $test -f usethreads.cbu; then
4385 echo "Your platform has some specific hints regarding threaded builds, using them..."
4388 case "$usethreads" in
4389 "$define"|true|[yY]*)
4391 (Your platform does not have any specific hints for threaded builds.
4392 Assuming POSIX threads, then.)
4398 : Check if multiplicity is required
4401 Perl can be built so that multiple Perl interpreters can coexist
4402 within the same Perl executable.
4405 case "$useithreads" in
4408 This multiple interpreter support is required for interpreter-based threads.
4412 *) case "$usemultiplicity" in
4413 $define|true|[yY]*) dflt='y';;
4417 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4418 rp='Build Perl for multiplicity?'
4421 y|Y) val="$define" ;;
4429 : Check if morebits is requested
4430 case "$usemorebits" in
4431 "$define"|true|[yY]*)
4432 use64bitint="$define"
4433 uselongdouble="$define"
4434 usemorebits="$define"
4436 *) usemorebits="$undef"
4440 : Determine the C compiler to be used
4446 rp="Use which C compiler?"
4450 : See whether they have no cc but they do have gcc
4452 if $test -f cc.cbu; then
4457 : make some quick guesses about what we are up against
4459 $echo $n "Hmm... $c"
4469 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4470 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4472 echo "Looks kind of like an OSF/1 system, but we'll see..."
4474 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4475 xxx=`./loc addbib blurfl $pth`
4476 if $test -f $xxx; then
4477 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4481 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4482 echo "Looks kind of like an extended USG system, but we'll see..."
4484 echo "Looks kind of like a USG system, but we'll see..."
4488 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4489 echo "Looks kind of like a BSD system, but we'll see..."
4493 echo "Looks kind of like a Version 7 system, but we'll see..."
4496 case "$eunicefix" in
4499 There is, however, a strange, musty smell in the air that reminds me of
4500 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4504 : it so happens the Eunice I know will not run shell scripts in Unix format
4508 echo "Congratulations. You aren't running Eunice."
4512 : Detect OS2. The p_ variable is set above in the Head.U unit.
4513 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4514 : semicolon as a patch separator
4519 I have the feeling something is not exactly right, however...don't tell me...
4520 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4521 (Or you may be running DOS with DJGPP.)
4526 if test -f /xenix; then
4527 echo "Actually, this looks more like a XENIX system..."
4532 echo "It's not Xenix..."
4537 if test -f /venix; then
4538 echo "Actually, this looks more like a VENIX system..."
4545 echo "Nor is it Venix..."
4548 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4549 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4552 : Check if we are using GNU gcc and what its version is
4554 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4558 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4560 printf("%s\n", __VERSION__);
4562 printf("%s\n", "1");
4568 if $cc -o try $ccflags $ldflags try.c; then
4569 gccversion=`$run ./try`
4570 case "$gccversion" in
4571 '') echo "You are not using GNU cc." ;;
4572 *) echo "You are using GNU cc $gccversion."
4578 echo "*** WHOA THERE!!! ***" >&4
4579 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4580 case "$knowitall" in
4582 echo " You'd better start hunting for one and let me know about it." >&4
4588 case "$gccversion" in
4589 1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4591 case "$gccversion" in
4592 '') gccosandvers='' ;;
4593 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4594 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4596 case "$gccosandvers" in
4597 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4598 $osname$osvers) ;; # looking good
4599 $osname*) cat <<EOM >&4
4601 *** WHOA THERE!!! ***
4603 Your gcc has not been compiled for the exact release of
4604 your operating system ($gccosandvers versus $osname$osvers).
4606 In general it is a good idea to keep gcc synchronized with
4607 the operating system because otherwise serious problems
4608 may ensue when trying to compile software, like Perl.
4610 I'm trying to be optimistic here, though, and will continue.
4611 If later during the configuration and build icky compilation
4612 problems appear (headerfile conflicts being the most common
4613 manifestation), I suggest reinstalling the gcc to match
4614 your operating system release.
4618 *) gccosandvers='' ;; # failed to parse, better be silent
4626 # gcc 3.* complain about adding -Idirectories that they already know about,
4627 # so we will take those off from locincpth.
4628 case "$gccversion" in
4630 echo "main(){}">try.c
4631 for incdir in $locincpth; do
4632 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4633 grep '^c[cp]p*[01]: warning: changing search order '`
4634 if test "X$warn" != X; then
4635 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4641 # gcc 4.9 by default does some optimizations that break perl.
4642 # see ticket 121505.
4644 # The -fwrapv disables those optimizations (and probably others,) so
4645 # for gcc 4.9 (and later, since the optimizations probably won't go
4646 # away), add -fwrapv unless the user requests -fno-wrapv, which
4647 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4648 # which turns the overflows -fwrapv ignores into runtime errors.
4649 case "$gccversion" in
4650 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4652 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4653 *) ccflags="$ccflags -fwrapv" ;;
4657 : What should the include directory be ?
4658 : Use sysroot if set, so findhdr looks in the right place.
4660 $echo $n "Hmm... $c"
4661 dflt="$sysroot/usr/include"
4664 if $test -f /bin/mips && /bin/mips; then
4665 echo "Looks like a MIPS system..."
4666 $cat >usr.c <<'EOCP'
4667 #ifdef SYSTYPE_BSD43
4671 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4672 dflt='/bsd43/usr/include'
4676 mips_type='System V'
4678 $rm -f usr.c usr.out
4679 echo "and you're compiling with the $mips_type compiler and libraries."
4683 echo "Doesn't look like a MIPS system."
4693 case "$xxx_prompt" in
4696 rp='Where are the include files you want to use?'
4704 : see how we invoke the C preprocessor
4706 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4707 cat <<'EOT' >testcpp.c
4713 if test ! -f cppstdin; then
4714 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4715 # AIX cc -E doesn't show the absolute headerfile
4716 # locations but we'll cheat by using the -M flag.
4717 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
4719 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4722 echo "Keeping your $hint cppstdin wrapper."
4725 wrapper=`pwd`/cppstdin
4729 if $test "X$cppstdin" != "X" && \
4730 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4731 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4733 echo "You used to use $cppstdin $cppminus so we'll use that again."
4735 '') echo "But let's see if we can live without a wrapper..." ;;
4737 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4738 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4740 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4743 echo "(However, $cpprun $cpplast does not work, let's see...)"
4751 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4758 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4759 $cc -E <testcpp.c >testcpp.out 2>&1; \
4760 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4761 echo "Yup, it does."
4762 x_cpp="$cc $cppflags -E"
4764 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4765 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4766 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4767 echo "Yup, it does."
4768 x_cpp="$cc $cppflags -E"
4770 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4771 $cc -P <testcpp.c >testcpp.out 2>&1; \
4772 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4773 echo "Yipee, that works!"
4774 x_cpp="$cc $cppflags -P"
4776 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4777 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4778 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4779 echo "At long last!"
4780 x_cpp="$cc $cppflags -P"
4782 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4783 $cpp <testcpp.c >testcpp.out 2>&1; \
4784 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4786 x_cpp="$cpp $cppflags"
4788 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4789 $cpp - <testcpp.c >testcpp.out 2>&1; \
4790 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4791 echo "Hooray, it works! I was beginning to wonder."
4792 x_cpp="$cpp $cppflags"
4794 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4795 $wrapper <testcpp.c >testcpp.out 2>&1; \
4796 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4802 rp="No dice. I can't find a C preprocessor. Name one:"
4806 $x_cpp <testcpp.c >testcpp.out 2>&1
4807 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4808 echo "OK, that will do." >&4
4810 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4825 echo "Perhaps can we force $cc -E using a wrapper..."
4826 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4827 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4833 echo "Nope, we'll have to live without it..."
4847 "$wrapper"|'cppstdin') ;;
4848 *) $rm -f $wrapper;;
4850 $rm -f testcpp.c testcpp.out
4852 : Adjust cppfilter for path component separator
4854 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4855 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4859 : Use gcc to determine libpth and incpth
4860 # If using gcc or clang, we can get better values for libpth, incpth
4861 # and usrinc directly from the compiler.
4862 # Note that ccname for clang is also gcc.
4865 $echo 'extern int foo;' > try.c
4866 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4868 if $test $# -gt 0; then
4870 incpth="`$echo $incpth|$sed 's/^ //'`"
4872 j="`$echo $i|$sed 's,/include$,/lib,'`"
4873 if $test -d $j; then
4877 libpth="`$echo $libpth|$sed 's/^ //'`"
4878 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4879 if $test -d $xxx; then
4882 *) libpth="$libpth $xxx";;
4889 '') for i in $incpth; do
4890 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4898 case "$usecrosscompile" in
4901 '') echo "Incpth not defined." >&4; croak=y ;;
4902 *) echo "Using incpth '$incpth'." >&4 ;;
4905 '') echo "Libpth not defined." >&4; croak=y ;;
4906 *) echo "Using libpth '$libpth'." >&4 ;;
4909 '') echo "Usrinc not defined." >&4; croak=y ;;
4910 *) echo "Using usrinc $usrinc." >&4 ;;
4914 if test "X$sysroot" = X; then
4915 echo "Cannot continue, aborting." >&4; exit 1
4917 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4926 : Default value for incpth is just usrinc
4928 '') incpth="$usrinc";;
4931 : Set private lib path
4934 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4939 '') dlist="$loclibpth $plibpth $glibpth";;
4940 *) dlist="$libpth";;
4943 : Now check and see which directories actually exist, avoiding duplicates
4946 if $test -d $xxx; then
4949 *) libpth="$libpth $xxx";;
4955 Some systems have incompatible or broken versions of libraries. Among
4956 the directories listed in the question below, please remove any you
4957 know not to be holding relevant libraries, and add any that are needed.
4958 Say "none" for none.
4962 if test "X$sysroot" != X; then
4964 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4977 rp="Directories to use for library searches?"
4984 : compute shared library extension
4987 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4997 On some systems, shared libraries may be available. Answer 'none' if
4998 you want to suppress searching of shared libraries for the remainder
4999 of this configuration.
5002 rp='What is the file extension used for shared libraries?'
5006 : Does target system insist that shared library basenames are unique
5009 Some dynamic loaders assume that the *basename* of shared library filenames
5010 are globally unique. We'll default this to undef as we assume your system
5011 is not this weird. Set to defined if you're on one of them.
5016 rp='Make shared library basenames unique?'
5019 y|Y) val="$define" ;;
5022 set d_libname_unique
5025 : Define several unixisms.
5026 : Hints files or command line option can be used to override them.
5027 : The convoluted testing is in case hints files set either the old
5030 '') case "$exe_ext" in
5032 *) _exe="$exe_ext" ;;
5037 '') case "$lib_ext" in
5044 '') case "$obj_ext" in
5051 '') case "$path_sep" in
5062 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5064 : Which makefile gets called first. This is used by make depend.
5065 case "$firstmakefile" in
5066 '') firstmakefile='makefile';;
5069 : Check is we will use socks
5071 $define|true|[yY]*) dflt='y';;
5076 Perl can be built to use the SOCKS proxy protocol library. To do so,
5077 Configure must be run with -Dusesocks. If you use SOCKS you also need
5078 to use the PerlIO abstraction layer, this will be implicitly selected.
5080 If this doesn't make any sense to you, just accept the default '$dflt'.
5082 rp='Build Perl for SOCKS?'
5085 y|Y) val="$define" ;;
5091 : Check for uselongdouble support
5093 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5096 case "$uselongdouble" in
5097 $define|true|[yY]*) dflt='y';;
5102 Perl can be built to take advantage of long doubles which
5103 (if available) may give more accuracy and range for floating point numbers.
5105 If this doesn't make any sense to you, just accept the default '$dflt'.
5107 rp='Try to use long doubles if available?'
5110 y|Y) val="$define" ;;
5116 case "$uselongdouble" in
5117 true|[yY]*) uselongdouble="$define" ;;
5120 : Look for a hint-file generated 'call-back-unit'. If the
5121 : user has specified that long doubles should be used,
5122 : we may need to set or change some other defaults.
5123 if $test -f uselongdouble.cbu; then
5124 echo "Your platform has some specific hints regarding long doubles, using them..."
5125 . ./uselongdouble.cbu
5127 case "$uselongdouble" in
5130 (Your platform does not have any specific hints for long doubles.)
5136 : Check if quadmath is requested
5137 case "$usequadmath" in
5138 "$define"|true|[yY]*) usequadmath="$define" ;;
5139 *) usequadmath="$undef" ;;
5142 : Fail if both uselongdouble and usequadmath are requested
5143 case "$usequadmath:$uselongdouble" in
5147 *** You requested the use of the quadmath library and use
5148 *** of long doubles.
5150 *** Please select one or the other.
5156 : Looking for optional libraries
5158 echo "Checking for optional libraries..." >&4
5163 case "$libswanted" in
5164 '') libswanted='c_s';;
5167 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5169 case "$usecbacktrace" in
5170 "$define") libswanted="$libswanted bfd" ;;
5172 case "$usequadmath" in
5173 "$define") libswanted="$libswanted quadmath" ;;
5179 for thisdir in $libpth $xlibpth; do
5180 test -d $thisdir && libspath="$libspath $thisdir"
5182 for thislib in $libswanted; do
5183 for thisdir in $libspath; do
5185 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5186 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5187 $test -f "$xxx" && eval $libscheck
5188 $test -f "$xxx" && libstyle=shared
5189 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5190 $test -f "$xxx" && eval $libscheck
5191 $test -f "$xxx" && libstyle=shared
5193 if test ! -f "$xxx"; then
5194 xxx=$thisdir/lib$thislib.$so
5195 $test -f "$xxx" && eval $libscheck
5196 $test -f "$xxx" && libstyle=shared
5198 if test ! -f "$xxx"; then
5199 xxx=$thisdir/lib$thislib$_a
5200 $test -f "$xxx" && eval $libscheck
5201 $test -f "$xxx" && libstyle=static
5203 if test ! -f "$xxx"; then
5204 xxx=$thisdir/$thislib$_a
5205 $test -f "$xxx" && eval $libscheck
5206 $test -f "$xxx" && libstyle=static
5208 if test ! -f "$xxx"; then
5209 xxx=$thisdir/lib${thislib}_s$_a
5210 $test -f "$xxx" && eval $libscheck
5211 $test -f "$xxx" && libstyle=static
5212 $test -f "$xxx" && thislib=${thislib}_s
5214 if test ! -f "$xxx"; then
5215 xxx=$thisdir/Slib$thislib$_a
5216 $test -f "$xxx" && eval $libscheck
5217 $test -f "$xxx" && libstyle=static
5219 if $test -f "$xxx"; then
5221 shared) echo "Found -l$thislib (shared)." ;;
5222 static) echo "Found -l$thislib." ;;
5223 *) echo "Found -l$thislib ($libstyle)." ;;
5227 *) dflt="$dflt -l$thislib"
5228 libsfound="$libsfound $xxx"
5230 libsfiles="$libsfiles $yyy"
5231 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5232 case " $libsdirs " in
5234 *) libsdirs="$libsdirs $yyy" ;;
5241 if $test ! -f "$xxx"; then
5242 echo "No -l$thislib."
5253 ' '|'') dflt='none';;
5258 In order to compile $package on your machine, a number of libraries
5259 are usually needed. Include any other special libraries here as well.
5260 Say "none" for none. The default list is almost always right.
5264 rp="What libraries to use?"
5271 : determine optimization, if desired, or use for debug flag also
5273 ' '|$undef) dflt='none';;
5275 *) dflt="$optimize";;
5279 By default, $package compiles with the -O flag to use the optimizer.
5280 Alternately, you might want to use the symbolic debugger, which uses
5281 the -g flag (on traditional Unix systems). Either flag can be
5282 specified here. To use neither flag, specify the word "none".
5285 rp="What optimizer/debugger flag should be used?"
5289 'none') optimize=" ";;
5292 : Check what DEBUGGING is required from the command line
5293 : -DEBUGGING or -DDEBUGGING or
5294 : -DEBUGGING=both = -g + -DDEBUGGING
5295 : -DEBUGGING=-g or -Doptimize=-g = -g
5296 : -DEBUGGING=none or -UDEBUGGING =
5297 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5300 *) DEBUGGING=$EBUGGING ;;
5303 case "$DEBUGGING" in
5307 *) optimize="$optimize -g" ;;
5311 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5319 case "$DEBUGGING" in
5320 both|$define) dflt='-DDEBUGGING'
5323 : argument order is deliberate, as the flag will start with - which set could
5324 : think is an option
5325 checkccflag='check=$1; flag=$2; callback=$3;
5327 echo "Checking if your compiler accepts $flag" 2>&1;
5328 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5329 echo "int main(void) { return 0; }" > gcctest.c;
5330 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5331 echo "Yes, it does." 2>&1;
5332 if $test -s gcctest.out ; then
5333 echo "But your platform does not like it:";
5338 echo "Leaving current flags $ccflags alone." 2>&1
5340 *) dflt="$dflt $flag";
5346 echo "Nope, it does not, but that is ok." 2>&1;
5350 : We will not override a previous value, but we might want to
5351 : augment a hint file
5353 default|recommended)
5354 case "$gccversion" in
5355 1.*) dflt="$dflt -fpcc-struct-return" ;;
5357 case "$optimize:$DEBUGGING" in
5358 *-g*:old) dflt="$dflt -DDEBUGGING";;
5360 case "$gccversion" in
5361 2.*) if $test -d /etc/conf/kconfig.d &&
5362 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5364 # Interactive Systems (ISC) POSIX mode.
5369 case "$gccversion" in
5372 ?*) set strict-aliasing -fno-strict-aliasing
5376 # For gcc, adding -pipe speeds up compilations for some, but apparently
5377 # some assemblers can't read from stdin. (It also slows down compilations
5378 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5379 case "$gccversion" in
5385 # on x86_64 (at least) we require an extra library (libssp) in the
5386 # link command line. This library is not named, so I infer that it is
5387 # an implementation detail that may change. Hence the safest approach
5388 # is to add the flag to the flags passed to the compiler at link time,
5389 # as that way the compiler can do the right implementation dependant
5392 *-fno-stack-protector*)
5393 echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1
5395 *) case "$gccversion" in
5396 ?*) set stack-protector-strong -fstack-protector-strong
5399 *-fstack-protector-strong*) ;; # It got added.
5400 *) # Try the plain/older -fstack-protector.
5401 set stack-protector -fstack-protector
5411 case "$mips_type" in
5412 *BSD*|'') inclwanted="$locincpth $usrinc";;
5413 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5415 for thisincl in $inclwanted; do
5416 if $test -d $thisincl; then
5417 if $test x$thisincl != x$usrinc; then
5419 *" -I$thisincl "*);;
5420 *) dflt="$dflt -I$thisincl ";;
5426 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5428 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5436 *) dflt="$dflt -D$2";;
5440 set signal.h LANGUAGE_C; eval $inctest
5444 ccflags="$ccflags -DSOCKS"
5449 default|recommended) dflt="$ccflags $dflt" ;;
5450 *) dflt="$ccflags";;
5459 Your C compiler may want other flags. For this question you should include
5460 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5461 but you should NOT include libraries or ld flags like -lwhatever. If you
5462 want $package to honor its debug switch, you should include -DDEBUGGING here.
5463 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5465 To use no flags, specify the word "none".
5471 rp="Any additional cc flags?"
5478 : the following weeds options from ccflags that are of no interest to cpp
5480 '') cppflags="$ccflags" ;;
5481 *) set X $ccflags; shift
5482 case " $cppflags " in
5483 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5484 *) cppflags="$cppflags $ccflags" ;;
5488 case "$gccversion" in
5489 1.*) cppflags="$cppflags -D__GNUC__"
5491 case "$mips_type" in
5493 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5499 echo "Let me guess what the preprocessor flags are..." >&4
5513 *) ftry="$previous $flag";;
5515 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5516 >cpp1.out 2>/dev/null && \
5517 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5518 >cpp2.out 2>/dev/null && \
5519 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5520 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5522 cppflags="$cppflags $ftry"
5532 *-*) echo "They appear to be: $cppflags";;
5534 $rm -f cpp.c cpp?.out
5538 : flags used in final linking phase
5540 '') if ./venix; then
5546 *-posix*) dflt="$dflt -posix" ;;
5549 *) dflt="$ldflags";;
5551 # See note above about -fstack-protector
5553 *-fstack-protector-strong*)
5555 *-fstack-protector-strong*) ;; # Don't add it again
5556 *) dflt="$dflt -fstack-protector-strong" ;;
5559 *-fstack-protector*)
5561 *-fstack-protector*) ;; # Don't add it again
5562 *) dflt="$dflt -fstack-protector" ;;
5567 : Try to guess additional flags to pick up local libraries.
5568 for thislibdir in $libpth; do
5569 case " $loclibpth " in
5572 *"-L$thislibdir "*) ;;
5573 *) dflt="$dflt -L$thislibdir" ;;
5585 Your C linker may need flags. For this question you should
5586 include -L/whatever and any other flags used by the C linker, but you
5587 should NOT include libraries like -lwhatever.
5589 Make sure you include the appropriate -L/path flags if your C linker
5590 does not normally search all of the directories you specified above,
5593 To use no flags, specify the word "none".
5597 rp="Any additional ld flags (NOT including libraries)?"
5603 rmlist="$rmlist pdp11"
5607 echo "Checking your choice of C compiler and flags for coherency..." >&4
5608 $cat > try.c <<'EOF'
5610 int main() { printf("Ok\n"); return(0); }
5612 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5614 $cat >try.msg <<'EOM'
5615 I've tried to compile and run the following simple program:
5618 $cat try.c >> try.msg
5620 $cat >> try.msg <<EOM
5627 and I got the following output:
5631 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5632 if $sh -c "$run ./try " >>try.msg 2>&1; then
5636 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5639 echo "The program compiled OK, but exited with status $?." >>try.msg
5640 rp="You have a problem. Shall I abort Configure"
5644 echo "I can't compile the test program." >>try.msg
5645 rp="You have a BIG problem. Shall I abort Configure"
5651 case "$knowitall" in
5653 echo "(The supplied flags or libraries might be incorrect.)"
5661 *) echo "Ok. Stopping Configure." >&4
5666 n) echo "OK, that should do.";;
5668 $rm_try gcctest gcctest.out
5670 : define a shorthand compile call
5674 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5675 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4;
5679 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5680 : define a shorthand compile call for compilations that should be ok.
5684 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5686 : stub, used only to satisfy other units
5689 : check for lengths of integral types
5693 echo "Checking to see how big your integers are..." >&4
5702 printf("intsize=%d;\n", (int)sizeof(int));
5703 printf("longsize=%d;\n", (int)sizeof(long));
5704 printf("shortsize=%d;\n", (int)sizeof(short));
5709 if eval $compile_ok && $run ./try > /dev/null; then
5711 echo "Your integers are $intsize bytes long."
5712 echo "Your long integers are $longsize bytes long."
5713 echo "Your short integers are $shortsize bytes long."
5717 Help! I can't compile and run the intsize test program: please enlighten me!
5718 (This is probably a misconfiguration in your system or libraries, and
5719 you really ought to fix it. Still, I'll try anyway.)
5723 rp="What is the size of an integer (in bytes)?"
5727 rp="What is the size of a long integer (in bytes)?"
5731 rp="What is the size of a short integer (in bytes)?"
5739 : check for long long
5741 echo "Checking to see if you have long long..." >&4
5742 echo 'int main() { long long x = 7; return 0; }' > try.c
5744 if eval $compile; then
5746 echo "You have long long."
5749 echo "You do not have long long."
5755 : check for length of long long
5756 case "${d_longlong}${longlongsize}" in
5759 echo "Checking to see how big your long longs are..." >&4
5760 $cat >try.c <<'EOCP'
5764 printf("%d\n", (int)sizeof(long long));
5769 if eval $compile_ok; then
5770 longlongsize=`$run ./try`
5771 echo "Your long longs are $longlongsize bytes long."
5775 echo "(I can't seem to compile the test program. Guessing...)"
5776 rp="What is the size of a long long (in bytes)?"
5780 if $test "X$longsize" = "X$longlongsize"; then
5781 echo "(That isn't any different from an ordinary long.)"
5787 : determine filename position in cpp output
5789 echo "Computing filename position in cpp output for #include directives..." >&4
5791 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5796 vos) testaccess=-e ;;
5799 echo '#include <stdio.h>' > foo.c
5802 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5803 $grep '^[ ]*#.*stdio\.h' | \
5804 while read cline; do
5807 while $test \$# -gt 0; do
5808 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5813 pos=\`expr \$pos + 1\`
5827 *) pos="${fieldn}th";;
5829 echo "Your cpp writes the filename in the $pos field of the line."
5831 : locate header file
5836 for usrincdir in $incpth
5838 if test -f \$usrincdir/\$wanted; then
5839 echo "\$usrincdir/\$wanted"
5843 awkprg='{ print \$$fieldn }'
5844 echo "#include <\$wanted>" > foo\$\$.c
5845 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5846 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5847 while read cline; do
5848 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5850 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5851 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5856 # status = 0: grep returned 0 lines, case statement not executed
5857 # status = 1: headerfile found
5858 # status = 2: while loop executed, no headerfile found
5862 if test \$status -eq 1; then
5869 : define an alternate in-header-list? function
5870 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5871 cont=true; xxf="echo \"<\$1> found.\" >&4";
5872 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5873 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5875 case $# in 4) instead=instead;; *) instead="at last";; esac;
5876 while $test "$cont"; do
5878 var=$2; eval "was=\$$2";
5879 if $test "$xxx" && $test -r "$xxx";
5881 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5884 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5885 set $yyy; shift; shift; yyy=$@;
5886 case $# in 0) cont="";;
5887 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5888 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5889 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5890 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5894 do set $yyy; var=$2; eval "was=\$$2";
5895 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5896 set $yyy; shift; shift; yyy=$@;
5899 : see if inttypes.h is available
5900 : we want a real compile instead of Inhdr because some systems
5901 : have an inttypes.h which includes non-existent headers
5904 #include <inttypes.h>
5906 static int32_t foo32 = 0x12345678;
5910 if eval $compile; then
5911 echo "<inttypes.h> found." >&4
5914 echo "<inttypes.h> NOT found." >&4
5923 echo "Checking to see if you have int64_t..." >&4
5925 #include <sys/types.h>
5926 #$i_inttypes I_INTTYPES
5928 #include <inttypes.h>
5930 int main() { int64_t x = 7; }
5933 if eval $compile; then
5935 echo "You have int64_t."
5938 echo "You do not have int64_t."
5944 : Check if 64bit ints have a quad type
5946 echo "Checking which 64-bit integer type we could use..." >&4
5952 val='"unsigned int"'
5957 *) case "$longsize" in
5961 val='"unsigned long"'
5966 *) case "$d_longlong:$longlongsize" in
5971 val='"unsigned long long"'
5976 *) case "$d_int64_t" in
5995 '') echo "Alas, no 64-bit integer types in sight." >&4
5998 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6003 : Do we want 64bit support
6004 case "$uselonglong" in
6005 "$define"|true|[yY]*)
6008 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6010 use64bitint="$define"
6013 case "$use64bits" in
6014 "$define"|true|[yY]*)
6017 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6019 use64bitint="$define"
6022 case "$use64bitints" in
6023 "$define"|true|[yY]*)
6026 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6028 use64bitint="$define"
6031 case "$use64bitsint" in
6032 "$define"|true|[yY]*)
6035 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6037 use64bitint="$define"
6040 case "$uselonglongs" in
6041 "$define"|true|[yY]*)
6044 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6046 use64bitint="$define"
6049 case "$use64bitsall" in
6050 "$define"|true|[yY]*)
6053 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6055 use64bitall="$define"
6060 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6062 case "$use64bitall" in
6063 "$define"|true|[yY]*) use64bitint="$define" ;;
6069 You have natively 64-bit long integers.
6073 *) case "$use64bitint" in
6074 "$define"|true|[yY]*) dflt='y';;
6083 Perl can be built to take advantage of 64-bit integer types
6084 on some systems. To do so, Configure can be run with -Duse64bitint.
6085 Choosing this option will most probably introduce binary incompatibilities.
6087 If this doesn't make any sense to you, just accept the default '$dflt'.
6088 (The default has been chosen based on your configuration.)
6090 rp='Try to use 64-bit integers, if available?'
6093 [yY]*) val="$define" ;;
6101 case "$use64bitall" in
6102 "$define"|true|[yY]*) dflt='y' ;;
6103 *) case "$longsize" in
6111 You may also choose to try maximal 64-bitness. It means using as much
6112 64-bitness as possible on the platform. This in turn means even more
6113 binary incompatibilities. On the other hand, your platform may not
6114 have any more 64-bitness available than what you already have chosen.
6116 If this doesn't make any sense to you, just accept the default '$dflt'.
6117 (The default has been chosen based on your configuration.)
6119 rp='Try to use maximal 64-bit support, if available?'
6122 [yY]*) val="$define" ;;
6127 case "$use64bitall" in
6129 case "$use64bitint" in
6133 Since you have chosen a maximally 64-bit build, I'm also turning on
6134 the use of 64-bit integers.
6136 use64bitint="$define" ;;
6141 : Look for a hint-file generated 'call-back-unit'. If the
6142 : user has specified that a 64-bit perl is to be built,
6143 : we may need to set or change some other defaults.
6144 if $test -f use64bitint.cbu; then
6145 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6148 case "$use64bitint" in
6149 "$define"|true|[yY]*)
6150 : This test was common to all the OpenBSD forks, and seems harmless for
6153 echo "Checking if your C library has broken 64-bit functions..." >&4
6156 typedef $uquadtype myULL;
6163 {4294967303.15, 4294967303ULL},
6164 {4294967294.2, 4294967294ULL},
6165 {4294967295.7, 4294967295ULL},
6168 for (p = test; p->u; p++) {
6169 myULL x = (myULL)p->d;
6180 if eval $compile_ok; then
6181 libcquad=`$run ./try`
6182 echo "Your C library's 64-bit functions are $libcquad."
6184 echo "(I can't seem to compile the test program.)"
6185 echo "Assuming that your C library's 64-bit functions are ok."
6194 *** You have a C library with broken 64-bit functions.
6195 *** 64-bit support does not work reliably in this configuration.
6196 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6197 *** Cannot continue, aborting.
6204 4) case "$archname64" in
6205 '') archname64=64int ;;
6212 : Look for a hint-file generated 'call-back-unit'. If the
6213 : user has specified that a maximally 64-bit perl is to be built,
6214 : we may need to set or change some other defaults.
6215 if $test -f use64bitall.cbu; then
6216 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6219 case "$use64bitall" in
6220 "$define"|true|[yY]*)
6222 4) case "$archname64" in
6223 ''|64int) archname64=64all ;;
6230 case "$d_quad:$use64bitint" in
6234 *** You have chosen to use 64-bit integers,
6235 *** but none can be found.
6236 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6237 *** Cannot continue, aborting.
6244 : Check if we are using the GNU C library
6246 echo "Checking for GNU C Library..." >&4
6248 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6249 alone are insufficient to distinguish different versions, such as
6250 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6251 libc version 2.1.0. A. Dougherty, June 3, 2002.
6257 # ifdef __GLIBC_MINOR__
6258 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6259 # include <gnu/libc-version.h>
6260 printf("%s\n", gnu_get_libc_version());
6262 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6265 printf("%d\n", __GLIBC__);
6274 if eval $compile_ok && $run ./try > glibc.ver; then
6276 gnulibc_version=`$cat glibc.ver`
6277 echo "You are using the GNU C Library version $gnulibc_version"
6281 echo "You are not using the GNU C Library"
6287 : see if nm is to be used to determine whether a symbol is defined or not
6291 case "$d_gnulibc" in
6294 echo "nm probably won't work on the GNU C Library." >&4
6300 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6302 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6303 echo "'nm' won't be sufficient on this system." >&4
6309 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6310 if $test $dflt -gt 20; then
6320 true|$define) dflt=y;;
6327 I can use $nm to extract the symbols from your C libraries. This
6328 is a time consuming task which may generate huge output on the disk (up
6329 to 3 megabytes) but that should make the symbols extraction faster. The
6330 alternative is to skip the 'nm' extraction part and to compile a small
6331 test program instead to determine whether each symbol is present. If
6332 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6333 this may be the best solution.
6335 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6338 rp="Shall I use $nm to extract C symbols from the libraries?"
6341 [Nn]*) usenm=false;;
6350 : nm options which may be necessary
6352 '') if $test -f /mach_boot; then
6354 elif $test -d /usr/ccs/lib; then
6355 nm_opt='-p' # Solaris (and SunOS?)
6356 elif $test -f /dgux; then
6358 elif $test -f /lib64/rld; then
6359 nm_opt='-p' # 64-bit Irix
6365 : nm options which may be necessary for shared libraries but illegal
6366 : for archive libraries. Thank you, Linux.
6367 case "$nm_so_opt" in
6368 '') case "$myuname" in
6370 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6371 nm_so_opt='--dynamic'
6378 : Figure out where the libc is located
6381 : get list of predefined functions in a handy place
6386 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6392 *) for thislib in $libs; do
6395 : Handle C library specially below.
6398 thislib=`echo $thislib | $sed -e 's/^-l//'`
6399 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6401 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6403 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6405 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6407 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6409 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6411 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6416 libnames="$libnames $try"
6418 *) libnames="$libnames $thislib" ;;
6427 for xxx in $libpth; do
6428 $test -r $1 || set $xxx/libc.$so
6429 : The messy sed command sorts on library version numbers.
6431 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6432 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6434 s/[0-9][0-9]*/0000&/g
6435 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6438 $sort | $sed -e 's/^.* //'`
6441 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6442 $test -r $1 || set $sysroot/lib/libsys_s$_a
6448 if $test -r "$1"; then
6449 echo "Your (shared) C library seems to be in $1."
6451 elif $test -r /lib/libc && $test -r /lib/clib; then
6452 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6454 libc='/lib/clib /lib/libc'
6455 if $test -r /lib/syslib; then
6456 echo "(Your math library is in /lib/syslib.)"
6457 libc="$libc /lib/syslib"
6459 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6460 echo "Your C library seems to be in $libc, as you said before."
6461 elif $test -r $incpath/usr/lib/libc$_a; then
6462 libc=$incpath/usr/lib/libc$_a;
6463 echo "Your C library seems to be in $libc. That's fine."
6464 elif $test -r /lib/libc$_a; then
6466 echo "Your C library seems to be in $libc. You're normal."
6468 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6470 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6471 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6472 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6474 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6476 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6479 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6481 if $test -r "$tans"; then
6482 echo "Your C library seems to be in $tans, of all places."
6488 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6492 If the guess above is wrong (which it might be if you're using a strange
6493 compiler, or your machine supports multiple models), you can override it here.
6498 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6500 I can't seem to find your C library. I've looked in the following places:
6503 $sed 's/^/ /' libpath
6506 None of these seems to contain your C library. I need to get its name...
6511 rp='Where is your C library?'
6516 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6517 set X `cat libnames`
6520 case $# in 1) xxx=file; esac
6521 echo "Extracting names from the following $xxx for later perusal:" >&4
6523 $sed 's/^/ /' libnames >&4
6525 $echo $n "This may take a while...$c" >&4
6529 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6530 *) $nm $nm_opt $file 2>/dev/null;;
6535 $grep fprintf libc.tmp > libc.ptf
6536 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6537 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6539 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6541 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6543 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6545 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6547 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6549 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6551 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6553 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6555 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6557 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6559 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6561 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6563 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6564 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6566 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6568 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6570 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6572 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6574 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6576 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6578 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6580 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6582 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6584 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6586 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6588 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6592 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6597 $nm -p $* 2>/dev/null >libc.tmp
6598 $grep fprintf libc.tmp > libc.ptf
6599 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6600 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6606 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6608 if $ar t $libc > libc.tmp && \
6609 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6611 for thisname in $libnames $libc; do
6612 $ar t $thisname >>libc.tmp
6614 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6616 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6617 for thisname in $libnames $libc; do
6618 $ar tv $thisname >>libc.tmp
6619 emximp -o tmp.imp $thisname \
6621 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6622 < tmp.imp >>libc.tmp
6625 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6628 echo "$ar didn't seem to work right." >&4
6629 echo "Maybe this is a Cray...trying bld instead..." >&4
6631 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6634 for thisname in $libnames; do
6636 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6637 $ar t $thisname >>libc.tmp
6641 echo "That didn't work either. Giving up." >&4
6651 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6652 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6654 *) if $test -f /lib/syscalls.exp; then
6656 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6657 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6658 /lib/syscalls.exp >>libc.list
6664 $rm -f libnames libpath
6666 : Check if we are using C++
6668 echo "Checking for C++..." >&4
6669 $cat >try.c <<'EOCP'
6681 if eval $compile_ok && $run ./try; then
6683 echo "You are using a C++ compiler."
6686 echo "You are not using a C++ compiler."
6692 : is a C symbol defined?
6695 -v) tf=libc.tmp; tdc="";;
6696 -a) tf=libc.tmp; tdc="[]";;
6697 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6699 case "$d_cplusplus" in
6700 $define) extern_C="extern \"C\"" ;;
6701 *) extern_C="extern" ;;
6704 case "$reuseval-$4" in
6706 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6711 if $test "$runnm" = true; then
6712 if $contains $tlook $tf >/dev/null 2>&1; then
6714 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6715 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;
6716 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6717 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6721 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;
6722 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6728 $define) tval=true;;
6735 : define an is-in-libc? function
6736 inlibc='echo " "; td=$define; tu=$undef;
6737 sym=$1; var=$2; eval "was=\$$2";
6739 case "$reuseval$was" in
6749 echo "$sym() found." >&4;
6750 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6752 echo "$sym() NOT found." >&4;
6753 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6757 $define) echo "$sym() found." >&4;;
6758 *) echo "$sym() NOT found." >&4;;
6762 : check for length of double
6764 case "$doublesize" in
6766 echo "Checking to see how big your double precision numbers are..." >&4
6775 printf("%d\n", (int)sizeof(double));
6780 if eval $compile_ok; then
6781 doublesize=`$run ./try`
6782 echo "Your double is $doublesize bytes long."
6785 echo "(I can't seem to compile the test program. Guessing...)"
6786 rp="What is the size of a double precision number (in bytes)?"
6794 : check for long doubles
6796 echo "Checking to see if you have long double..." >&4
6797 echo 'int main() { long double x = 7.0; }' > try.c
6799 if eval $compile; then
6801 echo "You have long double." >&4
6804 echo "You do not have long double." >&4
6810 : see if ldexpl exists
6814 : check for length of long double
6815 case "${d_longdbl}${longdblsize}" in
6818 echo "Checking to see how big your long doubles are..." >&4
6819 $cat >try.c <<'EOCP'
6823 printf("%d\n", sizeof(long double));
6828 if eval $compile; then
6829 longdblsize=`$run ./try`
6830 echo "Your long doubles are $longdblsize bytes long." >&4
6834 echo "(I can't seem to compile the test program. Guessing...)" >&4
6835 rp="What is the size of a long double (in bytes)?"
6839 if $test "X$doublesize" = "X$longdblsize"; then
6840 echo "That isn't any different from an ordinary double." >&4
6841 echo "I'll keep your setting anyway, but you may see some" >&4
6842 echo "harmless compilation warnings." >&4
6848 $echo "Checking the kind of long doubles you have..." >&4
6849 case "$d_longdbl" in
6853 #define LONGDBLSIZE $longdblsize
6854 #define DOUBLESIZE $doublesize
6860 static const long double d = -0.1L;
6862 unsigned const char* b = (unsigned const char*)(&d);
6863 #if DOUBLESIZE == LONGDBLSIZE
6864 printf("0\n"); /* if it floats like double */
6867 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6868 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6869 /* IEEE 754 128-bit little-endian */
6873 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6874 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6879 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6880 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6881 * cannot be trusted. */
6882 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6883 if (b[0] == 0xCD && b[9] == 0xBF) {
6884 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6885 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6886 * Also known as "extended precision". */
6890 if (b[0] == 0xBF && b[9] == 0xCD) {
6891 /* Is there ever big-endian 80-bit, really?
6893 * The Motorola 68881 had another "extended precision" format:
6894 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6895 * for total of 96 bits of bytes. The zero bits were unused.
6896 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6897 * If it ever becomes relevant, this format should be allocated
6898 * a new doublekind code since it's quite different from the Intel x87.
6904 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6905 /* software "double double", the 106 is 53+53.
6906 * but irix thinks it is 107. */
6907 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6908 /* double double 128-bit fully little-endian,
6909 * little-endian doubles in little-endian order,
6910 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6914 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6915 /* double double 128-bit fully big-endian,
6916 * big-endian doubles in big-endian order,
6917 * e.g. PPC/Power and MIPS:
6918 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6922 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
6923 /* double double 128-bit mixed endian.
6924 * little-endian doubles in big-endian order,
6926 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
6930 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
6931 /* double double 128-bit mixed endian,
6932 * big-endian doubles in little-endian order,
6933 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
6938 /* We are largely making this up because it may well be
6939 * that the VAX format H was never made available to C,
6940 * only to Fortran. */
6941 #if LONGDBLSIZE == 16 && defined(__vax__)
6942 if (b[0] == 0xFD && b[15] == 0x99) {
6943 /* VAX format H, PDP-11 mixed endian. */
6948 printf("-1\n"); /* unknown */
6953 if eval $compile; then
6954 longdblkind=`$run ./try`
6961 case "$longdblkind" in
6962 0) echo "Your long doubles are doubles." >&4 ;;
6963 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6964 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6965 3) echo "You have x86 80-bit little endian long doubles." >&4 ;;
6966 4) echo "You have x86 80-bit big endian long doubles." >&4 ;;
6967 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >&4 ;;
6968 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >&4 ;;
6969 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >&4 ;;
6970 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >&4 ;;
6971 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >&4 ;;
6972 *) echo "Cannot figure out your long double." >&4 ;;
6974 d_long_double_style_ieee=$undef
6975 d_long_double_style_ieee_std=$undef
6976 d_long_double_style_ieee_extended=$undef
6977 d_long_double_style_ieee_doubledouble=$undef
6978 d_long_double_style_vax=$undef
6979 case "$longdblkind" in
6980 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
6982 case "$longdblkind" in
6983 1|2) d_long_double_style_ieee_std=$define ;;
6985 case "$longdblkind" in
6986 3|4) d_long_double_style_ieee_extended=$define ;;
6988 case "$longdblkind" in
6989 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
6991 case "$longdblkind" in
6992 9) d_long_double_style_vax=$define ;;
6996 : get the patchlevel
6998 echo "Getting the current patchlevel..." >&4
6999 if $test -r $rsrc/patchlevel.h;then
7000 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
7001 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
7002 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7003 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
7004 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
7005 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7006 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
7015 $echo "(You do not have patchlevel.h. Eek.)"
7017 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
7018 version_patchlevel_string="version $patchlevel subversion $subversion"
7019 case "$perl_patchlevel" in
7021 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
7022 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
7026 $echo "(You have $package $version_patchlevel_string.)"
7030 : XXX Should be a Configure test for double-dots in filenames.
7031 version=`echo $revision $patchlevel $subversion | \
7032 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7033 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7034 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7037 version=`echo $revision $patchlevel $subversion | \
7038 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7039 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7040 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7043 : Special case the 5.005_xx maintenance series, which used 5.005
7044 : without any subversion label as a subdirectory in $sitelib
7045 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
7046 api_versionstring='5.005'
7049 : determine the architecture name
7051 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7052 tarch=`arch`"-$osname"
7053 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7054 if uname -m > tmparch 2>&1 ; then
7055 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7056 -e 's/$/'"-$osname/" tmparch`
7064 case "$myarchname" in
7067 echo "(Your architecture name used to be $myarchname.)"
7071 case "$targetarch" in
7073 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7078 *) dflt="$archname";;
7080 rp='What is your architecture name'
7084 : optionally add API version to the architecture for versioned archlibs
7085 case "$useversionedarchname" in
7086 $define|true|[yY]*) dflt='y';;
7089 rp='Add the Perl API version to your archname?'
7092 y|Y) useversionedarchname="$define" ;;
7093 *) useversionedarchname="$undef" ;;
7095 case "$useversionedarchname" in
7098 *-$api_versionstring)
7099 echo "...and architecture name already has -$api_versionstring" >&4
7102 archname="$archname-$api_versionstring"
7103 echo "...setting architecture name to $archname." >&4
7109 case "$usethreads" in
7111 echo "Threads selected." >&4
7113 *-thread*) echo "...and architecture name already has -thread." >&4
7115 *) archname="$archname-thread"
7116 echo "...setting architecture name to $archname." >&4
7121 case "$usemultiplicity" in
7123 echo "Multiplicity selected." >&4
7125 *-multi*) echo "...and architecture name already has -multi." >&4
7127 *) archname="$archname-multi"
7128 echo "...setting architecture name to $archname." >&4
7133 case "$use64bitint$use64bitall" in
7135 case "$archname64" in
7137 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7140 case "$use64bitint" in
7141 "$define") echo "64 bit integers selected." >&4 ;;
7143 case "$use64bitall" in
7144 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7147 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7149 *) archname="$archname-$archname64"
7150 echo "...setting architecture name to $archname." >&4
7156 case "$uselongdouble" in
7158 echo "Long doubles selected." >&4
7159 case "$longdblsize" in
7161 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7165 *-ld*) echo "...and architecture name already has -ld." >&4
7167 *) archname="$archname-ld"
7168 echo "...setting architecture name to $archname." >&4
7175 case "$usequadmath" in
7177 echo "quadmath selected." >&4
7179 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7181 *) archname="$archname-quadmath"
7182 echo "...setting architecture name to $archname." >&4
7187 if $test -f archname.cbu; then
7188 echo "Your platform has some specific hints for architecture name, using them..."
7192 : set the prefixit variable, to compute a suitable default value
7193 prefixit='case "$3" in
7195 case "$oldprefix" in
7196 "") eval "$1=\"\$$2\"";;
7203 ""|" "|none) eval "$1=\"\$$2\"";;
7209 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7211 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7212 /*-$oldprefix/*|\~*-$oldprefix/*)
7213 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7214 *) eval "$1=\"\$$2\"";;
7218 : determine installation style
7219 : For now, try to deduce it from prefix unless it is already set.
7220 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7221 case "$installstyle" in
7222 '') case "$prefix" in
7223 *perl*) dflt='lib';;
7224 *) dflt='lib/perl5' ;;
7227 *) dflt="$installstyle" ;;
7229 : Probably not worth prompting for this since we prompt for all
7230 : the directories individually, and the prompt would be too long and
7234 : determine where public executables go
7239 rp='Pathname where the public executables will reside?'
7241 if $test "X$ansexp" != "X$binexp"; then
7245 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7246 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7247 : this via initialinstalllocation
7250 case "$userelocatableinc" in
7251 $define|true|[yY]*) dflt='y' ;;
7256 Would you like to build Perl so that the installation is relocatable, so that
7257 library paths in @INC are determined relative to the path of the perl binary?
7258 This is not advised for system Perl installs, or if you need to run setid
7259 scripts or scripts under taint mode.
7261 If this doesn't make any sense to you, just accept the default '$dflt'.
7263 rp='Use relocatable @INC?'
7266 y|Y) val="$define" ;;
7269 set userelocatableinc
7272 initialinstalllocation="$binexp"
7273 : Default prefix is now "up one level from where the binaries are"
7274 case "$userelocatableinc" in
7280 installprefixexp=".../.."
7284 : determine where private library files go
7285 : Usual default is /usr/local/lib/perl5/$version.
7286 : Also allow things like /opt/perl/lib/$version, since
7287 : /opt/perl/lib/perl5... would be redundant.
7288 : The default "style" setting is made in installstyle.U
7289 case "$installstyle" in
7290 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7291 *) set dflt privlib lib/$version ;;
7296 There are some auxiliary files for $package that need to be put into a
7297 private library directory that is accessible by everyone.
7302 rp='Pathname where the private library files will reside?'
7307 : set the prefixup variable, to restore leading tilda escape
7308 prefixup='case "$prefixexp" in
7310 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7313 : determine where public architecture dependent libraries go
7316 : privlib default is /usr/local/lib/$package/$version
7317 : archlib default is /usr/local/lib/$package/$version/$archname
7318 : privlib may have an optional trailing /share.
7319 tdflt=`echo $privlib | $sed 's,/share$,,'`
7320 tdflt=$tdflt/$archname
7329 $spackage contains architecture-dependent library files. If you are
7330 sharing libraries in a heterogeneous environment, you might store
7331 these files in a separate location. Otherwise, you can just include
7332 them with the rest of the public library files.
7337 rp='Where do you want to put the public architecture-dependent libraries?'
7341 if $test X"$archlib" = X"$privlib"; then
7347 : see if setuid scripts can be secure
7350 Some kernels have a bug that prevents setuid #! scripts from being
7351 secure. Some sites have disabled setuid #! scripts because of this.
7353 First let's decide if your kernel supports secure setuid #! scripts.
7354 (If setuid #! scripts would be secure but have been disabled anyway,
7355 don't say that they are secure if asked.)
7360 if $test -d /dev/fd; then
7361 echo "#!$ls" >reflect
7362 chmod +x,u+s reflect
7363 ./reflect >flect 2>&1
7364 if $contains "/dev/fd" flect >/dev/null; then
7365 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7369 If you are not sure if they are secure, I can check but I'll need a
7370 username and password different from the one you are using right now.
7371 If you don't have such a username or don't want me to test, simply
7375 rp='Other username to test security of setuid scripts with?'
7380 case "$d_suidsafe" in
7381 '') echo "I'll assume setuid scripts are *not* secure." >&4
7384 echo "Well, the $hint value is *not* secure." >&4
7386 *) echo "Well, the $hint value *is* secure." >&4
7391 $rm -f reflect flect
7392 echo "#!$ls" >reflect
7393 chmod +x,u+s reflect
7396 echo '"su" will (probably) prompt you for '"$ans's password."
7397 su $ans -c './reflect >flect'
7398 if $contains "/dev/fd" flect >/dev/null; then
7399 echo "Okay, it looks like setuid scripts are secure." >&4
7402 echo "I don't think setuid scripts are secure." >&4
7407 rp='Does your kernel have *secure* setuid scripts?'
7410 [yY]*) val="$define";;
7415 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7416 echo "(That's for file descriptors, not floppy disks.)"
7422 $rm -f reflect flect
7424 : now see if they want to do setuid emulation
7425 if $test $patchlevel -lt 11; then
7428 case "$d_suidsafe" in
7431 echo "No need to emulate SUID scripts since they are secure here." >&4
7435 Some systems have disabled setuid scripts, especially systems where
7436 setuid scripts cannot be secure. On systems where setuid scripts have
7437 been disabled, the setuid/setgid bits on scripts are currently
7438 useless. It is possible for $package to detect those bits and emulate
7439 setuid/setgid in a secure fashion. This emulation will only work if
7440 setuid scripts have been disabled in your kernel.
7444 "$define") dflt=y ;;
7447 rp="Do you want to do setuid/setgid emulation?"
7450 [yY]*) val="$define";;
7462 SUID emulation has been removed for 5.12
7463 Please re-run Configure without -Dd_dosuid
7472 : Find perl5.005 or later.
7473 echo "Looking for a previously installed perl5.005 or later... "
7475 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7476 : Check if this perl is recent and can load a simple module
7477 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7480 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7490 '') echo "None found. That's ok.";;
7491 *) echo "Using $perl5." ;;
7494 : Set the siteprefix variables
7497 After $package is installed, you may wish to install various
7498 add-on modules and utilities. Typically, these add-ons will
7499 be installed under $prefix with the rest
7500 of this package. However, you may wish to install such add-ons
7501 elsewhere under a different prefix.
7503 If you do not wish to put everything under a single prefix, that's
7504 ok. You will be prompted for the individual locations; this siteprefix
7505 is only used to suggest the defaults.
7507 The default should be fine for most people.
7511 rp='Installation prefix to use for add-on modules and utilities?'
7512 : XXX Here might be another good place for an installstyle setting.
7513 case "$siteprefix" in
7515 *) dflt=$siteprefix ;;
7518 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7520 case "$siteprefix" in
7524 *) oldsiteprefix="$prefix";;
7529 siteprefixexp="$ansexp"
7531 : determine where site specific libraries go.
7532 : Usual default is /usr/local/lib/perl5/site_perl/$version
7533 : The default "style" setting is made in installstyle.U
7534 : XXX No longer works with Prefixit stuff.
7535 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7537 '') case "$installstyle" in
7538 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7539 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7547 The installation process will create a directory for
7548 site-specific extensions and modules. Most users find it convenient
7549 to place all site-specific files in this directory rather than in the
7550 main distribution directory.
7554 rp='Pathname for the site-specific library files?'
7558 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7560 : Determine list of previous versions to include in @INC
7561 $cat > getverlist <<EOPL
7566 my \$api_versionstring = "$api_versionstring";
7567 my \$version = "$version";
7568 my \$stem = "$sitelib_stem";
7569 my \$archname = "$archname";
7571 $cat >> getverlist <<'EOPL'
7572 # The list found is stored twice for each entry: the original name, and
7573 # the binary broken down version into pack "s>s>s>", so sorting is easy
7574 # and unambiguous. This will work for all versions that have a maximum
7575 # of three digit per group separate by '.'s or '_'s. Names are extended
7576 # with ".0.0" to ensure at least three elements for the pack.
7577 # -- H.Merijn Brand (m)'06 23-10-2006
7579 my @inc_version_list;
7581 # XXX Redo to do opendir/readdir?
7584 ;@candidates = map {
7585 [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*");
7586 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7592 my ($pversion, $aversion, $vsn5005) = map {
7593 pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7594 foreach my $d (@candidates) {
7595 if ($d->[1] lt $pversion) {
7596 if ($d->[1] ge $aversion) {
7597 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7599 elsif ($d->[1] ge $vsn5005) {
7600 unshift(@inc_version_list, grep { -d } $d->[0]);
7604 # Skip newer version. I.e. don't look in
7605 # 5.7.0 if we're installing 5.6.1.
7609 if (@inc_version_list) {
7610 print join(' ', @inc_version_list);
7613 # Blank space to preserve value for next Configure run.
7618 case "$inc_version_list" in
7619 '') if test -x "$perl5$exe_ext"; then
7620 dflt=`$perl5 getverlist`
7625 $undef) dflt='none' ;;
7626 *) eval dflt=\"$inc_version_list\" ;;
7629 ''|' ') dflt=none ;;
7636 In order to ease the process of upgrading, this version of perl
7637 can be configured to use modules built and installed with earlier
7638 versions of perl that were installed under $prefix. Specify here
7639 the list of earlier versions that this version of perl should check.
7640 If Configure detected no earlier versions of perl installed under
7641 $prefix, then the list will be empty. Answer 'none' to tell perl
7642 to not search earlier versions.
7644 The default should almost always be sensible, so if you're not sure,
7645 just accept the default.
7648 rp='List of earlier versions to include in @INC?'
7651 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7652 *) inc_version_list="$ans" ;;
7654 case "$inc_version_list" in
7656 inc_version_list_init='0'
7657 d_inc_version_list="$undef"
7659 *) inc_version_list_init=`echo $inc_version_list |
7660 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7661 d_inc_version_list="$define"
7666 : see if malloc/malloc.h has to be included
7667 set malloc/malloc.h i_mallocmalloc
7670 : see if this is a malloc.h system
7671 : we want a real compile instead of Inhdr because some systems have a
7672 : malloc.h that just gives a compile error saying to use stdlib.h instead
7677 #$i_mallocmalloc I_MALLOCMALLOC
7678 #ifdef I_MALLOCMALLOC
7679 # include <malloc/malloc.h>
7682 int main () { return 0; }
7685 if eval $compile; then
7686 echo "<malloc.h> found." >&4
7689 echo "<malloc.h> NOT found." >&4
7696 : check for length of pointer
7700 echo "Checking to see how big your pointers are..." >&4
7709 printf("%d\n", (int)sizeof(void *));
7714 if eval $compile_ok; then
7715 ptrsize=`$run ./try`
7716 echo "Your pointers are $ptrsize bytes long."
7719 echo "(I can't seem to compile the test program. Guessing...)" >&4
7720 rp="What is the size of a pointer (in bytes)?"
7727 case "$use64bitall" in
7728 "$define"|true|[yY]*)
7732 *** You have chosen a maximally 64-bit build,
7733 *** but your pointers are only 4 bytes wide.
7734 *** Please rerun Configure without -Duse64bitall.
7739 *** Since you have quads, you could possibly try with -Duse64bitint.
7744 *** Cannot continue, aborting.
7754 : determine whether to use malloc wrapping
7756 case "$usemallocwrap" in
7757 [yY]*|true|$define) dflt='y' ;;
7758 [nN]*|false|$undef) dflt='n' ;;
7759 *) case "$usedevel" in
7760 [yY]*|true|$define) dflt='y' ;;
7765 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7767 usemallocwrap="$ans"
7770 usemallocwrap="$define" ;;
7772 usemallocwrap="$undef" ;;
7775 : determine which malloc to compile in
7777 case "$usemymalloc" in
7778 [yY]*|true|$define) dflt='y' ;;
7779 [nN]*|false|$undef) dflt='n' ;;
7780 *) case "$ptrsize" in
7784 if test "$useithreads" = "$define"; then dflt='n'; fi
7787 rp="Do you wish to attempt to use the malloc that comes with $package?"
7793 mallocsrc='malloc.c'
7794 mallocobj="malloc$_o"
7795 d_mymalloc="$define"
7798 : Remove malloc from list of libraries to use
7799 echo "Removing unneeded -lmalloc from library list" >&4
7800 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7803 echo "libs = $libs" >&4
7815 : compute the return types of malloc and free
7817 $cat >malloc.c <<END
7821 #include <sys/types.h>
7835 case "$malloctype" in
7837 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7844 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7848 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7855 echo "Your system uses $freetype free(), it would seem." >&4
7857 : determine where site specific architecture-dependent libraries go.
7858 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7859 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7860 : sitelib may have an optional trailing /share.
7862 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7863 dflt="$dflt/$archname"
7868 set sitearch sitearch none
7872 The installation process will also create a directory for
7873 architecture-dependent site-specific extensions and modules.
7877 rp='Pathname for the site-specific architecture-dependent library files?'
7881 if $test X"$sitearch" = X"$sitelib"; then
7884 d_sitearch="$define"
7887 : Set the vendorprefix variables
7890 The installation process will also create a directory for
7891 vendor-supplied add-ons. Vendors who supply perl with their system
7892 may find it convenient to place all vendor-supplied files in this
7893 directory rather than in the main distribution directory. This will
7894 ease upgrades between binary-compatible maintenance versions of perl.
7896 Of course you may also use these directories in whatever way you see
7897 fit. For example, you might use them to access modules shared over a
7898 company-wide network.
7900 The default answer should be fine for most people.
7901 This causes further questions about vendor add-ons to be skipped
7902 and no vendor-specific directories will be configured for perl.
7905 rp='Do you want to configure vendor-specific add-on directories?'
7906 case "$usevendorprefix" in
7907 define|true|[yY]*) dflt=y ;;
7908 *) : User may have set vendorprefix directly on Configure command line.
7909 case "$vendorprefix" in
7918 rp='Installation prefix to use for vendor-supplied add-ons?'
7919 case "$vendorprefix" in
7920 '') dflt="$prefix" ;;
7921 *) dflt=$vendorprefix ;;
7924 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7926 case "$vendorprefix" in
7930 *) oldvendorprefix="$prefix";;
7934 usevendorprefix="$define"
7936 vendorprefixexp="$ansexp"
7938 *) usevendorprefix="$undef"
7944 : Set the vendorlib variables
7945 case "$vendorprefix" in
7946 '') d_vendorlib="$undef"
7950 *) d_vendorlib="$define"
7951 : determine where vendor-supplied modules go.
7952 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7953 case "$vendorlib" in
7955 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7956 case "$installstyle" in
7957 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7958 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7961 *) dflt="$vendorlib"
7965 rp='Pathname for the vendor-supplied library files?'
7968 vendorlibexp="$ansexp"
7971 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7975 : Set the vendorarch variables
7976 case "$vendorprefix" in
7977 '') d_vendorarch="$undef"
7981 *) d_vendorarch="$define"
7982 : determine where vendor-supplied architecture-dependent libraries go.
7983 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7984 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7985 : vendorlib may have an optional trailing /share.
7986 case "$vendorarch" in
7987 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7988 dflt="$dflt/$archname"
7990 *) dflt="$vendorarch" ;;
7993 rp='Pathname for vendor-supplied architecture-dependent files?'
7996 vendorarchexp="$ansexp"
7999 prefixvar=vendorarch
8001 if $test X"$vendorarch" = X"$vendorlib"; then
8002 d_vendorarch="$undef"
8004 d_vendorarch="$define"
8007 : Final catch-all directories to search
8010 Lastly, you can have perl look in other directories for extensions and
8011 modules in addition to those already specified.
8012 These directories will be searched after
8016 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8017 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8019 case "$otherlibdirs" in
8020 ''|' ') dflt='none' ;;
8021 *) dflt="$otherlibdirs" ;;
8024 Enter a colon-separated set of extra paths to include in perl's @INC
8025 search path, or enter 'none' for no extra paths.
8029 rp='Colon-separated list of additional directories for perl to search?'
8032 ' '|''|none) otherlibdirs=' ' ;;
8033 *) otherlibdirs="$ans" ;;
8035 case "$otherlibdirs" in
8039 set d_perl_otherlibdirs
8043 dflt_dtrace='/usr/sbin/dtrace'
8044 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8048 Perl can be built to support DTrace on platforms that support it.
8049 DTrace is a diagnosis and performance analysis tool from Sun.
8051 If this doesn't make any sense to you, just accept the default.
8055 case "$usedtrace" in
8065 dflt_dtrace=$usedtrace
8072 rp='Support DTrace if available?'
8075 y|Y) val="$define" ;;
8081 test "X$usedtrace" != "X$define" && break
8084 rp='Where is the dtrace executable?'
8093 if $dtrace -h -s ../perldtrace.d \
8094 -o perldtrace.tmp >/dev/null 2>&1 \
8095 && rm -f perldtrace.tmp
8098 echo "Good: your $dtrace knows about the -h flag."
8102 *** $me: Fatal Error: $dtrace doesn't support -h flag
8104 *** Your installed dtrace doesn't support the -h switch to compile a D
8105 *** program into a C header. Can't continue.
8117 *** $me: Fatal Error: $dtrace not found.
8124 echo "*** $dtrace was not found."
8130 : See if we want extra modules installed
8137 Perl can be built with extra modules or bundles of modules which
8138 will be fetched from the CPAN and installed alongside Perl.
8140 Notice that you will need access to the CPAN; either via the Internet,
8141 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8142 be asked later to configure the CPAN.pm module which will in turn do
8143 the installation of the rest of the extra modules or bundles.)
8145 Notice also that if the modules require any external software such as
8146 libraries and headers (the libz library and the zlib.h header for the
8147 Compress::Zlib module, for example) you MUST have any such software
8148 already installed, this configuration process will NOT install such
8151 If this doesn't make any sense to you, just accept the default '$dflt'.
8153 rp='Install any extra modules (y or n)?'
8159 Please list any extra modules or bundles to be installed from CPAN,
8160 with spaces between the names. The names can be in any format the
8161 'install' command of CPAN.pm will understand. (Answer 'none',
8162 without the quotes, to install no extra modules or bundles.)
8172 $rm -f ../extras.lst
8174 *) echo "(Saving the list of extras for later...)"
8175 echo "$extras" > ../extras.lst
8183 : determine where html pages for programs go
8184 set html1dir html1dir none
8188 If you wish to install html files for programs in $spackage, indicate
8189 the appropriate directory here. To skip installing html files,
8193 ''|none|$undef|' ') dflt=none ;;
8194 *) dflt=$html1dir ;;
8197 rp="Directory for the main $spackage html pages?"
8201 : Use ' ' for none so value is preserved next time through Configure
8202 $test X"$html1dir" = "X" && html1dir=' '
8204 : determine where html pages for libraries and modules go
8205 set html3dir html3dir none
8209 If you wish to install html files for modules associated with $spackage,
8210 indicate the appropriate directory here. To skip installing html files,
8213 : There is no obvious default. If they have specified html1dir, then
8214 : try to key off that, possibly changing .../html1 into .../html3.
8216 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8217 *) dflt=$html3dir ;;
8220 rp="Directory for the $spackage module html pages?"
8224 : Use ' ' for none so value is preserved next time through Configure
8225 $test X"$html3dir" = "X" && html3dir=' '
8227 : determine whether to install perl also as /usr/bin/perl
8230 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8232 Many scripts expect perl to be installed as /usr/bin/perl.
8234 If you want to, I can install the perl you are about to compile
8235 as /usr/bin/perl (in addition to $bin/perl).
8237 if test -f /usr/bin/perl; then
8240 However, please note that because you already have a /usr/bin/perl,
8241 overwriting that with a new Perl would very probably cause problems.
8242 Therefore I'm assuming you don't want to do that (unless you insist).
8245 case "$installusrbinperl" in
8246 "$define"|[yY]*) dflt='y';;
8252 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8255 case "$installusrbinperl" in
8256 "$undef"|[nN]*) dflt='n';;
8260 rp="Do you want to install perl as /usr/bin/perl?"
8263 [yY]*) val="$define";;
8269 set installusrbinperl
8272 : see if dlopen exists
8274 xxx_ccflags="$ccflags"
8276 : with g++ one needs -shared to get is-in-libc to work for dlopen
8277 case "$gccversion" in
8280 *) case "$d_cplusplus" in
8281 "$define") ccflags="$ccflags -shared" ;;
8288 ccflags="$xxx_ccflags"
8290 : see if this is a unistd.h system
8291 set unistd.h i_unistd
8294 : determine which dynamic loading, if any, to compile in
8296 dldir="ext/DynaLoader"
8309 $define) dflt='y' ;;
8311 : Does a dl_xxx.xs file exist for this operating system
8312 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8315 rp="Do you wish to use dynamic loading?"
8322 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8323 dflt="$dldir/dl_${osname}.xs"
8324 elif $test "$d_dlopen" = "$define" ; then
8325 dflt="$dldir/dl_dlopen.xs"
8330 *) dflt="$dldir/$dlsrc"
8333 echo "The following dynamic loading files are available:"
8334 : Can not go over to $dldir because getfile has path hard-coded in.
8335 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8336 rp="Source file to use for dynamic loading"
8342 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8346 Some systems may require passing special flags to $cc -c to
8347 compile modules that will be used to create a shared library.
8348 To use no flags, say "none".
8351 case "$cccdlflags" in
8352 '') case "$gccversion" in
8353 '') case "$osname" in
8355 irix*) dflt='-KPIC' ;;
8356 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8357 sunos) dflt='-pic' ;;
8361 *) case "$osname" in
8362 darwin) dflt='none' ;;
8363 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8368 *) dflt="$cccdlflags" ;;
8375 # If -Dsysroot was specified, now's the time to add it
8377 if test "X$sysroot" != X; then
8378 case "$gccversion" in
8383 dflt="$dflt --sysroot=$sysroot" ;;
8393 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8396 none) cccdlflags=' ' ;;
8397 *) cccdlflags="$ans" ;;
8402 Some systems use ld to create libraries that can be dynamically loaded,
8403 while other systems (such as those using ELF) use $cc.
8407 : Determine if this is ELF
8409 /* Test for whether ELF binaries are produced */
8421 int i = open("a.out",O_RDONLY);
8424 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8425 exit(0); /* succeed (yes, it is ELF) */
8429 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8435 '') if $test $bin_ELF = "$define"; then
8437 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8441 echo "I'll use ld to build dynamic libraries."
8449 rp="What command should be used to create dynamic libraries?"
8455 Some systems may require passing special flags to $ld to create a
8456 library that can be dynamically loaded. If your ld flags include
8457 -L/other/path options to locate libraries outside your loader's normal
8458 search path, you may need to specify those -L options here as well. To
8459 use no flags, say "none".
8462 case "$lddlflags" in
8463 '') case "$osname" in
8464 haiku) dflt='-shared' ;;
8466 case "$gccversion" in
8467 '') dflt="$dflt +vnocompatwarnings" ;;
8470 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8471 solaris) # See [perl #66604].
8472 # On Solaris 11, gcc -m64 on amd64
8473 # appears not to understand -G. gcc versions at
8474 # least as old as 3.4.3 support -shared, so just
8475 # use that with Solaris 11 and later, but keep
8476 # the old behavior for older Solaris versions.
8477 case "$gccversion" in
8479 *) case "$osvers" in
8480 2.?|2.10) dflt='-G' ;;
8481 *) dflt='-shared' ;;
8486 sunos) dflt='-assert nodefinitions' ;;
8487 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8491 *) dflt="$lddlflags" ;;
8494 : Only do this for gcc, since, for example, qcc has no concept
8496 if $test "X$sysroot" != X; then
8497 case "$gccversion" in
8499 *) dflt="$dflt --sysroot=$sysroot" ;;
8503 : Try to guess additional flags to pick up local libraries.
8504 : Be careful not to append to a plain 'none'
8508 for thisflag in $ldflags; do
8513 *) dflt="$dflt $thisflag" ;;
8520 ''|' ') dflt='none' ;;
8524 *-fstack-protector-strong*)
8526 *-fstack-protector-strong*) ;; # Don't add it again
8527 *) dflt="$dflt -fstack-protector-strong" ;;
8530 *-fstack-protector*)
8532 *-fstack-protector*) ;; # Don't add it again
8533 *) dflt="$dflt -fstack-protector" ;;
8538 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8541 none) lddlflags=' ' ;;
8542 *) lddlflags="$ans" ;;
8547 Some systems may require passing special flags to $cc to indicate that
8548 the resulting executable will use dynamic linking. To use no flags,
8552 case "$ccdlflags" in
8553 '') case "$osname" in
8554 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8555 sunos) dflt='none' ;;
8559 *) dflt="$ccdlflags" ;;
8561 rp="Any special flags to pass to $cc to use dynamic linking?"
8564 none) ccdlflags=' ' ;;
8565 *) ccdlflags="$ans" ;;
8577 ld_can_script="$undef"
8578 case "$bin_ELF$usedl" in
8580 # Abuse try.h and a.out names for neat cleanup
8592 if $cc $cccdlflags $ccdlflags $ccflags \
8593 $ldflags $lddlflags -o a.out try.c \
8594 -Wl,--version-script=try.h >/dev/null 2>&1 \
8595 && $test -s a.out ; then
8596 echo "ld supports scripting" >&4
8597 ld_can_script="$define"
8599 echo "ld does not support scripting" >&4
8605 : Do we want a shared libperl?
8609 # No dynamic loading being used, so don't bother even to prompt.
8612 *) case "$useshrplib" in
8613 '') case "$osname" in
8614 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8616 also='Building a shared libperl is required for dynamic loading to work on your system.'
8630 The perl executable is normally obtained by linking perlmain.c with
8631 libperl${_a}, any static extensions (usually just DynaLoader), and
8632 any other libraries needed on this system (such as -lm, etc.). Since
8633 your system supports dynamic loading, it is probably possible to build
8634 a shared libperl.$so. If you will have more than one executable linked
8635 to libperl.$so, this will significantly reduce the size of each
8636 executable, but it may have a noticeable effect on performance. The
8637 default is probably sensible for your system.
8641 rp="Build a shared libperl.$so (y/n)"
8645 useshrplib='true' ;;
8646 *) useshrplib='false' ;;
8651 case "$useshrplib" in
8653 case "$userelocatableinc" in
8655 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8656 echo "See INSTALL for an explanation why that won't work." >&4
8662 # Figure out a good name for libperl.so. Since it gets stored in
8663 # a version-specific architecture-dependent library, the version
8664 # number isn't really that important, except for making cc/ld happy.
8666 # A name such as libperl.so.10.1
8667 majmin="libperl.$so.$patchlevel.$subversion"
8668 # A name such as libperl.so.100
8669 majonly=`echo $patchlevel $subversion |
8670 $awk '{printf "%d%02d", $1, $2}'`
8671 majonly=libperl.$so.$majonly
8672 # I'd prefer to keep the os-specific stuff here to a minimum, and
8673 # rely on figuring it out from the naming of libc.
8674 case "${osname}${osvers}" in
8675 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8678 cygwin*) # ld links now against the dll directly
8679 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8680 majonly=`echo $patchlevel $subversion |
8681 $awk '{printf "%03d%03d", $1, $2}'`
8682 majonly=cygperl5.$majonly.$so
8685 *) # Try to guess based on whether libc has major.minor.
8687 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8688 *libc.$so.[0-9]*) dflt=$majonly ;;
8689 *) dflt=libperl.$so ;;
8699 I need to select a good name for the shared libperl. If your system uses
8700 library names with major and minor numbers, then you might want something
8701 like $majmin. Alternatively, if your system uses a single version
8702 number for shared libraries, then you might want to use $majonly.
8703 Or, your system might be quite happy with a simple libperl.$so.
8705 Since the shared libperl will get installed into a version-specific
8706 architecture-dependent directory, the version number of the shared perl
8707 library probably isn't important, so the default should be o.k.
8710 rp='What name do you want to give to the shared libperl?'
8713 echo "Ok, I'll use $libperl"
8716 libperl="libperl${_a}"
8720 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8724 WARNING: Use of the shrpdir variable for the installation location of
8725 the shared $libperl is not supported. It was never documented and
8726 will not work in this version. Let me (https://github.com/Perl/perl5/issues)
8727 know of any problems this may cause.
8733 But your current setting of $shrpdir is
8734 the default anyway, so it's harmless.
8739 Further, your current attempted setting of $shrpdir
8740 conflicts with the value of $archlibexp/CORE
8741 that installperl will use.
8748 # How will the perl executable find the installed shared $libperl?
8749 # Add $xxx to ccdlflags.
8750 # If we can't figure out a command-line option, use $shrpenv to
8751 # set env LD_RUN_PATH. The main perl makefile uses this.
8752 shrpdir=$archlibexp/CORE
8755 if "$useshrplib"; then
8758 # We'll set it in Makefile.SH...
8763 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8764 xxx="-Wl,-R$shrpdir"
8766 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8767 xxx="-Wl,-rpath,$shrpdir"
8770 # hpux doesn't like the default, either.
8771 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8774 # cygwin needs only ldlibpth
8777 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8783 # Only add $xxx if it isn't already in ccdlflags.
8784 case " $ccdlflags " in
8786 *) ccdlflags="$ccdlflags $xxx"
8789 Adding $xxx to the flags
8790 passed to $ld so that the perl executable will find the
8791 installed shared $libperl.
8799 # Fix ccdlflags in AIX for building external extensions.
8800 # (For building Perl itself bare -bE:perl.exp is needed,
8801 # Makefile.SH takes care of this.)
8803 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8805 # Respect a hint or command-line value.
8807 '') shrpenv="$tmp_shrpenv" ;;
8809 case "$ldlibpthname" in
8810 '') ldlibpthname=LD_LIBRARY_PATH ;;
8811 none) ldlibpthname='' ;;
8814 : determine where manual pages are on this system
8818 syspath='/usr/share/man/man1 /usr/man/man1'
8819 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8820 syspath="$syspath /usr/man/u_man/man1"
8821 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8822 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8823 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8824 sysman=`./loc . /usr/man/man1 $syspath`
8827 if $test -d "$sysman"; then
8828 echo "System manual is in $sysman." >&4
8830 echo "Could not find manual pages in source form." >&4
8833 : determine where manual pages go
8834 set man1dir man1dir none
8838 $spackage has manual pages available in source form.
8842 echo "However, you don't have nroff, so they're probably useless to you."
8844 '') man1dir="none";;
8847 echo "If you don't want the manual sources installed, answer 'none'."
8852 lookpath="$prefixexp/share/man/man1"
8853 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8854 lookpath="$lookpath $prefixexp/man/p_man/man1"
8855 lookpath="$lookpath $prefixexp/man/u_man/man1"
8856 lookpath="$lookpath $prefixexp/man/man.1"
8858 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8859 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8869 rp="Where do the main $spackage manual pages (source) go?"
8871 if $test "X$man1direxp" != "X$ansexp"; then
8882 : What suffix to use on installed man pages
8889 rp="What suffix should be used for the main $spackage man pages?"
8891 '') case "$man1dir" in
8905 *) dflt="$man1ext";;
8912 : see if we can have long filenames
8914 first=123456789abcdef
8916 if (echo hi >$first) 2>/dev/null; then
8917 if $test -f 123456789abcde; then
8918 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8921 echo 'You can have filenames longer than 14 characters.'>&4
8926 You can't have filenames longer than 14 chars.
8927 You can't even think about them!
8933 $rm -rf 123456789abcde*
8935 : determine where library module manual pages go
8936 set man3dir man3dir none
8940 $spackage has manual pages for many of the library modules.
8946 However, you don't have nroff, so they're probably useless to you.
8949 '') man3dir="none";;
8953 case "$d_flexfnam" in
8956 However, your system can't handle the long file names like File::Basename.3.
8959 '') man3dir="none";;
8963 echo "If you don't want the manual sources installed, answer 'none'."
8964 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8966 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8967 if $test -d "$privlib/man/man3"; then
8970 WARNING: Previous versions of perl installed man3 pages into
8971 $privlib/man/man3. This version will suggest a
8972 new default of $dflt.
8976 rp='Do you wish to preserve the old behavior?(y/n)'
8979 y*) dflt="$privlib/man/man3" ;;
8984 *) dflt="$man3dir" ;;
8991 rp="Where do the $package library man pages (source) go?"
9001 : What suffix to use on installed man pages
9007 rp="What suffix should be used for the $package library man pages?"
9009 '') case "$man3dir" in
9023 *) dflt="$man3ext";;
9030 : see if we have to deal with yellow pages, now NIS.
9031 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9037 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9045 rp='Are you getting the hosts file via yellow pages?'
9048 y*) hostcat='ypcat hosts';;
9049 *) hostcat='cat /etc/hosts';;
9055 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9058 '') test -f /etc/group && groupcat='cat /etc/group';;
9061 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9064 : now get the host name
9066 echo "Figuring out host name..." >&4
9067 case "$myhostname" in
9069 echo 'Maybe "hostname" will work...'
9070 if tans=`sh -c hostname 2>&1` ; then
9078 if $test "$cont"; then
9080 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9081 if tans=`cat /etc/systemid 2>&1` ; then
9083 phostname='cat /etc/systemid'
9084 echo "Whadyaknow. Xenix always was a bit strange..."
9087 elif $test -r /etc/systemid; then
9088 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9091 if $test "$cont"; then
9092 echo 'No, maybe "uuname -l" will work...'
9093 if tans=`sh -c 'uuname -l' 2>&1` ; then
9095 phostname='uuname -l'
9097 echo 'Strange. Maybe "uname -n" will work...'
9098 if tans=`sh -c 'uname -n' 2>&1` ; then
9100 phostname='uname -n'
9102 echo 'Oh well, maybe I can mine it out of whoami.h...'
9103 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9104 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9105 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9107 case "$myhostname" in
9108 '') echo "Does this machine have an identity crisis or something?"
9111 echo "Well, you said $myhostname before..."
9112 phostname='echo $myhostname';;
9118 case "$myhostname" in
9119 '') myhostname=noname ;;
9121 : you do not want to know about this
9126 if $test "$myhostname" ; then
9128 rp='Your host name appears to be "'$myhostname'".'" Right?"
9136 : bad guess or no guess
9137 while $test "X$myhostname" = X ; do
9139 rp="Please type the (one word) name of your host:"
9144 : translate upper to lower if necessary
9145 case "$myhostname" in
9147 echo "(Normalizing case in your host name)"
9148 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9152 case "$myhostname" in
9154 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9155 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9156 echo "(Trimming domain name from host name--host name is now $myhostname)"
9158 *) case "$mydomain" in
9161 test "X$hostcat" = "Xypcat hosts" &&
9162 ypmatch "$myhostname" hosts 2>/dev/null |\
9163 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9166 test "X$hostcat" != "X" &&
9167 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9168 /[ ]$myhostname[ . ]/p" > hosts
9171 if $test -f hosts; then
9172 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9173 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9174 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9175 hosts | $sort | $uniq | \
9176 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9177 case `$echo X$dflt` in
9178 X*\ *) echo "(Several hosts in the database matched hostname)"
9181 X.) echo "(You do not have fully-qualified names in the hosts database)"
9185 echo "(I cannot locate a hosts database anywhere)"
9190 tans=`./loc resolv.conf X /etc /usr/etc`
9191 if $test -f "$tans"; then
9192 echo "(Attempting domain name extraction from $tans)"
9193 dflt=.`$sed -n -e 's/ / /g' \
9194 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9197 .) dflt=.`$sed -n -e 's/ / /g' \
9198 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9206 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9207 dflt=.`sh -c domainname 2>/dev/null`
9210 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9214 case "$dflt$osname" in
9215 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9216 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9220 .) echo "(Lost all hope -- silly guess then)"
9226 *) dflt="$mydomain";;
9230 rp="What is your domain name?"
9240 : translate upper to lower if necessary
9243 echo "(Normalizing case in your domain name)"
9244 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9248 : a little sanity check here
9249 case "$phostname" in
9252 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9253 $myhostname$mydomain|$myhostname) ;;
9255 case "$phostname" in
9257 echo "(That doesn't agree with your whoami.h file, by the way.)"
9260 echo "(That doesn't agree with your $phostname command, by the way.)"
9268 : determine the e-mail address of the user who is running us
9271 I need to get your e-mail address in Internet format if possible, i.e.
9272 something like user@host.domain. Please answer accurately since I have
9273 no easy means to double check it. The default value provided below
9274 is most probably close to reality but may not be valid from outside
9275 your organization...
9279 while test "$cont"; do
9280 case "$MAILDOMAIN" in
9282 if $test -s /etc/mailname; then
9283 maildomain=`$cat /etc/mailname`
9285 maildomain="$myhostname$mydomain"
9288 *) maildomain="$MAILDOMAIN";;
9291 '') dflt="$cf_by@$maildomain";;
9292 *) dflt="$cf_email";;
9294 rp='What is your e-mail address?'
9300 rp='Address does not look like an Internet one. Use it anyway?'
9314 : Ask e-mail of administrator
9317 If you or somebody else will be maintaining perl at your site, please
9318 fill in the correct e-mail address here so that they may be contacted
9319 if necessary. Currently, the "perlbug" program included with perl
9320 will send mail to this address in addition to perlbug@perl.org. You may
9321 enter "none" for no administrator.
9324 case "$perladmin" in
9325 '') dflt="$cf_email";;
9326 *) dflt="$perladmin";;
9328 rp='Perl administrator e-mail address'
9332 : determine whether to use a version number suffix for installed binaries
9335 Do you want to use a version number suffix for installed binaries? This
9336 will install 'perl$version' instead of 'perl', and likewise for other
9337 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9338 to be installed side-by-side. Unless you are a developer, you probably
9339 do *not* want to do this.
9341 case "$versiononly" in
9342 "$define"|[Yy]*|true) dflt='y' ;;
9345 rp="Do you want to use a version number suffix for installed binaries?"
9348 [yY]*) val="$define";;
9354 case "$versiononly" in
9355 "$define") inc_version_list=''
9356 inc_version_list_init=0
9360 : figure out how to guarantee perl startup
9361 : XXX Note that this currently takes advantage of the bug that binexp ignores
9362 : the Configure -Dinstallprefix setting, which in turn means that under
9363 : relocatable @INC, initialinstalllocation is what binexp started as.
9364 case "$startperl" in
9366 case "$sharpbang" in
9370 I can use the #! construct to start perl on your system. This will
9371 make startup of perl scripts faster, but may cause problems if you
9372 want to share those scripts and perl is not in a standard place
9373 ($initialinstalllocation/perl) on all your platforms. The alternative
9374 is to force a shell by starting the script with a single ':' character.
9377 case "$versiononly" in
9378 "$define") dflt="$initialinstalllocation/perl$version";;
9379 *) dflt="$initialinstalllocation/perl";;
9381 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9384 none) startperl=": # use perl";;
9385 *) startperl="#!$ans"
9386 if $test 30 -lt `echo "$ans" | wc -c`; then
9389 WARNING: Some systems limit the #! command to 32 characters.
9390 If you experience difficulty running Perl scripts with #!, try
9391 installing Perl in a directory with a shorter pathname.
9397 *) startperl=": # use perl"
9402 echo "I'll use $startperl to start perl scripts."
9404 : figure best path for perl in scripts
9407 case "$versiononly" in
9408 "$define") perlpath="$initialinstalllocation/perl$version";;
9409 *) perlpath="$initialinstalllocation/perl";;
9411 case "$startperl" in
9416 I will use the "eval 'exec'" idiom to start Perl on your system.
9417 I can use the full path of your Perl binary for this purpose, but
9418 doing so may cause problems if you want to share those scripts and
9419 Perl is not always in a standard place ($initialinstalllocation/perl).
9422 dflt="$initialinstalllocation/perl"
9423 rp="What path shall I use in \"eval 'exec'\"?"
9430 case "$startperl" in
9432 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9435 : determine where public executable scripts go
9436 set scriptdir scriptdir
9438 case "$scriptdir" in
9441 : guess some guesses
9442 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9443 $test -d /usr/share/bin && dflt=/usr/share/bin
9444 $test -d /usr/local/script && dflt=/usr/local/script
9445 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9446 $test -d $prefixexp/script && dflt=$prefixexp/script
9450 *) dflt="$scriptdir"
9455 Some installations have a separate directory just for executable scripts so
9456 that they can mount it across multiple architectures but keep the scripts in
9457 one spot. You might, for example, have a subdirectory of /usr/share for this.
9458 Or you might just lump your scripts in with all your other executables.
9462 rp='Where do you keep publicly executable scripts?'
9464 if $test "X$ansexp" != "X$scriptdirexp"; then
9470 : A little fix up for an irregularly named variable.
9471 installscript="$installscriptdir"
9473 : determine where add-on public executables go
9475 '') dflt=$siteprefix/bin ;;
9479 rp='Pathname where the add-on public executables should be installed?'
9484 : determine where add-on html pages go
9485 : There is no standard location, so try to copy the previously-selected
9486 : directory structure for the core html pages.
9487 case "$sitehtml1dir" in
9488 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9489 *) dflt=$sitehtml1dir ;;
9492 ''|' ') dflt=none ;;
9495 rp='Pathname where the site-specific html pages should be installed?'
9497 prefixvar=sitehtml1dir
9500 : determine where add-on library html pages go
9501 : There is no standard location, so try to copy the previously-selected
9502 : directory structure for the core html pages.
9503 case "$sitehtml3dir" in
9504 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9505 *) dflt=$sitehtml3dir ;;
9508 ''|' ') dflt=none ;;
9511 rp='Pathname where the site-specific library html pages should be installed?'
9513 prefixvar=sitehtml3dir
9516 : determine where add-on manual pages go
9517 case "$siteman1dir" in
9518 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9519 *) dflt=$siteman1dir ;;
9522 ''|' ') dflt=none ;;
9525 rp='Pathname where the site-specific manual pages should be installed?'
9527 prefixvar=siteman1dir
9530 : determine where add-on library man pages go
9531 case "$siteman3dir" in
9532 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9533 *) dflt=$siteman3dir ;;
9536 ''|' ') dflt=none ;;
9539 rp='Pathname where the site-specific library manual pages should be installed?'
9541 prefixvar=siteman3dir
9544 : determine where add-on public executable scripts go
9545 case "$sitescript" in
9546 '') dflt=$siteprefix/script
9547 $test -d $dflt || dflt=$sitebin ;;
9548 *) dflt="$sitescript" ;;
9551 rp='Pathname where add-on public executable scripts should be installed?'
9553 prefixvar=sitescript
9556 : see if backtrace exists
9557 set backtrace d_backtrace
9560 : Check if C backtrace is actually supported.
9561 case "$usecbacktrace" in
9562 "") usecbacktrace=$undef ;;
9564 case "$d_backtrace" in
9568 echo "This system does not support backtrace" >&4
9569 usecbacktrace=$undef
9575 : Check if faststdio is requested and available
9576 case "$usefaststdio" in
9577 $define|true|[yY]*|'')
9578 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9588 Perl can be built to use 'fast stdio', which means using the stdio
9589 library but also directly manipulating the stdio buffers to enable
9590 faster I/O. Using stdio is better for backward compatibility (especially
9591 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9592 interface has been preferred instead of stdio.
9594 If this doesn't make any sense to you, just accept the default '$dflt'.
9596 rp='Use the "fast stdio" if available?'
9599 y|Y) val="$define" ;;
9605 : define an is-a-typedef? function
9606 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9608 "") inclist="sys/types.h";;
9610 eval "varval=\$$var";
9614 for inc in $inclist; do
9615 echo "#include <$inc>" >>temp.c;
9617 echo "#ifdef $type" >> temp.c;
9618 echo "printf(\"We have $type\");" >> temp.c;
9619 echo "#endif" >> temp.c;
9620 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9621 if $contains $type temp.E >/dev/null 2>&1; then
9627 *) eval "$var=\$varval";;
9630 : define an is-a-typedef? function that prompts if the type is not available.
9631 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9633 "") inclist="sys/types.h";;
9635 eval "varval=\$$var";
9639 for inc in $inclist; do
9640 echo "#include <$inc>" >>temp.c;
9642 echo "#ifdef $type" >> temp.c;
9643 echo "printf(\"We have $type\");" >> temp.c;
9644 echo "#endif" >> temp.c;
9645 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9647 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9648 if $contains $type temp.E >/dev/null 2>&1; then
9649 echo "$type found." >&4;
9652 echo "$type NOT found." >&4;
9658 *) eval "$var=\$varval";;
9661 : see what type lseek is declared as in the kernel
9662 rp="What is the type used for lseek's offset on this system?"
9663 set off_t lseektype long stdio.h sys/types.h
9667 echo "Checking to see how big your file offsets are..." >&4
9669 #include <sys/types.h>
9673 printf("%d\n", (int)sizeof($lseektype));
9678 if eval $compile_ok; then
9679 lseeksize=`$run ./try`
9680 echo "Your file offsets are $lseeksize bytes long."
9684 echo "(I can't seem to compile the test program. Guessing...)"
9685 rp="What is the size of your file offsets (in bytes)?"
9691 : see what type file positions are declared as in the library
9692 rp="What is the type for file position used by fsetpos()?"
9693 set fpos_t fpostype long stdio.h sys/types.h
9696 : Check size for Fpos_t
9699 *_t) zzz="$fpostype" ;;
9702 echo "Checking the size of $zzz..." >&4
9704 #include <sys/types.h>
9711 printf("%d\n", (int)sizeof($fpostype));
9716 if eval $compile_ok; then
9720 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9723 echo "Your $zzz is $fpossize bytes long."
9729 echo "(I can't compile the test program. Guessing...)" >&4
9730 rp="What is the size of your file positions (in bytes)?"
9735 : Check for large file support
9736 # Backward compatibility (uselfs is deprecated).
9738 "$define"|true|[yY]*)
9741 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9743 uselargefiles="$define"
9747 case "$lseeksize:$fpossize" in
9750 You can have files larger than 2 gigabytes.
9753 *) case "$uselargefiles" in
9754 "$undef"|false|[nN]*) dflt='n' ;;
9759 Perl can be built to understand large files (files larger than 2 gigabytes)
9760 on some systems. To do so, Configure can be run with -Duselargefiles.
9762 If this doesn't make any sense to you, just accept the default '$dflt'.
9764 rp='Try to understand large files, if available?'
9767 y|Y) val="$define" ;;
9774 : Look for a hint-file generated 'call-back-unit'. If the
9775 : user has specified that a large files perl is to be built,
9776 : we may need to set or change some other defaults.
9777 if $test -f uselargefiles.cbu; then
9778 echo "Your platform has some specific hints regarding large file builds, using them..."
9779 . ./uselargefiles.cbu
9781 case "$uselargefiles" in
9783 if $test -f uselargefiles.cbu; then
9785 echo "Rechecking to see how big your file offsets are..." >&4
9787 #include <sys/types.h>
9791 printf("%d\n", (int)sizeof($lseektype));
9796 if eval $compile_ok; then
9797 lseeksize=`$run ./try`
9798 $echo "Your file offsets are now $lseeksize bytes long."
9802 echo "(I can't seem to compile the test program. Guessing...)"
9803 rp="What is the size of your file offsets (in bytes)?"
9808 *_t) zzz="$fpostype" ;;
9811 $echo $n "Rechecking the size of $zzz...$c" >&4
9813 #include <sys/types.h>
9820 printf("%d\n", (int)sizeof($fpostype));
9825 if eval $compile_ok; then
9830 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9833 echo " $fpossize bytes." >&4
9839 echo "(I can't compile the test program. Guessing...)" >&4
9840 rp="What is the size of your file positions (in bytes)?"
9849 : Check if we want perlio
9852 : Set the vendorbin variables
9853 case "$vendorprefix" in
9854 '') d_vendorbin="$undef"
9858 *) d_vendorbin="$define"
9859 : determine where vendor-supplied executables go.
9860 case "$vendorbin" in
9861 '') dflt=$vendorprefix/bin ;;
9862 *) dflt="$vendorbin" ;;
9865 rp='Pathname for the vendor-supplied executables directory?'
9868 vendorbinexp="$ansexp"
9874 : Set the vendorhtml1dir variables
9875 case "$vendorprefix" in
9876 '') vendorhtml1dir=''
9877 vendorhtml1direxp=''
9879 *) : determine where vendor-supplied html pages go.
9880 : There is no standard location, so try to copy the previously-selected
9881 : directory structure for the core html pages.
9882 : XXX Better default suggestions would be welcome.
9883 case "$vendorhtml1dir" in
9884 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9885 *) dflt=$vendorhtml1dir ;;
9888 ''|' ') dflt=none ;;
9891 rp='Pathname for the vendor-supplied html pages?'
9893 vendorhtml1dir="$ans"
9894 vendorhtml1direxp="$ansexp"
9897 : Use ' ' for none so value is preserved next time through Configure
9898 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9899 prefixvar=vendorhtml1dir
9902 : Set the vendorhtml3dir variables
9903 case "$vendorprefix" in
9904 '') vendorhtml3dir=''
9905 vendorhtml3direxp=''
9907 *) : determine where vendor-supplied module html pages go.
9908 : There is no standard location, so try to copy the previously-selected
9909 : directory structure for the core html pages.
9910 : XXX Better default suggestions would be welcome.
9911 case "$vendorhtml3dir" in
9912 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9913 *) dflt=$vendorhtml3dir ;;
9916 ''|' ') dflt=none ;;
9919 rp='Pathname for the vendor-supplied html pages?'
9921 vendorhtml3dir="$ans"
9922 vendorhtml3direxp="$ansexp"
9925 : Use ' ' for none so value is preserved next time through Configure
9926 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9927 prefixvar=vendorhtml3dir
9930 : Set the vendorman1dir variables
9931 case "$vendorprefix" in
9932 '') vendorman1dir=''
9935 *) : determine where vendor-supplied manual pages go.
9936 case "$vendorman1dir" in
9937 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9938 *) dflt=$vendorman1dir ;;
9941 ''|' ') dflt=none ;;
9944 rp='Pathname for the vendor-supplied manual section 1 pages?'
9946 vendorman1dir="$ans"
9947 vendorman1direxp="$ansexp"
9950 : Use ' ' for none so value is preserved next time through Configure
9951 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9952 prefixvar=vendorman1dir
9955 : Set the vendorman3dir variables
9956 case "$vendorprefix" in
9957 '') vendorman3dir=''
9960 *) : determine where vendor-supplied module manual pages go.
9961 case "$vendorman3dir" in
9962 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9963 *) dflt=$vendorman3dir ;;
9966 ''|' ') dflt=none ;;
9969 rp='Pathname for the vendor-supplied manual section 3 pages?'
9971 vendorman3dir="$ans"
9972 vendorman3direxp="$ansexp"
9975 : Use ' ' for none so value is preserved next time through Configure
9976 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9977 prefixvar=vendorman3dir
9980 : Set the vendorscript variables
9981 case "$vendorprefix" in
9982 '') d_vendorscript="$undef"
9986 *) d_vendorscript="$define"
9987 : determine where vendor-supplied scripts go.
9988 case "$vendorscript" in
9989 '') dflt=$vendorprefix/script
9990 $test -d $dflt || dflt=$vendorbin ;;
9991 *) dflt="$vendorscript" ;;
9995 The installation process will create a directory for
9996 vendor-supplied scripts.
10000 rp='Pathname for the vendor-supplied scripts directory?'
10002 vendorscript="$ans"
10003 vendorscriptexp="$ansexp"
10006 prefixvar=vendorscript
10009 : see if qgcvt exists
10013 : Check what kind of doubles your system has
10014 $echo "Checking the kind of doubles you have..." >&4
10016 #$i_stdlib I_STDLIB
10017 #define DOUBLESIZE $doublesize
10019 #include <stdlib.h>
10022 static const double d = -0.1;
10024 unsigned const char* b = (unsigned const char*)(&d);
10025 #if DOUBLESIZE == 4
10026 if (b[0] == 0xCD && b[3] == 0xBD) {
10027 /* IEEE 754 32-bit little-endian */
10031 if (b[0] == 0xBD && b[3] == 0xCD) {
10032 /* IEEE 754 32-bit big-endian */
10036 if (b[0] == 0xCC && b[3] == 0xCC) {
10037 /* VAX format F, 32-bit PDP-style mixed endian. */
10041 if (b[0] == 0xC0 && b[3] == 0x9A) {
10042 /* IBM single 32-bit */
10047 #if DOUBLESIZE == 8
10048 if (b[0] == 0x9A && b[7] == 0xBF) {
10049 /* IEEE 754 64-bit little-endian */
10053 if (b[0] == 0xBF && b[7] == 0x9A) {
10054 /* IEEE 754 64-bit big-endian */
10058 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10059 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10060 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10061 * 99 99 b9 bf 9a 99 99 99 */
10065 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10066 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10067 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10068 * 99 99 99 9a bf b9 99 99 */
10072 if (b[0] == 0xCC && b[7] == 0xCC) {
10073 /* VAX format D, 64-bit PDP-style mixed endian. */
10077 if (b[0] == 0xD9 && b[7] == 0x99) {
10078 /* VAX format G, 64-bit PDP-style mixed endian. */
10082 if (b[0] == 0xC0 && b[7] == 0x9A) {
10083 /* IBM double 64-bit */
10087 if (b[0] == 0xBF && b[7] == 0xCD) {
10088 /* CRAY single 64-bit */
10093 #if DOUBLESIZE == 16
10094 if (b[0] == 0x9A && b[15] == 0xBF) {
10095 /* IEEE 754 128-bit little-endian */
10099 if (b[0] == 0xBF && b[15] == 0x9A) {
10100 /* IEEE 754 128-bit big-endian */
10105 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10106 * Whether those environments can still build Perl is debatable. */
10107 printf("-1\n"); /* unknown */
10112 if eval $compile; then
10113 doublekind=`$run ./try`
10117 case "$doublekind" in
10118 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10119 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10120 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10121 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10122 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10123 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10124 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10125 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10126 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10127 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10128 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10129 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10130 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10131 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10132 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10134 d_double_style_ieee=$undef
10135 d_double_style_vax=$undef
10136 d_double_style_ibm=$undef
10137 d_double_style_cray=$undef
10138 case "$doublekind" in
10139 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10140 9|10|11) d_double_style_vax=$define ;;
10141 12|13) d_double_style_ibm=$define ;;
10142 14) d_double_style_cray=$define ;;
10144 case "$d_double_style_ieee" in
10146 d_double_has_inf=$define
10147 d_double_has_nan=$define
10148 d_double_has_negative_zero=$define
10149 d_double_has_subnormals=$define
10152 d_double_has_inf=$undef
10153 d_double_has_nan=$undef
10154 d_double_has_negative_zero=$undef
10155 d_double_has_subnormals=$undef
10160 : Check print/scan long double stuff
10163 if $test X"$d_longdbl" = X"$define"; then
10165 echo "Checking how to print long doubles..." >&4
10167 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10168 $cat >try.c <<'EOCP'
10169 #include <sys/types.h>
10172 double d = 123.456;
10173 printf("%.3f\n", d);
10177 if eval $compile; then
10181 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10182 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10183 echo "We will use %f."
10189 if $test X"$sPRIfldbl" = X; then
10190 $cat >try.c <<'EOCP'
10191 #include <sys/types.h>
10194 long double d = 123.456;
10195 printf("%.3Lf\n", d);
10199 if eval $compile; then
10203 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10204 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10205 echo "We will use %Lf."
10211 if $test X"$sPRIfldbl" = X; then
10212 $cat >try.c <<'EOCP'
10213 #include <sys/types.h>
10216 long double d = 123.456;
10217 printf("%.3llf\n", d);
10221 if eval $compile; then
10225 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10226 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10227 echo "We will use %llf."
10233 if $test X"$sPRIfldbl" = X; then
10234 $cat >try.c <<'EOCP'
10235 #include <sys/types.h>
10238 long double d = 123.456;
10239 printf("%.3lf\n", d);
10243 if eval $compile; then
10247 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10248 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10249 echo "We will use %lf."
10255 if $test X"$sPRIfldbl" = X; then
10256 echo "Cannot figure out how to print long doubles." >&4
10258 sSCNfldbl=$sPRIfldbl # expect consistency
10265 case "$sPRIfldbl" in
10266 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10267 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10268 d_SCNfldbl="$undef";
10270 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10271 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10272 d_SCNfldbl="$define";
10276 : Before committing on uselongdouble, see whether that looks sane.
10277 if $test "$uselongdouble" = "$define"; then
10280 echo "Checking if your long double math functions work right..." >&4
10285 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10288 case "$osname:$gccversion" in
10289 aix:) saveccflags="$ccflags"
10290 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10293 if eval $compile_ok; then
10297 3) echo "Your long double math functions are working correctly." >&4 ;;
10298 *) echo "Your long double math functions are broken, not using long doubles." >&4
10299 uselongdouble=$undef
10303 case "$osname:$gccversion" in
10304 aix:) ccflags="$saveccflags" ;; # restore
10308 : Check how to convert floats to strings.
10310 if test "X$d_Gconvert" = X; then
10313 echo "Checking for an efficient way to convert floats to strings."
10315 case "$uselongdouble" in
10316 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10318 case "$d_longdbl" in
10319 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10321 case "$d_PRIgldbl" in
10322 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10325 #ifdef TRY_gconvert
10326 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10327 const char *myname = "gconvert";
10330 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10331 const char *myname = "gcvt";
10334 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10335 const char *myname = "qgcvt";
10336 #define DOUBLETYPE long double
10339 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10340 #ifdef HAS_PRIgldbl
10341 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10343 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10346 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10348 const char *myname = "sprintf";
10352 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10353 #define DOUBLETYPE long double
10355 #define DOUBLETYPE double
10361 #$i_stdlib I_STDLIB
10363 #include <stdlib.h>
10365 #include <string.h>
10367 void checkit(const char *expect, char *got)
10369 if (strcmp(expect, got)) {
10370 printf("%s oddity: Expected %s, got %s\n",
10371 myname, expect, got);
10381 /* This must be 1st test on (which?) platform */
10382 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10383 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10384 checkit("0.1", buf);
10386 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10387 checkit("0.01", buf);
10389 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10390 checkit("0.001", buf);
10392 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10393 checkit("0.0001", buf);
10395 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10396 if (strlen(buf) > 5)
10397 checkit("9e-005", buf); /* for Microsoft ?? */
10399 checkit("9e-05", buf);
10401 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10404 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10405 checkit("1.1", buf);
10407 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10408 checkit("1.01", buf);
10410 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10411 checkit("1.001", buf);
10413 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10414 checkit("1.0001", buf);
10416 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10417 checkit("1.00001", buf);
10419 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10420 checkit("1.000001", buf);
10422 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10425 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10426 checkit("-1", buf);
10428 /* Some Linux gcvt's give 1.e+5 here. */
10429 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10430 checkit("100000", buf);
10432 /* Some Linux gcvt's give -1.e+5 here. */
10433 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10434 checkit("-100000", buf);
10436 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10437 checkit("123.456", buf);
10439 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10440 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10441 /* 34 should be enough to scare even long double
10442 * places into using the e notation. */
10443 if (strlen(buf) > 5)
10444 checkit("1e+034", buf); /* for Microsoft */
10446 checkit("1e+34", buf);
10448 /* For Perl, if you add additional tests here, also add them to
10449 * t/base/num.t for benefit of platforms not using Configure or
10450 * overriding d_Gconvert */
10455 : first add preferred functions to our list
10457 for xxx_convert in $gconvert_preference; do
10458 case $xxx_convert in
10459 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10460 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10463 : then add any others
10464 for xxx_convert in gconvert gcvt sprintf; do
10465 case "$xxx_list" in
10467 *) xxx_list="$xxx_list $xxx_convert" ;;
10471 case "$d_longdbl$uselongdouble" in
10473 : again, add preferred functions to our list first
10475 for xxx_convert in $gconvert_ld_preference; do
10476 case $xxx_convert in
10477 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10478 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10481 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10482 for xxx_convert in qgcvt sprintf $xxx_list; do
10483 case "$xxx_ld_list" in
10484 $xxx_convert*|*" $xxx_convert"*) ;;
10485 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10488 : if sprintf cannot do long doubles, move it to the end
10489 if test "$d_PRIgldbl" != "$define"; then
10490 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10492 : if no qgcvt, remove it
10493 if test "$d_qgcvt" != "$define"; then
10494 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10497 xxx_list="$xxx_ld_list"
10501 for xxx_convert in $xxx_list; do
10502 echo "Trying $xxx_convert..."
10503 $rm -f try try$_o core
10504 set try -DTRY_$xxx_convert
10505 if eval $compile; then
10506 echo "$xxx_convert() found." >&4
10507 if $run ./try; then
10508 echo "I'll use $xxx_convert to convert floats into a string." >&4
10511 echo "...But $xxx_convert didn't work as I expected."
10515 echo "$xxx_convert NOT found." >&4
10520 if test X$xxx_convert = X; then
10521 echo "*** WHOA THERE!!! ***" >&4
10522 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10523 xxx_convert=sprintf
10526 case "$xxx_convert" in
10527 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10528 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10529 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10530 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10531 "$define$define$define")
10532 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10533 "$define$define$undef")
10534 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10535 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10543 : see if _fwalk exists
10547 : see if accept4 exists
10548 set accept4 d_accept4
10551 : Initialize h_fcntl
10554 : Initialize h_sysfile
10557 : access call always available on UNIX
10558 set access d_access
10561 : locate the flags for 'access()'
10562 case "$d_access" in
10565 $cat >access.c <<EOCP
10566 #include <sys/types.h>
10571 #include <sys/file.h>
10574 #include <unistd.h>
10576 #$i_stdlib I_STDLIB
10578 #include <stdlib.h>
10584 : check sys/file.h first, no particular reason here
10585 if $test `./findhdr sys/file.h` && \
10586 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10588 echo "<sys/file.h> defines the *_OK access constants." >&4
10589 elif $test `./findhdr fcntl.h` && \
10590 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10592 echo "<fcntl.h> defines the *_OK access constants." >&4
10593 elif $test `./findhdr unistd.h` && \
10594 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10595 echo "<unistd.h> defines the *_OK access constants." >&4
10597 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10603 : see if accessx exists
10604 set accessx d_accessx
10607 : see if acosh exists
10611 : see if aintl exists
10615 : see if alarm exists
10619 : see if 64bit time functions exists
10621 set ctime64 d_ctime64
10624 set localtime64 d_localtime64
10627 set gmtime64 d_gmtime64
10630 set mktime64 d_mktime64
10633 set difftime64 d_difftime64
10636 set asctime64 d_asctime64
10639 : see if POSIX threads are available
10640 set pthread.h i_pthread
10643 : define a function to check prototypes
10644 $cat > protochk <<EOSH
10647 optimize="$optimize"
10651 usethreads=$usethreads
10652 i_pthread=$i_pthread
10653 pthread_h_first=$pthread_h_first
10656 $cat >> protochk <<'EOSH'
10661 while test $# -ge 2; do
10663 $define) echo "#include <$2>" >> try.c ;;
10664 literal) echo "$2" >> try.c ;;
10666 # Extra magic for the benefit of systems that need pthread.h
10667 # to be included early to correctly detect threadsafe functions.
10668 # Such functions must guarantee themselves, though, that the usethreads
10669 # and i_pthread have been defined, before calling protochk.
10670 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10671 echo "#include <pthread.h>" >> try.c
10676 cat >> try.c <<'EOCP'
10677 #define _(args) args
10679 echo "$foo" >> try.c
10680 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10681 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10687 $eunicefix protochk
10689 : Define hasproto macro for Configure internal use
10690 hasproto='varname=$1; func=$2; shift; shift;
10691 while $test $# -ge 2; do
10693 $define) echo "#include <$2>";;
10694 literal) echo "$2" ;;
10698 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10699 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10700 echo "$func() prototype found.";
10703 echo "$func() prototype NOT found.";
10710 : see if sys/types.h has to be included
10711 set sys/types.h i_systypes
10714 : see if sys/select.h has to be included
10715 set sys/select.h i_sysselct
10718 : Define hasfield macro for Configure internal use
10719 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10720 while $test $# -ge 2; do
10722 $define) echo "#include <$2>";;
10726 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10728 if eval $compile; then
10737 : see if we should include sys/time.h
10740 if test "X$timeincl" = X; then
10741 echo "Testing to see if we should include <sys/time.h>." >&4
10742 $echo $n "I'm now running the test program...$c"
10744 #include <sys/types.h>
10747 #ifdef SYSTIMEKERNEL
10750 #include <sys/time.h>
10753 #include <sys/select.h>
10755 #$i_stdlib I_STDLIB
10757 #include <stdlib.h>
10763 struct timeval bar;
10766 struct timezone tzp;
10768 if (foo.tm_sec == foo.tm_sec)
10771 if (bar.tv_sec == bar.tv_sec)
10778 for s_timezone in '-DS_TIMEZONE' ''; do
10780 for s_timeval in '-DS_TIMEVAL' ''; do
10781 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10782 for i_systime in '-DI_SYSTIME' ''; do
10785 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10786 if eval $compile; then
10787 set X $i_systime $i_systimek $sysselect $s_timeval
10791 $echo $n "Succeeded with $flags$c"
10802 *SYSTIMEKERNEL*) i_systimek="$define"
10803 timeincl=`./findhdr sys/time.h`
10804 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10805 *) i_systimek="$undef";;
10808 *I_SYSTIME*) i_systime="$define"
10809 timeincl=`./findhdr sys/time.h`" $timeincl"
10810 echo "We'll include <sys/time.h>." >&4;;
10811 *) i_systime="$undef";;
10815 : see if struct tm knows about tm_zone
10816 case "$i_systime$i_time" in
10819 echo "Checking to see if your struct tm has tm_zone field..." >&4
10820 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10828 case "$d_tm_tm_zone" in
10829 "$define") echo "Yes, it does." ;;
10830 *) echo "No, it doesn't." ;;
10832 : see if struct tm knows about tm_gmtoff
10833 case "$i_systime$i_time" in
10836 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10837 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10845 case "$d_tm_tm_gmtoff" in
10846 "$define") echo "Yes, it does." ;;
10847 *) echo "No, it doesn't." ;;
10850 : see if asctime_r exists
10851 set asctime_r d_asctime_r
10853 case "$d_asctime_r" in
10855 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10856 case "$d_asctime_r_proto:$usethreads" in
10857 ":define") d_asctime_r_proto=define
10858 set d_asctime_r_proto asctime_r $hdrs
10862 case "$d_asctime_r_proto" in
10864 case "$asctime_r_proto" in
10865 ''|0) try='char* asctime_r(const struct tm*, char*);'
10866 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10868 case "$asctime_r_proto" in
10869 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10870 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10872 case "$asctime_r_proto" in
10873 ''|0) try='int asctime_r(const struct tm*, char*);'
10874 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10876 case "$asctime_r_proto" in
10877 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10878 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10880 case "$asctime_r_proto" in
10881 ''|0) d_asctime_r=undef
10883 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10884 * ) case "$asctime_r_proto" in
10885 REENTRANT_PROTO*) ;;
10886 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10888 echo "Prototype: $try" ;;
10891 *) case "$usethreads" in
10892 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10899 *) asctime_r_proto=0
10903 : see if asinh exists
10907 : see if atanh exists
10911 : see if atolf exists
10915 : see if atoll exists
10919 : See if a file contains compiler warnings
10920 : See if a file contains compiler warnings
10923 cat >compiler_warning <<EOSS
10924 # Sample for aix ('.5' indicates the column number in the line):
10925 # "op.h", line 203.5: 1506-159 (E) Bit field type specified for op_type
10926 # Since the word 'warning' isn't present, use a fairly rigorous match of what
10927 # warning messages look like
10928 # " o p . h ", line 203 . 5 : 1506 - 159 ( E )
10929 $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"
10931 compiler_warning=./compiler_warning
10932 chmod +x $compiler_warning
10934 # Maybe a colon after the 'warning' would be appropriate
10935 *) compiler_warning="$contains -i warning"
10939 : Look for GCC-style attribute format
10940 case "$d_attribute_format" in
10943 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10944 $cat >attrib.c <<'EOCP'
10946 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10948 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10949 if $compiler_warning attrib.out >/dev/null 2>&1; then
10950 echo "Your C compiler doesn't support __attribute__((format))."
10953 echo "Your C compiler supports __attribute__((format))."
10957 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10961 *) val="$d_attribute_format" ;;
10963 set d_attribute_format
10967 : Look for GCC-style attribute format with null format allowed
10968 case "$d_printf_format_null" in
10969 '') case "$d_attribute_format" in
10972 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10973 $cat >attrib.c <<EOCP
10975 #$i_stdlib I_STDLIB
10977 #include <stdlib.h>
10979 #$i_inttypes I_INTTYPES
10981 #include <inttypes.h>
10984 #define intptr_t int
10986 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10987 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
10988 int main () { exit(null_printf(NULL)); }
10990 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10991 : run the executable in case it produces a run-time warning
10992 if $run ./attrib >>attrib.out 2>&1; then
10993 if $compiler_warning attrib.out >/dev/null 2>&1; then
10994 echo "Your C compiler doesn't allow __printf__ format to be null."
10997 echo "Your C compiler allows __printf__ format to be null."
11001 echo "Your C compiler executable failed with __printf__ format null."
11005 echo "Your C compiler fails with __printf__ format null."
11012 *) val="$d_printf_format_null" ;;
11014 set d_printf_format_null
11018 : Look for GCC-style attribute malloc
11019 case "$d_attribute_malloc" in
11022 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11023 $cat >attrib.c <<'EOCP'
11025 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11027 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11028 if $compiler_warning attrib.out >/dev/null 2>&1; then
11029 echo "Your C compiler doesn't support __attribute__((malloc))."
11032 echo "Your C compiler supports __attribute__((malloc))."
11036 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11040 *) val="$d_attribute_malloc" ;;
11042 set d_attribute_malloc
11046 : Look for GCC-style attribute nonnull
11047 case "$d_attribute_nonnull" in
11050 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11051 $cat >attrib.c <<'EOCP'
11053 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11055 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11056 if $compiler_warning attrib.out >/dev/null 2>&1; then
11057 echo "Your C compiler doesn't support __attribute__((nonnull))."
11060 echo "Your C compiler supports __attribute__((nonnull))."
11064 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11068 *) val="$d_attribute_nonnull" ;;
11070 set d_attribute_nonnull
11074 : Look for GCC-style attribute noreturn
11075 case "$d_attribute_noreturn" in
11078 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11079 $cat >attrib.c <<'EOCP'
11081 void fall_over_dead( void ) __attribute__((noreturn));
11083 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11084 if $compiler_warning attrib.out >/dev/null 2>&1; then
11085 echo "Your C compiler doesn't support __attribute__((noreturn))."
11088 echo "Your C compiler supports __attribute__((noreturn))."
11092 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11096 *) val="$d_attribute_noreturn" ;;
11098 set d_attribute_noreturn
11102 : Look for GCC-style attribute pure
11103 case "$d_attribute_pure" in
11106 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11107 $cat >attrib.c <<'EOCP'
11109 int square( int n ) __attribute__((pure));
11111 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11112 if $compiler_warning attrib.out >/dev/null 2>&1; then
11113 echo "Your C compiler doesn't support __attribute__((pure))."
11116 echo "Your C compiler supports __attribute__((pure))."
11120 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11124 *) val="$d_attribute_pure" ;;
11126 set d_attribute_pure
11130 : Look for GCC-style attribute unused
11131 case "$d_attribute_unused" in
11134 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11135 $cat >attrib.c <<'EOCP'
11137 int do_something( int dummy __attribute__((unused)), int n );
11139 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11140 if $compiler_warning attrib.out >/dev/null 2>&1; then
11141 echo "Your C compiler doesn't support __attribute__((unused))."
11144 echo "Your C compiler supports __attribute__((unused))."
11148 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11152 *) val="$d_attribute_unused" ;;
11154 set d_attribute_unused
11158 : Look for GCC-style attribute deprecated
11159 case "$d_attribute_deprecated" in
11162 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11163 $cat >attrib.c <<'EOCP'
11165 int I_am_deprecated(void) __attribute__((deprecated));
11167 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11168 if $compiler_warning attrib.out >/dev/null 2>&1; then
11169 echo "Your C compiler doesn't support __attribute__((deprecated))."
11172 echo "Your C compiler supports __attribute__((deprecated))."
11176 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11180 *) val="$d_attribute_deprecated" ;;
11182 set d_attribute_deprecated
11186 : Look for GCC-style attribute warn_unused_result
11187 case "$d_attribute_warn_unused_result" in
11190 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11191 $cat >attrib.c <<'EOCP'
11193 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11195 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11196 if $compiler_warning attrib.out >/dev/null 2>&1; then
11197 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11200 echo "Your C compiler supports __attribute__((warn_unused_result))."
11204 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11208 *) val="$d_attribute_warn_unused_result" ;;
11210 set d_attribute_warn_unused_result
11214 : Look for GCC-style attribute always_inline
11215 case "$d_attribute_always_inline" in
11218 echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
11219 $cat >attrib.c <<'EOCP'
11221 static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
11223 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11224 if $compiler_warning attrib.out >/dev/null 2>&1; then
11225 echo "Your C compiler doesn't support __attribute__((always_inline))."
11228 echo "Your C compiler supports __attribute__((always_inline))."
11232 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11236 *) val="$d_attribute_always_inline" ;;
11238 set d_attribute_always_inline
11242 : see if getpgrp exists
11243 set getpgrp d_getpgrp
11246 case "$d_getpgrp" in
11249 echo "Checking to see which flavor of getpgrp is in use..."
11252 #$i_unistd I_UNISTD
11253 #include <sys/types.h>
11255 # include <unistd.h>
11257 #$i_stdlib I_STDLIB
11259 #include <stdlib.h>
11263 if (getuid() == 0) {
11264 printf("(I see you are running Configure as super-user...)\n");
11267 #ifdef TRY_BSD_PGRP
11268 if (getpgrp(1) == 0)
11277 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11278 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11280 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11281 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11284 echo "I can't seem to compile and run the test program."
11286 xxx="a USG one, i.e. you use getpgrp()."
11288 # SVR4 systems can appear rather BSD-ish.
11289 case "$i_unistd" in
11291 xxx="a BSD one, i.e. you use getpgrp(pid)."
11295 xxx="probably a USG one, i.e. you use getpgrp()."
11300 echo "Assuming your getpgrp is $xxx" >&4
11309 : see if setpgrp exists
11310 set setpgrp d_setpgrp
11313 case "$d_setpgrp" in
11316 echo "Checking to see which flavor of setpgrp is in use..."
11319 #$i_unistd I_UNISTD
11320 #include <sys/types.h>
11322 # include <unistd.h>
11324 #$i_stdlib I_STDLIB
11326 #include <stdlib.h>
11330 if (getuid() == 0) {
11331 printf("(I see you are running Configure as super-user...)\n");
11334 #ifdef TRY_BSD_PGRP
11335 if (-1 == setpgrp(1, 1))
11338 if (setpgrp() != -1)
11344 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11345 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11347 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11348 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11351 echo "(I can't seem to compile and run the test program.)"
11353 xxx="a USG one, i.e. you use setpgrp()."
11355 # SVR4 systems can appear rather BSD-ish.
11356 case "$i_unistd" in
11358 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11362 xxx="probably a USG one, i.e. you use setpgrp()."
11367 echo "Assuming your setpgrp is $xxx" >&4
11376 : Look for GCC-style __builtin_add_overflow
11377 case "$d_builtin_add_overflow" in
11380 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11381 $cat >try.c <<'EOCP'
11383 const unsigned int uint_max = ~0u;
11384 int target_int = 0;
11385 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11388 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11391 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11398 if eval $compile && $run ./try; then
11399 echo "Your C compiler supports __builtin_add_overflow."
11402 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11406 *) val="$d_builtin_add_overflow" ;;
11409 set d_builtin_add_overflow
11413 : Look for GCC-style __builtin_sub_overflow
11414 case "$d_builtin_sub_overflow" in
11417 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11418 $cat >try.c <<'EOCP'
11420 const unsigned int uint_max = ~0u;
11421 int target_int = 0;
11422 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11425 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11428 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11435 if eval $compile && $run ./try; then
11436 echo "Your C compiler supports __builtin_sub_overflow."
11439 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11443 *) val="$d_builtin_sub_overflow" ;;
11446 set d_builtin_sub_overflow
11450 : Look for GCC-style __builtin_mul_overflow
11451 case "$d_builtin_mul_overflow" in
11454 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11455 $cat >try.c <<'EOCP'
11457 const unsigned int uint_max = ~0u;
11458 int target_int = 0;
11459 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11462 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11465 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11472 if eval $compile && $run ./try; then
11473 echo "Your C compiler supports __builtin_mul_overflow."
11476 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11480 *) val="$d_builtin_mul_overflow" ;;
11483 set d_builtin_mul_overflow
11487 : Look for GCC-style __builtin_choose_expr
11488 case "$d_builtin_choose_expr" in
11491 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11492 $cat >try.c <<'EOCP'
11493 #include <assert.h>
11494 #include <stdlib.h>
11497 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11500 assert( SYRINX(1) == 2112 );
11501 assert( SYRINX(1) != 5150 );
11502 assert( SYRINX(0) == 5150 );
11503 assert( SYRINX(0) != 2112 );
11504 puts( "All good!" );
11510 if eval $compile && $run ./try; then
11511 echo "Your C compiler supports __builtin_choose_expr."
11514 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11518 *) val="$d_builtin_choose_expr" ;;
11521 set d_builtin_choose_expr
11525 : Look for GCC-style __builtin_expect
11526 case "$d_builtin_expect" in
11529 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11530 $cat >try.c <<'EOCP'
11533 if ( __builtin_expect(n, 0) ) n = 1;
11534 /* Remember shell exit code truth is 0, C truth is non-zero */
11539 if eval $compile && $run ./try; then
11540 echo "Your C compiler supports __builtin_expect."
11543 echo "Your C compiler doesn't seem to understand __builtin_expect."
11547 *) val="$d_builtin_expect" ;;
11550 set d_builtin_expect
11554 : see if the Compiler supports C99 variadic macros
11555 echo "Checking for C99 variadic macros." >&4
11558 #include <stdarg.h>
11560 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11564 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11570 if eval $compile && $run ./try 2>&1 >/dev/null; then
11571 case "`$run ./try`" in
11573 echo "You have C99 variadic macros." >&4
11574 d_c99_variadic_macros="$define"
11577 echo "You don't have functional C99 variadic macros." >&4
11578 d_c99_variadic_macros="$undef"
11582 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11583 d_c99_variadic_macros="$undef"
11587 : see if signal is declared as pointer to function returning int or void
11589 xxx=`./findhdr signal.h`
11590 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11591 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11592 echo "You have int (*signal())() instead of void." >&4
11594 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11595 echo "You have void (*signal())()." >&4
11597 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11598 echo "You have int (*signal())() instead of void." >&4
11600 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11601 echo "You have void (*signal())()." >&4
11604 case "$d_voidsig" in
11606 echo "I can't determine whether signal handler returns void or int..." >&4
11608 rp="What type does your signal handler return?"
11611 v*) val="$define";;
11615 echo "As you already told me, signal handler returns void." >&4
11618 *) echo "As you already told me, signal handler returns int." >&4
11625 case "$d_voidsig" in
11626 "$define") signal_t="void";;
11627 *) signal_t="int";;
11631 : check for ability to cast large floats to 32-bit ints.
11633 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11634 if $test "$intsize" -ge 4; then
11641 #$i_stdlib I_STDLIB
11643 #include <stdlib.h>
11645 #include <sys/types.h>
11646 #include <signal.h>
11647 $signal_t blech(int s) { exit(3); }
11654 signal(SIGFPE, blech);
11656 /* Don't let compiler optimize the test away. Store the number
11657 in a writable string for gcc to pass to sscanf under HP-UX.
11659 sprintf(str, "2147483647");
11660 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11664 /* x86 processors will probably give 0x8000 0000, which is a
11665 sign change. We don't want that. We want to mimic SPARC
11666 behavior here, which is to preserve the sign and give
11669 if (i32 != ($xxx) f)
11675 if eval $compile_ok; then
11676 $run ./try 2>/dev/null
11679 echo "(I can't seem to compile the test program--assuming it can't)"
11684 echo "Yup, it can."
11687 echo "Nope, it can't."
11694 : check for ability to cast negative floats to unsigned
11696 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11699 #$i_stdlib I_STDLIB
11701 #include <stdlib.h>
11703 #include <sys/types.h>
11704 #include <signal.h>
11705 $signal_t blech(int s) { exit(7); }
11706 $signal_t blech_in_list(int s) { exit(4); }
11707 unsigned long dummy_long(unsigned long p) { return p; }
11708 unsigned int dummy_int(unsigned int p) { return p; }
11709 unsigned short dummy_short(unsigned short p) { return p; }
11713 unsigned long along;
11715 unsigned short ashort;
11719 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11720 a direct f = -123. assignment. gcc-2.8.0 reportedly
11721 optimized the whole file away
11723 /* Store the number in a writable string for gcc to pass to
11724 sscanf under HP-UX.
11726 sprintf(str, "-123");
11727 sscanf(str, "%lf", &f); /* f = -123.; */
11729 signal(SIGFPE, blech);
11730 along = (unsigned long)f;
11731 aint = (unsigned int)f;
11732 ashort = (unsigned short)f;
11733 if (along != (unsigned long)-123)
11735 if (aint != (unsigned int)-123)
11737 if (ashort != (unsigned short)-123)
11739 sprintf(str, "1073741824.");
11740 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11743 along = (unsigned long)f;
11744 if (along != 0x80000000)
11748 along = (unsigned long)f;
11749 if (along != 0x7fffffff)
11753 along = (unsigned long)f;
11754 if (along != 0x80000001)
11758 signal(SIGFPE, blech_in_list);
11759 sprintf(str, "123.");
11760 sscanf(str, "%lf", &f); /* f = 123.; */
11761 along = dummy_long((unsigned long)f);
11762 aint = dummy_int((unsigned int)f);
11763 ashort = dummy_short((unsigned short)f);
11764 if (along != (unsigned long)123)
11766 if (aint != (unsigned int)123)
11768 if (ashort != (unsigned short)123)
11775 if eval $compile_ok; then
11776 $run ./try 2>/dev/null
11779 echo "(I can't seem to compile the test program--assuming it can't)"
11782 case "$castflags" in
11784 echo "Yup, it can."
11787 echo "Nope, it can't."
11794 : see if cbrt exists
11798 : see if chown exists
11802 : see if chroot exists
11803 set chroot d_chroot
11806 : see if chsize exists
11807 set chsize d_chsize
11810 : see if class exists
11814 : see if clearenv exists
11815 set clearenv d_clearenv
11818 : Define hasstruct macro for Configure internal use
11819 hasstruct='varname=$1; struct=$2; shift; shift;
11820 while $test $# -ge 2; do
11822 $define) echo "#include <$2>";;
11826 echo "int main () { struct $struct foo; }" >> try.c;
11828 if eval $compile; then
11837 : see whether socket exists
11841 $echo $n "Hmm... $c" >&4
11842 if set socket val -f d_socket; eval $csym; $val; then
11843 echo "Looks like you have Berkeley networking support." >&4
11845 if set setsockopt val -f; eval $csym; $val; then
11848 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11849 d_oldsock="$define"
11852 if $contains socklib libc.list >/dev/null 2>&1; then
11853 echo "Looks like you have Berkeley networking support." >&4
11855 : we will have to assume that it supports the 4.2 BSD interface
11858 echo "You don't have Berkeley networking in libc$_a..." >&4
11859 if test "X$d_socket" = "X$define"; then
11860 echo "...but you seem to believe that you have sockets." >&4
11862 for net in net socket
11864 if test -f $sysroot/usr/lib/lib$net$_a; then
11865 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11866 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11867 if $contains socket libc.list >/dev/null 2>&1; then
11872 echo "...but the Wollongong group seems to have hacked it in." >&4
11873 sockethdr="-I$sysroot/usr/netinclude"
11876 echo "Found Berkeley sockets interface in lib$net." >&4
11877 if $contains setsockopt libc.list >/dev/null 2>&1; then
11880 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11881 d_oldsock="$define"
11887 if test "X$d_socket" != "X$define"; then
11888 echo "or anywhere else I see." >&4
11896 : see if socketpair exists
11897 set socketpair d_sockpair
11901 echo "Checking the availability sa_len in the sock struct ..." >&4
11903 #include <sys/types.h>
11904 #include <sys/socket.h>
11906 struct sockaddr sa;
11907 return (sa.sa_len);
11911 set try; if eval $compile; then
11914 set d_sockaddr_sa_len; eval $setvar
11917 echo "Checking the availability struct sockaddr_in6 ..." >&4
11919 #include <sys/types.h>
11920 #include <sys/socket.h>
11921 #include <netinet/in.h>
11923 struct sockaddr_in6 sin6;
11924 return (sin6.sin6_family);
11928 set try; if eval $compile; then
11931 set d_sockaddr_in6; eval $setvar
11934 echo "Checking the availability struct sockaddr_storage ..." >&4
11936 #include <sys/types.h>
11937 #include <sys/socket.h>
11938 #include <netinet/in.h>
11940 struct sockaddr_storage sastor;
11941 return (sastor.ss_family);
11945 set try; if eval $compile; then
11948 set d_sockaddr_storage; eval $setvar
11951 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11953 #include <sys/types.h>
11954 #include <sys/socket.h>
11955 #include <netinet/in.h>
11957 struct sockaddr_in6 sin6;
11958 return (sin6.sin6_scope_id);
11962 set try; if eval $compile; then
11965 set d_sin6_scope_id; eval $setvar
11968 echo "Checking the availability struct ip_mreq ..." >&4
11970 #include <sys/types.h>
11971 #include <sys/socket.h>
11972 #include <netinet/in.h>
11974 struct ip_mreq mreq;
11975 return (mreq.imr_multiaddr.s_addr);
11979 set try; if eval $compile; then
11982 set d_ip_mreq; eval $setvar
11985 echo "Checking the availability struct ip_mreq_source ..." >&4
11987 #include <sys/types.h>
11988 #include <sys/socket.h>
11989 #include <netinet/in.h>
11991 struct ip_mreq_source mreq;
11992 return (mreq.imr_multiaddr.s_addr);
11996 set try; if eval $compile; then
11999 set d_ip_mreq_source; eval $setvar
12002 echo "Checking the availability struct ipv6_mreq ..." >&4
12004 #include <sys/types.h>
12005 #include <sys/socket.h>
12006 #include <netinet/in.h>
12008 struct ipv6_mreq mreq;
12009 return (mreq.ipv6mr_interface);
12013 set try; if eval $compile; then
12016 set d_ipv6_mreq; eval $setvar
12019 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12021 #include <sys/types.h>
12022 #include <sys/socket.h>
12023 #include <netinet/in.h>
12025 struct ipv6_mreq_source mreq;
12026 return (mreq.imr_multiaddr.s_addr);
12030 set try; if eval $compile; then
12033 set d_ipv6_mreq_source; eval $setvar
12036 echo "Checking the availability of certain socket constants..." >&4
12037 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12038 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12040 #include <sys/types.h>
12041 #include <sys/socket.h>
12047 set try; if eval $compile; then
12050 set d_${enum}; eval $setvar
12054 : see if this is a sys/uio.h system
12055 set sys/uio.h i_sysuio
12058 : Check for cmsghdr support
12060 echo "Checking to see if your system supports struct cmsghdr..." >&4
12061 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12063 case "$d_cmsghdr_s" in
12064 "$define") echo "Yes, it does." ;;
12065 *) echo "No, it doesn't." ;;
12068 : see if copysign exists
12069 set copysign d_copysign
12072 : see if copysignl exists
12073 set copysignl d_copysignl
12076 : see if crypt exists
12081 $define) cryptlib='' ;;
12082 *) if set crypt val -f d_crypt; eval $csym; $val; then
12083 echo 'crypt() found.' >&4
12087 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12088 if $test -z "$cryptlib"; then
12089 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12093 if $test -z "$cryptlib"; then
12094 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12098 if $test -z "$cryptlib"; then
12099 cryptlib=`./loc libcrypt$_a "" $libpth`
12103 if $test -z "$cryptlib"; then
12104 echo 'crypt() NOT found.' >&4
12115 : see if this is a crypt.h system
12116 set crypt.h i_crypt
12119 : see if crypt_r exists
12120 set crypt_r d_crypt_r
12122 case "$d_crypt_r" in
12124 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12125 case "$d_crypt_r_proto:$usethreads" in
12126 ":define") d_crypt_r_proto=define
12127 set d_crypt_r_proto crypt_r $hdrs
12131 case "$d_crypt_r_proto" in
12133 case "$crypt_r_proto" in
12134 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12135 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12137 case "$crypt_r_proto" in
12138 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12139 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12141 case "$crypt_r_proto" in
12142 ''|0) d_crypt_r=undef
12144 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12145 * ) case "$crypt_r_proto" in
12146 REENTRANT_PROTO*) ;;
12147 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12149 echo "Prototype: $try" ;;
12152 *) case "$usethreads" in
12153 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12164 : get csh whereabouts
12166 'csh') val="$undef" ;;
12167 *) val="$define" ;;
12171 : Respect a hint or command line value for full_csh.
12172 case "$full_csh" in
12173 '') full_csh=$csh ;;
12176 : see if ctermid exists
12177 set ctermid d_ctermid
12180 : see if ctermid_r exists
12181 set ctermid_r d_ctermid_r
12183 case "$d_ctermid_r" in
12185 hdrs="$i_systypes sys/types.h define stdio.h "
12186 case "$d_ctermid_r_proto:$usethreads" in
12187 ":define") d_ctermid_r_proto=define
12188 set d_ctermid_r_proto ctermid_r $hdrs
12192 case "$d_ctermid_r_proto" in
12194 case "$ctermid_r_proto" in
12195 ''|0) try='char* ctermid_r(char*);'
12196 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12198 case "$ctermid_r_proto" in
12199 ''|0) d_ctermid_r=undef
12201 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12202 * ) case "$ctermid_r_proto" in
12203 REENTRANT_PROTO*) ;;
12204 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12206 echo "Prototype: $try" ;;
12209 *) case "$usethreads" in
12210 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12217 *) ctermid_r_proto=0
12221 : see if ctime_r exists
12222 set ctime_r d_ctime_r
12224 case "$d_ctime_r" in
12226 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12227 case "$d_ctime_r_proto:$usethreads" in
12228 ":define") d_ctime_r_proto=define
12229 set d_ctime_r_proto ctime_r $hdrs
12233 case "$d_ctime_r_proto" in
12235 case "$ctime_r_proto" in
12236 ''|0) try='char* ctime_r(const time_t*, char*);'
12237 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12239 case "$ctime_r_proto" in
12240 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12241 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12243 case "$ctime_r_proto" in
12244 ''|0) try='int ctime_r(const time_t*, char*);'
12245 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12247 case "$ctime_r_proto" in
12248 ''|0) try='int ctime_r(const time_t*, char*, int);'
12249 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12251 case "$ctime_r_proto" in
12252 ''|0) d_ctime_r=undef
12254 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12255 * ) case "$ctime_r_proto" in
12256 REENTRANT_PROTO*) ;;
12257 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12259 echo "Prototype: $try" ;;
12262 *) case "$usethreads" in
12263 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12274 : see if cuserid exists
12275 set cuserid d_cuserid
12278 : see if dbm.h is available
12279 : see if dbmclose exists
12280 set dbmclose d_dbmclose
12283 case "$d_dbmclose" in
12293 *) set rpcsvc/dbm.h i_rpcsvcdbm
12298 *) echo "We won't be including <dbm.h>"
12308 : see if prototype for dbminit is available
12310 set d_dbminitproto dbminit $i_dbm dbm.h
12313 : see if difftime exists
12314 set difftime d_difftime
12317 : see if this is a dirent system
12319 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12321 echo "<dirent.h> found." >&4
12324 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12325 echo "<sys/dir.h> found." >&4
12328 xinc=`./findhdr sys/ndir.h`
12330 echo "<dirent.h> NOT found." >&4
12335 : Look for type of directory structure.
12337 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12339 case "$direntrytype" in
12341 case "$i_dirent" in
12342 $define) guess1='struct dirent' ;;
12343 *) guess1='struct direct' ;;
12346 *) guess1="$direntrytype"
12351 'struct dirent') guess2='struct direct' ;;
12352 *) guess2='struct dirent' ;;
12355 if $contains "$guess1" try.c >/dev/null 2>&1; then
12356 direntrytype="$guess1"
12357 echo "Your directory entries are $direntrytype." >&4
12358 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12359 direntrytype="$guess2"
12360 echo "Your directory entries seem to be $direntrytype." >&4
12362 echo "I don't recognize your system's directory entries." >&4
12363 rp="What type is used for directory entries on this system?"
12366 direntrytype="$ans"
12370 : see if the directory entry stores field length
12372 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12373 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12374 echo "Good, your directory entry keeps length information in d_namlen." >&4
12377 echo "Your directory entry does not know about the d_namlen field." >&4
12384 : Look for DIR.dd_fd
12385 case "$i_dirent" in
12387 echo "Checking to see if DIR has a dd_fd member variable" >&4
12389 #$i_stdlib I_STDLIB
12391 #include <stdlib.h>
12393 #include <dirent.h>
12403 if eval $compile; then
12404 echo "Yes, it does."
12407 echo "No, it does not."
12412 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12420 : see if this is an sysdir system
12421 set sys/dir.h i_sysdir
12424 : see if this is an sysndir system
12425 set sys/ndir.h i_sysndir
12430 $cat >dirfd.c <<EOM
12432 #$i_stdlib I_STDLIB
12434 #include <stdlib.h>
12436 #$i_dirent I_DIRENT /**/
12437 #$i_sysdir I_SYS_DIR /**/
12438 #$i_sysndir I_SYS_NDIR /**/
12439 #$i_systypes I_SYS_TYPES /**/
12440 #if defined(I_SYS_TYPES)
12441 #include <sys/types.h>
12443 #if defined(I_DIRENT)
12444 #include <dirent.h>
12447 #include <sys/ndir.h>
12450 #include <sys/dir.h>
12455 DIR *dirp = opendir(".");
12456 if (dirfd(dirp) >= 0)
12464 if eval $compile; then
12468 $define) echo "dirfd() found." >&4 ;;
12469 *) echo "dirfd() NOT found." >&4 ;;
12475 : see if dladdr exists
12476 set dladdr d_dladdr
12479 : see if dlerror exists
12482 set dlerror d_dlerror
12486 : see if dlfcn is available
12487 set dlfcn.h i_dlfcn
12490 : Check what extension to use for shared libs
12495 On a few systems, the dynamically loaded modules that perl generates and uses
12496 will need a different extension than shared libs. The default will probably
12502 *) dflt="$dlext" ;;
12504 rp='What is the extension of dynamically loaded modules'
12513 : Check if dlsym need a leading underscore
12519 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12520 $cat >dyna.c <<'EOM'
12527 #$i_stdlib I_STDLIB
12529 #include <stdlib.h>
12533 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12535 #include <sys/types.h>
12540 extern int fred() ;
12549 int mode = RTLD_LAZY ;
12551 handle = dlopen("./dyna.$dlext", mode) ;
12552 if (handle == NULL) {
12557 symbol = dlsym(handle, "fred") ;
12558 if (symbol == NULL) {
12559 /* try putting a leading underscore */
12560 symbol = dlsym(handle, "_fred") ;
12561 if (symbol == NULL) {
12574 : Call the object file tmp-dyna.o in case dlext=o.
12575 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12576 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12577 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12578 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12581 1) echo "Test program failed using dlopen." >&4
12582 echo "Perhaps you should not use dynamic loading." >&4;;
12583 2) echo "Test program failed using dlsym." >&4
12584 echo "Perhaps you should not use dynamic loading." >&4;;
12585 3) echo "dlsym needs a leading underscore" >&4
12587 4) echo "dlsym doesn't need a leading underscore." >&4;;
12590 echo "I can't compile and run the test program." >&4
12591 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12596 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12601 : see if drand48_r exists
12602 set drand48_r d_drand48_r
12604 case "$d_drand48_r" in
12606 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12607 case "$d_drand48_r_proto:$usethreads" in
12608 ":define") d_drand48_r_proto=define
12609 set d_drand48_r_proto drand48_r $hdrs
12613 case "$d_drand48_r_proto" in
12615 case "$drand48_r_proto" in
12616 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12617 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12619 case "$drand48_r_proto" in
12620 ''|0) d_drand48_r=undef
12622 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12623 * ) case "$drand48_r_proto" in
12624 REENTRANT_PROTO*) ;;
12625 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12627 echo "Prototype: $try" ;;
12630 *) case "$usethreads" in
12631 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12638 *) drand48_r_proto=0
12642 : see if prototype for drand48 is available
12644 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12647 : see if dup2 exists
12651 : see if dup3 exists
12655 : see if this is an xlocale.h system
12656 set xlocale.h i_xlocale
12659 : see if newlocale exists
12660 set newlocale d_newlocale
12663 : see if freelocale exists
12664 set freelocale d_freelocale
12667 : see if uselocale exists
12668 set uselocale d_uselocale
12671 : see if duplocale exists
12672 set duplocale d_duplocale
12675 : see if querylocale exists
12676 set querylocale d_querylocale
12679 : see if eaccess exists
12680 set eaccess d_eaccess
12683 : see if endgrent exists
12684 set endgrent d_endgrent
12687 : see if this is an grp system
12693 xxx=`./findhdr grp.h`
12694 $cppstdin $cppflags $cppminus < $xxx >$$.h
12696 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12708 set d_grpasswd; eval $setvar
12712 : see if endgrent_r exists
12713 set endgrent_r d_endgrent_r
12715 case "$d_endgrent_r" in
12717 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12718 case "$d_endgrent_r_proto:$usethreads" in
12719 ":define") d_endgrent_r_proto=define
12720 set d_endgrent_r_proto endgrent_r $hdrs
12724 case "$d_endgrent_r_proto" in
12726 case "$endgrent_r_proto" in
12727 ''|0) try='int endgrent_r(FILE**);'
12728 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12730 case "$endgrent_r_proto" in
12731 ''|0) try='void endgrent_r(FILE**);'
12732 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12734 case "$endgrent_r_proto" in
12735 ''|0) d_endgrent_r=undef
12737 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12738 * ) case "$endgrent_r_proto" in
12739 REENTRANT_PROTO*) ;;
12740 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12742 echo "Prototype: $try" ;;
12745 *) case "$usethreads" in
12746 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12753 *) endgrent_r_proto=0
12757 : see if endhostent exists
12758 set endhostent d_endhent
12761 : see if this is a netdb.h system
12762 set netdb.h i_netdb
12765 : see if endhostent_r exists
12766 set endhostent_r d_endhostent_r
12768 case "$d_endhostent_r" in
12770 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12771 case "$d_endhostent_r_proto:$usethreads" in
12772 ":define") d_endhostent_r_proto=define
12773 set d_endhostent_r_proto endhostent_r $hdrs
12777 case "$d_endhostent_r_proto" in
12779 case "$endhostent_r_proto" in
12780 ''|0) try='int endhostent_r(struct hostent_data*);'
12781 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12783 case "$endhostent_r_proto" in
12784 ''|0) try='void endhostent_r(struct hostent_data*);'
12785 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12787 case "$endhostent_r_proto" in
12788 ''|0) d_endhostent_r=undef
12789 endhostent_r_proto=0
12790 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12791 * ) case "$endhostent_r_proto" in
12792 REENTRANT_PROTO*) ;;
12793 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12795 echo "Prototype: $try" ;;
12798 *) case "$usethreads" in
12799 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12801 d_endhostent_r=undef
12802 endhostent_r_proto=0
12806 *) endhostent_r_proto=0
12810 : see if endnetent exists
12811 set endnetent d_endnent
12814 : see if endnetent_r exists
12815 set endnetent_r d_endnetent_r
12817 case "$d_endnetent_r" in
12819 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12820 case "$d_endnetent_r_proto:$usethreads" in
12821 ":define") d_endnetent_r_proto=define
12822 set d_endnetent_r_proto endnetent_r $hdrs
12826 case "$d_endnetent_r_proto" in
12828 case "$endnetent_r_proto" in
12829 ''|0) try='int endnetent_r(struct netent_data*);'
12830 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12832 case "$endnetent_r_proto" in
12833 ''|0) try='void endnetent_r(struct netent_data*);'
12834 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12836 case "$endnetent_r_proto" in
12837 ''|0) d_endnetent_r=undef
12838 endnetent_r_proto=0
12839 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12840 * ) case "$endnetent_r_proto" in
12841 REENTRANT_PROTO*) ;;
12842 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12844 echo "Prototype: $try" ;;
12847 *) case "$usethreads" in
12848 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12850 d_endnetent_r=undef
12851 endnetent_r_proto=0
12855 *) endnetent_r_proto=0
12859 : see if endprotoent exists
12860 set endprotoent d_endpent
12863 : see if endprotoent_r exists
12864 set endprotoent_r d_endprotoent_r
12866 case "$d_endprotoent_r" in
12868 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12869 case "$d_endprotoent_r_proto:$usethreads" in
12870 ":define") d_endprotoent_r_proto=define
12871 set d_endprotoent_r_proto endprotoent_r $hdrs
12875 case "$d_endprotoent_r_proto" in
12877 case "$endprotoent_r_proto" in
12878 ''|0) try='int endprotoent_r(struct protoent_data*);'
12879 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12881 case "$endprotoent_r_proto" in
12882 ''|0) try='void endprotoent_r(struct protoent_data*);'
12883 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12885 case "$endprotoent_r_proto" in
12886 ''|0) d_endprotoent_r=undef
12887 endprotoent_r_proto=0
12888 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12889 * ) case "$endprotoent_r_proto" in
12890 REENTRANT_PROTO*) ;;
12891 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12893 echo "Prototype: $try" ;;
12896 *) case "$usethreads" in
12897 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12899 d_endprotoent_r=undef
12900 endprotoent_r_proto=0
12904 *) endprotoent_r_proto=0
12908 : see if endpwent exists
12909 set endpwent d_endpwent
12912 : see if this is a pwd.h system
12918 xxx=`./findhdr pwd.h`
12919 $cppstdin $cppflags $cppminus < $xxx >$$.h
12921 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12929 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12937 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12945 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12953 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12961 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12969 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12977 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12989 set d_pwquota; eval $setvar
12990 set d_pwage; eval $setvar
12991 set d_pwchange; eval $setvar
12992 set d_pwclass; eval $setvar
12993 set d_pwexpire; eval $setvar
12994 set d_pwcomment; eval $setvar
12995 set d_pwgecos; eval $setvar
12996 set d_pwpasswd; eval $setvar
13000 : see if endpwent_r exists
13001 set endpwent_r d_endpwent_r
13003 case "$d_endpwent_r" in
13005 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13006 case "$d_endpwent_r_proto:$usethreads" in
13007 ":define") d_endpwent_r_proto=define
13008 set d_endpwent_r_proto endpwent_r $hdrs
13012 case "$d_endpwent_r_proto" in
13014 case "$endpwent_r_proto" in
13015 ''|0) try='int endpwent_r(FILE**);'
13016 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13018 case "$endpwent_r_proto" in
13019 ''|0) try='void endpwent_r(FILE**);'
13020 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13022 case "$endpwent_r_proto" in
13023 ''|0) d_endpwent_r=undef
13025 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13026 * ) case "$endpwent_r_proto" in
13027 REENTRANT_PROTO*) ;;
13028 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13030 echo "Prototype: $try" ;;
13033 *) case "$usethreads" in
13034 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13041 *) endpwent_r_proto=0
13045 : see if endservent exists
13046 set endservent d_endsent
13049 : see if endservent_r exists
13050 set endservent_r d_endservent_r
13052 case "$d_endservent_r" in
13054 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13055 case "$d_endservent_r_proto:$usethreads" in
13056 ":define") d_endservent_r_proto=define
13057 set d_endservent_r_proto endservent_r $hdrs
13061 case "$d_endservent_r_proto" in
13063 case "$endservent_r_proto" in
13064 ''|0) try='int endservent_r(struct servent_data*);'
13065 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13067 case "$endservent_r_proto" in
13068 ''|0) try='void endservent_r(struct servent_data*);'
13069 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13071 case "$endservent_r_proto" in
13072 ''|0) d_endservent_r=undef
13073 endservent_r_proto=0
13074 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13075 * ) case "$endservent_r_proto" in
13076 REENTRANT_PROTO*) ;;
13077 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13079 echo "Prototype: $try" ;;
13082 *) case "$usethreads" in
13083 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13085 d_endservent_r=undef
13086 endservent_r_proto=0
13090 *) endservent_r_proto=0
13094 : Locate the flags for 'open()'
13097 #include <sys/types.h>
13102 #include <sys/file.h>
13104 #$i_stdlib I_STDLIB
13106 #include <stdlib.h>
13117 : check sys/file.h first to get FREAD on Sun
13118 if $test `./findhdr sys/file.h` && \
13119 set try -DI_SYS_FILE && eval $compile; then
13121 echo "<sys/file.h> defines the O_* constants..." >&4
13122 if $run ./try; then
13123 echo "and you have the 3 argument form of open()." >&4
13126 echo "but not the 3 argument form of open(). Oh, well." >&4
13129 elif $test `./findhdr fcntl.h` && \
13130 set try -DI_FCNTL && eval $compile; then
13132 echo "<fcntl.h> defines the O_* constants..." >&4
13133 if $run ./try; then
13134 echo "and you have the 3 argument form of open()." >&4
13137 echo "but not the 3 argument form of open(). Oh, well." >&4
13142 echo "I can't find the O_* constant definitions! You got problems." >&4
13148 : see if this is a sys/file.h system
13153 : do we need to include sys/file.h ?
13157 if $h_sysfile; then
13159 echo "We'll be including <sys/file.h>." >&4
13162 echo "We won't be including <sys/file.h>." >&4
13172 : see if fcntl.h is there
13177 : see if we can include fcntl.h
13183 echo "We'll be including <fcntl.h>." >&4
13186 if $h_sysfile; then
13187 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13189 echo "We won't be including <fcntl.h>." >&4
13201 : see if fork exists
13205 : see if pipe exists
13209 : check for non-blocking I/O stuff
13210 case "$h_sysfile" in
13211 true) echo "#include <sys/file.h>" > head.c;;
13214 true) echo "#include <fcntl.h>" > head.c;;
13215 *) echo "#include <sys/fcntl.h>" > head.c;;
13220 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13221 case "$o_nonblock" in
13223 $cat head.c > try.c
13224 $cat >>try.c <<EOCP
13226 #$i_stdlib I_STDLIB
13228 #include <stdlib.h>
13236 printf("O_NONBLOCK\n");
13240 printf("O_NDELAY\n");
13244 printf("FNDELAY\n");
13251 if eval $compile_ok; then
13252 o_nonblock=`$run ./try`
13253 case "$o_nonblock" in
13254 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13255 *) echo "Seems like we can use $o_nonblock.";;
13258 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13261 *) echo "Using $hint value $o_nonblock.";;
13266 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13269 case "$d_fork:$d_pipe:$d_alarm" in
13270 define:define:define)
13271 $cat head.c > try.c
13272 $cat >>try.c <<EOCP
13274 #include <sys/types.h>
13275 #include <signal.h>
13277 #$i_stdlib I_STDLIB
13279 #include <stdlib.h>
13285 #define MY_O_NONBLOCK $o_nonblock
13286 #ifndef errno /* XXX need better Configure test */
13289 #$i_unistd I_UNISTD
13291 #include <unistd.h>
13293 #include <string.h>
13294 $signal_t blech(int x) { exit(3); }
13296 $cat >> try.c <<'EOCP'
13305 ret = pipe(pd); /* Down: child -> parent */
13308 ret = pipe(pu); /* Up: parent -> child */
13312 close(pd[1]); /* Parent reads from pd[0] */
13313 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13315 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13320 signal(SIGALRM, blech);
13322 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13324 sprintf(string, "%d\n", ret);
13325 ret = write(2, string, strlen(string));
13326 if (ret != strlen(string))
13330 if (errno == EAGAIN) {
13331 printf("EAGAIN\n");
13336 if (errno == EWOULDBLOCK)
13337 printf("EWOULDBLOCK\n");
13340 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13343 sleep(2); /* Give it time to close our pipe */
13345 ret = read(pd[0], buf, 1); /* Should read EOF */
13347 sprintf(string, "%d\n", ret);
13348 ret = write(4, string, strlen(string));
13349 if (ret != strlen(string))
13354 close(pd[0]); /* We write to pd[1] */
13355 close(pu[1]); /* We read from pu[0] */
13356 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13359 close(pd[1]); /* Pipe pd is now fully closed! */
13360 exit(0); /* Bye bye, thank you for playing! */
13364 if eval $compile_ok; then
13365 echo "$startsh" >mtry
13366 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13368 $run ./mtry >/dev/null 2>&1
13370 0) eagain=`$cat try.out`;;
13371 1) echo "Could not perform non-blocking setting!";;
13372 2) echo "I did a successful read() for something that was not there!";;
13373 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13374 4) echo "Could not find F_SETFL!";;
13375 *) echo "Something terribly wrong happened during testing.";;
13377 rd_nodata=`$cat try.ret`
13378 echo "A read() system call with no data present returns $rd_nodata."
13379 case "$rd_nodata" in
13382 echo "(That's peculiar, fixing that to be -1.)"
13388 echo "Forcing errno EAGAIN on read() with no data available."
13392 echo "Your read() sets errno to $eagain when no data is available."
13395 status=`$cat try.err`
13397 0) echo "And it correctly returns 0 to signal EOF.";;
13398 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13399 *) echo "However, your read() returns '$status' on EOF??";;
13402 if test "$status" = "$rd_nodata"; then
13403 echo "WARNING: you can't distinguish between EOF and no data!"
13407 echo "I can't compile the test program--assuming errno EAGAIN will do."
13411 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13420 echo "Using $hint value $eagain."
13421 echo "Your read() returns $rd_nodata when no data is present."
13422 case "$d_eofnblk" in
13423 "$define") echo "And you can see EOF because read() returns 0.";;
13424 "$undef") echo "But you can't see EOF status from read() returned value.";;
13426 echo "(Assuming you can't see EOF status from read anyway.)"
13432 $rm_try head.c mtry
13434 : see if erf exists
13438 : see if erfc exists
13442 : see if exp2 exists
13446 : see if expm1 exists
13450 : see if _ptr and _cnt from stdio act std
13453 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13454 echo "(Looks like you have stdio.h from BSD.)"
13455 case "$stdio_ptr" in
13456 '') stdio_ptr='((fp)->_p)'
13459 *) ptr_lval=$d_stdio_ptr_lval;;
13461 case "$stdio_cnt" in
13462 '') stdio_cnt='((fp)->_r)'
13465 *) cnt_lval=$d_stdio_cnt_lval;;
13467 case "$stdio_base" in
13468 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13470 case "$stdio_bufsiz" in
13471 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13473 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13474 echo "(Looks like you have stdio.h from Linux.)"
13475 case "$stdio_ptr" in
13476 '') stdio_ptr='((fp)->_IO_read_ptr)'
13479 *) ptr_lval=$d_stdio_ptr_lval;;
13481 case "$stdio_cnt" in
13482 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13485 *) cnt_lval=$d_stdio_cnt_lval;;
13487 case "$stdio_base" in
13488 '') stdio_base='((fp)->_IO_read_base)';;
13490 case "$stdio_bufsiz" in
13491 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13494 case "$stdio_ptr" in
13495 '') stdio_ptr='((fp)->_ptr)'
13498 *) ptr_lval=$d_stdio_ptr_lval;;
13500 case "$stdio_cnt" in
13501 '') stdio_cnt='((fp)->_cnt)'
13504 *) cnt_lval=$d_stdio_cnt_lval;;
13506 case "$stdio_base" in
13507 '') stdio_base='((fp)->_base)';;
13509 case "$stdio_bufsiz" in
13510 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13514 : test whether _ptr and _cnt really work
13515 echo "Checking how std your stdio is..." >&4
13518 #$i_stdlib I_STDLIB
13520 #include <stdlib.h>
13522 #define FILE_ptr(fp) $stdio_ptr
13523 #define FILE_cnt(fp) $stdio_cnt
13525 FILE *fp = fopen("try.c", "r");
13528 18 <= FILE_cnt(fp) &&
13529 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13537 if eval $compile && $to try.c; then
13538 if $run ./try; then
13539 echo "Your stdio acts pretty std."
13542 echo "Your stdio isn't very std."
13545 echo "Your stdio doesn't appear very std."
13549 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13550 # direct buffer manipulation no longer works. The Configure tests
13551 # should be changed to correctly detect this, but until then,
13552 # the following check should at least let perl compile and run.
13553 # (This quick fix should be updated before 5.8.1.)
13554 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13555 # A. Dougherty, June 3, 2002.
13556 case "$d_gnulibc" in
13558 case "$gnulibc_version" in
13562 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13571 : Can _ptr be used as an lvalue?
13572 case "$d_stdstdio$ptr_lval" in
13573 $define$define) val=$define ;;
13576 set d_stdio_ptr_lval
13579 : Can _cnt be used as an lvalue?
13580 case "$d_stdstdio$cnt_lval" in
13581 $define$define) val=$define ;;
13584 set d_stdio_cnt_lval
13588 : test whether setting _ptr sets _cnt as a side effect
13589 d_stdio_ptr_lval_sets_cnt="$undef"
13590 d_stdio_ptr_lval_nochange_cnt="$undef"
13591 case "$d_stdio_ptr_lval$d_stdstdio" in
13593 echo "Checking to see what happens if we set the stdio ptr..." >&4
13596 /* Can we scream? */
13597 /* Eat dust sed :-) */
13598 /* In the buffer space, no one can hear you scream. */
13599 #$i_stdlib I_STDLIB
13601 #include <stdlib.h>
13603 #define FILE_ptr(fp) $stdio_ptr
13604 #define FILE_cnt(fp) $stdio_cnt
13605 #include <sys/types.h>
13607 FILE *fp = fopen("try.c", "r");
13612 puts("Fail even to read");
13615 c = getc(fp); /* Read away the first # */
13617 puts("Fail even to read");
13621 18 <= FILE_cnt(fp) &&
13622 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13624 puts("Fail even to read");
13627 ptr = (char*) FILE_ptr(fp);
13628 cnt = (size_t)FILE_cnt(fp);
13630 FILE_ptr(fp) += 42;
13632 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13633 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13636 if (FILE_cnt(fp) <= 20) {
13637 printf ("Fail (<20 chars to test)");
13640 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13641 puts("Fail compare");
13644 if (cnt == FILE_cnt(fp)) {
13645 puts("Pass_unchanged");
13648 if (FILE_cnt(fp) == (cnt - 42)) {
13649 puts("Pass_changed");
13652 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13658 if eval $compile && $to try.c; then
13659 case `$run ./try` in
13661 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13662 d_stdio_ptr_lval_sets_cnt="$define" ;;
13664 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13665 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13667 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13669 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13672 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13678 : see if _base is also standard
13680 case "$d_stdstdio" in
13684 #$i_stdlib I_STDLIB
13686 #include <stdlib.h>
13688 #define FILE_base(fp) $stdio_base
13689 #define FILE_bufsiz(fp) $stdio_bufsiz
13691 FILE *fp = fopen("try.c", "r");
13694 19 <= FILE_bufsiz(fp) &&
13695 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13702 if eval $compile && $to try.c; then
13703 if $run ./try; then
13704 echo "And its _base field acts std."
13707 echo "But its _base field isn't std."
13710 echo "However, it seems to be lacking the _base field."
13718 : see if fast_stdio exists
13720 case "$d_stdstdio:$d_stdio_ptr_lval" in
13722 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13724 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13733 : see if fchdir exists
13734 set fchdir d_fchdir
13737 : see if fchmod exists
13738 set fchmod d_fchmod
13741 : check for openat, unlinkat, renameat, linkat, fchmodat
13742 set openat d_openat
13745 set unlinkat d_unlinkat
13748 set renameat d_renameat
13751 set linkat d_linkat
13754 set fchmodat d_fchmodat
13757 : see if fchown exists
13758 set fchown d_fchown
13761 : see if this is an fcntl system
13765 : See if fcntl-based locking works.
13768 #$i_stdlib I_STDLIB
13770 #include <stdlib.h>
13772 #include <unistd.h>
13774 #include <signal.h>
13775 $signal_t blech(int x) { exit(3); }
13777 #if defined(F_SETLK) && defined(F_SETLKW)
13778 struct flock flock;
13780 fd = open("try.c", O_RDONLY);
13781 flock.l_type = F_RDLCK;
13782 flock.l_whence = SEEK_SET;
13783 flock.l_start = flock.l_len = 0;
13784 signal(SIGALRM, blech);
13786 retval = fcntl(fd, F_SETLK, &flock);
13788 (retval < 0 ? exit(2) : exit(0));
13794 echo "Checking if fcntl-based file locking works... "
13798 if eval $compile_ok; then
13799 if $run ./try; then
13800 echo "Yes, it seems to work."
13803 echo "Nope, it didn't work."
13808 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13809 *** This is (almost) impossible.
13810 *** If your NFS lock daemons are not feeling well, something like
13811 *** this may happen, please investigate. Cannot continue, aborting.
13819 echo "I'm unable to compile the test program, so I'll assume not."
13824 echo "Nope, since you don't even have fcntl()."
13827 set d_fcntl_can_lock
13831 : check for fd_set items
13834 Checking to see how well your C compiler handles fd_set and friends ...
13837 #$i_stdlib I_STDLIB
13839 #include <stdlib.h>
13841 #$i_systime I_SYS_TIME
13842 #$i_sysselct I_SYS_SELECT
13843 #$d_socket HAS_SOCKET
13844 #include <sys/types.h>
13846 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13849 #include <sys/time.h>
13851 #ifdef I_SYS_SELECT
13852 #include <sys/select.h>
13861 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13869 if eval $compile; then
13870 d_fds_bits="$define"
13872 echo "Well, your system knows about the normal fd_set typedef..." >&4
13873 if $run ./try; then
13874 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13875 d_fd_macros="$define"
13878 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13880 d_fd_macros="$undef"
13884 Hmm, your compiler has some difficulty with fd_set. Checking further...
13887 if eval $compile; then
13888 d_fds_bits="$undef"
13890 echo "Well, your system has some sort of fd_set available..." >&4
13891 if $run ./try; then
13892 echo "and you have the normal fd_set macros." >&4
13893 d_fd_macros="$define"
13896 but not the normal fd_set macros! Gross! More work for me...
13898 d_fd_macros="$undef"
13901 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13903 d_fds_bits="$undef"
13904 d_fd_macros="$undef"
13909 : see if fdclose exists
13910 set fdclose d_fdclose
13913 : see if fdim exists
13917 : see if fegetround exists
13918 set fegetround d_fegetround
13921 : see if fgetpos exists
13922 set fgetpos d_fgetpos
13925 : see if finite exists
13926 set finite d_finite
13929 : see if finitel exists
13930 set finitel d_finitel
13933 : see if flock exists
13937 : see if prototype for flock is available
13939 set d_flockproto flock $i_sysfile sys/file.h
13942 : see if fma exists
13946 : see if fmax exists
13950 : see if fmin exists
13954 : see if fp_class exists
13955 set fp_class d_fp_class
13958 : check for fpclassify
13959 echo "Checking to see if you have fpclassify..." >&4
13962 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13965 if eval $compile; then
13967 echo "You have fpclassify."
13970 echo "You do not have fpclassify."
13976 : see if fp_classify exists
13977 set fp_classify d_fp_classify
13980 : see if fp_classl exists
13981 set fp_classl d_fp_classl
13984 : see if pathconf exists
13985 set pathconf d_pathconf
13988 : see if fpathconf exists
13989 set fpathconf d_fpathconf
13992 : see if fpclass exists
13993 set fpclass d_fpclass
13996 : see if fpclassl exists
13997 set fpclassl d_fpclassl
14000 : see if fpgetround exists
14001 set fpgetround d_fpgetround
14004 : check for fpos64_t
14006 echo "Checking to see if you have fpos64_t..." >&4
14009 int main() { fpos64_t x = 7; }
14012 if eval $compile; then
14014 echo "You have fpos64_t."
14017 echo "You do not have fpos64_t."
14018 case "$fpossize" in
14019 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14026 : see if frexpl exists
14027 set frexpl d_frexpl
14030 : see if this is a sys/param system
14031 set sys/param.h i_sysparam
14034 : see if this is a sys/mount.h system
14035 set sys/mount.h i_sysmount
14038 : Check for fs_data_s
14040 echo "Checking to see if your system supports struct fs_data..." >&4
14041 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14043 case "$d_fs_data_s" in
14044 "$define") echo "Yes, it does." ;;
14045 *) echo "No, it doesn't." ;;
14048 : see if fseeko exists
14049 set fseeko d_fseeko
14051 case "$longsize" in
14052 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14055 : see if fsetpos exists
14056 set fsetpos d_fsetpos
14059 : see if fstatfs exists
14060 set fstatfs d_fstatfs
14063 : see if statvfs exists
14064 set statvfs d_statvfs
14067 : see if fstatvfs exists
14068 set fstatvfs d_fstatvfs
14071 : see if fsync exists
14075 : see if ftello exists
14076 set ftello d_ftello
14078 case "$longsize" in
14079 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14082 : check for a working futimes
14085 echo "Checking if you have a working futimes()" >&4
14088 #include <stdlib.h>
14089 #include <sys/time.h>
14092 #include <stdlib.h>
14097 fd = open ("try.c", O_RDWR);
14098 if (-1 == fd) exit (1);
14099 rv = futimes (fd, NULL);
14100 exit (rv == -1 ? errno : 0);
14104 if eval $compile; then
14108 0) echo "Yes, you have" >&4
14109 d_futimes="$define"
14111 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14115 echo "No, it does not (probably harmless)" >&4
14119 : look for gai_strerror
14121 $cat >try.c <<'EOCP'
14122 #include <sys/types.h>
14123 #include <sys/socket.h>
14127 return (gai_strerror (0) ? 0 : 1);
14132 if eval $compile; then
14135 0) echo "A working gai_strerror() found." >&4
14137 *) echo "gai_strerror() found, but it doesn't work" >&4
14141 echo "gai_strerror() NOT found." >&4
14147 : see if ndbm.h is available
14150 : Compatibility location for RedHat 7.1
14151 set gdbm/ndbm.h i_gdbmndbm
14153 : Compatibility location for Debian 4.0
14154 set gdbm-ndbm.h i_gdbm_ndbm
14158 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14159 : see if dbm_open exists
14160 set dbm_open d_dbm_open
14162 case "$d_dbm_open" in
14165 i_gdbmndbm="$undef"
14166 i_gdbm_ndbm="$undef"
14167 echo "We won't be including <ndbm.h>"
14177 ndbm_hdr_protochk='name=$1; hdr=$2;
14178 eval "ihdr=\$""i_$name";
14180 if $test "$ihdr" = "$define"; then
14181 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14182 case "$d_cplusplus" in
14183 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14184 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14187 $define) $echo "Your <$hdr> seems to have prototypes";;
14188 *) $echo "Your <$hdr> does not seem to have prototypes";;
14191 set "d_${name}_h_uses_prototypes";
14195 eval $ndbm_hdr_protochk
14196 set gdbmndbm gdbm/ndbm.h
14197 eval $ndbm_hdr_protochk
14198 set gdbm_ndbm gdbm-ndbm.h
14199 eval $ndbm_hdr_protochk
14201 : see if getaddrinfo exists
14202 set getaddrinfo d_getaddrinfo
14205 : see if getcwd exists
14206 set getcwd d_getcwd
14209 : see if getespwnam exists
14210 set getespwnam d_getespwnam
14213 : see if getfsstat exists
14214 set getfsstat d_getfsstat
14217 : see if getgrent exists
14218 set getgrent d_getgrent
14221 : see if getgrent_r exists
14222 set getgrent_r d_getgrent_r
14224 case "$d_getgrent_r" in
14226 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14227 case "$d_getgrent_r_proto:$usethreads" in
14228 ":define") d_getgrent_r_proto=define
14229 set d_getgrent_r_proto getgrent_r $hdrs
14233 case "$d_getgrent_r_proto" in
14235 case "$getgrent_r_proto" in
14236 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14237 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14239 case "$getgrent_r_proto" in
14240 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14241 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14243 case "$getgrent_r_proto" in
14244 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14245 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14247 case "$getgrent_r_proto" in
14248 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14249 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14251 case "$getgrent_r_proto" in
14252 ''|0) try='int getgrent_r(struct group*, char*, int);'
14253 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14255 case "$getgrent_r_proto" in
14256 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14257 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14259 case "$getgrent_r_proto" in
14260 ''|0) d_getgrent_r=undef
14262 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14263 * ) case "$getgrent_r_proto" in
14264 REENTRANT_PROTO*) ;;
14265 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14267 echo "Prototype: $try" ;;
14270 *) case "$usethreads" in
14271 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14278 *) getgrent_r_proto=0
14282 : see if getgrgid_r exists
14283 set getgrgid_r d_getgrgid_r
14285 case "$d_getgrgid_r" in
14287 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14288 case "$d_getgrgid_r_proto:$usethreads" in
14289 ":define") d_getgrgid_r_proto=define
14290 set d_getgrgid_r_proto getgrgid_r $hdrs
14294 case "$d_getgrgid_r_proto" in
14296 case "$getgrgid_r_proto" in
14297 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14298 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14300 case "$getgrgid_r_proto" in
14301 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14302 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14304 case "$getgrgid_r_proto" in
14305 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14306 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14308 case "$getgrgid_r_proto" in
14309 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14310 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14312 case "$getgrgid_r_proto" in
14313 ''|0) d_getgrgid_r=undef
14315 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14316 * ) case "$getgrgid_r_proto" in
14317 REENTRANT_PROTO*) ;;
14318 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14320 echo "Prototype: $try" ;;
14323 *) case "$usethreads" in
14324 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14331 *) getgrgid_r_proto=0
14335 : see if getgrnam_r exists
14336 set getgrnam_r d_getgrnam_r
14338 case "$d_getgrnam_r" in
14340 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14341 case "$d_getgrnam_r_proto:$usethreads" in
14342 ":define") d_getgrnam_r_proto=define
14343 set d_getgrnam_r_proto getgrnam_r $hdrs
14347 case "$d_getgrnam_r_proto" in
14349 case "$getgrnam_r_proto" in
14350 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14351 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14353 case "$getgrnam_r_proto" in
14354 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14355 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14357 case "$getgrnam_r_proto" in
14358 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14359 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14361 case "$getgrnam_r_proto" in
14362 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14363 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14365 case "$getgrnam_r_proto" in
14366 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14367 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14369 case "$getgrnam_r_proto" in
14370 ''|0) d_getgrnam_r=undef
14372 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14373 * ) case "$getgrnam_r_proto" in
14374 REENTRANT_PROTO*) ;;
14375 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14377 echo "Prototype: $try" ;;
14380 *) case "$usethreads" in
14381 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14388 *) getgrnam_r_proto=0
14392 : see if gethostbyaddr exists
14393 set gethostbyaddr d_gethbyaddr
14396 : see if gethostbyname exists
14397 set gethostbyname d_gethbyname
14400 : see if gethostent exists
14401 set gethostent d_gethent
14404 : see how we will look up host name
14407 if set gethostname val -f d_gethname; eval $csym; $val; then
14408 echo 'gethostname() found.' >&4
14409 d_gethname="$define"
14412 if set uname val -f d_uname; eval $csym; $val; then
14415 uname() was found, but you're running xenix, and older versions of xenix
14416 have a broken uname(). If you don't really know whether your xenix is old
14417 enough to have a broken system call, use the default answer.
14422 "$define") dflt=n;;
14424 rp='Is your uname() broken?'
14427 n*) d_uname="$define"; call=uname;;
14430 echo 'uname() found.' >&4
14437 case "$d_gethname" in
14438 '') d_gethname="$undef";;
14441 '') d_uname="$undef";;
14443 case "$d_uname$d_gethname" in
14448 Every now and then someone has a $call() that lies about the hostname
14449 but can't be fixed for political or economic reasons. If you wish, I can
14450 pretend $call() isn't there and maybe compute hostname at run-time
14451 thanks to the '$phostname' command.
14454 rp="Shall I ignore $call() from now on?"
14457 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14460 case "$phostname" in
14461 '') aphostname='';;
14462 *) case "$aphostname" in
14464 *) set X $phostname
14468 file=`./loc $file $file $pth`
14469 aphostname=`echo $file $*`
14474 case "$d_uname$d_gethname" in
14477 case "$phostname" in
14479 echo "There will be no way for $package to get your hostname." >&4;;
14481 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14485 case "$d_phostname" in
14486 '') d_phostname="$undef";;
14489 : see if gethostbyaddr_r exists
14490 set gethostbyaddr_r d_gethostbyaddr_r
14492 case "$d_gethostbyaddr_r" in
14494 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14495 case "$d_gethostbyaddr_r_proto:$usethreads" in
14496 ":define") d_gethostbyaddr_r_proto=define
14497 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14501 case "$d_gethostbyaddr_r_proto" in
14503 case "$gethostbyaddr_r_proto" in
14504 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14505 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14507 case "$gethostbyaddr_r_proto" in
14508 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14509 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14511 case "$gethostbyaddr_r_proto" in
14512 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14513 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14515 case "$gethostbyaddr_r_proto" in
14516 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14517 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14519 case "$gethostbyaddr_r_proto" in
14520 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14521 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14523 case "$gethostbyaddr_r_proto" in
14524 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14525 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14527 case "$gethostbyaddr_r_proto" in
14528 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14529 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14531 case "$gethostbyaddr_r_proto" in
14532 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14533 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14535 case "$gethostbyaddr_r_proto" in
14536 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14537 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14539 case "$gethostbyaddr_r_proto" in
14540 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14541 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14543 case "$gethostbyaddr_r_proto" in
14544 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14545 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14547 case "$gethostbyaddr_r_proto" in
14548 ''|0) d_gethostbyaddr_r=undef
14549 gethostbyaddr_r_proto=0
14550 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14551 * ) case "$gethostbyaddr_r_proto" in
14552 REENTRANT_PROTO*) ;;
14553 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14555 echo "Prototype: $try" ;;
14558 *) case "$usethreads" in
14559 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14561 d_gethostbyaddr_r=undef
14562 gethostbyaddr_r_proto=0
14566 *) gethostbyaddr_r_proto=0
14570 : see if gethostbyname_r exists
14571 set gethostbyname_r d_gethostbyname_r
14573 case "$d_gethostbyname_r" in
14575 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14576 case "$d_gethostbyname_r_proto:$usethreads" in
14577 ":define") d_gethostbyname_r_proto=define
14578 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14582 case "$d_gethostbyname_r_proto" in
14584 case "$gethostbyname_r_proto" in
14585 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14586 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14588 case "$gethostbyname_r_proto" in
14589 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14590 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14592 case "$gethostbyname_r_proto" in
14593 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14594 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14596 case "$gethostbyname_r_proto" in
14597 ''|0) d_gethostbyname_r=undef
14598 gethostbyname_r_proto=0
14599 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14600 * ) case "$gethostbyname_r_proto" in
14601 REENTRANT_PROTO*) ;;
14602 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14604 echo "Prototype: $try" ;;
14607 *) case "$usethreads" in
14608 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14610 d_gethostbyname_r=undef
14611 gethostbyname_r_proto=0
14615 *) gethostbyname_r_proto=0
14619 : see if gethostent_r exists
14620 set gethostent_r d_gethostent_r
14622 case "$d_gethostent_r" in
14624 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14625 case "$d_gethostent_r_proto:$usethreads" in
14626 ":define") d_gethostent_r_proto=define
14627 set d_gethostent_r_proto gethostent_r $hdrs
14631 case "$d_gethostent_r_proto" in
14633 case "$gethostent_r_proto" in
14634 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14635 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14637 case "$gethostent_r_proto" in
14638 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14639 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14641 case "$gethostent_r_proto" in
14642 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14643 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14645 case "$gethostent_r_proto" in
14646 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14647 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14649 case "$gethostent_r_proto" in
14650 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14651 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14653 case "$gethostent_r_proto" in
14654 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14655 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14657 case "$gethostent_r_proto" in
14658 ''|0) d_gethostent_r=undef
14659 gethostent_r_proto=0
14660 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14661 * ) case "$gethostent_r_proto" in
14662 REENTRANT_PROTO*) ;;
14663 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14665 echo "Prototype: $try" ;;
14668 *) case "$usethreads" in
14669 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14671 d_gethostent_r=undef
14672 gethostent_r_proto=0
14676 *) gethostent_r_proto=0
14680 : see if prototypes for various gethostxxx netdb.h functions are available
14682 set d_gethostprotos gethostent $i_netdb netdb.h
14685 : see if getitimer exists
14686 set getitimer d_getitimer
14689 : see if getlogin exists
14690 set getlogin d_getlogin
14693 : see if getlogin_r exists
14694 set getlogin_r d_getlogin_r
14696 case "$d_getlogin_r" in
14698 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14699 case "$d_getlogin_r_proto:$usethreads" in
14700 ":define") d_getlogin_r_proto=define
14701 set d_getlogin_r_proto getlogin_r $hdrs
14705 case "$d_getlogin_r_proto" in
14707 case "$getlogin_r_proto" in
14708 ''|0) try='int getlogin_r(char*, size_t);'
14709 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14711 case "$getlogin_r_proto" in
14712 ''|0) try='int getlogin_r(char*, int);'
14713 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14715 case "$getlogin_r_proto" in
14716 ''|0) try='char* getlogin_r(char*, size_t);'
14717 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14719 case "$getlogin_r_proto" in
14720 ''|0) try='char* getlogin_r(char*, int);'
14721 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14723 case "$getlogin_r_proto" in
14724 ''|0) d_getlogin_r=undef
14726 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14727 * ) case "$getlogin_r_proto" in
14728 REENTRANT_PROTO*) ;;
14729 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14731 echo "Prototype: $try" ;;
14734 *) case "$usethreads" in
14735 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14742 *) getlogin_r_proto=0
14746 : see if getmnt exists
14747 set getmnt d_getmnt
14750 : see if getmntent exists
14751 set getmntent d_getmntent
14754 : see if getnameinfo exists
14755 set getnameinfo d_getnameinfo
14758 : see if getnetbyaddr exists
14759 set getnetbyaddr d_getnbyaddr
14762 : see if getnetbyname exists
14763 set getnetbyname d_getnbyname
14766 : see if getnetent exists
14767 set getnetent d_getnent
14770 : see if getnetbyaddr_r exists
14771 set getnetbyaddr_r d_getnetbyaddr_r
14773 case "$d_getnetbyaddr_r" in
14775 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14776 case "$d_getnetbyaddr_r_proto:$usethreads" in
14777 ":define") d_getnetbyaddr_r_proto=define
14778 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14782 case "$d_getnetbyaddr_r_proto" in
14784 case "$getnetbyaddr_r_proto" in
14785 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14786 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14788 case "$getnetbyaddr_r_proto" in
14789 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14790 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14792 case "$getnetbyaddr_r_proto" in
14793 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14794 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14796 case "$getnetbyaddr_r_proto" in
14797 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14798 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14800 case "$getnetbyaddr_r_proto" in
14801 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14802 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14804 case "$getnetbyaddr_r_proto" in
14805 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14806 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14808 case "$getnetbyaddr_r_proto" in
14809 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14810 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14812 case "$getnetbyaddr_r_proto" in
14813 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14814 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14816 case "$getnetbyaddr_r_proto" in
14817 ''|0) d_getnetbyaddr_r=undef
14818 getnetbyaddr_r_proto=0
14819 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14820 * ) case "$getnetbyaddr_r_proto" in
14821 REENTRANT_PROTO*) ;;
14822 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14824 echo "Prototype: $try" ;;
14827 *) case "$usethreads" in
14828 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14830 d_getnetbyaddr_r=undef
14831 getnetbyaddr_r_proto=0
14835 *) getnetbyaddr_r_proto=0
14839 : see if getnetbyname_r exists
14840 set getnetbyname_r d_getnetbyname_r
14842 case "$d_getnetbyname_r" in
14844 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14845 case "$d_getnetbyname_r_proto:$usethreads" in
14846 ":define") d_getnetbyname_r_proto=define
14847 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14851 case "$d_getnetbyname_r_proto" in
14853 case "$getnetbyname_r_proto" in
14854 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14855 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14857 case "$getnetbyname_r_proto" in
14858 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14859 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14861 case "$getnetbyname_r_proto" in
14862 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14863 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14865 case "$getnetbyname_r_proto" in
14866 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14867 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14869 case "$getnetbyname_r_proto" in
14870 ''|0) d_getnetbyname_r=undef
14871 getnetbyname_r_proto=0
14872 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14873 * ) case "$getnetbyname_r_proto" in
14874 REENTRANT_PROTO*) ;;
14875 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14877 echo "Prototype: $try" ;;
14880 *) case "$usethreads" in
14881 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14883 d_getnetbyname_r=undef
14884 getnetbyname_r_proto=0
14888 *) getnetbyname_r_proto=0
14892 : see if getnetent_r exists
14893 set getnetent_r d_getnetent_r
14895 case "$d_getnetent_r" in
14897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14898 case "$d_getnetent_r_proto:$usethreads" in
14899 ":define") d_getnetent_r_proto=define
14900 set d_getnetent_r_proto getnetent_r $hdrs
14904 case "$d_getnetent_r_proto" in
14906 case "$getnetent_r_proto" in
14907 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14908 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14910 case "$getnetent_r_proto" in
14911 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14912 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14914 case "$getnetent_r_proto" in
14915 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14916 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14918 case "$getnetent_r_proto" in
14919 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14920 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14922 case "$getnetent_r_proto" in
14923 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14924 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14926 case "$getnetent_r_proto" in
14927 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14928 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14930 case "$getnetent_r_proto" in
14931 ''|0) d_getnetent_r=undef
14932 getnetent_r_proto=0
14933 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14934 * ) case "$getnetent_r_proto" in
14935 REENTRANT_PROTO*) ;;
14936 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14938 echo "Prototype: $try" ;;
14941 *) case "$usethreads" in
14942 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14944 d_getnetent_r=undef
14945 getnetent_r_proto=0
14949 *) getnetent_r_proto=0
14953 : see if prototypes for various getnetxxx netdb.h functions are available
14955 set d_getnetprotos getnetent $i_netdb netdb.h
14958 : see if getpagesize exists
14959 set getpagesize d_getpagsz
14962 : Optional checks for getprotobyname and getprotobynumber
14964 : see if getprotobyname exists
14965 set getprotobyname d_getpbyname
14968 : see if getprotobynumber exists
14969 set getprotobynumber d_getpbynumber
14972 : see if getprotoent exists
14973 set getprotoent d_getpent
14976 : see if getpgid exists
14977 set getpgid d_getpgid
14980 : see if getpgrp2 exists
14981 set getpgrp2 d_getpgrp2
14984 : see if getppid exists
14985 set getppid d_getppid
14988 : see if getpriority exists
14989 set getpriority d_getprior
14992 : see if getprotobyname_r exists
14993 set getprotobyname_r d_getprotobyname_r
14995 case "$d_getprotobyname_r" in
14997 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14998 case "$d_getprotobyname_r_proto:$usethreads" in
14999 ":define") d_getprotobyname_r_proto=define
15000 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15004 case "$d_getprotobyname_r_proto" in
15006 case "$getprotobyname_r_proto" in
15007 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15008 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15010 case "$getprotobyname_r_proto" in
15011 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15012 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15014 case "$getprotobyname_r_proto" in
15015 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15016 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15018 case "$getprotobyname_r_proto" in
15019 ''|0) d_getprotobyname_r=undef
15020 getprotobyname_r_proto=0
15021 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15022 * ) case "$getprotobyname_r_proto" in
15023 REENTRANT_PROTO*) ;;
15024 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15026 echo "Prototype: $try" ;;
15029 *) case "$usethreads" in
15030 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15032 d_getprotobyname_r=undef
15033 getprotobyname_r_proto=0
15037 *) getprotobyname_r_proto=0
15041 : see if getprotobynumber_r exists
15042 set getprotobynumber_r d_getprotobynumber_r
15044 case "$d_getprotobynumber_r" in
15046 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15047 case "$d_getprotobynumber_r_proto:$usethreads" in
15048 ":define") d_getprotobynumber_r_proto=define
15049 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15053 case "$d_getprotobynumber_r_proto" in
15055 case "$getprotobynumber_r_proto" in
15056 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15057 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15059 case "$getprotobynumber_r_proto" in
15060 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15061 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15063 case "$getprotobynumber_r_proto" in
15064 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15065 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15067 case "$getprotobynumber_r_proto" in
15068 ''|0) d_getprotobynumber_r=undef
15069 getprotobynumber_r_proto=0
15070 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15071 * ) case "$getprotobynumber_r_proto" in
15072 REENTRANT_PROTO*) ;;
15073 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15075 echo "Prototype: $try" ;;
15078 *) case "$usethreads" in
15079 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15081 d_getprotobynumber_r=undef
15082 getprotobynumber_r_proto=0
15086 *) getprotobynumber_r_proto=0
15090 : see if getprotoent_r exists
15091 set getprotoent_r d_getprotoent_r
15093 case "$d_getprotoent_r" in
15095 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15096 case "$d_getprotoent_r_proto:$usethreads" in
15097 ":define") d_getprotoent_r_proto=define
15098 set d_getprotoent_r_proto getprotoent_r $hdrs
15102 case "$d_getprotoent_r_proto" in
15104 case "$getprotoent_r_proto" in
15105 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15106 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15108 case "$getprotoent_r_proto" in
15109 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15110 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15112 case "$getprotoent_r_proto" in
15113 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15114 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15116 case "$getprotoent_r_proto" in
15117 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15118 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15120 case "$getprotoent_r_proto" in
15121 ''|0) d_getprotoent_r=undef
15122 getprotoent_r_proto=0
15123 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15124 * ) case "$getprotoent_r_proto" in
15125 REENTRANT_PROTO*) ;;
15126 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15128 echo "Prototype: $try" ;;
15131 *) case "$usethreads" in
15132 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15134 d_getprotoent_r=undef
15135 getprotoent_r_proto=0
15139 *) getprotoent_r_proto=0
15143 : see if prototypes for various getprotoxxx netdb.h functions are available
15145 set d_getprotoprotos getprotoent $i_netdb netdb.h
15148 : see if getprpwnam exists
15149 set getprpwnam d_getprpwnam
15152 : see if getpwent exists
15153 set getpwent d_getpwent
15156 : see if getpwent_r exists
15157 set getpwent_r d_getpwent_r
15159 case "$d_getpwent_r" in
15161 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15162 case "$d_getpwent_r_proto:$usethreads" in
15163 ":define") d_getpwent_r_proto=define
15164 set d_getpwent_r_proto getpwent_r $hdrs
15168 case "$d_getpwent_r_proto" in
15170 case "$getpwent_r_proto" in
15171 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15172 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15174 case "$getpwent_r_proto" in
15175 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15176 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15178 case "$getpwent_r_proto" in
15179 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15180 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15182 case "$getpwent_r_proto" in
15183 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15184 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15186 case "$getpwent_r_proto" in
15187 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15188 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15190 case "$getpwent_r_proto" in
15191 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15192 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15194 case "$getpwent_r_proto" in
15195 ''|0) d_getpwent_r=undef
15197 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15198 * ) case "$getpwent_r_proto" in
15199 REENTRANT_PROTO*) ;;
15200 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15202 echo "Prototype: $try" ;;
15205 *) case "$usethreads" in
15206 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15213 *) getpwent_r_proto=0
15217 : see if getpwnam_r exists
15218 set getpwnam_r d_getpwnam_r
15220 case "$d_getpwnam_r" in
15222 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15223 case "$d_getpwnam_r_proto:$usethreads" in
15224 ":define") d_getpwnam_r_proto=define
15225 set d_getpwnam_r_proto getpwnam_r $hdrs
15229 case "$d_getpwnam_r_proto" in
15231 case "$getpwnam_r_proto" in
15232 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15233 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15235 case "$getpwnam_r_proto" in
15236 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15237 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15239 case "$getpwnam_r_proto" in
15240 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15241 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15243 case "$getpwnam_r_proto" in
15244 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15245 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15247 case "$getpwnam_r_proto" in
15248 ''|0) d_getpwnam_r=undef
15250 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15251 * ) case "$getpwnam_r_proto" in
15252 REENTRANT_PROTO*) ;;
15253 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15255 echo "Prototype: $try" ;;
15258 *) case "$usethreads" in
15259 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15266 *) getpwnam_r_proto=0
15270 : see if getpwuid_r exists
15271 set getpwuid_r d_getpwuid_r
15273 case "$d_getpwuid_r" in
15275 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15276 case "$d_getpwuid_r_proto:$usethreads" in
15277 ":define") d_getpwuid_r_proto=define
15278 set d_getpwuid_r_proto getpwuid_r $hdrs
15282 case "$d_getpwuid_r_proto" in
15284 case "$getpwuid_r_proto" in
15285 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15286 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15288 case "$getpwuid_r_proto" in
15289 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15290 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15292 case "$getpwuid_r_proto" in
15293 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15294 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15296 case "$getpwuid_r_proto" in
15297 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15298 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15300 case "$getpwuid_r_proto" in
15301 ''|0) d_getpwuid_r=undef
15303 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15304 * ) case "$getpwuid_r_proto" in
15305 REENTRANT_PROTO*) ;;
15306 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15308 echo "Prototype: $try" ;;
15311 *) case "$usethreads" in
15312 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15319 *) getpwuid_r_proto=0
15323 : Optional checks for getsbyname and getsbyport
15325 : see if getservbyname exists
15326 set getservbyname d_getsbyname
15329 : see if getservbyport exists
15330 set getservbyport d_getsbyport
15333 : see if getservent exists
15334 set getservent d_getsent
15337 : see if getservbyname_r exists
15338 set getservbyname_r d_getservbyname_r
15340 case "$d_getservbyname_r" in
15342 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15343 case "$d_getservbyname_r_proto:$usethreads" in
15344 ":define") d_getservbyname_r_proto=define
15345 set d_getservbyname_r_proto getservbyname_r $hdrs
15349 case "$d_getservbyname_r_proto" in
15351 case "$getservbyname_r_proto" in
15352 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15353 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15355 case "$getservbyname_r_proto" in
15356 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15357 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15359 case "$getservbyname_r_proto" in
15360 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15361 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15363 case "$getservbyname_r_proto" in
15364 ''|0) d_getservbyname_r=undef
15365 getservbyname_r_proto=0
15366 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15367 * ) case "$getservbyname_r_proto" in
15368 REENTRANT_PROTO*) ;;
15369 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15371 echo "Prototype: $try" ;;
15374 *) case "$usethreads" in
15375 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15377 d_getservbyname_r=undef
15378 getservbyname_r_proto=0
15382 *) getservbyname_r_proto=0
15386 : see if getservbyport_r exists
15387 set getservbyport_r d_getservbyport_r
15389 case "$d_getservbyport_r" in
15391 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15392 case "$d_getservbyport_r_proto:$usethreads" in
15393 ":define") d_getservbyport_r_proto=define
15394 set d_getservbyport_r_proto getservbyport_r $hdrs
15398 case "$d_getservbyport_r_proto" in
15400 case "$getservbyport_r_proto" in
15401 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15402 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15404 case "$getservbyport_r_proto" in
15405 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15406 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15408 case "$getservbyport_r_proto" in
15409 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15410 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15412 case "$getservbyport_r_proto" in
15413 ''|0) d_getservbyport_r=undef
15414 getservbyport_r_proto=0
15415 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15416 * ) case "$getservbyport_r_proto" in
15417 REENTRANT_PROTO*) ;;
15418 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15420 echo "Prototype: $try" ;;
15423 *) case "$usethreads" in
15424 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15426 d_getservbyport_r=undef
15427 getservbyport_r_proto=0
15431 *) getservbyport_r_proto=0
15435 : see if getservent_r exists
15436 set getservent_r d_getservent_r
15438 case "$d_getservent_r" in
15440 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15441 case "$d_getservent_r_proto:$usethreads" in
15442 ":define") d_getservent_r_proto=define
15443 set d_getservent_r_proto getservent_r $hdrs
15447 case "$d_getservent_r_proto" in
15449 case "$getservent_r_proto" in
15450 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15451 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15453 case "$getservent_r_proto" in
15454 ''|0) try='int getservent_r(struct servent*, char*, int);'
15455 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15457 case "$getservent_r_proto" in
15458 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15459 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15461 case "$getservent_r_proto" in
15462 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15463 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15465 case "$getservent_r_proto" in
15466 ''|0) d_getservent_r=undef
15467 getservent_r_proto=0
15468 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15469 * ) case "$getservent_r_proto" in
15470 REENTRANT_PROTO*) ;;
15471 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15473 echo "Prototype: $try" ;;
15476 *) case "$usethreads" in
15477 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15479 d_getservent_r=undef
15480 getservent_r_proto=0
15484 *) getservent_r_proto=0
15488 : see if prototypes for various getservxxx netdb.h functions are available
15490 set d_getservprotos getservent $i_netdb netdb.h
15493 : see if getspnam exists
15494 set getspnam d_getspnam
15497 : see if this is a shadow.h system
15498 set shadow.h i_shadow
15501 : see if getspnam_r exists
15502 set getspnam_r d_getspnam_r
15504 case "$d_getspnam_r" in
15506 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15507 case "$d_getspnam_r_proto:$usethreads" in
15508 ":define") d_getspnam_r_proto=define
15509 set d_getspnam_r_proto getspnam_r $hdrs
15513 case "$d_getspnam_r_proto" in
15515 case "$getspnam_r_proto" in
15516 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15517 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15519 case "$getspnam_r_proto" in
15520 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15521 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15523 case "$getspnam_r_proto" in
15524 ''|0) d_getspnam_r=undef
15526 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15527 * ) case "$getspnam_r_proto" in
15528 REENTRANT_PROTO*) ;;
15529 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15531 echo "Prototype: $try" ;;
15534 *) case "$usethreads" in
15535 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15542 *) getspnam_r_proto=0
15546 : see if gettimeofday or ftime exists
15547 set gettimeofday d_gettimeod
15549 case "$d_gettimeod" in
15555 val="$undef"; set d_ftime; eval $setvar
15558 case "$d_gettimeod$d_ftime" in
15561 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15565 : see if gmtime_r exists
15566 set gmtime_r d_gmtime_r
15568 case "$d_gmtime_r" in
15570 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15571 case "$d_gmtime_r_proto:$usethreads" in
15572 ":define") d_gmtime_r_proto=define
15573 set d_gmtime_r_proto gmtime_r $hdrs
15577 case "$d_gmtime_r_proto" in
15579 case "$gmtime_r_proto" in
15580 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15581 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15583 case "$gmtime_r_proto" in
15584 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15585 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15587 case "$gmtime_r_proto" in
15588 ''|0) d_gmtime_r=undef
15590 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15591 * ) case "$gmtime_r_proto" in
15592 REENTRANT_PROTO*) ;;
15593 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15595 echo "Prototype: $try" ;;
15598 *) case "$usethreads" in
15599 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15606 *) gmtime_r_proto=0
15610 : see if hasmntopt exists
15611 set hasmntopt d_hasmntopt
15614 : see if this is a netinet/in.h or sys/in.h system
15615 set netinet/in.h i_niin sys/in.h i_sysin
15618 : see if arpa/inet.h has to be included
15619 set arpa/inet.h i_arpainet
15622 : see if htonl --and friends-- exists
15627 : Maybe they are macros.
15630 $cat >htonl.c <<EOM
15632 #include <sys/types.h>
15633 #$i_niin I_NETINET_IN
15635 #$i_arpainet I_ARPA_INET
15636 #ifdef I_NETINET_IN
15637 #include <netinet/in.h>
15640 #include <sys/in.h>
15643 #include <arpa/inet.h>
15646 printf("Defined as a macro.");
15649 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15650 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15652 echo "But it seems to be defined as a macro." >&4
15660 : see if hypot exists
15664 : see if ilogb exists
15668 : see if ilogbl exists
15669 set ilogbl d_ilogbl
15672 : check whether inet_aton exists
15673 set inet_aton d_inetaton
15676 : see if inet_ntop exists
15677 set inet_ntop d_inetntop
15680 : see if inet_pton exists
15681 set inet_pton d_inetpton
15686 $cat >isascii.c <<EOCP
15689 #$i_stdlib I_STDLIB
15691 #include <stdlib.h>
15702 if eval $compile; then
15703 echo "isascii() found." >&4
15706 echo "isascii() NOT found." >&4
15715 $cat >isblank.c <<'EOCP'
15726 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15727 echo "isblank() found." >&4
15730 echo "isblank() NOT found." >&4
15737 : check for isfinite
15738 echo "Checking to see if you have isfinite..." >&4
15741 int main() { return isfinite(0.0); }
15744 if eval $compile; then
15746 echo "You have isfinite."
15749 echo "You do not have isfinite."
15755 : see if isfinitel exists
15756 set isfinitel d_isfinitel
15760 echo "Checking to see if you have isinf..." >&4
15763 int main() { return isinf(0.0); }
15766 if eval $compile; then
15768 echo "You have isinf."
15771 echo "You do not have isinf."
15777 : see if isinfl exists
15778 set isinfl d_isinfl
15782 echo "Checking to see if you have isless..." >&4
15785 int main() { return isless(2.0, 1.0); }
15788 if eval $compile; then
15790 echo "You have isless."
15793 echo "You do not have isless."
15800 echo "Checking to see if you have isnan..." >&4
15803 int main() { return isnan(0.0); }
15806 if eval $compile; then
15808 echo "You have isnan."
15811 echo "You do not have isnan."
15817 : see if isnanl exists
15818 set isnanl d_isnanl
15821 : check for isnormal
15822 echo "Checking to see if you have isnormal..." >&4
15825 int main() { return isnormal(0.0); }
15828 if eval $compile; then
15830 echo "You have isnormal."
15833 echo "You do not have isnormal."
15843 : see if j0l exists
15847 : see if killpg exists
15848 set killpg d_killpg
15851 : see if localeconv exists
15852 set localeconv d_locconv
15855 : see if libc has the POSIX.1-2008 currency locale rules
15856 case "$d_locconv:$d_lc_monetary_2008" in
15859 #include <locale.h>
15861 struct lconv *lc = localeconv();
15862 char int_p_cs_precedes = lc->int_p_cs_precedes;
15867 if eval $compile; then
15868 d_lc_monetary_2008="$define"
15870 d_lc_monetary_2008="$undef"
15876 : see if lchown exists
15878 $cat > try.c <<EOCP
15881 #include <stdlib.h>
15882 #$i_unistd I_UNISTD
15884 # include <unistd.h>
15886 int main(int argc, char *argv[])
15888 if (lchown("./try.c", -1, getgid()) == -1) {
15889 exit(EXIT_FAILURE);
15891 exit(EXIT_SUCCESS);
15895 if eval $compile && ./try; then
15896 $echo "lchown() found." >&4
15899 $echo "lchown() NOT found." >&4
15906 : See if number of significant digits in a double precision number is known
15908 $cat >ldbl_dig.c <<EOM
15909 #include <limits.h>
15912 printf("Contains LDBL_DIG");
15915 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15916 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15917 echo "LDBL_DIG found." >&4
15920 echo "LDBL_DIG NOT found." >&4
15927 : see if lgamma exists
15928 set lgamma d_lgamma
15931 : see if lgamma_r exists
15932 set lgamma_r d_lgamma_r
15935 : check to see if math.h defines _LIB_VERSION
15936 d_libm_lib_version="$undef"
15938 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15940 #include <unistd.h>
15942 int main (int argc, char *argv[])
15944 printf ("%d\n", _LIB_VERSION);
15949 if eval $compile; then
15951 echo "Yes, it does ($foo)" >&4
15952 d_libm_lib_version="$define"
15954 echo "No, it does not (probably harmless)" >&4
15958 : see if link exists
15962 : see if llrint exists
15963 set llrint d_llrint
15966 : see if llrintl exists
15967 set llrintl d_llrintl
15970 : see if llround exists
15971 set llround d_llround
15974 : see if llroundl exists
15975 set llroundl d_llroundl
15978 : see if localeconv_l exists
15979 set localeconv_l d_localeconv_l
15982 : see if localtime_r exists
15983 set localtime_r d_localtime_r
15985 case "$d_localtime_r" in
15987 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15988 case "$d_localtime_r_proto:$usethreads" in
15989 ":define") d_localtime_r_proto=define
15990 set d_localtime_r_proto localtime_r $hdrs
15994 case "$d_localtime_r_proto" in
15996 case "$localtime_r_proto" in
15997 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15998 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16000 case "$localtime_r_proto" in
16001 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16002 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16004 case "$localtime_r_proto" in
16005 ''|0) d_localtime_r=undef
16006 localtime_r_proto=0
16007 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16008 * ) case "$localtime_r_proto" in
16009 REENTRANT_PROTO*) ;;
16010 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16012 echo "Prototype: $try" ;;
16015 *) case "$usethreads" in
16016 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16018 d_localtime_r=undef
16019 localtime_r_proto=0
16023 *) localtime_r_proto=0
16027 : see if localtime_r calls tzset
16028 case "$localtime_r_proto" in
16031 /* Does our libc's localtime_r call tzset ?
16032 * return 0 if so, 1 otherwise.
16034 #$i_systypes I_SYS_TYPES
16035 #$i_unistd I_UNISTD
16037 #$i_stdlib I_STDLIB
16038 #$i_malloc I_MALLOC
16040 # include <sys/types.h>
16043 # include <unistd.h>
16049 #include <stdlib.h>
16051 #include <string.h>
16053 # include <malloc.h>
16058 time_t t = time(0L);
16059 char w_tz[]="TZ" "=GMT+5",
16060 e_tz[]="TZ" "=GMT-5",
16061 *tz_e = (char*)malloc(16),
16062 *tz_w = (char*)malloc(16);
16063 struct tm tm_e, tm_w;
16064 memset(&tm_e,'\0',sizeof(struct tm));
16065 memset(&tm_w,'\0',sizeof(struct tm));
16070 localtime_r(&t, &tm_e);
16073 localtime_r(&t, &tm_w);
16075 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16078 free(tz_e);free(tz_w);
16083 if eval $compile; then
16084 if $run ./try; then
16085 d_localtime_r_needs_tzset=undef;
16087 d_localtime_r_needs_tzset=define;
16090 d_localtime_r_needs_tzset=undef;
16094 d_localtime_r_needs_tzset=undef;
16099 : see if lockf exists
16103 : see if log1p exists
16107 : see if log2 exists
16111 : see if logb exists
16115 : see if lrint exists
16119 : see if lrintl exists
16120 set lrintl d_lrintl
16123 : see if lround exists
16124 set lround d_lround
16127 : see if lroundl exists
16128 set lroundl d_lroundl
16131 : see if prototype for lseek is available
16133 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16136 : see if lstat exists
16140 : see if madvise exists
16141 set madvise d_madvise
16144 : see if malloc_size exists
16145 set malloc_size d_malloc_size
16148 : see if malloc_size_good exists
16149 set malloc_good_size d_malloc_good_size
16152 : see if malloc_usable_size exists
16153 set malloc_usable_size d_malloc_usable_size
16156 : see if mblen exists
16160 : see if mbrlen exists
16161 set mbrlen d_mbrlen
16164 : see if mbrtowc exists
16165 set mbrtowc d_mbrtowc
16168 : see if mbstowcs exists
16169 set mbstowcs d_mbstowcs
16172 : see if mbtowc exists
16173 set mbtowc d_mbtowc
16176 : see if memmem exists
16177 : We need both a prototype in string.h and the symbol in libc.
16180 xx1="#$d_gnulibc HAS_GNULIBC"
16181 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16182 xx3='# define _GNU_SOURCE'
16184 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16186 case "$d_memmem_proto" in
16187 define) # see if memmem exists
16188 set memmem d_memmem
16197 : see if memrchr exists
16198 : We need both a prototype in string.h and the symbol in libc.
16201 xx1="#$d_gnulibc HAS_GNULIBC"
16202 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16203 xx3='# define _GNU_SOURCE'
16205 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16207 case "$d_memrchr_proto" in
16208 define) # see if memrchr exists
16209 set memrchr d_memrchr
16218 : see if mkdir exists
16222 : see if mkdtemp exists
16223 set mkdtemp d_mkdtemp
16226 : see if mkfifo exists
16227 set mkfifo d_mkfifo
16230 : see if mkostemp exists
16231 set mkostemp d_mkostemp
16234 : see if mkstemp exists
16235 set mkstemp d_mkstemp
16238 : see if mkstemps exists
16239 set mkstemps d_mkstemps
16242 : see if mktime exists
16243 set mktime d_mktime
16246 : see if sys/mman.h has to be included
16247 set sys/mman.h i_sysmman
16250 : see if mmap exists
16253 : see what shmat returns
16254 : default to something harmless
16256 case "$i_sysmman$d_mmap" in
16258 $cat >mmap.c <<'END'
16259 #include <sys/mman.h>
16262 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16267 echo "and it returns ($mmaptype)." >&4
16271 : see if sqrtl exists
16275 : see if scalbnl exists
16276 set scalbnl d_scalbnl
16279 : see if truncl exists
16280 set truncl d_truncl
16283 : see if modfl exists
16287 : see if prototype for modfl is available
16289 set d_modflproto modfl define math.h
16292 if $test "$uselongdouble" = "$define"; then
16294 if $test "$d_sqrtl" != "$define"; then
16295 message="$message sqrtl"
16297 if $test "$d_modfl" != "$define"; then
16298 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16299 echo "You have both truncl and copysignl, so I can emulate modfl."
16301 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16302 echo "You have both aintl and copysignl, so I can emulate modfl."
16304 message="$message modfl"
16308 if $test "$d_frexpl" != "$define"; then
16309 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16310 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16312 message="$message frexpl"
16315 if $test "$d_ldexpl" != "$define"; then
16316 message="$message ldexpl"
16319 if $test "$message" != ""; then
16322 *** You requested the use of long doubles but you do not seem to have
16323 *** the following mathematical functions needed for long double support:
16325 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16326 *** Cannot continue, aborting.
16334 : see if mprotect exists
16335 set mprotect d_mprotect
16338 : see if msgctl exists
16339 set msgctl d_msgctl
16342 : see if msgget exists
16343 set msgget d_msgget
16346 : see if msgsnd exists
16347 set msgsnd d_msgsnd
16350 : see if msgrcv exists
16351 set msgrcv d_msgrcv
16354 : see how much of the 'msg*(2)' library is present.
16357 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16358 *"$undef"*) h_msg=false;;
16362 case "`ipcs 2>&1`" in
16363 "SVID messages"*"not configured"*)
16364 echo "Your $osname does not have the msg*(2) configured." >&4
16367 set msgctl d_msgctl
16369 set msgget d_msgget
16371 set msgsnd d_msgsnd
16373 set msgrcv d_msgrcv
16379 : we could also check for sys/ipc.h ...
16380 if $h_msg && $test `./findhdr sys/msg.h`; then
16381 echo "You have the full msg*(2) library." >&4
16384 echo "You don't have the full msg*(2) library." >&4
16390 : Check for msghdr_s
16392 echo "Checking to see if your system supports struct msghdr..." >&4
16393 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16395 case "$d_msghdr_s" in
16396 "$define") echo "Yes, it does." ;;
16397 *) echo "No, it doesn't." ;;
16400 : see if msync exists
16404 : see if munmap exists
16405 set munmap d_munmap
16408 : see if nan exists
16412 : see if nanosleep exists
16413 set nanosleep d_nanosleep
16416 : see if nearbyint exists
16417 set nearbyint d_nearbyint
16420 : see if nextafter exists
16421 set nextafter d_nextafter
16424 : see if nexttoward exists
16425 set nexttoward d_nexttoward
16428 : see if nice exists
16432 : see if this is a langinfo.h system
16433 set langinfo.h i_langinfo
16436 : see if nl_langinfo exists
16437 set nl_langinfo d_nl_langinfo
16440 : see if this is a quadmath.h system
16441 set quadmath.h i_quadmath
16444 : Check basic sizes
16446 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16448 case "$use64bitint:$d_quad:$quadtype" in
16451 uvtype="$uquadtype"
16456 uvtype="unsigned long"
16462 case "$uselongdouble:$d_longdbl" in
16464 nvtype="long double"
16465 nvsize=$longdblsize
16472 case "$usequadmath:$i_quadmath" in
16474 nvtype="__float128"
16480 *** You requested the use of the quadmath library, but you
16481 *** do not seem to have the quadmath library installed.
16482 *** Cannot continue, aborting.
16488 define:*) $cat <<EOM >&4
16490 *** You requested the use of the quadmath library, but you
16491 *** do not seem to have the required header, <quadmath.h>.
16493 case "$gccversion" in
16496 *** Your gcc looks a bit old:
16502 *** You are not running a gcc.
16507 *** For the quadmath library you need at least gcc 4.6.
16508 *** Cannot continue, aborting.
16514 $echo "(IV will be "$ivtype", $ivsize bytes)"
16515 $echo "(UV will be "$uvtype", $uvsize bytes)"
16516 $echo "(NV will be "$nvtype", $nvsize bytes)"
16519 #$i_inttypes I_INTTYPES
16521 #include <inttypes.h>
16526 int8_t i = INT8_MAX;
16527 uint8_t u = UINT8_MAX;
16528 printf("int8_t\n");
16531 int16_t i = INT16_MAX;
16532 uint16_t u = UINT16_MAX;
16533 printf("int16_t\n");
16536 int32_t i = INT32_MAX;
16537 uint32_t u = UINT32_MAX;
16538 printf("int32_t\n");
16543 i8type="signed char"
16544 u8type="unsigned char"
16549 '') case "$shortsize" in
16551 u16type="unsigned short"
16559 '') set try -DINT16
16560 if eval $compile; then
16561 case "`$run ./try`" in
16573 '') if $test $shortsize -ge 2; then
16575 u16type="unsigned short"
16583 '') case "$longsize" in
16585 u32type="unsigned long"
16589 *) case "$intsize" in
16591 u32type="unsigned int"
16601 '') set try -DINT32
16602 if eval $compile; then
16603 case "`$run ./try`" in
16615 '') if $test $intsize -ge 4; then
16617 u32type="unsigned int"
16625 '') case "$d_quad:$quadtype" in
16627 i64type="$quadtype"
16628 u64type="$uquadtype"
16636 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16639 #$i_stdlib I_STDLIB
16641 #include <stdlib.h>
16643 #include <sys/types.h>
16644 #include <signal.h>
16646 /* volatile so that the compiler has to store it out to memory */
16647 volatile int bletched = 0;
16648 $signal_t blech(int s) { bletched = 1; }
16653 int n = 8 * $uvsize;
16656 signal(SIGFPE, blech);
16659 for (i = 0; i < n; i++) {
16660 u = u << 1 | ($uvtype)1;
16662 if (($uvtype)d != u)
16666 d = ($nvtype)(u - 1);
16667 if (($uvtype)d != (u - 1))
16674 printf("%d\n", ((i == n) ? -n : i));
16680 d_nv_preserves_uv="$undef"
16681 if eval $compile; then
16682 nv_preserves_uv_bits="`$run ./try`"
16684 case "$nv_preserves_uv_bits" in
16686 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16687 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16688 d_nv_preserves_uv="$define"
16690 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16691 d_nv_preserves_uv="$undef" ;;
16692 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16693 nv_preserves_uv_bits="0" ;;
16697 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16701 typedef $nvtype NV;
16708 while(count < 256) {
16709 /* volatile so that the compiler has to store it out to memory */
16710 volatile NV up = value + 1.0;
16711 volatile NV negated = -value;
16712 volatile NV down = negated - 1.0;
16713 volatile NV got_up = up - value;
16714 int up_good = got_up == 1.0;
16715 int got_down = down - negated;
16716 int down_good = got_down == -1.0;
16718 if (down_good != up_good) {
16720 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16721 up_good, (double) got_up, down_good, (double) got_down,
16722 count, (double) value);
16729 fputs("256.0", stdout);
16732 fputs("2.0", stdout);
16738 fputs("*", stdout);
16744 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16745 count, (double) value);
16751 nv_overflows_integers_at='0'
16752 if eval $compile; then
16758 The largest integer your NVs can preserve is equal to $xxx
16760 nv_overflows_integers_at="$xxx"
16763 Cannot determine the largest integer value your NVs can hold, unexpected output
16770 Cannot determine the largest integer value your NVs can hold
16777 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16780 #$i_stdlib I_STDLIB
16782 #include <stdlib.h>
16784 #include <string.h>
16785 #include <sys/types.h>
16786 #include <signal.h>
16788 /* volatile so that the compiler has to store it out to memory */
16789 volatile int bletched = 0;
16790 $signal_t blech(int s) { bletched = 1; }
16793 int checkit($nvtype d, const char *where) {
16795 unsigned char *p = (unsigned char *)v;
16796 unsigned char *end = p + sizeof(d);
16805 p = (unsigned char *)v;
16806 printf("No - %s: 0x", where);
16808 printf ("%02X", *p++);
16813 int main(int argc, char **argv) {
16816 fail += checkit(d, "0.0");
16818 /* The compiler shouldn't be assuming that bletched is 0 */
16821 fail += checkit(d, "bleched");
16824 signal(SIGFPE, blech);
16827 /* Paranoia - the compiler should have no way of knowing that ANSI says
16828 that argv[argc] will always be NULL. Actually, if it did assume this it
16829 would be buggy, as this is C and main() can be called from elsewhere in
16831 d = argv[argc] ? 1 : 0;
16834 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16837 fail += checkit(d, "ternary");
16839 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16842 printf("No - memset doesn't give 0.0\n");
16843 /* This might just blow up: */
16844 printf("(gives %g)\n", d);
16850 printf("No - something bleched\n");
16855 printf("No - %d fail(s)\n", fail);
16864 d_nv_zero_is_allbits_zero="$undef"
16865 if eval $compile; then
16871 0.0 is represented as all bits zero in memory
16873 d_nv_zero_is_allbits_zero="$define"
16876 0.0 is not represented as all bits zero in memory
16878 d_nv_zero_is_allbits_zero="$undef"
16883 0.0 is not represented as all bits zero in memory
16885 d_nv_zero_is_allbits_zero="$undef"
16891 : check for off64_t
16893 echo "Checking to see if you have off64_t..." >&4
16895 #include <sys/types.h>
16896 #include <unistd.h>
16897 int main() { off64_t x = 7; }
16900 if eval $compile; then
16902 echo "You have off64_t."
16905 echo "You do not have off64_t."
16906 case "$lseeksize" in
16907 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16914 : how to create joinable pthreads
16915 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16917 echo "Checking what constant to use for creating joinable pthreads..." >&4
16918 $cat >try.c <<'EOCP'
16919 #include <pthread.h>
16921 int detachstate = JOINABLE;
16924 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16925 if eval $compile; then
16926 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16927 val="$undef" # Yes, undef.
16928 set d_old_pthread_create_joinable
16931 set old_pthread_create_joinable
16934 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16935 if eval $compile; then
16936 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16938 set d_old_pthread_create_joinable
16940 val=PTHREAD_CREATE_UNDETACHED
16941 set old_pthread_create_joinable
16944 set try -DJOINABLE=__UNDETACHED
16945 if eval $compile; then
16946 echo "You seem to use __UNDETACHED." >&4
16948 set d_old_pthread_create_joinable
16951 set old_pthread_create_joinable
16954 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16956 set d_old_pthread_create_joinable
16959 set old_pthread_create_joinable
16966 d_old_pthread_create_joinable="$undef"
16967 old_pthread_create_joinable=""
16970 : see if pause exists
16974 : see if pipe2 exists
16978 : see if poll exists
16982 : see if prctl exists
16986 : see if prctl supports PR_SET_NAME
16987 d_prctl_set_name=$undef
16992 #include <unistd.h>
16994 #include <sys/prctl.h>
16996 int main (int argc, char *argv[])
16998 return (prctl (PR_SET_NAME, "Test"));
17002 if eval $compile_ok && $run ./try; then
17003 echo "Your prctl (PR_SET_NAME, ...) works"
17004 d_prctl_set_name=$define
17010 : see if readlink exists
17011 set readlink d_readlink
17014 : Check if there is a /proc symlink to the abs path of
17015 : the executing program. We will honor hints of d_procselfexe=$undef
17016 : or procselfexe being non-empty, otherwise will try to determine both
17017 : if we have readlink.
17018 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17019 : referenced, and AmigaOS does not have a proc filesystem anyway.
17022 if $test "X$d_procselfexe" = Xundef; then
17024 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17026 elif $test "X$d_readlink" = Xdefine; then
17027 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17028 : and it feels more tidy to avoid an extra level of symlink
17029 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17030 while test $# -gt 0; do
17033 if $issymlink $try; then
17034 $ls -l $try > reflect
17035 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17036 echo "You have $type-like $try."
17037 procselfexe='"'$try'"'
17039 : This will break out of the loop
17049 : backward compatibility for d_hvfork
17050 if test X$d_hvfork != X; then
17051 d_vfork="$d_hvfork"
17054 : see if there is a vfork
17059 d_pseudofork=$undef
17061 : Ok, but do we want to use it. vfork is reportedly unreliable in
17062 : perl on Solaris 2.x, and probably elsewhere.
17066 case "$usevfork" in
17072 Perl can only use a vfork() that doesn't suffer from strict
17073 restrictions on calling functions or modifying global data in
17074 the child. For example, glibc-2.1 contains such a vfork()
17075 that is unsuitable. If your system provides a proper fork()
17076 call, chances are that you do NOT want perl to use vfork().
17079 rp="Do you still want to use vfork()?"
17084 echo "Ok, we won't use vfork()."
17093 $define) usevfork='true';;
17094 *) usevfork='false';;
17097 : see whether the pthread_atfork exists
17099 #include <pthread.h>
17102 #ifdef PTHREAD_ATFORK
17103 pthread_atfork(NULL,NULL,NULL);
17108 : see if pthread_atfork exists
17109 set try -DPTHREAD_ATFORK
17110 if eval $compile; then
17115 case "$usethreads" in
17118 $define) echo 'pthread_atfork found.' >&4 ;;
17119 *) echo 'pthread_atfork NOT found.' >&4 ;;
17122 set d_pthread_atfork
17125 : see if pthread_attr_setscope exists
17126 set pthread_attr_setscope d_pthread_attr_setscope
17129 : see whether the various POSIXish _yields exist
17131 #include <pthread.h>
17137 #ifdef PTHREAD_YIELD
17140 #ifdef PTHREAD_YIELD_NULL
17141 pthread_yield(NULL);
17147 : see if sched_yield exists
17148 set try -DSCHED_YIELD
17149 if eval $compile; then
17151 sched_yield='sched_yield()'
17155 case "$usethreads" in
17158 $define) echo 'sched_yield() found.' >&4 ;;
17159 *) echo 'sched_yield() NOT found.' >&4 ;;
17165 : see if pthread_yield exists
17166 set try -DPTHREAD_YIELD
17167 if eval $compile; then
17169 case "$sched_yield" in
17170 '') sched_yield='pthread_yield()' ;;
17173 set try -DPTHREAD_YIELD_NULL
17174 if eval $compile; then
17176 case "$sched_yield" in
17177 '') sched_yield='pthread_yield(NULL)' ;;
17183 case "$usethreads" in
17186 $define) echo 'pthread_yield() found.' >&4 ;;
17187 *) echo 'pthread_yield() NOT found.' >&4 ;;
17191 set d_pthread_yield
17193 case "$sched_yield" in
17194 '') sched_yield=undef ;;
17198 : check for ptrdiff_t
17200 echo "Checking to see if you have ptrdiff_t..." >&4
17202 #include <stddef.h>
17203 int main() { ptrdiff_t x = 7; }
17206 if eval $compile; then
17208 echo "You have ptrdiff_t."
17211 echo "You do not have ptrdiff_t."
17217 : see if random_r exists
17218 set random_r d_random_r
17220 case "$d_random_r" in
17222 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17223 case "$d_random_r_proto:$usethreads" in
17224 ":define") d_random_r_proto=define
17225 set d_random_r_proto random_r $hdrs
17229 case "$d_random_r_proto" in
17231 case "$random_r_proto" in
17232 ''|0) try='int random_r(int*, struct random_data*);'
17233 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17235 case "$random_r_proto" in
17236 ''|0) try='int random_r(long*, struct random_data*);'
17237 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17239 case "$random_r_proto" in
17240 ''|0) try='int random_r(struct random_data*, int32_t*);'
17241 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17243 case "$random_r_proto" in
17244 ''|0) d_random_r=undef
17246 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17247 * ) case "$random_r_proto" in
17248 REENTRANT_PROTO*) ;;
17249 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17251 echo "Prototype: $try" ;;
17254 *) case "$usethreads" in
17255 define) echo "random_r has no prototype, not using it." >&4 ;;
17262 *) random_r_proto=0
17266 : see if readdir and friends exist
17267 set readdir d_readdir
17269 set seekdir d_seekdir
17271 set telldir d_telldir
17273 set rewinddir d_rewinddir
17276 : see if readdir64_r exists
17277 set readdir64_r d_readdir64_r
17279 case "$d_readdir64_r" in
17281 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17282 case "$d_readdir64_r_proto:$usethreads" in
17283 ":define") d_readdir64_r_proto=define
17284 set d_readdir64_r_proto readdir64_r $hdrs
17288 case "$d_readdir64_r_proto" in
17290 case "$readdir64_r_proto" in
17291 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17292 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17294 case "$readdir64_r_proto" in
17295 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17296 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17298 case "$readdir64_r_proto" in
17299 ''|0) d_readdir64_r=undef
17300 readdir64_r_proto=0
17301 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17302 * ) case "$readdir64_r_proto" in
17303 REENTRANT_PROTO*) ;;
17304 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17306 echo "Prototype: $try" ;;
17309 *) case "$usethreads" in
17310 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17312 d_readdir64_r=undef
17313 readdir64_r_proto=0
17317 *) readdir64_r_proto=0
17321 : see if readdir_r exists
17322 set readdir_r d_readdir_r
17324 case "$d_readdir_r" in
17326 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17327 case "$d_readdir_r_proto:$usethreads" in
17328 ":define") d_readdir_r_proto=define
17329 set d_readdir_r_proto readdir_r $hdrs
17333 case "$d_readdir_r_proto" in
17335 case "$readdir_r_proto" in
17336 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17337 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17339 case "$readdir_r_proto" in
17340 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17341 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17343 case "$readdir_r_proto" in
17344 ''|0) d_readdir_r=undef
17346 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17347 * ) case "$readdir_r_proto" in
17348 REENTRANT_PROTO*) ;;
17349 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17351 echo "Prototype: $try" ;;
17354 *) case "$usethreads" in
17355 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17362 *) readdir_r_proto=0
17366 : see if readv exists
17370 : see if recvmsg exists
17371 set recvmsg d_recvmsg
17374 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17376 if set regcomp val -f d_regcomp; eval $csym; $val; then
17377 echo 'regcomp() found.' >&4
17378 d_regcomp="$define"
17381 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17382 echo 'regcmp() found.' >&4
17386 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17387 echo 're_comp() found, assuming re_exec() also exists.' >&4
17388 d_re_comp="$define"
17393 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17400 : see if remainder exists
17401 set remainder d_remainder
17404 : see if remquo exists
17405 set remquo d_remquo
17408 : see if rename exists
17409 set rename d_rename
17412 : see if rint exists
17416 : see if rmdir exists
17420 : see if round exists
17424 : see if prototype for sbrk is available
17426 set d_sbrkproto sbrk $i_unistd unistd.h
17429 : see if scalbn exists
17430 set scalbn d_scalbn
17433 : see if select exists
17434 set select d_select
17437 : see if semctl exists
17438 set semctl d_semctl
17441 : see if semget exists
17442 set semget d_semget
17445 : see if semop exists
17449 : see how much of the 'sem*(2)' library is present.
17452 case "$d_semctl$d_semget$d_semop" in
17453 *"$undef"*) h_sem=false;;
17457 case "`ipcs 2>&1`" in
17458 "SVID messages"*"not configured"*)
17459 echo "Your $osname does not have the sem*(2) configured." >&4
17462 set semctl d_semctl
17464 set semget d_semget
17472 : we could also check for sys/ipc.h ...
17473 if $h_sem && $test `./findhdr sys/sem.h`; then
17474 echo "You have the full sem*(2) library." >&4
17477 echo "You don't have the full sem*(2) library." >&4
17483 : see whether sys/sem.h defines union semun
17485 $cat > try.c <<'END'
17486 #include <sys/types.h>
17487 #include <sys/ipc.h>
17488 #include <sys/sem.h>
17489 int main () { union semun semun; semun.buf = 0; }
17492 if eval $compile; then
17493 echo "You have union semun in <sys/sem.h>." >&4
17496 echo "You do not have union semun in <sys/sem.h>." >&4
17503 : see how to do semctl IPC_STAT
17507 $cat > tryh.h <<END
17510 # define S_IRUSR S_IREAD
17511 # define S_IWUSR S_IWRITE
17512 # define S_IXUSR S_IEXEC
17514 # define S_IRUSR 0400
17515 # define S_IWUSR 0200
17516 # define S_IXUSR 0100
17518 # define S_IRGRP (S_IRUSR>>3)
17519 # define S_IWGRP (S_IWUSR>>3)
17520 # define S_IXGRP (S_IXUSR>>3)
17521 # define S_IROTH (S_IRUSR>>6)
17522 # define S_IWOTH (S_IWUSR>>6)
17523 # define S_IXOTH (S_IXUSR>>6)
17526 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17527 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17528 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17531 : see whether semctl IPC_STAT can use union semun
17532 case "$d_semctl_semun" in
17536 #include <sys/types.h>
17537 #include <sys/ipc.h>
17538 #include <sys/sem.h>
17539 #include <sys/stat.h>
17546 #$d_union_semun HAS_UNION_SEMUN
17549 #ifndef HAS_UNION_SEMUN
17552 struct semid_ds *buf;
17553 unsigned short *array;
17559 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17560 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17562 struct semid_ds argbuf;
17565 st = semctl(sem, 0, IPC_STAT, arg);
17569 # endif /* IPC_STAT */
17570 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17572 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17573 # endif /* IPC_RMID */
17574 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17576 #endif /* IPC_PRIVATE && ... */
17577 printf("semget failed: errno = %d\n", errno);
17582 if eval $compile; then
17585 semun) val="$define" ;;
17593 case "$d_semctl_semun" in
17595 echo "You can use union semun for semctl IPC_STAT." >&4
17598 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17603 : see whether semctl IPC_STAT can use struct semid_ds pointer
17604 case "$d_semctl_semid_ds" in
17607 $cat > try.c <<'END'
17608 #include <sys/types.h>
17609 #include <sys/ipc.h>
17610 #include <sys/sem.h>
17611 #include <sys/stat.h>
17620 #ifndef HAS_UNION_SEMUN
17623 struct semid_ds *buf;
17624 unsigned short *array;
17628 struct semid_ds argbuf;
17631 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17632 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17636 st = semctl(sem, 0, IPC_STAT, arg);
17638 printf("semid_ds\n");
17640 # endif /* IPC_STAT */
17641 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17643 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17644 # endif /* IPC_RMID */
17645 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17647 #endif /* IPC_PRIVATE && ... */
17648 printf("semget failed: errno = %d\n", errno);
17654 if eval $compile; then
17657 semid_ds) val="$define" ;;
17661 set d_semctl_semid_ds
17665 case "$d_semctl_semid_ds" in
17667 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17669 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17675 # We do not have the full sem*(2) library, so assume we can not
17681 set d_semctl_semid_ds
17687 : see if sendmsg exists
17688 set sendmsg d_sendmsg
17691 : see if setegid exists
17692 set setegid d_setegid
17695 : see if seteuid exists
17696 set seteuid d_seteuid
17699 : see if setgrent exists
17700 set setgrent d_setgrent
17703 : see if setgrent_r exists
17704 set setgrent_r d_setgrent_r
17706 case "$d_setgrent_r" in
17708 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17709 case "$d_setgrent_r_proto:$usethreads" in
17710 ":define") d_setgrent_r_proto=define
17711 set d_setgrent_r_proto setgrent_r $hdrs
17715 case "$d_setgrent_r_proto" in
17717 case "$setgrent_r_proto" in
17718 ''|0) try='int setgrent_r(FILE**);'
17719 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17721 case "$setgrent_r_proto" in
17722 ''|0) try='void setgrent_r(FILE**);'
17723 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17725 case "$setgrent_r_proto" in
17726 ''|0) d_setgrent_r=undef
17728 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17729 * ) case "$setgrent_r_proto" in
17730 REENTRANT_PROTO*) ;;
17731 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17733 echo "Prototype: $try" ;;
17736 *) case "$usethreads" in
17737 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17744 *) setgrent_r_proto=0
17748 : see if sethostent exists
17749 set sethostent d_sethent
17752 : see if sethostent_r exists
17753 set sethostent_r d_sethostent_r
17755 case "$d_sethostent_r" in
17757 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17758 case "$d_sethostent_r_proto:$usethreads" in
17759 ":define") d_sethostent_r_proto=define
17760 set d_sethostent_r_proto sethostent_r $hdrs
17764 case "$d_sethostent_r_proto" in
17766 case "$sethostent_r_proto" in
17767 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17768 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17770 case "$sethostent_r_proto" in
17771 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17772 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17774 case "$sethostent_r_proto" in
17775 ''|0) d_sethostent_r=undef
17776 sethostent_r_proto=0
17777 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17778 * ) case "$sethostent_r_proto" in
17779 REENTRANT_PROTO*) ;;
17780 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17782 echo "Prototype: $try" ;;
17785 *) case "$usethreads" in
17786 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17788 d_sethostent_r=undef
17789 sethostent_r_proto=0
17793 *) sethostent_r_proto=0
17797 : see if setitimer exists
17798 set setitimer d_setitimer
17801 : see if setlinebuf exists
17802 set setlinebuf d_setlinebuf
17805 : see if locale.h is available
17806 set locale.h i_locale
17809 : see if this system has wctype.h
17810 set wctype.h i_wctype
17813 : see if towupper exists
17814 set towupper d_towupper
17817 : check for setlocale function and behavior
17818 case "$d_setlocale" in
17822 Checking to see if you have setlocale() and its behavior
17825 #include <stdlib.h>
17826 #include <string.h>
17827 #$i_locale I_LOCALE
17829 # include <locale.h>
17831 #$i_wctype I_WCTYPE
17833 # include <wctype.h>
17837 const char * invalid_name = "\a"; /* This is really invalid! */
17838 int accepts_any_locale_name = 0;
17839 int has_C_UTF8 = 0;
17840 unsigned char bad_setlocale = 255;
17842 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17843 * disabled. It's hard to imagine an instance where meaningful locale
17844 * handling could be done without LC_CTYPE */
17845 const char * name = setlocale(LC_CTYPE, "C");
17847 if (name == NULL || strcmp(name, "C") != 0) {
17848 exit(bad_setlocale);
17851 name = setlocale(LC_CTYPE, invalid_name);
17852 if (name != NULL) {
17854 /* Let it pass if it accepts the name but gives back one of the C
17856 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17857 accepts_any_locale_name = 1;
17861 name = setlocale(LC_CTYPE, "C.UTF-8");
17862 if (name != NULL) {
17863 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17865 #$d_towupper HAS_TOWUPPER
17866 #ifdef HAS_TOWUPPER
17868 /* We assume that if the machine doesn't have the C99 towupper, it
17869 * doesn't have C.UTF-8, even if we successfully changed locales to
17870 * include it. This seems safer even on platforms that didn't accept
17871 * the really invalid name */
17873 if (towupper(y_with_diaeresis) == 0x178) {
17883 /* Currently unused code to determine if LC_ALL with disparate values uses
17884 * category = value pairs or positional, and to determine the separator
17885 * between the categories. We could add code so that if the separator were
17886 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
17887 * every possible ASCII separator would fit in the 5 bits available in the
17888 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
17889 * positional, we probably would want to know the order of the categories.
17890 * Using a file between the C program and the shell script would really be
17891 * require to do that */
17894 unsigned char min_separator = ' ' - 1;
17895 unsigned char separator = min_separator;
17896 int uses_name_value_pair_names = 0;
17898 name = setlocale(LC_ALL, "C");
17899 if (name == NULL || strcmp(name, "C") != 0) {
17900 exit(bad_setlocale);
17906 name = setlocale(LC_CTYPE, "C.UTF-8");
17907 if (name == NULL) {
17908 exit(bad_setlocale);
17910 name = setlocale(LC_ALL, NULL);
17911 if (name == NULL) {
17912 exit(bad_setlocale);
17915 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
17917 uses_name_value_pair_names = 1;
17919 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
17922 separator = *(pos - 1);
17926 pos = strstr(name, "C.UTF-8");
17930 else if (pos == name) {
17931 separator = name[sizeof("C.UTF-8") - 1];
17934 separator = *(pos - 1);
17942 exit( 0 /* (separator - min_separator) << 3
17943 | uses_name_value_pair_names << 2
17946 | accepts_any_locale_name);
17953 case $d_setlocale in
17954 $undef) d_setlocale_accepts_any_locale_name="$undef"
17955 d_has_C_UTF8="false"
17958 if eval $compile; then
17959 echo "Your system has setlocale()..." >&4
17962 0) echo "and it seems sane; you don't have a C.UTF8 locale" >&4
17963 d_setlocale="$define"
17964 d_setlocale_accepts_any_locale_name="$undef"
17965 d_has_C_UTF8="false"
17967 1) echo "and it seems sane, but accepts any locale name as valid" >&4
17968 d_setlocale="$define"
17969 d_setlocale_accepts_any_locale_name="$define"
17970 d_has_C_UTF8="false"
17972 2) echo "and it seems sane; you have a C.UTF8 locale" >&4
17973 d_setlocale="$define"
17974 d_setlocale_accepts_any_locale_name="$undef"
17975 d_has_C_UTF8="true"
17977 3) echo "and it seems sane, but accepts any locale name as valid" >&4
17978 d_setlocale="$define"
17979 d_setlocale_accepts_any_locale_name="$define"
17980 d_has_C_UTF8="true"
17982 *) echo "but it doesn't seem to work, so we won't use it." >&4
17983 d_setlocale="$undef"
17984 d_setlocale_accepts_any_locale_name="$undef"
17985 d_has_C_UTF8="false"
17989 echo "your system does not have setlocale()" >&4
17990 d_setlocale="$undef"
17991 d_setlocale_accepts_any_locale_name="$undef"
17992 d_has_C_UTF8="false"
17997 *) val="$d_setlocale"
18000 case "$d_setlocale" in
18001 $undef) echo "There may be other ways to set the locale on your system, so we need to ask:" >&4
18004 rp="Does your system have the C.UTF8 locale?"
18008 [Yy]*) d_has_C_UTF8="true"
18009 c_utf8_locale=" or C.UTF8"
18011 *) d_has_C_UTF8="false"
18015 case "$d_setlocale" in
18017 rp="When you set your locale to something besides C$c_utf8_locale, does it do so, or just pretend to?" >&4
18022 d_setlocale_accepts_any_locale_name="$undef"
18024 *) d_setlocale_accepts_any_locale_name="$define"
18028 *) d_setlocale_accepts_any_locale_name="$undef"
18033 : see if setlocale_r exists
18034 set setlocale_r d_setlocale_r
18036 case "$d_setlocale_r" in
18038 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18039 case "$d_setlocale_r_proto:$usethreads" in
18040 ":define") d_setlocale_r_proto=define
18041 set d_setlocale_r_proto setlocale_r $hdrs
18045 case "$d_setlocale_r_proto" in
18047 case "$setlocale_r_proto" in
18048 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18049 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18051 case "$setlocale_r_proto" in
18052 ''|0) d_setlocale_r=undef
18053 setlocale_r_proto=0
18054 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18055 * ) case "$setlocale_r_proto" in
18056 REENTRANT_PROTO*) ;;
18057 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18059 echo "Prototype: $try" ;;
18062 *) case "$usethreads" in
18063 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18065 d_setlocale_r=undef
18066 setlocale_r_proto=0
18070 *) setlocale_r_proto=0
18074 : see if setnetent exists
18075 set setnetent d_setnent
18078 : see if setnetent_r exists
18079 set setnetent_r d_setnetent_r
18081 case "$d_setnetent_r" in
18083 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18084 case "$d_setnetent_r_proto:$usethreads" in
18085 ":define") d_setnetent_r_proto=define
18086 set d_setnetent_r_proto setnetent_r $hdrs
18090 case "$d_setnetent_r_proto" in
18092 case "$setnetent_r_proto" in
18093 ''|0) try='int setnetent_r(int, struct netent_data*);'
18094 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18096 case "$setnetent_r_proto" in
18097 ''|0) try='void setnetent_r(int, struct netent_data*);'
18098 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18100 case "$setnetent_r_proto" in
18101 ''|0) d_setnetent_r=undef
18102 setnetent_r_proto=0
18103 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18104 * ) case "$setnetent_r_proto" in
18105 REENTRANT_PROTO*) ;;
18106 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18108 echo "Prototype: $try" ;;
18111 *) case "$usethreads" in
18112 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18114 d_setnetent_r=undef
18115 setnetent_r_proto=0
18119 *) setnetent_r_proto=0
18123 : see if setprotoent exists
18124 set setprotoent d_setpent
18127 : see if setpgid exists
18128 set setpgid d_setpgid
18131 : see if setpgrp2 exists
18132 set setpgrp2 d_setpgrp2
18135 : see if setpriority exists
18136 set setpriority d_setprior
18139 : see if setproctitle exists
18140 set setproctitle d_setproctitle
18143 : see if setprotoent_r exists
18144 set setprotoent_r d_setprotoent_r
18146 case "$d_setprotoent_r" in
18148 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18149 case "$d_setprotoent_r_proto:$usethreads" in
18150 ":define") d_setprotoent_r_proto=define
18151 set d_setprotoent_r_proto setprotoent_r $hdrs
18155 case "$d_setprotoent_r_proto" in
18157 case "$setprotoent_r_proto" in
18158 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18159 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18161 case "$setprotoent_r_proto" in
18162 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18163 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18165 case "$setprotoent_r_proto" in
18166 ''|0) d_setprotoent_r=undef
18167 setprotoent_r_proto=0
18168 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18169 * ) case "$setprotoent_r_proto" in
18170 REENTRANT_PROTO*) ;;
18171 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18173 echo "Prototype: $try" ;;
18176 *) case "$usethreads" in
18177 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18179 d_setprotoent_r=undef
18180 setprotoent_r_proto=0
18184 *) setprotoent_r_proto=0
18188 : see if setpwent exists
18189 set setpwent d_setpwent
18192 : see if setpwent_r exists
18193 set setpwent_r d_setpwent_r
18195 case "$d_setpwent_r" in
18197 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18198 case "$d_setpwent_r_proto:$usethreads" in
18199 ":define") d_setpwent_r_proto=define
18200 set d_setpwent_r_proto setpwent_r $hdrs
18204 case "$d_setpwent_r_proto" in
18206 case "$setpwent_r_proto" in
18207 ''|0) try='int setpwent_r(FILE**);'
18208 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18210 case "$setpwent_r_proto" in
18211 ''|0) try='void setpwent_r(FILE**);'
18212 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18214 case "$setpwent_r_proto" in
18215 ''|0) d_setpwent_r=undef
18217 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18218 * ) case "$setpwent_r_proto" in
18219 REENTRANT_PROTO*) ;;
18220 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18222 echo "Prototype: $try" ;;
18225 *) case "$usethreads" in
18226 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18233 *) setpwent_r_proto=0
18237 : see if setregid exists
18238 set setregid d_setregid
18240 set setresgid d_setresgid
18243 : see if setreuid exists
18244 set setreuid d_setreuid
18246 set setresuid d_setresuid
18249 : see if setrgid exists
18250 set setrgid d_setrgid
18253 : see if setruid exists
18254 set setruid d_setruid
18257 : see if setservent exists
18258 set setservent d_setsent
18261 : see if setservent_r exists
18262 set setservent_r d_setservent_r
18264 case "$d_setservent_r" in
18266 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18267 case "$d_setservent_r_proto:$usethreads" in
18268 ":define") d_setservent_r_proto=define
18269 set d_setservent_r_proto setservent_r $hdrs
18273 case "$d_setservent_r_proto" in
18275 case "$setservent_r_proto" in
18276 ''|0) try='int setservent_r(int, struct servent_data*);'
18277 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18279 case "$setservent_r_proto" in
18280 ''|0) try='void setservent_r(int, struct servent_data*);'
18281 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18283 case "$setservent_r_proto" in
18284 ''|0) d_setservent_r=undef
18285 setservent_r_proto=0
18286 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18287 * ) case "$setservent_r_proto" in
18288 REENTRANT_PROTO*) ;;
18289 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18291 echo "Prototype: $try" ;;
18294 *) case "$usethreads" in
18295 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18297 d_setservent_r=undef
18298 setservent_r_proto=0
18302 *) setservent_r_proto=0
18306 : see if setsid exists
18307 set setsid d_setsid
18310 : see if setvbuf exists
18311 set setvbuf d_setvbuf
18314 : see if shmctl exists
18315 set shmctl d_shmctl
18318 : see if shmget exists
18319 set shmget d_shmget
18322 : see if shmat exists
18325 : see what shmat returns
18328 $cat >shmat.c <<'END'
18329 #include <sys/shm.h>
18332 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18337 echo "and it returns ($shmattype)." >&4
18338 : see if a prototype for shmat is available
18339 xxx=`./findhdr sys/shm.h`
18340 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18341 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18352 set d_shmatprototype
18355 : see if shmdt exists
18359 : see how much of the 'shm*(2)' library is present.
18362 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18363 *"$undef"*) h_shm=false;;
18367 case "`ipcs 2>&1`" in
18368 "SVID shared memory"*"not configured"*)
18369 echo "Your $osname does not have the shm*(2) configured." >&4
18372 set shmctl d_shmctl
18374 set shmget d_shmget
18384 : we could also check for sys/ipc.h ...
18385 if $h_shm && $test `./findhdr sys/shm.h`; then
18386 echo "You have the full shm*(2) library." >&4
18389 echo "You don't have the full shm*(2) library." >&4
18395 : see if we have sigaction
18397 if set sigaction val -f d_sigaction; eval $csym; $val; then
18398 echo 'sigaction() found.' >&4
18401 #include <sys/types.h>
18402 #include <signal.h>
18403 #$i_stdlib I_STDLIB
18405 #include <stdlib.h>
18409 struct sigaction act, oact;
18411 oact.sa_handler = 0;
18412 /* so that act and oact are used */
18413 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18417 if eval $compile_ok; then
18420 echo "But you don't seem to have a usable struct sigaction." >&4
18424 echo 'sigaction NOT found.' >&4
18427 set d_sigaction; eval $setvar
18430 : see what type pids are declared as in the kernel
18431 rp="What is the type of process ids on this system?"
18432 set pid_t pidtype int stdio.h sys/types.h
18435 : see what type uids are declared as in the kernel
18437 echo "Looking for the type for user ids returned by getuid()."
18438 set uid_t uidtype xxx stdio.h sys/types.h
18442 xxx=`./findhdr sys/user.h`
18443 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18445 unsigned) dflt="$1 $2" ;;
18449 *) dflt="$uidtype";;
18452 uid_t) echo "uid_t found." ;;
18453 *) rp="What is the type for user ids returned by getuid()?"
18459 : Define hasfield_t macro for Configure internal use
18460 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18461 while $test $# -ge 2; do
18463 $define) echo "#include <$2>";;
18467 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18469 if eval $compile; then
18478 : see what siginfo fields we have
18479 case "$d_sigaction" in
18481 echo "Checking if your siginfo_t has si_errno field...">&4
18482 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18485 echo "Checking if your siginfo_t has si_pid field...">&4
18486 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18489 echo "Checking if your siginfo_t has si_uid field...">&4
18490 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18493 echo "Checking if your siginfo_t has si_addr field...">&4
18494 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18497 echo "Checking if your siginfo_t has si_status field...">&4
18498 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18501 echo "Checking if your siginfo_t has si_band field...">&4
18502 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18505 echo "Checking if your siginfo_t has si_value field...">&4
18506 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18509 echo "Checking if your siginfo_t has si_fd field...">&4
18510 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18515 d_siginfo_si_errno="$undef"
18516 d_siginfo_si_pid="$undef"
18517 d_siginfo_si_uid="$undef"
18518 d_siginfo_si_addr="$undef"
18519 d_siginfo_si_status="$undef"
18520 d_siginfo_si_band="$undef"
18521 d_siginfo_si_value="$undef"
18522 d_siginfo_si_fd="$undef"
18526 : see if this is a sunmath.h system
18527 set sunmath.h i_sunmath
18530 : see if signbit exists
18531 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18533 #$i_sunmath I_SUNMATH
18535 #ifdef I_SUNMATH /* Solaris special math library */
18536 # include <sunmath.h>
18539 int main(int argc, char **argv)
18543 if ((signbit(x) == 0) && (signbit(y) != 0))
18551 if eval $compile; then
18552 if $run ./try; then
18556 $echo "Signbit seems to be available, but doesn't work as I expected."
18557 $echo "I won't use it." >&4
18568 : see if sigprocmask exists
18569 set sigprocmask d_sigprocmask
18572 : see if sigsetjmp exists
18574 case "$d_sigsetjmp" in
18577 #include <setjmp.h>
18578 #$i_stdlib I_STDLIB
18580 #include <stdlib.h>
18586 if (sigsetjmp(env,1))
18589 siglongjmp(env, 1);
18594 if eval $compile; then
18595 if $run ./try >/dev/null 2>&1; then
18596 echo "POSIX sigsetjmp found." >&4
18600 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18606 echo "sigsetjmp not found." >&4
18610 *) val="$d_sigsetjmp"
18611 case "$d_sigsetjmp" in
18612 $define) echo "POSIX sigsetjmp found." >&4;;
18613 $undef) echo "sigsetjmp not found." >&4;;
18621 : see if snprintf exists
18622 set snprintf d_snprintf
18625 : see if vsnprintf exists
18626 set vsnprintf d_vsnprintf
18629 case "$d_snprintf-$d_vsnprintf" in
18632 Checking whether your snprintf() and vsnprintf() work okay...
18634 $cat >try.c <<'EOCP'
18635 /* v?snprintf testing logic courtesy of Russ Allbery.
18636 * According to C99:
18637 * - if the buffer is too short it still must be \0-terminated
18638 * - if the buffer is too short the potentially required length
18639 * must be returned and not -1
18640 * - if the buffer is NULL the potentially required length
18641 * must be returned and not -1 or core dump
18644 #include <stdarg.h>
18648 int test (char *format, ...)
18653 va_start (args, format);
18654 count = vsnprintf (buf, sizeof buf, format, args);
18661 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18662 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18666 if eval $compile; then
18669 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18671 Your snprintf() and snprintf() don't seem to be working okay.
18673 d_snprintf="$undef"
18674 d_vsnprintf="$undef"
18678 echo "(I can't seem to compile the test program--assuming they don't)"
18679 d_snprintf="$undef"
18680 d_vsnprintf="$undef"
18686 : see if sockatmark exists
18687 set sockatmark d_sockatmark
18690 : see if prototype for sockatmark is available
18692 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18695 : see if socks5_init exists
18696 set socks5_init d_socks5_init
18699 : see if srand48_r exists
18700 set srand48_r d_srand48_r
18702 case "$d_srand48_r" in
18704 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18705 case "$d_srand48_r_proto:$usethreads" in
18706 ":define") d_srand48_r_proto=define
18707 set d_srand48_r_proto srand48_r $hdrs
18711 case "$d_srand48_r_proto" in
18713 case "$srand48_r_proto" in
18714 ''|0) try='int srand48_r(long, struct drand48_data*);'
18715 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18717 case "$srand48_r_proto" in
18718 ''|0) d_srand48_r=undef
18720 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18721 * ) case "$srand48_r_proto" in
18722 REENTRANT_PROTO*) ;;
18723 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18725 echo "Prototype: $try" ;;
18728 *) case "$usethreads" in
18729 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18736 *) srand48_r_proto=0
18740 : see if srandom_r exists
18741 set srandom_r d_srandom_r
18743 case "$d_srandom_r" in
18745 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18746 case "$d_srandom_r_proto:$usethreads" in
18747 ":define") d_srandom_r_proto=define
18748 set d_srandom_r_proto srandom_r $hdrs
18752 case "$d_srandom_r_proto" in
18754 case "$srandom_r_proto" in
18755 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18756 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18758 case "$srandom_r_proto" in
18759 ''|0) d_srandom_r=undef
18761 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18762 * ) case "$srandom_r_proto" in
18763 REENTRANT_PROTO*) ;;
18764 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18766 echo "Prototype: $try" ;;
18769 *) case "$usethreads" in
18770 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18777 *) srandom_r_proto=0
18781 : see if prototype for setresgid is available
18783 set d_sresgproto setresgid $i_unistd unistd.h
18786 : see if prototype for setresuid is available
18788 set d_sresuproto setresuid $i_unistd unistd.h
18791 : see if stat exists
18795 : see if sys/stat.h is available
18796 set sys/stat.h i_sysstat
18799 : see if stat knows about block sizes
18801 echo "Checking to see if your struct stat has st_blocks field..." >&4
18802 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18805 : see if this is a sys/vfs.h system
18806 set sys/vfs.h i_sysvfs
18809 : see if this is a sys/statfs.h system
18810 set sys/statfs.h i_sysstatfs
18813 : Check for statfs_s
18815 echo "Checking to see if your system supports struct statfs..." >&4
18816 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
18818 case "$d_statfs_s" in
18819 "$define") echo "Yes, it does." ;;
18820 *) echo "No, it doesn't." ;;
18823 : see if struct statfs knows about f_flags
18824 case "$d_statfs_s" in
18827 echo "Checking to see if your struct statfs has f_flags field..." >&4
18828 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
18832 set d_statfs_f_flags
18836 case "$d_statfs_f_flags" in
18837 "$define") echo "Yes, it does." ;;
18838 *) echo "No, it doesn't." ;;
18841 : see what flavor, if any, of static inline is supported
18843 echo "Checking to see if your system supports static inline..."
18844 $cat > try.c <<'EOCP'
18845 #include <stdlib.h>
18846 extern int f_via_a(int x);
18847 extern int f_via_b(int x);
18848 int main(int argc, char **argv)
18857 return EXIT_SUCCESS;
18860 return EXIT_FAILURE;
18864 $cat > a.c <<'EOCP'
18865 static INLINE int f(int x) {
18876 $cat > b.c <<'EOCP'
18877 extern int f(int x);
18885 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18886 case "$perl_static_inline" in
18887 '') # Check the various possibilities, and break out on success.
18888 # For gcc, prefer __inline__, which will still permit
18889 # cflags.SH to add in -ansi.
18890 case "$gccversion" in
18891 '') xxx="inline __inline__ __inline _inline";;
18892 *) xxx="__inline__ inline __inline _inline";;
18894 for inline in $xxx; do
18895 set try -DINLINE=$inline a.c
18896 if eval $compile && $run ./try; then
18897 # Now make sure there is no external linkage of static
18899 set try -DINLINE=$inline -DUSE_B a.c b.c
18900 if eval $compile && $run ./try; then
18901 $echo "Your compiler supports static $inline, " >&4
18902 $echo "but it also creates an external definition," >&4
18903 $echo "so I won't use it." >&4
18906 $echo "Your compiler supports static $inline." >&4
18908 perl_static_inline="static $inline";
18912 $echo "Your compiler does NOT support static $inline." >&4
18917 *inline*) # Some variant of inline exists.
18918 echo "Keeping your $hint value of $perl_static_inline."
18921 static) # No inline capabilities
18922 echo "Keeping your $hint value of $perl_static_inline."
18925 *) # Unrecognized previous value -- blindly trust the supplied
18926 # value and hope it makes sense. Use old value for
18927 # d_static_inline, if there is one.
18928 echo "Keeping your $hint value of $perl_static_inline."
18929 case "$d_static_inline" in
18931 *) val=$d_static_inline ;;
18935 # Fallback to plain 'static' if nothing worked.
18936 case "$perl_static_inline" in
18938 perl_static_inline="static"
18942 set d_static_inline
18944 $rm -f a.[co] b.[co]
18947 : Check stream access
18949 Checking how to access stdio streams by file descriptor number...
18951 case "$stdio_stream_array" in
18952 '') $cat >try.c <<EOCP
18955 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18959 for s in _iob __iob __sF
18961 set try -DSTDIO_STREAM_ARRAY=$s
18962 if eval $compile; then
18963 case "`$run ./try`" in
18964 yes) stdio_stream_array=$s; break ;;
18970 case "$stdio_stream_array" in
18972 I can't figure out how to access stdio streams by file descriptor number.
18974 d_stdio_stream_array="$undef"
18977 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18979 d_stdio_stream_array="$define"
18983 : see if strcoll exists
18984 set strcoll d_strcoll
18987 : see if strerror_l exists
18988 set strerror_l d_strerror_l
18991 : see if strerror_r exists
18992 set strerror_r d_strerror_r
18994 case "$d_strerror_r" in
18996 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18997 case "$d_strerror_r_proto:$usethreads" in
18998 ":define") d_strerror_r_proto=define
18999 set d_strerror_r_proto strerror_r $hdrs
19003 case "$d_strerror_r_proto" in
19005 case "$strerror_r_proto" in
19006 ''|0) try='int strerror_r(int, char*, size_t);'
19007 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19009 case "$strerror_r_proto" in
19010 ''|0) try='int strerror_r(int, char*, int);'
19011 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19013 case "$strerror_r_proto" in
19014 ''|0) try='char* strerror_r(int, char*, size_t);'
19015 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19017 case "$strerror_r_proto" in
19018 ''|0) d_strerror_r=undef
19020 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19021 * ) case "$strerror_r_proto" in
19022 REENTRANT_PROTO*) ;;
19023 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19025 echo "Prototype: $try" ;;
19028 *) case "$usethreads" in
19029 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19036 *) strerror_r_proto=0
19040 : see if strftime exists
19041 set strftime d_strftime
19044 : see if strlcat exists
19045 : We need both a prototype in string.h and the symbol in libc.
19048 xx1="#$d_gnulibc HAS_GNULIBC"
19049 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19050 xx3='# define _GNU_SOURCE'
19052 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19054 case "$d_strlcat_proto" in
19055 define) # see if strlcat exists
19056 set strlcat d_strlcat
19065 : see if strlcpy exists
19066 : We need both a prototype in string.h and the symbol in libc.
19069 xx1="#$d_gnulibc HAS_GNULIBC"
19070 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19071 xx3='# define _GNU_SOURCE'
19073 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19075 case "$d_strlcpy_proto" in
19076 define) # see if strlcpy exists
19077 set strlcpy d_strlcpy
19086 : see if strnlen exists
19087 set strnlen d_strnlen
19090 : see if strtod exists
19091 set strtod d_strtod
19094 : see if strtod_l exists
19095 set strtod_l d_strtod_l
19098 : see if strtol exists
19099 set strtol d_strtol
19102 : see if strtold exists
19103 set strtold d_strtold
19106 : see if strtold_l exists
19107 set strtold_l d_strtold_l
19110 : see if strtoll exists
19111 set strtoll d_strtoll
19114 case "$d_longlong-$d_strtoll" in
19117 Checking whether your strtoll() works okay...
19119 $cat >try.c <<'EOCP'
19122 #define strtoll __strtoll
19125 #define strtoll _strtoll
19128 #include <stdlib.h>
19129 static int bad = 0;
19130 void check(const char *s, long long ell, int een) {
19133 gll = strtoll(s, 0, 10);
19134 if (!((gll == ell) && (errno == een)))
19138 check(" 1", 1LL, 0);
19139 check(" 0", 0LL, 0);
19140 check("-1", -1LL, 0);
19141 check("-9223372036854775808", -9223372036854775808LL, 0);
19142 check("-9223372036854775808", -9223372036854775808LL, 0);
19143 check(" 9223372036854775807", 9223372036854775807LL, 0);
19144 check("-9223372036854775808", -9223372036854775808LL, 0);
19145 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19146 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19152 if eval $compile; then
19155 ok) echo "Your strtoll() seems to be working okay." ;;
19157 Your strtoll() doesn't seem to be working okay.
19163 echo "(I can't seem to compile the test program--assuming it doesn't)"
19169 : see if strtoq exists
19170 set strtoq d_strtoq
19173 : see if strtoul exists
19174 set strtoul d_strtoul
19177 case "$d_strtoul" in
19180 Checking whether your strtoul() works okay...
19182 $cat >try.c <<'EOCP'
19183 #include <stdlib.h>
19186 static int bad = 0;
19187 void check(const char *s, unsigned long eul, int een) {
19190 gul = strtoul(s, 0, 10);
19191 if (!((gul == eul) && (errno == een)))
19195 check(" 1", 1L, 0);
19196 check(" 0", 0L, 0);
19198 case "$longsize" in
19200 $cat >>try.c <<'EOCP'
19201 check("18446744073709551615", 18446744073709551615UL, 0);
19202 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19203 #if 0 /* strtoul() for /^-/ strings is undefined. */
19204 check("-1", 18446744073709551615UL, 0);
19205 check("-18446744073709551614", 2, 0);
19206 check("-18446744073709551615", 1, 0);
19207 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19208 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19213 $cat >>try.c <<'EOCP'
19214 check("4294967295", 4294967295UL, 0);
19215 check("4294967296", 4294967295UL, ERANGE);
19216 #if 0 /* strtoul() for /^-/ strings is undefined. */
19217 check("-1", 4294967295UL, 0);
19218 check("-4294967294", 2, 0);
19219 check("-4294967295", 1, 0);
19220 check("-4294967296", 4294967295UL, ERANGE);
19221 check("-4294967297", 4294967295UL, ERANGE);
19226 : Should we write these tests to be more portable by sprintf-ing
19227 : ~0 and then manipulating that char string as input for strtol?
19230 $cat >>try.c <<'EOCP'
19237 if eval $compile; then
19238 case "`$run ./try`" in
19239 ok) echo "Your strtoul() seems to be working okay." ;;
19241 Your strtoul() doesn't seem to be working okay.
19247 echo "(I can't seem to compile the test program--assuming it doesn't)"
19253 : see if strtoull exists
19254 set strtoull d_strtoull
19257 case "$d_longlong-$d_strtoull" in
19260 Checking whether your strtoull() works okay...
19262 $cat >try.c <<'EOCP'
19263 #include <stdlib.h>
19266 #define strtoull __strtoull
19269 static int bad = 0;
19270 void check(const char *s, long long eull, int een) {
19273 gull = strtoull(s, 0, 10);
19274 if (!((gull == eull) && (errno == een)))
19278 check(" 1", 1LL, 0);
19279 check(" 0", 0LL, 0);
19280 check("18446744073709551615", 18446744073709551615ULL, 0);
19281 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19282 #if 0 /* strtoull() for /^-/ strings is undefined. */
19283 check("-1", 18446744073709551615ULL, 0);
19284 check("-18446744073709551614", 2LL, 0);
19285 check("-18446744073709551615", 1LL, 0);
19286 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19287 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19294 if eval $compile; then
19295 case "`$run ./try`" in
19296 ok) echo "Your strtoull() seems to be working okay." ;;
19298 Your strtoull() doesn't seem to be working okay.
19300 d_strtoull="$undef"
19304 echo "(I can't seem to compile the test program--assuming it doesn't)"
19305 d_strtoull="$undef"
19310 : see if strtouq exists
19311 set strtouq d_strtouq
19314 case "$d_strtouq" in
19317 Checking whether your strtouq() works okay...
19319 $cat >try.c <<'EOCP'
19320 #include <stdlib.h>
19323 static int bad = 0;
19324 void check(const char *s, unsigned long long eull, int een) {
19325 unsigned long long gull;
19327 gull = strtouq(s, 0, 10);
19328 if (!((gull == eull) && (errno == een)))
19332 check(" 1", 1LL, 0);
19333 check(" 0", 0LL, 0);
19334 check("18446744073709551615", 18446744073709551615ULL, 0);
19335 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19336 #if 0 /* strtouq() for /^-/ strings is undefined. */
19337 check("-1", 18446744073709551615ULL, 0);
19338 check("-18446744073709551614", 2LL, 0);
19339 check("-18446744073709551615", 1LL, 0);
19340 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19341 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19349 if eval $compile; then
19350 case "`$run ./try`" in
19351 ok) echo "Your strtouq() seems to be working okay." ;;
19353 Your strtouq() doesn't seem to be working okay.
19359 echo "(I can't seem to compile the test program--assuming it doesn't)"
19365 : see if strxfrm exists
19366 set strxfrm d_strxfrm
19369 : see if symlink exists
19370 set symlink d_symlink
19373 : see if syscall exists
19374 set syscall d_syscall
19377 : see if prototype for syscall is available
19379 set d_syscallproto syscall $i_unistd unistd.h
19382 : see if sysconf exists
19383 set sysconf d_sysconf
19386 : see if sys_errlist[] exists
19388 if test "X$d_syserrlst" = X; then
19389 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19390 echo "You have sys_errlist[], so we could roll our own strerror."
19391 d_syserrlst="$define"
19393 echo "You don't have sys_errlist[], so strerror() is welcome."
19394 d_syserrlst="$undef"
19398 : see if system exists
19399 set system d_system
19402 : see if tcgetpgrp exists
19403 set tcgetpgrp d_tcgetpgrp
19406 : see if tcsetpgrp exists
19407 set tcsetpgrp d_tcsetpgrp
19410 : see if prototype for telldir is available
19412 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19415 : see if tgamma exists
19416 set tgamma d_tgamma
19419 : check for thread_safe_nl_langinfo_l item
19422 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19425 #$i_stdlib I_STDLIB
19427 # include <stdlib.h>
19429 #include <string.h>
19430 #$i_langinfo I_LANGINFO
19432 # include <langinfo.h>
19434 #$i_pthread I_PTHREAD
19436 # include <pthread.h>
19438 #$i_locale I_LOCALE
19440 # include <locale.h>
19444 thread_start(void * arg)
19446 nl_langinfo(RADIXCHAR);
19450 char * main_buffer;
19451 char save_main_buffer[1000];
19452 pthread_t subthread;
19453 pthread_attr_t attr;
19455 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19457 /* If too large for our generous allowance, just assume we don't have
19459 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19463 strcpy(save_main_buffer, main_buffer);
19465 if (pthread_attr_init(&attr) != 0) {
19469 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19473 if (pthread_join(subthread, NULL) != 0) {
19477 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19480 case "$usethreads" in
19483 if eval $compile; then
19484 echo "Your system has nl_langinfo_l()..." >&4
19485 if $run ./try; then
19486 echo "and it is thread-safe (just as I'd hoped)." >&4
19487 d_thread_safe_nl_langinfo_l="$define"
19488 echo "$d_thread_safe_nl_langinfo_l" >&4
19490 echo "but it isn't thread-safe, so we won't use it." >&4
19493 echo "your system does not have nl_langinfo_l()" >&4
19496 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19498 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19499 d_thread_safe_nl_langinfo_l="$undef"
19503 : see if time exists
19505 if test "X$d_time" = X -o X"$timetype" = X; then
19506 if set time val -f d_time; eval $csym; $val; then
19507 echo 'time() found.' >&4
19509 rp="What is the type returned by time() on this system?"
19510 set time_t timetype long stdio.h sys/types.h
19513 echo 'time() not found, hope that will do.' >&4
19521 : see if timegm exists
19522 set timegm d_timegm
19525 : see if this is a sys/times.h system
19526 set sys/times.h i_systimes
19529 : see if times exists
19531 if set times val -f d_times; eval $csym; $val; then
19532 echo 'times() found.' >&4
19535 case "$i_systimes" in
19536 "$define") inc='sys/times.h';;
19538 rp="What is the type returned by times() on this system?"
19539 set clock_t clocktype long stdio.h sys/types.h $inc
19542 echo 'times() NOT found, hope that will do.' >&4
19547 : see if tmpnam_r exists
19548 set tmpnam_r d_tmpnam_r
19550 case "$d_tmpnam_r" in
19552 hdrs="$i_systypes sys/types.h define stdio.h "
19553 case "$d_tmpnam_r_proto:$usethreads" in
19554 ":define") d_tmpnam_r_proto=define
19555 set d_tmpnam_r_proto tmpnam_r $hdrs
19559 case "$d_tmpnam_r_proto" in
19561 case "$tmpnam_r_proto" in
19562 ''|0) try='char* tmpnam_r(char*);'
19563 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19565 case "$tmpnam_r_proto" in
19566 ''|0) d_tmpnam_r=undef
19568 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19569 * ) case "$tmpnam_r_proto" in
19570 REENTRANT_PROTO*) ;;
19571 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19573 echo "Prototype: $try" ;;
19576 *) case "$usethreads" in
19577 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19584 *) tmpnam_r_proto=0
19588 : see if towlower exists
19589 set towlower d_towlower
19592 : see if trunc exists
19596 : see if truncate exists
19597 set truncate d_truncate
19600 : see if ttyname_r exists
19601 set ttyname_r d_ttyname_r
19603 case "$d_ttyname_r" in
19605 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19606 case "$d_ttyname_r_proto:$usethreads" in
19607 ":define") d_ttyname_r_proto=define
19608 set d_ttyname_r_proto ttyname_r $hdrs
19612 case "$d_ttyname_r_proto" in
19614 case "$ttyname_r_proto" in
19615 ''|0) try='int ttyname_r(int, char*, size_t);'
19616 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19618 case "$ttyname_r_proto" in
19619 ''|0) try='int ttyname_r(int, char*, int);'
19620 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19622 case "$ttyname_r_proto" in
19623 ''|0) try='char* ttyname_r(int, char*, int);'
19624 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19626 case "$ttyname_r_proto" in
19627 ''|0) d_ttyname_r=undef
19629 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19630 * ) case "$ttyname_r_proto" in
19631 REENTRANT_PROTO*) ;;
19632 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19634 echo "Prototype: $try" ;;
19637 *) case "$usethreads" in
19638 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19645 *) ttyname_r_proto=0
19649 : see if tzname[] exists
19651 if set tzname val -a d_tzname; eval $csym; $val; then
19653 echo 'tzname[] found.' >&4
19656 echo 'tzname[] NOT found.' >&4
19661 : Check if is a multiplatform env
19663 darwin) multiarch="$define" ;;
19665 case "$multiarch" in
19666 ''|[nN]*) multiarch="$undef" ;;
19669 : check for ordering of bytes in a UV
19671 case "$multiarch" in
19674 You seem to be doing a multiarchitecture build,
19675 skipping the byteorder check.
19681 case "$byteorder" in
19684 In the following, larger digits indicate more significance. A big-endian
19685 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19686 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19687 machines may have weird orders like 3412. A Cray will report 87654321,
19688 an Alpha will report 12345678. If the test program works the default is
19690 I'm now running the test program...
19694 #$i_stdlib I_STDLIB
19696 #include <stdlib.h>
19698 #include <sys/types.h>
19699 typedef $uvtype UV;
19709 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19711 u.l = (UV)0x04030201;
19712 for (i = 0; i < $uvsize; i++)
19713 printf("%c", u.c[i]+'0');
19720 if eval $compile && $run ./try > /dev/null; then
19723 [1-4][1-4][1-4][1-4]|12345678|87654321)
19724 echo "(The test program ran ok.)"
19725 echo "byteorder=$dflt"
19728 ????|????????) echo "(The test program ran ok.)" ;;
19729 *) echo "(The test program didn't run right for some reason.)" ;;
19734 (I can't seem to compile the test program. Guessing big-endian...)
19737 case "$xxx_prompt" in
19739 rp="What is the order of bytes in $uvtype?"
19752 : Checking 32bit alignedness
19755 Checking to see whether you can access character data unalignedly...
19757 case "$d_u32align" in
19758 '') $cat >try.c <<EOCP
19760 #$i_stdlib I_STDLIB
19762 #include <stdlib.h>
19764 #define U32 $u32type
19765 #define BYTEORDER 0x$byteorder
19767 #include <signal.h>
19769 $signal_t bletch(int s) { exit(4); }
19772 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19773 volatile U8 buf[8];
19777 if (sizeof(U32) != 4) {
19778 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19785 signal(SIGBUS, bletch);
19797 for (i = 0; i < 4; i++) {
19798 up = (U32*)(buf + i);
19799 if (! ((*up == 1 << (8*i)) || /* big-endian */
19800 (*up == 1 << (8*(3-i))) /* little-endian */
19804 printf("read failed (%x)\n", *up);
19810 for (i = 0; i < 4; i++) {
19811 up = (U32*)(buf + i);
19813 if (*up != 0xBeef) {
19814 printf("write failed (%x)\n", *up);
19828 if eval $compile_ok; then
19829 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19830 $run ./try 2>&1 >/dev/null
19833 You can access character data pretty unalignedly.
19835 d_u32align="$undef"
19838 It seems that you must access character data in an aligned manner.
19840 d_u32align="$define"
19844 rp='Can you access character data at unaligned addresses?'
19848 [yY]*) d_u32align="$undef" ;;
19849 *) d_u32align="$define" ;;
19856 : see if ualarm exists
19857 set ualarm d_ualarm
19860 : see if umask exists
19864 : see if unordered exists
19865 set unordered d_unordered
19868 : see if unsetenv exists
19869 set unsetenv d_unsetenv
19872 : see if usleep exists
19873 set usleep d_usleep
19876 : see if prototype for usleep is available
19878 set d_usleepproto usleep $i_unistd unistd.h
19881 : see if ustat exists
19885 : see if closedir exists
19886 set closedir d_closedir
19889 case "$d_closedir" in
19892 echo "Checking whether closedir() returns a status..." >&4
19894 #$i_dirent I_DIRENT /**/
19895 #$i_sysdir I_SYS_DIR /**/
19896 #$i_sysndir I_SYS_NDIR /**/
19897 #$i_systypes I_SYS_TYPES /**/
19899 #if defined(I_SYS_TYPES)
19900 #include <sys/types.h>
19902 #if defined(I_DIRENT)
19903 #include <dirent.h>
19906 #include <sys/ndir.h>
19909 #include <sys/dir.h>
19913 int main() { return closedir(opendir(".")); }
19916 if eval $compile_ok; then
19917 if $run ./try > /dev/null 2>&1 ; then
19918 echo "Yes, it does."
19921 echo "No, it doesn't."
19925 echo "(I can't seem to compile the test program--assuming it doesn't)"
19933 set d_void_closedir
19937 : see if there is a wait4
19941 : see if waitpid exists
19942 set waitpid d_waitpid
19945 : see if wcrtomb exists
19946 set wcrtomb d_wcrtomb
19951 $cat >try.c <<'EOCP'
19957 return (wcscmp (s, s) ? 1 : 0);
19962 if eval $compile; then
19965 0) echo "A working wcscmp() found." >&4
19967 *) echo "wcscmp() found, but it doesn't work" >&4
19971 echo "wcscmp() NOT found." >&4
19977 : see if wcstombs exists
19978 set wcstombs d_wcstombs
19983 $cat >try.c <<'EOCP'
19988 wchar_t dst[4], *src = L" ";
19990 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19995 if eval $compile; then
19998 0) echo "A working wcsxfrm() found." >&4
20000 *) echo "wcsxfrm() found, but it doesn't work" >&4
20004 echo "wcsxfrm() NOT found." >&4
20010 : see if wctomb exists
20011 set wctomb d_wctomb
20014 : see if writev exists
20015 set writev d_writev
20018 : check for alignment requirements
20020 case "$alignbytes" in
20021 '') echo "Checking alignment constraints..." >&4
20030 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20035 if eval $compile_ok; then
20039 echo "(I can't seem to compile the test program...)"
20041 case "$multiarch" in
20043 : The usual safe value is 8, but Darwin with -Duselongdouble
20044 : needs 16. Hence, we will take 8 as a minimum, but allow
20045 : Configure to pick a larger value if needed.
20046 if $test "$dflt" -lt 8; then
20048 echo "Setting alignment to 8 for multiarch support.">&4
20053 *) dflt="$alignbytes"
20056 rp="Doubles must be aligned on a how-many-byte boundary?"
20061 : set the base revision
20064 : length of character in bytes. Is always 1, otherwise it is not C
20065 : This used to be a test using sizeof
20068 : Check for the number of bits in a character
20069 case "$charbits" in
20070 '') echo "Checking how long a character is (in bits)..." >&4
20077 for (c = 1, n = 0; c; c <<= 1, n++) ;
20078 printf ("%d\n", n);
20083 if eval $compile_ok; then
20087 echo "(I can't seem to compile the test program. Guessing...)"
20094 rp="What is the length of a character (in bits)?"
20098 case "$charbits" in
20101 Your system has an unsigned character size of $charbits bits, which
20102 is rather unusual (normally it is 8 bits). Perl likely will not work
20103 correctly on your system, with subtle bugs in various places.
20105 rp='Do you really want to continue?'
20109 [yY]) echo >&4 "Okay, continuing." ;;
20114 : how do we concatenate cpp tokens here?
20116 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20117 $cat >cpp_stuff.c <<'EOCP'
20118 #define RCAT(a,b)a/**/b
20119 #define ACAT(a,b)a ## b
20123 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20124 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20125 echo "Oh! Smells like ANSI's been here." >&4
20126 echo "We can catify or stringify, separately or together!"
20128 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20129 echo "Ah, yes! The good old days!" >&4
20130 echo "However, in the good old days we don't know how to stringify and"
20131 echo "catify at the same time."
20135 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20136 You're going to have to edit the values of CAT[2-5] in config.h...
20138 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20142 : see if this is a db.h system
20148 : Check db version.
20150 echo "Checking Berkeley DB version ..." >&4
20152 #include <sys/types.h>
20154 #$i_stdlib I_STDLIB
20156 #include <stdlib.h>
20159 int main(int argc, char *argv[])
20161 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20162 int Major, Minor, Patch ;
20163 unsigned long Version ;
20164 (void)db_version(&Major, &Minor, &Patch) ;
20166 printf("%d %d %d %d %d %d\n",
20167 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20168 Major, Minor, Patch);
20171 printf("You have Berkeley DB Version 2 or greater.\n");
20173 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20174 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20175 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20176 Major, Minor, Patch) ;
20178 /* check that db.h & libdb are compatible */
20179 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20180 printf("db.h and libdb are incompatible.\n") ;
20184 printf("db.h and libdb are compatible.\n") ;
20186 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20187 + DB_VERSION_PATCH ;
20189 /* needs to be >= 2.3.4 */
20190 if (Version < 2003004) {
20191 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20192 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20198 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20203 printf("You have Berkeley DB Version 1.\n");
20204 exit(0); /* DB version < 2: the coast is clear. */
20206 exit(1); /* <db.h> not Berkeley DB? */
20212 if eval $compile_ok && $run ./try; then
20213 echo 'Looks OK.' >&4
20215 db_version_major=$1
20216 db_version_minor=$2
20217 db_version_patch=$3
20219 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20223 : Remove db from list of libraries to use
20224 echo "Removing unusable -ldb from library list" >&4
20225 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20228 echo "libs = $libs" >&4
20238 : Check the return type needed for hash
20240 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20242 #include <sys/types.h>
20245 #ifndef DB_VERSION_MAJOR
20246 u_int32_t hash_cb (const void* ptr, size_t size)
20253 info.hash = hash_cb;
20257 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20258 if $compiler_warning try.out >>/dev/null 2>&1 ; then
20261 db_hashtype='u_int32_t'
20264 : XXX Maybe we should just give up here.
20265 db_hashtype=u_int32_t
20267 echo "Help: I can't seem to compile the db test program." >&4
20268 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20271 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20273 *) db_hashtype=u_int32_t
20278 : Check the return type needed for prefix
20280 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20282 #include <sys/types.h>
20285 #ifndef DB_VERSION_MAJOR
20286 size_t prefix_cb (const DBT *key1, const DBT *key2)
20293 info.prefix = prefix_cb;
20297 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20298 if $compiler_warning try.out >>/dev/null 2>&1 ; then
20299 db_prefixtype='int'
20301 db_prefixtype='size_t'
20304 db_prefixtype='size_t'
20305 : XXX Maybe we should just give up here.
20307 echo "Help: I can't seem to compile the db test program." >&4
20308 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20311 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20313 *) db_prefixtype='size_t'
20317 : Include . in @INC
20320 Historically Perl has provided a final fallback of the current working
20321 directory '.' when searching for a library. This, however, can lead to
20322 problems when a Perl program which loads optional modules is called from
20323 a shared directory. This can lead to executing unexpected code.
20327 # When changing to exclude by default:
20328 case "$default_inc_excludes_dot" in
20329 $undef|false|[nN]*) dflt="n" ;;
20332 # To turn exclude off by default:
20333 #case "$default_inc_excludes_dot" in
20334 # $define|true|[yY]*) dflt="y" ;;
20338 rp='Exclude '.' from @INC by default? '
20341 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20342 *) default_inc_excludes_dot="$define" ;;
20345 : Check what kind of inf/nan your system has
20346 $echo "Checking the kind of infinities and nans you have..." >&4
20347 $echo "(The following tests may crash. That's okay.)" >&4
20349 #define DOUBLESIZE $doublesize
20350 #$d_longdbl HAS_LONG_DOUBLE
20351 #ifdef HAS_LONG_DOUBLE
20352 #define LONG_DOUBLESIZE $longdblsize
20353 #define LONG_DOUBLEKIND $longdblkind
20356 #include <string.h>
20358 /* Note that whether the sign bit is on or off
20359 * for NaN depends on the CPU/FPU, and possibly
20360 * can be affected by the build toolchain.
20362 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20363 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20364 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20365 * (respectively) as opposed to the more usual
20366 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20368 * Pre-IEEE-754 floating point format do not even have inf/nan support
20369 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20370 * to even mention, causing immediate SIGFPE or equivalent: this is
20371 * the case with VAX floating point, for example.
20373 static void bytes(void *v, unsigned int n) {
20374 unsigned char *p = (unsigned char *)v;
20376 for (i = 0; i < n; i++) {
20377 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20380 int main(int argc, char *argv[]) {
20381 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20382 * because some compilers are 'smart' and not only warn but refuse to
20383 * compile such 'illegal' values. */
20384 double dinf = exp(1e9);
20385 double dnan = sqrt(-1.0);
20386 #ifdef HAS_LONG_DOUBLE
20387 long double ldinf = (long double)exp(1e9);
20388 long double ldnan = (long double)sqrt(-1.0);
20389 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20390 /* the 80-bit long doubles might have garbage in their excess bytes */
20391 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20392 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20395 switch (argv[1][0]) {
20396 case '1': bytes(&dinf, sizeof(dinf)); break;
20397 case '2': bytes(&dnan, sizeof(dnan)); break;
20398 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20399 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20407 if eval $compile; then
20408 doubleinfbytes=`$run ./try 1`
20409 doublenanbytes=`$run ./try 2`
20410 case "$d_longdbl" in
20412 longdblinfbytes=`$run ./try 3`
20413 longdblnanbytes=`$run ./try 4`
20417 # Defaults in case the above test program failed.
20418 case "$doublekind" in
20419 1) # IEEE 754 32-bit LE
20420 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20421 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20423 2) # IEEE 754 32-bit BE
20424 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20425 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20427 3) # IEEE 754 64-bit LE
20428 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20429 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20431 4) # IEEE 754 64-bit BE
20432 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20433 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20435 5) # IEEE 754 128-bit LE
20436 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20437 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20439 6) # IEEE 754 128-bit BE
20440 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20441 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20443 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20444 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20445 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20447 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20448 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20449 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20451 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20452 doubleinfbytes=$undef
20453 doublenanbytes=$undef
20456 doubleinfbytes=$undef
20457 doublenanbytes=$undef
20460 case "$longdblkind" in
20461 1) # IEEE 754 128-bit LE
20462 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20463 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20465 2) # IEEE 754 128-bit BE
20466 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20467 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20469 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20470 case "$longdblsize" in
20471 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20472 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20473 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20476 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20477 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20480 longdblinfbytes=$undef
20481 longdblnanbytes=$undef
20485 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20486 case "$longdblsize" in
20487 12) # 32-bit system
20488 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20489 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20491 16) # 64-bit system
20492 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20493 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20496 longdblinfbytes=$undef
20497 longdblnanbytes=$undef
20501 5) # 128-bit LE-LE "double double"
20502 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20503 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20505 6) # 128-bit BE-BE "double double"
20506 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20507 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20509 7) # 128-bit LE-BE "double double"
20510 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20511 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20513 8) # 128-bit BE-LE "double double"
20514 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20515 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20517 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20518 longdblinfbytes=$undef
20519 longdblnanbytes=$undef
20522 longdblinfbytes=$undef
20523 longdblnanbytes=$undef
20527 # In case the program crashed the values are empty, turn them undef.
20528 case "$doubleinfbytes" in
20529 '') doubleinfbytes=$undef ;;
20531 case "$doublenanbytes" in
20532 '') doublenanbytes=$undef ;;
20534 case "$longdblinfbytes" in
20535 '') longdblinfbytes=$undef ;;
20537 case "$longdblnanbytes" in
20538 '') longdblnanbytes=$undef ;;
20542 : Check the length of the double mantissa
20543 $echo "Checking how many mantissa bits your doubles have..." >&4
20545 #$i_sunmath I_SUNMATH
20548 # include <sunmath.h>
20550 #ifdef DBL_MANT_DIG
20551 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20554 int main(int argc, char *argv[]) {
20556 printf("%d\n", BITS);
20562 if eval $compile; then
20563 doublemantbits=`$run ./try`
20565 doublemantbits="$undef"
20569 : Check the length of the longdouble mantissa
20570 $echo "Checking how many mantissa bits your long doubles have..." >&4
20572 #$i_sunmath I_SUNMATH
20575 # include <sunmath.h>
20577 #$d_longdbl HAS_LONG_DOUBLE
20578 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20579 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20580 /* This format has no implicit bit. Beware, however, that for
20581 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20582 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20583 * and the top bit must have been one since 387, zero is plain invalid.
20584 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20585 # define BITS LDBL_MANT_DIG
20586 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20587 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20588 * reason e.g. Irix thinks 107. But in any case, we want only
20589 * the number of real bits, the implicit bits are of no interest. */
20590 # define BITS 2 * (DBL_MANT_DIG - 1)
20592 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20596 int main(int argc, char *argv[]) {
20598 printf("%d\n", BITS);
20604 if eval $compile; then
20605 longdblmantbits=`$run ./try`
20607 longdblmantbits="$undef"
20611 : Check the length of the NV mantissa
20612 $echo "Checking how many mantissa bits your NVs have..." >&4
20613 if test "X$usequadmath" = "X$define"; then
20614 nvmantbits=112 # 128-1-15
20616 if test "X$nvsize" = "X$doublesize"; then
20617 nvmantbits="$doublemantbits"
20619 if test "X$nvsize" = "X$longdblsize"; then
20620 nvmantbits="$longdblmantbits"
20622 nvmantbits="$undef"
20627 : How can we generate normalized random numbers ?
20629 echo "Using our internal random number implementation..." >&4
20632 *-Dmy_rand=*|*-Dmy_srand=*)
20633 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20634 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20635 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20636 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20640 randfunc=Perl_drand48
20641 drand01="Perl_drand48()"
20642 seedfunc="Perl_drand48_init"
20646 : Probe whether dtrace builds an object, as newer Illumos requires an input
20647 : object file that uses at least one of the probes defined in the .d file
20648 case "$usedtrace" in
20650 case "$dtracexnolibs" in
20651 $define|true|[yY]*)
20652 dtracexnolibs=$define
20653 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20656 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20657 dtracexnolibs=$define
20658 echo "Your dtrace accepts -xnolibs"
20659 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20660 dtracexnolibs=$undef
20661 echo "Your dtrace doesn't accept -xnolibs"
20663 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20668 dtracexnolibs=$undef
20669 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20672 case $dtracexnolibs in
20673 $define) xnolibs=-xnolibs ;;
20677 case "$dtraceobject" in
20678 $define|true|[yY]*)
20679 dtraceobject=$define
20683 #include "perldtrace.h"
20685 PERL_LOADED_FILE("dummy");
20689 dtraceobject=$undef
20690 if $cc -c -o try.o $optimize $ccflags try.c \
20691 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20692 dtraceobject=$define
20693 echo "Your dtrace builds an object file"
20696 *) dtraceobject=$undef ;;
20698 $rm_try perldtrace.o perldtrace.h
20701 : Determine if this is an EBCDIC system
20703 echo "Determining whether or not we are on an EBCDIC system..." >&4
20704 $cat >try.c <<'EOM'
20707 if ('M'==0xd4) return 0;
20714 if eval $compile_ok; then
20715 if $run ./try; then
20716 echo "You seem to speak EBCDIC." >&4
20719 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20722 echo "I'm unable to compile the test program." >&4
20723 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20729 : Check how to flush
20732 Checking how to flush all pending stdio output...
20734 # I only know how to find the first 32 possibly open files on SunOS.
20735 # See also hints/sunos_4_1.sh and util.c --AD
20737 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20739 $cat >>try.c <<EOCP
20741 #$i_stdlib I_STDLIB
20743 #include <stdlib.h>
20745 #$i_unistd I_UNISTD
20747 # include <unistd.h>
20749 #$d_sysconf HAS_SYSCONF
20750 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20751 #ifdef HAS_STDIO_STREAM_ARRAY
20752 # define STDIO_STREAM_ARRAY $stdio_stream_array
20757 p = fopen("try.out", "w");
20761 # ifdef TRY_FPRINTF
20765 #ifdef TRY_FFLUSH_NULL
20768 #ifdef TRY_FFLUSH_ALL
20770 long open_max = -1;
20771 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20772 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20774 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20775 open_max = sysconf(_SC_OPEN_MAX);
20778 open_max = FOPEN_MAX;
20781 open_max = OPEN_MAX;
20790 # ifdef HAS_STDIO_STREAM_ARRAY
20791 if (open_max > 0) {
20793 for (i = 0; i < open_max; i++)
20794 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20795 STDIO_STREAM_ARRAY[i]._file < open_max &&
20796 STDIO_STREAM_ARRAY[i]._flag)
20797 fflush(&STDIO_STREAM_ARRAY[i]);
20805 : first we have to find out how _not_ to flush
20807 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20809 set try -DTRY_FPUTC
20810 if eval $compile; then
20811 $run ./try 2>/dev/null
20814 if $test ! -s try.out -a "X$code" = X42; then
20820 set try -DTRY_FPRINTF
20821 if eval $compile; then
20822 $run ./try 2>/dev/null
20825 if $test ! -s try.out -a "X$code" = X42; then
20826 output=-DTRY_FPRINTF
20832 : check for fflush NULL behavior
20833 case "$fflushNULL" in
20834 '') set try -DTRY_FFLUSH_NULL $output
20835 if eval $compile; then
20836 $run ./try 2>/dev/null
20839 if $test -s try.out -a "X$code" = X42; then
20840 fflushNULL="`$cat try.out`"
20842 if $test "X$code" != X42; then
20844 (If this test failed, don't worry, we'll try another method shortly.)
20849 $rm -f core try.core core.try.*
20850 case "$fflushNULL" in
20852 Your fflush(NULL) works okay for output streams.
20853 Let's see if it clobbers input pipes...
20855 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20856 # bug that improperly flushes the input end of pipes. So we avoid the
20857 # autoflush on fork/system/exec support for now. :-(
20858 $cat >tryp.c <<EOCP
20861 main(int argc, char **argv)
20867 while ((i = getc(stdin)) != -1
20868 && (*bp++ = i) != '\n'
20869 && bp < &buf[1024])
20872 fprintf(stdout, "%s", buf);
20880 fflushNULL="$define"
20882 if eval $compile; then
20884 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20885 if $test "X$targethost" != X; then
20888 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20890 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20892 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20894 fflush(NULL) seems to behave okay with input streams.
20896 fflushNULL="$define"
20899 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20901 fflushNULL="$undef"
20904 $rm -f core tryp.c tryp.core core.tryp.*
20907 Your fflush(NULL) isn't working (contrary to ANSI C).
20909 fflushNULL="$undef"
20912 Cannot figure out whether your fflush(NULL) works or not.
20913 I'm assuming it doesn't (contrary to ANSI C).
20915 fflushNULL="$undef"
20919 $define|true|[yY]*)
20920 fflushNULL="$define"
20923 fflushNULL="$undef"
20926 : check explicit looping only if NULL did not work, and if the pipe
20927 : bug does not show up on an explicit flush too
20928 case "$fflushNULL" in
20930 $cat >tryp.c <<EOCP
20933 main(int argc, char **argv)
20939 while ((i = getc(stdin)) != -1
20940 && (*bp++ = i) != '\n'
20941 && bp < &buf[1024])
20944 fprintf(stdout, "%s", buf);
20953 if eval $compile; then
20955 if $test "X$targethost" != X; then
20958 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20960 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20962 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20964 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20966 : now check for fflushall behaviour
20967 case "$fflushall" in
20968 '') set try -DTRY_FFLUSH_ALL $output
20969 if eval $compile; then
20971 (Now testing the other method--but note that this also may fail.)
20973 $run ./try 2>/dev/null
20976 if $test -s try.out -a "X$code" = X42; then
20977 fflushall="`$cat try.out`"
20981 case "$fflushall" in
20983 Whew. Flushing explicitly all the stdio streams works.
20985 fflushall="$define"
20988 Sigh. Flushing explicitly all the stdio streams doesn't work.
20993 Cannot figure out whether flushing stdio streams explicitly works or not.
20994 I'm assuming it doesn't.
21000 "$define"|true|[yY]*)
21001 fflushall="$define"
21009 All is futile. Even fflush(stdin) clobbers input pipes!
21016 $rm -f core tryp.c tryp.core core.tryp.*
21018 *) fflushall="$undef"
21022 case "$fflushNULL$fflushall" in
21025 OK, I give up. I cannot figure out how to flush pending stdio output.
21026 We won't be flushing handles at all before fork/exec/popen.
21032 : Store the full pathname to the ar program for use in the C program
21033 : Respect a hint or command line value for full_ar.
21038 : Store the full pathname to the sed program for use in the C program
21041 : see what type gids are declared as in the kernel
21043 echo "Looking for the type for group ids returned by getgid()."
21044 set gid_t gidtype xxx stdio.h sys/types.h
21048 xxx=`./findhdr sys/user.h`
21049 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21051 unsigned) dflt="$1 $2" ;;
21055 *) dflt="$gidtype";;
21058 gid_t) echo "gid_t found." ;;
21059 *) rp="What is the type for group ids returned by getgid()?"
21065 : Check the size of GID
21068 *_t) zzz="$gidtype" ;;
21071 echo "Checking the size of $zzz..." >&4
21073 #include <sys/types.h>
21075 #$i_stdlib I_STDLIB
21077 #include <stdlib.h>
21080 printf("%d\n", (int)sizeof($gidtype));
21085 if eval $compile_ok; then
21089 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21092 echo "Your $zzz is $gidsize bytes long."
21097 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21100 : Check if GID is signed
21103 *_t) zzz="$gidtype" ;;
21106 echo "Checking the sign of $zzz..." >&4
21108 #include <sys/types.h>
21119 if eval $compile; then
21123 echo "(I can't execute the test program--guessing unsigned.)" >&4
21127 1) echo "Your $zzz is unsigned." ;;
21128 -1) echo "Your $zzz is signed." ;;
21134 echo "(I can't compile the test program--guessing unsigned.)" >&4
21137 : Check 64bit sizes
21140 if $test X"$quadtype" != X; then
21142 echo "Checking how to print 64-bit integers..." >&4
21144 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21145 $cat >try.c <<'EOCP'
21146 #include <sys/types.h>
21149 int q = 12345678901;
21150 printf("%ld\n", q);
21154 if eval $compile; then
21158 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21159 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21160 echo "We will use %d."
21166 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21167 $cat >try.c <<'EOCP'
21168 #include <sys/types.h>
21171 long q = 12345678901;
21172 printf("%ld\n", q);
21176 if eval $compile; then
21180 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21181 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21182 echo "We will use %ld."
21188 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21189 $cat >try.c <<'EOCP'
21190 #include <sys/types.h>
21191 #include <inttypes.h>
21194 int64_t q = 12345678901;
21195 printf("%" PRId64 "\n", q);
21199 if eval $compile; then
21203 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21204 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21205 echo "We will use the C9X style."
21211 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21213 #include <sys/types.h>
21216 $quadtype q = 12345678901;
21217 printf("%Ld\n", q);
21221 if eval $compile; then
21225 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21226 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21227 echo "We will use %Ld."
21233 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21234 $cat >try.c <<'EOCP'
21235 #include <sys/types.h>
21238 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21239 printf("%lld\n", q);
21243 if eval $compile; then
21247 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21248 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21249 echo "We will use the %lld style."
21255 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21257 #include <sys/types.h>
21260 $quadtype q = 12345678901;
21261 printf("%qd\n", q);
21265 if eval $compile; then
21269 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21270 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21271 echo "We will use %qd."
21277 if $test X"$sPRId64" = X; then
21278 echo "Cannot figure out how to print 64-bit integers." >&4
21285 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21286 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21288 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21289 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21293 : Check format strings for internal types
21295 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21297 if $test X"$ivsize" = X8; then
21298 ivdformat="$sPRId64"
21299 uvuformat="$sPRIu64"
21300 uvoformat="$sPRIo64"
21301 uvxformat="$sPRIx64"
21302 uvXUformat="$sPRIXU64"
21304 if $test X"$ivsize" = X"$longsize"; then
21311 if $test X"$ivsize" = X"$intsize"; then
21319 if $test X"$ivsize" = X"$shortsize"; then
21330 if $test X"$usequadmath" = X"$define"; then
21338 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21339 nveformat="$sPRIeldbl"
21340 nvfformat="$sPRIfldbl"
21341 nvgformat="$sPRIgldbl"
21342 nvEUformat="$sPRIEUldbl"
21343 nvFUformat="$sPRIFUldbl"
21344 nvGUformat="$sPRIGUldbl"
21355 case "$ivdformat" in
21356 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21361 : Check format string for GID
21364 $echo "Checking the format string to be used for gids..." >&4
21367 -1) if $test X"$gidsize" = X"$ivsize"; then
21368 gidformat="$ivdformat"
21370 if $test X"$gidsize" = X"$longsize"; then
21373 if $test X"$gidsize" = X"$intsize"; then
21376 if $test X"$gidsize" = X"$shortsize"; then
21383 *) if $test X"$gidsize" = X"$uvsize"; then
21384 gidformat="$uvuformat"
21386 if $test X"$gidsize" = X"$longsize"; then
21389 if $test X"$gidsize" = X"$intsize"; then
21392 if $test X"$gidsize" = X"$shortsize"; then
21401 : see if getgroups exists
21402 set getgroups d_getgrps
21405 : see if setgroups exists
21406 set setgroups d_setgrps
21409 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21411 case "$d_getgrps$d_setgrps" in
21413 case "$groupstype" in
21414 '') dflt="$gidtype" ;;
21415 *) dflt="$groupstype" ;;
21418 What type of pointer is the second argument to getgroups() and setgroups()?
21419 Usually this is the same as group ids, $gidtype, but not always.
21422 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21426 *) groupstype="$gidtype";;
21429 : check whether make sets MAKE
21431 echo "Checking if your $make program sets \$(MAKE)..." >&4
21432 case "$make_set_make" in
21434 $sed 's/^X //' > testmake.mak << 'EOF'
21436 X @echo 'maketemp="$(MAKE)"'
21438 case "`$make -f testmake.mak 2>/dev/null`" in
21439 *maketemp=*) make_set_make='#' ;;
21440 *) make_set_make="MAKE=$make" ;;
21442 $rm -f testmake.mak
21445 case "$make_set_make" in
21446 '#') echo "Yup, it does.";;
21447 *) echo "Nope, it doesn't.";;
21450 : see what type is used for mode_t
21451 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21452 set mode_t modetype int stdio.h sys/types.h
21455 : see if we need va_copy
21458 #include <stdarg.h>
21460 #include <stdlib.h>
21461 #include <signal.h>
21464 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21466 return vfprintf(f, fmt, *valp);
21470 myvfprintf(FILE *f, const char *fmt, va_list val)
21472 return ivfprintf(f, fmt, &val);
21476 myprintf(char *fmt, ...)
21479 va_start(val, fmt);
21480 return myvfprintf(stdout, fmt, val);
21484 main(int ac, char **av)
21486 signal(SIGSEGV, exit);
21488 signal(SIGBUS, exit);
21491 myprintf("%s%cs all right, then\n", "that", '\'');
21496 if eval $compile && $run ./try 2>&1 >/dev/null; then
21497 case "`$run ./try`" in
21498 "that's all right, then")
21504 yes) echo "It seems that you don't need va_copy()." >&4
21505 need_va_copy="$undef"
21507 *) echo "It seems that va_copy() or similar will be needed." >&4
21508 need_va_copy="$define"
21513 : see what type is used for size_t
21514 rp="What is the type used for the length parameter for string functions?"
21515 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21518 : check for type of arguments to gethostbyaddr.
21519 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21520 case "$d_gethbyaddr" in
21524 Checking to see what type of arguments are accepted by gethostbyaddr().
21526 hdrs="$define sys/types.h
21527 $d_socket sys/socket.h
21528 $i_niin netinet/in.h
21530 $i_unistd unistd.h"
21531 : The first arg can 'char *' or 'void *'
21532 : The second arg is some of integral type
21533 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21534 for yyy in size_t long int; do
21535 case "$netdb_host_type" in
21536 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21537 if ./protochk "$try" $hdrs; then
21538 echo "Your system accepts $xxx for the first arg."
21539 echo "...and $yyy for the second arg."
21540 netdb_host_type="$xxx"
21541 netdb_hlen_type="$yyy"
21547 : In case none of those worked, prompt the user.
21548 case "$netdb_host_type" in
21549 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21552 netdb_host_type=$ans
21553 rp='What is the type for the 2nd argument to gethostbyaddr?'
21556 netdb_hlen_type=$ans
21560 *) : no gethostbyaddr, so pick harmless defaults
21561 netdb_host_type='char *'
21562 netdb_hlen_type="$sizetype"
21565 # Remove the "const" if needed. -- but then we'll have a
21567 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21570 : check for type of argument to gethostbyname.
21571 if test "X$netdb_name_type" = X ; then
21572 case "$d_gethbyname" in
21576 Checking to see what type of argument is accepted by gethostbyname().
21578 hdrs="$define sys/types.h
21579 $d_socket sys/socket.h
21580 $i_niin netinet/in.h
21582 $i_unistd unistd.h"
21583 for xxx in "const char *" "char *"; do
21584 case "$netdb_name_type" in
21585 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21586 if ./protochk "$try" $hdrs; then
21587 echo "Your system accepts $xxx."
21588 netdb_name_type="$xxx"
21593 : In case none of those worked, prompt the user.
21594 case "$netdb_name_type" in
21595 '') rp='What is the type for the 1st argument to gethostbyname?'
21598 netdb_name_type=$ans
21602 *) : no gethostbyname, so pick harmless default
21603 netdb_name_type='char *'
21608 : check for type of 1st argument to getnetbyaddr.
21609 if test "X$netdb_net_type" = X ; then
21610 case "$d_getnbyaddr" in
21614 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21616 hdrs="$define sys/types.h
21617 $d_socket sys/socket.h
21618 $i_niin netinet/in.h
21620 $i_unistd unistd.h"
21621 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21622 case "$netdb_net_type" in
21623 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21624 if ./protochk "$try" $hdrs; then
21625 echo "Your system accepts $xxx."
21626 netdb_net_type="$xxx"
21631 : In case none of those worked, prompt the user.
21632 case "$netdb_net_type" in
21633 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21636 netdb_net_type=$ans
21640 *) : no getnetbyaddr, so pick harmless default
21641 netdb_net_type='long'
21645 : locate the preferred pager for this system
21652 [a-zA-Z]:/*) dflt=$pg;;
21656 [a-zA-Z]:/*) dflt=$more;;
21660 [a-zA-Z]:/*) dflt=$less;;
21663 '') dflt=/usr/ucb/more;;
21671 rp='What pager is used on your system?'
21675 : see if ar generates random libraries by itself
21677 echo "Checking how to generate random libraries on your machine..." >&4
21678 echo 'int bar1() { return bar2(); }' > bar1.c
21679 echo 'int bar2() { return 2; }' > bar2.c
21681 #$i_stdlib I_STDLIB
21683 #include <stdlib.h>
21685 int main() { printf("%d\n", bar1()); exit(0); }
21687 $cc $ccflags -c bar1.c >/dev/null 2>&1
21688 $cc $ccflags -c bar2.c >/dev/null 2>&1
21689 $cc $ccflags -c foo.c >/dev/null 2>&1
21690 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21691 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21692 $run ./foobar >/dev/null 2>&1; then
21693 echo "$ar appears to generate random libraries itself."
21695 if [ "X$ranlib" = "X" ]; then
21698 elif $ar s bar$_a >/dev/null 2>&1 &&
21699 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21700 $run ./foobar >/dev/null 2>&1; then
21701 echo "a table of contents needs to be added with '$ar s'."
21704 elif $ar ts bar$_a >/dev/null 2>&1 &&
21705 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21706 $run ./foobar >/dev/null 2>&1; then
21707 echo "a table of contents needs to be added with '$ar ts'."
21714 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21715 $test -f $ranlib || ranlib=''
21718 if $test -n "$ranlib"; then
21719 echo "your system has '$ranlib'; we'll use that."
21722 echo "your system doesn't seem to support random libraries"
21723 echo "so we'll use lorder and tsort to order the libraries."
21730 : Check the max offset that gmtime and localtime accept
21731 echo "Checking max offsets that gmtime () accepts"
21733 case "$sGMTIME_min/$sGMTIME_max" in
21736 #include <sys/types.h>
21744 void gm_check (time_t t, int min_year, int max_year)
21747 if ( tmp == NULL ||
21748 /* Check tm_year overflow */
21749 tmp->tm_year < min_year || tmp->tm_year > max_year)
21760 gm_check (MAXLONG, 69, 0x7fffffff);
21762 if (tmp == NULL || tmp->tm_year < 0) {
21763 for (i = 63; i >= 0; i--) {
21764 time_t x = pt | ((time_t)1 << i);
21765 if (x < 0 || x < pt) continue;
21766 gm_check (x, 69, 0x7fffffff);
21769 printf ("sGMTIME_max=%ld\n", pt);
21778 gm_check (MINLONG, -1900, 70);
21781 for (i = 36; i >= 0; i--) {
21782 time_t x = pt - ((time_t)1 << i);
21783 if (x > 0) continue;
21784 gm_check (x, -1900, 70);
21787 printf ("sGMTIME_min=%ld\n", pt);
21791 int main (int argc, char *argv[])
21793 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21800 if eval $compile; then
21801 eval `$run ./try 2>/dev/null`
21803 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21809 echo "Checking max offsets that localtime () accepts"
21811 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21814 #include <sys/types.h>
21822 void local_check (time_t t, int min_year, int max_year)
21824 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21827 tmp = localtime (&t);
21828 if ( tmp == NULL ||
21829 /* Check tm_year overflow */
21830 tmp->tm_year < min_year || tmp->tm_year > max_year)
21834 } /* local_check */
21841 local_check (MAXLONG, 69, 0x7fffffff);
21843 if (tmp == NULL || tmp->tm_year < 0) {
21844 for (i = 63; i >= 0; i--) {
21845 time_t x = pt | ((time_t)1 << i);
21846 if (x < 0 || x < pt) continue;
21847 local_check (x, 69, 0x7fffffff);
21850 printf ("sLOCALTIME_max=%ld\n", pt);
21859 local_check (MINLONG, -1900, 70);
21862 for (i = 36; i >= 0; i--) {
21863 time_t x = pt - ((time_t)1 << i);
21864 if (x > 0) continue;
21865 local_check (x, -1900, 70);
21868 printf ("sLOCALTIME_min=%ld\n", pt);
21872 int main (int argc, char *argv[])
21880 if eval $compile; then
21881 eval `$run ./try 2>/dev/null`
21883 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21889 : check for type of arguments to select.
21890 case "$selecttype" in
21891 '') case "$d_select" in
21895 Checking to see what type of arguments are accepted by select().
21897 hdrs="$define sys/types.h
21898 $i_systime sys/time.h
21899 $i_sysselct sys/select.h
21900 $d_socket sys/socket.h"
21901 : The first arg can be int, unsigned, or size_t
21902 : The last arg may or may not be 'const'
21904 : void pointer has been seen but using that
21905 : breaks the selectminbits test
21906 for xxx in 'fd_set *' 'int *'; do
21907 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21908 for tmo in 'struct timeval *' 'const struct timeval *'; do
21910 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21911 if ./protochk "$try" $hdrs; then
21912 echo "Your system accepts $xxx."
21921 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21922 case "$d_fd_set" in
21923 $define) dflt="fd_set *" ;;
21932 *) : no select, so pick a harmless default
21939 : check for the select 'width'
21940 case "$selectminbits" in
21941 '') safebits=`expr $ptrsize \* 8`
21942 case "$d_select" in
21946 Checking to see on how many bits at a time your select() operates...
21949 #include <sys/types.h>
21951 #$i_systime I_SYS_TIME
21952 #$i_systimek I_SYS_TIME_KERNEL
21957 # ifdef I_SYS_TIME_KERNEL
21960 # include <sys/time.h>
21961 # ifdef I_SYS_TIME_KERNEL
21965 #$i_sysselct I_SYS_SELECT
21966 #ifdef I_SYS_SELECT
21967 #include <sys/select.h>
21969 #$d_socket HAS_SOCKET
21971 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21974 #$i_stdlib I_STDLIB
21976 #include <stdlib.h>
21979 #define S sizeof(*(b))
21981 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21982 #define NBITS (NBYTES * 8)
21984 char *s = (char *)malloc(NBYTES);
21993 fp = fopen("try.c", "r");
21999 b = ($selecttype)s;
22000 for (i = 0; i < NBITS; i++)
22004 select(fd + 1, b, 0, 0, &t);
22005 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22007 printf("%d\n", i + 1);
22012 if eval $compile_ok; then
22013 selectminbits=`$run ./try 2>/dev/null`
22014 case "$selectminbits" in
22016 Cannot figure out on how many bits at a time your select() operates.
22017 I'll play safe and guess it is $safebits bits.
22019 selectminbits=$safebits
22020 bits="$safebits bits"
22023 *) bits="$selectminbits bits" ;;
22025 echo "Your select() operates on $bits at a time." >&4
22027 rp='What is the minimum number of bits your select() operates on?'
22028 case "$byteorder" in
22029 12345678) dflt=64 ;;
22035 selectminbits="$val"
22039 *) : no select, so pick a harmless default
22040 selectminbits=$safebits
22046 : Trace out the files included by signal.h, then look for SIGxxx names.
22047 case "$sig_num_init" in
22049 if [ "X$fieldn" = X ]; then
22050 : Just make some guesses. We check them later.
22051 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22053 xxx=`echo '#include <signal.h>' |
22054 $cppstdin $cppminus $cppflags 2>/dev/null |
22055 $grep '^[ ]*#.*include' |
22056 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22057 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22060 for xx in $xxx /dev/null ; do
22061 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22063 case "$xxxfiles" in
22064 '') xxxfiles=`./findhdr signal.h` ;;
22067 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22068 print substr($2, 4, 20)
22070 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22071 print substr($3, 4, 20)
22073 : Append some common names just in case the awk scan failed.
22074 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22075 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22076 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22077 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22078 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22080 : generate a few handy files for later
22081 $cat > signal.c <<EOCP
22082 #include <sys/types.h>
22083 #include <signal.h>
22084 #$i_stdlib I_STDLIB
22086 #include <stdlib.h>
22091 /* Strange style to avoid deeply-nested #if/#else/#endif */
22094 # define NSIG (_NSIG)
22100 # define NSIG (SIGMAX+1)
22106 # define NSIG (SIG_MAX+1)
22112 # define NSIG (_SIG_MAX+1)
22118 # define NSIG (MAXSIG+1)
22124 # define NSIG (MAX_SIG+1)
22129 # ifdef SIGARRAYSIZE
22130 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22136 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22140 /* Default to some arbitrary number that's big enough to get most
22141 of the common signals.
22147 printf("NSIG %d\n", NSIG);
22153 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22155 printf "#ifdef SIG"; printf $1; printf "\n"
22156 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22157 printf $1; printf ");\n"
22161 printf "#endif /* JUST_NSIG */\n";
22162 printf "exit(0);\n}\n";
22165 $cat >signal.awk <<'EOP'
22166 BEGIN { ndups = 0 }
22167 $1 ~ /^NSIG$/ { nsig = $2 }
22168 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22169 if ($2 > maxsig) { maxsig = $2 }
22170 if (sig_name[$2]) {
22171 dup_name[ndups] = $1
22172 dup_num[ndups] = $2
22184 printf("NSIG %d\n", nsig);
22185 for (n = 1; n < nsig; n++) {
22187 printf("%s %d\n", sig_name[n], sig_num[n])
22190 printf("NUM%d %d\n", n, n)
22193 for (n = 0; n < ndups; n++) {
22194 printf("%s %d\n", dup_name[n], dup_num[n])
22198 $cat >signal_cmd <<EOS
22200 if $test -s signal.lst; then
22201 echo "Using your existing signal.lst file"
22206 $cat >>signal_cmd <<'EOS'
22209 if eval $compile_ok; then
22210 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22211 $uniq | $awk -f signal.awk >signal.lst
22213 echo "(I can't seem be able to compile the whole test program)" >&4
22214 echo "(I'll try it in little pieces.)" >&4
22215 set signal -DJUST_NSIG
22216 if eval $compile_ok; then
22217 $run ./signal$_exe > signal.nsg
22220 echo "I can't seem to figure out how many signals you have." >&4
22221 echo "Guessing 50." >&4
22222 echo 'NSIG 50' > signal.nsg
22224 : Now look at all the signal names, one at a time.
22225 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22226 $cat > signal.c <<EOCP
22227 #include <sys/types.h>
22228 #include <signal.h>
22231 printf("$xx %d\n", SIG${xx});
22236 if eval $compile; then
22237 echo "SIG${xx} found."
22238 $run ./signal$_exe >> signal.ls1
22240 echo "SIG${xx} NOT found."
22243 if $test -s signal.ls1; then
22244 $cat signal.nsg signal.ls1 |
22245 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22249 if $test -s signal.lst; then
22252 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22253 echo 'kill -l' >signal
22254 set X `csh -f <signal`
22258 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22260 echo $@ | $tr ' ' $trnl | \
22261 $awk '{ printf "%s %d\n", $1, ++s; }
22262 END { printf "NSIG %d\n", ++s }' >signal.lst
22264 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22266 chmod a+x signal_cmd
22267 $eunicefix signal_cmd
22271 : generate list of signal names
22272 case "$sig_num_init" in
22275 case "$sig_name_init" in
22277 *) case "$sig_num_init" in
22278 ''|*,*) doinit=yes ;;
22283 echo "Generating a list of signal names and numbers..." >&4
22285 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22286 sig_name=`$awk 'BEGIN { printf "ZERO " }
22287 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22288 sig_num=`$awk 'BEGIN { printf "0 " }
22289 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22290 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22291 !/^NSIG/ { printf "\"%s\", ", $1 }
22292 END { printf "0\n" }' signal.lst`
22293 sig_num_init=`$awk 'BEGIN { printf "0, " }
22294 !/^NSIG/ { printf "%d, ", $2}
22295 END { printf "0\n"}' signal.lst`
22298 echo "The following $sig_count signals are available:"
22300 echo $sig_name | $awk \
22301 'BEGIN { linelen = 0 }
22303 for (i = 1; i <= NF; i++) {
22304 name = "SIG" $i " "
22305 linelen = linelen + length(name)
22306 if (linelen > 70) {
22308 linelen = length(name)
22314 sig_size=`echo $sig_name | awk '{print NF}'`
22315 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22319 : Check size of size
22321 case "$sizetype" in
22322 *_t) zzz="$sizetype" ;;
22323 *) zzz="filesize" ;;
22325 echo "Checking the size of $zzz..." >&4
22327 #include <sys/types.h>
22329 #$i_stdlib I_STDLIB
22331 #include <stdlib.h>
22334 printf("%d\n", (int)sizeof($sizetype));
22339 if eval $compile_ok; then
22343 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22346 echo "Your $zzz size is $sizesize bytes."
22351 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22354 : check for socklen_t
22356 echo "Checking to see if you have socklen_t..." >&4
22358 #include <sys/types.h>
22359 #$d_socket HAS_SOCKET
22361 #include <sys/socket.h>
22363 int main() { socklen_t x = 16; }
22366 if eval $compile; then
22368 echo "You have socklen_t."
22371 echo "You do not have socklen_t."
22372 case "$sizetype" in
22373 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22380 : see if this is a socks.h system
22381 set socks.h i_socks
22384 : check for type of the size argument to socket calls
22385 case "$d_socket" in
22389 Checking to see what type is the last argument of accept().
22392 case "$d_socklen_t" in
22393 "$define") yyy="$yyy socklen_t"
22395 yyy="$yyy $sizetype int long unsigned"
22396 for xxx in $yyy; do
22397 case "$socksizetype" in
22398 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22399 case "$usesocks" in
22401 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22402 echo "Your system accepts '$xxx *' for the last argument of accept()."
22403 socksizetype="$xxx"
22406 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22407 echo "Your system accepts '$xxx *' for the last argument of accept()."
22408 socksizetype="$xxx"
22415 : In case none of those worked, prompt the user.
22416 case "$socksizetype" in
22417 '') rp='What is the type for socket address structure sizes?'
22424 *) : no sockets, so pick relatively harmless default
22429 : see what type is used for signed size_t
22430 set ssize_t ssizetype int stdio.h sys/types.h
22435 #$i_stdlib I_STDLIB
22437 #include <stdlib.h>
22439 #include <sys/types.h>
22440 #define Size_t $sizetype
22441 #define SSize_t $dflt
22444 if (sizeof(Size_t) == sizeof(SSize_t))
22446 else if (sizeof(Size_t) == sizeof(int))
22455 if eval $compile_ok && $run ./try > /dev/null; then
22456 ssizetype=`$run ./try`
22457 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22460 Help! I can't compile and run the ssize_t test program: please enlighten me!
22461 (This is probably a misconfiguration in your system or libraries, and
22462 you really ought to fix it. Still, I'll try anyway.)
22464 I need a type that is the same size as $sizetype, but is guaranteed to
22465 be signed. Common values are ssize_t, int and long.
22468 rp="What signed type is the same size as $sizetype?"
22474 : Check the size of st_ino
22476 $echo "Checking the size of st_ino..." >&4
22477 $cat > try.c <<EOCP
22478 #include <sys/stat.h>
22480 #$i_stdlib I_STDLIB
22482 #include <stdlib.h>
22486 printf("%d\n", (int)sizeof(st.st_ino));
22491 if eval $compile_ok; then
22495 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22497 *) st_ino_size=$val
22498 $echo "Your st_ino is $st_ino_size bytes long."
22503 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22507 : Check if st_ino is signed
22509 $echo "Checking the sign of st_ino..." >&4
22510 $cat > try.c <<EOCP
22511 #include <sys/stat.h>
22516 if (foo.st_ino < 0)
22523 if eval $compile; then
22527 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22529 *) st_ino_sign=$val
22530 case "$st_ino_sign" in
22531 1) $echo "Your st_ino is unsigned." ;;
22532 -1) $echo "Your st_ino is signed." ;;
22538 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22542 : see what type of char stdio uses.
22544 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22545 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22546 echo "Your stdio uses unsigned chars." >&4
22547 stdchar="unsigned char"
22549 echo "Your stdio uses signed chars." >&4
22554 : Check size of UID
22557 *_t) zzz="$uidtype" ;;
22560 echo "Checking the size of $zzz..." >&4
22562 #include <sys/types.h>
22564 #$i_stdlib I_STDLIB
22566 #include <stdlib.h>
22569 printf("%d\n", (int)sizeof($uidtype));
22574 if eval $compile_ok; then
22578 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22581 echo "Your $zzz is $uidsize bytes long."
22586 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22589 : Check if UID is signed
22592 *_t) zzz="$uidtype" ;;
22595 echo "Checking the sign of $zzz..." >&4
22597 #include <sys/types.h>
22608 if eval $compile; then
22612 echo "(I can't execute the test program--guessing unsigned.)" >&4
22616 1) echo "Your $zzz is unsigned." ;;
22617 -1) echo "Your $zzz is signed." ;;
22623 echo "(I can't compile the test program--guessing unsigned.)" >&4
22626 : Check format string for UID
22628 $echo "Checking the format string to be used for uids..." >&4
22631 -1) if $test X"$uidsize" = X"$ivsize"; then
22632 uidformat="$ivdformat"
22634 if $test X"$uidsize" = X"$longsize"; then
22637 if $test X"$uidsize" = X"$intsize"; then
22640 if $test X"$uidsize" = X"$shortsize"; then
22647 *) if $test X"$uidsize" = X"$uvsize"; then
22648 uidformat="$uvuformat"
22650 if $test X"$uidsize" = X"$longsize"; then
22653 if $test X"$uidsize" = X"$intsize"; then
22656 if $test X"$uidsize" = X"$shortsize"; then
22665 : Ask about strict by default.
22666 case "$usedefaultstrict" in
22667 $define|true|[Yy]*)
22677 EXPERIMENTAL: Perl can now be built with strict on by default when not
22678 invoked with -e or -E. This is a diagnostic tool for development.
22680 Unless you are familiar with this feature, you should probably answer 'no'.
22684 rp='Would you like to build perl with strict enabled by default?'
22687 y|Y) val="$define" ;;
22690 set usedefaultstrict
22693 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22695 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22696 $cat >try.c <<'EOM'
22697 /* Intentionally a long probe as I'd like to sanity check that the exact
22698 approach is going to work, as thinking it will work, but only having it
22699 part working at runtime is worse than not having it. */
22701 #include <sys/types.h>
22702 #include <sys/sysctl.h>
22703 #include <sys/param.h>
22705 #include <string.h>
22706 #include <stdlib.h>
22707 #include <unistd.h>
22710 main(int argc, char **argv) {
22712 char *argv_leaf = strrchr(argv[0], '/');
22718 mib[1] = KERN_PROC;
22719 mib[2] = KERN_PROC_PATHNAME;
22723 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22727 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22732 if (size < strlen(argv_leaf) + 1) {
22733 fprintf(stderr, "size %lu is too short for a path\n",
22734 (unsigned long) size);
22738 if (size > MAXPATHLEN * MAXPATHLEN) {
22739 fprintf(stderr, "size %lu is too long for a path\n",
22740 (unsigned long) size);
22744 buffer = (char *)malloc(size);
22750 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22755 if (strlen(buffer) + 1 != size) {
22756 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22757 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22762 if (*buffer != '/') {
22763 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22767 if (strstr(buffer, "/./")) {
22768 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22772 if (strstr(buffer, "/../")) {
22773 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22777 buffer_leaf = strrchr(buffer, '/');
22778 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22779 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22791 if eval $compile; then
22792 if $run ./try; then
22793 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22796 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22800 echo "I'm unable to compile the test program." >&4
22801 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22805 set usekernprocpathname
22808 : Determine if we can use _NSGetExecutablePath to find executing program
22810 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22811 $cat >try.c <<'EOM'
22812 /* Intentionally a long probe as I'd like to sanity check that the exact
22813 approach is going to work, as thinking it will work, but only having it
22814 part working at runtime is worse than not having it. */
22815 #include <mach-o/dyld.h>
22817 #include <stdlib.h>
22818 #include <sys/param.h>
22819 #include <string.h>
22822 main(int argc, char **argv) {
22824 uint32_t size = sizeof(buf);
22828 char *argv_leaf = strrchr(argv[0], '/');
22832 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22836 _NSGetExecutablePath(buf, &size);
22837 if (size > MAXPATHLEN * MAXPATHLEN) {
22838 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22839 (unsigned int) size);
22843 buffer = (char *)malloc(size);
22849 result = _NSGetExecutablePath(buffer, &size);
22851 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22852 result, (unsigned int) size);
22856 tidied = realpath(buffer, NULL);
22858 perror("realpath");
22864 if (*tidied != '/') {
22865 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22869 if (strstr(tidied, "/./")) {
22870 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22874 if (strstr(tidied, "/../")) {
22875 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22879 tidied_leaf = strrchr(tidied, '/');
22880 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22881 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22893 if eval $compile; then
22894 if $run ./try; then
22895 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22898 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22901 echo "I'm unable to compile the test program." >&4
22902 echo "I'll assume no _NSGetExecutablePath here." >&4
22905 set usensgetexecutablepath
22908 : Check if site customization support was requested
22909 case "$usesitecustomize" in
22910 $define|true|[Yy]*)
22911 usesitecustomize="$define"
22914 usesitecustomize="$undef"
22918 : determine compiler compiler
22927 if $test -f "$byacc$_exe"; then
22929 comp="byacc or $comp"
22931 if $test -f "$bison$_exe"; then
22932 comp="$comp or bison -y"
22934 rp="Which compiler compiler ($comp) shall I use?"
22943 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22949 : see if this is a bfd.h system
22953 : see if this is an execinfo.h system
22954 set execinfo.h i_execinfo
22957 : see if this is a fenv.h system
22961 : see if this is a fp.h system
22965 : see if this is a fp_class.h system
22966 set fp_class.h i_fp_class
22969 : see if gdbm.h is available
22974 : see if gdbm_open exists
22975 set gdbm_open d_gdbm_open
22977 case "$d_gdbm_open" in
22980 echo "We won't be including <gdbm.h>"
22989 : see if this is a ieeefp.h system
22990 case "$i_ieeefp" in
22991 '' ) set ieeefp.h i_ieeefp
22996 : see if this is a libutil.h system
22997 set libutil.h i_libutil
23000 : see if mach cthreads are available
23001 if test "X$usethreads" = "X$define"; then
23002 set mach/cthreads.h i_machcthr
23005 i_machcthr="$undef"
23008 : see if this is a mntent.h system
23009 set mntent.h i_mntent
23012 : see if net/errno.h is available
23014 set net/errno.h val
23017 : Unfortunately, it causes problems on some systems. Arrgh.
23020 cat > try.c <<'EOM'
23023 #include <net/errno.h>
23029 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23030 echo "We'll be including <net/errno.h>." >&4
23032 echo "We won't be including <net/errno.h>." >&4
23041 : see if netinet/tcp.h is available
23042 set netinet/tcp.h i_netinettcp
23045 : see if this is a poll.h system
23049 : see if this is a prot.h system
23053 : Preprocessor symbols
23055 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23056 $cat <<'EOSH' > Cppsym.know
23057 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23058 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23059 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23060 arch_pwr ardent ARM ARM32 atarist att386 att3b
23061 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23062 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23063 byteorder byte_order
23064 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23065 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23066 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23067 ELF encore EPI EXTENSIONS
23068 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23069 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23070 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23071 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23072 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
23073 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23074 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23075 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23076 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23078 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23079 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23080 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23082 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23083 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23084 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23085 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23086 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23087 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23088 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23089 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23090 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23091 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23092 ns32000 ns32016 ns32332 ns32k nsc32000
23093 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23094 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23095 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23096 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23098 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23099 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23100 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23101 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23102 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23103 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23104 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23105 SYSV4 SYSV5 sysV68 sysV88
23106 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23107 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23108 tower32_800 tower32_850 tss
23109 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23110 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23111 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23112 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23113 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23114 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23116 vax venix VMESA vms
23117 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23118 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23121 # Maybe put other stuff here too.
23122 ./tr '-' '_' <<EOSH >>Cppsym.know
23125 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23126 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23127 $cat Cppsym.know > Cppsym.c
23128 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23129 $rm -f Cppsym.a Cppsym.b Cppsym.c
23130 cat <<EOSH > Cppsym
23132 if $test \$# -gt 0; then
23133 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23134 if $test -s Cppsym.got; then
23141 $tr " " "$trnl" | ./Cppsym.try
23147 cat <<EOSH > Cppsym.try
23149 cat <<'EOCP' > try.c
23152 #define STRINGIFY(a) "a"
23154 #if cpp_stuff == 42
23155 #define StGiFy(a) #a
23156 #define STRINGIFY(a) StGiFy(a)
23158 #if $cpp_stuff != 1 && $cpp_stuff != 42
23159 # include "Bletch: How does this C preprocessor stringify macros?"
23165 cat <<'EOSH' >> Cppsym.try
23167 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23168 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23169 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23170 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23172 echo 'return 0;}' >> try.c
23174 cat <<EOSH >> Cppsym.try
23176 case "$osname-$gccversion" in
23177 irix-) ccflags="\$ccflags -woff 1178" ;;
23178 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23180 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23182 chmod +x Cppsym.try
23183 $eunicefix Cppsym.try
23184 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23185 : Add in any Linux cpp "predefined macros":
23186 case "$osname::$gccversion" in
23187 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23189 rm -f $tHdrH'.h' $tHdrH
23191 # Filter out macro arguments, such as Linux's __INT8_C(c)
23192 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23193 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23194 if [ -s $tHdrH'_cppsym.real' ]; then
23195 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23198 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23201 : now check the C compiler for additional symbols
23202 postprocess_cc_v=''
23204 aix) postprocess_cc_v="|$tr , ' '" ;;
23211 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23214 -D*) echo "\$i" | $sed 's/^-D//';;
23215 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23220 postprocess_cc_v=''
23223 ./ccsym > ccsym1.raw
23224 if $test -s ccsym1.raw; then
23225 $sort ccsym1.raw | $uniq >ccsym.raw
23227 mv ccsym1.raw ccsym.raw
23230 $awk '/\=/ { print $0; next }
23231 { print $0"=1" }' ccsym.raw >ccsym.list
23232 $comm -13 Cppsym.true ccsym.list >ccsym.own
23233 $comm -12 Cppsym.true ccsym.list >ccsym.com
23234 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23236 if $test -z ccsym.raw; then
23237 echo "Your C compiler doesn't seem to define any symbols!" >&4
23239 echo "However, your C preprocessor defines the following symbols:"
23242 cppsymbols=`$cat Cppsym.true`
23243 cppsymbols=`echo $cppsymbols`
23244 cppccsymbols="$cppsymbols"
23246 if $test -s ccsym.com; then
23247 echo "Your C compiler and pre-processor define these symbols:"
23248 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23251 cppccsymbols=`$cat ccsym.com`
23252 cppccsymbols=`echo $cppccsymbols`
23253 $test "$silent" || sleep 1
23255 if $test -s ccsym.cpp; then
23256 $test "$also" && echo " "
23257 echo "Your C pre-processor ${also}defines the following symbols:"
23258 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23260 cppsymbols=`$cat ccsym.cpp`
23261 cppsymbols=`echo $cppsymbols`
23262 $test "$silent" || sleep 1
23264 if $test -s ccsym.own; then
23265 $test "$also" && echo " "
23266 echo "Your C compiler ${also}defines the following cpp symbols:"
23267 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23268 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23269 ccsymbols=`$cat ccsym.own`
23270 ccsymbols=`echo $ccsymbols`
23271 $test "$silent" || sleep 1
23275 : add -D_FORTIFY_SOURCE if feasible and not already there
23276 case "$gccversion" in
23277 [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
23278 *-O*) case "$ccflags$cppsymbols" in
23279 *_FORTIFY_SOURCE=*) # Don't add it again.
23280 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23282 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23283 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23287 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23291 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23295 : script used to emit important warnings
23298 if test \$# -gt 0; then
23303 echo "*** WARNING:" >&4
23304 sed -e 's/^/*** /' <msg >&4
23306 cat msg >>config.msg
23307 echo " " >>config.msg
23313 : see if this is a termio system
23317 if $test `./findhdr termios.h`; then
23318 set tcsetattr i_termios
23324 "$define") echo "You have POSIX termios.h... good!" >&4;;
23325 *) if ./Cppsym pyr; then
23326 case "`$run /bin/universe`" in
23327 ucb) if $test `./findhdr sgtty.h`; then
23329 echo "<sgtty.h> found." >&4
23331 echo "System is pyramid with BSD universe."
23332 ./warn "<sgtty.h> not found--you could have problems."
23334 *) if $test `./findhdr termio.h`; then
23336 echo "<termio.h> found." >&4
23338 echo "System is pyramid with USG universe."
23339 ./warn "<termio.h> not found--you could have problems."
23343 if $test `./findhdr termio.h`; then
23344 echo "<termio.h> found." >&4
23346 elif $test `./findhdr sgtty.h`; then
23347 echo "<sgtty.h> found." >&4
23350 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23353 if $test `./findhdr sgtty.h`; then
23354 echo "<sgtty.h> found." >&4
23356 elif $test `./findhdr termio.h`; then
23357 echo "<termio.h> found." >&4
23360 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23364 set i_termio; eval $setvar
23365 val=$val2; set i_sgtty; eval $setvar
23366 val=$val3; set i_termios; eval $setvar
23368 : see if stdbool is available
23369 : we want a real compile instead of Inhdr because some Solaris systems
23370 : have stdbool.h, but it can only be used if the compiler indicates it
23371 : is sufficiently c99-compliant.
23375 #include <stdbool.h>
23380 int main(int argc, char **argv)
23386 if eval $compile; then
23387 echo "<stdbool.h> found." >&4
23390 echo "<stdbool.h> NOT found." >&4
23397 : see if stdint is available
23398 set stdint.h i_stdint
23401 : see if sys/access.h is available
23402 set sys/access.h i_sysaccess
23405 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23406 set sys/filio.h i_sysfilio
23409 if $test `./findhdr sys/ioctl.h`; then
23411 echo '<sys/ioctl.h> found.' >&4
23414 if $test $i_sysfilio = "$define"; then
23415 echo '<sys/ioctl.h> NOT found.' >&4
23417 $test $i_sgtty = "$define" && xxx="sgtty.h"
23418 $test $i_termio = "$define" && xxx="termio.h"
23419 $test $i_termios = "$define" && xxx="termios.h"
23420 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23426 : see if socket ioctl defs are in sys/sockio.h
23428 xxx=`./findhdr sys/sockio.h`
23429 if $test "$xxx"; then
23430 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23432 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23435 echo "No socket ioctls found in <sys/sockio.h>." >&4
23440 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23446 : see if this is a syslog.h system
23447 set syslog.h i_syslog
23450 : see if this is a sys/mode.h system
23451 set sys/mode.h i_sysmode
23454 : see if there is a sys/poll.h file
23455 set sys/poll.h i_syspoll
23458 : see if sys/resource.h has to be included
23459 set sys/resource.h i_sysresrc
23462 : see if sys/security.h is available
23463 set sys/security.h i_syssecrt
23466 : see if this is a sys/statvfs.h system
23467 set sys/statvfs.h i_sysstatvfs
23470 : see if this is a sys/un.h system
23471 set sys/un.h i_sysun
23474 : see if this is a sys/utsname.h system
23475 set sys/utsname.h i_sysutsname
23478 : see if this is a syswait system
23479 set sys/wait.h i_syswait
23482 : see if this is a ustat.h system
23483 set ustat.h i_ustat
23486 : see if this is an utime system
23487 set utime.h i_utime
23490 : see if this is a vfork system
23493 set vfork.h i_vfork
23501 : see if wchar.h is present
23502 set wchar.h i_wchar
23507 echo "Looking for extensions..." >&4
23508 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23509 : contain old or inaccurate or duplicate values.
23510 nonxs_extensions=''
23512 : We do not use find because it might not be available.
23513 : We do not just use MANIFEST because the user may have dropped
23514 : some additional extensions into the source tree and expect them
23517 : Function to recursively find available extensions, ignoring DynaLoader
23518 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23519 : In 5.10.1 and later, extensions are stored in directories
23520 : like File-Glob instead of the older File/Glob/.
23524 DynaLoader|dynaload) ;;
23526 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23527 case "$this_ext" in
23528 Scalar/List/Utils) this_ext="List/Util" ;;
23529 PathTools) this_ext="Cwd" ;;
23531 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23532 if $contains " $this_ext " "$tdir/$$.tmp"; then
23534 echo "Duplicate directories detected for extension $xxx" >&4;
23535 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23536 case "$knowitall" in
23544 echo "Ok. Stopping Configure." >&4;
23545 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23548 echo "Ok. You will need to correct config.sh before running make." >&4;
23550 $ls -1 "$xxx" > "$tdir/$$.tmp";
23551 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23552 xs_extensions="$xs_extensions $this_ext";
23553 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23554 xs_extensions="$xs_extensions $this_ext";
23555 elif $test -d "$xxx"; then
23556 nonxs_extensions="$nonxs_extensions $this_ext";
23558 $rm -f "$tdir/$$.tmp";
23566 eval $find_extensions
23570 eval $find_extensions
23574 eval $find_extensions
23575 set X $xs_extensions
23577 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23578 set X $nonxs_extensions
23580 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23582 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23584 : Now see which are supported on this system.
23586 for xxx in $xs_extensions ; do
23590 amigaos) avail_ext="$avail_ext $xxx" ;;
23595 $define) avail_ext="$avail_ext $xxx" ;;
23598 GDBM_File|gdbm_fil)
23600 $define) avail_ext="$avail_ext $xxx" ;;
23604 : XXX Do we need a useipcsysv variable here
23605 case "${d_msg}${d_sem}${d_shm}" in
23606 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23609 NDBM_File|ndbm_fil)
23612 case "$osname-$use64bitint" in
23615 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23618 *) avail_ext="$avail_ext $xxx" ;;
23623 ODBM_File|odbm_fil)
23624 case "${i_dbm}${i_rpcsvcdbm}" in
23626 case "$d_cplusplus" in
23627 define) ;; # delete as a function name will not work
23628 *) case "$osname-$use64bitint" in
23631 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23634 *) avail_ext="$avail_ext $xxx" ;;
23642 case "$useopcode" in
23643 true|define|y) avail_ext="$avail_ext $xxx" ;;
23647 case "$useposix" in
23648 true|define|y) avail_ext="$avail_ext $xxx" ;;
23652 case "$d_socket" in
23653 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23656 I18N/Langinfo|langinfo)
23657 case "$uselanginfo" in
23658 true|define|y) avail_ext="$avail_ext $xxx" ;;
23661 Sys/Syslog|sys/syslog)
23663 amigaos) ;; # not really very useful on AmigaOS
23665 : XXX syslog requires socket
23666 case "$d_socket" in
23667 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23672 threads|threads/shared)
23673 # threads and threads::shared are special cases.
23674 # To stop people from asking "Perl 5.8.0 was supposed
23675 # to have this new fancy threads implementation but my
23676 # perl doesn't have it" and from people trying to
23677 # (re)install the threads module using CPAN.pm and
23678 # CPAN.pm then offering to reinstall Perl 5.8.0,
23679 # the threads.pm and threads/shared.pm will always be
23680 # there, croaking informatively ("you need to rebuild
23681 # all of Perl with threads, sorry") when threads haven't
23682 # been compiled in.
23684 avail_ext="$avail_ext $xxx"
23690 cygwin) avail_ext="$avail_ext $xxx" ;;
23693 XS/APItest|xs/apitest)
23694 # This is just for testing. Skip it unless we have dynamic loading.
23697 $define) avail_ext="$avail_ext $xxx" ;;
23700 XS/Typemap|xs/typemap)
23701 # This is just for testing. Skip it unless we have dynamic loading.
23703 $define) avail_ext="$avail_ext $xxx" ;;
23706 *) avail_ext="$avail_ext $xxx"
23715 case "$onlyextensions" in
23717 *) keepextensions=''
23718 echo "You have requested that only certain extensions be included..." >&4
23719 for i in $onlyextensions; do
23720 case " $avail_ext " in
23722 echo "Keeping extension $i."
23723 keepextensions="$keepextensions $i"
23725 *) echo "Ignoring extension $i." ;;
23728 avail_ext="$keepextensions"
23732 case "$noextensions" in
23734 *) keepextensions=''
23735 echo "You have requested that certain extensions be ignored..." >&4
23736 for i in $avail_ext; do
23737 case " $noextensions " in
23738 *" $i "*) echo "Ignoring extension $i." ;;
23739 *) echo "Keeping extension $i.";
23740 keepextensions="$keepextensions $i"
23744 avail_ext="$keepextensions"
23748 : Now see which nonxs extensions are supported on this system.
23749 : For now assume all are.
23751 for xxx in $nonxs_extensions ; do
23755 *) nonxs_ext="$nonxs_ext $xxx"
23767 A number of extensions are supplied with $package. You may choose to
23768 compile these extensions for dynamic loading (the default), compile
23769 them into the $package executable (static loading), or not include
23770 them at all. Answer "none" to include no extensions.
23771 Note that DynaLoader is always built and need not be mentioned here.
23774 case "$dynamic_ext" in
23776 : Exclude those listed in static_ext
23778 for xxx in $avail_ext; do
23779 case " $static_ext " in
23781 *) dflt="$dflt $xxx" ;;
23788 *) dflt="$dynamic_ext"
23789 # Perhaps we are reusing an old out-of-date config.sh.
23792 if test X"$dynamic_ext" != X"$avail_ext"; then
23794 NOTICE: Your previous config.sh list may be incorrect.
23795 The extensions now available to you are
23797 but the default list from your previous config.sh is
23809 rp="What extensions do you wish to load dynamically?"
23812 none) dynamic_ext=' ' ;;
23813 *) dynamic_ext="$ans" ;;
23816 case "$static_ext" in
23818 : Exclude those already listed in dynamic linking
23820 for xxx in $avail_ext; do
23821 case " $dynamic_ext " in
23823 *) dflt="$dflt $xxx" ;;
23830 *) dflt="$static_ext"
23837 rp="What extensions do you wish to load statically?"
23840 none) static_ext=' ' ;;
23841 *) static_ext="$ans" ;;
23846 A number of extensions are supplied with $package. Answer "none"
23847 to include no extensions.
23848 Note that DynaLoader is always built and need not be mentioned here.
23851 case "$static_ext" in
23852 '') dflt="$avail_ext" ;;
23853 *) dflt="$static_ext"
23854 # Perhaps we are reusing an old out-of-date config.sh.
23857 if test X"$static_ext" != X"$avail_ext"; then
23859 NOTICE: Your previous config.sh list may be incorrect.
23860 The extensions now available to you are
23862 but the default list from your previous config.sh is
23871 : Exclude those that are not xs extensions
23875 rp="What extensions do you wish to include?"
23878 none) static_ext=' ' ;;
23879 *) static_ext="$ans" ;;
23884 # Encode is a special case. If we are building Encode as a static
23885 # extension, we need to explicitly list its subextensions as well.
23886 # For other nested extensions, this is handled automatically by
23887 # the appropriate Makefile.PL.
23888 case " $static_ext " in
23889 *" Encode "*) # Add the subextensions of Encode
23891 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23892 static_ext="$static_ext Encode/$xxx"
23893 known_extensions="$known_extensions Encode/$xxx"
23899 set X $dynamic_ext $static_ext $nonxs_ext
23903 # Sanity check: We require an extension suitable for use with
23904 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23905 # should show up as failures in the test suite, but it's helpful to
23906 # catch them now.) The 'extensions' list is normally sorted
23907 # alphabetically, so we need to accept either
23908 # DB_File ... Fcntl ... IO ....
23909 # or something like
23910 # Fcntl ... NDBM_File ... IO ....
23911 case " $extensions" in
23912 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23913 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23914 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23915 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23916 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23920 : Remove libraries needed only for extensions
23921 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23922 : The exception is SunOS 4.x, which needs them.
23923 case "${osname}X${osvers}" in
23927 *) case "$usedl" in
23928 $define|true|[yY]*)
23929 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23933 *) perllibs="$libs"
23939 : Remove build directory name from cppstdin so it can be used from
23940 : either the present location or the final installed location.
23942 : Get out of the UU directory to get correct path name.
23944 case "$cppstdin" in
23946 echo "Stripping down cppstdin path name"
23952 : end of configuration questions
23954 echo "End of configuration questions."
23957 : back to where it started
23958 if test -d ../UU; then
23962 : configuration may be unconditionally patched via a 'config.arch' file
23963 if $test -f config.arch; then
23964 echo "I see a config.arch file, loading it." >&4
23968 : configuration may be patched via a 'config.over' file
23969 if $test -f config.over; then
23972 rp='I see a config.over file. Do you wish to load it?'
23975 n*) echo "OK, I'll ignore it.";;
23977 echo "Configuration override changes have been loaded."
23982 : in case they want portability, strip down executable paths
23983 case "$d_portable" in
23986 echo "Stripping down executable paths..." >&4
23987 for file in $loclist $trylist; do
23989 eval $file=`basename $temp`
23994 : create config.sh file
23996 echo "Creating config.sh..." >&4
23997 $spitshell <<EOT >config.sh
24000 # This file was produced by running the Configure script. It holds all the
24001 # definitions figured out by Configure. Should you modify one of these values,
24002 # do not forget to propagate your changes by running "Configure -der". You may
24003 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24006 # Package name : $package
24007 # Source directory : $src
24008 # Configuration time: $cf_time
24009 # Configured by : $cf_by
24010 # Target system : $myuname
24013 : Add in command line options if available
24014 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24016 $spitshell <<EOT >>config.sh
24025 Revision='$Revision'
24033 alignbytes='$alignbytes'
24034 aphostname='$aphostname'
24035 api_revision='$api_revision'
24036 api_subversion='$api_subversion'
24037 api_version='$api_version'
24038 api_versionstring='$api_versionstring'
24041 archlibexp='$archlibexp'
24042 archname64='$archname64'
24043 archname='$archname'
24044 archobjs='$archobjs'
24045 asctime_r_proto='$asctime_r_proto'
24054 byteorder='$byteorder'
24056 castflags='$castflags'
24059 cccdlflags='$cccdlflags'
24060 ccdlflags='$ccdlflags'
24062 ccflags_uselargefiles='$ccflags_uselargefiles'
24064 ccsymbols='$ccsymbols'
24065 ccversion='$ccversion'
24067 cf_email='$cf_email'
24069 charbits='$charbits'
24070 charsize='$charsize'
24074 clocktype='$clocktype'
24076 compiler_warning='$compiler_warning'
24077 compress='$compress'
24078 contains='$contains'
24082 cpp_stuff='$cpp_stuff'
24083 cppccsymbols='$cppccsymbols'
24084 cppflags='$cppflags'
24086 cppminus='$cppminus'
24088 cppstdin='$cppstdin'
24089 cppsymbols='$cppsymbols'
24090 crypt_r_proto='$crypt_r_proto'
24091 cryptlib='$cryptlib'
24093 ctermid_r_proto='$ctermid_r_proto'
24094 ctime_r_proto='$ctime_r_proto'
24095 d_Gconvert='$d_Gconvert'
24096 d_PRIEUldbl='$d_PRIEUldbl'
24097 d_PRIFUldbl='$d_PRIFUldbl'
24098 d_PRIGUldbl='$d_PRIGUldbl'
24099 d_PRIXU64='$d_PRIXU64'
24100 d_PRId64='$d_PRId64'
24101 d_PRIeldbl='$d_PRIeldbl'
24102 d_PRIfldbl='$d_PRIfldbl'
24103 d_PRIgldbl='$d_PRIgldbl'
24104 d_PRIi64='$d_PRIi64'
24105 d_PRIo64='$d_PRIo64'
24106 d_PRIu64='$d_PRIu64'
24107 d_PRIx64='$d_PRIx64'
24108 d_SCNfldbl='$d_SCNfldbl'
24109 d__fwalk='$d__fwalk'
24110 d_accept4='$d_accept4'
24111 d_access='$d_access'
24112 d_accessx='$d_accessx'
24116 d_archlib='$d_archlib'
24117 d_asctime64='$d_asctime64'
24118 d_asctime_r='$d_asctime_r'
24123 d_attribute_always_inline='$d_attribute_always_inline'
24124 d_attribute_deprecated='$d_attribute_deprecated'
24125 d_attribute_format='$d_attribute_format'
24126 d_attribute_malloc='$d_attribute_malloc'
24127 d_attribute_nonnull='$d_attribute_nonnull'
24128 d_attribute_noreturn='$d_attribute_noreturn'
24129 d_attribute_pure='$d_attribute_pure'
24130 d_attribute_unused='$d_attribute_unused'
24131 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24132 d_backtrace='$d_backtrace'
24134 d_bsdgetpgrp='$d_bsdgetpgrp'
24135 d_bsdsetpgrp='$d_bsdsetpgrp'
24136 d_builtin_add_overflow='$d_builtin_add_overflow'
24137 d_builtin_choose_expr='$d_builtin_choose_expr'
24138 d_builtin_expect='$d_builtin_expect'
24139 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24140 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24141 d_c99_variadic_macros='$d_c99_variadic_macros'
24142 d_casti32='$d_casti32'
24143 d_castneg='$d_castneg'
24146 d_chroot='$d_chroot'
24147 d_chsize='$d_chsize'
24149 d_clearenv='$d_clearenv'
24150 d_closedir='$d_closedir'
24151 d_cmsghdr_s='$d_cmsghdr_s'
24152 d_copysign='$d_copysign'
24153 d_copysignl='$d_copysignl'
24154 d_cplusplus='$d_cplusplus'
24156 d_crypt_r='$d_crypt_r'
24158 d_ctermid='$d_ctermid'
24159 d_ctermid_r='$d_ctermid_r'
24160 d_ctime64='$d_ctime64'
24161 d_ctime_r='$d_ctime_r'
24162 d_cuserid='$d_cuserid'
24163 d_dbminitproto='$d_dbminitproto'
24164 d_difftime64='$d_difftime64'
24165 d_difftime='$d_difftime'
24166 d_dir_dd_fd='$d_dir_dd_fd'
24168 d_dirnamlen='$d_dirnamlen'
24169 d_dladdr='$d_dladdr'
24170 d_dlerror='$d_dlerror'
24171 d_dlopen='$d_dlopen'
24172 d_dlsymun='$d_dlsymun'
24173 d_dosuid='$d_dosuid'
24174 d_double_has_inf='$d_double_has_inf'
24175 d_double_has_nan='$d_double_has_nan'
24176 d_double_has_negative_zero='$d_double_has_negative_zero'
24177 d_double_has_subnormals='$d_double_has_subnormals'
24178 d_double_style_cray='$d_double_style_cray'
24179 d_double_style_ibm='$d_double_style_ibm'
24180 d_double_style_ieee='$d_double_style_ieee'
24181 d_double_style_vax='$d_double_style_vax'
24182 d_drand48_r='$d_drand48_r'
24183 d_drand48proto='$d_drand48proto'
24186 d_duplocale='$d_duplocale'
24187 d_eaccess='$d_eaccess'
24188 d_endgrent='$d_endgrent'
24189 d_endgrent_r='$d_endgrent_r'
24190 d_endhent='$d_endhent'
24191 d_endhostent_r='$d_endhostent_r'
24192 d_endnent='$d_endnent'
24193 d_endnetent_r='$d_endnetent_r'
24194 d_endpent='$d_endpent'
24195 d_endprotoent_r='$d_endprotoent_r'
24196 d_endpwent='$d_endpwent'
24197 d_endpwent_r='$d_endpwent_r'
24198 d_endsent='$d_endsent'
24199 d_endservent_r='$d_endservent_r'
24200 d_eofnblk='$d_eofnblk'
24203 d_eunice='$d_eunice'
24206 d_faststdio='$d_faststdio'
24207 d_fchdir='$d_fchdir'
24208 d_fchmod='$d_fchmod'
24209 d_fchmodat='$d_fchmodat'
24210 d_fchown='$d_fchown'
24212 d_fcntl_can_lock='$d_fcntl_can_lock'
24213 d_fd_macros='$d_fd_macros'
24214 d_fd_set='$d_fd_set'
24215 d_fdclose='$d_fdclose'
24217 d_fds_bits='$d_fds_bits'
24218 d_fegetround='$d_fegetround'
24219 d_fgetpos='$d_fgetpos'
24220 d_finite='$d_finite'
24221 d_finitel='$d_finitel'
24222 d_flexfnam='$d_flexfnam'
24224 d_flockproto='$d_flockproto'
24229 d_fp_class='$d_fp_class'
24230 d_fp_classify='$d_fp_classify'
24231 d_fp_classl='$d_fp_classl'
24232 d_fpathconf='$d_fpathconf'
24233 d_fpclass='$d_fpclass'
24234 d_fpclassify='$d_fpclassify'
24235 d_fpclassl='$d_fpclassl'
24236 d_fpgetround='$d_fpgetround'
24237 d_fpos64_t='$d_fpos64_t'
24238 d_freelocale='$d_freelocale'
24239 d_frexpl='$d_frexpl'
24240 d_fs_data_s='$d_fs_data_s'
24241 d_fseeko='$d_fseeko'
24242 d_fsetpos='$d_fsetpos'
24243 d_fstatfs='$d_fstatfs'
24244 d_fstatvfs='$d_fstatvfs'
24246 d_ftello='$d_ftello'
24248 d_futimes='$d_futimes'
24249 d_gai_strerror='$d_gai_strerror'
24250 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24251 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24252 d_getaddrinfo='$d_getaddrinfo'
24253 d_getcwd='$d_getcwd'
24254 d_getespwnam='$d_getespwnam'
24255 d_getfsstat='$d_getfsstat'
24256 d_getgrent='$d_getgrent'
24257 d_getgrent_r='$d_getgrent_r'
24258 d_getgrgid_r='$d_getgrgid_r'
24259 d_getgrnam_r='$d_getgrnam_r'
24260 d_getgrps='$d_getgrps'
24261 d_gethbyaddr='$d_gethbyaddr'
24262 d_gethbyname='$d_gethbyname'
24263 d_gethent='$d_gethent'
24264 d_gethname='$d_gethname'
24265 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24266 d_gethostbyname_r='$d_gethostbyname_r'
24267 d_gethostent_r='$d_gethostent_r'
24268 d_gethostprotos='$d_gethostprotos'
24269 d_getitimer='$d_getitimer'
24270 d_getlogin='$d_getlogin'
24271 d_getlogin_r='$d_getlogin_r'
24272 d_getmnt='$d_getmnt'
24273 d_getmntent='$d_getmntent'
24274 d_getnameinfo='$d_getnameinfo'
24275 d_getnbyaddr='$d_getnbyaddr'
24276 d_getnbyname='$d_getnbyname'
24277 d_getnent='$d_getnent'
24278 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24279 d_getnetbyname_r='$d_getnetbyname_r'
24280 d_getnetent_r='$d_getnetent_r'
24281 d_getnetprotos='$d_getnetprotos'
24282 d_getpagsz='$d_getpagsz'
24283 d_getpbyname='$d_getpbyname'
24284 d_getpbynumber='$d_getpbynumber'
24285 d_getpent='$d_getpent'
24286 d_getpgid='$d_getpgid'
24287 d_getpgrp2='$d_getpgrp2'
24288 d_getpgrp='$d_getpgrp'
24289 d_getppid='$d_getppid'
24290 d_getprior='$d_getprior'
24291 d_getprotobyname_r='$d_getprotobyname_r'
24292 d_getprotobynumber_r='$d_getprotobynumber_r'
24293 d_getprotoent_r='$d_getprotoent_r'
24294 d_getprotoprotos='$d_getprotoprotos'
24295 d_getprpwnam='$d_getprpwnam'
24296 d_getpwent='$d_getpwent'
24297 d_getpwent_r='$d_getpwent_r'
24298 d_getpwnam_r='$d_getpwnam_r'
24299 d_getpwuid_r='$d_getpwuid_r'
24300 d_getsbyname='$d_getsbyname'
24301 d_getsbyport='$d_getsbyport'
24302 d_getsent='$d_getsent'
24303 d_getservbyname_r='$d_getservbyname_r'
24304 d_getservbyport_r='$d_getservbyport_r'
24305 d_getservent_r='$d_getservent_r'
24306 d_getservprotos='$d_getservprotos'
24307 d_getspnam='$d_getspnam'
24308 d_getspnam_r='$d_getspnam_r'
24309 d_gettimeod='$d_gettimeod'
24310 d_gmtime64='$d_gmtime64'
24311 d_gmtime_r='$d_gmtime_r'
24312 d_gnulibc='$d_gnulibc'
24313 d_grpasswd='$d_grpasswd'
24314 d_has_C_UTF8='$d_has_C_UTF8'
24315 d_hasmntopt='$d_hasmntopt'
24319 d_ilogbl='$d_ilogbl'
24320 d_inc_version_list='$d_inc_version_list'
24321 d_inetaton='$d_inetaton'
24322 d_inetntop='$d_inetntop'
24323 d_inetpton='$d_inetpton'
24324 d_int64_t='$d_int64_t'
24325 d_ip_mreq='$d_ip_mreq'
24326 d_ip_mreq_source='$d_ip_mreq_source'
24327 d_ipv6_mreq='$d_ipv6_mreq'
24328 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24329 d_isascii='$d_isascii'
24330 d_isblank='$d_isblank'
24331 d_isfinite='$d_isfinite'
24332 d_isfinitel='$d_isfinitel'
24334 d_isinfl='$d_isinfl'
24335 d_isless='$d_isless'
24337 d_isnanl='$d_isnanl'
24338 d_isnormal='$d_isnormal'
24341 d_killpg='$d_killpg'
24342 d_lc_monetary_2008='$d_lc_monetary_2008'
24343 d_lchown='$d_lchown'
24344 d_ldbl_dig='$d_ldbl_dig'
24345 d_ldexpl='$d_ldexpl'
24346 d_lgamma='$d_lgamma'
24347 d_lgamma_r='$d_lgamma_r'
24348 d_libm_lib_version='$d_libm_lib_version'
24349 d_libname_unique='$d_libname_unique'
24351 d_linkat='$d_linkat'
24352 d_llrint='$d_llrint'
24353 d_llrintl='$d_llrintl'
24354 d_llround='$d_llround'
24355 d_llroundl='$d_llroundl'
24356 d_localeconv_l='$d_localeconv_l'
24357 d_localtime64='$d_localtime64'
24358 d_localtime_r='$d_localtime_r'
24359 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24360 d_locconv='$d_locconv'
24365 d_long_double_style_ieee='$d_long_double_style_ieee'
24366 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24367 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24368 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24369 d_long_double_style_vax='$d_long_double_style_vax'
24370 d_longdbl='$d_longdbl'
24371 d_longlong='$d_longlong'
24373 d_lrintl='$d_lrintl'
24374 d_lround='$d_lround'
24375 d_lroundl='$d_lroundl'
24376 d_lseekproto='$d_lseekproto'
24378 d_madvise='$d_madvise'
24379 d_malloc_good_size='$d_malloc_good_size'
24380 d_malloc_size='$d_malloc_size'
24381 d_malloc_usable_size='$d_malloc_usable_size'
24383 d_mbrlen='$d_mbrlen'
24384 d_mbrtowc='$d_mbrtowc'
24385 d_mbstowcs='$d_mbstowcs'
24386 d_mbtowc='$d_mbtowc'
24387 d_memmem='$d_memmem'
24388 d_memrchr='$d_memrchr'
24390 d_mkdtemp='$d_mkdtemp'
24391 d_mkfifo='$d_mkfifo'
24392 d_mkostemp='$d_mkostemp'
24393 d_mkstemp='$d_mkstemp'
24394 d_mkstemps='$d_mkstemps'
24395 d_mktime64='$d_mktime64'
24396 d_mktime='$d_mktime'
24399 d_modflproto='$d_modflproto'
24400 d_mprotect='$d_mprotect'
24402 d_msg_ctrunc='$d_msg_ctrunc'
24403 d_msg_dontroute='$d_msg_dontroute'
24404 d_msg_oob='$d_msg_oob'
24405 d_msg_peek='$d_msg_peek'
24406 d_msg_proxy='$d_msg_proxy'
24407 d_msgctl='$d_msgctl'
24408 d_msgget='$d_msgget'
24409 d_msghdr_s='$d_msghdr_s'
24410 d_msgrcv='$d_msgrcv'
24411 d_msgsnd='$d_msgsnd'
24413 d_munmap='$d_munmap'
24414 d_mymalloc='$d_mymalloc'
24416 d_nanosleep='$d_nanosleep'
24418 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24419 d_nearbyint='$d_nearbyint'
24420 d_newlocale='$d_newlocale'
24421 d_nextafter='$d_nextafter'
24422 d_nexttoward='$d_nexttoward'
24424 d_nl_langinfo='$d_nl_langinfo'
24425 d_nv_preserves_uv='$d_nv_preserves_uv'
24426 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24427 d_off64_t='$d_off64_t'
24428 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24429 d_oldpthreads='$d_oldpthreads'
24430 d_oldsock='$d_oldsock'
24432 d_openat='$d_openat'
24433 d_pathconf='$d_pathconf'
24435 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24436 d_phostname='$d_phostname'
24440 d_portable='$d_portable'
24442 d_prctl_set_name='$d_prctl_set_name'
24443 d_printf_format_null='$d_printf_format_null'
24444 d_procselfexe='$d_procselfexe'
24445 d_pseudofork='$d_pseudofork'
24446 d_pthread_atfork='$d_pthread_atfork'
24447 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24448 d_pthread_yield='$d_pthread_yield'
24449 d_ptrdiff_t='$d_ptrdiff_t'
24451 d_pwchange='$d_pwchange'
24452 d_pwclass='$d_pwclass'
24453 d_pwcomment='$d_pwcomment'
24454 d_pwexpire='$d_pwexpire'
24455 d_pwgecos='$d_pwgecos'
24456 d_pwpasswd='$d_pwpasswd'
24457 d_pwquota='$d_pwquota'
24460 d_querylocale='$d_querylocale'
24461 d_random_r='$d_random_r'
24462 d_re_comp='$d_re_comp'
24463 d_readdir64_r='$d_readdir64_r'
24464 d_readdir='$d_readdir'
24465 d_readdir_r='$d_readdir_r'
24466 d_readlink='$d_readlink'
24468 d_recvmsg='$d_recvmsg'
24469 d_regcmp='$d_regcmp'
24470 d_regcomp='$d_regcomp'
24471 d_remainder='$d_remainder'
24472 d_remquo='$d_remquo'
24473 d_rename='$d_rename'
24474 d_renameat='$d_renameat'
24475 d_rewinddir='$d_rewinddir'
24479 d_sbrkproto='$d_sbrkproto'
24480 d_scalbn='$d_scalbn'
24481 d_scalbnl='$d_scalbnl'
24482 d_sched_yield='$d_sched_yield'
24483 d_scm_rights='$d_scm_rights'
24484 d_seekdir='$d_seekdir'
24485 d_select='$d_select'
24487 d_semctl='$d_semctl'
24488 d_semctl_semid_ds='$d_semctl_semid_ds'
24489 d_semctl_semun='$d_semctl_semun'
24490 d_semget='$d_semget'
24492 d_sendmsg='$d_sendmsg'
24493 d_setegid='$d_setegid'
24494 d_seteuid='$d_seteuid'
24495 d_setgrent='$d_setgrent'
24496 d_setgrent_r='$d_setgrent_r'
24497 d_setgrps='$d_setgrps'
24498 d_sethent='$d_sethent'
24499 d_sethostent_r='$d_sethostent_r'
24500 d_setitimer='$d_setitimer'
24501 d_setlinebuf='$d_setlinebuf'
24502 d_setlocale='$d_setlocale'
24503 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
24504 d_setlocale_r='$d_setlocale_r'
24505 d_setnent='$d_setnent'
24506 d_setnetent_r='$d_setnetent_r'
24507 d_setpent='$d_setpent'
24508 d_setpgid='$d_setpgid'
24509 d_setpgrp2='$d_setpgrp2'
24510 d_setpgrp='$d_setpgrp'
24511 d_setprior='$d_setprior'
24512 d_setproctitle='$d_setproctitle'
24513 d_setprotoent_r='$d_setprotoent_r'
24514 d_setpwent='$d_setpwent'
24515 d_setpwent_r='$d_setpwent_r'
24516 d_setregid='$d_setregid'
24517 d_setresgid='$d_setresgid'
24518 d_setresuid='$d_setresuid'
24519 d_setreuid='$d_setreuid'
24520 d_setrgid='$d_setrgid'
24521 d_setruid='$d_setruid'
24522 d_setsent='$d_setsent'
24523 d_setservent_r='$d_setservent_r'
24524 d_setsid='$d_setsid'
24525 d_setvbuf='$d_setvbuf'
24528 d_shmatprototype='$d_shmatprototype'
24529 d_shmctl='$d_shmctl'
24531 d_shmget='$d_shmget'
24532 d_sigaction='$d_sigaction'
24533 d_siginfo_si_addr='$d_siginfo_si_addr'
24534 d_siginfo_si_band='$d_siginfo_si_band'
24535 d_siginfo_si_errno='$d_siginfo_si_errno'
24536 d_siginfo_si_fd='$d_siginfo_si_fd'
24537 d_siginfo_si_pid='$d_siginfo_si_pid'
24538 d_siginfo_si_status='$d_siginfo_si_status'
24539 d_siginfo_si_uid='$d_siginfo_si_uid'
24540 d_siginfo_si_value='$d_siginfo_si_value'
24541 d_signbit='$d_signbit'
24542 d_sigprocmask='$d_sigprocmask'
24543 d_sigsetjmp='$d_sigsetjmp'
24544 d_sin6_scope_id='$d_sin6_scope_id'
24545 d_sitearch='$d_sitearch'
24546 d_snprintf='$d_snprintf'
24547 d_sockaddr_in6='$d_sockaddr_in6'
24548 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24549 d_sockaddr_storage='$d_sockaddr_storage'
24550 d_sockatmark='$d_sockatmark'
24551 d_sockatmarkproto='$d_sockatmarkproto'
24552 d_socket='$d_socket'
24553 d_socklen_t='$d_socklen_t'
24554 d_sockpair='$d_sockpair'
24555 d_socks5_init='$d_socks5_init'
24557 d_srand48_r='$d_srand48_r'
24558 d_srandom_r='$d_srandom_r'
24559 d_sresgproto='$d_sresgproto'
24560 d_sresuproto='$d_sresuproto'
24562 d_statblks='$d_statblks'
24563 d_statfs_f_flags='$d_statfs_f_flags'
24564 d_statfs_s='$d_statfs_s'
24565 d_static_inline='$d_static_inline'
24566 d_statvfs='$d_statvfs'
24567 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24568 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24569 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24570 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24571 d_stdio_stream_array='$d_stdio_stream_array'
24572 d_stdiobase='$d_stdiobase'
24573 d_stdstdio='$d_stdstdio'
24574 d_strcoll='$d_strcoll'
24575 d_strerror_l='$d_strerror_l'
24576 d_strerror_r='$d_strerror_r'
24577 d_strftime='$d_strftime'
24578 d_strlcat='$d_strlcat'
24579 d_strlcpy='$d_strlcpy'
24580 d_strnlen='$d_strnlen'
24581 d_strtod='$d_strtod'
24582 d_strtod_l='$d_strtod_l'
24583 d_strtol='$d_strtol'
24584 d_strtold='$d_strtold'
24585 d_strtold_l='$d_strtold_l'
24586 d_strtoll='$d_strtoll'
24587 d_strtoq='$d_strtoq'
24588 d_strtoul='$d_strtoul'
24589 d_strtoull='$d_strtoull'
24590 d_strtouq='$d_strtouq'
24591 d_strxfrm='$d_strxfrm'
24592 d_suidsafe='$d_suidsafe'
24593 d_symlink='$d_symlink'
24594 d_syscall='$d_syscall'
24595 d_syscallproto='$d_syscallproto'
24596 d_sysconf='$d_sysconf'
24597 d_sysernlst='$d_sysernlst'
24598 d_syserrlst='$d_syserrlst'
24599 d_system='$d_system'
24600 d_tcgetpgrp='$d_tcgetpgrp'
24601 d_tcsetpgrp='$d_tcsetpgrp'
24602 d_telldir='$d_telldir'
24603 d_telldirproto='$d_telldirproto'
24604 d_tgamma='$d_tgamma'
24605 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24607 d_timegm='$d_timegm'
24609 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24610 d_tm_tm_zone='$d_tm_tm_zone'
24611 d_tmpnam_r='$d_tmpnam_r'
24612 d_towlower='$d_towlower'
24613 d_towupper='$d_towupper'
24615 d_truncate='$d_truncate'
24616 d_truncl='$d_truncl'
24617 d_ttyname_r='$d_ttyname_r'
24618 d_tzname='$d_tzname'
24619 d_u32align='$d_u32align'
24620 d_ualarm='$d_ualarm'
24623 d_union_semun='$d_union_semun'
24624 d_unlinkat='$d_unlinkat'
24625 d_unordered='$d_unordered'
24626 d_unsetenv='$d_unsetenv'
24627 d_uselocale='$d_uselocale'
24628 d_usleep='$d_usleep'
24629 d_usleepproto='$d_usleepproto'
24631 d_vendorarch='$d_vendorarch'
24632 d_vendorbin='$d_vendorbin'
24633 d_vendorlib='$d_vendorlib'
24634 d_vendorscript='$d_vendorscript'
24636 d_void_closedir='$d_void_closedir'
24637 d_voidsig='$d_voidsig'
24638 d_voidtty='$d_voidtty'
24639 d_vsnprintf='$d_vsnprintf'
24641 d_waitpid='$d_waitpid'
24642 d_wcrtomb='$d_wcrtomb'
24643 d_wcscmp='$d_wcscmp'
24644 d_wcstombs='$d_wcstombs'
24645 d_wcsxfrm='$d_wcsxfrm'
24646 d_wctomb='$d_wctomb'
24647 d_writev='$d_writev'
24650 db_hashtype='$db_hashtype'
24651 db_prefixtype='$db_prefixtype'
24652 db_version_major='$db_version_major'
24653 db_version_minor='$db_version_minor'
24654 db_version_patch='$db_version_patch'
24655 default_inc_excludes_dot='$default_inc_excludes_dot'
24656 direntrytype='$direntrytype'
24659 doubleinfbytes='$doubleinfbytes'
24660 doublekind='$doublekind'
24661 doublemantbits='$doublemantbits'
24662 doublenanbytes='$doublenanbytes'
24663 doublesize='$doublesize'
24665 drand48_r_proto='$drand48_r_proto'
24667 dtraceobject='$dtraceobject'
24668 dtracexnolibs='$dtracexnolibs'
24669 dynamic_ext='$dynamic_ext'
24675 endgrent_r_proto='$endgrent_r_proto'
24676 endhostent_r_proto='$endhostent_r_proto'
24677 endnetent_r_proto='$endnetent_r_proto'
24678 endprotoent_r_proto='$endprotoent_r_proto'
24679 endpwent_r_proto='$endpwent_r_proto'
24680 endservent_r_proto='$endservent_r_proto'
24681 eunicefix='$eunicefix'
24684 extensions='$extensions'
24685 extern_C='$extern_C'
24687 fflushNULL='$fflushNULL'
24688 fflushall='$fflushall'
24690 firstmakefile='$firstmakefile'
24692 fpossize='$fpossize'
24693 fpostype='$fpostype'
24694 freetype='$freetype'
24697 full_csh='$full_csh'
24698 full_sed='$full_sed'
24699 gccansipedantic='$gccansipedantic'
24700 gccosandvers='$gccosandvers'
24701 gccversion='$gccversion'
24702 getgrent_r_proto='$getgrent_r_proto'
24703 getgrgid_r_proto='$getgrgid_r_proto'
24704 getgrnam_r_proto='$getgrnam_r_proto'
24705 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24706 gethostbyname_r_proto='$gethostbyname_r_proto'
24707 gethostent_r_proto='$gethostent_r_proto'
24708 getlogin_r_proto='$getlogin_r_proto'
24709 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24710 getnetbyname_r_proto='$getnetbyname_r_proto'
24711 getnetent_r_proto='$getnetent_r_proto'
24712 getprotobyname_r_proto='$getprotobyname_r_proto'
24713 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24714 getprotoent_r_proto='$getprotoent_r_proto'
24715 getpwent_r_proto='$getpwent_r_proto'
24716 getpwnam_r_proto='$getpwnam_r_proto'
24717 getpwuid_r_proto='$getpwuid_r_proto'
24718 getservbyname_r_proto='$getservbyname_r_proto'
24719 getservbyport_r_proto='$getservbyport_r_proto'
24720 getservent_r_proto='$getservent_r_proto'
24721 getspnam_r_proto='$getspnam_r_proto'
24722 gidformat='$gidformat'
24728 gmtime_r_proto='$gmtime_r_proto'
24729 gnulibc_version='$gnulibc_version'
24731 groupcat='$groupcat'
24732 groupstype='$groupstype'
24735 h_sysfile='$h_sysfile'
24738 hostgenerate='$hostgenerate'
24739 hostosname='$hostosname'
24740 hostperl='$hostperl'
24741 html1dir='$html1dir'
24742 html1direxp='$html1direxp'
24743 html3dir='$html3dir'
24744 html3direxp='$html3direxp'
24753 i_arpainet='$i_arpainet'
24755 i_bsdioctl='$i_bsdioctl'
24759 i_dirent='$i_dirent'
24761 i_execinfo='$i_execinfo'
24765 i_fp_class='$i_fp_class'
24767 i_gdbm_ndbm='$i_gdbm_ndbm'
24768 i_gdbmndbm='$i_gdbmndbm'
24770 i_ieeefp='$i_ieeefp'
24771 i_inttypes='$i_inttypes'
24772 i_langinfo='$i_langinfo'
24773 i_libutil='$i_libutil'
24774 i_locale='$i_locale'
24775 i_machcthr='$i_machcthr'
24776 i_malloc='$i_malloc'
24777 i_mallocmalloc='$i_mallocmalloc'
24778 i_mntent='$i_mntent'
24781 i_neterrno='$i_neterrno'
24782 i_netinettcp='$i_netinettcp'
24786 i_pthread='$i_pthread'
24788 i_quadmath='$i_quadmath'
24789 i_rpcsvcdbm='$i_rpcsvcdbm'
24791 i_shadow='$i_shadow'
24793 i_stdbool='$i_stdbool'
24794 i_stdint='$i_stdint'
24795 i_stdlib='$i_stdlib'
24796 i_sunmath='$i_sunmath'
24797 i_sysaccess='$i_sysaccess'
24798 i_sysdir='$i_sysdir'
24799 i_sysfile='$i_sysfile'
24800 i_sysfilio='$i_sysfilio'
24802 i_sysioctl='$i_sysioctl'
24803 i_syslog='$i_syslog'
24804 i_sysmman='$i_sysmman'
24805 i_sysmode='$i_sysmode'
24806 i_sysmount='$i_sysmount'
24807 i_sysndir='$i_sysndir'
24808 i_sysparam='$i_sysparam'
24809 i_syspoll='$i_syspoll'
24810 i_sysresrc='$i_sysresrc'
24811 i_syssecrt='$i_syssecrt'
24812 i_sysselct='$i_sysselct'
24813 i_syssockio='$i_syssockio'
24814 i_sysstat='$i_sysstat'
24815 i_sysstatfs='$i_sysstatfs'
24816 i_sysstatvfs='$i_sysstatvfs'
24817 i_systime='$i_systime'
24818 i_systimek='$i_systimek'
24819 i_systimes='$i_systimes'
24820 i_systypes='$i_systypes'
24821 i_sysuio='$i_sysuio'
24823 i_sysutsname='$i_sysutsname'
24824 i_sysvfs='$i_sysvfs'
24825 i_syswait='$i_syswait'
24826 i_termio='$i_termio'
24827 i_termios='$i_termios'
24829 i_unistd='$i_unistd'
24834 i_wctype='$i_wctype'
24835 i_xlocale='$i_xlocale'
24836 ignore_versioned_solibs='$ignore_versioned_solibs'
24837 inc_version_list='$inc_version_list'
24838 inc_version_list_init='$inc_version_list_init'
24842 initialinstalllocation='$initialinstalllocation'
24843 installarchlib='$installarchlib'
24844 installbin='$installbin'
24845 installhtml1dir='$installhtml1dir'
24846 installhtml3dir='$installhtml3dir'
24847 installman1dir='$installman1dir'
24848 installman3dir='$installman3dir'
24849 installprefix='$installprefix'
24850 installprefixexp='$installprefixexp'
24851 installprivlib='$installprivlib'
24852 installscript='$installscript'
24853 installsitearch='$installsitearch'
24854 installsitebin='$installsitebin'
24855 installsitehtml1dir='$installsitehtml1dir'
24856 installsitehtml3dir='$installsitehtml3dir'
24857 installsitelib='$installsitelib'
24858 installsiteman1dir='$installsiteman1dir'
24859 installsiteman3dir='$installsiteman3dir'
24860 installsitescript='$installsitescript'
24861 installstyle='$installstyle'
24862 installusrbinperl='$installusrbinperl'
24863 installvendorarch='$installvendorarch'
24864 installvendorbin='$installvendorbin'
24865 installvendorhtml1dir='$installvendorhtml1dir'
24866 installvendorhtml3dir='$installvendorhtml3dir'
24867 installvendorlib='$installvendorlib'
24868 installvendorman1dir='$installvendorman1dir'
24869 installvendorman3dir='$installvendorman3dir'
24870 installvendorscript='$installvendorscript'
24872 issymlink='$issymlink'
24873 ivdformat='$ivdformat'
24876 known_extensions='$known_extensions'
24879 ld_can_script='$ld_can_script'
24880 lddlflags='$lddlflags'
24882 ldflags_uselargefiles='$ldflags_uselargefiles'
24883 ldlibpthname='$ldlibpthname'
24890 libsdirs='$libsdirs'
24891 libsfiles='$libsfiles'
24892 libsfound='$libsfound'
24893 libspath='$libspath'
24894 libswanted='$libswanted'
24895 libswanted_uselargefiles='$libswanted_uselargefiles'
24901 localtime_r_proto='$localtime_r_proto'
24902 locincpth='$locincpth'
24903 loclibpth='$loclibpth'
24904 longdblinfbytes='$longdblinfbytes'
24905 longdblkind='$longdblkind'
24906 longdblmantbits='$longdblmantbits'
24907 longdblnanbytes='$longdblnanbytes'
24908 longdblsize='$longdblsize'
24909 longlongsize='$longlongsize'
24910 longsize='$longsize'
24914 lseeksize='$lseeksize'
24915 lseektype='$lseektype'
24919 make_set_make='$make_set_make'
24920 mallocobj='$mallocobj'
24921 mallocsrc='$mallocsrc'
24922 malloctype='$malloctype'
24924 man1direxp='$man1direxp'
24927 man3direxp='$man3direxp'
24929 mips_type='$mips_type'
24930 mistrustnm='$mistrustnm'
24932 mmaptype='$mmaptype'
24933 modetype='$modetype'
24935 multiarch='$multiarch'
24937 myarchname='$myarchname'
24938 mydomain='$mydomain'
24939 myhostname='$myhostname'
24942 need_va_copy='$need_va_copy'
24943 netdb_hlen_type='$netdb_hlen_type'
24944 netdb_host_type='$netdb_host_type'
24945 netdb_name_type='$netdb_name_type'
24946 netdb_net_type='$netdb_net_type'
24949 nm_so_opt='$nm_so_opt'
24950 nonxs_ext='$nonxs_ext'
24952 nvEUformat='$nvEUformat'
24953 nvFUformat='$nvFUformat'
24954 nvGUformat='$nvGUformat'
24955 nv_overflows_integers_at='$nv_overflows_integers_at'
24956 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24957 nveformat='$nveformat'
24958 nvfformat='$nvfformat'
24959 nvgformat='$nvgformat'
24960 nvmantbits='$nvmantbits'
24963 o_nonblock='$o_nonblock'
24965 old_pthread_create_joinable='$old_pthread_create_joinable'
24966 optimize='$optimize'
24967 orderlib='$orderlib'
24970 otherlibdirs='$otherlibdirs'
24974 patchlevel='$patchlevel'
24975 path_sep='$path_sep'
24978 perl_patchlevel='$perl_patchlevel'
24979 perl_static_inline='$perl_static_inline'
24980 perladmin='$perladmin'
24981 perllibs='$perllibs'
24982 perlpath='$perlpath'
24984 phostname='$phostname'
24990 prefixexp='$prefixexp'
24992 privlibexp='$privlibexp'
24993 procselfexe='$procselfexe'
24995 quadkind='$quadkind'
24996 quadtype='$quadtype'
24997 randbits='$randbits'
24998 randfunc='$randfunc'
24999 random_r_proto='$random_r_proto'
25000 randseedtype='$randseedtype'
25002 rd_nodata='$rd_nodata'
25003 readdir64_r_proto='$readdir64_r_proto'
25004 readdir_r_proto='$readdir_r_proto'
25005 revision='$revision'
25011 sGMTIME_max='$sGMTIME_max'
25012 sGMTIME_min='$sGMTIME_min'
25013 sLOCALTIME_max='$sLOCALTIME_max'
25014 sLOCALTIME_min='$sLOCALTIME_min'
25015 sPRIEUldbl='$sPRIEUldbl'
25016 sPRIFUldbl='$sPRIFUldbl'
25017 sPRIGUldbl='$sPRIGUldbl'
25018 sPRIXU64='$sPRIXU64'
25020 sPRIeldbl='$sPRIeldbl'
25021 sPRIfldbl='$sPRIfldbl'
25022 sPRIgldbl='$sPRIgldbl'
25027 sSCNfldbl='$sSCNfldbl'
25028 sched_yield='$sched_yield'
25029 scriptdir='$scriptdir'
25030 scriptdirexp='$scriptdirexp'
25032 seedfunc='$seedfunc'
25033 selectminbits='$selectminbits'
25034 selecttype='$selecttype'
25035 sendmail='$sendmail'
25036 setgrent_r_proto='$setgrent_r_proto'
25037 sethostent_r_proto='$sethostent_r_proto'
25038 setlocale_r_proto='$setlocale_r_proto'
25039 setnetent_r_proto='$setnetent_r_proto'
25040 setprotoent_r_proto='$setprotoent_r_proto'
25041 setpwent_r_proto='$setpwent_r_proto'
25042 setservent_r_proto='$setservent_r_proto'
25045 sharpbang='$sharpbang'
25046 shmattype='$shmattype'
25047 shortsize='$shortsize'
25050 sig_count='$sig_count'
25051 sig_name='$sig_name'
25052 sig_name_init='$sig_name_init'
25054 sig_num_init='$sig_num_init'
25055 sig_size='$sig_size'
25056 signal_t='$signal_t'
25057 sitearch='$sitearch'
25058 sitearchexp='$sitearchexp'
25060 sitebinexp='$sitebinexp'
25061 sitehtml1dir='$sitehtml1dir'
25062 sitehtml1direxp='$sitehtml1direxp'
25063 sitehtml3dir='$sitehtml3dir'
25064 sitehtml3direxp='$sitehtml3direxp'
25066 sitelib_stem='$sitelib_stem'
25067 sitelibexp='$sitelibexp'
25068 siteman1dir='$siteman1dir'
25069 siteman1direxp='$siteman1direxp'
25070 siteman3dir='$siteman3dir'
25071 siteman3direxp='$siteman3direxp'
25072 siteprefix='$siteprefix'
25073 siteprefixexp='$siteprefixexp'
25074 sitescript='$sitescript'
25075 sitescriptexp='$sitescriptexp'
25076 sizesize='$sizesize'
25077 sizetype='$sizetype'
25081 sockethdr='$sockethdr'
25082 socketlib='$socketlib'
25083 socksizetype='$socksizetype'
25085 spackage='$spackage'
25086 spitshell='$spitshell'
25087 srand48_r_proto='$srand48_r_proto'
25088 srandom_r_proto='$srandom_r_proto'
25090 ssizetype='$ssizetype'
25091 st_ino_sign='$st_ino_sign'
25092 st_ino_size='$st_ino_size'
25093 startperl='$startperl'
25095 static_ext='$static_ext'
25097 stdio_base='$stdio_base'
25098 stdio_bufsiz='$stdio_bufsiz'
25099 stdio_cnt='$stdio_cnt'
25100 stdio_filbuf='$stdio_filbuf'
25101 stdio_ptr='$stdio_ptr'
25102 stdio_stream_array='$stdio_stream_array'
25103 strerror_r_proto='$strerror_r_proto'
25105 subversion='$subversion'
25110 targetarch='$targetarch'
25111 targetdir='$targetdir'
25112 targetenv='$targetenv'
25113 targethost='$targethost'
25114 targetmkdir='$targetmkdir'
25115 targetport='$targetport'
25116 targetsh='$targetsh'
25120 timeincl='$timeincl'
25121 timetype='$timetype'
25122 tmpnam_r_proto='$tmpnam_r_proto'
25128 ttyname_r_proto='$ttyname_r_proto'
25137 uidformat='$uidformat'
25143 uquadtype='$uquadtype'
25144 use64bitall='$use64bitall'
25145 use64bitint='$use64bitint'
25146 usecbacktrace='$usecbacktrace'
25147 usecrosscompile='$usecrosscompile'
25148 usedefaultstrict='$usedefaultstrict'
25149 usedevel='$usedevel'
25151 usedtrace='$usedtrace'
25152 usefaststdio='$usefaststdio'
25153 useithreads='$useithreads'
25154 usekernprocpathname='$usekernprocpathname'
25155 uselanginfo='$uselanginfo'
25156 uselargefiles='$uselargefiles'
25157 uselongdouble='$uselongdouble'
25158 usemallocwrap='$usemallocwrap'
25159 usemorebits='$usemorebits'
25160 usemultiplicity='$usemultiplicity'
25161 usemymalloc='$usemymalloc'
25163 usensgetexecutablepath='$usensgetexecutablepath'
25164 useopcode='$useopcode'
25165 useperlio='$useperlio'
25166 useposix='$useposix'
25167 usequadmath='$usequadmath'
25168 usereentrant='$usereentrant'
25169 userelocatableinc='$userelocatableinc'
25170 useshrplib='$useshrplib'
25171 usesitecustomize='$usesitecustomize'
25172 usesocks='$usesocks'
25173 usethreads='$usethreads'
25174 usevendorprefix='$usevendorprefix'
25175 useversionedarchname='$useversionedarchname'
25176 usevfork='$usevfork'
25179 uvXUformat='$uvXUformat'
25180 uvoformat='$uvoformat'
25183 uvuformat='$uvuformat'
25184 uvxformat='$uvxformat'
25185 vendorarch='$vendorarch'
25186 vendorarchexp='$vendorarchexp'
25187 vendorbin='$vendorbin'
25188 vendorbinexp='$vendorbinexp'
25189 vendorhtml1dir='$vendorhtml1dir'
25190 vendorhtml1direxp='$vendorhtml1direxp'
25191 vendorhtml3dir='$vendorhtml3dir'
25192 vendorhtml3direxp='$vendorhtml3direxp'
25193 vendorlib='$vendorlib'
25194 vendorlib_stem='$vendorlib_stem'
25195 vendorlibexp='$vendorlibexp'
25196 vendorman1dir='$vendorman1dir'
25197 vendorman1direxp='$vendorman1direxp'
25198 vendorman3dir='$vendorman3dir'
25199 vendorman3direxp='$vendorman3direxp'
25200 vendorprefix='$vendorprefix'
25201 vendorprefixexp='$vendorprefixexp'
25202 vendorscript='$vendorscript'
25203 vendorscriptexp='$vendorscriptexp'
25205 version_patchlevel_string='$version_patchlevel_string'
25206 versiononly='$versiononly'
25210 yaccflags='$yaccflags'
25215 : add special variables
25216 $test -f $src/patchlevel.h && \
25217 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25218 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25219 echo "PERL_CONFIG_SH=true" >>config.sh
25221 : propagate old symbols
25222 if $test -f UU/config.sh; then
25223 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25224 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25225 config.sh config.sh UU/oldconfig.sh |\
25226 $sort | $uniq -u >UU/oldsyms
25227 set X `$cat UU/oldsyms`
25233 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25235 echo ": Variables propagated from previous config.sh file." >>config.sh
25236 for sym in `$cat UU/oldsyms`; do
25237 echo " Propagating $hint variable "'$'"$sym..."
25238 eval 'tmp="$'"${sym}"'"'
25240 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25246 : preserve RCS keywords in files with variable substitution, grrr
25249 : Finish up by extracting the .SH files
25252 echo "Stopping at your request, leaving temporary files around."
25262 If you'd like to make any changes to the config.sh file before I begin
25263 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25266 rp="Press return or use a shell escape to edit config.sh:"
25271 *) : in case they cannot read
25272 sh 1>&4 -c "$ans";;
25277 : if this fails, just run all the .SH files by hand
25286 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25293 Now you need to generate make dependencies by running "$make depend".
25294 You might prefer to run it in background: "$make depend > makedepend.out &"
25295 It can take a while, so you might not want to run it right now.
25300 rp="Run $make depend now?"
25304 $make depend && echo "Now you must run '$make'."
25307 echo "You must run '$make depend' then '$make'."
25310 elif test -f [Mm]akefile; then
25312 echo "Now you must run a $make."
25314 echo "Configure done."
25317 if $test -f Policy.sh; then
25320 If you compile $package on a different machine or from a different object
25321 directory, copy the Policy.sh file from this object directory to the
25322 new one before you run Configure -- this will help you with most of
25323 the policy defaults.
25327 if $test -f UU/config.msg; then
25328 echo "Hmm. I also noted the following information while running:"
25330 $cat UU/config.msg >&4
25332 $rm -f kit*isdone ark*isdone