3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/Perl/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # with additional metaconfig patches from https://github.com/Perl/metaconfig
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
386 d_attribute_always_inline=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_visibility=''
395 d_attribute_warn_unused_result=''
396 d_printf_format_null=''
398 d_non_int_bitfields=''
399 d_builtin_choose_expr=''
401 d_builtin_add_overflow=''
402 d_builtin_mul_overflow=''
403 d_builtin_sub_overflow=''
404 d_c99_variadic_macros=''
453 endhostent_r_proto=''
459 endprotoent_r_proto=''
465 endservent_r_proto=''
521 d_getenv_preserves_other_thread=''
540 gethostbyaddr_r_proto=''
542 gethostbyname_r_proto=''
544 gethostent_r_proto=''
557 getnetbyaddr_r_proto=''
559 getnetbyname_r_proto=''
573 d_getprotobyname_r=''
574 getprotobyname_r_proto=''
575 d_getprotobynumber_r=''
576 getprotobynumber_r_proto=''
578 getprotoent_r_proto=''
590 getservbyname_r_proto=''
592 getservbyport_r_proto=''
594 getservent_r_proto=''
627 d_lc_monetary_2008=''
632 d_libm_lib_version=''
640 d_localtime_r_needs_tzset=''
648 d_long_double_style_ieee=''
649 d_long_double_style_ieee_doubledouble=''
650 d_long_double_style_ieee_extended=''
651 d_long_double_style_ieee_std=''
652 d_long_double_style_vax=''
665 d_malloc_good_size=''
667 d_malloc_usable_size=''
723 d_old_pthread_create_joinable=''
724 old_pthread_create_joinable=''
726 d_pthread_attr_setscope=''
772 sethostent_r_proto=''
777 d_setlocale_accepts_any_locale_name=''
791 setprotoent_r_proto=''
803 setservent_r_proto=''
816 d_siginfo_si_errno=''
819 d_siginfo_si_status=''
821 d_siginfo_si_value=''
833 d_ipv6_mreq_source=''
844 d_sockaddr_storage=''
863 perl_static_inline=''
868 d_stdio_ptr_lval_nochange_cnt=''
869 d_stdio_ptr_lval_sets_cnt=''
955 default_inc_excludes_dot=''
956 d_perl_lc_all_category_positions_init=''
957 d_perl_lc_all_separator=''
958 d_perl_lc_all_uses_name_value_pairs=''
959 perl_lc_all_category_positions_init=''
960 perl_lc_all_separator=''
1026 d_gdbm_ndbm_h_uses_prototypes=''
1027 d_gdbmndbm_h_uses_prototypes=''
1029 d_ndbm_h_uses_prototypes=''
1101 d_inc_version_list=''
1103 inc_version_list_init=''
1111 installusrbinperl=''
1127 ignore_versioned_solibs=''
1143 d_double_has_negative_zero=''
1144 d_double_has_subnormals=''
1145 d_double_style_cray=''
1146 d_double_style_ibm=''
1147 d_double_style_ieee=''
1148 d_double_style_vax=''
1199 d_perl_otherlibdirs=''
1207 api_versionstring=''
1213 version_patchlevel_string=''
1222 d_nv_preserves_uv=''
1223 d_nv_zero_is_allbits_zero=''
1234 nv_overflows_integers_at=''
1235 nv_preserves_uv_bits=''
1307 installsitehtml1dir=''
1310 installsitehtml3dir=''
1317 installsiteman1dir=''
1320 installsiteman3dir=''
1325 installsitescript=''
1345 d_stdio_stream_array=''
1346 stdio_stream_array=''
1365 usekernprocpathname=''
1366 ccflags_uselargefiles=''
1367 ldflags_uselargefiles=''
1368 libswanted_uselargefiles=''
1377 usensgetexecutablepath=''
1389 installvendorarch=''
1396 installvendorhtml1dir=''
1398 vendorhtml1direxp=''
1399 installvendorhtml3dir=''
1401 vendorhtml3direxp=''
1407 installvendorman1dir=''
1410 installvendorman3dir=''
1417 installvendorscript=''
1428 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1431 : We must find out about Eunice early
1433 if test -f /etc/unixtovms; then
1434 eunicefix=/etc/unixtovms
1436 if test -f /etc/unixtovms.exe; then
1437 eunicefix=/etc/unixtovms.exe
1440 : Set executable suffix now -- needed before hints available
1441 if test -f "/libs/version.library"; then
1444 elif test -f "/system/gnu_library/bin/ar.pm"; then
1447 elif test -n "$DJGPP"; then
1450 elif test -f /kern/cookiejar; then
1453 elif test -d c:/. -o -n "$is_os2" ; then
1460 : Possible local include directories to search.
1461 : Set locincpth to "" in a hint file to defeat local include searches.
1462 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1463 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1465 : no include file wanted by default
1468 : Enable -DEBUGGING and -DDEBUGGING from the command line
1472 : Trailing extension. Override this in a hint file, if needed.
1473 : Extra object files, if any, needed on this platform.
1476 : change the next line if compiling for Xenix/286 on Xenix/386
1477 xlibpth='/usr/lib/386 /lib/386'
1478 : Possible local library directories to search.
1479 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1480 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1482 : general looking path for locating libraries
1483 glibpth="/lib /usr/lib $xlibpth"
1484 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1485 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1486 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1487 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1489 : Private path used by Configure to find libraries. Its value
1490 : is prepended to libpth. This variable takes care of special
1491 : machines, like the mips. Usually, it should be empty.
1494 : default library list
1496 : some systems want to use only the non-versioned libso:s
1497 ignore_versioned_solibs=''
1501 : set useposix=false in your hint file to disable the POSIX extension.
1503 : set useopcode=false in your hint file to disable the Opcode extension.
1505 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1508 ccflags_uselargefiles=''
1509 ldflags_uselargefiles=''
1510 libswanted_uselargefiles=''
1511 : set usemultiplicity on the Configure command line to enable multiplicity.
1512 : set usesocks on the Configure command line to enable socks.
1514 : set usethreads on the Configure command line to enable threads.
1515 usereentrant='undef'
1516 : List of libraries we want.
1517 : If anyone needs extra -lxxx, put those in a hint file.
1518 libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld"
1519 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1520 : We probably want to search /usr/shlib before most other libraries.
1521 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1522 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1523 glibpth="/usr/shlib $glibpth"
1524 : Do not use vfork unless overridden by a hint file.
1527 : Find the basic shell for Bourne shell scripts
1531 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1534 if test -f "$xxx"; then
1537 : Build up a list and do a single loop so we can 'break' out.
1538 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1539 for xxx in sh bash ksh pdksh ash; do
1541 try="$try ${p}/${xxx}"
1545 if test -f "$xxx"; then
1548 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1551 elif test -f "$xxx.exe"; then
1562 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1564 Usually it's in /bin/sh. How did you even get this far?
1565 Please report this issue at https://github.com/Perl/perl5/issues
1566 and we'll try to straighten this all out.
1572 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1573 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1576 : see if sh knows # comments
1577 if `$sh -c '#' >/dev/null 2>&1`; then
1581 test -f $xcat$_exe || xcat=/usr/bin/cat
1582 if test ! -f $xcat$_exe; then
1583 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1584 if test -f $p/cat$_exe; then
1589 if test ! -f $xcat$_exe; then
1590 echo "Can't find cat anywhere!"
1594 echo "#!$xcat" >sharp
1597 ./sharp > today 2>/dev/null
1598 if test -s today; then
1601 echo "#! $xcat" > sharp
1604 ./sharp > today 2>/dev/null
1605 if test -s today; then
1613 echo "Your $sh doesn't grok # comments--I will strip them later on."
1616 echo "exec grep -v '^[ ]*#'" >spitshell
1618 $eunicefix spitshell
1619 spitshell=`pwd`/spitshell
1621 echo "I presume that if # doesn't work, #! won't work either!"
1626 : figure out how to guarantee sh startup
1628 '') startsh=${sharpbang}${sh} ;;
1640 : echo "Yup, it does."
1642 echo "Hmm... '$startsh' does not guarantee sh startup..."
1643 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1647 : Save command line options in file UU/cmdline.opt for later use in
1648 : generating config.sh.
1649 cat > cmdline.opt <<EOSH
1650 : Configure command line arguments.
1659 cat >>cmdline.opt <<EOSH
1660 config_arg$argn='$arg'
1662 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1665 arg_exp=`cat cmdl.opt`
1666 args_exp="$args_exp$args_sep'$arg_exp'"
1667 argn=`expr $argn + 1`
1672 : produce awk script to parse command line options
1673 cat >options.awk <<'EOF'
1675 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1677 len = length(optstr);
1678 for (i = 1; i <= len; i++) {
1679 c = substr(optstr, i, 1);
1680 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1691 if (substr(str, 1, 1) != "-") {
1692 printf("'%s'\n", str);
1696 for (i = 2; i <= len; i++) {
1697 c = substr(str, i, 1);
1699 printf("-%s\n", substr(str, i));
1705 printf("'%s'\n", substr(str, i + 1));
1718 : process the command line options
1719 set X `for arg in "$@"; do echo "X$arg"; done |
1720 sed -e s/X// | awk -f options.awk`
1725 : set up default values
1734 rm -f optdef.sh posthint.sh
1735 cat >optdef.sh <<EOS
1741 while test $# -gt 0; do
1743 -d) shift; fastread=yes;;
1744 -e) shift; alldone=cont;;
1748 if test -r "$1"; then
1751 echo "$me: cannot read config file $1." >&2
1757 -h) shift; error=true;;
1758 -r) shift; reuseval=true;;
1759 -s) shift; silent=true; realsilent=true;;
1760 -E) shift; alldone=exit;;
1761 -K) shift; knowitall=true;;
1763 -S) shift; silent=true; extractsh=true;;
1768 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1769 echo "$me: ignoring -D $1" >&2
1772 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1773 *) echo "$1='define'" >> optdef.sh;;
1780 *=) echo "$1" >> optdef.sh;;
1782 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1783 echo "$me: ignoring -U $1" >&2
1785 *) echo "$1='undef'" >> optdef.sh;;
1796 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1800 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1801 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1807 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1808 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1809 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1810 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1811 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1812 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1818 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1820 echo "$yyy=''" >> posthint.sh ;;
1825 echo "$yyy='$zzz'" >> posthint.sh ;;
1827 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1829 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1834 echo "$yyy=$zzz" >> posthint.sh ;;
1835 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1839 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1842 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1850 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1851 [-U symbol] [-U symbol=] [-A command:symbol...]
1852 -d : use defaults for all answers.
1853 -e : go on without questioning past the production of config.sh.
1854 -f : specify an alternate default configuration file.
1855 -h : print this help message and exit (with an error status).
1856 -r : reuse C symbols value if possible (skips costly nm extraction).
1857 -s : silent mode, only echoes questions and essential information.
1858 -D : define symbol to have some value:
1859 -D symbol symbol gets the value 'define'
1860 -D symbol='some value' symbol is set to 'some value'
1861 common used examples (see INSTALL for more info):
1862 -Duse64bitint use 64bit integers
1863 -Duse64bitall use 64bit integers and pointers
1864 -Dusethreads use thread support
1865 -Dinc_version_list=none do not include older perl trees in @INC
1866 -DEBUGGING=none DEBUGGING options
1867 -Dcc=gcc choose your compiler
1868 -Dprefix=/opt/perl5 choose your destination
1869 -E : stop at the end of questions, after having produced config.sh.
1870 -K : do not use unless you know what you are doing.
1871 -O : ignored for backward compatibility
1872 -S : perform variable substitutions on all .SH files (can mix with -f)
1873 -U : undefine symbol:
1874 -U symbol symbol gets the value 'undef'
1875 -U symbol= symbol gets completely empty
1877 -A : manipulate symbol after the platform specific hints have been applied:
1878 -A append:symbol=value append value to symbol
1879 -A symbol=value like append:, but with a separating space
1880 -A define:symbol=value define symbol to have value
1881 -A clear:symbol define symbol to be ''
1882 -A define:symbol define symbol to be 'define'
1883 -A eval:symbol=value define symbol to be eval of value
1884 -A prepend:symbol=value prepend value to symbol
1885 -A undef:symbol define symbol to be 'undef'
1886 -A undef:symbol= define symbol to be ''
1887 e.g.: -A prepend:libswanted='cl pthread '
1888 -A ccflags=-DSOME_MACRO
1889 -V : print version number and exit (with a zero status).
1896 case "$fastread$alldone" in
1899 case "$extractsh" in
1902 if test ! -t 0; then
1903 echo "Say 'sh Configure', not 'sh <Configure'"
1913 true) exec 1>/dev/null;;
1916 : run the defines and the undefines, if any, but leave the file out there...
1918 grep '\\' optdef.sh >/dev/null 2>&1
1919 if test $? = 0; then
1920 echo "Configure does not support \\ in -D arguments"
1924 : create the posthint manipulation script and leave the file out there...
1929 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1930 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1931 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1932 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1933 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1936 : Some greps do not return status, grrr.
1937 echo "grimblepritz" >grimble
1938 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1940 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1946 : the following should work in any shell
1950 echo "AGH! Grep doesn't return a status. Attempting remedial action." >&4
1951 cat >contains <<'EOSS'
1952 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1958 : Find the path to the source tree
1961 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1965 *) src=`cd ../$src && pwd` ;;
1978 if test -f $rsrc/Configure && \
1979 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1981 : found it, so we are ok.
1984 for src in . .. ../.. ../../.. ../../../..; do
1985 if test -f ../$src/Configure && \
1986 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1997 Sorry, I can't seem to locate the source dir for $package. Please start
1998 Configure with an explicit path -- i.e. /some/path/Configure.
2006 echo "Sources for $package found in \"$src\"." >&4
2010 : script used to extract .SH files with variable substitutions
2011 cat >extract <<'EOS'
2013 echo "Doing variable substitutions on .SH files..."
2014 if test -f MANIFEST; then
2015 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
2017 echo "(Looking for .SH files under the source directory.)"
2018 set x `(cd "$src"; find . -name "*.SH" -print)`
2022 0) set x `(cd "$src"; echo *.SH)`; shift;;
2024 if test ! -f "$src/$1"; then
2030 while test $name; do
2031 if test ! -d "$name"; then
2032 create="$name $create";
2033 name=`echo $name | sed -e "s|^[^/]*$||"`;
2034 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2039 for file in $create; do
2048 dir=`expr X$file : 'X\(.*\)/'`
2049 file=`expr X$file : 'X.*/\(.*\)'`
2050 (cd "$dir" && . ./$file)
2060 dir=`expr X$file : 'X\(.*\)/'`
2061 file=`expr X$file : 'X.*/\(.*\)'`
2062 (set x $dir; shift; eval $mkdir_p)
2063 sh <"$src/$dir/$file"
2072 if test -f "$src/config_h.SH"; then
2073 if test ! -f config.h; then
2074 : oops, they left it out of MANIFEST, probably, so do it anyway.
2075 . "$src/config_h.SH"
2080 : extract files and exit if asked to do so
2081 case "$extractsh" in
2083 case "$realsilent" in
2087 case "$config_sh" in
2088 '') config_sh='config.sh';;
2091 echo "Fetching answers from $config_sh..."
2098 echo "Extraction done."
2103 : Eunice requires " " instead of "", can you believe it
2106 echo "Beginning of configuration questions for $package."
2108 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2110 : first determine how to suppress newline on echo command
2112 echo "Checking echo to see how to suppress newlines..."
2113 (echo "hi there\c" ; echo " ") >.echotmp
2114 if $contains c .echotmp >/dev/null 2>&1 ; then
2125 echo $n "The star should be here-->$c"
2129 : Now test for existence of everything in MANIFEST
2131 if test -f "$rsrc/MANIFEST"; then
2132 echo "First let's make sure your kit is complete. Checking..." >&4
2133 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2134 (split -l 50 2>/dev/null || split -50)
2137 for filelist in x??; do
2138 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2139 >/dev/null 2>>"$tmppwd/missing")
2141 if test -s missing; then
2145 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2147 You have the option of continuing the configuration process, despite the
2148 distinct possibility that your kit is damaged, by typing 'y'es. If you
2149 do, don't blame me if something goes wrong. I advise you to type 'n'o
2150 and contact the author (https://github.com/Perl/perl5/issues).
2153 echo $n "Continue? [n] $c" >&4
2157 echo "Continuing..." >&4
2161 echo "ABORTING..." >&4
2166 echo "Looks good..."
2169 echo "There is no MANIFEST file. I hope your kit is complete !"
2173 : Find the appropriate value for a newline for tr
2174 if test -n "$DJGPP"; then
2177 if test X"$trnl" = X; then
2178 case "`echo foo | tr '\n' x 2>/dev/null`" in
2182 if test X"$trnl" = X; then
2183 case "`echo foo | tr '\012' x 2>/dev/null`" in
2184 foox) trnl='\012' ;;
2187 if test X"$trnl" = X; then
2188 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2189 fooxy) trnl='\n\r' ;;
2192 if test X"$trnl" = X; then
2195 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2201 : compute the number of columns on the terminal for proper question formatting
2206 : set up the echo used in my read
2207 myecho="case \"\$xxxm\" in
2208 '') echo $n \"\$rp $c\" >&4;;
2210 '') echo $n \"[\$xxxm] $c\";;
2212 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2214 echo $n \"[\$xxxm] $c\" >&4
2216 echo $n \"\$rp [\$xxxm] $c\" >&4
2222 : now set up to do reads with possible shell escape and default assignment
2229 case "\$fastread" in
2230 yes) case "\$dflt" in
2233 case "\$silent-\$rp" in
2238 *) case "\$silent" in
2239 true) case "\$rp" in
2244 while expr "X\$ans" : "X!" >/dev/null; do
2248 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2256 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2265 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2270 echo "(OK, I'll run with -d after this question.)" >&4
2273 echo "*** Sorry, \$1 not supported yet." >&4
2283 echo "*** Substitution done -- please confirm."
2285 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2290 echo "*** Error -- try again."
2297 case "\$ans\$xxxm\$nostick" in
2303 counter=\`echo \$counter | awk '{ print --\$0 }'\`
2304 if [ \$counter = 0 ]; then
2306 echo >&4 Too many attempts asking the same question. Giving up.
2315 : create .config dir to save info across Configure sessions
2316 test -d ../.config || mkdir ../.config
2317 cat >../.config/README <<EOF
2318 This directory created by Configure to save information that should
2319 persist across sessions for $package.
2321 You may safely delete it if you wish.
2324 : See if we are using a devel version and want that
2325 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2328 usedevel="$define" ;;
2329 *) case "$xversion" in
2332 *** WHOA THERE!!! ***
2334 This is an UNSTABLE DEVELOPMENT release.
2335 The version of this $package distribution is $xversion, that is, odd,
2336 (as opposed to even) and that signifies a development release.
2337 If you want a maintenance release, you want an even-numbered version.
2339 Do ***NOT*** install this into production use.
2340 Data corruption and crashes are possible.
2342 It is most seriously suggested that you do not continue any further
2343 unless you want to help in developing and debugging Perl.
2345 If you *still* want to build perl, you can answer 'y' now,
2346 or pass -Dusedevel to Configure.
2349 rp='Do you really want to continue?'
2353 [yY]) echo >&4 "Okay, continuing."
2354 usedevel="$define" ;;
2355 *) echo >&4 "Okay, bye."
2366 case "$versiononly" in
2367 '') versiononly="$define" ;;
2369 case "$installusrbinperl" in
2370 '') installusrbinperl="$undef" ;;
2375 : general instructions
2378 user=`(logname) 2>/dev/null`
2380 '') user=`whoami 2>&1`;;
2382 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2385 rp='Would you like to see the instructions?'
2396 This installation shell script will examine your system and ask you questions
2397 to determine how the perl5 package should be installed. If you get
2398 stuck on a question, you may use a ! shell escape to start a subshell or
2399 execute a command. Many of the questions will have default answers in square
2400 brackets; typing carriage return will give you the default.
2402 On some of the questions which ask for file or directory names you are allowed
2403 to use the ~name construct to specify the login directory belonging to "name",
2404 even if you don't have a shell which knows about that. Questions where this is
2405 allowed will be marked "(~name ok)".
2409 dflt='Type carriage return to continue'
2413 The prompter used in this script allows you to use shell variables and
2414 backticks in your answers. You may use $1, $2, etc... to refer to the words
2415 in the default answer, as if the default line was a set of arguments given to a
2416 script shell. This means you may also use $* to repeat the whole default line,
2417 so you do not have to re-type everything to add something to the default.
2419 Every time there is a substitution, you will have to confirm. If there is an
2420 error (e.g. an unmatched backtick), the default answer will remain unchanged
2421 and you will be prompted again.
2423 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2424 the questions and use the computed defaults (or the previous answers if there
2425 was already a config.sh file). Type 'Configure -h' for a list of options.
2426 You may also start interactively and then answer '& -d' at any prompt to turn
2427 on the non-interactive behaviour for the remainder of the execution.
2433 Much effort has been expended to ensure that this shell script will run on any
2434 Unix system. If despite that it blows up on yours, your best bet is to edit
2435 Configure and run it again. If you can't run Configure for some reason,
2436 you'll have to generate a config.sh file by hand. Whatever problems you
2437 have, let me (https://github.com/Perl/perl5/issues) know how I blew it.
2439 This installation script affects things in two ways:
2441 1) it may do direct variable substitutions on some of the files included
2443 2) it builds a config.h file for inclusion in C programs. You may edit
2444 any of these files as the need arises after running this script.
2446 If you make a mistake on a question, there is no easy way to back up to it
2447 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2448 files. Configure will offer to let you do this before it runs the SH files.
2451 dflt='Type carriage return to continue'
2453 case "$firsttime" in
2454 true) echo $user >>../.config/instruct;;
2458 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2459 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2460 if test "X$sysroot" = X; then
2465 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2466 # _sysroot is used in places where we need --sysroot=foo
2467 # but using the rest of the flags could cause issues.
2468 _sysroot="--sysroot=$sysroot";
2472 ccflags="$ccflags $_sysroot"
2477 ldflags="$ldflags $_sysroot"
2482 cppflags="$cppflags $_sysroot"
2484 # lddlflags updated below in lddlflags section;
2485 # same with cccdlflags
2489 # Adjust some defaults to also use $sysroot
2490 for var in xlibpth loclibpth locincpth glibpth; do
2493 for path in $xxx; do
2494 eval $var=\"\$$var $sysroot$path\"
2500 : find out where common programs are
2502 echo "Locating common programs..." >&4
2515 if test -d \$dir/\$thing; then
2521 for thisthing in \$dir/\$thing; do
2522 : just loop through to pick last item
2524 if test -f \$thisthing; then
2527 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2530 elif test -f \$dir/\$thing.exe; then
2531 if test -n "$DJGPP"; then
2532 echo \$dir/\$thing.exe
2533 elif test "$eunicefix" != ":"; then
2534 : on Eunice apparently
2587 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2588 pth="$pth $sysroot/lib $sysroot/usr/lib"
2589 for file in $loclist; do
2593 if test -f "$xxx"; then
2596 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2597 xxx=`./loc $file $file $pth`
2600 '') xxx=`./loc $file $file $pth`;;
2601 *) xxx=`./loc $xxx $xxx $pth`;;
2603 eval $file=$xxx$_exe
2607 echo $file is in $xxx.
2610 echo $file is in $xxx.
2613 echo "I don't know where '$file' is, and my life depends on it." >&4
2614 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2616 test -f /etc/debian_version && echo "Run \"apt install build-essential\" to install make and friends" >&4
2617 test -f /etc/SUSE-brand && echo "Run \"zypper install 'pattern:devel_C_C++'\" to install make and friends" >&4
2618 test -f /etc/redhat-release && echo "Run \"yum groupinstall 'Development Tools'\" to install make and friends" >&4
2619 test -f /etc/fedora-release && echo "Run \"dnf group install 'Development Tools'\" to install make and friends" >&4
2625 echo "Don't worry if any of the following aren't found..."
2627 for file in $trylist; do
2631 if test -f "$xxx"; then
2634 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2635 xxx=`./loc $file $file $pth`
2638 '') xxx=`./loc $file $file $pth`;;
2639 *) xxx=`./loc $xxx $xxx $pth`;;
2641 eval $file=$xxx$_exe
2645 echo $file is in $xxx.
2648 echo $file is in $xxx.
2651 echo "I don't see $file out there, $say."
2658 echo "Substituting grep for egrep."
2665 *) if $less -R </dev/null >/dev/null 2>&1; then
2666 echo "Substituting less -R for less."
2674 echo "Substituting cp for ln."
2683 echo "I can't find make or gmake, and my life depends on it." >&4
2684 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2692 *) # We can't have osname yet.
2693 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2694 # Assume that gmake, if found, is definitely GNU make
2695 # and prefer it over the system make.
2696 echo "Substituting gmake for make."
2704 echo "Hopefully test is built into your sh."
2707 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2708 echo "Using the test built into your sh."
2716 echo "Hopefully echo is built into your sh."
2721 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2722 $echo $n "hi there$c" >foo1
2723 echo $n "hi there$c" >foo2
2724 if cmp foo1 foo2 >/dev/null 2>&1; then
2725 echo "They are compatible. In fact, they may be identical."
2732 They are not compatible! You are probably running ksh on a non-USG system.
2733 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2734 have echo built in and we may have to run some Bourne shell scripts. That
2735 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2738 $echo $n "The star should be here-->$c"
2745 # This question was auctioned at YAPC::Europe-2007 in Vienna
2746 # I never promised you could answer it. I only auctioned the question.
2748 The following message is sponsored by
2750 Dresden.pm<--The stars should be here.
2752 Dear Perl user, system administrator or package
2753 maintainer, the Perl community sends greetings to
2754 you. Do you (emblematical) greet back [Y/n]? n
2758 : Check what type of C compiler we use
2762 cat <<'EOSC' >>trygcc
2767 int main(int argc, char *argv[]) {
2771 if $cc -o try $ccflags $ldflags try.c; then
2774 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2780 # Skip this test because it gives a false match on output like:
2781 # ./trygcc: line 23: cc: command not found
2782 # case "`$cc -v -c try.c 2>&1`" in
2783 # *gcc*) trygcc=no ;;
2785 if $test X"$trygcc" = Xyes; then
2786 if gcc -o try -c try.c; then
2788 echo "You seem to have a working gcc, though." >&4
2789 # Switching compilers may undo the work of hints files.
2790 # The most common problem is -D_REENTRANT for threads.
2791 # This heuristic catches that case, but gets false positives
2792 # if -Dusethreads was not actually specified. Better to
2793 # bail out here with a useful message than fail
2794 # mysteriously later. Should we perhaps just try to
2795 # re-invoke Configure -Dcc=gcc config_args ?
2796 if $test -f usethreads.cbu; then
2799 *** However, any setting of the C compiler flags (e.g. for thread support)
2800 *** will be lost. It may be necessary for you to restart Configure and
2801 *** add -Dcc=gcc to your Configure command line.
2804 rp="Would you like to go ahead and try gcc anyway?"
2807 rp="Would you like to use it?"
2810 if $test -f myread; then
2813 if $test -f UU/myread; then
2816 echo "Cannot find myread, sorry. Aborting." >&4
2821 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2834 cat <<'EOSC' >>checkcc
2839 int main(int argc, char *argv[]) {
2843 if $cc -o try $ccflags $ldflags try.c; then
2846 if $test X"$despair" = Xyes; then
2847 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2850 You need to find a working C compiler.
2851 Either (purchase and) install the C compiler supplied by your OS vendor,
2852 or for a free C compiler try http://gcc.gnu.org/
2853 I cannot continue any further, aborting.
2862 : determine whether symbolic links are supported
2865 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2866 echo "Symbolic links are supported." >&4
2869 echo "Symbolic links are NOT supported." >&4
2874 : determine whether symbolic links are supported
2878 echo "Checking how to test for symbolic links..." >&4
2880 if $test "X$issymlink" = X; then
2882 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2883 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2885 if test $? = 0; then
2888 echo "Your builtin 'test -h' may be broken." >&4
2891 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2894 if test -f "$p/$test"; then
2903 echo "Trying external '$test -h'." >&4
2904 issymlink="$test -h"
2905 if $test ! -h sym >/dev/null 2>&1; then
2906 echo "External '$test -h' is broken, too." >&4
2914 if $test "X$issymlink" = X; then
2915 if $test -L sym 2>/dev/null; then
2916 issymlink="$test -L"
2917 echo "The builtin '$test -L' worked." >&4
2920 if $test "X$issymlink" != X; then
2921 echo "You can test for symbolic links with '$issymlink'." >&4
2923 echo "I do not know how you can test for symbolic links." >&4
2927 *) echo "No symbolic links, so not testing for their testing..." >&4
2931 : Make symlinks util
2932 case "$mksymlinks" in
2935 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2938 *) case "$lns:$issymlink" in
2939 *"ln"*" -s:"*"test -"?)
2940 echo "Creating the symbolic links..." >&4
2942 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2952 print "# dir = ", dir, "file = ", file
2953 mf[dir] = mf[dir]" "source"/"dir"/"file;
2956 if (d != ".") { print("mkdir -p "d) }
2957 print("ln -sf "mf[d]" "d);
2959 }' source="$src" > UU/mksymlinks.$$
2963 if test ! -d t/base; then
2964 echo "Failed to create the subdirectories. Aborting." >&4
2968 if test ! -f t/base/lex.t; then
2969 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2972 if test ! -f win32/win32.c; then
2973 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2978 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2986 : Check for Cross-Compilation
2987 if $test "X$targethost" = "X"; then
2990 if $test "X$targetenv" = "X"; then
2993 case "$usecrosscompile" in
2995 $echo "Cross-compiling..."
2998 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2999 # arm-linux-androideabi-gcc -> arm-linux-androideabi
3000 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
3001 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
3002 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
3003 # leave out ld, choosing it is more complex
3004 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
3005 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
3006 # We are in a weird spot. Just before us, some values
3007 # were 'saved', to be restored after the hints are
3008 # run. This means that the changes we made to ar,
3009 # nm and ranlib will get reverted.
3010 # To avoid that, we hijack the saving mechanism and
3011 # have it save our new values.
3012 for file in ar nm ranlib; do
3014 eval $file=$xxx$_exe
3019 case "$targetarch" in
3020 '') echo "Targetarch not defined." >&4; croak=y ;;
3021 *) echo "Using targetarch $targetarch." >&4 ;;
3023 case "$targethost" in
3024 '') echo "Targethost not defined." >&4; croak=n ;;
3025 *) echo "Using targethost $targethost." >&4
3030 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
3032 : compile a host miniperl and generate_uudmap, unless we got passed them
3033 if $test "X$hostperl" = X; then
3034 echo "Building host miniperl and generate_uudmap binaries" >&4
3042 $src/Configure -des -Dusedevel -Dmksymlinks
3044 case "$hostgenerate" in
3045 '') $make generate_uudmap
3046 hostgenerate=$src/host/generate_uudmap
3048 "$undef") hostgenerate=''
3051 hostperl=$src/host/miniperl
3054 hostosname=`$hostperl -le 'print $^O'`
3057 usecrosscompile="$undef"
3061 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3062 case "$targethost" in
3063 '') echo "Checking for cross-compile" >&4
3064 case "$usecrosscompile$multiarch" in
3065 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3066 if [ -f Makefile ]; then
3068 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3070 echo "Configure done."
3074 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3081 *) echo "Using targethost $targethost." >&4
3083 /*) run=$src/Cross/run
3084 targetmkdir=$src/Cross/mkdir
3086 from=$src/Cross/from
3088 *) pwd=`$test -f ../Configure & cd ..; pwd`
3090 targetmkdir=$pwd/Cross/mkdir
3092 from=$pwd/Cross/from
3095 case "$targetrun" in
3096 '') targetrun=ssh ;;
3101 case "$targetfrom" in
3102 '') targetfrom=scp ;;
3106 from=$from-$targetfrom
3107 case "$targetdir" in
3109 echo "Guessing targetdir $targetdir." >&4
3112 case "$targetuser" in
3114 echo "Guessing targetuser $targetuser." >&4
3117 case "$targetport" in
3119 echo "Guessing targetport $targetport." >&4
3122 case "$targetfrom" in
3126 case "$targetrun" in
3146 '') cwd=$targetdir ;;
3151 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3157 *) echo "Unknown targetrun '$targetrun'" >&4
3161 case "$targetmkdir" in
3163 cat >$targetmkdir <<EOF
3165 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3167 $chmod a+rx $targetmkdir
3169 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3181 $targetmkdir \`dirname \$f\`
3182 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3185 $targetmkdir $targetdir/\`dirname \$f\`
3186 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3199 $mkdir -p $targetdir/\`dirname \$f\`
3200 $cp \$f $targetdir/\$f || exit 1
3203 $targetmkdir $targetdir/\`dirname \$f\`
3204 $cp \$f $targetdir/\$f || exit 1
3211 *) echo "Unknown targetto '$targetto'" >&4
3215 case "$targetfrom" in
3222 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3227 cp) cat >$from <<EOF
3232 cp $targetdir/\$f . || exit 1
3237 *) echo "Unknown targetfrom '$targetfrom'" >&4
3241 if $test ! -f $run; then
3242 echo "Target 'run' script '$run' not found." >&4
3246 if $test ! -f $to; then
3247 echo "Target 'to' script '$to' not found." >&4
3251 if $test ! -f $from; then
3252 echo "Target 'from' script '$from' not found." >&4
3256 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3260 Using '$run' for remote execution,
3261 and '$from' and '$to'
3262 for remote file transfer.
3268 usecrosscompile="$undef"
3273 : see whether [:lower:] and [:upper:] are supported character classes
3275 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3277 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3281 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3282 # (0xd9 and 0xe2), therefore that is a nice testing point.
3283 if test "X$up" = X -o "X$low" = X; then
3284 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3290 if test "X$up" = X -o "X$low" = X; then
3291 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3297 if test "X$up" = X -o "X$low" = X; then
3298 case "`echo RS | od -x 2>/dev/null`" in
3300 echo "Hey, this might be EBCDIC." >&4
3301 if test "X$up" = X -o "X$low" = X; then
3302 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3303 rs) up='[A-IJ-RS-Z]'
3308 if test "X$up" = X -o "X$low" = X; then
3309 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3319 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3321 echo "Using $up and $low to convert case." >&4
3324 echo "I don't know how to translate letters from upper to lower case." >&4
3325 echo "Your tr is not acting any way I know of." >&4
3329 : set up the translation script tr, must be called with ./tr of course
3333 '[A-Z][a-z]') exec $tr '$up' '$low';;
3334 '[a-z][A-Z]') exec $tr '$low' '$up';;
3341 : Try to determine whether config.sh was made on this system
3342 case "$config_sh" in
3344 myuname=`$uname -a 2>/dev/null`
3345 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3346 # Downcase everything to avoid ambiguity.
3347 # Remove slashes and single quotes so we can use parts of this in
3348 # directory and file names.
3349 # Remove newlines so myuname is sane to use elsewhere.
3350 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3351 # because the A-Z/a-z are not consecutive.
3352 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3353 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3354 newmyuname="$myuname"
3356 case "$knowitall" in
3358 if test -f ../config.sh; then
3359 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3360 eval "`grep myuname= ../config.sh`"
3362 if test "X$myuname" = "X$newmyuname"; then
3370 : Get old answers from old config file if Configure was run on the
3371 : same system, otherwise use the hints.
3374 if test -f config.sh; then
3376 rp="I see a config.sh file. Shall I use it to set the defaults?"
3379 n*|N*) echo "OK, I'll ignore it."
3380 mv config.sh config.sh.old
3381 myuname="$newmyuname"
3383 *) echo "Fetching default answers from your old config.sh file..." >&4
3391 : Older versions did not always set $sh. Catch re-use of such
3401 if test ! -f config.sh; then
3404 First time through, eh? I have some defaults handy for some systems
3405 that need some extra help getting the Configure answers right:
3408 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3410 : Half the following guesses are probably wrong... If you have better
3411 : tests or hints, please send them to https://github.com/Perl/perl5/issues
3412 : The metaconfig authors would also appreciate a copy...
3413 $test -f /irix && osname=irix
3414 $test -f /xenix && osname=sco_xenix
3415 $test -f /dynix && osname=dynix
3416 $test -f /dnix && osname=dnix
3417 $test -f /lynx.os && osname=lynxos
3418 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3419 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3420 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3421 $test -f /bin/mips && /bin/mips && osname=mips
3422 $test -d /usr/apollo/bin && osname=apollo
3423 $test -f /etc/saf/_sactab && osname=svr4
3424 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3425 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3426 $test -f /sys/utilities/MultiView && osname=amigaos
3427 if $test -d /MachTen -o -d /MachTen_Folder; then
3429 if $test -x /sbin/version; then
3430 osvers=`/sbin/version | $awk '{print $2}' |
3431 $sed -e 's/[A-Za-z]$//'`
3432 elif $test -x /usr/etc/version; then
3433 osvers=`/usr/etc/version | $awk '{print $2}' |
3434 $sed -e 's/[A-Za-z]$//'`
3440 $test -f /sys/posix.dll &&
3441 $test -f /usr/bin/what &&
3442 set X `/usr/bin/what /sys/posix.dll` &&
3443 $test "$3" = UWIN &&
3447 if $test -f $uname; then
3455 umips) osname=umips ;;
3458 [23]100) osname=mips ;;
3460 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3461 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3464 elif $test -f /etc/kconfig; then
3466 if test "$lns" = "$ln -s"; then
3468 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3470 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3477 if test -n "$DJGPP"; then
3486 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3488 # oslevel can fail with:
3489 # oslevel: Unable to acquire lock.
3490 *not\ found) osvers="$4"."$3" ;;
3491 '<3240'|'<>3240') osvers=3.2.0 ;;
3492 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3493 '=3250'|'>3250') osvers=3.2.5 ;;
3497 bitrig) osname=bitrig
3500 bsd386) osname=bsd386
3503 cygwin*) osname=cygwin
3506 *dc.osx) osname=dcosx
3512 domainos) osname=apollo
3518 dragonfly) osname=dragonfly
3520 [0-9]*) osvers="$3" ;;
3524 dynixptx*) osname=dynixptx
3525 osvers=`echo "$4"|sed 's/^v//'`
3527 freebsd) osname=freebsd
3529 genix) osname=genix ;;
3533 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3546 $test -f /system/lib/libandroid.so && osname=linux-android
3553 netbsd*) osname=netbsd
3556 news-os) osvers="$3"
3558 4*) osname=newsos4 ;;
3562 nonstop-ux) osname=nonstopux ;;
3563 openbsd) osname=openbsd
3569 POSIX-BC | posix-bc ) osname=posix-bc
3572 powerux | power_ux | powermax_os | powermaxos | \
3573 powerunix | power_unix) osname=powerux
3579 solaris) osname=solaris
3581 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3588 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3592 titanos) osname=titanos
3601 ultrix) osname=ultrix
3604 osf1|mls+) case "$5" in
3607 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3610 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3613 hp*) osname=hp_osf1 ;;
3614 mips) osname=mips_osf1 ;;
3617 # UnixWare 7.1.2 is known as Open UNIX 8
3618 openunix|unixware) osname=svr5
3626 $2) case "$osname" in
3630 : svr4.x or possibly later
3640 if test -f /stand/boot ; then
3641 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3642 if test -n "$INITPROG" -a -f "$INITPROG"; then
3643 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3644 if test -n "$isesix"; then
3652 *) if test -f /etc/systemid; then
3654 set `echo $3 | $sed 's/\./ /g'` $4
3655 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3657 elif $test -f $src/hints/sco_$1_$2.sh; then
3659 elif $test -f $src/hints/sco_$1.sh; then
3664 '') : Still unknown. Probably a generic Sys V.
3673 *) case "$osname" in
3674 '') : Still unknown. Probably a generic BSD.
3682 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3683 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3684 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3687 $rm -f UU/kernel.what
3688 elif test -d c:/. -o -n "$is_os2" ; then
3695 case "$targetarch" in
3698 case "$targetarch" in
3700 # Will load qnx.sh, which should change osname to nto
3705 # Catch arm-linux-androideabi, mipsel-linux-android,
3706 # and i686-linux-android
3707 osname=linux-android
3711 # Something like arm-linux-gnueabihf is really just
3718 # XXX perhaps we should just assume
3719 # osvers to be 2, or maybe take the value
3720 # from targetarch. Using $run before the
3721 # hints are run is somewhat icky.
3722 set X `$run $uname -a 2>/dev/null`
3725 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3730 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3737 : Now look for a hint file osname_osvers, unless one has been
3738 : specified already.
3741 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3742 : Also try without trailing minor version numbers.
3743 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3744 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3745 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3746 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3749 *) case "$osvers" in
3752 *) if $test -f $src/hints/$file.sh ; then
3754 elif $test -f $src/hints/$xfile.sh ; then
3756 elif $test -f $src/hints/$xxfile.sh ; then
3758 elif $test -f $src/hints/$xxxfile.sh ; then
3760 elif $test -f $src/hints/$xxxxfile.sh ; then
3762 elif $test -f "$src/hints/${osname}.sh" ; then
3771 if $test -f Policy.sh ; then
3774 none) dflt="Policy" ;;
3775 *) dflt="Policy $dflt" ;;
3780 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3784 if $test -f Policy.sh ; then
3787 There's also a Policy hint file available, which should make the
3788 site-specific (policy) questions easier to answer.
3795 You may give one or more space-separated answers, or "none" if appropriate.
3796 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3797 previous run of Configure, you may specify it as well as or instead of
3798 OS-specific hints. If hints are provided for your OS, you should use them:
3799 although Perl can probably be built without hints on many platforms, using
3800 hints often improve performance and may enable features that Configure can't
3801 set up on its own. If there are no hints that match your OS, specify "none";
3802 DO NOT give a wrong version or a wrong OS.
3806 rp="Which of these apply, if any?"
3809 for file in $tans; do
3810 if $test X$file = XPolicy -a -f Policy.sh; then
3812 $cat Policy.sh >> UU/config.sh
3813 elif $test -f $src/hints/$file.sh; then
3814 . $src/hints/$file.sh
3815 $cat $src/hints/$file.sh >> UU/config.sh
3816 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3819 : Give one chance to correct a possible typo.
3820 echo "$file.sh does not exist"
3822 rp="hint to use instead?"
3824 for file in $ans; do
3825 if $test -f "$src/hints/$file.sh"; then
3826 . $src/hints/$file.sh
3827 $cat $src/hints/$file.sh >> UU/config.sh
3828 elif $test X$ans = X -o X$ans = Xnone ; then
3831 echo "$file.sh does not exist -- ignored."
3838 : Remember our hint file for later.
3839 if $test -f "$src/hints/$file.sh" ; then
3849 echo "Fetching default answers from $config_sh..." >&4
3853 cp $config_sh config.sh 2>/dev/null
3865 : Restore computed paths
3866 for file in $loclist $trylist; do
3867 eval $file="\$_$file"
3872 Configure uses the operating system name and version to set some defaults.
3873 The default value is probably right if the name rings a bell. Otherwise,
3874 since spelling matters for me, either accept the default or answer "none"
3881 ''|' '|none) dflt=none ;;
3882 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3885 *) dflt="$osname" ;;
3887 rp="Operating system name?"
3891 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3897 ''|' '|none) dflt=none ;;
3898 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3899 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3901 ''|' ') dflt=none ;;
3906 *) dflt="$osvers" ;;
3908 rp="Operating system version?"
3918 : who configured the system
3919 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3922 cf_by=`(logname) 2>/dev/null`
3925 cf_by=`(whoami) 2>/dev/null`
3927 "") cf_by=unknown ;;
3932 : decide how portable to be. Allow command line overrides.
3933 case "$d_portable" in
3935 *) d_portable="$define" ;;
3938 : set up shell script to do ~ expansion
3944 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3947 if $test -f /bin/csh; then
3948 /bin/csh -f -c "glob \$1"
3953 name=\`$expr x\$1 : '..\([^/]*\)'\`
3954 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3955 if $test ! -d "\$dir"; then
3957 echo "\$me: can't locate home directory for: \$name" >&2
3962 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3978 : now set up to get a file name
3982 cat <<'EOSC' >>getfile
3998 : getfile will accept an answer from the comma-separated list
3999 : enclosed in parentheses even if it does not meet other criteria.
4000 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4001 fn=`echo $fn | sed 's/(.*)//'`
4007 loc_file=`expr $fn : '.*:\(.*\)'`
4008 fn=`expr $fn : '\(.*\):.*'`
4016 */*) fullpath=true;;
4025 *e*) exp_file=true;;
4028 *p*) nopath_ok=true;;
4033 *d*) type='Directory';;
4034 *l*) type='Locate';;
4039 Locate) what='File';;
4044 case "$d_portable" in
4052 while test "$type"; do
4057 true) rp="$rp (~name ok)";;
4060 if test -f UU/getfile.ok && \
4061 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4080 value=`UU/filexp $ans`
4083 if test "$ans" != "$value"; then
4084 echo "(That expands to $value on this system.)"
4098 /*) value="$ansexp" ;;
4099 [a-zA-Z]:/*) value="$ansexp" ;;
4104 echo "I shall only accept a full path name, as in /bin/ls." >&4
4105 echo "Use a ! shell escape if you wish to check pathnames." >&4
4108 echo "Please give a full path name, starting with slash." >&4
4111 echo "Note that using ~name is ok provided it expands well." >&4
4124 for fp in $gfpth; do
4125 if test "X$fp" = X.; then
4130 if test -f "$pf"; then
4132 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4134 echo "($value is not a plain file, but that's ok.)"
4137 if test X"$type" = X; then
4144 for fp in $gfpth; do
4145 if test "X$fp" = X.; then
4150 direxp="$fp/$ansexp"
4152 if test -d "$direxp"; then
4160 if test -d "$ansexp"; then
4161 echo "(Looking for $loc_file in directory $value.)"
4162 value="$value/$loc_file"
4163 ansexp="$ansexp/$loc_file"
4165 if test -f "$ansexp"; then
4168 case "$nopath_ok" in
4169 true) case "$value" in
4171 *) echo "Assuming $value will be in people's path."
4187 if test "$fastread" = yes; then
4192 rp="$what $value doesn't exist. Use that name anyway?"
4211 test "X$gfpthkeep" != Xy && gfpth=""
4214 : determine root of directory hierarchy where package will be installed.
4216 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4223 By default, $package will be installed in $dflt/bin, manual pages
4224 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4225 installation directories. Typically this is something like /usr/local.
4226 If you wish to have binaries under /usr/bin but other parts of the
4227 installation under /usr/local, that's ok: you will be prompted
4228 separately for each of the installation directories, the prefix being
4229 only used to set the defaults.
4233 rp='Installation prefix to use?'
4240 *) oldprefix="$prefix";;
4246 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4252 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4254 *) prefixexp="$ansexp"
4257 : allow them to override the AFS root
4260 *) afsroot=$afsroot ;;
4266 $define|true) afs=true ;;
4267 $undef|false) afs=false ;;
4268 *) if $test -d $afsroot; then
4276 echo "AFS may be running... I'll be extra cautious then..." >&4
4278 echo "AFS does not seem to be running..." >&4
4281 : determine installation prefix for where package is to be installed.
4285 Since you are running AFS, I need to distinguish the directory in which
4286 files will reside from the directory in which they are installed (and from
4287 which they are presumably copied to the former directory by occult means).
4290 case "$installprefix" in
4291 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4292 *) dflt="$installprefix";;
4297 In some special cases, particularly when building $package for distribution,
4298 it is convenient to distinguish the directory in which files should be
4299 installed from the directory ($prefix) in which they will
4300 eventually reside. For most users, these two directories are the same.
4303 case "$installprefix" in
4305 *) dflt=$installprefix;;
4309 rp='What installation prefix should I use for installing files?'
4311 installprefix="$ans"
4312 installprefixexp="$ansexp"
4314 : Perform the prefixexp/installprefixexp correction if necessary
4315 cat <<EOS >installprefix
4318 cat <<'EOSC' >>installprefix
4319 : Change installation prefix, if necessary.
4320 if $test X"$prefix" != X"$installprefix"; then
4321 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4323 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4326 chmod +x installprefix
4327 $eunicefix installprefix
4329 : Set variables such as privlib and privlibexp from the output of ./getfile
4330 : performing the prefixexp/installprefixexp correction if necessary.
4331 cat <<EOS >setprefixvar
4334 cat <<'EOSC' >>setprefixvar
4335 eval "${prefixvar}=\"\$ans\""
4336 eval "${prefixvar}exp=\"\$ansexp\""
4339 chmod +x setprefixvar
4340 $eunicefix setprefixvar
4342 : set up the script used to warn in case of inconsistency
4351 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4353 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4354 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4359 echo "*** WHOA THERE!!! ***" >&4
4360 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4363 rp=" Keep the $hint value?"
4366 y) td=$was; tu=$was;;
4370 : function used to set '$1' to '$val'
4371 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4373 $define$undef) . ./whoa; eval "$var=\$td";;
4374 $undef$define) . ./whoa; eval "$var=\$tu";;
4375 *) eval "$var=$val";;
4378 : Do we want threads support and if so, what type
4379 case "$usethreads" in
4380 $define|true|[yY]*) dflt='y';;
4381 *) # Catch case where user specified ithreads but
4382 # forgot -Dusethreads (A.D. 4/2002)
4383 case "$useithreads" in
4384 *$define*) dflt='y';;
4391 Perl can be built to offer a form of threading support on some systems
4392 To do so, Configure can be run with -Dusethreads.
4394 Note that Perl built with threading support runs slightly slower
4395 and uses slightly more memory than plain Perl.
4397 If this doesn't make any sense to you, just accept the default '$dflt'.
4399 rp='Build a threading Perl?'
4402 y|Y) val="$define" ;;
4408 useithreads="$usethreads"
4410 case "$d_oldpthreads" in
4411 '') : Configure tests would be welcome here. For now, assume undef.
4413 *) val="$d_oldpthreads" ;;
4419 : Look for a hint-file generated 'call-back-unit'. If the
4420 : user has specified that a threading perl is to be built,
4421 : we may need to set or change some other defaults.
4422 if $test -f usethreads.cbu; then
4423 echo "Your platform has some specific hints regarding threaded builds, using them..."
4426 case "$usethreads" in
4427 "$define"|true|[yY]*)
4429 (Your platform does not have any specific hints for threaded builds.
4430 Assuming POSIX threads, then.)
4436 : Check if multiplicity is required
4439 Perl can be built so that multiple Perl interpreters can coexist
4440 within the same Perl executable.
4443 case "$useithreads" in
4446 This multiple interpreter support is required for interpreter-based threads.
4450 *) case "$usemultiplicity" in
4451 $define|true|[yY]*) dflt='y';;
4455 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4456 rp='Build Perl for multiplicity?'
4459 y|Y) val="$define" ;;
4467 : Check if morebits is requested
4468 case "$usemorebits" in
4469 "$define"|true|[yY]*)
4470 use64bitint="$define"
4471 uselongdouble="$define"
4472 usemorebits="$define"
4474 *) usemorebits="$undef"
4478 : Determine the C compiler to be used
4484 rp="Use which C compiler?"
4488 : See whether they have no cc but they do have gcc
4490 if $test -f cc.cbu; then
4495 : make some quick guesses about what we are up against
4497 $echo $n "Hmm... $c"
4507 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4508 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4510 echo "Looks kind of like an OSF/1 system, but we'll see..."
4512 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4513 xxx=`./loc addbib blurfl $pth`
4514 if $test -f $xxx; then
4515 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4519 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4520 echo "Looks kind of like an extended USG system, but we'll see..."
4522 echo "Looks kind of like a USG system, but we'll see..."
4526 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4527 echo "Looks kind of like a BSD system, but we'll see..."
4531 echo "Looks kind of like a Version 7 system, but we'll see..."
4534 case "$eunicefix" in
4537 There is, however, a strange, musty smell in the air that reminds me of
4538 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4542 : it so happens the Eunice I know will not run shell scripts in Unix format
4546 echo "Congratulations. You aren't running Eunice."
4550 : Detect OS2. The p_ variable is set above in the Head.U unit.
4551 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4552 : semicolon as a patch separator
4557 I have the feeling something is not exactly right, however...don't tell me...
4558 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4559 (Or you may be running DOS with DJGPP.)
4564 if test -f /xenix; then
4565 echo "Actually, this looks more like a XENIX system..."
4570 echo "It's not Xenix..."
4575 if test -f /venix; then
4576 echo "Actually, this looks more like a VENIX system..."
4583 echo "Nor is it Venix..."
4586 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4587 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4590 : Check if we are using GNU gcc and what its version is
4592 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4596 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4598 printf("%s\n", __VERSION__);
4600 printf("%s\n", "1");
4606 if $cc -o try $ccflags $ldflags try.c; then
4607 gccversion=`$run ./try`
4608 case "$gccversion" in
4609 '') echo "You are not using GNU cc." ;;
4610 *) echo "You are using GNU cc $gccversion."
4616 echo "*** WHOA THERE!!! ***" >&4
4617 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4618 case "$knowitall" in
4620 echo " You'd better start hunting for one and let me know about it." >&4
4626 case "$gccversion" in
4627 1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4629 case "$gccversion" in
4630 '') gccosandvers='' ;;
4631 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4632 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4634 case "$gccosandvers" in
4635 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4636 $osname$osvers) ;; # looking good
4637 $osname*) cat <<EOM >&4
4639 *** WHOA THERE!!! ***
4641 Your gcc has not been compiled for the exact release of
4642 your operating system ($gccosandvers versus $osname$osvers).
4644 In general it is a good idea to keep gcc synchronized with
4645 the operating system because otherwise serious problems
4646 may ensue when trying to compile software, like Perl.
4648 I'm trying to be optimistic here, though, and will continue.
4649 If later during the configuration and build icky compilation
4650 problems appear (headerfile conflicts being the most common
4651 manifestation), I suggest reinstalling the gcc to match
4652 your operating system release.
4656 *) gccosandvers='' ;; # failed to parse, better be silent
4664 # gcc 3.* complain about adding -Idirectories that they already know about,
4665 # so we will take those off from locincpth.
4666 case "$gccversion" in
4668 echo "int main(){}">try.c
4669 for incdir in $locincpth; do
4670 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4671 grep '^c[cp]p*[01]: warning: changing search order '`
4672 if test "X$warn" != X; then
4673 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4679 # gcc 4.9 by default does some optimizations that break perl.
4680 # see ticket 121505.
4682 # The -fwrapv disables those optimizations (and probably others,) so
4683 # for gcc 4.9 (and later, since the optimizations probably won't go
4684 # away), add -fwrapv unless the user requests -fno-wrapv, which
4685 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4686 # which turns the overflows -fwrapv ignores into runtime errors.
4687 case "$gccversion" in
4688 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4690 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4691 *) ccflags="$ccflags -fwrapv" ;;
4695 # Really old versions of gcc default to C89 and will error for this code.
4696 # See if the compiler (gcc or otherwise) needs a flag to compile C99 code
4697 # Initialisations in for loops seem to be the particular problem
4698 # (Does this syntax conflict with something else that was valid C89?)
4699 # We also add a declaration after a statement to detect whether the compiler
4700 # (or the user supplied -Accflags) consider such declarations to be errors.
4701 # This causes 'Configure with -Accflags="-Werror=declaration-after-statement"'
4702 # to fail hard and early.
4704 # Annoyingly -std=c99 will cause gcc to tell glibc not to define prototypes for
4705 # syscall, drand48 etc when including <unistd.h>, which messes up our build.
4706 # I guess we *could* loop round trying -std=c99 first with checks both for the
4707 # prototype found and the code compiling (because -std=gnu99 might do other
4708 # things we don't want, particularly on non-GCC compilers) but
4709 # 1) We would need to check for the prototype first (without any flags)
4710 # 2) We would still end up with most Linux systems either being -std=gnu99
4711 # or "" (no flag), and so both common options would not rigorously check our
4712 # portability to other platforms.
4713 # So it doesn't seem worth the complexity and chance of different failure.
4714 $cat >try.c <<'EOCP'
4715 int main(int argc, char **argv) {
4717 /* This is deliberately a declaration after a statement. */
4718 unsigned long long count = 0;
4719 for (char **p = argv; *p; ++p) {
4722 return count == 1 ? 0 : argc;
4726 for flag in '' '-std=gnu99' '-std=c99'; do
4727 if $cc -o try $flag $ccflags $ldflags try.c 2>/dev/null && ./try; then
4733 '') echo "Your C compiler doesn't need any special flags to compile C99 code"
4735 no) echo >&4 "Your C compiler doesn't seem to be able to compile C99 code"
4736 rp='Do you really want to continue?'
4740 [yY]) echo >&4 "Okay, continuing." ;;
4744 *) echo "Your C compiler needs $c99_for to compile C99 code"
4745 ccflags="$c99_for $ccflags"
4750 : What should the include directory be ?
4751 : Use sysroot if set, so findhdr looks in the right place.
4753 $echo $n "Hmm... $c"
4754 dflt="$sysroot/usr/include"
4757 if $test -f /bin/mips && /bin/mips; then
4758 echo "Looks like a MIPS system..."
4759 $cat >usr.c <<'EOCP'
4760 #ifdef SYSTYPE_BSD43
4764 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4765 dflt='/bsd43/usr/include'
4769 mips_type='System V'
4771 $rm -f usr.c usr.out
4772 echo "and you're compiling with the $mips_type compiler and libraries."
4776 echo "Doesn't look like a MIPS system."
4786 case "$xxx_prompt" in
4789 rp='Where are the include files you want to use?'
4797 : see how we invoke the C preprocessor
4799 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4800 cat <<'EOT' >testcpp.c
4806 if test ! -f cppstdin; then
4807 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4808 # AIX cc -E doesn't show the absolute headerfile
4809 # locations but we'll cheat by using the -M flag.
4810 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
4812 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4815 echo "Keeping your $hint cppstdin wrapper."
4818 wrapper=`pwd`/cppstdin
4822 if $test "X$cppstdin" != "X" && \
4823 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4824 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4826 echo "You used to use $cppstdin $cppminus so we'll use that again."
4828 '') echo "But let's see if we can live without a wrapper..." ;;
4830 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4831 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4833 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4836 echo "(However, $cpprun $cpplast does not work, let's see...)"
4844 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4851 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4852 $cc -E <testcpp.c >testcpp.out 2>&1; \
4853 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4854 echo "Yup, it does."
4855 x_cpp="$cc $cppflags -E"
4857 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4858 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4859 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4860 echo "Yup, it does."
4861 x_cpp="$cc $cppflags -E"
4863 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4864 $cc -P <testcpp.c >testcpp.out 2>&1; \
4865 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4866 echo "Yipee, that works!"
4867 x_cpp="$cc $cppflags -P"
4869 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4870 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4871 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4872 echo "At long last!"
4873 x_cpp="$cc $cppflags -P"
4875 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4876 $cpp <testcpp.c >testcpp.out 2>&1; \
4877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 x_cpp="$cpp $cppflags"
4881 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4882 $cpp - <testcpp.c >testcpp.out 2>&1; \
4883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4884 echo "Hooray, it works! I was beginning to wonder."
4885 x_cpp="$cpp $cppflags"
4887 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4888 $wrapper <testcpp.c >testcpp.out 2>&1; \
4889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4895 rp="No dice. I can't find a C preprocessor. Name one:"
4899 $x_cpp <testcpp.c >testcpp.out 2>&1
4900 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4901 echo "OK, that will do." >&4
4903 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4918 echo "Perhaps can we force $cc -E using a wrapper..."
4919 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4920 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4926 echo "Nope, we'll have to live without it..."
4940 "$wrapper"|'cppstdin') ;;
4941 *) $rm -f $wrapper;;
4943 $rm -f testcpp.c testcpp.out
4945 : Adjust cppfilter for path component separator
4947 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4948 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4952 : Use gcc to determine libpth and incpth
4953 # If using gcc or clang, we can get better values for libpth, incpth
4954 # and usrinc directly from the compiler.
4955 # Note that ccname for clang is also gcc.
4958 realpath=`which realpath 2>/dev/null | sed 's/no realpath in.*//'`
4959 $echo 'extern int foo;' > try.c
4960 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4963 if $test $# -gt 0; then
4966 */realpath) i=`$realpath $i` ;;
4969 j="`$echo $i | $sed 's,/include[^/]*,/lib,'`"
4970 if $test -d $j; then
4971 inclibpth="$inclibpth $j"
4974 incpth="`$echo $incpth | $sed 's/^ //'`"
4975 for xxx in $inclibpth $loclibpth $plibpth $glibpth; do
4976 if $test -d $xxx; then
4978 */realpath) xxx=`$realpath $xxx` ;;
4982 *) libpth="$libpth $xxx";;
4986 libpth="`$echo $libpth | $sed 's/^ //'`"
4990 '') for i in $incpth; do
4991 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4999 case "$usecrosscompile" in
5002 '') echo "Incpth not defined." >&4; croak=y ;;
5003 *) echo "Using incpth '$incpth'." >&4 ;;
5006 '') echo "Libpth not defined." >&4; croak=y ;;
5007 *) echo "Using libpth '$libpth'." >&4 ;;
5010 '') echo "Usrinc not defined." >&4; croak=y ;;
5011 *) echo "Using usrinc $usrinc." >&4 ;;
5015 if test "X$sysroot" = X; then
5016 echo "Cannot continue, aborting." >&4; exit 1
5018 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5027 : Default value for incpth is just usrinc
5029 '') incpth="$usrinc";;
5032 : Set private lib path
5035 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5040 '') dlist="$loclibpth $plibpth $glibpth";;
5041 *) dlist="$libpth";;
5044 : Now check and see which directories actually exist, avoiding duplicates
5047 if $test -d $xxx; then
5050 *) libpth="$libpth $xxx";;
5056 Some systems have incompatible or broken versions of libraries. Among
5057 the directories listed in the question below, please remove any you
5058 know not to be holding relevant libraries, and add any that are needed.
5059 Say "none" for none.
5063 if test "X$sysroot" != X; then
5065 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5078 rp="Directories to use for library searches?"
5085 : compute shared library extension
5088 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5098 On some systems, shared libraries may be available. Answer 'none' if
5099 you want to suppress searching of shared libraries for the remainder
5100 of this configuration.
5103 rp='What is the file extension used for shared libraries?'
5107 : Does target system insist that shared library basenames are unique
5110 Some dynamic loaders assume that the *basename* of shared library filenames
5111 are globally unique. We'll default this to undef as we assume your system
5112 is not this weird. Set to defined if you're on one of them.
5117 rp='Make shared library basenames unique?'
5120 y|Y) val="$define" ;;
5123 set d_libname_unique
5126 : Define several unixisms.
5127 : Hints files or command line option can be used to override them.
5128 : The convoluted testing is in case hints files set either the old
5131 '') case "$exe_ext" in
5133 *) _exe="$exe_ext" ;;
5138 '') case "$lib_ext" in
5145 '') case "$obj_ext" in
5152 '') case "$path_sep" in
5163 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5165 : Which makefile gets called first. This is used by make depend.
5166 case "$firstmakefile" in
5167 '') firstmakefile='makefile';;
5170 : Check is we will use socks
5172 $define|true|[yY]*) dflt='y';;
5177 Perl can be built to use the SOCKS proxy protocol library. To do so,
5178 Configure must be run with -Dusesocks. If you use SOCKS you also need
5179 to use the PerlIO abstraction layer, this will be implicitly selected.
5181 If this doesn't make any sense to you, just accept the default '$dflt'.
5183 rp='Build Perl for SOCKS?'
5186 y|Y) val="$define" ;;
5192 : Check for uselongdouble support
5194 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5197 case "$uselongdouble" in
5198 $define|true|[yY]*) dflt='y';;
5203 Perl can be built to take advantage of long doubles which
5204 (if available) may give more accuracy and range for floating point numbers.
5206 If this doesn't make any sense to you, just accept the default '$dflt'.
5208 rp='Try to use long doubles if available?'
5211 y|Y) val="$define" ;;
5217 case "$uselongdouble" in
5218 true|[yY]*) uselongdouble="$define" ;;
5221 : Look for a hint-file generated 'call-back-unit'. If the
5222 : user has specified that long doubles should be used,
5223 : we may need to set or change some other defaults.
5224 if $test -f uselongdouble.cbu; then
5225 echo "Your platform has some specific hints regarding long doubles, using them..."
5226 . ./uselongdouble.cbu
5228 case "$uselongdouble" in
5231 (Your platform does not have any specific hints for long doubles.)
5237 : Looking for optional libraries
5239 echo "Checking for optional libraries..." >&4
5244 case "$libswanted" in
5245 '') libswanted='c_s';;
5248 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5250 case "$usecbacktrace" in
5251 "$define") libswanted="$libswanted bfd" ;;
5257 for thisdir in $libpth $xlibpth; do
5258 test -d $thisdir && libspath="$libspath $thisdir"
5260 for thislib in $libswanted; do
5261 for thisdir in $libspath; do
5263 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5264 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5265 $test -f "$xxx" && eval $libscheck
5266 $test -f "$xxx" && libstyle=shared
5267 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5268 $test -f "$xxx" && eval $libscheck
5269 $test -f "$xxx" && libstyle=shared
5271 if test ! -f "$xxx"; then
5272 xxx=$thisdir/lib$thislib.$so$_a
5273 $test -f "$xxx" && eval $libscheck
5274 $test -f "$xxx" && libstyle="import"
5276 if test ! -f "$xxx"; then
5277 xxx=$thisdir/$thislib.$so$_a
5278 $test -f "$xxx" && eval $libscheck
5279 $test -f "$xxx" && libstyle="import"
5281 if test ! -f "$xxx"; then
5282 xxx=$thisdir/lib$thislib.$so
5283 $test -f "$xxx" && eval $libscheck
5284 $test -f "$xxx" && libstyle=shared
5286 if test ! -f "$xxx"; then
5287 xxx=$thisdir/lib$thislib$_a
5288 $test -f "$xxx" && eval $libscheck
5289 $test -f "$xxx" && libstyle=static
5291 if test ! -f "$xxx"; then
5292 xxx=$thisdir/$thislib$_a
5293 $test -f "$xxx" && eval $libscheck
5294 $test -f "$xxx" && libstyle=static
5296 if test ! -f "$xxx"; then
5297 xxx=$thisdir/lib${thislib}_s$_a
5298 $test -f "$xxx" && eval $libscheck
5299 $test -f "$xxx" && libstyle=static
5300 $test -f "$xxx" && thislib=${thislib}_s
5302 if test ! -f "$xxx"; then
5303 xxx=$thisdir/Slib$thislib$_a
5304 $test -f "$xxx" && eval $libscheck
5305 $test -f "$xxx" && libstyle=static
5307 if $test -f "$xxx"; then
5309 shared) echo "Found -l$thislib (shared)." ;;
5310 static) echo "Found -l$thislib." ;;
5311 *) echo "Found -l$thislib ($libstyle)." ;;
5315 *) dflt="$dflt -l$thislib"
5316 libsfound="$libsfound $xxx"
5318 libsfiles="$libsfiles $yyy"
5319 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5320 case " $libsdirs " in
5322 *) libsdirs="$libsdirs $yyy" ;;
5329 if $test ! -f "$xxx"; then
5330 echo "No -l$thislib."
5341 ' '|'') dflt='none';;
5346 In order to compile $package on your machine, a number of libraries
5347 are usually needed. Include any other special libraries here as well.
5348 Say "none" for none. The default list is almost always right.
5352 rp="What libraries to use?"
5359 : determine optimization, if desired, or use for debug flag also
5361 ' '|$undef) dflt='none';;
5363 *) dflt="$optimize";;
5367 By default, $package compiles with the -O flag to use the optimizer.
5368 Alternately, you might want to use the symbolic debugger, which uses
5369 the -g flag (on traditional Unix systems). Either flag can be
5370 specified here. To use neither flag, specify the word "none".
5373 rp="What optimizer/debugger flag should be used?"
5377 'none') optimize=" ";;
5380 : Check what DEBUGGING is required from the command line
5381 : -DEBUGGING or -DDEBUGGING or
5382 : -DEBUGGING=both = -g + -DDEBUGGING
5383 : -DEBUGGING=-g or -Doptimize=-g = -g
5384 : -DEBUGGING=none or -UDEBUGGING =
5385 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5388 *) DEBUGGING=$EBUGGING ;;
5391 case "$DEBUGGING" in
5395 *) optimize="$optimize -g" ;;
5399 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5407 case "$DEBUGGING" in
5408 both|$define) dflt='-DDEBUGGING'
5411 : argument order is deliberate, as the flag will start with - which set could
5412 : think is an option
5413 checkccflag='check=$1; flag=$2; callback=$3;
5415 echo "Checking if your compiler accepts $flag" >&4;
5416 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5417 echo "int main(void) { return 0; }" > gcctest.c;
5418 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5419 echo "Yes, it does." >&4;
5420 if $test -s gcctest.out ; then
5421 echo "But your platform does not like it:";
5426 echo "Leaving current flags $ccflags alone." >&4
5428 *) dflt="$dflt $flag";
5434 echo "Nope, it does not, but that is ok." >&4;
5438 : We will not override a previous value, but we might want to
5439 : augment a hint file
5441 default|recommended)
5442 case "$gccversion" in
5443 1.*) dflt="$dflt -fpcc-struct-return" ;;
5445 case "$optimize:$DEBUGGING" in
5446 *-g*:old) dflt="$dflt -DDEBUGGING";;
5448 case "$gccversion" in
5449 2.*) if $test -d /etc/conf/kconfig.d &&
5450 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5452 # Interactive Systems (ISC) POSIX mode.
5457 case "$gccversion" in
5460 ?*) set strict-aliasing -fno-strict-aliasing
5464 # For gcc, adding -pipe speeds up compilations for some, but apparently
5465 # some assemblers can't read from stdin. (It also slows down compilations
5466 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5467 case "$gccversion" in
5473 # on x86_64 (at least) we require an extra library (libssp) in the
5474 # link command line. This library is not named, so I infer that it is
5475 # an implementation detail that may change. Hence the safest approach
5476 # is to add the flag to the flags passed to the compiler at link time,
5477 # as that way the compiler can do the right implementation dependant
5480 *-fno-stack-protector*)
5481 echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1
5483 *) case "$gccversion" in
5484 ?*) set stack-protector-strong -fstack-protector-strong
5487 *-fstack-protector-strong*) ;; # It got added.
5488 *) # Try the plain/older -fstack-protector.
5489 set stack-protector -fstack-protector
5499 case "$mips_type" in
5500 *BSD*|'') inclwanted="$locincpth $usrinc";;
5501 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5503 for thisincl in $inclwanted; do
5504 if $test -d $thisincl; then
5505 if $test x$thisincl != x$usrinc; then
5507 *" -I$thisincl "*);;
5508 *) dflt="$dflt -I$thisincl ";;
5514 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5516 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5524 *) dflt="$dflt -D$2";;
5528 set signal.h LANGUAGE_C; eval $inctest
5532 ccflags="$ccflags -DSOCKS"
5537 default|recommended) dflt="$ccflags $dflt" ;;
5538 *) dflt="$ccflags";;
5547 Your C compiler may want other flags. For this question you should include
5548 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5549 but you should NOT include libraries or ld flags like -lwhatever. If you
5550 want $package to honor its debug switch, you should include -DDEBUGGING here.
5551 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5553 To use no flags, specify the word "none".
5559 rp="Any additional cc flags?"
5566 : the following weeds options from ccflags that are of no interest to cpp
5568 '') cppflags="$ccflags" ;;
5569 *) set X $ccflags; shift
5570 case " $cppflags " in
5571 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5572 *) cppflags="$cppflags $ccflags" ;;
5576 case "$gccversion" in
5577 1.*) cppflags="$cppflags -D__GNUC__"
5579 case "$mips_type" in
5581 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5587 echo "Let me guess what the preprocessor flags are..." >&4
5601 *) ftry="$previous $flag";;
5603 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5604 >cpp1.out 2>/dev/null && \
5605 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5606 >cpp2.out 2>/dev/null && \
5607 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5608 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5610 cppflags="$cppflags $ftry"
5620 *-*) echo "They appear to be: $cppflags";;
5622 $rm -f cpp.c cpp?.out
5626 : flags used in final linking phase
5628 '') if ./venix; then
5634 *-posix*) dflt="$dflt -posix" ;;
5637 *) dflt="$ldflags";;
5639 # See note above about -fstack-protector
5641 *-fstack-protector-strong*)
5643 *-fstack-protector-strong*) ;; # Don't add it again
5644 *) dflt="$dflt -fstack-protector-strong" ;;
5647 *-fstack-protector*)
5649 *-fstack-protector*) ;; # Don't add it again
5650 *) dflt="$dflt -fstack-protector" ;;
5655 : Try to guess additional flags to pick up local libraries.
5656 for thislibdir in $libpth; do
5657 case " $loclibpth " in
5660 *"-L$thislibdir "*) ;;
5661 *) dflt="$dflt -L$thislibdir" ;;
5673 Your C linker may need flags. For this question you should
5674 include -L/whatever and any other flags used by the C linker, but you
5675 should NOT include libraries like -lwhatever.
5677 Make sure you include the appropriate -L/path flags if your C linker
5678 does not normally search all of the directories you specified above,
5681 To use no flags, specify the word "none".
5685 rp="Any additional ld flags (NOT including libraries)?"
5691 rmlist="$rmlist pdp11"
5695 echo "Checking your choice of C compiler and flags for coherency..." >&4
5696 $cat > try.c <<'EOF'
5698 int main() { printf("Ok\n"); return(0); }
5700 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5702 $cat >try.msg <<'EOM'
5703 I've tried to compile and run the following simple program:
5706 $cat try.c >> try.msg
5708 $cat >> try.msg <<EOM
5715 and I got the following output:
5719 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5720 if $sh -c "$run ./try " >>try.msg 2>&1; then
5724 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5727 echo "The program compiled OK, but exited with status $?." >>try.msg
5728 rp="You have a problem. Shall I abort Configure"
5732 echo "I can't compile the test program." >>try.msg
5733 rp="You have a BIG problem. Shall I abort Configure"
5739 case "$knowitall" in
5741 echo "(The supplied flags or libraries might be incorrect.)"
5749 *) echo "Ok. Stopping Configure." >&4
5754 n) echo "OK, that should do.";;
5756 $rm_try gcctest gcctest.out
5758 : define a shorthand compile call
5762 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5763 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4;
5767 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5768 : define a shorthand compile call for compilations that should be ok.
5772 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5774 : stub, used only to satisfy other units
5777 : check for lengths of integral types
5781 echo "Checking to see how big your integers are..." >&4
5791 printf("intsize=%d;\n", (int)sizeof(int));
5792 printf("longsize=%d;\n", (int)sizeof(long));
5793 printf("shortsize=%d;\n", (int)sizeof(short));
5798 if eval $compile_ok && $run ./try > /dev/null; then
5800 echo "Your integers are $intsize bytes long."
5801 echo "Your long integers are $longsize bytes long."
5802 echo "Your short integers are $shortsize bytes long."
5806 Help! I can't compile and run the intsize test program: please enlighten me!
5807 (This is probably a misconfiguration in your system or libraries, and
5808 you really ought to fix it. Still, I'll try anyway.)
5812 rp="What is the size of an integer (in bytes)?"
5816 rp="What is the size of a long integer (in bytes)?"
5820 rp="What is the size of a short integer (in bytes)?"
5828 : check for long long
5830 echo "Checking to see if you have long long..." >&4
5831 echo 'int main() { long long x = 7; return 0; }' > try.c
5833 if eval $compile; then
5835 echo "You have long long."
5838 echo "You do not have long long."
5844 : check for length of long long
5845 case "${d_longlong}${longlongsize}" in
5848 echo "Checking to see how big your long longs are..." >&4
5849 $cat >try.c <<'EOCP'
5853 printf("%d\n", (int)sizeof(long long));
5858 if eval $compile_ok; then
5859 longlongsize=`$run ./try`
5860 echo "Your long longs are $longlongsize bytes long."
5864 echo "(I can't seem to compile the test program. Guessing...)"
5865 rp="What is the size of a long long (in bytes)?"
5869 if $test "X$longsize" = "X$longlongsize"; then
5870 echo "(That isn't any different from an ordinary long.)"
5876 : determine filename position in cpp output
5878 echo "Computing filename position in cpp output for #include directives..." >&4
5880 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5885 vos) testaccess=-e ;;
5888 echo '#include <stdio.h>' > foo.c
5891 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5892 $grep '^[ ]*#.*stdio\.h' | \
5893 while read cline; do
5896 while $test \$# -gt 0; do
5897 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5902 pos=\`expr \$pos + 1\`
5916 *) pos="${fieldn}th";;
5918 echo "Your cpp writes the filename in the $pos field of the line."
5920 : locate header file
5925 for usrincdir in $incpth
5927 if test -f \$usrincdir/\$wanted; then
5928 echo "\$usrincdir/\$wanted"
5932 awkprg='{ print \$$fieldn }'
5933 echo "#include <\$wanted>" > foo\$\$.c
5934 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5935 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5936 while read cline; do
5937 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5939 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5940 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5945 # status = 0: grep returned 0 lines, case statement not executed
5946 # status = 1: headerfile found
5947 # status = 2: while loop executed, no headerfile found
5951 if test \$status -eq 1; then
5958 : define an alternate in-header-list? function
5959 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5960 cont=true; xxf="echo \"<\$1> found.\" >&4";
5961 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5962 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5964 case $# in 4) instead=instead;; *) instead="at last";; esac;
5965 while $test "$cont"; do
5967 var=$2; eval "was=\$$2";
5968 if $test "$xxx" && $test -r "$xxx";
5970 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5973 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5974 set $yyy; shift; shift; yyy=$@;
5975 case $# in 0) cont="";;
5976 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5977 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5978 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5979 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5983 do set $yyy; var=$2; eval "was=\$$2";
5984 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5985 set $yyy; shift; shift; yyy=$@;
5988 : see if inttypes.h is available
5989 : we want a real compile instead of Inhdr because some systems
5990 : have an inttypes.h which includes non-existent headers
5993 #include <inttypes.h>
5995 static int32_t foo32 = 0x12345678;
5999 if eval $compile; then
6000 echo "<inttypes.h> found." >&4
6003 echo "<inttypes.h> NOT found." >&4
6012 echo "Checking to see if you have int64_t..." >&4
6014 #include <sys/types.h>
6015 #$i_inttypes I_INTTYPES
6017 #include <inttypes.h>
6019 int main() { int64_t x = 7; }
6022 if eval $compile; then
6024 echo "You have int64_t."
6027 echo "You do not have int64_t."
6033 : Check if 64bit ints have a quad type
6035 echo "Checking which 64-bit integer type we could use..." >&4
6041 val='"unsigned int"'
6046 *) case "$longsize" in
6050 val='"unsigned long"'
6055 *) case "$d_longlong:$longlongsize" in
6060 val='"unsigned long long"'
6065 *) case "$d_int64_t" in
6084 '') echo "Alas, no 64-bit integer types in sight." >&4
6087 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6092 : Do we want 64bit support
6093 case "$uselonglong" in
6094 "$define"|true|[yY]*)
6097 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6099 use64bitint="$define"
6102 case "$use64bits" in
6103 "$define"|true|[yY]*)
6106 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6108 use64bitint="$define"
6111 case "$use64bitints" in
6112 "$define"|true|[yY]*)
6115 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6117 use64bitint="$define"
6120 case "$use64bitsint" in
6121 "$define"|true|[yY]*)
6124 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6126 use64bitint="$define"
6129 case "$uselonglongs" in
6130 "$define"|true|[yY]*)
6133 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6135 use64bitint="$define"
6138 case "$use64bitsall" in
6139 "$define"|true|[yY]*)
6142 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6144 use64bitall="$define"
6149 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6151 case "$use64bitall" in
6152 "$define"|true|[yY]*) use64bitint="$define" ;;
6158 You have natively 64-bit long integers.
6162 *) case "$use64bitint" in
6163 "$define"|true|[yY]*) dflt='y';;
6172 Perl can be built to take advantage of 64-bit integer types
6173 on some systems. To do so, Configure can be run with -Duse64bitint.
6174 Choosing this option will most probably introduce binary incompatibilities.
6176 If this doesn't make any sense to you, just accept the default '$dflt'.
6177 (The default has been chosen based on your configuration.)
6179 rp='Try to use 64-bit integers, if available?'
6182 [yY]*) val="$define" ;;
6190 case "$use64bitall" in
6191 "$define"|true|[yY]*) dflt='y' ;;
6192 *) case "$longsize" in
6200 You may also choose to try maximal 64-bitness. It means using as much
6201 64-bitness as possible on the platform. This in turn means even more
6202 binary incompatibilities. On the other hand, your platform may not
6203 have any more 64-bitness available than what you already have chosen.
6205 If this doesn't make any sense to you, just accept the default '$dflt'.
6206 (The default has been chosen based on your configuration.)
6208 rp='Try to use maximal 64-bit support, if available?'
6211 [yY]*) val="$define" ;;
6216 case "$use64bitall" in
6218 case "$use64bitint" in
6222 Since you have chosen a maximally 64-bit build, I'm also turning on
6223 the use of 64-bit integers.
6225 use64bitint="$define" ;;
6230 : Look for a hint-file generated 'call-back-unit'. If the
6231 : user has specified that a 64-bit perl is to be built,
6232 : we may need to set or change some other defaults.
6233 if $test -f use64bitint.cbu; then
6234 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6237 case "$use64bitint" in
6238 "$define"|true|[yY]*)
6239 : This test was common to all the OpenBSD forks, and seems harmless for
6242 echo "Checking if your C library has broken 64-bit functions..." >&4
6245 typedef $uquadtype myULL;
6252 {4294967303.15, 4294967303ULL},
6253 {4294967294.2, 4294967294ULL},
6254 {4294967295.7, 4294967295ULL},
6257 for (p = test; p->u; p++) {
6258 myULL x = (myULL)p->d;
6269 if eval $compile_ok; then
6270 libcquad=`$run ./try`
6271 echo "Your C library's 64-bit functions are $libcquad."
6273 echo "(I can't seem to compile the test program.)"
6274 echo "Assuming that your C library's 64-bit functions are ok."
6283 *** You have a C library with broken 64-bit functions.
6284 *** 64-bit support does not work reliably in this configuration.
6285 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6286 *** Cannot continue, aborting.
6293 4) case "$archname64" in
6294 '') archname64=64int ;;
6301 : Look for a hint-file generated 'call-back-unit'. If the
6302 : user has specified that a maximally 64-bit perl is to be built,
6303 : we may need to set or change some other defaults.
6304 if $test -f use64bitall.cbu; then
6305 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6308 case "$use64bitall" in
6309 "$define"|true|[yY]*)
6311 4) case "$archname64" in
6312 ''|64int) archname64=64all ;;
6319 case "$d_quad:$use64bitint" in
6323 *** You have chosen to use 64-bit integers,
6324 *** but none can be found.
6325 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6326 *** Cannot continue, aborting.
6333 : Check if we are using the GNU C library
6335 echo "Checking for GNU C Library..." >&4
6337 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6338 alone are insufficient to distinguish different versions, such as
6339 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6340 libc version 2.1.0. A. Dougherty, June 3, 2002.
6346 # ifdef __GLIBC_MINOR__
6347 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6348 # include <gnu/libc-version.h>
6349 printf("%s\n", gnu_get_libc_version());
6351 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6354 printf("%d\n", __GLIBC__);
6363 if eval $compile_ok && $run ./try > glibc.ver; then
6365 gnulibc_version=`$cat glibc.ver`
6366 echo "You are using the GNU C Library version $gnulibc_version"
6370 echo "You are not using the GNU C Library"
6376 : see if nm is to be used to determine whether a symbol is defined or not
6380 case "$d_gnulibc" in
6383 echo "nm probably won't work on the GNU C Library." >&4
6389 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6391 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6392 echo "'nm' won't be sufficient on this system." >&4
6398 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6399 if $test $dflt -gt 20; then
6409 true|$define) dflt=y;;
6416 I can use $nm to extract the symbols from your C libraries. This
6417 is a time consuming task which may generate huge output on the disk (up
6418 to 3 megabytes) but that should make the symbols extraction faster. The
6419 alternative is to skip the 'nm' extraction part and to compile a small
6420 test program instead to determine whether each symbol is present. If
6421 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6422 this may be the best solution.
6424 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6427 rp="Shall I use $nm to extract C symbols from the libraries?"
6430 [Nn]*) usenm=false;;
6439 : nm options which may be necessary
6441 '') if $test -f /mach_boot; then
6443 elif $test -d /usr/ccs/lib; then
6444 nm_opt='-p' # Solaris (and SunOS?)
6445 elif $test -f /dgux; then
6447 elif $test -f /lib64/rld; then
6448 nm_opt='-p' # 64-bit Irix
6454 : nm options which may be necessary for shared libraries but illegal
6455 : for archive libraries. Thank you, Linux.
6456 case "$nm_so_opt" in
6457 '') case "$myuname" in
6459 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6460 nm_so_opt='--dynamic'
6467 : Figure out where the libc is located
6470 : get list of predefined functions in a handy place
6475 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6481 *) for thislib in $libs; do
6484 : Handle C library specially below.
6487 thislib=`echo $thislib | $sed -e 's/^-l//'`
6488 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6490 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6492 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6494 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6496 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6498 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6500 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6505 libnames="$libnames $try"
6507 *) libnames="$libnames $thislib" ;;
6516 for xxx in $libpth; do
6517 $test -r $1 || set $xxx/libc.$so
6518 : The messy sed command sorts on library version numbers.
6520 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6521 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6523 s/[0-9][0-9]*/0000&/g
6524 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6527 $sort | $sed -e 's/^.* //'`
6530 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6531 $test -r $1 || set $sysroot/lib/libsys_s$_a
6537 if $test -r "$1"; then
6538 echo "Your (shared) C library seems to be in $1."
6540 elif $test -r /lib/libc && $test -r /lib/clib; then
6541 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6543 libc='/lib/clib /lib/libc'
6544 if $test -r /lib/syslib; then
6545 echo "(Your math library is in /lib/syslib.)"
6546 libc="$libc /lib/syslib"
6548 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6549 echo "Your C library seems to be in $libc, as you said before."
6550 elif $test -r $incpath/usr/lib/libc$_a; then
6551 libc=$incpath/usr/lib/libc$_a;
6552 echo "Your C library seems to be in $libc. That's fine."
6553 elif $test -r /lib/libc$_a; then
6555 echo "Your C library seems to be in $libc. You're normal."
6557 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6559 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6560 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6561 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6563 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6565 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6568 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6570 if $test -r "$tans"; then
6571 echo "Your C library seems to be in $tans, of all places."
6577 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6581 If the guess above is wrong (which it might be if you're using a strange
6582 compiler, or your machine supports multiple models), you can override it here.
6587 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6589 I can't seem to find your C library. I've looked in the following places:
6592 $sed 's/^/ /' libpath
6595 None of these seems to contain your C library. I need to get its name...
6600 rp='Where is your C library?'
6605 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6606 set X `cat libnames`
6609 case $# in 1) xxx=file; esac
6610 echo "Extracting names from the following $xxx for later perusal:" >&4
6612 $sed 's/^/ /' libnames >&4
6614 $echo $n "This may take a while...$c" >&4
6618 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6619 *) $nm $nm_opt $file 2>/dev/null;;
6624 $grep fprintf libc.tmp > libc.ptf
6625 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6626 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6628 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6632 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6636 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6640 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6653 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 $nm -p $* 2>/dev/null >libc.tmp
6687 $grep fprintf libc.tmp > libc.ptf
6688 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6689 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6695 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6697 if $ar t $libc > libc.tmp && \
6698 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6700 for thisname in $libnames $libc; do
6701 $ar t $thisname >>libc.tmp
6703 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6705 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6706 for thisname in $libnames $libc; do
6707 $ar tv $thisname >>libc.tmp
6708 emximp -o tmp.imp $thisname \
6710 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6711 < tmp.imp >>libc.tmp
6714 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6717 echo "$ar didn't seem to work right." >&4
6718 echo "Maybe this is a Cray...trying bld instead..." >&4
6720 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6723 for thisname in $libnames; do
6725 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6726 $ar t $thisname >>libc.tmp
6730 echo "That didn't work either. Giving up." >&4
6740 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6741 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6743 *) if $test -f /lib/syscalls.exp; then
6745 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6746 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6747 /lib/syscalls.exp >>libc.list
6753 $rm -f libnames libpath
6755 : Check if we are using C++
6757 echo "Checking for C++..." >&4
6758 $cat >try.c <<'EOCP'
6770 if eval $compile_ok && $run ./try; then
6772 echo "You are using a C++ compiler."
6775 echo "You are not using a C++ compiler."
6781 : is a C symbol defined?
6784 -v) tf=libc.tmp; tdc="";;
6785 -a) tf=libc.tmp; tdc="[]";;
6786 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6788 case "$d_cplusplus" in
6789 $define) extern_C="extern \"C\"" ;;
6790 *) extern_C="extern" ;;
6793 case "$reuseval-$4" in
6795 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6800 if $test "$runnm" = true; then
6801 if $contains $tlook $tf >/dev/null 2>&1; then
6803 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6804 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;
6805 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6806 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6810 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;
6811 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6817 $define) tval=true;;
6824 : define an is-in-libc? function
6825 inlibc='echo " "; td=$define; tu=$undef;
6826 sym=$1; var=$2; eval "was=\$$2";
6828 case "$reuseval$was" in
6838 echo "$sym() found." >&4;
6839 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6841 echo "$sym() NOT found." >&4;
6842 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6846 $define) echo "$sym() found." >&4;;
6847 *) echo "$sym() NOT found." >&4;;
6851 : check for length of double
6853 case "$doublesize" in
6855 echo "Checking to see how big your double precision numbers are..." >&4
6865 printf("%d\n", (int)sizeof(double));
6870 if eval $compile_ok; then
6871 doublesize=`$run ./try`
6872 echo "Your double is $doublesize bytes long."
6875 echo "(I can't seem to compile the test program. Guessing...)"
6876 rp="What is the size of a double precision number (in bytes)?"
6884 : check for long doubles
6886 echo "Checking to see if you have long double..." >&4
6887 echo 'int main() { long double x = 7.0; }' > try.c
6889 if eval $compile; then
6891 echo "You have long double." >&4
6894 echo "You do not have long double." >&4
6900 : see if ldexpl exists
6904 : check for length of long double
6905 case "${d_longdbl}${longdblsize}" in
6908 echo "Checking to see how big your long doubles are..." >&4
6909 $cat >try.c <<'EOCP'
6913 printf("%d\n", sizeof(long double));
6918 if eval $compile; then
6919 longdblsize=`$run ./try`
6920 echo "Your long doubles are $longdblsize bytes long." >&4
6924 echo "(I can't seem to compile the test program. Guessing...)" >&4
6925 rp="What is the size of a long double (in bytes)?"
6929 if $test "X$doublesize" = "X$longdblsize"; then
6930 echo "That isn't any different from an ordinary double." >&4
6931 echo "I'll keep your setting anyway, but you may see some" >&4
6932 echo "harmless compilation warnings." >&4
6938 $echo "Checking the kind of long doubles you have..." >&4
6939 case "$d_longdbl" in
6943 #define LONGDBLSIZE $longdblsize
6944 #define DOUBLESIZE $doublesize
6950 static const long double d = -0.1L;
6952 unsigned const char* b = (unsigned const char*)(&d);
6953 #if DOUBLESIZE == LONGDBLSIZE
6954 printf("0\n"); /* if it floats like double */
6957 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6958 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6959 /* IEEE 754 128-bit little-endian */
6963 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6964 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6969 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6970 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6971 * cannot be trusted. */
6972 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6973 if (b[0] == 0xCD && b[9] == 0xBF) {
6974 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6975 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6976 * Also known as "extended precision". */
6980 if (b[0] == 0xBF && b[9] == 0xCD) {
6981 /* Is there ever big-endian 80-bit, really?
6983 * The Motorola 68881 had another "extended precision" format:
6984 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6985 * for total of 96 bits of bytes. The zero bits were unused.
6986 * See "M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL" for more details.
6987 * If it ever becomes relevant, this format should be allocated a
6988 * new doublekind code since it is quite different from the Intel x87.
6994 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6995 /* software "double double", the 106 is 53+53.
6996 * but irix thinks it is 107. */
6997 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6998 /* double double 128-bit fully little-endian,
6999 * little-endian doubles in little-endian order,
7000 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7004 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7005 /* double double 128-bit fully big-endian,
7006 * big-endian doubles in big-endian order,
7007 * e.g. PPC/Power and MIPS:
7008 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7012 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7013 /* double double 128-bit mixed endian.
7014 * little-endian doubles in big-endian order,
7016 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7020 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7021 /* double double 128-bit mixed endian,
7022 * big-endian doubles in little-endian order,
7023 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7028 /* We are largely making this up because it may well be
7029 * that the VAX format H was never made available to C,
7030 * only to Fortran. */
7031 #if LONGDBLSIZE == 16 && defined(__vax__)
7032 if (b[0] == 0xFD && b[15] == 0x99) {
7033 /* VAX format H, PDP-11 mixed endian. */
7038 printf("-1\n"); /* unknown */
7043 if eval $compile; then
7044 longdblkind=`$run ./try`
7051 case "$longdblkind" in
7052 0) echo "Your long doubles are doubles." >&4 ;;
7053 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7054 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7055 3) echo "You have x86 80-bit little endian long doubles." >&4 ;;
7056 4) echo "You have x86 80-bit big endian long doubles." >&4 ;;
7057 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >&4 ;;
7058 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >&4 ;;
7059 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >&4 ;;
7060 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >&4 ;;
7061 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >&4 ;;
7062 *) echo "Cannot figure out your long double." >&4 ;;
7064 d_long_double_style_ieee=$undef
7065 d_long_double_style_ieee_std=$undef
7066 d_long_double_style_ieee_extended=$undef
7067 d_long_double_style_ieee_doubledouble=$undef
7068 d_long_double_style_vax=$undef
7069 case "$longdblkind" in
7070 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7072 case "$longdblkind" in
7073 1|2) d_long_double_style_ieee_std=$define ;;
7075 case "$longdblkind" in
7076 3|4) d_long_double_style_ieee_extended=$define ;;
7078 case "$longdblkind" in
7079 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7081 case "$longdblkind" in
7082 9) d_long_double_style_vax=$define ;;
7086 : get the patchlevel
7088 echo "Getting the current patchlevel..." >&4
7089 if $test -r $rsrc/patchlevel.h;then
7090 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
7091 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
7092 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7093 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
7094 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
7095 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7096 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
7105 $echo "(You do not have patchlevel.h. Eek.)"
7107 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
7108 version_patchlevel_string="version $patchlevel subversion $subversion"
7109 case "$perl_patchlevel" in
7111 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
7112 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
7116 $echo "(You have $package $version_patchlevel_string.)"
7120 : XXX Should be a Configure test for double-dots in filenames.
7121 version=`echo $revision $patchlevel $subversion | \
7122 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7123 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7124 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7127 version=`echo $revision $patchlevel $subversion | \
7128 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7129 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7130 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7133 : Special case the 5.005_xx maintenance series, which used 5.005
7134 : without any subversion label as a subdirectory in $sitelib
7135 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
7136 api_versionstring='5.005'
7139 : Check if quadmath is requested
7140 case "$usequadmath" in
7141 "$define"|true|[yY]*) usequadmath="$define" ;;
7142 *) usequadmath="$undef" ;;
7145 : Fail if both uselongdouble and usequadmath are requested
7146 case "$usequadmath:$uselongdouble" in
7150 *** You requested the use of the quadmath library and use
7151 *** of long doubles.
7153 *** Please select one or the other.
7159 : determine the architecture name
7161 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7162 tarch=`arch`"-$osname"
7163 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7164 if uname -m > tmparch 2>&1 ; then
7165 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7166 -e 's/$/'"-$osname/" tmparch`
7174 case "$myarchname" in
7177 echo "(Your architecture name used to be $myarchname.)"
7181 case "$targetarch" in
7183 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7188 *) dflt="$archname";;
7190 rp='What is your architecture name'
7194 : optionally add API version to the architecture for versioned archlibs
7195 case "$useversionedarchname" in
7196 $define|true|[yY]*) dflt='y';;
7199 rp='Add the Perl API version to your archname?'
7202 y|Y) useversionedarchname="$define" ;;
7203 *) useversionedarchname="$undef" ;;
7205 case "$useversionedarchname" in
7208 *-$api_versionstring)
7209 echo "...and architecture name already has -$api_versionstring" >&4
7212 archname="$archname-$api_versionstring"
7213 echo "...setting architecture name to $archname." >&4
7219 case "$usethreads" in
7221 echo "Threads selected." >&4
7223 *-thread*) echo "...and architecture name already has -thread." >&4
7225 *) archname="$archname-thread"
7226 echo "...setting architecture name to $archname." >&4
7231 case "$usemultiplicity" in
7233 echo "Multiplicity selected." >&4
7235 *-multi*) echo "...and architecture name already has -multi." >&4
7237 *) archname="$archname-multi"
7238 echo "...setting architecture name to $archname." >&4
7243 case "$use64bitint$use64bitall" in
7245 case "$archname64" in
7247 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7250 case "$use64bitint" in
7251 "$define") echo "64 bit integers selected." >&4 ;;
7253 case "$use64bitall" in
7254 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7257 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7259 *) archname="$archname-$archname64"
7260 echo "...setting architecture name to $archname." >&4
7266 case "$uselongdouble" in
7268 echo "Long doubles selected." >&4
7269 case "$longdblsize" in
7271 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7275 *-ld*) echo "...and architecture name already has -ld." >&4
7277 *) archname="$archname-ld"
7278 echo "...setting architecture name to $archname." >&4
7285 case "$usequadmath" in
7287 echo "quadmath selected." >&4
7289 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7291 *) archname="$archname-quadmath"
7292 echo "...setting architecture name to $archname." >&4
7297 if $test -f archname.cbu; then
7298 echo "Your platform has some specific hints for architecture name, using them..."
7302 : set the prefixit variable, to compute a suitable default value
7303 prefixit='case "$3" in
7305 case "$oldprefix" in
7306 "") eval "$1=\"\$$2\"";;
7313 ""|" "|none) eval "$1=\"\$$2\"";;
7319 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7321 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7322 /*-$oldprefix/*|\~*-$oldprefix/*)
7323 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7324 *) eval "$1=\"\$$2\"";;
7328 : determine installation style
7329 : For now, try to deduce it from prefix unless it is already set.
7330 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7331 case "$installstyle" in
7332 '') case "$prefix" in
7333 *perl*) dflt='lib';;
7334 *) dflt='lib/perl5' ;;
7337 *) dflt="$installstyle" ;;
7339 : Probably not worth prompting for this since we prompt for all
7340 : the directories individually, and the prompt would be too long and
7344 : determine where public executables go
7349 rp='Pathname where the public executables will reside?'
7351 if $test "X$ansexp" != "X$binexp"; then
7355 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7356 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7357 : this via initialinstalllocation
7360 case "$userelocatableinc" in
7361 $define|true|[yY]*) dflt='y' ;;
7366 Would you like to build Perl so that the installation is relocatable, so that
7367 library paths in @INC are determined relative to the path of the perl binary?
7368 This is not advised for system Perl installs, or if you need to run setid
7369 scripts or scripts under taint mode.
7371 If this doesn't make any sense to you, just accept the default '$dflt'.
7373 rp='Use relocatable @INC?'
7376 y|Y) val="$define" ;;
7379 set userelocatableinc
7382 initialinstalllocation="$binexp"
7383 : Default prefix is now "up one level from where the binaries are"
7384 case "$userelocatableinc" in
7390 installprefixexp=".../.."
7394 : determine where private library files go
7395 : Usual default is /usr/local/lib/perl5/$version.
7396 : Also allow things like /opt/perl/lib/$version, since
7397 : /opt/perl/lib/perl5... would be redundant.
7398 : The default "style" setting is made in installstyle.U
7399 case "$installstyle" in
7400 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7401 *) set dflt privlib lib/$version ;;
7406 There are some auxiliary files for $package that need to be put into a
7407 private library directory that is accessible by everyone.
7412 rp='Pathname where the private library files will reside?'
7417 : set the prefixup variable, to restore leading tilda escape
7418 prefixup='case "$prefixexp" in
7420 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7423 : determine where public architecture dependent libraries go
7426 : privlib default is /usr/local/lib/$package/$version
7427 : archlib default is /usr/local/lib/$package/$version/$archname
7428 : privlib may have an optional trailing /share.
7429 tdflt=`echo $privlib | $sed 's,/share$,,'`
7430 tdflt=$tdflt/$archname
7439 $spackage contains architecture-dependent library files. If you are
7440 sharing libraries in a heterogeneous environment, you might store
7441 these files in a separate location. Otherwise, you can just include
7442 them with the rest of the public library files.
7447 rp='Where do you want to put the public architecture-dependent libraries?'
7451 if $test X"$archlib" = X"$privlib"; then
7457 : see if setuid scripts can be secure
7460 Some kernels have a bug that prevents setuid #! scripts from being
7461 secure. Some sites have disabled setuid #! scripts because of this.
7463 First let's decide if your kernel supports secure setuid #! scripts.
7464 (If setuid #! scripts would be secure but have been disabled anyway,
7465 don't say that they are secure if asked.)
7470 if $test -d /dev/fd; then
7471 echo "#!$ls" >reflect
7472 chmod +x,u+s reflect
7473 ./reflect >flect 2>&1
7474 if $contains "/dev/fd" flect >/dev/null; then
7475 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7479 If you are not sure if they are secure, I can check but I'll need a
7480 username and password different from the one you are using right now.
7481 If you don't have such a username or don't want me to test, simply
7485 rp='Other username to test security of setuid scripts with?'
7490 case "$d_suidsafe" in
7491 '') echo "I'll assume setuid scripts are *not* secure." >&4
7494 echo "Well, the $hint value is *not* secure." >&4
7496 *) echo "Well, the $hint value *is* secure." >&4
7501 $rm -f reflect flect
7502 echo "#!$ls" >reflect
7503 chmod +x,u+s reflect
7506 echo '"su" will (probably) prompt you for '"$ans's password."
7507 su $ans -c './reflect >flect'
7508 if $contains "/dev/fd" flect >/dev/null; then
7509 echo "Okay, it looks like setuid scripts are secure." >&4
7512 echo "I don't think setuid scripts are secure." >&4
7517 rp='Does your kernel have *secure* setuid scripts?'
7520 [yY]*) val="$define";;
7525 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7526 echo "(That's for file descriptors, not floppy disks.)"
7532 $rm -f reflect flect
7534 : now see if they want to do setuid emulation
7535 if $test $patchlevel -lt 11; then
7538 case "$d_suidsafe" in
7541 echo "No need to emulate SUID scripts since they are secure here." >&4
7545 Some systems have disabled setuid scripts, especially systems where
7546 setuid scripts cannot be secure. On systems where setuid scripts have
7547 been disabled, the setuid/setgid bits on scripts are currently
7548 useless. It is possible for $package to detect those bits and emulate
7549 setuid/setgid in a secure fashion. This emulation will only work if
7550 setuid scripts have been disabled in your kernel.
7554 "$define") dflt=y ;;
7557 rp="Do you want to do setuid/setgid emulation?"
7560 [yY]*) val="$define";;
7572 SUID emulation has been removed for 5.12
7573 Please re-run Configure without -Dd_dosuid
7582 : Find perl5.005 or later.
7583 echo "Looking for a previously installed perl5.005 or later... "
7585 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7586 : Check if this perl is recent and can load a simple module
7587 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7590 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7600 '') echo "None found. That's ok.";;
7601 *) echo "Using $perl5." ;;
7604 : Set the siteprefix variables
7607 After $package is installed, you may wish to install various
7608 add-on modules and utilities. Typically, these add-ons will
7609 be installed under $prefix with the rest
7610 of this package. However, you may wish to install such add-ons
7611 elsewhere under a different prefix.
7613 If you do not wish to put everything under a single prefix, that's
7614 ok. You will be prompted for the individual locations; this siteprefix
7615 is only used to suggest the defaults.
7617 The default should be fine for most people.
7621 rp='Installation prefix to use for add-on modules and utilities?'
7622 : XXX Here might be another good place for an installstyle setting.
7623 case "$siteprefix" in
7625 *) dflt=$siteprefix ;;
7628 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7630 case "$siteprefix" in
7634 *) oldsiteprefix="$prefix";;
7639 siteprefixexp="$ansexp"
7641 : determine where site specific libraries go.
7642 : Usual default is /usr/local/lib/perl5/site_perl/$version
7643 : The default "style" setting is made in installstyle.U
7644 : XXX No longer works with Prefixit stuff.
7645 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7647 '') case "$installstyle" in
7648 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7649 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7657 The installation process will create a directory for
7658 site-specific extensions and modules. Most users find it convenient
7659 to place all site-specific files in this directory rather than in the
7660 main distribution directory.
7664 rp='Pathname for the site-specific library files?'
7668 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7670 : Determine list of previous versions to include in @INC
7671 $cat > getverlist <<EOPL
7676 my \$api_versionstring = "$api_versionstring";
7677 my \$version = "$version";
7678 my \$stem = "$sitelib_stem";
7679 my \$archname = "$archname";
7681 $cat >> getverlist <<'EOPL'
7682 # The list found is stored twice for each entry: the original name, and
7683 # the binary broken down version into pack "s>s>s>", so sorting is easy
7684 # and unambiguous. This will work for all versions that have a maximum
7685 # of three digit per group separate by '.'s or '_'s. Names are extended
7686 # with ".0.0" to ensure at least three elements for the pack.
7687 # -- H.Merijn Brand (m)'06 23-10-2006
7689 my @inc_version_list;
7691 # XXX Redo to do opendir/readdir?
7694 ;@candidates = map {
7695 [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*");
7696 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7702 my ($pversion, $aversion, $vsn5005) = map {
7703 pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7704 foreach my $d (@candidates) {
7705 if ($d->[1] lt $pversion) {
7706 if ($d->[1] ge $aversion) {
7707 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7709 elsif ($d->[1] ge $vsn5005) {
7710 unshift(@inc_version_list, grep { -d } $d->[0]);
7714 # Skip newer version. I.e. don't look in
7715 # 5.7.0 if we're installing 5.6.1.
7719 if (@inc_version_list) {
7720 print join(' ', @inc_version_list);
7723 # Blank space to preserve value for next Configure run.
7728 case "$inc_version_list" in
7729 '') if test -x "$perl5$exe_ext"; then
7730 dflt=`$perl5 getverlist`
7735 $undef) dflt='none' ;;
7736 *) eval dflt=\"$inc_version_list\" ;;
7739 ''|' ') dflt=none ;;
7746 In order to ease the process of upgrading, this version of perl
7747 can be configured to use modules built and installed with earlier
7748 versions of perl that were installed under $prefix. Specify here
7749 the list of earlier versions that this version of perl should check.
7750 If Configure detected no earlier versions of perl installed under
7751 $prefix, then the list will be empty. Answer 'none' to tell perl
7752 to not search earlier versions.
7754 The default should almost always be sensible, so if you're not sure,
7755 just accept the default.
7758 rp='List of earlier versions to include in @INC?'
7761 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7762 *) inc_version_list="$ans" ;;
7764 case "$inc_version_list" in
7766 inc_version_list_init='0'
7767 d_inc_version_list="$undef"
7769 *) inc_version_list_init=`echo $inc_version_list |
7770 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7771 d_inc_version_list="$define"
7776 : check for length of pointer
7780 echo "Checking to see how big your pointers are..." >&4
7789 printf("%d\n", (int)sizeof(void *));
7794 if eval $compile_ok; then
7795 ptrsize=`$run ./try`
7796 echo "Your pointers are $ptrsize bytes long."
7799 echo "(I can't seem to compile the test program. Guessing...)" >&4
7800 rp="What is the size of a pointer (in bytes)?"
7807 case "$use64bitall" in
7808 "$define"|true|[yY]*)
7812 *** You have chosen a maximally 64-bit build,
7813 *** but your pointers are only 4 bytes wide.
7814 *** Please rerun Configure without -Duse64bitall.
7819 *** Since you have quads, you could possibly try with -Duse64bitint.
7824 *** Cannot continue, aborting.
7834 : determine whether to use malloc wrapping
7836 case "$usemallocwrap" in
7837 [yY]*|true|$define) dflt='y' ;;
7838 [nN]*|false|$undef) dflt='n' ;;
7839 *) case "$usedevel" in
7840 [yY]*|true|$define) dflt='y' ;;
7845 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7847 usemallocwrap="$ans"
7850 usemallocwrap="$define" ;;
7852 usemallocwrap="$undef" ;;
7855 : determine which malloc to compile in
7857 case "$usemymalloc" in
7858 [yY]*|true|$define) dflt='y' ;;
7859 [nN]*|false|$undef) dflt='n' ;;
7860 *) case "$ptrsize" in
7864 if test "$useithreads" = "$define"; then dflt='n'; fi
7867 rp="Do you wish to attempt to use the malloc that comes with $package?"
7873 mallocsrc='malloc.c'
7874 mallocobj="malloc$_o"
7875 d_mymalloc="$define"
7878 : Remove malloc from list of libraries to use
7879 echo "Removing unneeded -lmalloc from library list" >&4
7880 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7883 echo "libs = $libs" >&4
7895 : compute the return types of malloc and free
7897 case "$malloctype" in
7902 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7909 echo "Your system uses $freetype free(), it would seem." >&4
7911 : determine where site specific architecture-dependent libraries go.
7912 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7913 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7914 : sitelib may have an optional trailing /share.
7916 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7917 dflt="$dflt/$archname"
7922 set sitearch sitearch none
7926 The installation process will also create a directory for
7927 architecture-dependent site-specific extensions and modules.
7931 rp='Pathname for the site-specific architecture-dependent library files?'
7935 if $test X"$sitearch" = X"$sitelib"; then
7938 d_sitearch="$define"
7941 : Set the vendorprefix variables
7944 The installation process will also create a directory for
7945 vendor-supplied add-ons. Vendors who supply perl with their system
7946 may find it convenient to place all vendor-supplied files in this
7947 directory rather than in the main distribution directory. This will
7948 ease upgrades between binary-compatible maintenance versions of perl.
7950 Of course you may also use these directories in whatever way you see
7951 fit. For example, you might use them to access modules shared over a
7952 company-wide network.
7954 The default answer should be fine for most people.
7955 This causes further questions about vendor add-ons to be skipped
7956 and no vendor-specific directories will be configured for perl.
7959 rp='Do you want to configure vendor-specific add-on directories?'
7960 case "$usevendorprefix" in
7961 define|true|[yY]*) dflt=y ;;
7962 *) : User may have set vendorprefix directly on Configure command line.
7963 case "$vendorprefix" in
7972 rp='Installation prefix to use for vendor-supplied add-ons?'
7973 case "$vendorprefix" in
7974 '') dflt="$prefix" ;;
7975 *) dflt=$vendorprefix ;;
7978 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7980 case "$vendorprefix" in
7984 *) oldvendorprefix="$prefix";;
7988 usevendorprefix="$define"
7990 vendorprefixexp="$ansexp"
7992 *) usevendorprefix="$undef"
7998 : Set the vendorlib variables
7999 case "$vendorprefix" in
8000 '') d_vendorlib="$undef"
8004 *) d_vendorlib="$define"
8005 : determine where vendor-supplied modules go.
8006 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8007 case "$vendorlib" in
8009 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8010 case "$installstyle" in
8011 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8012 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8015 *) dflt="$vendorlib"
8019 rp='Pathname for the vendor-supplied library files?'
8022 vendorlibexp="$ansexp"
8025 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8029 : Set the vendorarch variables
8030 case "$vendorprefix" in
8031 '') d_vendorarch="$undef"
8035 *) d_vendorarch="$define"
8036 : determine where vendor-supplied architecture-dependent libraries go.
8037 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8038 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8039 : vendorlib may have an optional trailing /share.
8040 case "$vendorarch" in
8041 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8042 dflt="$dflt/$archname"
8044 *) dflt="$vendorarch" ;;
8047 rp='Pathname for vendor-supplied architecture-dependent files?'
8050 vendorarchexp="$ansexp"
8053 prefixvar=vendorarch
8055 if $test X"$vendorarch" = X"$vendorlib"; then
8056 d_vendorarch="$undef"
8058 d_vendorarch="$define"
8061 : Final catch-all directories to search
8064 Lastly, you can have perl look in other directories for extensions and
8065 modules in addition to those already specified.
8066 These directories will be searched after
8070 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8071 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8073 case "$otherlibdirs" in
8074 ''|' ') dflt='none' ;;
8075 *) dflt="$otherlibdirs" ;;
8078 Enter a colon-separated set of extra paths to include in perl's @INC
8079 search path, or enter 'none' for no extra paths.
8083 rp='Colon-separated list of additional directories for perl to search?'
8086 ' '|''|none) otherlibdirs=' ' ;;
8087 *) otherlibdirs="$ans" ;;
8089 case "$otherlibdirs" in
8093 set d_perl_otherlibdirs
8097 dflt_dtrace='/usr/sbin/dtrace'
8098 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8102 Perl can be built to support DTrace on platforms that support it.
8103 DTrace is a diagnosis and performance analysis tool from Sun.
8105 If this doesn't make any sense to you, just accept the default.
8109 case "$usedtrace" in
8119 dflt_dtrace=$usedtrace
8126 rp='Support DTrace if available?'
8129 y|Y) val="$define" ;;
8135 test "X$usedtrace" != "X$define" && break
8138 rp='Where is the dtrace executable?'
8147 if $dtrace -h -s ../perldtrace.d \
8148 -o perldtrace.tmp >/dev/null 2>&1 \
8149 && rm -f perldtrace.tmp
8152 echo "Good: your $dtrace knows about the -h flag."
8156 *** $me: Fatal Error: $dtrace doesn't support -h flag
8158 *** Your installed dtrace doesn't support the -h switch to compile a D
8159 *** program into a C header. Can't continue.
8171 *** $me: Fatal Error: $dtrace not found.
8178 echo "*** $dtrace was not found."
8184 : See if we want extra modules installed
8191 Perl can be built with extra modules or bundles of modules which
8192 will be fetched from the CPAN and installed alongside Perl.
8194 Notice that you will need access to the CPAN; either via the Internet,
8195 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8196 be asked later to configure the CPAN.pm module which will in turn do
8197 the installation of the rest of the extra modules or bundles.)
8199 Notice also that if the modules require any external software such as
8200 libraries and headers (the libz library and the zlib.h header for the
8201 Compress::Zlib module, for example) you MUST have any such software
8202 already installed, this configuration process will NOT install such
8205 If this doesn't make any sense to you, just accept the default '$dflt'.
8207 rp='Install any extra modules (y or n)?'
8213 Please list any extra modules or bundles to be installed from CPAN,
8214 with spaces between the names. The names can be in any format the
8215 'install' command of CPAN.pm will understand. (Answer 'none',
8216 without the quotes, to install no extra modules or bundles.)
8226 $rm -f ../extras.lst
8228 *) echo "(Saving the list of extras for later...)"
8229 echo "$extras" > ../extras.lst
8237 : determine where html pages for programs go
8238 set html1dir html1dir none
8242 If you wish to install html files for programs in $spackage, indicate
8243 the appropriate directory here. To skip installing html files,
8247 ''|none|$undef|' ') dflt=none ;;
8248 *) dflt=$html1dir ;;
8251 rp="Directory for the main $spackage html pages?"
8255 : Use ' ' for none so value is preserved next time through Configure
8256 $test X"$html1dir" = "X" && html1dir=' '
8258 : determine where html pages for libraries and modules go
8259 set html3dir html3dir none
8263 If you wish to install html files for modules associated with $spackage,
8264 indicate the appropriate directory here. To skip installing html files,
8267 : There is no obvious default. If they have specified html1dir, then
8268 : try to key off that, possibly changing .../html1 into .../html3.
8270 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8271 *) dflt=$html3dir ;;
8274 rp="Directory for the $spackage module html pages?"
8278 : Use ' ' for none so value is preserved next time through Configure
8279 $test X"$html3dir" = "X" && html3dir=' '
8281 : determine whether to install perl also as /usr/bin/perl
8284 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8286 Many scripts expect perl to be installed as /usr/bin/perl.
8288 If you want to, I can install the perl you are about to compile
8289 as /usr/bin/perl (in addition to $bin/perl).
8291 if test -f /usr/bin/perl; then
8294 However, please note that because you already have a /usr/bin/perl,
8295 overwriting that with a new Perl would very probably cause problems.
8296 Therefore I'm assuming you don't want to do that (unless you insist).
8299 case "$installusrbinperl" in
8300 "$define"|[yY]*) dflt='y';;
8306 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8309 case "$installusrbinperl" in
8310 "$undef"|[nN]*) dflt='n';;
8314 rp="Do you want to install perl as /usr/bin/perl?"
8317 [yY]*) val="$define";;
8323 set installusrbinperl
8326 : see if dlopen exists
8328 xxx_ccflags="$ccflags"
8330 : with g++ one needs -shared to get is-in-libc to work for dlopen
8331 case "$gccversion" in
8334 *) case "$d_cplusplus" in
8335 "$define") ccflags="$ccflags -shared" ;;
8342 ccflags="$xxx_ccflags"
8344 : see if this is a unistd.h system
8345 set unistd.h i_unistd
8348 : determine which dynamic loading, if any, to compile in
8350 dldir="ext/DynaLoader"
8363 $define) dflt='y' ;;
8365 : Does a dl_xxx.xs file exist for this operating system
8366 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8369 rp="Do you wish to use dynamic loading?"
8376 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8377 dflt="$dldir/dl_${osname}.xs"
8378 elif $test "$d_dlopen" = "$define" ; then
8379 dflt="$dldir/dl_dlopen.xs"
8384 *) dflt="$dldir/$dlsrc"
8387 echo "The following dynamic loading files are available:"
8388 : Can not go over to $dldir because getfile has path hard-coded in.
8389 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8390 rp="Source file to use for dynamic loading"
8396 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8400 Some systems may require passing special flags to $cc -c to
8401 compile modules that will be used to create a shared library.
8402 To use no flags, say "none".
8405 case "$cccdlflags" in
8406 '') case "$gccversion" in
8407 '') case "$osname" in
8409 irix*) dflt='-KPIC' ;;
8410 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8411 sunos) dflt='-pic' ;;
8415 *) case "$osname" in
8416 darwin) dflt='none' ;;
8417 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8422 *) dflt="$cccdlflags" ;;
8429 # If -Dsysroot was specified, now's the time to add it
8431 if test "X$sysroot" != X; then
8432 case "$gccversion" in
8437 dflt="$dflt --sysroot=$sysroot" ;;
8447 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8450 none) cccdlflags=' ' ;;
8451 *) cccdlflags="$ans" ;;
8456 Some systems use ld to create libraries that can be dynamically loaded,
8457 while other systems (such as those using ELF) use $cc.
8461 : Determine if this is ELF
8463 /* Test for whether ELF binaries are produced */
8475 int i = open("a.out",O_RDONLY);
8478 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8479 exit(0); /* succeed (yes, it is ELF) */
8483 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8489 '') if $test $bin_ELF = "$define"; then
8491 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8495 echo "I'll use ld to build dynamic libraries."
8503 rp="What command should be used to create dynamic libraries?"
8509 Some systems may require passing special flags to $ld to create a
8510 library that can be dynamically loaded. If your ld flags include
8511 -L/other/path options to locate libraries outside your loader's normal
8512 search path, you may need to specify those -L options here as well. To
8513 use no flags, say "none".
8516 case "$lddlflags" in
8517 '') case "$osname" in
8518 haiku) dflt='-shared' ;;
8520 case "$gccversion" in
8521 '') dflt="$dflt +vnocompatwarnings" ;;
8524 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8525 solaris) # See [perl #66604].
8526 # On Solaris 11, gcc -m64 on amd64
8527 # appears not to understand -G. gcc versions at
8528 # least as old as 3.4.3 support -shared, so just
8529 # use that with Solaris 11 and later, but keep
8530 # the old behavior for older Solaris versions.
8531 case "$gccversion" in
8533 *) case "$osvers" in
8534 2.?|2.10) dflt='-G' ;;
8535 *) dflt='-shared' ;;
8540 sunos) dflt='-assert nodefinitions' ;;
8541 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8545 *) dflt="$lddlflags" ;;
8548 : Only do this for gcc, since, for example, qcc has no concept
8550 if $test "X$sysroot" != X; then
8551 case "$gccversion" in
8553 *) dflt="$dflt --sysroot=$sysroot" ;;
8557 : Try to guess additional flags to pick up local libraries.
8558 : Be careful not to append to a plain 'none'
8562 for thisflag in $ldflags; do
8567 *) dflt="$dflt $thisflag" ;;
8574 ''|' ') dflt='none' ;;
8578 *-fstack-protector-strong*)
8580 *-fstack-protector-strong*) ;; # Don't add it again
8581 *) dflt="$dflt -fstack-protector-strong" ;;
8584 *-fstack-protector*)
8586 *-fstack-protector*) ;; # Don't add it again
8587 *) dflt="$dflt -fstack-protector" ;;
8592 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8595 none) lddlflags=' ' ;;
8596 *) lddlflags="$ans" ;;
8601 Some systems may require passing special flags to $cc to indicate that
8602 the resulting executable will use dynamic linking. To use no flags,
8606 case "$ccdlflags" in
8607 '') case "$osname" in
8608 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8609 sunos) dflt='none' ;;
8613 *) dflt="$ccdlflags" ;;
8615 rp="Any special flags to pass to $cc to use dynamic linking?"
8618 none) ccdlflags=' ' ;;
8619 *) ccdlflags="$ans" ;;
8631 ld_can_script="$undef"
8632 case "$bin_ELF$usedl" in
8634 # Abuse try.h and a.out names for neat cleanup
8646 if $cc $cccdlflags $ccdlflags $ccflags \
8647 $ldflags $lddlflags -o a.out try.c \
8648 -Wl,--version-script=try.h >/dev/null 2>&1 \
8649 && $test -s a.out ; then
8650 echo "ld supports scripting" >&4
8651 ld_can_script="$define"
8653 echo "ld does not support scripting" >&4
8659 : Do we want a shared libperl?
8663 # No dynamic loading being used, so don't bother even to prompt.
8666 *) case "$useshrplib" in
8667 '') case "$osname" in
8668 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8670 also='Building a shared libperl is required for dynamic loading to work on your system.'
8684 The perl executable is normally obtained by linking perlmain.c with
8685 libperl${_a}, any static extensions (usually just DynaLoader), and
8686 any other libraries needed on this system (such as -lm, etc.). Since
8687 your system supports dynamic loading, it is probably possible to build
8688 a shared libperl.$so. If you will have more than one executable linked
8689 to libperl.$so, this will significantly reduce the size of each
8690 executable, but it may have a noticeable effect on performance. The
8691 default is probably sensible for your system.
8695 rp="Build a shared libperl.$so (y/n)"
8699 useshrplib='true' ;;
8700 *) useshrplib='false' ;;
8705 case "$useshrplib" in
8707 case "$userelocatableinc" in
8709 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8710 echo "See INSTALL for an explanation why that won't work." >&4
8716 # Figure out a good name for libperl.so. Since it gets stored in
8717 # a version-specific architecture-dependent library, the version
8718 # number isn't really that important, except for making cc/ld happy.
8720 # A name such as libperl.so.10.1
8721 majmin="libperl.$so.$patchlevel.$subversion"
8722 # A name such as libperl.so.100
8723 majonly=`echo $patchlevel $subversion |
8724 $awk '{printf "%d%02d", $1, $2}'`
8725 majonly=libperl.$so.$majonly
8726 # I'd prefer to keep the os-specific stuff here to a minimum, and
8727 # rely on figuring it out from the naming of libc.
8728 case "${osname}${osvers}" in
8729 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8732 cygwin*) # ld links now against the dll directly
8733 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8734 majonly=`echo $patchlevel $subversion |
8735 $awk '{printf "%03d%03d", $1, $2}'`
8736 majonly=cygperl5.$majonly.$so
8739 *) # Try to guess based on whether libc has major.minor.
8741 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8742 *libc.$so.[0-9]*) dflt=$majonly ;;
8743 *) dflt=libperl.$so ;;
8753 I need to select a good name for the shared libperl. If your system uses
8754 library names with major and minor numbers, then you might want something
8755 like $majmin. Alternatively, if your system uses a single version
8756 number for shared libraries, then you might want to use $majonly.
8757 Or, your system might be quite happy with a simple libperl.$so.
8759 Since the shared libperl will get installed into a version-specific
8760 architecture-dependent directory, the version number of the shared perl
8761 library probably isn't important, so the default should be o.k.
8764 rp='What name do you want to give to the shared libperl?'
8767 echo "Ok, I'll use $libperl"
8770 libperl="libperl${_a}"
8774 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8778 WARNING: Use of the shrpdir variable for the installation location of
8779 the shared $libperl is not supported. It was never documented and
8780 will not work in this version. Let me (https://github.com/Perl/perl5/issues)
8781 know of any problems this may cause.
8787 But your current setting of $shrpdir is
8788 the default anyway, so it's harmless.
8793 Further, your current attempted setting of $shrpdir
8794 conflicts with the value of $archlibexp/CORE
8795 that installperl will use.
8802 # How will the perl executable find the installed shared $libperl?
8803 # Add $xxx to ccdlflags.
8804 # If we can't figure out a command-line option, use $shrpenv to
8805 # set env LD_RUN_PATH. The main perl makefile uses this.
8806 shrpdir=$archlibexp/CORE
8809 if "$useshrplib"; then
8812 # We'll set it in Makefile.SH...
8817 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8818 xxx="-Wl,-R$shrpdir"
8820 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8821 xxx="-Wl,-rpath,$shrpdir"
8824 # hpux doesn't like the default, either.
8825 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8828 # cygwin needs only ldlibpth
8831 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8837 # Only add $xxx if it isn't already in ccdlflags.
8838 case " $ccdlflags " in
8840 *) ccdlflags="$ccdlflags $xxx"
8843 Adding $xxx to the flags
8844 passed to $ld so that the perl executable will find the
8845 installed shared $libperl.
8853 # Fix ccdlflags in AIX for building external extensions.
8854 # (For building Perl itself bare -bE:perl.exp is needed,
8855 # Makefile.SH takes care of this.)
8857 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8859 # Respect a hint or command-line value.
8861 '') shrpenv="$tmp_shrpenv" ;;
8863 case "$ldlibpthname" in
8864 '') ldlibpthname=LD_LIBRARY_PATH ;;
8865 none) ldlibpthname='' ;;
8868 : determine where manual pages are on this system
8872 syspath='/usr/share/man/man1 /usr/man/man1'
8873 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8874 syspath="$syspath /usr/man/u_man/man1"
8875 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8876 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8877 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8878 sysman=`./loc . /usr/man/man1 $syspath`
8881 if $test -d "$sysman"; then
8882 echo "System manual is in $sysman." >&4
8884 echo "Could not find manual pages in source form." >&4
8887 : determine where manual pages go
8888 set man1dir man1dir none
8892 $spackage has manual pages available in source form.
8896 echo "However, you don't have nroff, so they're probably useless to you."
8898 '') man1dir="none";;
8901 echo "If you don't want the manual sources installed, answer 'none'."
8906 lookpath="$prefixexp/share/man/man1"
8907 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8908 lookpath="$lookpath $prefixexp/man/p_man/man1"
8909 lookpath="$lookpath $prefixexp/man/u_man/man1"
8910 lookpath="$lookpath $prefixexp/man/man.1"
8912 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8913 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8923 rp="Where do the main $spackage manual pages (source) go?"
8925 if $test "X$man1direxp" != "X$ansexp"; then
8936 : What suffix to use on installed man pages
8943 rp="What suffix should be used for the main $spackage man pages?"
8945 '') case "$man1dir" in
8959 *) dflt="$man1ext";;
8966 : see if we can have long filenames
8968 first=123456789abcdef
8970 if (echo hi >$first) 2>/dev/null; then
8971 if $test -f 123456789abcde; then
8972 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8975 echo 'You can have filenames longer than 14 characters.'>&4
8980 You can't have filenames longer than 14 chars.
8981 You can't even think about them!
8987 $rm -rf 123456789abcde*
8989 : determine where library module manual pages go
8990 set man3dir man3dir none
8994 $spackage has manual pages for many of the library modules.
9000 However, you don't have nroff, so they're probably useless to you.
9003 '') man3dir="none";;
9007 case "$d_flexfnam" in
9010 However, your system can't handle the long file names like File::Basename.3.
9013 '') man3dir="none";;
9017 echo "If you don't want the manual sources installed, answer 'none'."
9018 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9020 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9021 if $test -d "$privlib/man/man3"; then
9024 WARNING: Previous versions of perl installed man3 pages into
9025 $privlib/man/man3. This version will suggest a
9026 new default of $dflt.
9030 rp='Do you wish to preserve the old behavior?(y/n)'
9033 y*) dflt="$privlib/man/man3" ;;
9038 *) dflt="$man3dir" ;;
9045 rp="Where do the $package library man pages (source) go?"
9055 : What suffix to use on installed man pages
9061 rp="What suffix should be used for the $package library man pages?"
9063 '') case "$man3dir" in
9077 *) dflt="$man3ext";;
9084 : see if we have to deal with yellow pages, now NIS.
9085 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9091 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9099 rp='Are you getting the hosts file via yellow pages?'
9102 y*) hostcat='ypcat hosts';;
9103 *) hostcat='cat /etc/hosts';;
9109 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9112 '') test -f /etc/group && groupcat='cat /etc/group';;
9115 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9118 : now get the host name
9120 echo "Figuring out host name..." >&4
9121 case "$myhostname" in
9123 echo 'Maybe "hostname" will work...'
9124 if tans=`sh -c hostname 2>&1` ; then
9132 if $test "$cont"; then
9134 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9135 if tans=`cat /etc/systemid 2>&1` ; then
9137 phostname='cat /etc/systemid'
9138 echo "Whadyaknow. Xenix always was a bit strange..."
9141 elif $test -r /etc/systemid; then
9142 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9145 if $test "$cont"; then
9146 echo 'No, maybe "uuname -l" will work...'
9147 if tans=`sh -c 'uuname -l' 2>&1` ; then
9149 phostname='uuname -l'
9151 echo 'Strange. Maybe "uname -n" will work...'
9152 if tans=`sh -c 'uname -n' 2>&1` ; then
9154 phostname='uname -n'
9156 echo 'Oh well, maybe I can mine it out of whoami.h...'
9157 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9158 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9159 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9161 case "$myhostname" in
9162 '') echo "Does this machine have an identity crisis or something?"
9165 echo "Well, you said $myhostname before..."
9166 phostname='echo $myhostname';;
9172 case "$myhostname" in
9173 '') myhostname=noname ;;
9175 : you do not want to know about this
9180 if $test "$myhostname" ; then
9182 rp='Your host name appears to be "'$myhostname'".'" Right?"
9190 : bad guess or no guess
9191 while $test "X$myhostname" = X ; do
9193 rp="Please type the (one word) name of your host:"
9198 : translate upper to lower if necessary
9199 case "$myhostname" in
9201 echo "(Normalizing case in your host name)"
9202 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9206 case "$myhostname" in
9208 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9209 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9210 echo "(Trimming domain name from host name--host name is now $myhostname)"
9212 *) case "$mydomain" in
9215 test "X$hostcat" = "Xypcat hosts" &&
9216 ypmatch "$myhostname" hosts 2>/dev/null |\
9217 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9220 test "X$hostcat" != "X" &&
9221 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9222 /[ ]$myhostname[ . ]/p" > hosts
9225 if $test -f hosts; then
9226 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9227 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9228 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9229 hosts | $sort | $uniq | \
9230 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9231 case `$echo X$dflt` in
9232 X*\ *) echo "(Several hosts in the database matched hostname)"
9235 X.) echo "(You do not have fully-qualified names in the hosts database)"
9239 echo "(I cannot locate a hosts database anywhere)"
9244 tans=`./loc resolv.conf X /etc /usr/etc`
9245 if $test -f "$tans"; then
9246 echo "(Attempting domain name extraction from $tans)"
9247 dflt=.`$sed -n -e 's/ / /g' \
9248 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9251 .) dflt=.`$sed -n -e 's/ / /g' \
9252 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9260 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9261 dflt=.`sh -c domainname 2>/dev/null`
9264 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9268 case "$dflt$osname" in
9269 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9270 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9274 .) echo "(Lost all hope -- silly guess then)"
9280 *) dflt="$mydomain";;
9284 rp="What is your domain name?"
9294 : translate upper to lower if necessary
9297 echo "(Normalizing case in your domain name)"
9298 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9302 : a little sanity check here
9303 case "$phostname" in
9306 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9307 $myhostname$mydomain|$myhostname) ;;
9309 case "$phostname" in
9311 echo "(That doesn't agree with your whoami.h file, by the way.)"
9314 echo "(That doesn't agree with your $phostname command, by the way.)"
9322 : determine the e-mail address of the user who is running us
9325 I need to get your e-mail address in Internet format if possible, i.e.
9327 no easy means to double check it. The default value provided below
9328 is most probably close to reality but may not be valid from outside
9329 your organization...
9333 while test "$cont"; do
9334 case "$MAILDOMAIN" in
9336 if $test -s /etc/mailname; then
9337 maildomain=`$cat /etc/mailname`
9339 maildomain="$myhostname$mydomain"
9342 *) maildomain="$MAILDOMAIN";;
9345 '') dflt="$cf_by@$maildomain";;
9346 *) dflt="$cf_email";;
9348 rp='What is your e-mail address?'
9354 rp='Address does not look like an Internet one. Use it anyway?'
9368 : Ask e-mail of administrator
9371 If you or somebody else will be maintaining perl at your site, please
9372 fill in the correct e-mail address here so that they may be contacted
9373 if necessary. You may enter "none" for no administrator.
9376 case "$perladmin" in
9377 '') dflt="$cf_email";;
9378 *) dflt="$perladmin";;
9380 rp='Perl administrator e-mail address'
9384 : determine whether to use a version number suffix for installed binaries
9387 Do you want to use a version number suffix for installed binaries? This
9388 will install 'perl$version' instead of 'perl', and likewise for other
9389 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9390 to be installed side-by-side. Unless you are a developer, you probably
9391 do *not* want to do this.
9393 case "$versiononly" in
9394 "$define"|[Yy]*|true) dflt='y' ;;
9397 rp="Do you want to use a version number suffix for installed binaries?"
9400 [yY]*) val="$define";;
9406 case "$versiononly" in
9407 "$define") inc_version_list=''
9408 inc_version_list_init=0
9412 : figure out how to guarantee perl startup
9413 : XXX Note that this currently takes advantage of the bug that binexp ignores
9414 : the Configure -Dinstallprefix setting, which in turn means that under
9415 : relocatable @INC, initialinstalllocation is what binexp started as.
9416 case "$startperl" in
9418 case "$sharpbang" in
9422 I can use the #! construct to start perl on your system. This will
9423 make startup of perl scripts faster, but may cause problems if you
9424 want to share those scripts and perl is not in a standard place
9425 ($initialinstalllocation/perl) on all your platforms. The alternative
9426 is to force a shell by starting the script with a single ':' character.
9429 case "$versiononly" in
9430 "$define") dflt="$initialinstalllocation/perl$version";;
9431 *) dflt="$initialinstalllocation/perl";;
9433 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9436 none) startperl=": # use perl";;
9437 *) startperl="#!$ans"
9438 if $test 30 -lt `echo "$ans" | wc -c`; then
9441 WARNING: Some systems limit the #! command to 32 characters.
9442 If you experience difficulty running Perl scripts with #!, try
9443 installing Perl in a directory with a shorter pathname.
9449 *) startperl=": # use perl"
9454 echo "I'll use $startperl to start perl scripts."
9456 : figure best path for perl in scripts
9459 case "$versiononly" in
9460 "$define") perlpath="$initialinstalllocation/perl$version";;
9461 *) perlpath="$initialinstalllocation/perl";;
9463 case "$startperl" in
9468 I will use the "eval 'exec'" idiom to start Perl on your system.
9469 I can use the full path of your Perl binary for this purpose, but
9470 doing so may cause problems if you want to share those scripts and
9471 Perl is not always in a standard place ($initialinstalllocation/perl).
9474 dflt="$initialinstalllocation/perl"
9475 rp="What path shall I use in \"eval 'exec'\"?"
9482 case "$startperl" in
9484 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9487 : determine where public executable scripts go
9488 set scriptdir scriptdir
9490 case "$scriptdir" in
9493 : guess some guesses
9494 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9495 $test -d /usr/share/bin && dflt=/usr/share/bin
9496 $test -d /usr/local/script && dflt=/usr/local/script
9497 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9498 $test -d $prefixexp/script && dflt=$prefixexp/script
9502 *) dflt="$scriptdir"
9507 Some installations have a separate directory just for executable scripts so
9508 that they can mount it across multiple architectures but keep the scripts in
9509 one spot. You might, for example, have a subdirectory of /usr/share for this.
9510 Or you might just lump your scripts in with all your other executables.
9514 rp='Where do you keep publicly executable scripts?'
9516 if $test "X$ansexp" != "X$scriptdirexp"; then
9522 : A little fix up for an irregularly named variable.
9523 installscript="$installscriptdir"
9525 : determine where add-on public executables go
9527 '') dflt=$siteprefix/bin ;;
9531 rp='Pathname where the add-on public executables should be installed?'
9536 : determine where add-on html pages go
9537 : There is no standard location, so try to copy the previously-selected
9538 : directory structure for the core html pages.
9539 case "$sitehtml1dir" in
9540 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9541 *) dflt=$sitehtml1dir ;;
9544 ''|' ') dflt=none ;;
9547 rp='Pathname where the site-specific html pages should be installed?'
9549 prefixvar=sitehtml1dir
9552 : determine where add-on library html pages go
9553 : There is no standard location, so try to copy the previously-selected
9554 : directory structure for the core html pages.
9555 case "$sitehtml3dir" in
9556 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9557 *) dflt=$sitehtml3dir ;;
9560 ''|' ') dflt=none ;;
9563 rp='Pathname where the site-specific library html pages should be installed?'
9565 prefixvar=sitehtml3dir
9568 : determine where add-on manual pages go
9569 case "$siteman1dir" in
9570 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9571 *) dflt=$siteman1dir ;;
9574 ''|' ') dflt=none ;;
9577 rp='Pathname where the site-specific manual pages should be installed?'
9579 prefixvar=siteman1dir
9582 : determine where add-on library man pages go
9583 case "$siteman3dir" in
9584 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9585 *) dflt=$siteman3dir ;;
9588 ''|' ') dflt=none ;;
9591 rp='Pathname where the site-specific library manual pages should be installed?'
9593 prefixvar=siteman3dir
9596 : determine where add-on public executable scripts go
9597 case "$sitescript" in
9598 '') dflt=$siteprefix/script
9599 $test -d $dflt || dflt=$sitebin ;;
9600 *) dflt="$sitescript" ;;
9603 rp='Pathname where add-on public executable scripts should be installed?'
9605 prefixvar=sitescript
9608 : see if backtrace exists
9609 set backtrace d_backtrace
9612 : Check if C backtrace is actually supported.
9613 case "$usecbacktrace" in
9614 "") usecbacktrace=$undef ;;
9616 case "$d_backtrace" in
9620 echo "This system does not support backtrace" >&4
9621 usecbacktrace=$undef
9627 : Check if faststdio is requested and available
9628 case "$usefaststdio" in
9629 $define|true|[yY]*|'')
9630 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9640 Perl can be built to use 'fast stdio', which means using the stdio
9641 library but also directly manipulating the stdio buffers to enable
9642 faster I/O. Using stdio is better for backward compatibility (especially
9643 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9644 interface has been preferred instead of stdio.
9646 If this doesn't make any sense to you, just accept the default '$dflt'.
9648 rp='Use the "fast stdio" if available?'
9651 y|Y) val="$define" ;;
9657 : define an is-a-typedef? function
9658 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9660 "") inclist="sys/types.h";;
9662 eval "varval=\$$var";
9666 for inc in $inclist; do
9667 echo "#include <$inc>" >>temp.c;
9669 echo "#ifdef $type" >> temp.c;
9670 echo "printf(\"We have $type\");" >> temp.c;
9671 echo "#endif" >> temp.c;
9672 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9673 if $contains $type temp.E >/dev/null 2>&1; then
9679 *) eval "$var=\$varval";;
9682 : define an is-a-typedef? function that prompts if the type is not available.
9683 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9685 "") inclist="sys/types.h";;
9687 eval "varval=\$$var";
9691 for inc in $inclist; do
9692 echo "#include <$inc>" >>temp.c;
9694 echo "#ifdef $type" >> temp.c;
9695 echo "printf(\"We have $type\");" >> temp.c;
9696 echo "#endif" >> temp.c;
9697 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9699 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9700 if $contains $type temp.E >/dev/null 2>&1; then
9701 echo "$type found." >&4;
9704 echo "$type NOT found." >&4;
9710 *) eval "$var=\$varval";;
9713 : see what type lseek is declared as in the kernel
9714 rp="What is the type used for lseek's offset on this system?"
9715 set off_t lseektype long stdio.h sys/types.h
9719 echo "Checking to see how big your file offsets are..." >&4
9721 #include <sys/types.h>
9725 printf("%d\n", (int)sizeof($lseektype));
9730 if eval $compile_ok; then
9731 lseeksize=`$run ./try`
9732 echo "Your file offsets are $lseeksize bytes long."
9736 echo "(I can't seem to compile the test program. Guessing...)"
9737 rp="What is the size of your file offsets (in bytes)?"
9743 : see what type file positions are declared as in the library
9744 rp="What is the type for file position used by fsetpos()?"
9745 set fpos_t fpostype long stdio.h sys/types.h
9748 : Check size for Fpos_t
9751 *_t) zzz="$fpostype" ;;
9754 echo "Checking the size of $zzz..." >&4
9756 #include <sys/types.h>
9763 printf("%d\n", (int)sizeof($fpostype));
9768 if eval $compile_ok; then
9772 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9775 echo "Your $zzz is $fpossize bytes long."
9781 echo "(I can't compile the test program. Guessing...)" >&4
9782 rp="What is the size of your file positions (in bytes)?"
9787 : Check for large file support
9788 # Backward compatibility (uselfs is deprecated).
9790 "$define"|true|[yY]*)
9793 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9795 uselargefiles="$define"
9799 case "$lseeksize:$fpossize" in
9802 You can have files larger than 2 gigabytes.
9805 *) case "$uselargefiles" in
9806 "$undef"|false|[nN]*) dflt='n' ;;
9811 Perl can be built to understand large files (files larger than 2 gigabytes)
9812 on some systems. To do so, Configure can be run with -Duselargefiles.
9814 If this doesn't make any sense to you, just accept the default '$dflt'.
9816 rp='Try to understand large files, if available?'
9819 y|Y) val="$define" ;;
9826 : Look for a hint-file generated 'call-back-unit'. If the
9827 : user has specified that a large files perl is to be built,
9828 : we may need to set or change some other defaults.
9829 if $test -f uselargefiles.cbu; then
9830 echo "Your platform has some specific hints regarding large file builds, using them..."
9831 . ./uselargefiles.cbu
9833 case "$uselargefiles" in
9835 if $test -f uselargefiles.cbu; then
9837 echo "Rechecking to see how big your file offsets are..." >&4
9839 #include <sys/types.h>
9843 printf("%d\n", (int)sizeof($lseektype));
9848 if eval $compile_ok; then
9849 lseeksize=`$run ./try`
9850 $echo "Your file offsets are now $lseeksize bytes long."
9854 echo "(I can't seem to compile the test program. Guessing...)"
9855 rp="What is the size of your file offsets (in bytes)?"
9860 *_t) zzz="$fpostype" ;;
9863 $echo $n "Rechecking the size of $zzz...$c" >&4
9865 #include <sys/types.h>
9872 printf("%d\n", (int)sizeof($fpostype));
9877 if eval $compile_ok; then
9882 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9885 echo " $fpossize bytes." >&4
9891 echo "(I can't compile the test program. Guessing...)" >&4
9892 rp="What is the size of your file positions (in bytes)?"
9901 : Check if we want perlio
9904 : Set the vendorbin variables
9905 case "$vendorprefix" in
9906 '') d_vendorbin="$undef"
9910 *) d_vendorbin="$define"
9911 : determine where vendor-supplied executables go.
9912 case "$vendorbin" in
9913 '') dflt=$vendorprefix/bin ;;
9914 *) dflt="$vendorbin" ;;
9917 rp='Pathname for the vendor-supplied executables directory?'
9920 vendorbinexp="$ansexp"
9926 : Set the vendorhtml1dir variables
9927 case "$vendorprefix" in
9928 '') vendorhtml1dir=''
9929 vendorhtml1direxp=''
9931 *) : determine where vendor-supplied html pages go.
9932 : There is no standard location, so try to copy the previously-selected
9933 : directory structure for the core html pages.
9934 : XXX Better default suggestions would be welcome.
9935 case "$vendorhtml1dir" in
9936 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9937 *) dflt=$vendorhtml1dir ;;
9940 ''|' ') dflt=none ;;
9943 rp='Pathname for the vendor-supplied html pages?'
9945 vendorhtml1dir="$ans"
9946 vendorhtml1direxp="$ansexp"
9949 : Use ' ' for none so value is preserved next time through Configure
9950 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9951 prefixvar=vendorhtml1dir
9954 : Set the vendorhtml3dir variables
9955 case "$vendorprefix" in
9956 '') vendorhtml3dir=''
9957 vendorhtml3direxp=''
9959 *) : determine where vendor-supplied module html pages go.
9960 : There is no standard location, so try to copy the previously-selected
9961 : directory structure for the core html pages.
9962 : XXX Better default suggestions would be welcome.
9963 case "$vendorhtml3dir" in
9964 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9965 *) dflt=$vendorhtml3dir ;;
9968 ''|' ') dflt=none ;;
9971 rp='Pathname for the vendor-supplied html pages?'
9973 vendorhtml3dir="$ans"
9974 vendorhtml3direxp="$ansexp"
9977 : Use ' ' for none so value is preserved next time through Configure
9978 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9979 prefixvar=vendorhtml3dir
9982 : Set the vendorman1dir variables
9983 case "$vendorprefix" in
9984 '') vendorman1dir=''
9987 *) : determine where vendor-supplied manual pages go.
9988 case "$vendorman1dir" in
9989 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9990 *) dflt=$vendorman1dir ;;
9993 ''|' ') dflt=none ;;
9996 rp='Pathname for the vendor-supplied manual section 1 pages?'
9998 vendorman1dir="$ans"
9999 vendorman1direxp="$ansexp"
10002 : Use ' ' for none so value is preserved next time through Configure
10003 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10004 prefixvar=vendorman1dir
10007 : Set the vendorman3dir variables
10008 case "$vendorprefix" in
10009 '') vendorman3dir=''
10010 vendorman3direxp=''
10012 *) : determine where vendor-supplied module manual pages go.
10013 case "$vendorman3dir" in
10014 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10015 *) dflt=$vendorman3dir ;;
10018 ''|' ') dflt=none ;;
10021 rp='Pathname for the vendor-supplied manual section 3 pages?'
10023 vendorman3dir="$ans"
10024 vendorman3direxp="$ansexp"
10027 : Use ' ' for none so value is preserved next time through Configure
10028 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10029 prefixvar=vendorman3dir
10032 : Set the vendorscript variables
10033 case "$vendorprefix" in
10034 '') d_vendorscript="$undef"
10038 *) d_vendorscript="$define"
10039 : determine where vendor-supplied scripts go.
10040 case "$vendorscript" in
10041 '') dflt=$vendorprefix/script
10042 $test -d $dflt || dflt=$vendorbin ;;
10043 *) dflt="$vendorscript" ;;
10047 The installation process will create a directory for
10048 vendor-supplied scripts.
10052 rp='Pathname for the vendor-supplied scripts directory?'
10054 vendorscript="$ans"
10055 vendorscriptexp="$ansexp"
10058 prefixvar=vendorscript
10061 : see if qgcvt exists
10065 : Check what kind of doubles your system has
10066 $echo "Checking the kind of doubles you have..." >&4
10068 #$i_stdlib I_STDLIB
10069 #define DOUBLESIZE $doublesize
10071 #include <stdlib.h>
10074 static const double d = -0.1;
10076 unsigned const char* b = (unsigned const char*)(&d);
10077 #if DOUBLESIZE == 4
10078 if (b[0] == 0xCD && b[3] == 0xBD) {
10079 /* IEEE 754 32-bit little-endian */
10083 if (b[0] == 0xBD && b[3] == 0xCD) {
10084 /* IEEE 754 32-bit big-endian */
10088 if (b[0] == 0xCC && b[3] == 0xCC) {
10089 /* VAX format F, 32-bit PDP-style mixed endian. */
10093 if (b[0] == 0xC0 && b[3] == 0x9A) {
10094 /* IBM single 32-bit */
10099 #if DOUBLESIZE == 8
10100 if (b[0] == 0x9A && b[7] == 0xBF) {
10101 /* IEEE 754 64-bit little-endian */
10105 if (b[0] == 0xBF && b[7] == 0x9A) {
10106 /* IEEE 754 64-bit big-endian */
10110 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10111 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10112 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10113 * 99 99 b9 bf 9a 99 99 99 */
10117 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10118 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10119 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10120 * 99 99 99 9a bf b9 99 99 */
10124 if (b[0] == 0xCC && b[7] == 0xCC) {
10125 /* VAX format D, 64-bit PDP-style mixed endian. */
10129 if (b[0] == 0xD9 && b[7] == 0x99) {
10130 /* VAX format G, 64-bit PDP-style mixed endian. */
10134 if (b[0] == 0xC0 && b[7] == 0x9A) {
10135 /* IBM double 64-bit */
10139 if (b[0] == 0xBF && b[7] == 0xCD) {
10140 /* CRAY single 64-bit */
10145 #if DOUBLESIZE == 16
10146 if (b[0] == 0x9A && b[15] == 0xBF) {
10147 /* IEEE 754 128-bit little-endian */
10151 if (b[0] == 0xBF && b[15] == 0x9A) {
10152 /* IEEE 754 128-bit big-endian */
10157 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10158 * Whether those environments can still build Perl is debatable. */
10159 printf("-1\n"); /* unknown */
10164 if eval $compile; then
10165 doublekind=`$run ./try`
10169 case "$doublekind" in
10170 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10171 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10172 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10173 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10174 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10175 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10176 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10177 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10178 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10179 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10180 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10181 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10182 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10183 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10184 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10186 d_double_style_ieee=$undef
10187 d_double_style_vax=$undef
10188 d_double_style_ibm=$undef
10189 d_double_style_cray=$undef
10190 case "$doublekind" in
10191 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10192 9|10|11) d_double_style_vax=$define ;;
10193 12|13) d_double_style_ibm=$define ;;
10194 14) d_double_style_cray=$define ;;
10196 case "$d_double_style_ieee" in
10198 d_double_has_inf=$define
10199 d_double_has_nan=$define
10200 d_double_has_negative_zero=$define
10201 d_double_has_subnormals=$define
10204 d_double_has_inf=$undef
10205 d_double_has_nan=$undef
10206 d_double_has_negative_zero=$undef
10207 d_double_has_subnormals=$undef
10212 : Check print/scan long double stuff
10215 if $test X"$d_longdbl" = X"$define"; then
10217 echo "Checking how to print long doubles..." >&4
10219 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10220 $cat >try.c <<'EOCP'
10221 #include <sys/types.h>
10224 double d = 123.456;
10225 printf("%.3f\n", d);
10229 if eval $compile; then
10233 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10234 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10235 echo "We will use %f."
10241 if $test X"$sPRIfldbl" = X; then
10242 $cat >try.c <<'EOCP'
10243 #include <sys/types.h>
10246 long double d = 123.456;
10247 printf("%.3Lf\n", d);
10251 if eval $compile; then
10255 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10256 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10257 echo "We will use %Lf."
10263 if $test X"$sPRIfldbl" = X; then
10264 $cat >try.c <<'EOCP'
10265 #include <sys/types.h>
10268 long double d = 123.456;
10269 printf("%.3llf\n", d);
10273 if eval $compile; then
10277 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10278 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10279 echo "We will use %llf."
10285 if $test X"$sPRIfldbl" = X; then
10286 $cat >try.c <<'EOCP'
10287 #include <sys/types.h>
10290 long double d = 123.456;
10291 printf("%.3lf\n", d);
10295 if eval $compile; then
10299 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10300 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10301 echo "We will use %lf."
10307 if $test X"$sPRIfldbl" = X; then
10308 echo "Cannot figure out how to print long doubles." >&4
10310 sSCNfldbl=$sPRIfldbl # expect consistency
10317 case "$sPRIfldbl" in
10318 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10319 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10320 d_SCNfldbl="$undef";
10322 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10323 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10324 d_SCNfldbl="$define";
10328 : Before committing on uselongdouble, see whether that looks sane.
10329 if $test "$uselongdouble" = "$define"; then
10332 echo "Checking if your long double math functions work right..." >&4
10337 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10340 case "$osname:$gccversion" in
10341 aix:) saveccflags="$ccflags"
10342 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10345 if eval $compile_ok; then
10349 3) echo "Your long double math functions are working correctly." >&4 ;;
10350 *) echo "Your long double math functions are broken, not using long doubles." >&4
10351 uselongdouble=$undef
10355 case "$osname:$gccversion" in
10356 aix:) ccflags="$saveccflags" ;; # restore
10360 : Check how to convert floats to strings.
10362 if test "X$d_Gconvert" = X; then
10365 echo "Checking for an efficient way to convert floats to strings."
10367 case "$uselongdouble" in
10368 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10370 case "$d_longdbl" in
10371 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10373 case "$d_PRIgldbl" in
10374 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10377 #ifdef TRY_gconvert
10378 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10379 const char *myname = "gconvert";
10382 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10383 const char *myname = "gcvt";
10386 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10387 const char *myname = "qgcvt";
10388 #define DOUBLETYPE long double
10391 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10392 #ifdef HAS_PRIgldbl
10393 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10395 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10398 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10400 const char *myname = "sprintf";
10404 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10405 #define DOUBLETYPE long double
10407 #define DOUBLETYPE double
10413 #$i_stdlib I_STDLIB
10415 #include <stdlib.h>
10417 #include <string.h>
10419 void checkit(const char *expect, char *got)
10421 if (strcmp(expect, got)) {
10422 printf("%s oddity: Expected %s, got %s\n",
10423 myname, expect, got);
10428 void lencheck(int expect, int got)
10430 if (expect != got) {
10431 printf("%s length mismatch: Expected %d, got %d\n",
10432 myname, expect, got);
10442 /* This must be 1st test on (which?) platform */
10444 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10445 checkit("0.1", buf);
10447 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10448 checkit("0.01", buf);
10450 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10451 checkit("0.001", buf);
10453 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10454 checkit("0.0001", buf);
10456 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10457 if (strlen(buf) > 5)
10458 checkit("9e-005", buf); /* for Microsoft ?? */
10460 checkit("9e-05", buf);
10462 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10465 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10466 checkit("1.1", buf);
10468 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10469 checkit("1.01", buf);
10471 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10472 checkit("1.001", buf);
10474 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10475 checkit("1.0001", buf);
10477 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10478 checkit("1.00001", buf);
10480 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10481 checkit("1.000001", buf);
10483 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10486 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10487 checkit("-1", buf);
10489 /* Some Linux gcvt's give 1.e+5 here. */
10490 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10491 checkit("100000", buf);
10493 /* Some Linux gcvt's give -1.e+5 here. */
10494 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10495 checkit("-100000", buf);
10497 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10498 checkit("123.456", buf);
10500 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10501 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10502 /* 34 should be enough to scare even long double
10503 * places into using the e notation. */
10504 if (strlen(buf) > 5)
10505 checkit("1e+034", buf); /* for Microsoft */
10507 checkit("1e+34", buf);
10509 /* Test for an Ubuntu/Debian bug in gcvt and qgcvt. See: *
10510 * https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1899553 */
10512 Gconvert((DOUBLETYPE)0.4, 53, 0, buf);
10513 lencheck(55, (int)strlen(buf));
10515 /* For Perl, if you add additional tests here, also add them to
10516 * t/base/num.t for benefit of platforms not using Configure or
10517 * overriding d_Gconvert */
10522 : first add preferred functions to our list
10524 for xxx_convert in $gconvert_preference; do
10525 case $xxx_convert in
10526 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10527 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10530 : then add any others
10531 for xxx_convert in gconvert gcvt sprintf; do
10532 case "$xxx_list" in
10534 *) xxx_list="$xxx_list $xxx_convert" ;;
10538 case "$d_longdbl$uselongdouble" in
10540 : again, add preferred functions to our list first
10542 for xxx_convert in $gconvert_ld_preference; do
10543 case $xxx_convert in
10544 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10545 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10548 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10549 for xxx_convert in qgcvt sprintf $xxx_list; do
10550 case "$xxx_ld_list" in
10551 $xxx_convert*|*" $xxx_convert"*) ;;
10552 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10555 : if sprintf cannot do long doubles, move it to the end
10556 if test "$d_PRIgldbl" != "$define"; then
10557 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10559 : if no qgcvt, remove it
10560 if test "$d_qgcvt" != "$define"; then
10561 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10564 xxx_list="$xxx_ld_list"
10568 for xxx_convert in $xxx_list; do
10569 echo "Trying $xxx_convert..."
10570 $rm -f try try$_o core
10571 set try -DTRY_$xxx_convert
10572 if eval $compile; then
10573 echo "$xxx_convert() found." >&4
10574 if $run ./try; then
10575 echo "I'll use $xxx_convert to convert floats into a string." >&4
10578 echo "...But $xxx_convert didn't work as I expected."
10582 echo "$xxx_convert NOT found." >&4
10587 if test X$xxx_convert = X; then
10588 echo "*** WHOA THERE!!! ***" >&4
10589 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10590 xxx_convert=sprintf
10593 case "$xxx_convert" in
10594 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10595 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10596 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10597 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10598 "$define$define$define")
10599 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10600 "$define$define$undef")
10601 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10602 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10610 : see if _fwalk exists
10614 : see if accept4 exists
10615 set accept4 d_accept4
10618 : Initialize h_fcntl
10621 : Initialize h_sysfile
10624 : access call always available on UNIX
10625 set access d_access
10628 : locate the flags for 'access()'
10629 case "$d_access" in
10632 $cat >access.c <<EOCP
10633 #include <sys/types.h>
10638 #include <sys/file.h>
10641 #include <unistd.h>
10643 #$i_stdlib I_STDLIB
10645 #include <stdlib.h>
10651 : check sys/file.h first, no particular reason here
10652 if $test `./findhdr sys/file.h` && \
10653 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10655 echo "<sys/file.h> defines the *_OK access constants." >&4
10656 elif $test `./findhdr fcntl.h` && \
10657 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10659 echo "<fcntl.h> defines the *_OK access constants." >&4
10660 elif $test `./findhdr unistd.h` && \
10661 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10662 echo "<unistd.h> defines the *_OK access constants." >&4
10664 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10670 : see if accessx exists
10671 set accessx d_accessx
10674 : see if acosh exists
10678 : see if aintl exists
10682 : see if alarm exists
10686 : see if 64bit time functions exists
10688 set ctime64 d_ctime64
10691 set localtime64 d_localtime64
10694 set gmtime64 d_gmtime64
10697 set mktime64 d_mktime64
10700 set difftime64 d_difftime64
10703 set asctime64 d_asctime64
10706 : see if POSIX threads are available
10707 set pthread.h i_pthread
10710 : define a function to check prototypes
10711 $cat > protochk <<EOSH
10714 optimize="$optimize"
10718 usethreads=$usethreads
10719 i_pthread=$i_pthread
10720 pthread_h_first=$pthread_h_first
10723 $cat >> protochk <<'EOSH'
10728 while test $# -ge 2; do
10730 $define) echo "#include <$2>" >> try.c ;;
10731 literal) echo "$2" >> try.c ;;
10733 # Extra magic for the benefit of systems that need pthread.h
10734 # to be included early to correctly detect threadsafe functions.
10735 # Such functions must guarantee themselves, though, that the usethreads
10736 # and i_pthread have been defined, before calling protochk.
10737 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10738 echo "#include <pthread.h>" >> try.c
10743 cat >> try.c <<'EOCP'
10744 #define _(args) args
10746 echo "$foo" >> try.c
10747 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10748 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10754 $eunicefix protochk
10756 : Define hasproto macro for Configure internal use
10757 hasproto='varname=$1; func=$2; shift; shift;
10758 while $test $# -ge 2; do
10760 $define) echo "#include <$2>";;
10761 literal) echo "$2" ;;
10765 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10766 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10767 echo "$func() prototype found.";
10770 echo "$func() prototype NOT found.";
10777 : see if sys/types.h has to be included
10778 set sys/types.h i_systypes
10781 : see if sys/select.h has to be included
10782 set sys/select.h i_sysselct
10785 : Define hasfield macro for Configure internal use
10786 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10787 while $test $# -ge 2; do
10789 $define) echo "#include <$2>";;
10793 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10795 if eval $compile; then
10804 : see if we should include sys/time.h
10807 if test "X$timeincl" = X; then
10808 echo "Testing to see if we should include <sys/time.h>." >&4
10809 $echo $n "I'm now running the test program...$c"
10811 #include <sys/types.h>
10814 #ifdef SYSTIMEKERNEL
10817 #include <sys/time.h>
10820 #include <sys/select.h>
10822 #$i_stdlib I_STDLIB
10824 #include <stdlib.h>
10830 struct timeval bar;
10833 struct timezone tzp;
10835 if (foo.tm_sec == foo.tm_sec)
10838 if (bar.tv_sec == bar.tv_sec)
10845 for s_timezone in '-DS_TIMEZONE' ''; do
10847 for s_timeval in '-DS_TIMEVAL' ''; do
10848 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10849 for i_systime in '-DI_SYSTIME' ''; do
10852 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10853 if eval $compile; then
10854 set X $i_systime $i_systimek $sysselect $s_timeval
10858 $echo $n "Succeeded with $flags$c"
10869 *SYSTIMEKERNEL*) i_systimek="$define"
10870 timeincl=`./findhdr sys/time.h`
10871 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10872 *) i_systimek="$undef";;
10875 *I_SYSTIME*) i_systime="$define"
10876 timeincl=`./findhdr sys/time.h`" $timeincl"
10877 echo "We'll include <sys/time.h>." >&4;;
10878 *) i_systime="$undef";;
10882 : see if struct tm knows about tm_zone
10883 case "$i_systime$i_time" in
10886 echo "Checking to see if your struct tm has tm_zone field..." >&4
10887 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10895 case "$d_tm_tm_zone" in
10896 "$define") echo "Yes, it does." ;;
10897 *) echo "No, it doesn't." ;;
10899 : see if struct tm knows about tm_gmtoff
10900 case "$i_systime$i_time" in
10903 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10904 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10912 case "$d_tm_tm_gmtoff" in
10913 "$define") echo "Yes, it does." ;;
10914 *) echo "No, it doesn't." ;;
10917 : see if asctime_r exists
10918 set asctime_r d_asctime_r
10920 case "$d_asctime_r" in
10922 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10923 case "$d_asctime_r_proto:$usethreads" in
10924 ":define") d_asctime_r_proto=define
10925 set d_asctime_r_proto asctime_r $hdrs
10929 case "$d_asctime_r_proto" in
10931 case "$asctime_r_proto" in
10932 ''|0) try='char* asctime_r(const struct tm*, char*);'
10933 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10935 case "$asctime_r_proto" in
10936 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10937 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10939 case "$asctime_r_proto" in
10940 ''|0) try='int asctime_r(const struct tm*, char*);'
10941 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10943 case "$asctime_r_proto" in
10944 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10945 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10947 case "$asctime_r_proto" in
10948 ''|0) d_asctime_r=undef
10950 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10951 * ) case "$asctime_r_proto" in
10952 REENTRANT_PROTO*) ;;
10953 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10955 echo "Prototype: $try" ;;
10958 *) case "$usethreads" in
10959 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10966 *) asctime_r_proto=0
10970 : see if asinh exists
10974 : see if atanh exists
10978 : see if atolf exists
10982 : see if atoll exists
10986 : See if a file contains compiler warnings
10989 cat >compiler_warning <<EOSS
10990 # Sample for aix ('.5' indicates the column number in the line):
10991 # "op.h", line 203.5: 1506-159 (E) Bit field type specified for op_type
10992 # Since the word 'warning' isn't present, use a fairly rigorous match of what
10993 # warning messages look like
10994 # " o p . h ", line 203 . 5 : 1506 - 159 ( E )
10995 $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"
10997 compiler_warning=./compiler_warning
10998 chmod +x $compiler_warning
11000 # Maybe a colon after the 'warning' would be appropriate
11001 *) compiler_warning="$contains -i warning"
11005 : Look for GCC-style attribute format
11006 case "$d_attribute_format" in
11009 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11010 $cat >attrib.c <<'EOCP'
11012 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11014 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11015 if $compiler_warning attrib.out >/dev/null 2>&1; then
11016 echo "Your C compiler doesn't support __attribute__((format))."
11019 echo "Your C compiler supports __attribute__((format))."
11023 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11027 *) val="$d_attribute_format" ;;
11029 set d_attribute_format
11033 : Look for GCC-style attribute format with null format allowed
11034 case "$d_printf_format_null" in
11035 '') case "$d_attribute_format" in
11038 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11039 $cat >attrib.c <<EOCP
11041 #$i_stdlib I_STDLIB
11043 #include <stdlib.h>
11045 #$i_inttypes I_INTTYPES
11047 #include <inttypes.h>
11050 #define intptr_t int
11052 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11053 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11054 int main () { exit(null_printf(NULL)); }
11056 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11057 : run the executable in case it produces a run-time warning
11058 if $run ./attrib >>attrib.out 2>&1; then
11059 if $compiler_warning attrib.out >/dev/null 2>&1; then
11060 echo "Your C compiler doesn't allow __printf__ format to be null."
11063 echo "Your C compiler allows __printf__ format to be null."
11067 echo "Your C compiler executable failed with __printf__ format null."
11071 echo "Your C compiler fails with __printf__ format null."
11078 *) val="$d_printf_format_null" ;;
11080 set d_printf_format_null
11084 : Look for GCC-style attribute malloc
11085 case "$d_attribute_malloc" in
11088 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11089 $cat >attrib.c <<'EOCP'
11091 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11093 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11094 if $compiler_warning attrib.out >/dev/null 2>&1; then
11095 echo "Your C compiler doesn't support __attribute__((malloc))."
11098 echo "Your C compiler supports __attribute__((malloc))."
11102 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11106 *) val="$d_attribute_malloc" ;;
11108 set d_attribute_malloc
11112 : Look for GCC-style attribute nonnull
11113 case "$d_attribute_nonnull" in
11116 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11117 $cat >attrib.c <<'EOCP'
11119 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11121 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11122 if $compiler_warning attrib.out >/dev/null 2>&1; then
11123 echo "Your C compiler doesn't support __attribute__((nonnull))."
11126 echo "Your C compiler supports __attribute__((nonnull))."
11130 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11134 *) val="$d_attribute_nonnull" ;;
11136 set d_attribute_nonnull
11140 : Look for GCC-style attribute noreturn
11141 case "$d_attribute_noreturn" in
11144 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11145 $cat >attrib.c <<'EOCP'
11147 void fall_over_dead( void ) __attribute__((noreturn));
11149 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11150 if $compiler_warning attrib.out >/dev/null 2>&1; then
11151 echo "Your C compiler doesn't support __attribute__((noreturn))."
11154 echo "Your C compiler supports __attribute__((noreturn))."
11158 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11162 *) val="$d_attribute_noreturn" ;;
11164 set d_attribute_noreturn
11168 : Look for GCC-style attribute pure
11169 case "$d_attribute_pure" in
11172 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11173 $cat >attrib.c <<'EOCP'
11175 int square( int n ) __attribute__((pure));
11177 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11178 if $compiler_warning attrib.out >/dev/null 2>&1; then
11179 echo "Your C compiler doesn't support __attribute__((pure))."
11182 echo "Your C compiler supports __attribute__((pure))."
11186 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11190 *) val="$d_attribute_pure" ;;
11192 set d_attribute_pure
11196 : Look for GCC-style attribute unused
11197 case "$d_attribute_unused" in
11200 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11201 $cat >attrib.c <<'EOCP'
11203 int do_something( int dummy __attribute__((unused)), int n );
11205 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11206 if $compiler_warning attrib.out >/dev/null 2>&1; then
11207 echo "Your C compiler doesn't support __attribute__((unused))."
11210 echo "Your C compiler supports __attribute__((unused))."
11214 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11218 *) val="$d_attribute_unused" ;;
11220 set d_attribute_unused
11224 : Look for GCC-style attribute deprecated
11225 case "$d_attribute_deprecated" in
11228 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11229 $cat >attrib.c <<'EOCP'
11231 int I_am_deprecated(void) __attribute__((deprecated));
11233 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11234 if $compiler_warning attrib.out >/dev/null 2>&1; then
11235 echo "Your C compiler doesn't support __attribute__((deprecated))."
11238 echo "Your C compiler supports __attribute__((deprecated))."
11242 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11246 *) val="$d_attribute_deprecated" ;;
11248 set d_attribute_deprecated
11252 : Look for GCC-style attribute warn_unused_result
11253 case "$d_attribute_warn_unused_result" in
11256 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11257 $cat >attrib.c <<'EOCP'
11259 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11261 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11262 if $compiler_warning attrib.out >/dev/null 2>&1; then
11263 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11266 echo "Your C compiler supports __attribute__((warn_unused_result))."
11270 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11274 *) val="$d_attribute_warn_unused_result" ;;
11276 set d_attribute_warn_unused_result
11280 : Look for GCC-style attribute always_inline
11281 case "$d_attribute_always_inline" in
11284 echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
11285 $cat >attrib.c <<'EOCP'
11287 static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
11289 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11290 if $compiler_warning attrib.out >/dev/null 2>&1; then
11291 echo "Your C compiler doesn't support __attribute__((always_inline))."
11294 echo "Your C compiler supports __attribute__((always_inline))."
11298 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11302 *) val="$d_attribute_always_inline" ;;
11304 set d_attribute_always_inline
11308 : Look for GCC-style attribute visibility
11309 case "$d_attribute_visibility" in
11312 echo "Checking whether your compiler can handle __attribute__((visibility)) ..." >&4
11313 $cat >attrib.c <<'EOCP'
11315 __attribute__((visibility("hidden"))) int I_will_be_hidden(void);
11317 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11318 if $compiler_warning attrib.out >/dev/null 2>&1; then
11319 echo "Your C compiler doesn't support __attribute__((visibility))."
11322 echo "Your C compiler supports __attribute__((visibility))."
11326 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11330 *) val="$d_attribute_visibility" ;;
11332 set d_attribute_visibility
11336 : see if getpgrp exists
11337 set getpgrp d_getpgrp
11340 case "$d_getpgrp" in
11343 echo "Checking to see which flavor of getpgrp is in use..."
11346 #$i_unistd I_UNISTD
11347 #include <sys/types.h>
11349 # include <unistd.h>
11351 #$i_stdlib I_STDLIB
11353 #include <stdlib.h>
11357 if (getuid() == 0) {
11358 printf("(I see you are running Configure as super-user...)\n");
11361 #ifdef TRY_BSD_PGRP
11362 if (getpgrp(1) == 0)
11371 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11372 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11374 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11375 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11378 echo "I can't seem to compile and run the test program."
11380 xxx="a USG one, i.e. you use getpgrp()."
11382 # SVR4 systems can appear rather BSD-ish.
11383 case "$i_unistd" in
11385 xxx="a BSD one, i.e. you use getpgrp(pid)."
11389 xxx="probably a USG one, i.e. you use getpgrp()."
11394 echo "Assuming your getpgrp is $xxx" >&4
11403 : see if setpgrp exists
11404 set setpgrp d_setpgrp
11407 case "$d_setpgrp" in
11410 echo "Checking to see which flavor of setpgrp is in use..."
11413 #$i_unistd I_UNISTD
11414 #include <sys/types.h>
11416 # include <unistd.h>
11418 #$i_stdlib I_STDLIB
11420 #include <stdlib.h>
11424 if (getuid() == 0) {
11425 printf("(I see you are running Configure as super-user...)\n");
11428 #ifdef TRY_BSD_PGRP
11429 if (-1 == setpgrp(1, 1))
11432 if (setpgrp() != -1)
11438 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11439 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11441 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11442 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11445 echo "(I can't seem to compile and run the test program.)"
11447 xxx="a USG one, i.e. you use setpgrp()."
11449 # SVR4 systems can appear rather BSD-ish.
11450 case "$i_unistd" in
11452 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11456 xxx="probably a USG one, i.e. you use setpgrp()."
11461 echo "Assuming your setpgrp is $xxx" >&4
11470 : Look for GCC-style __builtin_add_overflow
11471 case "$d_builtin_add_overflow" in
11474 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11475 $cat >try.c <<'EOCP'
11477 const unsigned int uint_max = ~0u;
11478 int target_int = 0;
11479 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11482 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11485 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11492 if eval $compile && $run ./try; then
11493 echo "Your C compiler supports __builtin_add_overflow."
11496 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11500 *) val="$d_builtin_add_overflow" ;;
11503 set d_builtin_add_overflow
11507 : Look for GCC-style __builtin_sub_overflow
11508 case "$d_builtin_sub_overflow" in
11511 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11512 $cat >try.c <<'EOCP'
11514 const unsigned int uint_max = ~0u;
11515 int target_int = 0;
11516 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11519 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11522 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11529 if eval $compile && $run ./try; then
11530 echo "Your C compiler supports __builtin_sub_overflow."
11533 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11537 *) val="$d_builtin_sub_overflow" ;;
11540 set d_builtin_sub_overflow
11544 : Look for GCC-style __builtin_mul_overflow
11545 case "$d_builtin_mul_overflow" in
11548 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11549 $cat >try.c <<'EOCP'
11551 const unsigned int uint_max = ~0u;
11552 int target_int = 0;
11553 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11556 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11559 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11566 if eval $compile && $run ./try; then
11567 echo "Your C compiler supports __builtin_mul_overflow."
11570 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11574 *) val="$d_builtin_mul_overflow" ;;
11577 set d_builtin_mul_overflow
11581 : Look for GCC-style __builtin_choose_expr
11582 case "$d_builtin_choose_expr" in
11585 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11586 $cat >try.c <<'EOCP'
11587 #include <assert.h>
11588 #include <stdlib.h>
11591 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11594 assert( SYRINX(1) == 2112 );
11595 assert( SYRINX(1) != 5150 );
11596 assert( SYRINX(0) == 5150 );
11597 assert( SYRINX(0) != 2112 );
11598 puts( "All good!" );
11604 if eval $compile && $run ./try; then
11605 echo "Your C compiler supports __builtin_choose_expr."
11608 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11612 *) val="$d_builtin_choose_expr" ;;
11615 set d_builtin_choose_expr
11619 : Look for GCC-style __builtin_expect
11620 case "$d_builtin_expect" in
11623 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11624 $cat >try.c <<'EOCP'
11627 if ( __builtin_expect(n, 0) ) n = 1;
11628 /* Remember shell exit code truth is 0, C truth is non-zero */
11633 if eval $compile && $run ./try; then
11634 echo "Your C compiler supports __builtin_expect."
11637 echo "Your C compiler doesn't seem to understand __builtin_expect."
11641 *) val="$d_builtin_expect" ;;
11644 set d_builtin_expect
11648 : see if the Compiler supports C99 variadic macros
11649 echo "Checking for C99 variadic macros." >&4
11652 #include <stdarg.h>
11654 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11658 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11664 if eval $compile && $run ./try 2>&1 >/dev/null; then
11665 case "`$run ./try`" in
11667 echo "You have C99 variadic macros." >&4
11668 d_c99_variadic_macros="$define"
11671 echo "You don't have functional C99 variadic macros." >&4
11672 d_c99_variadic_macros="$undef"
11676 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11677 d_c99_variadic_macros="$undef"
11681 : see if signal is declared as pointer to function returning int or void
11683 xxx=`./findhdr signal.h`
11684 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11685 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11686 echo "You have int (*signal())() instead of void." >&4
11688 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11689 echo "You have void (*signal())()." >&4
11691 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11692 echo "You have int (*signal())() instead of void." >&4
11694 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11695 echo "You have void (*signal())()." >&4
11698 case "$d_voidsig" in
11700 echo "I can't determine whether signal handler returns void or int..." >&4
11702 rp="What type does your signal handler return?"
11705 v*) val="$define";;
11709 echo "As you already told me, signal handler returns void." >&4
11712 *) echo "As you already told me, signal handler returns int." >&4
11719 case "$d_voidsig" in
11720 "$define") signal_t="void";;
11721 *) signal_t="int";;
11725 : check for ability to cast large floats to 32-bit ints.
11727 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11728 if $test "$intsize" -ge 4; then
11735 #$i_stdlib I_STDLIB
11737 #include <stdlib.h>
11739 #include <sys/types.h>
11740 #include <signal.h>
11741 $signal_t blech(int s) { exit(3); }
11748 signal(SIGFPE, blech);
11750 /* Don't let compiler optimize the test away. Store the number
11751 in a writable string for gcc to pass to sscanf under HP-UX.
11753 sprintf(str, "2147483647");
11754 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11758 /* x86 processors will probably give 0x8000 0000, which is a
11759 sign change. We don't want that. We want to mimic SPARC
11760 behavior here, which is to preserve the sign and give
11763 if (i32 != ($xxx) f)
11769 if eval $compile_ok; then
11770 $run ./try 2>/dev/null
11773 echo "(I can't seem to compile the test program--assuming it can't)"
11778 echo "Yup, it can."
11781 echo "Nope, it can't."
11788 : check for ability to cast negative floats to unsigned
11790 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11793 #$i_stdlib I_STDLIB
11795 #include <stdlib.h>
11797 #include <sys/types.h>
11798 #include <signal.h>
11799 $signal_t blech(int s) { exit(7); }
11800 $signal_t blech_in_list(int s) { exit(4); }
11801 unsigned long dummy_long(unsigned long p) { return p; }
11802 unsigned int dummy_int(unsigned int p) { return p; }
11803 unsigned short dummy_short(unsigned short p) { return p; }
11807 unsigned long along;
11809 unsigned short ashort;
11813 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11814 a direct f = -123. assignment. gcc-2.8.0 reportedly
11815 optimized the whole file away
11817 /* Store the number in a writable string for gcc to pass to
11818 sscanf under HP-UX.
11820 sprintf(str, "-123");
11821 sscanf(str, "%lf", &f); /* f = -123.; */
11823 signal(SIGFPE, blech);
11824 along = (unsigned long)f;
11825 aint = (unsigned int)f;
11826 ashort = (unsigned short)f;
11827 if (along != (unsigned long)-123)
11829 if (aint != (unsigned int)-123)
11831 if (ashort != (unsigned short)-123)
11833 sprintf(str, "1073741824.");
11834 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11837 along = (unsigned long)f;
11838 if (along != 0x80000000)
11842 along = (unsigned long)f;
11843 if (along != 0x7fffffff)
11847 along = (unsigned long)f;
11848 if (along != 0x80000001)
11852 signal(SIGFPE, blech_in_list);
11853 sprintf(str, "123.");
11854 sscanf(str, "%lf", &f); /* f = 123.; */
11855 along = dummy_long((unsigned long)f);
11856 aint = dummy_int((unsigned int)f);
11857 ashort = dummy_short((unsigned short)f);
11858 if (along != (unsigned long)123)
11860 if (aint != (unsigned int)123)
11862 if (ashort != (unsigned short)123)
11869 if eval $compile_ok; then
11870 $run ./try 2>/dev/null
11873 echo "(I can't seem to compile the test program--assuming it can't)"
11876 case "$castflags" in
11878 echo "Yup, it can."
11881 echo "Nope, it can't."
11888 : see if cbrt exists
11892 : see if chown exists
11896 : see if chroot exists
11897 set chroot d_chroot
11900 : see if chsize exists
11901 set chsize d_chsize
11904 : see if class exists
11908 : see if clearenv exists
11909 set clearenv d_clearenv
11912 : Define hasstruct macro for Configure internal use
11913 hasstruct='varname=$1; struct=$2; shift; shift;
11914 while $test $# -ge 2; do
11916 $define) echo "#include <$2>";;
11920 echo "int main () { struct $struct foo; }" >> try.c;
11922 if eval $compile; then
11931 : see whether socket exists
11935 $echo $n "Hmm... $c" >&4
11936 if set socket val -f d_socket; eval $csym; $val; then
11937 echo "Looks like you have Berkeley networking support." >&4
11939 if set setsockopt val -f; eval $csym; $val; then
11942 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11943 d_oldsock="$define"
11946 if $contains socklib libc.list >/dev/null 2>&1; then
11947 echo "Looks like you have Berkeley networking support." >&4
11949 : we will have to assume that it supports the 4.2 BSD interface
11952 echo "You don't have Berkeley networking in libc$_a..." >&4
11953 if test "X$d_socket" = "X$define"; then
11954 echo "...but you seem to believe that you have sockets." >&4
11956 for net in net socket
11958 if test -f $sysroot/usr/lib/lib$net$_a; then
11959 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11960 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11961 if $contains socket libc.list >/dev/null 2>&1; then
11966 echo "...but the Wollongong group seems to have hacked it in." >&4
11967 sockethdr="-I$sysroot/usr/netinclude"
11970 echo "Found Berkeley sockets interface in lib$net." >&4
11971 if $contains setsockopt libc.list >/dev/null 2>&1; then
11974 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11975 d_oldsock="$define"
11981 if test "X$d_socket" != "X$define"; then
11982 echo "or anywhere else I see." >&4
11990 : see if socketpair exists
11991 set socketpair d_sockpair
11995 echo "Checking the availability sa_len in the sock struct ..." >&4
11997 #include <sys/types.h>
11998 #include <sys/socket.h>
12000 struct sockaddr sa;
12001 return (sa.sa_len);
12005 set try; if eval $compile; then
12008 set d_sockaddr_sa_len; eval $setvar
12011 echo "Checking the availability struct sockaddr_in6 ..." >&4
12013 #include <sys/types.h>
12014 #include <sys/socket.h>
12015 #include <netinet/in.h>
12017 struct sockaddr_in6 sin6;
12018 return (sin6.sin6_family);
12022 set try; if eval $compile; then
12025 set d_sockaddr_in6; eval $setvar
12028 echo "Checking the availability struct sockaddr_storage ..." >&4
12030 #include <sys/types.h>
12031 #include <sys/socket.h>
12032 #include <netinet/in.h>
12034 struct sockaddr_storage sastor;
12035 return (sastor.ss_family);
12039 set try; if eval $compile; then
12042 set d_sockaddr_storage; eval $setvar
12045 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12047 #include <sys/types.h>
12048 #include <sys/socket.h>
12049 #include <netinet/in.h>
12051 struct sockaddr_in6 sin6;
12052 return (sin6.sin6_scope_id);
12056 set try; if eval $compile; then
12059 set d_sin6_scope_id; eval $setvar
12062 echo "Checking the availability struct ip_mreq ..." >&4
12064 #include <sys/types.h>
12065 #include <sys/socket.h>
12066 #include <netinet/in.h>
12068 struct ip_mreq mreq;
12069 return (mreq.imr_multiaddr.s_addr);
12073 set try; if eval $compile; then
12076 set d_ip_mreq; eval $setvar
12079 echo "Checking the availability struct ip_mreq_source ..." >&4
12081 #include <sys/types.h>
12082 #include <sys/socket.h>
12083 #include <netinet/in.h>
12085 struct ip_mreq_source mreq;
12086 return (mreq.imr_multiaddr.s_addr);
12090 set try; if eval $compile; then
12093 set d_ip_mreq_source; eval $setvar
12096 echo "Checking the availability struct ipv6_mreq ..." >&4
12098 #include <sys/types.h>
12099 #include <sys/socket.h>
12100 #include <netinet/in.h>
12102 struct ipv6_mreq mreq;
12103 return (mreq.ipv6mr_interface);
12107 set try; if eval $compile; then
12110 set d_ipv6_mreq; eval $setvar
12113 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12115 #include <sys/types.h>
12116 #include <sys/socket.h>
12117 #include <netinet/in.h>
12119 struct ipv6_mreq_source mreq;
12120 return (mreq.imr_multiaddr.s_addr);
12124 set try; if eval $compile; then
12127 set d_ipv6_mreq_source; eval $setvar
12130 echo "Checking the availability of certain socket constants..." >&4
12131 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12132 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12134 #include <sys/types.h>
12135 #include <sys/socket.h>
12141 set try; if eval $compile; then
12144 set d_${enum}; eval $setvar
12148 : see if this is a sys/uio.h system
12149 set sys/uio.h i_sysuio
12152 : Check for cmsghdr support
12154 echo "Checking to see if your system supports struct cmsghdr..." >&4
12155 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12157 case "$d_cmsghdr_s" in
12158 "$define") echo "Yes, it does." ;;
12159 *) echo "No, it doesn't." ;;
12162 : see if copysign exists
12163 set copysign d_copysign
12166 : see if copysignl exists
12167 set copysignl d_copysignl
12170 : see if crypt exists
12175 $define) cryptlib='' ;;
12176 *) if set crypt val -f d_crypt; eval $csym; $val; then
12177 echo 'crypt() found.' >&4
12181 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12182 if $test -z "$cryptlib"; then
12183 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12187 if $test -z "$cryptlib"; then
12188 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12192 if $test -z "$cryptlib"; then
12193 cryptlib=`./loc libcrypt$_a "" $libpth`
12197 if $test -z "$cryptlib"; then
12198 echo 'crypt() NOT found.' >&4
12209 : see if this is a crypt.h system
12210 set crypt.h i_crypt
12213 : see if crypt_r exists
12214 set crypt_r d_crypt_r
12216 case "$d_crypt_r" in
12218 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12219 case "$d_crypt_r_proto:$usethreads" in
12220 ":define") d_crypt_r_proto=define
12221 set d_crypt_r_proto crypt_r $hdrs
12225 case "$d_crypt_r_proto" in
12227 case "$crypt_r_proto" in
12228 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12229 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12231 case "$crypt_r_proto" in
12232 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12233 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12235 case "$crypt_r_proto" in
12236 ''|0) d_crypt_r=undef
12238 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12239 * ) case "$crypt_r_proto" in
12240 REENTRANT_PROTO*) ;;
12241 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12243 echo "Prototype: $try" ;;
12246 *) case "$usethreads" in
12247 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12258 : get csh whereabouts
12260 'csh') val="$undef" ;;
12261 *) val="$define" ;;
12265 : Respect a hint or command line value for full_csh.
12266 case "$full_csh" in
12267 '') full_csh=$csh ;;
12270 : see if ctermid exists
12271 set ctermid d_ctermid
12274 : see if ctermid_r exists
12275 set ctermid_r d_ctermid_r
12277 case "$d_ctermid_r" in
12279 hdrs="$i_systypes sys/types.h define stdio.h "
12280 case "$d_ctermid_r_proto:$usethreads" in
12281 ":define") d_ctermid_r_proto=define
12282 set d_ctermid_r_proto ctermid_r $hdrs
12286 case "$d_ctermid_r_proto" in
12288 case "$ctermid_r_proto" in
12289 ''|0) try='char* ctermid_r(char*);'
12290 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12292 case "$ctermid_r_proto" in
12293 ''|0) d_ctermid_r=undef
12295 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12296 * ) case "$ctermid_r_proto" in
12297 REENTRANT_PROTO*) ;;
12298 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12300 echo "Prototype: $try" ;;
12303 *) case "$usethreads" in
12304 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12311 *) ctermid_r_proto=0
12315 : see if ctime_r exists
12316 set ctime_r d_ctime_r
12318 case "$d_ctime_r" in
12320 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12321 case "$d_ctime_r_proto:$usethreads" in
12322 ":define") d_ctime_r_proto=define
12323 set d_ctime_r_proto ctime_r $hdrs
12327 case "$d_ctime_r_proto" in
12329 case "$ctime_r_proto" in
12330 ''|0) try='char* ctime_r(const time_t*, char*);'
12331 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12333 case "$ctime_r_proto" in
12334 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12335 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12337 case "$ctime_r_proto" in
12338 ''|0) try='int ctime_r(const time_t*, char*);'
12339 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12341 case "$ctime_r_proto" in
12342 ''|0) try='int ctime_r(const time_t*, char*, int);'
12343 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12345 case "$ctime_r_proto" in
12346 ''|0) d_ctime_r=undef
12348 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12349 * ) case "$ctime_r_proto" in
12350 REENTRANT_PROTO*) ;;
12351 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12353 echo "Prototype: $try" ;;
12356 *) case "$usethreads" in
12357 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12368 : see if cuserid exists
12369 set cuserid d_cuserid
12372 : see if dbm.h is available
12373 : see if dbmclose exists
12374 set dbmclose d_dbmclose
12377 case "$d_dbmclose" in
12387 *) set rpcsvc/dbm.h i_rpcsvcdbm
12392 *) echo "We won't be including <dbm.h>"
12402 : see if prototype for dbminit is available
12404 set d_dbminitproto dbminit $i_dbm dbm.h
12407 : see if difftime exists
12408 set difftime d_difftime
12411 : see if this is a dirent system
12413 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12415 echo "<dirent.h> found." >&4
12418 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12419 echo "<sys/dir.h> found." >&4
12422 xinc=`./findhdr sys/ndir.h`
12424 echo "<dirent.h> NOT found." >&4
12429 : Look for type of directory structure.
12431 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12433 case "$direntrytype" in
12435 case "$i_dirent" in
12436 $define) guess1='struct dirent' ;;
12437 *) guess1='struct direct' ;;
12440 *) guess1="$direntrytype"
12445 'struct dirent') guess2='struct direct' ;;
12446 *) guess2='struct dirent' ;;
12449 if $contains "$guess1" try.c >/dev/null 2>&1; then
12450 direntrytype="$guess1"
12451 echo "Your directory entries are $direntrytype." >&4
12452 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12453 direntrytype="$guess2"
12454 echo "Your directory entries seem to be $direntrytype." >&4
12456 echo "I don't recognize your system's directory entries." >&4
12457 rp="What type is used for directory entries on this system?"
12460 direntrytype="$ans"
12464 : see if the directory entry stores field length
12466 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12467 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12468 echo "Good, your directory entry keeps length information in d_namlen." >&4
12471 echo "Your directory entry does not know about the d_namlen field." >&4
12478 : Look for DIR.dd_fd
12479 case "$i_dirent" in
12481 echo "Checking to see if DIR has a dd_fd member variable" >&4
12483 #$i_stdlib I_STDLIB
12485 #include <stdlib.h>
12487 #include <dirent.h>
12497 if eval $compile; then
12498 echo "Yes, it does."
12501 echo "No, it does not."
12506 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12514 : see if this is an sysdir system
12515 set sys/dir.h i_sysdir
12518 : see if this is an sysndir system
12519 set sys/ndir.h i_sysndir
12524 $cat >dirfd.c <<EOM
12526 #$i_stdlib I_STDLIB
12528 #include <stdlib.h>
12530 #$i_dirent I_DIRENT /**/
12531 #$i_sysdir I_SYS_DIR /**/
12532 #$i_sysndir I_SYS_NDIR /**/
12533 #$i_systypes I_SYS_TYPES /**/
12534 #if defined(I_SYS_TYPES)
12535 #include <sys/types.h>
12537 #if defined(I_DIRENT)
12538 #include <dirent.h>
12541 #include <sys/ndir.h>
12544 #include <sys/dir.h>
12549 DIR *dirp = opendir(".");
12550 if (dirfd(dirp) >= 0)
12558 if eval $compile; then
12562 $define) echo "dirfd() found." >&4 ;;
12563 *) echo "dirfd() NOT found." >&4 ;;
12569 : see if dladdr exists
12570 set dladdr d_dladdr
12573 : see if dlerror exists
12576 set dlerror d_dlerror
12580 : see if dlfcn is available
12581 set dlfcn.h i_dlfcn
12584 : Check what extension to use for shared libs
12589 On a few systems, the dynamically loaded modules that perl generates and uses
12590 will need a different extension than shared libs. The default will probably
12596 *) dflt="$dlext" ;;
12598 rp='What is the extension of dynamically loaded modules'
12607 : Check if dlsym need a leading underscore
12613 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12614 $cat >dyna.c <<'EOM'
12615 void fred (void) { }
12621 #$i_stdlib I_STDLIB
12623 #include <stdlib.h>
12627 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12629 #include <sys/types.h>
12634 extern void fred(void) ;
12643 int mode = RTLD_LAZY ;
12645 handle = dlopen("./dyna.$dlext", mode) ;
12646 if (handle == NULL) {
12651 symbol = dlsym(handle, "fred") ;
12652 if (symbol == NULL) {
12653 /* try putting a leading underscore */
12654 symbol = dlsym(handle, "_fred") ;
12655 if (symbol == NULL) {
12668 : Call the object file tmp-dyna.o in case dlext=o.
12669 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12670 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12671 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12672 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12675 1) echo "Test program failed using dlopen." >&4
12676 echo "Perhaps you should not use dynamic loading." >&4;;
12677 2) echo "Test program failed using dlsym." >&4
12678 echo "Perhaps you should not use dynamic loading." >&4;;
12679 3) echo "dlsym needs a leading underscore" >&4
12681 4) echo "dlsym doesn't need a leading underscore." >&4;;
12684 echo "I can't compile and run the test program." >&4
12685 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12690 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12695 : see if drand48_r exists
12696 set drand48_r d_drand48_r
12698 case "$d_drand48_r" in
12700 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12701 case "$d_drand48_r_proto:$usethreads" in
12702 ":define") d_drand48_r_proto=define
12703 set d_drand48_r_proto drand48_r $hdrs
12707 case "$d_drand48_r_proto" in
12709 case "$drand48_r_proto" in
12710 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12711 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12713 case "$drand48_r_proto" in
12714 ''|0) d_drand48_r=undef
12716 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12717 * ) case "$drand48_r_proto" in
12718 REENTRANT_PROTO*) ;;
12719 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12721 echo "Prototype: $try" ;;
12724 *) case "$usethreads" in
12725 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12732 *) drand48_r_proto=0
12736 : see if prototype for drand48 is available
12738 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12741 : see if dup2 exists
12745 : see if dup3 exists
12749 : see if localeconv_l exists
12750 set localeconv_l d_localeconv_l
12753 : see if this is an xlocale.h system
12754 set xlocale.h i_xlocale
12757 : see if newlocale exists
12758 set newlocale d_newlocale
12761 : see if freelocale exists
12762 set freelocale d_freelocale
12765 : see if uselocale exists
12766 set uselocale d_uselocale
12769 : see if duplocale exists
12770 set duplocale d_duplocale
12773 : see if querylocale exists
12774 set querylocale d_querylocale
12777 : if we have xlocale.h, check whether it is needed
12778 case "$i_xlocale$d_newlocale$xlocale_needed" in
12780 echo "Checking if xlocale.h is needed..." >&4
12782 #include <locale.h>
12785 #include <xlocale.h>
12787 #$d_localeconv_l HAVE_LOCALECONV_L
12789 #ifdef HAVE_LOCALECONV_L
12790 struct lconv *(*lcptr)(locale_t) = localeconv_l;
12794 locale_t lc = newlocale(LC_ALL_MASK, "C", (locale_t)0);
12796 #ifdef HAVE_LOCALECONV_L
12797 /* FreeBSD hides only localeconv_l() in xlocale.h */
12798 struct lconv *lcbuf = localeconv_l(lc);
12799 printf("decimal: %s\n", lcbuf->decimal_point);
12807 if eval $compile && $run ./try > /dev/null 2>&1 ; then
12808 echo "xlocale.h isn't needed" >&4
12809 xlocale_needed=$undef
12811 set try -DTRY_XLOCALE
12812 if eval $compile && $run ./try > /dev/null 2>&1 ; then
12813 xlocale_needed=$define
12814 echo "xlocale.h is needed" >&4
12816 echo "I can't build my test either way" >&4
12817 xlocale_needed=$undef
12822 *) xlocale_needed=$undef ;;
12825 : see if eaccess exists
12826 set eaccess d_eaccess
12829 : see if endgrent exists
12830 set endgrent d_endgrent
12833 : see if this is an grp system
12839 xxx=`./findhdr grp.h`
12840 $cppstdin $cppflags $cppminus < $xxx >$$.h
12842 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12854 set d_grpasswd; eval $setvar
12858 : see if endgrent_r exists
12859 set endgrent_r d_endgrent_r
12861 case "$d_endgrent_r" in
12863 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12864 case "$d_endgrent_r_proto:$usethreads" in
12865 ":define") d_endgrent_r_proto=define
12866 set d_endgrent_r_proto endgrent_r $hdrs
12870 case "$d_endgrent_r_proto" in
12872 case "$endgrent_r_proto" in
12873 ''|0) try='int endgrent_r(FILE**);'
12874 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12876 case "$endgrent_r_proto" in
12877 ''|0) try='void endgrent_r(FILE**);'
12878 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12880 case "$endgrent_r_proto" in
12881 ''|0) d_endgrent_r=undef
12883 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12884 * ) case "$endgrent_r_proto" in
12885 REENTRANT_PROTO*) ;;
12886 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12888 echo "Prototype: $try" ;;
12891 *) case "$usethreads" in
12892 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12899 *) endgrent_r_proto=0
12903 : see if endhostent exists
12904 set endhostent d_endhent
12907 : see if this is a netdb.h system
12908 set netdb.h i_netdb
12911 : see if endhostent_r exists
12912 set endhostent_r d_endhostent_r
12914 case "$d_endhostent_r" in
12916 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12917 case "$d_endhostent_r_proto:$usethreads" in
12918 ":define") d_endhostent_r_proto=define
12919 set d_endhostent_r_proto endhostent_r $hdrs
12923 case "$d_endhostent_r_proto" in
12925 case "$endhostent_r_proto" in
12926 ''|0) try='int endhostent_r(struct hostent_data*);'
12927 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12929 case "$endhostent_r_proto" in
12930 ''|0) try='void endhostent_r(struct hostent_data*);'
12931 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12933 case "$endhostent_r_proto" in
12934 ''|0) d_endhostent_r=undef
12935 endhostent_r_proto=0
12936 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12937 * ) case "$endhostent_r_proto" in
12938 REENTRANT_PROTO*) ;;
12939 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12941 echo "Prototype: $try" ;;
12944 *) case "$usethreads" in
12945 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12947 d_endhostent_r=undef
12948 endhostent_r_proto=0
12952 *) endhostent_r_proto=0
12956 : see if endnetent exists
12957 set endnetent d_endnent
12960 : see if endnetent_r exists
12961 set endnetent_r d_endnetent_r
12963 case "$d_endnetent_r" in
12965 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12966 case "$d_endnetent_r_proto:$usethreads" in
12967 ":define") d_endnetent_r_proto=define
12968 set d_endnetent_r_proto endnetent_r $hdrs
12972 case "$d_endnetent_r_proto" in
12974 case "$endnetent_r_proto" in
12975 ''|0) try='int endnetent_r(struct netent_data*);'
12976 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12978 case "$endnetent_r_proto" in
12979 ''|0) try='void endnetent_r(struct netent_data*);'
12980 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12982 case "$endnetent_r_proto" in
12983 ''|0) d_endnetent_r=undef
12984 endnetent_r_proto=0
12985 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12986 * ) case "$endnetent_r_proto" in
12987 REENTRANT_PROTO*) ;;
12988 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12990 echo "Prototype: $try" ;;
12993 *) case "$usethreads" in
12994 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12996 d_endnetent_r=undef
12997 endnetent_r_proto=0
13001 *) endnetent_r_proto=0
13005 : see if endprotoent exists
13006 set endprotoent d_endpent
13009 : see if endprotoent_r exists
13010 set endprotoent_r d_endprotoent_r
13012 case "$d_endprotoent_r" in
13014 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13015 case "$d_endprotoent_r_proto:$usethreads" in
13016 ":define") d_endprotoent_r_proto=define
13017 set d_endprotoent_r_proto endprotoent_r $hdrs
13021 case "$d_endprotoent_r_proto" in
13023 case "$endprotoent_r_proto" in
13024 ''|0) try='int endprotoent_r(struct protoent_data*);'
13025 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13027 case "$endprotoent_r_proto" in
13028 ''|0) try='void endprotoent_r(struct protoent_data*);'
13029 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13031 case "$endprotoent_r_proto" in
13032 ''|0) d_endprotoent_r=undef
13033 endprotoent_r_proto=0
13034 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13035 * ) case "$endprotoent_r_proto" in
13036 REENTRANT_PROTO*) ;;
13037 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13039 echo "Prototype: $try" ;;
13042 *) case "$usethreads" in
13043 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13045 d_endprotoent_r=undef
13046 endprotoent_r_proto=0
13050 *) endprotoent_r_proto=0
13054 : see if endpwent exists
13055 set endpwent d_endpwent
13058 : see if this is a pwd.h system
13064 xxx=`./findhdr pwd.h`
13065 $cppstdin $cppflags $cppminus < $xxx >$$.h
13067 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13075 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13083 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13091 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13099 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13107 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13115 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13123 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13135 set d_pwquota; eval $setvar
13136 set d_pwage; eval $setvar
13137 set d_pwchange; eval $setvar
13138 set d_pwclass; eval $setvar
13139 set d_pwexpire; eval $setvar
13140 set d_pwcomment; eval $setvar
13141 set d_pwgecos; eval $setvar
13142 set d_pwpasswd; eval $setvar
13146 : see if endpwent_r exists
13147 set endpwent_r d_endpwent_r
13149 case "$d_endpwent_r" in
13151 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13152 case "$d_endpwent_r_proto:$usethreads" in
13153 ":define") d_endpwent_r_proto=define
13154 set d_endpwent_r_proto endpwent_r $hdrs
13158 case "$d_endpwent_r_proto" in
13160 case "$endpwent_r_proto" in
13161 ''|0) try='int endpwent_r(FILE**);'
13162 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13164 case "$endpwent_r_proto" in
13165 ''|0) try='void endpwent_r(FILE**);'
13166 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13168 case "$endpwent_r_proto" in
13169 ''|0) d_endpwent_r=undef
13171 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13172 * ) case "$endpwent_r_proto" in
13173 REENTRANT_PROTO*) ;;
13174 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13176 echo "Prototype: $try" ;;
13179 *) case "$usethreads" in
13180 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13187 *) endpwent_r_proto=0
13191 : see if endservent exists
13192 set endservent d_endsent
13195 : see if endservent_r exists
13196 set endservent_r d_endservent_r
13198 case "$d_endservent_r" in
13200 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13201 case "$d_endservent_r_proto:$usethreads" in
13202 ":define") d_endservent_r_proto=define
13203 set d_endservent_r_proto endservent_r $hdrs
13207 case "$d_endservent_r_proto" in
13209 case "$endservent_r_proto" in
13210 ''|0) try='int endservent_r(struct servent_data*);'
13211 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13213 case "$endservent_r_proto" in
13214 ''|0) try='void endservent_r(struct servent_data*);'
13215 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13217 case "$endservent_r_proto" in
13218 ''|0) d_endservent_r=undef
13219 endservent_r_proto=0
13220 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13221 * ) case "$endservent_r_proto" in
13222 REENTRANT_PROTO*) ;;
13223 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13225 echo "Prototype: $try" ;;
13228 *) case "$usethreads" in
13229 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13231 d_endservent_r=undef
13232 endservent_r_proto=0
13236 *) endservent_r_proto=0
13240 : Locate the flags for 'open()'
13243 #include <sys/types.h>
13248 #include <sys/file.h>
13250 #$i_stdlib I_STDLIB
13252 #include <stdlib.h>
13263 : check sys/file.h first to get FREAD on Sun
13264 if $test `./findhdr sys/file.h` && \
13265 set try -DI_SYS_FILE && eval $compile; then
13267 echo "<sys/file.h> defines the O_* constants..." >&4
13268 if $run ./try; then
13269 echo "and you have the 3 argument form of open()." >&4
13272 echo "but not the 3 argument form of open(). Oh, well." >&4
13275 elif $test `./findhdr fcntl.h` && \
13276 set try -DI_FCNTL && eval $compile; then
13278 echo "<fcntl.h> defines the O_* constants..." >&4
13279 if $run ./try; then
13280 echo "and you have the 3 argument form of open()." >&4
13283 echo "but not the 3 argument form of open(). Oh, well." >&4
13288 echo "I can't find the O_* constant definitions! You got problems." >&4
13294 : see if this is a sys/file.h system
13299 : do we need to include sys/file.h ?
13303 if $h_sysfile; then
13305 echo "We'll be including <sys/file.h>." >&4
13308 echo "We won't be including <sys/file.h>." >&4
13318 : see if fcntl.h is there
13323 : see if we can include fcntl.h
13329 echo "We'll be including <fcntl.h>." >&4
13332 if $h_sysfile; then
13333 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13335 echo "We won't be including <fcntl.h>." >&4
13347 : see if fork exists
13351 : see if pipe exists
13355 : check for non-blocking I/O stuff
13356 case "$h_sysfile" in
13357 true) echo "#include <sys/file.h>" > head.c;;
13360 true) echo "#include <fcntl.h>" > head.c;;
13361 *) echo "#include <sys/fcntl.h>" > head.c;;
13366 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13367 case "$o_nonblock" in
13369 $cat head.c > try.c
13370 $cat >>try.c <<EOCP
13372 #$i_stdlib I_STDLIB
13374 #include <stdlib.h>
13382 printf("O_NONBLOCK\n");
13386 printf("O_NDELAY\n");
13390 printf("FNDELAY\n");
13397 if eval $compile_ok; then
13398 o_nonblock=`$run ./try`
13399 case "$o_nonblock" in
13400 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13401 *) echo "Seems like we can use $o_nonblock.";;
13404 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13407 *) echo "Using $hint value $o_nonblock.";;
13412 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13415 case "$d_fork:$d_pipe:$d_alarm" in
13416 define:define:define)
13417 $cat head.c > try.c
13418 $cat >>try.c <<EOCP
13420 #include <sys/types.h>
13421 #include <signal.h>
13423 #$i_stdlib I_STDLIB
13425 #include <stdlib.h>
13431 #define MY_O_NONBLOCK $o_nonblock
13432 #ifndef errno /* XXX need better Configure test */
13435 #$i_unistd I_UNISTD
13437 #include <unistd.h>
13439 #include <string.h>
13440 $signal_t blech(int x) { exit(3); }
13442 $cat >> try.c <<'EOCP'
13451 ret = pipe(pd); /* Down: child -> parent */
13454 ret = pipe(pu); /* Up: parent -> child */
13458 close(pd[1]); /* Parent reads from pd[0] */
13459 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13461 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13466 signal(SIGALRM, blech);
13468 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13470 sprintf(string, "%d\n", ret);
13471 ret = write(2, string, strlen(string));
13472 if (ret != strlen(string))
13476 if (errno == EAGAIN) {
13477 printf("EAGAIN\n");
13482 if (errno == EWOULDBLOCK)
13483 printf("EWOULDBLOCK\n");
13486 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13489 sleep(2); /* Give it time to close our pipe */
13491 ret = read(pd[0], buf, 1); /* Should read EOF */
13493 sprintf(string, "%d\n", ret);
13494 ret = write(4, string, strlen(string));
13495 if (ret != strlen(string))
13500 close(pd[0]); /* We write to pd[1] */
13501 close(pu[1]); /* We read from pu[0] */
13502 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13505 close(pd[1]); /* Pipe pd is now fully closed! */
13506 exit(0); /* Bye bye, thank you for playing! */
13510 if eval $compile_ok; then
13511 echo "$startsh" >mtry
13512 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13514 $run ./mtry >/dev/null 2>&1
13516 0) eagain=`$cat try.out`;;
13517 1) echo "Could not perform non-blocking setting!";;
13518 2) echo "I did a successful read() for something that was not there!";;
13519 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13520 4) echo "Could not find F_SETFL!";;
13521 *) echo "Something terribly wrong happened during testing.";;
13523 rd_nodata=`$cat try.ret`
13524 echo "A read() system call with no data present returns $rd_nodata."
13525 case "$rd_nodata" in
13528 echo "(That's peculiar, fixing that to be -1.)"
13534 echo "Forcing errno EAGAIN on read() with no data available."
13538 echo "Your read() sets errno to $eagain when no data is available."
13541 status=`$cat try.err`
13543 0) echo "And it correctly returns 0 to signal EOF.";;
13544 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13545 *) echo "However, your read() returns '$status' on EOF??";;
13548 if test "$status" = "$rd_nodata"; then
13549 echo "WARNING: you can't distinguish between EOF and no data!"
13553 echo "I can't compile the test program--assuming errno EAGAIN will do."
13557 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13566 echo "Using $hint value $eagain."
13567 echo "Your read() returns $rd_nodata when no data is present."
13568 case "$d_eofnblk" in
13569 "$define") echo "And you can see EOF because read() returns 0.";;
13570 "$undef") echo "But you can't see EOF status from read() returned value.";;
13572 echo "(Assuming you can't see EOF status from read anyway.)"
13578 $rm_try head.c mtry
13580 : see if erf exists
13584 : see if erfc exists
13588 : see if exp2 exists
13592 : see if expm1 exists
13596 : see if _ptr and _cnt from stdio act std
13599 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13600 echo "(Looks like you have stdio.h from BSD.)"
13601 case "$stdio_ptr" in
13602 '') stdio_ptr='((fp)->_p)'
13605 *) ptr_lval=$d_stdio_ptr_lval;;
13607 case "$stdio_cnt" in
13608 '') stdio_cnt='((fp)->_r)'
13611 *) cnt_lval=$d_stdio_cnt_lval;;
13613 case "$stdio_base" in
13614 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13616 case "$stdio_bufsiz" in
13617 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13619 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13620 echo "(Looks like you have stdio.h from Linux.)"
13621 case "$stdio_ptr" in
13622 '') stdio_ptr='((fp)->_IO_read_ptr)'
13625 *) ptr_lval=$d_stdio_ptr_lval;;
13627 case "$stdio_cnt" in
13628 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13631 *) cnt_lval=$d_stdio_cnt_lval;;
13633 case "$stdio_base" in
13634 '') stdio_base='((fp)->_IO_read_base)';;
13636 case "$stdio_bufsiz" in
13637 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13640 case "$stdio_ptr" in
13641 '') stdio_ptr='((fp)->_ptr)'
13644 *) ptr_lval=$d_stdio_ptr_lval;;
13646 case "$stdio_cnt" in
13647 '') stdio_cnt='((fp)->_cnt)'
13650 *) cnt_lval=$d_stdio_cnt_lval;;
13652 case "$stdio_base" in
13653 '') stdio_base='((fp)->_base)';;
13655 case "$stdio_bufsiz" in
13656 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13660 : test whether _ptr and _cnt really work
13661 echo "Checking how std your stdio is..." >&4
13664 #$i_stdlib I_STDLIB
13666 #include <stdlib.h>
13668 #include <string.h>
13669 #define FILE_ptr(fp) $stdio_ptr
13670 #define FILE_cnt(fp) $stdio_cnt
13672 FILE *fp = fopen("try.c", "r");
13675 18 <= FILE_cnt(fp) &&
13676 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13684 if eval $compile && $to try.c; then
13685 if $run ./try; then
13686 echo "Your stdio acts pretty std."
13689 echo "Your stdio isn't very std."
13692 echo "Your stdio doesn't appear very std."
13696 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13697 # direct buffer manipulation no longer works. The Configure tests
13698 # should be changed to correctly detect this, but until then,
13699 # the following check should at least let perl compile and run.
13700 # (This quick fix should be updated before 5.8.1.)
13701 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13702 # A. Dougherty, June 3, 2002.
13703 case "$d_gnulibc" in
13705 case "$gnulibc_version" in
13709 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13718 : Can _ptr be used as an lvalue?
13719 case "$d_stdstdio$ptr_lval" in
13720 $define$define) val=$define ;;
13723 set d_stdio_ptr_lval
13726 : Can _cnt be used as an lvalue?
13727 case "$d_stdstdio$cnt_lval" in
13728 $define$define) val=$define ;;
13731 set d_stdio_cnt_lval
13735 : test whether setting _ptr sets _cnt as a side effect
13736 d_stdio_ptr_lval_sets_cnt="$undef"
13737 d_stdio_ptr_lval_nochange_cnt="$undef"
13738 case "$d_stdio_ptr_lval$d_stdstdio" in
13740 echo "Checking to see what happens if we set the stdio ptr..." >&4
13743 /* Can we scream? */
13744 /* Eat dust sed :-) */
13745 /* In the buffer space, no one can hear you scream. */
13746 #$i_stdlib I_STDLIB
13748 #include <stdlib.h>
13750 #define FILE_ptr(fp) $stdio_ptr
13751 #define FILE_cnt(fp) $stdio_cnt
13752 #include <sys/types.h>
13754 FILE *fp = fopen("try.c", "r");
13759 puts("Fail even to read");
13762 c = getc(fp); /* Read away the first # */
13764 puts("Fail even to read");
13768 18 <= FILE_cnt(fp) &&
13769 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13771 puts("Fail even to read");
13774 ptr = (char*) FILE_ptr(fp);
13775 cnt = (size_t)FILE_cnt(fp);
13777 FILE_ptr(fp) += 42;
13779 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13780 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13783 if (FILE_cnt(fp) <= 20) {
13784 printf ("Fail (<20 chars to test)");
13787 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13788 puts("Fail compare");
13791 if (cnt == FILE_cnt(fp)) {
13792 puts("Pass_unchanged");
13795 if (FILE_cnt(fp) == (cnt - 42)) {
13796 puts("Pass_changed");
13799 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13805 if eval $compile && $to try.c; then
13806 case `$run ./try` in
13808 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13809 d_stdio_ptr_lval_sets_cnt="$define" ;;
13811 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13812 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13814 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13816 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13819 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13825 : see if _base is also standard
13827 case "$d_stdstdio" in
13831 #$i_stdlib I_STDLIB
13833 #include <stdlib.h>
13835 #define FILE_base(fp) $stdio_base
13836 #define FILE_bufsiz(fp) $stdio_bufsiz
13838 FILE *fp = fopen("try.c", "r");
13841 19 <= FILE_bufsiz(fp) &&
13842 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13849 if eval $compile && $to try.c; then
13850 if $run ./try; then
13851 echo "And its _base field acts std."
13854 echo "But its _base field isn't std."
13857 echo "However, it seems to be lacking the _base field."
13865 : see if fast_stdio exists
13867 case "$d_stdstdio:$d_stdio_ptr_lval" in
13869 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13871 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >&4
13880 : see if fchdir exists
13881 set fchdir d_fchdir
13884 : see if fchmod exists
13885 set fchmod d_fchmod
13888 : check for openat, unlinkat, renameat, linkat, fchmodat
13889 set openat d_openat
13892 set unlinkat d_unlinkat
13895 set renameat d_renameat
13898 set linkat d_linkat
13901 set fchmodat d_fchmodat
13904 : see if fchown exists
13905 set fchown d_fchown
13908 : see if this is an fcntl system
13912 : See if fcntl-based locking works.
13915 #$i_stdlib I_STDLIB
13917 #include <stdlib.h>
13919 #include <unistd.h>
13921 #include <signal.h>
13922 $signal_t blech(int x) { exit(3); }
13924 #if defined(F_SETLK) && defined(F_SETLKW)
13925 struct flock flock;
13927 fd = open("try.c", O_RDONLY);
13928 flock.l_type = F_RDLCK;
13929 flock.l_whence = SEEK_SET;
13930 flock.l_start = flock.l_len = 0;
13931 signal(SIGALRM, blech);
13933 retval = fcntl(fd, F_SETLK, &flock);
13935 (retval < 0 ? exit(2) : exit(0));
13941 echo "Checking if fcntl-based file locking works... "
13945 if eval $compile_ok; then
13946 if $run ./try; then
13947 echo "Yes, it seems to work."
13950 echo "Nope, it didn't work."
13955 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13956 *** This is (almost) impossible.
13957 *** If your NFS lock daemons are not feeling well, something like
13958 *** this may happen, please investigate. Cannot continue, aborting.
13966 echo "I'm unable to compile the test program, so I'll assume not."
13971 echo "Nope, since you don't even have fcntl()."
13974 set d_fcntl_can_lock
13978 : check for fd_set items
13981 Checking to see how well your C compiler handles fd_set and friends ...
13984 #$i_stdlib I_STDLIB
13986 #include <stdlib.h>
13988 #$i_systime I_SYS_TIME
13989 #$i_sysselct I_SYS_SELECT
13990 #$d_socket HAS_SOCKET
13991 #include <sys/types.h>
13993 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13996 #include <sys/time.h>
13998 #ifdef I_SYS_SELECT
13999 #include <sys/select.h>
14008 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14016 if eval $compile; then
14017 d_fds_bits="$define"
14019 echo "Well, your system knows about the normal fd_set typedef..." >&4
14020 if $run ./try; then
14021 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14022 d_fd_macros="$define"
14025 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14027 d_fd_macros="$undef"
14031 Hmm, your compiler has some difficulty with fd_set. Checking further...
14034 if eval $compile; then
14035 d_fds_bits="$undef"
14037 echo "Well, your system has some sort of fd_set available..." >&4
14038 if $run ./try; then
14039 echo "and you have the normal fd_set macros." >&4
14040 d_fd_macros="$define"
14043 but not the normal fd_set macros! Gross! More work for me...
14045 d_fd_macros="$undef"
14048 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14050 d_fds_bits="$undef"
14051 d_fd_macros="$undef"
14056 : see if fdclose exists
14057 set fdclose d_fdclose
14060 : see if fdim exists
14064 : see if fegetround exists
14065 set fegetround d_fegetround
14068 : see if ffs exists
14071 : see if ffsl exists
14075 : see if fgetpos exists
14076 set fgetpos d_fgetpos
14079 : see if finite exists
14080 set finite d_finite
14083 : see if finitel exists
14084 set finitel d_finitel
14087 : see if flock exists
14091 : see if prototype for flock is available
14093 set d_flockproto flock $i_sysfile sys/file.h
14096 : see if fma exists
14100 : see if fmax exists
14104 : see if fmin exists
14108 : see if fp_class exists
14109 set fp_class d_fp_class
14112 : check for fpclassify
14113 echo "Checking to see if you have fpclassify..." >&4
14116 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14119 if eval $compile; then
14121 echo "You have fpclassify."
14124 echo "You do not have fpclassify."
14130 : see if fp_classify exists
14131 set fp_classify d_fp_classify
14134 : see if fp_classl exists
14135 set fp_classl d_fp_classl
14138 : see if pathconf exists
14139 set pathconf d_pathconf
14142 : see if fpathconf exists
14143 set fpathconf d_fpathconf
14146 : see if fpclass exists
14147 set fpclass d_fpclass
14150 : see if fpclassl exists
14151 set fpclassl d_fpclassl
14154 : see if fpgetround exists
14155 set fpgetround d_fpgetround
14158 : check for fpos64_t
14160 echo "Checking to see if you have fpos64_t..." >&4
14163 int main() { fpos64_t x = 7; }
14166 if eval $compile; then
14168 echo "You have fpos64_t."
14171 echo "You do not have fpos64_t."
14172 case "$fpossize" in
14173 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14180 : see if frexpl exists
14181 set frexpl d_frexpl
14184 : see if this is a sys/param system
14185 set sys/param.h i_sysparam
14188 : see if this is a sys/mount.h system
14189 set sys/mount.h i_sysmount
14192 : Check for fs_data_s
14194 echo "Checking to see if your system supports struct fs_data..." >&4
14195 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14197 case "$d_fs_data_s" in
14198 "$define") echo "Yes, it does." ;;
14199 *) echo "No, it doesn't." ;;
14202 : see if fseeko exists
14203 set fseeko d_fseeko
14205 case "$longsize" in
14206 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14209 : see if fsetpos exists
14210 set fsetpos d_fsetpos
14213 : see if fstatfs exists
14214 set fstatfs d_fstatfs
14217 : see if statvfs exists
14218 set statvfs d_statvfs
14221 : see if fstatvfs exists
14222 set fstatvfs d_fstatvfs
14225 : see if fsync exists
14229 : see if ftello exists
14230 set ftello d_ftello
14232 case "$longsize" in
14233 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14236 : check for a working futimes
14239 echo "Checking if you have a working futimes()" >&4
14242 #include <stdlib.h>
14243 #include <sys/time.h>
14246 #include <stdlib.h>
14251 fd = open ("try.c", O_RDWR);
14252 if (-1 == fd) exit (1);
14253 rv = futimes (fd, NULL);
14254 exit (rv == -1 ? errno : 0);
14258 if eval $compile; then
14262 0) echo "Yes, you have" >&4
14263 d_futimes="$define"
14265 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14269 echo "No, it does not (probably harmless)" >&4
14273 : look for gai_strerror
14275 $cat >try.c <<'EOCP'
14276 #include <sys/types.h>
14277 #include <sys/socket.h>
14281 return (gai_strerror (0) ? 0 : 1);
14286 if eval $compile; then
14289 0) echo "A working gai_strerror() found." >&4
14291 *) echo "gai_strerror() found, but it doesn't work" >&4
14295 echo "gai_strerror() NOT found." >&4
14301 : see if ndbm.h is available
14304 : Compatibility location for RedHat 7.1
14305 set gdbm/ndbm.h i_gdbmndbm
14307 : Compatibility location for Debian 4.0
14308 set gdbm-ndbm.h i_gdbm_ndbm
14312 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14313 : see if dbm_open exists
14314 set dbm_open d_dbm_open
14316 case "$d_dbm_open" in
14319 i_gdbmndbm="$undef"
14320 i_gdbm_ndbm="$undef"
14321 echo "We won't be including <ndbm.h>"
14331 ndbm_hdr_protochk='name=$1; hdr=$2;
14332 eval "ihdr=\$""i_$name";
14334 if $test "$ihdr" = "$define"; then
14335 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14336 case "$d_cplusplus" in
14337 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14338 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14341 $define) $echo "Your <$hdr> seems to have prototypes";;
14342 *) $echo "Your <$hdr> does not seem to have prototypes";;
14345 set "d_${name}_h_uses_prototypes";
14349 eval $ndbm_hdr_protochk
14350 set gdbmndbm gdbm/ndbm.h
14351 eval $ndbm_hdr_protochk
14352 set gdbm_ndbm gdbm-ndbm.h
14353 eval $ndbm_hdr_protochk
14355 : see if getaddrinfo exists
14356 set getaddrinfo d_getaddrinfo
14359 : see if getcwd exists
14360 set getcwd d_getcwd
14363 : check for getenv behavior
14364 case "$d_getenv_preserves_other_thread" in
14366 $echo "Checking to see if getenv() preserves a different thread's results" >&4
14368 #$i_stdlib I_STDLIB
14370 # include <stdlib.h>
14373 #include <string.h>
14374 #$i_pthread I_PTHREAD
14376 # include <pthread.h>
14380 thread_start(void * arg)
14382 return (void *) getenv("HOME");
14386 char * main_buffer;
14387 char save_main_buffer[1000];
14388 pthread_t subthread;
14389 pthread_attr_t attr;
14391 main_buffer = getenv("PATH");
14393 /* If too large for our generous allowance, return we couldn't figure it
14395 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
14399 strcpy(save_main_buffer, main_buffer);
14401 if (pthread_attr_init(&attr) != 0) {
14405 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
14409 if (pthread_join(subthread, NULL) != 0) {
14413 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
14418 if eval $compile_ok; then
14422 0) echo "getenv() didn't destroy another thread's buffer" >&4
14425 1) echo "getenv() does destroy another thread's buffer" >&4
14428 *) echo "Couldn't determine if getenv() destroys another thread's return value (code=$rc); assuming it does" >&4
14433 echo "(I can't seem to compile the test program.)" >&4
14434 echo "Assuming that your C library's getenv destroys another thread's return value." >&4
14437 set d_getenv_preserves_other_thread
14443 : see if getespwnam exists
14444 set getespwnam d_getespwnam
14447 : see if getfsstat exists
14448 set getfsstat d_getfsstat
14451 : see if getgrent exists
14452 set getgrent d_getgrent
14455 : see if getgrent_r exists
14456 set getgrent_r d_getgrent_r
14458 case "$d_getgrent_r" in
14460 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14461 case "$d_getgrent_r_proto:$usethreads" in
14462 ":define") d_getgrent_r_proto=define
14463 set d_getgrent_r_proto getgrent_r $hdrs
14467 case "$d_getgrent_r_proto" in
14469 case "$getgrent_r_proto" in
14470 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14471 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14473 case "$getgrent_r_proto" in
14474 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14475 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14477 case "$getgrent_r_proto" in
14478 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14479 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14481 case "$getgrent_r_proto" in
14482 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14483 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14485 case "$getgrent_r_proto" in
14486 ''|0) try='int getgrent_r(struct group*, char*, int);'
14487 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14489 case "$getgrent_r_proto" in
14490 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14491 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14493 case "$getgrent_r_proto" in
14494 ''|0) d_getgrent_r=undef
14496 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14497 * ) case "$getgrent_r_proto" in
14498 REENTRANT_PROTO*) ;;
14499 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14501 echo "Prototype: $try" ;;
14504 *) case "$usethreads" in
14505 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14512 *) getgrent_r_proto=0
14516 : see if getgrgid_r exists
14517 set getgrgid_r d_getgrgid_r
14519 case "$d_getgrgid_r" in
14521 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14522 case "$d_getgrgid_r_proto:$usethreads" in
14523 ":define") d_getgrgid_r_proto=define
14524 set d_getgrgid_r_proto getgrgid_r $hdrs
14528 case "$d_getgrgid_r_proto" in
14530 case "$getgrgid_r_proto" in
14531 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14532 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14534 case "$getgrgid_r_proto" in
14535 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14536 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14538 case "$getgrgid_r_proto" in
14539 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14540 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14542 case "$getgrgid_r_proto" in
14543 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14544 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14546 case "$getgrgid_r_proto" in
14547 ''|0) d_getgrgid_r=undef
14549 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14550 * ) case "$getgrgid_r_proto" in
14551 REENTRANT_PROTO*) ;;
14552 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14554 echo "Prototype: $try" ;;
14557 *) case "$usethreads" in
14558 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14565 *) getgrgid_r_proto=0
14569 : see if getgrnam_r exists
14570 set getgrnam_r d_getgrnam_r
14572 case "$d_getgrnam_r" in
14574 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14575 case "$d_getgrnam_r_proto:$usethreads" in
14576 ":define") d_getgrnam_r_proto=define
14577 set d_getgrnam_r_proto getgrnam_r $hdrs
14581 case "$d_getgrnam_r_proto" in
14583 case "$getgrnam_r_proto" in
14584 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14585 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14587 case "$getgrnam_r_proto" in
14588 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14589 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14591 case "$getgrnam_r_proto" in
14592 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14593 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14595 case "$getgrnam_r_proto" in
14596 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14597 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14599 case "$getgrnam_r_proto" in
14600 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14601 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14603 case "$getgrnam_r_proto" in
14604 ''|0) d_getgrnam_r=undef
14606 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14607 * ) case "$getgrnam_r_proto" in
14608 REENTRANT_PROTO*) ;;
14609 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14611 echo "Prototype: $try" ;;
14614 *) case "$usethreads" in
14615 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14622 *) getgrnam_r_proto=0
14626 : see if gethostbyaddr exists
14627 set gethostbyaddr d_gethbyaddr
14630 : see if gethostbyname exists
14631 set gethostbyname d_gethbyname
14634 : see if gethostent exists
14635 set gethostent d_gethent
14638 : see how we will look up host name
14641 if set gethostname val -f d_gethname; eval $csym; $val; then
14642 echo 'gethostname() found.' >&4
14643 d_gethname="$define"
14646 if set uname val -f d_uname; eval $csym; $val; then
14649 uname() was found, but you're running xenix, and older versions of xenix
14650 have a broken uname(). If you don't really know whether your xenix is old
14651 enough to have a broken system call, use the default answer.
14656 "$define") dflt=n;;
14658 rp='Is your uname() broken?'
14661 n*) d_uname="$define"; call=uname;;
14664 echo 'uname() found.' >&4
14671 case "$d_gethname" in
14672 '') d_gethname="$undef";;
14675 '') d_uname="$undef";;
14677 case "$d_uname$d_gethname" in
14682 Every now and then someone has a $call() that lies about the hostname
14683 but can't be fixed for political or economic reasons. If you wish, I can
14684 pretend $call() isn't there and maybe compute hostname at run-time
14685 thanks to the '$phostname' command.
14688 rp="Shall I ignore $call() from now on?"
14691 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14694 case "$phostname" in
14695 '') aphostname='';;
14696 *) case "$aphostname" in
14698 *) set X $phostname
14702 file=`./loc $file $file $pth`
14703 aphostname=`echo $file $*`
14708 case "$d_uname$d_gethname" in
14711 case "$phostname" in
14713 echo "There will be no way for $package to get your hostname." >&4;;
14715 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14719 case "$d_phostname" in
14720 '') d_phostname="$undef";;
14723 : see if gethostbyaddr_r exists
14724 set gethostbyaddr_r d_gethostbyaddr_r
14726 case "$d_gethostbyaddr_r" in
14728 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14729 case "$d_gethostbyaddr_r_proto:$usethreads" in
14730 ":define") d_gethostbyaddr_r_proto=define
14731 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14735 case "$d_gethostbyaddr_r_proto" in
14737 case "$gethostbyaddr_r_proto" in
14738 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14739 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14741 case "$gethostbyaddr_r_proto" in
14742 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14743 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14745 case "$gethostbyaddr_r_proto" in
14746 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14747 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14749 case "$gethostbyaddr_r_proto" in
14750 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14751 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14753 case "$gethostbyaddr_r_proto" in
14754 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14755 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14757 case "$gethostbyaddr_r_proto" in
14758 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14759 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14761 case "$gethostbyaddr_r_proto" in
14762 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14763 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14765 case "$gethostbyaddr_r_proto" in
14766 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14767 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14769 case "$gethostbyaddr_r_proto" in
14770 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14771 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14773 case "$gethostbyaddr_r_proto" in
14774 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14775 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14777 case "$gethostbyaddr_r_proto" in
14778 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14779 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14781 case "$gethostbyaddr_r_proto" in
14782 ''|0) d_gethostbyaddr_r=undef
14783 gethostbyaddr_r_proto=0
14784 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14785 * ) case "$gethostbyaddr_r_proto" in
14786 REENTRANT_PROTO*) ;;
14787 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14789 echo "Prototype: $try" ;;
14792 *) case "$usethreads" in
14793 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14795 d_gethostbyaddr_r=undef
14796 gethostbyaddr_r_proto=0
14800 *) gethostbyaddr_r_proto=0
14804 : see if gethostbyname_r exists
14805 set gethostbyname_r d_gethostbyname_r
14807 case "$d_gethostbyname_r" in
14809 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14810 case "$d_gethostbyname_r_proto:$usethreads" in
14811 ":define") d_gethostbyname_r_proto=define
14812 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14816 case "$d_gethostbyname_r_proto" in
14818 case "$gethostbyname_r_proto" in
14819 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14820 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14822 case "$gethostbyname_r_proto" in
14823 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14824 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14826 case "$gethostbyname_r_proto" in
14827 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14828 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14830 case "$gethostbyname_r_proto" in
14831 ''|0) d_gethostbyname_r=undef
14832 gethostbyname_r_proto=0
14833 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14834 * ) case "$gethostbyname_r_proto" in
14835 REENTRANT_PROTO*) ;;
14836 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14838 echo "Prototype: $try" ;;
14841 *) case "$usethreads" in
14842 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14844 d_gethostbyname_r=undef
14845 gethostbyname_r_proto=0
14849 *) gethostbyname_r_proto=0
14853 : see if gethostent_r exists
14854 set gethostent_r d_gethostent_r
14856 case "$d_gethostent_r" in
14858 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14859 case "$d_gethostent_r_proto:$usethreads" in
14860 ":define") d_gethostent_r_proto=define
14861 set d_gethostent_r_proto gethostent_r $hdrs
14865 case "$d_gethostent_r_proto" in
14867 case "$gethostent_r_proto" in
14868 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14869 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14871 case "$gethostent_r_proto" in
14872 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14873 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14875 case "$gethostent_r_proto" in
14876 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14877 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14879 case "$gethostent_r_proto" in
14880 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14881 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14883 case "$gethostent_r_proto" in
14884 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14885 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14887 case "$gethostent_r_proto" in
14888 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14889 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14891 case "$gethostent_r_proto" in
14892 ''|0) d_gethostent_r=undef
14893 gethostent_r_proto=0
14894 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14895 * ) case "$gethostent_r_proto" in
14896 REENTRANT_PROTO*) ;;
14897 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14899 echo "Prototype: $try" ;;
14902 *) case "$usethreads" in
14903 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14905 d_gethostent_r=undef
14906 gethostent_r_proto=0
14910 *) gethostent_r_proto=0
14914 : see if prototypes for various gethostxxx netdb.h functions are available
14916 set d_gethostprotos gethostent $i_netdb netdb.h
14919 : see if getitimer exists
14920 set getitimer d_getitimer
14923 : see if getlogin exists
14924 set getlogin d_getlogin
14927 : see if getlogin_r exists
14928 set getlogin_r d_getlogin_r
14930 case "$d_getlogin_r" in
14932 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14933 case "$d_getlogin_r_proto:$usethreads" in
14934 ":define") d_getlogin_r_proto=define
14935 set d_getlogin_r_proto getlogin_r $hdrs
14939 case "$d_getlogin_r_proto" in
14941 case "$getlogin_r_proto" in
14942 ''|0) try='int getlogin_r(char*, size_t);'
14943 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14945 case "$getlogin_r_proto" in
14946 ''|0) try='int getlogin_r(char*, int);'
14947 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14949 case "$getlogin_r_proto" in
14950 ''|0) try='char* getlogin_r(char*, size_t);'
14951 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14953 case "$getlogin_r_proto" in
14954 ''|0) try='char* getlogin_r(char*, int);'
14955 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14957 case "$getlogin_r_proto" in
14958 ''|0) d_getlogin_r=undef
14960 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14961 * ) case "$getlogin_r_proto" in
14962 REENTRANT_PROTO*) ;;
14963 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14965 echo "Prototype: $try" ;;
14968 *) case "$usethreads" in
14969 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14976 *) getlogin_r_proto=0
14980 : see if getmnt exists
14981 set getmnt d_getmnt
14984 : see if getmntent exists
14985 set getmntent d_getmntent
14988 : see if getnameinfo exists
14989 set getnameinfo d_getnameinfo
14992 : see if getnetbyaddr exists
14993 set getnetbyaddr d_getnbyaddr
14996 : see if getnetbyname exists
14997 set getnetbyname d_getnbyname
15000 : see if getnetent exists
15001 set getnetent d_getnent
15004 : see if getnetbyaddr_r exists
15005 set getnetbyaddr_r d_getnetbyaddr_r
15007 case "$d_getnetbyaddr_r" in
15009 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15010 case "$d_getnetbyaddr_r_proto:$usethreads" in
15011 ":define") d_getnetbyaddr_r_proto=define
15012 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
15016 case "$d_getnetbyaddr_r_proto" in
15018 case "$getnetbyaddr_r_proto" in
15019 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
15020 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
15022 case "$getnetbyaddr_r_proto" in
15023 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
15024 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
15026 case "$getnetbyaddr_r_proto" in
15027 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
15028 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
15030 case "$getnetbyaddr_r_proto" in
15031 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
15032 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
15034 case "$getnetbyaddr_r_proto" in
15035 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
15036 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15038 case "$getnetbyaddr_r_proto" in
15039 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15040 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15042 case "$getnetbyaddr_r_proto" in
15043 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15044 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15046 case "$getnetbyaddr_r_proto" in
15047 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15048 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15050 case "$getnetbyaddr_r_proto" in
15051 ''|0) d_getnetbyaddr_r=undef
15052 getnetbyaddr_r_proto=0
15053 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15054 * ) case "$getnetbyaddr_r_proto" in
15055 REENTRANT_PROTO*) ;;
15056 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15058 echo "Prototype: $try" ;;
15061 *) case "$usethreads" in
15062 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15064 d_getnetbyaddr_r=undef
15065 getnetbyaddr_r_proto=0
15069 *) getnetbyaddr_r_proto=0
15073 : see if getnetbyname_r exists
15074 set getnetbyname_r d_getnetbyname_r
15076 case "$d_getnetbyname_r" in
15078 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15079 case "$d_getnetbyname_r_proto:$usethreads" in
15080 ":define") d_getnetbyname_r_proto=define
15081 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15085 case "$d_getnetbyname_r_proto" in
15087 case "$getnetbyname_r_proto" in
15088 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15089 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15091 case "$getnetbyname_r_proto" in
15092 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15093 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15095 case "$getnetbyname_r_proto" in
15096 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15097 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15099 case "$getnetbyname_r_proto" in
15100 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15101 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15103 case "$getnetbyname_r_proto" in
15104 ''|0) d_getnetbyname_r=undef
15105 getnetbyname_r_proto=0
15106 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15107 * ) case "$getnetbyname_r_proto" in
15108 REENTRANT_PROTO*) ;;
15109 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15111 echo "Prototype: $try" ;;
15114 *) case "$usethreads" in
15115 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15117 d_getnetbyname_r=undef
15118 getnetbyname_r_proto=0
15122 *) getnetbyname_r_proto=0
15126 : see if getnetent_r exists
15127 set getnetent_r d_getnetent_r
15129 case "$d_getnetent_r" in
15131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15132 case "$d_getnetent_r_proto:$usethreads" in
15133 ":define") d_getnetent_r_proto=define
15134 set d_getnetent_r_proto getnetent_r $hdrs
15138 case "$d_getnetent_r_proto" in
15140 case "$getnetent_r_proto" in
15141 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15142 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15144 case "$getnetent_r_proto" in
15145 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15146 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15148 case "$getnetent_r_proto" in
15149 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15150 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15152 case "$getnetent_r_proto" in
15153 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15154 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15156 case "$getnetent_r_proto" in
15157 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15158 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15160 case "$getnetent_r_proto" in
15161 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15162 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15164 case "$getnetent_r_proto" in
15165 ''|0) d_getnetent_r=undef
15166 getnetent_r_proto=0
15167 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15168 * ) case "$getnetent_r_proto" in
15169 REENTRANT_PROTO*) ;;
15170 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15172 echo "Prototype: $try" ;;
15175 *) case "$usethreads" in
15176 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15178 d_getnetent_r=undef
15179 getnetent_r_proto=0
15183 *) getnetent_r_proto=0
15187 : see if prototypes for various getnetxxx netdb.h functions are available
15189 set d_getnetprotos getnetent $i_netdb netdb.h
15192 : see if getpagesize exists
15193 set getpagesize d_getpagsz
15196 : Optional checks for getprotobyname and getprotobynumber
15198 : see if getprotobyname exists
15199 set getprotobyname d_getpbyname
15202 : see if getprotobynumber exists
15203 set getprotobynumber d_getpbynumber
15206 : see if getprotoent exists
15207 set getprotoent d_getpent
15210 : see if getpgid exists
15211 set getpgid d_getpgid
15214 : see if getpgrp2 exists
15215 set getpgrp2 d_getpgrp2
15218 : see if getppid exists
15219 set getppid d_getppid
15222 : see if getpriority exists
15223 set getpriority d_getprior
15226 : see if getprotobyname_r exists
15227 set getprotobyname_r d_getprotobyname_r
15229 case "$d_getprotobyname_r" in
15231 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15232 case "$d_getprotobyname_r_proto:$usethreads" in
15233 ":define") d_getprotobyname_r_proto=define
15234 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15238 case "$d_getprotobyname_r_proto" in
15240 case "$getprotobyname_r_proto" in
15241 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15242 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15244 case "$getprotobyname_r_proto" in
15245 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15246 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15248 case "$getprotobyname_r_proto" in
15249 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15250 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15252 case "$getprotobyname_r_proto" in
15253 ''|0) d_getprotobyname_r=undef
15254 getprotobyname_r_proto=0
15255 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15256 * ) case "$getprotobyname_r_proto" in
15257 REENTRANT_PROTO*) ;;
15258 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15260 echo "Prototype: $try" ;;
15263 *) case "$usethreads" in
15264 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15266 d_getprotobyname_r=undef
15267 getprotobyname_r_proto=0
15271 *) getprotobyname_r_proto=0
15275 : see if getprotobynumber_r exists
15276 set getprotobynumber_r d_getprotobynumber_r
15278 case "$d_getprotobynumber_r" in
15280 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15281 case "$d_getprotobynumber_r_proto:$usethreads" in
15282 ":define") d_getprotobynumber_r_proto=define
15283 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15287 case "$d_getprotobynumber_r_proto" in
15289 case "$getprotobynumber_r_proto" in
15290 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15291 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15293 case "$getprotobynumber_r_proto" in
15294 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15295 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15297 case "$getprotobynumber_r_proto" in
15298 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15299 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15301 case "$getprotobynumber_r_proto" in
15302 ''|0) d_getprotobynumber_r=undef
15303 getprotobynumber_r_proto=0
15304 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15305 * ) case "$getprotobynumber_r_proto" in
15306 REENTRANT_PROTO*) ;;
15307 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15309 echo "Prototype: $try" ;;
15312 *) case "$usethreads" in
15313 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15315 d_getprotobynumber_r=undef
15316 getprotobynumber_r_proto=0
15320 *) getprotobynumber_r_proto=0
15324 : see if getprotoent_r exists
15325 set getprotoent_r d_getprotoent_r
15327 case "$d_getprotoent_r" in
15329 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15330 case "$d_getprotoent_r_proto:$usethreads" in
15331 ":define") d_getprotoent_r_proto=define
15332 set d_getprotoent_r_proto getprotoent_r $hdrs
15336 case "$d_getprotoent_r_proto" in
15338 case "$getprotoent_r_proto" in
15339 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15340 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15342 case "$getprotoent_r_proto" in
15343 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15344 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15346 case "$getprotoent_r_proto" in
15347 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15348 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15350 case "$getprotoent_r_proto" in
15351 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15352 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15354 case "$getprotoent_r_proto" in
15355 ''|0) d_getprotoent_r=undef
15356 getprotoent_r_proto=0
15357 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15358 * ) case "$getprotoent_r_proto" in
15359 REENTRANT_PROTO*) ;;
15360 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15362 echo "Prototype: $try" ;;
15365 *) case "$usethreads" in
15366 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15368 d_getprotoent_r=undef
15369 getprotoent_r_proto=0
15373 *) getprotoent_r_proto=0
15377 : see if prototypes for various getprotoxxx netdb.h functions are available
15379 set d_getprotoprotos getprotoent $i_netdb netdb.h
15382 : see if getprpwnam exists
15383 set getprpwnam d_getprpwnam
15386 : see if getpwent exists
15387 set getpwent d_getpwent
15390 : see if getpwent_r exists
15391 set getpwent_r d_getpwent_r
15393 case "$d_getpwent_r" in
15395 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15396 case "$d_getpwent_r_proto:$usethreads" in
15397 ":define") d_getpwent_r_proto=define
15398 set d_getpwent_r_proto getpwent_r $hdrs
15402 case "$d_getpwent_r_proto" in
15404 case "$getpwent_r_proto" in
15405 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15406 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15408 case "$getpwent_r_proto" in
15409 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15410 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15412 case "$getpwent_r_proto" in
15413 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15414 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15416 case "$getpwent_r_proto" in
15417 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15418 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15420 case "$getpwent_r_proto" in
15421 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15422 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15424 case "$getpwent_r_proto" in
15425 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15426 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15428 case "$getpwent_r_proto" in
15429 ''|0) d_getpwent_r=undef
15431 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15432 * ) case "$getpwent_r_proto" in
15433 REENTRANT_PROTO*) ;;
15434 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15436 echo "Prototype: $try" ;;
15439 *) case "$usethreads" in
15440 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15447 *) getpwent_r_proto=0
15451 : see if getpwnam_r exists
15452 set getpwnam_r d_getpwnam_r
15454 case "$d_getpwnam_r" in
15456 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15457 case "$d_getpwnam_r_proto:$usethreads" in
15458 ":define") d_getpwnam_r_proto=define
15459 set d_getpwnam_r_proto getpwnam_r $hdrs
15463 case "$d_getpwnam_r_proto" in
15465 case "$getpwnam_r_proto" in
15466 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15467 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15469 case "$getpwnam_r_proto" in
15470 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15471 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15473 case "$getpwnam_r_proto" in
15474 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15475 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15477 case "$getpwnam_r_proto" in
15478 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15479 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15481 case "$getpwnam_r_proto" in
15482 ''|0) d_getpwnam_r=undef
15484 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15485 * ) case "$getpwnam_r_proto" in
15486 REENTRANT_PROTO*) ;;
15487 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15489 echo "Prototype: $try" ;;
15492 *) case "$usethreads" in
15493 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15500 *) getpwnam_r_proto=0
15504 : see if getpwuid_r exists
15505 set getpwuid_r d_getpwuid_r
15507 case "$d_getpwuid_r" in
15509 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15510 case "$d_getpwuid_r_proto:$usethreads" in
15511 ":define") d_getpwuid_r_proto=define
15512 set d_getpwuid_r_proto getpwuid_r $hdrs
15516 case "$d_getpwuid_r_proto" in
15518 case "$getpwuid_r_proto" in
15519 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15520 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15522 case "$getpwuid_r_proto" in
15523 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15524 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15526 case "$getpwuid_r_proto" in
15527 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15528 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15530 case "$getpwuid_r_proto" in
15531 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15532 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15534 case "$getpwuid_r_proto" in
15535 ''|0) d_getpwuid_r=undef
15537 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15538 * ) case "$getpwuid_r_proto" in
15539 REENTRANT_PROTO*) ;;
15540 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15542 echo "Prototype: $try" ;;
15545 *) case "$usethreads" in
15546 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15553 *) getpwuid_r_proto=0
15557 : Optional checks for getsbyname and getsbyport
15559 : see if getservbyname exists
15560 set getservbyname d_getsbyname
15563 : see if getservbyport exists
15564 set getservbyport d_getsbyport
15567 : see if getservent exists
15568 set getservent d_getsent
15571 : see if getservbyname_r exists
15572 set getservbyname_r d_getservbyname_r
15574 case "$d_getservbyname_r" in
15576 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15577 case "$d_getservbyname_r_proto:$usethreads" in
15578 ":define") d_getservbyname_r_proto=define
15579 set d_getservbyname_r_proto getservbyname_r $hdrs
15583 case "$d_getservbyname_r_proto" in
15585 case "$getservbyname_r_proto" in
15586 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15587 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15589 case "$getservbyname_r_proto" in
15590 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15591 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15593 case "$getservbyname_r_proto" in
15594 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15595 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15597 case "$getservbyname_r_proto" in
15598 ''|0) d_getservbyname_r=undef
15599 getservbyname_r_proto=0
15600 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15601 * ) case "$getservbyname_r_proto" in
15602 REENTRANT_PROTO*) ;;
15603 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15605 echo "Prototype: $try" ;;
15608 *) case "$usethreads" in
15609 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15611 d_getservbyname_r=undef
15612 getservbyname_r_proto=0
15616 *) getservbyname_r_proto=0
15620 : see if getservbyport_r exists
15621 set getservbyport_r d_getservbyport_r
15623 case "$d_getservbyport_r" in
15625 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15626 case "$d_getservbyport_r_proto:$usethreads" in
15627 ":define") d_getservbyport_r_proto=define
15628 set d_getservbyport_r_proto getservbyport_r $hdrs
15632 case "$d_getservbyport_r_proto" in
15634 case "$getservbyport_r_proto" in
15635 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15636 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15638 case "$getservbyport_r_proto" in
15639 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15640 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15642 case "$getservbyport_r_proto" in
15643 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15644 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15646 case "$getservbyport_r_proto" in
15647 ''|0) d_getservbyport_r=undef
15648 getservbyport_r_proto=0
15649 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15650 * ) case "$getservbyport_r_proto" in
15651 REENTRANT_PROTO*) ;;
15652 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15654 echo "Prototype: $try" ;;
15657 *) case "$usethreads" in
15658 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15660 d_getservbyport_r=undef
15661 getservbyport_r_proto=0
15665 *) getservbyport_r_proto=0
15669 : see if getservent_r exists
15670 set getservent_r d_getservent_r
15672 case "$d_getservent_r" in
15674 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15675 case "$d_getservent_r_proto:$usethreads" in
15676 ":define") d_getservent_r_proto=define
15677 set d_getservent_r_proto getservent_r $hdrs
15681 case "$d_getservent_r_proto" in
15683 case "$getservent_r_proto" in
15684 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15685 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15687 case "$getservent_r_proto" in
15688 ''|0) try='int getservent_r(struct servent*, char*, int);'
15689 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15691 case "$getservent_r_proto" in
15692 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15693 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15695 case "$getservent_r_proto" in
15696 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15697 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15699 case "$getservent_r_proto" in
15700 ''|0) d_getservent_r=undef
15701 getservent_r_proto=0
15702 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15703 * ) case "$getservent_r_proto" in
15704 REENTRANT_PROTO*) ;;
15705 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15707 echo "Prototype: $try" ;;
15710 *) case "$usethreads" in
15711 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15713 d_getservent_r=undef
15714 getservent_r_proto=0
15718 *) getservent_r_proto=0
15722 : see if prototypes for various getservxxx netdb.h functions are available
15724 set d_getservprotos getservent $i_netdb netdb.h
15727 : see if getspnam exists
15728 set getspnam d_getspnam
15731 : see if this is a shadow.h system
15732 set shadow.h i_shadow
15735 : see if getspnam_r exists
15736 set getspnam_r d_getspnam_r
15738 case "$d_getspnam_r" in
15740 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15741 case "$d_getspnam_r_proto:$usethreads" in
15742 ":define") d_getspnam_r_proto=define
15743 set d_getspnam_r_proto getspnam_r $hdrs
15747 case "$d_getspnam_r_proto" in
15749 case "$getspnam_r_proto" in
15750 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15751 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15753 case "$getspnam_r_proto" in
15754 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15755 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15757 case "$getspnam_r_proto" in
15758 ''|0) d_getspnam_r=undef
15760 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15761 * ) case "$getspnam_r_proto" in
15762 REENTRANT_PROTO*) ;;
15763 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15765 echo "Prototype: $try" ;;
15768 *) case "$usethreads" in
15769 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15776 *) getspnam_r_proto=0
15780 : see if gettimeofday or ftime exists
15781 set gettimeofday d_gettimeod
15783 case "$d_gettimeod" in
15789 val="$undef"; set d_ftime; eval $setvar
15792 case "$d_gettimeod$d_ftime" in
15795 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15799 : see if gmtime_r exists
15800 set gmtime_r d_gmtime_r
15802 case "$d_gmtime_r" in
15804 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15805 case "$d_gmtime_r_proto:$usethreads" in
15806 ":define") d_gmtime_r_proto=define
15807 set d_gmtime_r_proto gmtime_r $hdrs
15811 case "$d_gmtime_r_proto" in
15813 case "$gmtime_r_proto" in
15814 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15815 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15817 case "$gmtime_r_proto" in
15818 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15819 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15821 case "$gmtime_r_proto" in
15822 ''|0) d_gmtime_r=undef
15824 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15825 * ) case "$gmtime_r_proto" in
15826 REENTRANT_PROTO*) ;;
15827 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15829 echo "Prototype: $try" ;;
15832 *) case "$usethreads" in
15833 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15840 *) gmtime_r_proto=0
15844 : see if hasmntopt exists
15845 set hasmntopt d_hasmntopt
15848 : see if this is a netinet/in.h or sys/in.h system
15849 set netinet/in.h i_niin sys/in.h i_sysin
15852 : see if arpa/inet.h has to be included
15853 set arpa/inet.h i_arpainet
15856 : see if htonl --and friends-- exists
15861 : Maybe they are macros.
15864 $cat >htonl.c <<EOM
15866 #include <sys/types.h>
15867 #$i_niin I_NETINET_IN
15869 #$i_arpainet I_ARPA_INET
15870 #ifdef I_NETINET_IN
15871 #include <netinet/in.h>
15874 #include <sys/in.h>
15877 #include <arpa/inet.h>
15880 printf("Defined as a macro.");
15883 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15884 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15886 echo "But it seems to be defined as a macro." >&4
15894 : see if hypot exists
15898 : see if ilogb exists
15902 : see if ilogbl exists
15903 set ilogbl d_ilogbl
15906 : check whether inet_aton exists
15907 set inet_aton d_inetaton
15910 : see if inet_ntop exists
15911 set inet_ntop d_inetntop
15914 : see if inet_pton exists
15915 set inet_pton d_inetpton
15920 $cat >isascii.c <<EOCP
15923 #$i_stdlib I_STDLIB
15925 #include <stdlib.h>
15936 if eval $compile; then
15937 echo "isascii() found." >&4
15940 echo "isascii() NOT found." >&4
15949 $cat >isblank.c <<'EOCP'
15960 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15961 echo "isblank() found." >&4
15964 echo "isblank() NOT found." >&4
15971 : check for isfinite
15972 echo "Checking to see if you have isfinite..." >&4
15975 int main() { return isfinite(0.0); }
15978 if eval $compile; then
15980 echo "You have isfinite."
15983 echo "You do not have isfinite."
15989 : see if isfinitel exists
15990 set isfinitel d_isfinitel
15994 echo "Checking to see if you have isinf..." >&4
15997 int main() { return isinf(0.0); }
16000 if eval $compile; then
16002 echo "You have isinf."
16005 echo "You do not have isinf."
16011 : see if isinfl exists
16012 set isinfl d_isinfl
16016 echo "Checking to see if you have isless..." >&4
16019 int main() { return isless(2.0, 1.0); }
16022 if eval $compile; then
16024 echo "You have isless."
16027 echo "You do not have isless."
16034 echo "Checking to see if you have isnan..." >&4
16037 int main() { return isnan(0.0); }
16040 if eval $compile; then
16042 echo "You have isnan."
16045 echo "You do not have isnan."
16051 : see if isnanl exists
16052 set isnanl d_isnanl
16055 : check for isnormal
16056 echo "Checking to see if you have isnormal..." >&4
16059 int main() { return isnormal(0.0); }
16062 if eval $compile; then
16064 echo "You have isnormal."
16067 echo "You do not have isnormal."
16077 : see if j0l exists
16081 : see if killpg exists
16082 set killpg d_killpg
16085 : see if localeconv exists
16086 set localeconv d_locconv
16089 : see if libc has the POSIX.1-2008 currency locale rules
16090 case "$d_locconv:$d_lc_monetary_2008" in
16093 #include <locale.h>
16095 struct lconv *lc = localeconv();
16096 char int_p_cs_precedes = lc->int_p_cs_precedes;
16101 if eval $compile; then
16102 d_lc_monetary_2008="$define"
16104 d_lc_monetary_2008="$undef"
16108 *) d_lc_monetary_2008="$undef"
16112 : see if lchown exists
16114 $cat > try.c <<EOCP
16117 #include <stdlib.h>
16118 #$i_unistd I_UNISTD
16120 # include <unistd.h>
16122 int main(int argc, char *argv[])
16124 if (lchown("./try.c", -1, getgid()) == -1) {
16125 exit(EXIT_FAILURE);
16127 exit(EXIT_SUCCESS);
16131 if eval $compile && ./try; then
16132 $echo "lchown() found." >&4
16135 $echo "lchown() NOT found." >&4
16142 : See if number of significant digits in a double precision number is known
16144 $cat >ldbl_dig.c <<EOM
16145 #include <limits.h>
16148 printf("Contains LDBL_DIG");
16151 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16152 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16153 echo "LDBL_DIG found." >&4
16156 echo "LDBL_DIG NOT found." >&4
16163 : see if lgamma exists
16164 set lgamma d_lgamma
16167 : see if lgamma_r exists
16168 set lgamma_r d_lgamma_r
16171 : check to see if math.h defines _LIB_VERSION
16172 d_libm_lib_version="$undef"
16174 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16176 #include <unistd.h>
16179 int main (int argc, char *argv[])
16181 printf ("%d\n", _LIB_VERSION);
16186 if eval $compile; then
16188 echo "Yes, it does ($foo)" >&4
16189 d_libm_lib_version="$define"
16191 echo "No, it does not (probably harmless)" >&4
16195 : see if link exists
16199 : see if llrint exists
16200 set llrint d_llrint
16203 : see if llrintl exists
16204 set llrintl d_llrintl
16207 : see if llround exists
16208 set llround d_llround
16211 : see if llroundl exists
16212 set llroundl d_llroundl
16215 : see if malloc/malloc.h has to be included
16216 set malloc/malloc.h i_mallocmalloc
16219 : see if this is a malloc.h system
16220 : we want a real compile instead of Inhdr because some systems have a
16221 : malloc.h that just gives a compile error saying to use stdlib.h instead
16224 #include <stdlib.h>
16225 #include <malloc.h>
16226 #$i_mallocmalloc I_MALLOCMALLOC
16227 #ifdef I_MALLOCMALLOC
16228 # include <malloc/malloc.h>
16231 int main () { return 0; }
16234 if eval $compile; then
16235 echo "<malloc.h> found." >&4
16238 echo "<malloc.h> NOT found." >&4
16245 : see if localtime_r exists
16246 set localtime_r d_localtime_r
16248 case "$d_localtime_r" in
16250 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16251 case "$d_localtime_r_proto:$usethreads" in
16252 ":define") d_localtime_r_proto=define
16253 set d_localtime_r_proto localtime_r $hdrs
16257 case "$d_localtime_r_proto" in
16259 case "$localtime_r_proto" in
16260 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16261 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16263 case "$localtime_r_proto" in
16264 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16265 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16267 case "$localtime_r_proto" in
16268 ''|0) d_localtime_r=undef
16269 localtime_r_proto=0
16270 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16271 * ) case "$localtime_r_proto" in
16272 REENTRANT_PROTO*) ;;
16273 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16275 echo "Prototype: $try" ;;
16278 *) case "$usethreads" in
16279 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16281 d_localtime_r=undef
16282 localtime_r_proto=0
16286 *) localtime_r_proto=0
16290 : see if localtime_r calls tzset
16291 case "$localtime_r_proto" in
16294 /* Does our libc's localtime_r call tzset ?
16295 * return 0 if so, 1 otherwise.
16297 #$i_systypes I_SYS_TYPES
16298 #$i_unistd I_UNISTD
16300 #$i_stdlib I_STDLIB
16301 #$i_malloc I_MALLOC
16303 # include <sys/types.h>
16306 # include <unistd.h>
16312 #include <stdlib.h>
16314 #include <string.h>
16316 # include <malloc.h>
16321 time_t t = time(0L);
16322 char w_tz[]="TZ" "=GMT+5",
16323 e_tz[]="TZ" "=GMT-5",
16324 *tz_e = (char*)malloc(16),
16325 *tz_w = (char*)malloc(16);
16326 struct tm tm_e, tm_w;
16327 memset(&tm_e,'\0',sizeof(struct tm));
16328 memset(&tm_w,'\0',sizeof(struct tm));
16333 localtime_r(&t, &tm_e);
16336 localtime_r(&t, &tm_w);
16338 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16341 free(tz_e);free(tz_w);
16346 if eval $compile; then
16347 if $run ./try; then
16348 d_localtime_r_needs_tzset=undef;
16350 d_localtime_r_needs_tzset=define;
16353 d_localtime_r_needs_tzset=undef;
16357 d_localtime_r_needs_tzset=undef;
16362 : see if lockf exists
16366 : see if log1p exists
16370 : see if log2 exists
16374 : see if logb exists
16378 : see if lrint exists
16382 : see if lrintl exists
16383 set lrintl d_lrintl
16386 : see if lround exists
16387 set lround d_lround
16390 : see if lroundl exists
16391 set lroundl d_lroundl
16394 : see if prototype for lseek is available
16396 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16399 : see if lstat exists
16403 : see if madvise exists
16404 set madvise d_madvise
16407 : see if malloc_size exists
16408 set malloc_size d_malloc_size
16411 : see if malloc_size_good exists
16412 set malloc_good_size d_malloc_good_size
16415 : see if malloc_usable_size exists
16416 set malloc_usable_size d_malloc_usable_size
16419 : see if mblen exists
16423 : see if mbrlen exists
16424 set mbrlen d_mbrlen
16427 : see if mbrtowc exists
16428 set mbrtowc d_mbrtowc
16431 : see if mbstowcs exists
16432 set mbstowcs d_mbstowcs
16435 : see if mbtowc exists
16436 set mbtowc d_mbtowc
16439 : see if memmem exists
16440 : We need both a prototype in string.h and the symbol in libc.
16443 xx1="#$d_gnulibc HAS_GNULIBC"
16444 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16445 xx3='# define _GNU_SOURCE'
16447 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16449 case "$d_memmem_proto" in
16450 define) # see if memmem exists
16451 set memmem d_memmem
16460 : see if memrchr exists
16461 : We need both a prototype in string.h and the symbol in libc.
16464 xx1="#$d_gnulibc HAS_GNULIBC"
16465 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16466 xx3='# define _GNU_SOURCE'
16468 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16470 case "$d_memrchr_proto" in
16471 define) # see if memrchr exists
16472 set memrchr d_memrchr
16481 : see if mkdir exists
16485 : see if mkdtemp exists
16486 set mkdtemp d_mkdtemp
16489 : see if mkfifo exists
16490 set mkfifo d_mkfifo
16493 : see if mkostemp exists
16494 set mkostemp d_mkostemp
16497 : see if mkstemp exists
16498 set mkstemp d_mkstemp
16501 : see if mkstemps exists
16502 set mkstemps d_mkstemps
16505 : see if mktime exists
16506 set mktime d_mktime
16509 : see if sys/mman.h has to be included
16510 set sys/mman.h i_sysmman
16513 : see if mmap exists
16516 : see what shmat returns
16517 : default to something harmless
16519 case "$i_sysmman$d_mmap" in
16521 $cat >mmap.c <<'END'
16522 #include <sys/mman.h>
16525 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16530 echo "and it returns ($mmaptype)." >&4
16534 : see if sqrtl exists
16538 : see if scalbnl exists
16539 set scalbnl d_scalbnl
16542 : see if truncl exists
16543 set truncl d_truncl
16546 : see if modfl exists
16550 : see if prototype for modfl is available
16552 set d_modflproto modfl define math.h
16555 if $test "$uselongdouble" = "$define"; then
16557 if $test "$d_sqrtl" != "$define"; then
16558 message="$message sqrtl"
16560 if $test "$d_modfl" != "$define"; then
16561 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16562 echo "You have both truncl and copysignl, so I can emulate modfl."
16564 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16565 echo "You have both aintl and copysignl, so I can emulate modfl."
16567 message="$message modfl"
16571 if $test "$d_frexpl" != "$define"; then
16572 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16573 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16575 message="$message frexpl"
16578 if $test "$d_ldexpl" != "$define"; then
16579 message="$message ldexpl"
16582 if $test "$message" != ""; then
16585 *** You requested the use of long doubles but you do not seem to have
16586 *** the following mathematical functions needed for long double support:
16588 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16589 *** Cannot continue, aborting.
16597 : see if mprotect exists
16598 set mprotect d_mprotect
16601 : see if msgctl exists
16602 set msgctl d_msgctl
16605 : see if msgget exists
16606 set msgget d_msgget
16609 : see if msgsnd exists
16610 set msgsnd d_msgsnd
16613 : see if msgrcv exists
16614 set msgrcv d_msgrcv
16617 : see how much of the 'msg*(2)' library is present.
16620 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16621 *"$undef"*) h_msg=false;;
16625 case "`ipcs 2>&1`" in
16626 "SVID messages"*"not configured"*)
16627 echo "Your $osname does not have the msg*(2) configured." >&4
16630 set msgctl d_msgctl
16632 set msgget d_msgget
16634 set msgsnd d_msgsnd
16636 set msgrcv d_msgrcv
16642 : we could also check for sys/ipc.h ...
16643 if $h_msg && $test `./findhdr sys/msg.h`; then
16644 echo "You have the full msg*(2) library." >&4
16647 echo "You don't have the full msg*(2) library." >&4
16653 : Check for msghdr_s
16655 echo "Checking to see if your system supports struct msghdr..." >&4
16656 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16658 case "$d_msghdr_s" in
16659 "$define") echo "Yes, it does." ;;
16660 *) echo "No, it doesn't." ;;
16663 : see if msync exists
16667 : see if munmap exists
16668 set munmap d_munmap
16671 : see if nan exists
16675 : see if nanosleep exists
16676 set nanosleep d_nanosleep
16679 : see if nearbyint exists
16680 set nearbyint d_nearbyint
16683 : see if nextafter exists
16684 set nextafter d_nextafter
16687 : see if nexttoward exists
16688 set nexttoward d_nexttoward
16691 : see if nice exists
16695 : see if this is a langinfo.h system
16696 set langinfo.h i_langinfo
16699 : see if nl_langinfo and/or nl_langinfo_l exist
16700 set nl_langinfo d_nl_langinfo
16702 set nl_langinfo_l d_nl_langinfo_l
16705 : Look for non 'int'-sized bitfields
16706 case "$d_non_int_bitfields" in
16709 echo "Checking whether your compiler can handle struct bitfields that aren't 'int' or 'unsigned int' ..." >&4
16710 $cat >try.c <<'EOCP'
16713 unsigned char byte:1;
16714 unsigned short halfword:1;
16717 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16718 if $compiler_warning try.out >/dev/null 2>&1; then
16719 echo "Your C compiler doesn't support struct bitfields that aren't 'int' or 'unsigned int'." >&4
16722 echo "Your C compiler supports struct bitfields besides 'int' and 'unsigned int'." >&4
16726 echo "Your C compiler doesn't seem to understand struct bitfields that aren't 'int' or 'unsigned int' at all." >&4
16730 *) val="$d_non_int_bitfields" ;;
16732 set d_non_int_bitfields
16736 : see if this is a quadmath.h system
16737 set quadmath.h i_quadmath
16740 : Check basic sizes
16742 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16744 case "$use64bitint:$d_quad:$quadtype" in
16747 uvtype="$uquadtype"
16752 uvtype="unsigned long"
16758 case "$uselongdouble:$d_longdbl" in
16760 nvtype="long double"
16761 nvsize=$longdblsize
16768 case "$usequadmath:$i_quadmath" in
16770 nvtype="__float128"
16772 : libquadmath is not in the usual places, and the place
16773 : changes if the compiler is upgraded. So ask the compiler if it
16775 : We do not need to save this, if it fails we abort.
16776 libs="$libs -lquadmath"
16779 #include <quadmath.h>
16781 int main(int argc, char *argv[]) {
16782 __float128 x = 1.0;
16783 if (fabsq(logq(x)) > 1e-6) {
16784 fputs("quadmath is broken\n", stderr);
16792 if eval $compile_ok; then
16798 *** You requested the use of the quadmath library, but
16799 *** it appears to be nonfunctional.
16800 *** Cannot continue, aborting.
16809 *** You requested the use of the quadmath library, but you
16810 *** do not seem to have the quadmath library installed.
16811 *** Cannot continue, aborting.
16816 define:*) $cat <<EOM >&4
16818 *** You requested the use of the quadmath library, but you
16819 *** do not seem to have the required header, <quadmath.h>.
16821 case "$gccversion" in
16824 *** Your gcc looks a bit old:
16830 *** You are not running a gcc.
16835 *** For the quadmath library you need at least gcc 4.6.
16836 *** Cannot continue, aborting.
16842 $echo "(IV will be "$ivtype", $ivsize bytes)"
16843 $echo "(UV will be "$uvtype", $uvsize bytes)"
16844 $echo "(NV will be "$nvtype", $nvsize bytes)"
16847 #$i_inttypes I_INTTYPES
16849 #include <inttypes.h>
16854 int8_t i = INT8_MAX;
16855 uint8_t u = UINT8_MAX;
16856 printf("int8_t\n");
16859 int16_t i = INT16_MAX;
16860 uint16_t u = UINT16_MAX;
16861 printf("int16_t\n");
16864 int32_t i = INT32_MAX;
16865 uint32_t u = UINT32_MAX;
16866 printf("int32_t\n");
16871 i8type="signed char"
16872 u8type="unsigned char"
16877 '') case "$shortsize" in
16879 u16type="unsigned short"
16887 '') set try -DINT16
16888 if eval $compile; then
16889 case "`$run ./try`" in
16901 '') if $test $shortsize -ge 2; then
16903 u16type="unsigned short"
16911 '') case "$longsize" in
16913 u32type="unsigned long"
16917 *) case "$intsize" in
16919 u32type="unsigned int"
16929 '') set try -DINT32
16930 if eval $compile; then
16931 case "`$run ./try`" in
16943 '') if $test $intsize -ge 4; then
16945 u32type="unsigned int"
16953 '') case "$d_quad:$quadtype" in
16955 i64type="$quadtype"
16956 u64type="$uquadtype"
16964 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16967 #$i_stdlib I_STDLIB
16969 #include <stdlib.h>
16971 #$i_inttypes I_INTTYPES
16973 #include <inttypes.h>
16975 #include <sys/types.h>
16976 #include <signal.h>
16978 /* volatile so that the compiler has to store it out to memory */
16979 volatile int bletched = 0;
16980 $signal_t blech(int s) { bletched = 1; }
16985 int n = 8 * $uvsize;
16988 signal(SIGFPE, blech);
16991 for (i = 0; i < n; i++) {
16992 u = u << 1 | ($uvtype)1;
16994 if (($uvtype)d != u)
16998 d = ($nvtype)(u - 1);
16999 if (($uvtype)d != (u - 1))
17006 printf("%d\n", ((i == n) ? -n : i));
17012 d_nv_preserves_uv="$undef"
17013 if eval $compile; then
17014 nv_preserves_uv_bits="`$run ./try`"
17016 case "$nv_preserves_uv_bits" in
17018 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
17019 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." >&4
17020 d_nv_preserves_uv="$define"
17022 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." >&4
17023 d_nv_preserves_uv="$undef" ;;
17024 *) $echo "Can't figure out how many bits your NVs preserve." >&4
17025 nv_preserves_uv_bits="0" ;;
17029 $echo "Checking to find the largest integer value your NVs can hold..." >&4
17033 typedef $nvtype NV;
17040 while(count < 256) {
17041 /* volatile so that the compiler has to store it out to memory */
17042 volatile NV up = value + 1.0;
17043 volatile NV negated = -value;
17044 volatile NV down = negated - 1.0;
17045 volatile NV got_up = up - value;
17046 int up_good = got_up == 1.0;
17047 int got_down = down - negated;
17048 int down_good = got_down == -1.0;
17050 if (down_good != up_good) {
17052 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
17053 up_good, (double) got_up, down_good, (double) got_down,
17054 count, (double) value);
17061 fputs("256.0", stdout);
17064 fputs("2.0", stdout);
17070 fputs("*", stdout);
17076 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17077 count, (double) value);
17083 nv_overflows_integers_at='0'
17084 if eval $compile; then
17090 The largest integer your NVs can preserve is equal to $xxx
17092 nv_overflows_integers_at="$xxx"
17095 Cannot determine the largest integer value your NVs can hold, unexpected output
17102 Cannot determine the largest integer value your NVs can hold
17109 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17112 #$i_stdlib I_STDLIB
17114 #include <stdlib.h>
17116 #include <string.h>
17117 #include <sys/types.h>
17118 #include <signal.h>
17120 /* volatile so that the compiler has to store it out to memory */
17121 volatile int bletched = 0;
17122 $signal_t blech(int s) { bletched = 1; }
17125 int checkit($nvtype d, const char *where) {
17127 unsigned char *p = (unsigned char *)v;
17128 unsigned char *end = p + sizeof(d);
17137 p = (unsigned char *)v;
17138 printf("No - %s: 0x", where);
17140 printf ("%02X", *p++);
17145 int main(int argc, char **argv) {
17148 fail += checkit(d, "0.0");
17150 /* The compiler shouldn't be assuming that bletched is 0 */
17153 fail += checkit(d, "bleched");
17156 signal(SIGFPE, blech);
17159 /* Paranoia - the compiler should have no way of knowing that ANSI says
17160 that argv[argc] will always be NULL. Actually, if it did assume this it
17161 would be buggy, as this is C and main() can be called from elsewhere in
17163 d = argv[argc] ? 1 : 0;
17166 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17169 fail += checkit(d, "ternary");
17171 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17174 printf("No - memset doesn't give 0.0\n");
17175 /* This might just blow up: */
17176 printf("(gives %g)\n", d);
17182 printf("No - something bleched\n");
17187 printf("No - %d fail(s)\n", fail);
17196 d_nv_zero_is_allbits_zero="$undef"
17197 if eval $compile; then
17203 0.0 is represented as all bits zero in memory
17205 d_nv_zero_is_allbits_zero="$define"
17208 0.0 is not represented as all bits zero in memory
17210 d_nv_zero_is_allbits_zero="$undef"
17215 0.0 is not represented as all bits zero in memory
17217 d_nv_zero_is_allbits_zero="$undef"
17223 : check for off64_t
17225 echo "Checking to see if you have off64_t..." >&4
17227 #include <sys/types.h>
17228 #include <unistd.h>
17229 int main() { off64_t x = 7; }
17232 if eval $compile; then
17234 echo "You have off64_t."
17237 echo "You do not have off64_t."
17238 case "$lseeksize" in
17239 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17246 : how to create joinable pthreads
17247 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17249 echo "Checking what constant to use for creating joinable pthreads..." >&4
17250 $cat >try.c <<'EOCP'
17251 #include <pthread.h>
17253 int detachstate = JOINABLE;
17256 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17257 if eval $compile; then
17258 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17259 val="$undef" # Yes, undef.
17260 set d_old_pthread_create_joinable
17263 set old_pthread_create_joinable
17266 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17267 if eval $compile; then
17268 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17270 set d_old_pthread_create_joinable
17272 val=PTHREAD_CREATE_UNDETACHED
17273 set old_pthread_create_joinable
17276 set try -DJOINABLE=__UNDETACHED
17277 if eval $compile; then
17278 echo "You seem to use __UNDETACHED." >&4
17280 set d_old_pthread_create_joinable
17283 set old_pthread_create_joinable
17286 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17288 set d_old_pthread_create_joinable
17291 set old_pthread_create_joinable
17298 d_old_pthread_create_joinable="$undef"
17299 old_pthread_create_joinable=""
17302 : see if pause exists
17306 : see if locale.h is available
17307 set locale.h i_locale
17310 : see if this system has wctype.h
17311 set wctype.h i_wctype
17314 : see if towupper exists
17315 set towupper d_towupper
17318 : check for setlocale function and behavior
17319 case "$d_setlocale" in
17323 Checking to see if you have setlocale() and its behavior
17326 #include <stdlib.h>
17327 #include <string.h>
17328 #$i_locale I_LOCALE
17330 # include <locale.h>
17332 #$i_wctype I_WCTYPE
17334 # include <wctype.h>
17338 const char * invalid_name = "\a"; /* This is really invalid! */
17339 int accepts_any_locale_name = 0;
17340 int has_C_UTF8 = 0;
17341 unsigned char bad_setlocale = 255;
17343 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17344 * disabled. It's hard to imagine an instance where meaningful locale
17345 * handling could be done without LC_CTYPE */
17346 const char * name = setlocale(LC_CTYPE, "C");
17348 if (name == NULL || strcmp(name, "C") != 0) {
17349 exit(bad_setlocale);
17352 name = setlocale(LC_CTYPE, invalid_name);
17353 if (name != NULL) {
17355 /* Let it pass if it accepts the name but gives back one of the C
17357 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17358 accepts_any_locale_name = 1;
17362 name = setlocale(LC_CTYPE, "C.UTF-8");
17363 if (name != NULL) {
17364 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17366 #$d_towupper HAS_TOWUPPER
17367 #ifdef HAS_TOWUPPER
17369 /* We assume that if the machine doesn't have the C99 towupper, it
17370 * doesn't have C.UTF-8, even if we successfully changed locales to
17371 * include it. This seems safer even on platforms that didn't accept
17372 * the really invalid name */
17374 if (towupper(y_with_diaeresis) == 0x178) {
17382 exit( 0 /* (separator - min_separator) << 3
17383 | uses_name_value_pair_names << 2
17386 | accepts_any_locale_name);
17393 case $d_setlocale in
17394 $undef) d_setlocale_accepts_any_locale_name="$undef"
17395 d_has_C_UTF8="false"
17398 if eval $compile; then
17399 echo "Your system has setlocale()..." >&4
17402 0) echo "and it seems sane; you don't have a C.UTF-8 locale" >&4
17403 d_setlocale="$define"
17404 d_setlocale_accepts_any_locale_name="$undef"
17405 d_has_C_UTF8="false"
17407 1) echo "and it seems sane, but accepts any locale name as valid" >&4
17408 d_setlocale="$define"
17409 d_setlocale_accepts_any_locale_name="$define"
17410 d_has_C_UTF8="false"
17412 2) echo "and it seems sane; you have a C.UTF-8 locale" >&4
17413 d_setlocale="$define"
17414 d_setlocale_accepts_any_locale_name="$undef"
17415 d_has_C_UTF8="true"
17417 3) echo "and it seems sane, but accepts any locale name as valid" >&4
17418 d_setlocale="$define"
17419 d_setlocale_accepts_any_locale_name="$define"
17420 d_has_C_UTF8="true"
17422 *) echo "but it doesn't seem to work, so we won't use it." >&4
17423 d_setlocale="$undef"
17424 d_setlocale_accepts_any_locale_name="$undef"
17425 d_has_C_UTF8="false"
17429 echo "your system does not have setlocale()" >&4
17430 d_setlocale="$undef"
17431 d_setlocale_accepts_any_locale_name="$undef"
17432 d_has_C_UTF8="false"
17437 *) val="$d_setlocale"
17440 case "$d_setlocale" in
17441 $undef) echo "There may be other ways to set the locale on your system, so we need to ask:" >&4
17444 rp="Does your system have the C.UTF-8 locale?"
17448 [Yy]*) d_has_C_UTF8="true"
17449 c_utf8_locale=" or C.UTF-8"
17451 *) d_has_C_UTF8="false"
17455 case "$d_setlocale" in
17457 rp="When you set your locale to something besides C$c_utf8_locale, does it actually do so? (Answer no if it just pretends to set it)" >&4
17462 d_setlocale_accepts_any_locale_name="$define"
17464 *) d_setlocale_accepts_any_locale_name="$undef"
17468 *) d_setlocale_accepts_any_locale_name="$undef"
17473 : Check the syntax of LC_ALL when categories are set to different locales
17475 $echo "Checking the syntax of LC_ALL when categories are set to different locales..." >&4
17477 case $d_setlocale in
17480 $cat >try.c <<'EOF'
17481 #include <limits.h>
17482 #include <locale.h>
17483 #include <stdlib.h>
17484 #include <string.h>
17490 main (const int argc, const char ** argv)
17495 # define C_ARRAY_LENGTH(a) (sizeof(a)/sizeof((a)[0]))
17496 # define strEQ(s1,s2) (strcmp(s1,s2) == 0)
17497 # define strNE(s1,s2) (strcmp(s1,s2) != 0)
17498 # define Copy(s,d,n,t) (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t))
17499 # define memEQ(s1,s2,l) (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
17500 # define memNE(s1,s2,l) (! memEQ(s1,s2,l))
17503 main (const int argc, const char ** argv)
17508 /* All categories Perl knows about on any system. If any are missing, this
17509 * won't work for that system, and they must be added here and in perl.h,
17511 const int categories[] = {
17525 # ifdef LC_MESSAGES
17528 # ifdef LC_MONETARY
17534 # ifdef LC_IDENTIFICATION
17537 # ifdef LC_MEASUREMENT
17543 # ifdef LC_TELEPHONE
17558 const char * category_names[] = {
17572 # ifdef LC_MESSAGES
17575 # ifdef LC_MONETARY
17581 # ifdef LC_IDENTIFICATION
17582 "LC_IDENTIFICATION",
17584 # ifdef LC_MEASUREMENT
17590 # ifdef LC_TELEPHONE
17605 char alternate[1024] = { '\0' } ;
17607 /* This is a list of locales that are likely to be found on any machine
17608 * (Windows and non-Windows) */
17609 const char * candidates[] = {
17617 char separator[1024];
17618 size_t separator_len = 0;
17619 unsigned int distincts_count = 0;
17621 /* We look through the candidates for one which returns the same non-C
17622 * locale for every category */
17623 for (unsigned int i = 0; i < C_ARRAY_LENGTH(candidates); i++) {
17624 const char * candidate = candidates[i];
17625 distincts_count = 0;
17626 alternate[0] = '\0';
17628 for (unsigned int j = 0; j < C_ARRAY_LENGTH(categories); j++) {
17629 const int category = categories[j];
17630 const char * locale_name = setlocale(category, candidate);
17632 if (locale_name == NULL) { /* Not on this system */
17636 if (debug) fprintf(stderr,
17638 " Return of setlocale(%d=%s, '%s') is '%s'\n",
17640 category, category_names[j],
17641 candidate, locale_name);
17643 /* If the candidate is indistinguishable from C, break to try the
17644 * next candidate */
17645 if (strEQ(locale_name, "C")) {
17649 /* Save the name the first time through, and on subsequent ones */
17650 /* make sure the name is the same as before, so the code below can
17651 * be assured of finding it when searching */
17653 strncpy(alternate, locale_name, sizeof(alternate));
17655 else if (strNE(alternate, locale_name)) {
17662 /* Done with this candidate. If every category returned the same non-C
17663 * name, this candidate works. It not, loop to try the next candidate
17665 if (distincts_count == C_ARRAY_LENGTH(categories)) {
17670 /* Here, either found a suitable candidate, or exhausted the possibilities.
17671 * In the latter case, give up */
17672 if (distincts_count < C_ARRAY_LENGTH(categories)) {
17673 fprintf(stderr, "Couldn't find a locale distinguishable from C\n");
17677 /* An example syntax, from cygwin, is:
17678 * LC_COLLATE/LC_CTYPE/LC_MONETARY/LC_NUMERIC/LC_TIME/LC_MESSAGES
17679 * The locales for a given category are always in the same position,
17680 * indicated above, with a slash separating them */
17682 int map_LC_ALL_position_to_category[C_ARRAY_LENGTH(categories)];
17685 for (unsigned int i = 0; i < C_ARRAY_LENGTH(categories); i++) {
17686 map_LC_ALL_position_to_category[i] = INT_MAX;
17689 const char * lc_all = NULL;
17691 /* We need to find the category that goes in each position */
17692 for (unsigned int i = 0; i < C_ARRAY_LENGTH(categories); i++) {
17694 /* First set everything to 'C' */
17695 if (! setlocale(LC_ALL, "C")) {
17696 fprintf(stderr, "Failed to set LC_ALL to C\n");
17700 /* Then set this category to the alternate */
17701 if (! setlocale(categories[i], alternate)) {
17702 fprintf(stderr, "Failed to set %d to to '%s'\n",
17703 categories[i], alternate);
17707 /* Then find what the system says LC_ALL looks like with just this one
17708 * category not set to 'C' */
17709 lc_all = setlocale(LC_ALL, NULL);
17711 fprintf(stderr, "Failed to retrieve LC_ALL\n");
17715 if (debug) fprintf(stderr, "LC_ALL is '%s'\n", lc_all);
17717 /* Assume is name=value pairs if the result contains both an equals and
17719 if (strchr(lc_all, '=') && strchr(lc_all, ';')) {
17720 fprintf(stdout, "\"=;\"\n\n");
17724 /* Here isn't name=value pairs. Find the position of the alternate */
17725 const char * alt_pos = strstr(lc_all, alternate);
17727 fprintf(stderr, "Couldn't find '%s' in '%s'\n", alternate, lc_all);
17731 /* Parse the LC_ALL string from the beginning up to where the alternate
17733 const char * s = lc_all;
17735 while (s < alt_pos) {
17737 /* Count the 'C' locales before the non-C one. (Note the letter
17738 * 'C' can only occur as the entire 'C' locale, since all of them
17739 * are that locale before 'alt_pos') */
17740 const char * next_C = (const char *) memchr(s, 'C', alt_pos - s);
17747 /* Here, there is no 'C' between 's' and the alternate locale, so
17748 * 'count' gives the total number of occurrences of 'C' in that
17749 * span. If count is 0, this is the first category in an LC_ALL
17750 * string, and we know its position, but not the separator. */
17755 /* When 'count' isn't 0, 's' points to one past the previous 'C'.
17756 * The separator starts here, ending just before the non-C locale.
17759 const char * new_sep = s;
17760 unsigned int new_sep_len = alt_pos - s;
17762 /* If we don't already have a separator saved, save this as it */
17763 if (separator_len == 0) {
17764 separator_len = new_sep_len;
17765 Copy(s, separator, separator_len, char);
17766 separator[separator_len] = '\0';
17768 else { /* Otherwise make sure it's the same string as previously
17770 if ( new_sep_len != separator_len
17771 || memNE(separator, new_sep, separator_len))
17773 fprintf(stderr, "Unexpectedly got distinct separators"
17774 " '%s' vs '%s\n", separator, new_sep);
17779 /* Here, we have found the position of category[i] in LC_ALL. */
17782 } /* End of loop parsing the LC_ALL string */
17784 if (map_LC_ALL_position_to_category[count] != INT_MAX) {
17785 fprintf(stderr, "Categories %d and %d both appear to occupy"
17786 " position %d in LC_ALL; there is something"
17787 " wrong with the calculation\n",
17788 categories[count], categories[i],
17793 /* Save the position of this category */
17794 map_LC_ALL_position_to_category[count] = categories[i];
17796 } /* End of loop through all the categories */
17798 fprintf(stdout, "\"%s\"\n{", separator);
17799 for (unsigned int i = 0; i < C_ARRAY_LENGTH(categories) - 1; i++) {
17800 fprintf(stdout, " %d,", map_LC_ALL_position_to_category[i]);
17802 fprintf(stdout, " %d }\n", map_LC_ALL_position_to_category[
17803 C_ARRAY_LENGTH(categories) - 1]);
17811 if eval $compile_ok; then
17812 output=`$run ./try 2>/dev/null`
17813 separator=`echo "$output" | $sed 1q`
17816 d_perl_lc_all_uses_name_value_pairs="$define"
17817 d_perl_lc_all_separator="$undef"
17818 perl_lc_all_separator=
17819 d_perl_lc_all_category_positions_init="$undef"
17820 perl_lc_all_category_positions_init=
17822 "") d_perl_lc_all_uses_name_value_pairs="$undef"
17823 d_perl_lc_all_separator="$undef"
17824 perl_lc_all_separator=
17825 d_perl_lc_all_category_positions_init="$undef"
17826 perl_lc_all_category_positions_init=
17828 *) d_perl_lc_all_uses_name_value_pairs="$undef"
17829 d_perl_lc_all_separator="$define"
17830 perl_lc_all_separator="$separator"
17831 d_perl_lc_all_category_positions_init="$define"
17832 perl_lc_all_category_positions_init=`echo "$output" | sed -n 2p`
17836 $echo "Failed to compile lc_all probe" >&4
17840 *) d_perl_lc_all_separator="$undef"
17841 perl_lc_all_separator=
17842 d_perl_lc_all_category_positions_init="$undef"
17843 perl_lc_all_category_positions_init=
17845 # No setlocale(), but using this default allows our code to compile
17846 # and run without having to have a bunch more #ifdef's
17847 d_perl_lc_all_uses_name_value_pairs="$define"
17851 : see if pipe2 exists
17855 : see if poll exists
17859 : see if prctl exists
17863 : see if prctl supports PR_SET_NAME
17864 d_prctl_set_name=$undef
17869 #include <unistd.h>
17871 #include <sys/prctl.h>
17873 int main (int argc, char *argv[])
17875 return (prctl (PR_SET_NAME, "Test"));
17879 if eval $compile_ok && $run ./try; then
17880 echo "Your prctl (PR_SET_NAME, ...) works"
17881 d_prctl_set_name=$define
17887 : see if readlink exists
17888 set readlink d_readlink
17891 : Check if there is a /proc symlink to the abs path of
17892 : the executing program. We will honor hints of d_procselfexe=$undef
17893 : or procselfexe being non-empty, otherwise will try to determine both
17894 : if we have readlink.
17895 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17896 : referenced, and AmigaOS does not have a proc filesystem anyway.
17899 if $test "X$d_procselfexe" = Xundef; then
17901 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17903 elif $test "X$d_readlink" = Xdefine; then
17904 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17905 : and it feels more tidy to avoid an extra level of symlink
17906 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17907 while test $# -gt 0; do
17910 if $issymlink $try; then
17911 $ls -l $try > reflect
17912 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17913 echo "You have $type-like $try."
17914 procselfexe='"'$try'"'
17916 : This will break out of the loop
17926 : backward compatibility for d_hvfork
17927 if test X$d_hvfork != X; then
17928 d_vfork="$d_hvfork"
17931 : see if there is a vfork
17936 d_pseudofork=$undef
17938 : Ok, but do we want to use it. vfork is reportedly unreliable in
17939 : perl on Solaris 2.x, and probably elsewhere.
17943 case "$usevfork" in
17949 Perl can only use a vfork() that doesn't suffer from strict
17950 restrictions on calling functions or modifying global data in
17951 the child. For example, glibc-2.1 contains such a vfork()
17952 that is unsuitable. If your system provides a proper fork()
17953 call, chances are that you do NOT want perl to use vfork().
17956 rp="Do you still want to use vfork()?"
17961 echo "Ok, we won't use vfork()."
17970 $define) usevfork='true';;
17971 *) usevfork='false';;
17974 : see whether the pthread_atfork exists
17976 #include <pthread.h>
17979 #ifdef PTHREAD_ATFORK
17980 pthread_atfork(NULL,NULL,NULL);
17985 : see if pthread_atfork exists
17986 set try -DPTHREAD_ATFORK
17987 if eval $compile; then
17992 case "$usethreads" in
17995 $define) echo 'pthread_atfork found.' >&4 ;;
17996 *) echo 'pthread_atfork NOT found.' >&4 ;;
17999 set d_pthread_atfork
18002 : see if pthread_attr_setscope exists
18003 set pthread_attr_setscope d_pthread_attr_setscope
18006 : see whether the various POSIXish _yields exist
18008 #include <pthread.h>
18014 #ifdef PTHREAD_YIELD
18017 #ifdef PTHREAD_YIELD_NULL
18018 pthread_yield(NULL);
18024 : see if sched_yield exists
18025 set try -DSCHED_YIELD
18026 if eval $compile; then
18028 sched_yield='sched_yield()'
18032 case "$usethreads" in
18035 $define) echo 'sched_yield() found.' >&4 ;;
18036 *) echo 'sched_yield() NOT found.' >&4 ;;
18042 : see if pthread_yield exists
18043 set try -DPTHREAD_YIELD
18044 if eval $compile; then
18046 case "$sched_yield" in
18047 '') sched_yield='pthread_yield()' ;;
18050 set try -DPTHREAD_YIELD_NULL
18051 if eval $compile; then
18053 case "$sched_yield" in
18054 '') sched_yield='pthread_yield(NULL)' ;;
18060 case "$usethreads" in
18063 $define) echo 'pthread_yield() found.' >&4 ;;
18064 *) echo 'pthread_yield() NOT found.' >&4 ;;
18068 set d_pthread_yield
18070 case "$sched_yield" in
18071 '') sched_yield=undef ;;
18075 : check for ptrdiff_t
18077 echo "Checking to see if you have ptrdiff_t..." >&4
18079 #include <stddef.h>
18080 int main() { ptrdiff_t x = 7; }
18083 if eval $compile; then
18085 echo "You have ptrdiff_t."
18088 echo "You do not have ptrdiff_t."
18094 : see if random_r exists
18095 set random_r d_random_r
18097 case "$d_random_r" in
18099 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18100 case "$d_random_r_proto:$usethreads" in
18101 ":define") d_random_r_proto=define
18102 set d_random_r_proto random_r $hdrs
18106 case "$d_random_r_proto" in
18108 case "$random_r_proto" in
18109 ''|0) try='int random_r(int*, struct random_data*);'
18110 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
18112 case "$random_r_proto" in
18113 ''|0) try='int random_r(long*, struct random_data*);'
18114 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
18116 case "$random_r_proto" in
18117 ''|0) try='int random_r(struct random_data*, int32_t*);'
18118 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
18120 case "$random_r_proto" in
18121 ''|0) d_random_r=undef
18123 echo "Disabling random_r, cannot determine prototype." >&4 ;;
18124 * ) case "$random_r_proto" in
18125 REENTRANT_PROTO*) ;;
18126 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
18128 echo "Prototype: $try" ;;
18131 *) case "$usethreads" in
18132 define) echo "random_r has no prototype, not using it." >&4 ;;
18139 *) random_r_proto=0
18143 : see if readdir and friends exist
18144 set readdir d_readdir
18146 set seekdir d_seekdir
18148 set telldir d_telldir
18150 set rewinddir d_rewinddir
18153 : see if readdir64_r exists
18154 set readdir64_r d_readdir64_r
18156 case "$d_readdir64_r" in
18158 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
18159 case "$d_readdir64_r_proto:$usethreads" in
18160 ":define") d_readdir64_r_proto=define
18161 set d_readdir64_r_proto readdir64_r $hdrs
18165 case "$d_readdir64_r_proto" in
18167 case "$readdir64_r_proto" in
18168 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
18169 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
18171 case "$readdir64_r_proto" in
18172 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
18173 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
18175 case "$readdir64_r_proto" in
18176 ''|0) d_readdir64_r=undef
18177 readdir64_r_proto=0
18178 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
18179 * ) case "$readdir64_r_proto" in
18180 REENTRANT_PROTO*) ;;
18181 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
18183 echo "Prototype: $try" ;;
18186 *) case "$usethreads" in
18187 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
18189 d_readdir64_r=undef
18190 readdir64_r_proto=0
18194 *) readdir64_r_proto=0
18198 : see if readdir_r exists
18199 set readdir_r d_readdir_r
18201 case "$d_readdir_r" in
18203 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
18204 case "$d_readdir_r_proto:$usethreads" in
18205 ":define") d_readdir_r_proto=define
18206 set d_readdir_r_proto readdir_r $hdrs
18210 case "$d_readdir_r_proto" in
18212 case "$readdir_r_proto" in
18213 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
18214 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
18216 case "$readdir_r_proto" in
18217 ''|0) try='int readdir_r(DIR*, struct dirent*);'
18218 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
18220 case "$readdir_r_proto" in
18221 ''|0) d_readdir_r=undef
18223 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
18224 * ) case "$readdir_r_proto" in
18225 REENTRANT_PROTO*) ;;
18226 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
18228 echo "Prototype: $try" ;;
18231 *) case "$usethreads" in
18232 define) echo "readdir_r has no prototype, not using it." >&4 ;;
18239 *) readdir_r_proto=0
18243 : see if readv exists
18247 : see if recvmsg exists
18248 set recvmsg d_recvmsg
18251 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
18253 if set regcomp val -f d_regcomp; eval $csym; $val; then
18254 echo 'regcomp() found.' >&4
18255 d_regcomp="$define"
18258 elif set regcmp val -f d_regcmp; eval $csym; $val; then
18259 echo 'regcmp() found.' >&4
18263 elif set re_comp val -f d_re_comp; eval $csym; $val; then
18264 echo 're_comp() found, assuming re_exec() also exists.' >&4
18265 d_re_comp="$define"
18270 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
18277 : see if remainder exists
18278 set remainder d_remainder
18281 : see if remquo exists
18282 set remquo d_remquo
18285 : see if rename exists
18286 set rename d_rename
18289 : see if rint exists
18293 : see if rmdir exists
18297 : see if round exists
18301 : see if prototype for sbrk is available
18303 set d_sbrkproto sbrk $i_unistd unistd.h
18306 : see if scalbn exists
18307 set scalbn d_scalbn
18310 : see if select exists
18311 set select d_select
18314 : see if semctl exists
18315 set semctl d_semctl
18318 : see if semget exists
18319 set semget d_semget
18322 : see if semop exists
18326 : see how much of the 'sem*(2)' library is present.
18329 case "$d_semctl$d_semget$d_semop" in
18330 *"$undef"*) h_sem=false;;
18334 case "`ipcs 2>&1`" in
18335 "SVID messages"*"not configured"*)
18336 echo "Your $osname does not have the sem*(2) configured." >&4
18339 set semctl d_semctl
18341 set semget d_semget
18349 : we could also check for sys/ipc.h ...
18350 if $h_sem && $test `./findhdr sys/sem.h`; then
18351 echo "You have the full sem*(2) library." >&4
18354 echo "You don't have the full sem*(2) library." >&4
18360 : see whether sys/sem.h defines union semun
18362 $cat > try.c <<'END'
18363 #include <sys/types.h>
18364 #include <sys/ipc.h>
18365 #include <sys/sem.h>
18366 int main () { union semun semun; semun.buf = 0; }
18369 if eval $compile; then
18370 echo "You have union semun in <sys/sem.h>." >&4
18373 echo "You do not have union semun in <sys/sem.h>." >&4
18380 : see how to do semctl IPC_STAT
18384 $cat > tryh.h <<END
18387 # define S_IRUSR S_IREAD
18388 # define S_IWUSR S_IWRITE
18389 # define S_IXUSR S_IEXEC
18391 # define S_IRUSR 0400
18392 # define S_IWUSR 0200
18393 # define S_IXUSR 0100
18395 # define S_IRGRP (S_IRUSR>>3)
18396 # define S_IWGRP (S_IWUSR>>3)
18397 # define S_IXGRP (S_IXUSR>>3)
18398 # define S_IROTH (S_IRUSR>>6)
18399 # define S_IWOTH (S_IWUSR>>6)
18400 # define S_IXOTH (S_IXUSR>>6)
18403 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
18404 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18405 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18408 : see whether semctl IPC_STAT can use union semun
18409 case "$d_semctl_semun" in
18413 #include <sys/types.h>
18414 #include <sys/ipc.h>
18415 #include <sys/sem.h>
18416 #include <sys/stat.h>
18423 #$d_union_semun HAS_UNION_SEMUN
18426 #ifndef HAS_UNION_SEMUN
18429 struct semid_ds *buf;
18430 unsigned short *array;
18436 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18437 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18439 struct semid_ds argbuf;
18442 st = semctl(sem, 0, IPC_STAT, arg);
18446 # endif /* IPC_STAT */
18447 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18449 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18450 # endif /* IPC_RMID */
18451 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18453 #endif /* IPC_PRIVATE && ... */
18454 printf("semget failed: errno = %d\n", errno);
18459 if eval $compile; then
18462 semun) val="$define" ;;
18470 case "$d_semctl_semun" in
18472 echo "You can use union semun for semctl IPC_STAT." >&4
18475 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18480 : see whether semctl IPC_STAT can use struct semid_ds pointer
18481 case "$d_semctl_semid_ds" in
18484 $cat > try.c <<'END'
18485 #include <sys/types.h>
18486 #include <sys/ipc.h>
18487 #include <sys/sem.h>
18488 #include <sys/stat.h>
18497 #ifndef HAS_UNION_SEMUN
18500 struct semid_ds *buf;
18501 unsigned short *array;
18505 struct semid_ds argbuf;
18508 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18509 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18513 st = semctl(sem, 0, IPC_STAT, arg);
18515 printf("semid_ds\n");
18517 # endif /* IPC_STAT */
18518 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18520 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18521 # endif /* IPC_RMID */
18522 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18524 #endif /* IPC_PRIVATE && ... */
18525 printf("semget failed: errno = %d\n", errno);
18531 if eval $compile; then
18534 semid_ds) val="$define" ;;
18538 set d_semctl_semid_ds
18542 case "$d_semctl_semid_ds" in
18544 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18546 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18552 # We do not have the full sem*(2) library, so assume we can not
18558 set d_semctl_semid_ds
18564 : see if sendmsg exists
18565 set sendmsg d_sendmsg
18568 : see if setegid exists
18569 set setegid d_setegid
18572 : see if setenv exists
18573 set setenv d_setenv
18576 : see if seteuid exists
18577 set seteuid d_seteuid
18580 : see if setgrent exists
18581 set setgrent d_setgrent
18584 : see if setgrent_r exists
18585 set setgrent_r d_setgrent_r
18587 case "$d_setgrent_r" in
18589 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18590 case "$d_setgrent_r_proto:$usethreads" in
18591 ":define") d_setgrent_r_proto=define
18592 set d_setgrent_r_proto setgrent_r $hdrs
18596 case "$d_setgrent_r_proto" in
18598 case "$setgrent_r_proto" in
18599 ''|0) try='int setgrent_r(FILE**);'
18600 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18602 case "$setgrent_r_proto" in
18603 ''|0) try='void setgrent_r(FILE**);'
18604 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18606 case "$setgrent_r_proto" in
18607 ''|0) d_setgrent_r=undef
18609 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18610 * ) case "$setgrent_r_proto" in
18611 REENTRANT_PROTO*) ;;
18612 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18614 echo "Prototype: $try" ;;
18617 *) case "$usethreads" in
18618 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18625 *) setgrent_r_proto=0
18629 : see if sethostent exists
18630 set sethostent d_sethent
18633 : see if sethostent_r exists
18634 set sethostent_r d_sethostent_r
18636 case "$d_sethostent_r" in
18638 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18639 case "$d_sethostent_r_proto:$usethreads" in
18640 ":define") d_sethostent_r_proto=define
18641 set d_sethostent_r_proto sethostent_r $hdrs
18645 case "$d_sethostent_r_proto" in
18647 case "$sethostent_r_proto" in
18648 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18649 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18651 case "$sethostent_r_proto" in
18652 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18653 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18655 case "$sethostent_r_proto" in
18656 ''|0) d_sethostent_r=undef
18657 sethostent_r_proto=0
18658 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18659 * ) case "$sethostent_r_proto" in
18660 REENTRANT_PROTO*) ;;
18661 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18663 echo "Prototype: $try" ;;
18666 *) case "$usethreads" in
18667 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18669 d_sethostent_r=undef
18670 sethostent_r_proto=0
18674 *) sethostent_r_proto=0
18678 : see if setitimer exists
18679 set setitimer d_setitimer
18682 : see if setlinebuf exists
18683 set setlinebuf d_setlinebuf
18686 : see if setlocale_r exists
18687 set setlocale_r d_setlocale_r
18689 case "$d_setlocale_r" in
18691 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18692 case "$d_setlocale_r_proto:$usethreads" in
18693 ":define") d_setlocale_r_proto=define
18694 set d_setlocale_r_proto setlocale_r $hdrs
18698 case "$d_setlocale_r_proto" in
18700 case "$setlocale_r_proto" in
18701 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18702 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18704 case "$setlocale_r_proto" in
18705 ''|0) d_setlocale_r=undef
18706 setlocale_r_proto=0
18707 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18708 * ) case "$setlocale_r_proto" in
18709 REENTRANT_PROTO*) ;;
18710 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18712 echo "Prototype: $try" ;;
18715 *) case "$usethreads" in
18716 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18718 d_setlocale_r=undef
18719 setlocale_r_proto=0
18723 *) setlocale_r_proto=0
18727 : see if setnetent exists
18728 set setnetent d_setnent
18731 : see if setnetent_r exists
18732 set setnetent_r d_setnetent_r
18734 case "$d_setnetent_r" in
18736 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18737 case "$d_setnetent_r_proto:$usethreads" in
18738 ":define") d_setnetent_r_proto=define
18739 set d_setnetent_r_proto setnetent_r $hdrs
18743 case "$d_setnetent_r_proto" in
18745 case "$setnetent_r_proto" in
18746 ''|0) try='int setnetent_r(int, struct netent_data*);'
18747 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18749 case "$setnetent_r_proto" in
18750 ''|0) try='void setnetent_r(int, struct netent_data*);'
18751 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18753 case "$setnetent_r_proto" in
18754 ''|0) d_setnetent_r=undef
18755 setnetent_r_proto=0
18756 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18757 * ) case "$setnetent_r_proto" in
18758 REENTRANT_PROTO*) ;;
18759 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18761 echo "Prototype: $try" ;;
18764 *) case "$usethreads" in
18765 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18767 d_setnetent_r=undef
18768 setnetent_r_proto=0
18772 *) setnetent_r_proto=0
18776 : see if setprotoent exists
18777 set setprotoent d_setpent
18780 : see if setpgid exists
18781 set setpgid d_setpgid
18784 : see if setpgrp2 exists
18785 set setpgrp2 d_setpgrp2
18788 : see if setpriority exists
18789 set setpriority d_setprior
18792 : see if setproctitle exists
18793 set setproctitle d_setproctitle
18796 : see if setprotoent_r exists
18797 set setprotoent_r d_setprotoent_r
18799 case "$d_setprotoent_r" in
18801 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18802 case "$d_setprotoent_r_proto:$usethreads" in
18803 ":define") d_setprotoent_r_proto=define
18804 set d_setprotoent_r_proto setprotoent_r $hdrs
18808 case "$d_setprotoent_r_proto" in
18810 case "$setprotoent_r_proto" in
18811 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18812 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18814 case "$setprotoent_r_proto" in
18815 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18816 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18818 case "$setprotoent_r_proto" in
18819 ''|0) d_setprotoent_r=undef
18820 setprotoent_r_proto=0
18821 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18822 * ) case "$setprotoent_r_proto" in
18823 REENTRANT_PROTO*) ;;
18824 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18826 echo "Prototype: $try" ;;
18829 *) case "$usethreads" in
18830 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18832 d_setprotoent_r=undef
18833 setprotoent_r_proto=0
18837 *) setprotoent_r_proto=0
18841 : see if setpwent exists
18842 set setpwent d_setpwent
18845 : see if setpwent_r exists
18846 set setpwent_r d_setpwent_r
18848 case "$d_setpwent_r" in
18850 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18851 case "$d_setpwent_r_proto:$usethreads" in
18852 ":define") d_setpwent_r_proto=define
18853 set d_setpwent_r_proto setpwent_r $hdrs
18857 case "$d_setpwent_r_proto" in
18859 case "$setpwent_r_proto" in
18860 ''|0) try='int setpwent_r(FILE**);'
18861 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18863 case "$setpwent_r_proto" in
18864 ''|0) try='void setpwent_r(FILE**);'
18865 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18867 case "$setpwent_r_proto" in
18868 ''|0) d_setpwent_r=undef
18870 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18871 * ) case "$setpwent_r_proto" in
18872 REENTRANT_PROTO*) ;;
18873 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18875 echo "Prototype: $try" ;;
18878 *) case "$usethreads" in
18879 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18886 *) setpwent_r_proto=0
18890 : see if setregid exists
18891 set setregid d_setregid
18893 set setresgid d_setresgid
18896 : see if setreuid exists
18897 set setreuid d_setreuid
18899 set setresuid d_setresuid
18902 : see if setrgid exists
18903 set setrgid d_setrgid
18906 : see if setruid exists
18907 set setruid d_setruid
18910 : see if setservent exists
18911 set setservent d_setsent
18914 : see if setservent_r exists
18915 set setservent_r d_setservent_r
18917 case "$d_setservent_r" in
18919 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18920 case "$d_setservent_r_proto:$usethreads" in
18921 ":define") d_setservent_r_proto=define
18922 set d_setservent_r_proto setservent_r $hdrs
18926 case "$d_setservent_r_proto" in
18928 case "$setservent_r_proto" in
18929 ''|0) try='int setservent_r(int, struct servent_data*);'
18930 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18932 case "$setservent_r_proto" in
18933 ''|0) try='void setservent_r(int, struct servent_data*);'
18934 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18936 case "$setservent_r_proto" in
18937 ''|0) d_setservent_r=undef
18938 setservent_r_proto=0
18939 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18940 * ) case "$setservent_r_proto" in
18941 REENTRANT_PROTO*) ;;
18942 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18944 echo "Prototype: $try" ;;
18947 *) case "$usethreads" in
18948 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18950 d_setservent_r=undef
18951 setservent_r_proto=0
18955 *) setservent_r_proto=0
18959 : see if setsid exists
18960 set setsid d_setsid
18963 : see if setvbuf exists
18964 set setvbuf d_setvbuf
18967 : see if shmctl exists
18968 set shmctl d_shmctl
18971 : see if shmget exists
18972 set shmget d_shmget
18975 : see if shmat exists
18978 : see what shmat returns
18981 $cat >shmat.c <<'END'
18982 #include <sys/shm.h>
18985 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18990 echo "and it returns ($shmattype)." >&4
18991 : see if a prototype for shmat is available
18992 xxx=`./findhdr sys/shm.h`
18993 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18994 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
19005 set d_shmatprototype
19008 : see if shmdt exists
19012 : see how much of the 'shm*(2)' library is present.
19015 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
19016 *"$undef"*) h_shm=false;;
19020 case "`ipcs 2>&1`" in
19021 "SVID shared memory"*"not configured"*)
19022 echo "Your $osname does not have the shm*(2) configured." >&4
19025 set shmctl d_shmctl
19027 set shmget d_shmget
19037 : we could also check for sys/ipc.h ...
19038 if $h_shm && $test `./findhdr sys/shm.h`; then
19039 echo "You have the full shm*(2) library." >&4
19042 echo "You don't have the full shm*(2) library." >&4
19048 : see if we have sigaction
19050 if set sigaction val -f d_sigaction; eval $csym; $val; then
19051 echo 'sigaction() found.' >&4
19054 #include <sys/types.h>
19055 #include <signal.h>
19056 #$i_stdlib I_STDLIB
19058 #include <stdlib.h>
19062 struct sigaction act, oact;
19064 oact.sa_handler = 0;
19065 /* so that act and oact are used */
19066 exit(act.sa_flags == 0 && oact.sa_handler == 0);
19070 if eval $compile_ok; then
19073 echo "But you don't seem to have a usable struct sigaction." >&4
19077 echo 'sigaction NOT found.' >&4
19080 set d_sigaction; eval $setvar
19083 : see what type pids are declared as in the kernel
19084 rp="What is the type of process ids on this system?"
19085 set pid_t pidtype int stdio.h sys/types.h
19088 : see what type uids are declared as in the kernel
19090 echo "Looking for the type for user ids returned by getuid()."
19091 set uid_t uidtype xxx stdio.h sys/types.h
19095 xxx=`./findhdr sys/user.h`
19096 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19098 unsigned) dflt="$1 $2" ;;
19102 *) dflt="$uidtype";;
19105 uid_t) echo "uid_t found." ;;
19106 *) rp="What is the type for user ids returned by getuid()?"
19112 : Define hasfield_t macro for Configure internal use
19113 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
19114 while $test $# -ge 2; do
19116 $define) echo "#include <$2>";;
19120 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
19122 if eval $compile; then
19131 : see what siginfo fields we have
19132 case "$d_sigaction" in
19134 echo "Checking if your siginfo_t has si_errno field...">&4
19135 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
19138 echo "Checking if your siginfo_t has si_pid field...">&4
19139 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
19142 echo "Checking if your siginfo_t has si_uid field...">&4
19143 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
19146 echo "Checking if your siginfo_t has si_addr field...">&4
19147 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
19150 echo "Checking if your siginfo_t has si_status field...">&4
19151 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
19154 echo "Checking if your siginfo_t has si_band field...">&4
19155 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
19158 echo "Checking if your siginfo_t has si_value field...">&4
19159 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
19162 echo "Checking if your siginfo_t has si_fd field...">&4
19163 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
19168 d_siginfo_si_errno="$undef"
19169 d_siginfo_si_pid="$undef"
19170 d_siginfo_si_uid="$undef"
19171 d_siginfo_si_addr="$undef"
19172 d_siginfo_si_status="$undef"
19173 d_siginfo_si_band="$undef"
19174 d_siginfo_si_value="$undef"
19175 d_siginfo_si_fd="$undef"
19179 : see if this is a sunmath.h system
19180 set sunmath.h i_sunmath
19183 : see if signbit exists
19184 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
19186 #$i_sunmath I_SUNMATH
19188 #ifdef I_SUNMATH /* Solaris special math library */
19189 # include <sunmath.h>
19192 int main(int argc, char **argv)
19196 if ((signbit(x) == 0) && (signbit(y) != 0))
19204 if eval $compile; then
19205 if $run ./try; then
19209 $echo "Signbit seems to be available, but doesn't work as I expected."
19210 $echo "I won't use it." >&4
19221 : see if sigprocmask exists
19222 set sigprocmask d_sigprocmask
19225 : see if sigsetjmp exists
19227 case "$d_sigsetjmp" in
19230 #include <setjmp.h>
19231 #$i_stdlib I_STDLIB
19233 #include <stdlib.h>
19239 if (sigsetjmp(env,1))
19242 siglongjmp(env, 1);
19247 if eval $compile; then
19248 if $run ./try >/dev/null 2>&1; then
19249 echo "POSIX sigsetjmp found." >&4
19253 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
19259 echo "sigsetjmp not found." >&4
19263 *) val="$d_sigsetjmp"
19264 case "$d_sigsetjmp" in
19265 $define) echo "POSIX sigsetjmp found." >&4;;
19266 $undef) echo "sigsetjmp not found." >&4;;
19274 : see if snprintf exists
19275 set snprintf d_snprintf
19278 : see if vsnprintf exists
19279 set vsnprintf d_vsnprintf
19282 case "$d_snprintf-$d_vsnprintf" in
19285 Checking whether your snprintf() and vsnprintf() work okay...
19287 $cat >try.c <<'EOCP'
19288 /* v?snprintf testing logic courtesy of Russ Allbery.
19289 * According to C99:
19290 * - if the buffer is too short it still must be \0-terminated
19291 * - if the buffer is too short the potentially required length
19292 * must be returned and not -1
19293 * - if the buffer is NULL the potentially required length
19294 * must be returned and not -1 or core dump
19297 #include <stdarg.h>
19301 int test (char *format, ...)
19306 va_start (args, format);
19307 count = vsnprintf (buf, sizeof buf, format, args);
19314 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
19315 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
19319 if eval $compile; then
19322 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
19324 Your snprintf() and snprintf() don't seem to be working okay.
19326 d_snprintf="$undef"
19327 d_vsnprintf="$undef"
19331 echo "(I can't seem to compile the test program--assuming they don't)"
19332 d_snprintf="$undef"
19333 d_vsnprintf="$undef"
19339 : see if sockatmark exists
19340 set sockatmark d_sockatmark
19343 : see if prototype for sockatmark is available
19345 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
19348 : see if socks5_init exists
19349 set socks5_init d_socks5_init
19352 : see if srand48_r exists
19353 set srand48_r d_srand48_r
19355 case "$d_srand48_r" in
19357 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19358 case "$d_srand48_r_proto:$usethreads" in
19359 ":define") d_srand48_r_proto=define
19360 set d_srand48_r_proto srand48_r $hdrs
19364 case "$d_srand48_r_proto" in
19366 case "$srand48_r_proto" in
19367 ''|0) try='int srand48_r(long, struct drand48_data*);'
19368 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19370 case "$srand48_r_proto" in
19371 ''|0) d_srand48_r=undef
19373 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19374 * ) case "$srand48_r_proto" in
19375 REENTRANT_PROTO*) ;;
19376 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19378 echo "Prototype: $try" ;;
19381 *) case "$usethreads" in
19382 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19389 *) srand48_r_proto=0
19393 : see if srandom_r exists
19394 set srandom_r d_srandom_r
19396 case "$d_srandom_r" in
19398 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19399 case "$d_srandom_r_proto:$usethreads" in
19400 ":define") d_srandom_r_proto=define
19401 set d_srandom_r_proto srandom_r $hdrs
19405 case "$d_srandom_r_proto" in
19407 case "$srandom_r_proto" in
19408 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19409 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19411 case "$srandom_r_proto" in
19412 ''|0) d_srandom_r=undef
19414 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19415 * ) case "$srandom_r_proto" in
19416 REENTRANT_PROTO*) ;;
19417 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19419 echo "Prototype: $try" ;;
19422 *) case "$usethreads" in
19423 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19430 *) srandom_r_proto=0
19434 : see if prototype for setresgid is available
19436 set d_sresgproto setresgid $i_unistd unistd.h
19439 : see if prototype for setresuid is available
19441 set d_sresuproto setresuid $i_unistd unistd.h
19444 : see if stat exists
19448 : see if sys/stat.h is available
19449 set sys/stat.h i_sysstat
19452 : see if stat knows about block sizes
19454 echo "Checking to see if your struct stat has st_blocks field..." >&4
19455 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19458 : see if this is a sys/vfs.h system
19459 set sys/vfs.h i_sysvfs
19462 : see if this is a sys/statfs.h system
19463 set sys/statfs.h i_sysstatfs
19466 : Check for statfs_s
19468 echo "Checking to see if your system supports struct statfs..." >&4
19469 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
19471 case "$d_statfs_s" in
19472 "$define") echo "Yes, it does." ;;
19473 *) echo "No, it doesn't." ;;
19476 : see if struct statfs knows about f_flags
19477 case "$d_statfs_s" in
19480 echo "Checking to see if your struct statfs has f_flags field..." >&4
19481 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
19485 set d_statfs_f_flags
19489 case "$d_statfs_f_flags" in
19490 "$define") echo "Yes, it does." ;;
19491 *) echo "No, it doesn't." ;;
19494 : see what flavor, if any, of static inline is supported
19496 echo "Checking to see if your system supports static inline..."
19497 $cat > try.c <<'EOCP'
19498 #include <stdlib.h>
19499 extern int f_via_a(int x);
19500 extern int f_via_b(int x);
19501 int main(int argc, char **argv)
19510 return EXIT_SUCCESS;
19513 return EXIT_FAILURE;
19517 $cat > a.c <<'EOCP'
19518 static INLINE int f(int x) {
19529 $cat > b.c <<'EOCP'
19530 extern int f(int x);
19538 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19539 case "$perl_static_inline" in
19540 '') # Check the various possibilities, and break out on success.
19541 # For gcc, prefer __inline__, which will still permit
19542 # cflags.SH to add in -ansi.
19543 case "$gccversion" in
19544 '') xxx="inline __inline__ __inline _inline";;
19545 *) xxx="__inline__ inline __inline _inline";;
19547 for inline in $xxx; do
19548 set try -DINLINE=$inline a.c
19549 if eval $compile && $run ./try; then
19550 # Now make sure there is no external linkage of static
19552 set try -DINLINE=$inline -DUSE_B a.c b.c
19553 if eval $compile && $run ./try; then
19554 $echo "Your compiler supports static $inline, " >&4
19555 $echo "but it also creates an external definition," >&4
19556 $echo "so I won't use it." >&4
19559 $echo "Your compiler supports static $inline." >&4
19561 perl_static_inline="static $inline";
19565 $echo "Your compiler does NOT support static $inline." >&4
19570 *inline*) # Some variant of inline exists.
19571 echo "Keeping your $hint value of $perl_static_inline."
19574 static) # No inline capabilities
19575 echo "Keeping your $hint value of $perl_static_inline."
19578 *) # Unrecognized previous value -- blindly trust the supplied
19579 # value and hope it makes sense. Use old value for
19580 # d_static_inline, if there is one.
19581 echo "Keeping your $hint value of $perl_static_inline."
19582 case "$d_static_inline" in
19584 *) val=$d_static_inline ;;
19588 # Fallback to plain 'static' if nothing worked.
19589 case "$perl_static_inline" in
19591 perl_static_inline="static"
19595 set d_static_inline
19597 $rm -f a.[co] b.[co]
19600 : Check stream access
19602 Checking how to access stdio streams by file descriptor number...
19604 case "$stdio_stream_array" in
19605 '') $cat >try.c <<EOCP
19608 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19612 for s in _iob __iob __sF
19614 set try -DSTDIO_STREAM_ARRAY=$s
19615 if eval $compile; then
19616 case "`$run ./try`" in
19617 yes) stdio_stream_array=$s; break ;;
19623 case "$stdio_stream_array" in
19625 I can't figure out how to access stdio streams by file descriptor number.
19627 d_stdio_stream_array="$undef"
19630 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19632 d_stdio_stream_array="$define"
19636 : see if strcoll exists
19637 set strcoll d_strcoll
19640 : see if strerror_l exists
19641 set strerror_l d_strerror_l
19644 : see if strerror_r exists
19645 set strerror_r d_strerror_r
19647 case "$d_strerror_r" in
19649 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
19650 case "$d_strerror_r_proto:$usethreads" in
19651 ":define") d_strerror_r_proto=define
19652 set d_strerror_r_proto strerror_r $hdrs
19656 case "$d_strerror_r_proto" in
19658 case "$strerror_r_proto" in
19659 ''|0) try='int strerror_r(int, char*, size_t);'
19660 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19662 case "$strerror_r_proto" in
19663 ''|0) try='int strerror_r(int, char*, int);'
19664 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19666 case "$strerror_r_proto" in
19667 ''|0) try='char* strerror_r(int, char*, size_t);'
19668 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19670 case "$strerror_r_proto" in
19671 ''|0) d_strerror_r=undef
19673 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19674 * ) case "$strerror_r_proto" in
19675 REENTRANT_PROTO*) ;;
19676 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19678 echo "Prototype: $try" ;;
19681 *) case "$usethreads" in
19682 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19689 *) strerror_r_proto=0
19693 : see if strftime exists
19694 set strftime d_strftime
19697 : see if strlcat exists
19698 : We need both a prototype in string.h and the symbol in libc.
19701 xx1="#$d_gnulibc HAS_GNULIBC"
19702 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19703 xx3='# define _GNU_SOURCE'
19705 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19707 case "$d_strlcat_proto" in
19708 define) # see if strlcat exists
19709 set strlcat d_strlcat
19718 : see if strlcpy exists
19719 : We need both a prototype in string.h and the symbol in libc.
19722 xx1="#$d_gnulibc HAS_GNULIBC"
19723 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19724 xx3='# define _GNU_SOURCE'
19726 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19728 case "$d_strlcpy_proto" in
19729 define) # see if strlcpy exists
19730 set strlcpy d_strlcpy
19739 : see if strnlen exists
19740 set strnlen d_strnlen
19743 : see if strtod exists
19744 set strtod d_strtod
19747 : see if strtod_l exists
19748 set strtod_l d_strtod_l
19751 : see if strtol exists
19752 set strtol d_strtol
19755 : see if strtold exists
19756 set strtold d_strtold
19759 : see if strtold_l exists
19760 set strtold_l d_strtold_l
19763 : see if strtoll exists
19764 set strtoll d_strtoll
19767 case "$d_longlong-$d_strtoll" in
19770 Checking whether your strtoll() works okay...
19772 $cat >try.c <<'EOCP'
19775 #define strtoll __strtoll
19778 #define strtoll _strtoll
19781 #include <stdlib.h>
19782 static int bad = 0;
19783 void check(const char *s, long long ell, int een) {
19786 gll = strtoll(s, 0, 10);
19787 if (!((gll == ell) && (errno == een)))
19791 check(" 1", 1LL, 0);
19792 check(" 0", 0LL, 0);
19793 check("-1", -1LL, 0);
19794 check("-9223372036854775808", -9223372036854775808LL, 0);
19795 check("-9223372036854775808", -9223372036854775808LL, 0);
19796 check(" 9223372036854775807", 9223372036854775807LL, 0);
19797 check("-9223372036854775808", -9223372036854775808LL, 0);
19798 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19799 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19805 if eval $compile; then
19808 ok) echo "Your strtoll() seems to be working okay." ;;
19810 Your strtoll() doesn't seem to be working okay.
19816 echo "(I can't seem to compile the test program--assuming it doesn't)"
19822 : see if strtoq exists
19823 set strtoq d_strtoq
19826 : see if strtoul exists
19827 set strtoul d_strtoul
19830 case "$d_strtoul" in
19833 Checking whether your strtoul() works okay...
19835 $cat >try.c <<'EOCP'
19836 #include <stdlib.h>
19839 static int bad = 0;
19840 void check(const char *s, unsigned long eul, int een) {
19843 gul = strtoul(s, 0, 10);
19844 if (!((gul == eul) && (errno == een)))
19848 check(" 1", 1L, 0);
19849 check(" 0", 0L, 0);
19851 case "$longsize" in
19853 $cat >>try.c <<'EOCP'
19854 check("18446744073709551615", 18446744073709551615UL, 0);
19855 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19856 #if 0 /* strtoul() for /^-/ strings is undefined. */
19857 check("-1", 18446744073709551615UL, 0);
19858 check("-18446744073709551614", 2, 0);
19859 check("-18446744073709551615", 1, 0);
19860 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19861 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19866 $cat >>try.c <<'EOCP'
19867 check("4294967295", 4294967295UL, 0);
19868 check("4294967296", 4294967295UL, ERANGE);
19869 #if 0 /* strtoul() for /^-/ strings is undefined. */
19870 check("-1", 4294967295UL, 0);
19871 check("-4294967294", 2, 0);
19872 check("-4294967295", 1, 0);
19873 check("-4294967296", 4294967295UL, ERANGE);
19874 check("-4294967297", 4294967295UL, ERANGE);
19879 : Should we write these tests to be more portable by sprintf-ing
19880 : ~0 and then manipulating that char string as input for strtol?
19883 $cat >>try.c <<'EOCP'
19890 if eval $compile; then
19891 case "`$run ./try`" in
19892 ok) echo "Your strtoul() seems to be working okay." ;;
19894 Your strtoul() doesn't seem to be working okay.
19900 echo "(I can't seem to compile the test program--assuming it doesn't)"
19906 : see if strtoull exists
19907 set strtoull d_strtoull
19910 case "$d_longlong-$d_strtoull" in
19913 Checking whether your strtoull() works okay...
19915 $cat >try.c <<'EOCP'
19916 #include <stdlib.h>
19919 #define strtoull __strtoull
19922 static int bad = 0;
19923 void check(const char *s, long long eull, int een) {
19926 gull = strtoull(s, 0, 10);
19927 if (!((gull == eull) && (errno == een)))
19931 check(" 1", 1LL, 0);
19932 check(" 0", 0LL, 0);
19933 check("18446744073709551615", 18446744073709551615ULL, 0);
19934 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19935 #if 0 /* strtoull() for /^-/ strings is undefined. */
19936 check("-1", 18446744073709551615ULL, 0);
19937 check("-18446744073709551614", 2LL, 0);
19938 check("-18446744073709551615", 1LL, 0);
19939 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19940 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19947 if eval $compile; then
19948 case "`$run ./try`" in
19949 ok) echo "Your strtoull() seems to be working okay." ;;
19951 Your strtoull() doesn't seem to be working okay.
19953 d_strtoull="$undef"
19957 echo "(I can't seem to compile the test program--assuming it doesn't)"
19958 d_strtoull="$undef"
19963 : see if strtouq exists
19964 set strtouq d_strtouq
19967 case "$d_strtouq" in
19970 Checking whether your strtouq() works okay...
19972 $cat >try.c <<'EOCP'
19973 #include <stdlib.h>
19976 static int bad = 0;
19977 void check(const char *s, unsigned long long eull, int een) {
19978 unsigned long long gull;
19980 gull = strtouq(s, 0, 10);
19981 if (!((gull == eull) && (errno == een)))
19985 check(" 1", 1LL, 0);
19986 check(" 0", 0LL, 0);
19987 check("18446744073709551615", 18446744073709551615ULL, 0);
19988 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19989 #if 0 /* strtouq() for /^-/ strings is undefined. */
19990 check("-1", 18446744073709551615ULL, 0);
19991 check("-18446744073709551614", 2LL, 0);
19992 check("-18446744073709551615", 1LL, 0);
19993 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19994 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
20002 if eval $compile; then
20003 case "`$run ./try`" in
20004 ok) echo "Your strtouq() seems to be working okay." ;;
20006 Your strtouq() doesn't seem to be working okay.
20012 echo "(I can't seem to compile the test program--assuming it doesn't)"
20018 : see if strxfrm exists
20019 set strxfrm d_strxfrm
20022 : see if strxfrm_l exists
20023 set strxfrm_l d_strxfrm_l
20026 : see if symlink exists
20027 set symlink d_symlink
20030 : see if syscall exists
20031 set syscall d_syscall
20034 : see if this is a sys/syscall.h system
20035 set sys/syscall.h i_syssyscall
20038 : see if prototype for syscall is available
20040 set d_syscallproto syscall $i_unistd unistd.h $i_syssyscall sys/syscall.h
20043 : see if sysconf exists
20044 set sysconf d_sysconf
20047 : see if sys_errlist[] exists
20049 if test "X$d_syserrlst" = X; then
20050 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
20051 echo "You have sys_errlist[], so we could roll our own strerror."
20052 d_syserrlst="$define"
20054 echo "You don't have sys_errlist[], so strerror() is welcome."
20055 d_syserrlst="$undef"
20059 : see if system exists
20060 set system d_system
20063 : see if tcgetpgrp exists
20064 set tcgetpgrp d_tcgetpgrp
20067 : see if tcsetpgrp exists
20068 set tcsetpgrp d_tcsetpgrp
20071 : see if prototype for telldir is available
20073 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
20076 : see if tgamma exists
20077 set tgamma d_tgamma
20080 : see what flavor, if any, of thread local storage is supported
20082 echo "Checking to see if your system supports C11 thread local storage..."
20083 $cat > try.c <<'EOCP'
20085 #include <stdlib.h>
20086 #include <pthread.h>
20088 static int plus_one = 1;
20089 static int minus_one = -1;
20091 PROBE_MACRO int *minion;
20093 int callback (const void *a, const void *b) {
20094 int val_a = *minion * *(const int *)a;
20095 int val_b = *minion * *(const int *)b;
20096 return val_a < val_b ? -1 : val_a > val_b;
20101 void *thread_function(void *arg) {
20102 /* thread local variables should start zeroed in each thread. */
20103 if (minion != NULL) {
20104 fprintf(stderr, "__thread variable started with %p, should be NULL\n",
20108 minion = &minus_one;
20112 for (i = 0; i < SIZE; ++i) {
20113 /* "Hash randomisation" - this array isn't in sorted order: */
20114 array[i ^ 5] = i * i;
20117 qsort(array, SIZE, sizeof(int), callback);
20120 for (i = 0; i < SIZE; ++i) {
20121 int want = (SIZE - 1 - i) * (SIZE - 1 - i);
20122 int have = array[i];
20123 if (want != have) {
20125 fprintf(stderr, "array[%u] - want %i, have %i\n", i, want, have);
20134 int main(int argc, char **argv) {
20135 if (minion != NULL) {
20136 fprintf(stderr, "__thread variable started with %p, should be NULL\n",
20141 minion = &plus_one;
20144 int result = pthread_create(&tid, NULL, thread_function, NULL);
20146 fprintf(stderr, "pthread_create failed (%d)\n", result);
20150 result = pthread_join(tid, NULL);
20152 fprintf(stderr, "pthread_join failed (%d)\n", result);
20156 if (minion == NULL) {
20157 fprintf(stderr, "__thread variable should not be NULL\n");
20160 if (!(minion == &plus_one && *minion == 1)) {
20161 fprintf(stderr, "__thread variable should be %d @ %p, not %d @ %p\n",
20162 1, &plus_one, *minion, minion);
20170 # Respect a hint (or previous) value for perl_thread_local, if there is one.
20171 case "$perl_thread_local" in
20172 '') # Check the various possibilities, and break out on success.
20173 for thread_local in _Thread_local __thread; do
20174 set try -DPROBE_MACRO=$thread_local
20175 if eval $compile && $run ./try; then
20176 $echo "Your compiler supports $thread_local." >&4
20178 perl_thread_local="$thread_local";
20181 $echo "Your compiler does NOT support $thread_local." >&4
20185 *thread*|*Thread*) # Some variant of thread local exists.
20186 echo "Keeping your $hint value of $perl_thread_local."
20189 *) # Unrecognized previous value -- blindly trust the supplied
20190 # value and hope it makes sense. Use old value for
20191 # d_thread_local, if there is one.
20192 echo "Keeping your $hint value of $perl_thread_local."
20193 case "$d_thread_local" in
20195 *) val=$d_thread_local ;;
20203 : see if time exists
20205 if test "X$d_time" = X -o X"$timetype" = X; then
20206 if set time val -f d_time; eval $csym; $val; then
20207 echo 'time() found.' >&4
20209 rp="What is the type returned by time() on this system?"
20210 set time_t timetype long stdio.h sys/types.h
20213 echo 'time() not found, hope that will do.' >&4
20221 : see if timegm exists
20222 set timegm d_timegm
20225 : see if this is a sys/times.h system
20226 set sys/times.h i_systimes
20229 : see if times exists
20231 if set times val -f d_times; eval $csym; $val; then
20232 echo 'times() found.' >&4
20235 case "$i_systimes" in
20236 "$define") inc='sys/times.h';;
20238 rp="What is the type returned by times() on this system?"
20239 set clock_t clocktype long stdio.h sys/types.h $inc
20242 echo 'times() NOT found, hope that will do.' >&4
20247 : see if tmpnam_r exists
20248 set tmpnam_r d_tmpnam_r
20250 case "$d_tmpnam_r" in
20252 hdrs="$i_systypes sys/types.h define stdio.h "
20253 case "$d_tmpnam_r_proto:$usethreads" in
20254 ":define") d_tmpnam_r_proto=define
20255 set d_tmpnam_r_proto tmpnam_r $hdrs
20259 case "$d_tmpnam_r_proto" in
20261 case "$tmpnam_r_proto" in
20262 ''|0) try='char* tmpnam_r(char*);'
20263 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
20265 case "$tmpnam_r_proto" in
20266 ''|0) d_tmpnam_r=undef
20268 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
20269 * ) case "$tmpnam_r_proto" in
20270 REENTRANT_PROTO*) ;;
20271 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
20273 echo "Prototype: $try" ;;
20276 *) case "$usethreads" in
20277 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
20284 *) tmpnam_r_proto=0
20288 : see if towlower exists
20289 set towlower d_towlower
20292 : see if trunc exists
20296 : see if truncate exists
20297 set truncate d_truncate
20300 : see if ttyname_r exists
20301 set ttyname_r d_ttyname_r
20303 case "$d_ttyname_r" in
20305 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
20306 case "$d_ttyname_r_proto:$usethreads" in
20307 ":define") d_ttyname_r_proto=define
20308 set d_ttyname_r_proto ttyname_r $hdrs
20312 case "$d_ttyname_r_proto" in
20314 case "$ttyname_r_proto" in
20315 ''|0) try='int ttyname_r(int, char*, size_t);'
20316 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
20318 case "$ttyname_r_proto" in
20319 ''|0) try='int ttyname_r(int, char*, int);'
20320 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
20322 case "$ttyname_r_proto" in
20323 ''|0) try='char* ttyname_r(int, char*, int);'
20324 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
20326 case "$ttyname_r_proto" in
20327 ''|0) d_ttyname_r=undef
20329 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
20330 * ) case "$ttyname_r_proto" in
20331 REENTRANT_PROTO*) ;;
20332 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
20334 echo "Prototype: $try" ;;
20337 *) case "$usethreads" in
20338 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
20345 *) ttyname_r_proto=0
20349 : see if tzname[] exists
20351 if set tzname val -a d_tzname; eval $csym; $val; then
20353 echo 'tzname[] found.' >&4
20356 echo 'tzname[] NOT found.' >&4
20361 : Check if is a multiplatform env
20363 darwin) multiarch="$define" ;;
20365 case "$multiarch" in
20366 ''|[nN]*) multiarch="$undef" ;;
20369 : check for ordering of bytes in a UV
20371 case "$multiarch" in
20374 You seem to be doing a multiarchitecture build,
20375 skipping the byteorder check.
20381 case "$byteorder" in
20384 In the following, larger digits indicate more significance. A big-endian
20385 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
20386 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
20387 machines may have weird orders like 3412. A Cray will report 87654321,
20388 an Alpha will report 12345678. If the test program works the default is
20390 I'm now running the test program...
20394 #$i_stdlib I_STDLIB
20396 #include <stdlib.h>
20398 #$i_inttypes I_INTTYPES
20400 #include <inttypes.h>
20402 #include <sys/types.h>
20403 typedef $uvtype UV;
20413 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
20415 u.l = (UV)0x04030201;
20416 for (i = 0; i < $uvsize; i++)
20417 printf("%c", u.c[i]+'0');
20424 if eval $compile && $run ./try > /dev/null; then
20427 [1-4][1-4][1-4][1-4]|12345678|87654321)
20428 echo "(The test program ran ok.)"
20429 echo "byteorder=$dflt"
20432 ????|????????) echo "(The test program ran ok.)" ;;
20433 *) echo "(The test program didn't run right for some reason.)" ;;
20438 (I can't seem to compile the test program. Guessing big-endian...)
20441 case "$xxx_prompt" in
20443 rp="What is the order of bytes in $uvtype?"
20456 : Checking 32bit alignedness
20459 Checking to see whether you can access character data unalignedly...
20461 case "$d_u32align" in
20462 '') $cat >try.c <<EOCP
20464 #$i_stdlib I_STDLIB
20466 #include <stdlib.h>
20468 #define U32 $u32type
20469 #define BYTEORDER 0x$byteorder
20471 #include <signal.h>
20473 $signal_t bletch(int s) { exit(4); }
20476 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20477 volatile U8 buf[8];
20481 if (sizeof(U32) != 4) {
20482 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20489 signal(SIGBUS, bletch);
20501 for (i = 0; i < 4; i++) {
20502 up = (U32*)(buf + i);
20503 if (! ((*up == 1 << (8*i)) || /* big-endian */
20504 (*up == 1 << (8*(3-i))) /* little-endian */
20508 printf("read failed (%x)\n", *up);
20514 for (i = 0; i < 4; i++) {
20515 up = (U32*)(buf + i);
20517 if (*up != 0xBeef) {
20518 printf("write failed (%x)\n", *up);
20532 if eval $compile_ok; then
20533 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20534 $run ./try 2>&1 >/dev/null
20537 You can access character data pretty unalignedly.
20539 d_u32align="$undef"
20542 It seems that you must access character data in an aligned manner.
20544 d_u32align="$define"
20548 rp='Can you access character data at unaligned addresses?'
20552 [yY]*) d_u32align="$undef" ;;
20553 *) d_u32align="$define" ;;
20560 : see if ualarm exists
20561 set ualarm d_ualarm
20564 : see if umask exists
20568 : see if unordered exists
20569 set unordered d_unordered
20572 : see if unsetenv exists
20573 set unsetenv d_unsetenv
20576 : see if usleep exists
20577 set usleep d_usleep
20580 : see if prototype for usleep is available
20582 set d_usleepproto usleep $i_unistd unistd.h
20585 : see if ustat exists
20589 : see if closedir exists
20590 set closedir d_closedir
20593 case "$d_closedir" in
20596 echo "Checking whether closedir() returns a status..." >&4
20598 #$i_dirent I_DIRENT /**/
20599 #$i_sysdir I_SYS_DIR /**/
20600 #$i_sysndir I_SYS_NDIR /**/
20601 #$i_systypes I_SYS_TYPES /**/
20603 #if defined(I_SYS_TYPES)
20604 #include <sys/types.h>
20606 #if defined(I_DIRENT)
20607 #include <dirent.h>
20610 #include <sys/ndir.h>
20613 #include <sys/dir.h>
20617 int main() { return closedir(opendir(".")); }
20620 if eval $compile_ok; then
20621 if $run ./try > /dev/null 2>&1 ; then
20622 echo "Yes, it does."
20625 echo "No, it doesn't."
20629 echo "(I can't seem to compile the test program--assuming it doesn't)"
20637 set d_void_closedir
20641 : see if there is a wait4
20645 : see if waitpid exists
20646 set waitpid d_waitpid
20649 : see if wcrtomb exists
20650 set wcrtomb d_wcrtomb
20655 $cat >try.c <<'EOCP'
20661 return (wcscmp (s, s) ? 1 : 0);
20666 if eval $compile; then
20669 0) echo "A working wcscmp() found." >&4
20671 *) echo "wcscmp() found, but it doesn't work" >&4
20675 echo "wcscmp() NOT found." >&4
20681 : see if wcstombs exists
20682 set wcstombs d_wcstombs
20687 $cat >try.c <<'EOCP'
20692 wchar_t dst[4], *src = L" ";
20694 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20699 if eval $compile; then
20702 0) echo "A working wcsxfrm() found." >&4
20704 *) echo "wcsxfrm() found, but it doesn't work" >&4
20708 echo "wcsxfrm() NOT found." >&4
20714 : see if wctomb exists
20715 set wctomb d_wctomb
20718 : see if writev exists
20719 set writev d_writev
20722 : check for alignment requirements
20724 case "$alignbytes" in
20725 '') echo "Checking alignment constraints..." >&4
20734 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20739 if eval $compile_ok; then
20743 echo "(I can't seem to compile the test program...)"
20745 case "$multiarch" in
20747 : The usual safe value is 8, but Darwin with -Duselongdouble
20748 : needs 16. Hence, we will take 8 as a minimum, but allow
20749 : Configure to pick a larger value if needed.
20750 if $test "$dflt" -lt 8; then
20752 echo "Setting alignment to 8 for multiarch support.">&4
20757 *) dflt="$alignbytes"
20760 rp="Doubles must be aligned on a how-many-byte boundary?"
20765 : set the base revision
20768 : length of character in bytes. Is always 1, otherwise it is not C
20769 : This used to be a test using sizeof
20772 : Check for the number of bits in a character
20773 case "$charbits" in
20774 '') echo "Checking how long a character is (in bits)..." >&4
20781 for (c = 1, n = 0; c; c <<= 1, n++) ;
20782 printf ("%d\n", n);
20787 if eval $compile_ok; then
20791 echo "(I can't seem to compile the test program. Guessing...)"
20798 rp="What is the length of a character (in bits)?"
20802 case "$charbits" in
20805 Your system has an unsigned character size of $charbits bits, which
20806 is rather unusual (normally it is 8 bits). Perl likely will not work
20807 correctly on your system, with subtle bugs in various places.
20809 rp='Do you really want to continue?'
20813 [yY]) echo >&4 "Okay, continuing." ;;
20818 : how do we concatenate cpp tokens here?
20820 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20821 $cat >cpp_stuff.c <<'EOCP'
20822 #define RCAT(a,b)a/**/b
20823 #define ACAT(a,b)a ## b
20827 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20828 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20829 echo "Oh! Smells like ANSI's been here." >&4
20830 echo "We can catify or stringify, separately or together!"
20832 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20833 echo "Ah, yes! The good old days!" >&4
20834 echo "However, in the good old days we don't know how to stringify and"
20835 echo "catify at the same time."
20839 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20840 You're going to have to edit the values of CAT[2-5] in config.h...
20842 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20846 : see if this is a db.h system
20852 : Check db version.
20854 echo "Checking Berkeley DB version ..." >&4
20856 #include <sys/types.h>
20858 #$i_stdlib I_STDLIB
20860 #include <stdlib.h>
20863 int main(int argc, char *argv[])
20865 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20866 int Major, Minor, Patch ;
20867 unsigned long Version ;
20868 (void)db_version(&Major, &Minor, &Patch) ;
20870 printf("%d %d %d %d %d %d\n",
20871 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20872 Major, Minor, Patch);
20875 printf("You have Berkeley DB Version 2 or greater.\n");
20877 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20878 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20879 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20880 Major, Minor, Patch) ;
20882 /* check that db.h & libdb are compatible */
20883 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20884 printf("db.h and libdb are incompatible.\n") ;
20888 printf("db.h and libdb are compatible.\n") ;
20890 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20891 + DB_VERSION_PATCH ;
20893 /* needs to be >= 2.3.4 */
20894 if (Version < 2003004) {
20895 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20896 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20902 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20907 printf("You have Berkeley DB Version 1.\n");
20908 exit(0); /* DB version < 2: the coast is clear. */
20910 exit(1); /* <db.h> not Berkeley DB? */
20916 if eval $compile_ok && $run ./try; then
20917 echo 'Looks OK.' >&4
20919 db_version_major=$1
20920 db_version_minor=$2
20921 db_version_patch=$3
20923 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20927 : Remove db from list of libraries to use
20928 echo "Removing unusable -ldb from library list" >&4
20929 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20932 echo "libs = $libs" >&4
20942 : Check the return type needed for hash
20944 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20946 #include <sys/types.h>
20949 #ifndef DB_VERSION_MAJOR
20950 u_int32_t hash_cb (const void* ptr, size_t size)
20957 info.hash = hash_cb;
20961 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20962 if $compiler_warning try.out >>/dev/null 2>&1 ; then
20965 db_hashtype='u_int32_t'
20968 : XXX Maybe we should just give up here.
20969 db_hashtype=u_int32_t
20971 echo "Help: I can't seem to compile the db test program." >&4
20972 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20975 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20977 *) db_hashtype=u_int32_t
20982 : Check the return type needed for prefix
20984 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20986 #include <sys/types.h>
20989 #ifndef DB_VERSION_MAJOR
20990 size_t prefix_cb (const DBT *key1, const DBT *key2)
20997 info.prefix = prefix_cb;
21001 if $cc $ccflags -c try.c >try.out 2>&1 ; then
21002 if $compiler_warning try.out >>/dev/null 2>&1 ; then
21003 db_prefixtype='int'
21005 db_prefixtype='size_t'
21008 db_prefixtype='size_t'
21009 : XXX Maybe we should just give up here.
21011 echo "Help: I can't seem to compile the db test program." >&4
21012 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
21015 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
21017 *) db_prefixtype='size_t'
21021 : Include . in @INC
21024 Historically Perl has provided a final fallback of the current working
21025 directory '.' when searching for a library. This, however, can lead to
21026 problems when a Perl program which loads optional modules is called from
21027 a shared directory. This can lead to executing unexpected code.
21031 # When changing to exclude by default:
21032 case "$default_inc_excludes_dot" in
21033 $undef|false|[nN]*) dflt="n" ;;
21036 # To turn exclude off by default:
21037 #case "$default_inc_excludes_dot" in
21038 # $define|true|[yY]*) dflt="y" ;;
21042 rp='Exclude '.' from @INC by default? '
21045 [nN]|undef) default_inc_excludes_dot="$undef" ;;
21046 *) default_inc_excludes_dot="$define" ;;
21049 : Check what kind of inf/nan your system has
21050 $echo "Checking the kind of infinities and nans you have..." >&4
21051 $echo "(The following tests may crash. That's okay.)" >&4
21053 #define DOUBLESIZE $doublesize
21054 #$d_longdbl HAS_LONG_DOUBLE
21055 #ifdef HAS_LONG_DOUBLE
21056 #define LONG_DOUBLESIZE $longdblsize
21057 #define LONG_DOUBLEKIND $longdblkind
21060 #include <string.h>
21062 /* Note that whether the sign bit is on or off
21063 * for NaN depends on the CPU/FPU, and possibly
21064 * can be affected by the build toolchain.
21066 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
21067 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
21068 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
21069 * (respectively) as opposed to the more usual
21070 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
21072 * Pre-IEEE-754 floating point format do not even have inf/nan support
21073 * at all. They might have a "max" value (DBL_MAX), which may be deadly
21074 * to even mention, causing immediate SIGFPE or equivalent: this is
21075 * the case with VAX floating point, for example.
21077 static void bytes(void *v, unsigned int n) {
21078 unsigned char *p = (unsigned char *)v;
21080 for (i = 0; i < n; i++) {
21081 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
21084 int main(int argc, char *argv[]) {
21085 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
21086 * because some compilers are 'smart' and not only warn but refuse to
21087 * compile such 'illegal' values. */
21088 double dinf = exp(1e9);
21089 double dnan = sqrt(-1.0);
21090 #ifdef HAS_LONG_DOUBLE
21091 long double ldinf = (long double)exp(1e9);
21092 long double ldnan = (long double)sqrt(-1.0);
21093 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
21094 /* the 80-bit long doubles might have garbage in their excess bytes */
21095 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
21096 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
21100 switch (argv[1][0]) {
21101 case '1': bytes(&dinf, sizeof(dinf)); break;
21102 case '2': bytes(&dnan, sizeof(dnan)); break;
21103 #ifdef HAS_LONG_DOUBLE
21104 case '3': bytes(&ldinf, sizeof(ldinf)); break;
21105 case '4': bytes(&ldnan, sizeof(ldnan)); break;
21113 if eval $compile; then
21114 doubleinfbytes=`$run ./try 1`
21115 doublenanbytes=`$run ./try 2`
21116 case "$d_longdbl" in
21118 longdblinfbytes=`$run ./try 3`
21119 longdblnanbytes=`$run ./try 4`
21123 # Defaults in case the above test program failed.
21124 case "$doublekind" in
21125 1) # IEEE 754 32-bit LE
21126 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
21127 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
21129 2) # IEEE 754 32-bit BE
21130 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
21131 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
21133 3) # IEEE 754 64-bit LE
21134 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
21135 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
21137 4) # IEEE 754 64-bit BE
21138 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21139 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21141 5) # IEEE 754 128-bit LE
21142 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
21143 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
21145 6) # IEEE 754 128-bit BE
21146 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21147 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21149 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
21150 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
21151 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
21153 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
21154 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
21155 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
21157 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
21158 doubleinfbytes=$undef
21159 doublenanbytes=$undef
21162 doubleinfbytes=$undef
21163 doublenanbytes=$undef
21166 case "$longdblkind" in
21167 1) # IEEE 754 128-bit LE
21168 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
21169 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
21171 2) # IEEE 754 128-bit BE
21172 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21173 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21175 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
21176 case "$longdblsize" in
21177 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
21178 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
21179 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
21182 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21183 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21186 longdblinfbytes=$undef
21187 longdblnanbytes=$undef
21191 4) # IEEE 754 80-bit BE, 12 or 16 bytes
21192 case "$longdblsize" in
21193 12) # 32-bit system
21194 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21195 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21197 16) # 64-bit system
21198 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21199 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21202 longdblinfbytes=$undef
21203 longdblnanbytes=$undef
21207 5) # 128-bit LE-LE "double double"
21208 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
21209 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
21211 6) # 128-bit BE-BE "double double"
21212 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21213 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21215 7) # 128-bit LE-BE "double double"
21216 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21217 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21219 8) # 128-bit BE-LE "double double"
21220 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21221 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
21223 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
21224 longdblinfbytes=$undef
21225 longdblnanbytes=$undef
21228 longdblinfbytes=$undef
21229 longdblnanbytes=$undef
21233 # In case the program crashed the values are empty, turn them undef.
21234 case "$doubleinfbytes" in
21235 '') doubleinfbytes=$undef ;;
21237 case "$doublenanbytes" in
21238 '') doublenanbytes=$undef ;;
21240 case "$longdblinfbytes" in
21241 '') longdblinfbytes=$undef ;;
21243 case "$longdblnanbytes" in
21244 '') longdblnanbytes=$undef ;;
21248 : Check the length of the double mantissa
21249 $echo "Checking how many mantissa bits your doubles have..." >&4
21251 #$i_sunmath I_SUNMATH
21254 # include <sunmath.h>
21256 #ifdef DBL_MANT_DIG
21257 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
21260 int main(int argc, char *argv[]) {
21262 printf("%d\n", BITS);
21268 if eval $compile; then
21269 doublemantbits=`$run ./try`
21271 doublemantbits="$undef"
21275 : Check the length of the longdouble mantissa
21276 $echo "Checking how many mantissa bits your long doubles have..." >&4
21278 #$i_sunmath I_SUNMATH
21281 # include <sunmath.h>
21283 #$d_longdbl HAS_LONG_DOUBLE
21284 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
21285 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
21286 /* This format has no implicit bit. Beware, however, that for
21287 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
21288 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
21289 * and the top bit must have been one since 387, zero is plain invalid.
21290 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
21291 # define BITS LDBL_MANT_DIG
21292 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
21293 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
21294 * reason e.g. Irix thinks 107. But in any case, we want only
21295 * the number of real bits, the implicit bits are of no interest. */
21296 # define BITS 2 * (DBL_MANT_DIG - 1)
21298 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
21302 int main(int argc, char *argv[]) {
21304 printf("%d\n", BITS);
21310 if eval $compile; then
21311 longdblmantbits=`$run ./try`
21313 longdblmantbits="$undef"
21317 : Check the length of the NV mantissa
21318 $echo "Checking how many mantissa bits your NVs have..." >&4
21319 if test "X$usequadmath" = "X$define"; then
21320 nvmantbits=112 # 128-1-15
21322 if test "X$nvsize" = "X$doublesize"; then
21323 nvmantbits="$doublemantbits"
21325 if test "X$nvsize" = "X$longdblsize"; then
21326 nvmantbits="$longdblmantbits"
21328 nvmantbits="$undef"
21333 : How can we generate normalized random numbers ?
21335 echo "Using our internal random number implementation..." >&4
21338 *-Dmy_rand=*|*-Dmy_srand=*)
21339 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
21340 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
21341 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
21342 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
21346 randfunc=Perl_drand48
21347 drand01="Perl_drand48()"
21348 seedfunc="Perl_drand48_init"
21352 : Probe whether dtrace builds an object, as newer Illumos requires an input
21353 : object file that uses at least one of the probes defined in the .d file
21354 case "$usedtrace" in
21356 case "$dtracexnolibs" in
21357 $define|true|[yY]*)
21358 dtracexnolibs=$define
21359 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
21362 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21363 dtracexnolibs=$define
21364 echo "Your dtrace accepts -xnolibs"
21365 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21366 dtracexnolibs=$undef
21367 echo "Your dtrace doesn't accept -xnolibs"
21369 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
21374 dtracexnolibs=$undef
21375 $dtrace -h -s ../perldtrace.d -o perldtrace.h
21378 case $dtracexnolibs in
21379 $define) xnolibs=-xnolibs ;;
21383 case "$dtraceobject" in
21384 $define|true|[yY]*)
21385 dtraceobject=$define
21389 #include "perldtrace.h"
21391 PERL_LOADED_FILE("dummy");
21395 dtraceobject=$undef
21396 if $cc -c -o try.o $optimize $ccflags try.c \
21397 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
21398 dtraceobject=$define
21399 echo "Your dtrace builds an object file"
21402 *) dtraceobject=$undef ;;
21404 $rm_try perldtrace.o perldtrace.h
21407 : Determine if this is an EBCDIC system
21409 echo "Determining whether or not we are on an EBCDIC system..." >&4
21410 $cat >try.c <<'EOM'
21413 if ('M'==0xd4) return 0;
21420 if eval $compile_ok; then
21421 if $run ./try; then
21422 echo "You seem to speak EBCDIC." >&4
21425 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21428 echo "I'm unable to compile the test program." >&4
21429 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21435 : Check how to flush
21438 Checking how to flush all pending stdio output...
21440 # I only know how to find the first 32 possibly open files on SunOS.
21441 # See also hints/sunos_4_1.sh and util.c --AD
21443 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21445 $cat >>try.c <<EOCP
21447 #$i_stdlib I_STDLIB
21449 #include <stdlib.h>
21451 #$i_unistd I_UNISTD
21453 # include <unistd.h>
21455 #$d_sysconf HAS_SYSCONF
21456 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21457 #ifdef HAS_STDIO_STREAM_ARRAY
21458 # define STDIO_STREAM_ARRAY $stdio_stream_array
21463 p = fopen("try.out", "w");
21467 # ifdef TRY_FPRINTF
21471 #ifdef TRY_FFLUSH_NULL
21474 #ifdef TRY_FFLUSH_ALL
21476 long open_max = -1;
21477 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21478 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21480 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21481 open_max = sysconf(_SC_OPEN_MAX);
21484 open_max = FOPEN_MAX;
21487 open_max = OPEN_MAX;
21496 # ifdef HAS_STDIO_STREAM_ARRAY
21497 if (open_max > 0) {
21499 for (i = 0; i < open_max; i++)
21500 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21501 STDIO_STREAM_ARRAY[i]._file < open_max &&
21502 STDIO_STREAM_ARRAY[i]._flag)
21503 fflush(&STDIO_STREAM_ARRAY[i]);
21511 : first we have to find out how _not_ to flush
21513 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21515 set try -DTRY_FPUTC
21516 if eval $compile; then
21517 $run ./try 2>/dev/null
21520 if $test ! -s try.out -a "X$code" = X42; then
21526 set try -DTRY_FPRINTF
21527 if eval $compile; then
21528 $run ./try 2>/dev/null
21531 if $test ! -s try.out -a "X$code" = X42; then
21532 output=-DTRY_FPRINTF
21538 : check for fflush NULL behavior
21539 case "$fflushNULL" in
21540 '') set try -DTRY_FFLUSH_NULL $output
21541 if eval $compile; then
21542 $run ./try 2>/dev/null
21545 if $test -s try.out -a "X$code" = X42; then
21546 fflushNULL="`$cat try.out`"
21548 if $test "X$code" != X42; then
21550 (If this test failed, don't worry, we'll try another method shortly.)
21555 $rm -f core try.core core.try.*
21556 case "$fflushNULL" in
21558 Your fflush(NULL) works okay for output streams.
21559 Let's see if it clobbers input pipes...
21561 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21562 # bug that improperly flushes the input end of pipes. So we avoid the
21563 # autoflush on fork/system/exec support for now. :-(
21564 $cat >tryp.c <<EOCP
21567 main(int argc, char **argv)
21573 while ((i = getc(stdin)) != -1
21574 && (*bp++ = i) != '\n'
21575 && bp < &buf[1024])
21578 fprintf(stdout, "%s", buf);
21586 fflushNULL="$define"
21588 if eval $compile; then
21590 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21591 if $test "X$targethost" != X; then
21594 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21596 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21598 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21600 fflush(NULL) seems to behave okay with input streams.
21602 fflushNULL="$define"
21605 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21607 fflushNULL="$undef"
21610 $rm -f core tryp.c tryp.core core.tryp.*
21613 Your fflush(NULL) isn't working (contrary to ANSI C).
21615 fflushNULL="$undef"
21618 Cannot figure out whether your fflush(NULL) works or not.
21619 I'm assuming it doesn't (contrary to ANSI C).
21621 fflushNULL="$undef"
21625 $define|true|[yY]*)
21626 fflushNULL="$define"
21629 fflushNULL="$undef"
21632 : check explicit looping only if NULL did not work, and if the pipe
21633 : bug does not show up on an explicit flush too
21634 case "$fflushNULL" in
21636 $cat >tryp.c <<EOCP
21639 main(int argc, char **argv)
21645 while ((i = getc(stdin)) != -1
21646 && (*bp++ = i) != '\n'
21647 && bp < &buf[1024])
21650 fprintf(stdout, "%s", buf);
21659 if eval $compile; then
21661 if $test "X$targethost" != X; then
21664 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21666 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21668 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21670 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21672 : now check for fflushall behaviour
21673 case "$fflushall" in
21674 '') set try -DTRY_FFLUSH_ALL $output
21675 if eval $compile; then
21677 (Now testing the other method--but note that this also may fail.)
21679 $run ./try 2>/dev/null
21682 if $test -s try.out -a "X$code" = X42; then
21683 fflushall="`$cat try.out`"
21687 case "$fflushall" in
21689 Whew. Flushing explicitly all the stdio streams works.
21691 fflushall="$define"
21694 Sigh. Flushing explicitly all the stdio streams doesn't work.
21699 Cannot figure out whether flushing stdio streams explicitly works or not.
21700 I'm assuming it doesn't.
21706 "$define"|true|[yY]*)
21707 fflushall="$define"
21715 All is futile. Even fflush(stdin) clobbers input pipes!
21722 $rm -f core tryp.c tryp.core core.tryp.*
21724 *) fflushall="$undef"
21728 case "$fflushNULL$fflushall" in
21731 OK, I give up. I cannot figure out how to flush pending stdio output.
21732 We won't be flushing handles at all before fork/exec/popen.
21738 : Store the full pathname to the ar program for use in the C program
21739 : Respect a hint or command line value for full_ar.
21744 : Store the full pathname to the sed program for use in the C program
21747 : see what type gids are declared as in the kernel
21749 echo "Looking for the type for group ids returned by getgid()."
21750 set gid_t gidtype xxx stdio.h sys/types.h
21754 xxx=`./findhdr sys/user.h`
21755 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21757 unsigned) dflt="$1 $2" ;;
21761 *) dflt="$gidtype";;
21764 gid_t) echo "gid_t found." ;;
21765 *) rp="What is the type for group ids returned by getgid()?"
21771 : Check the size of GID
21774 *_t) zzz="$gidtype" ;;
21777 echo "Checking the size of $zzz..." >&4
21779 #include <sys/types.h>
21781 #$i_stdlib I_STDLIB
21783 #include <stdlib.h>
21786 printf("%d\n", (int)sizeof($gidtype));
21791 if eval $compile_ok; then
21795 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21798 echo "Your $zzz is $gidsize bytes long."
21803 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21806 : Check if GID is signed
21809 *_t) zzz="$gidtype" ;;
21812 echo "Checking the sign of $zzz..." >&4
21814 #include <sys/types.h>
21825 if eval $compile; then
21829 echo "(I can't execute the test program--guessing unsigned.)" >&4
21833 1) echo "Your $zzz is unsigned." ;;
21834 -1) echo "Your $zzz is signed." ;;
21840 echo "(I can't compile the test program--guessing unsigned.)" >&4
21843 : Check 64bit sizes
21846 if $test X"$quadtype" != X; then
21848 echo "Checking how to print 64-bit integers..." >&4
21850 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21851 $cat >try.c <<'EOCP'
21852 #include <sys/types.h>
21855 int q = 12345678901;
21856 printf("%ld\n", q);
21860 if eval $compile; then
21864 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21865 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21866 echo "We will use %d."
21872 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21873 $cat >try.c <<'EOCP'
21874 #include <sys/types.h>
21877 long q = 12345678901;
21878 printf("%ld\n", q);
21882 if eval $compile; then
21886 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21887 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21888 echo "We will use %ld."
21894 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21895 $cat >try.c <<'EOCP'
21896 #include <sys/types.h>
21897 #include <inttypes.h>
21900 int64_t q = 12345678901;
21901 printf("%" PRId64 "\n", q);
21905 if eval $compile; then
21909 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21910 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIX64;
21911 echo "We will use the C9X style."
21917 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21918 $cat >try.c <<'EOCP'
21919 #include <sys/types.h>
21922 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21923 printf("%lld\n", q);
21927 if eval $compile; then
21931 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21932 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21933 echo "We will use the %lld style."
21939 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21941 #include <sys/types.h>
21944 $quadtype q = 12345678901;
21945 printf("%qd\n", q);
21949 if eval $compile; then
21953 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21954 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21955 echo "We will use %qd."
21961 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21963 #include <sys/types.h>
21966 $quadtype q = 12345678901;
21967 printf("%Ld\n", q);
21971 if eval $compile; then
21975 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21976 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21977 echo "We will use %Ld."
21983 if $test X"$sPRId64" = X; then
21984 echo "Cannot figure out how to print 64-bit integers." >&4
21991 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21992 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21994 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21995 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21999 : Check format strings for internal types
22001 $echo "Checking the format strings to be used for Perl's internal types..." >&4
22003 if $test X"$ivsize" = X8; then
22004 ivdformat="$sPRId64"
22005 uvuformat="$sPRIu64"
22006 uvoformat="$sPRIo64"
22007 uvxformat="$sPRIx64"
22008 uvXUformat="$sPRIXU64"
22010 if $test X"$ivsize" = X"$longsize"; then
22017 if $test X"$ivsize" = X"$intsize"; then
22025 if $test X"$ivsize" = X"$shortsize"; then
22036 if $test X"$usequadmath" = X"$define"; then
22044 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
22045 nveformat="$sPRIeldbl"
22046 nvfformat="$sPRIfldbl"
22047 nvgformat="$sPRIgldbl"
22048 nvEUformat="$sPRIEUldbl"
22049 nvFUformat="$sPRIFUldbl"
22050 nvGUformat="$sPRIGUldbl"
22061 case "$ivdformat" in
22062 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
22067 : Check format string for GID
22070 $echo "Checking the format string to be used for gids..." >&4
22073 -1) if $test X"$gidsize" = X"$ivsize"; then
22074 gidformat="$ivdformat"
22076 if $test X"$gidsize" = X"$longsize"; then
22079 if $test X"$gidsize" = X"$intsize"; then
22082 if $test X"$gidsize" = X"$shortsize"; then
22089 *) if $test X"$gidsize" = X"$uvsize"; then
22090 gidformat="$uvuformat"
22092 if $test X"$gidsize" = X"$longsize"; then
22095 if $test X"$gidsize" = X"$intsize"; then
22098 if $test X"$gidsize" = X"$shortsize"; then
22107 : see if getgroups exists
22108 set getgroups d_getgrps
22111 : see if setgroups exists
22112 set setgroups d_setgrps
22115 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
22117 case "$d_getgrps$d_setgrps" in
22119 case "$groupstype" in
22120 '') dflt="$gidtype" ;;
22121 *) dflt="$groupstype" ;;
22124 What type of pointer is the second argument to getgroups() and setgroups()?
22125 Usually this is the same as group ids, $gidtype, but not always.
22128 rp='What type pointer is the second argument to getgroups() and setgroups()?'
22132 *) groupstype="$gidtype";;
22135 : Check format strings for internal 32bit types
22137 $echo "Checking the format strings to be used for Perl's internal 32bit-types..." >&4
22139 case "$i32dformat" in
22140 '') case "$i32type" in
22155 int_least32_t) : will not happen currently
22156 i32dformat=PRIdLEAST32
22157 u32uformat=PRIuLEAST32
22158 u32oformat=PRIoLEAST32
22159 u32xformat=PRIxLEAST32
22160 u32XUformat=PRIXLEAST32
22172 case "$i32dformat" in
22173 '') echo "$0: Fatal: failed to find format strings for 32-bit integers, cannot continue." >&4
22178 : check whether make sets MAKE
22180 echo "Checking if your $make program sets \$(MAKE)..." >&4
22181 case "$make_set_make" in
22183 $sed 's/^X //' > testmake.mak << 'EOF'
22185 X @echo 'maketemp="$(MAKE)"'
22187 case "`$make -f testmake.mak 2>/dev/null`" in
22188 *maketemp=*) make_set_make='#' ;;
22189 *) make_set_make="MAKE=$make" ;;
22191 $rm -f testmake.mak
22194 case "$make_set_make" in
22195 '#') echo "Yup, it does.";;
22196 *) echo "Nope, it doesn't.";;
22199 : see what type is used for mode_t
22200 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
22201 set mode_t modetype int stdio.h sys/types.h
22204 : see if we need va_copy
22207 #include <stdarg.h>
22209 #include <stdlib.h>
22210 #include <signal.h>
22213 ivfprintf(FILE *f, const char *fmt, va_list *valp)
22215 return vfprintf(f, fmt, *valp);
22219 myvfprintf(FILE *f, const char *fmt, va_list val)
22221 return ivfprintf(f, fmt, &val);
22225 myprintf(char *fmt, ...)
22228 va_start(val, fmt);
22229 return myvfprintf(stdout, fmt, val);
22233 main(int ac, char **av)
22235 signal(SIGSEGV, exit);
22237 signal(SIGBUS, exit);
22240 myprintf("%s%cs all right, then\n", "that", '\'');
22245 if eval $compile && $run ./try 2>&1 >/dev/null; then
22246 case "`$run ./try`" in
22247 "that's all right, then")
22253 yes) echo "It seems that you don't need va_copy()." >&4
22254 need_va_copy="$undef"
22256 *) echo "It seems that va_copy() or similar will be needed." >&4
22257 need_va_copy="$define"
22262 : see what type is used for size_t
22263 rp="What is the type used for the length parameter for string functions?"
22264 set size_t sizetype 'unsigned int' stdio.h sys/types.h
22267 : check for type of arguments to gethostbyaddr.
22268 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
22269 case "$d_gethbyaddr" in
22273 Checking to see what type of arguments are accepted by gethostbyaddr().
22275 hdrs="$define sys/types.h
22276 $d_socket sys/socket.h
22277 $i_niin netinet/in.h
22279 $i_unistd unistd.h"
22280 : The first arg can 'char *' or 'void *'
22281 : The second arg is some of integral type
22282 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
22283 for yyy in size_t long int; do
22284 case "$netdb_host_type" in
22285 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
22286 if ./protochk "$try" $hdrs; then
22287 echo "Your system accepts $xxx for the first arg."
22288 echo "...and $yyy for the second arg."
22289 netdb_host_type="$xxx"
22290 netdb_hlen_type="$yyy"
22296 : In case none of those worked, prompt the user.
22297 case "$netdb_host_type" in
22298 '') rp='What is the type for the 1st argument to gethostbyaddr?'
22301 netdb_host_type=$ans
22302 rp='What is the type for the 2nd argument to gethostbyaddr?'
22305 netdb_hlen_type=$ans
22309 *) : no gethostbyaddr, so pick harmless defaults
22310 netdb_host_type='char *'
22311 netdb_hlen_type="$sizetype"
22314 # Remove the "const" if needed. -- but then we'll have a
22316 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
22319 : check for type of argument to gethostbyname.
22320 if test "X$netdb_name_type" = X ; then
22321 case "$d_gethbyname" in
22325 Checking to see what type of argument is accepted by gethostbyname().
22327 hdrs="$define sys/types.h
22328 $d_socket sys/socket.h
22329 $i_niin netinet/in.h
22331 $i_unistd unistd.h"
22332 for xxx in "const char *" "char *"; do
22333 case "$netdb_name_type" in
22334 '') try="$extern_C struct hostent *gethostbyname($xxx);"
22335 if ./protochk "$try" $hdrs; then
22336 echo "Your system accepts $xxx."
22337 netdb_name_type="$xxx"
22342 : In case none of those worked, prompt the user.
22343 case "$netdb_name_type" in
22344 '') rp='What is the type for the 1st argument to gethostbyname?'
22347 netdb_name_type=$ans
22351 *) : no gethostbyname, so pick harmless default
22352 netdb_name_type='char *'
22357 : check for type of 1st argument to getnetbyaddr.
22358 if test "X$netdb_net_type" = X ; then
22359 case "$d_getnbyaddr" in
22363 Checking to see what type of 1st argument is accepted by getnetbyaddr().
22365 hdrs="$define sys/types.h
22366 $d_socket sys/socket.h
22367 $i_niin netinet/in.h
22369 $i_unistd unistd.h"
22370 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
22371 case "$netdb_net_type" in
22372 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
22373 if ./protochk "$try" $hdrs; then
22374 echo "Your system accepts $xxx."
22375 netdb_net_type="$xxx"
22380 : In case none of those worked, prompt the user.
22381 case "$netdb_net_type" in
22382 '') rp='What is the type for the 1st argument to getnetbyaddr?'
22385 netdb_net_type=$ans
22389 *) : no getnetbyaddr, so pick harmless default
22390 netdb_net_type='long'
22394 : locate the preferred pager for this system
22401 [a-zA-Z]:/*) dflt=$pg;;
22405 [a-zA-Z]:/*) dflt=$more;;
22409 [a-zA-Z]:/*) dflt=$less;;
22412 '') dflt=/usr/ucb/more;;
22420 rp='What pager is used on your system?'
22424 : see if ar generates random libraries by itself
22426 echo "Checking how to generate random libraries on your machine..." >&4
22427 echo 'extern int bar2(); int bar1() { return bar2(); }' > bar1.c
22428 echo 'int bar2() { return 2; }' > bar2.c
22430 #$i_stdlib I_STDLIB
22432 #include <stdlib.h>
22436 int main() { printf("%d\n", bar1()); exit(0); }
22438 $cc $ccflags -c bar1.c >/dev/null 2>&1
22439 $cc $ccflags -c bar2.c >/dev/null 2>&1
22440 $cc $ccflags -c foo.c >/dev/null 2>&1
22441 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
22442 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22443 $run ./foobar >/dev/null 2>&1; then
22444 echo "$ar appears to generate random libraries itself."
22446 if [ "X$ranlib" = "X" ]; then
22449 elif $ar s bar$_a >/dev/null 2>&1 &&
22450 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22451 $run ./foobar >/dev/null 2>&1; then
22452 echo "a table of contents needs to be added with '$ar s'."
22455 elif $ar ts bar$_a >/dev/null 2>&1 &&
22456 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22457 $run ./foobar >/dev/null 2>&1; then
22458 echo "a table of contents needs to be added with '$ar ts'."
22465 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22466 $test -f $ranlib || ranlib=''
22469 if $test -n "$ranlib"; then
22470 echo "your system has '$ranlib'; we'll use that."
22473 echo "your system doesn't seem to support random libraries"
22474 echo "so we'll use lorder and tsort to order the libraries."
22481 : Check the max offset that gmtime and localtime accept
22482 echo "Checking max offsets that gmtime () accepts"
22484 case "$sGMTIME_min/$sGMTIME_max" in
22487 #include <sys/types.h>
22495 void gm_check (time_t t, int min_year, int max_year)
22498 if ( tmp == NULL ||
22499 /* Check tm_year overflow */
22500 tmp->tm_year < min_year || tmp->tm_year > max_year)
22511 gm_check (MAXLONG, 69, 0x7fffffff);
22513 if (tmp == NULL || tmp->tm_year < 0) {
22514 for (i = 63; i >= 0; i--) {
22515 time_t x = pt | ((time_t)1 << i);
22516 if (x < 0 || x < pt) continue;
22517 gm_check (x, 69, 0x7fffffff);
22520 printf ("sGMTIME_max=%ld\n", pt);
22529 gm_check (MINLONG, -1900, 70);
22532 for (i = 36; i >= 0; i--) {
22533 time_t x = pt - ((time_t)1 << i);
22534 if (x > 0) continue;
22535 gm_check (x, -1900, 70);
22538 printf ("sGMTIME_min=%ld\n", pt);
22542 int main (int argc, char *argv[])
22544 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22551 if eval $compile; then
22552 eval `$run ./try 2>/dev/null`
22554 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22560 echo "Checking max offsets that localtime () accepts"
22562 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22565 #include <sys/types.h>
22573 void local_check (time_t t, int min_year, int max_year)
22575 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22578 tmp = localtime (&t);
22579 if ( tmp == NULL ||
22580 /* Check tm_year overflow */
22581 tmp->tm_year < min_year || tmp->tm_year > max_year)
22585 } /* local_check */
22592 local_check (MAXLONG, 69, 0x7fffffff);
22594 if (tmp == NULL || tmp->tm_year < 0) {
22595 for (i = 63; i >= 0; i--) {
22596 time_t x = pt | ((time_t)1 << i);
22597 if (x < 0 || x < pt) continue;
22598 local_check (x, 69, 0x7fffffff);
22601 printf ("sLOCALTIME_max=%ld\n", pt);
22610 local_check (MINLONG, -1900, 70);
22613 for (i = 36; i >= 0; i--) {
22614 time_t x = pt - ((time_t)1 << i);
22615 if (x > 0) continue;
22616 local_check (x, -1900, 70);
22619 printf ("sLOCALTIME_min=%ld\n", pt);
22623 int main (int argc, char *argv[])
22631 if eval $compile; then
22632 eval `$run ./try 2>/dev/null`
22634 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22640 : check for type of arguments to select.
22641 case "$selecttype" in
22642 '') case "$d_select" in
22646 Checking to see what type of arguments are accepted by select().
22648 hdrs="$define sys/types.h
22649 $i_systime sys/time.h
22650 $i_sysselct sys/select.h
22651 $d_socket sys/socket.h"
22652 : The first arg can be int, unsigned, or size_t
22653 : The last arg may or may not be 'const'
22655 : void pointer has been seen but using that
22656 : breaks the selectminbits test
22657 for xxx in 'fd_set *' 'int *'; do
22658 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22659 for tmo in 'struct timeval *' 'const struct timeval *'; do
22661 '') try="$extern_C int select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22662 if ./protochk "$try" $hdrs; then
22663 echo "Your system accepts $xxx."
22672 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22673 case "$d_fd_set" in
22674 $define) dflt="fd_set *" ;;
22683 *) : no select, so pick a harmless default
22690 : check for the select 'width'
22691 case "$selectminbits" in
22692 '') safebits=`expr $ptrsize \* 8`
22693 case "$d_select" in
22697 Checking to see on how many bits at a time your select() operates...
22700 #include <sys/types.h>
22702 #$i_systime I_SYS_TIME
22703 #$i_systimek I_SYS_TIME_KERNEL
22708 # ifdef I_SYS_TIME_KERNEL
22711 # include <sys/time.h>
22712 # ifdef I_SYS_TIME_KERNEL
22716 #$i_sysselct I_SYS_SELECT
22717 #ifdef I_SYS_SELECT
22718 #include <sys/select.h>
22720 #$d_socket HAS_SOCKET
22722 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22725 #$i_stdlib I_STDLIB
22727 #include <stdlib.h>
22730 #define S sizeof(*(b))
22732 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22733 #define NBITS (NBYTES * 8)
22735 char *s = (char *)malloc(NBYTES);
22744 fp = fopen("try.c", "r");
22750 b = ($selecttype)s;
22751 for (i = 0; i < NBITS; i++)
22755 select(fd + 1, b, 0, 0, &t);
22756 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22758 printf("%d\n", i + 1);
22763 if eval $compile_ok; then
22764 selectminbits=`$run ./try 2>/dev/null`
22765 case "$selectminbits" in
22767 Cannot figure out on how many bits at a time your select() operates.
22768 I'll play safe and guess it is $safebits bits.
22770 selectminbits=$safebits
22771 bits="$safebits bits"
22774 *) bits="$selectminbits bits" ;;
22776 echo "Your select() operates on $bits at a time." >&4
22778 rp='What is the minimum number of bits your select() operates on?'
22779 case "$byteorder" in
22780 12345678) dflt=64 ;;
22786 selectminbits="$val"
22790 *) : no select, so pick a harmless default
22791 selectminbits=$safebits
22797 : Trace out the files included by signal.h, then look for SIGxxx names.
22798 case "$sig_num_init" in
22800 if [ "X$fieldn" = X ]; then
22801 : Just make some guesses. We check them later.
22802 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22804 xxx=`echo '#include <signal.h>' |
22805 $cppstdin $cppminus $cppflags 2>/dev/null |
22806 $grep '^[ ]*#.*include' |
22807 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22808 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22811 for xx in $xxx /dev/null ; do
22812 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22814 case "$xxxfiles" in
22815 '') xxxfiles=`./findhdr signal.h` ;;
22818 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22819 print substr($2, 4, 20)
22821 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22822 print substr($3, 4, 20)
22824 : Append some common names just in case the awk scan failed.
22825 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22826 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22827 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22828 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22829 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22831 : generate a few handy files for later
22832 $cat > signal.c <<EOCP
22833 #include <sys/types.h>
22834 #include <signal.h>
22835 #$i_stdlib I_STDLIB
22837 #include <stdlib.h>
22842 /* Strange style to avoid deeply-nested #if/#else/#endif */
22845 # define NSIG (_NSIG)
22851 # define NSIG (SIGMAX+1)
22857 # define NSIG (SIG_MAX+1)
22863 # define NSIG (_SIG_MAX+1)
22869 # define NSIG (MAXSIG+1)
22875 # define NSIG (MAX_SIG+1)
22880 # ifdef SIGARRAYSIZE
22881 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22887 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22891 /* Default to some arbitrary number that's big enough to get most
22892 of the common signals.
22898 printf("NSIG %d\n", NSIG);
22904 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22906 printf "#ifdef SIG"; printf $1; printf "\n"
22907 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22908 printf $1; printf ");\n"
22912 printf "#endif /* JUST_NSIG */\n";
22913 printf "exit(0);\n}\n";
22916 $cat >signal.awk <<'EOP'
22917 BEGIN { ndups = 0 }
22918 $1 ~ /^NSIG$/ { nsig = $2 }
22919 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22920 if ($2 > maxsig) { maxsig = $2 }
22921 if (sig_name[$2]) {
22922 dup_name[ndups] = $1
22923 dup_num[ndups] = $2
22935 printf("NSIG %d\n", nsig);
22936 for (n = 1; n < nsig; n++) {
22938 printf("%s %d\n", sig_name[n], sig_num[n])
22941 printf("NUM%d %d\n", n, n)
22944 for (n = 0; n < ndups; n++) {
22945 printf("%s %d\n", dup_name[n], dup_num[n])
22949 $cat >signal_cmd <<EOS
22951 if $test -s signal.lst; then
22952 echo "Using your existing signal.lst file"
22957 $cat >>signal_cmd <<'EOS'
22960 if eval $compile_ok; then
22961 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22962 $uniq | $awk -f signal.awk >signal.lst
22964 echo "(I can't seem be able to compile the whole test program)" >&4
22965 echo "(I'll try it in little pieces.)" >&4
22966 set signal -DJUST_NSIG
22967 if eval $compile_ok; then
22968 $run ./signal$_exe > signal.nsg
22971 echo "I can't seem to figure out how many signals you have." >&4
22972 echo "Guessing 50." >&4
22973 echo 'NSIG 50' > signal.nsg
22975 : Now look at all the signal names, one at a time.
22976 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22977 $cat > signal.c <<EOCP
22978 #include <sys/types.h>
22979 #include <signal.h>
22982 printf("$xx %ld\n", (long) SIG${xx});
22987 if eval $compile; then
22988 echo "SIG${xx} found."
22989 $run ./signal$_exe >> signal.ls1
22991 echo "SIG${xx} NOT found."
22994 if $test -s signal.ls1; then
22995 $cat signal.nsg signal.ls1 |
22996 $sort -n | $uniq | $awk -f signal.awk >signal.lst
23000 if $test -s signal.lst; then
23003 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
23004 echo 'kill -l' >signal
23005 set X `csh -f <signal`
23009 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
23011 echo $@ | $tr ' ' $trnl | \
23012 $awk '{ printf "%s %d\n", $1, ++s; }
23013 END { printf "NSIG %d\n", ++s }' >signal.lst
23015 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
23017 chmod a+x signal_cmd
23018 $eunicefix signal_cmd
23022 : generate list of signal names
23023 case "$sig_num_init" in
23026 case "$sig_name_init" in
23028 *) case "$sig_num_init" in
23029 ''|*,*) doinit=yes ;;
23034 echo "Generating a list of signal names and numbers..." >&4
23036 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
23037 sig_name=`$awk 'BEGIN { printf "ZERO " }
23038 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
23039 sig_num=`$awk 'BEGIN { printf "0 " }
23040 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
23041 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
23042 !/^NSIG/ { printf "\"%s\", ", $1 }
23043 END { printf "0\n" }' signal.lst`
23044 sig_num_init=`$awk 'BEGIN { printf "0, " }
23045 !/^NSIG/ { printf "%d, ", $2}
23046 END { printf "0\n"}' signal.lst`
23049 echo "The following $sig_count signals are available:"
23051 echo $sig_name | $awk \
23052 'BEGIN { linelen = 0 }
23054 for (i = 1; i <= NF; i++) {
23055 name = "SIG" $i " "
23056 linelen = linelen + length(name)
23057 if (linelen > 70) {
23059 linelen = length(name)
23065 sig_size=`echo $sig_name | awk '{print NF}'`
23066 $rm -f signal signal.c signal.awk signal.lst signal_cmd
23070 : Check size of size
23072 case "$sizetype" in
23073 *_t) zzz="$sizetype" ;;
23074 *) zzz="filesize" ;;
23076 echo "Checking the size of $zzz..." >&4
23078 #include <sys/types.h>
23080 #$i_stdlib I_STDLIB
23082 #include <stdlib.h>
23085 printf("%d\n", (int)sizeof($sizetype));
23090 if eval $compile_ok; then
23094 echo "(I can't execute the test program--guessing $sizesize.)" >&4
23097 echo "Your $zzz size is $sizesize bytes."
23102 echo "(I can't compile the test program--guessing $sizesize.)" >&4
23105 : check for socklen_t
23107 echo "Checking to see if you have socklen_t..." >&4
23109 #include <sys/types.h>
23110 #$d_socket HAS_SOCKET
23112 #include <sys/socket.h>
23114 int main() { socklen_t x = 16; }
23117 if eval $compile; then
23119 echo "You have socklen_t."
23122 echo "You do not have socklen_t."
23123 case "$sizetype" in
23124 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
23131 : see if this is a socks.h system
23132 set socks.h i_socks
23135 : check for type of the size argument to socket calls
23136 case "$d_socket" in
23140 Checking to see what type is the last argument of accept().
23143 case "$d_socklen_t" in
23144 "$define") yyy="$yyy socklen_t"
23146 yyy="$yyy $sizetype int long unsigned"
23147 for xxx in $yyy; do
23148 case "$socksizetype" in
23149 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
23150 case "$usesocks" in
23152 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
23153 echo "Your system accepts '$xxx *' for the last argument of accept()."
23154 socksizetype="$xxx"
23157 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
23158 echo "Your system accepts '$xxx *' for the last argument of accept()."
23159 socksizetype="$xxx"
23166 : In case none of those worked, prompt the user.
23167 case "$socksizetype" in
23168 '') rp='What is the type for socket address structure sizes?'
23175 *) : no sockets, so pick relatively harmless default
23180 : see what type is used for signed size_t
23181 set ssize_t ssizetype int stdio.h sys/types.h
23186 #$i_stdlib I_STDLIB
23188 #include <stdlib.h>
23190 #include <sys/types.h>
23191 #define Size_t $sizetype
23192 #define SSize_t $dflt
23195 if (sizeof(Size_t) == sizeof(SSize_t))
23197 else if (sizeof(Size_t) == sizeof(int))
23206 if eval $compile_ok && $run ./try > /dev/null; then
23207 ssizetype=`$run ./try`
23208 echo "I'll be using $ssizetype for functions returning a byte count." >&4
23211 Help! I can't compile and run the ssize_t test program: please enlighten me!
23212 (This is probably a misconfiguration in your system or libraries, and
23213 you really ought to fix it. Still, I'll try anyway.)
23215 I need a type that is the same size as $sizetype, but is guaranteed to
23216 be signed. Common values are ssize_t, int and long.
23219 rp="What signed type is the same size as $sizetype?"
23225 : Check the size of st_dev
23227 $echo "Checking the size of st_dev..." >&4
23228 $cat > try.c <<EOCP
23229 #include <sys/stat.h>
23231 #$i_stdlib I_STDLIB
23233 #include <stdlib.h>
23237 printf("%d\n", (int)sizeof(st.st_dev));
23242 if eval $compile_ok; then
23246 $echo "(I can't execute the test program--guessing $st_dev_size.)" >&4
23248 *) st_dev_size=$val
23249 $echo "Your st_dev is $st_dev_size bytes long."
23254 $echo "(I can't compile the test program--guessing $st_dev_size.)" >&4
23258 : Check if st_dev is signed
23260 $echo "Checking the sign of st_dev..." >&4
23261 $cat > try.c <<EOCP
23262 #include <sys/stat.h>
23267 if (foo.st_dev < 0)
23274 if eval $compile; then
23278 $echo "(I can't execute the test program--guessing unsigned.)" >&4
23280 *) st_dev_sign=$val
23281 case "$st_dev_sign" in
23282 1) $echo "Your st_dev is unsigned." ;;
23283 -1) $echo "Your st_dev is signed." ;;
23289 $echo "(I can't compile the test program--guessing unsigned.)" >&4
23293 : Check the size of st_ino
23295 $echo "Checking the size of st_ino..." >&4
23296 $cat > try.c <<EOCP
23297 #include <sys/stat.h>
23299 #$i_stdlib I_STDLIB
23301 #include <stdlib.h>
23305 printf("%d\n", (int)sizeof(st.st_ino));
23310 if eval $compile_ok; then
23314 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
23316 *) st_ino_size=$val
23317 $echo "Your st_ino is $st_ino_size bytes long."
23322 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
23326 : Check if st_ino is signed
23328 $echo "Checking the sign of st_ino..." >&4
23329 $cat > try.c <<EOCP
23330 #include <sys/stat.h>
23335 if (foo.st_ino < 0)
23342 if eval $compile; then
23346 $echo "(I can't execute the test program--guessing unsigned.)" >&4
23348 *) st_ino_sign=$val
23349 case "$st_ino_sign" in
23350 1) $echo "Your st_ino is unsigned." ;;
23351 -1) $echo "Your st_ino is signed." ;;
23357 $echo "(I can't compile the test program--guessing unsigned.)" >&4
23361 : see what type of char stdio uses.
23363 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
23364 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
23365 echo "Your stdio uses unsigned chars." >&4
23366 stdchar="unsigned char"
23368 echo "Your stdio uses signed chars." >&4
23373 : Check size of UID
23376 *_t) zzz="$uidtype" ;;
23379 echo "Checking the size of $zzz..." >&4
23381 #include <sys/types.h>
23383 #$i_stdlib I_STDLIB
23385 #include <stdlib.h>
23388 printf("%d\n", (int)sizeof($uidtype));
23393 if eval $compile_ok; then
23397 echo "(I can't execute the test program--guessing $uidsize.)" >&4
23400 echo "Your $zzz is $uidsize bytes long."
23405 echo "(I can't compile the test program--guessing $uidsize.)" >&4
23408 : Check if UID is signed
23411 *_t) zzz="$uidtype" ;;
23414 echo "Checking the sign of $zzz..." >&4
23416 #include <sys/types.h>
23427 if eval $compile; then
23431 echo "(I can't execute the test program--guessing unsigned.)" >&4
23435 1) echo "Your $zzz is unsigned." ;;
23436 -1) echo "Your $zzz is signed." ;;
23442 echo "(I can't compile the test program--guessing unsigned.)" >&4
23445 : Check format string for UID
23447 $echo "Checking the format string to be used for uids..." >&4
23450 -1) if $test X"$uidsize" = X"$ivsize"; then
23451 uidformat="$ivdformat"
23453 if $test X"$uidsize" = X"$longsize"; then
23456 if $test X"$uidsize" = X"$intsize"; then
23459 if $test X"$uidsize" = X"$shortsize"; then
23466 *) if $test X"$uidsize" = X"$uvsize"; then
23467 uidformat="$uvuformat"
23469 if $test X"$uidsize" = X"$longsize"; then
23472 if $test X"$uidsize" = X"$intsize"; then
23475 if $test X"$uidsize" = X"$shortsize"; then
23484 : Ask about strict by default.
23485 case "$usedefaultstrict" in
23486 $define|true|[Yy]*)
23496 EXPERIMENTAL: Perl can now be built with strict on by default when not
23497 invoked with -e or -E. This is a diagnostic tool for development.
23499 Unless you are familiar with this feature, you should probably answer 'no'.
23503 rp='Would you like to build perl with strict enabled by default?'
23506 y|Y) val="$define" ;;
23509 set usedefaultstrict
23512 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
23514 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
23515 $cat >try.c <<'EOM'
23516 /* Intentionally a long probe as I'd like to sanity check that the exact
23517 approach is going to work, as thinking it will work, but only having it
23518 part working at runtime is worse than not having it. */
23520 #include <sys/types.h>
23521 #include <sys/sysctl.h>
23522 #include <sys/param.h>
23524 #include <string.h>
23525 #include <stdlib.h>
23526 #include <unistd.h>
23529 main(int argc, char **argv) {
23531 char *argv_leaf = strrchr(argv[0], '/');
23537 mib[1] = KERN_PROC;
23538 mib[2] = KERN_PROC_PATHNAME;
23542 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23546 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23551 if (size < strlen(argv_leaf) + 1) {
23552 fprintf(stderr, "size %lu is too short for a path\n",
23553 (unsigned long) size);
23557 if (size > MAXPATHLEN * MAXPATHLEN) {
23558 fprintf(stderr, "size %lu is too long for a path\n",
23559 (unsigned long) size);
23563 buffer = (char *)malloc(size);
23569 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23574 if (strlen(buffer) + 1 != size) {
23575 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23576 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23581 if (*buffer != '/') {
23582 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23586 if (strstr(buffer, "/./")) {
23587 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23591 if (strstr(buffer, "/../")) {
23592 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23596 buffer_leaf = strrchr(buffer, '/');
23597 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23598 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23610 if eval $compile; then
23611 if $run ./try; then
23612 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23615 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23619 echo "I'm unable to compile the test program." >&4
23620 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23624 set usekernprocpathname
23627 : Determine if we can use _NSGetExecutablePath to find executing program
23629 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23630 $cat >try.c <<'EOM'
23631 /* Intentionally a long probe as I'd like to sanity check that the exact
23632 approach is going to work, as thinking it will work, but only having it
23633 part working at runtime is worse than not having it. */
23634 #include <mach-o/dyld.h>
23636 #include <stdlib.h>
23637 #include <sys/param.h>
23638 #include <string.h>
23641 main(int argc, char **argv) {
23643 uint32_t size = sizeof(buf);
23647 char *argv_leaf = strrchr(argv[0], '/');
23651 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23655 _NSGetExecutablePath(buf, &size);
23656 if (size > MAXPATHLEN * MAXPATHLEN) {
23657 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23658 (unsigned int) size);
23662 buffer = (char *)malloc(size);
23668 result = _NSGetExecutablePath(buffer, &size);
23670 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23671 result, (unsigned int) size);
23675 tidied = realpath(buffer, NULL);
23677 perror("realpath");
23683 if (*tidied != '/') {
23684 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23688 if (strstr(tidied, "/./")) {
23689 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23693 if (strstr(tidied, "/../")) {
23694 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23698 tidied_leaf = strrchr(tidied, '/');
23699 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23700 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23712 if eval $compile; then
23713 if $run ./try; then
23714 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23717 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23720 echo "I'm unable to compile the test program." >&4
23721 echo "I'll assume no _NSGetExecutablePath here." >&4
23724 set usensgetexecutablepath
23727 : Check if site customization support was requested
23728 case "$usesitecustomize" in
23729 $define|true|[Yy]*)
23730 usesitecustomize="$define"
23733 usesitecustomize="$undef"
23737 : determine compiler compiler
23746 if $test -f "$byacc$_exe"; then
23748 comp="byacc or $comp"
23750 if $test -f "$bison$_exe"; then
23751 comp="$comp or bison -y"
23753 rp="Which compiler compiler ($comp) shall I use?"
23762 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23768 : see if this is a bfd.h system
23772 : see if this is an execinfo.h system
23773 set execinfo.h i_execinfo
23776 : see if this is a fenv.h system
23780 : see if this is a fp.h system
23784 : see if this is a fp_class.h system
23785 set fp_class.h i_fp_class
23788 : see if gdbm.h is available
23793 : see if gdbm_open exists
23794 set gdbm_open d_gdbm_open
23796 case "$d_gdbm_open" in
23799 echo "We won't be including <gdbm.h>"
23808 : see if this is a ieeefp.h system
23809 case "$i_ieeefp" in
23810 '' ) set ieeefp.h i_ieeefp
23815 : see if this is a libutil.h system
23816 set libutil.h i_libutil
23819 : see if mach cthreads are available
23820 if test "X$usethreads" = "X$define"; then
23821 set mach/cthreads.h i_machcthr
23824 i_machcthr="$undef"
23827 : see if this is a mntent.h system
23828 set mntent.h i_mntent
23831 : see if net/errno.h is available
23833 set net/errno.h val
23836 : Unfortunately, it causes problems on some systems. Arrgh.
23839 cat > try.c <<'EOM'
23842 #include <net/errno.h>
23848 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23849 echo "We'll be including <net/errno.h>." >&4
23851 echo "We won't be including <net/errno.h>." >&4
23860 : see if netinet/tcp.h is available
23861 set netinet/tcp.h i_netinettcp
23864 : see if this is a poll.h system
23868 : see if this is a prot.h system
23872 : Preprocessor symbols
23874 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23875 $cat <<'EOSH' > Cppsym.know
23876 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23877 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23878 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23879 arch_pwr ardent ARM ARM32 atarist att386 att3b
23880 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23881 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23882 byteorder byte_order
23883 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23884 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23885 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23886 ELF encore EPI EXTENSIONS
23887 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23888 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23889 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23890 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23891 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
23892 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23893 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23894 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23895 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23897 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23898 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23899 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23901 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23902 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23903 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23904 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23905 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23906 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23907 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23908 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23909 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23910 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23911 ns32000 ns32016 ns32332 ns32k nsc32000
23912 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23913 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23914 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23915 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23917 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23918 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23919 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23920 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23921 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23922 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23923 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23924 SYSV4 SYSV5 sysV68 sysV88
23925 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23926 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23927 tower32_800 tower32_850 tss
23928 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23929 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23930 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23931 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23932 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23933 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23935 vax venix VMESA vms
23936 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23937 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23940 # Maybe put other stuff here too.
23941 ./tr '-' '_' <<EOSH >>Cppsym.know
23944 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23945 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23946 $cat Cppsym.know > Cppsym.c
23947 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23948 $rm -f Cppsym.a Cppsym.b Cppsym.c
23949 cat <<EOSH > Cppsym
23951 if $test \$# -gt 0; then
23952 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23953 if $test -s Cppsym.got; then
23960 $tr " " "$trnl" | ./Cppsym.try
23966 cat <<EOSH > Cppsym.try
23968 cat <<'EOCP' > try.c
23971 #define STRINGIFY(a) "a"
23973 #if cpp_stuff == 42
23974 #define StGiFy(a) #a
23975 #define STRINGIFY(a) StGiFy(a)
23977 #if $cpp_stuff != 1 && $cpp_stuff != 42
23978 # include "Bletch: How does this C preprocessor stringify macros?"
23984 cat <<'EOSH' >> Cppsym.try
23986 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23987 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23988 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23989 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23991 echo 'return 0;}' >> try.c
23993 cat <<EOSH >> Cppsym.try
23995 case "$osname-$gccversion" in
23996 irix-) ccflags="\$ccflags -woff 1178" ;;
23997 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23999 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
24001 chmod +x Cppsym.try
24002 $eunicefix Cppsym.try
24003 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
24004 : Add in any Linux cpp "predefined macros":
24005 case "$osname::$gccversion" in
24006 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
24008 rm -f $tHdrH'.h' $tHdrH
24010 # Filter out macro arguments, such as Linux's __INT8_C(c)
24011 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
24012 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
24013 if [ -s $tHdrH'_cppsym.real' ]; then
24014 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
24017 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
24020 : now check the C compiler for additional symbols
24021 postprocess_cc_v=''
24023 aix) postprocess_cc_v="|$tr , ' '" ;;
24030 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
24033 -D*) echo "\$i" | $sed 's/^-D//;s/['\''\"]//g';;
24034 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
24039 postprocess_cc_v=''
24042 ./ccsym > ccsym1.raw
24043 if $test -s ccsym1.raw; then
24044 $sort ccsym1.raw | $uniq >ccsym.raw
24046 mv ccsym1.raw ccsym.raw
24049 $awk '/=/ { print $0; next }
24050 { print $0"=1" }' ccsym.raw >ccsym.list
24051 $comm -13 Cppsym.true ccsym.list >ccsym.own
24052 $comm -12 Cppsym.true ccsym.list >ccsym.com
24053 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
24055 if $test -z ccsym.raw; then
24056 echo "Your C compiler doesn't seem to define any symbols!" >&4
24058 echo "However, your C preprocessor defines the following symbols:"
24061 cppsymbols=`$cat Cppsym.true`
24062 cppsymbols=`echo $cppsymbols`
24063 cppccsymbols="$cppsymbols"
24065 if $test -s ccsym.com; then
24066 echo "Your C compiler and pre-processor define these symbols:"
24067 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
24070 cppccsymbols=`$cat ccsym.com`
24071 cppccsymbols=`echo $cppccsymbols`
24072 $test "$silent" || sleep 1
24074 if $test -s ccsym.cpp; then
24075 $test "$also" && echo " "
24076 echo "Your C pre-processor ${also}defines the following symbols:"
24077 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
24079 cppsymbols=`$cat ccsym.cpp`
24080 cppsymbols=`echo $cppsymbols`
24081 $test "$silent" || sleep 1
24083 if $test -s ccsym.own; then
24084 $test "$also" && echo " "
24085 echo "Your C compiler ${also}defines the following cpp symbols:"
24086 $sed -e 's/\(..*\)=1/\1/' ccsym.own
24087 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
24088 ccsymbols=`$cat ccsym.own`
24089 ccsymbols=`echo $ccsymbols`
24090 $test "$silent" || sleep 1
24094 : add -D_FORTIFY_SOURCE if feasible and not already there
24095 case "$gccversion" in
24096 [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
24097 *-O*) case "$ccflags$cppsymbols" in
24098 *_FORTIFY_SOURCE=*) # Don't add it again.
24099 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
24101 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
24102 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
24106 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
24110 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
24114 : script used to emit important warnings
24117 if test \$# -gt 0; then
24122 echo "*** WARNING:" >&4
24123 sed -e 's/^/*** /' <msg >&4
24125 cat msg >>config.msg
24126 echo " " >>config.msg
24132 : see if this is a termio system
24136 if $test `./findhdr termios.h`; then
24137 set tcsetattr i_termios
24143 "$define") echo "You have POSIX termios.h... good!" >&4;;
24144 *) if ./Cppsym pyr; then
24145 case "`$run /bin/universe`" in
24146 ucb) if $test `./findhdr sgtty.h`; then
24148 echo "<sgtty.h> found." >&4
24150 echo "System is pyramid with BSD universe."
24151 ./warn "<sgtty.h> not found--you could have problems."
24153 *) if $test `./findhdr termio.h`; then
24155 echo "<termio.h> found." >&4
24157 echo "System is pyramid with USG universe."
24158 ./warn "<termio.h> not found--you could have problems."
24162 if $test `./findhdr termio.h`; then
24163 echo "<termio.h> found." >&4
24165 elif $test `./findhdr sgtty.h`; then
24166 echo "<sgtty.h> found." >&4
24169 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
24172 if $test `./findhdr sgtty.h`; then
24173 echo "<sgtty.h> found." >&4
24175 elif $test `./findhdr termio.h`; then
24176 echo "<termio.h> found." >&4
24179 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
24183 set i_termio; eval $setvar
24184 val=$val2; set i_sgtty; eval $setvar
24185 val=$val3; set i_termios; eval $setvar
24187 : see if stdbool is available
24188 : we want a real compile instead of Inhdr because some Solaris systems
24189 : have stdbool.h, but it can only be used if the compiler indicates it
24190 : is sufficiently c99-compliant.
24194 #include <stdbool.h>
24199 int main(int argc, char **argv)
24205 if eval $compile; then
24206 echo "<stdbool.h> found." >&4
24209 echo "<stdbool.h> NOT found." >&4
24216 : see if stdint is available
24217 set stdint.h i_stdint
24220 : see if sys/access.h is available
24221 set sys/access.h i_sysaccess
24224 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
24225 set sys/filio.h i_sysfilio
24228 if $test `./findhdr sys/ioctl.h`; then
24230 echo '<sys/ioctl.h> found.' >&4
24233 if $test $i_sysfilio = "$define"; then
24234 echo '<sys/ioctl.h> NOT found.' >&4
24236 $test $i_sgtty = "$define" && xxx="sgtty.h"
24237 $test $i_termio = "$define" && xxx="termio.h"
24238 $test $i_termios = "$define" && xxx="termios.h"
24239 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
24245 : see if socket ioctl defs are in sys/sockio.h
24247 xxx=`./findhdr sys/sockio.h`
24248 if $test "$xxx"; then
24249 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
24251 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
24254 echo "No socket ioctls found in <sys/sockio.h>." >&4
24259 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
24265 : see if this is a syslog.h system
24266 set syslog.h i_syslog
24269 : see if this is a sys/mode.h system
24270 set sys/mode.h i_sysmode
24273 : see if there is a sys/poll.h file
24274 set sys/poll.h i_syspoll
24277 : see if sys/resource.h has to be included
24278 set sys/resource.h i_sysresrc
24281 : see if sys/security.h is available
24282 set sys/security.h i_syssecrt
24285 : see if this is a sys/statvfs.h system
24286 set sys/statvfs.h i_sysstatvfs
24289 : see if this is a sys/un.h system
24290 set sys/un.h i_sysun
24293 : see if this is a sys/utsname.h system
24294 set sys/utsname.h i_sysutsname
24297 : see if this is a syswait system
24298 set sys/wait.h i_syswait
24301 : see if this is a ustat.h system
24302 set ustat.h i_ustat
24305 : see if this is an utime system
24306 set utime.h i_utime
24309 : see if this is a vfork system
24312 set vfork.h i_vfork
24320 : see if wchar.h is present
24321 set wchar.h i_wchar
24326 echo "Looking for extensions..." >&4
24327 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
24328 : contain old or inaccurate or duplicate values.
24329 nonxs_extensions=''
24331 : We do not use find because it might not be available.
24332 : We do not just use MANIFEST because the user may have dropped
24333 : some additional extensions into the source tree and expect them
24336 : Function to recursively find available extensions, ignoring DynaLoader
24337 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
24338 : In 5.10.1 and later, extensions are stored in directories
24339 : like File-Glob instead of the older File/Glob/.
24343 DynaLoader|dynaload) ;;
24345 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
24346 case "$this_ext" in
24347 Scalar/List/Utils) this_ext="List/Util" ;;
24348 PathTools) this_ext="Cwd" ;;
24350 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
24351 if $contains " $this_ext " "$tdir/$$.tmp"; then
24353 echo "Duplicate directories detected for extension $xxx" >&4;
24354 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
24355 case "$knowitall" in
24363 echo "Ok. Stopping Configure." >&4;
24364 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
24367 echo "Ok. You will need to correct config.sh before running make." >&4;
24369 $ls -1 "$xxx" > "$tdir/$$.tmp";
24370 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
24371 xs_extensions="$xs_extensions $this_ext";
24372 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
24373 xs_extensions="$xs_extensions $this_ext";
24374 elif $test -d "$xxx"; then
24375 nonxs_extensions="$nonxs_extensions $this_ext";
24377 $rm -f "$tdir/$$.tmp";
24385 eval $find_extensions
24389 eval $find_extensions
24393 eval $find_extensions
24394 set X $xs_extensions
24396 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
24397 set X $nonxs_extensions
24399 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
24401 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
24403 : Now see which are supported on this system.
24405 for xxx in $xs_extensions ; do
24409 amigaos) avail_ext="$avail_ext $xxx" ;;
24414 $define) avail_ext="$avail_ext $xxx" ;;
24417 GDBM_File|gdbm_fil)
24419 $define) avail_ext="$avail_ext $xxx" ;;
24423 : XXX Do we need a useipcsysv variable here
24424 case "${d_msg}${d_sem}${d_shm}" in
24425 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
24428 NDBM_File|ndbm_fil)
24431 case "$osname-$use64bitint" in
24434 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
24437 *) avail_ext="$avail_ext $xxx" ;;
24442 ODBM_File|odbm_fil)
24443 case "${i_dbm}${i_rpcsvcdbm}" in
24445 case "$d_cplusplus" in
24446 define) ;; # delete as a function name will not work
24447 *) case "$osname-$use64bitint" in
24450 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
24453 *) avail_ext="$avail_ext $xxx" ;;
24461 case "$useopcode" in
24462 true|define|y) avail_ext="$avail_ext $xxx" ;;
24466 case "$useposix" in
24467 true|define|y) avail_ext="$avail_ext $xxx" ;;
24471 case "$d_socket" in
24472 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24475 I18N/Langinfo|langinfo)
24476 case "$uselanginfo" in
24477 true|define|y) avail_ext="$avail_ext $xxx" ;;
24480 Sys/Syslog|sys/syslog)
24482 amigaos) ;; # not really very useful on AmigaOS
24484 : XXX syslog requires socket
24485 case "$d_socket" in
24486 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24491 threads|threads/shared)
24492 # threads and threads::shared are special cases.
24493 # To stop people from asking "Perl 5.8.0 was supposed
24494 # to have this new fancy threads implementation but my
24495 # perl doesn't have it" and from people trying to
24496 # (re)install the threads module using CPAN.pm and
24497 # CPAN.pm then offering to reinstall Perl 5.8.0,
24498 # the threads.pm and threads/shared.pm will always be
24499 # there, croaking informatively ("you need to rebuild
24500 # all of Perl with threads, sorry") when threads haven't
24501 # been compiled in.
24503 avail_ext="$avail_ext $xxx"
24509 cygwin) avail_ext="$avail_ext $xxx" ;;
24512 XS/APItest|xs/apitest)
24513 # This is just for testing. Skip it unless we have dynamic loading.
24516 $define) avail_ext="$avail_ext $xxx" ;;
24519 XS/Typemap|xs/typemap)
24520 # This is just for testing. Skip it unless we have dynamic loading.
24522 $define) avail_ext="$avail_ext $xxx" ;;
24525 *) avail_ext="$avail_ext $xxx"
24534 case "$onlyextensions" in
24536 *) keepextensions=''
24537 echo "You have requested that only certain extensions be included..." >&4
24538 for i in $onlyextensions; do
24539 case " $avail_ext " in
24541 echo "Keeping extension $i."
24542 keepextensions="$keepextensions $i"
24544 *) echo "Ignoring extension $i." ;;
24547 avail_ext="$keepextensions"
24551 case "$noextensions" in
24553 *) keepextensions=''
24554 echo "You have requested that certain extensions be ignored..." >&4
24555 for i in $avail_ext; do
24556 case " $noextensions " in
24557 *" $i "*) echo "Ignoring extension $i." ;;
24558 *) echo "Keeping extension $i.";
24559 keepextensions="$keepextensions $i"
24563 avail_ext="$keepextensions"
24567 : Now see which nonxs extensions are supported on this system.
24568 : For now assume all are.
24570 for xxx in $nonxs_extensions ; do
24574 *) nonxs_ext="$nonxs_ext $xxx"
24586 A number of extensions are supplied with $package. You may choose to
24587 compile these extensions for dynamic loading (the default), compile
24588 them into the $package executable (static loading), or not include
24589 them at all. Answer "none" to include no extensions.
24590 Note that DynaLoader is always built and need not be mentioned here.
24593 case "$dynamic_ext" in
24595 : Exclude those listed in static_ext
24597 for xxx in $avail_ext; do
24598 case " $static_ext " in
24600 *) dflt="$dflt $xxx" ;;
24607 *) dflt="$dynamic_ext"
24608 # Perhaps we are reusing an old out-of-date config.sh.
24611 if test X"$dynamic_ext" != X"$avail_ext"; then
24613 NOTICE: Your previous config.sh list may be incorrect.
24614 The extensions now available to you are
24616 but the default list from your previous config.sh is
24628 rp="What extensions do you wish to load dynamically?"
24631 none) dynamic_ext=' ' ;;
24632 *) dynamic_ext="$ans" ;;
24635 case "$static_ext" in
24637 : Exclude those already listed in dynamic linking
24639 for xxx in $avail_ext; do
24640 case " $dynamic_ext " in
24642 *) dflt="$dflt $xxx" ;;
24649 *) dflt="$static_ext"
24656 rp="What extensions do you wish to load statically?"
24659 none) static_ext=' ' ;;
24660 *) static_ext="$ans" ;;
24665 A number of extensions are supplied with $package. Answer "none"
24666 to include no extensions.
24667 Note that DynaLoader is always built and need not be mentioned here.
24670 case "$static_ext" in
24671 '') dflt="$avail_ext" ;;
24672 *) dflt="$static_ext"
24673 # Perhaps we are reusing an old out-of-date config.sh.
24676 if test X"$static_ext" != X"$avail_ext"; then
24678 NOTICE: Your previous config.sh list may be incorrect.
24679 The extensions now available to you are
24681 but the default list from your previous config.sh is
24690 : Exclude those that are not xs extensions
24694 rp="What extensions do you wish to include?"
24697 none) static_ext=' ' ;;
24698 *) static_ext="$ans" ;;
24703 # Encode is a special case. If we are building Encode as a static
24704 # extension, we need to explicitly list its subextensions as well.
24705 # For other nested extensions, this is handled automatically by
24706 # the appropriate Makefile.PL.
24707 case " $static_ext " in
24708 *" Encode "*) # Add the subextensions of Encode
24710 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24711 static_ext="$static_ext Encode/$xxx"
24712 known_extensions="$known_extensions Encode/$xxx"
24718 set X $dynamic_ext $static_ext $nonxs_ext
24722 # Sanity check: We require an extension suitable for use with
24723 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24724 # should show up as failures in the test suite, but it's helpful to
24725 # catch them now.) The 'extensions' list is normally sorted
24726 # alphabetically, so we need to accept either
24727 # DB_File ... Fcntl ... IO ....
24728 # or something like
24729 # Fcntl ... NDBM_File ... IO ....
24730 case " $extensions" in
24731 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24732 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24733 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24734 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24735 echo "WARNING: The Perl you are building will be quite crippled." >&4
24739 : Remove libraries needed only for extensions
24740 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24741 : The exception is SunOS 4.x, which needs them.
24742 case "${osname}X${osvers}" in
24746 *) case "$usedl" in
24747 $define|true|[yY]*)
24748 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24752 *) perllibs="$libs"
24758 : Remove build directory name from cppstdin so it can be used from
24759 : either the present location or the final installed location.
24761 : Get out of the UU directory to get correct path name.
24763 case "$cppstdin" in
24765 echo "Stripping down cppstdin path name"
24771 : end of configuration questions
24773 echo "End of configuration questions."
24776 : back to where it started
24777 if test -d ../UU; then
24781 : configuration may be unconditionally patched via a 'config.arch' file
24782 if $test -f config.arch; then
24783 echo "I see a config.arch file, loading it." >&4
24787 : configuration may be patched via a 'config.over' file
24788 if $test -f config.over; then
24791 rp='I see a config.over file. Do you wish to load it?'
24794 n*) echo "OK, I'll ignore it.";;
24796 echo "Configuration override changes have been loaded."
24801 : in case they want portability, strip down executable paths
24802 case "$d_portable" in
24805 echo "Stripping down executable paths..." >&4
24806 for file in $loclist $trylist; do
24808 eval $file=`basename $temp`
24813 : create config.sh file
24815 echo "Creating config.sh..." >&4
24816 $spitshell <<EOT >config.sh
24819 # This file was produced by running the Configure script. It holds all the
24820 # definitions figured out by Configure. Should you modify one of these values,
24821 # do not forget to propagate your changes by running "Configure -der". You may
24822 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24825 # Package name : $package
24826 # Source directory : $src
24827 # Configuration time: $cf_time
24828 # Configured by : $cf_by
24829 # Target system : $myuname
24832 : Add in command line options if available
24833 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24835 $spitshell <<EOT >>config.sh
24844 Revision='$Revision'
24852 alignbytes='$alignbytes'
24853 aphostname='$aphostname'
24854 api_revision='$api_revision'
24855 api_subversion='$api_subversion'
24856 api_version='$api_version'
24857 api_versionstring='$api_versionstring'
24860 archlibexp='$archlibexp'
24861 archname64='$archname64'
24862 archname='$archname'
24863 archobjs='$archobjs'
24864 asctime_r_proto='$asctime_r_proto'
24873 byteorder='$byteorder'
24875 castflags='$castflags'
24878 cccdlflags='$cccdlflags'
24879 ccdlflags='$ccdlflags'
24881 ccflags_uselargefiles='$ccflags_uselargefiles'
24883 ccsymbols='$ccsymbols'
24884 ccversion='$ccversion'
24886 cf_email='$cf_email'
24888 charbits='$charbits'
24889 charsize='$charsize'
24893 clocktype='$clocktype'
24895 compiler_warning='$compiler_warning'
24896 compress='$compress'
24897 contains='$contains'
24901 cpp_stuff='$cpp_stuff'
24902 cppccsymbols='$cppccsymbols'
24903 cppflags='$cppflags'
24905 cppminus='$cppminus'
24907 cppstdin='$cppstdin'
24908 cppsymbols='$cppsymbols'
24909 crypt_r_proto='$crypt_r_proto'
24910 cryptlib='$cryptlib'
24912 ctermid_r_proto='$ctermid_r_proto'
24913 ctime_r_proto='$ctime_r_proto'
24914 d_Gconvert='$d_Gconvert'
24915 d_PRIEUldbl='$d_PRIEUldbl'
24916 d_PRIFUldbl='$d_PRIFUldbl'
24917 d_PRIGUldbl='$d_PRIGUldbl'
24918 d_PRIXU64='$d_PRIXU64'
24919 d_PRId64='$d_PRId64'
24920 d_PRIeldbl='$d_PRIeldbl'
24921 d_PRIfldbl='$d_PRIfldbl'
24922 d_PRIgldbl='$d_PRIgldbl'
24923 d_PRIi64='$d_PRIi64'
24924 d_PRIo64='$d_PRIo64'
24925 d_PRIu64='$d_PRIu64'
24926 d_PRIx64='$d_PRIx64'
24927 d_SCNfldbl='$d_SCNfldbl'
24928 d__fwalk='$d__fwalk'
24929 d_accept4='$d_accept4'
24930 d_access='$d_access'
24931 d_accessx='$d_accessx'
24935 d_archlib='$d_archlib'
24936 d_asctime64='$d_asctime64'
24937 d_asctime_r='$d_asctime_r'
24942 d_attribute_always_inline='$d_attribute_always_inline'
24943 d_attribute_deprecated='$d_attribute_deprecated'
24944 d_attribute_format='$d_attribute_format'
24945 d_attribute_malloc='$d_attribute_malloc'
24946 d_attribute_nonnull='$d_attribute_nonnull'
24947 d_attribute_noreturn='$d_attribute_noreturn'
24948 d_attribute_pure='$d_attribute_pure'
24949 d_attribute_unused='$d_attribute_unused'
24950 d_attribute_visibility='$d_attribute_visibility'
24951 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24952 d_backtrace='$d_backtrace'
24954 d_bsdgetpgrp='$d_bsdgetpgrp'
24955 d_bsdsetpgrp='$d_bsdsetpgrp'
24956 d_builtin_add_overflow='$d_builtin_add_overflow'
24957 d_builtin_choose_expr='$d_builtin_choose_expr'
24958 d_builtin_expect='$d_builtin_expect'
24959 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24960 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24961 d_c99_variadic_macros='$d_c99_variadic_macros'
24962 d_casti32='$d_casti32'
24963 d_castneg='$d_castneg'
24966 d_chroot='$d_chroot'
24967 d_chsize='$d_chsize'
24969 d_clearenv='$d_clearenv'
24970 d_closedir='$d_closedir'
24971 d_cmsghdr_s='$d_cmsghdr_s'
24972 d_copysign='$d_copysign'
24973 d_copysignl='$d_copysignl'
24974 d_cplusplus='$d_cplusplus'
24976 d_crypt_r='$d_crypt_r'
24978 d_ctermid='$d_ctermid'
24979 d_ctermid_r='$d_ctermid_r'
24980 d_ctime64='$d_ctime64'
24981 d_ctime_r='$d_ctime_r'
24982 d_cuserid='$d_cuserid'
24983 d_dbminitproto='$d_dbminitproto'
24984 d_difftime64='$d_difftime64'
24985 d_difftime='$d_difftime'
24986 d_dir_dd_fd='$d_dir_dd_fd'
24988 d_dirnamlen='$d_dirnamlen'
24989 d_dladdr='$d_dladdr'
24990 d_dlerror='$d_dlerror'
24991 d_dlopen='$d_dlopen'
24992 d_dlsymun='$d_dlsymun'
24993 d_dosuid='$d_dosuid'
24994 d_double_has_inf='$d_double_has_inf'
24995 d_double_has_nan='$d_double_has_nan'
24996 d_double_has_negative_zero='$d_double_has_negative_zero'
24997 d_double_has_subnormals='$d_double_has_subnormals'
24998 d_double_style_cray='$d_double_style_cray'
24999 d_double_style_ibm='$d_double_style_ibm'
25000 d_double_style_ieee='$d_double_style_ieee'
25001 d_double_style_vax='$d_double_style_vax'
25002 d_drand48_r='$d_drand48_r'
25003 d_drand48proto='$d_drand48proto'
25006 d_duplocale='$d_duplocale'
25007 d_eaccess='$d_eaccess'
25008 d_endgrent='$d_endgrent'
25009 d_endgrent_r='$d_endgrent_r'
25010 d_endhent='$d_endhent'
25011 d_endhostent_r='$d_endhostent_r'
25012 d_endnent='$d_endnent'
25013 d_endnetent_r='$d_endnetent_r'
25014 d_endpent='$d_endpent'
25015 d_endprotoent_r='$d_endprotoent_r'
25016 d_endpwent='$d_endpwent'
25017 d_endpwent_r='$d_endpwent_r'
25018 d_endsent='$d_endsent'
25019 d_endservent_r='$d_endservent_r'
25020 d_eofnblk='$d_eofnblk'
25023 d_eunice='$d_eunice'
25026 d_faststdio='$d_faststdio'
25027 d_fchdir='$d_fchdir'
25028 d_fchmod='$d_fchmod'
25029 d_fchmodat='$d_fchmodat'
25030 d_fchown='$d_fchown'
25032 d_fcntl_can_lock='$d_fcntl_can_lock'
25033 d_fd_macros='$d_fd_macros'
25034 d_fd_set='$d_fd_set'
25035 d_fdclose='$d_fdclose'
25037 d_fds_bits='$d_fds_bits'
25038 d_fegetround='$d_fegetround'
25041 d_fgetpos='$d_fgetpos'
25042 d_finite='$d_finite'
25043 d_finitel='$d_finitel'
25044 d_flexfnam='$d_flexfnam'
25046 d_flockproto='$d_flockproto'
25051 d_fp_class='$d_fp_class'
25052 d_fp_classify='$d_fp_classify'
25053 d_fp_classl='$d_fp_classl'
25054 d_fpathconf='$d_fpathconf'
25055 d_fpclass='$d_fpclass'
25056 d_fpclassify='$d_fpclassify'
25057 d_fpclassl='$d_fpclassl'
25058 d_fpgetround='$d_fpgetround'
25059 d_fpos64_t='$d_fpos64_t'
25060 d_freelocale='$d_freelocale'
25061 d_frexpl='$d_frexpl'
25062 d_fs_data_s='$d_fs_data_s'
25063 d_fseeko='$d_fseeko'
25064 d_fsetpos='$d_fsetpos'
25065 d_fstatfs='$d_fstatfs'
25066 d_fstatvfs='$d_fstatvfs'
25068 d_ftello='$d_ftello'
25070 d_futimes='$d_futimes'
25071 d_gai_strerror='$d_gai_strerror'
25072 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
25073 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
25074 d_getaddrinfo='$d_getaddrinfo'
25075 d_getcwd='$d_getcwd'
25076 d_getenv_preserves_other_thread='$d_getenv_preserves_other_thread'
25077 d_getespwnam='$d_getespwnam'
25078 d_getfsstat='$d_getfsstat'
25079 d_getgrent='$d_getgrent'
25080 d_getgrent_r='$d_getgrent_r'
25081 d_getgrgid_r='$d_getgrgid_r'
25082 d_getgrnam_r='$d_getgrnam_r'
25083 d_getgrps='$d_getgrps'
25084 d_gethbyaddr='$d_gethbyaddr'
25085 d_gethbyname='$d_gethbyname'
25086 d_gethent='$d_gethent'
25087 d_gethname='$d_gethname'
25088 d_gethostbyaddr_r='$d_gethostbyaddr_r'
25089 d_gethostbyname_r='$d_gethostbyname_r'
25090 d_gethostent_r='$d_gethostent_r'
25091 d_gethostprotos='$d_gethostprotos'
25092 d_getitimer='$d_getitimer'
25093 d_getlogin='$d_getlogin'
25094 d_getlogin_r='$d_getlogin_r'
25095 d_getmnt='$d_getmnt'
25096 d_getmntent='$d_getmntent'
25097 d_getnameinfo='$d_getnameinfo'
25098 d_getnbyaddr='$d_getnbyaddr'
25099 d_getnbyname='$d_getnbyname'
25100 d_getnent='$d_getnent'
25101 d_getnetbyaddr_r='$d_getnetbyaddr_r'
25102 d_getnetbyname_r='$d_getnetbyname_r'
25103 d_getnetent_r='$d_getnetent_r'
25104 d_getnetprotos='$d_getnetprotos'
25105 d_getpagsz='$d_getpagsz'
25106 d_getpbyname='$d_getpbyname'
25107 d_getpbynumber='$d_getpbynumber'
25108 d_getpent='$d_getpent'
25109 d_getpgid='$d_getpgid'
25110 d_getpgrp2='$d_getpgrp2'
25111 d_getpgrp='$d_getpgrp'
25112 d_getppid='$d_getppid'
25113 d_getprior='$d_getprior'
25114 d_getprotobyname_r='$d_getprotobyname_r'
25115 d_getprotobynumber_r='$d_getprotobynumber_r'
25116 d_getprotoent_r='$d_getprotoent_r'
25117 d_getprotoprotos='$d_getprotoprotos'
25118 d_getprpwnam='$d_getprpwnam'
25119 d_getpwent='$d_getpwent'
25120 d_getpwent_r='$d_getpwent_r'
25121 d_getpwnam_r='$d_getpwnam_r'
25122 d_getpwuid_r='$d_getpwuid_r'
25123 d_getsbyname='$d_getsbyname'
25124 d_getsbyport='$d_getsbyport'
25125 d_getsent='$d_getsent'
25126 d_getservbyname_r='$d_getservbyname_r'
25127 d_getservbyport_r='$d_getservbyport_r'
25128 d_getservent_r='$d_getservent_r'
25129 d_getservprotos='$d_getservprotos'
25130 d_getspnam='$d_getspnam'
25131 d_getspnam_r='$d_getspnam_r'
25132 d_gettimeod='$d_gettimeod'
25133 d_gmtime64='$d_gmtime64'
25134 d_gmtime_r='$d_gmtime_r'
25135 d_gnulibc='$d_gnulibc'
25136 d_grpasswd='$d_grpasswd'
25137 d_has_C_UTF8='$d_has_C_UTF8'
25138 d_hasmntopt='$d_hasmntopt'
25142 d_ilogbl='$d_ilogbl'
25143 d_inc_version_list='$d_inc_version_list'
25144 d_inetaton='$d_inetaton'
25145 d_inetntop='$d_inetntop'
25146 d_inetpton='$d_inetpton'
25147 d_int64_t='$d_int64_t'
25148 d_ip_mreq='$d_ip_mreq'
25149 d_ip_mreq_source='$d_ip_mreq_source'
25150 d_ipv6_mreq='$d_ipv6_mreq'
25151 d_ipv6_mreq_source='$d_ipv6_mreq_source'
25152 d_isascii='$d_isascii'
25153 d_isblank='$d_isblank'
25154 d_isfinite='$d_isfinite'
25155 d_isfinitel='$d_isfinitel'
25157 d_isinfl='$d_isinfl'
25158 d_isless='$d_isless'
25160 d_isnanl='$d_isnanl'
25161 d_isnormal='$d_isnormal'
25164 d_killpg='$d_killpg'
25165 d_lc_monetary_2008='$d_lc_monetary_2008'
25166 d_lchown='$d_lchown'
25167 d_ldbl_dig='$d_ldbl_dig'
25168 d_ldexpl='$d_ldexpl'
25169 d_lgamma='$d_lgamma'
25170 d_lgamma_r='$d_lgamma_r'
25171 d_libm_lib_version='$d_libm_lib_version'
25172 d_libname_unique='$d_libname_unique'
25174 d_linkat='$d_linkat'
25175 d_llrint='$d_llrint'
25176 d_llrintl='$d_llrintl'
25177 d_llround='$d_llround'
25178 d_llroundl='$d_llroundl'
25179 d_localeconv_l='$d_localeconv_l'
25180 d_localtime64='$d_localtime64'
25181 d_localtime_r='$d_localtime_r'
25182 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
25183 d_locconv='$d_locconv'
25188 d_long_double_style_ieee='$d_long_double_style_ieee'
25189 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
25190 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
25191 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
25192 d_long_double_style_vax='$d_long_double_style_vax'
25193 d_longdbl='$d_longdbl'
25194 d_longlong='$d_longlong'
25196 d_lrintl='$d_lrintl'
25197 d_lround='$d_lround'
25198 d_lroundl='$d_lroundl'
25199 d_lseekproto='$d_lseekproto'
25201 d_madvise='$d_madvise'
25202 d_malloc_good_size='$d_malloc_good_size'
25203 d_malloc_size='$d_malloc_size'
25204 d_malloc_usable_size='$d_malloc_usable_size'
25206 d_mbrlen='$d_mbrlen'
25207 d_mbrtowc='$d_mbrtowc'
25208 d_mbstowcs='$d_mbstowcs'
25209 d_mbtowc='$d_mbtowc'
25210 d_memmem='$d_memmem'
25211 d_memrchr='$d_memrchr'
25213 d_mkdtemp='$d_mkdtemp'
25214 d_mkfifo='$d_mkfifo'
25215 d_mkostemp='$d_mkostemp'
25216 d_mkstemp='$d_mkstemp'
25217 d_mkstemps='$d_mkstemps'
25218 d_mktime64='$d_mktime64'
25219 d_mktime='$d_mktime'
25222 d_modflproto='$d_modflproto'
25223 d_mprotect='$d_mprotect'
25225 d_msg_ctrunc='$d_msg_ctrunc'
25226 d_msg_dontroute='$d_msg_dontroute'
25227 d_msg_oob='$d_msg_oob'
25228 d_msg_peek='$d_msg_peek'
25229 d_msg_proxy='$d_msg_proxy'
25230 d_msgctl='$d_msgctl'
25231 d_msgget='$d_msgget'
25232 d_msghdr_s='$d_msghdr_s'
25233 d_msgrcv='$d_msgrcv'
25234 d_msgsnd='$d_msgsnd'
25236 d_munmap='$d_munmap'
25237 d_mymalloc='$d_mymalloc'
25239 d_nanosleep='$d_nanosleep'
25241 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
25242 d_nearbyint='$d_nearbyint'
25243 d_newlocale='$d_newlocale'
25244 d_nextafter='$d_nextafter'
25245 d_nexttoward='$d_nexttoward'
25247 d_nl_langinfo='$d_nl_langinfo'
25248 d_nl_langinfo_l='$d_nl_langinfo_l'
25249 d_non_int_bitfields='$d_non_int_bitfields'
25250 d_nv_preserves_uv='$d_nv_preserves_uv'
25251 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
25252 d_off64_t='$d_off64_t'
25253 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
25254 d_oldpthreads='$d_oldpthreads'
25255 d_oldsock='$d_oldsock'
25257 d_openat='$d_openat'
25258 d_pathconf='$d_pathconf'
25260 d_perl_lc_all_category_positions_init='$d_perl_lc_all_category_positions_init'
25261 d_perl_lc_all_separator='$d_perl_lc_all_separator'
25262 d_perl_lc_all_uses_name_value_pairs='$d_perl_lc_all_uses_name_value_pairs'
25263 d_perl_otherlibdirs='$d_perl_otherlibdirs'
25264 d_phostname='$d_phostname'
25268 d_portable='$d_portable'
25270 d_prctl_set_name='$d_prctl_set_name'
25271 d_printf_format_null='$d_printf_format_null'
25272 d_procselfexe='$d_procselfexe'
25273 d_pseudofork='$d_pseudofork'
25274 d_pthread_atfork='$d_pthread_atfork'
25275 d_pthread_attr_setscope='$d_pthread_attr_setscope'
25276 d_pthread_yield='$d_pthread_yield'
25277 d_ptrdiff_t='$d_ptrdiff_t'
25279 d_pwchange='$d_pwchange'
25280 d_pwclass='$d_pwclass'
25281 d_pwcomment='$d_pwcomment'
25282 d_pwexpire='$d_pwexpire'
25283 d_pwgecos='$d_pwgecos'
25284 d_pwpasswd='$d_pwpasswd'
25285 d_pwquota='$d_pwquota'
25288 d_querylocale='$d_querylocale'
25289 d_random_r='$d_random_r'
25290 d_re_comp='$d_re_comp'
25291 d_readdir64_r='$d_readdir64_r'
25292 d_readdir='$d_readdir'
25293 d_readdir_r='$d_readdir_r'
25294 d_readlink='$d_readlink'
25296 d_recvmsg='$d_recvmsg'
25297 d_regcmp='$d_regcmp'
25298 d_regcomp='$d_regcomp'
25299 d_remainder='$d_remainder'
25300 d_remquo='$d_remquo'
25301 d_rename='$d_rename'
25302 d_renameat='$d_renameat'
25303 d_rewinddir='$d_rewinddir'
25307 d_sbrkproto='$d_sbrkproto'
25308 d_scalbn='$d_scalbn'
25309 d_scalbnl='$d_scalbnl'
25310 d_sched_yield='$d_sched_yield'
25311 d_scm_rights='$d_scm_rights'
25312 d_seekdir='$d_seekdir'
25313 d_select='$d_select'
25315 d_semctl='$d_semctl'
25316 d_semctl_semid_ds='$d_semctl_semid_ds'
25317 d_semctl_semun='$d_semctl_semun'
25318 d_semget='$d_semget'
25320 d_sendmsg='$d_sendmsg'
25321 d_setegid='$d_setegid'
25322 d_setenv='$d_setenv'
25323 d_seteuid='$d_seteuid'
25324 d_setgrent='$d_setgrent'
25325 d_setgrent_r='$d_setgrent_r'
25326 d_setgrps='$d_setgrps'
25327 d_sethent='$d_sethent'
25328 d_sethostent_r='$d_sethostent_r'
25329 d_setitimer='$d_setitimer'
25330 d_setlinebuf='$d_setlinebuf'
25331 d_setlocale='$d_setlocale'
25332 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
25333 d_setlocale_r='$d_setlocale_r'
25334 d_setnent='$d_setnent'
25335 d_setnetent_r='$d_setnetent_r'
25336 d_setpent='$d_setpent'
25337 d_setpgid='$d_setpgid'
25338 d_setpgrp2='$d_setpgrp2'
25339 d_setpgrp='$d_setpgrp'
25340 d_setprior='$d_setprior'
25341 d_setproctitle='$d_setproctitle'
25342 d_setprotoent_r='$d_setprotoent_r'
25343 d_setpwent='$d_setpwent'
25344 d_setpwent_r='$d_setpwent_r'
25345 d_setregid='$d_setregid'
25346 d_setresgid='$d_setresgid'
25347 d_setresuid='$d_setresuid'
25348 d_setreuid='$d_setreuid'
25349 d_setrgid='$d_setrgid'
25350 d_setruid='$d_setruid'
25351 d_setsent='$d_setsent'
25352 d_setservent_r='$d_setservent_r'
25353 d_setsid='$d_setsid'
25354 d_setvbuf='$d_setvbuf'
25357 d_shmatprototype='$d_shmatprototype'
25358 d_shmctl='$d_shmctl'
25360 d_shmget='$d_shmget'
25361 d_sigaction='$d_sigaction'
25362 d_siginfo_si_addr='$d_siginfo_si_addr'
25363 d_siginfo_si_band='$d_siginfo_si_band'
25364 d_siginfo_si_errno='$d_siginfo_si_errno'
25365 d_siginfo_si_fd='$d_siginfo_si_fd'
25366 d_siginfo_si_pid='$d_siginfo_si_pid'
25367 d_siginfo_si_status='$d_siginfo_si_status'
25368 d_siginfo_si_uid='$d_siginfo_si_uid'
25369 d_siginfo_si_value='$d_siginfo_si_value'
25370 d_signbit='$d_signbit'
25371 d_sigprocmask='$d_sigprocmask'
25372 d_sigsetjmp='$d_sigsetjmp'
25373 d_sin6_scope_id='$d_sin6_scope_id'
25374 d_sitearch='$d_sitearch'
25375 d_snprintf='$d_snprintf'
25376 d_sockaddr_in6='$d_sockaddr_in6'
25377 d_sockaddr_sa_len='$d_sockaddr_sa_len'
25378 d_sockaddr_storage='$d_sockaddr_storage'
25379 d_sockatmark='$d_sockatmark'
25380 d_sockatmarkproto='$d_sockatmarkproto'
25381 d_socket='$d_socket'
25382 d_socklen_t='$d_socklen_t'
25383 d_sockpair='$d_sockpair'
25384 d_socks5_init='$d_socks5_init'
25386 d_srand48_r='$d_srand48_r'
25387 d_srandom_r='$d_srandom_r'
25388 d_sresgproto='$d_sresgproto'
25389 d_sresuproto='$d_sresuproto'
25391 d_statblks='$d_statblks'
25392 d_statfs_f_flags='$d_statfs_f_flags'
25393 d_statfs_s='$d_statfs_s'
25394 d_static_inline='$d_static_inline'
25395 d_statvfs='$d_statvfs'
25396 d_stdio_cnt_lval='$d_stdio_cnt_lval'
25397 d_stdio_ptr_lval='$d_stdio_ptr_lval'
25398 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
25399 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
25400 d_stdio_stream_array='$d_stdio_stream_array'
25401 d_stdiobase='$d_stdiobase'
25402 d_stdstdio='$d_stdstdio'
25403 d_strcoll='$d_strcoll'
25404 d_strerror_l='$d_strerror_l'
25405 d_strerror_r='$d_strerror_r'
25406 d_strftime='$d_strftime'
25407 d_strlcat='$d_strlcat'
25408 d_strlcpy='$d_strlcpy'
25409 d_strnlen='$d_strnlen'
25410 d_strtod='$d_strtod'
25411 d_strtod_l='$d_strtod_l'
25412 d_strtol='$d_strtol'
25413 d_strtold='$d_strtold'
25414 d_strtold_l='$d_strtold_l'
25415 d_strtoll='$d_strtoll'
25416 d_strtoq='$d_strtoq'
25417 d_strtoul='$d_strtoul'
25418 d_strtoull='$d_strtoull'
25419 d_strtouq='$d_strtouq'
25420 d_strxfrm='$d_strxfrm'
25421 d_strxfrm_l='$d_strxfrm_l'
25422 d_suidsafe='$d_suidsafe'
25423 d_symlink='$d_symlink'
25424 d_syscall='$d_syscall'
25425 d_syscallproto='$d_syscallproto'
25426 d_sysconf='$d_sysconf'
25427 d_sysernlst='$d_sysernlst'
25428 d_syserrlst='$d_syserrlst'
25429 d_system='$d_system'
25430 d_tcgetpgrp='$d_tcgetpgrp'
25431 d_tcsetpgrp='$d_tcsetpgrp'
25432 d_telldir='$d_telldir'
25433 d_telldirproto='$d_telldirproto'
25434 d_tgamma='$d_tgamma'
25435 d_thread_local='$d_thread_local'
25437 d_timegm='$d_timegm'
25439 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
25440 d_tm_tm_zone='$d_tm_tm_zone'
25441 d_tmpnam_r='$d_tmpnam_r'
25442 d_towlower='$d_towlower'
25443 d_towupper='$d_towupper'
25445 d_truncate='$d_truncate'
25446 d_truncl='$d_truncl'
25447 d_ttyname_r='$d_ttyname_r'
25448 d_tzname='$d_tzname'
25449 d_u32align='$d_u32align'
25450 d_ualarm='$d_ualarm'
25453 d_union_semun='$d_union_semun'
25454 d_unlinkat='$d_unlinkat'
25455 d_unordered='$d_unordered'
25456 d_unsetenv='$d_unsetenv'
25457 d_uselocale='$d_uselocale'
25458 d_usleep='$d_usleep'
25459 d_usleepproto='$d_usleepproto'
25461 d_vendorarch='$d_vendorarch'
25462 d_vendorbin='$d_vendorbin'
25463 d_vendorlib='$d_vendorlib'
25464 d_vendorscript='$d_vendorscript'
25466 d_void_closedir='$d_void_closedir'
25467 d_voidsig='$d_voidsig'
25468 d_voidtty='$d_voidtty'
25469 d_vsnprintf='$d_vsnprintf'
25471 d_waitpid='$d_waitpid'
25472 d_wcrtomb='$d_wcrtomb'
25473 d_wcscmp='$d_wcscmp'
25474 d_wcstombs='$d_wcstombs'
25475 d_wcsxfrm='$d_wcsxfrm'
25476 d_wctomb='$d_wctomb'
25477 d_writev='$d_writev'
25480 db_hashtype='$db_hashtype'
25481 db_prefixtype='$db_prefixtype'
25482 db_version_major='$db_version_major'
25483 db_version_minor='$db_version_minor'
25484 db_version_patch='$db_version_patch'
25485 default_inc_excludes_dot='$default_inc_excludes_dot'
25486 direntrytype='$direntrytype'
25489 doubleinfbytes='$doubleinfbytes'
25490 doublekind='$doublekind'
25491 doublemantbits='$doublemantbits'
25492 doublenanbytes='$doublenanbytes'
25493 doublesize='$doublesize'
25495 drand48_r_proto='$drand48_r_proto'
25497 dtraceobject='$dtraceobject'
25498 dtracexnolibs='$dtracexnolibs'
25499 dynamic_ext='$dynamic_ext'
25505 endgrent_r_proto='$endgrent_r_proto'
25506 endhostent_r_proto='$endhostent_r_proto'
25507 endnetent_r_proto='$endnetent_r_proto'
25508 endprotoent_r_proto='$endprotoent_r_proto'
25509 endpwent_r_proto='$endpwent_r_proto'
25510 endservent_r_proto='$endservent_r_proto'
25511 eunicefix='$eunicefix'
25514 extensions='$extensions'
25515 extern_C='$extern_C'
25517 fflushNULL='$fflushNULL'
25518 fflushall='$fflushall'
25520 firstmakefile='$firstmakefile'
25522 fpossize='$fpossize'
25523 fpostype='$fpostype'
25524 freetype='$freetype'
25527 full_csh='$full_csh'
25528 full_sed='$full_sed'
25529 gccansipedantic='$gccansipedantic'
25530 gccosandvers='$gccosandvers'
25531 gccversion='$gccversion'
25532 getgrent_r_proto='$getgrent_r_proto'
25533 getgrgid_r_proto='$getgrgid_r_proto'
25534 getgrnam_r_proto='$getgrnam_r_proto'
25535 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
25536 gethostbyname_r_proto='$gethostbyname_r_proto'
25537 gethostent_r_proto='$gethostent_r_proto'
25538 getlogin_r_proto='$getlogin_r_proto'
25539 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
25540 getnetbyname_r_proto='$getnetbyname_r_proto'
25541 getnetent_r_proto='$getnetent_r_proto'
25542 getprotobyname_r_proto='$getprotobyname_r_proto'
25543 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25544 getprotoent_r_proto='$getprotoent_r_proto'
25545 getpwent_r_proto='$getpwent_r_proto'
25546 getpwnam_r_proto='$getpwnam_r_proto'
25547 getpwuid_r_proto='$getpwuid_r_proto'
25548 getservbyname_r_proto='$getservbyname_r_proto'
25549 getservbyport_r_proto='$getservbyport_r_proto'
25550 getservent_r_proto='$getservent_r_proto'
25551 getspnam_r_proto='$getspnam_r_proto'
25552 gidformat='$gidformat'
25558 gmtime_r_proto='$gmtime_r_proto'
25559 gnulibc_version='$gnulibc_version'
25561 groupcat='$groupcat'
25562 groupstype='$groupstype'
25565 h_sysfile='$h_sysfile'
25568 hostgenerate='$hostgenerate'
25569 hostosname='$hostosname'
25570 hostperl='$hostperl'
25571 html1dir='$html1dir'
25572 html1direxp='$html1direxp'
25573 html3dir='$html3dir'
25574 html3direxp='$html3direxp'
25577 i32dformat='$i32dformat'
25584 i_arpainet='$i_arpainet'
25586 i_bsdioctl='$i_bsdioctl'
25590 i_dirent='$i_dirent'
25592 i_execinfo='$i_execinfo'
25596 i_fp_class='$i_fp_class'
25598 i_gdbm_ndbm='$i_gdbm_ndbm'
25599 i_gdbmndbm='$i_gdbmndbm'
25601 i_ieeefp='$i_ieeefp'
25602 i_inttypes='$i_inttypes'
25603 i_langinfo='$i_langinfo'
25604 i_libutil='$i_libutil'
25605 i_locale='$i_locale'
25606 i_machcthr='$i_machcthr'
25607 i_malloc='$i_malloc'
25608 i_mallocmalloc='$i_mallocmalloc'
25609 i_mntent='$i_mntent'
25612 i_neterrno='$i_neterrno'
25613 i_netinettcp='$i_netinettcp'
25617 i_pthread='$i_pthread'
25619 i_quadmath='$i_quadmath'
25620 i_rpcsvcdbm='$i_rpcsvcdbm'
25622 i_shadow='$i_shadow'
25624 i_stdbool='$i_stdbool'
25625 i_stdint='$i_stdint'
25626 i_stdlib='$i_stdlib'
25627 i_sunmath='$i_sunmath'
25628 i_sysaccess='$i_sysaccess'
25629 i_sysdir='$i_sysdir'
25630 i_sysfile='$i_sysfile'
25631 i_sysfilio='$i_sysfilio'
25633 i_sysioctl='$i_sysioctl'
25634 i_syslog='$i_syslog'
25635 i_sysmman='$i_sysmman'
25636 i_sysmode='$i_sysmode'
25637 i_sysmount='$i_sysmount'
25638 i_sysndir='$i_sysndir'
25639 i_sysparam='$i_sysparam'
25640 i_syspoll='$i_syspoll'
25641 i_sysresrc='$i_sysresrc'
25642 i_syssecrt='$i_syssecrt'
25643 i_sysselct='$i_sysselct'
25644 i_syssockio='$i_syssockio'
25645 i_sysstat='$i_sysstat'
25646 i_sysstatfs='$i_sysstatfs'
25647 i_sysstatvfs='$i_sysstatvfs'
25648 i_syssyscall='$i_syssyscall'
25649 i_systime='$i_systime'
25650 i_systimek='$i_systimek'
25651 i_systimes='$i_systimes'
25652 i_systypes='$i_systypes'
25653 i_sysuio='$i_sysuio'
25655 i_sysutsname='$i_sysutsname'
25656 i_sysvfs='$i_sysvfs'
25657 i_syswait='$i_syswait'
25658 i_termio='$i_termio'
25659 i_termios='$i_termios'
25661 i_unistd='$i_unistd'
25666 i_wctype='$i_wctype'
25667 i_xlocale='$i_xlocale'
25668 ignore_versioned_solibs='$ignore_versioned_solibs'
25669 inc_version_list='$inc_version_list'
25670 inc_version_list_init='$inc_version_list_init'
25674 initialinstalllocation='$initialinstalllocation'
25675 installarchlib='$installarchlib'
25676 installbin='$installbin'
25677 installhtml1dir='$installhtml1dir'
25678 installhtml3dir='$installhtml3dir'
25679 installman1dir='$installman1dir'
25680 installman3dir='$installman3dir'
25681 installprefix='$installprefix'
25682 installprefixexp='$installprefixexp'
25683 installprivlib='$installprivlib'
25684 installscript='$installscript'
25685 installsitearch='$installsitearch'
25686 installsitebin='$installsitebin'
25687 installsitehtml1dir='$installsitehtml1dir'
25688 installsitehtml3dir='$installsitehtml3dir'
25689 installsitelib='$installsitelib'
25690 installsiteman1dir='$installsiteman1dir'
25691 installsiteman3dir='$installsiteman3dir'
25692 installsitescript='$installsitescript'
25693 installstyle='$installstyle'
25694 installusrbinperl='$installusrbinperl'
25695 installvendorarch='$installvendorarch'
25696 installvendorbin='$installvendorbin'
25697 installvendorhtml1dir='$installvendorhtml1dir'
25698 installvendorhtml3dir='$installvendorhtml3dir'
25699 installvendorlib='$installvendorlib'
25700 installvendorman1dir='$installvendorman1dir'
25701 installvendorman3dir='$installvendorman3dir'
25702 installvendorscript='$installvendorscript'
25704 issymlink='$issymlink'
25705 ivdformat='$ivdformat'
25708 known_extensions='$known_extensions'
25711 ld_can_script='$ld_can_script'
25712 lddlflags='$lddlflags'
25714 ldflags_uselargefiles='$ldflags_uselargefiles'
25715 ldlibpthname='$ldlibpthname'
25722 libsdirs='$libsdirs'
25723 libsfiles='$libsfiles'
25724 libsfound='$libsfound'
25725 libspath='$libspath'
25726 libswanted='$libswanted'
25727 libswanted_uselargefiles='$libswanted_uselargefiles'
25733 localtime_r_proto='$localtime_r_proto'
25734 locincpth='$locincpth'
25735 loclibpth='$loclibpth'
25736 longdblinfbytes='$longdblinfbytes'
25737 longdblkind='$longdblkind'
25738 longdblmantbits='$longdblmantbits'
25739 longdblnanbytes='$longdblnanbytes'
25740 longdblsize='$longdblsize'
25741 longlongsize='$longlongsize'
25742 longsize='$longsize'
25746 lseeksize='$lseeksize'
25747 lseektype='$lseektype'
25751 make_set_make='$make_set_make'
25752 mallocobj='$mallocobj'
25753 mallocsrc='$mallocsrc'
25754 malloctype='$malloctype'
25756 man1direxp='$man1direxp'
25759 man3direxp='$man3direxp'
25761 mips_type='$mips_type'
25762 mistrustnm='$mistrustnm'
25764 mmaptype='$mmaptype'
25765 modetype='$modetype'
25767 multiarch='$multiarch'
25769 myarchname='$myarchname'
25770 mydomain='$mydomain'
25771 myhostname='$myhostname'
25774 need_va_copy='$need_va_copy'
25775 netdb_hlen_type='$netdb_hlen_type'
25776 netdb_host_type='$netdb_host_type'
25777 netdb_name_type='$netdb_name_type'
25778 netdb_net_type='$netdb_net_type'
25781 nm_so_opt='$nm_so_opt'
25782 nonxs_ext='$nonxs_ext'
25784 nvEUformat='$nvEUformat'
25785 nvFUformat='$nvFUformat'
25786 nvGUformat='$nvGUformat'
25787 nv_overflows_integers_at='$nv_overflows_integers_at'
25788 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25789 nveformat='$nveformat'
25790 nvfformat='$nvfformat'
25791 nvgformat='$nvgformat'
25792 nvmantbits='$nvmantbits'
25795 o_nonblock='$o_nonblock'
25797 old_pthread_create_joinable='$old_pthread_create_joinable'
25798 optimize='$optimize'
25799 orderlib='$orderlib'
25802 otherlibdirs='$otherlibdirs'
25806 patchlevel='$patchlevel'
25807 path_sep='$path_sep'
25810 perl_lc_all_category_positions_init='$perl_lc_all_category_positions_init'
25811 perl_lc_all_separator='$perl_lc_all_separator'
25812 perl_patchlevel='$perl_patchlevel'
25813 perl_static_inline='$perl_static_inline'
25814 perl_thread_local='$perl_thread_local'
25815 perladmin='$perladmin'
25816 perllibs='$perllibs'
25817 perlpath='$perlpath'
25819 phostname='$phostname'
25825 prefixexp='$prefixexp'
25827 privlibexp='$privlibexp'
25828 procselfexe='$procselfexe'
25830 quadkind='$quadkind'
25831 quadtype='$quadtype'
25832 randbits='$randbits'
25833 randfunc='$randfunc'
25834 random_r_proto='$random_r_proto'
25835 randseedtype='$randseedtype'
25837 rd_nodata='$rd_nodata'
25838 readdir64_r_proto='$readdir64_r_proto'
25839 readdir_r_proto='$readdir_r_proto'
25840 revision='$revision'
25846 sGMTIME_max='$sGMTIME_max'
25847 sGMTIME_min='$sGMTIME_min'
25848 sLOCALTIME_max='$sLOCALTIME_max'
25849 sLOCALTIME_min='$sLOCALTIME_min'
25850 sPRIEUldbl='$sPRIEUldbl'
25851 sPRIFUldbl='$sPRIFUldbl'
25852 sPRIGUldbl='$sPRIGUldbl'
25853 sPRIXU64='$sPRIXU64'
25855 sPRIeldbl='$sPRIeldbl'
25856 sPRIfldbl='$sPRIfldbl'
25857 sPRIgldbl='$sPRIgldbl'
25862 sSCNfldbl='$sSCNfldbl'
25863 sched_yield='$sched_yield'
25864 scriptdir='$scriptdir'
25865 scriptdirexp='$scriptdirexp'
25867 seedfunc='$seedfunc'
25868 selectminbits='$selectminbits'
25869 selecttype='$selecttype'
25870 sendmail='$sendmail'
25871 setgrent_r_proto='$setgrent_r_proto'
25872 sethostent_r_proto='$sethostent_r_proto'
25873 setlocale_r_proto='$setlocale_r_proto'
25874 setnetent_r_proto='$setnetent_r_proto'
25875 setprotoent_r_proto='$setprotoent_r_proto'
25876 setpwent_r_proto='$setpwent_r_proto'
25877 setservent_r_proto='$setservent_r_proto'
25880 sharpbang='$sharpbang'
25881 shmattype='$shmattype'
25882 shortsize='$shortsize'
25885 sig_count='$sig_count'
25886 sig_name='$sig_name'
25887 sig_name_init='$sig_name_init'
25889 sig_num_init='$sig_num_init'
25890 sig_size='$sig_size'
25891 signal_t='$signal_t'
25892 sitearch='$sitearch'
25893 sitearchexp='$sitearchexp'
25895 sitebinexp='$sitebinexp'
25896 sitehtml1dir='$sitehtml1dir'
25897 sitehtml1direxp='$sitehtml1direxp'
25898 sitehtml3dir='$sitehtml3dir'
25899 sitehtml3direxp='$sitehtml3direxp'
25901 sitelib_stem='$sitelib_stem'
25902 sitelibexp='$sitelibexp'
25903 siteman1dir='$siteman1dir'
25904 siteman1direxp='$siteman1direxp'
25905 siteman3dir='$siteman3dir'
25906 siteman3direxp='$siteman3direxp'
25907 siteprefix='$siteprefix'
25908 siteprefixexp='$siteprefixexp'
25909 sitescript='$sitescript'
25910 sitescriptexp='$sitescriptexp'
25911 sizesize='$sizesize'
25912 sizetype='$sizetype'
25916 sockethdr='$sockethdr'
25917 socketlib='$socketlib'
25918 socksizetype='$socksizetype'
25920 spackage='$spackage'
25921 spitshell='$spitshell'
25922 srand48_r_proto='$srand48_r_proto'
25923 srandom_r_proto='$srandom_r_proto'
25925 ssizetype='$ssizetype'
25926 st_dev_sign='$st_dev_sign'
25927 st_dev_size='$st_dev_size'
25928 st_ino_sign='$st_ino_sign'
25929 st_ino_size='$st_ino_size'
25930 startperl='$startperl'
25932 static_ext='$static_ext'
25934 stdio_base='$stdio_base'
25935 stdio_bufsiz='$stdio_bufsiz'
25936 stdio_cnt='$stdio_cnt'
25937 stdio_filbuf='$stdio_filbuf'
25938 stdio_ptr='$stdio_ptr'
25939 stdio_stream_array='$stdio_stream_array'
25940 strerror_r_proto='$strerror_r_proto'
25942 subversion='$subversion'
25947 targetarch='$targetarch'
25948 targetdir='$targetdir'
25949 targetenv='$targetenv'
25950 targethost='$targethost'
25951 targetmkdir='$targetmkdir'
25952 targetport='$targetport'
25953 targetsh='$targetsh'
25957 timeincl='$timeincl'
25958 timetype='$timetype'
25959 tmpnam_r_proto='$tmpnam_r_proto'
25965 ttyname_r_proto='$ttyname_r_proto'
25968 u32XUformat='$u32XUformat'
25969 u32oformat='$u32oformat'
25972 u32uformat='$u32uformat'
25973 u32xformat='$u32xformat'
25978 uidformat='$uidformat'
25984 uquadtype='$uquadtype'
25985 use64bitall='$use64bitall'
25986 use64bitint='$use64bitint'
25987 usecbacktrace='$usecbacktrace'
25988 usecrosscompile='$usecrosscompile'
25989 usedefaultstrict='$usedefaultstrict'
25990 usedevel='$usedevel'
25992 usedtrace='$usedtrace'
25993 usefaststdio='$usefaststdio'
25994 useithreads='$useithreads'
25995 usekernprocpathname='$usekernprocpathname'
25996 uselanginfo='$uselanginfo'
25997 uselargefiles='$uselargefiles'
25998 uselongdouble='$uselongdouble'
25999 usemallocwrap='$usemallocwrap'
26000 usemorebits='$usemorebits'
26001 usemultiplicity='$usemultiplicity'
26002 usemymalloc='$usemymalloc'
26004 usensgetexecutablepath='$usensgetexecutablepath'
26005 useopcode='$useopcode'
26006 useperlio='$useperlio'
26007 useposix='$useposix'
26008 usequadmath='$usequadmath'
26009 usereentrant='$usereentrant'
26010 userelocatableinc='$userelocatableinc'
26011 useshrplib='$useshrplib'
26012 usesitecustomize='$usesitecustomize'
26013 usesocks='$usesocks'
26014 usethreads='$usethreads'
26015 usevendorprefix='$usevendorprefix'
26016 useversionedarchname='$useversionedarchname'
26017 usevfork='$usevfork'
26020 uvXUformat='$uvXUformat'
26021 uvoformat='$uvoformat'
26024 uvuformat='$uvuformat'
26025 uvxformat='$uvxformat'
26026 vendorarch='$vendorarch'
26027 vendorarchexp='$vendorarchexp'
26028 vendorbin='$vendorbin'
26029 vendorbinexp='$vendorbinexp'
26030 vendorhtml1dir='$vendorhtml1dir'
26031 vendorhtml1direxp='$vendorhtml1direxp'
26032 vendorhtml3dir='$vendorhtml3dir'
26033 vendorhtml3direxp='$vendorhtml3direxp'
26034 vendorlib='$vendorlib'
26035 vendorlib_stem='$vendorlib_stem'
26036 vendorlibexp='$vendorlibexp'
26037 vendorman1dir='$vendorman1dir'
26038 vendorman1direxp='$vendorman1direxp'
26039 vendorman3dir='$vendorman3dir'
26040 vendorman3direxp='$vendorman3direxp'
26041 vendorprefix='$vendorprefix'
26042 vendorprefixexp='$vendorprefixexp'
26043 vendorscript='$vendorscript'
26044 vendorscriptexp='$vendorscriptexp'
26046 version_patchlevel_string='$version_patchlevel_string'
26047 versiononly='$versiononly'
26050 xlocale_needed='$xlocale_needed'
26052 yaccflags='$yaccflags'
26057 : add special variables
26058 $test -f $src/patchlevel.h && \
26059 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
26060 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
26061 echo "PERL_CONFIG_SH=true" >>config.sh
26063 : propagate old symbols
26064 if $test -f UU/config.sh; then
26065 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
26066 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
26067 config.sh config.sh UU/oldconfig.sh |\
26068 $sort | $uniq -u >UU/oldsyms
26069 set X `$cat UU/oldsyms`
26075 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
26077 echo ": Variables propagated from previous config.sh file." >>config.sh
26078 for sym in `$cat UU/oldsyms`; do
26079 echo " Propagating $hint variable "'$'"$sym..."
26080 eval 'tmp="$'"${sym}"'"'
26082 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
26088 : preserve RCS keywords in files with variable substitution, grrr
26091 : Finish up by extracting the .SH files
26094 echo "Stopping at your request, leaving temporary files around."
26104 If you'd like to make any changes to the config.sh file before I begin
26105 to configure things, do it as a shell escape now (e.g. !vi config.sh).
26108 rp="Press return or use a shell escape to edit config.sh:"
26113 *) : in case they cannot read
26114 sh 1>&4 -c "$ans";;
26119 : if this fails, just run all the .SH files by hand
26128 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
26135 Now you need to generate make dependencies by running "$make depend".
26136 You might prefer to run it in background: "$make depend > makedepend.out &"
26137 It can take a while, so you might not want to run it right now.
26142 rp="Run $make depend now?"
26146 $make depend && echo "Now you must run '$make'."
26149 echo "You must run '$make depend' then '$make'."
26152 elif test -f [Mm]akefile; then
26154 echo "Now you must run a $make."
26156 echo "Configure done."
26159 if $test -f Policy.sh; then
26162 If you compile $package on a different machine or from a different object
26163 directory, copy the Policy.sh file from this object directory to the
26164 new one before you run Configure -- this will help you with most of
26165 the policy defaults.
26169 if $test -f UU/config.msg; then
26170 echo "Hmm. I also noted the following information while running:"
26172 $cat UU/config.msg >&4
26174 $rm -f kit*isdone ark*isdone