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/perl5-metaconfig/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 by perlbug@perl.org)
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
345 useversionedarchname=''
351 initialinstalllocation=''
383 d_attribute_deprecated=''
384 d_attribute_format=''
385 d_attribute_malloc=''
386 d_attribute_nonnull=''
387 d_attribute_noreturn=''
389 d_attribute_unused=''
390 d_attribute_warn_unused_result=''
391 d_printf_format_null=''
393 d_builtin_choose_expr=''
395 d_builtin_add_overflow=''
396 d_builtin_mul_overflow=''
397 d_builtin_sub_overflow=''
398 d_c99_variadic_macros=''
448 endhostent_r_proto=''
454 endprotoent_r_proto=''
460 endservent_r_proto=''
532 gethostbyaddr_r_proto=''
534 gethostbyname_r_proto=''
536 gethostent_r_proto=''
549 getnetbyaddr_r_proto=''
551 getnetbyname_r_proto=''
565 d_getprotobyname_r=''
566 getprotobyname_r_proto=''
567 d_getprotobynumber_r=''
568 getprotobynumber_r_proto=''
570 getprotoent_r_proto=''
582 getservbyname_r_proto=''
584 getservbyport_r_proto=''
586 getservent_r_proto=''
619 d_lc_monetary_2008=''
624 d_libm_lib_version=''
632 d_localtime_r_needs_tzset=''
640 d_long_double_style_ieee=''
641 d_long_double_style_ieee_doubledouble=''
642 d_long_double_style_ieee_extended=''
643 d_long_double_style_ieee_std=''
644 d_long_double_style_vax=''
657 d_malloc_good_size=''
698 d_thread_safe_nl_langinfo_l=''
711 d_old_pthread_create_joinable=''
712 old_pthread_create_joinable=''
714 d_pthread_attr_setscope=''
759 sethostent_r_proto=''
776 setprotoent_r_proto=''
788 setservent_r_proto=''
801 d_siginfo_si_errno=''
804 d_siginfo_si_status=''
806 d_siginfo_si_value=''
816 d_ipv6_mreq_source=''
833 d_sprintf_returns_strlen=''
846 perl_static_inline=''
851 d_stdio_ptr_lval_nochange_cnt=''
852 d_stdio_ptr_lval_sets_cnt=''
935 default_inc_excludes_dot=''
1006 d_gdbm_ndbm_h_uses_prototypes=''
1007 d_gdbmndbm_h_uses_prototypes=''
1009 d_ndbm_h_uses_prototypes=''
1083 d_inc_version_list=''
1085 inc_version_list_init=''
1093 installusrbinperl=''
1109 ignore_versioned_solibs=''
1125 d_double_has_negative_zero=''
1126 d_double_has_subnormals=''
1127 d_double_style_cray=''
1128 d_double_style_ibm=''
1129 d_double_style_ieee=''
1130 d_double_style_vax=''
1181 d_perl_otherlibdirs=''
1189 api_versionstring=''
1195 version_patchlevel_string=''
1199 d_nv_preserves_uv=''
1200 d_nv_zero_is_allbits_zero=''
1211 nv_overflows_integers_at=''
1212 nv_preserves_uv_bits=''
1284 installsitehtml1dir=''
1287 installsitehtml3dir=''
1294 installsiteman1dir=''
1297 installsiteman3dir=''
1302 installsitescript=''
1320 d_stdio_stream_array=''
1321 stdio_stream_array=''
1339 usekernprocpathname=''
1340 ccflags_uselargefiles=''
1341 ldflags_uselargefiles=''
1342 libswanted_uselargefiles=''
1351 usensgetexecutablepath=''
1364 installvendorarch=''
1371 installvendorhtml1dir=''
1373 vendorhtml1direxp=''
1374 installvendorhtml3dir=''
1376 vendorhtml3direxp=''
1382 installvendorman1dir=''
1385 installvendorman3dir=''
1392 installvendorscript=''
1403 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1406 : We must find out about Eunice early
1408 if test -f /etc/unixtovms; then
1409 eunicefix=/etc/unixtovms
1411 if test -f /etc/unixtovms.exe; then
1412 eunicefix=/etc/unixtovms.exe
1415 : Set executable suffix now -- needed before hints available
1416 if test -f "/libs/version.library"; then
1419 elif test -f "/system/gnu_library/bin/ar.pm"; then
1422 elif test -n "$DJGPP"; then
1425 elif test -f /kern/cookiejar; then
1428 elif test -d c:/. -o -n "$is_os2" ; then
1435 : Possible local include directories to search.
1436 : Set locincpth to "" in a hint file to defeat local include searches.
1437 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1438 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1440 : no include file wanted by default
1443 : Enable -DEBUGGING and -DDEBUGGING from the command line
1447 : Trailing extension. Override this in a hint file, if needed.
1448 : Extra object files, if any, needed on this platform.
1451 : change the next line if compiling for Xenix/286 on Xenix/386
1452 xlibpth='/usr/lib/386 /lib/386'
1453 : Possible local library directories to search.
1454 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1455 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1457 : general looking path for locating libraries
1458 glibpth="/lib /usr/lib $xlibpth"
1459 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1460 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1461 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1462 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1464 : Private path used by Configure to find libraries. Its value
1465 : is prepended to libpth. This variable takes care of special
1466 : machines, like the mips. Usually, it should be empty.
1469 : default library list
1471 : some systems want to use only the non-versioned libso:s
1472 ignore_versioned_solibs=''
1476 : set useposix=false in your hint file to disable the POSIX extension.
1478 : set useopcode=false in your hint file to disable the Opcode extension.
1481 ccflags_uselargefiles=''
1482 ldflags_uselargefiles=''
1483 libswanted_uselargefiles=''
1484 : set usemultiplicity on the Configure command line to enable multiplicity.
1485 : set usesocks on the Configure command line to enable socks.
1487 : set usethreads on the Configure command line to enable threads.
1488 usereentrant='undef'
1489 : List of libraries we want.
1490 : If anyone needs extra -lxxx, put those in a hint file.
1491 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1492 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1493 : We probably want to search /usr/shlib before most other libraries.
1494 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1495 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1496 glibpth="/usr/shlib $glibpth"
1497 : Do not use vfork unless overridden by a hint file.
1500 : Find the basic shell for Bourne shell scripts
1504 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1507 if test -f "$xxx"; then
1510 : Build up a list and do a single loop so we can 'break' out.
1511 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1512 for xxx in sh bash ksh pdksh ash; do
1514 try="$try ${p}/${xxx}"
1518 if test -f "$xxx"; then
1521 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1524 elif test -f "$xxx.exe"; then
1535 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1537 Usually it's in /bin/sh. How did you even get this far?
1538 Please contact me (Perl Maintainers) at perlbug@perl.org and
1539 we'll try to straighten this all out.
1545 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1546 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1549 : see if sh knows # comments
1550 if `$sh -c '#' >/dev/null 2>&1`; then
1554 test -f $xcat$_exe || xcat=/usr/bin/cat
1555 if test ! -f $xcat$_exe; then
1556 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1557 if test -f $p/cat$_exe; then
1562 if test ! -f $xcat$_exe; then
1563 echo "Can't find cat anywhere!"
1567 echo "#!$xcat" >sharp
1570 ./sharp > today 2>/dev/null
1571 if test -s today; then
1574 echo "#! $xcat" > sharp
1577 ./sharp > today 2>/dev/null
1578 if test -s today; then
1586 echo "Your $sh doesn't grok # comments--I will strip them later on."
1589 echo "exec grep -v '^[ ]*#'" >spitshell
1591 $eunicefix spitshell
1592 spitshell=`pwd`/spitshell
1594 echo "I presume that if # doesn't work, #! won't work either!"
1599 : figure out how to guarantee sh startup
1601 '') startsh=${sharpbang}${sh} ;;
1613 : echo "Yup, it does."
1615 echo "Hmm... '$startsh' does not guarantee sh startup..."
1616 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1620 : Save command line options in file UU/cmdline.opt for later use in
1621 : generating config.sh.
1622 cat > cmdline.opt <<EOSH
1623 : Configure command line arguments.
1632 cat >>cmdline.opt <<EOSH
1633 config_arg$argn='$arg'
1635 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1638 arg_exp=`cat cmdl.opt`
1639 args_exp="$args_exp$args_sep'$arg_exp'"
1640 argn=`expr $argn + 1`
1645 : produce awk script to parse command line options
1646 cat >options.awk <<'EOF'
1648 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1650 len = length(optstr);
1651 for (i = 1; i <= len; i++) {
1652 c = substr(optstr, i, 1);
1653 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1664 if (substr(str, 1, 1) != "-") {
1665 printf("'%s'\n", str);
1669 for (i = 2; i <= len; i++) {
1670 c = substr(str, i, 1);
1672 printf("-%s\n", substr(str, i));
1678 printf("'%s'\n", substr(str, i + 1));
1691 : process the command line options
1692 set X `for arg in "$@"; do echo "X$arg"; done |
1693 sed -e s/X// | awk -f options.awk`
1698 : set up default values
1707 rm -f optdef.sh posthint.sh
1708 cat >optdef.sh <<EOS
1714 while test $# -gt 0; do
1716 -d) shift; fastread=yes;;
1717 -e) shift; alldone=cont;;
1721 if test -r "$1"; then
1724 echo "$me: cannot read config file $1." >&2
1730 -h) shift; error=true;;
1731 -r) shift; reuseval=true;;
1732 -s) shift; silent=true; realsilent=true;;
1733 -E) shift; alldone=exit;;
1734 -K) shift; knowitall=true;;
1736 -S) shift; silent=true; extractsh=true;;
1741 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1742 echo "$me: ignoring -D $1" >&2
1745 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1746 *) echo "$1='define'" >> optdef.sh;;
1753 *=) echo "$1" >> optdef.sh;;
1755 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1756 echo "$me: ignoring -U $1" >&2
1758 *) echo "$1='undef'" >> optdef.sh;;
1769 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1773 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1774 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1780 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1781 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1782 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1783 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1784 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1785 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1791 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1793 echo "$yyy=''" >> posthint.sh ;;
1798 echo "$yyy='$zzz'" >> posthint.sh ;;
1800 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1802 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1807 echo "$yyy=$zzz" >> posthint.sh ;;
1808 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1812 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1815 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1823 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1824 [-U symbol] [-U symbol=] [-A command:symbol...]
1825 -d : use defaults for all answers.
1826 -e : go on without questioning past the production of config.sh.
1827 -f : specify an alternate default configuration file.
1828 -h : print this help message and exit (with an error status).
1829 -r : reuse C symbols value if possible (skips costly nm extraction).
1830 -s : silent mode, only echoes questions and essential information.
1831 -D : define symbol to have some value:
1832 -D symbol symbol gets the value 'define'
1833 -D symbol=value symbol gets the value 'value'
1834 common used examples (see INSTALL for more info):
1835 -Duse64bitint use 64bit integers
1836 -Duse64bitall use 64bit integers and pointers
1837 -Dusethreads use thread support
1838 -Dinc_version_list=none do not include older perl trees in @INC
1839 -DEBUGGING=none DEBUGGING options
1840 -Dcc=gcc choose your compiler
1841 -Dprefix=/opt/perl5 choose your destination
1842 -E : stop at the end of questions, after having produced config.sh.
1843 -K : do not use unless you know what you are doing.
1844 -O : ignored for backward compatibility
1845 -S : perform variable substitutions on all .SH files (can mix with -f)
1846 -U : undefine symbol:
1847 -U symbol symbol gets the value 'undef'
1848 -U symbol= symbol gets completely empty
1850 -A : manipulate symbol after the platform specific hints have been applied:
1851 -A append:symbol=value append value to symbol
1852 -A symbol=value like append:, but with a separating space
1853 -A define:symbol=value define symbol to have value
1854 -A clear:symbol define symbol to be ''
1855 -A define:symbol define symbol to be 'define'
1856 -A eval:symbol=value define symbol to be eval of value
1857 -A prepend:symbol=value prepend value to symbol
1858 -A undef:symbol define symbol to be 'undef'
1859 -A undef:symbol= define symbol to be ''
1860 e.g.: -A prepend:libswanted='cl pthread '
1861 -A ccflags=-DSOME_MACRO
1862 -V : print version number and exit (with a zero status).
1869 case "$fastread$alldone" in
1872 case "$extractsh" in
1875 if test ! -t 0; then
1876 echo "Say 'sh Configure', not 'sh <Configure'"
1886 true) exec 1>/dev/null;;
1889 : run the defines and the undefines, if any, but leave the file out there...
1891 grep '\\' optdef.sh >/dev/null 2>&1
1892 if test $? = 0; then
1893 echo "Configure does not support \\ in -D arguments"
1897 : create the posthint manipulation script and leave the file out there...
1902 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1903 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1904 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1905 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1906 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1909 : Some greps do not return status, grrr.
1910 echo "grimblepritz" >grimble
1911 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1913 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1919 : the following should work in any shell
1923 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1924 cat >contains <<'EOSS'
1925 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1930 : Find the path to the source tree
1933 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1937 *) src=`cd ../$src && pwd` ;;
1950 if test -f $rsrc/Configure && \
1951 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1953 : found it, so we are ok.
1956 for src in . .. ../.. ../../.. ../../../..; do
1957 if test -f ../$src/Configure && \
1958 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1969 Sorry, I can't seem to locate the source dir for $package. Please start
1970 Configure with an explicit path -- i.e. /some/path/Configure.
1978 echo "Sources for $package found in \"$src\"." >&4
1982 : script used to extract .SH files with variable substitutions
1983 cat >extract <<'EOS'
1985 echo "Doing variable substitutions on .SH files..."
1986 if test -f MANIFEST; then
1987 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1989 echo "(Looking for .SH files under the source directory.)"
1990 set x `(cd "$src"; find . -name "*.SH" -print)`
1994 0) set x `(cd "$src"; echo *.SH)`; shift;;
1996 if test ! -f "$src/$1"; then
2002 while test $name; do
2003 if test ! -d "$name"; then
2004 create="$name $create";
2005 name=`echo $name | sed -e "s|^[^/]*$||"`;
2006 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2011 for file in $create; do
2020 dir=`expr X$file : 'X\(.*\)/'`
2021 file=`expr X$file : 'X.*/\(.*\)'`
2022 (cd "$dir" && . ./$file)
2032 dir=`expr X$file : 'X\(.*\)/'`
2033 file=`expr X$file : 'X.*/\(.*\)'`
2034 (set x $dir; shift; eval $mkdir_p)
2035 sh <"$src/$dir/$file"
2044 if test -f "$src/config_h.SH"; then
2045 if test ! -f config.h; then
2046 : oops, they left it out of MANIFEST, probably, so do it anyway.
2047 . "$src/config_h.SH"
2052 : extract files and exit if asked to do so
2053 case "$extractsh" in
2055 case "$realsilent" in
2059 case "$config_sh" in
2060 '') config_sh='config.sh';;
2063 echo "Fetching answers from $config_sh..."
2070 echo "Extraction done."
2075 : Eunice requires " " instead of "", can you believe it
2078 echo "Beginning of configuration questions for $package."
2080 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2082 : first determine how to suppress newline on echo command
2084 echo "Checking echo to see how to suppress newlines..."
2085 (echo "hi there\c" ; echo " ") >.echotmp
2086 if $contains c .echotmp >/dev/null 2>&1 ; then
2097 echo $n "The star should be here-->$c"
2101 : Now test for existence of everything in MANIFEST
2103 if test -f "$rsrc/MANIFEST"; then
2104 echo "First let's make sure your kit is complete. Checking..." >&4
2105 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2106 (split -l 50 2>/dev/null || split -50)
2109 for filelist in x??; do
2110 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2111 >/dev/null 2>>"$tmppwd/missing")
2113 if test -s missing; then
2117 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2119 You have the option of continuing the configuration process, despite the
2120 distinct possibility that your kit is damaged, by typing 'y'es. If you
2121 do, don't blame me if something goes wrong. I advise you to type 'n'o
2122 and contact the author (perlbug@perl.org).
2125 echo $n "Continue? [n] $c" >&4
2129 echo "Continuing..." >&4
2133 echo "ABORTING..." >&4
2138 echo "Looks good..."
2141 echo "There is no MANIFEST file. I hope your kit is complete !"
2145 : Find the appropriate value for a newline for tr
2146 if test -n "$DJGPP"; then
2149 if test X"$trnl" = X; then
2150 case "`echo foo | tr '\n' x 2>/dev/null`" in
2154 if test X"$trnl" = X; then
2155 case "`echo foo | tr '\012' x 2>/dev/null`" in
2156 foox) trnl='\012' ;;
2159 if test X"$trnl" = X; then
2160 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2161 fooxy) trnl='\n\r' ;;
2164 if test X"$trnl" = X; then
2167 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2173 : compute the number of columns on the terminal for proper question formatting
2178 : set up the echo used in my read
2179 myecho="case \"\$xxxm\" in
2180 '') echo $n \"\$rp $c\" >&4;;
2182 '') echo $n \"[\$xxxm] $c\";;
2184 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2186 echo $n \"[\$xxxm] $c\" >&4
2188 echo $n \"\$rp [\$xxxm] $c\" >&4
2194 : now set up to do reads with possible shell escape and default assignment
2200 case "\$fastread" in
2201 yes) case "\$dflt" in
2204 case "\$silent-\$rp" in
2209 *) case "\$silent" in
2210 true) case "\$rp" in
2215 while expr "X\$ans" : "X!" >/dev/null; do
2219 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2227 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2236 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2241 echo "(OK, I'll run with -d after this question.)" >&4
2244 echo "*** Sorry, \$1 not supported yet." >&4
2254 echo "*** Substitution done -- please confirm."
2256 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2261 echo "*** Error -- try again."
2268 case "\$ans\$xxxm\$nostick" in
2280 : create .config dir to save info across Configure sessions
2281 test -d ../.config || mkdir ../.config
2282 cat >../.config/README <<EOF
2283 This directory created by Configure to save information that should
2284 persist across sessions for $package.
2286 You may safely delete it if you wish.
2289 : See if we are using a devel version and want that
2290 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2293 usedevel="$define" ;;
2294 *) case "$xversion" in
2297 *** WHOA THERE!!! ***
2299 This is an UNSTABLE DEVELOPMENT release.
2300 The version of this $package distribution is $xversion, that is, odd,
2301 (as opposed to even) and that signifies a development release.
2302 If you want a maintenance release, you want an even-numbered version.
2304 Do ***NOT*** install this into production use.
2305 Data corruption and crashes are possible.
2307 It is most seriously suggested that you do not continue any further
2308 unless you want to help in developing and debugging Perl.
2310 If you *still* want to build perl, you can answer 'y' now,
2311 or pass -Dusedevel to Configure.
2314 rp='Do you really want to continue?'
2318 [yY]) echo >&4 "Okay, continuing."
2319 usedevel="$define" ;;
2320 *) echo >&4 "Okay, bye."
2331 case "$versiononly" in
2332 '') versiononly="$define" ;;
2334 case "$installusrbinperl" in
2335 '') installusrbinperl="$undef" ;;
2340 : general instructions
2343 user=`(logname) 2>/dev/null`
2345 '') user=`whoami 2>&1`;;
2347 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2350 rp='Would you like to see the instructions?'
2361 This installation shell script will examine your system and ask you questions
2362 to determine how the perl5 package should be installed. If you get
2363 stuck on a question, you may use a ! shell escape to start a subshell or
2364 execute a command. Many of the questions will have default answers in square
2365 brackets; typing carriage return will give you the default.
2367 On some of the questions which ask for file or directory names you are allowed
2368 to use the ~name construct to specify the login directory belonging to "name",
2369 even if you don't have a shell which knows about that. Questions where this is
2370 allowed will be marked "(~name ok)".
2374 dflt='Type carriage return to continue'
2378 The prompter used in this script allows you to use shell variables and
2379 backticks in your answers. You may use $1, $2, etc... to refer to the words
2380 in the default answer, as if the default line was a set of arguments given to a
2381 script shell. This means you may also use $* to repeat the whole default line,
2382 so you do not have to re-type everything to add something to the default.
2384 Every time there is a substitution, you will have to confirm. If there is an
2385 error (e.g. an unmatched backtick), the default answer will remain unchanged
2386 and you will be prompted again.
2388 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2389 the questions and use the computed defaults (or the previous answers if there
2390 was already a config.sh file). Type 'Configure -h' for a list of options.
2391 You may also start interactively and then answer '& -d' at any prompt to turn
2392 on the non-interactive behaviour for the remainder of the execution.
2398 Much effort has been expended to ensure that this shell script will run on any
2399 Unix system. If despite that it blows up on yours, your best bet is to edit
2400 Configure and run it again. If you can't run Configure for some reason,
2401 you'll have to generate a config.sh file by hand. Whatever problems you
2402 have, let me (perlbug@perl.org) know how I blew it.
2404 This installation script affects things in two ways:
2406 1) it may do direct variable substitutions on some of the files included
2408 2) it builds a config.h file for inclusion in C programs. You may edit
2409 any of these files as the need arises after running this script.
2411 If you make a mistake on a question, there is no easy way to back up to it
2412 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2413 files. Configure will offer to let you do this before it runs the SH files.
2416 dflt='Type carriage return to continue'
2418 case "$firsttime" in
2419 true) echo $user >>../.config/instruct;;
2423 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2424 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2425 if test "X$sysroot" = X; then
2430 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2431 # _sysroot is used in places where we need --sysroot=foo
2432 # but using the rest of the flags could cause issues.
2433 _sysroot="--sysroot=$sysroot";
2437 ccflags="$ccflags $_sysroot"
2442 ldflags="$ldflags $_sysroot"
2447 cppflags="$cppflags $_sysroot"
2449 # lddlflags updated below in lddlflags section;
2450 # same with cccdlflags
2454 # Adjust some defaults to also use $sysroot
2455 for var in xlibpth loclibpth locincpth glibpth; do
2458 for path in $xxx; do
2459 eval $var=\"\$$var $sysroot$path\"
2465 : find out where common programs are
2467 echo "Locating common programs..." >&4
2480 if test -d \$dir/\$thing; then
2486 for thisthing in \$dir/\$thing; do
2487 : just loop through to pick last item
2489 if test -f \$thisthing; then
2492 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2495 elif test -f \$dir/\$thing.exe; then
2496 if test -n "$DJGPP"; then
2497 echo \$dir/\$thing.exe
2498 elif test "$eunicefix" != ":"; then
2499 : on Eunice apparently
2552 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2553 pth="$pth $sysroot/lib $sysroot/usr/lib"
2554 for file in $loclist; do
2558 if test -f "$xxx"; then
2561 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2562 xxx=`./loc $file $file $pth`
2565 '') xxx=`./loc $file $file $pth`;;
2566 *) xxx=`./loc $xxx $xxx $pth`;;
2568 eval $file=$xxx$_exe
2572 echo $file is in $xxx.
2575 echo $file is in $xxx.
2578 echo "I don't know where '$file' is, and my life depends on it." >&4
2579 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2585 echo "Don't worry if any of the following aren't found..."
2587 for file in $trylist; do
2591 if test -f "$xxx"; then
2594 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2595 xxx=`./loc $file $file $pth`
2598 '') xxx=`./loc $file $file $pth`;;
2599 *) xxx=`./loc $xxx $xxx $pth`;;
2601 eval $file=$xxx$_exe
2605 echo $file is in $xxx.
2608 echo $file is in $xxx.
2611 echo "I don't see $file out there, $say."
2618 echo "Substituting grep for egrep."
2625 *) if $less -R </dev/null >/dev/null 2>&1; then
2626 echo "Substituting less -R for less."
2634 echo "Substituting cp for ln."
2643 echo "I can't find make or gmake, and my life depends on it." >&4
2644 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2652 *) # We can't have osname yet.
2653 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2654 # Assume that gmake, if found, is definitely GNU make
2655 # and prefer it over the system make.
2656 echo "Substituting gmake for make."
2664 echo "Hopefully test is built into your sh."
2667 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2668 echo "Using the test built into your sh."
2676 echo "Hopefully echo is built into your sh."
2681 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2682 $echo $n "hi there$c" >foo1
2683 echo $n "hi there$c" >foo2
2684 if cmp foo1 foo2 >/dev/null 2>&1; then
2685 echo "They are compatible. In fact, they may be identical."
2692 They are not compatible! You are probably running ksh on a non-USG system.
2693 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2694 have echo built in and we may have to run some Bourne shell scripts. That
2695 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2698 $echo $n "The star should be here-->$c"
2705 # This question was auctioned at YAPC::Europe-2007 in Vienna
2706 # I never promised you could answer it. I only auctioned the question.
2708 The following message is sponsored by
2710 Dresden.pm<--The stars should be here.
2712 Dear Perl user, system administrator or package
2713 maintainer, the Perl community sends greetings to
2714 you. Do you (emblematical) greet back [Y/n]? n
2718 : Check what type of C compiler we use
2722 cat <<'EOSC' >>trygcc
2727 int main(int argc, char *argv[]) {
2731 if $cc -o try $ccflags $ldflags try.c; then
2734 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2740 # Skip this test because it gives a false match on output like:
2741 # ./trygcc: line 23: cc: command not found
2742 # case "`$cc -v -c try.c 2>&1`" in
2743 # *gcc*) trygcc=no ;;
2745 if $test X"$trygcc" = Xyes; then
2746 if gcc -o try -c try.c; then
2748 echo "You seem to have a working gcc, though." >&4
2749 # Switching compilers may undo the work of hints files.
2750 # The most common problem is -D_REENTRANT for threads.
2751 # This heuristic catches that case, but gets false positives
2752 # if -Dusethreads was not actually specified. Better to
2753 # bail out here with a useful message than fail
2754 # mysteriously later. Should we perhaps just try to
2755 # re-invoke Configure -Dcc=gcc config_args ?
2756 if $test -f usethreads.cbu; then
2759 *** However, any setting of the C compiler flags (e.g. for thread support)
2760 *** will be lost. It may be necessary for you to restart Configure and
2761 *** add -Dcc=gcc to your Configure command line.
2764 rp="Would you like to go ahead and try gcc anyway?"
2767 rp="Would you like to use it?"
2770 if $test -f myread; then
2773 if $test -f UU/myread; then
2776 echo "Cannot find myread, sorry. Aborting." >&2
2781 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2794 cat <<'EOSC' >>checkcc
2799 int main(int argc, char *argv[]) {
2803 if $cc -o try $ccflags $ldflags try.c; then
2806 if $test X"$despair" = Xyes; then
2807 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2810 You need to find a working C compiler.
2811 Either (purchase and) install the C compiler supplied by your OS vendor,
2812 or for a free C compiler try http://gcc.gnu.org/
2813 I cannot continue any further, aborting.
2822 : determine whether symbolic links are supported
2825 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2826 echo "Symbolic links are supported." >&4
2829 echo "Symbolic links are NOT supported." >&4
2834 : determine whether symbolic links are supported
2838 echo "Checking how to test for symbolic links..." >&4
2840 if $test "X$issymlink" = X; then
2842 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2843 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2845 if test $? = 0; then
2848 echo "Your builtin 'test -h' may be broken." >&4
2851 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2854 if test -f "$p/$test"; then
2863 echo "Trying external '$test -h'." >&4
2864 issymlink="$test -h"
2865 if $test ! -h sym >/dev/null 2>&1; then
2866 echo "External '$test -h' is broken, too." >&4
2874 if $test "X$issymlink" = X; then
2875 if $test -L sym 2>/dev/null; then
2876 issymlink="$test -L"
2877 echo "The builtin '$test -L' worked." >&4
2880 if $test "X$issymlink" != X; then
2881 echo "You can test for symbolic links with '$issymlink'." >&4
2883 echo "I do not know how you can test for symbolic links." >&4
2887 *) echo "No symbolic links, so not testing for their testing..." >&4
2891 : Make symlinks util
2892 case "$mksymlinks" in
2895 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2898 *) case "$lns:$issymlink" in
2899 *"ln"*" -s:"*"test -"?)
2900 echo "Creating the symbolic links..." >&4
2902 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2912 print "# dir = ", dir, "file = ", file
2913 mf[dir] = mf[dir]" "source"/"dir"/"file;
2916 if (d != ".") { print("mkdir -p "d) }
2917 print("ln -sf "mf[d]" "d);
2919 }' source="$src" > UU/mksymlinks.$$
2923 if test ! -d t/base; then
2924 echo "Failed to create the subdirectories. Aborting." >&4
2928 if test ! -f t/base/lex.t; then
2929 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2932 if test ! -f win32/win32.c; then
2933 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2938 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2946 : Check for Cross-Compilation
2947 if $test "X$targethost" = "X"; then
2950 if $test "X$targetenv" = "X"; then
2953 case "$usecrosscompile" in
2955 $echo "Cross-compiling..."
2958 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2959 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2960 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2961 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2962 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2963 # leave out ld, choosing it is more complex
2964 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2965 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2966 # We are in a weird spot. Just before us, some values
2967 # were 'saved', to be restored after the hints are
2968 # run. This means that the changes we made to ar,
2969 # nm and ranlib will get reverted.
2970 # To avoid that, we hijack the saving mechanism and
2971 # have it save our new values.
2972 for file in ar nm ranlib; do
2974 eval $file=$xxx$_exe
2979 case "$targetarch" in
2980 '') echo "Targetarch not defined." >&4; croak=y ;;
2981 *) echo "Using targetarch $targetarch." >&4 ;;
2983 case "$targethost" in
2984 '') echo "Targethost not defined." >&4; croak=n ;;
2985 *) echo "Using targethost $targethost." >&4
2990 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2992 : compile a host miniperl and generate_uudmap, unless we got passed them
2993 if $test "X$hostperl" = X; then
2994 echo "Building host miniperl and generate_uudmap binaries" >&4
3002 $src/Configure -des -Dusedevel -Dmksymlinks
3004 case "$hostgenerate" in
3005 '') $make generate_uudmap
3006 hostgenerate=$src/host/generate_uudmap
3008 "$undef") hostgenerate=''
3011 hostperl=$src/host/miniperl
3014 hostosname=`$hostperl -le 'print $^O'`
3017 usecrosscompile="$undef"
3021 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3022 case "$targethost" in
3023 '') echo "Checking for cross-compile" >&4
3024 case "$usecrosscompile$multiarch" in
3025 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3026 if [ -f Makefile ]; then
3028 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3030 echo "Configure done."
3034 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3041 *) echo "Using targethost $targethost." >&4
3043 /*) run=$src/Cross/run
3044 targetmkdir=$src/Cross/mkdir
3046 from=$src/Cross/from
3048 *) pwd=`$test -f ../Configure & cd ..; pwd`
3050 targetmkdir=$pwd/Cross/mkdir
3052 from=$pwd/Cross/from
3055 case "$targetrun" in
3056 '') targetrun=ssh ;;
3061 case "$targetfrom" in
3062 '') targetfrom=scp ;;
3066 from=$from-$targetfrom
3067 case "$targetdir" in
3069 echo "Guessing targetdir $targetdir." >&4
3072 case "$targetuser" in
3074 echo "Guessing targetuser $targetuser." >&4
3077 case "$targetport" in
3079 echo "Guessing targetport $targetport." >&4
3082 case "$targetfrom" in
3086 case "$targetrun" in
3106 '') cwd=$targetdir ;;
3111 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3117 *) echo "Unknown targetrun '$targetrun'" >&4
3121 case "$targetmkdir" in
3123 cat >$targetmkdir <<EOF
3125 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3127 $chmod a+rx $targetmkdir
3129 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3141 $targetmkdir \`dirname \$f\`
3142 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3145 $targetmkdir $targetdir/\`dirname \$f\`
3146 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3159 $mkdir -p $targetdir/\`dirname \$f\`
3160 $cp \$f $targetdir/\$f || exit 1
3163 $targetmkdir $targetdir/\`dirname \$f\`
3164 $cp \$f $targetdir/\$f || exit 1
3171 *) echo "Unknown targetto '$targetto'" >&4
3175 case "$targetfrom" in
3182 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3187 cp) cat >$from <<EOF
3192 cp $targetdir/\$f . || exit 1
3197 *) echo "Unknown targetfrom '$targetfrom'" >&4
3201 if $test ! -f $run; then
3202 echo "Target 'run' script '$run' not found." >&4
3206 if $test ! -f $to; then
3207 echo "Target 'to' script '$to' not found." >&4
3211 if $test ! -f $from; then
3212 echo "Target 'from' script '$from' not found." >&4
3216 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3220 Using '$run' for remote execution,
3221 and '$from' and '$to'
3222 for remote file transfer.
3228 usecrosscompile="$undef"
3233 : see whether [:lower:] and [:upper:] are supported character classes
3235 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3237 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3241 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3242 # (0xd9 and 0xe2), therefore that is a nice testing point.
3243 if test "X$up" = X -o "X$low" = X; then
3244 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3250 if test "X$up" = X -o "X$low" = X; then
3251 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3257 if test "X$up" = X -o "X$low" = X; then
3258 case "`echo RS | od -x 2>/dev/null`" in
3260 echo "Hey, this might be EBCDIC." >&4
3261 if test "X$up" = X -o "X$low" = X; then
3262 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3263 rs) up='[A-IJ-RS-Z]'
3268 if test "X$up" = X -o "X$low" = X; then
3269 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3279 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3281 echo "Using $up and $low to convert case." >&4
3284 echo "I don't know how to translate letters from upper to lower case." >&4
3285 echo "Your tr is not acting any way I know of." >&4
3289 : set up the translation script tr, must be called with ./tr of course
3293 '[A-Z][a-z]') exec $tr '$up' '$low';;
3294 '[a-z][A-Z]') exec $tr '$low' '$up';;
3301 : Try to determine whether config.sh was made on this system
3302 case "$config_sh" in
3304 myuname=`$uname -a 2>/dev/null`
3305 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3306 # Downcase everything to avoid ambiguity.
3307 # Remove slashes and single quotes so we can use parts of this in
3308 # directory and file names.
3309 # Remove newlines so myuname is sane to use elsewhere.
3310 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3311 # because the A-Z/a-z are not consecutive.
3312 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3313 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3314 newmyuname="$myuname"
3316 case "$knowitall" in
3318 if test -f ../config.sh; then
3319 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3320 eval "`grep myuname= ../config.sh`"
3322 if test "X$myuname" = "X$newmyuname"; then
3330 : Get old answers from old config file if Configure was run on the
3331 : same system, otherwise use the hints.
3334 if test -f config.sh; then
3336 rp="I see a config.sh file. Shall I use it to set the defaults?"
3339 n*|N*) echo "OK, I'll ignore it."
3340 mv config.sh config.sh.old
3341 myuname="$newmyuname"
3343 *) echo "Fetching default answers from your old config.sh file..." >&4
3351 : Older versions did not always set $sh. Catch re-use of such
3361 if test ! -f config.sh; then
3364 First time through, eh? I have some defaults handy for some systems
3365 that need some extra help getting the Configure answers right:
3368 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3370 : Half the following guesses are probably wrong... If you have better
3371 : tests or hints, please send them to perlbug@perl.org
3372 : The metaconfig authors would also appreciate a copy...
3373 $test -f /irix && osname=irix
3374 $test -f /xenix && osname=sco_xenix
3375 $test -f /dynix && osname=dynix
3376 $test -f /dnix && osname=dnix
3377 $test -f /lynx.os && osname=lynxos
3378 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3379 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3380 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3381 $test -f /bin/mips && /bin/mips && osname=mips
3382 $test -d /usr/apollo/bin && osname=apollo
3383 $test -f /etc/saf/_sactab && osname=svr4
3384 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3385 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3386 $test -f /sys/utilities/MultiView && osname=amigaos
3387 if $test -d /MachTen -o -d /MachTen_Folder; then
3389 if $test -x /sbin/version; then
3390 osvers=`/sbin/version | $awk '{print $2}' |
3391 $sed -e 's/[A-Za-z]$//'`
3392 elif $test -x /usr/etc/version; then
3393 osvers=`/usr/etc/version | $awk '{print $2}' |
3394 $sed -e 's/[A-Za-z]$//'`
3400 $test -f /sys/posix.dll &&
3401 $test -f /usr/bin/what &&
3402 set X `/usr/bin/what /sys/posix.dll` &&
3403 $test "$3" = UWIN &&
3407 if $test -f $uname; then
3415 umips) osname=umips ;;
3418 [23]100) osname=mips ;;
3420 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3421 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3424 elif $test -f /etc/kconfig; then
3426 if test "$lns" = "$ln -s"; then
3428 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3430 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3437 if test -n "$DJGPP"; then
3446 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3448 # oslevel can fail with:
3449 # oslevel: Unable to acquire lock.
3450 *not\ found) osvers="$4"."$3" ;;
3451 '<3240'|'<>3240') osvers=3.2.0 ;;
3452 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3453 '=3250'|'>3250') osvers=3.2.5 ;;
3457 bitrig) osname=bitrig
3460 bsd386) osname=bsd386
3463 cygwin*) osname=cygwin
3466 *dc.osx) osname=dcosx
3472 domainos) osname=apollo
3478 dragonfly) osname=dragonfly
3481 dynixptx*) osname=dynixptx
3482 osvers=`echo "$4"|sed 's/^v//'`
3484 freebsd) osname=freebsd
3486 genix) osname=genix ;;
3490 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3503 $test -f /system/lib/libandroid.so && osname=linux-android
3507 netbsd*) osname=netbsd
3510 news-os) osvers="$3"
3512 4*) osname=newsos4 ;;
3516 nonstop-ux) osname=nonstopux ;;
3517 openbsd) osname=openbsd
3523 POSIX-BC | posix-bc ) osname=posix-bc
3526 powerux | power_ux | powermax_os | powermaxos | \
3527 powerunix | power_unix) osname=powerux
3533 solaris) osname=solaris
3535 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3542 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3546 titanos) osname=titanos
3555 ultrix) osname=ultrix
3558 osf1|mls+) case "$5" in
3561 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3564 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3567 hp*) osname=hp_osf1 ;;
3568 mips) osname=mips_osf1 ;;
3571 # UnixWare 7.1.2 is known as Open UNIX 8
3572 openunix|unixware) osname=svr5
3580 $2) case "$osname" in
3584 : svr4.x or possibly later
3594 if test -f /stand/boot ; then
3595 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3596 if test -n "$INITPROG" -a -f "$INITPROG"; then
3597 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3598 if test -n "$isesix"; then
3606 *) if test -f /etc/systemid; then
3608 set `echo $3 | $sed 's/\./ /g'` $4
3609 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3611 elif $test -f $src/hints/sco_$1_$2.sh; then
3613 elif $test -f $src/hints/sco_$1.sh; then
3618 '') : Still unknown. Probably a generic Sys V.
3627 *) case "$osname" in
3628 '') : Still unknown. Probably a generic BSD.
3636 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3637 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3638 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3641 $rm -f UU/kernel.what
3642 elif test -d c:/. -o -n "$is_os2" ; then
3649 case "$targetarch" in
3652 case "$targetarch" in
3654 # Will load qnx.sh, which should change osname to nto
3659 # Catch arm-linux-androideabi, mipsel-linux-android,
3660 # and i686-linux-android
3661 osname=linux-android
3665 # Something like arm-linux-gnueabihf is really just
3672 # XXX perhaps we should just assume
3673 # osvers to be 2, or maybe take the value
3674 # from targetarch. Using $run before the
3675 # hints are run is somewhat icky.
3676 set X `$run $uname -a 2>/dev/null`
3679 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3684 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3691 : Now look for a hint file osname_osvers, unless one has been
3692 : specified already.
3695 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3696 : Also try without trailing minor version numbers.
3697 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3698 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3699 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3700 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3703 *) case "$osvers" in
3706 *) if $test -f $src/hints/$file.sh ; then
3708 elif $test -f $src/hints/$xfile.sh ; then
3710 elif $test -f $src/hints/$xxfile.sh ; then
3712 elif $test -f $src/hints/$xxxfile.sh ; then
3714 elif $test -f $src/hints/$xxxxfile.sh ; then
3716 elif $test -f "$src/hints/${osname}.sh" ; then
3725 if $test -f Policy.sh ; then
3728 none) dflt="Policy" ;;
3729 *) dflt="Policy $dflt" ;;
3734 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3738 if $test -f Policy.sh ; then
3741 There's also a Policy hint file available, which should make the
3742 site-specific (policy) questions easier to answer.
3749 You may give one or more space-separated answers, or "none" if appropriate.
3750 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3751 previous run of Configure, you may specify it as well as or instead of
3752 OS-specific hints. If hints are provided for your OS, you should use them:
3753 although Perl can probably be built without hints on many platforms, using
3754 hints often improve performance and may enable features that Configure can't
3755 set up on its own. If there are no hints that match your OS, specify "none";
3756 DO NOT give a wrong version or a wrong OS.
3760 rp="Which of these apply, if any?"
3763 for file in $tans; do
3764 if $test X$file = XPolicy -a -f Policy.sh; then
3766 $cat Policy.sh >> UU/config.sh
3767 elif $test -f $src/hints/$file.sh; then
3768 . $src/hints/$file.sh
3769 $cat $src/hints/$file.sh >> UU/config.sh
3770 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3773 : Give one chance to correct a possible typo.
3774 echo "$file.sh does not exist"
3776 rp="hint to use instead?"
3778 for file in $ans; do
3779 if $test -f "$src/hints/$file.sh"; then
3780 . $src/hints/$file.sh
3781 $cat $src/hints/$file.sh >> UU/config.sh
3782 elif $test X$ans = X -o X$ans = Xnone ; then
3785 echo "$file.sh does not exist -- ignored."
3792 : Remember our hint file for later.
3793 if $test -f "$src/hints/$file.sh" ; then
3803 echo "Fetching default answers from $config_sh..." >&4
3807 cp $config_sh config.sh 2>/dev/null
3819 : Restore computed paths
3820 for file in $loclist $trylist; do
3821 eval $file="\$_$file"
3826 Configure uses the operating system name and version to set some defaults.
3827 The default value is probably right if the name rings a bell. Otherwise,
3828 since spelling matters for me, either accept the default or answer "none"
3835 ''|' '|none) dflt=none ;;
3836 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3839 *) dflt="$osname" ;;
3841 rp="Operating system name?"
3845 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3851 ''|' '|none) dflt=none ;;
3852 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3853 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3855 ''|' ') dflt=none ;;
3860 *) dflt="$osvers" ;;
3862 rp="Operating system version?"
3872 : who configured the system
3873 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3876 cf_by=`(logname) 2>/dev/null`
3879 cf_by=`(whoami) 2>/dev/null`
3881 "") cf_by=unknown ;;
3886 : decide how portable to be. Allow command line overrides.
3887 case "$d_portable" in
3889 *) d_portable="$define" ;;
3892 : set up shell script to do ~ expansion
3898 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3901 if $test -f /bin/csh; then
3902 /bin/csh -f -c "glob \$1"
3907 name=\`$expr x\$1 : '..\([^/]*\)'\`
3908 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3909 if $test ! -d "\$dir"; then
3911 echo "\$me: can't locate home directory for: \$name" >&2
3916 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3932 : now set up to get a file name
3936 cat <<'EOSC' >>getfile
3952 : getfile will accept an answer from the comma-separated list
3953 : enclosed in parentheses even if it does not meet other criteria.
3954 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3955 fn=`echo $fn | sed 's/(.*)//'`
3961 loc_file=`expr $fn : '.*:\(.*\)'`
3962 fn=`expr $fn : '\(.*\):.*'`
3970 */*) fullpath=true;;
3979 *e*) exp_file=true;;
3982 *p*) nopath_ok=true;;
3987 *d*) type='Directory';;
3988 *l*) type='Locate';;
3993 Locate) what='File';;
3998 case "$d_portable" in
4006 while test "$type"; do
4011 true) rp="$rp (~name ok)";;
4014 if test -f UU/getfile.ok && \
4015 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4034 value=`UU/filexp $ans`
4037 if test "$ans" != "$value"; then
4038 echo "(That expands to $value on this system.)"
4052 /*) value="$ansexp" ;;
4053 [a-zA-Z]:/*) value="$ansexp" ;;
4058 echo "I shall only accept a full path name, as in /bin/ls." >&4
4059 echo "Use a ! shell escape if you wish to check pathnames." >&4
4062 echo "Please give a full path name, starting with slash." >&4
4065 echo "Note that using ~name is ok provided it expands well." >&4
4078 for fp in $gfpth; do
4079 if test "X$fp" = X.; then
4084 if test -f "$pf"; then
4086 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4088 echo "($value is not a plain file, but that's ok.)"
4091 if test X"$type" = X; then
4098 for fp in $gfpth; do
4099 if test "X$fp" = X.; then
4104 direxp="$fp/$ansexp"
4106 if test -d "$direxp"; then
4114 if test -d "$ansexp"; then
4115 echo "(Looking for $loc_file in directory $value.)"
4116 value="$value/$loc_file"
4117 ansexp="$ansexp/$loc_file"
4119 if test -f "$ansexp"; then
4122 case "$nopath_ok" in
4123 true) case "$value" in
4125 *) echo "Assuming $value will be in people's path."
4141 if test "$fastread" = yes; then
4146 rp="$what $value doesn't exist. Use that name anyway?"
4165 test "X$gfpthkeep" != Xy && gfpth=""
4168 : determine root of directory hierarchy where package will be installed.
4171 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4174 dflt=`echo "$prefix" | sed 's/.$//'`
4182 By default, $package will be installed in $dflt/bin, manual pages
4183 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4184 installation directories. Typically this is something like /usr/local.
4185 If you wish to have binaries under /usr/bin but other parts of the
4186 installation under /usr/local, that's ok: you will be prompted
4187 separately for each of the installation directories, the prefix being
4188 only used to set the defaults.
4192 rp='Installation prefix to use?'
4200 *) oldprefix="$prefix";;
4207 : allow them to override the AFS root
4210 *) afsroot=$afsroot ;;
4216 $define|true) afs=true ;;
4217 $undef|false) afs=false ;;
4218 *) if $test -d $afsroot; then
4226 echo "AFS may be running... I'll be extra cautious then..." >&4
4228 echo "AFS does not seem to be running..." >&4
4231 : determine installation prefix for where package is to be installed.
4235 Since you are running AFS, I need to distinguish the directory in which
4236 files will reside from the directory in which they are installed (and from
4237 which they are presumably copied to the former directory by occult means).
4240 case "$installprefix" in
4241 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4242 *) dflt="$installprefix";;
4247 In some special cases, particularly when building $package for distribution,
4248 it is convenient to distinguish the directory in which files should be
4249 installed from the directory ($prefix) in which they will
4250 eventually reside. For most users, these two directories are the same.
4253 case "$installprefix" in
4255 *) dflt=$installprefix;;
4259 rp='What installation prefix should I use for installing files?'
4261 installprefix="$ans"
4262 installprefixexp="$ansexp"
4264 : Perform the prefixexp/installprefixexp correction if necessary
4265 cat <<EOS >installprefix
4268 cat <<'EOSC' >>installprefix
4269 : Change installation prefix, if necessary.
4270 if $test X"$prefix" != X"$installprefix"; then
4271 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4273 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4276 chmod +x installprefix
4277 $eunicefix installprefix
4279 : Set variables such as privlib and privlibexp from the output of ./getfile
4280 : performing the prefixexp/installprefixexp correction if necessary.
4281 cat <<EOS >setprefixvar
4284 cat <<'EOSC' >>setprefixvar
4285 eval "${prefixvar}=\"\$ans\""
4286 eval "${prefixvar}exp=\"\$ansexp\""
4289 chmod +x setprefixvar
4290 $eunicefix setprefixvar
4292 : set up the script used to warn in case of inconsistency
4301 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4303 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4304 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4309 echo "*** WHOA THERE!!! ***" >&4
4310 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4313 rp=" Keep the $hint value?"
4316 y) td=$was; tu=$was;;
4320 : function used to set '$1' to '$val'
4321 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4323 $define$undef) . ./whoa; eval "$var=\$td";;
4324 $undef$define) . ./whoa; eval "$var=\$tu";;
4325 *) eval "$var=$val";;
4328 : get the patchlevel
4330 echo "Getting the current patchlevel..." >&4
4331 if $test -r $rsrc/patchlevel.h;then
4332 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4333 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4334 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4335 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4336 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4337 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4338 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4347 $echo "(You do not have patchlevel.h. Eek.)"
4349 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4350 version_patchlevel_string="version $patchlevel subversion $subversion"
4351 case "$perl_patchlevel" in
4353 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4354 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4358 $echo "(You have $package $version_patchlevel_string.)"
4362 : XXX Should be a Configure test for double-dots in filenames.
4363 version=`echo $revision $patchlevel $subversion | \
4364 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4365 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4366 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4369 version=`echo $revision $patchlevel $subversion | \
4370 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4371 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4372 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4375 : Special case the 5.005_xx maintenance series, which used 5.005
4376 : without any subversion label as a subdirectory in $sitelib
4377 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4378 api_versionstring='5.005'
4381 : Do we want threads support and if so, what type
4382 case "$usethreads" in
4383 $define|true|[yY]*) dflt='y';;
4384 *) # Catch case where user specified ithreads or 5005threads but
4385 # forgot -Dusethreads (A.D. 4/2002)
4386 case "$useithreads$use5005threads" in
4387 *$define*) dflt='y';;
4394 Perl can be built to offer a form of threading support on some systems
4395 To do so, Configure can be run with -Dusethreads.
4397 Note that Perl built with threading support runs slightly slower
4398 and uses slightly more memory than plain Perl.
4400 If this doesn't make any sense to you, just accept the default '$dflt'.
4402 rp='Build a threading Perl?'
4405 y|Y) val="$define" ;;
4411 if $test $patchlevel -lt 9; then
4412 case "$usethreads" in
4414 : Default to ithreads unless overridden on command line or with
4417 case "$use5005threads" in
4419 echo "5.005 threads are no longer supported"
4423 case "$useithreads" in
4424 $undef|false|[nN]*) dflt='n';;
4426 rp='Use the newer interpreter-based ithreads?'
4429 y|Y) val="$define" ;;
4434 : Now set use5005threads to the opposite value.
4435 case "$useithreads" in
4436 $define) val="$undef" ;;
4443 useithreads="$undef"
4444 use5005threads="$undef"
4448 case "$useithreads$use5005threads" in
4452 You cannot have both the ithreads and the 5.005 threads enabled
4453 at the same time. Disabling the 5.005 threads since they are
4454 much less stable than the ithreads.
4457 use5005threads="$undef"
4462 : perl-5.9.x and later
4464 if test X"$usethreads" = "X$define"; then
4465 case "$use5005threads" in
4469 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4476 use5005threads="$undef"
4477 useithreads="$usethreads"
4480 case "$d_oldpthreads" in
4481 '') : Configure tests would be welcome here. For now, assume undef.
4483 *) val="$d_oldpthreads" ;;
4489 : Look for a hint-file generated 'call-back-unit'. If the
4490 : user has specified that a threading perl is to be built,
4491 : we may need to set or change some other defaults.
4492 if $test -f usethreads.cbu; then
4493 echo "Your platform has some specific hints regarding threaded builds, using them..."
4496 case "$usethreads" in
4497 "$define"|true|[yY]*)
4499 (Your platform does not have any specific hints for threaded builds.
4500 Assuming POSIX threads, then.)
4506 : Check if multiplicity is required
4509 Perl can be built so that multiple Perl interpreters can coexist
4510 within the same Perl executable.
4513 case "$useithreads" in
4516 This multiple interpreter support is required for interpreter-based threads.
4520 *) case "$usemultiplicity" in
4521 $define|true|[yY]*) dflt='y';;
4525 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4526 rp='Build Perl for multiplicity?'
4529 y|Y) val="$define" ;;
4537 : Check if morebits is requested
4538 case "$usemorebits" in
4539 "$define"|true|[yY]*)
4540 use64bitint="$define"
4541 uselongdouble="$define"
4542 usemorebits="$define"
4544 *) usemorebits="$undef"
4548 : Determine the C compiler to be used
4554 rp="Use which C compiler?"
4558 : See whether they have no cc but they do have gcc
4560 if $test -f cc.cbu; then
4565 : make some quick guesses about what we are up against
4567 $echo $n "Hmm... $c"
4577 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4578 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4580 echo "Looks kind of like an OSF/1 system, but we'll see..."
4582 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4583 xxx=`./loc addbib blurfl $pth`
4584 if $test -f $xxx; then
4585 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4589 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4590 echo "Looks kind of like an extended USG system, but we'll see..."
4592 echo "Looks kind of like a USG system, but we'll see..."
4596 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4597 echo "Looks kind of like a BSD system, but we'll see..."
4601 echo "Looks kind of like a Version 7 system, but we'll see..."
4604 case "$eunicefix" in
4607 There is, however, a strange, musty smell in the air that reminds me of
4608 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4612 : it so happens the Eunice I know will not run shell scripts in Unix format
4616 echo "Congratulations. You aren't running Eunice."
4620 : Detect OS2. The p_ variable is set above in the Head.U unit.
4621 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4622 : semicolon as a patch separator
4627 I have the feeling something is not exactly right, however...don't tell me...
4628 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4629 (Or you may be running DOS with DJGPP.)
4634 if test -f /xenix; then
4635 echo "Actually, this looks more like a XENIX system..."
4640 echo "It's not Xenix..."
4645 if test -f /venix; then
4646 echo "Actually, this looks more like a VENIX system..."
4653 echo "Nor is it Venix..."
4656 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4657 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4660 : Check if we are using GNU gcc and what its version is
4662 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4666 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4668 printf("%s\n", __VERSION__);
4670 printf("%s\n", "1");
4676 if $cc -o try $ccflags $ldflags try.c; then
4677 gccversion=`$run ./try`
4678 case "$gccversion" in
4679 '') echo "You are not using GNU cc." ;;
4680 *) echo "You are using GNU cc $gccversion."
4686 echo "*** WHOA THERE!!! ***" >&4
4687 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4688 case "$knowitall" in
4690 echo " You'd better start hunting for one and let me know about it." >&4
4696 case "$gccversion" in
4697 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4699 case "$gccversion" in
4700 '') gccosandvers='' ;;
4701 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4702 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4704 case "$gccosandvers" in
4705 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4706 $osname$osvers) ;; # looking good
4707 $osname*) cat <<EOM >&4
4709 *** WHOA THERE!!! ***
4711 Your gcc has not been compiled for the exact release of
4712 your operating system ($gccosandvers versus $osname$osvers).
4714 In general it is a good idea to keep gcc synchronized with
4715 the operating system because otherwise serious problems
4716 may ensue when trying to compile software, like Perl.
4718 I'm trying to be optimistic here, though, and will continue.
4719 If later during the configuration and build icky compilation
4720 problems appear (headerfile conflicts being the most common
4721 manifestation), I suggest reinstalling the gcc to match
4722 your operating system release.
4726 *) gccosandvers='' ;; # failed to parse, better be silent
4734 # gcc 3.* complain about adding -Idirectories that they already know about,
4735 # so we will take those off from locincpth.
4736 case "$gccversion" in
4738 echo "main(){}">try.c
4739 for incdir in $locincpth; do
4740 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4741 grep '^c[cp]p*[01]: warning: changing search order '`
4742 if test "X$warn" != X; then
4743 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4749 # gcc 4.9 by default does some optimizations that break perl.
4750 # see ticket 121505.
4752 # The -fwrapv disables those optimizations (and probably others,) so
4753 # for gcc 4.9 (and later, since the optimizations probably won't go
4754 # away), add -fwrapv unless the user requests -fno-wrapv, which
4755 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4756 # which turns the overflows -fwrapv ignores into runtime errors.
4757 case "$gccversion" in
4758 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4760 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4761 *) ccflags="$ccflags -fwrapv" ;;
4765 : What should the include directory be ?
4766 : Use sysroot if set, so findhdr looks in the right place.
4768 $echo $n "Hmm... $c"
4769 dflt="$sysroot/usr/include"
4772 if $test -f /bin/mips && /bin/mips; then
4773 echo "Looks like a MIPS system..."
4774 $cat >usr.c <<'EOCP'
4775 #ifdef SYSTYPE_BSD43
4779 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4780 dflt='/bsd43/usr/include'
4784 mips_type='System V'
4786 $rm -f usr.c usr.out
4787 echo "and you're compiling with the $mips_type compiler and libraries."
4791 echo "Doesn't look like a MIPS system."
4801 case "$xxx_prompt" in
4804 rp='Where are the include files you want to use?'
4812 : see how we invoke the C preprocessor
4814 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4815 cat <<'EOT' >testcpp.c
4821 if test ! -f cppstdin; then
4822 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4823 # AIX cc -E doesn't show the absolute headerfile
4824 # locations but we'll cheat by using the -M flag.
4825 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
4827 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4830 echo "Keeping your $hint cppstdin wrapper."
4833 wrapper=`pwd`/cppstdin
4837 if $test "X$cppstdin" != "X" && \
4838 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4839 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4841 echo "You used to use $cppstdin $cppminus so we'll use that again."
4843 '') echo "But let's see if we can live without a wrapper..." ;;
4845 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4846 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4848 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4851 echo "(However, $cpprun $cpplast does not work, let's see...)"
4859 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4866 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4867 $cc -E <testcpp.c >testcpp.out 2>&1; \
4868 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 echo "Yup, it does."
4870 x_cpp="$cc $cppflags -E"
4872 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4873 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4874 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4875 echo "Yup, it does."
4876 x_cpp="$cc $cppflags -E"
4878 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4879 $cc -P <testcpp.c >testcpp.out 2>&1; \
4880 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 echo "Yipee, that works!"
4882 x_cpp="$cc $cppflags -P"
4884 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4885 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4886 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4887 echo "At long last!"
4888 x_cpp="$cc $cppflags -P"
4890 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4891 $cpp <testcpp.c >testcpp.out 2>&1; \
4892 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4894 x_cpp="$cpp $cppflags"
4896 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4897 $cpp - <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4899 echo "Hooray, it works! I was beginning to wonder."
4900 x_cpp="$cpp $cppflags"
4902 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4903 $wrapper <testcpp.c >testcpp.out 2>&1; \
4904 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4910 rp="No dice. I can't find a C preprocessor. Name one:"
4914 $x_cpp <testcpp.c >testcpp.out 2>&1
4915 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4916 echo "OK, that will do." >&4
4918 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4933 echo "Perhaps can we force $cc -E using a wrapper..."
4934 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4935 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4941 echo "Nope, we'll have to live without it..."
4955 "$wrapper"|'cppstdin') ;;
4956 *) $rm -f $wrapper;;
4958 $rm -f testcpp.c testcpp.out
4960 : Adjust cppfilter for path component separator
4962 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4963 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4967 : Use gcc to determine libpth and incpth
4968 # If using gcc or clang, we can get better values for libpth, incpth
4969 # and usrinc directly from the compiler.
4970 # Note that ccname for clang is also gcc.
4973 $echo 'extern int foo;' > try.c
4974 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4976 if $test $# -gt 0; then
4978 incpth="`$echo $incpth|$sed 's/^ //'`"
4980 j="`$echo $i|$sed 's,/include$,/lib,'`"
4981 if $test -d $j; then
4985 libpth="`$echo $libpth|$sed 's/^ //'`"
4986 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4987 if $test -d $xxx; then
4990 *) libpth="$libpth $xxx";;
4997 '') for i in $incpth; do
4998 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5006 case "$usecrosscompile" in
5009 '') echo "Incpth not defined." >&4; croak=y ;;
5010 *) echo "Using incpth '$incpth'." >&4 ;;
5013 '') echo "Libpth not defined." >&4; croak=y ;;
5014 *) echo "Using libpth '$libpth'." >&4 ;;
5017 '') echo "Usrinc not defined." >&4; croak=y ;;
5018 *) echo "Using usrinc $usrinc." >&4 ;;
5022 if test "X$sysroot" = X; then
5023 echo "Cannot continue, aborting." >&4; exit 1
5025 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5034 : Default value for incpth is just usrinc
5036 '') incpth="$usrinc";;
5039 : Set private lib path
5042 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5047 '') dlist="$loclibpth $plibpth $glibpth";;
5048 *) dlist="$libpth";;
5051 : Now check and see which directories actually exist, avoiding duplicates
5054 if $test -d $xxx; then
5057 *) libpth="$libpth $xxx";;
5063 Some systems have incompatible or broken versions of libraries. Among
5064 the directories listed in the question below, please remove any you
5065 know not to be holding relevant libraries, and add any that are needed.
5066 Say "none" for none.
5070 if test "X$sysroot" != X; then
5072 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5085 rp="Directories to use for library searches?"
5092 : compute shared library extension
5095 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5105 On some systems, shared libraries may be available. Answer 'none' if
5106 you want to suppress searching of shared libraries for the remainder
5107 of this configuration.
5110 rp='What is the file extension used for shared libraries?'
5114 : Does target system insist that shared library basenames are unique
5117 Some dynamic loaders assume that the *basename* of shared library filenames
5118 are globally unique. We'll default this to undef as we assume your system
5119 is not this weird. Set to defined if you're on one of them.
5124 rp='Make shared library basenames unique?'
5127 y|Y) val="$define" ;;
5130 set d_libname_unique
5133 : Define several unixisms.
5134 : Hints files or command line option can be used to override them.
5135 : The convoluted testing is in case hints files set either the old
5138 '') case "$exe_ext" in
5140 *) _exe="$exe_ext" ;;
5145 '') case "$lib_ext" in
5152 '') case "$obj_ext" in
5159 '') case "$path_sep" in
5170 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5172 : Which makefile gets called first. This is used by make depend.
5173 case "$firstmakefile" in
5174 '') firstmakefile='makefile';;
5177 : Check is we will use socks
5179 $define|true|[yY]*) dflt='y';;
5184 Perl can be built to use the SOCKS proxy protocol library. To do so,
5185 Configure must be run with -Dusesocks. If you use SOCKS you also need
5186 to use the PerlIO abstraction layer, this will be implicitly selected.
5188 If this doesn't make any sense to you, just accept the default '$dflt'.
5190 rp='Build Perl for SOCKS?'
5193 y|Y) val="$define" ;;
5199 : Check for uselongdouble support
5201 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5204 case "$uselongdouble" in
5205 $define|true|[yY]*) dflt='y';;
5210 Perl can be built to take advantage of long doubles which
5211 (if available) may give more accuracy and range for floating point numbers.
5213 If this doesn't make any sense to you, just accept the default '$dflt'.
5215 rp='Try to use long doubles if available?'
5218 y|Y) val="$define" ;;
5224 case "$uselongdouble" in
5225 true|[yY]*) uselongdouble="$define" ;;
5228 : Look for a hint-file generated 'call-back-unit'. If the
5229 : user has specified that long doubles should be used,
5230 : we may need to set or change some other defaults.
5231 if $test -f uselongdouble.cbu; then
5232 echo "Your platform has some specific hints regarding long doubles, using them..."
5233 . ./uselongdouble.cbu
5235 case "$uselongdouble" in
5238 (Your platform does not have any specific hints for long doubles.)
5244 : Check if quadmath is requested
5245 case "$usequadmath" in
5246 "$define"|true|[yY]*) usequadmath="$define" ;;
5247 *) usequadmath="$undef" ;;
5250 : Fail if both uselongdouble and usequadmath are requested
5251 case "$usequadmath:$uselongdouble" in
5255 *** You requested the use of the quadmath library and use
5256 *** of long doubles.
5258 *** Please select one or the other.
5264 : Looking for optional libraries
5266 echo "Checking for optional libraries..." >&4
5271 case "$libswanted" in
5272 '') libswanted='c_s';;
5275 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5277 case "$usecbacktrace" in
5278 "$define") libswanted="$libswanted bfd" ;;
5280 case "$usequadmath" in
5281 "$define") libswanted="$libswanted quadmath" ;;
5287 for thisdir in $libpth $xlibpth; do
5288 test -d $thisdir && libspath="$libspath $thisdir"
5290 for thislib in $libswanted; do
5291 for thisdir in $libspath; do
5293 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5294 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5295 $test -f "$xxx" && eval $libscheck
5296 $test -f "$xxx" && libstyle=shared
5297 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5298 $test -f "$xxx" && eval $libscheck
5299 $test -f "$xxx" && libstyle=shared
5301 if test ! -f "$xxx"; then
5302 xxx=$thisdir/lib$thislib.$so
5303 $test -f "$xxx" && eval $libscheck
5304 $test -f "$xxx" && libstyle=shared
5306 if test ! -f "$xxx"; then
5307 xxx=$thisdir/lib$thislib$_a
5308 $test -f "$xxx" && eval $libscheck
5309 $test -f "$xxx" && libstyle=static
5311 if test ! -f "$xxx"; then
5312 xxx=$thisdir/$thislib$_a
5313 $test -f "$xxx" && eval $libscheck
5314 $test -f "$xxx" && libstyle=static
5316 if test ! -f "$xxx"; then
5317 xxx=$thisdir/lib${thislib}_s$_a
5318 $test -f "$xxx" && eval $libscheck
5319 $test -f "$xxx" && libstyle=static
5320 $test -f "$xxx" && thislib=${thislib}_s
5322 if test ! -f "$xxx"; then
5323 xxx=$thisdir/Slib$thislib$_a
5324 $test -f "$xxx" && eval $libscheck
5325 $test -f "$xxx" && libstyle=static
5327 if $test -f "$xxx"; then
5329 shared) echo "Found -l$thislib (shared)." ;;
5330 static) echo "Found -l$thislib." ;;
5331 *) echo "Found -l$thislib ($libstyle)." ;;
5335 *) dflt="$dflt -l$thislib"
5336 libsfound="$libsfound $xxx"
5338 libsfiles="$libsfiles $yyy"
5339 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5340 case " $libsdirs " in
5342 *) libsdirs="$libsdirs $yyy" ;;
5349 if $test ! -f "$xxx"; then
5350 echo "No -l$thislib."
5361 ' '|'') dflt='none';;
5366 In order to compile $package on your machine, a number of libraries
5367 are usually needed. Include any other special libraries here as well.
5368 Say "none" for none. The default list is almost always right.
5372 rp="What libraries to use?"
5379 : determine optimization, if desired, or use for debug flag also
5381 ' '|$undef) dflt='none';;
5383 *) dflt="$optimize";;
5387 By default, $package compiles with the -O flag to use the optimizer.
5388 Alternately, you might want to use the symbolic debugger, which uses
5389 the -g flag (on traditional Unix systems). Either flag can be
5390 specified here. To use neither flag, specify the word "none".
5393 rp="What optimizer/debugger flag should be used?"
5397 'none') optimize=" ";;
5400 : Check what DEBUGGING is required from the command line
5401 : -DEBUGGING or -DDEBUGGING or
5402 : -DEBUGGING=both = -g + -DDEBUGGING
5403 : -DEBUGGING=-g or -Doptimize=-g = -g
5404 : -DEBUGGING=none or -UDEBUGGING =
5405 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5408 *) DEBUGGING=$EBUGGING ;;
5411 case "$DEBUGGING" in
5415 *) optimize="$optimize -g" ;;
5419 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5427 case "$DEBUGGING" in
5428 both|$define) dflt='-DDEBUGGING'
5431 : argument order is deliberate, as the flag will start with - which set could
5432 : think is an option
5433 checkccflag='check=$1; flag=$2; callback=$3;
5435 echo "Checking if your compiler accepts $flag" 2>&1;
5436 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5437 echo "int main(void) { return 0; }" > gcctest.c;
5438 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5439 echo "Yes, it does." 2>&1;
5440 if $test -s gcctest.out ; then
5441 echo "But your platform does not like it:";
5446 echo "Leaving current flags $ccflags alone." 2>&1
5448 *) dflt="$dflt $flag";
5454 echo "Nope, it does not, but that is ok." 2>&1;
5458 : We will not override a previous value, but we might want to
5459 : augment a hint file
5461 default|recommended)
5462 case "$gccversion" in
5463 1*) dflt="$dflt -fpcc-struct-return" ;;
5465 case "$optimize:$DEBUGGING" in
5466 *-g*:old) dflt="$dflt -DDEBUGGING";;
5468 case "$gccversion" in
5469 2*) if $test -d /etc/conf/kconfig.d &&
5470 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5472 # Interactive Systems (ISC) POSIX mode.
5477 case "$gccversion" in
5480 ?*) set strict-aliasing -fno-strict-aliasing
5484 # For gcc, adding -pipe speeds up compilations for some, but apparently
5485 # some assemblers can't read from stdin. (It also slows down compilations
5486 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5487 case "$gccversion" in
5493 # on x86_64 (at least) we require an extra library (libssp) in the
5494 # link command line. This library is not named, so I infer that it is
5495 # an implementation detail that may change. Hence the safest approach
5496 # is to add the flag to the flags passed to the compiler at link time,
5497 # as that way the compiler can do the right implementation dependant
5500 amigaos) ;; # -fstack-protector builds but doesn't work
5501 *) case "$gccversion" in
5502 ?*) set stack-protector-strong -fstack-protector-strong
5505 *-fstack-protector-strong*) ;; # It got added.
5506 *) # Try the plain/older -fstack-protector.
5507 set stack-protector -fstack-protector
5518 case "$mips_type" in
5519 *BSD*|'') inclwanted="$locincpth $usrinc";;
5520 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5522 for thisincl in $inclwanted; do
5523 if $test -d $thisincl; then
5524 if $test x$thisincl != x$usrinc; then
5526 *" -I$thisincl "*);;
5527 *) dflt="$dflt -I$thisincl ";;
5533 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5535 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5543 *) dflt="$dflt -D$2";;
5547 set signal.h LANGUAGE_C; eval $inctest
5551 ccflags="$ccflags -DSOCKS"
5556 default|recommended) dflt="$ccflags $dflt" ;;
5557 *) dflt="$ccflags";;
5566 Your C compiler may want other flags. For this question you should include
5567 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5568 but you should NOT include libraries or ld flags like -lwhatever. If you
5569 want $package to honor its debug switch, you should include -DDEBUGGING here.
5570 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5572 To use no flags, specify the word "none".
5578 rp="Any additional cc flags?"
5585 : the following weeds options from ccflags that are of no interest to cpp
5587 '') cppflags="$ccflags" ;;
5588 *) set X $ccflags; shift
5589 case " $cppflags " in
5590 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5591 *) cppflags="$cppflags $ccflags" ;;
5595 case "$gccversion" in
5596 1*) cppflags="$cppflags -D__GNUC__"
5598 case "$mips_type" in
5600 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5606 echo "Let me guess what the preprocessor flags are..." >&4
5620 *) ftry="$previous $flag";;
5622 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5623 >cpp1.out 2>/dev/null && \
5624 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5625 >cpp2.out 2>/dev/null && \
5626 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5627 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5629 cppflags="$cppflags $ftry"
5639 *-*) echo "They appear to be: $cppflags";;
5641 $rm -f cpp.c cpp?.out
5645 : flags used in final linking phase
5647 '') if ./venix; then
5653 *-posix*) dflt="$dflt -posix" ;;
5656 *) dflt="$ldflags";;
5658 # See note above about -fstack-protector
5660 *-fstack-protector-strong*)
5662 *-fstack-protector-strong*) ;; # Don't add it again
5663 *) dflt="$dflt -fstack-protector-strong" ;;
5666 *-fstack-protector*)
5668 *-fstack-protector*) ;; # Don't add it again
5669 *) dflt="$dflt -fstack-protector" ;;
5674 : Try to guess additional flags to pick up local libraries.
5675 for thislibdir in $libpth; do
5676 case " $loclibpth " in
5679 *"-L$thislibdir "*) ;;
5680 *) dflt="$dflt -L$thislibdir" ;;
5692 Your C linker may need flags. For this question you should
5693 include -L/whatever and any other flags used by the C linker, but you
5694 should NOT include libraries like -lwhatever.
5696 Make sure you include the appropriate -L/path flags if your C linker
5697 does not normally search all of the directories you specified above,
5700 To use no flags, specify the word "none".
5704 rp="Any additional ld flags (NOT including libraries)?"
5710 rmlist="$rmlist pdp11"
5714 echo "Checking your choice of C compiler and flags for coherency..." >&4
5715 $cat > try.c <<'EOF'
5717 int main() { printf("Ok\n"); return(0); }
5719 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5721 $cat >try.msg <<'EOM'
5722 I've tried to compile and run the following simple program:
5725 $cat try.c >> try.msg
5727 $cat >> try.msg <<EOM
5734 and I got the following output:
5738 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5739 if $sh -c "$run ./try " >>try.msg 2>&1; then
5743 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5746 echo "The program compiled OK, but exited with status $?." >>try.msg
5747 rp="You have a problem. Shall I abort Configure"
5751 echo "I can't compile the test program." >>try.msg
5752 rp="You have a BIG problem. Shall I abort Configure"
5758 case "$knowitall" in
5760 echo "(The supplied flags or libraries might be incorrect.)"
5768 *) echo "Ok. Stopping Configure." >&4
5773 n) echo "OK, that should do.";;
5775 $rm_try gcctest gcctest.out
5777 : define a shorthand compile call
5781 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5782 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5786 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5787 : define a shorthand compile call for compilations that should be ok.
5791 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5793 : stub, used only to satisfy other units
5796 : check for lengths of integral types
5800 echo "Checking to see how big your integers are..." >&4
5809 printf("intsize=%d;\n", (int)sizeof(int));
5810 printf("longsize=%d;\n", (int)sizeof(long));
5811 printf("shortsize=%d;\n", (int)sizeof(short));
5816 if eval $compile_ok && $run ./try > /dev/null; then
5818 echo "Your integers are $intsize bytes long."
5819 echo "Your long integers are $longsize bytes long."
5820 echo "Your short integers are $shortsize bytes long."
5824 Help! I can't compile and run the intsize test program: please enlighten me!
5825 (This is probably a misconfiguration in your system or libraries, and
5826 you really ought to fix it. Still, I'll try anyway.)
5830 rp="What is the size of an integer (in bytes)?"
5834 rp="What is the size of a long integer (in bytes)?"
5838 rp="What is the size of a short integer (in bytes)?"
5846 : check for long long
5848 echo "Checking to see if you have long long..." >&4
5849 echo 'int main() { long long x = 7; return 0; }' > try.c
5851 if eval $compile; then
5853 echo "You have long long."
5856 echo "You do not have long long."
5862 : check for length of long long
5863 case "${d_longlong}${longlongsize}" in
5866 echo "Checking to see how big your long longs are..." >&4
5867 $cat >try.c <<'EOCP'
5871 printf("%d\n", (int)sizeof(long long));
5876 if eval $compile_ok; then
5877 longlongsize=`$run ./try`
5878 echo "Your long longs are $longlongsize bytes long."
5882 echo "(I can't seem to compile the test program. Guessing...)"
5883 rp="What is the size of a long long (in bytes)?"
5887 if $test "X$longsize" = "X$longlongsize"; then
5888 echo "(That isn't any different from an ordinary long.)"
5894 : determine filename position in cpp output
5896 echo "Computing filename position in cpp output for #include directives..." >&4
5898 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5903 vos) testaccess=-e ;;
5906 echo '#include <stdio.h>' > foo.c
5909 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5910 $grep '^[ ]*#.*stdio\.h' | \
5911 while read cline; do
5914 while $test \$# -gt 0; do
5915 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5920 pos=\`expr \$pos + 1\`
5934 *) pos="${fieldn}th";;
5936 echo "Your cpp writes the filename in the $pos field of the line."
5938 : locate header file
5943 for usrincdir in $incpth
5945 if test -f \$usrincdir/\$wanted; then
5946 echo "\$usrincdir/\$wanted"
5950 awkprg='{ print \$$fieldn }'
5951 echo "#include <\$wanted>" > foo\$\$.c
5952 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5953 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5954 while read cline; do
5955 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5957 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5958 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5963 # status = 0: grep returned 0 lines, case statement not executed
5964 # status = 1: headerfile found
5965 # status = 2: while loop executed, no headerfile found
5969 if test \$status -eq 1; then
5976 : define an alternate in-header-list? function
5977 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5978 cont=true; xxf="echo \"<\$1> found.\" >&4";
5979 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5980 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5982 case $# in 4) instead=instead;; *) instead="at last";; esac;
5983 while $test "$cont"; do
5985 var=$2; eval "was=\$$2";
5986 if $test "$xxx" && $test -r "$xxx";
5988 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5991 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5992 set $yyy; shift; shift; yyy=$@;
5993 case $# in 0) cont="";;
5994 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5995 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5996 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5997 xxnf="echo \"there is no <\$1>, ...\" >&4";;
6001 do set $yyy; var=$2; eval "was=\$$2";
6002 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
6003 set $yyy; shift; shift; yyy=$@;
6006 : see if inttypes.h is available
6007 : we want a real compile instead of Inhdr because some systems
6008 : have an inttypes.h which includes non-existent headers
6011 #include <inttypes.h>
6013 static int32_t foo32 = 0x12345678;
6017 if eval $compile; then
6018 echo "<inttypes.h> found." >&4
6021 echo "<inttypes.h> NOT found." >&4
6030 echo "Checking to see if you have int64_t..." >&4
6032 #include <sys/types.h>
6033 #$i_inttypes I_INTTYPES
6035 #include <inttypes.h>
6037 int main() { int64_t x = 7; }
6040 if eval $compile; then
6042 echo "You have int64_t."
6045 echo "You do not have int64_t."
6051 : Check if 64bit ints have a quad type
6053 echo "Checking which 64-bit integer type we could use..." >&4
6059 val='"unsigned int"'
6064 *) case "$longsize" in
6068 val='"unsigned long"'
6073 *) case "$d_longlong:$longlongsize" in
6078 val='"unsigned long long"'
6083 *) case "$d_int64_t" in
6102 '') echo "Alas, no 64-bit integer types in sight." >&4
6105 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6110 : Do we want 64bit support
6111 case "$uselonglong" in
6112 "$define"|true|[yY]*)
6115 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6117 use64bitint="$define"
6120 case "$use64bits" in
6121 "$define"|true|[yY]*)
6124 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6126 use64bitint="$define"
6129 case "$use64bitints" in
6130 "$define"|true|[yY]*)
6133 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6135 use64bitint="$define"
6138 case "$use64bitsint" in
6139 "$define"|true|[yY]*)
6142 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6144 use64bitint="$define"
6147 case "$uselonglongs" in
6148 "$define"|true|[yY]*)
6151 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6153 use64bitint="$define"
6156 case "$use64bitsall" in
6157 "$define"|true|[yY]*)
6160 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6162 use64bitall="$define"
6167 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6169 case "$use64bitall" in
6170 "$define"|true|[yY]*) use64bitint="$define" ;;
6176 You have natively 64-bit long integers.
6180 *) case "$use64bitint" in
6181 "$define"|true|[yY]*) dflt='y';;
6190 Perl can be built to take advantage of 64-bit integer types
6191 on some systems. To do so, Configure can be run with -Duse64bitint.
6192 Choosing this option will most probably introduce binary incompatibilities.
6194 If this doesn't make any sense to you, just accept the default '$dflt'.
6195 (The default has been chosen based on your configuration.)
6197 rp='Try to use 64-bit integers, if available?'
6200 [yY]*) val="$define" ;;
6208 case "$use64bitall" in
6209 "$define"|true|[yY]*) dflt='y' ;;
6210 *) case "$longsize" in
6218 You may also choose to try maximal 64-bitness. It means using as much
6219 64-bitness as possible on the platform. This in turn means even more
6220 binary incompatibilities. On the other hand, your platform may not
6221 have any more 64-bitness available than what you already have chosen.
6223 If this doesn't make any sense to you, just accept the default '$dflt'.
6224 (The default has been chosen based on your configuration.)
6226 rp='Try to use maximal 64-bit support, if available?'
6229 [yY]*) val="$define" ;;
6234 case "$use64bitall" in
6236 case "$use64bitint" in
6240 Since you have chosen a maximally 64-bit build, I'm also turning on
6241 the use of 64-bit integers.
6243 use64bitint="$define" ;;
6248 : Look for a hint-file generated 'call-back-unit'. If the
6249 : user has specified that a 64-bit perl is to be built,
6250 : we may need to set or change some other defaults.
6251 if $test -f use64bitint.cbu; then
6252 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6255 case "$use64bitint" in
6256 "$define"|true|[yY]*)
6257 : This test was common to all the OpenBSD forks, and seems harmless for
6260 echo "Checking if your C library has broken 64-bit functions..." >&4
6263 typedef $uquadtype myULL;
6270 {4294967303.15, 4294967303ULL},
6271 {4294967294.2, 4294967294ULL},
6272 {4294967295.7, 4294967295ULL},
6275 for (p = test; p->u; p++) {
6276 myULL x = (myULL)p->d;
6287 if eval $compile_ok; then
6288 libcquad=`$run ./try`
6289 echo "Your C library's 64-bit functions are $libcquad."
6291 echo "(I can't seem to compile the test program.)"
6292 echo "Assuming that your C library's 64-bit functions are ok."
6301 *** You have a C library with broken 64-bit functions.
6302 *** 64-bit support does not work reliably in this configuration.
6303 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6304 *** Cannot continue, aborting.
6311 4) case "$archname64" in
6312 '') archname64=64int ;;
6319 : Look for a hint-file generated 'call-back-unit'. If the
6320 : user has specified that a maximally 64-bit perl is to be built,
6321 : we may need to set or change some other defaults.
6322 if $test -f use64bitall.cbu; then
6323 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6326 case "$use64bitall" in
6327 "$define"|true|[yY]*)
6329 4) case "$archname64" in
6330 ''|64int) archname64=64all ;;
6337 case "$d_quad:$use64bitint" in
6341 *** You have chosen to use 64-bit integers,
6342 *** but none can be found.
6343 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6344 *** Cannot continue, aborting.
6351 : Check if we are using the GNU C library
6353 echo "Checking for GNU C Library..." >&4
6355 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6356 alone are insufficient to distinguish different versions, such as
6357 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6358 libc version 2.1.0. A. Dougherty, June 3, 2002.
6364 # ifdef __GLIBC_MINOR__
6365 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6366 # include <gnu/libc-version.h>
6367 printf("%s\n", gnu_get_libc_version());
6369 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6372 printf("%d\n", __GLIBC__);
6381 if eval $compile_ok && $run ./try > glibc.ver; then
6383 gnulibc_version=`$cat glibc.ver`
6384 echo "You are using the GNU C Library version $gnulibc_version"
6388 echo "You are not using the GNU C Library"
6394 : see if nm is to be used to determine whether a symbol is defined or not
6398 case "$d_gnulibc" in
6401 echo "nm probably won't work on the GNU C Library." >&4
6407 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6409 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6410 echo "'nm' won't be sufficient on this system." >&4
6416 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6417 if $test $dflt -gt 20; then
6427 true|$define) dflt=y;;
6434 I can use $nm to extract the symbols from your C libraries. This
6435 is a time consuming task which may generate huge output on the disk (up
6436 to 3 megabytes) but that should make the symbols extraction faster. The
6437 alternative is to skip the 'nm' extraction part and to compile a small
6438 test program instead to determine whether each symbol is present. If
6439 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6440 this may be the best solution.
6442 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6445 rp="Shall I use $nm to extract C symbols from the libraries?"
6448 [Nn]*) usenm=false;;
6457 : nm options which may be necessary
6459 '') if $test -f /mach_boot; then
6461 elif $test -d /usr/ccs/lib; then
6462 nm_opt='-p' # Solaris (and SunOS?)
6463 elif $test -f /dgux; then
6465 elif $test -f /lib64/rld; then
6466 nm_opt='-p' # 64-bit Irix
6472 : nm options which may be necessary for shared libraries but illegal
6473 : for archive libraries. Thank you, Linux.
6474 case "$nm_so_opt" in
6475 '') case "$myuname" in
6477 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6478 nm_so_opt='--dynamic'
6485 : Figure out where the libc is located
6488 : get list of predefined functions in a handy place
6493 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6499 *) for thislib in $libs; do
6502 : Handle C library specially below.
6505 thislib=`echo $thislib | $sed -e 's/^-l//'`
6506 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6508 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6510 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6512 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6514 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6516 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6518 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6523 libnames="$libnames $try"
6525 *) libnames="$libnames $thislib" ;;
6534 for xxx in $libpth; do
6535 $test -r $1 || set $xxx/libc.$so
6536 : The messy sed command sorts on library version numbers.
6538 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6539 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6541 s/[0-9][0-9]*/0000&/g
6542 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6545 $sort | $sed -e 's/^.* //'`
6548 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6549 $test -r $1 || set $sysroot/lib/libsys_s$_a
6555 if $test -r "$1"; then
6556 echo "Your (shared) C library seems to be in $1."
6558 elif $test -r /lib/libc && $test -r /lib/clib; then
6559 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6561 libc='/lib/clib /lib/libc'
6562 if $test -r /lib/syslib; then
6563 echo "(Your math library is in /lib/syslib.)"
6564 libc="$libc /lib/syslib"
6566 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6567 echo "Your C library seems to be in $libc, as you said before."
6568 elif $test -r $incpath/usr/lib/libc$_a; then
6569 libc=$incpath/usr/lib/libc$_a;
6570 echo "Your C library seems to be in $libc. That's fine."
6571 elif $test -r /lib/libc$_a; then
6573 echo "Your C library seems to be in $libc. You're normal."
6575 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6577 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6578 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6579 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6581 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6583 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6586 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6588 if $test -r "$tans"; then
6589 echo "Your C library seems to be in $tans, of all places."
6595 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6599 If the guess above is wrong (which it might be if you're using a strange
6600 compiler, or your machine supports multiple models), you can override it here.
6605 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6607 I can't seem to find your C library. I've looked in the following places:
6610 $sed 's/^/ /' libpath
6613 None of these seems to contain your C library. I need to get its name...
6618 rp='Where is your C library?'
6623 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6624 set X `cat libnames`
6627 case $# in 1) xxx=file; esac
6628 echo "Extracting names from the following $xxx for later perusal:" >&4
6630 $sed 's/^/ /' libnames >&4
6632 $echo $n "This may take a while...$c" >&4
6636 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6637 *) $nm $nm_opt $file 2>/dev/null;;
6642 $grep fprintf libc.tmp > libc.ptf
6643 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6644 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6646 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6650 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6654 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6658 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6662 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6666 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6670 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6671 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6675 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6679 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6683 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6687 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6691 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6693 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6695 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6697 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6699 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6701 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6704 $nm -p $* 2>/dev/null >libc.tmp
6705 $grep fprintf libc.tmp > libc.ptf
6706 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6707 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6713 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6715 if $ar t $libc > libc.tmp && \
6716 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6718 for thisname in $libnames $libc; do
6719 $ar t $thisname >>libc.tmp
6721 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6723 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6724 for thisname in $libnames $libc; do
6725 $ar tv $thisname >>libc.tmp
6726 emximp -o tmp.imp $thisname \
6728 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6729 < tmp.imp >>libc.tmp
6732 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6735 echo "$ar didn't seem to work right." >&4
6736 echo "Maybe this is a Cray...trying bld instead..." >&4
6738 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6741 for thisname in $libnames; do
6743 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6744 $ar t $thisname >>libc.tmp
6748 echo "That didn't work either. Giving up." >&4
6758 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6759 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6761 *) if $test -f /lib/syscalls.exp; then
6763 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6764 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6765 /lib/syscalls.exp >>libc.list
6771 $rm -f libnames libpath
6773 : Check if we are using C++
6775 echo "Checking for C++..." >&4
6776 $cat >try.c <<'EOCP'
6788 if eval $compile_ok && $run ./try; then
6790 echo "You are using a C++ compiler."
6793 echo "You are not using a C++ compiler."
6799 : is a C symbol defined?
6802 -v) tf=libc.tmp; tdc="";;
6803 -a) tf=libc.tmp; tdc="[]";;
6804 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6806 case "$d_cplusplus" in
6807 $define) extern_C="extern \"C\"" ;;
6808 *) extern_C="extern" ;;
6811 case "$reuseval-$4" in
6813 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6818 if $test "$runnm" = true; then
6819 if $contains $tlook $tf >/dev/null 2>&1; then
6821 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6822 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;
6823 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6824 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6828 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;
6829 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6835 $define) tval=true;;
6842 : define an is-in-libc? function
6843 inlibc='echo " "; td=$define; tu=$undef;
6844 sym=$1; var=$2; eval "was=\$$2";
6846 case "$reuseval$was" in
6856 echo "$sym() found." >&4;
6857 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6859 echo "$sym() NOT found." >&4;
6860 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6864 $define) echo "$sym() found." >&4;;
6865 *) echo "$sym() NOT found." >&4;;
6869 : check for length of double
6871 case "$doublesize" in
6873 echo "Checking to see how big your double precision numbers are..." >&4
6882 printf("%d\n", (int)sizeof(double));
6887 if eval $compile_ok; then
6888 doublesize=`$run ./try`
6889 echo "Your double is $doublesize bytes long."
6892 echo "(I can't seem to compile the test program. Guessing...)"
6893 rp="What is the size of a double precision number (in bytes)?"
6901 : see if this is a float.h system
6905 : check for long doubles
6907 echo "Checking to see if you have long double..." >&4
6908 echo 'int main() { long double x = 7.0; }' > try.c
6910 if eval $compile; then
6912 echo "You have long double."
6915 echo "You do not have long double."
6921 : see if ldexpl exists
6925 : check for length of long double
6926 case "${d_longdbl}${longdblsize}" in
6929 echo "Checking to see how big your long doubles are..." >&4
6930 $cat >try.c <<'EOCP'
6934 printf("%d\n", sizeof(long double));
6939 if eval $compile; then
6940 longdblsize=`$run ./try`
6941 echo "Your long doubles are $longdblsize bytes long."
6945 echo "(I can't seem to compile the test program. Guessing...)" >&4
6946 rp="What is the size of a long double (in bytes)?"
6950 if $test "X$doublesize" = "X$longdblsize"; then
6951 echo "That isn't any different from an ordinary double."
6952 echo "I'll keep your setting anyway, but you may see some"
6953 echo "harmless compilation warnings."
6959 $echo "Checking the kind of long doubles you have..." >&4
6960 case "$d_longdbl" in
6965 #define LONGDBLSIZE $longdblsize
6966 #define DOUBLESIZE $doublesize
6974 static const long double d = -0.1L;
6976 unsigned const char* b = (unsigned const char*)(&d);
6977 #if DOUBLESIZE == LONGDBLSIZE
6978 printf("0\n"); /* if it floats like double */
6981 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6982 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6983 /* IEEE 754 128-bit little-endian */
6987 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6988 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6993 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6994 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6995 * cannot be trusted. */
6996 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6997 if (b[0] == 0xCD && b[9] == 0xBF) {
6998 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6999 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7000 * Also known as "extended precision". */
7004 if (b[0] == 0xBF && b[9] == 0xCD) {
7005 /* Is there ever big-endian 80-bit, really?
7007 * The Motorola 68881 had another "extended precision" format:
7008 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7009 * for total of 96 bits of bytes. The zero bits were unused.
7010 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7011 * If it ever becomes relevant, this format should be allocated
7012 * a new doublekind code since it's quite different from the Intel x87.
7018 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7019 /* software "double double", the 106 is 53+53.
7020 * but irix thinks it is 107. */
7021 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7022 /* double double 128-bit fully little-endian,
7023 * little-endian doubles in little-endian order,
7024 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7028 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7029 /* double double 128-bit fully big-endian,
7030 * big-endian doubles in big-endian order,
7031 * e.g. PPC/Power and MIPS:
7032 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7036 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7037 /* double double 128-bit mixed endian.
7038 * little-endian doubles in big-endian order,
7040 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7044 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7045 /* double double 128-bit mixed endian,
7046 * big-endian doubles in little-endian order,
7047 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7052 /* We are largely making this up because it may well be
7053 * that the VAX format H was never made available to C,
7054 * only to Fortran. */
7055 #if LONGDBLSIZE == 16 && defined(__vax__)
7056 if (b[0] == 0xFD && b[15] == 0x99) {
7057 /* VAX format H, PDP-11 mixed endian. */
7062 printf("-1\n"); /* unknown */
7067 if eval $compile; then
7068 longdblkind=`$run ./try`
7075 case "$longdblkind" in
7076 0) echo "Your long doubles are doubles." >&4 ;;
7077 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7078 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7079 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7080 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7081 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7082 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7083 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7084 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7085 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7086 *) echo "Cannot figure out your long double." >&4 ;;
7088 d_long_double_style_ieee=$undef
7089 d_long_double_style_ieee_std=$undef
7090 d_long_double_style_ieee_extended=$undef
7091 d_long_double_style_ieee_doubledouble=$undef
7092 d_long_double_style_vax=$undef
7093 case "$longdblkind" in
7094 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7096 case "$longdblkind" in
7097 1|2) d_long_double_style_ieee_std=$define ;;
7099 case "$longdblkind" in
7100 3|4) d_long_double_style_ieee_extended=$define ;;
7102 case "$longdblkind" in
7103 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7105 case "$longdblkind" in
7106 9) d_long_double_style_vax=$define ;;
7110 : determine the architecture name
7112 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7113 tarch=`arch`"-$osname"
7114 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7115 if uname -m > tmparch 2>&1 ; then
7116 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7117 -e 's/$/'"-$osname/" tmparch`
7125 case "$myarchname" in
7128 echo "(Your architecture name used to be $myarchname.)"
7132 case "$targetarch" in
7134 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7139 *) dflt="$archname";;
7141 rp='What is your architecture name'
7145 : optionally add API version to the architecture for versioned archlibs
7146 case "$useversionedarchname" in
7147 $define|true|[yY]*) dflt='y';;
7150 rp='Add the Perl API version to your archname?'
7153 y|Y) useversionedarchname="$define" ;;
7154 *) useversionedarchname="$undef" ;;
7156 case "$useversionedarchname" in
7159 *-$api_versionstring)
7160 echo "...and architecture name already has -$api_versionstring" >&4
7163 archname="$archname-$api_versionstring"
7164 echo "...setting architecture name to $archname." >&4
7170 case "$usethreads" in
7172 echo "Threads selected." >&4
7174 *-thread*) echo "...and architecture name already has -thread." >&4
7176 *) archname="$archname-thread"
7177 echo "...setting architecture name to $archname." >&4
7182 case "$usemultiplicity" in
7184 echo "Multiplicity selected." >&4
7186 *-multi*) echo "...and architecture name already has -multi." >&4
7188 *) archname="$archname-multi"
7189 echo "...setting architecture name to $archname." >&4
7194 case "$use64bitint$use64bitall" in
7196 case "$archname64" in
7198 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7201 case "$use64bitint" in
7202 "$define") echo "64 bit integers selected." >&4 ;;
7204 case "$use64bitall" in
7205 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7208 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7210 *) archname="$archname-$archname64"
7211 echo "...setting architecture name to $archname." >&4
7217 case "$uselongdouble" in
7219 echo "Long doubles selected." >&4
7220 case "$longdblsize" in
7222 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7226 *-ld*) echo "...and architecture name already has -ld." >&4
7228 *) archname="$archname-ld"
7229 echo "...setting architecture name to $archname." >&4
7236 case "$usequadmath" in
7238 echo "quadmath selected." >&4
7240 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7242 *) archname="$archname-quadmath"
7243 echo "...setting architecture name to $archname." >&4
7248 if $test -f archname.cbu; then
7249 echo "Your platform has some specific hints for architecture name, using them..."
7253 : set the prefixit variable, to compute a suitable default value
7254 prefixit='case "$3" in
7256 case "$oldprefix" in
7257 "") eval "$1=\"\$$2\"";;
7264 ""|" ") eval "$1=\"\$$2\"";;
7270 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7272 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7273 /*-$oldprefix/*|\~*-$oldprefix/*)
7274 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7275 *) eval "$1=\"\$$2\"";;
7279 : determine installation style
7280 : For now, try to deduce it from prefix unless it is already set.
7281 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7282 case "$installstyle" in
7283 '') case "$prefix" in
7284 *perl*) dflt='lib';;
7285 *) dflt='lib/perl5' ;;
7288 *) dflt="$installstyle" ;;
7290 : Probably not worth prompting for this since we prompt for all
7291 : the directories individually, and the prompt would be too long and
7295 : determine where public executables go
7300 rp='Pathname where the public executables will reside?'
7302 if $test "X$ansexp" != "X$binexp"; then
7306 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7307 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7308 : this via initialinstalllocation
7311 case "$userelocatableinc" in
7312 $define|true|[yY]*) dflt='y' ;;
7317 Would you like to build Perl so that the installation is relocatable, so that
7318 library paths in @INC are determined relative to the path of the perl binary?
7319 This is not advised for system Perl installs, or if you need to run setid
7320 scripts or scripts under taint mode.
7322 If this doesn't make any sense to you, just accept the default '$dflt'.
7324 rp='Use relocatable @INC?'
7327 y|Y) val="$define" ;;
7330 set userelocatableinc
7333 initialinstalllocation="$binexp"
7334 : Default prefix is now "up one level from where the binaries are"
7335 case "$userelocatableinc" in
7341 installprefixexp=".../.."
7345 : determine where private library files go
7346 : Usual default is /usr/local/lib/perl5/$version.
7347 : Also allow things like /opt/perl/lib/$version, since
7348 : /opt/perl/lib/perl5... would be redundant.
7349 : The default "style" setting is made in installstyle.U
7350 case "$installstyle" in
7351 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7352 *) set dflt privlib lib/$version ;;
7357 There are some auxiliary files for $package that need to be put into a
7358 private library directory that is accessible by everyone.
7363 rp='Pathname where the private library files will reside?'
7368 : set the prefixup variable, to restore leading tilda escape
7369 prefixup='case "$prefixexp" in
7371 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7374 : determine where public architecture dependent libraries go
7377 : privlib default is /usr/local/lib/$package/$version
7378 : archlib default is /usr/local/lib/$package/$version/$archname
7379 : privlib may have an optional trailing /share.
7380 tdflt=`echo $privlib | $sed 's,/share$,,'`
7381 tdflt=$tdflt/$archname
7390 $spackage contains architecture-dependent library files. If you are
7391 sharing libraries in a heterogeneous environment, you might store
7392 these files in a separate location. Otherwise, you can just include
7393 them with the rest of the public library files.
7398 rp='Where do you want to put the public architecture-dependent libraries?'
7402 if $test X"$archlib" = X"$privlib"; then
7408 : see if setuid scripts can be secure
7411 Some kernels have a bug that prevents setuid #! scripts from being
7412 secure. Some sites have disabled setuid #! scripts because of this.
7414 First let's decide if your kernel supports secure setuid #! scripts.
7415 (If setuid #! scripts would be secure but have been disabled anyway,
7416 don't say that they are secure if asked.)
7421 if $test -d /dev/fd; then
7422 echo "#!$ls" >reflect
7423 chmod +x,u+s reflect
7424 ./reflect >flect 2>&1
7425 if $contains "/dev/fd" flect >/dev/null; then
7426 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7430 If you are not sure if they are secure, I can check but I'll need a
7431 username and password different from the one you are using right now.
7432 If you don't have such a username or don't want me to test, simply
7436 rp='Other username to test security of setuid scripts with?'
7441 case "$d_suidsafe" in
7442 '') echo "I'll assume setuid scripts are *not* secure." >&4
7445 echo "Well, the $hint value is *not* secure." >&4
7447 *) echo "Well, the $hint value *is* secure." >&4
7452 $rm -f reflect flect
7453 echo "#!$ls" >reflect
7454 chmod +x,u+s reflect
7457 echo '"su" will (probably) prompt you for '"$ans's password."
7458 su $ans -c './reflect >flect'
7459 if $contains "/dev/fd" flect >/dev/null; then
7460 echo "Okay, it looks like setuid scripts are secure." >&4
7463 echo "I don't think setuid scripts are secure." >&4
7468 rp='Does your kernel have *secure* setuid scripts?'
7471 [yY]*) val="$define";;
7476 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7477 echo "(That's for file descriptors, not floppy disks.)"
7483 $rm -f reflect flect
7485 : now see if they want to do setuid emulation
7486 if $test $patchlevel -lt 11; then
7489 case "$d_suidsafe" in
7492 echo "No need to emulate SUID scripts since they are secure here." >&4
7496 Some systems have disabled setuid scripts, especially systems where
7497 setuid scripts cannot be secure. On systems where setuid scripts have
7498 been disabled, the setuid/setgid bits on scripts are currently
7499 useless. It is possible for $package to detect those bits and emulate
7500 setuid/setgid in a secure fashion. This emulation will only work if
7501 setuid scripts have been disabled in your kernel.
7505 "$define") dflt=y ;;
7508 rp="Do you want to do setuid/setgid emulation?"
7511 [yY]*) val="$define";;
7523 SUID emulation has been removed for 5.12
7524 Please re-run Configure without -Dd_dosuid
7533 : Find perl5.005 or later.
7534 echo "Looking for a previously installed perl5.005 or later... "
7536 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7537 : Check if this perl is recent and can load a simple module
7538 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7541 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7551 '') echo "None found. That's ok.";;
7552 *) echo "Using $perl5." ;;
7555 : Set the siteprefix variables
7558 After $package is installed, you may wish to install various
7559 add-on modules and utilities. Typically, these add-ons will
7560 be installed under $prefix with the rest
7561 of this package. However, you may wish to install such add-ons
7562 elsewhere under a different prefix.
7564 If you do not wish to put everything under a single prefix, that's
7565 ok. You will be prompted for the individual locations; this siteprefix
7566 is only used to suggest the defaults.
7568 The default should be fine for most people.
7572 rp='Installation prefix to use for add-on modules and utilities?'
7573 : XXX Here might be another good place for an installstyle setting.
7574 case "$siteprefix" in
7576 *) dflt=$siteprefix ;;
7579 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7581 case "$siteprefix" in
7585 *) oldsiteprefix="$prefix";;
7590 siteprefixexp="$ansexp"
7592 : determine where site specific libraries go.
7593 : Usual default is /usr/local/lib/perl5/site_perl/$version
7594 : The default "style" setting is made in installstyle.U
7595 : XXX No longer works with Prefixit stuff.
7596 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7598 '') case "$installstyle" in
7599 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7600 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7608 The installation process will create a directory for
7609 site-specific extensions and modules. Most users find it convenient
7610 to place all site-specific files in this directory rather than in the
7611 main distribution directory.
7615 rp='Pathname for the site-specific library files?'
7619 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7621 : Determine list of previous versions to include in @INC
7622 $cat > getverlist <<EOPL
7625 \$api_versionstring = "$api_versionstring";
7626 \$version = "$version";
7627 \$stem = "$sitelib_stem";
7628 \$archname = "$archname";
7630 $cat >> getverlist <<'EOPL'
7631 # The list found is store twice for each entry: the original name, and
7632 # the binary broken down version as pack "sss", so sorting is easy and
7633 # unambiguous. This will work for all versions that have a maximum of
7634 # three digit groups, separate by '.'s or '_'s. Names are extended with
7635 # ".0.0" to ensure at least three elements for the pack.
7636 # -- H.Merijn Brand (m)'06 23-10-2006
7638 # Can't have leading @ because metaconfig interprets it as a command!
7639 ;@inc_version_list=();
7640 # XXX Redo to do opendir/readdir?
7643 ;@candidates = map {
7644 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7645 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7651 ($pversion, $aversion, $vsn5005) = map {
7652 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7653 foreach $d (@candidates) {
7654 if ($d->[1] lt $pversion) {
7655 if ($d->[1] ge $aversion) {
7656 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7658 elsif ($d->[1] ge $vsn5005) {
7659 unshift(@inc_version_list, grep { -d } $d->[0]);
7663 # Skip newer version. I.e. don't look in
7664 # 5.7.0 if we're installing 5.6.1.
7668 if (@inc_version_list) {
7669 print join(' ', @inc_version_list);
7672 # Blank space to preserve value for next Configure run.
7677 case "$inc_version_list" in
7678 '') if test -x "$perl5$exe_ext"; then
7679 dflt=`$perl5 getverlist`
7684 $undef) dflt='none' ;;
7685 *) eval dflt=\"$inc_version_list\" ;;
7688 ''|' ') dflt=none ;;
7695 In order to ease the process of upgrading, this version of perl
7696 can be configured to use modules built and installed with earlier
7697 versions of perl that were installed under $prefix. Specify here
7698 the list of earlier versions that this version of perl should check.
7699 If Configure detected no earlier versions of perl installed under
7700 $prefix, then the list will be empty. Answer 'none' to tell perl
7701 to not search earlier versions.
7703 The default should almost always be sensible, so if you're not sure,
7704 just accept the default.
7707 rp='List of earlier versions to include in @INC?'
7710 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7711 *) inc_version_list="$ans" ;;
7713 case "$inc_version_list" in
7715 inc_version_list_init='0'
7716 d_inc_version_list="$undef"
7718 *) inc_version_list_init=`echo $inc_version_list |
7719 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7720 d_inc_version_list="$define"
7725 : see if malloc/malloc.h has to be included
7726 set malloc/malloc.h i_mallocmalloc
7729 : see if this is a malloc.h system
7730 : we want a real compile instead of Inhdr because some systems have a
7731 : malloc.h that just gives a compile error saying to use stdlib.h instead
7736 #$i_mallocmalloc I_MALLOCMALLOC
7737 #ifdef I_MALLOCMALLOC
7738 # include <malloc/malloc.h>
7741 int main () { return 0; }
7744 if eval $compile; then
7745 echo "<malloc.h> found." >&4
7748 echo "<malloc.h> NOT found." >&4
7755 : check for length of pointer
7759 echo "Checking to see how big your pointers are..." >&4
7768 printf("%d\n", (int)sizeof(void *));
7773 if eval $compile_ok; then
7774 ptrsize=`$run ./try`
7775 echo "Your pointers are $ptrsize bytes long."
7778 echo "(I can't seem to compile the test program. Guessing...)" >&4
7779 rp="What is the size of a pointer (in bytes)?"
7786 case "$use64bitall" in
7787 "$define"|true|[yY]*)
7791 *** You have chosen a maximally 64-bit build,
7792 *** but your pointers are only 4 bytes wide.
7793 *** Please rerun Configure without -Duse64bitall.
7798 *** Since you have quads, you could possibly try with -Duse64bitint.
7803 *** Cannot continue, aborting.
7814 : determine whether to use malloc wrapping
7816 case "$usemallocwrap" in
7817 [yY]*|true|$define) dflt='y' ;;
7818 [nN]*|false|$undef) dflt='n' ;;
7819 *) case "$usedevel" in
7820 [yY]*|true|$define) dflt='y' ;;
7825 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7827 usemallocwrap="$ans"
7830 usemallocwrap="$define" ;;
7832 usemallocwrap="$undef" ;;
7835 : determine which malloc to compile in
7837 case "$usemymalloc" in
7838 [yY]*|true|$define) dflt='y' ;;
7839 [nN]*|false|$undef) dflt='n' ;;
7840 *) case "$ptrsize" in
7844 if test "$useithreads" = "$define"; then dflt='n'; fi
7847 rp="Do you wish to attempt to use the malloc that comes with $package?"
7853 mallocsrc='malloc.c'
7854 mallocobj="malloc$_o"
7855 d_mymalloc="$define"
7858 : Remove malloc from list of libraries to use
7859 echo "Removing unneeded -lmalloc from library list" >&4
7860 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7863 echo "libs = $libs" >&4
7875 : compute the return types of malloc and free
7877 $cat >malloc.c <<END
7881 #include <sys/types.h>
7895 case "$malloctype" in
7897 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7904 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7908 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7915 echo "Your system uses $freetype free(), it would seem." >&4
7917 : determine where site specific architecture-dependent libraries go.
7918 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7919 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7920 : sitelib may have an optional trailing /share.
7922 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7923 dflt="$dflt/$archname"
7928 set sitearch sitearch none
7932 The installation process will also create a directory for
7933 architecture-dependent site-specific extensions and modules.
7937 rp='Pathname for the site-specific architecture-dependent library files?'
7941 if $test X"$sitearch" = X"$sitelib"; then
7944 d_sitearch="$define"
7947 : Set the vendorprefix variables
7950 The installation process will also create a directory for
7951 vendor-supplied add-ons. Vendors who supply perl with their system
7952 may find it convenient to place all vendor-supplied files in this
7953 directory rather than in the main distribution directory. This will
7954 ease upgrades between binary-compatible maintenance versions of perl.
7956 Of course you may also use these directories in whatever way you see
7957 fit. For example, you might use them to access modules shared over a
7958 company-wide network.
7960 The default answer should be fine for most people.
7961 This causes further questions about vendor add-ons to be skipped
7962 and no vendor-specific directories will be configured for perl.
7965 rp='Do you want to configure vendor-specific add-on directories?'
7966 case "$usevendorprefix" in
7967 define|true|[yY]*) dflt=y ;;
7968 *) : User may have set vendorprefix directly on Configure command line.
7969 case "$vendorprefix" in
7978 rp='Installation prefix to use for vendor-supplied add-ons?'
7979 case "$vendorprefix" in
7980 '') dflt="$prefix" ;;
7981 *) dflt=$vendorprefix ;;
7984 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7986 case "$vendorprefix" in
7990 *) oldvendorprefix="$prefix";;
7994 usevendorprefix="$define"
7996 vendorprefixexp="$ansexp"
7998 *) usevendorprefix="$undef"
8004 : Set the vendorlib variables
8005 case "$vendorprefix" in
8006 '') d_vendorlib="$undef"
8010 *) d_vendorlib="$define"
8011 : determine where vendor-supplied modules go.
8012 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8013 case "$vendorlib" in
8015 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8016 case "$installstyle" in
8017 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8018 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8021 *) dflt="$vendorlib"
8025 rp='Pathname for the vendor-supplied library files?'
8028 vendorlibexp="$ansexp"
8031 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8035 : Set the vendorarch variables
8036 case "$vendorprefix" in
8037 '') d_vendorarch="$undef"
8041 *) d_vendorarch="$define"
8042 : determine where vendor-supplied architecture-dependent libraries go.
8043 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8044 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8045 : vendorlib may have an optional trailing /share.
8046 case "$vendorarch" in
8047 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8048 dflt="$dflt/$archname"
8050 *) dflt="$vendorarch" ;;
8053 rp='Pathname for vendor-supplied architecture-dependent files?'
8056 vendorarchexp="$ansexp"
8059 prefixvar=vendorarch
8061 if $test X"$vendorarch" = X"$vendorlib"; then
8062 d_vendorarch="$undef"
8064 d_vendorarch="$define"
8067 : Final catch-all directories to search
8070 Lastly, you can have perl look in other directories for extensions and
8071 modules in addition to those already specified.
8072 These directories will be searched after
8076 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8077 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8079 case "$otherlibdirs" in
8080 ''|' ') dflt='none' ;;
8081 *) dflt="$otherlibdirs" ;;
8084 Enter a colon-separated set of extra paths to include in perl's @INC
8085 search path, or enter 'none' for no extra paths.
8089 rp='Colon-separated list of additional directories for perl to search?'
8092 ' '|''|none) otherlibdirs=' ' ;;
8093 *) otherlibdirs="$ans" ;;
8095 case "$otherlibdirs" in
8099 set d_perl_otherlibdirs
8103 dflt_dtrace='/usr/sbin/dtrace'
8104 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8108 Perl can be built to support DTrace on platforms that support it.
8109 DTrace is a diagnosis and performance analysis tool from Sun.
8111 If this doesn't make any sense to you, just accept the default.
8115 case "$usedtrace" in
8121 dflt_dtrace=$usedtrace
8128 rp='Support DTrace if available?'
8131 y|Y) val="$define" ;;
8137 test "X$usedtrace" != "X$define" && break
8140 rp='Where is the dtrace executable?'
8149 if $dtrace -h -s ../perldtrace.d \
8150 -o perldtrace.tmp >/dev/null 2>&1 \
8151 && rm -f perldtrace.tmp
8154 echo "Good: your $dtrace knows about the -h flag."
8158 *** $me: Fatal Error: $dtrace doesn't support -h flag
8160 *** Your installed dtrace doesn't support the -h switch to compile a D
8161 *** program into a C header. Can't continue.
8173 *** $me: Fatal Error: $dtrace not found.
8180 echo "*** $dtrace was not found."
8186 : See if we want extra modules installed
8193 Perl can be built with extra modules or bundles of modules which
8194 will be fetched from the CPAN and installed alongside Perl.
8196 Notice that you will need access to the CPAN; either via the Internet,
8197 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8198 be asked later to configure the CPAN.pm module which will in turn do
8199 the installation of the rest of the extra modules or bundles.)
8201 Notice also that if the modules require any external software such as
8202 libraries and headers (the libz library and the zlib.h header for the
8203 Compress::Zlib module, for example) you MUST have any such software
8204 already installed, this configuration process will NOT install such
8207 If this doesn't make any sense to you, just accept the default '$dflt'.
8209 rp='Install any extra modules (y or n)?'
8215 Please list any extra modules or bundles to be installed from CPAN,
8216 with spaces between the names. The names can be in any format the
8217 'install' command of CPAN.pm will understand. (Answer 'none',
8218 without the quotes, to install no extra modules or bundles.)
8228 $rm -f ../extras.lst
8230 *) echo "(Saving the list of extras for later...)"
8231 echo "$extras" > ../extras.lst
8239 : determine where html pages for programs go
8240 set html1dir html1dir none
8244 If you wish to install html files for programs in $spackage, indicate
8245 the appropriate directory here. To skip installing html files,
8249 ''|none|$undef|' ') dflt=none ;;
8250 *) dflt=$html1dir ;;
8253 rp="Directory for the main $spackage html pages?"
8257 : Use ' ' for none so value is preserved next time through Configure
8258 $test X"$html1dir" = "X" && html1dir=' '
8260 : determine where html pages for libraries and modules go
8261 set html3dir html3dir none
8265 If you wish to install html files for modules associated with $spackage,
8266 indicate the appropriate directory here. To skip installing html files,
8269 : There is no obvious default. If they have specified html1dir, then
8270 : try to key off that, possibly changing .../html1 into .../html3.
8272 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8273 *) dflt=$html3dir ;;
8276 rp="Directory for the $spackage module html pages?"
8280 : Use ' ' for none so value is preserved next time through Configure
8281 $test X"$html3dir" = "X" && html3dir=' '
8283 : determine whether to install perl also as /usr/bin/perl
8286 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8288 Many scripts expect perl to be installed as /usr/bin/perl.
8290 If you want to, I can install the perl you are about to compile
8291 as /usr/bin/perl (in addition to $bin/perl).
8293 if test -f /usr/bin/perl; then
8296 However, please note that because you already have a /usr/bin/perl,
8297 overwriting that with a new Perl would very probably cause problems.
8298 Therefore I'm assuming you don't want to do that (unless you insist).
8301 case "$installusrbinperl" in
8302 "$define"|[yY]*) dflt='y';;
8308 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8311 case "$installusrbinperl" in
8312 "$undef"|[nN]*) dflt='n';;
8316 rp="Do you want to install perl as /usr/bin/perl?"
8319 [yY]*) val="$define";;
8325 set installusrbinperl
8328 : see if dlopen exists
8330 xxx_ccflags="$ccflags"
8332 : with g++ one needs -shared to get is-in-libc to work for dlopen
8333 case "$gccversion" in
8336 *) case "$d_cplusplus" in
8337 "$define") ccflags="$ccflags -shared" ;;
8344 ccflags="$xxx_ccflags"
8346 : see if this is a unistd.h system
8347 set unistd.h i_unistd
8350 : determine which dynamic loading, if any, to compile in
8352 dldir="ext/DynaLoader"
8365 $define) dflt='y' ;;
8367 : Does a dl_xxx.xs file exist for this operating system
8368 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8371 rp="Do you wish to use dynamic loading?"
8378 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8379 dflt="$dldir/dl_${osname}.xs"
8380 elif $test "$d_dlopen" = "$define" ; then
8381 dflt="$dldir/dl_dlopen.xs"
8386 *) dflt="$dldir/$dlsrc"
8389 echo "The following dynamic loading files are available:"
8390 : Can not go over to $dldir because getfile has path hard-coded in.
8391 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8392 rp="Source file to use for dynamic loading"
8398 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8402 Some systems may require passing special flags to $cc -c to
8403 compile modules that will be used to create a shared library.
8404 To use no flags, say "none".
8407 case "$cccdlflags" in
8408 '') case "$gccversion" in
8409 '') case "$osname" in
8411 irix*) dflt='-KPIC' ;;
8412 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8413 sunos) dflt='-pic' ;;
8417 *) case "$osname" in
8418 darwin) dflt='none' ;;
8419 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8424 *) dflt="$cccdlflags" ;;
8431 # If -Dsysroot was specified, now's the time to add it
8433 if test "X$sysroot" != X; then
8434 case "$gccversion" in
8439 dflt="$dflt --sysroot=$sysroot" ;;
8449 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8452 none) cccdlflags=' ' ;;
8453 *) cccdlflags="$ans" ;;
8458 Some systems use ld to create libraries that can be dynamically loaded,
8459 while other systems (such as those using ELF) use $cc.
8463 : Determine if this is ELF
8465 /* Test for whether ELF binaries are produced */
8477 int i = open("a.out",O_RDONLY);
8480 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8481 exit(0); /* succeed (yes, it is ELF) */
8485 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8491 '') if $test $bin_ELF = "$define"; then
8493 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8497 echo "I'll use ld to build dynamic libraries."
8505 rp="What command should be used to create dynamic libraries?"
8511 Some systems may require passing special flags to $ld to create a
8512 library that can be dynamically loaded. If your ld flags include
8513 -L/other/path options to locate libraries outside your loader's normal
8514 search path, you may need to specify those -L options here as well. To
8515 use no flags, say "none".
8518 case "$lddlflags" in
8519 '') case "$osname" in
8520 haiku) dflt='-shared' ;;
8522 case "$gccversion" in
8523 '') dflt="$dflt +vnocompatwarnings" ;;
8526 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8527 solaris) # See [perl #66604].
8528 # On Solaris 11, gcc -m64 on amd64
8529 # appears not to understand -G. gcc versions at
8530 # least as old as 3.4.3 support -shared, so just
8531 # use that with Solaris 11 and later, but keep
8532 # the old behavior for older Solaris versions.
8533 case "$gccversion" in
8535 *) case "$osvers" in
8536 2.?|2.10) dflt='-G' ;;
8537 *) dflt='-shared' ;;
8542 sunos) dflt='-assert nodefinitions' ;;
8543 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8547 *) dflt="$lddlflags" ;;
8550 : Only do this for gcc, since, for example, qcc has no concept
8552 if $test "X$sysroot" != X; then
8553 case "$gccversion" in
8555 *) dflt="$dflt --sysroot $sysroot" ;;
8559 : Try to guess additional flags to pick up local libraries.
8560 : Be careful not to append to a plain 'none'
8564 for thisflag in $ldflags; do
8569 *) dflt="$dflt $thisflag" ;;
8576 ''|' ') dflt='none' ;;
8580 *-fstack-protector-strong*)
8582 *-fstack-protector-strong*) ;; # Don't add it again
8583 *) dflt="$dflt -fstack-protector-strong" ;;
8586 *-fstack-protector*)
8588 *-fstack-protector*) ;; # Don't add it again
8589 *) dflt="$dflt -fstack-protector" ;;
8594 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8597 none) lddlflags=' ' ;;
8598 *) lddlflags="$ans" ;;
8603 Some systems may require passing special flags to $cc to indicate that
8604 the resulting executable will use dynamic linking. To use no flags,
8608 case "$ccdlflags" in
8609 '') case "$osname" in
8610 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8611 sunos) dflt='none' ;;
8615 *) dflt="$ccdlflags" ;;
8617 rp="Any special flags to pass to $cc to use dynamic linking?"
8620 none) ccdlflags=' ' ;;
8621 *) ccdlflags="$ans" ;;
8633 ld_can_script="$undef"
8634 case "$bin_ELF$usedl" in
8636 # Abuse try.h and a.out names for neat cleanup
8648 if $cc $cccdlflags $ccdlflags $ccflags \
8649 $ldflags $lddlflags -o a.out try.c \
8650 -Wl,--version-script=try.h >/dev/null 2>&1 \
8651 && $test -s a.out ; then
8652 echo "ld supports scripting" >&4
8653 ld_can_script="$define"
8655 echo "ld does not support scripting" >&4
8661 : Do we want a shared libperl?
8665 # No dynamic loading being used, so don't bother even to prompt.
8668 *) case "$useshrplib" in
8669 '') case "$osname" in
8670 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8672 also='Building a shared libperl is required for dynamic loading to work on your system.'
8686 The perl executable is normally obtained by linking perlmain.c with
8687 libperl${_a}, any static extensions (usually just DynaLoader), and
8688 any other libraries needed on this system (such as -lm, etc.). Since
8689 your system supports dynamic loading, it is probably possible to build
8690 a shared libperl.$so. If you will have more than one executable linked
8691 to libperl.$so, this will significantly reduce the size of each
8692 executable, but it may have a noticeable effect on performance. The
8693 default is probably sensible for your system.
8697 rp="Build a shared libperl.$so (y/n)"
8701 useshrplib='true' ;;
8702 *) useshrplib='false' ;;
8707 case "$useshrplib" in
8709 case "$userelocatableinc" in
8711 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8712 echo "See INSTALL for an explanation why that won't work." >&4
8718 # Figure out a good name for libperl.so. Since it gets stored in
8719 # a version-specific architecture-dependent library, the version
8720 # number isn't really that important, except for making cc/ld happy.
8722 # A name such as libperl.so.10.1
8723 majmin="libperl.$so.$patchlevel.$subversion"
8724 # A name such as libperl.so.100
8725 majonly=`echo $patchlevel $subversion |
8726 $awk '{printf "%d%02d", $1, $2}'`
8727 majonly=libperl.$so.$majonly
8728 # I'd prefer to keep the os-specific stuff here to a minimum, and
8729 # rely on figuring it out from the naming of libc.
8730 case "${osname}${osvers}" in
8731 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8734 cygwin*) # ld links now against the dll directly
8735 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8736 majonly=`echo $patchlevel $subversion |
8737 $awk '{printf "%03d%03d", $1, $2}'`
8738 majonly=cygperl5.$majonly.$so
8741 *) # Try to guess based on whether libc has major.minor.
8743 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8744 *libc.$so.[0-9]*) dflt=$majonly ;;
8745 *) dflt=libperl.$so ;;
8755 I need to select a good name for the shared libperl. If your system uses
8756 library names with major and minor numbers, then you might want something
8757 like $majmin. Alternatively, if your system uses a single version
8758 number for shared libraries, then you might want to use $majonly.
8759 Or, your system might be quite happy with a simple libperl.$so.
8761 Since the shared libperl will get installed into a version-specific
8762 architecture-dependent directory, the version number of the shared perl
8763 library probably isn't important, so the default should be o.k.
8766 rp='What name do you want to give to the shared libperl?'
8769 echo "Ok, I'll use $libperl"
8772 libperl="libperl${_a}"
8776 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8780 WARNING: Use of the shrpdir variable for the installation location of
8781 the shared $libperl is not supported. It was never documented and
8782 will not work in this version. Let me (perlbug@perl.org)
8783 know of any problems this may cause.
8789 But your current setting of $shrpdir is
8790 the default anyway, so it's harmless.
8795 Further, your current attempted setting of $shrpdir
8796 conflicts with the value of $archlibexp/CORE
8797 that installperl will use.
8804 # How will the perl executable find the installed shared $libperl?
8805 # Add $xxx to ccdlflags.
8806 # If we can't figure out a command-line option, use $shrpenv to
8807 # set env LD_RUN_PATH. The main perl makefile uses this.
8808 shrpdir=$archlibexp/CORE
8811 if "$useshrplib"; then
8814 # We'll set it in Makefile.SH...
8819 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8820 xxx="-Wl,-R$shrpdir"
8822 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8823 xxx="-Wl,-rpath,$shrpdir"
8826 # hpux doesn't like the default, either.
8827 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8830 # cygwin needs only ldlibpth
8833 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8839 # Only add $xxx if it isn't already in ccdlflags.
8840 case " $ccdlflags " in
8842 *) ccdlflags="$ccdlflags $xxx"
8845 Adding $xxx to the flags
8846 passed to $ld so that the perl executable will find the
8847 installed shared $libperl.
8855 # Fix ccdlflags in AIX for building external extensions.
8856 # (For building Perl itself bare -bE:perl.exp is needed,
8857 # Makefile.SH takes care of this.)
8859 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8861 # Respect a hint or command-line value.
8863 '') shrpenv="$tmp_shrpenv" ;;
8865 case "$ldlibpthname" in
8866 '') ldlibpthname=LD_LIBRARY_PATH ;;
8867 none) ldlibpthname='' ;;
8870 : determine where manual pages are on this system
8874 syspath='/usr/share/man/man1 /usr/man/man1'
8875 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8876 syspath="$syspath /usr/man/u_man/man1"
8877 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8878 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8879 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8880 sysman=`./loc . /usr/man/man1 $syspath`
8883 if $test -d "$sysman"; then
8884 echo "System manual is in $sysman." >&4
8886 echo "Could not find manual pages in source form." >&4
8889 : determine where manual pages go
8890 set man1dir man1dir none
8894 $spackage has manual pages available in source form.
8898 echo "However, you don't have nroff, so they're probably useless to you."
8900 '') man1dir="none";;
8903 echo "If you don't want the manual sources installed, answer 'none'."
8908 lookpath="$prefixexp/share/man/man1"
8909 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8910 lookpath="$lookpath $prefixexp/man/p_man/man1"
8911 lookpath="$lookpath $prefixexp/man/u_man/man1"
8912 lookpath="$lookpath $prefixexp/man/man.1"
8914 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8915 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8925 rp="Where do the main $spackage manual pages (source) go?"
8927 if $test "X$man1direxp" != "X$ansexp"; then
8938 : What suffix to use on installed man pages
8945 rp="What suffix should be used for the main $spackage man pages?"
8947 '') case "$man1dir" in
8961 *) dflt="$man1ext";;
8968 : see if we can have long filenames
8970 first=123456789abcdef
8972 if (echo hi >$first) 2>/dev/null; then
8973 if $test -f 123456789abcde; then
8974 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8977 echo 'You can have filenames longer than 14 characters.'>&4
8982 You can't have filenames longer than 14 chars.
8983 You can't even think about them!
8989 $rm -rf 123456789abcde*
8991 : determine where library module manual pages go
8992 set man3dir man3dir none
8996 $spackage has manual pages for many of the library modules.
9002 However, you don't have nroff, so they're probably useless to you.
9005 '') man3dir="none";;
9009 case "$d_flexfnam" in
9012 However, your system can't handle the long file names like File::Basename.3.
9015 '') man3dir="none";;
9019 echo "If you don't want the manual sources installed, answer 'none'."
9020 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9022 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9023 if $test -d "$privlib/man/man3"; then
9026 WARNING: Previous versions of perl installed man3 pages into
9027 $privlib/man/man3. This version will suggest a
9028 new default of $dflt.
9032 rp='Do you wish to preserve the old behavior?(y/n)'
9035 y*) dflt="$privlib/man/man3" ;;
9040 *) dflt="$man3dir" ;;
9047 rp="Where do the $package library man pages (source) go?"
9057 : What suffix to use on installed man pages
9063 rp="What suffix should be used for the $package library man pages?"
9065 '') case "$man3dir" in
9079 *) dflt="$man3ext";;
9086 : see if we have to deal with yellow pages, now NIS.
9087 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9093 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9101 rp='Are you getting the hosts file via yellow pages?'
9104 y*) hostcat='ypcat hosts';;
9105 *) hostcat='cat /etc/hosts';;
9111 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9114 '') test -f /etc/group && groupcat='cat /etc/group';;
9117 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9120 : now get the host name
9122 echo "Figuring out host name..." >&4
9123 case "$myhostname" in
9125 echo 'Maybe "hostname" will work...'
9126 if tans=`sh -c hostname 2>&1` ; then
9134 if $test "$cont"; then
9136 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9137 if tans=`cat /etc/systemid 2>&1` ; then
9139 phostname='cat /etc/systemid'
9140 echo "Whadyaknow. Xenix always was a bit strange..."
9143 elif $test -r /etc/systemid; then
9144 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9147 if $test "$cont"; then
9148 echo 'No, maybe "uuname -l" will work...'
9149 if tans=`sh -c 'uuname -l' 2>&1` ; then
9151 phostname='uuname -l'
9153 echo 'Strange. Maybe "uname -n" will work...'
9154 if tans=`sh -c 'uname -n' 2>&1` ; then
9156 phostname='uname -n'
9158 echo 'Oh well, maybe I can mine it out of whoami.h...'
9159 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9160 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9161 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9163 case "$myhostname" in
9164 '') echo "Does this machine have an identity crisis or something?"
9167 echo "Well, you said $myhostname before..."
9168 phostname='echo $myhostname';;
9174 case "$myhostname" in
9175 '') myhostname=noname ;;
9177 : you do not want to know about this
9182 if $test "$myhostname" ; then
9184 rp='Your host name appears to be "'$myhostname'".'" Right?"
9192 : bad guess or no guess
9193 while $test "X$myhostname" = X ; do
9195 rp="Please type the (one word) name of your host:"
9200 : translate upper to lower if necessary
9201 case "$myhostname" in
9203 echo "(Normalizing case in your host name)"
9204 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9208 case "$myhostname" in
9210 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9211 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9212 echo "(Trimming domain name from host name--host name is now $myhostname)"
9214 *) case "$mydomain" in
9217 test "X$hostcat" = "Xypcat hosts" &&
9218 ypmatch "$myhostname" hosts 2>/dev/null |\
9219 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9222 test "X$hostcat" != "X" &&
9223 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9224 /[ ]$myhostname[ . ]/p" > hosts
9227 if $test -f hosts; then
9228 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9229 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9230 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9231 hosts | $sort | $uniq | \
9232 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9233 case `$echo X$dflt` in
9234 X*\ *) echo "(Several hosts in the database matched hostname)"
9237 X.) echo "(You do not have fully-qualified names in the hosts database)"
9241 echo "(I cannot locate a hosts database anywhere)"
9246 tans=`./loc resolv.conf X /etc /usr/etc`
9247 if $test -f "$tans"; then
9248 echo "(Attempting domain name extraction from $tans)"
9249 dflt=.`$sed -n -e 's/ / /g' \
9250 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9253 .) dflt=.`$sed -n -e 's/ / /g' \
9254 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9262 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9263 dflt=.`sh -c domainname 2>/dev/null`
9266 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9270 case "$dflt$osname" in
9271 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9272 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9276 .) echo "(Lost all hope -- silly guess then)"
9282 *) dflt="$mydomain";;
9286 rp="What is your domain name?"
9296 : translate upper to lower if necessary
9299 echo "(Normalizing case in your domain name)"
9300 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9304 : a little sanity check here
9305 case "$phostname" in
9308 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9309 $myhostname$mydomain|$myhostname) ;;
9311 case "$phostname" in
9313 echo "(That doesn't agree with your whoami.h file, by the way.)"
9316 echo "(That doesn't agree with your $phostname command, by the way.)"
9324 : determine the e-mail address of the user who is running us
9327 I need to get your e-mail address in Internet format if possible, i.e.
9328 something like user@host.domain. Please answer accurately since I have
9329 no easy means to double check it. The default value provided below
9330 is most probably close to reality but may not be valid from outside
9331 your organization...
9335 while test "$cont"; do
9336 case "$MAILDOMAIN" in
9338 if $test -s /etc/mailname; then
9339 maildomain=`$cat /etc/mailname`
9341 maildomain="$myhostname$mydomain"
9344 *) maildomain="$MAILDOMAIN";;
9347 '') dflt="$cf_by@$maildomain";;
9348 *) dflt="$cf_email";;
9350 rp='What is your e-mail address?'
9356 rp='Address does not look like an Internet one. Use it anyway?'
9370 : Ask e-mail of administrator
9373 If you or somebody else will be maintaining perl at your site, please
9374 fill in the correct e-mail address here so that they may be contacted
9375 if necessary. Currently, the "perlbug" program included with perl
9376 will send mail to this address in addition to perlbug@perl.org. You may
9377 enter "none" for no administrator.
9380 case "$perladmin" in
9381 '') dflt="$cf_email";;
9382 *) dflt="$perladmin";;
9384 rp='Perl administrator e-mail address'
9388 : determine whether to use a version number suffix for installed binaries
9391 Do you want to use a version number suffix for installed binaries? This
9392 will install 'perl$version' instead of 'perl', and likewise for other
9393 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9394 to be installed side-by-side. Unless you are a developer, you probably
9395 do *not* want to do this.
9397 case "$versiononly" in
9398 "$define"|[Yy]*|true) dflt='y' ;;
9401 rp="Do you want to use a version number suffix for installed binaries?"
9404 [yY]*) val="$define";;
9410 case "$versiononly" in
9411 "$define") inc_version_list=''
9412 inc_version_list_init=0
9416 : figure out how to guarantee perl startup
9417 : XXX Note that this currently takes advantage of the bug that binexp ignores
9418 : the Configure -Dinstallprefix setting, which in turn means that under
9419 : relocatable @INC, initialinstalllocation is what binexp started as.
9420 case "$startperl" in
9422 case "$sharpbang" in
9426 I can use the #! construct to start perl on your system. This will
9427 make startup of perl scripts faster, but may cause problems if you
9428 want to share those scripts and perl is not in a standard place
9429 ($initialinstalllocation/perl) on all your platforms. The alternative
9430 is to force a shell by starting the script with a single ':' character.
9433 case "$versiononly" in
9434 "$define") dflt="$initialinstalllocation/perl$version";;
9435 *) dflt="$initialinstalllocation/perl";;
9437 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9440 none) startperl=": # use perl";;
9441 *) startperl="#!$ans"
9442 if $test 30 -lt `echo "$ans" | wc -c`; then
9445 WARNING: Some systems limit the #! command to 32 characters.
9446 If you experience difficulty running Perl scripts with #!, try
9447 installing Perl in a directory with a shorter pathname.
9453 *) startperl=": # use perl"
9458 echo "I'll use $startperl to start perl scripts."
9460 : figure best path for perl in scripts
9463 case "$versiononly" in
9464 "$define") perlpath="$initialinstalllocation/perl$version";;
9465 *) perlpath="$initialinstalllocation/perl";;
9467 case "$startperl" in
9472 I will use the "eval 'exec'" idiom to start Perl on your system.
9473 I can use the full path of your Perl binary for this purpose, but
9474 doing so may cause problems if you want to share those scripts and
9475 Perl is not always in a standard place ($initialinstalllocation/perl).
9478 dflt="$initialinstalllocation/perl"
9479 rp="What path shall I use in \"eval 'exec'\"?"
9486 case "$startperl" in
9488 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9491 : determine where public executable scripts go
9492 set scriptdir scriptdir
9494 case "$scriptdir" in
9497 : guess some guesses
9498 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9499 $test -d /usr/share/bin && dflt=/usr/share/bin
9500 $test -d /usr/local/script && dflt=/usr/local/script
9501 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9502 $test -d $prefixexp/script && dflt=$prefixexp/script
9506 *) dflt="$scriptdir"
9511 Some installations have a separate directory just for executable scripts so
9512 that they can mount it across multiple architectures but keep the scripts in
9513 one spot. You might, for example, have a subdirectory of /usr/share for this.
9514 Or you might just lump your scripts in with all your other executables.
9518 rp='Where do you keep publicly executable scripts?'
9520 if $test "X$ansexp" != "X$scriptdirexp"; then
9526 : A little fix up for an irregularly named variable.
9527 installscript="$installscriptdir"
9529 : determine where add-on public executables go
9531 '') dflt=$siteprefix/bin ;;
9535 rp='Pathname where the add-on public executables should be installed?'
9540 : determine where add-on html pages go
9541 : There is no standard location, so try to copy the previously-selected
9542 : directory structure for the core html pages.
9543 case "$sitehtml1dir" in
9544 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9545 *) dflt=$sitehtml1dir ;;
9548 ''|' ') dflt=none ;;
9551 rp='Pathname where the site-specific html pages should be installed?'
9553 prefixvar=sitehtml1dir
9556 : determine where add-on library html pages go
9557 : There is no standard location, so try to copy the previously-selected
9558 : directory structure for the core html pages.
9559 case "$sitehtml3dir" in
9560 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9561 *) dflt=$sitehtml3dir ;;
9564 ''|' ') dflt=none ;;
9567 rp='Pathname where the site-specific library html pages should be installed?'
9569 prefixvar=sitehtml3dir
9572 : determine where add-on manual pages go
9573 case "$siteman1dir" in
9574 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9575 *) dflt=$siteman1dir ;;
9578 ''|' ') dflt=none ;;
9581 rp='Pathname where the site-specific manual pages should be installed?'
9583 prefixvar=siteman1dir
9586 : determine where add-on library man pages go
9587 case "$siteman3dir" in
9588 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9589 *) dflt=$siteman3dir ;;
9592 ''|' ') dflt=none ;;
9595 rp='Pathname where the site-specific library manual pages should be installed?'
9597 prefixvar=siteman3dir
9600 : determine where add-on public executable scripts go
9601 case "$sitescript" in
9602 '') dflt=$siteprefix/script
9603 $test -d $dflt || dflt=$sitebin ;;
9604 *) dflt="$sitescript" ;;
9607 rp='Pathname where add-on public executable scripts should be installed?'
9609 prefixvar=sitescript
9612 : see if backtrace exists
9613 set backtrace d_backtrace
9616 : add flags if using c backtrace
9617 case "$usecbacktrace" in
9618 "") usecbacktrace=$undef ;;
9620 case "$d_backtrace" in
9622 case " $ccflags " in
9623 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9624 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9628 echo "This system does not support backtrace" >&4
9629 usecbacktrace=$undef
9635 : Check if faststdio is requested and available
9636 case "$usefaststdio" in
9637 $define|true|[yY]*|'')
9638 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9648 Perl can be built to use 'fast stdio', which means using the stdio
9649 library but also directly manipulating the stdio buffers to enable
9650 faster I/O. Using stdio is better for backward compatibility (especially
9651 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9652 interface has been preferred instead of stdio.
9654 If this doesn't make any sense to you, just accept the default '$dflt'.
9656 rp='Use the "fast stdio" if available?'
9659 y|Y) val="$define" ;;
9666 : define an is-a-typedef? function
9667 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9669 "") inclist="sys/types.h";;
9671 eval "varval=\$$var";
9675 for inc in $inclist; do
9676 echo "#include <$inc>" >>temp.c;
9678 echo "#ifdef $type" >> temp.c;
9679 echo "printf(\"We have $type\");" >> temp.c;
9680 echo "#endif" >> temp.c;
9681 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9682 if $contains $type temp.E >/dev/null 2>&1; then
9688 *) eval "$var=\$varval";;
9691 : define an is-a-typedef? function that prompts if the type is not available.
9692 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9694 "") inclist="sys/types.h";;
9696 eval "varval=\$$var";
9700 for inc in $inclist; do
9701 echo "#include <$inc>" >>temp.c;
9703 echo "#ifdef $type" >> temp.c;
9704 echo "printf(\"We have $type\");" >> temp.c;
9705 echo "#endif" >> temp.c;
9706 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9708 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9709 if $contains $type temp.E >/dev/null 2>&1; then
9710 echo "$type found." >&4;
9713 echo "$type NOT found." >&4;
9719 *) eval "$var=\$varval";;
9722 : see what type lseek is declared as in the kernel
9723 rp="What is the type used for lseek's offset on this system?"
9724 set off_t lseektype long stdio.h sys/types.h
9728 echo "Checking to see how big your file offsets are..." >&4
9730 #include <sys/types.h>
9734 printf("%d\n", (int)sizeof($lseektype));
9739 if eval $compile_ok; then
9740 lseeksize=`$run ./try`
9741 echo "Your file offsets are $lseeksize bytes long."
9745 echo "(I can't seem to compile the test program. Guessing...)"
9746 rp="What is the size of your file offsets (in bytes)?"
9752 : see what type file positions are declared as in the library
9753 rp="What is the type for file position used by fsetpos()?"
9754 set fpos_t fpostype long stdio.h sys/types.h
9757 : Check size for Fpos_t
9760 *_t) zzz="$fpostype" ;;
9763 echo "Checking the size of $zzz..." >&4
9765 #include <sys/types.h>
9772 printf("%d\n", (int)sizeof($fpostype));
9777 if eval $compile_ok; then
9781 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9784 echo "Your $zzz is $fpossize bytes long."
9790 echo "(I can't compile the test program. Guessing...)" >&4
9791 rp="What is the size of your file positions (in bytes)?"
9796 : Check for large file support
9797 # Backward compatibility (uselfs is deprecated).
9799 "$define"|true|[yY]*)
9802 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9804 uselargefiles="$define"
9808 case "$lseeksize:$fpossize" in
9811 You can have files larger than 2 gigabytes.
9814 *) case "$uselargefiles" in
9815 "$undef"|false|[nN]*) dflt='n' ;;
9820 Perl can be built to understand large files (files larger than 2 gigabytes)
9821 on some systems. To do so, Configure can be run with -Duselargefiles.
9823 If this doesn't make any sense to you, just accept the default '$dflt'.
9825 rp='Try to understand large files, if available?'
9828 y|Y) val="$define" ;;
9835 : Look for a hint-file generated 'call-back-unit'. If the
9836 : user has specified that a large files perl is to be built,
9837 : we may need to set or change some other defaults.
9838 if $test -f uselargefiles.cbu; then
9839 echo "Your platform has some specific hints regarding large file builds, using them..."
9840 . ./uselargefiles.cbu
9842 case "$uselargefiles" in
9844 if $test -f uselargefiles.cbu; then
9846 echo "Rechecking to see how big your file offsets are..." >&4
9848 #include <sys/types.h>
9852 printf("%d\n", (int)sizeof($lseektype));
9857 if eval $compile_ok; then
9858 lseeksize=`$run ./try`
9859 $echo "Your file offsets are now $lseeksize bytes long."
9863 echo "(I can't seem to compile the test program. Guessing...)"
9864 rp="What is the size of your file offsets (in bytes)?"
9869 *_t) zzz="$fpostype" ;;
9872 $echo $n "Rechecking the size of $zzz...$c" >&4
9874 #include <sys/types.h>
9881 printf("%d\n", (int)sizeof($fpostype));
9886 if eval $compile_ok; then
9891 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9894 echo " $fpossize bytes." >&4
9900 echo "(I can't compile the test program. Guessing...)" >&4
9901 rp="What is the size of your file positions (in bytes)?"
9910 : Check if we want perlio
9913 : Set the vendorbin variables
9914 case "$vendorprefix" in
9915 '') d_vendorbin="$undef"
9919 *) d_vendorbin="$define"
9920 : determine where vendor-supplied executables go.
9921 case "$vendorbin" in
9922 '') dflt=$vendorprefix/bin ;;
9923 *) dflt="$vendorbin" ;;
9926 rp='Pathname for the vendor-supplied executables directory?'
9929 vendorbinexp="$ansexp"
9935 : Set the vendorhtml1dir variables
9936 case "$vendorprefix" in
9937 '') vendorhtml1dir=''
9938 vendorhtml1direxp=''
9940 *) : determine where vendor-supplied html pages go.
9941 : There is no standard location, so try to copy the previously-selected
9942 : directory structure for the core html pages.
9943 : XXX Better default suggestions would be welcome.
9944 case "$vendorhtml1dir" in
9945 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9946 *) dflt=$vendorhtml1dir ;;
9949 ''|' ') dflt=none ;;
9952 rp='Pathname for the vendor-supplied html pages?'
9954 vendorhtml1dir="$ans"
9955 vendorhtml1direxp="$ansexp"
9958 : Use ' ' for none so value is preserved next time through Configure
9959 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9960 prefixvar=vendorhtml1dir
9963 : Set the vendorhtml3dir variables
9964 case "$vendorprefix" in
9965 '') vendorhtml3dir=''
9966 vendorhtml3direxp=''
9968 *) : determine where vendor-supplied module html pages go.
9969 : There is no standard location, so try to copy the previously-selected
9970 : directory structure for the core html pages.
9971 : XXX Better default suggestions would be welcome.
9972 case "$vendorhtml3dir" in
9973 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9974 *) dflt=$vendorhtml3dir ;;
9977 ''|' ') dflt=none ;;
9980 rp='Pathname for the vendor-supplied html pages?'
9982 vendorhtml3dir="$ans"
9983 vendorhtml3direxp="$ansexp"
9986 : Use ' ' for none so value is preserved next time through Configure
9987 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9988 prefixvar=vendorhtml3dir
9991 : Set the vendorman1dir variables
9992 case "$vendorprefix" in
9993 '') vendorman1dir=''
9996 *) : determine where vendor-supplied manual pages go.
9997 case "$vendorman1dir" in
9998 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9999 *) dflt=$vendorman1dir ;;
10002 ''|' ') dflt=none ;;
10005 rp='Pathname for the vendor-supplied manual section 1 pages?'
10007 vendorman1dir="$ans"
10008 vendorman1direxp="$ansexp"
10011 : Use ' ' for none so value is preserved next time through Configure
10012 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10013 prefixvar=vendorman1dir
10016 : Set the vendorman3dir variables
10017 case "$vendorprefix" in
10018 '') vendorman3dir=''
10019 vendorman3direxp=''
10021 *) : determine where vendor-supplied module manual pages go.
10022 case "$vendorman3dir" in
10023 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10024 *) dflt=$vendorman3dir ;;
10027 ''|' ') dflt=none ;;
10030 rp='Pathname for the vendor-supplied manual section 3 pages?'
10032 vendorman3dir="$ans"
10033 vendorman3direxp="$ansexp"
10036 : Use ' ' for none so value is preserved next time through Configure
10037 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10038 prefixvar=vendorman3dir
10041 : Set the vendorscript variables
10042 case "$vendorprefix" in
10043 '') d_vendorscript="$undef"
10047 *) d_vendorscript="$define"
10048 : determine where vendor-supplied scripts go.
10049 case "$vendorscript" in
10050 '') dflt=$vendorprefix/script
10051 $test -d $dflt || dflt=$vendorbin ;;
10052 *) dflt="$vendorscript" ;;
10056 The installation process will create a directory for
10057 vendor-supplied scripts.
10061 rp='Pathname for the vendor-supplied scripts directory?'
10063 vendorscript="$ans"
10064 vendorscriptexp="$ansexp"
10067 prefixvar=vendorscript
10070 : script used to emit important warnings
10073 if test \$# -gt 0; then
10078 echo "*** WARNING:" >&4
10079 sed -e 's/^/*** /' <msg >&4
10081 cat msg >>config.msg
10082 echo " " >>config.msg
10088 : see which of string.h or strings.h is needed
10090 strings=`./findhdr string.h`
10091 if $test "$strings" && $test -r "$strings"; then
10092 echo "Using <string.h> instead of <strings.h>." >&4
10096 strings=`./findhdr strings.h`
10097 if $test "$strings" && $test -r "$strings"; then
10098 echo "Using <strings.h> instead of <string.h>." >&4
10100 ./warn "No string header found -- You'll surely have problems."
10105 case "$i_string" in
10106 "$undef") strings=`./findhdr strings.h`;;
10107 *) strings=`./findhdr string.h`;;
10110 : see if qgcvt exists
10114 : Check what kind of doubles your system has
10115 $echo "Checking the kind of doubles you have..." >&4
10117 #$i_stdlib I_STDLIB
10118 #define DOUBLESIZE $doublesize
10120 #include <stdlib.h>
10123 static const double d = -0.1;
10125 unsigned const char* b = (unsigned const char*)(&d);
10126 #if DOUBLESIZE == 4
10127 if (b[0] == 0xCD && b[3] == 0xBD) {
10128 /* IEEE 754 32-bit little-endian */
10132 if (b[0] == 0xBD && b[3] == 0xCD) {
10133 /* IEEE 754 32-bit big-endian */
10137 if (b[0] == 0xCC && b[3] == 0xCC) {
10138 /* VAX format F, 32-bit PDP-style mixed endian. */
10142 if (b[0] == 0xC0 && b[3] == 0x9A) {
10143 /* IBM single 32-bit */
10148 #if DOUBLESIZE == 8
10149 if (b[0] == 0x9A && b[7] == 0xBF) {
10150 /* IEEE 754 64-bit little-endian */
10154 if (b[0] == 0xBF && b[7] == 0x9A) {
10155 /* IEEE 754 64-bit big-endian */
10159 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10160 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10161 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10162 * 99 99 b9 bf 9a 99 99 99 */
10166 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10167 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10168 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10169 * 99 99 99 9a bf b9 99 99 */
10173 if (b[0] == 0xCC && b[7] == 0xCC) {
10174 /* VAX format D, 64-bit PDP-style mixed endian. */
10178 if (b[0] == 0xD9 && b[7] == 0x99) {
10179 /* VAX format G, 64-bit PDP-style mixed endian. */
10183 if (b[0] == 0xC0 && b[7] == 0x9A) {
10184 /* IBM double 64-bit */
10188 if (b[0] == 0xBF && b[7] == 0xCD) {
10189 /* CRAY single 64-bit */
10194 #if DOUBLESIZE == 16
10195 if (b[0] == 0x9A && b[15] == 0xBF) {
10196 /* IEEE 754 128-bit little-endian */
10200 if (b[0] == 0xBF && b[15] == 0x9A) {
10201 /* IEEE 754 128-bit big-endian */
10206 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10207 * Whether those environments can still build Perl is debatable. */
10208 printf("-1\n"); /* unknown */
10213 if eval $compile; then
10214 doublekind=`$run ./try`
10218 case "$doublekind" in
10219 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10220 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10221 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10222 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10223 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10224 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10225 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10226 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10227 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10228 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10229 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10230 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10231 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10232 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10233 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10235 d_double_style_ieee=$undef
10236 d_double_style_vax=$undef
10237 d_double_style_ibm=$undef
10238 d_double_style_cray=$undef
10239 case "$doublekind" in
10240 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10241 9|10|11) d_double_style_vax=$define ;;
10242 12|13) d_double_style_ibm=$define ;;
10243 14) d_double_style_cray=$define ;;
10245 case "$d_double_style_ieee" in
10247 d_double_has_inf=$define
10248 d_double_has_nan=$define
10249 d_double_has_negative_zero=$define
10250 d_double_has_subnormals=$define
10253 d_double_has_inf=$undef
10254 d_double_has_nan=$undef
10255 d_double_has_negative_zero=$undef
10256 d_double_has_subnormals=$undef
10261 : Check print/scan long double stuff
10264 if $test X"$d_longdbl" = X"$define"; then
10266 echo "Checking how to print long doubles..." >&4
10268 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10269 $cat >try.c <<'EOCP'
10270 #include <sys/types.h>
10273 double d = 123.456;
10274 printf("%.3f\n", d);
10278 if eval $compile; then
10282 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10283 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10284 echo "We will use %f."
10290 if $test X"$sPRIfldbl" = X; then
10291 $cat >try.c <<'EOCP'
10292 #include <sys/types.h>
10295 long double d = 123.456;
10296 printf("%.3Lf\n", d);
10300 if eval $compile; then
10304 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10305 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10306 echo "We will use %Lf."
10312 if $test X"$sPRIfldbl" = X; then
10313 $cat >try.c <<'EOCP'
10314 #include <sys/types.h>
10317 long double d = 123.456;
10318 printf("%.3llf\n", d);
10322 if eval $compile; then
10326 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10327 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10328 echo "We will use %llf."
10334 if $test X"$sPRIfldbl" = X; then
10335 $cat >try.c <<'EOCP'
10336 #include <sys/types.h>
10339 long double d = 123.456;
10340 printf("%.3lf\n", d);
10344 if eval $compile; then
10348 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10349 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10350 echo "We will use %lf."
10356 if $test X"$sPRIfldbl" = X; then
10357 echo "Cannot figure out how to print long doubles." >&4
10359 sSCNfldbl=$sPRIfldbl # expect consistency
10366 case "$sPRIfldbl" in
10367 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10368 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10369 d_SCNfldbl="$undef";
10371 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10372 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10373 d_SCNfldbl="$define";
10377 : Before committing on uselongdouble, see whether that looks sane.
10378 if $test "$uselongdouble" = "$define"; then
10381 echo "Checking if your long double math functions work right..." >&4
10386 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10389 case "$osname:$gccversion" in
10390 aix:) saveccflags="$ccflags"
10391 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10394 if eval $compile_ok; then
10398 3) echo "Your long double math functions are working correctly." >&4 ;;
10399 *) echo "Your long double math functions are broken, not using long doubles." >&4
10400 uselongdouble=$undef
10404 case "$osname:$gccversion" in
10405 aix:) ccflags="$saveccflags" ;; # restore
10409 : Check how to convert floats to strings.
10411 if test "X$d_Gconvert" = X; then
10414 echo "Checking for an efficient way to convert floats to strings."
10416 case "$uselongdouble" in
10417 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10419 case "$d_longdbl" in
10420 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10422 case "$d_PRIgldbl" in
10423 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10426 #ifdef TRY_gconvert
10427 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10428 char *myname = "gconvert";
10431 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10432 char *myname = "gcvt";
10435 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10436 char *myname = "qgcvt";
10437 #define DOUBLETYPE long double
10440 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10441 #ifdef HAS_PRIgldbl
10442 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10444 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10447 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10449 char *myname = "sprintf";
10453 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10454 #define DOUBLETYPE long double
10456 #define DOUBLETYPE double
10462 #$i_stdlib I_STDLIB
10464 #include <stdlib.h>
10466 #$i_string I_STRING
10468 # include <string.h>
10470 # include <strings.h>
10473 int checkit(char *expect, char *got)
10475 if (strcmp(expect, got)) {
10476 printf("%s oddity: Expected %s, got %s\n",
10477 myname, expect, got);
10487 /* This must be 1st test on (which?) platform */
10488 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10489 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10490 checkit("0.1", buf);
10492 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10493 checkit("0.01", buf);
10495 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10496 checkit("0.001", buf);
10498 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10499 checkit("0.0001", buf);
10501 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10502 if (strlen(buf) > 5)
10503 checkit("9e-005", buf); /* for Microsoft ?? */
10505 checkit("9e-05", buf);
10507 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10510 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10511 checkit("1.1", buf);
10513 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10514 checkit("1.01", buf);
10516 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10517 checkit("1.001", buf);
10519 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10520 checkit("1.0001", buf);
10522 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10523 checkit("1.00001", buf);
10525 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10526 checkit("1.000001", buf);
10528 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10531 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10532 checkit("-1", buf);
10534 /* Some Linux gcvt's give 1.e+5 here. */
10535 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10536 checkit("100000", buf);
10538 /* Some Linux gcvt's give -1.e+5 here. */
10539 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10540 checkit("-100000", buf);
10542 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10543 checkit("123.456", buf);
10545 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10546 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10547 /* 34 should be enough to scare even long double
10548 * places into using the e notation. */
10549 if (strlen(buf) > 5)
10550 checkit("1e+034", buf); /* for Microsoft */
10552 checkit("1e+34", buf);
10554 /* For Perl, if you add additional tests here, also add them to
10555 * t/base/num.t for benefit of platforms not using Configure or
10556 * overriding d_Gconvert */
10561 : first add preferred functions to our list
10563 for xxx_convert in $gconvert_preference; do
10564 case $xxx_convert in
10565 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10566 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10569 : then add any others
10570 for xxx_convert in gconvert gcvt sprintf; do
10571 case "$xxx_list" in
10573 *) xxx_list="$xxx_list $xxx_convert" ;;
10577 case "$d_longdbl$uselongdouble" in
10579 : again, add preferred functions to our list first
10581 for xxx_convert in $gconvert_ld_preference; do
10582 case $xxx_convert in
10583 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10584 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10587 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10588 for xxx_convert in qgcvt sprintf $xxx_list; do
10589 case "$xxx_ld_list" in
10590 $xxx_convert*|*" $xxx_convert"*) ;;
10591 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10594 : if sprintf cannot do long doubles, move it to the end
10595 if test "$d_PRIgldbl" != "$define"; then
10596 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10598 : if no qgcvt, remove it
10599 if test "$d_qgcvt" != "$define"; then
10600 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10603 xxx_list="$xxx_ld_list"
10607 for xxx_convert in $xxx_list; do
10608 echo "Trying $xxx_convert..."
10609 $rm -f try try$_o core
10610 set try -DTRY_$xxx_convert
10611 if eval $compile; then
10612 echo "$xxx_convert() found." >&4
10613 if $run ./try; then
10614 echo "I'll use $xxx_convert to convert floats into a string." >&4
10617 echo "...But $xxx_convert didn't work as I expected."
10621 echo "$xxx_convert NOT found." >&4
10625 if test X$xxx_convert = X; then
10626 echo "*** WHOA THERE!!! ***" >&4
10627 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10628 xxx_convert=sprintf
10631 case "$xxx_convert" in
10632 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10633 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10634 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10635 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10636 "$define$define$define")
10637 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10638 "$define$define$undef")
10639 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10640 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10648 : see if _fwalk exists
10652 : Initialize h_fcntl
10655 : Initialize h_sysfile
10658 : access call always available on UNIX
10659 set access d_access
10662 : locate the flags for 'access()'
10663 case "$d_access" in
10666 $cat >access.c <<EOCP
10667 #include <sys/types.h>
10672 #include <sys/file.h>
10675 #include <unistd.h>
10677 #$i_stdlib I_STDLIB
10679 #include <stdlib.h>
10685 : check sys/file.h first, no particular reason here
10686 if $test `./findhdr sys/file.h` && \
10687 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10689 echo "<sys/file.h> defines the *_OK access constants." >&4
10690 elif $test `./findhdr fcntl.h` && \
10691 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10693 echo "<fcntl.h> defines the *_OK access constants." >&4
10694 elif $test `./findhdr unistd.h` && \
10695 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10696 echo "<unistd.h> defines the *_OK access constants." >&4
10698 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10704 : see if accessx exists
10705 set accessx d_accessx
10708 : see if acosh exists
10712 : see if aintl exists
10716 : see if alarm exists
10720 : see if 64bit time functions exists
10722 set ctime64 d_ctime64
10725 set localtime64 d_localtime64
10728 set gmtime64 d_gmtime64
10731 set mktime64 d_mktime64
10734 set difftime64 d_difftime64
10737 set asctime64 d_asctime64
10740 : see if POSIX threads are available
10741 set pthread.h i_pthread
10744 : define a function to check prototypes
10745 $cat > protochk <<EOSH
10748 optimize="$optimize"
10752 usethreads=$usethreads
10753 i_pthread=$i_pthread
10754 pthread_h_first=$pthread_h_first
10757 $cat >> protochk <<'EOSH'
10762 while test $# -ge 2; do
10764 $define) echo "#include <$2>" >> try.c ;;
10765 literal) echo "$2" >> try.c ;;
10767 # Extra magic for the benefit of systems that need pthread.h
10768 # to be included early to correctly detect threadsafe functions.
10769 # Such functions must guarantee themselves, though, that the usethreads
10770 # and i_pthread have been defined, before calling protochk.
10771 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10772 echo "#include <pthread.h>" >> try.c
10777 cat >> try.c <<'EOCP'
10778 #define _(args) args
10780 echo "$foo" >> try.c
10781 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10782 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10788 $eunicefix protochk
10790 : Define hasproto macro for Configure internal use
10791 hasproto='varname=$1; func=$2; shift; shift;
10792 while $test $# -ge 2; do
10794 $define) echo "#include <$2>";;
10798 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10799 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10800 echo "$func() prototype found.";
10803 echo "$func() prototype NOT found.";
10810 : see if sys/types.h has to be included
10811 set sys/types.h i_systypes
10814 : see if sys/select.h has to be included
10815 set sys/select.h i_sysselct
10818 : Define hasfield macro for Configure internal use
10819 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10820 while $test $# -ge 2; do
10822 $define) echo "#include <$2>";;
10826 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10828 if eval $compile; then
10837 : see if we should include time.h, sys/time.h, or both
10839 if test "X$timeincl" = X; then
10840 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10841 $echo $n "I'm now running the test program...$c"
10843 #include <sys/types.h>
10848 #ifdef SYSTIMEKERNEL
10851 #include <sys/time.h>
10854 #include <sys/select.h>
10856 #$i_stdlib I_STDLIB
10858 #include <stdlib.h>
10864 struct timeval bar;
10867 struct timezone tzp;
10869 if (foo.tm_sec == foo.tm_sec)
10872 if (bar.tv_sec == bar.tv_sec)
10879 for s_timezone in '-DS_TIMEZONE' ''; do
10881 for s_timeval in '-DS_TIMEVAL' ''; do
10882 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10883 for i_time in '' '-DI_TIME'; do
10884 for i_systime in '-DI_SYSTIME' ''; do
10887 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10888 if eval $compile; then
10889 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10893 $echo $n "Succeeded with $flags$c"
10905 *SYSTIMEKERNEL*) i_systimek="$define"
10906 timeincl=`./findhdr sys/time.h`
10907 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10908 *) i_systimek="$undef";;
10911 *I_TIME*) i_time="$define"
10912 timeincl=`./findhdr time.h`" $timeincl"
10913 echo "We'll include <time.h>." >&4;;
10914 *) i_time="$undef";;
10917 *I_SYSTIME*) i_systime="$define"
10918 timeincl=`./findhdr sys/time.h`" $timeincl"
10919 echo "We'll include <sys/time.h>." >&4;;
10920 *) i_systime="$undef";;
10924 : see if struct tm knows about tm_zone
10925 case "$i_systime$i_time" in
10928 echo "Checking to see if your struct tm has tm_zone field..." >&4
10929 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10937 case "$d_tm_tm_zone" in
10938 "$define") echo "Yes, it does." ;;
10939 *) echo "No, it doesn't." ;;
10941 : see if struct tm knows about tm_gmtoff
10942 case "$i_systime$i_time" in
10945 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10946 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10954 case "$d_tm_tm_gmtoff" in
10955 "$define") echo "Yes, it does." ;;
10956 *) echo "No, it doesn't." ;;
10959 : see if asctime_r exists
10960 set asctime_r d_asctime_r
10962 case "$d_asctime_r" in
10964 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10965 case "$d_asctime_r_proto:$usethreads" in
10966 ":define") d_asctime_r_proto=define
10967 set d_asctime_r_proto asctime_r $hdrs
10971 case "$d_asctime_r_proto" in
10973 case "$asctime_r_proto" in
10974 ''|0) try='char* asctime_r(const struct tm*, char*);'
10975 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10977 case "$asctime_r_proto" in
10978 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10979 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10981 case "$asctime_r_proto" in
10982 ''|0) try='int asctime_r(const struct tm*, char*);'
10983 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10985 case "$asctime_r_proto" in
10986 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10987 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10989 case "$asctime_r_proto" in
10990 ''|0) d_asctime_r=undef
10992 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10993 * ) case "$asctime_r_proto" in
10994 REENTRANT_PROTO*) ;;
10995 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10997 echo "Prototype: $try" ;;
11000 *) case "$usethreads" in
11001 define) echo "asctime_r has no prototype, not using it." >&4 ;;
11008 *) asctime_r_proto=0
11012 : see if asinh exists
11016 : see if atanh exists
11020 : see if atolf exists
11024 : see if atoll exists
11028 : Look for GCC-style attribute format
11029 case "$d_attribute_format" in
11032 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11033 $cat >attrib.c <<'EOCP'
11035 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11037 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11038 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11039 echo "Your C compiler doesn't support __attribute__((format))."
11042 echo "Your C compiler supports __attribute__((format))."
11046 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11050 *) val="$d_attribute_format" ;;
11052 set d_attribute_format
11056 : Look for GCC-style attribute format with null format allowed
11057 case "$d_printf_format_null" in
11058 '') case "$d_attribute_format" in
11061 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11062 $cat >attrib.c <<EOCP
11064 #$i_stdlib I_STDLIB
11066 #include <stdlib.h>
11068 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11069 int null_printf (char* pat,...) { return (int)pat; }
11070 int main () { exit(null_printf(NULL)); }
11072 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11073 : run the executable in case it produces a run-time warning
11074 if $run ./attrib >>attrib.out 2>&1; then
11075 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11076 echo "Your C compiler doesn't allow __printf__ format to be null."
11079 echo "Your C compiler allows __printf__ format to be null."
11083 echo "Your C compiler executable failed with __printf__ format null."
11087 echo "Your C compiler fails with __printf__ format null."
11094 *) val="$d_printf_format_null" ;;
11096 set d_printf_format_null
11100 : Look for GCC-style attribute malloc
11101 case "$d_attribute_malloc" in
11104 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11105 $cat >attrib.c <<'EOCP'
11107 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11109 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11110 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11111 echo "Your C compiler doesn't support __attribute__((malloc))."
11114 echo "Your C compiler supports __attribute__((malloc))."
11118 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11122 *) val="$d_attribute_malloc" ;;
11124 set d_attribute_malloc
11128 : Look for GCC-style attribute nonnull
11129 case "$d_attribute_nonnull" in
11132 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11133 $cat >attrib.c <<'EOCP'
11135 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11137 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11138 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11139 echo "Your C compiler doesn't support __attribute__((nonnull))."
11142 echo "Your C compiler supports __attribute__((nonnull))."
11146 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11150 *) val="$d_attribute_nonnull" ;;
11152 set d_attribute_nonnull
11156 : Look for GCC-style attribute noreturn
11157 case "$d_attribute_noreturn" in
11160 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11161 $cat >attrib.c <<'EOCP'
11163 void fall_over_dead( void ) __attribute__((noreturn));
11165 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11166 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11167 echo "Your C compiler doesn't support __attribute__((noreturn))."
11170 echo "Your C compiler supports __attribute__((noreturn))."
11174 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11178 *) val="$d_attribute_noreturn" ;;
11180 set d_attribute_noreturn
11184 : Look for GCC-style attribute pure
11185 case "$d_attribute_pure" in
11188 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11189 $cat >attrib.c <<'EOCP'
11191 int square( int n ) __attribute__((pure));
11193 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11194 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11195 echo "Your C compiler doesn't support __attribute__((pure))."
11198 echo "Your C compiler supports __attribute__((pure))."
11202 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11206 *) val="$d_attribute_pure" ;;
11208 set d_attribute_pure
11212 : Look for GCC-style attribute unused
11213 case "$d_attribute_unused" in
11216 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11217 $cat >attrib.c <<'EOCP'
11219 int do_something( int dummy __attribute__((unused)), int n );
11221 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11222 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11223 echo "Your C compiler doesn't support __attribute__((unused))."
11226 echo "Your C compiler supports __attribute__((unused))."
11230 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11234 *) val="$d_attribute_unused" ;;
11236 set d_attribute_unused
11240 : Look for GCC-style attribute deprecated
11241 case "$d_attribute_deprecated" in
11244 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11245 $cat >attrib.c <<'EOCP'
11247 int I_am_deprecated(void) __attribute__((deprecated));
11249 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11250 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11251 echo "Your C compiler doesn't support __attribute__((deprecated))."
11254 echo "Your C compiler supports __attribute__((deprecated))."
11258 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11262 *) val="$d_attribute_deprecated" ;;
11264 set d_attribute_deprecated
11268 : Look for GCC-style attribute warn_unused_result
11269 case "$d_attribute_warn_unused_result" in
11272 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11273 $cat >attrib.c <<'EOCP'
11275 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11277 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11278 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11279 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11282 echo "Your C compiler supports __attribute__((warn_unused_result))."
11286 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11290 *) val="$d_attribute_warn_unused_result" ;;
11292 set d_attribute_warn_unused_result
11296 : see if getpgrp exists
11297 set getpgrp d_getpgrp
11300 case "$d_getpgrp" in
11303 echo "Checking to see which flavor of getpgrp is in use..."
11305 #$i_unistd I_UNISTD
11306 #include <sys/types.h>
11308 # include <unistd.h>
11310 #$i_stdlib I_STDLIB
11312 #include <stdlib.h>
11316 if (getuid() == 0) {
11317 printf("(I see you are running Configure as super-user...)\n");
11320 #ifdef TRY_BSD_PGRP
11321 if (getpgrp(1) == 0)
11330 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11331 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11333 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11334 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11337 echo "I can't seem to compile and run the test program."
11339 xxx="a USG one, i.e. you use getpgrp()."
11341 # SVR4 systems can appear rather BSD-ish.
11342 case "$i_unistd" in
11344 xxx="a BSD one, i.e. you use getpgrp(pid)."
11348 xxx="probably a USG one, i.e. you use getpgrp()."
11353 echo "Assuming your getpgrp is $xxx" >&4
11362 : see if setpgrp exists
11363 set setpgrp d_setpgrp
11366 case "$d_setpgrp" in
11369 echo "Checking to see which flavor of setpgrp is in use..."
11371 #$i_unistd I_UNISTD
11372 #include <sys/types.h>
11374 # include <unistd.h>
11376 #$i_stdlib I_STDLIB
11378 #include <stdlib.h>
11382 if (getuid() == 0) {
11383 printf("(I see you are running Configure as super-user...)\n");
11386 #ifdef TRY_BSD_PGRP
11387 if (-1 == setpgrp(1, 1))
11390 if (setpgrp() != -1)
11396 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11397 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11399 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11400 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11403 echo "(I can't seem to compile and run the test program.)"
11405 xxx="a USG one, i.e. you use setpgrp()."
11407 # SVR4 systems can appear rather BSD-ish.
11408 case "$i_unistd" in
11410 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11414 xxx="probably a USG one, i.e. you use setpgrp()."
11419 echo "Assuming your setpgrp is $xxx" >&4
11428 : Look for GCC-style __builtin_add_overflow
11429 case "$d_builtin_add_overflow" in
11432 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11433 $cat >try.c <<'EOCP'
11435 const unsigned int uint_max = ~0u;
11436 int target_int = 0;
11437 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11440 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11443 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11450 if eval $compile && $run ./try; then
11451 echo "Your C compiler supports __builtin_add_overflow."
11454 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11458 *) val="$d_builtin_add_overflow" ;;
11461 set d_builtin_add_overflow
11465 : Look for GCC-style __builtin_sub_overflow
11466 case "$d_builtin_sub_overflow" in
11469 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11470 $cat >try.c <<'EOCP'
11472 const unsigned int uint_max = ~0u;
11473 int target_int = 0;
11474 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11477 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11480 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11487 if eval $compile && $run ./try; then
11488 echo "Your C compiler supports __builtin_sub_overflow."
11491 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11495 *) val="$d_builtin_sub_overflow" ;;
11498 set d_builtin_sub_overflow
11502 : Look for GCC-style __builtin_mul_overflow
11503 case "$d_builtin_mul_overflow" in
11506 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11507 $cat >try.c <<'EOCP'
11509 const unsigned int uint_max = ~0u;
11510 int target_int = 0;
11511 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11514 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11517 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11524 if eval $compile && $run ./try; then
11525 echo "Your C compiler supports __builtin_mul_overflow."
11528 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11532 *) val="$d_builtin_mul_overflow" ;;
11535 set d_builtin_mul_overflow
11539 : Look for GCC-style __builtin_choose_expr
11540 case "$d_builtin_choose_expr" in
11543 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11544 $cat >try.c <<'EOCP'
11545 #include <assert.h>
11546 #include <stdlib.h>
11549 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11552 assert( SYRINX(1) == 2112 );
11553 assert( SYRINX(1) != 5150 );
11554 assert( SYRINX(0) == 5150 );
11555 assert( SYRINX(0) != 2112 );
11556 puts( "All good!" );
11562 if eval $compile && $run ./try; then
11563 echo "Your C compiler supports __builtin_choose_expr."
11566 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11570 *) val="$d_builtin_choose_expr" ;;
11573 set d_builtin_choose_expr
11577 : Look for GCC-style __builtin_expect
11578 case "$d_builtin_expect" in
11581 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11582 $cat >try.c <<'EOCP'
11585 if ( __builtin_expect(n, 0) ) n = 1;
11586 /* Remember shell exit code truth is 0, C truth is non-zero */
11591 if eval $compile && $run ./try; then
11592 echo "Your C compiler supports __builtin_expect."
11595 echo "Your C compiler doesn't seem to understand __builtin_expect."
11599 *) val="$d_builtin_expect" ;;
11602 set d_builtin_expect
11606 : see if the Compiler supports C99 variadic macros
11607 echo "Checking for C99 variadic macros." >&4
11610 #include <stdarg.h>
11612 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11616 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11622 if eval $compile && $run ./try 2>&1 >/dev/null; then
11623 case "`$run ./try`" in
11625 echo "You have C99 variadic macros." >&4
11626 d_c99_variadic_macros="$define"
11629 echo "You don't have functional C99 variadic macros." >&4
11630 d_c99_variadic_macros="$undef"
11634 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11635 d_c99_variadic_macros="$undef"
11639 : see if signal is declared as pointer to function returning int or void
11641 xxx=`./findhdr signal.h`
11642 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11643 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11644 echo "You have int (*signal())() instead of void." >&4
11646 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11647 echo "You have void (*signal())()." >&4
11649 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11650 echo "You have int (*signal())() instead of void." >&4
11652 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11653 echo "You have void (*signal())()." >&4
11656 case "$d_voidsig" in
11658 echo "I can't determine whether signal handler returns void or int..." >&4
11660 rp="What type does your signal handler return?"
11663 v*) val="$define";;
11667 echo "As you already told me, signal handler returns void." >&4
11670 *) echo "As you already told me, signal handler returns int." >&4
11677 case "$d_voidsig" in
11678 "$define") signal_t="void";;
11679 *) signal_t="int";;
11683 : check for ability to cast large floats to 32-bit ints.
11685 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11686 if $test "$intsize" -ge 4; then
11693 #$i_stdlib I_STDLIB
11695 #include <stdlib.h>
11697 #include <sys/types.h>
11698 #include <signal.h>
11699 $signal_t blech(int s) { exit(3); }
11706 signal(SIGFPE, blech);
11708 /* Don't let compiler optimize the test away. Store the number
11709 in a writable string for gcc to pass to sscanf under HP-UX.
11711 sprintf(str, "2147483647");
11712 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11716 /* x86 processors will probably give 0x8000 0000, which is a
11717 sign change. We don't want that. We want to mimic SPARC
11718 behavior here, which is to preserve the sign and give
11721 if (i32 != ($xxx) f)
11727 if eval $compile_ok; then
11728 $run ./try 2>/dev/null
11731 echo "(I can't seem to compile the test program--assuming it can't)"
11736 echo "Yup, it can."
11739 echo "Nope, it can't."
11746 : check for ability to cast negative floats to unsigned
11748 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11751 #$i_stdlib I_STDLIB
11753 #include <stdlib.h>
11755 #include <sys/types.h>
11756 #include <signal.h>
11757 $signal_t blech(int s) { exit(7); }
11758 $signal_t blech_in_list(int s) { exit(4); }
11759 unsigned long dummy_long(unsigned long p) { return p; }
11760 unsigned int dummy_int(unsigned int p) { return p; }
11761 unsigned short dummy_short(unsigned short p) { return p; }
11765 unsigned long along;
11767 unsigned short ashort;
11771 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11772 a direct f = -123. assignment. gcc-2.8.0 reportedly
11773 optimized the whole file away
11775 /* Store the number in a writable string for gcc to pass to
11776 sscanf under HP-UX.
11778 sprintf(str, "-123");
11779 sscanf(str, "%lf", &f); /* f = -123.; */
11781 signal(SIGFPE, blech);
11782 along = (unsigned long)f;
11783 aint = (unsigned int)f;
11784 ashort = (unsigned short)f;
11785 if (along != (unsigned long)-123)
11787 if (aint != (unsigned int)-123)
11789 if (ashort != (unsigned short)-123)
11791 sprintf(str, "1073741824.");
11792 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11795 along = (unsigned long)f;
11796 if (along != 0x80000000)
11800 along = (unsigned long)f;
11801 if (along != 0x7fffffff)
11805 along = (unsigned long)f;
11806 if (along != 0x80000001)
11810 signal(SIGFPE, blech_in_list);
11811 sprintf(str, "123.");
11812 sscanf(str, "%lf", &f); /* f = 123.; */
11813 along = dummy_long((unsigned long)f);
11814 aint = dummy_int((unsigned int)f);
11815 ashort = dummy_short((unsigned short)f);
11816 if (along != (unsigned long)123)
11818 if (aint != (unsigned int)123)
11820 if (ashort != (unsigned short)123)
11827 if eval $compile_ok; then
11828 $run ./try 2>/dev/null
11831 echo "(I can't seem to compile the test program--assuming it can't)"
11834 case "$castflags" in
11836 echo "Yup, it can."
11839 echo "Nope, it can't."
11846 : see if cbrt exists
11850 : see if chown exists
11854 : see if chroot exists
11855 set chroot d_chroot
11858 : see if chsize exists
11859 set chsize d_chsize
11862 : see if class exists
11866 : see if clearenv exists
11867 set clearenv d_clearenv
11870 : Define hasstruct macro for Configure internal use
11871 hasstruct='varname=$1; struct=$2; shift; shift;
11872 while $test $# -ge 2; do
11874 $define) echo "#include <$2>";;
11878 echo "int main () { struct $struct foo; }" >> try.c;
11880 if eval $compile; then
11889 : see whether socket exists
11893 $echo $n "Hmm... $c" >&4
11894 if set socket val -f d_socket; eval $csym; $val; then
11895 echo "Looks like you have Berkeley networking support." >&4
11897 if set setsockopt val -f; eval $csym; $val; then
11900 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11901 d_oldsock="$define"
11904 if $contains socklib libc.list >/dev/null 2>&1; then
11905 echo "Looks like you have Berkeley networking support." >&4
11907 : we will have to assume that it supports the 4.2 BSD interface
11910 echo "You don't have Berkeley networking in libc$_a..." >&4
11911 if test "X$d_socket" = "X$define"; then
11912 echo "...but you seem to believe that you have sockets." >&4
11914 for net in net socket
11916 if test -f $sysroot/usr/lib/lib$net$_a; then
11917 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11918 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11919 if $contains socket libc.list >/dev/null 2>&1; then
11924 echo "...but the Wollongong group seems to have hacked it in." >&4
11925 sockethdr="-I$sysroot/usr/netinclude"
11928 echo "Found Berkeley sockets interface in lib$net." >&4
11929 if $contains setsockopt libc.list >/dev/null 2>&1; then
11932 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11933 d_oldsock="$define"
11939 if test "X$d_socket" != "X$define"; then
11940 echo "or anywhere else I see." >&4
11948 : see if socketpair exists
11949 set socketpair d_sockpair
11954 echo "Checking the availability sa_len in the sock struct ..." >&4
11956 #include <sys/types.h>
11957 #include <sys/socket.h>
11959 struct sockaddr sa;
11960 return (sa.sa_len);
11964 set try; if eval $compile; then
11967 set d_sockaddr_sa_len; eval $setvar
11971 echo "Checking the availability struct sockaddr_in6 ..." >&4
11973 #include <sys/types.h>
11974 #include <sys/socket.h>
11975 #include <netinet/in.h>
11977 struct sockaddr_in6 sin6;
11978 return (sin6.sin6_family);
11982 set try; if eval $compile; then
11985 set d_sockaddr_in6; eval $setvar
11989 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11991 #include <sys/types.h>
11992 #include <sys/socket.h>
11993 #include <netinet/in.h>
11995 struct sockaddr_in6 sin6;
11996 return (sin6.sin6_scope_id);
12000 set try; if eval $compile; then
12003 set d_sin6_scope_id; eval $setvar
12007 echo "Checking the availability struct ip_mreq ..." >&4
12009 #include <sys/types.h>
12010 #include <sys/socket.h>
12011 #include <netinet/in.h>
12013 struct ip_mreq mreq;
12014 return (mreq.imr_multiaddr.s_addr);
12018 set try; if eval $compile; then
12021 set d_ip_mreq; eval $setvar
12025 echo "Checking the availability struct ip_mreq_source ..." >&4
12027 #include <sys/types.h>
12028 #include <sys/socket.h>
12029 #include <netinet/in.h>
12031 struct ip_mreq_source mreq;
12032 return (mreq.imr_multiaddr.s_addr);
12036 set try; if eval $compile; then
12039 set d_ip_mreq_source; eval $setvar
12043 echo "Checking the availability struct ipv6_mreq ..." >&4
12045 #include <sys/types.h>
12046 #include <sys/socket.h>
12047 #include <netinet/in.h>
12049 struct ipv6_mreq mreq;
12050 return (mreq.ipv6mr_interface);
12054 set try; if eval $compile; then
12057 set d_ipv6_mreq; eval $setvar
12061 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12063 #include <sys/types.h>
12064 #include <sys/socket.h>
12065 #include <netinet/in.h>
12067 struct ipv6_mreq_source mreq;
12068 return (mreq.imr_multiaddr.s_addr);
12072 set try; if eval $compile; then
12075 set d_ipv6_mreq_source; eval $setvar
12079 echo "Checking the availability of certain socket constants..." >&4
12080 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12081 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12083 #include <sys/types.h>
12084 #include <sys/socket.h>
12090 set try; if eval $compile; then
12093 set d_${enum}; eval $setvar
12097 : see if this is a sys/uio.h system
12098 set sys/uio.h i_sysuio
12101 : Check for cmsghdr support
12103 echo "Checking to see if your system supports struct cmsghdr..." >&4
12104 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12106 case "$d_cmsghdr_s" in
12107 "$define") echo "Yes, it does." ;;
12108 *) echo "No, it doesn't." ;;
12112 : check for const keyword
12114 echo 'Checking to see if your C compiler knows about "const"...' >&4
12115 $cat >const.c <<'EOCP'
12116 typedef struct spug { int drokk; } spug;
12120 const spug y = { 0 };
12123 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12125 echo "Yup, it does."
12128 echo "Nope, it doesn't."
12133 : see if copysign exists
12134 set copysign d_copysign
12137 : see if copysignl exists
12138 set copysignl d_copysignl
12141 : see if crypt exists
12146 $define) cryptlib='' ;;
12147 *) if set crypt val -f d_crypt; eval $csym; $val; then
12148 echo 'crypt() found.' >&4
12152 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12153 if $test -z "$cryptlib"; then
12154 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12158 if $test -z "$cryptlib"; then
12159 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12163 if $test -z "$cryptlib"; then
12164 cryptlib=`./loc libcrypt$_a "" $libpth`
12168 if $test -z "$cryptlib"; then
12169 echo 'crypt() NOT found.' >&4
12180 : see if this is a crypt.h system
12181 set crypt.h i_crypt
12184 : see if crypt_r exists
12185 set crypt_r d_crypt_r
12187 case "$d_crypt_r" in
12189 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12190 case "$d_crypt_r_proto:$usethreads" in
12191 ":define") d_crypt_r_proto=define
12192 set d_crypt_r_proto crypt_r $hdrs
12196 case "$d_crypt_r_proto" in
12198 case "$crypt_r_proto" in
12199 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12200 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12202 case "$crypt_r_proto" in
12203 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12204 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12206 case "$crypt_r_proto" in
12207 ''|0) d_crypt_r=undef
12209 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12210 * ) case "$crypt_r_proto" in
12211 REENTRANT_PROTO*) ;;
12212 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12214 echo "Prototype: $try" ;;
12217 *) case "$usethreads" in
12218 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12229 : get csh whereabouts
12231 'csh') val="$undef" ;;
12232 *) val="$define" ;;
12236 : Respect a hint or command line value for full_csh.
12237 case "$full_csh" in
12238 '') full_csh=$csh ;;
12241 : see if ctermid exists
12242 set ctermid d_ctermid
12245 : see if ctermid_r exists
12246 set ctermid_r d_ctermid_r
12248 case "$d_ctermid_r" in
12250 hdrs="$i_systypes sys/types.h define stdio.h "
12251 case "$d_ctermid_r_proto:$usethreads" in
12252 ":define") d_ctermid_r_proto=define
12253 set d_ctermid_r_proto ctermid_r $hdrs
12257 case "$d_ctermid_r_proto" in
12259 case "$ctermid_r_proto" in
12260 ''|0) try='char* ctermid_r(char*);'
12261 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12263 case "$ctermid_r_proto" in
12264 ''|0) d_ctermid_r=undef
12266 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12267 * ) case "$ctermid_r_proto" in
12268 REENTRANT_PROTO*) ;;
12269 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12271 echo "Prototype: $try" ;;
12274 *) case "$usethreads" in
12275 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12282 *) ctermid_r_proto=0
12286 : see if ctime_r exists
12287 set ctime_r d_ctime_r
12289 case "$d_ctime_r" in
12291 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12292 case "$d_ctime_r_proto:$usethreads" in
12293 ":define") d_ctime_r_proto=define
12294 set d_ctime_r_proto ctime_r $hdrs
12298 case "$d_ctime_r_proto" in
12300 case "$ctime_r_proto" in
12301 ''|0) try='char* ctime_r(const time_t*, char*);'
12302 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12304 case "$ctime_r_proto" in
12305 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12306 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12308 case "$ctime_r_proto" in
12309 ''|0) try='int ctime_r(const time_t*, char*);'
12310 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12312 case "$ctime_r_proto" in
12313 ''|0) try='int ctime_r(const time_t*, char*, int);'
12314 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12316 case "$ctime_r_proto" in
12317 ''|0) d_ctime_r=undef
12319 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12320 * ) case "$ctime_r_proto" in
12321 REENTRANT_PROTO*) ;;
12322 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12324 echo "Prototype: $try" ;;
12327 *) case "$usethreads" in
12328 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12339 : see if cuserid exists
12340 set cuserid d_cuserid
12343 : see if this is a limits.h system
12344 set limits.h i_limits
12347 : See if number of significant digits in a double precision number is known
12349 $cat >dbl_dig.c <<EOM
12350 #$i_limits I_LIMITS
12353 #include <limits.h>
12359 printf("Contains DBL_DIG");
12362 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12363 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12364 echo "DBL_DIG found." >&4
12367 echo "DBL_DIG NOT found." >&4
12374 : see if dbm.h is available
12375 : see if dbmclose exists
12376 set dbmclose d_dbmclose
12379 case "$d_dbmclose" in
12389 *) set rpcsvc/dbm.h i_rpcsvcdbm
12394 *) echo "We won't be including <dbm.h>"
12404 : see if prototype for dbminit is available
12406 set d_dbminitproto dbminit $i_dbm dbm.h
12409 : see if difftime exists
12410 set difftime d_difftime
12413 : see if this is a dirent system
12415 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12417 echo "<dirent.h> found." >&4
12420 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12421 echo "<sys/dir.h> found." >&4
12424 xinc=`./findhdr sys/ndir.h`
12426 echo "<dirent.h> NOT found." >&4
12431 : Look for type of directory structure.
12433 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12435 case "$direntrytype" in
12437 case "$i_dirent" in
12438 $define) guess1='struct dirent' ;;
12439 *) guess1='struct direct' ;;
12442 *) guess1="$direntrytype"
12447 'struct dirent') guess2='struct direct' ;;
12448 *) guess2='struct dirent' ;;
12451 if $contains "$guess1" try.c >/dev/null 2>&1; then
12452 direntrytype="$guess1"
12453 echo "Your directory entries are $direntrytype." >&4
12454 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12455 direntrytype="$guess2"
12456 echo "Your directory entries seem to be $direntrytype." >&4
12458 echo "I don't recognize your system's directory entries." >&4
12459 rp="What type is used for directory entries on this system?"
12462 direntrytype="$ans"
12466 : see if the directory entry stores field length
12468 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12469 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12470 echo "Good, your directory entry keeps length information in d_namlen." >&4
12473 echo "Your directory entry does not know about the d_namlen field." >&4
12480 : Look for DIR.dd_fd
12481 case "$i_dirent" in
12483 echo "Checking to see if DIR has a dd_fd member variable" >&4
12485 #$i_stdlib I_STDLIB
12487 #include <stdlib.h>
12489 #include <dirent.h>
12499 if eval $compile; then
12500 echo "Yes, it does."
12503 echo "No, it does not."
12508 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12516 : see if this is an sysdir system
12517 set sys/dir.h i_sysdir
12520 : see if this is an sysndir system
12521 set sys/ndir.h i_sysndir
12526 $cat >dirfd.c <<EOM
12528 #$i_stdlib I_STDLIB
12530 #include <stdlib.h>
12532 #$i_dirent I_DIRENT /**/
12533 #$i_sysdir I_SYS_DIR /**/
12534 #$i_sysndir I_SYS_NDIR /**/
12535 #$i_systypes I_SYS_TYPES /**/
12536 #if defined(I_SYS_TYPES)
12537 #include <sys/types.h>
12539 #if defined(I_DIRENT)
12540 #include <dirent.h>
12543 #include <sys/ndir.h>
12547 #include <ndir.h> /* may be wrong in the future */
12549 #include <sys/dir.h>
12555 DIR *dirp = opendir(".");
12556 if (dirfd(dirp) >= 0)
12564 if eval $compile; then
12568 $define) echo "dirfd() found." >&4 ;;
12569 *) echo "dirfd() NOT found." >&4 ;;
12575 : see if dladdr exists
12576 set dladdr d_dladdr
12579 : see if dlerror exists
12582 set dlerror d_dlerror
12586 : see if dlfcn is available
12587 set dlfcn.h i_dlfcn
12590 : Check what extension to use for shared libs
12595 On a few systems, the dynamically loaded modules that perl generates and uses
12596 will need a different extension than shared libs. The default will probably
12602 *) dflt="$dlext" ;;
12604 rp='What is the extension of dynamically loaded modules'
12613 : Check if dlsym need a leading underscore
12619 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12620 $cat >dyna.c <<'EOM'
12627 #$i_stdlib I_STDLIB
12629 #include <stdlib.h>
12633 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12635 #include <sys/types.h>
12640 extern int fred() ;
12649 int mode = RTLD_LAZY ;
12651 handle = dlopen("./dyna.$dlext", mode) ;
12652 if (handle == NULL) {
12657 symbol = dlsym(handle, "fred") ;
12658 if (symbol == NULL) {
12659 /* try putting a leading underscore */
12660 symbol = dlsym(handle, "_fred") ;
12661 if (symbol == NULL) {
12674 : Call the object file tmp-dyna.o in case dlext=o.
12675 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12676 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12677 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12678 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12681 1) echo "Test program failed using dlopen." >&4
12682 echo "Perhaps you should not use dynamic loading." >&4;;
12683 2) echo "Test program failed using dlsym." >&4
12684 echo "Perhaps you should not use dynamic loading." >&4;;
12685 3) echo "dlsym needs a leading underscore" >&4
12687 4) echo "dlsym doesn't need a leading underscore." >&4;;
12690 echo "I can't compile and run the test program." >&4
12691 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12696 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12701 : see if drand48_r exists
12702 set drand48_r d_drand48_r
12704 case "$d_drand48_r" in
12706 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12707 case "$d_drand48_r_proto:$usethreads" in
12708 ":define") d_drand48_r_proto=define
12709 set d_drand48_r_proto drand48_r $hdrs
12713 case "$d_drand48_r_proto" in
12715 case "$drand48_r_proto" in
12716 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12717 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12719 case "$drand48_r_proto" in
12720 ''|0) d_drand48_r=undef
12722 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12723 * ) case "$drand48_r_proto" in
12724 REENTRANT_PROTO*) ;;
12725 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12727 echo "Prototype: $try" ;;
12730 *) case "$usethreads" in
12731 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12738 *) drand48_r_proto=0
12742 : see if prototype for drand48 is available
12744 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12747 : see if dup2 exists
12751 : see if eaccess exists
12752 set eaccess d_eaccess
12755 : see if endgrent exists
12756 set endgrent d_endgrent
12759 : see if this is an grp system
12765 xxx=`./findhdr grp.h`
12766 $cppstdin $cppflags $cppminus < $xxx >$$.h
12768 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12780 set d_grpasswd; eval $setvar
12784 : see if endgrent_r exists
12785 set endgrent_r d_endgrent_r
12787 case "$d_endgrent_r" in
12789 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12790 case "$d_endgrent_r_proto:$usethreads" in
12791 ":define") d_endgrent_r_proto=define
12792 set d_endgrent_r_proto endgrent_r $hdrs
12796 case "$d_endgrent_r_proto" in
12798 case "$endgrent_r_proto" in
12799 ''|0) try='int endgrent_r(FILE**);'
12800 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12802 case "$endgrent_r_proto" in
12803 ''|0) try='void endgrent_r(FILE**);'
12804 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12806 case "$endgrent_r_proto" in
12807 ''|0) d_endgrent_r=undef
12809 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12810 * ) case "$endgrent_r_proto" in
12811 REENTRANT_PROTO*) ;;
12812 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12814 echo "Prototype: $try" ;;
12817 *) case "$usethreads" in
12818 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12825 *) endgrent_r_proto=0
12829 : see if endhostent exists
12830 set endhostent d_endhent
12833 : see if this is a netdb.h system
12834 set netdb.h i_netdb
12837 : see if endhostent_r exists
12838 set endhostent_r d_endhostent_r
12840 case "$d_endhostent_r" in
12842 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12843 case "$d_endhostent_r_proto:$usethreads" in
12844 ":define") d_endhostent_r_proto=define
12845 set d_endhostent_r_proto endhostent_r $hdrs
12849 case "$d_endhostent_r_proto" in
12851 case "$endhostent_r_proto" in
12852 ''|0) try='int endhostent_r(struct hostent_data*);'
12853 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12855 case "$endhostent_r_proto" in
12856 ''|0) try='void endhostent_r(struct hostent_data*);'
12857 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12859 case "$endhostent_r_proto" in
12860 ''|0) d_endhostent_r=undef
12861 endhostent_r_proto=0
12862 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12863 * ) case "$endhostent_r_proto" in
12864 REENTRANT_PROTO*) ;;
12865 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12867 echo "Prototype: $try" ;;
12870 *) case "$usethreads" in
12871 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12873 d_endhostent_r=undef
12874 endhostent_r_proto=0
12878 *) endhostent_r_proto=0
12882 : see if endnetent exists
12883 set endnetent d_endnent
12886 : see if endnetent_r exists
12887 set endnetent_r d_endnetent_r
12889 case "$d_endnetent_r" in
12891 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12892 case "$d_endnetent_r_proto:$usethreads" in
12893 ":define") d_endnetent_r_proto=define
12894 set d_endnetent_r_proto endnetent_r $hdrs
12898 case "$d_endnetent_r_proto" in
12900 case "$endnetent_r_proto" in
12901 ''|0) try='int endnetent_r(struct netent_data*);'
12902 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12904 case "$endnetent_r_proto" in
12905 ''|0) try='void endnetent_r(struct netent_data*);'
12906 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12908 case "$endnetent_r_proto" in
12909 ''|0) d_endnetent_r=undef
12910 endnetent_r_proto=0
12911 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12912 * ) case "$endnetent_r_proto" in
12913 REENTRANT_PROTO*) ;;
12914 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12916 echo "Prototype: $try" ;;
12919 *) case "$usethreads" in
12920 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12922 d_endnetent_r=undef
12923 endnetent_r_proto=0
12927 *) endnetent_r_proto=0
12931 : see if endprotoent exists
12932 set endprotoent d_endpent
12935 : see if endprotoent_r exists
12936 set endprotoent_r d_endprotoent_r
12938 case "$d_endprotoent_r" in
12940 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12941 case "$d_endprotoent_r_proto:$usethreads" in
12942 ":define") d_endprotoent_r_proto=define
12943 set d_endprotoent_r_proto endprotoent_r $hdrs
12947 case "$d_endprotoent_r_proto" in
12949 case "$endprotoent_r_proto" in
12950 ''|0) try='int endprotoent_r(struct protoent_data*);'
12951 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12953 case "$endprotoent_r_proto" in
12954 ''|0) try='void endprotoent_r(struct protoent_data*);'
12955 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12957 case "$endprotoent_r_proto" in
12958 ''|0) d_endprotoent_r=undef
12959 endprotoent_r_proto=0
12960 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12961 * ) case "$endprotoent_r_proto" in
12962 REENTRANT_PROTO*) ;;
12963 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12965 echo "Prototype: $try" ;;
12968 *) case "$usethreads" in
12969 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12971 d_endprotoent_r=undef
12972 endprotoent_r_proto=0
12976 *) endprotoent_r_proto=0
12980 : see if endpwent exists
12981 set endpwent d_endpwent
12984 : see if this is a pwd.h system
12990 xxx=`./findhdr pwd.h`
12991 $cppstdin $cppflags $cppminus < $xxx >$$.h
12993 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13001 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13009 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13017 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13025 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13033 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13041 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13049 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13061 set d_pwquota; eval $setvar
13062 set d_pwage; eval $setvar
13063 set d_pwchange; eval $setvar
13064 set d_pwclass; eval $setvar
13065 set d_pwexpire; eval $setvar
13066 set d_pwcomment; eval $setvar
13067 set d_pwgecos; eval $setvar
13068 set d_pwpasswd; eval $setvar
13072 : see if endpwent_r exists
13073 set endpwent_r d_endpwent_r
13075 case "$d_endpwent_r" in
13077 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13078 case "$d_endpwent_r_proto:$usethreads" in
13079 ":define") d_endpwent_r_proto=define
13080 set d_endpwent_r_proto endpwent_r $hdrs
13084 case "$d_endpwent_r_proto" in
13086 case "$endpwent_r_proto" in
13087 ''|0) try='int endpwent_r(FILE**);'
13088 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13090 case "$endpwent_r_proto" in
13091 ''|0) try='void endpwent_r(FILE**);'
13092 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13094 case "$endpwent_r_proto" in
13095 ''|0) d_endpwent_r=undef
13097 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13098 * ) case "$endpwent_r_proto" in
13099 REENTRANT_PROTO*) ;;
13100 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13102 echo "Prototype: $try" ;;
13105 *) case "$usethreads" in
13106 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13113 *) endpwent_r_proto=0
13117 : see if endservent exists
13118 set endservent d_endsent
13121 : see if endservent_r exists
13122 set endservent_r d_endservent_r
13124 case "$d_endservent_r" in
13126 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13127 case "$d_endservent_r_proto:$usethreads" in
13128 ":define") d_endservent_r_proto=define
13129 set d_endservent_r_proto endservent_r $hdrs
13133 case "$d_endservent_r_proto" in
13135 case "$endservent_r_proto" in
13136 ''|0) try='int endservent_r(struct servent_data*);'
13137 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13139 case "$endservent_r_proto" in
13140 ''|0) try='void endservent_r(struct servent_data*);'
13141 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13143 case "$endservent_r_proto" in
13144 ''|0) d_endservent_r=undef
13145 endservent_r_proto=0
13146 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13147 * ) case "$endservent_r_proto" in
13148 REENTRANT_PROTO*) ;;
13149 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13151 echo "Prototype: $try" ;;
13154 *) case "$usethreads" in
13155 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13157 d_endservent_r=undef
13158 endservent_r_proto=0
13162 *) endservent_r_proto=0
13166 : Locate the flags for 'open()'
13169 #include <sys/types.h>
13174 #include <sys/file.h>
13176 #$i_stdlib I_STDLIB
13178 #include <stdlib.h>
13189 : check sys/file.h first to get FREAD on Sun
13190 if $test `./findhdr sys/file.h` && \
13191 set try -DI_SYS_FILE && eval $compile; then
13193 echo "<sys/file.h> defines the O_* constants..." >&4
13194 if $run ./try; then
13195 echo "and you have the 3 argument form of open()." >&4
13198 echo "but not the 3 argument form of open(). Oh, well." >&4
13201 elif $test `./findhdr fcntl.h` && \
13202 set try -DI_FCNTL && eval $compile; then
13204 echo "<fcntl.h> defines the O_* constants..." >&4
13205 if $run ./try; then
13206 echo "and you have the 3 argument form of open()." >&4
13209 echo "but not the 3 argument form of open(). Oh, well." >&4
13214 echo "I can't find the O_* constant definitions! You got problems." >&4
13220 : see if this is a sys/file.h system
13225 : do we need to include sys/file.h ?
13229 if $h_sysfile; then
13231 echo "We'll be including <sys/file.h>." >&4
13234 echo "We won't be including <sys/file.h>." >&4
13244 : see if fcntl.h is there
13249 : see if we can include fcntl.h
13255 echo "We'll be including <fcntl.h>." >&4
13258 if $h_sysfile; then
13259 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13261 echo "We won't be including <fcntl.h>." >&4
13273 : see if fork exists
13277 : see if pipe exists
13281 : check for non-blocking I/O stuff
13282 case "$h_sysfile" in
13283 true) echo "#include <sys/file.h>" > head.c;;
13286 true) echo "#include <fcntl.h>" > head.c;;
13287 *) echo "#include <sys/fcntl.h>" > head.c;;
13292 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13293 case "$o_nonblock" in
13295 $cat head.c > try.c
13296 $cat >>try.c <<EOCP
13298 #$i_stdlib I_STDLIB
13300 #include <stdlib.h>
13308 printf("O_NONBLOCK\n");
13312 printf("O_NDELAY\n");
13316 printf("FNDELAY\n");
13323 if eval $compile_ok; then
13324 o_nonblock=`$run ./try`
13325 case "$o_nonblock" in
13326 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13327 *) echo "Seems like we can use $o_nonblock.";;
13330 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13333 *) echo "Using $hint value $o_nonblock.";;
13338 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13341 case "$d_fork:$d_pipe:$d_alarm" in
13342 define:define:define)
13343 $cat head.c > try.c
13344 $cat >>try.c <<EOCP
13346 #include <sys/types.h>
13347 #include <signal.h>
13349 #$i_stdlib I_STDLIB
13351 #include <stdlib.h>
13357 #define MY_O_NONBLOCK $o_nonblock
13358 #ifndef errno /* XXX need better Configure test */
13361 #$i_unistd I_UNISTD
13363 #include <unistd.h>
13365 #$i_string I_STRING
13367 #include <string.h>
13369 #include <strings.h>
13371 $signal_t blech(int x) { exit(3); }
13373 $cat >> try.c <<'EOCP'
13382 ret = pipe(pd); /* Down: child -> parent */
13385 ret = pipe(pu); /* Up: parent -> child */
13389 close(pd[1]); /* Parent reads from pd[0] */
13390 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13392 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13397 signal(SIGALRM, blech);
13399 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13401 sprintf(string, "%d\n", ret);
13402 ret = write(2, string, strlen(string));
13403 if (ret != strlen(string))
13407 if (errno == EAGAIN) {
13408 printf("EAGAIN\n");
13413 if (errno == EWOULDBLOCK)
13414 printf("EWOULDBLOCK\n");
13417 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13420 sleep(2); /* Give it time to close our pipe */
13422 ret = read(pd[0], buf, 1); /* Should read EOF */
13424 sprintf(string, "%d\n", ret);
13425 ret = write(4, string, strlen(string));
13426 if (ret != strlen(string))
13431 close(pd[0]); /* We write to pd[1] */
13432 close(pu[1]); /* We read from pu[0] */
13433 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13436 close(pd[1]); /* Pipe pd is now fully closed! */
13437 exit(0); /* Bye bye, thank you for playing! */
13441 if eval $compile_ok; then
13442 echo "$startsh" >mtry
13443 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13445 $run ./mtry >/dev/null 2>&1
13447 0) eagain=`$cat try.out`;;
13448 1) echo "Could not perform non-blocking setting!";;
13449 2) echo "I did a successful read() for something that was not there!";;
13450 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13451 4) echo "Could not find F_SETFL!";;
13452 *) echo "Something terribly wrong happened during testing.";;
13454 rd_nodata=`$cat try.ret`
13455 echo "A read() system call with no data present returns $rd_nodata."
13456 case "$rd_nodata" in
13459 echo "(That's peculiar, fixing that to be -1.)"
13465 echo "Forcing errno EAGAIN on read() with no data available."
13469 echo "Your read() sets errno to $eagain when no data is available."
13472 status=`$cat try.err`
13474 0) echo "And it correctly returns 0 to signal EOF.";;
13475 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13476 *) echo "However, your read() returns '$status' on EOF??";;
13479 if test "$status" = "$rd_nodata"; then
13480 echo "WARNING: you can't distinguish between EOF and no data!"
13484 echo "I can't compile the test program--assuming errno EAGAIN will do."
13488 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13497 echo "Using $hint value $eagain."
13498 echo "Your read() returns $rd_nodata when no data is present."
13499 case "$d_eofnblk" in
13500 "$define") echo "And you can see EOF because read() returns 0.";;
13501 "$undef") echo "But you can't see EOF status from read() returned value.";;
13503 echo "(Assuming you can't see EOF status from read anyway.)"
13509 $rm_try head.c mtry
13511 : see if erf exists
13515 : see if erfc exists
13519 : see if exp2 exists
13523 : see if expm1 exists
13527 : see if _ptr and _cnt from stdio act std
13530 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13531 echo "(Looks like you have stdio.h from BSD.)"
13532 case "$stdio_ptr" in
13533 '') stdio_ptr='((fp)->_p)'
13536 *) ptr_lval=$d_stdio_ptr_lval;;
13538 case "$stdio_cnt" in
13539 '') stdio_cnt='((fp)->_r)'
13542 *) cnt_lval=$d_stdio_cnt_lval;;
13544 case "$stdio_base" in
13545 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13547 case "$stdio_bufsiz" in
13548 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13550 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13551 echo "(Looks like you have stdio.h from Linux.)"
13552 case "$stdio_ptr" in
13553 '') stdio_ptr='((fp)->_IO_read_ptr)'
13556 *) ptr_lval=$d_stdio_ptr_lval;;
13558 case "$stdio_cnt" in
13559 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13562 *) cnt_lval=$d_stdio_cnt_lval;;
13564 case "$stdio_base" in
13565 '') stdio_base='((fp)->_IO_read_base)';;
13567 case "$stdio_bufsiz" in
13568 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13571 case "$stdio_ptr" in
13572 '') stdio_ptr='((fp)->_ptr)'
13575 *) ptr_lval=$d_stdio_ptr_lval;;
13577 case "$stdio_cnt" in
13578 '') stdio_cnt='((fp)->_cnt)'
13581 *) cnt_lval=$d_stdio_cnt_lval;;
13583 case "$stdio_base" in
13584 '') stdio_base='((fp)->_base)';;
13586 case "$stdio_bufsiz" in
13587 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13591 : test whether _ptr and _cnt really work
13592 echo "Checking how std your stdio is..." >&4
13595 #$i_stdlib I_STDLIB
13597 #include <stdlib.h>
13599 #define FILE_ptr(fp) $stdio_ptr
13600 #define FILE_cnt(fp) $stdio_cnt
13602 FILE *fp = fopen("try.c", "r");
13605 18 <= FILE_cnt(fp) &&
13606 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13614 if eval $compile && $to try.c; then
13615 if $run ./try; then
13616 echo "Your stdio acts pretty std."
13619 echo "Your stdio isn't very std."
13622 echo "Your stdio doesn't appear very std."
13626 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13627 # direct buffer manipulation no longer works. The Configure tests
13628 # should be changed to correctly detect this, but until then,
13629 # the following check should at least let perl compile and run.
13630 # (This quick fix should be updated before 5.8.1.)
13631 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13632 # A. Dougherty, June 3, 2002.
13633 case "$d_gnulibc" in
13635 case "$gnulibc_version" in
13639 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13648 : Can _ptr be used as an lvalue?
13649 case "$d_stdstdio$ptr_lval" in
13650 $define$define) val=$define ;;
13653 set d_stdio_ptr_lval
13656 : Can _cnt be used as an lvalue?
13657 case "$d_stdstdio$cnt_lval" in
13658 $define$define) val=$define ;;
13661 set d_stdio_cnt_lval
13665 : test whether setting _ptr sets _cnt as a side effect
13666 d_stdio_ptr_lval_sets_cnt="$undef"
13667 d_stdio_ptr_lval_nochange_cnt="$undef"
13668 case "$d_stdio_ptr_lval$d_stdstdio" in
13670 echo "Checking to see what happens if we set the stdio ptr..." >&4
13673 /* Can we scream? */
13674 /* Eat dust sed :-) */
13675 /* In the buffer space, no one can hear you scream. */
13676 #$i_stdlib I_STDLIB
13678 #include <stdlib.h>
13680 #define FILE_ptr(fp) $stdio_ptr
13681 #define FILE_cnt(fp) $stdio_cnt
13682 #include <sys/types.h>
13684 FILE *fp = fopen("try.c", "r");
13689 puts("Fail even to read");
13692 c = getc(fp); /* Read away the first # */
13694 puts("Fail even to read");
13698 18 <= FILE_cnt(fp) &&
13699 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13701 puts("Fail even to read");
13704 ptr = (char*) FILE_ptr(fp);
13705 cnt = (size_t)FILE_cnt(fp);
13707 FILE_ptr(fp) += 42;
13709 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13710 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13713 if (FILE_cnt(fp) <= 20) {
13714 printf ("Fail (<20 chars to test)");
13717 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13718 puts("Fail compare");
13721 if (cnt == FILE_cnt(fp)) {
13722 puts("Pass_unchanged");
13725 if (FILE_cnt(fp) == (cnt - 42)) {
13726 puts("Pass_changed");
13729 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13735 if eval $compile && $to try.c; then
13736 case `$run ./try` in
13738 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13739 d_stdio_ptr_lval_sets_cnt="$define" ;;
13741 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13742 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13744 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13746 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13749 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13755 : see if _base is also standard
13757 case "$d_stdstdio" in
13761 #$i_stdlib I_STDLIB
13763 #include <stdlib.h>
13765 #define FILE_base(fp) $stdio_base
13766 #define FILE_bufsiz(fp) $stdio_bufsiz
13768 FILE *fp = fopen("try.c", "r");
13771 19 <= FILE_bufsiz(fp) &&
13772 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13779 if eval $compile && $to try.c; then
13780 if $run ./try; then
13781 echo "And its _base field acts std."
13784 echo "But its _base field isn't std."
13787 echo "However, it seems to be lacking the _base field."
13795 : see if fast_stdio exists
13797 case "$d_stdstdio:$d_stdio_ptr_lval" in
13799 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13801 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13812 : see if fchdir exists
13813 set fchdir d_fchdir
13816 : see if fchmod exists
13817 set fchmod d_fchmod
13820 : check for openat, unlinkat, renameat, linkat, fchmodat
13821 set openat d_openat
13824 set unlinkat d_unlinkat
13827 set renameat d_renameat
13830 set linkat d_linkat
13833 set fchmodat d_fchmodat
13836 : see if fchown exists
13837 set fchown d_fchown
13840 : see if this is an fcntl system
13844 : See if fcntl-based locking works.
13847 #$i_stdlib I_STDLIB
13849 #include <stdlib.h>
13851 #include <unistd.h>
13853 #include <signal.h>
13854 $signal_t blech(int x) { exit(3); }
13856 #if defined(F_SETLK) && defined(F_SETLKW)
13857 struct flock flock;
13859 fd = open("try.c", O_RDONLY);
13860 flock.l_type = F_RDLCK;
13861 flock.l_whence = SEEK_SET;
13862 flock.l_start = flock.l_len = 0;
13863 signal(SIGALRM, blech);
13865 retval = fcntl(fd, F_SETLK, &flock);
13867 (retval < 0 ? exit(2) : exit(0));
13873 echo "Checking if fcntl-based file locking works... "
13877 if eval $compile_ok; then
13878 if $run ./try; then
13879 echo "Yes, it seems to work."
13882 echo "Nope, it didn't work."
13887 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13888 *** This is (almost) impossible.
13889 *** If your NFS lock daemons are not feeling well, something like
13890 *** this may happen, please investigate. Cannot continue, aborting.
13898 echo "I'm unable to compile the test program, so I'll assume not."
13903 echo "Nope, since you don't even have fcntl()."
13906 set d_fcntl_can_lock
13910 : check for fd_set items
13913 Checking to see how well your C compiler handles fd_set and friends ...
13916 #$i_stdlib I_STDLIB
13918 #include <stdlib.h>
13920 #$i_systime I_SYS_TIME
13921 #$i_sysselct I_SYS_SELECT
13922 #$d_socket HAS_SOCKET
13923 #include <sys/types.h>
13925 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13928 #include <sys/time.h>
13930 #ifdef I_SYS_SELECT
13931 #include <sys/select.h>
13940 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13948 if eval $compile; then
13949 d_fds_bits="$define"
13951 echo "Well, your system knows about the normal fd_set typedef..." >&4
13952 if $run ./try; then
13953 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13954 d_fd_macros="$define"
13957 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13959 d_fd_macros="$undef"
13963 Hmm, your compiler has some difficulty with fd_set. Checking further...
13966 if eval $compile; then
13967 d_fds_bits="$undef"
13969 echo "Well, your system has some sort of fd_set available..." >&4
13970 if $run ./try; then
13971 echo "and you have the normal fd_set macros." >&4
13972 d_fd_macros="$define"
13975 but not the normal fd_set macros! Gross! More work for me...
13977 d_fd_macros="$undef"
13980 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13982 d_fds_bits="$undef"
13983 d_fd_macros="$undef"
13988 : see if fdclose exists
13989 set fdclose d_fdclose
13992 : see if fdim exists
13996 : see if fegetround exists
13997 set fegetround d_fegetround
14000 : see if fgetpos exists
14001 set fgetpos d_fgetpos
14004 : see if finite exists
14005 set finite d_finite
14008 : see if finitel exists
14009 set finitel d_finitel
14012 : see if flock exists
14016 : see if prototype for flock is available
14018 set d_flockproto flock $i_sysfile sys/file.h
14021 : see if fma exists
14025 : see if fmax exists
14029 : see if fmin exists
14033 : see if fp_class exists
14034 set fp_class d_fp_class
14037 : see if this is a math.h system
14041 : check for fpclassify
14042 echo "Checking to see if you have fpclassify..." >&4
14048 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14051 if eval $compile; then
14053 echo "You have fpclassify."
14056 echo "You do not have fpclassify."
14062 : see if fp_classify exists
14063 set fp_classify d_fp_classify
14066 : see if fp_classl exists
14067 set fp_classl d_fp_classl
14070 : see if pathconf exists
14071 set pathconf d_pathconf
14074 : see if fpathconf exists
14075 set fpathconf d_fpathconf
14078 : see if fpclass exists
14079 set fpclass d_fpclass
14082 : see if fpclassl exists
14083 set fpclassl d_fpclassl
14086 : see if fpgetround exists
14087 set fpgetround d_fpgetround
14090 : check for fpos64_t
14092 echo "Checking to see if you have fpos64_t..." >&4
14095 int main() { fpos64_t x = 7; }
14098 if eval $compile; then
14100 echo "You have fpos64_t."
14103 echo "You do not have fpos64_t."
14104 case "$fpossize" in
14105 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14112 : see if this is an xlocale.h system
14113 set xlocale.h i_xlocale
14116 : see if newlocale exists
14117 set newlocale d_newlocale
14120 : see if freelocale exists
14121 set freelocale d_freelocale
14124 : see if uselocale exists
14125 set uselocale d_uselocale
14128 : see if duplocale exists
14129 set duplocale d_duplocale
14132 : see if querylocale exists
14133 set querylocale d_querylocale
14136 : see if frexpl exists
14137 set frexpl d_frexpl
14140 : see if this is a sys/param system
14141 set sys/param.h i_sysparam
14144 : see if this is a sys/mount.h system
14145 set sys/mount.h i_sysmount
14148 : Check for fs_data_s
14150 echo "Checking to see if your system supports struct fs_data..." >&4
14151 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14153 case "$d_fs_data_s" in
14154 "$define") echo "Yes, it does." ;;
14155 *) echo "No, it doesn't." ;;
14158 : see if fseeko exists
14159 set fseeko d_fseeko
14161 case "$longsize" in
14162 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14165 : see if fsetpos exists
14166 set fsetpos d_fsetpos
14169 : see if fstatfs exists
14170 set fstatfs d_fstatfs
14173 : see if statvfs exists
14174 set statvfs d_statvfs
14177 : see if fstatvfs exists
14178 set fstatvfs d_fstatvfs
14182 : see if fsync exists
14186 : see if ftello exists
14187 set ftello d_ftello
14189 case "$longsize" in
14190 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14193 : check for a working futimes
14196 echo "Checking if you have a working futimes()" >&4
14199 #include <sys/time.h>
14206 fd = open ("try.c", O_RDWR);
14207 if (-1 == fd) exit (1);
14208 rv = futimes (fd, NULL);
14209 exit (rv == -1 ? errno : 0);
14213 if eval $compile; then
14217 0) echo "Yes, you have" >&4
14218 d_futimes="$define"
14220 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14224 echo "No, it does not (probably harmless)" >&4
14228 : look for gai_strerror
14230 $cat >try.c <<'EOCP'
14231 #include <sys/types.h>
14232 #include <sys/socket.h>
14236 return (gai_strerror (0) ? 0 : 1);
14241 if eval $compile; then
14244 0) echo "A working gai_strerror() found." >&4
14246 *) echo "gai_strerror() found, but it doesn't work" >&4
14250 echo "gai_strerror() NOT found." >&4
14256 : see if ndbm.h is available
14259 : Compatibility location for RedHat 7.1
14260 set gdbm/ndbm.h i_gdbmndbm
14262 : Compatibility location for Debian 4.0
14263 set gdbm-ndbm.h i_gdbm_ndbm
14267 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14268 : see if dbm_open exists
14269 set dbm_open d_dbm_open
14271 case "$d_dbm_open" in
14274 i_gdbmndbm="$undef"
14275 i_gdbm_ndbm="$undef"
14276 echo "We won't be including <ndbm.h>"
14286 ndbm_hdr_protochk='name=$1; hdr=$2;
14287 eval "ihdr=\$""i_$name";
14289 if $test "$ihdr" = "$define"; then
14290 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14291 case "$d_cplusplus" in
14292 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14293 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14296 $define) $echo "Your <$hdr> seems to have prototypes";;
14297 *) $echo "Your <$hdr> does not seem to have prototypes";;
14300 set "d_${name}_h_uses_prototypes";
14304 eval $ndbm_hdr_protochk
14305 set gdbmndbm gdbm/ndbm.h
14306 eval $ndbm_hdr_protochk
14307 set gdbm_ndbm gdbm-ndbm.h
14308 eval $ndbm_hdr_protochk
14310 : see if getaddrinfo exists
14311 set getaddrinfo d_getaddrinfo
14314 : see if getcwd exists
14315 set getcwd d_getcwd
14318 : see if getespwnam exists
14319 set getespwnam d_getespwnam
14322 : see if getfsstat exists
14323 set getfsstat d_getfsstat
14326 : see if getgrent exists
14327 set getgrent d_getgrent
14330 : see if getgrent_r exists
14331 set getgrent_r d_getgrent_r
14333 case "$d_getgrent_r" in
14335 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14336 case "$d_getgrent_r_proto:$usethreads" in
14337 ":define") d_getgrent_r_proto=define
14338 set d_getgrent_r_proto getgrent_r $hdrs
14342 case "$d_getgrent_r_proto" in
14344 case "$getgrent_r_proto" in
14345 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14346 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14348 case "$getgrent_r_proto" in
14349 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14350 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14352 case "$getgrent_r_proto" in
14353 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14354 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14356 case "$getgrent_r_proto" in
14357 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14358 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14360 case "$getgrent_r_proto" in
14361 ''|0) try='int getgrent_r(struct group*, char*, int);'
14362 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14364 case "$getgrent_r_proto" in
14365 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14366 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14368 case "$getgrent_r_proto" in
14369 ''|0) d_getgrent_r=undef
14371 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14372 * ) case "$getgrent_r_proto" in
14373 REENTRANT_PROTO*) ;;
14374 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14376 echo "Prototype: $try" ;;
14379 *) case "$usethreads" in
14380 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14387 *) getgrent_r_proto=0
14391 : see if getgrgid_r exists
14392 set getgrgid_r d_getgrgid_r
14394 case "$d_getgrgid_r" in
14396 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14397 case "$d_getgrgid_r_proto:$usethreads" in
14398 ":define") d_getgrgid_r_proto=define
14399 set d_getgrgid_r_proto getgrgid_r $hdrs
14403 case "$d_getgrgid_r_proto" in
14405 case "$getgrgid_r_proto" in
14406 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14407 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14409 case "$getgrgid_r_proto" in
14410 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14411 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14413 case "$getgrgid_r_proto" in
14414 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14415 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14417 case "$getgrgid_r_proto" in
14418 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14419 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14421 case "$getgrgid_r_proto" in
14422 ''|0) d_getgrgid_r=undef
14424 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14425 * ) case "$getgrgid_r_proto" in
14426 REENTRANT_PROTO*) ;;
14427 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14429 echo "Prototype: $try" ;;
14432 *) case "$usethreads" in
14433 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14440 *) getgrgid_r_proto=0
14444 : see if getgrnam_r exists
14445 set getgrnam_r d_getgrnam_r
14447 case "$d_getgrnam_r" in
14449 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14450 case "$d_getgrnam_r_proto:$usethreads" in
14451 ":define") d_getgrnam_r_proto=define
14452 set d_getgrnam_r_proto getgrnam_r $hdrs
14456 case "$d_getgrnam_r_proto" in
14458 case "$getgrnam_r_proto" in
14459 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14460 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14462 case "$getgrnam_r_proto" in
14463 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14464 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14466 case "$getgrnam_r_proto" in
14467 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14468 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14470 case "$getgrnam_r_proto" in
14471 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14472 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14474 case "$getgrnam_r_proto" in
14475 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14476 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14478 case "$getgrnam_r_proto" in
14479 ''|0) d_getgrnam_r=undef
14481 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14482 * ) case "$getgrnam_r_proto" in
14483 REENTRANT_PROTO*) ;;
14484 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14486 echo "Prototype: $try" ;;
14489 *) case "$usethreads" in
14490 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14497 *) getgrnam_r_proto=0
14501 : see if gethostbyaddr exists
14502 set gethostbyaddr d_gethbyaddr
14505 : see if gethostbyname exists
14506 set gethostbyname d_gethbyname
14509 : see if gethostent exists
14510 set gethostent d_gethent
14513 : see how we will look up host name
14516 if set gethostname val -f d_gethname; eval $csym; $val; then
14517 echo 'gethostname() found.' >&4
14518 d_gethname="$define"
14521 if set uname val -f d_uname; eval $csym; $val; then
14524 uname() was found, but you're running xenix, and older versions of xenix
14525 have a broken uname(). If you don't really know whether your xenix is old
14526 enough to have a broken system call, use the default answer.
14531 "$define") dflt=n;;
14533 rp='Is your uname() broken?'
14536 n*) d_uname="$define"; call=uname;;
14539 echo 'uname() found.' >&4
14546 case "$d_gethname" in
14547 '') d_gethname="$undef";;
14550 '') d_uname="$undef";;
14552 case "$d_uname$d_gethname" in
14557 Every now and then someone has a $call() that lies about the hostname
14558 but can't be fixed for political or economic reasons. If you wish, I can
14559 pretend $call() isn't there and maybe compute hostname at run-time
14560 thanks to the '$phostname' command.
14563 rp="Shall I ignore $call() from now on?"
14566 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14569 case "$phostname" in
14570 '') aphostname='';;
14571 *) case "$aphostname" in
14573 *) set X $phostname
14577 file=`./loc $file $file $pth`
14578 aphostname=`echo $file $*`
14583 case "$d_uname$d_gethname" in
14586 case "$phostname" in
14588 echo "There will be no way for $package to get your hostname." >&4;;
14590 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14594 case "$d_phostname" in
14595 '') d_phostname="$undef";;
14598 : see if gethostbyaddr_r exists
14599 set gethostbyaddr_r d_gethostbyaddr_r
14601 case "$d_gethostbyaddr_r" in
14603 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14604 case "$d_gethostbyaddr_r_proto:$usethreads" in
14605 ":define") d_gethostbyaddr_r_proto=define
14606 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14610 case "$d_gethostbyaddr_r_proto" in
14612 case "$gethostbyaddr_r_proto" in
14613 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14614 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14616 case "$gethostbyaddr_r_proto" in
14617 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14618 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14620 case "$gethostbyaddr_r_proto" in
14621 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14622 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14624 case "$gethostbyaddr_r_proto" in
14625 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14626 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14628 case "$gethostbyaddr_r_proto" in
14629 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14630 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14632 case "$gethostbyaddr_r_proto" in
14633 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14634 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14636 case "$gethostbyaddr_r_proto" in
14637 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14638 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14640 case "$gethostbyaddr_r_proto" in
14641 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14642 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14644 case "$gethostbyaddr_r_proto" in
14645 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14646 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14648 case "$gethostbyaddr_r_proto" in
14649 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14650 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14652 case "$gethostbyaddr_r_proto" in
14653 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14654 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14656 case "$gethostbyaddr_r_proto" in
14657 ''|0) d_gethostbyaddr_r=undef
14658 gethostbyaddr_r_proto=0
14659 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14660 * ) case "$gethostbyaddr_r_proto" in
14661 REENTRANT_PROTO*) ;;
14662 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14664 echo "Prototype: $try" ;;
14667 *) case "$usethreads" in
14668 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14670 d_gethostbyaddr_r=undef
14671 gethostbyaddr_r_proto=0
14675 *) gethostbyaddr_r_proto=0
14679 : see if gethostbyname_r exists
14680 set gethostbyname_r d_gethostbyname_r
14682 case "$d_gethostbyname_r" in
14684 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14685 case "$d_gethostbyname_r_proto:$usethreads" in
14686 ":define") d_gethostbyname_r_proto=define
14687 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14691 case "$d_gethostbyname_r_proto" in
14693 case "$gethostbyname_r_proto" in
14694 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14695 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14697 case "$gethostbyname_r_proto" in
14698 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14699 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14701 case "$gethostbyname_r_proto" in
14702 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14703 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14705 case "$gethostbyname_r_proto" in
14706 ''|0) d_gethostbyname_r=undef
14707 gethostbyname_r_proto=0
14708 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14709 * ) case "$gethostbyname_r_proto" in
14710 REENTRANT_PROTO*) ;;
14711 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14713 echo "Prototype: $try" ;;
14716 *) case "$usethreads" in
14717 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14719 d_gethostbyname_r=undef
14720 gethostbyname_r_proto=0
14724 *) gethostbyname_r_proto=0
14728 : see if gethostent_r exists
14729 set gethostent_r d_gethostent_r
14731 case "$d_gethostent_r" in
14733 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14734 case "$d_gethostent_r_proto:$usethreads" in
14735 ":define") d_gethostent_r_proto=define
14736 set d_gethostent_r_proto gethostent_r $hdrs
14740 case "$d_gethostent_r_proto" in
14742 case "$gethostent_r_proto" in
14743 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14744 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14746 case "$gethostent_r_proto" in
14747 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14748 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14750 case "$gethostent_r_proto" in
14751 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14752 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14754 case "$gethostent_r_proto" in
14755 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14756 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14758 case "$gethostent_r_proto" in
14759 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14760 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14762 case "$gethostent_r_proto" in
14763 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14764 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14766 case "$gethostent_r_proto" in
14767 ''|0) d_gethostent_r=undef
14768 gethostent_r_proto=0
14769 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14770 * ) case "$gethostent_r_proto" in
14771 REENTRANT_PROTO*) ;;
14772 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14774 echo "Prototype: $try" ;;
14777 *) case "$usethreads" in
14778 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14780 d_gethostent_r=undef
14781 gethostent_r_proto=0
14785 *) gethostent_r_proto=0
14789 : see if prototypes for various gethostxxx netdb.h functions are available
14791 set d_gethostprotos gethostent $i_netdb netdb.h
14794 : see if getitimer exists
14795 set getitimer d_getitimer
14798 : see if getlogin exists
14799 set getlogin d_getlogin
14802 : see if getlogin_r exists
14803 set getlogin_r d_getlogin_r
14805 case "$d_getlogin_r" in
14807 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14808 case "$d_getlogin_r_proto:$usethreads" in
14809 ":define") d_getlogin_r_proto=define
14810 set d_getlogin_r_proto getlogin_r $hdrs
14814 case "$d_getlogin_r_proto" in
14816 case "$getlogin_r_proto" in
14817 ''|0) try='int getlogin_r(char*, size_t);'
14818 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14820 case "$getlogin_r_proto" in
14821 ''|0) try='int getlogin_r(char*, int);'
14822 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14824 case "$getlogin_r_proto" in
14825 ''|0) try='char* getlogin_r(char*, size_t);'
14826 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14828 case "$getlogin_r_proto" in
14829 ''|0) try='char* getlogin_r(char*, int);'
14830 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14832 case "$getlogin_r_proto" in
14833 ''|0) d_getlogin_r=undef
14835 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14836 * ) case "$getlogin_r_proto" in
14837 REENTRANT_PROTO*) ;;
14838 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14840 echo "Prototype: $try" ;;
14843 *) case "$usethreads" in
14844 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14851 *) getlogin_r_proto=0
14855 : see if getmnt exists
14856 set getmnt d_getmnt
14859 : see if getmntent exists
14860 set getmntent d_getmntent
14863 : see if getnameinfo exists
14864 set getnameinfo d_getnameinfo
14867 : see if getnetbyaddr exists
14868 set getnetbyaddr d_getnbyaddr
14871 : see if getnetbyname exists
14872 set getnetbyname d_getnbyname
14875 : see if getnetent exists
14876 set getnetent d_getnent
14879 : see if getnetbyaddr_r exists
14880 set getnetbyaddr_r d_getnetbyaddr_r
14882 case "$d_getnetbyaddr_r" in
14884 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14885 case "$d_getnetbyaddr_r_proto:$usethreads" in
14886 ":define") d_getnetbyaddr_r_proto=define
14887 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14891 case "$d_getnetbyaddr_r_proto" in
14893 case "$getnetbyaddr_r_proto" in
14894 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14895 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14897 case "$getnetbyaddr_r_proto" in
14898 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14899 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14901 case "$getnetbyaddr_r_proto" in
14902 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14903 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14905 case "$getnetbyaddr_r_proto" in
14906 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14907 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14909 case "$getnetbyaddr_r_proto" in
14910 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14911 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14913 case "$getnetbyaddr_r_proto" in
14914 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14915 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14917 case "$getnetbyaddr_r_proto" in
14918 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14919 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14921 case "$getnetbyaddr_r_proto" in
14922 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14923 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14925 case "$getnetbyaddr_r_proto" in
14926 ''|0) d_getnetbyaddr_r=undef
14927 getnetbyaddr_r_proto=0
14928 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14929 * ) case "$getnetbyaddr_r_proto" in
14930 REENTRANT_PROTO*) ;;
14931 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14933 echo "Prototype: $try" ;;
14936 *) case "$usethreads" in
14937 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14939 d_getnetbyaddr_r=undef
14940 getnetbyaddr_r_proto=0
14944 *) getnetbyaddr_r_proto=0
14948 : see if getnetbyname_r exists
14949 set getnetbyname_r d_getnetbyname_r
14951 case "$d_getnetbyname_r" in
14953 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14954 case "$d_getnetbyname_r_proto:$usethreads" in
14955 ":define") d_getnetbyname_r_proto=define
14956 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14960 case "$d_getnetbyname_r_proto" in
14962 case "$getnetbyname_r_proto" in
14963 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14964 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14966 case "$getnetbyname_r_proto" in
14967 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14968 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14970 case "$getnetbyname_r_proto" in
14971 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14972 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14974 case "$getnetbyname_r_proto" in
14975 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14976 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14978 case "$getnetbyname_r_proto" in
14979 ''|0) d_getnetbyname_r=undef
14980 getnetbyname_r_proto=0
14981 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14982 * ) case "$getnetbyname_r_proto" in
14983 REENTRANT_PROTO*) ;;
14984 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14986 echo "Prototype: $try" ;;
14989 *) case "$usethreads" in
14990 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14992 d_getnetbyname_r=undef
14993 getnetbyname_r_proto=0
14997 *) getnetbyname_r_proto=0
15001 : see if getnetent_r exists
15002 set getnetent_r d_getnetent_r
15004 case "$d_getnetent_r" in
15006 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15007 case "$d_getnetent_r_proto:$usethreads" in
15008 ":define") d_getnetent_r_proto=define
15009 set d_getnetent_r_proto getnetent_r $hdrs
15013 case "$d_getnetent_r_proto" in
15015 case "$getnetent_r_proto" in
15016 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15017 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15019 case "$getnetent_r_proto" in
15020 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15021 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15023 case "$getnetent_r_proto" in
15024 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15025 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15027 case "$getnetent_r_proto" in
15028 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15029 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15031 case "$getnetent_r_proto" in
15032 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15033 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15035 case "$getnetent_r_proto" in
15036 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15037 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15039 case "$getnetent_r_proto" in
15040 ''|0) d_getnetent_r=undef
15041 getnetent_r_proto=0
15042 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15043 * ) case "$getnetent_r_proto" in
15044 REENTRANT_PROTO*) ;;
15045 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15047 echo "Prototype: $try" ;;
15050 *) case "$usethreads" in
15051 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15053 d_getnetent_r=undef
15054 getnetent_r_proto=0
15058 *) getnetent_r_proto=0
15062 : see if prototypes for various getnetxxx netdb.h functions are available
15064 set d_getnetprotos getnetent $i_netdb netdb.h
15067 : see if getpagesize exists
15068 set getpagesize d_getpagsz
15071 : Optional checks for getprotobyname and getprotobynumber
15073 : see if getprotobyname exists
15074 set getprotobyname d_getpbyname
15077 : see if getprotobynumber exists
15078 set getprotobynumber d_getpbynumber
15081 : see if getprotoent exists
15082 set getprotoent d_getpent
15085 : see if getpgid exists
15086 set getpgid d_getpgid
15089 : see if getpgrp2 exists
15090 set getpgrp2 d_getpgrp2
15093 : see if getppid exists
15094 set getppid d_getppid
15097 : see if getpriority exists
15098 set getpriority d_getprior
15101 : see if getprotobyname_r exists
15102 set getprotobyname_r d_getprotobyname_r
15104 case "$d_getprotobyname_r" in
15106 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15107 case "$d_getprotobyname_r_proto:$usethreads" in
15108 ":define") d_getprotobyname_r_proto=define
15109 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15113 case "$d_getprotobyname_r_proto" in
15115 case "$getprotobyname_r_proto" in
15116 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15117 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15119 case "$getprotobyname_r_proto" in
15120 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15121 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15123 case "$getprotobyname_r_proto" in
15124 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15125 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15127 case "$getprotobyname_r_proto" in
15128 ''|0) d_getprotobyname_r=undef
15129 getprotobyname_r_proto=0
15130 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15131 * ) case "$getprotobyname_r_proto" in
15132 REENTRANT_PROTO*) ;;
15133 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15135 echo "Prototype: $try" ;;
15138 *) case "$usethreads" in
15139 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15141 d_getprotobyname_r=undef
15142 getprotobyname_r_proto=0
15146 *) getprotobyname_r_proto=0
15150 : see if getprotobynumber_r exists
15151 set getprotobynumber_r d_getprotobynumber_r
15153 case "$d_getprotobynumber_r" in
15155 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15156 case "$d_getprotobynumber_r_proto:$usethreads" in
15157 ":define") d_getprotobynumber_r_proto=define
15158 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15162 case "$d_getprotobynumber_r_proto" in
15164 case "$getprotobynumber_r_proto" in
15165 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15166 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15168 case "$getprotobynumber_r_proto" in
15169 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15170 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15172 case "$getprotobynumber_r_proto" in
15173 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15174 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15176 case "$getprotobynumber_r_proto" in
15177 ''|0) d_getprotobynumber_r=undef
15178 getprotobynumber_r_proto=0
15179 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15180 * ) case "$getprotobynumber_r_proto" in
15181 REENTRANT_PROTO*) ;;
15182 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15184 echo "Prototype: $try" ;;
15187 *) case "$usethreads" in
15188 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15190 d_getprotobynumber_r=undef
15191 getprotobynumber_r_proto=0
15195 *) getprotobynumber_r_proto=0
15199 : see if getprotoent_r exists
15200 set getprotoent_r d_getprotoent_r
15202 case "$d_getprotoent_r" in
15204 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15205 case "$d_getprotoent_r_proto:$usethreads" in
15206 ":define") d_getprotoent_r_proto=define
15207 set d_getprotoent_r_proto getprotoent_r $hdrs
15211 case "$d_getprotoent_r_proto" in
15213 case "$getprotoent_r_proto" in
15214 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15215 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15217 case "$getprotoent_r_proto" in
15218 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15219 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15221 case "$getprotoent_r_proto" in
15222 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15223 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15225 case "$getprotoent_r_proto" in
15226 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15227 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15229 case "$getprotoent_r_proto" in
15230 ''|0) d_getprotoent_r=undef
15231 getprotoent_r_proto=0
15232 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15233 * ) case "$getprotoent_r_proto" in
15234 REENTRANT_PROTO*) ;;
15235 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15237 echo "Prototype: $try" ;;
15240 *) case "$usethreads" in
15241 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15243 d_getprotoent_r=undef
15244 getprotoent_r_proto=0
15248 *) getprotoent_r_proto=0
15252 : see if prototypes for various getprotoxxx netdb.h functions are available
15254 set d_getprotoprotos getprotoent $i_netdb netdb.h
15257 : see if getprpwnam exists
15258 set getprpwnam d_getprpwnam
15261 : see if getpwent exists
15262 set getpwent d_getpwent
15265 : see if getpwent_r exists
15266 set getpwent_r d_getpwent_r
15268 case "$d_getpwent_r" in
15270 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15271 case "$d_getpwent_r_proto:$usethreads" in
15272 ":define") d_getpwent_r_proto=define
15273 set d_getpwent_r_proto getpwent_r $hdrs
15277 case "$d_getpwent_r_proto" in
15279 case "$getpwent_r_proto" in
15280 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15281 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15283 case "$getpwent_r_proto" in
15284 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15285 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15287 case "$getpwent_r_proto" in
15288 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15289 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15291 case "$getpwent_r_proto" in
15292 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15293 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15295 case "$getpwent_r_proto" in
15296 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15297 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15299 case "$getpwent_r_proto" in
15300 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15301 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15303 case "$getpwent_r_proto" in
15304 ''|0) d_getpwent_r=undef
15306 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15307 * ) case "$getpwent_r_proto" in
15308 REENTRANT_PROTO*) ;;
15309 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15311 echo "Prototype: $try" ;;
15314 *) case "$usethreads" in
15315 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15322 *) getpwent_r_proto=0
15326 : see if getpwnam_r exists
15327 set getpwnam_r d_getpwnam_r
15329 case "$d_getpwnam_r" in
15331 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15332 case "$d_getpwnam_r_proto:$usethreads" in
15333 ":define") d_getpwnam_r_proto=define
15334 set d_getpwnam_r_proto getpwnam_r $hdrs
15338 case "$d_getpwnam_r_proto" in
15340 case "$getpwnam_r_proto" in
15341 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15342 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15344 case "$getpwnam_r_proto" in
15345 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15346 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15348 case "$getpwnam_r_proto" in
15349 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15350 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15352 case "$getpwnam_r_proto" in
15353 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15354 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15356 case "$getpwnam_r_proto" in
15357 ''|0) d_getpwnam_r=undef
15359 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15360 * ) case "$getpwnam_r_proto" in
15361 REENTRANT_PROTO*) ;;
15362 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15364 echo "Prototype: $try" ;;
15367 *) case "$usethreads" in
15368 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15375 *) getpwnam_r_proto=0
15379 : see if getpwuid_r exists
15380 set getpwuid_r d_getpwuid_r
15382 case "$d_getpwuid_r" in
15384 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15385 case "$d_getpwuid_r_proto:$usethreads" in
15386 ":define") d_getpwuid_r_proto=define
15387 set d_getpwuid_r_proto getpwuid_r $hdrs
15391 case "$d_getpwuid_r_proto" in
15393 case "$getpwuid_r_proto" in
15394 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15395 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15397 case "$getpwuid_r_proto" in
15398 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15399 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15401 case "$getpwuid_r_proto" in
15402 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15403 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15405 case "$getpwuid_r_proto" in
15406 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15407 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15409 case "$getpwuid_r_proto" in
15410 ''|0) d_getpwuid_r=undef
15412 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15413 * ) case "$getpwuid_r_proto" in
15414 REENTRANT_PROTO*) ;;
15415 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15417 echo "Prototype: $try" ;;
15420 *) case "$usethreads" in
15421 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15428 *) getpwuid_r_proto=0
15432 : Optional checks for getsbyname and getsbyport
15434 : see if getservbyname exists
15435 set getservbyname d_getsbyname
15438 : see if getservbyport exists
15439 set getservbyport d_getsbyport
15442 : see if getservent exists
15443 set getservent d_getsent
15446 : see if getservbyname_r exists
15447 set getservbyname_r d_getservbyname_r
15449 case "$d_getservbyname_r" in
15451 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15452 case "$d_getservbyname_r_proto:$usethreads" in
15453 ":define") d_getservbyname_r_proto=define
15454 set d_getservbyname_r_proto getservbyname_r $hdrs
15458 case "$d_getservbyname_r_proto" in
15460 case "$getservbyname_r_proto" in
15461 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15462 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15464 case "$getservbyname_r_proto" in
15465 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15466 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15468 case "$getservbyname_r_proto" in
15469 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15470 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15472 case "$getservbyname_r_proto" in
15473 ''|0) d_getservbyname_r=undef
15474 getservbyname_r_proto=0
15475 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15476 * ) case "$getservbyname_r_proto" in
15477 REENTRANT_PROTO*) ;;
15478 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15480 echo "Prototype: $try" ;;
15483 *) case "$usethreads" in
15484 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15486 d_getservbyname_r=undef
15487 getservbyname_r_proto=0
15491 *) getservbyname_r_proto=0
15495 : see if getservbyport_r exists
15496 set getservbyport_r d_getservbyport_r
15498 case "$d_getservbyport_r" in
15500 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15501 case "$d_getservbyport_r_proto:$usethreads" in
15502 ":define") d_getservbyport_r_proto=define
15503 set d_getservbyport_r_proto getservbyport_r $hdrs
15507 case "$d_getservbyport_r_proto" in
15509 case "$getservbyport_r_proto" in
15510 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15511 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15513 case "$getservbyport_r_proto" in
15514 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15515 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15517 case "$getservbyport_r_proto" in
15518 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15519 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15521 case "$getservbyport_r_proto" in
15522 ''|0) d_getservbyport_r=undef
15523 getservbyport_r_proto=0
15524 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15525 * ) case "$getservbyport_r_proto" in
15526 REENTRANT_PROTO*) ;;
15527 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15529 echo "Prototype: $try" ;;
15532 *) case "$usethreads" in
15533 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15535 d_getservbyport_r=undef
15536 getservbyport_r_proto=0
15540 *) getservbyport_r_proto=0
15544 : see if getservent_r exists
15545 set getservent_r d_getservent_r
15547 case "$d_getservent_r" in
15549 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15550 case "$d_getservent_r_proto:$usethreads" in
15551 ":define") d_getservent_r_proto=define
15552 set d_getservent_r_proto getservent_r $hdrs
15556 case "$d_getservent_r_proto" in
15558 case "$getservent_r_proto" in
15559 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15560 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15562 case "$getservent_r_proto" in
15563 ''|0) try='int getservent_r(struct servent*, char*, int);'
15564 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15566 case "$getservent_r_proto" in
15567 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15568 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15570 case "$getservent_r_proto" in
15571 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15572 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15574 case "$getservent_r_proto" in
15575 ''|0) d_getservent_r=undef
15576 getservent_r_proto=0
15577 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15578 * ) case "$getservent_r_proto" in
15579 REENTRANT_PROTO*) ;;
15580 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15582 echo "Prototype: $try" ;;
15585 *) case "$usethreads" in
15586 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15588 d_getservent_r=undef
15589 getservent_r_proto=0
15593 *) getservent_r_proto=0
15597 : see if prototypes for various getservxxx netdb.h functions are available
15599 set d_getservprotos getservent $i_netdb netdb.h
15602 : see if getspnam exists
15603 set getspnam d_getspnam
15606 : see if this is a shadow.h system
15607 set shadow.h i_shadow
15610 : see if getspnam_r exists
15611 set getspnam_r d_getspnam_r
15613 case "$d_getspnam_r" in
15615 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15616 case "$d_getspnam_r_proto:$usethreads" in
15617 ":define") d_getspnam_r_proto=define
15618 set d_getspnam_r_proto getspnam_r $hdrs
15622 case "$d_getspnam_r_proto" in
15624 case "$getspnam_r_proto" in
15625 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15626 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15628 case "$getspnam_r_proto" in
15629 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15630 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15632 case "$getspnam_r_proto" in
15633 ''|0) d_getspnam_r=undef
15635 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15636 * ) case "$getspnam_r_proto" in
15637 REENTRANT_PROTO*) ;;
15638 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15640 echo "Prototype: $try" ;;
15643 *) case "$usethreads" in
15644 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15651 *) getspnam_r_proto=0
15655 : see if gettimeofday or ftime exists
15656 set gettimeofday d_gettimeod
15658 case "$d_gettimeod" in
15664 val="$undef"; set d_ftime; eval $setvar
15667 case "$d_gettimeod$d_ftime" in
15670 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15674 : see if gmtime_r exists
15675 set gmtime_r d_gmtime_r
15677 case "$d_gmtime_r" in
15679 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15680 case "$d_gmtime_r_proto:$usethreads" in
15681 ":define") d_gmtime_r_proto=define
15682 set d_gmtime_r_proto gmtime_r $hdrs
15686 case "$d_gmtime_r_proto" in
15688 case "$gmtime_r_proto" in
15689 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15690 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15692 case "$gmtime_r_proto" in
15693 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15694 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15696 case "$gmtime_r_proto" in
15697 ''|0) d_gmtime_r=undef
15699 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15700 * ) case "$gmtime_r_proto" in
15701 REENTRANT_PROTO*) ;;
15702 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15704 echo "Prototype: $try" ;;
15707 *) case "$usethreads" in
15708 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15715 *) gmtime_r_proto=0
15719 : see if hasmntopt exists
15720 set hasmntopt d_hasmntopt
15723 : see if this is a netinet/in.h or sys/in.h system
15724 set netinet/in.h i_niin sys/in.h i_sysin
15727 : see if arpa/inet.h has to be included
15728 set arpa/inet.h i_arpainet
15731 : see if htonl --and friends-- exists
15736 : Maybe they are macros.
15739 $cat >htonl.c <<EOM
15741 #include <sys/types.h>
15742 #$i_niin I_NETINET_IN
15744 #$i_arpainet I_ARPA_INET
15745 #ifdef I_NETINET_IN
15746 #include <netinet/in.h>
15749 #include <sys/in.h>
15752 #include <arpa/inet.h>
15755 printf("Defined as a macro.");
15758 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15759 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15761 echo "But it seems to be defined as a macro." >&4
15769 : see if hypot exists
15773 : see if ilogb exists
15777 : see if ilogbl exists
15778 set ilogbl d_ilogbl
15783 if set index val -f; eval $csym; $val; then
15784 if set strchr val -f d_strchr; eval $csym; $val; then
15785 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15788 echo "strchr() found." >&4
15792 echo "index() found." >&4
15797 echo "index() found." >&4
15800 if set strchr val -f d_strchr; eval $csym; $val; then
15803 echo "strchr() found." >&4
15805 echo "No index() or strchr() found!" >&4
15810 set d_strchr; eval $setvar
15812 set d_index; eval $setvar
15814 : check whether inet_aton exists
15815 set inet_aton d_inetaton
15818 : see if inet_ntop exists
15819 set inet_ntop d_inetntop
15822 : see if inet_pton exists
15823 set inet_pton d_inetpton
15828 $cat >isascii.c <<EOCP
15831 #$i_stdlib I_STDLIB
15833 #include <stdlib.h>
15844 if eval $compile; then
15845 echo "isascii() found." >&4
15848 echo "isascii() NOT found." >&4
15857 $cat >isblank.c <<'EOCP'
15868 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15869 echo "isblank() found." >&4
15872 echo "isblank() NOT found." >&4
15879 : check for isfinite
15880 echo "Checking to see if you have isfinite..." >&4
15886 int main() { return isfinite(0.0); }
15889 if eval $compile; then
15891 echo "You have isfinite."
15894 echo "You do not have isfinite."
15900 : see if isfinitel exists
15901 set isfinitel d_isfinitel
15905 echo "Checking to see if you have isinf..." >&4
15911 int main() { return isinf(0.0); }
15914 if eval $compile; then
15916 echo "You have isinf."
15919 echo "You do not have isinf."
15925 : see if isinfl exists
15926 set isinfl d_isinfl
15930 echo "Checking to see if you have isless..." >&4
15936 int main() { return isless(0.0); }
15939 if eval $compile; then
15941 echo "You have isless."
15944 echo "You do not have isless."
15951 echo "Checking to see if you have isnan..." >&4
15957 int main() { return isnan(0.0); }
15960 if eval $compile; then
15962 echo "You have isnan."
15965 echo "You do not have isnan."
15971 : see if isnanl exists
15972 set isnanl d_isnanl
15975 : check for isnormal
15976 echo "Checking to see if you have isnormal..." >&4
15982 int main() { return isnormal(0.0); }
15985 if eval $compile; then
15987 echo "You have isnormal."
15990 echo "You do not have isnormal."
16000 : see if j0l exists
16004 : see if killpg exists
16005 set killpg d_killpg
16008 : see if localeconv exists
16009 set localeconv d_locconv
16012 : see if libc has the POSIX.1-2008 currency locale rules
16013 case "$d_locconv:$d_lc_monetary_2008" in
16016 #include <locale.h>
16018 struct lconv *lc = localeconv();
16019 char int_p_cs_precedes = lc->int_p_cs_precedes;
16024 if eval $compile; then
16025 d_lc_monetary_2008="$define"
16027 d_lc_monetary_2008="$undef"
16033 : see if lchown exists
16035 $cat > try.c <<'EOCP'
16036 /* System header to define __stub macros and hopefully few prototypes,
16037 which can conflict with char lchown(); below. */
16038 #include <assert.h>
16039 /* Override any gcc2 internal prototype to avoid an error. */
16040 /* We use char because int might match the return type of a gcc2
16041 builtin and then its argument prototype would still apply. */
16044 /* The GNU C library defines this for functions which it implements
16045 to always fail with ENOSYS. Some functions are actually named
16046 something starting with __ and the normal name is an alias. */
16047 #if defined (__stub_lchown) || defined (__stub___lchown)
16055 if eval $compile; then
16056 $echo "lchown() found." >&4
16059 $echo "lchown() NOT found." >&4
16065 : See if number of significant digits in a double precision number is known
16067 $cat >ldbl_dig.c <<EOM
16068 #$i_limits I_LIMITS
16071 #include <limits.h>
16077 printf("Contains LDBL_DIG");
16080 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16081 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16082 echo "LDBL_DIG found." >&4
16085 echo "LDBL_DIG NOT found." >&4
16092 : see if lgamma exists
16093 set lgamma d_lgamma
16096 : see if lgamma_r exists
16097 set lgamma_r d_lgamma_r
16100 : check to see if math.h defines _LIB_VERSION
16101 d_libm_lib_version="$undef"
16105 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16107 #include <unistd.h>
16109 int main (int argc, char *argv[])
16111 printf ("%d\n", _LIB_VERSION);
16116 if eval $compile; then
16118 echo "Yes, it does ($foo)" >&4
16119 d_libm_lib_version="$define"
16121 echo "No, it does not (probably harmless)" >&4
16128 : see if link exists
16132 : see if llrint exists
16133 set llrint d_llrint
16136 : see if llrintl exists
16137 set llrintl d_llrintl
16140 : see if llround exists
16141 set llround d_llround
16144 : see if llroundl exists
16145 set llroundl d_llroundl
16148 : see if localeconv_l exists
16149 set localeconv_l d_localeconv_l
16152 : see if localtime_r exists
16153 set localtime_r d_localtime_r
16155 case "$d_localtime_r" in
16157 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16158 case "$d_localtime_r_proto:$usethreads" in
16159 ":define") d_localtime_r_proto=define
16160 set d_localtime_r_proto localtime_r $hdrs
16164 case "$d_localtime_r_proto" in
16166 case "$localtime_r_proto" in
16167 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16168 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16170 case "$localtime_r_proto" in
16171 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16172 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16174 case "$localtime_r_proto" in
16175 ''|0) d_localtime_r=undef
16176 localtime_r_proto=0
16177 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16178 * ) case "$localtime_r_proto" in
16179 REENTRANT_PROTO*) ;;
16180 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16182 echo "Prototype: $try" ;;
16185 *) case "$usethreads" in
16186 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16188 d_localtime_r=undef
16189 localtime_r_proto=0
16193 *) localtime_r_proto=0
16197 : see if localtime_r calls tzset
16198 case "$localtime_r_proto" in
16201 /* Does our libc's localtime_r call tzset ?
16202 * return 0 if so, 1 otherwise.
16204 #$i_systypes I_SYS_TYPES
16205 #$i_unistd I_UNISTD
16207 #$i_stdlib I_STDLIB
16208 #$i_string I_STRING
16209 #$i_malloc I_MALLOC
16211 # include <sys/types.h>
16214 # include <unistd.h>
16220 #include <stdlib.h>
16223 # include <string.h>
16225 # include <strings.h>
16228 # include <malloc.h>
16232 time_t t = time(0L);
16233 char w_tz[]="TZ" "=GMT+5",
16234 e_tz[]="TZ" "=GMT-5",
16235 *tz_e = (char*)malloc(16),
16236 *tz_w = (char*)malloc(16);
16237 struct tm tm_e, tm_w;
16238 memset(&tm_e,'\0',sizeof(struct tm));
16239 memset(&tm_w,'\0',sizeof(struct tm));
16244 localtime_r(&t, &tm_e);
16247 localtime_r(&t, &tm_w);
16249 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16255 if eval $compile; then
16256 if $run ./try; then
16257 d_localtime_r_needs_tzset=undef;
16259 d_localtime_r_needs_tzset=define;
16262 d_localtime_r_needs_tzset=undef;
16266 d_localtime_r_needs_tzset=undef;
16271 : see if lockf exists
16275 : see if log1p exists
16279 : see if log2 exists
16283 : see if logb exists
16287 : see if lrint exists
16291 : see if lrintl exists
16292 set lrintl d_lrintl
16295 : see if lround exists
16296 set lround d_lround
16299 : see if lroundl exists
16300 set lroundl d_lroundl
16303 : see if prototype for lseek is available
16305 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16308 : see if lstat exists
16312 : see if madvise exists
16313 set madvise d_madvise
16316 : see if malloc_size exists
16317 set malloc_size d_malloc_size
16320 : see if malloc_size_good exists
16321 set malloc_good_size d_malloc_good_size
16324 : see if mblen exists
16328 : see if mbrlen exists
16329 set mbrlen d_mbrlen
16332 : see if mbrtowc exists
16333 set mbrtowc d_mbrtowc
16336 : see if mbstowcs exists
16337 set mbstowcs d_mbstowcs
16340 : see if mbtowc exists
16341 set mbtowc d_mbtowc
16344 : see if memmem exists
16345 set memmem d_memmem
16348 : see if memrchr exists
16349 set memrchr d_memrchr
16352 : see if mkdir exists
16356 : see if mkdtemp exists
16357 set mkdtemp d_mkdtemp
16360 : see if mkfifo exists
16361 set mkfifo d_mkfifo
16364 : see if mkstemp exists
16365 set mkstemp d_mkstemp
16368 : see if mkstemps exists
16369 set mkstemps d_mkstemps
16372 : see if mktime exists
16373 set mktime d_mktime
16376 : see if this is a sys/mman.h system
16377 set sys/mman.h i_sysmman
16380 : see if mmap exists
16383 : see what shmat returns
16384 : default to something harmless
16386 case "$i_sysmman$d_mmap" in
16388 $cat >mmap.c <<'END'
16389 #include <sys/mman.h>
16392 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16397 echo "and it returns ($mmaptype)." >&4
16403 : see if sqrtl exists
16407 : see if scalbnl exists
16408 set scalbnl d_scalbnl
16411 : see if truncl exists
16412 set truncl d_truncl
16415 : see if modfl exists
16419 : see if prototype for modfl is available
16421 set d_modflproto modfl $i_math math.h
16424 if $test "$uselongdouble" = "$define"; then
16426 if $test "$d_sqrtl" != "$define"; then
16427 message="$message sqrtl"
16429 if $test "$d_modfl" != "$define"; then
16430 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16431 echo "You have both truncl and copysignl, so I can emulate modfl."
16433 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16434 echo "You have both aintl and copysignl, so I can emulate modfl."
16436 message="$message modfl"
16440 if $test "$d_frexpl" != "$define"; then
16441 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16442 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16444 message="$message frexpl"
16447 if $test "$d_ldexpl" != "$define"; then
16448 message="$message ldexpl"
16451 if $test "$message" != ""; then
16454 *** You requested the use of long doubles but you do not seem to have
16455 *** the following mathematical functions needed for long double support:
16457 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16458 *** Cannot continue, aborting.
16466 : see if mprotect exists
16467 set mprotect d_mprotect
16470 : see if msgctl exists
16471 set msgctl d_msgctl
16474 : see if msgget exists
16475 set msgget d_msgget
16478 : see if msgsnd exists
16479 set msgsnd d_msgsnd
16482 : see if msgrcv exists
16483 set msgrcv d_msgrcv
16486 : see how much of the 'msg*(2)' library is present.
16489 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16490 *"$undef"*) h_msg=false;;
16494 case "`ipcs 2>&1`" in
16495 "SVID messages"*"not configured"*)
16496 echo "Your $osname does not have the msg*(2) configured." >&4
16499 set msgctl d_msgctl
16501 set msgget d_msgget
16503 set msgsnd d_msgsnd
16505 set msgrcv d_msgrcv
16511 : we could also check for sys/ipc.h ...
16512 if $h_msg && $test `./findhdr sys/msg.h`; then
16513 echo "You have the full msg*(2) library." >&4
16516 echo "You don't have the full msg*(2) library." >&4
16522 : Check for msghdr_s
16524 echo "Checking to see if your system supports struct msghdr..." >&4
16525 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16527 case "$d_msghdr_s" in
16528 "$define") echo "Yes, it does." ;;
16529 *) echo "No, it doesn't." ;;
16533 : see if msync exists
16537 : see if munmap exists
16538 set munmap d_munmap
16541 : see if nan exists
16545 : see if nanosleep exists
16546 set nanosleep d_nanosleep
16549 : see if nearbyint exists
16550 set nearbyint d_nearbyint
16553 : see if nextafter exists
16554 set nextafter d_nextafter
16557 : see if nexttoward exists
16558 set nexttoward d_nexttoward
16561 : see if nice exists
16565 : see if this is a langinfo.h system
16566 set langinfo.h i_langinfo
16569 : see if nl_langinfo exists
16570 set nl_langinfo d_nl_langinfo
16573 : see if this is a quadmath.h system
16574 set quadmath.h i_quadmath
16577 : Check basic sizes
16579 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16581 case "$use64bitint:$d_quad:$quadtype" in
16584 uvtype="$uquadtype"
16589 uvtype="unsigned long"
16595 case "$uselongdouble:$d_longdbl" in
16597 nvtype="long double"
16598 nvsize=$longdblsize
16605 case "$usequadmath:$i_quadmath" in
16607 nvtype="__float128"
16613 *** You requested the use of the quadmath library, but you
16614 *** do not seem to have the quadmath library installed.
16615 *** Cannot continue, aborting.
16621 define:*) $cat <<EOM >&4
16623 *** You requested the use of the quadmath library, but you
16624 *** do not seem to have the required header, <quadmath.h>.
16626 case "$gccversion" in
16629 *** Your gcc looks a bit old:
16635 *** You are not running a gcc.
16640 *** For the quadmath library you need at least gcc 4.6.
16641 *** Cannot continue, aborting.
16647 $echo "(IV will be "$ivtype", $ivsize bytes)"
16648 $echo "(UV will be "$uvtype", $uvsize bytes)"
16649 $echo "(NV will be "$nvtype", $nvsize bytes)"
16652 #$i_inttypes I_INTTYPES
16654 #include <inttypes.h>
16659 int8_t i = INT8_MAX;
16660 uint8_t u = UINT8_MAX;
16661 printf("int8_t\n");
16664 int16_t i = INT16_MAX;
16665 uint16_t u = UINT16_MAX;
16666 printf("int16_t\n");
16669 int32_t i = INT32_MAX;
16670 uint32_t u = UINT32_MAX;
16671 printf("int32_t\n");
16676 i8type="signed char"
16677 u8type="unsigned char"
16682 '') case "$shortsize" in
16684 u16type="unsigned short"
16692 '') set try -DINT16
16693 if eval $compile; then
16694 case "`$run ./try`" in
16706 '') if $test $shortsize -ge 2; then
16708 u16type="unsigned short"
16716 '') case "$longsize" in
16718 u32type="unsigned long"
16722 *) case "$intsize" in
16724 u32type="unsigned int"
16734 '') set try -DINT32
16735 if eval $compile; then
16736 case "`$run ./try`" in
16748 '') if $test $intsize -ge 4; then
16750 u32type="unsigned int"
16758 '') case "$d_quad:$quadtype" in
16760 i64type="$quadtype"
16761 u64type="$uquadtype"
16769 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16772 #$i_stdlib I_STDLIB
16774 #include <stdlib.h>
16776 #include <sys/types.h>
16777 #include <signal.h>
16779 /* volatile so that the compiler has to store it out to memory */
16780 volatile int bletched = 0;
16781 $signal_t blech(int s) { bletched = 1; }
16786 int n = 8 * $uvsize;
16789 signal(SIGFPE, blech);
16792 for (i = 0; i < n; i++) {
16793 u = u << 1 | ($uvtype)1;
16795 if (($uvtype)d != u)
16799 d = ($nvtype)(u - 1);
16800 if (($uvtype)d != (u - 1))
16807 printf("%d\n", ((i == n) ? -n : i));
16813 d_nv_preserves_uv="$undef"
16814 if eval $compile; then
16815 nv_preserves_uv_bits="`$run ./try`"
16817 case "$nv_preserves_uv_bits" in
16819 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16820 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16821 d_nv_preserves_uv="$define"
16823 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16824 d_nv_preserves_uv="$undef" ;;
16825 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16826 nv_preserves_uv_bits="0" ;;
16830 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16834 typedef $nvtype NV;
16841 while(count < 256) {
16842 /* volatile so that the compiler has to store it out to memory */
16843 volatile NV up = value + 1.0;
16844 volatile NV negated = -value;
16845 volatile NV down = negated - 1.0;
16846 volatile NV got_up = up - value;
16847 int up_good = got_up == 1.0;
16848 int got_down = down - negated;
16849 int down_good = got_down == -1.0;
16851 if (down_good != up_good) {
16853 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16854 up_good, (double) got_up, down_good, (double) got_down,
16855 count, (double) value);
16862 fputs("256.0", stdout);
16865 fputs("2.0", stdout);
16871 fputs("*", stdout);
16877 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16878 count, (double) value);
16884 nv_overflows_integers_at='0'
16885 if eval $compile; then
16891 The largest integer your NVs can preserve is equal to $xxx
16893 nv_overflows_integers_at="$xxx"
16896 Cannot determine the largest integer value your NVs can hold, unexpected output
16903 Cannot determine the largest integer value your NVs can hold
16910 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16913 #$i_stdlib I_STDLIB
16915 #include <stdlib.h>
16917 #$i_string I_STRING
16919 # include <string.h>
16921 # include <strings.h>
16923 #include <sys/types.h>
16924 #include <signal.h>
16926 /* volatile so that the compiler has to store it out to memory */
16927 volatile int bletched = 0;
16928 $signal_t blech(int s) { bletched = 1; }
16931 int checkit($nvtype d, const char *where) {
16933 unsigned char *p = (unsigned char *)v;
16934 unsigned char *end = p + sizeof(d);
16943 p = (unsigned char *)v;
16944 printf("No - %s: 0x", where);
16946 printf ("%02X", *p++);
16951 int main(int argc, char **argv) {
16954 fail += checkit(d, "0.0");
16956 /* The compiler shouldn't be assuming that bletched is 0 */
16959 fail += checkit(d, "bleched");
16962 signal(SIGFPE, blech);
16965 /* Paranoia - the compiler should have no way of knowing that ANSI says
16966 that argv[argc] will always be NULL. Actually, if it did assume this it
16967 would be buggy, as this is C and main() can be called from elsewhere in
16969 d = argv[argc] ? 1 : 0;
16972 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16975 fail += checkit(d, "ternary");
16977 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16980 printf("No - memset doesn't give 0.0\n");
16981 /* This might just blow up: */
16982 printf("(gives %g)\n", d);
16988 printf("No - something bleched\n");
16993 printf("No - %d fail(s)\n", fail);
17002 d_nv_zero_is_allbits_zero="$undef"
17003 if eval $compile; then
17009 0.0 is represented as all bits zero in memory
17011 d_nv_zero_is_allbits_zero="$define"
17014 0.0 is not represented as all bits zero in memory
17016 d_nv_zero_is_allbits_zero="$undef"
17021 0.0 is not represented as all bits zero in memory
17023 d_nv_zero_is_allbits_zero="$undef"
17029 : check for off64_t
17031 echo "Checking to see if you have off64_t..." >&4
17033 #include <sys/types.h>
17034 #include <unistd.h>
17035 int main() { off64_t x = 7; }
17038 if eval $compile; then
17040 echo "You have off64_t."
17043 echo "You do not have off64_t."
17044 case "$lseeksize" in
17045 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17052 : how to create joinable pthreads
17053 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17055 echo "Checking what constant to use for creating joinable pthreads..." >&4
17056 $cat >try.c <<'EOCP'
17057 #include <pthread.h>
17059 int detachstate = JOINABLE;
17062 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17063 if eval $compile; then
17064 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17065 val="$undef" # Yes, undef.
17066 set d_old_pthread_create_joinable
17069 set old_pthread_create_joinable
17072 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17073 if eval $compile; then
17074 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17076 set d_old_pthread_create_joinable
17078 val=PTHREAD_CREATE_UNDETACHED
17079 set old_pthread_create_joinable
17082 set try -DJOINABLE=__UNDETACHED
17083 if eval $compile; then
17084 echo "You seem to use __UNDETACHED." >&4
17086 set d_old_pthread_create_joinable
17089 set old_pthread_create_joinable
17092 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17094 set d_old_pthread_create_joinable
17097 set old_pthread_create_joinable
17104 d_old_pthread_create_joinable="$undef"
17105 old_pthread_create_joinable=""
17108 : see if pause exists
17112 : see if poll exists
17116 : see if prctl exists
17120 : see if prctl supports PR_SET_NAME
17121 d_prctl_set_name=$undef
17126 #include <unistd.h>
17128 #include <sys/prctl.h>
17130 int main (int argc, char *argv[])
17132 return (prctl (PR_SET_NAME, "Test"));
17136 if eval $compile_ok && $run ./try; then
17137 echo "Your prctl (PR_SET_NAME, ...) works"
17138 d_prctl_set_name=$define
17144 : see if readlink exists
17145 set readlink d_readlink
17148 : Check if there is a /proc symlink to the abs path of
17149 : the executing program. We will honor hints of d_procselfexe=$undef
17150 : or procselfexe being non-empty, otherwise will try to determine both
17151 : if we have readlink.
17152 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17153 : referenced, and AmigaOS does not have a proc filesystem anyway.
17156 if $test "X$d_procselfexe" = Xundef; then
17158 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17160 elif $test "X$d_readlink" = Xdefine; then
17161 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17162 : and it feels more tidy to avoid an extra level of symlink
17163 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17164 while test $# -gt 0; do
17167 if $issymlink $try; then
17168 $ls -l $try > reflect
17169 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17170 echo "You have $type-like $try."
17171 procselfexe='"'$try'"'
17173 : This will break out of the loop
17183 : backward compatibility for d_hvfork
17184 if test X$d_hvfork != X; then
17185 d_vfork="$d_hvfork"
17188 : see if there is a vfork
17193 d_pseudofork=$undef
17195 : Ok, but do we want to use it. vfork is reportedly unreliable in
17196 : perl on Solaris 2.x, and probably elsewhere.
17200 case "$usevfork" in
17206 Perl can only use a vfork() that doesn't suffer from strict
17207 restrictions on calling functions or modifying global data in
17208 the child. For example, glibc-2.1 contains such a vfork()
17209 that is unsuitable. If your system provides a proper fork()
17210 call, chances are that you do NOT want perl to use vfork().
17213 rp="Do you still want to use vfork()?"
17218 echo "Ok, we won't use vfork()."
17227 $define) usevfork='true';;
17228 *) usevfork='false';;
17231 : see whether the pthread_atfork exists
17233 #include <pthread.h>
17236 #ifdef PTHREAD_ATFORK
17237 pthread_atfork(NULL,NULL,NULL);
17242 : see if pthread_atfork exists
17243 set try -DPTHREAD_ATFORK
17244 if eval $compile; then
17249 case "$usethreads" in
17252 $define) echo 'pthread_atfork found.' >&4 ;;
17253 *) echo 'pthread_atfork NOT found.' >&4 ;;
17256 set d_pthread_atfork
17259 : see if pthread_attr_setscope exists
17260 set pthread_attr_setscope d_pthread_attr_setscope
17263 : see whether the various POSIXish _yields exist
17265 #include <pthread.h>
17271 #ifdef PTHREAD_YIELD
17274 #ifdef PTHREAD_YIELD_NULL
17275 pthread_yield(NULL);
17281 : see if sched_yield exists
17282 set try -DSCHED_YIELD
17283 if eval $compile; then
17285 sched_yield='sched_yield()'
17289 case "$usethreads" in
17292 $define) echo 'sched_yield() found.' >&4 ;;
17293 *) echo 'sched_yield() NOT found.' >&4 ;;
17299 : see if pthread_yield exists
17300 set try -DPTHREAD_YIELD
17301 if eval $compile; then
17303 case "$sched_yield" in
17304 '') sched_yield='pthread_yield()' ;;
17307 set try -DPTHREAD_YIELD_NULL
17308 if eval $compile; then
17310 case "$sched_yield" in
17311 '') sched_yield='pthread_yield(NULL)' ;;
17317 case "$usethreads" in
17320 $define) echo 'pthread_yield() found.' >&4 ;;
17321 *) echo 'pthread_yield() NOT found.' >&4 ;;
17325 set d_pthread_yield
17327 case "$sched_yield" in
17328 '') sched_yield=undef ;;
17332 : check for ptrdiff_t
17334 echo "Checking to see if you have ptrdiff_t..." >&4
17336 #include <stddef.h>
17337 int main() { ptrdiff_t x = 7; }
17340 if eval $compile; then
17342 echo "You have ptrdiff_t."
17345 echo "You do not have ptrdiff_t."
17351 : see if random_r exists
17352 set random_r d_random_r
17354 case "$d_random_r" in
17356 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17357 case "$d_random_r_proto:$usethreads" in
17358 ":define") d_random_r_proto=define
17359 set d_random_r_proto random_r $hdrs
17363 case "$d_random_r_proto" in
17365 case "$random_r_proto" in
17366 ''|0) try='int random_r(int*, struct random_data*);'
17367 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17369 case "$random_r_proto" in
17370 ''|0) try='int random_r(long*, struct random_data*);'
17371 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17373 case "$random_r_proto" in
17374 ''|0) try='int random_r(struct random_data*, int32_t*);'
17375 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17377 case "$random_r_proto" in
17378 ''|0) d_random_r=undef
17380 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17381 * ) case "$random_r_proto" in
17382 REENTRANT_PROTO*) ;;
17383 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17385 echo "Prototype: $try" ;;
17388 *) case "$usethreads" in
17389 define) echo "random_r has no prototype, not using it." >&4 ;;
17396 *) random_r_proto=0
17400 : see if readdir and friends exist
17401 set readdir d_readdir
17403 set seekdir d_seekdir
17405 set telldir d_telldir
17407 set rewinddir d_rewinddir
17410 : see if readdir64_r exists
17411 set readdir64_r d_readdir64_r
17413 case "$d_readdir64_r" in
17415 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17416 case "$d_readdir64_r_proto:$usethreads" in
17417 ":define") d_readdir64_r_proto=define
17418 set d_readdir64_r_proto readdir64_r $hdrs
17422 case "$d_readdir64_r_proto" in
17424 case "$readdir64_r_proto" in
17425 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17426 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17428 case "$readdir64_r_proto" in
17429 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17430 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17432 case "$readdir64_r_proto" in
17433 ''|0) d_readdir64_r=undef
17434 readdir64_r_proto=0
17435 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17436 * ) case "$readdir64_r_proto" in
17437 REENTRANT_PROTO*) ;;
17438 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17440 echo "Prototype: $try" ;;
17443 *) case "$usethreads" in
17444 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17446 d_readdir64_r=undef
17447 readdir64_r_proto=0
17451 *) readdir64_r_proto=0
17455 : see if readdir_r exists
17456 set readdir_r d_readdir_r
17458 case "$d_readdir_r" in
17460 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17461 case "$d_readdir_r_proto:$usethreads" in
17462 ":define") d_readdir_r_proto=define
17463 set d_readdir_r_proto readdir_r $hdrs
17467 case "$d_readdir_r_proto" in
17469 case "$readdir_r_proto" in
17470 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17471 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17473 case "$readdir_r_proto" in
17474 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17475 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17477 case "$readdir_r_proto" in
17478 ''|0) d_readdir_r=undef
17480 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17481 * ) case "$readdir_r_proto" in
17482 REENTRANT_PROTO*) ;;
17483 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17485 echo "Prototype: $try" ;;
17488 *) case "$usethreads" in
17489 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17496 *) readdir_r_proto=0
17500 : see if readv exists
17504 : see if recvmsg exists
17505 set recvmsg d_recvmsg
17508 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17510 if set regcomp val -f d_regcomp; eval $csym; $val; then
17511 echo 'regcomp() found.' >&4
17512 d_regcomp="$define"
17515 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17516 echo 'regcmp() found.' >&4
17520 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17521 echo 're_comp() found, assuming re_exec() also exists.' >&4
17522 d_re_comp="$define"
17527 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17534 : see if remainder exists
17535 set remainder d_remainder
17538 : see if remquo exists
17539 set remquo d_remquo
17542 : see if rename exists
17543 set rename d_rename
17546 : see if rint exists
17550 : see if rmdir exists
17554 : see if round exists
17558 : see if prototype for sbrk is available
17560 set d_sbrkproto sbrk $i_unistd unistd.h
17563 : see if scalbn exists
17564 set scalbn d_scalbn
17567 : see if select exists
17568 set select d_select
17571 : see if semctl exists
17572 set semctl d_semctl
17575 : see if semget exists
17576 set semget d_semget
17579 : see if semop exists
17583 : see how much of the 'sem*(2)' library is present.
17586 case "$d_semctl$d_semget$d_semop" in
17587 *"$undef"*) h_sem=false;;
17591 case "`ipcs 2>&1`" in
17592 "SVID messages"*"not configured"*)
17593 echo "Your $osname does not have the sem*(2) configured." >&4
17596 set semctl d_semctl
17598 set semget d_semget
17606 : we could also check for sys/ipc.h ...
17607 if $h_sem && $test `./findhdr sys/sem.h`; then
17608 echo "You have the full sem*(2) library." >&4
17611 echo "You don't have the full sem*(2) library." >&4
17617 : see whether sys/sem.h defines union semun
17619 $cat > try.c <<'END'
17620 #include <sys/types.h>
17621 #include <sys/ipc.h>
17622 #include <sys/sem.h>
17623 int main () { union semun semun; semun.buf = 0; }
17626 if eval $compile; then
17627 echo "You have union semun in <sys/sem.h>." >&4
17630 echo "You do not have union semun in <sys/sem.h>." >&4
17637 : see how to do semctl IPC_STAT
17641 $cat > tryh.h <<END
17644 # define S_IRUSR S_IREAD
17645 # define S_IWUSR S_IWRITE
17646 # define S_IXUSR S_IEXEC
17648 # define S_IRUSR 0400
17649 # define S_IWUSR 0200
17650 # define S_IXUSR 0100
17652 # define S_IRGRP (S_IRUSR>>3)
17653 # define S_IWGRP (S_IWUSR>>3)
17654 # define S_IXGRP (S_IXUSR>>3)
17655 # define S_IROTH (S_IRUSR>>6)
17656 # define S_IWOTH (S_IWUSR>>6)
17657 # define S_IXOTH (S_IXUSR>>6)
17660 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17661 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17662 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17665 : see whether semctl IPC_STAT can use union semun
17666 case "$d_semctl_semun" in
17670 #include <sys/types.h>
17671 #include <sys/ipc.h>
17672 #include <sys/sem.h>
17673 #include <sys/stat.h>
17680 #$d_union_semun HAS_UNION_SEMUN
17683 #ifndef HAS_UNION_SEMUN
17686 struct semid_ds *buf;
17687 unsigned short *array;
17693 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17694 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17696 struct semid_ds argbuf;
17699 st = semctl(sem, 0, IPC_STAT, arg);
17703 # endif /* IPC_STAT */
17704 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17706 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17707 # endif /* IPC_RMID */
17708 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17710 #endif /* IPC_PRIVATE && ... */
17711 printf("semget failed: errno = %d\n", errno);
17716 if eval $compile; then
17719 semun) val="$define" ;;
17727 case "$d_semctl_semun" in
17729 echo "You can use union semun for semctl IPC_STAT." >&4
17732 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17737 : see whether semctl IPC_STAT can use struct semid_ds pointer
17738 case "$d_semctl_semid_ds" in
17741 $cat > try.c <<'END'
17742 #include <sys/types.h>
17743 #include <sys/ipc.h>
17744 #include <sys/sem.h>
17745 #include <sys/stat.h>
17753 struct semid_ds arg;
17756 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17757 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17760 st = semctl(sem, 0, IPC_STAT, &arg);
17762 printf("semid_ds\n");
17764 # endif /* IPC_STAT */
17765 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17767 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17768 # endif /* IPC_RMID */
17769 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17771 #endif /* IPC_PRIVATE && ... */
17772 printf("semget failed: errno = %d\n", errno);
17778 if eval $compile; then
17781 semid_ds) val="$define" ;;
17785 set d_semctl_semid_ds
17789 case "$d_semctl_semid_ds" in
17791 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17793 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17799 # We do not have the full sem*(2) library, so assume we can not
17805 set d_semctl_semid_ds
17811 : see if sendmsg exists
17812 set sendmsg d_sendmsg
17815 : see if setegid exists
17816 set setegid d_setegid
17819 : see if seteuid exists
17820 set seteuid d_seteuid
17823 : see if setgrent exists
17824 set setgrent d_setgrent
17827 : see if setgrent_r exists
17828 set setgrent_r d_setgrent_r
17830 case "$d_setgrent_r" in
17832 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17833 case "$d_setgrent_r_proto:$usethreads" in
17834 ":define") d_setgrent_r_proto=define
17835 set d_setgrent_r_proto setgrent_r $hdrs
17839 case "$d_setgrent_r_proto" in
17841 case "$setgrent_r_proto" in
17842 ''|0) try='int setgrent_r(FILE**);'
17843 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17845 case "$setgrent_r_proto" in
17846 ''|0) try='void setgrent_r(FILE**);'
17847 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17849 case "$setgrent_r_proto" in
17850 ''|0) d_setgrent_r=undef
17852 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17853 * ) case "$setgrent_r_proto" in
17854 REENTRANT_PROTO*) ;;
17855 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17857 echo "Prototype: $try" ;;
17860 *) case "$usethreads" in
17861 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17868 *) setgrent_r_proto=0
17872 : see if sethostent exists
17873 set sethostent d_sethent
17876 : see if sethostent_r exists
17877 set sethostent_r d_sethostent_r
17879 case "$d_sethostent_r" in
17881 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17882 case "$d_sethostent_r_proto:$usethreads" in
17883 ":define") d_sethostent_r_proto=define
17884 set d_sethostent_r_proto sethostent_r $hdrs
17888 case "$d_sethostent_r_proto" in
17890 case "$sethostent_r_proto" in
17891 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17892 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17894 case "$sethostent_r_proto" in
17895 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17896 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17898 case "$sethostent_r_proto" in
17899 ''|0) d_sethostent_r=undef
17900 sethostent_r_proto=0
17901 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17902 * ) case "$sethostent_r_proto" in
17903 REENTRANT_PROTO*) ;;
17904 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17906 echo "Prototype: $try" ;;
17909 *) case "$usethreads" in
17910 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17912 d_sethostent_r=undef
17913 sethostent_r_proto=0
17917 *) sethostent_r_proto=0
17921 : see if setitimer exists
17922 set setitimer d_setitimer
17925 : see if setlinebuf exists
17926 set setlinebuf d_setlinebuf
17929 : see if setlocale exists
17930 set setlocale d_setlocale
17933 : see if locale.h is available
17934 set locale.h i_locale
17937 : see if setlocale_r exists
17938 set setlocale_r d_setlocale_r
17940 case "$d_setlocale_r" in
17942 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17943 case "$d_setlocale_r_proto:$usethreads" in
17944 ":define") d_setlocale_r_proto=define
17945 set d_setlocale_r_proto setlocale_r $hdrs
17949 case "$d_setlocale_r_proto" in
17951 case "$setlocale_r_proto" in
17952 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17953 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17955 case "$setlocale_r_proto" in
17956 ''|0) d_setlocale_r=undef
17957 setlocale_r_proto=0
17958 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17959 * ) case "$setlocale_r_proto" in
17960 REENTRANT_PROTO*) ;;
17961 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17963 echo "Prototype: $try" ;;
17966 *) case "$usethreads" in
17967 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17969 d_setlocale_r=undef
17970 setlocale_r_proto=0
17974 *) setlocale_r_proto=0
17978 : see if setnetent exists
17979 set setnetent d_setnent
17982 : see if setnetent_r exists
17983 set setnetent_r d_setnetent_r
17985 case "$d_setnetent_r" in
17987 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17988 case "$d_setnetent_r_proto:$usethreads" in
17989 ":define") d_setnetent_r_proto=define
17990 set d_setnetent_r_proto setnetent_r $hdrs
17994 case "$d_setnetent_r_proto" in
17996 case "$setnetent_r_proto" in
17997 ''|0) try='int setnetent_r(int, struct netent_data*);'
17998 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18000 case "$setnetent_r_proto" in
18001 ''|0) try='void setnetent_r(int, struct netent_data*);'
18002 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18004 case "$setnetent_r_proto" in
18005 ''|0) d_setnetent_r=undef
18006 setnetent_r_proto=0
18007 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18008 * ) case "$setnetent_r_proto" in
18009 REENTRANT_PROTO*) ;;
18010 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18012 echo "Prototype: $try" ;;
18015 *) case "$usethreads" in
18016 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18018 d_setnetent_r=undef
18019 setnetent_r_proto=0
18023 *) setnetent_r_proto=0
18027 : see if setprotoent exists
18028 set setprotoent d_setpent
18031 : see if setpgid exists
18032 set setpgid d_setpgid
18035 : see if setpgrp2 exists
18036 set setpgrp2 d_setpgrp2
18039 : see if setpriority exists
18040 set setpriority d_setprior
18043 : see if setproctitle exists
18044 set setproctitle d_setproctitle
18047 : see if setprotoent_r exists
18048 set setprotoent_r d_setprotoent_r
18050 case "$d_setprotoent_r" in
18052 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18053 case "$d_setprotoent_r_proto:$usethreads" in
18054 ":define") d_setprotoent_r_proto=define
18055 set d_setprotoent_r_proto setprotoent_r $hdrs
18059 case "$d_setprotoent_r_proto" in
18061 case "$setprotoent_r_proto" in
18062 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18063 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18065 case "$setprotoent_r_proto" in
18066 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18067 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18069 case "$setprotoent_r_proto" in
18070 ''|0) d_setprotoent_r=undef
18071 setprotoent_r_proto=0
18072 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18073 * ) case "$setprotoent_r_proto" in
18074 REENTRANT_PROTO*) ;;
18075 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18077 echo "Prototype: $try" ;;
18080 *) case "$usethreads" in
18081 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18083 d_setprotoent_r=undef
18084 setprotoent_r_proto=0
18088 *) setprotoent_r_proto=0
18092 : see if setpwent exists
18093 set setpwent d_setpwent
18096 : see if setpwent_r exists
18097 set setpwent_r d_setpwent_r
18099 case "$d_setpwent_r" in
18101 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18102 case "$d_setpwent_r_proto:$usethreads" in
18103 ":define") d_setpwent_r_proto=define
18104 set d_setpwent_r_proto setpwent_r $hdrs
18108 case "$d_setpwent_r_proto" in
18110 case "$setpwent_r_proto" in
18111 ''|0) try='int setpwent_r(FILE**);'
18112 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18114 case "$setpwent_r_proto" in
18115 ''|0) try='void setpwent_r(FILE**);'
18116 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18118 case "$setpwent_r_proto" in
18119 ''|0) d_setpwent_r=undef
18121 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18122 * ) case "$setpwent_r_proto" in
18123 REENTRANT_PROTO*) ;;
18124 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18126 echo "Prototype: $try" ;;
18129 *) case "$usethreads" in
18130 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18137 *) setpwent_r_proto=0
18141 : see if setregid exists
18142 set setregid d_setregid
18144 set setresgid d_setresgid
18147 : see if setreuid exists
18148 set setreuid d_setreuid
18150 set setresuid d_setresuid
18153 : see if setrgid exists
18154 set setrgid d_setrgid
18157 : see if setruid exists
18158 set setruid d_setruid
18161 : see if setservent exists
18162 set setservent d_setsent
18165 : see if setservent_r exists
18166 set setservent_r d_setservent_r
18168 case "$d_setservent_r" in
18170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18171 case "$d_setservent_r_proto:$usethreads" in
18172 ":define") d_setservent_r_proto=define
18173 set d_setservent_r_proto setservent_r $hdrs
18177 case "$d_setservent_r_proto" in
18179 case "$setservent_r_proto" in
18180 ''|0) try='int setservent_r(int, struct servent_data*);'
18181 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18183 case "$setservent_r_proto" in
18184 ''|0) try='void setservent_r(int, struct servent_data*);'
18185 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18187 case "$setservent_r_proto" in
18188 ''|0) d_setservent_r=undef
18189 setservent_r_proto=0
18190 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18191 * ) case "$setservent_r_proto" in
18192 REENTRANT_PROTO*) ;;
18193 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18195 echo "Prototype: $try" ;;
18198 *) case "$usethreads" in
18199 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18201 d_setservent_r=undef
18202 setservent_r_proto=0
18206 *) setservent_r_proto=0
18210 : see if setsid exists
18211 set setsid d_setsid
18214 : see if setvbuf exists
18215 set setvbuf d_setvbuf
18218 : see if shmctl exists
18219 set shmctl d_shmctl
18222 : see if shmget exists
18223 set shmget d_shmget
18226 : see if shmat exists
18229 : see what shmat returns
18232 $cat >shmat.c <<'END'
18233 #include <sys/shm.h>
18236 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18241 echo "and it returns ($shmattype)." >&4
18242 : see if a prototype for shmat is available
18243 xxx=`./findhdr sys/shm.h`
18244 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18245 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18256 set d_shmatprototype
18259 : see if shmdt exists
18263 : see how much of the 'shm*(2)' library is present.
18266 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18267 *"$undef"*) h_shm=false;;
18271 case "`ipcs 2>&1`" in
18272 "SVID shared memory"*"not configured"*)
18273 echo "Your $osname does not have the shm*(2) configured." >&4
18276 set shmctl d_shmctl
18278 set shmget d_shmget
18288 : we could also check for sys/ipc.h ...
18289 if $h_shm && $test `./findhdr sys/shm.h`; then
18290 echo "You have the full shm*(2) library." >&4
18293 echo "You don't have the full shm*(2) library." >&4
18299 : see if we have sigaction
18301 if set sigaction val -f d_sigaction; eval $csym; $val; then
18302 echo 'sigaction() found.' >&4
18305 #include <sys/types.h>
18306 #include <signal.h>
18307 #$i_stdlib I_STDLIB
18309 #include <stdlib.h>
18313 struct sigaction act, oact;
18315 oact.sa_handler = 0;
18316 /* so that act and oact are used */
18317 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18321 if eval $compile_ok; then
18324 echo "But you don't seem to have a usable struct sigaction." >&4
18328 echo 'sigaction NOT found.' >&4
18331 set d_sigaction; eval $setvar
18334 : see what type pids are declared as in the kernel
18335 rp="What is the type of process ids on this system?"
18336 set pid_t pidtype int stdio.h sys/types.h
18339 : see what type uids are declared as in the kernel
18341 echo "Looking for the type for user ids returned by getuid()."
18342 set uid_t uidtype xxx stdio.h sys/types.h
18346 xxx=`./findhdr sys/user.h`
18347 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18349 unsigned) dflt="$1 $2" ;;
18353 *) dflt="$uidtype";;
18356 uid_t) echo "uid_t found." ;;
18357 *) rp="What is the type for user ids returned by getuid()?"
18363 : Define hasfield_t macro for Configure internal use
18364 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18365 while $test $# -ge 2; do
18367 $define) echo "#include <$2>";;
18371 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18373 if eval $compile; then
18382 : see what siginfo fields we have
18383 case "$d_sigaction" in
18385 echo "Checking if your siginfo_t has si_errno field...">&4
18386 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18389 echo "Checking if your siginfo_t has si_pid field...">&4
18390 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18393 echo "Checking if your siginfo_t has si_uid field...">&4
18394 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18397 echo "Checking if your siginfo_t has si_addr field...">&4
18398 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18401 echo "Checking if your siginfo_t has si_status field...">&4
18402 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18405 echo "Checking if your siginfo_t has si_band field...">&4
18406 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18409 echo "Checking if your siginfo_t has si_value field...">&4
18410 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18413 echo "Checking if your siginfo_t has si_fd field...">&4
18414 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18419 d_siginfo_si_errno="$undef"
18420 d_siginfo_si_pid="$undef"
18421 d_siginfo_si_uid="$undef"
18422 d_siginfo_si_addr="$undef"
18423 d_siginfo_si_status="$undef"
18424 d_siginfo_si_band="$undef"
18425 d_siginfo_si_value="$undef"
18426 d_siginfo_si_fd="$undef"
18430 : see if this is a sunmath.h system
18431 set sunmath.h i_sunmath
18434 : see if signbit exists
18435 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18438 #$i_sunmath I_SUNMATH
18442 #ifdef I_SUNMATH /* Solaris special math library */
18443 # include <sunmath.h>
18446 int main(int argc, char **argv)
18450 if ((signbit(x) == 0) && (signbit(y) != 0))
18458 if eval $compile; then
18459 if $run ./try; then
18463 $echo "Signbit seems to be available, but doesn't work as I expected."
18464 $echo "I won't use it." >&4
18475 : see if sigprocmask exists
18476 set sigprocmask d_sigprocmask
18479 : see if sigsetjmp exists
18481 case "$d_sigsetjmp" in
18484 #include <setjmp.h>
18485 #$i_stdlib I_STDLIB
18487 #include <stdlib.h>
18493 if (sigsetjmp(env,1))
18496 siglongjmp(env, 1);
18501 if eval $compile; then
18502 if $run ./try >/dev/null 2>&1; then
18503 echo "POSIX sigsetjmp found." >&4
18507 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18513 echo "sigsetjmp not found." >&4
18517 *) val="$d_sigsetjmp"
18518 case "$d_sigsetjmp" in
18519 $define) echo "POSIX sigsetjmp found." >&4;;
18520 $undef) echo "sigsetjmp not found." >&4;;
18528 : see if sockatmark exists
18529 set sockatmark d_sockatmark
18532 : see if prototype for sockatmark is available
18534 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18537 : see if socks5_init exists
18538 set socks5_init d_socks5_init
18541 : see if sprintf returns the length of the string in the buffer as per ANSI
18542 $echo "Checking whether sprintf returns the length of the string..." >&4
18545 #$i_stdlib I_STDLIB
18547 #include <stdlib.h>
18549 #$i_string I_STRING
18551 # include <string.h>
18553 # include <strings.h>
18562 int check (size_t expect, int test) {
18563 size_t got = strlen(buffer);
18567 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18572 int main(int argc, char **argv) {
18575 check(sprintf(buffer, ""), ++test);
18576 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18577 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18584 if eval $compile; then
18588 sprintf returns the length of the string (as ANSI says it should)
18590 d_sprintf_returns_strlen="$define"
18593 sprintf does not return the length of the string (how old is this system?)
18595 d_sprintf_returns_strlen="$undef"
18599 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18600 d_sprintf_returns_strlen="$undef"
18604 : see if srand48_r exists
18605 set srand48_r d_srand48_r
18607 case "$d_srand48_r" in
18609 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18610 case "$d_srand48_r_proto:$usethreads" in
18611 ":define") d_srand48_r_proto=define
18612 set d_srand48_r_proto srand48_r $hdrs
18616 case "$d_srand48_r_proto" in
18618 case "$srand48_r_proto" in
18619 ''|0) try='int srand48_r(long, struct drand48_data*);'
18620 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18622 case "$srand48_r_proto" in
18623 ''|0) d_srand48_r=undef
18625 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18626 * ) case "$srand48_r_proto" in
18627 REENTRANT_PROTO*) ;;
18628 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18630 echo "Prototype: $try" ;;
18633 *) case "$usethreads" in
18634 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18641 *) srand48_r_proto=0
18645 : see if srandom_r exists
18646 set srandom_r d_srandom_r
18648 case "$d_srandom_r" in
18650 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18651 case "$d_srandom_r_proto:$usethreads" in
18652 ":define") d_srandom_r_proto=define
18653 set d_srandom_r_proto srandom_r $hdrs
18657 case "$d_srandom_r_proto" in
18659 case "$srandom_r_proto" in
18660 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18661 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18663 case "$srandom_r_proto" in
18664 ''|0) d_srandom_r=undef
18666 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18667 * ) case "$srandom_r_proto" in
18668 REENTRANT_PROTO*) ;;
18669 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18671 echo "Prototype: $try" ;;
18674 *) case "$usethreads" in
18675 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18682 *) srandom_r_proto=0
18686 : see if prototype for setresgid is available
18688 set d_sresgproto setresgid $i_unistd unistd.h
18691 : see if prototype for setresuid is available
18693 set d_sresuproto setresuid $i_unistd unistd.h
18696 : see if stat exists
18700 : see if sys/stat.h is available
18701 set sys/stat.h i_sysstat
18704 : see if stat knows about block sizes
18706 echo "Checking to see if your struct stat has st_blocks field..." >&4
18707 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18710 : see if this is a sys/vfs.h system
18711 set sys/vfs.h i_sysvfs
18714 : see if this is a sys/statfs.h system
18715 set sys/statfs.h i_sysstatfs
18718 : Check for statfs_s
18720 echo "Checking to see if your system supports struct statfs..." >&4
18721 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
18723 case "$d_statfs_s" in
18724 "$define") echo "Yes, it does." ;;
18725 *) echo "No, it doesn't." ;;
18729 : see if struct statfs knows about f_flags
18730 case "$d_statfs_s" in
18733 echo "Checking to see if your struct statfs has f_flags field..." >&4
18734 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
18738 set d_statfs_f_flags
18742 case "$d_statfs_f_flags" in
18743 "$define") echo "Yes, it does." ;;
18744 *) echo "No, it doesn't." ;;
18747 : see what flavor, if any, of static inline is supported
18749 echo "Checking to see if your system supports static inline..."
18750 $cat > try.c <<'EOCP'
18751 #include <stdlib.h>
18752 extern int f_via_a(int x);
18753 extern int f_via_b(int x);
18754 int main(int argc, char **argv)
18763 return EXIT_SUCCESS;
18766 return EXIT_FAILURE;
18770 $cat > a.c <<'EOCP'
18771 static INLINE int f(int x) {
18782 $cat > b.c <<'EOCP'
18783 extern int f(int x);
18791 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18792 case "$perl_static_inline" in
18793 '') # Check the various possibilities, and break out on success.
18794 # For gcc, prefer __inline__, which will still permit
18795 # cflags.SH to add in -ansi.
18796 case "$gccversion" in
18797 '') xxx="inline __inline__ __inline _inline";;
18798 *) xxx="__inline__ inline __inline _inline";;
18800 for inline in $xxx; do
18801 set try -DINLINE=$inline a.c
18802 if eval $compile && $run ./try; then
18803 # Now make sure there is no external linkage of static
18805 set try -DINLINE=$inline -DUSE_B a.c b.c
18806 if eval $compile && $run ./try; then
18807 $echo "Your compiler supports static $inline, " >&4
18808 $echo "but it also creates an external definition," >&4
18809 $echo "so I won't use it." >&4
18812 $echo "Your compiler supports static $inline." >&4
18814 perl_static_inline="static $inline";
18818 $echo "Your compiler does NOT support static $inline." >&4
18823 *inline*) # Some variant of inline exists.
18824 echo "Keeping your $hint value of $perl_static_inline."
18827 static) # No inline capabilities
18828 echo "Keeping your $hint value of $perl_static_inline."
18831 *) # Unrecognized previous value -- blindly trust the supplied
18832 # value and hope it makes sense. Use old value for
18833 # d_static_inline, if there is one.
18834 echo "Keeping your $hint value of $perl_static_inline."
18835 case "$d_static_inline" in
18837 *) val=$d_static_inline ;;
18841 # Fallback to plain 'static' if nothing worked.
18842 case "$perl_static_inline" in
18844 perl_static_inline="static"
18848 set d_static_inline
18850 $rm -f a.[co] b.[co]
18853 : Check stream access
18855 Checking how to access stdio streams by file descriptor number...
18857 case "$stdio_stream_array" in
18858 '') $cat >try.c <<EOCP
18861 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18865 for s in _iob __iob __sF
18867 set try -DSTDIO_STREAM_ARRAY=$s
18868 if eval $compile; then
18869 case "`$run ./try`" in
18870 yes) stdio_stream_array=$s; break ;;
18876 case "$stdio_stream_array" in
18878 I can't figure out how to access stdio streams by file descriptor number.
18880 d_stdio_stream_array="$undef"
18883 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18885 d_stdio_stream_array="$define"
18889 : see if strcoll exists
18890 set strcoll d_strcoll
18893 : see if strerror and/or sys_errlist[] exist
18895 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18896 if set strerror val -f d_strerror; eval $csym; $val; then
18897 echo 'strerror() found.' >&4
18898 d_strerror="$define"
18899 d_strerrm='strerror(e)'
18900 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18901 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18902 d_syserrlst="$define"
18904 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18905 d_syserrlst="$undef"
18907 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18908 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18909 echo 'strerror() found in string header.' >&4
18910 d_strerror="$define"
18911 d_strerrm='strerror(e)'
18912 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18913 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18914 d_syserrlst="$define"
18916 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18917 d_syserrlst="$undef"
18919 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18920 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18921 d_strerror="$undef"
18922 d_syserrlst="$define"
18923 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18925 echo 'strerror() and sys_errlist[] NOT found.' >&4
18926 d_strerror="$undef"
18927 d_syserrlst="$undef"
18928 d_strerrm='"unknown"'
18932 : see if strerror_l exists
18933 set strerror_l d_strerror_l
18936 : see if strerror_r exists
18937 set strerror_r d_strerror_r
18939 case "$d_strerror_r" in
18941 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18942 case "$d_strerror_r_proto:$usethreads" in
18943 ":define") d_strerror_r_proto=define
18944 set d_strerror_r_proto strerror_r $hdrs
18948 case "$d_strerror_r_proto" in
18950 case "$strerror_r_proto" in
18951 ''|0) try='int strerror_r(int, char*, size_t);'
18952 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18954 case "$strerror_r_proto" in
18955 ''|0) try='int strerror_r(int, char*, int);'
18956 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18958 case "$strerror_r_proto" in
18959 ''|0) try='char* strerror_r(int, char*, size_t);'
18960 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18962 case "$strerror_r_proto" in
18963 ''|0) d_strerror_r=undef
18965 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18966 * ) case "$strerror_r_proto" in
18967 REENTRANT_PROTO*) ;;
18968 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18970 echo "Prototype: $try" ;;
18973 *) case "$usethreads" in
18974 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18981 *) strerror_r_proto=0
18985 : see if strftime exists
18986 set strftime d_strftime
18989 : see if strlcat exists
18990 set strlcat d_strlcat
18993 : see if strlcpy exists
18994 set strlcpy d_strlcpy
18997 : see if strnlen exists
18998 set strnlen d_strnlen
19001 : see if strtod exists
19002 set strtod d_strtod
19005 : see if strtol exists
19006 set strtol d_strtol
19009 : see if strtold exists
19010 set strtold d_strtold
19013 : see if strtold_l exists
19014 set strtold_l d_strtold_l
19017 : see if strtoll exists
19018 set strtoll d_strtoll
19021 case "$d_longlong-$d_strtoll" in
19024 Checking whether your strtoll() works okay...
19026 $cat >try.c <<'EOCP'
19029 #define strtoll __strtoll
19032 #define strtoll _strtoll
19035 extern long long int strtoll(char *s, char **, int);
19036 static int bad = 0;
19037 int check(char *s, long long ell, int een) {
19040 gll = strtoll(s, 0, 10);
19041 if (!((gll == ell) && (errno == een)))
19045 check(" 1", 1LL, 0);
19046 check(" 0", 0LL, 0);
19047 check("-1", -1LL, 0);
19048 check("-9223372036854775808", -9223372036854775808LL, 0);
19049 check("-9223372036854775808", -9223372036854775808LL, 0);
19050 check(" 9223372036854775807", 9223372036854775807LL, 0);
19051 check("-9223372036854775808", -9223372036854775808LL, 0);
19052 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19053 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19059 if eval $compile; then
19062 ok) echo "Your strtoll() seems to be working okay." ;;
19064 Your strtoll() doesn't seem to be working okay.
19070 echo "(I can't seem to compile the test program--assuming it doesn't)"
19076 : see if strtoq exists
19077 set strtoq d_strtoq
19080 : see if strtoul exists
19081 set strtoul d_strtoul
19084 case "$d_strtoul" in
19087 Checking whether your strtoul() works okay...
19089 $cat >try.c <<'EOCP'
19092 extern unsigned long int strtoul(char *s, char **, int);
19093 static int bad = 0;
19094 void check(char *s, unsigned long eul, int een) {
19097 gul = strtoul(s, 0, 10);
19098 if (!((gul == eul) && (errno == een)))
19102 check(" 1", 1L, 0);
19103 check(" 0", 0L, 0);
19105 case "$longsize" in
19107 $cat >>try.c <<'EOCP'
19108 check("18446744073709551615", 18446744073709551615UL, 0);
19109 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19110 #if 0 /* strtoul() for /^-/ strings is undefined. */
19111 check("-1", 18446744073709551615UL, 0);
19112 check("-18446744073709551614", 2, 0);
19113 check("-18446744073709551615", 1, 0);
19114 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19115 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19120 $cat >>try.c <<'EOCP'
19121 check("4294967295", 4294967295UL, 0);
19122 check("4294967296", 4294967295UL, ERANGE);
19123 #if 0 /* strtoul() for /^-/ strings is undefined. */
19124 check("-1", 4294967295UL, 0);
19125 check("-4294967294", 2, 0);
19126 check("-4294967295", 1, 0);
19127 check("-4294967296", 4294967295UL, ERANGE);
19128 check("-4294967297", 4294967295UL, ERANGE);
19133 : Should we write these tests to be more portable by sprintf-ing
19134 : ~0 and then manipulating that char string as input for strtol?
19137 $cat >>try.c <<'EOCP'
19144 if eval $compile; then
19145 case "`$run ./try`" in
19146 ok) echo "Your strtoul() seems to be working okay." ;;
19148 Your strtoul() doesn't seem to be working okay.
19154 echo "(I can't seem to compile the test program--assuming it doesn't)"
19160 : see if strtoull exists
19161 set strtoull d_strtoull
19164 case "$d_longlong-$d_strtoull" in
19167 Checking whether your strtoull() works okay...
19169 $cat >try.c <<'EOCP'
19172 #define strtoull __strtoull
19175 extern unsigned long long int strtoull(char *s, char **, int);
19176 static int bad = 0;
19177 int check(char *s, long long eull, int een) {
19180 gull = strtoull(s, 0, 10);
19181 if (!((gull == eull) && (errno == een)))
19185 check(" 1", 1LL, 0);
19186 check(" 0", 0LL, 0);
19187 check("18446744073709551615", 18446744073709551615ULL, 0);
19188 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19189 #if 0 /* strtoull() for /^-/ strings is undefined. */
19190 check("-1", 18446744073709551615ULL, 0);
19191 check("-18446744073709551614", 2LL, 0);
19192 check("-18446744073709551615", 1LL, 0);
19193 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19194 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19201 if eval $compile; then
19202 case "`$run ./try`" in
19203 ok) echo "Your strtoull() seems to be working okay." ;;
19205 Your strtoull() doesn't seem to be working okay.
19207 d_strtoull="$undef"
19211 echo "(I can't seem to compile the test program--assuming it doesn't)"
19212 d_strtoull="$undef"
19217 : see if strtouq exists
19218 set strtouq d_strtouq
19221 case "$d_strtouq" in
19224 Checking whether your strtouq() works okay...
19226 $cat >try.c <<'EOCP'
19229 extern unsigned long long int strtouq(char *s, char **, int);
19230 static int bad = 0;
19231 void check(char *s, unsigned long long eull, int een) {
19232 unsigned long long gull;
19234 gull = strtouq(s, 0, 10);
19235 if (!((gull == eull) && (errno == een)))
19239 check(" 1", 1LL, 0);
19240 check(" 0", 0LL, 0);
19241 check("18446744073709551615", 18446744073709551615ULL, 0);
19242 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19243 #if 0 /* strtouq() for /^-/ strings is undefined. */
19244 check("-1", 18446744073709551615ULL, 0);
19245 check("-18446744073709551614", 2LL, 0);
19246 check("-18446744073709551615", 1LL, 0);
19247 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19248 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19256 if eval $compile; then
19257 case "`$run ./try`" in
19258 ok) echo "Your strtouq() seems to be working okay." ;;
19260 Your strtouq() doesn't seem to be working okay.
19266 echo "(I can't seem to compile the test program--assuming it doesn't)"
19272 : see if strxfrm exists
19273 set strxfrm d_strxfrm
19276 : see if symlink exists
19277 set symlink d_symlink
19280 : see if syscall exists
19281 set syscall d_syscall
19284 : see if prototype for syscall is available
19286 set d_syscallproto syscall $i_unistd unistd.h
19289 : see if sysconf exists
19290 set sysconf d_sysconf
19293 : see if system exists
19294 set system d_system
19297 : see if tcgetpgrp exists
19298 set tcgetpgrp d_tcgetpgrp
19301 : see if tcsetpgrp exists
19302 set tcsetpgrp d_tcsetpgrp
19305 : see if prototype for telldir is available
19307 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19310 : see if tgamma exists
19311 set tgamma d_tgamma
19314 : check for thread_safe_nl_langinfo_l item
19317 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19320 #$i_stdlib I_STDLIB
19322 # include <stdlib.h>
19324 #$i_string I_STRING
19326 # include <string.h>
19328 #$i_langinfo I_LANGINFO
19330 # include <langinfo.h>
19332 #$i_pthread I_PTHREAD
19334 # include <pthread.h>
19336 #$i_locale I_LOCALE
19338 # include <locale.h>
19342 thread_start(void * arg)
19344 nl_langinfo(RADIXCHAR);
19348 char * main_buffer;
19349 char save_main_buffer[1000];
19350 pthread_t subthread;
19351 pthread_attr_t attr;
19353 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19355 /* If too large for our generous allowance, just assume we don't have
19357 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19361 strcpy(save_main_buffer, main_buffer);
19363 if (pthread_attr_init(&attr) != 0) {
19367 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19371 if (pthread_join(subthread, NULL) != 0) {
19375 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19378 case "$usethreads" in
19381 if eval $compile; then
19382 echo "Your system has nl_langinfo_l()..." >&4
19383 if $run ./try; then
19384 echo "and it is thread-safe (just as I'd hoped)." >&4
19385 d_thread_safe_nl_langinfo_l="$define"
19386 echo "$d_thread_safe_nl_langinfo_l" >&4
19388 echo "but it isn't thread-safe, so we won't use it." >&4
19391 echo "your system does not have nl_langinfo_l()" >&4
19394 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19396 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19397 d_thread_safe_nl_langinfo_l="$undef"
19401 : see if time exists
19403 if test "X$d_time" = X -o X"$timetype" = X; then
19404 if set time val -f d_time; eval $csym; $val; then
19405 echo 'time() found.' >&4
19407 rp="What is the type returned by time() on this system?"
19408 set time_t timetype long stdio.h sys/types.h
19411 echo 'time() not found, hope that will do.' >&4
19419 : see if timegm exists
19420 set timegm d_timegm
19423 : see if this is a sys/times.h system
19424 set sys/times.h i_systimes
19427 : see if times exists
19429 if set times val -f d_times; eval $csym; $val; then
19430 echo 'times() found.' >&4
19433 case "$i_systimes" in
19434 "$define") inc='sys/times.h';;
19436 rp="What is the type returned by times() on this system?"
19437 set clock_t clocktype long stdio.h sys/types.h $inc
19440 echo 'times() NOT found, hope that will do.' >&4
19445 : see if tmpnam_r exists
19446 set tmpnam_r d_tmpnam_r
19448 case "$d_tmpnam_r" in
19450 hdrs="$i_systypes sys/types.h define stdio.h "
19451 case "$d_tmpnam_r_proto:$usethreads" in
19452 ":define") d_tmpnam_r_proto=define
19453 set d_tmpnam_r_proto tmpnam_r $hdrs
19457 case "$d_tmpnam_r_proto" in
19459 case "$tmpnam_r_proto" in
19460 ''|0) try='char* tmpnam_r(char*);'
19461 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19463 case "$tmpnam_r_proto" in
19464 ''|0) d_tmpnam_r=undef
19466 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19467 * ) case "$tmpnam_r_proto" in
19468 REENTRANT_PROTO*) ;;
19469 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19471 echo "Prototype: $try" ;;
19474 *) case "$usethreads" in
19475 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19482 *) tmpnam_r_proto=0
19486 : see if trunc exists
19490 : see if truncate exists
19491 set truncate d_truncate
19494 : see if ttyname_r exists
19495 set ttyname_r d_ttyname_r
19497 case "$d_ttyname_r" in
19499 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19500 case "$d_ttyname_r_proto:$usethreads" in
19501 ":define") d_ttyname_r_proto=define
19502 set d_ttyname_r_proto ttyname_r $hdrs
19506 case "$d_ttyname_r_proto" in
19508 case "$ttyname_r_proto" in
19509 ''|0) try='int ttyname_r(int, char*, size_t);'
19510 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19512 case "$ttyname_r_proto" in
19513 ''|0) try='int ttyname_r(int, char*, int);'
19514 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19516 case "$ttyname_r_proto" in
19517 ''|0) try='char* ttyname_r(int, char*, int);'
19518 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19520 case "$ttyname_r_proto" in
19521 ''|0) d_ttyname_r=undef
19523 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19524 * ) case "$ttyname_r_proto" in
19525 REENTRANT_PROTO*) ;;
19526 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19528 echo "Prototype: $try" ;;
19531 *) case "$usethreads" in
19532 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19539 *) ttyname_r_proto=0
19543 : see if tzname[] exists
19545 if set tzname val -a d_tzname; eval $csym; $val; then
19547 echo 'tzname[] found.' >&4
19550 echo 'tzname[] NOT found.' >&4
19555 : Check if is a multiplatform env
19557 darwin) multiarch="$define" ;;
19559 case "$multiarch" in
19560 ''|[nN]*) multiarch="$undef" ;;
19563 : check for ordering of bytes in a UV
19565 case "$multiarch" in
19568 You seem to be doing a multiarchitecture build,
19569 skipping the byteorder check.
19575 case "$byteorder" in
19578 In the following, larger digits indicate more significance. A big-endian
19579 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19580 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19581 machines may have weird orders like 3412. A Cray will report 87654321,
19582 an Alpha will report 12345678. If the test program works the default is
19584 I'm now running the test program...
19588 #$i_stdlib I_STDLIB
19590 #include <stdlib.h>
19592 #include <sys/types.h>
19593 typedef $uvtype UV;
19603 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19605 u.l = (UV)0x04030201;
19606 for (i = 0; i < $uvsize; i++)
19607 printf("%c", u.c[i]+'0');
19614 if eval $compile && $run ./try > /dev/null; then
19617 [1-4][1-4][1-4][1-4]|12345678|87654321)
19618 echo "(The test program ran ok.)"
19619 echo "byteorder=$dflt"
19622 ????|????????) echo "(The test program ran ok.)" ;;
19623 *) echo "(The test program didn't run right for some reason.)" ;;
19628 (I can't seem to compile the test program. Guessing big-endian...)
19631 case "$xxx_prompt" in
19633 rp="What is the order of bytes in $uvtype?"
19646 : Checking 32bit alignedness
19649 Checking to see whether you can access character data unalignedly...
19651 case "$d_u32align" in
19652 '') $cat >try.c <<EOCP
19654 #$i_stdlib I_STDLIB
19656 #include <stdlib.h>
19658 #define U32 $u32type
19659 #define BYTEORDER 0x$byteorder
19661 #include <signal.h>
19663 $signal_t bletch(int s) { exit(4); }
19666 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19667 volatile U8 buf[8];
19671 if (sizeof(U32) != 4) {
19672 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19679 signal(SIGBUS, bletch);
19691 for (i = 0; i < 4; i++) {
19692 up = (U32*)(buf + i);
19693 if (! ((*up == 1 << (8*i)) || /* big-endian */
19694 (*up == 1 << (8*(3-i))) /* little-endian */
19698 printf("read failed (%x)\n", *up);
19704 for (i = 0; i < 4; i++) {
19705 up = (U32*)(buf + i);
19707 if (*up != 0xBeef) {
19708 printf("write failed (%x)\n", *up);
19722 if eval $compile_ok; then
19723 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19724 $run ./try 2>&1 >/dev/null
19727 You can access character data pretty unalignedly.
19729 d_u32align="$undef"
19732 It seems that you must access character data in an aligned manner.
19734 d_u32align="$define"
19738 rp='Can you access character data at unaligned addresses?'
19742 [yY]*) d_u32align="$undef" ;;
19743 *) d_u32align="$define" ;;
19750 : see if ualarm exists
19751 set ualarm d_ualarm
19754 : see if umask exists
19758 : see if unordered exists
19759 set unordered d_unordered
19762 : see if unsetenv exists
19763 set unsetenv d_unsetenv
19766 : see if usleep exists
19767 set usleep d_usleep
19770 : see if prototype for usleep is available
19772 set d_usleepproto usleep $i_unistd unistd.h
19775 : see if ustat exists
19779 : see if closedir exists
19780 set closedir d_closedir
19783 case "$d_closedir" in
19786 echo "Checking whether closedir() returns a status..." >&4
19788 #$i_dirent I_DIRENT /**/
19789 #$i_sysdir I_SYS_DIR /**/
19790 #$i_sysndir I_SYS_NDIR /**/
19791 #$i_systypes I_SYS_TYPES /**/
19793 #if defined(I_SYS_TYPES)
19794 #include <sys/types.h>
19796 #if defined(I_DIRENT)
19797 #include <dirent.h>
19800 #include <sys/ndir.h>
19804 #include <ndir.h> /* may be wrong in the future */
19806 #include <sys/dir.h>
19811 int main() { return closedir(opendir(".")); }
19814 if eval $compile_ok; then
19815 if $run ./try > /dev/null 2>&1 ; then
19816 echo "Yes, it does."
19819 echo "No, it doesn't."
19823 echo "(I can't seem to compile the test program--assuming it doesn't)"
19831 set d_void_closedir
19835 : see if there is a wait4
19839 : see if waitpid exists
19840 set waitpid d_waitpid
19845 $cat >try.c <<'EOCP'
19851 return (wcscmp (s, s) ? 1 : 0);
19856 if eval $compile; then
19859 0) echo "A working wcscmp() found." >&4
19861 *) echo "wcscmp() found, but it doesn't work" >&4
19865 echo "wcscmp() NOT found." >&4
19871 : see if wcstombs exists
19872 set wcstombs d_wcstombs
19877 $cat >try.c <<'EOCP'
19882 wchar_t dst[4], *src = L" ";
19884 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19889 if eval $compile; then
19892 0) echo "A working wcsxfrm() found." >&4
19894 *) echo "wcsxfrm() found, but it doesn't work" >&4
19898 echo "wcsxfrm() NOT found." >&4
19904 : see if wctomb exists
19905 set wctomb d_wctomb
19908 : see if writev exists
19909 set writev d_writev
19912 : check for alignment requirements
19914 case "$alignbytes" in
19915 '') echo "Checking alignment constraints..." >&4
19924 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19929 if eval $compile_ok; then
19933 echo "(I can't seem to compile the test program...)"
19935 case "$multiarch" in
19937 : The usual safe value is 8, but Darwin with -Duselongdouble
19938 : needs 16. Hence, we will take 8 as a minimum, but allow
19939 : Configure to pick a larger value if needed.
19940 if $test "$dflt" -lt 8; then
19942 echo "Setting alignment to 8 for multiarch support.">&4
19947 *) dflt="$alignbytes"
19950 rp="Doubles must be aligned on a how-many-byte boundary?"
19955 : set the base revision
19958 : length of character in bytes. Is always 1, otherwise it is not C
19959 : This used to be a test using sizeof
19962 : Check for the number of bits in a character
19963 case "$charbits" in
19964 '') echo "Checking how long a character is (in bits)..." >&4
19971 for (c = 1, n = 0; c; c <<= 1, n++) ;
19972 printf ("%d\n", n);
19977 if eval $compile_ok; then
19981 echo "(I can't seem to compile the test program. Guessing...)"
19988 rp="What is the length of a character (in bits)?"
19992 case "$charbits" in
19995 Your system has an unsigned character size of $charbits bits, which
19996 is rather unusual (normally it is 8 bits). Perl likely will not work
19997 correctly on your system, with subtle bugs in various places.
19999 rp='Do you really want to continue?'
20003 [yY]) echo >&4 "Okay, continuing." ;;
20008 : how do we concatenate cpp tokens here?
20010 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20011 $cat >cpp_stuff.c <<'EOCP'
20012 #define RCAT(a,b)a/**/b
20013 #define ACAT(a,b)a ## b
20017 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20018 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20019 echo "Oh! Smells like ANSI's been here." >&4
20020 echo "We can catify or stringify, separately or together!"
20022 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20023 echo "Ah, yes! The good old days!" >&4
20024 echo "However, in the good old days we don't know how to stringify and"
20025 echo "catify at the same time."
20029 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20030 You're going to have to edit the values of CAT[2-5] in config.h...
20032 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20036 : see if this is a db.h system
20042 : Check db version.
20044 echo "Checking Berkeley DB version ..." >&4
20050 #include <sys/types.h>
20052 #$i_stdlib I_STDLIB
20054 #include <stdlib.h>
20057 int main(int argc, char *argv[])
20059 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20060 int Major, Minor, Patch ;
20061 unsigned long Version ;
20062 (void)db_version(&Major, &Minor, &Patch) ;
20064 printf("%d %d %d %d %d %d\n",
20065 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20066 Major, Minor, Patch);
20069 printf("You have Berkeley DB Version 2 or greater.\n");
20071 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20072 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20073 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20074 Major, Minor, Patch) ;
20076 /* check that db.h & libdb are compatible */
20077 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20078 printf("db.h and libdb are incompatible.\n") ;
20082 printf("db.h and libdb are compatible.\n") ;
20084 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20085 + DB_VERSION_PATCH ;
20087 /* needs to be >= 2.3.4 */
20088 if (Version < 2003004) {
20089 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20090 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20096 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20101 printf("You have Berkeley DB Version 1.\n");
20102 exit(0); /* DB version < 2: the coast is clear. */
20104 exit(1); /* <db.h> not Berkeley DB? */
20110 if eval $compile_ok && $run ./try; then
20111 echo 'Looks OK.' >&4
20113 db_version_major=$1
20114 db_version_minor=$2
20115 db_version_patch=$3
20117 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20121 : Remove db from list of libraries to use
20122 echo "Removing unusable -ldb from library list" >&4
20123 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20126 echo "libs = $libs" >&4
20136 : Check the return type needed for hash
20138 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20144 #include <sys/types.h>
20147 #ifndef DB_VERSION_MAJOR
20148 u_int32_t hash_cb (const void* ptr, size_t size)
20154 info.hash = hash_cb;
20158 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20159 if $contains warning try.out >>/dev/null 2>&1 ; then
20162 db_hashtype='u_int32_t'
20165 : XXX Maybe we should just give up here.
20166 db_hashtype=u_int32_t
20168 echo "Help: I can't seem to compile the db test program." >&4
20169 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20172 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20174 *) db_hashtype=u_int32_t
20179 : Check the return type needed for prefix
20181 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20187 #include <sys/types.h>
20190 #ifndef DB_VERSION_MAJOR
20191 size_t prefix_cb (const DBT *key1, const DBT *key2)
20197 info.prefix = prefix_cb;
20201 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20202 if $contains warning try.out >>/dev/null 2>&1 ; then
20203 db_prefixtype='int'
20205 db_prefixtype='size_t'
20208 db_prefixtype='size_t'
20209 : XXX Maybe we should just give up here.
20211 echo "Help: I can't seem to compile the db test program." >&4
20212 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20215 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20217 *) db_prefixtype='size_t'
20221 : Include . in @INC
20224 Historically Perl has provided a final fallback of the current working
20225 directory '.' when searching for a library. This, however, can lead to
20226 problems when a Perl program which loads optional modules is called from
20227 a shared directory. This can lead to executing unexpected code.
20231 # When changing to exclude by default:
20232 case "$default_inc_excludes_dot" in
20233 $undef|false|[nN]*) dflt="n" ;;
20236 # To turn exclude off by default:
20237 #case "$default_inc_excludes_dot" in
20238 # $define|true|[yY]*) dflt="y" ;;
20242 rp='Exclude '.' from @INC by default? '
20245 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20246 *) default_inc_excludes_dot="$define" ;;
20249 : Check what kind of inf/nan your system has
20250 $echo "Checking the kind of infinities and nans you have..." >&4
20251 $echo "(The following tests may crash. That's okay.)" >&4
20253 #define DOUBLESIZE $doublesize
20254 #$d_longdbl HAS_LONG_DOUBLE
20255 #ifdef HAS_LONG_DOUBLE
20256 #define LONG_DOUBLESIZE $longdblsize
20257 #define LONG_DOUBLEKIND $longdblkind
20260 #$i_string I_STRING
20265 # include <string.h>
20268 /* Note that whether the sign bit is on or off
20269 * for NaN depends on the CPU/FPU, and possibly
20270 * can be affected by the build toolchain.
20272 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20273 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20274 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20275 * (respectively) as opposed to the more usual
20276 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20278 * Pre-IEEE-754 floating point format do not even have inf/nan support
20279 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20280 * to even mention, causing immediate SIGFPE or equivalent: this is
20281 * the case with VAX floating point, for example.
20283 static void bytes(void *v, unsigned int n) {
20284 unsigned char *p = (unsigned char *)v;
20286 for (i = 0; i < n; i++) {
20287 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20290 int main(int argc, char *argv[]) {
20291 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20292 * because some compilers are 'smart' and not only warn but refuse to
20293 * compile such 'illegal' values. */
20294 double dinf = exp(1e9);
20295 double dnan = sqrt(-1.0);
20296 #ifdef HAS_LONG_DOUBLE
20297 long double ldinf = (long double)exp(1e9);
20298 long double ldnan = (long double)sqrt(-1.0);
20299 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20300 /* the 80-bit long doubles might have garbage in their excess bytes */
20301 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20302 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20305 switch (argv[1][0]) {
20306 case '1': bytes(&dinf, sizeof(dinf)); break;
20307 case '2': bytes(&dnan, sizeof(dnan)); break;
20308 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20309 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20317 if eval $compile; then
20318 doubleinfbytes=`$run ./try 1`
20319 doublenanbytes=`$run ./try 2`
20320 case "$d_longdbl" in
20322 longdblinfbytes=`$run ./try 3`
20323 longdblnanbytes=`$run ./try 4`
20327 # Defaults in case the above test program failed.
20328 case "$doublekind" in
20329 1) # IEEE 754 32-bit LE
20330 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20331 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20333 2) # IEEE 754 32-bit BE
20334 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20335 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20337 3) # IEEE 754 64-bit LE
20338 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20339 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20341 4) # IEEE 754 64-bit BE
20342 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20343 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20345 5) # IEEE 754 128-bit LE
20346 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20347 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20349 6) # IEEE 754 128-bit BE
20350 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20351 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20353 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20354 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20355 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20357 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20358 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20359 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20361 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20362 doubleinfbytes=$undef
20363 doublenanbytes=$undef
20366 doubleinfbytes=$undef
20367 doublenanbytes=$undef
20370 case "$longdblkind" in
20371 1) # IEEE 754 128-bit LE
20372 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20373 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20375 2) # IEEE 754 128-bit BE
20376 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20377 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20379 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20380 case "$longdblsize" in
20381 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20382 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20383 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20386 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20387 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20390 longdblinfbytes=$undef
20391 longdblnanbytes=$undef
20395 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20396 case "$longdblsize" in
20397 12) # 32-bit system
20398 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20399 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20401 16) # 64-bit system
20402 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20403 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20406 longdblinfbytes=$undef
20407 longdblnanbytes=$undef
20411 5) # 128-bit LE-LE "double double"
20412 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20413 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20415 6) # 128-bit BE-BE "double double"
20416 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20417 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20419 7) # 128-bit LE-BE "double double"
20420 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20421 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20423 8) # 128-bit BE-LE "double double"
20424 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20425 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20427 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20428 longdblinfbytes=$undef
20429 longdblnanbytes=$undef
20432 longdblinfbytes=$undef
20433 longdblnanbytes=$undef
20437 # In case the program crashed the values are empty, turn them undef.
20438 case "$doubleinfbytes" in
20439 '') doubleinfbytes=$undef ;;
20441 case "$doublenanbytes" in
20442 '') doublenanbytes=$undef ;;
20444 case "$longdblinfbytes" in
20445 '') longdblinfbytes=$undef ;;
20447 case "$longdblnanbytes" in
20448 '') longdblnanbytes=$undef ;;
20452 : Check the length of the double mantissa
20453 $echo "Checking how many mantissa bits your doubles have..." >&4
20456 #$i_sunmath I_SUNMATH
20458 # include <float.h>
20461 # include <sunmath.h>
20463 #ifdef DBL_MANT_DIG
20464 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20467 int main(int argc, char *argv[]) {
20469 printf("%d\n", BITS);
20475 if eval $compile; then
20476 doublemantbits=`$run ./try`
20478 doublemantbits="$undef"
20482 : Check the length of the longdouble mantissa
20483 $echo "Checking how many mantissa bits your long doubles have..." >&4
20486 #$i_sunmath I_SUNMATH
20488 # include <float.h>
20491 # include <sunmath.h>
20493 #$d_longdbl HAS_LONG_DOUBLE
20494 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20495 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20496 /* This format has no implicit bit. Beware, however, that for
20497 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20498 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20499 * and the top bit must have been one since 387, zero is plain invalid.
20500 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20501 # define BITS LDBL_MANT_DIG
20502 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20503 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20504 * reason e.g. Irix thinks 107. But in any case, we want only
20505 * the number of real bits, the implicit bits are of no interest. */
20506 # define BITS 2 * (DBL_MANT_DIG - 1)
20508 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20512 int main(int argc, char *argv[]) {
20514 printf("%d\n", BITS);
20520 if eval $compile; then
20521 longdblmantbits=`$run ./try`
20523 longdblmantbits="$undef"
20527 : Check the length of the NV mantissa
20528 $echo "Checking how many mantissa bits your NVs have..." >&4
20529 if test "X$usequadmath" = "X$define"; then
20530 nvmantbits=112 # 128-1-15
20532 if test "X$nvsize" = "X$doublesize"; then
20533 nvmantbits="$doublemantbits"
20535 if test "X$nvsize" = "X$longdblsize"; then
20536 nvmantbits="$longdblmantbits"
20538 nvmantbits="$undef"
20543 : How can we generate normalized random numbers ?
20545 echo "Using our internal random number implementation..." >&4
20548 *-Dmy_rand=*|*-Dmy_srand=*)
20549 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20550 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20551 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20552 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20556 randfunc=Perl_drand48
20557 drand01="Perl_drand48()"
20558 seedfunc="Perl_drand48_init"
20562 : Probe whether dtrace builds an object, as newer Illumos requires an input
20563 : object file that uses at least one of the probes defined in the .d file
20564 case "$usedtrace" in
20566 case "$dtracexnolibs" in
20567 $define|true|[yY]*)
20568 dtracexnolibs=$define
20569 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20572 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20573 dtracexnolibs=$define
20574 echo "Your dtrace accepts -xnolibs"
20575 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20576 dtracexnolibs=$undef
20577 echo "Your dtrace doesn't accept -xnolibs"
20579 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20584 dtracexnolibs=$undef
20585 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20588 case $dtracexnolibs in
20589 $define) xnolibs=-xnolibs ;;
20593 case "$dtraceobject" in
20594 $define|true|[yY]*)
20595 dtraceobject=$define
20599 #include "perldtrace.h"
20601 PERL_LOADED_FILE("dummy");
20605 dtraceobject=$undef
20606 if $cc -c -o try.o $optimize $ccflags try.c \
20607 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20608 dtraceobject=$define
20609 echo "Your dtrace builds an object file"
20612 *) dtraceobject=$undef ;;
20614 $rm_try perldtrace.o perldtrace.h
20617 : Determine if this is an EBCDIC system
20619 echo "Determining whether or not we are on an EBCDIC system..." >&4
20620 $cat >try.c <<'EOM'
20623 if ('M'==0xd4) return 0;
20630 if eval $compile_ok; then
20631 if $run ./try; then
20632 echo "You seem to speak EBCDIC." >&4
20635 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20638 echo "I'm unable to compile the test program." >&4
20639 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20645 : Check how to flush
20648 Checking how to flush all pending stdio output...
20650 # I only know how to find the first 32 possibly open files on SunOS.
20651 # See also hints/sunos_4_1.sh and util.c --AD
20653 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20655 $cat >>try.c <<EOCP
20657 #$i_stdlib I_STDLIB
20659 #include <stdlib.h>
20661 #$i_unistd I_UNISTD
20663 # include <unistd.h>
20665 #$d_sysconf HAS_SYSCONF
20666 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20667 #ifdef HAS_STDIO_STREAM_ARRAY
20668 # define STDIO_STREAM_ARRAY $stdio_stream_array
20673 p = fopen("try.out", "w");
20677 # ifdef TRY_FPRINTF
20681 #ifdef TRY_FFLUSH_NULL
20684 #ifdef TRY_FFLUSH_ALL
20686 long open_max = -1;
20687 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20688 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20690 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20691 open_max = sysconf(_SC_OPEN_MAX);
20694 open_max = FOPEN_MAX;
20697 open_max = OPEN_MAX;
20706 # ifdef HAS_STDIO_STREAM_ARRAY
20707 if (open_max > 0) {
20709 for (i = 0; i < open_max; i++)
20710 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20711 STDIO_STREAM_ARRAY[i]._file < open_max &&
20712 STDIO_STREAM_ARRAY[i]._flag)
20713 fflush(&STDIO_STREAM_ARRAY[i]);
20721 : first we have to find out how _not_ to flush
20723 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20725 set try -DTRY_FPUTC
20726 if eval $compile; then
20727 $run ./try 2>/dev/null
20730 if $test ! -s try.out -a "X$code" = X42; then
20736 set try -DTRY_FPRINTF
20737 if eval $compile; then
20738 $run ./try 2>/dev/null
20741 if $test ! -s try.out -a "X$code" = X42; then
20742 output=-DTRY_FPRINTF
20748 : check for fflush NULL behavior
20749 case "$fflushNULL" in
20750 '') set try -DTRY_FFLUSH_NULL $output
20751 if eval $compile; then
20752 $run ./try 2>/dev/null
20755 if $test -s try.out -a "X$code" = X42; then
20756 fflushNULL="`$cat try.out`"
20758 if $test "X$code" != X42; then
20760 (If this test failed, don't worry, we'll try another method shortly.)
20765 $rm -f core try.core core.try.*
20766 case "$fflushNULL" in
20768 Your fflush(NULL) works okay for output streams.
20769 Let's see if it clobbers input pipes...
20771 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20772 # bug that improperly flushes the input end of pipes. So we avoid the
20773 # autoflush on fork/system/exec support for now. :-(
20774 $cat >tryp.c <<EOCP
20777 main(int argc, char **argv)
20783 while ((i = getc(stdin)) != -1
20784 && (*bp++ = i) != '\n'
20785 && bp < &buf[1024])
20788 fprintf(stdout, "%s", buf);
20796 fflushNULL="$define"
20798 if eval $compile; then
20800 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20801 if $test "X$targethost" != X; then
20804 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20806 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20808 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20810 fflush(NULL) seems to behave okay with input streams.
20812 fflushNULL="$define"
20815 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20817 fflushNULL="$undef"
20820 $rm -f core tryp.c tryp.core core.tryp.*
20823 Your fflush(NULL) isn't working (contrary to ANSI C).
20825 fflushNULL="$undef"
20828 Cannot figure out whether your fflush(NULL) works or not.
20829 I'm assuming it doesn't (contrary to ANSI C).
20831 fflushNULL="$undef"
20835 $define|true|[yY]*)
20836 fflushNULL="$define"
20839 fflushNULL="$undef"
20842 : check explicit looping only if NULL did not work, and if the pipe
20843 : bug does not show up on an explicit flush too
20844 case "$fflushNULL" in
20846 $cat >tryp.c <<EOCP
20849 main(int argc, char **argv)
20855 while ((i = getc(stdin)) != -1
20856 && (*bp++ = i) != '\n'
20857 && bp < &buf[1024])
20860 fprintf(stdout, "%s", buf);
20869 if eval $compile; then
20871 if $test "X$targethost" != X; then
20874 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20876 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20878 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20880 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20882 : now check for fflushall behaviour
20883 case "$fflushall" in
20884 '') set try -DTRY_FFLUSH_ALL $output
20885 if eval $compile; then
20887 (Now testing the other method--but note that this also may fail.)
20889 $run ./try 2>/dev/null
20892 if $test -s try.out -a "X$code" = X42; then
20893 fflushall="`$cat try.out`"
20897 case "$fflushall" in
20899 Whew. Flushing explicitly all the stdio streams works.
20901 fflushall="$define"
20904 Sigh. Flushing explicitly all the stdio streams doesn't work.
20909 Cannot figure out whether flushing stdio streams explicitly works or not.
20910 I'm assuming it doesn't.
20916 "$define"|true|[yY]*)
20917 fflushall="$define"
20925 All is futile. Even fflush(stdin) clobbers input pipes!
20932 $rm -f core tryp.c tryp.core core.tryp.*
20934 *) fflushall="$undef"
20938 case "$fflushNULL$fflushall" in
20941 OK, I give up. I cannot figure out how to flush pending stdio output.
20942 We won't be flushing handles at all before fork/exec/popen.
20948 : Store the full pathname to the ar program for use in the C program
20949 : Respect a hint or command line value for full_ar.
20954 : Store the full pathname to the sed program for use in the C program
20957 : see what type gids are declared as in the kernel
20959 echo "Looking for the type for group ids returned by getgid()."
20960 set gid_t gidtype xxx stdio.h sys/types.h
20964 xxx=`./findhdr sys/user.h`
20965 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20967 unsigned) dflt="$1 $2" ;;
20971 *) dflt="$gidtype";;
20974 gid_t) echo "gid_t found." ;;
20975 *) rp="What is the type for group ids returned by getgid()?"
20981 : Check the size of GID
20984 *_t) zzz="$gidtype" ;;
20987 echo "Checking the size of $zzz..." >&4
20989 #include <sys/types.h>
20991 #$i_stdlib I_STDLIB
20993 #include <stdlib.h>
20996 printf("%d\n", (int)sizeof($gidtype));
21001 if eval $compile_ok; then
21005 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21008 echo "Your $zzz is $gidsize bytes long."
21013 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21017 : Check if GID is signed
21020 *_t) zzz="$gidtype" ;;
21023 echo "Checking the sign of $zzz..." >&4
21025 #include <sys/types.h>
21036 if eval $compile; then
21040 echo "(I can't execute the test program--guessing unsigned.)" >&4
21044 1) echo "Your $zzz is unsigned." ;;
21045 -1) echo "Your $zzz is signed." ;;
21051 echo "(I can't compile the test program--guessing unsigned.)" >&4
21055 : Check 64bit sizes
21058 if $test X"$quadtype" != X; then
21060 echo "Checking how to print 64-bit integers..." >&4
21062 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21063 $cat >try.c <<'EOCP'
21064 #include <sys/types.h>
21067 int q = 12345678901;
21068 printf("%ld\n", q);
21072 if eval $compile; then
21076 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21077 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21078 echo "We will use %d."
21084 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21085 $cat >try.c <<'EOCP'
21086 #include <sys/types.h>
21089 long q = 12345678901;
21090 printf("%ld\n", q);
21094 if eval $compile; then
21098 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21099 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21100 echo "We will use %ld."
21106 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21107 $cat >try.c <<'EOCP'
21108 #include <sys/types.h>
21109 #include <inttypes.h>
21112 int64_t q = 12345678901;
21113 printf("%" PRId64 "\n", q);
21117 if eval $compile; then
21121 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21122 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21123 echo "We will use the C9X style."
21129 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21131 #include <sys/types.h>
21134 $quadtype q = 12345678901;
21135 printf("%Ld\n", q);
21139 if eval $compile; then
21143 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21144 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21145 echo "We will use %Ld."
21151 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21152 $cat >try.c <<'EOCP'
21153 #include <sys/types.h>
21156 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21157 printf("%lld\n", q);
21161 if eval $compile; then
21165 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21166 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21167 echo "We will use the %lld style."
21173 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21175 #include <sys/types.h>
21178 $quadtype q = 12345678901;
21179 printf("%qd\n", q);
21183 if eval $compile; then
21187 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21188 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21189 echo "We will use %qd."
21195 if $test X"$sPRId64" = X; then
21196 echo "Cannot figure out how to print 64-bit integers." >&4
21203 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21204 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21206 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21207 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21211 : Check format strings for internal types
21213 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21215 if $test X"$ivsize" = X8; then
21216 ivdformat="$sPRId64"
21217 uvuformat="$sPRIu64"
21218 uvoformat="$sPRIo64"
21219 uvxformat="$sPRIx64"
21220 uvXUformat="$sPRIXU64"
21222 if $test X"$ivsize" = X"$longsize"; then
21229 if $test X"$ivsize" = X"$intsize"; then
21237 if $test X"$ivsize" = X"$shortsize"; then
21248 if $test X"$usequadmath" = X"$define"; then
21256 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21257 nveformat="$sPRIeldbl"
21258 nvfformat="$sPRIfldbl"
21259 nvgformat="$sPRIgldbl"
21260 nvEUformat="$sPRIEUldbl"
21261 nvFUformat="$sPRIFUldbl"
21262 nvGUformat="$sPRIGUldbl"
21273 case "$ivdformat" in
21274 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21279 : Check format string for GID
21282 $echo "Checking the format string to be used for gids..." >&4
21285 -1) if $test X"$gidsize" = X"$ivsize"; then
21286 gidformat="$ivdformat"
21288 if $test X"$gidsize" = X"$longsize"; then
21291 if $test X"$gidsize" = X"$intsize"; then
21294 if $test X"$gidsize" = X"$shortsize"; then
21301 *) if $test X"$gidsize" = X"$uvsize"; then
21302 gidformat="$uvuformat"
21304 if $test X"$gidsize" = X"$longsize"; then
21307 if $test X"$gidsize" = X"$intsize"; then
21310 if $test X"$gidsize" = X"$shortsize"; then
21319 : see if getgroups exists
21320 set getgroups d_getgrps
21323 : see if setgroups exists
21324 set setgroups d_setgrps
21327 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21329 case "$d_getgrps$d_setgrps" in
21331 case "$groupstype" in
21332 '') dflt="$gidtype" ;;
21333 *) dflt="$groupstype" ;;
21336 What type of pointer is the second argument to getgroups() and setgroups()?
21337 Usually this is the same as group ids, $gidtype, but not always.
21340 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21344 *) groupstype="$gidtype";;
21347 : check whether make sets MAKE
21349 echo "Checking if your $make program sets \$(MAKE)..." >&4
21350 case "$make_set_make" in
21352 $sed 's/^X //' > testmake.mak << 'EOF'
21354 X @echo 'maketemp="$(MAKE)"'
21356 case "`$make -f testmake.mak 2>/dev/null`" in
21357 *maketemp=*) make_set_make='#' ;;
21358 *) make_set_make="MAKE=$make" ;;
21360 $rm -f testmake.mak
21363 case "$make_set_make" in
21364 '#') echo "Yup, it does.";;
21365 *) echo "Nope, it doesn't.";;
21368 : see what type is used for mode_t
21369 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21370 set mode_t modetype int stdio.h sys/types.h
21373 : see if we need va_copy
21376 #include <stdarg.h>
21378 #include <stdlib.h>
21379 #include <signal.h>
21382 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21384 return vfprintf(f, fmt, *valp);
21388 myvfprintf(FILE *f, const char *fmt, va_list val)
21390 return ivfprintf(f, fmt, &val);
21394 myprintf(char *fmt, ...)
21397 va_start(val, fmt);
21398 return myvfprintf(stdout, fmt, val);
21402 main(int ac, char **av)
21404 signal(SIGSEGV, exit);
21406 myprintf("%s%cs all right, then\n", "that", '\'');
21411 if eval $compile && $run ./try 2>&1 >/dev/null; then
21412 case "`$run ./try`" in
21413 "that's all right, then")
21419 yes) echo "It seems that you don't need va_copy()." >&4
21420 need_va_copy="$undef"
21422 *) echo "It seems that va_copy() or similar will be needed." >&4
21423 need_va_copy="$define"
21428 : see what type is used for size_t
21429 rp="What is the type used for the length parameter for string functions?"
21430 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21433 : check for type of arguments to gethostbyaddr.
21434 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21435 case "$d_gethbyaddr" in
21439 Checking to see what type of arguments are accepted by gethostbyaddr().
21441 hdrs="$define sys/types.h
21442 $d_socket sys/socket.h
21443 $i_niin netinet/in.h
21445 $i_unistd unistd.h"
21446 : The first arg can 'char *' or 'void *'
21447 : The second arg is some of integral type
21448 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21449 for yyy in size_t long int; do
21450 case "$netdb_host_type" in
21451 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21452 if ./protochk "$try" $hdrs; then
21453 echo "Your system accepts $xxx for the first arg."
21454 echo "...and $yyy for the second arg."
21455 netdb_host_type="$xxx"
21456 netdb_hlen_type="$yyy"
21462 : In case none of those worked, prompt the user.
21463 case "$netdb_host_type" in
21464 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21467 netdb_host_type=$ans
21468 rp='What is the type for the 2nd argument to gethostbyaddr?'
21471 netdb_hlen_type=$ans
21475 *) : no gethostbyaddr, so pick harmless defaults
21476 netdb_host_type='char *'
21477 netdb_hlen_type="$sizetype"
21480 # Remove the "const" if needed. -- but then we'll have a
21482 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21485 : check for type of argument to gethostbyname.
21486 if test "X$netdb_name_type" = X ; then
21487 case "$d_gethbyname" in
21491 Checking to see what type of argument is accepted by gethostbyname().
21493 hdrs="$define sys/types.h
21494 $d_socket sys/socket.h
21495 $i_niin netinet/in.h
21497 $i_unistd unistd.h"
21498 for xxx in "const char *" "char *"; do
21499 case "$netdb_name_type" in
21500 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21501 if ./protochk "$try" $hdrs; then
21502 echo "Your system accepts $xxx."
21503 netdb_name_type="$xxx"
21508 : In case none of those worked, prompt the user.
21509 case "$netdb_name_type" in
21510 '') rp='What is the type for the 1st argument to gethostbyname?'
21513 netdb_name_type=$ans
21517 *) : no gethostbyname, so pick harmless default
21518 netdb_name_type='char *'
21523 : check for type of 1st argument to getnetbyaddr.
21524 if test "X$netdb_net_type" = X ; then
21525 case "$d_getnbyaddr" in
21529 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21531 hdrs="$define sys/types.h
21532 $d_socket sys/socket.h
21533 $i_niin netinet/in.h
21535 $i_unistd unistd.h"
21536 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21537 case "$netdb_net_type" in
21538 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21539 if ./protochk "$try" $hdrs; then
21540 echo "Your system accepts $xxx."
21541 netdb_net_type="$xxx"
21546 : In case none of those worked, prompt the user.
21547 case "$netdb_net_type" in
21548 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21551 netdb_net_type=$ans
21555 *) : no getnetbyaddr, so pick harmless default
21556 netdb_net_type='long'
21560 : locate the preferred pager for this system
21567 [a-zA-Z]:/*) dflt=$pg;;
21571 [a-zA-Z]:/*) dflt=$more;;
21575 [a-zA-Z]:/*) dflt=$less;;
21578 '') dflt=/usr/ucb/more;;
21586 rp='What pager is used on your system?'
21590 : see if ar generates random libraries by itself
21592 echo "Checking how to generate random libraries on your machine..." >&4
21593 echo 'int bar1() { return bar2(); }' > bar1.c
21594 echo 'int bar2() { return 2; }' > bar2.c
21596 #$i_stdlib I_STDLIB
21598 #include <stdlib.h>
21600 int main() { printf("%d\n", bar1()); exit(0); }
21602 $cc $ccflags -c bar1.c >/dev/null 2>&1
21603 $cc $ccflags -c bar2.c >/dev/null 2>&1
21604 $cc $ccflags -c foo.c >/dev/null 2>&1
21605 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21606 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21607 $run ./foobar >/dev/null 2>&1; then
21608 echo "$ar appears to generate random libraries itself."
21610 if [ "X$ranlib" = "X" ]; then
21613 elif $ar s bar$_a >/dev/null 2>&1 &&
21614 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21615 $run ./foobar >/dev/null 2>&1; then
21616 echo "a table of contents needs to be added with '$ar s'."
21619 elif $ar ts bar$_a >/dev/null 2>&1 &&
21620 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21621 $run ./foobar >/dev/null 2>&1; then
21622 echo "a table of contents needs to be added with '$ar ts'."
21629 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21630 $test -f $ranlib || ranlib=''
21633 if $test -n "$ranlib"; then
21634 echo "your system has '$ranlib'; we'll use that."
21637 echo "your system doesn't seem to support random libraries"
21638 echo "so we'll use lorder and tsort to order the libraries."
21645 : see if this is a values.h system
21646 set values.h i_values
21649 : Check the max offset that gmtime and localtime accept
21650 echo "Checking max offsets that gmtime () accepts"
21653 define) yyy="#include <values.h>" ;;
21657 case "$sGMTIME_min/$sGMTIME_max" in
21660 #include <sys/types.h>
21669 void gm_check (time_t t, int min_year, int max_year)
21672 if ( tmp == NULL ||
21673 /* Check tm_year overflow */
21674 tmp->tm_year < min_year || tmp->tm_year > max_year)
21685 gm_check (MAXLONG, 69, 0x7fffffff);
21687 if (tmp == NULL || tmp->tm_year < 0) {
21688 for (i = 63; i >= 0; i--) {
21689 time_t x = pt | ((time_t)1 << i);
21690 if (x < 0 || x < pt) continue;
21691 gm_check (x, 69, 0x7fffffff);
21694 printf ("sGMTIME_max=%ld\n", pt);
21703 gm_check (MINLONG, -1900, 70);
21706 for (i = 36; i >= 0; i--) {
21707 time_t x = pt - ((time_t)1 << i);
21708 if (x > 0) continue;
21709 gm_check (x, -1900, 70);
21712 printf ("sGMTIME_min=%ld\n", pt);
21716 int main (int argc, char *argv[])
21718 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21725 if eval $compile; then
21726 eval `$run ./try 2>/dev/null`
21728 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21734 echo "Checking max offsets that localtime () accepts"
21736 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21739 #include <sys/types.h>
21748 void local_check (time_t t, int min_year, int max_year)
21750 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21753 tmp = localtime (&t);
21754 if ( tmp == NULL ||
21755 /* Check tm_year overflow */
21756 tmp->tm_year < min_year || tmp->tm_year > max_year)
21760 } /* local_check */
21767 local_check (MAXLONG, 69, 0x7fffffff);
21769 if (tmp == NULL || tmp->tm_year < 0) {
21770 for (i = 63; i >= 0; i--) {
21771 time_t x = pt | ((time_t)1 << i);
21772 if (x < 0 || x < pt) continue;
21773 local_check (x, 69, 0x7fffffff);
21776 printf ("sLOCALTIME_max=%ld\n", pt);
21785 local_check (MINLONG, -1900, 70);
21788 for (i = 36; i >= 0; i--) {
21789 time_t x = pt - ((time_t)1 << i);
21790 if (x > 0) continue;
21791 local_check (x, -1900, 70);
21794 printf ("sLOCALTIME_min=%ld\n", pt);
21798 int main (int argc, char *argv[])
21806 if eval $compile; then
21807 eval `$run ./try 2>/dev/null`
21809 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21815 : check for type of arguments to select.
21816 case "$selecttype" in
21817 '') case "$d_select" in
21821 Checking to see what type of arguments are accepted by select().
21823 hdrs="$define sys/types.h
21824 $i_systime sys/time.h
21825 $i_sysselct sys/select.h
21826 $d_socket sys/socket.h"
21827 : The first arg can be int, unsigned, or size_t
21828 : The last arg may or may not be 'const'
21830 : void pointer has been seen but using that
21831 : breaks the selectminbits test
21832 for xxx in 'fd_set *' 'int *'; do
21833 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21834 for tmo in 'struct timeval *' 'const struct timeval *'; do
21836 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21837 if ./protochk "$try" $hdrs; then
21838 echo "Your system accepts $xxx."
21847 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21848 case "$d_fd_set" in
21849 $define) dflt="fd_set *" ;;
21858 *) : no select, so pick a harmless default
21865 : check for the select 'width'
21866 case "$selectminbits" in
21867 '') safebits=`expr $ptrsize \* 8`
21868 case "$d_select" in
21872 Checking to see on how many bits at a time your select() operates...
21875 #include <sys/types.h>
21877 #$i_systime I_SYS_TIME
21878 #$i_systimek I_SYS_TIME_KERNEL
21883 # ifdef I_SYS_TIME_KERNEL
21886 # include <sys/time.h>
21887 # ifdef I_SYS_TIME_KERNEL
21891 #$i_sysselct I_SYS_SELECT
21892 #ifdef I_SYS_SELECT
21893 #include <sys/select.h>
21895 #$d_socket HAS_SOCKET
21897 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21900 #$i_stdlib I_STDLIB
21902 #include <stdlib.h>
21905 #define S sizeof(*(b))
21907 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21908 #define NBITS (NBYTES * 8)
21910 char *s = (char *)malloc(NBYTES);
21919 fp = fopen("try.c", "r");
21925 b = ($selecttype)s;
21926 for (i = 0; i < NBITS; i++)
21930 select(fd + 1, b, 0, 0, &t);
21931 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21933 printf("%d\n", i + 1);
21938 if eval $compile_ok; then
21939 selectminbits=`$run ./try 2>/dev/null`
21940 case "$selectminbits" in
21942 Cannot figure out on how many bits at a time your select() operates.
21943 I'll play safe and guess it is $safebits bits.
21945 selectminbits=$safebits
21946 bits="$safebits bits"
21949 *) bits="$selectminbits bits" ;;
21951 echo "Your select() operates on $bits at a time." >&4
21953 rp='What is the minimum number of bits your select() operates on?'
21954 case "$byteorder" in
21955 12345678) dflt=64 ;;
21961 selectminbits="$val"
21965 *) : no select, so pick a harmless default
21966 selectminbits=$safebits
21972 : Trace out the files included by signal.h, then look for SIGxxx names.
21973 case "$sig_num_init" in
21975 if [ "X$fieldn" = X ]; then
21976 : Just make some guesses. We check them later.
21977 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21979 xxx=`echo '#include <signal.h>' |
21980 $cppstdin $cppminus $cppflags 2>/dev/null |
21981 $grep '^[ ]*#.*include' |
21982 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21983 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21986 for xx in $xxx /dev/null ; do
21987 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21989 case "$xxxfiles" in
21990 '') xxxfiles=`./findhdr signal.h` ;;
21993 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21994 print substr($2, 4, 20)
21996 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21997 print substr($3, 4, 20)
21999 : Append some common names just in case the awk scan failed.
22000 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22001 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22002 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22003 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22004 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22006 : generate a few handy files for later
22007 $cat > signal.c <<EOCP
22008 #include <sys/types.h>
22009 #include <signal.h>
22010 #$i_stdlib I_STDLIB
22012 #include <stdlib.h>
22017 /* Strange style to avoid deeply-nested #if/#else/#endif */
22020 # define NSIG (_NSIG)
22026 # define NSIG (SIGMAX+1)
22032 # define NSIG (SIG_MAX+1)
22038 # define NSIG (_SIG_MAX+1)
22044 # define NSIG (MAXSIG+1)
22050 # define NSIG (MAX_SIG+1)
22055 # ifdef SIGARRAYSIZE
22056 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22062 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22066 /* Default to some arbitrary number that's big enough to get most
22067 of the common signals.
22073 printf("NSIG %d\n", NSIG);
22079 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22081 printf "#ifdef SIG"; printf $1; printf "\n"
22082 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22083 printf $1; printf ");\n"
22087 printf "#endif /* JUST_NSIG */\n";
22088 printf "exit(0);\n}\n";
22091 $cat >signal.awk <<'EOP'
22092 BEGIN { ndups = 0 }
22093 $1 ~ /^NSIG$/ { nsig = $2 }
22094 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22095 if ($2 > maxsig) { maxsig = $2 }
22096 if (sig_name[$2]) {
22097 dup_name[ndups] = $1
22098 dup_num[ndups] = $2
22110 printf("NSIG %d\n", nsig);
22111 for (n = 1; n < nsig; n++) {
22113 printf("%s %d\n", sig_name[n], sig_num[n])
22116 printf("NUM%d %d\n", n, n)
22119 for (n = 0; n < ndups; n++) {
22120 printf("%s %d\n", dup_name[n], dup_num[n])
22124 $cat >signal_cmd <<EOS
22126 if $test -s signal.lst; then
22127 echo "Using your existing signal.lst file"
22132 $cat >>signal_cmd <<'EOS'
22135 if eval $compile_ok; then
22136 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22137 $uniq | $awk -f signal.awk >signal.lst
22139 echo "(I can't seem be able to compile the whole test program)" >&4
22140 echo "(I'll try it in little pieces.)" >&4
22141 set signal -DJUST_NSIG
22142 if eval $compile_ok; then
22143 $run ./signal$_exe > signal.nsg
22146 echo "I can't seem to figure out how many signals you have." >&4
22147 echo "Guessing 50." >&4
22148 echo 'NSIG 50' > signal.nsg
22150 : Now look at all the signal names, one at a time.
22151 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22152 $cat > signal.c <<EOCP
22153 #include <sys/types.h>
22154 #include <signal.h>
22157 printf("$xx %d\n", SIG${xx});
22162 if eval $compile; then
22163 echo "SIG${xx} found."
22164 $run ./signal$_exe >> signal.ls1
22166 echo "SIG${xx} NOT found."
22169 if $test -s signal.ls1; then
22170 $cat signal.nsg signal.ls1 |
22171 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22175 if $test -s signal.lst; then
22178 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22179 echo 'kill -l' >signal
22180 set X `csh -f <signal`
22184 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22186 echo $@ | $tr ' ' $trnl | \
22187 $awk '{ printf "%s %d\n", $1, ++s; }
22188 END { printf "NSIG %d\n", ++s }' >signal.lst
22190 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22192 chmod a+x signal_cmd
22193 $eunicefix signal_cmd
22197 : generate list of signal names
22198 case "$sig_num_init" in
22201 case "$sig_name_init" in
22203 *) case "$sig_num_init" in
22204 ''|*,*) doinit=yes ;;
22209 echo "Generating a list of signal names and numbers..." >&4
22211 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22212 sig_name=`$awk 'BEGIN { printf "ZERO " }
22213 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22214 sig_num=`$awk 'BEGIN { printf "0 " }
22215 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22216 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22217 !/^NSIG/ { printf "\"%s\", ", $1 }
22218 END { printf "0\n" }' signal.lst`
22219 sig_num_init=`$awk 'BEGIN { printf "0, " }
22220 !/^NSIG/ { printf "%d, ", $2}
22221 END { printf "0\n"}' signal.lst`
22224 echo "The following $sig_count signals are available:"
22226 echo $sig_name | $awk \
22227 'BEGIN { linelen = 0 }
22229 for (i = 1; i <= NF; i++) {
22230 name = "SIG" $i " "
22231 linelen = linelen + length(name)
22232 if (linelen > 70) {
22234 linelen = length(name)
22240 sig_size=`echo $sig_name | awk '{print NF}'`
22241 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22245 : Check size of size
22247 case "$sizetype" in
22248 *_t) zzz="$sizetype" ;;
22249 *) zzz="filesize" ;;
22251 echo "Checking the size of $zzz..." >&4
22253 #include <sys/types.h>
22255 #$i_stdlib I_STDLIB
22257 #include <stdlib.h>
22260 printf("%d\n", (int)sizeof($sizetype));
22265 if eval $compile_ok; then
22269 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22272 echo "Your $zzz size is $sizesize bytes."
22277 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22281 : check for socklen_t
22283 echo "Checking to see if you have socklen_t..." >&4
22285 #include <sys/types.h>
22286 #$d_socket HAS_SOCKET
22288 #include <sys/socket.h>
22290 int main() { socklen_t x = 16; }
22293 if eval $compile; then
22295 echo "You have socklen_t."
22298 echo "You do not have socklen_t."
22299 case "$sizetype" in
22300 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22307 : see if this is a socks.h system
22308 set socks.h i_socks
22311 : check for type of the size argument to socket calls
22312 case "$d_socket" in
22316 Checking to see what type is the last argument of accept().
22319 case "$d_socklen_t" in
22320 "$define") yyy="$yyy socklen_t"
22322 yyy="$yyy $sizetype int long unsigned"
22323 for xxx in $yyy; do
22324 case "$socksizetype" in
22325 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22326 case "$usesocks" in
22328 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22329 echo "Your system accepts '$xxx *' for the last argument of accept()."
22330 socksizetype="$xxx"
22333 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22334 echo "Your system accepts '$xxx *' for the last argument of accept()."
22335 socksizetype="$xxx"
22342 : In case none of those worked, prompt the user.
22343 case "$socksizetype" in
22344 '') rp='What is the type for socket address structure sizes?'
22351 *) : no sockets, so pick relatively harmless default
22356 : see what type is used for signed size_t
22357 set ssize_t ssizetype int stdio.h sys/types.h
22362 #$i_stdlib I_STDLIB
22364 #include <stdlib.h>
22366 #include <sys/types.h>
22367 #define Size_t $sizetype
22368 #define SSize_t $dflt
22371 if (sizeof(Size_t) == sizeof(SSize_t))
22373 else if (sizeof(Size_t) == sizeof(int))
22382 if eval $compile_ok && $run ./try > /dev/null; then
22383 ssizetype=`$run ./try`
22384 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22387 Help! I can't compile and run the ssize_t test program: please enlighten me!
22388 (This is probably a misconfiguration in your system or libraries, and
22389 you really ought to fix it. Still, I'll try anyway.)
22391 I need a type that is the same size as $sizetype, but is guaranteed to
22392 be signed. Common values are ssize_t, int and long.
22395 rp="What signed type is the same size as $sizetype?"
22401 : Check the size of st_ino
22403 $echo "Checking the size of st_ino..." >&4
22404 $cat > try.c <<EOCP
22405 #include <sys/stat.h>
22407 #$i_stdlib I_STDLIB
22409 #include <stdlib.h>
22413 printf("%d\n", (int)sizeof(st.st_ino));
22418 if eval $compile_ok; then
22422 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22424 *) st_ino_size=$val
22425 $echo "Your st_ino is $st_ino_size bytes long."
22430 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22434 : Check if st_ino is signed
22436 $echo "Checking the sign of st_ino..." >&4
22437 $cat > try.c <<EOCP
22438 #include <sys/stat.h>
22443 if (foo.st_ino < 0)
22450 if eval $compile; then
22454 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22456 *) st_ino_sign=$val
22457 case "$st_ino_sign" in
22458 1) $echo "Your st_ino is unsigned." ;;
22459 -1) $echo "Your st_ino is signed." ;;
22465 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22469 : see what type of char stdio uses.
22471 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22472 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22473 echo "Your stdio uses unsigned chars." >&4
22474 stdchar="unsigned char"
22476 echo "Your stdio uses signed chars." >&4
22481 : Check size of UID
22484 *_t) zzz="$uidtype" ;;
22487 echo "Checking the size of $zzz..." >&4
22489 #include <sys/types.h>
22491 #$i_stdlib I_STDLIB
22493 #include <stdlib.h>
22496 printf("%d\n", (int)sizeof($uidtype));
22501 if eval $compile_ok; then
22505 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22508 echo "Your $zzz is $uidsize bytes long."
22513 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22516 : Check if UID is signed
22519 *_t) zzz="$uidtype" ;;
22522 echo "Checking the sign of $zzz..." >&4
22524 #include <sys/types.h>
22535 if eval $compile; then
22539 echo "(I can't execute the test program--guessing unsigned.)" >&4
22543 1) echo "Your $zzz is unsigned." ;;
22544 -1) echo "Your $zzz is signed." ;;
22550 echo "(I can't compile the test program--guessing unsigned.)" >&4
22554 : Check format string for UID
22556 $echo "Checking the format string to be used for uids..." >&4
22559 -1) if $test X"$uidsize" = X"$ivsize"; then
22560 uidformat="$ivdformat"
22562 if $test X"$uidsize" = X"$longsize"; then
22565 if $test X"$uidsize" = X"$intsize"; then
22568 if $test X"$uidsize" = X"$shortsize"; then
22575 *) if $test X"$uidsize" = X"$uvsize"; then
22576 uidformat="$uvuformat"
22578 if $test X"$uidsize" = X"$longsize"; then
22581 if $test X"$uidsize" = X"$intsize"; then
22584 if $test X"$uidsize" = X"$shortsize"; then
22593 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22595 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22596 $cat >try.c <<'EOM'
22597 /* Intentionally a long probe as I'd like to sanity check that the exact
22598 approach is going to work, as thinking it will work, but only having it
22599 part working at runtime is worse than not having it. */
22601 #include <sys/types.h>
22602 #include <sys/sysctl.h>
22603 #include <sys/param.h>
22605 #include <string.h>
22606 #include <stdlib.h>
22607 #include <unistd.h>
22610 main(int argc, char **argv) {
22612 char *argv_leaf = strrchr(argv[0], '/');
22618 mib[1] = KERN_PROC;
22619 mib[2] = KERN_PROC_PATHNAME;
22623 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22627 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22632 if (size < strlen(argv_leaf) + 1) {
22633 fprintf(stderr, "size %lu is too short for a path\n",
22634 (unsigned long) size);
22638 if (size > MAXPATHLEN * MAXPATHLEN) {
22639 fprintf(stderr, "size %lu is too long for a path\n",
22640 (unsigned long) size);
22644 buffer = (char *)malloc(size);
22650 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22655 if (strlen(buffer) + 1 != size) {
22656 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22657 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22662 if (*buffer != '/') {
22663 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22667 if (strstr(buffer, "/./")) {
22668 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22672 if (strstr(buffer, "/../")) {
22673 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22677 buffer_leaf = strrchr(buffer, '/');
22678 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22679 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22691 if eval $compile; then
22692 if $run ./try; then
22693 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22696 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22700 echo "I'm unable to compile the test program." >&4
22701 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22705 set usekernprocpathname
22708 : Determine if we can use _NSGetExecutablePath to find executing program
22710 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22711 $cat >try.c <<'EOM'
22712 /* Intentionally a long probe as I'd like to sanity check that the exact
22713 approach is going to work, as thinking it will work, but only having it
22714 part working at runtime is worse than not having it. */
22715 #include <mach-o/dyld.h>
22717 #include <stdlib.h>
22718 #include <sys/param.h>
22719 #include <string.h>
22722 main(int argc, char **argv) {
22724 uint32_t size = sizeof(buf);
22728 char *argv_leaf = strrchr(argv[0], '/');
22732 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22736 _NSGetExecutablePath(buf, &size);
22737 if (size > MAXPATHLEN * MAXPATHLEN) {
22738 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22739 (unsigned int) size);
22743 buffer = (char *)malloc(size);
22749 result = _NSGetExecutablePath(buffer, &size);
22751 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22752 result, (unsigned int) size);
22756 tidied = realpath(buffer, NULL);
22758 perror("realpath");
22764 if (*tidied != '/') {
22765 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22769 if (strstr(tidied, "/./")) {
22770 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22774 if (strstr(tidied, "/../")) {
22775 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22779 tidied_leaf = strrchr(tidied, '/');
22780 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22781 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22793 if eval $compile; then
22794 if $run ./try; then
22795 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22798 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22801 echo "I'm unable to compile the test program." >&4
22802 echo "I'll assume no _NSGetExecutablePath here." >&4
22805 set usensgetexecutablepath
22808 : Check if site customization support was requested
22809 case "$usesitecustomize" in
22810 $define|true|[Yy]*)
22811 usesitecustomize="$define"
22814 usesitecustomize="$undef"
22818 : determine compiler compiler
22827 if $test -f "$byacc$_exe"; then
22829 comp="byacc or $comp"
22831 if $test -f "$bison$_exe"; then
22832 comp="$comp or bison -y"
22834 rp="Which compiler compiler ($comp) shall I use?"
22843 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22849 : see if this is a assert.h system
22850 set assert.h i_assert
22853 : see if this is a bfd.h system
22857 : see if this is an execinfo.h system
22858 set execinfo.h i_execinfo
22861 : see if this is a fenv.h system
22865 : see if this is a fp.h system
22869 : see if this is a fp_class.h system
22870 set fp_class.h i_fp_class
22873 : see if gdbm.h is available
22878 : see if gdbm_open exists
22879 set gdbm_open d_gdbm_open
22881 case "$d_gdbm_open" in
22884 echo "We won't be including <gdbm.h>"
22893 : see if this is a ieeefp.h system
22894 case "$i_ieeefp" in
22895 '' ) set ieeefp.h i_ieeefp
22900 : see if this is a libutil.h system
22901 set libutil.h i_libutil
22904 : see if mach cthreads are available
22905 if test "X$usethreads" = "X$define"; then
22906 set mach/cthreads.h i_machcthr
22909 i_machcthr="$undef"
22912 : see if memory.h is available.
22917 : See if it conflicts with string.h
22923 $cppstdin $cppflags $cppminus < $strings > mem.h
22924 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
22926 echo "We won't be including <memory.h>."
22936 : see if this is a mntent.h system
22937 set mntent.h i_mntent
22940 : see if net/errno.h is available
22942 set net/errno.h val
22945 : Unfortunately, it causes problems on some systems. Arrgh.
22948 cat > try.c <<'EOM'
22951 #include <net/errno.h>
22957 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22958 echo "We'll be including <net/errno.h>." >&4
22960 echo "We won't be including <net/errno.h>." >&4
22969 : see if netinet/tcp.h is available
22970 set netinet/tcp.h i_netinettcp
22973 : see if this is a poll.h system
22977 : see if this is a prot.h system
22981 : Preprocessor symbols
22983 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22984 $cat <<'EOSH' > Cppsym.know
22985 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22986 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22987 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22988 arch_pwr ardent ARM ARM32 atarist att386 att3b
22989 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22990 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22991 byteorder byte_order
22992 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22993 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22994 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22995 ELF encore EPI EXTENSIONS
22996 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22997 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22998 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22999 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23000 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23001 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23002 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23003 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23004 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23006 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23007 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23008 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23010 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23011 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23012 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23013 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23014 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23015 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23016 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23017 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23018 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23019 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23020 ns32000 ns32016 ns32332 ns32k nsc32000
23021 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23022 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23023 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23024 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23026 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23027 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23028 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23029 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23030 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23031 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23032 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23033 SYSV4 SYSV5 sysV68 sysV88
23034 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23035 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23036 tower32_800 tower32_850 tss
23037 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23038 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23039 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23040 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23041 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23042 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23044 vax venix VMESA vms
23045 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23046 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23049 # Maybe put other stuff here too.
23050 ./tr '-' '_' <<EOSH >>Cppsym.know
23053 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23054 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23055 $cat Cppsym.know > Cppsym.c
23056 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23057 $rm -f Cppsym.a Cppsym.b Cppsym.c
23058 cat <<EOSH > Cppsym
23060 if $test \$# -gt 0; then
23061 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23062 if $test -s Cppsym.got; then
23069 $tr " " "$trnl" | ./Cppsym.try
23075 cat <<EOSH > Cppsym.try
23077 cat <<'EOCP' > try.c
23080 #define STRINGIFY(a) "a"
23082 #if cpp_stuff == 42
23083 #define StGiFy(a) #a
23084 #define STRINGIFY(a) StGiFy(a)
23086 #if $cpp_stuff != 1 && $cpp_stuff != 42
23087 # include "Bletch: How does this C preprocessor stringify macros?"
23093 cat <<'EOSH' >> Cppsym.try
23095 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23096 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23097 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23098 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23100 echo 'return 0;}' >> try.c
23102 cat <<EOSH >> Cppsym.try
23104 case "$osname-$gccversion" in
23105 irix-) ccflags="\$ccflags -woff 1178" ;;
23106 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23108 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23110 chmod +x Cppsym.try
23111 $eunicefix Cppsym.try
23112 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23113 : Add in any Linux cpp "predefined macros":
23114 case "$osname::$gccversion" in
23115 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23117 rm -f $tHdrH'.h' $tHdrH
23119 # Filter out macro arguments, such as Linux's __INT8_C(c)
23120 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23121 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23122 if [ -s $tHdrH'_cppsym.real' ]; then
23123 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23126 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23129 : now check the C compiler for additional symbols
23130 postprocess_cc_v=''
23132 aix) postprocess_cc_v="|$tr , ' '" ;;
23139 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23142 -D*) echo "\$i" | $sed 's/^-D//';;
23143 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23148 postprocess_cc_v=''
23151 ./ccsym > ccsym1.raw
23152 if $test -s ccsym1.raw; then
23153 $sort ccsym1.raw | $uniq >ccsym.raw
23155 mv ccsym1.raw ccsym.raw
23158 $awk '/\=/ { print $0; next }
23159 { print $0"=1" }' ccsym.raw >ccsym.list
23160 $comm -13 Cppsym.true ccsym.list >ccsym.own
23161 $comm -12 Cppsym.true ccsym.list >ccsym.com
23162 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23164 if $test -z ccsym.raw; then
23165 echo "Your C compiler doesn't seem to define any symbols!" >&4
23167 echo "However, your C preprocessor defines the following symbols:"
23170 cppsymbols=`$cat Cppsym.true`
23171 cppsymbols=`echo $cppsymbols`
23172 cppccsymbols="$cppsymbols"
23174 if $test -s ccsym.com; then
23175 echo "Your C compiler and pre-processor define these symbols:"
23176 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23179 cppccsymbols=`$cat ccsym.com`
23180 cppccsymbols=`echo $cppccsymbols`
23181 $test "$silent" || sleep 1
23183 if $test -s ccsym.cpp; then
23184 $test "$also" && echo " "
23185 echo "Your C pre-processor ${also}defines the following symbols:"
23186 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23188 cppsymbols=`$cat ccsym.cpp`
23189 cppsymbols=`echo $cppsymbols`
23190 $test "$silent" || sleep 1
23192 if $test -s ccsym.own; then
23193 $test "$also" && echo " "
23194 echo "Your C compiler ${also}defines the following cpp symbols:"
23195 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23196 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23197 ccsymbols=`$cat ccsym.own`
23198 ccsymbols=`echo $ccsymbols`
23199 $test "$silent" || sleep 1
23203 : add -D_FORTIFY_SOURCE if feasible and not already there
23204 case "$gccversion" in
23205 [4567].*) case "$optimize$ccflags" in
23206 *-O*) case "$ccflags$cppsymbols" in
23207 *_FORTIFY_SOURCE=*) # Don't add it again.
23208 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23210 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23211 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23215 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23219 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23223 : see if this is a termio system
23227 if $test `./findhdr termios.h`; then
23228 set tcsetattr i_termios
23234 "$define") echo "You have POSIX termios.h... good!" >&4;;
23235 *) if ./Cppsym pyr; then
23236 case "`$run /bin/universe`" in
23237 ucb) if $test `./findhdr sgtty.h`; then
23239 echo "<sgtty.h> found." >&4
23241 echo "System is pyramid with BSD universe."
23242 ./warn "<sgtty.h> not found--you could have problems."
23244 *) if $test `./findhdr termio.h`; then
23246 echo "<termio.h> found." >&4
23248 echo "System is pyramid with USG universe."
23249 ./warn "<termio.h> not found--you could have problems."
23253 if $test `./findhdr termio.h`; then
23254 echo "<termio.h> found." >&4
23256 elif $test `./findhdr sgtty.h`; then
23257 echo "<sgtty.h> found." >&4
23260 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23263 if $test `./findhdr sgtty.h`; then
23264 echo "<sgtty.h> found." >&4
23266 elif $test `./findhdr termio.h`; then
23267 echo "<termio.h> found." >&4
23270 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23274 set i_termio; eval $setvar
23275 val=$val2; set i_sgtty; eval $setvar
23276 val=$val3; set i_termios; eval $setvar
23278 : see if stdbool is available
23279 : we want a real compile instead of Inhdr because some Solaris systems
23280 : have stdbool.h, but it can only be used if the compiler indicates it
23281 : is sufficiently c99-compliant.
23285 #include <stdbool.h>
23290 int main(int argc, char **argv)
23296 if eval $compile; then
23297 echo "<stdbool.h> found." >&4
23300 echo "<stdbool.h> NOT found." >&4
23307 : see if stddef is available
23308 set stddef.h i_stddef
23311 : see if stdint is available
23312 set stdint.h i_stdint
23315 : see if sys/access.h is available
23316 set sys/access.h i_sysaccess
23319 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23320 set sys/filio.h i_sysfilio
23323 if $test `./findhdr sys/ioctl.h`; then
23325 echo '<sys/ioctl.h> found.' >&4
23328 if $test $i_sysfilio = "$define"; then
23329 echo '<sys/ioctl.h> NOT found.' >&4
23331 $test $i_sgtty = "$define" && xxx="sgtty.h"
23332 $test $i_termio = "$define" && xxx="termio.h"
23333 $test $i_termios = "$define" && xxx="termios.h"
23334 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23340 : see if socket ioctl defs are in sys/sockio.h
23342 xxx=`./findhdr sys/sockio.h`
23343 if $test "$xxx"; then
23344 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23346 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23349 echo "No socket ioctls found in <sys/sockio.h>." >&4
23354 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23360 : see if this is a syslog.h system
23361 set syslog.h i_syslog
23364 : see if this is a sys/mode.h system
23365 set sys/mode.h i_sysmode
23368 : see if there is a sys/poll.h file
23369 set sys/poll.h i_syspoll
23372 : see if sys/resource.h has to be included
23373 set sys/resource.h i_sysresrc
23376 : see if sys/security.h is available
23377 set sys/security.h i_syssecrt
23380 : see if this is a sys/statvfs.h system
23381 set sys/statvfs.h i_sysstatvfs
23384 : see if this is a sys/un.h system
23385 set sys/un.h i_sysun
23388 : see if this is a sys/utsname.h system
23389 set sys/utsname.h i_sysutsname
23392 : see if this is a syswait system
23393 set sys/wait.h i_syswait
23396 : see if this is a ustat.h system
23397 set ustat.h i_ustat
23400 : see if this is an utime system
23401 set utime.h i_utime
23404 : see if this is a vfork system
23407 set vfork.h i_vfork
23415 : see if wchar.h is present
23416 set wchar.h i_wchar
23421 echo "Looking for extensions..." >&4
23422 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23423 : contain old or inaccurate or duplicate values.
23424 nonxs_extensions=''
23426 : We do not use find because it might not be available.
23427 : We do not just use MANIFEST because the user may have dropped
23428 : some additional extensions into the source tree and expect them
23431 : Function to recursively find available extensions, ignoring DynaLoader
23432 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23433 : In 5.10.1 and later, extensions are stored in directories
23434 : like File-Glob instead of the older File/Glob/.
23438 DynaLoader|dynaload) ;;
23440 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23441 case "$this_ext" in
23442 Scalar/List/Utils) this_ext="List/Util" ;;
23443 PathTools) this_ext="Cwd" ;;
23445 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23446 if $contains " $this_ext " "$tdir/$$.tmp"; then
23448 echo "Duplicate directories detected for extension $xxx" >&4;
23449 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23450 case "$knowitall" in
23458 echo "Ok. Stopping Configure." >&4;
23459 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23462 echo "Ok. You will need to correct config.sh before running make." >&4;
23464 $ls -1 "$xxx" > "$tdir/$$.tmp";
23465 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23466 xs_extensions="$xs_extensions $this_ext";
23467 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23468 xs_extensions="$xs_extensions $this_ext";
23469 elif $test -d "$xxx"; then
23470 nonxs_extensions="$nonxs_extensions $this_ext";
23472 $rm -f "$tdir/$$.tmp";
23480 eval $find_extensions
23484 eval $find_extensions
23488 eval $find_extensions
23489 set X $xs_extensions
23491 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23492 set X $nonxs_extensions
23494 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23496 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23498 : Now see which are supported on this system.
23500 for xxx in $xs_extensions ; do
23504 amigaos) avail_ext="$avail_ext $xxx" ;;
23509 $define) avail_ext="$avail_ext $xxx" ;;
23512 GDBM_File|gdbm_fil)
23514 $define) avail_ext="$avail_ext $xxx" ;;
23517 I18N/Langinfo|i18n_lan)
23518 case "$i_langinfo$d_nl_langinfo" in
23519 $define$define) avail_ext="$avail_ext $xxx" ;;
23523 : XXX Do we need a useipcsysv variable here
23524 case "${d_msg}${d_sem}${d_shm}" in
23525 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23528 NDBM_File|ndbm_fil)
23531 case "$osname-$use64bitint" in
23534 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23537 *) avail_ext="$avail_ext $xxx" ;;
23542 ODBM_File|odbm_fil)
23543 case "${i_dbm}${i_rpcsvcdbm}" in
23545 case "$d_cplusplus" in
23546 define) ;; # delete as a function name will not work
23547 *) case "$osname-$use64bitint" in
23550 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23553 *) avail_ext="$avail_ext $xxx" ;;
23561 case "$useopcode" in
23562 true|define|y) avail_ext="$avail_ext $xxx" ;;
23566 case "$useposix" in
23567 true|define|y) avail_ext="$avail_ext $xxx" ;;
23571 case "$d_socket" in
23572 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23575 Sys/Syslog|sys/syslog)
23577 amigaos) ;; # not really very useful on AmigaOS
23579 : XXX syslog requires socket
23580 case "$d_socket" in
23581 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23587 case "$usethreads" in
23589 case "$use5005threads" in
23590 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23594 threads|threads/shared)
23595 # threads and threads::shared are special cases.
23596 # To stop people from asking "Perl 5.8.0 was supposed
23597 # to have this new fancy threads implementation but my
23598 # perl doesn't have it" and from people trying to
23599 # (re)install the threads module using CPAN.pm and
23600 # CPAN.pm then offering to reinstall Perl 5.8.0,
23601 # the threads.pm and threads/shared.pm will always be
23602 # there, croaking informatively ("you need to rebuild
23603 # all of Perl with threads, sorry") when threads haven't
23604 # been compiled in.
23606 avail_ext="$avail_ext $xxx"
23612 cygwin) avail_ext="$avail_ext $xxx" ;;
23615 XS/APItest|xs/apitest)
23616 # This is just for testing. Skip it unless we have dynamic loading.
23619 $define) avail_ext="$avail_ext $xxx" ;;
23622 XS/Typemap|xs/typemap)
23623 # This is just for testing. Skip it unless we have dynamic loading.
23625 $define) avail_ext="$avail_ext $xxx" ;;
23628 *) avail_ext="$avail_ext $xxx"
23637 case "$onlyextensions" in
23639 *) keepextensions=''
23640 echo "You have requested that only certain extensions be included..." >&4
23641 for i in $onlyextensions; do
23642 case " $avail_ext " in
23644 echo "Keeping extension $i."
23645 keepextensions="$keepextensions $i"
23647 *) echo "Ignoring extension $i." ;;
23650 avail_ext="$keepextensions"
23654 case "$noextensions" in
23656 *) keepextensions=''
23657 echo "You have requested that certain extensions be ignored..." >&4
23658 for i in $avail_ext; do
23659 case " $noextensions " in
23660 *" $i "*) echo "Ignoring extension $i." ;;
23661 *) echo "Keeping extension $i.";
23662 keepextensions="$keepextensions $i"
23666 avail_ext="$keepextensions"
23670 : Now see which nonxs extensions are supported on this system.
23671 : For now assume all are.
23673 for xxx in $nonxs_extensions ; do
23677 *) nonxs_ext="$nonxs_ext $xxx"
23689 A number of extensions are supplied with $package. You may choose to
23690 compile these extensions for dynamic loading (the default), compile
23691 them into the $package executable (static loading), or not include
23692 them at all. Answer "none" to include no extensions.
23693 Note that DynaLoader is always built and need not be mentioned here.
23696 case "$dynamic_ext" in
23698 : Exclude those listed in static_ext
23700 for xxx in $avail_ext; do
23701 case " $static_ext " in
23703 *) dflt="$dflt $xxx" ;;
23710 *) dflt="$dynamic_ext"
23711 # Perhaps we are reusing an old out-of-date config.sh.
23714 if test X"$dynamic_ext" != X"$avail_ext"; then
23716 NOTICE: Your previous config.sh list may be incorrect.
23717 The extensions now available to you are
23719 but the default list from your previous config.sh is
23731 rp="What extensions do you wish to load dynamically?"
23734 none) dynamic_ext=' ' ;;
23735 *) dynamic_ext="$ans" ;;
23738 case "$static_ext" in
23740 : Exclude those already listed in dynamic linking
23742 for xxx in $avail_ext; do
23743 case " $dynamic_ext " in
23745 *) dflt="$dflt $xxx" ;;
23752 *) dflt="$static_ext"
23759 rp="What extensions do you wish to load statically?"
23762 none) static_ext=' ' ;;
23763 *) static_ext="$ans" ;;
23768 A number of extensions are supplied with $package. Answer "none"
23769 to include no extensions.
23770 Note that DynaLoader is always built and need not be mentioned here.
23773 case "$static_ext" in
23774 '') dflt="$avail_ext" ;;
23775 *) dflt="$static_ext"
23776 # Perhaps we are reusing an old out-of-date config.sh.
23779 if test X"$static_ext" != X"$avail_ext"; then
23781 NOTICE: Your previous config.sh list may be incorrect.
23782 The extensions now available to you are
23784 but the default list from your previous config.sh is
23793 : Exclude those that are not xs extensions
23797 rp="What extensions do you wish to include?"
23800 none) static_ext=' ' ;;
23801 *) static_ext="$ans" ;;
23806 # Encode is a special case. If we are building Encode as a static
23807 # extension, we need to explicitly list its subextensions as well.
23808 # For other nested extensions, this is handled automatically by
23809 # the appropriate Makefile.PL.
23810 case " $static_ext " in
23811 *" Encode "*) # Add the subextensions of Encode
23813 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23814 static_ext="$static_ext Encode/$xxx"
23815 known_extensions="$known_extensions Encode/$xxx"
23821 set X $dynamic_ext $static_ext $nonxs_ext
23825 # Sanity check: We require an extension suitable for use with
23826 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23827 # should show up as failures in the test suite, but it's helpful to
23828 # catch them now.) The 'extensions' list is normally sorted
23829 # alphabetically, so we need to accept either
23830 # DB_File ... Fcntl ... IO ....
23831 # or something like
23832 # Fcntl ... NDBM_File ... IO ....
23833 case " $extensions" in
23834 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23835 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23836 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23837 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23838 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23842 : Remove libraries needed only for extensions
23843 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23844 : The exception is SunOS 4.x, which needs them.
23845 case "${osname}X${osvers}" in
23849 *) case "$usedl" in
23850 $define|true|[yY]*)
23851 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23855 *) perllibs="$libs"
23861 : Remove build directory name from cppstdin so it can be used from
23862 : either the present location or the final installed location.
23864 : Get out of the UU directory to get correct path name.
23866 case "$cppstdin" in
23868 echo "Stripping down cppstdin path name"
23874 : end of configuration questions
23876 echo "End of configuration questions."
23879 : back to where it started
23880 if test -d ../UU; then
23884 : configuration may be unconditionally patched via a 'config.arch' file
23885 if $test -f config.arch; then
23886 echo "I see a config.arch file, loading it." >&4
23890 : configuration may be patched via a 'config.over' file
23891 if $test -f config.over; then
23894 rp='I see a config.over file. Do you wish to load it?'
23897 n*) echo "OK, I'll ignore it.";;
23899 echo "Configuration override changes have been loaded."
23904 : in case they want portability, strip down executable paths
23905 case "$d_portable" in
23908 echo "Stripping down executable paths..." >&4
23909 for file in $loclist $trylist; do
23911 eval $file=`basename $temp`
23916 : create config.sh file
23918 echo "Creating config.sh..." >&4
23919 $spitshell <<EOT >config.sh
23922 # This file was produced by running the Configure script. It holds all the
23923 # definitions figured out by Configure. Should you modify one of these values,
23924 # do not forget to propagate your changes by running "Configure -der". You may
23925 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23928 # Package name : $package
23929 # Source directory : $src
23930 # Configuration time: $cf_time
23931 # Configured by : $cf_by
23932 # Target system : $myuname
23935 : Add in command line options if available
23936 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23938 $spitshell <<EOT >>config.sh
23947 Revision='$Revision'
23955 alignbytes='$alignbytes'
23956 aphostname='$aphostname'
23957 api_revision='$api_revision'
23958 api_subversion='$api_subversion'
23959 api_version='$api_version'
23960 api_versionstring='$api_versionstring'
23963 archlibexp='$archlibexp'
23964 archname64='$archname64'
23965 archname='$archname'
23966 archobjs='$archobjs'
23967 asctime_r_proto='$asctime_r_proto'
23976 byteorder='$byteorder'
23978 castflags='$castflags'
23981 cccdlflags='$cccdlflags'
23982 ccdlflags='$ccdlflags'
23984 ccflags_uselargefiles='$ccflags_uselargefiles'
23986 ccsymbols='$ccsymbols'
23987 ccversion='$ccversion'
23989 cf_email='$cf_email'
23991 charbits='$charbits'
23992 charsize='$charsize'
23996 clocktype='$clocktype'
23998 compress='$compress'
23999 contains='$contains'
24003 cpp_stuff='$cpp_stuff'
24004 cppccsymbols='$cppccsymbols'
24005 cppflags='$cppflags'
24007 cppminus='$cppminus'
24009 cppstdin='$cppstdin'
24010 cppsymbols='$cppsymbols'
24011 crypt_r_proto='$crypt_r_proto'
24012 cryptlib='$cryptlib'
24014 ctermid_r_proto='$ctermid_r_proto'
24015 ctime_r_proto='$ctime_r_proto'
24016 d_Gconvert='$d_Gconvert'
24017 d_PRIEUldbl='$d_PRIEUldbl'
24018 d_PRIFUldbl='$d_PRIFUldbl'
24019 d_PRIGUldbl='$d_PRIGUldbl'
24020 d_PRIXU64='$d_PRIXU64'
24021 d_PRId64='$d_PRId64'
24022 d_PRIeldbl='$d_PRIeldbl'
24023 d_PRIfldbl='$d_PRIfldbl'
24024 d_PRIgldbl='$d_PRIgldbl'
24025 d_PRIi64='$d_PRIi64'
24026 d_PRIo64='$d_PRIo64'
24027 d_PRIu64='$d_PRIu64'
24028 d_PRIx64='$d_PRIx64'
24029 d_SCNfldbl='$d_SCNfldbl'
24030 d__fwalk='$d__fwalk'
24031 d_access='$d_access'
24032 d_accessx='$d_accessx'
24036 d_archlib='$d_archlib'
24037 d_asctime64='$d_asctime64'
24038 d_asctime_r='$d_asctime_r'
24043 d_attribute_deprecated='$d_attribute_deprecated'
24044 d_attribute_format='$d_attribute_format'
24045 d_attribute_malloc='$d_attribute_malloc'
24046 d_attribute_nonnull='$d_attribute_nonnull'
24047 d_attribute_noreturn='$d_attribute_noreturn'
24048 d_attribute_pure='$d_attribute_pure'
24049 d_attribute_unused='$d_attribute_unused'
24050 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24051 d_backtrace='$d_backtrace'
24053 d_bsdgetpgrp='$d_bsdgetpgrp'
24054 d_bsdsetpgrp='$d_bsdsetpgrp'
24055 d_builtin_add_overflow='$d_builtin_add_overflow'
24056 d_builtin_choose_expr='$d_builtin_choose_expr'
24057 d_builtin_expect='$d_builtin_expect'
24058 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24059 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24060 d_c99_variadic_macros='$d_c99_variadic_macros'
24061 d_casti32='$d_casti32'
24062 d_castneg='$d_castneg'
24065 d_chroot='$d_chroot'
24066 d_chsize='$d_chsize'
24068 d_clearenv='$d_clearenv'
24069 d_closedir='$d_closedir'
24070 d_cmsghdr_s='$d_cmsghdr_s'
24072 d_copysign='$d_copysign'
24073 d_copysignl='$d_copysignl'
24074 d_cplusplus='$d_cplusplus'
24076 d_crypt_r='$d_crypt_r'
24078 d_ctermid='$d_ctermid'
24079 d_ctermid_r='$d_ctermid_r'
24080 d_ctime64='$d_ctime64'
24081 d_ctime_r='$d_ctime_r'
24082 d_cuserid='$d_cuserid'
24083 d_dbl_dig='$d_dbl_dig'
24084 d_dbminitproto='$d_dbminitproto'
24085 d_difftime64='$d_difftime64'
24086 d_difftime='$d_difftime'
24087 d_dir_dd_fd='$d_dir_dd_fd'
24089 d_dirnamlen='$d_dirnamlen'
24090 d_dladdr='$d_dladdr'
24091 d_dlerror='$d_dlerror'
24092 d_dlopen='$d_dlopen'
24093 d_dlsymun='$d_dlsymun'
24094 d_dosuid='$d_dosuid'
24095 d_double_has_inf='$d_double_has_inf'
24096 d_double_has_nan='$d_double_has_nan'
24097 d_double_has_negative_zero='$d_double_has_negative_zero'
24098 d_double_has_subnormals='$d_double_has_subnormals'
24099 d_double_style_cray='$d_double_style_cray'
24100 d_double_style_ibm='$d_double_style_ibm'
24101 d_double_style_ieee='$d_double_style_ieee'
24102 d_double_style_vax='$d_double_style_vax'
24103 d_drand48_r='$d_drand48_r'
24104 d_drand48proto='$d_drand48proto'
24106 d_duplocale='$d_duplocale'
24107 d_eaccess='$d_eaccess'
24108 d_endgrent='$d_endgrent'
24109 d_endgrent_r='$d_endgrent_r'
24110 d_endhent='$d_endhent'
24111 d_endhostent_r='$d_endhostent_r'
24112 d_endnent='$d_endnent'
24113 d_endnetent_r='$d_endnetent_r'
24114 d_endpent='$d_endpent'
24115 d_endprotoent_r='$d_endprotoent_r'
24116 d_endpwent='$d_endpwent'
24117 d_endpwent_r='$d_endpwent_r'
24118 d_endsent='$d_endsent'
24119 d_endservent_r='$d_endservent_r'
24120 d_eofnblk='$d_eofnblk'
24123 d_eunice='$d_eunice'
24126 d_faststdio='$d_faststdio'
24127 d_fchdir='$d_fchdir'
24128 d_fchmod='$d_fchmod'
24129 d_fchmodat='$d_fchmodat'
24130 d_fchown='$d_fchown'
24132 d_fcntl_can_lock='$d_fcntl_can_lock'
24133 d_fd_macros='$d_fd_macros'
24134 d_fd_set='$d_fd_set'
24135 d_fdclose='$d_fdclose'
24137 d_fds_bits='$d_fds_bits'
24138 d_fegetround='$d_fegetround'
24139 d_fgetpos='$d_fgetpos'
24140 d_finite='$d_finite'
24141 d_finitel='$d_finitel'
24142 d_flexfnam='$d_flexfnam'
24144 d_flockproto='$d_flockproto'
24149 d_fp_class='$d_fp_class'
24150 d_fp_classify='$d_fp_classify'
24151 d_fp_classl='$d_fp_classl'
24152 d_fpathconf='$d_fpathconf'
24153 d_fpclass='$d_fpclass'
24154 d_fpclassify='$d_fpclassify'
24155 d_fpclassl='$d_fpclassl'
24156 d_fpgetround='$d_fpgetround'
24157 d_fpos64_t='$d_fpos64_t'
24158 d_freelocale='$d_freelocale'
24159 d_frexpl='$d_frexpl'
24160 d_fs_data_s='$d_fs_data_s'
24161 d_fseeko='$d_fseeko'
24162 d_fsetpos='$d_fsetpos'
24163 d_fstatfs='$d_fstatfs'
24164 d_fstatvfs='$d_fstatvfs'
24166 d_ftello='$d_ftello'
24168 d_futimes='$d_futimes'
24169 d_gai_strerror='$d_gai_strerror'
24170 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24171 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24172 d_getaddrinfo='$d_getaddrinfo'
24173 d_getcwd='$d_getcwd'
24174 d_getespwnam='$d_getespwnam'
24175 d_getfsstat='$d_getfsstat'
24176 d_getgrent='$d_getgrent'
24177 d_getgrent_r='$d_getgrent_r'
24178 d_getgrgid_r='$d_getgrgid_r'
24179 d_getgrnam_r='$d_getgrnam_r'
24180 d_getgrps='$d_getgrps'
24181 d_gethbyaddr='$d_gethbyaddr'
24182 d_gethbyname='$d_gethbyname'
24183 d_gethent='$d_gethent'
24184 d_gethname='$d_gethname'
24185 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24186 d_gethostbyname_r='$d_gethostbyname_r'
24187 d_gethostent_r='$d_gethostent_r'
24188 d_gethostprotos='$d_gethostprotos'
24189 d_getitimer='$d_getitimer'
24190 d_getlogin='$d_getlogin'
24191 d_getlogin_r='$d_getlogin_r'
24192 d_getmnt='$d_getmnt'
24193 d_getmntent='$d_getmntent'
24194 d_getnameinfo='$d_getnameinfo'
24195 d_getnbyaddr='$d_getnbyaddr'
24196 d_getnbyname='$d_getnbyname'
24197 d_getnent='$d_getnent'
24198 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24199 d_getnetbyname_r='$d_getnetbyname_r'
24200 d_getnetent_r='$d_getnetent_r'
24201 d_getnetprotos='$d_getnetprotos'
24202 d_getpagsz='$d_getpagsz'
24203 d_getpbyname='$d_getpbyname'
24204 d_getpbynumber='$d_getpbynumber'
24205 d_getpent='$d_getpent'
24206 d_getpgid='$d_getpgid'
24207 d_getpgrp2='$d_getpgrp2'
24208 d_getpgrp='$d_getpgrp'
24209 d_getppid='$d_getppid'
24210 d_getprior='$d_getprior'
24211 d_getprotobyname_r='$d_getprotobyname_r'
24212 d_getprotobynumber_r='$d_getprotobynumber_r'
24213 d_getprotoent_r='$d_getprotoent_r'
24214 d_getprotoprotos='$d_getprotoprotos'
24215 d_getprpwnam='$d_getprpwnam'
24216 d_getpwent='$d_getpwent'
24217 d_getpwent_r='$d_getpwent_r'
24218 d_getpwnam_r='$d_getpwnam_r'
24219 d_getpwuid_r='$d_getpwuid_r'
24220 d_getsbyname='$d_getsbyname'
24221 d_getsbyport='$d_getsbyport'
24222 d_getsent='$d_getsent'
24223 d_getservbyname_r='$d_getservbyname_r'
24224 d_getservbyport_r='$d_getservbyport_r'
24225 d_getservent_r='$d_getservent_r'
24226 d_getservprotos='$d_getservprotos'
24227 d_getspnam='$d_getspnam'
24228 d_getspnam_r='$d_getspnam_r'
24229 d_gettimeod='$d_gettimeod'
24230 d_gmtime64='$d_gmtime64'
24231 d_gmtime_r='$d_gmtime_r'
24232 d_gnulibc='$d_gnulibc'
24233 d_grpasswd='$d_grpasswd'
24234 d_hasmntopt='$d_hasmntopt'
24238 d_ilogbl='$d_ilogbl'
24239 d_inc_version_list='$d_inc_version_list'
24241 d_inetaton='$d_inetaton'
24242 d_inetntop='$d_inetntop'
24243 d_inetpton='$d_inetpton'
24244 d_int64_t='$d_int64_t'
24245 d_ip_mreq='$d_ip_mreq'
24246 d_ip_mreq_source='$d_ip_mreq_source'
24247 d_ipv6_mreq='$d_ipv6_mreq'
24248 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24249 d_isascii='$d_isascii'
24250 d_isblank='$d_isblank'
24251 d_isfinite='$d_isfinite'
24252 d_isfinitel='$d_isfinitel'
24254 d_isinfl='$d_isinfl'
24255 d_isless='$d_isless'
24257 d_isnanl='$d_isnanl'
24258 d_isnormal='$d_isnormal'
24261 d_killpg='$d_killpg'
24262 d_lc_monetary_2008='$d_lc_monetary_2008'
24263 d_lchown='$d_lchown'
24264 d_ldbl_dig='$d_ldbl_dig'
24265 d_ldexpl='$d_ldexpl'
24266 d_lgamma='$d_lgamma'
24267 d_lgamma_r='$d_lgamma_r'
24268 d_libm_lib_version='$d_libm_lib_version'
24269 d_libname_unique='$d_libname_unique'
24271 d_linkat='$d_linkat'
24272 d_llrint='$d_llrint'
24273 d_llrintl='$d_llrintl'
24274 d_llround='$d_llround'
24275 d_llroundl='$d_llroundl'
24276 d_localeconv_l='$d_localeconv_l'
24277 d_localtime64='$d_localtime64'
24278 d_localtime_r='$d_localtime_r'
24279 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24280 d_locconv='$d_locconv'
24285 d_long_double_style_ieee='$d_long_double_style_ieee'
24286 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24287 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24288 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24289 d_long_double_style_vax='$d_long_double_style_vax'
24290 d_longdbl='$d_longdbl'
24291 d_longlong='$d_longlong'
24293 d_lrintl='$d_lrintl'
24294 d_lround='$d_lround'
24295 d_lroundl='$d_lroundl'
24296 d_lseekproto='$d_lseekproto'
24298 d_madvise='$d_madvise'
24299 d_malloc_good_size='$d_malloc_good_size'
24300 d_malloc_size='$d_malloc_size'
24302 d_mbrlen='$d_mbrlen'
24303 d_mbrtowc='$d_mbrtowc'
24304 d_mbstowcs='$d_mbstowcs'
24305 d_mbtowc='$d_mbtowc'
24306 d_memmem='$d_memmem'
24307 d_memrchr='$d_memrchr'
24309 d_mkdtemp='$d_mkdtemp'
24310 d_mkfifo='$d_mkfifo'
24311 d_mkstemp='$d_mkstemp'
24312 d_mkstemps='$d_mkstemps'
24313 d_mktime64='$d_mktime64'
24314 d_mktime='$d_mktime'
24317 d_modflproto='$d_modflproto'
24318 d_mprotect='$d_mprotect'
24320 d_msg_ctrunc='$d_msg_ctrunc'
24321 d_msg_dontroute='$d_msg_dontroute'
24322 d_msg_oob='$d_msg_oob'
24323 d_msg_peek='$d_msg_peek'
24324 d_msg_proxy='$d_msg_proxy'
24325 d_msgctl='$d_msgctl'
24326 d_msgget='$d_msgget'
24327 d_msghdr_s='$d_msghdr_s'
24328 d_msgrcv='$d_msgrcv'
24329 d_msgsnd='$d_msgsnd'
24331 d_munmap='$d_munmap'
24332 d_mymalloc='$d_mymalloc'
24334 d_nanosleep='$d_nanosleep'
24336 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24337 d_nearbyint='$d_nearbyint'
24338 d_newlocale='$d_newlocale'
24339 d_nextafter='$d_nextafter'
24340 d_nexttoward='$d_nexttoward'
24342 d_nl_langinfo='$d_nl_langinfo'
24343 d_nv_preserves_uv='$d_nv_preserves_uv'
24344 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24345 d_off64_t='$d_off64_t'
24346 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24347 d_oldpthreads='$d_oldpthreads'
24348 d_oldsock='$d_oldsock'
24350 d_openat='$d_openat'
24351 d_pathconf='$d_pathconf'
24353 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24354 d_phostname='$d_phostname'
24357 d_portable='$d_portable'
24359 d_prctl_set_name='$d_prctl_set_name'
24360 d_printf_format_null='$d_printf_format_null'
24361 d_procselfexe='$d_procselfexe'
24362 d_pseudofork='$d_pseudofork'
24363 d_pthread_atfork='$d_pthread_atfork'
24364 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24365 d_pthread_yield='$d_pthread_yield'
24366 d_ptrdiff_t='$d_ptrdiff_t'
24368 d_pwchange='$d_pwchange'
24369 d_pwclass='$d_pwclass'
24370 d_pwcomment='$d_pwcomment'
24371 d_pwexpire='$d_pwexpire'
24372 d_pwgecos='$d_pwgecos'
24373 d_pwpasswd='$d_pwpasswd'
24374 d_pwquota='$d_pwquota'
24377 d_querylocale='$d_querylocale'
24378 d_random_r='$d_random_r'
24379 d_re_comp='$d_re_comp'
24380 d_readdir64_r='$d_readdir64_r'
24381 d_readdir='$d_readdir'
24382 d_readdir_r='$d_readdir_r'
24383 d_readlink='$d_readlink'
24385 d_recvmsg='$d_recvmsg'
24386 d_regcmp='$d_regcmp'
24387 d_regcomp='$d_regcomp'
24388 d_remainder='$d_remainder'
24389 d_remquo='$d_remquo'
24390 d_rename='$d_rename'
24391 d_renameat='$d_renameat'
24392 d_rewinddir='$d_rewinddir'
24396 d_sbrkproto='$d_sbrkproto'
24397 d_scalbn='$d_scalbn'
24398 d_scalbnl='$d_scalbnl'
24399 d_sched_yield='$d_sched_yield'
24400 d_scm_rights='$d_scm_rights'
24401 d_seekdir='$d_seekdir'
24402 d_select='$d_select'
24404 d_semctl='$d_semctl'
24405 d_semctl_semid_ds='$d_semctl_semid_ds'
24406 d_semctl_semun='$d_semctl_semun'
24407 d_semget='$d_semget'
24409 d_sendmsg='$d_sendmsg'
24410 d_setegid='$d_setegid'
24411 d_seteuid='$d_seteuid'
24412 d_setgrent='$d_setgrent'
24413 d_setgrent_r='$d_setgrent_r'
24414 d_setgrps='$d_setgrps'
24415 d_sethent='$d_sethent'
24416 d_sethostent_r='$d_sethostent_r'
24417 d_setitimer='$d_setitimer'
24418 d_setlinebuf='$d_setlinebuf'
24419 d_setlocale='$d_setlocale'
24420 d_setlocale_r='$d_setlocale_r'
24421 d_setnent='$d_setnent'
24422 d_setnetent_r='$d_setnetent_r'
24423 d_setpent='$d_setpent'
24424 d_setpgid='$d_setpgid'
24425 d_setpgrp2='$d_setpgrp2'
24426 d_setpgrp='$d_setpgrp'
24427 d_setprior='$d_setprior'
24428 d_setproctitle='$d_setproctitle'
24429 d_setprotoent_r='$d_setprotoent_r'
24430 d_setpwent='$d_setpwent'
24431 d_setpwent_r='$d_setpwent_r'
24432 d_setregid='$d_setregid'
24433 d_setresgid='$d_setresgid'
24434 d_setresuid='$d_setresuid'
24435 d_setreuid='$d_setreuid'
24436 d_setrgid='$d_setrgid'
24437 d_setruid='$d_setruid'
24438 d_setsent='$d_setsent'
24439 d_setservent_r='$d_setservent_r'
24440 d_setsid='$d_setsid'
24441 d_setvbuf='$d_setvbuf'
24444 d_shmatprototype='$d_shmatprototype'
24445 d_shmctl='$d_shmctl'
24447 d_shmget='$d_shmget'
24448 d_sigaction='$d_sigaction'
24449 d_siginfo_si_addr='$d_siginfo_si_addr'
24450 d_siginfo_si_band='$d_siginfo_si_band'
24451 d_siginfo_si_errno='$d_siginfo_si_errno'
24452 d_siginfo_si_fd='$d_siginfo_si_fd'
24453 d_siginfo_si_pid='$d_siginfo_si_pid'
24454 d_siginfo_si_status='$d_siginfo_si_status'
24455 d_siginfo_si_uid='$d_siginfo_si_uid'
24456 d_siginfo_si_value='$d_siginfo_si_value'
24457 d_signbit='$d_signbit'
24458 d_sigprocmask='$d_sigprocmask'
24459 d_sigsetjmp='$d_sigsetjmp'
24460 d_sin6_scope_id='$d_sin6_scope_id'
24461 d_sitearch='$d_sitearch'
24462 d_sockaddr_in6='$d_sockaddr_in6'
24463 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24464 d_sockatmark='$d_sockatmark'
24465 d_sockatmarkproto='$d_sockatmarkproto'
24466 d_socket='$d_socket'
24467 d_socklen_t='$d_socklen_t'
24468 d_sockpair='$d_sockpair'
24469 d_socks5_init='$d_socks5_init'
24470 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24472 d_srand48_r='$d_srand48_r'
24473 d_srandom_r='$d_srandom_r'
24474 d_sresgproto='$d_sresgproto'
24475 d_sresuproto='$d_sresuproto'
24477 d_statblks='$d_statblks'
24478 d_statfs_f_flags='$d_statfs_f_flags'
24479 d_statfs_s='$d_statfs_s'
24480 d_static_inline='$d_static_inline'
24481 d_statvfs='$d_statvfs'
24482 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24483 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24484 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24485 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24486 d_stdio_stream_array='$d_stdio_stream_array'
24487 d_stdiobase='$d_stdiobase'
24488 d_stdstdio='$d_stdstdio'
24489 d_strchr='$d_strchr'
24490 d_strcoll='$d_strcoll'
24491 d_strerrm='$d_strerrm'
24492 d_strerror='$d_strerror'
24493 d_strerror_l='$d_strerror_l'
24494 d_strerror_r='$d_strerror_r'
24495 d_strftime='$d_strftime'
24496 d_strlcat='$d_strlcat'
24497 d_strlcpy='$d_strlcpy'
24498 d_strnlen='$d_strnlen'
24499 d_strtod='$d_strtod'
24500 d_strtol='$d_strtol'
24501 d_strtold='$d_strtold'
24502 d_strtold_l='$d_strtold_l'
24503 d_strtoll='$d_strtoll'
24504 d_strtoq='$d_strtoq'
24505 d_strtoul='$d_strtoul'
24506 d_strtoull='$d_strtoull'
24507 d_strtouq='$d_strtouq'
24508 d_strxfrm='$d_strxfrm'
24509 d_suidsafe='$d_suidsafe'
24510 d_symlink='$d_symlink'
24511 d_syscall='$d_syscall'
24512 d_syscallproto='$d_syscallproto'
24513 d_sysconf='$d_sysconf'
24514 d_sysernlst='$d_sysernlst'
24515 d_syserrlst='$d_syserrlst'
24516 d_system='$d_system'
24517 d_tcgetpgrp='$d_tcgetpgrp'
24518 d_tcsetpgrp='$d_tcsetpgrp'
24519 d_telldir='$d_telldir'
24520 d_telldirproto='$d_telldirproto'
24521 d_tgamma='$d_tgamma'
24522 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24524 d_timegm='$d_timegm'
24526 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24527 d_tm_tm_zone='$d_tm_tm_zone'
24528 d_tmpnam_r='$d_tmpnam_r'
24530 d_truncate='$d_truncate'
24531 d_truncl='$d_truncl'
24532 d_ttyname_r='$d_ttyname_r'
24533 d_tzname='$d_tzname'
24534 d_u32align='$d_u32align'
24535 d_ualarm='$d_ualarm'
24538 d_union_semun='$d_union_semun'
24539 d_unlinkat='$d_unlinkat'
24540 d_unordered='$d_unordered'
24541 d_unsetenv='$d_unsetenv'
24542 d_uselocale='$d_uselocale'
24543 d_usleep='$d_usleep'
24544 d_usleepproto='$d_usleepproto'
24546 d_vendorarch='$d_vendorarch'
24547 d_vendorbin='$d_vendorbin'
24548 d_vendorlib='$d_vendorlib'
24549 d_vendorscript='$d_vendorscript'
24551 d_void_closedir='$d_void_closedir'
24552 d_voidsig='$d_voidsig'
24553 d_voidtty='$d_voidtty'
24555 d_waitpid='$d_waitpid'
24556 d_wcscmp='$d_wcscmp'
24557 d_wcstombs='$d_wcstombs'
24558 d_wcsxfrm='$d_wcsxfrm'
24559 d_wctomb='$d_wctomb'
24560 d_writev='$d_writev'
24563 db_hashtype='$db_hashtype'
24564 db_prefixtype='$db_prefixtype'
24565 db_version_major='$db_version_major'
24566 db_version_minor='$db_version_minor'
24567 db_version_patch='$db_version_patch'
24568 default_inc_excludes_dot='$default_inc_excludes_dot'
24569 direntrytype='$direntrytype'
24572 doubleinfbytes='$doubleinfbytes'
24573 doublekind='$doublekind'
24574 doublemantbits='$doublemantbits'
24575 doublenanbytes='$doublenanbytes'
24576 doublesize='$doublesize'
24578 drand48_r_proto='$drand48_r_proto'
24580 dtraceobject='$dtraceobject'
24581 dtracexnolibs='$dtracexnolibs'
24582 dynamic_ext='$dynamic_ext'
24588 endgrent_r_proto='$endgrent_r_proto'
24589 endhostent_r_proto='$endhostent_r_proto'
24590 endnetent_r_proto='$endnetent_r_proto'
24591 endprotoent_r_proto='$endprotoent_r_proto'
24592 endpwent_r_proto='$endpwent_r_proto'
24593 endservent_r_proto='$endservent_r_proto'
24594 eunicefix='$eunicefix'
24597 extensions='$extensions'
24598 extern_C='$extern_C'
24600 fflushNULL='$fflushNULL'
24601 fflushall='$fflushall'
24603 firstmakefile='$firstmakefile'
24605 fpossize='$fpossize'
24606 fpostype='$fpostype'
24607 freetype='$freetype'
24610 full_csh='$full_csh'
24611 full_sed='$full_sed'
24612 gccansipedantic='$gccansipedantic'
24613 gccosandvers='$gccosandvers'
24614 gccversion='$gccversion'
24615 getgrent_r_proto='$getgrent_r_proto'
24616 getgrgid_r_proto='$getgrgid_r_proto'
24617 getgrnam_r_proto='$getgrnam_r_proto'
24618 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24619 gethostbyname_r_proto='$gethostbyname_r_proto'
24620 gethostent_r_proto='$gethostent_r_proto'
24621 getlogin_r_proto='$getlogin_r_proto'
24622 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24623 getnetbyname_r_proto='$getnetbyname_r_proto'
24624 getnetent_r_proto='$getnetent_r_proto'
24625 getprotobyname_r_proto='$getprotobyname_r_proto'
24626 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24627 getprotoent_r_proto='$getprotoent_r_proto'
24628 getpwent_r_proto='$getpwent_r_proto'
24629 getpwnam_r_proto='$getpwnam_r_proto'
24630 getpwuid_r_proto='$getpwuid_r_proto'
24631 getservbyname_r_proto='$getservbyname_r_proto'
24632 getservbyport_r_proto='$getservbyport_r_proto'
24633 getservent_r_proto='$getservent_r_proto'
24634 getspnam_r_proto='$getspnam_r_proto'
24635 gidformat='$gidformat'
24641 gmtime_r_proto='$gmtime_r_proto'
24642 gnulibc_version='$gnulibc_version'
24644 groupcat='$groupcat'
24645 groupstype='$groupstype'
24648 h_sysfile='$h_sysfile'
24651 hostgenerate='$hostgenerate'
24652 hostosname='$hostosname'
24653 hostperl='$hostperl'
24654 html1dir='$html1dir'
24655 html1direxp='$html1direxp'
24656 html3dir='$html3dir'
24657 html3direxp='$html3direxp'
24666 i_arpainet='$i_arpainet'
24667 i_assert='$i_assert'
24669 i_bsdioctl='$i_bsdioctl'
24673 i_dirent='$i_dirent'
24675 i_execinfo='$i_execinfo'
24680 i_fp_class='$i_fp_class'
24682 i_gdbm_ndbm='$i_gdbm_ndbm'
24683 i_gdbmndbm='$i_gdbmndbm'
24685 i_ieeefp='$i_ieeefp'
24686 i_inttypes='$i_inttypes'
24687 i_langinfo='$i_langinfo'
24688 i_libutil='$i_libutil'
24689 i_limits='$i_limits'
24690 i_locale='$i_locale'
24691 i_machcthr='$i_machcthr'
24692 i_malloc='$i_malloc'
24693 i_mallocmalloc='$i_mallocmalloc'
24695 i_memory='$i_memory'
24696 i_mntent='$i_mntent'
24699 i_neterrno='$i_neterrno'
24700 i_netinettcp='$i_netinettcp'
24704 i_pthread='$i_pthread'
24706 i_quadmath='$i_quadmath'
24707 i_rpcsvcdbm='$i_rpcsvcdbm'
24709 i_shadow='$i_shadow'
24711 i_stdbool='$i_stdbool'
24712 i_stddef='$i_stddef'
24713 i_stdint='$i_stdint'
24714 i_stdlib='$i_stdlib'
24715 i_string='$i_string'
24716 i_sunmath='$i_sunmath'
24717 i_sysaccess='$i_sysaccess'
24718 i_sysdir='$i_sysdir'
24719 i_sysfile='$i_sysfile'
24720 i_sysfilio='$i_sysfilio'
24722 i_sysioctl='$i_sysioctl'
24723 i_syslog='$i_syslog'
24724 i_sysmman='$i_sysmman'
24725 i_sysmode='$i_sysmode'
24726 i_sysmount='$i_sysmount'
24727 i_sysndir='$i_sysndir'
24728 i_sysparam='$i_sysparam'
24729 i_syspoll='$i_syspoll'
24730 i_sysresrc='$i_sysresrc'
24731 i_syssecrt='$i_syssecrt'
24732 i_sysselct='$i_sysselct'
24733 i_syssockio='$i_syssockio'
24734 i_sysstat='$i_sysstat'
24735 i_sysstatfs='$i_sysstatfs'
24736 i_sysstatvfs='$i_sysstatvfs'
24737 i_systime='$i_systime'
24738 i_systimek='$i_systimek'
24739 i_systimes='$i_systimes'
24740 i_systypes='$i_systypes'
24741 i_sysuio='$i_sysuio'
24743 i_sysutsname='$i_sysutsname'
24744 i_sysvfs='$i_sysvfs'
24745 i_syswait='$i_syswait'
24746 i_termio='$i_termio'
24747 i_termios='$i_termios'
24749 i_unistd='$i_unistd'
24752 i_values='$i_values'
24755 i_xlocale='$i_xlocale'
24756 ignore_versioned_solibs='$ignore_versioned_solibs'
24757 inc_version_list='$inc_version_list'
24758 inc_version_list_init='$inc_version_list_init'
24762 initialinstalllocation='$initialinstalllocation'
24763 installarchlib='$installarchlib'
24764 installbin='$installbin'
24765 installhtml1dir='$installhtml1dir'
24766 installhtml3dir='$installhtml3dir'
24767 installman1dir='$installman1dir'
24768 installman3dir='$installman3dir'
24769 installprefix='$installprefix'
24770 installprefixexp='$installprefixexp'
24771 installprivlib='$installprivlib'
24772 installscript='$installscript'
24773 installsitearch='$installsitearch'
24774 installsitebin='$installsitebin'
24775 installsitehtml1dir='$installsitehtml1dir'
24776 installsitehtml3dir='$installsitehtml3dir'
24777 installsitelib='$installsitelib'
24778 installsiteman1dir='$installsiteman1dir'
24779 installsiteman3dir='$installsiteman3dir'
24780 installsitescript='$installsitescript'
24781 installstyle='$installstyle'
24782 installusrbinperl='$installusrbinperl'
24783 installvendorarch='$installvendorarch'
24784 installvendorbin='$installvendorbin'
24785 installvendorhtml1dir='$installvendorhtml1dir'
24786 installvendorhtml3dir='$installvendorhtml3dir'
24787 installvendorlib='$installvendorlib'
24788 installvendorman1dir='$installvendorman1dir'
24789 installvendorman3dir='$installvendorman3dir'
24790 installvendorscript='$installvendorscript'
24792 issymlink='$issymlink'
24793 ivdformat='$ivdformat'
24796 known_extensions='$known_extensions'
24799 ld_can_script='$ld_can_script'
24800 lddlflags='$lddlflags'
24802 ldflags_uselargefiles='$ldflags_uselargefiles'
24803 ldlibpthname='$ldlibpthname'
24810 libsdirs='$libsdirs'
24811 libsfiles='$libsfiles'
24812 libsfound='$libsfound'
24813 libspath='$libspath'
24814 libswanted='$libswanted'
24815 libswanted_uselargefiles='$libswanted_uselargefiles'
24821 localtime_r_proto='$localtime_r_proto'
24822 locincpth='$locincpth'
24823 loclibpth='$loclibpth'
24824 longdblinfbytes='$longdblinfbytes'
24825 longdblkind='$longdblkind'
24826 longdblmantbits='$longdblmantbits'
24827 longdblnanbytes='$longdblnanbytes'
24828 longdblsize='$longdblsize'
24829 longlongsize='$longlongsize'
24830 longsize='$longsize'
24834 lseeksize='$lseeksize'
24835 lseektype='$lseektype'
24839 make_set_make='$make_set_make'
24840 mallocobj='$mallocobj'
24841 mallocsrc='$mallocsrc'
24842 malloctype='$malloctype'
24844 man1direxp='$man1direxp'
24847 man3direxp='$man3direxp'
24849 mips_type='$mips_type'
24850 mistrustnm='$mistrustnm'
24852 mmaptype='$mmaptype'
24853 modetype='$modetype'
24855 multiarch='$multiarch'
24857 myarchname='$myarchname'
24858 mydomain='$mydomain'
24859 myhostname='$myhostname'
24862 need_va_copy='$need_va_copy'
24863 netdb_hlen_type='$netdb_hlen_type'
24864 netdb_host_type='$netdb_host_type'
24865 netdb_name_type='$netdb_name_type'
24866 netdb_net_type='$netdb_net_type'
24869 nm_so_opt='$nm_so_opt'
24870 nonxs_ext='$nonxs_ext'
24872 nvEUformat='$nvEUformat'
24873 nvFUformat='$nvFUformat'
24874 nvGUformat='$nvGUformat'
24875 nv_overflows_integers_at='$nv_overflows_integers_at'
24876 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24877 nveformat='$nveformat'
24878 nvfformat='$nvfformat'
24879 nvgformat='$nvgformat'
24880 nvmantbits='$nvmantbits'
24883 o_nonblock='$o_nonblock'
24885 old_pthread_create_joinable='$old_pthread_create_joinable'
24886 optimize='$optimize'
24887 orderlib='$orderlib'
24890 otherlibdirs='$otherlibdirs'
24894 patchlevel='$patchlevel'
24895 path_sep='$path_sep'
24898 perl_patchlevel='$perl_patchlevel'
24899 perl_static_inline='$perl_static_inline'
24900 perladmin='$perladmin'
24901 perllibs='$perllibs'
24902 perlpath='$perlpath'
24904 phostname='$phostname'
24910 prefixexp='$prefixexp'
24912 privlibexp='$privlibexp'
24913 procselfexe='$procselfexe'
24915 quadkind='$quadkind'
24916 quadtype='$quadtype'
24917 randbits='$randbits'
24918 randfunc='$randfunc'
24919 random_r_proto='$random_r_proto'
24920 randseedtype='$randseedtype'
24922 rd_nodata='$rd_nodata'
24923 readdir64_r_proto='$readdir64_r_proto'
24924 readdir_r_proto='$readdir_r_proto'
24925 revision='$revision'
24931 sGMTIME_max='$sGMTIME_max'
24932 sGMTIME_min='$sGMTIME_min'
24933 sLOCALTIME_max='$sLOCALTIME_max'
24934 sLOCALTIME_min='$sLOCALTIME_min'
24935 sPRIEUldbl='$sPRIEUldbl'
24936 sPRIFUldbl='$sPRIFUldbl'
24937 sPRIGUldbl='$sPRIGUldbl'
24938 sPRIXU64='$sPRIXU64'
24940 sPRIeldbl='$sPRIeldbl'
24941 sPRIfldbl='$sPRIfldbl'
24942 sPRIgldbl='$sPRIgldbl'
24947 sSCNfldbl='$sSCNfldbl'
24948 sched_yield='$sched_yield'
24949 scriptdir='$scriptdir'
24950 scriptdirexp='$scriptdirexp'
24952 seedfunc='$seedfunc'
24953 selectminbits='$selectminbits'
24954 selecttype='$selecttype'
24955 sendmail='$sendmail'
24956 setgrent_r_proto='$setgrent_r_proto'
24957 sethostent_r_proto='$sethostent_r_proto'
24958 setlocale_r_proto='$setlocale_r_proto'
24959 setnetent_r_proto='$setnetent_r_proto'
24960 setprotoent_r_proto='$setprotoent_r_proto'
24961 setpwent_r_proto='$setpwent_r_proto'
24962 setservent_r_proto='$setservent_r_proto'
24965 sharpbang='$sharpbang'
24966 shmattype='$shmattype'
24967 shortsize='$shortsize'
24970 sig_count='$sig_count'
24971 sig_name='$sig_name'
24972 sig_name_init='$sig_name_init'
24974 sig_num_init='$sig_num_init'
24975 sig_size='$sig_size'
24976 signal_t='$signal_t'
24977 sitearch='$sitearch'
24978 sitearchexp='$sitearchexp'
24980 sitebinexp='$sitebinexp'
24981 sitehtml1dir='$sitehtml1dir'
24982 sitehtml1direxp='$sitehtml1direxp'
24983 sitehtml3dir='$sitehtml3dir'
24984 sitehtml3direxp='$sitehtml3direxp'
24986 sitelib_stem='$sitelib_stem'
24987 sitelibexp='$sitelibexp'
24988 siteman1dir='$siteman1dir'
24989 siteman1direxp='$siteman1direxp'
24990 siteman3dir='$siteman3dir'
24991 siteman3direxp='$siteman3direxp'
24992 siteprefix='$siteprefix'
24993 siteprefixexp='$siteprefixexp'
24994 sitescript='$sitescript'
24995 sitescriptexp='$sitescriptexp'
24996 sizesize='$sizesize'
24997 sizetype='$sizetype'
25001 sockethdr='$sockethdr'
25002 socketlib='$socketlib'
25003 socksizetype='$socksizetype'
25005 spackage='$spackage'
25006 spitshell='$spitshell'
25007 srand48_r_proto='$srand48_r_proto'
25008 srandom_r_proto='$srandom_r_proto'
25010 ssizetype='$ssizetype'
25011 st_ino_sign='$st_ino_sign'
25012 st_ino_size='$st_ino_size'
25013 startperl='$startperl'
25015 static_ext='$static_ext'
25017 stdio_base='$stdio_base'
25018 stdio_bufsiz='$stdio_bufsiz'
25019 stdio_cnt='$stdio_cnt'
25020 stdio_filbuf='$stdio_filbuf'
25021 stdio_ptr='$stdio_ptr'
25022 stdio_stream_array='$stdio_stream_array'
25023 strerror_r_proto='$strerror_r_proto'
25026 subversion='$subversion'
25031 targetarch='$targetarch'
25032 targetdir='$targetdir'
25033 targetenv='$targetenv'
25034 targethost='$targethost'
25035 targetmkdir='$targetmkdir'
25036 targetport='$targetport'
25037 targetsh='$targetsh'
25041 timeincl='$timeincl'
25042 timetype='$timetype'
25043 tmpnam_r_proto='$tmpnam_r_proto'
25049 ttyname_r_proto='$ttyname_r_proto'
25058 uidformat='$uidformat'
25064 uquadtype='$uquadtype'
25065 use5005threads='$use5005threads'
25066 use64bitall='$use64bitall'
25067 use64bitint='$use64bitint'
25068 usecbacktrace='$usecbacktrace'
25069 usecrosscompile='$usecrosscompile'
25070 usedevel='$usedevel'
25072 usedtrace='$usedtrace'
25073 usefaststdio='$usefaststdio'
25074 useithreads='$useithreads'
25075 usekernprocpathname='$usekernprocpathname'
25076 uselargefiles='$uselargefiles'
25077 uselongdouble='$uselongdouble'
25078 usemallocwrap='$usemallocwrap'
25079 usemorebits='$usemorebits'
25080 usemultiplicity='$usemultiplicity'
25081 usemymalloc='$usemymalloc'
25083 usensgetexecutablepath='$usensgetexecutablepath'
25084 useopcode='$useopcode'
25085 useperlio='$useperlio'
25086 useposix='$useposix'
25087 usequadmath='$usequadmath'
25088 usereentrant='$usereentrant'
25089 userelocatableinc='$userelocatableinc'
25090 useshrplib='$useshrplib'
25091 usesitecustomize='$usesitecustomize'
25092 usesocks='$usesocks'
25093 usethreads='$usethreads'
25094 usevendorprefix='$usevendorprefix'
25095 useversionedarchname='$useversionedarchname'
25096 usevfork='$usevfork'
25099 uvXUformat='$uvXUformat'
25100 uvoformat='$uvoformat'
25103 uvuformat='$uvuformat'
25104 uvxformat='$uvxformat'
25105 vendorarch='$vendorarch'
25106 vendorarchexp='$vendorarchexp'
25107 vendorbin='$vendorbin'
25108 vendorbinexp='$vendorbinexp'
25109 vendorhtml1dir='$vendorhtml1dir'
25110 vendorhtml1direxp='$vendorhtml1direxp'
25111 vendorhtml3dir='$vendorhtml3dir'
25112 vendorhtml3direxp='$vendorhtml3direxp'
25113 vendorlib='$vendorlib'
25114 vendorlib_stem='$vendorlib_stem'
25115 vendorlibexp='$vendorlibexp'
25116 vendorman1dir='$vendorman1dir'
25117 vendorman1direxp='$vendorman1direxp'
25118 vendorman3dir='$vendorman3dir'
25119 vendorman3direxp='$vendorman3direxp'
25120 vendorprefix='$vendorprefix'
25121 vendorprefixexp='$vendorprefixexp'
25122 vendorscript='$vendorscript'
25123 vendorscriptexp='$vendorscriptexp'
25125 version_patchlevel_string='$version_patchlevel_string'
25126 versiononly='$versiononly'
25130 yaccflags='$yaccflags'
25135 : add special variables
25136 $test -f $src/patchlevel.h && \
25137 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25138 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25139 echo "PERL_CONFIG_SH=true" >>config.sh
25141 : propagate old symbols
25142 if $test -f UU/config.sh; then
25143 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25144 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25145 config.sh config.sh UU/oldconfig.sh |\
25146 $sort | $uniq -u >UU/oldsyms
25147 set X `$cat UU/oldsyms`
25153 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25155 echo ": Variables propagated from previous config.sh file." >>config.sh
25156 for sym in `$cat UU/oldsyms`; do
25157 echo " Propagating $hint variable "'$'"$sym..."
25158 eval 'tmp="$'"${sym}"'"'
25160 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25166 : preserve RCS keywords in files with variable substitution, grrr
25169 : Finish up by extracting the .SH files
25172 echo "Stopping at your request, leaving temporary files around."
25182 If you'd like to make any changes to the config.sh file before I begin
25183 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25186 rp="Press return or use a shell escape to edit config.sh:"
25191 *) : in case they cannot read
25192 sh 1>&4 -c "$ans";;
25197 : if this fails, just run all the .SH files by hand
25206 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25213 Now you need to generate make dependencies by running "$make depend".
25214 You might prefer to run it in background: "$make depend > makedepend.out &"
25215 It can take a while, so you might not want to run it right now.
25220 rp="Run $make depend now?"
25224 $make depend && echo "Now you must run '$make'."
25227 echo "You must run '$make depend' then '$make'."
25230 elif test -f [Mm]akefile; then
25232 echo "Now you must run a $make."
25234 echo "Configure done."
25237 if $test -f Policy.sh; then
25240 If you compile $package on a different machine or from a different object
25241 directory, copy the Policy.sh file from this object directory to the
25242 new one before you run Configure -- this will help you with most of
25243 the policy defaults.
25247 if $test -f UU/config.msg; then
25248 echo "Hmm. I also noted the following information while running:"
25250 $cat UU/config.msg >&4
25252 $rm -f kit*isdone ark*isdone