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
346 useversionedarchname=''
352 initialinstalllocation=''
385 d_attribute_deprecated=''
386 d_attribute_format=''
387 d_attribute_malloc=''
388 d_attribute_nonnull=''
389 d_attribute_noreturn=''
391 d_attribute_unused=''
392 d_attribute_warn_unused_result=''
393 d_printf_format_null=''
395 d_builtin_choose_expr=''
397 d_builtin_add_overflow=''
398 d_builtin_mul_overflow=''
399 d_builtin_sub_overflow=''
400 d_c99_variadic_macros=''
449 endhostent_r_proto=''
455 endprotoent_r_proto=''
461 endservent_r_proto=''
533 gethostbyaddr_r_proto=''
535 gethostbyname_r_proto=''
537 gethostent_r_proto=''
550 getnetbyaddr_r_proto=''
552 getnetbyname_r_proto=''
566 d_getprotobyname_r=''
567 getprotobyname_r_proto=''
568 d_getprotobynumber_r=''
569 getprotobynumber_r_proto=''
571 getprotoent_r_proto=''
583 getservbyname_r_proto=''
585 getservbyport_r_proto=''
587 getservent_r_proto=''
620 d_lc_monetary_2008=''
625 d_libm_lib_version=''
633 d_localtime_r_needs_tzset=''
641 d_long_double_style_ieee=''
642 d_long_double_style_ieee_doubledouble=''
643 d_long_double_style_ieee_extended=''
644 d_long_double_style_ieee_std=''
645 d_long_double_style_vax=''
658 d_malloc_good_size=''
660 d_malloc_usable_size=''
701 d_thread_safe_nl_langinfo_l=''
715 d_old_pthread_create_joinable=''
716 old_pthread_create_joinable=''
718 d_pthread_attr_setscope=''
763 sethostent_r_proto=''
768 d_setlocale_accepts_any_locale_name=''
782 setprotoent_r_proto=''
794 setservent_r_proto=''
807 d_siginfo_si_errno=''
810 d_siginfo_si_status=''
812 d_siginfo_si_value=''
824 d_ipv6_mreq_source=''
853 perl_static_inline=''
858 d_stdio_ptr_lval_nochange_cnt=''
859 d_stdio_ptr_lval_sets_cnt=''
941 default_inc_excludes_dot=''
1007 d_gdbm_ndbm_h_uses_prototypes=''
1008 d_gdbmndbm_h_uses_prototypes=''
1010 d_ndbm_h_uses_prototypes=''
1081 d_inc_version_list=''
1083 inc_version_list_init=''
1091 installusrbinperl=''
1107 ignore_versioned_solibs=''
1123 d_double_has_negative_zero=''
1124 d_double_has_subnormals=''
1125 d_double_style_cray=''
1126 d_double_style_ibm=''
1127 d_double_style_ieee=''
1128 d_double_style_vax=''
1179 d_perl_otherlibdirs=''
1187 api_versionstring=''
1193 version_patchlevel_string=''
1197 d_nv_preserves_uv=''
1198 d_nv_zero_is_allbits_zero=''
1209 nv_overflows_integers_at=''
1210 nv_preserves_uv_bits=''
1282 installsitehtml1dir=''
1285 installsitehtml3dir=''
1292 installsiteman1dir=''
1295 installsiteman3dir=''
1300 installsitescript=''
1318 d_stdio_stream_array=''
1319 stdio_stream_array=''
1337 usekernprocpathname=''
1338 ccflags_uselargefiles=''
1339 ldflags_uselargefiles=''
1340 libswanted_uselargefiles=''
1349 usensgetexecutablepath=''
1362 installvendorarch=''
1369 installvendorhtml1dir=''
1371 vendorhtml1direxp=''
1372 installvendorhtml3dir=''
1374 vendorhtml3direxp=''
1380 installvendorman1dir=''
1383 installvendorman3dir=''
1390 installvendorscript=''
1401 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1404 : We must find out about Eunice early
1406 if test -f /etc/unixtovms; then
1407 eunicefix=/etc/unixtovms
1409 if test -f /etc/unixtovms.exe; then
1410 eunicefix=/etc/unixtovms.exe
1413 : Set executable suffix now -- needed before hints available
1414 if test -f "/libs/version.library"; then
1417 elif test -f "/system/gnu_library/bin/ar.pm"; then
1420 elif test -n "$DJGPP"; then
1423 elif test -f /kern/cookiejar; then
1426 elif test -d c:/. -o -n "$is_os2" ; then
1433 : Possible local include directories to search.
1434 : Set locincpth to "" in a hint file to defeat local include searches.
1435 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1436 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1438 : no include file wanted by default
1441 : Enable -DEBUGGING and -DDEBUGGING from the command line
1445 : Trailing extension. Override this in a hint file, if needed.
1446 : Extra object files, if any, needed on this platform.
1449 : change the next line if compiling for Xenix/286 on Xenix/386
1450 xlibpth='/usr/lib/386 /lib/386'
1451 : Possible local library directories to search.
1452 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1453 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1455 : general looking path for locating libraries
1456 glibpth="/lib /usr/lib $xlibpth"
1457 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1458 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1459 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1460 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1462 : Private path used by Configure to find libraries. Its value
1463 : is prepended to libpth. This variable takes care of special
1464 : machines, like the mips. Usually, it should be empty.
1467 : default library list
1469 : some systems want to use only the non-versioned libso:s
1470 ignore_versioned_solibs=''
1474 : set useposix=false in your hint file to disable the POSIX extension.
1476 : set useopcode=false in your hint file to disable the Opcode extension.
1478 : set uselanginfo=false in your hint file to disable the I18N::Langinfo 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
3510 netbsd*) osname=netbsd
3513 news-os) osvers="$3"
3515 4*) osname=newsos4 ;;
3519 nonstop-ux) osname=nonstopux ;;
3520 openbsd) osname=openbsd
3526 POSIX-BC | posix-bc ) osname=posix-bc
3529 powerux | power_ux | powermax_os | powermaxos | \
3530 powerunix | power_unix) osname=powerux
3536 solaris) osname=solaris
3538 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3545 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3549 titanos) osname=titanos
3558 ultrix) osname=ultrix
3561 osf1|mls+) case "$5" in
3564 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3567 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3570 hp*) osname=hp_osf1 ;;
3571 mips) osname=mips_osf1 ;;
3574 # UnixWare 7.1.2 is known as Open UNIX 8
3575 openunix|unixware) osname=svr5
3583 $2) case "$osname" in
3587 : svr4.x or possibly later
3597 if test -f /stand/boot ; then
3598 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3599 if test -n "$INITPROG" -a -f "$INITPROG"; then
3600 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3601 if test -n "$isesix"; then
3609 *) if test -f /etc/systemid; then
3611 set `echo $3 | $sed 's/\./ /g'` $4
3612 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3614 elif $test -f $src/hints/sco_$1_$2.sh; then
3616 elif $test -f $src/hints/sco_$1.sh; then
3621 '') : Still unknown. Probably a generic Sys V.
3630 *) case "$osname" in
3631 '') : Still unknown. Probably a generic BSD.
3639 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3640 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3641 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3644 $rm -f UU/kernel.what
3645 elif test -d c:/. -o -n "$is_os2" ; then
3652 case "$targetarch" in
3655 case "$targetarch" in
3657 # Will load qnx.sh, which should change osname to nto
3662 # Catch arm-linux-androideabi, mipsel-linux-android,
3663 # and i686-linux-android
3664 osname=linux-android
3668 # Something like arm-linux-gnueabihf is really just
3675 # XXX perhaps we should just assume
3676 # osvers to be 2, or maybe take the value
3677 # from targetarch. Using $run before the
3678 # hints are run is somewhat icky.
3679 set X `$run $uname -a 2>/dev/null`
3682 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3687 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3694 : Now look for a hint file osname_osvers, unless one has been
3695 : specified already.
3698 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3699 : Also try without trailing minor version numbers.
3700 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3701 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3702 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3703 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3706 *) case "$osvers" in
3709 *) if $test -f $src/hints/$file.sh ; then
3711 elif $test -f $src/hints/$xfile.sh ; then
3713 elif $test -f $src/hints/$xxfile.sh ; then
3715 elif $test -f $src/hints/$xxxfile.sh ; then
3717 elif $test -f $src/hints/$xxxxfile.sh ; then
3719 elif $test -f "$src/hints/${osname}.sh" ; then
3728 if $test -f Policy.sh ; then
3731 none) dflt="Policy" ;;
3732 *) dflt="Policy $dflt" ;;
3737 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3741 if $test -f Policy.sh ; then
3744 There's also a Policy hint file available, which should make the
3745 site-specific (policy) questions easier to answer.
3752 You may give one or more space-separated answers, or "none" if appropriate.
3753 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3754 previous run of Configure, you may specify it as well as or instead of
3755 OS-specific hints. If hints are provided for your OS, you should use them:
3756 although Perl can probably be built without hints on many platforms, using
3757 hints often improve performance and may enable features that Configure can't
3758 set up on its own. If there are no hints that match your OS, specify "none";
3759 DO NOT give a wrong version or a wrong OS.
3763 rp="Which of these apply, if any?"
3766 for file in $tans; do
3767 if $test X$file = XPolicy -a -f Policy.sh; then
3769 $cat Policy.sh >> UU/config.sh
3770 elif $test -f $src/hints/$file.sh; then
3771 . $src/hints/$file.sh
3772 $cat $src/hints/$file.sh >> UU/config.sh
3773 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3776 : Give one chance to correct a possible typo.
3777 echo "$file.sh does not exist"
3779 rp="hint to use instead?"
3781 for file in $ans; do
3782 if $test -f "$src/hints/$file.sh"; then
3783 . $src/hints/$file.sh
3784 $cat $src/hints/$file.sh >> UU/config.sh
3785 elif $test X$ans = X -o X$ans = Xnone ; then
3788 echo "$file.sh does not exist -- ignored."
3795 : Remember our hint file for later.
3796 if $test -f "$src/hints/$file.sh" ; then
3806 echo "Fetching default answers from $config_sh..." >&4
3810 cp $config_sh config.sh 2>/dev/null
3822 : Restore computed paths
3823 for file in $loclist $trylist; do
3824 eval $file="\$_$file"
3829 Configure uses the operating system name and version to set some defaults.
3830 The default value is probably right if the name rings a bell. Otherwise,
3831 since spelling matters for me, either accept the default or answer "none"
3838 ''|' '|none) dflt=none ;;
3839 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3842 *) dflt="$osname" ;;
3844 rp="Operating system name?"
3848 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3854 ''|' '|none) dflt=none ;;
3855 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3856 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3858 ''|' ') dflt=none ;;
3863 *) dflt="$osvers" ;;
3865 rp="Operating system version?"
3875 : who configured the system
3876 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3879 cf_by=`(logname) 2>/dev/null`
3882 cf_by=`(whoami) 2>/dev/null`
3884 "") cf_by=unknown ;;
3889 : decide how portable to be. Allow command line overrides.
3890 case "$d_portable" in
3892 *) d_portable="$define" ;;
3895 : set up shell script to do ~ expansion
3901 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3904 if $test -f /bin/csh; then
3905 /bin/csh -f -c "glob \$1"
3910 name=\`$expr x\$1 : '..\([^/]*\)'\`
3911 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3912 if $test ! -d "\$dir"; then
3914 echo "\$me: can't locate home directory for: \$name" >&2
3919 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3935 : now set up to get a file name
3939 cat <<'EOSC' >>getfile
3955 : getfile will accept an answer from the comma-separated list
3956 : enclosed in parentheses even if it does not meet other criteria.
3957 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3958 fn=`echo $fn | sed 's/(.*)//'`
3964 loc_file=`expr $fn : '.*:\(.*\)'`
3965 fn=`expr $fn : '\(.*\):.*'`
3973 */*) fullpath=true;;
3982 *e*) exp_file=true;;
3985 *p*) nopath_ok=true;;
3990 *d*) type='Directory';;
3991 *l*) type='Locate';;
3996 Locate) what='File';;
4001 case "$d_portable" in
4009 while test "$type"; do
4014 true) rp="$rp (~name ok)";;
4017 if test -f UU/getfile.ok && \
4018 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4037 value=`UU/filexp $ans`
4040 if test "$ans" != "$value"; then
4041 echo "(That expands to $value on this system.)"
4055 /*) value="$ansexp" ;;
4056 [a-zA-Z]:/*) value="$ansexp" ;;
4061 echo "I shall only accept a full path name, as in /bin/ls." >&4
4062 echo "Use a ! shell escape if you wish to check pathnames." >&4
4065 echo "Please give a full path name, starting with slash." >&4
4068 echo "Note that using ~name is ok provided it expands well." >&4
4081 for fp in $gfpth; do
4082 if test "X$fp" = X.; then
4087 if test -f "$pf"; then
4089 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4091 echo "($value is not a plain file, but that's ok.)"
4094 if test X"$type" = X; then
4101 for fp in $gfpth; do
4102 if test "X$fp" = X.; then
4107 direxp="$fp/$ansexp"
4109 if test -d "$direxp"; then
4117 if test -d "$ansexp"; then
4118 echo "(Looking for $loc_file in directory $value.)"
4119 value="$value/$loc_file"
4120 ansexp="$ansexp/$loc_file"
4122 if test -f "$ansexp"; then
4125 case "$nopath_ok" in
4126 true) case "$value" in
4128 *) echo "Assuming $value will be in people's path."
4144 if test "$fastread" = yes; then
4149 rp="$what $value doesn't exist. Use that name anyway?"
4168 test "X$gfpthkeep" != Xy && gfpth=""
4171 : determine root of directory hierarchy where package will be installed.
4173 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4180 By default, $package will be installed in $dflt/bin, manual pages
4181 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4182 installation directories. Typically this is something like /usr/local.
4183 If you wish to have binaries under /usr/bin but other parts of the
4184 installation under /usr/local, that's ok: you will be prompted
4185 separately for each of the installation directories, the prefix being
4186 only used to set the defaults.
4190 rp='Installation prefix to use?'
4197 *) oldprefix="$prefix";;
4203 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4209 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4211 *) prefixexp="$ansexp"
4214 : allow them to override the AFS root
4217 *) afsroot=$afsroot ;;
4223 $define|true) afs=true ;;
4224 $undef|false) afs=false ;;
4225 *) if $test -d $afsroot; then
4233 echo "AFS may be running... I'll be extra cautious then..." >&4
4235 echo "AFS does not seem to be running..." >&4
4238 : determine installation prefix for where package is to be installed.
4242 Since you are running AFS, I need to distinguish the directory in which
4243 files will reside from the directory in which they are installed (and from
4244 which they are presumably copied to the former directory by occult means).
4247 case "$installprefix" in
4248 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4249 *) dflt="$installprefix";;
4254 In some special cases, particularly when building $package for distribution,
4255 it is convenient to distinguish the directory in which files should be
4256 installed from the directory ($prefix) in which they will
4257 eventually reside. For most users, these two directories are the same.
4260 case "$installprefix" in
4262 *) dflt=$installprefix;;
4266 rp='What installation prefix should I use for installing files?'
4268 installprefix="$ans"
4269 installprefixexp="$ansexp"
4271 : Perform the prefixexp/installprefixexp correction if necessary
4272 cat <<EOS >installprefix
4275 cat <<'EOSC' >>installprefix
4276 : Change installation prefix, if necessary.
4277 if $test X"$prefix" != X"$installprefix"; then
4278 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4280 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4283 chmod +x installprefix
4284 $eunicefix installprefix
4286 : Set variables such as privlib and privlibexp from the output of ./getfile
4287 : performing the prefixexp/installprefixexp correction if necessary.
4288 cat <<EOS >setprefixvar
4291 cat <<'EOSC' >>setprefixvar
4292 eval "${prefixvar}=\"\$ans\""
4293 eval "${prefixvar}exp=\"\$ansexp\""
4296 chmod +x setprefixvar
4297 $eunicefix setprefixvar
4299 : set up the script used to warn in case of inconsistency
4308 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4310 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4311 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4316 echo "*** WHOA THERE!!! ***" >&4
4317 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4320 rp=" Keep the $hint value?"
4323 y) td=$was; tu=$was;;
4327 : function used to set '$1' to '$val'
4328 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4330 $define$undef) . ./whoa; eval "$var=\$td";;
4331 $undef$define) . ./whoa; eval "$var=\$tu";;
4332 *) eval "$var=$val";;
4335 : get the patchlevel
4337 echo "Getting the current patchlevel..." >&4
4338 if $test -r $rsrc/patchlevel.h;then
4339 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4340 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4341 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4342 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4343 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4344 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4345 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4354 $echo "(You do not have patchlevel.h. Eek.)"
4356 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4357 version_patchlevel_string="version $patchlevel subversion $subversion"
4358 case "$perl_patchlevel" in
4360 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4361 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4365 $echo "(You have $package $version_patchlevel_string.)"
4369 : XXX Should be a Configure test for double-dots in filenames.
4370 version=`echo $revision $patchlevel $subversion | \
4371 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4372 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4373 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4376 version=`echo $revision $patchlevel $subversion | \
4377 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4378 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4379 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4382 : Special case the 5.005_xx maintenance series, which used 5.005
4383 : without any subversion label as a subdirectory in $sitelib
4384 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4385 api_versionstring='5.005'
4388 : Do we want threads support and if so, what type
4389 case "$usethreads" in
4390 $define|true|[yY]*) dflt='y';;
4391 *) # Catch case where user specified ithreads or 5005threads but
4392 # forgot -Dusethreads (A.D. 4/2002)
4393 case "$useithreads$use5005threads" in
4394 *$define*) dflt='y';;
4401 Perl can be built to offer a form of threading support on some systems
4402 To do so, Configure can be run with -Dusethreads.
4404 Note that Perl built with threading support runs slightly slower
4405 and uses slightly more memory than plain Perl.
4407 If this doesn't make any sense to you, just accept the default '$dflt'.
4409 rp='Build a threading Perl?'
4412 y|Y) val="$define" ;;
4418 if $test $patchlevel -lt 9; then
4419 case "$usethreads" in
4421 : Default to ithreads unless overridden on command line or with
4424 case "$use5005threads" in
4426 echo "5.005 threads are no longer supported"
4430 case "$useithreads" in
4431 $undef|false|[nN]*) dflt='n';;
4433 rp='Use the newer interpreter-based ithreads?'
4436 y|Y) val="$define" ;;
4441 : Now set use5005threads to the opposite value.
4442 case "$useithreads" in
4443 $define) val="$undef" ;;
4450 useithreads="$undef"
4451 use5005threads="$undef"
4455 case "$useithreads$use5005threads" in
4459 You cannot have both the ithreads and the 5.005 threads enabled
4460 at the same time. Disabling the 5.005 threads since they are
4461 much less stable than the ithreads.
4464 use5005threads="$undef"
4469 : perl-5.9.x and later
4471 if test X"$usethreads" = "X$define"; then
4472 case "$use5005threads" in
4476 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4483 use5005threads="$undef"
4484 useithreads="$usethreads"
4487 case "$d_oldpthreads" in
4488 '') : Configure tests would be welcome here. For now, assume undef.
4490 *) val="$d_oldpthreads" ;;
4496 : Look for a hint-file generated 'call-back-unit'. If the
4497 : user has specified that a threading perl is to be built,
4498 : we may need to set or change some other defaults.
4499 if $test -f usethreads.cbu; then
4500 echo "Your platform has some specific hints regarding threaded builds, using them..."
4503 case "$usethreads" in
4504 "$define"|true|[yY]*)
4506 (Your platform does not have any specific hints for threaded builds.
4507 Assuming POSIX threads, then.)
4513 : Check if multiplicity is required
4516 Perl can be built so that multiple Perl interpreters can coexist
4517 within the same Perl executable.
4520 case "$useithreads" in
4523 This multiple interpreter support is required for interpreter-based threads.
4527 *) case "$usemultiplicity" in
4528 $define|true|[yY]*) dflt='y';;
4532 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4533 rp='Build Perl for multiplicity?'
4536 y|Y) val="$define" ;;
4544 : Check if morebits is requested
4545 case "$usemorebits" in
4546 "$define"|true|[yY]*)
4547 use64bitint="$define"
4548 uselongdouble="$define"
4549 usemorebits="$define"
4551 *) usemorebits="$undef"
4555 : Determine the C compiler to be used
4561 rp="Use which C compiler?"
4565 : See whether they have no cc but they do have gcc
4567 if $test -f cc.cbu; then
4572 : make some quick guesses about what we are up against
4574 $echo $n "Hmm... $c"
4584 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4585 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4587 echo "Looks kind of like an OSF/1 system, but we'll see..."
4589 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4590 xxx=`./loc addbib blurfl $pth`
4591 if $test -f $xxx; then
4592 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4596 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4597 echo "Looks kind of like an extended USG system, but we'll see..."
4599 echo "Looks kind of like a USG system, but we'll see..."
4603 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4604 echo "Looks kind of like a BSD system, but we'll see..."
4608 echo "Looks kind of like a Version 7 system, but we'll see..."
4611 case "$eunicefix" in
4614 There is, however, a strange, musty smell in the air that reminds me of
4615 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4619 : it so happens the Eunice I know will not run shell scripts in Unix format
4623 echo "Congratulations. You aren't running Eunice."
4627 : Detect OS2. The p_ variable is set above in the Head.U unit.
4628 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4629 : semicolon as a patch separator
4634 I have the feeling something is not exactly right, however...don't tell me...
4635 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4636 (Or you may be running DOS with DJGPP.)
4641 if test -f /xenix; then
4642 echo "Actually, this looks more like a XENIX system..."
4647 echo "It's not Xenix..."
4652 if test -f /venix; then
4653 echo "Actually, this looks more like a VENIX system..."
4660 echo "Nor is it Venix..."
4663 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4664 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4667 : Check if we are using GNU gcc and what its version is
4669 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4673 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4675 printf("%s\n", __VERSION__);
4677 printf("%s\n", "1");
4683 if $cc -o try $ccflags $ldflags try.c; then
4684 gccversion=`$run ./try`
4685 case "$gccversion" in
4686 '') echo "You are not using GNU cc." ;;
4687 *) echo "You are using GNU cc $gccversion."
4693 echo "*** WHOA THERE!!! ***" >&4
4694 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4695 case "$knowitall" in
4697 echo " You'd better start hunting for one and let me know about it." >&4
4703 case "$gccversion" in
4704 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4706 case "$gccversion" in
4707 '') gccosandvers='' ;;
4708 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4709 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4711 case "$gccosandvers" in
4712 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4713 $osname$osvers) ;; # looking good
4714 $osname*) cat <<EOM >&4
4716 *** WHOA THERE!!! ***
4718 Your gcc has not been compiled for the exact release of
4719 your operating system ($gccosandvers versus $osname$osvers).
4721 In general it is a good idea to keep gcc synchronized with
4722 the operating system because otherwise serious problems
4723 may ensue when trying to compile software, like Perl.
4725 I'm trying to be optimistic here, though, and will continue.
4726 If later during the configuration and build icky compilation
4727 problems appear (headerfile conflicts being the most common
4728 manifestation), I suggest reinstalling the gcc to match
4729 your operating system release.
4733 *) gccosandvers='' ;; # failed to parse, better be silent
4741 # gcc 3.* complain about adding -Idirectories that they already know about,
4742 # so we will take those off from locincpth.
4743 case "$gccversion" in
4745 echo "main(){}">try.c
4746 for incdir in $locincpth; do
4747 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4748 grep '^c[cp]p*[01]: warning: changing search order '`
4749 if test "X$warn" != X; then
4750 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4756 # gcc 4.9 by default does some optimizations that break perl.
4757 # see ticket 121505.
4759 # The -fwrapv disables those optimizations (and probably others,) so
4760 # for gcc 4.9 (and later, since the optimizations probably won't go
4761 # away), add -fwrapv unless the user requests -fno-wrapv, which
4762 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4763 # which turns the overflows -fwrapv ignores into runtime errors.
4764 case "$gccversion" in
4765 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4767 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4768 *) ccflags="$ccflags -fwrapv" ;;
4772 : What should the include directory be ?
4773 : Use sysroot if set, so findhdr looks in the right place.
4775 $echo $n "Hmm... $c"
4776 dflt="$sysroot/usr/include"
4779 if $test -f /bin/mips && /bin/mips; then
4780 echo "Looks like a MIPS system..."
4781 $cat >usr.c <<'EOCP'
4782 #ifdef SYSTYPE_BSD43
4786 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4787 dflt='/bsd43/usr/include'
4791 mips_type='System V'
4793 $rm -f usr.c usr.out
4794 echo "and you're compiling with the $mips_type compiler and libraries."
4798 echo "Doesn't look like a MIPS system."
4808 case "$xxx_prompt" in
4811 rp='Where are the include files you want to use?'
4819 : see how we invoke the C preprocessor
4821 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4822 cat <<'EOT' >testcpp.c
4828 if test ! -f cppstdin; then
4829 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4830 # AIX cc -E doesn't show the absolute headerfile
4831 # locations but we'll cheat by using the -M flag.
4832 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
4834 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4837 echo "Keeping your $hint cppstdin wrapper."
4840 wrapper=`pwd`/cppstdin
4844 if $test "X$cppstdin" != "X" && \
4845 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4846 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4848 echo "You used to use $cppstdin $cppminus so we'll use that again."
4850 '') echo "But let's see if we can live without a wrapper..." ;;
4852 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4853 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4855 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4858 echo "(However, $cpprun $cpplast does not work, let's see...)"
4866 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4873 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4874 $cc -E <testcpp.c >testcpp.out 2>&1; \
4875 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4876 echo "Yup, it does."
4877 x_cpp="$cc $cppflags -E"
4879 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4880 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4881 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4882 echo "Yup, it does."
4883 x_cpp="$cc $cppflags -E"
4885 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4886 $cc -P <testcpp.c >testcpp.out 2>&1; \
4887 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4888 echo "Yipee, that works!"
4889 x_cpp="$cc $cppflags -P"
4891 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4892 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4893 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4894 echo "At long last!"
4895 x_cpp="$cc $cppflags -P"
4897 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4898 $cpp <testcpp.c >testcpp.out 2>&1; \
4899 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4901 x_cpp="$cpp $cppflags"
4903 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4904 $cpp - <testcpp.c >testcpp.out 2>&1; \
4905 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4906 echo "Hooray, it works! I was beginning to wonder."
4907 x_cpp="$cpp $cppflags"
4909 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4910 $wrapper <testcpp.c >testcpp.out 2>&1; \
4911 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4917 rp="No dice. I can't find a C preprocessor. Name one:"
4921 $x_cpp <testcpp.c >testcpp.out 2>&1
4922 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4923 echo "OK, that will do." >&4
4925 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4940 echo "Perhaps can we force $cc -E using a wrapper..."
4941 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4942 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4948 echo "Nope, we'll have to live without it..."
4962 "$wrapper"|'cppstdin') ;;
4963 *) $rm -f $wrapper;;
4965 $rm -f testcpp.c testcpp.out
4967 : Adjust cppfilter for path component separator
4969 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4970 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4974 : Use gcc to determine libpth and incpth
4975 # If using gcc or clang, we can get better values for libpth, incpth
4976 # and usrinc directly from the compiler.
4977 # Note that ccname for clang is also gcc.
4980 $echo 'extern int foo;' > try.c
4981 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4983 if $test $# -gt 0; then
4985 incpth="`$echo $incpth|$sed 's/^ //'`"
4987 j="`$echo $i|$sed 's,/include$,/lib,'`"
4988 if $test -d $j; then
4992 libpth="`$echo $libpth|$sed 's/^ //'`"
4993 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4994 if $test -d $xxx; then
4997 *) libpth="$libpth $xxx";;
5004 '') for i in $incpth; do
5005 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5013 case "$usecrosscompile" in
5016 '') echo "Incpth not defined." >&4; croak=y ;;
5017 *) echo "Using incpth '$incpth'." >&4 ;;
5020 '') echo "Libpth not defined." >&4; croak=y ;;
5021 *) echo "Using libpth '$libpth'." >&4 ;;
5024 '') echo "Usrinc not defined." >&4; croak=y ;;
5025 *) echo "Using usrinc $usrinc." >&4 ;;
5029 if test "X$sysroot" = X; then
5030 echo "Cannot continue, aborting." >&4; exit 1
5032 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5041 : Default value for incpth is just usrinc
5043 '') incpth="$usrinc";;
5046 : Set private lib path
5049 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5054 '') dlist="$loclibpth $plibpth $glibpth";;
5055 *) dlist="$libpth";;
5058 : Now check and see which directories actually exist, avoiding duplicates
5061 if $test -d $xxx; then
5064 *) libpth="$libpth $xxx";;
5070 Some systems have incompatible or broken versions of libraries. Among
5071 the directories listed in the question below, please remove any you
5072 know not to be holding relevant libraries, and add any that are needed.
5073 Say "none" for none.
5077 if test "X$sysroot" != X; then
5079 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5092 rp="Directories to use for library searches?"
5099 : compute shared library extension
5102 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5112 On some systems, shared libraries may be available. Answer 'none' if
5113 you want to suppress searching of shared libraries for the remainder
5114 of this configuration.
5117 rp='What is the file extension used for shared libraries?'
5121 : Does target system insist that shared library basenames are unique
5124 Some dynamic loaders assume that the *basename* of shared library filenames
5125 are globally unique. We'll default this to undef as we assume your system
5126 is not this weird. Set to defined if you're on one of them.
5131 rp='Make shared library basenames unique?'
5134 y|Y) val="$define" ;;
5137 set d_libname_unique
5140 : Define several unixisms.
5141 : Hints files or command line option can be used to override them.
5142 : The convoluted testing is in case hints files set either the old
5145 '') case "$exe_ext" in
5147 *) _exe="$exe_ext" ;;
5152 '') case "$lib_ext" in
5159 '') case "$obj_ext" in
5166 '') case "$path_sep" in
5177 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5179 : Which makefile gets called first. This is used by make depend.
5180 case "$firstmakefile" in
5181 '') firstmakefile='makefile';;
5184 : Check is we will use socks
5186 $define|true|[yY]*) dflt='y';;
5191 Perl can be built to use the SOCKS proxy protocol library. To do so,
5192 Configure must be run with -Dusesocks. If you use SOCKS you also need
5193 to use the PerlIO abstraction layer, this will be implicitly selected.
5195 If this doesn't make any sense to you, just accept the default '$dflt'.
5197 rp='Build Perl for SOCKS?'
5200 y|Y) val="$define" ;;
5206 : Check for uselongdouble support
5208 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5211 case "$uselongdouble" in
5212 $define|true|[yY]*) dflt='y';;
5217 Perl can be built to take advantage of long doubles which
5218 (if available) may give more accuracy and range for floating point numbers.
5220 If this doesn't make any sense to you, just accept the default '$dflt'.
5222 rp='Try to use long doubles if available?'
5225 y|Y) val="$define" ;;
5231 case "$uselongdouble" in
5232 true|[yY]*) uselongdouble="$define" ;;
5235 : Look for a hint-file generated 'call-back-unit'. If the
5236 : user has specified that long doubles should be used,
5237 : we may need to set or change some other defaults.
5238 if $test -f uselongdouble.cbu; then
5239 echo "Your platform has some specific hints regarding long doubles, using them..."
5240 . ./uselongdouble.cbu
5242 case "$uselongdouble" in
5245 (Your platform does not have any specific hints for long doubles.)
5251 : Check if quadmath is requested
5252 case "$usequadmath" in
5253 "$define"|true|[yY]*) usequadmath="$define" ;;
5254 *) usequadmath="$undef" ;;
5257 : Fail if both uselongdouble and usequadmath are requested
5258 case "$usequadmath:$uselongdouble" in
5262 *** You requested the use of the quadmath library and use
5263 *** of long doubles.
5265 *** Please select one or the other.
5271 : Looking for optional libraries
5273 echo "Checking for optional libraries..." >&4
5278 case "$libswanted" in
5279 '') libswanted='c_s';;
5282 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5284 case "$usecbacktrace" in
5285 "$define") libswanted="$libswanted bfd" ;;
5287 case "$usequadmath" in
5288 "$define") libswanted="$libswanted quadmath" ;;
5294 for thisdir in $libpth $xlibpth; do
5295 test -d $thisdir && libspath="$libspath $thisdir"
5297 for thislib in $libswanted; do
5298 for thisdir in $libspath; do
5300 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5301 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5302 $test -f "$xxx" && eval $libscheck
5303 $test -f "$xxx" && libstyle=shared
5304 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5305 $test -f "$xxx" && eval $libscheck
5306 $test -f "$xxx" && libstyle=shared
5308 if test ! -f "$xxx"; then
5309 xxx=$thisdir/lib$thislib.$so
5310 $test -f "$xxx" && eval $libscheck
5311 $test -f "$xxx" && libstyle=shared
5313 if test ! -f "$xxx"; then
5314 xxx=$thisdir/lib$thislib$_a
5315 $test -f "$xxx" && eval $libscheck
5316 $test -f "$xxx" && libstyle=static
5318 if test ! -f "$xxx"; then
5319 xxx=$thisdir/$thislib$_a
5320 $test -f "$xxx" && eval $libscheck
5321 $test -f "$xxx" && libstyle=static
5323 if test ! -f "$xxx"; then
5324 xxx=$thisdir/lib${thislib}_s$_a
5325 $test -f "$xxx" && eval $libscheck
5326 $test -f "$xxx" && libstyle=static
5327 $test -f "$xxx" && thislib=${thislib}_s
5329 if test ! -f "$xxx"; then
5330 xxx=$thisdir/Slib$thislib$_a
5331 $test -f "$xxx" && eval $libscheck
5332 $test -f "$xxx" && libstyle=static
5334 if $test -f "$xxx"; then
5336 shared) echo "Found -l$thislib (shared)." ;;
5337 static) echo "Found -l$thislib." ;;
5338 *) echo "Found -l$thislib ($libstyle)." ;;
5342 *) dflt="$dflt -l$thislib"
5343 libsfound="$libsfound $xxx"
5345 libsfiles="$libsfiles $yyy"
5346 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5347 case " $libsdirs " in
5349 *) libsdirs="$libsdirs $yyy" ;;
5356 if $test ! -f "$xxx"; then
5357 echo "No -l$thislib."
5368 ' '|'') dflt='none';;
5373 In order to compile $package on your machine, a number of libraries
5374 are usually needed. Include any other special libraries here as well.
5375 Say "none" for none. The default list is almost always right.
5379 rp="What libraries to use?"
5386 : determine optimization, if desired, or use for debug flag also
5388 ' '|$undef) dflt='none';;
5390 *) dflt="$optimize";;
5394 By default, $package compiles with the -O flag to use the optimizer.
5395 Alternately, you might want to use the symbolic debugger, which uses
5396 the -g flag (on traditional Unix systems). Either flag can be
5397 specified here. To use neither flag, specify the word "none".
5400 rp="What optimizer/debugger flag should be used?"
5404 'none') optimize=" ";;
5407 : Check what DEBUGGING is required from the command line
5408 : -DEBUGGING or -DDEBUGGING or
5409 : -DEBUGGING=both = -g + -DDEBUGGING
5410 : -DEBUGGING=-g or -Doptimize=-g = -g
5411 : -DEBUGGING=none or -UDEBUGGING =
5412 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5415 *) DEBUGGING=$EBUGGING ;;
5418 case "$DEBUGGING" in
5422 *) optimize="$optimize -g" ;;
5426 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5434 case "$DEBUGGING" in
5435 both|$define) dflt='-DDEBUGGING'
5438 : argument order is deliberate, as the flag will start with - which set could
5439 : think is an option
5440 checkccflag='check=$1; flag=$2; callback=$3;
5442 echo "Checking if your compiler accepts $flag" 2>&1;
5443 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5444 echo "int main(void) { return 0; }" > gcctest.c;
5445 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5446 echo "Yes, it does." 2>&1;
5447 if $test -s gcctest.out ; then
5448 echo "But your platform does not like it:";
5453 echo "Leaving current flags $ccflags alone." 2>&1
5455 *) dflt="$dflt $flag";
5461 echo "Nope, it does not, but that is ok." 2>&1;
5465 : We will not override a previous value, but we might want to
5466 : augment a hint file
5468 default|recommended)
5469 case "$gccversion" in
5470 1*) dflt="$dflt -fpcc-struct-return" ;;
5472 case "$optimize:$DEBUGGING" in
5473 *-g*:old) dflt="$dflt -DDEBUGGING";;
5475 case "$gccversion" in
5476 2*) if $test -d /etc/conf/kconfig.d &&
5477 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5479 # Interactive Systems (ISC) POSIX mode.
5484 case "$gccversion" in
5487 ?*) set strict-aliasing -fno-strict-aliasing
5491 # For gcc, adding -pipe speeds up compilations for some, but apparently
5492 # some assemblers can't read from stdin. (It also slows down compilations
5493 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5494 case "$gccversion" in
5500 # on x86_64 (at least) we require an extra library (libssp) in the
5501 # link command line. This library is not named, so I infer that it is
5502 # an implementation detail that may change. Hence the safest approach
5503 # is to add the flag to the flags passed to the compiler at link time,
5504 # as that way the compiler can do the right implementation dependant
5507 amigaos) ;; # -fstack-protector builds but doesn't work
5508 *) case "$gccversion" in
5509 ?*) set stack-protector-strong -fstack-protector-strong
5512 *-fstack-protector-strong*) ;; # It got added.
5513 *) # Try the plain/older -fstack-protector.
5514 set stack-protector -fstack-protector
5525 case "$mips_type" in
5526 *BSD*|'') inclwanted="$locincpth $usrinc";;
5527 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5529 for thisincl in $inclwanted; do
5530 if $test -d $thisincl; then
5531 if $test x$thisincl != x$usrinc; then
5533 *" -I$thisincl "*);;
5534 *) dflt="$dflt -I$thisincl ";;
5540 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5542 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5550 *) dflt="$dflt -D$2";;
5554 set signal.h LANGUAGE_C; eval $inctest
5558 ccflags="$ccflags -DSOCKS"
5563 default|recommended) dflt="$ccflags $dflt" ;;
5564 *) dflt="$ccflags";;
5573 Your C compiler may want other flags. For this question you should include
5574 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5575 but you should NOT include libraries or ld flags like -lwhatever. If you
5576 want $package to honor its debug switch, you should include -DDEBUGGING here.
5577 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5579 To use no flags, specify the word "none".
5585 rp="Any additional cc flags?"
5592 : the following weeds options from ccflags that are of no interest to cpp
5594 '') cppflags="$ccflags" ;;
5595 *) set X $ccflags; shift
5596 case " $cppflags " in
5597 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5598 *) cppflags="$cppflags $ccflags" ;;
5602 case "$gccversion" in
5603 1*) cppflags="$cppflags -D__GNUC__"
5605 case "$mips_type" in
5607 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5613 echo "Let me guess what the preprocessor flags are..." >&4
5627 *) ftry="$previous $flag";;
5629 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5630 >cpp1.out 2>/dev/null && \
5631 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5632 >cpp2.out 2>/dev/null && \
5633 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5634 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5636 cppflags="$cppflags $ftry"
5646 *-*) echo "They appear to be: $cppflags";;
5648 $rm -f cpp.c cpp?.out
5652 : flags used in final linking phase
5654 '') if ./venix; then
5660 *-posix*) dflt="$dflt -posix" ;;
5663 *) dflt="$ldflags";;
5665 # See note above about -fstack-protector
5667 *-fstack-protector-strong*)
5669 *-fstack-protector-strong*) ;; # Don't add it again
5670 *) dflt="$dflt -fstack-protector-strong" ;;
5673 *-fstack-protector*)
5675 *-fstack-protector*) ;; # Don't add it again
5676 *) dflt="$dflt -fstack-protector" ;;
5681 : Try to guess additional flags to pick up local libraries.
5682 for thislibdir in $libpth; do
5683 case " $loclibpth " in
5686 *"-L$thislibdir "*) ;;
5687 *) dflt="$dflt -L$thislibdir" ;;
5699 Your C linker may need flags. For this question you should
5700 include -L/whatever and any other flags used by the C linker, but you
5701 should NOT include libraries like -lwhatever.
5703 Make sure you include the appropriate -L/path flags if your C linker
5704 does not normally search all of the directories you specified above,
5707 To use no flags, specify the word "none".
5711 rp="Any additional ld flags (NOT including libraries)?"
5717 rmlist="$rmlist pdp11"
5721 echo "Checking your choice of C compiler and flags for coherency..." >&4
5722 $cat > try.c <<'EOF'
5724 int main() { printf("Ok\n"); return(0); }
5726 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5728 $cat >try.msg <<'EOM'
5729 I've tried to compile and run the following simple program:
5732 $cat try.c >> try.msg
5734 $cat >> try.msg <<EOM
5741 and I got the following output:
5745 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5746 if $sh -c "$run ./try " >>try.msg 2>&1; then
5750 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5753 echo "The program compiled OK, but exited with status $?." >>try.msg
5754 rp="You have a problem. Shall I abort Configure"
5758 echo "I can't compile the test program." >>try.msg
5759 rp="You have a BIG problem. Shall I abort Configure"
5765 case "$knowitall" in
5767 echo "(The supplied flags or libraries might be incorrect.)"
5775 *) echo "Ok. Stopping Configure." >&4
5780 n) echo "OK, that should do.";;
5782 $rm_try gcctest gcctest.out
5784 : define a shorthand compile call
5788 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5789 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5793 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5794 : define a shorthand compile call for compilations that should be ok.
5798 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5800 : stub, used only to satisfy other units
5803 : check for lengths of integral types
5807 echo "Checking to see how big your integers are..." >&4
5816 printf("intsize=%d;\n", (int)sizeof(int));
5817 printf("longsize=%d;\n", (int)sizeof(long));
5818 printf("shortsize=%d;\n", (int)sizeof(short));
5823 if eval $compile_ok && $run ./try > /dev/null; then
5825 echo "Your integers are $intsize bytes long."
5826 echo "Your long integers are $longsize bytes long."
5827 echo "Your short integers are $shortsize bytes long."
5831 Help! I can't compile and run the intsize test program: please enlighten me!
5832 (This is probably a misconfiguration in your system or libraries, and
5833 you really ought to fix it. Still, I'll try anyway.)
5837 rp="What is the size of an integer (in bytes)?"
5841 rp="What is the size of a long integer (in bytes)?"
5845 rp="What is the size of a short integer (in bytes)?"
5853 : check for long long
5855 echo "Checking to see if you have long long..." >&4
5856 echo 'int main() { long long x = 7; return 0; }' > try.c
5858 if eval $compile; then
5860 echo "You have long long."
5863 echo "You do not have long long."
5869 : check for length of long long
5870 case "${d_longlong}${longlongsize}" in
5873 echo "Checking to see how big your long longs are..." >&4
5874 $cat >try.c <<'EOCP'
5878 printf("%d\n", (int)sizeof(long long));
5883 if eval $compile_ok; then
5884 longlongsize=`$run ./try`
5885 echo "Your long longs are $longlongsize bytes long."
5889 echo "(I can't seem to compile the test program. Guessing...)"
5890 rp="What is the size of a long long (in bytes)?"
5894 if $test "X$longsize" = "X$longlongsize"; then
5895 echo "(That isn't any different from an ordinary long.)"
5901 : determine filename position in cpp output
5903 echo "Computing filename position in cpp output for #include directives..." >&4
5905 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5910 vos) testaccess=-e ;;
5913 echo '#include <stdio.h>' > foo.c
5916 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5917 $grep '^[ ]*#.*stdio\.h' | \
5918 while read cline; do
5921 while $test \$# -gt 0; do
5922 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5927 pos=\`expr \$pos + 1\`
5941 *) pos="${fieldn}th";;
5943 echo "Your cpp writes the filename in the $pos field of the line."
5945 : locate header file
5950 for usrincdir in $incpth
5952 if test -f \$usrincdir/\$wanted; then
5953 echo "\$usrincdir/\$wanted"
5957 awkprg='{ print \$$fieldn }'
5958 echo "#include <\$wanted>" > foo\$\$.c
5959 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5960 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5961 while read cline; do
5962 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5964 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5965 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5970 # status = 0: grep returned 0 lines, case statement not executed
5971 # status = 1: headerfile found
5972 # status = 2: while loop executed, no headerfile found
5976 if test \$status -eq 1; then
5983 : define an alternate in-header-list? function
5984 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5985 cont=true; xxf="echo \"<\$1> found.\" >&4";
5986 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5987 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5989 case $# in 4) instead=instead;; *) instead="at last";; esac;
5990 while $test "$cont"; do
5992 var=$2; eval "was=\$$2";
5993 if $test "$xxx" && $test -r "$xxx";
5995 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5998 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5999 set $yyy; shift; shift; yyy=$@;
6000 case $# in 0) cont="";;
6001 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
6002 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
6003 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
6004 xxnf="echo \"there is no <\$1>, ...\" >&4";;
6008 do set $yyy; var=$2; eval "was=\$$2";
6009 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
6010 set $yyy; shift; shift; yyy=$@;
6013 : see if inttypes.h is available
6014 : we want a real compile instead of Inhdr because some systems
6015 : have an inttypes.h which includes non-existent headers
6018 #include <inttypes.h>
6020 static int32_t foo32 = 0x12345678;
6024 if eval $compile; then
6025 echo "<inttypes.h> found." >&4
6028 echo "<inttypes.h> NOT found." >&4
6037 echo "Checking to see if you have int64_t..." >&4
6039 #include <sys/types.h>
6040 #$i_inttypes I_INTTYPES
6042 #include <inttypes.h>
6044 int main() { int64_t x = 7; }
6047 if eval $compile; then
6049 echo "You have int64_t."
6052 echo "You do not have int64_t."
6058 : Check if 64bit ints have a quad type
6060 echo "Checking which 64-bit integer type we could use..." >&4
6066 val='"unsigned int"'
6071 *) case "$longsize" in
6075 val='"unsigned long"'
6080 *) case "$d_longlong:$longlongsize" in
6085 val='"unsigned long long"'
6090 *) case "$d_int64_t" in
6109 '') echo "Alas, no 64-bit integer types in sight." >&4
6112 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6117 : Do we want 64bit support
6118 case "$uselonglong" in
6119 "$define"|true|[yY]*)
6122 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6124 use64bitint="$define"
6127 case "$use64bits" in
6128 "$define"|true|[yY]*)
6131 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6133 use64bitint="$define"
6136 case "$use64bitints" in
6137 "$define"|true|[yY]*)
6140 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6142 use64bitint="$define"
6145 case "$use64bitsint" in
6146 "$define"|true|[yY]*)
6149 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6151 use64bitint="$define"
6154 case "$uselonglongs" in
6155 "$define"|true|[yY]*)
6158 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6160 use64bitint="$define"
6163 case "$use64bitsall" in
6164 "$define"|true|[yY]*)
6167 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6169 use64bitall="$define"
6174 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6176 case "$use64bitall" in
6177 "$define"|true|[yY]*) use64bitint="$define" ;;
6183 You have natively 64-bit long integers.
6187 *) case "$use64bitint" in
6188 "$define"|true|[yY]*) dflt='y';;
6197 Perl can be built to take advantage of 64-bit integer types
6198 on some systems. To do so, Configure can be run with -Duse64bitint.
6199 Choosing this option will most probably introduce binary incompatibilities.
6201 If this doesn't make any sense to you, just accept the default '$dflt'.
6202 (The default has been chosen based on your configuration.)
6204 rp='Try to use 64-bit integers, if available?'
6207 [yY]*) val="$define" ;;
6215 case "$use64bitall" in
6216 "$define"|true|[yY]*) dflt='y' ;;
6217 *) case "$longsize" in
6225 You may also choose to try maximal 64-bitness. It means using as much
6226 64-bitness as possible on the platform. This in turn means even more
6227 binary incompatibilities. On the other hand, your platform may not
6228 have any more 64-bitness available than what you already have chosen.
6230 If this doesn't make any sense to you, just accept the default '$dflt'.
6231 (The default has been chosen based on your configuration.)
6233 rp='Try to use maximal 64-bit support, if available?'
6236 [yY]*) val="$define" ;;
6241 case "$use64bitall" in
6243 case "$use64bitint" in
6247 Since you have chosen a maximally 64-bit build, I'm also turning on
6248 the use of 64-bit integers.
6250 use64bitint="$define" ;;
6255 : Look for a hint-file generated 'call-back-unit'. If the
6256 : user has specified that a 64-bit perl is to be built,
6257 : we may need to set or change some other defaults.
6258 if $test -f use64bitint.cbu; then
6259 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6262 case "$use64bitint" in
6263 "$define"|true|[yY]*)
6264 : This test was common to all the OpenBSD forks, and seems harmless for
6267 echo "Checking if your C library has broken 64-bit functions..." >&4
6270 typedef $uquadtype myULL;
6277 {4294967303.15, 4294967303ULL},
6278 {4294967294.2, 4294967294ULL},
6279 {4294967295.7, 4294967295ULL},
6282 for (p = test; p->u; p++) {
6283 myULL x = (myULL)p->d;
6294 if eval $compile_ok; then
6295 libcquad=`$run ./try`
6296 echo "Your C library's 64-bit functions are $libcquad."
6298 echo "(I can't seem to compile the test program.)"
6299 echo "Assuming that your C library's 64-bit functions are ok."
6308 *** You have a C library with broken 64-bit functions.
6309 *** 64-bit support does not work reliably in this configuration.
6310 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6311 *** Cannot continue, aborting.
6318 4) case "$archname64" in
6319 '') archname64=64int ;;
6326 : Look for a hint-file generated 'call-back-unit'. If the
6327 : user has specified that a maximally 64-bit perl is to be built,
6328 : we may need to set or change some other defaults.
6329 if $test -f use64bitall.cbu; then
6330 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6333 case "$use64bitall" in
6334 "$define"|true|[yY]*)
6336 4) case "$archname64" in
6337 ''|64int) archname64=64all ;;
6344 case "$d_quad:$use64bitint" in
6348 *** You have chosen to use 64-bit integers,
6349 *** but none can be found.
6350 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6351 *** Cannot continue, aborting.
6358 : Check if we are using the GNU C library
6360 echo "Checking for GNU C Library..." >&4
6362 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6363 alone are insufficient to distinguish different versions, such as
6364 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6365 libc version 2.1.0. A. Dougherty, June 3, 2002.
6371 # ifdef __GLIBC_MINOR__
6372 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6373 # include <gnu/libc-version.h>
6374 printf("%s\n", gnu_get_libc_version());
6376 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6379 printf("%d\n", __GLIBC__);
6388 if eval $compile_ok && $run ./try > glibc.ver; then
6390 gnulibc_version=`$cat glibc.ver`
6391 echo "You are using the GNU C Library version $gnulibc_version"
6395 echo "You are not using the GNU C Library"
6401 : see if nm is to be used to determine whether a symbol is defined or not
6405 case "$d_gnulibc" in
6408 echo "nm probably won't work on the GNU C Library." >&4
6414 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6416 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6417 echo "'nm' won't be sufficient on this system." >&4
6423 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6424 if $test $dflt -gt 20; then
6434 true|$define) dflt=y;;
6441 I can use $nm to extract the symbols from your C libraries. This
6442 is a time consuming task which may generate huge output on the disk (up
6443 to 3 megabytes) but that should make the symbols extraction faster. The
6444 alternative is to skip the 'nm' extraction part and to compile a small
6445 test program instead to determine whether each symbol is present. If
6446 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6447 this may be the best solution.
6449 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6452 rp="Shall I use $nm to extract C symbols from the libraries?"
6455 [Nn]*) usenm=false;;
6464 : nm options which may be necessary
6466 '') if $test -f /mach_boot; then
6468 elif $test -d /usr/ccs/lib; then
6469 nm_opt='-p' # Solaris (and SunOS?)
6470 elif $test -f /dgux; then
6472 elif $test -f /lib64/rld; then
6473 nm_opt='-p' # 64-bit Irix
6479 : nm options which may be necessary for shared libraries but illegal
6480 : for archive libraries. Thank you, Linux.
6481 case "$nm_so_opt" in
6482 '') case "$myuname" in
6484 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6485 nm_so_opt='--dynamic'
6492 : Figure out where the libc is located
6495 : get list of predefined functions in a handy place
6500 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6506 *) for thislib in $libs; do
6509 : Handle C library specially below.
6512 thislib=`echo $thislib | $sed -e 's/^-l//'`
6513 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6515 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6517 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6519 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6521 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6523 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6525 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6530 libnames="$libnames $try"
6532 *) libnames="$libnames $thislib" ;;
6541 for xxx in $libpth; do
6542 $test -r $1 || set $xxx/libc.$so
6543 : The messy sed command sorts on library version numbers.
6545 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6546 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6548 s/[0-9][0-9]*/0000&/g
6549 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6552 $sort | $sed -e 's/^.* //'`
6555 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6556 $test -r $1 || set $sysroot/lib/libsys_s$_a
6562 if $test -r "$1"; then
6563 echo "Your (shared) C library seems to be in $1."
6565 elif $test -r /lib/libc && $test -r /lib/clib; then
6566 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6568 libc='/lib/clib /lib/libc'
6569 if $test -r /lib/syslib; then
6570 echo "(Your math library is in /lib/syslib.)"
6571 libc="$libc /lib/syslib"
6573 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6574 echo "Your C library seems to be in $libc, as you said before."
6575 elif $test -r $incpath/usr/lib/libc$_a; then
6576 libc=$incpath/usr/lib/libc$_a;
6577 echo "Your C library seems to be in $libc. That's fine."
6578 elif $test -r /lib/libc$_a; then
6580 echo "Your C library seems to be in $libc. You're normal."
6582 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6584 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6585 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6586 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6588 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6590 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6593 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6595 if $test -r "$tans"; then
6596 echo "Your C library seems to be in $tans, of all places."
6602 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6606 If the guess above is wrong (which it might be if you're using a strange
6607 compiler, or your machine supports multiple models), you can override it here.
6612 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6614 I can't seem to find your C library. I've looked in the following places:
6617 $sed 's/^/ /' libpath
6620 None of these seems to contain your C library. I need to get its name...
6625 rp='Where is your C library?'
6630 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6631 set X `cat libnames`
6634 case $# in 1) xxx=file; esac
6635 echo "Extracting names from the following $xxx for later perusal:" >&4
6637 $sed 's/^/ /' libnames >&4
6639 $echo $n "This may take a while...$c" >&4
6643 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6644 *) $nm $nm_opt $file 2>/dev/null;;
6649 $grep fprintf libc.tmp > libc.ptf
6650 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6651 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6653 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6678 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6682 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6690 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6694 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6698 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6702 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6706 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6711 $nm -p $* 2>/dev/null >libc.tmp
6712 $grep fprintf libc.tmp > libc.ptf
6713 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6714 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6720 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6722 if $ar t $libc > libc.tmp && \
6723 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6725 for thisname in $libnames $libc; do
6726 $ar t $thisname >>libc.tmp
6728 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6730 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6731 for thisname in $libnames $libc; do
6732 $ar tv $thisname >>libc.tmp
6733 emximp -o tmp.imp $thisname \
6735 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6736 < tmp.imp >>libc.tmp
6739 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6742 echo "$ar didn't seem to work right." >&4
6743 echo "Maybe this is a Cray...trying bld instead..." >&4
6745 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6748 for thisname in $libnames; do
6750 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6751 $ar t $thisname >>libc.tmp
6755 echo "That didn't work either. Giving up." >&4
6765 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6766 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6768 *) if $test -f /lib/syscalls.exp; then
6770 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6771 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6772 /lib/syscalls.exp >>libc.list
6778 $rm -f libnames libpath
6780 : Check if we are using C++
6782 echo "Checking for C++..." >&4
6783 $cat >try.c <<'EOCP'
6795 if eval $compile_ok && $run ./try; then
6797 echo "You are using a C++ compiler."
6800 echo "You are not using a C++ compiler."
6806 : is a C symbol defined?
6809 -v) tf=libc.tmp; tdc="";;
6810 -a) tf=libc.tmp; tdc="[]";;
6811 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6813 case "$d_cplusplus" in
6814 $define) extern_C="extern \"C\"" ;;
6815 *) extern_C="extern" ;;
6818 case "$reuseval-$4" in
6820 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6825 if $test "$runnm" = true; then
6826 if $contains $tlook $tf >/dev/null 2>&1; then
6828 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6829 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;
6830 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6831 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6835 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;
6836 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6842 $define) tval=true;;
6849 : define an is-in-libc? function
6850 inlibc='echo " "; td=$define; tu=$undef;
6851 sym=$1; var=$2; eval "was=\$$2";
6853 case "$reuseval$was" in
6863 echo "$sym() found." >&4;
6864 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6866 echo "$sym() NOT found." >&4;
6867 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6871 $define) echo "$sym() found." >&4;;
6872 *) echo "$sym() NOT found." >&4;;
6876 : check for length of double
6878 case "$doublesize" in
6880 echo "Checking to see how big your double precision numbers are..." >&4
6889 printf("%d\n", (int)sizeof(double));
6894 if eval $compile_ok; then
6895 doublesize=`$run ./try`
6896 echo "Your double is $doublesize bytes long."
6899 echo "(I can't seem to compile the test program. Guessing...)"
6900 rp="What is the size of a double precision number (in bytes)?"
6908 : check for long doubles
6910 echo "Checking to see if you have long double..." >&4
6911 echo 'int main() { long double x = 7.0; }' > try.c
6913 if eval $compile; then
6915 echo "You have long double."
6918 echo "You do not have long double."
6924 : see if ldexpl exists
6928 : check for length of long double
6929 case "${d_longdbl}${longdblsize}" in
6932 echo "Checking to see how big your long doubles are..." >&4
6933 $cat >try.c <<'EOCP'
6937 printf("%d\n", sizeof(long double));
6942 if eval $compile; then
6943 longdblsize=`$run ./try`
6944 echo "Your long doubles are $longdblsize bytes long."
6948 echo "(I can't seem to compile the test program. Guessing...)" >&4
6949 rp="What is the size of a long double (in bytes)?"
6953 if $test "X$doublesize" = "X$longdblsize"; then
6954 echo "That isn't any different from an ordinary double."
6955 echo "I'll keep your setting anyway, but you may see some"
6956 echo "harmless compilation warnings."
6962 $echo "Checking the kind of long doubles you have..." >&4
6963 case "$d_longdbl" in
6967 #define LONGDBLSIZE $longdblsize
6968 #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 ""|" "|none) 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.
7813 : determine whether to use malloc wrapping
7815 case "$usemallocwrap" in
7816 [yY]*|true|$define) dflt='y' ;;
7817 [nN]*|false|$undef) dflt='n' ;;
7818 *) case "$usedevel" in
7819 [yY]*|true|$define) dflt='y' ;;
7824 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7826 usemallocwrap="$ans"
7829 usemallocwrap="$define" ;;
7831 usemallocwrap="$undef" ;;
7834 : determine which malloc to compile in
7836 case "$usemymalloc" in
7837 [yY]*|true|$define) dflt='y' ;;
7838 [nN]*|false|$undef) dflt='n' ;;
7839 *) case "$ptrsize" in
7843 if test "$useithreads" = "$define"; then dflt='n'; fi
7846 rp="Do you wish to attempt to use the malloc that comes with $package?"
7852 mallocsrc='malloc.c'
7853 mallocobj="malloc$_o"
7854 d_mymalloc="$define"
7857 : Remove malloc from list of libraries to use
7858 echo "Removing unneeded -lmalloc from library list" >&4
7859 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7862 echo "libs = $libs" >&4
7874 : compute the return types of malloc and free
7876 $cat >malloc.c <<END
7880 #include <sys/types.h>
7894 case "$malloctype" in
7896 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7903 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7907 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7914 echo "Your system uses $freetype free(), it would seem." >&4
7916 : determine where site specific architecture-dependent libraries go.
7917 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7918 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7919 : sitelib may have an optional trailing /share.
7921 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7922 dflt="$dflt/$archname"
7927 set sitearch sitearch none
7931 The installation process will also create a directory for
7932 architecture-dependent site-specific extensions and modules.
7936 rp='Pathname for the site-specific architecture-dependent library files?'
7940 if $test X"$sitearch" = X"$sitelib"; then
7943 d_sitearch="$define"
7946 : Set the vendorprefix variables
7949 The installation process will also create a directory for
7950 vendor-supplied add-ons. Vendors who supply perl with their system
7951 may find it convenient to place all vendor-supplied files in this
7952 directory rather than in the main distribution directory. This will
7953 ease upgrades between binary-compatible maintenance versions of perl.
7955 Of course you may also use these directories in whatever way you see
7956 fit. For example, you might use them to access modules shared over a
7957 company-wide network.
7959 The default answer should be fine for most people.
7960 This causes further questions about vendor add-ons to be skipped
7961 and no vendor-specific directories will be configured for perl.
7964 rp='Do you want to configure vendor-specific add-on directories?'
7965 case "$usevendorprefix" in
7966 define|true|[yY]*) dflt=y ;;
7967 *) : User may have set vendorprefix directly on Configure command line.
7968 case "$vendorprefix" in
7977 rp='Installation prefix to use for vendor-supplied add-ons?'
7978 case "$vendorprefix" in
7979 '') dflt="$prefix" ;;
7980 *) dflt=$vendorprefix ;;
7983 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7985 case "$vendorprefix" in
7989 *) oldvendorprefix="$prefix";;
7993 usevendorprefix="$define"
7995 vendorprefixexp="$ansexp"
7997 *) usevendorprefix="$undef"
8003 : Set the vendorlib variables
8004 case "$vendorprefix" in
8005 '') d_vendorlib="$undef"
8009 *) d_vendorlib="$define"
8010 : determine where vendor-supplied modules go.
8011 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8012 case "$vendorlib" in
8014 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8015 case "$installstyle" in
8016 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8017 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8020 *) dflt="$vendorlib"
8024 rp='Pathname for the vendor-supplied library files?'
8027 vendorlibexp="$ansexp"
8030 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8034 : Set the vendorarch variables
8035 case "$vendorprefix" in
8036 '') d_vendorarch="$undef"
8040 *) d_vendorarch="$define"
8041 : determine where vendor-supplied architecture-dependent libraries go.
8042 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8043 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8044 : vendorlib may have an optional trailing /share.
8045 case "$vendorarch" in
8046 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8047 dflt="$dflt/$archname"
8049 *) dflt="$vendorarch" ;;
8052 rp='Pathname for vendor-supplied architecture-dependent files?'
8055 vendorarchexp="$ansexp"
8058 prefixvar=vendorarch
8060 if $test X"$vendorarch" = X"$vendorlib"; then
8061 d_vendorarch="$undef"
8063 d_vendorarch="$define"
8066 : Final catch-all directories to search
8069 Lastly, you can have perl look in other directories for extensions and
8070 modules in addition to those already specified.
8071 These directories will be searched after
8075 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8076 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8078 case "$otherlibdirs" in
8079 ''|' ') dflt='none' ;;
8080 *) dflt="$otherlibdirs" ;;
8083 Enter a colon-separated set of extra paths to include in perl's @INC
8084 search path, or enter 'none' for no extra paths.
8088 rp='Colon-separated list of additional directories for perl to search?'
8091 ' '|''|none) otherlibdirs=' ' ;;
8092 *) otherlibdirs="$ans" ;;
8094 case "$otherlibdirs" in
8098 set d_perl_otherlibdirs
8102 dflt_dtrace='/usr/sbin/dtrace'
8103 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8107 Perl can be built to support DTrace on platforms that support it.
8108 DTrace is a diagnosis and performance analysis tool from Sun.
8110 If this doesn't make any sense to you, just accept the default.
8114 case "$usedtrace" in
8124 dflt_dtrace=$usedtrace
8131 rp='Support DTrace if available?'
8134 y|Y) val="$define" ;;
8140 test "X$usedtrace" != "X$define" && break
8143 rp='Where is the dtrace executable?'
8152 if $dtrace -h -s ../perldtrace.d \
8153 -o perldtrace.tmp >/dev/null 2>&1 \
8154 && rm -f perldtrace.tmp
8157 echo "Good: your $dtrace knows about the -h flag."
8161 *** $me: Fatal Error: $dtrace doesn't support -h flag
8163 *** Your installed dtrace doesn't support the -h switch to compile a D
8164 *** program into a C header. Can't continue.
8176 *** $me: Fatal Error: $dtrace not found.
8183 echo "*** $dtrace was not found."
8189 : See if we want extra modules installed
8196 Perl can be built with extra modules or bundles of modules which
8197 will be fetched from the CPAN and installed alongside Perl.
8199 Notice that you will need access to the CPAN; either via the Internet,
8200 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8201 be asked later to configure the CPAN.pm module which will in turn do
8202 the installation of the rest of the extra modules or bundles.)
8204 Notice also that if the modules require any external software such as
8205 libraries and headers (the libz library and the zlib.h header for the
8206 Compress::Zlib module, for example) you MUST have any such software
8207 already installed, this configuration process will NOT install such
8210 If this doesn't make any sense to you, just accept the default '$dflt'.
8212 rp='Install any extra modules (y or n)?'
8218 Please list any extra modules or bundles to be installed from CPAN,
8219 with spaces between the names. The names can be in any format the
8220 'install' command of CPAN.pm will understand. (Answer 'none',
8221 without the quotes, to install no extra modules or bundles.)
8231 $rm -f ../extras.lst
8233 *) echo "(Saving the list of extras for later...)"
8234 echo "$extras" > ../extras.lst
8242 : determine where html pages for programs go
8243 set html1dir html1dir none
8247 If you wish to install html files for programs in $spackage, indicate
8248 the appropriate directory here. To skip installing html files,
8252 ''|none|$undef|' ') dflt=none ;;
8253 *) dflt=$html1dir ;;
8256 rp="Directory for the main $spackage html pages?"
8260 : Use ' ' for none so value is preserved next time through Configure
8261 $test X"$html1dir" = "X" && html1dir=' '
8263 : determine where html pages for libraries and modules go
8264 set html3dir html3dir none
8268 If you wish to install html files for modules associated with $spackage,
8269 indicate the appropriate directory here. To skip installing html files,
8272 : There is no obvious default. If they have specified html1dir, then
8273 : try to key off that, possibly changing .../html1 into .../html3.
8275 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8276 *) dflt=$html3dir ;;
8279 rp="Directory for the $spackage module html pages?"
8283 : Use ' ' for none so value is preserved next time through Configure
8284 $test X"$html3dir" = "X" && html3dir=' '
8286 : determine whether to install perl also as /usr/bin/perl
8289 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8291 Many scripts expect perl to be installed as /usr/bin/perl.
8293 If you want to, I can install the perl you are about to compile
8294 as /usr/bin/perl (in addition to $bin/perl).
8296 if test -f /usr/bin/perl; then
8299 However, please note that because you already have a /usr/bin/perl,
8300 overwriting that with a new Perl would very probably cause problems.
8301 Therefore I'm assuming you don't want to do that (unless you insist).
8304 case "$installusrbinperl" in
8305 "$define"|[yY]*) dflt='y';;
8311 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8314 case "$installusrbinperl" in
8315 "$undef"|[nN]*) dflt='n';;
8319 rp="Do you want to install perl as /usr/bin/perl?"
8322 [yY]*) val="$define";;
8328 set installusrbinperl
8331 : see if dlopen exists
8333 xxx_ccflags="$ccflags"
8335 : with g++ one needs -shared to get is-in-libc to work for dlopen
8336 case "$gccversion" in
8339 *) case "$d_cplusplus" in
8340 "$define") ccflags="$ccflags -shared" ;;
8347 ccflags="$xxx_ccflags"
8349 : see if this is a unistd.h system
8350 set unistd.h i_unistd
8353 : determine which dynamic loading, if any, to compile in
8355 dldir="ext/DynaLoader"
8368 $define) dflt='y' ;;
8370 : Does a dl_xxx.xs file exist for this operating system
8371 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8374 rp="Do you wish to use dynamic loading?"
8381 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8382 dflt="$dldir/dl_${osname}.xs"
8383 elif $test "$d_dlopen" = "$define" ; then
8384 dflt="$dldir/dl_dlopen.xs"
8389 *) dflt="$dldir/$dlsrc"
8392 echo "The following dynamic loading files are available:"
8393 : Can not go over to $dldir because getfile has path hard-coded in.
8394 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8395 rp="Source file to use for dynamic loading"
8401 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8405 Some systems may require passing special flags to $cc -c to
8406 compile modules that will be used to create a shared library.
8407 To use no flags, say "none".
8410 case "$cccdlflags" in
8411 '') case "$gccversion" in
8412 '') case "$osname" in
8414 irix*) dflt='-KPIC' ;;
8415 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8416 sunos) dflt='-pic' ;;
8420 *) case "$osname" in
8421 darwin) dflt='none' ;;
8422 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8427 *) dflt="$cccdlflags" ;;
8434 # If -Dsysroot was specified, now's the time to add it
8436 if test "X$sysroot" != X; then
8437 case "$gccversion" in
8442 dflt="$dflt --sysroot=$sysroot" ;;
8452 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8455 none) cccdlflags=' ' ;;
8456 *) cccdlflags="$ans" ;;
8461 Some systems use ld to create libraries that can be dynamically loaded,
8462 while other systems (such as those using ELF) use $cc.
8466 : Determine if this is ELF
8468 /* Test for whether ELF binaries are produced */
8480 int i = open("a.out",O_RDONLY);
8483 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8484 exit(0); /* succeed (yes, it is ELF) */
8488 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8494 '') if $test $bin_ELF = "$define"; then
8496 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8500 echo "I'll use ld to build dynamic libraries."
8508 rp="What command should be used to create dynamic libraries?"
8514 Some systems may require passing special flags to $ld to create a
8515 library that can be dynamically loaded. If your ld flags include
8516 -L/other/path options to locate libraries outside your loader's normal
8517 search path, you may need to specify those -L options here as well. To
8518 use no flags, say "none".
8521 case "$lddlflags" in
8522 '') case "$osname" in
8523 haiku) dflt='-shared' ;;
8525 case "$gccversion" in
8526 '') dflt="$dflt +vnocompatwarnings" ;;
8529 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8530 solaris) # See [perl #66604].
8531 # On Solaris 11, gcc -m64 on amd64
8532 # appears not to understand -G. gcc versions at
8533 # least as old as 3.4.3 support -shared, so just
8534 # use that with Solaris 11 and later, but keep
8535 # the old behavior for older Solaris versions.
8536 case "$gccversion" in
8538 *) case "$osvers" in
8539 2.?|2.10) dflt='-G' ;;
8540 *) dflt='-shared' ;;
8545 sunos) dflt='-assert nodefinitions' ;;
8546 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8550 *) dflt="$lddlflags" ;;
8553 : Only do this for gcc, since, for example, qcc has no concept
8555 if $test "X$sysroot" != X; then
8556 case "$gccversion" in
8558 *) dflt="$dflt --sysroot=$sysroot" ;;
8562 : Try to guess additional flags to pick up local libraries.
8563 : Be careful not to append to a plain 'none'
8567 for thisflag in $ldflags; do
8572 *) dflt="$dflt $thisflag" ;;
8579 ''|' ') dflt='none' ;;
8583 *-fstack-protector-strong*)
8585 *-fstack-protector-strong*) ;; # Don't add it again
8586 *) dflt="$dflt -fstack-protector-strong" ;;
8589 *-fstack-protector*)
8591 *-fstack-protector*) ;; # Don't add it again
8592 *) dflt="$dflt -fstack-protector" ;;
8597 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8600 none) lddlflags=' ' ;;
8601 *) lddlflags="$ans" ;;
8606 Some systems may require passing special flags to $cc to indicate that
8607 the resulting executable will use dynamic linking. To use no flags,
8611 case "$ccdlflags" in
8612 '') case "$osname" in
8613 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8614 sunos) dflt='none' ;;
8618 *) dflt="$ccdlflags" ;;
8620 rp="Any special flags to pass to $cc to use dynamic linking?"
8623 none) ccdlflags=' ' ;;
8624 *) ccdlflags="$ans" ;;
8636 ld_can_script="$undef"
8637 case "$bin_ELF$usedl" in
8639 # Abuse try.h and a.out names for neat cleanup
8651 if $cc $cccdlflags $ccdlflags $ccflags \
8652 $ldflags $lddlflags -o a.out try.c \
8653 -Wl,--version-script=try.h >/dev/null 2>&1 \
8654 && $test -s a.out ; then
8655 echo "ld supports scripting" >&4
8656 ld_can_script="$define"
8658 echo "ld does not support scripting" >&4
8664 : Do we want a shared libperl?
8668 # No dynamic loading being used, so don't bother even to prompt.
8671 *) case "$useshrplib" in
8672 '') case "$osname" in
8673 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8675 also='Building a shared libperl is required for dynamic loading to work on your system.'
8689 The perl executable is normally obtained by linking perlmain.c with
8690 libperl${_a}, any static extensions (usually just DynaLoader), and
8691 any other libraries needed on this system (such as -lm, etc.). Since
8692 your system supports dynamic loading, it is probably possible to build
8693 a shared libperl.$so. If you will have more than one executable linked
8694 to libperl.$so, this will significantly reduce the size of each
8695 executable, but it may have a noticeable effect on performance. The
8696 default is probably sensible for your system.
8700 rp="Build a shared libperl.$so (y/n)"
8704 useshrplib='true' ;;
8705 *) useshrplib='false' ;;
8710 case "$useshrplib" in
8712 case "$userelocatableinc" in
8714 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8715 echo "See INSTALL for an explanation why that won't work." >&4
8721 # Figure out a good name for libperl.so. Since it gets stored in
8722 # a version-specific architecture-dependent library, the version
8723 # number isn't really that important, except for making cc/ld happy.
8725 # A name such as libperl.so.10.1
8726 majmin="libperl.$so.$patchlevel.$subversion"
8727 # A name such as libperl.so.100
8728 majonly=`echo $patchlevel $subversion |
8729 $awk '{printf "%d%02d", $1, $2}'`
8730 majonly=libperl.$so.$majonly
8731 # I'd prefer to keep the os-specific stuff here to a minimum, and
8732 # rely on figuring it out from the naming of libc.
8733 case "${osname}${osvers}" in
8734 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8737 cygwin*) # ld links now against the dll directly
8738 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8739 majonly=`echo $patchlevel $subversion |
8740 $awk '{printf "%03d%03d", $1, $2}'`
8741 majonly=cygperl5.$majonly.$so
8744 *) # Try to guess based on whether libc has major.minor.
8746 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8747 *libc.$so.[0-9]*) dflt=$majonly ;;
8748 *) dflt=libperl.$so ;;
8758 I need to select a good name for the shared libperl. If your system uses
8759 library names with major and minor numbers, then you might want something
8760 like $majmin. Alternatively, if your system uses a single version
8761 number for shared libraries, then you might want to use $majonly.
8762 Or, your system might be quite happy with a simple libperl.$so.
8764 Since the shared libperl will get installed into a version-specific
8765 architecture-dependent directory, the version number of the shared perl
8766 library probably isn't important, so the default should be o.k.
8769 rp='What name do you want to give to the shared libperl?'
8772 echo "Ok, I'll use $libperl"
8775 libperl="libperl${_a}"
8779 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8783 WARNING: Use of the shrpdir variable for the installation location of
8784 the shared $libperl is not supported. It was never documented and
8785 will not work in this version. Let me (perlbug@perl.org)
8786 know of any problems this may cause.
8792 But your current setting of $shrpdir is
8793 the default anyway, so it's harmless.
8798 Further, your current attempted setting of $shrpdir
8799 conflicts with the value of $archlibexp/CORE
8800 that installperl will use.
8807 # How will the perl executable find the installed shared $libperl?
8808 # Add $xxx to ccdlflags.
8809 # If we can't figure out a command-line option, use $shrpenv to
8810 # set env LD_RUN_PATH. The main perl makefile uses this.
8811 shrpdir=$archlibexp/CORE
8814 if "$useshrplib"; then
8817 # We'll set it in Makefile.SH...
8822 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8823 xxx="-Wl,-R$shrpdir"
8825 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8826 xxx="-Wl,-rpath,$shrpdir"
8829 # hpux doesn't like the default, either.
8830 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8833 # cygwin needs only ldlibpth
8836 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8842 # Only add $xxx if it isn't already in ccdlflags.
8843 case " $ccdlflags " in
8845 *) ccdlflags="$ccdlflags $xxx"
8848 Adding $xxx to the flags
8849 passed to $ld so that the perl executable will find the
8850 installed shared $libperl.
8858 # Fix ccdlflags in AIX for building external extensions.
8859 # (For building Perl itself bare -bE:perl.exp is needed,
8860 # Makefile.SH takes care of this.)
8862 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8864 # Respect a hint or command-line value.
8866 '') shrpenv="$tmp_shrpenv" ;;
8868 case "$ldlibpthname" in
8869 '') ldlibpthname=LD_LIBRARY_PATH ;;
8870 none) ldlibpthname='' ;;
8873 : determine where manual pages are on this system
8877 syspath='/usr/share/man/man1 /usr/man/man1'
8878 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8879 syspath="$syspath /usr/man/u_man/man1"
8880 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8881 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8882 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8883 sysman=`./loc . /usr/man/man1 $syspath`
8886 if $test -d "$sysman"; then
8887 echo "System manual is in $sysman." >&4
8889 echo "Could not find manual pages in source form." >&4
8892 : determine where manual pages go
8893 set man1dir man1dir none
8897 $spackage has manual pages available in source form.
8901 echo "However, you don't have nroff, so they're probably useless to you."
8903 '') man1dir="none";;
8906 echo "If you don't want the manual sources installed, answer 'none'."
8911 lookpath="$prefixexp/share/man/man1"
8912 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8913 lookpath="$lookpath $prefixexp/man/p_man/man1"
8914 lookpath="$lookpath $prefixexp/man/u_man/man1"
8915 lookpath="$lookpath $prefixexp/man/man.1"
8917 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8918 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8928 rp="Where do the main $spackage manual pages (source) go?"
8930 if $test "X$man1direxp" != "X$ansexp"; then
8941 : What suffix to use on installed man pages
8948 rp="What suffix should be used for the main $spackage man pages?"
8950 '') case "$man1dir" in
8964 *) dflt="$man1ext";;
8971 : see if we can have long filenames
8973 first=123456789abcdef
8975 if (echo hi >$first) 2>/dev/null; then
8976 if $test -f 123456789abcde; then
8977 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8980 echo 'You can have filenames longer than 14 characters.'>&4
8985 You can't have filenames longer than 14 chars.
8986 You can't even think about them!
8992 $rm -rf 123456789abcde*
8994 : determine where library module manual pages go
8995 set man3dir man3dir none
8999 $spackage has manual pages for many of the library modules.
9005 However, you don't have nroff, so they're probably useless to you.
9008 '') man3dir="none";;
9012 case "$d_flexfnam" in
9015 However, your system can't handle the long file names like File::Basename.3.
9018 '') man3dir="none";;
9022 echo "If you don't want the manual sources installed, answer 'none'."
9023 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9025 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9026 if $test -d "$privlib/man/man3"; then
9029 WARNING: Previous versions of perl installed man3 pages into
9030 $privlib/man/man3. This version will suggest a
9031 new default of $dflt.
9035 rp='Do you wish to preserve the old behavior?(y/n)'
9038 y*) dflt="$privlib/man/man3" ;;
9043 *) dflt="$man3dir" ;;
9050 rp="Where do the $package library man pages (source) go?"
9060 : What suffix to use on installed man pages
9066 rp="What suffix should be used for the $package library man pages?"
9068 '') case "$man3dir" in
9082 *) dflt="$man3ext";;
9089 : see if we have to deal with yellow pages, now NIS.
9090 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9096 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9104 rp='Are you getting the hosts file via yellow pages?'
9107 y*) hostcat='ypcat hosts';;
9108 *) hostcat='cat /etc/hosts';;
9114 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9117 '') test -f /etc/group && groupcat='cat /etc/group';;
9120 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9123 : now get the host name
9125 echo "Figuring out host name..." >&4
9126 case "$myhostname" in
9128 echo 'Maybe "hostname" will work...'
9129 if tans=`sh -c hostname 2>&1` ; then
9137 if $test "$cont"; then
9139 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9140 if tans=`cat /etc/systemid 2>&1` ; then
9142 phostname='cat /etc/systemid'
9143 echo "Whadyaknow. Xenix always was a bit strange..."
9146 elif $test -r /etc/systemid; then
9147 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9150 if $test "$cont"; then
9151 echo 'No, maybe "uuname -l" will work...'
9152 if tans=`sh -c 'uuname -l' 2>&1` ; then
9154 phostname='uuname -l'
9156 echo 'Strange. Maybe "uname -n" will work...'
9157 if tans=`sh -c 'uname -n' 2>&1` ; then
9159 phostname='uname -n'
9161 echo 'Oh well, maybe I can mine it out of whoami.h...'
9162 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9163 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9164 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9166 case "$myhostname" in
9167 '') echo "Does this machine have an identity crisis or something?"
9170 echo "Well, you said $myhostname before..."
9171 phostname='echo $myhostname';;
9177 case "$myhostname" in
9178 '') myhostname=noname ;;
9180 : you do not want to know about this
9185 if $test "$myhostname" ; then
9187 rp='Your host name appears to be "'$myhostname'".'" Right?"
9195 : bad guess or no guess
9196 while $test "X$myhostname" = X ; do
9198 rp="Please type the (one word) name of your host:"
9203 : translate upper to lower if necessary
9204 case "$myhostname" in
9206 echo "(Normalizing case in your host name)"
9207 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9211 case "$myhostname" in
9213 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9214 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9215 echo "(Trimming domain name from host name--host name is now $myhostname)"
9217 *) case "$mydomain" in
9220 test "X$hostcat" = "Xypcat hosts" &&
9221 ypmatch "$myhostname" hosts 2>/dev/null |\
9222 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9225 test "X$hostcat" != "X" &&
9226 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9227 /[ ]$myhostname[ . ]/p" > hosts
9230 if $test -f hosts; then
9231 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9232 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9233 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9234 hosts | $sort | $uniq | \
9235 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9236 case `$echo X$dflt` in
9237 X*\ *) echo "(Several hosts in the database matched hostname)"
9240 X.) echo "(You do not have fully-qualified names in the hosts database)"
9244 echo "(I cannot locate a hosts database anywhere)"
9249 tans=`./loc resolv.conf X /etc /usr/etc`
9250 if $test -f "$tans"; then
9251 echo "(Attempting domain name extraction from $tans)"
9252 dflt=.`$sed -n -e 's/ / /g' \
9253 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9256 .) dflt=.`$sed -n -e 's/ / /g' \
9257 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9265 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9266 dflt=.`sh -c domainname 2>/dev/null`
9269 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9273 case "$dflt$osname" in
9274 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9275 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9279 .) echo "(Lost all hope -- silly guess then)"
9285 *) dflt="$mydomain";;
9289 rp="What is your domain name?"
9299 : translate upper to lower if necessary
9302 echo "(Normalizing case in your domain name)"
9303 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9307 : a little sanity check here
9308 case "$phostname" in
9311 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9312 $myhostname$mydomain|$myhostname) ;;
9314 case "$phostname" in
9316 echo "(That doesn't agree with your whoami.h file, by the way.)"
9319 echo "(That doesn't agree with your $phostname command, by the way.)"
9327 : determine the e-mail address of the user who is running us
9330 I need to get your e-mail address in Internet format if possible, i.e.
9331 something like user@host.domain. Please answer accurately since I have
9332 no easy means to double check it. The default value provided below
9333 is most probably close to reality but may not be valid from outside
9334 your organization...
9338 while test "$cont"; do
9339 case "$MAILDOMAIN" in
9341 if $test -s /etc/mailname; then
9342 maildomain=`$cat /etc/mailname`
9344 maildomain="$myhostname$mydomain"
9347 *) maildomain="$MAILDOMAIN";;
9350 '') dflt="$cf_by@$maildomain";;
9351 *) dflt="$cf_email";;
9353 rp='What is your e-mail address?'
9359 rp='Address does not look like an Internet one. Use it anyway?'
9373 : Ask e-mail of administrator
9376 If you or somebody else will be maintaining perl at your site, please
9377 fill in the correct e-mail address here so that they may be contacted
9378 if necessary. Currently, the "perlbug" program included with perl
9379 will send mail to this address in addition to perlbug@perl.org. You may
9380 enter "none" for no administrator.
9383 case "$perladmin" in
9384 '') dflt="$cf_email";;
9385 *) dflt="$perladmin";;
9387 rp='Perl administrator e-mail address'
9391 : determine whether to use a version number suffix for installed binaries
9394 Do you want to use a version number suffix for installed binaries? This
9395 will install 'perl$version' instead of 'perl', and likewise for other
9396 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9397 to be installed side-by-side. Unless you are a developer, you probably
9398 do *not* want to do this.
9400 case "$versiononly" in
9401 "$define"|[Yy]*|true) dflt='y' ;;
9404 rp="Do you want to use a version number suffix for installed binaries?"
9407 [yY]*) val="$define";;
9413 case "$versiononly" in
9414 "$define") inc_version_list=''
9415 inc_version_list_init=0
9419 : figure out how to guarantee perl startup
9420 : XXX Note that this currently takes advantage of the bug that binexp ignores
9421 : the Configure -Dinstallprefix setting, which in turn means that under
9422 : relocatable @INC, initialinstalllocation is what binexp started as.
9423 case "$startperl" in
9425 case "$sharpbang" in
9429 I can use the #! construct to start perl on your system. This will
9430 make startup of perl scripts faster, but may cause problems if you
9431 want to share those scripts and perl is not in a standard place
9432 ($initialinstalllocation/perl) on all your platforms. The alternative
9433 is to force a shell by starting the script with a single ':' character.
9436 case "$versiononly" in
9437 "$define") dflt="$initialinstalllocation/perl$version";;
9438 *) dflt="$initialinstalllocation/perl";;
9440 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9443 none) startperl=": # use perl";;
9444 *) startperl="#!$ans"
9445 if $test 30 -lt `echo "$ans" | wc -c`; then
9448 WARNING: Some systems limit the #! command to 32 characters.
9449 If you experience difficulty running Perl scripts with #!, try
9450 installing Perl in a directory with a shorter pathname.
9456 *) startperl=": # use perl"
9461 echo "I'll use $startperl to start perl scripts."
9463 : figure best path for perl in scripts
9466 case "$versiononly" in
9467 "$define") perlpath="$initialinstalllocation/perl$version";;
9468 *) perlpath="$initialinstalllocation/perl";;
9470 case "$startperl" in
9475 I will use the "eval 'exec'" idiom to start Perl on your system.
9476 I can use the full path of your Perl binary for this purpose, but
9477 doing so may cause problems if you want to share those scripts and
9478 Perl is not always in a standard place ($initialinstalllocation/perl).
9481 dflt="$initialinstalllocation/perl"
9482 rp="What path shall I use in \"eval 'exec'\"?"
9489 case "$startperl" in
9491 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9494 : determine where public executable scripts go
9495 set scriptdir scriptdir
9497 case "$scriptdir" in
9500 : guess some guesses
9501 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9502 $test -d /usr/share/bin && dflt=/usr/share/bin
9503 $test -d /usr/local/script && dflt=/usr/local/script
9504 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9505 $test -d $prefixexp/script && dflt=$prefixexp/script
9509 *) dflt="$scriptdir"
9514 Some installations have a separate directory just for executable scripts so
9515 that they can mount it across multiple architectures but keep the scripts in
9516 one spot. You might, for example, have a subdirectory of /usr/share for this.
9517 Or you might just lump your scripts in with all your other executables.
9521 rp='Where do you keep publicly executable scripts?'
9523 if $test "X$ansexp" != "X$scriptdirexp"; then
9529 : A little fix up for an irregularly named variable.
9530 installscript="$installscriptdir"
9532 : determine where add-on public executables go
9534 '') dflt=$siteprefix/bin ;;
9538 rp='Pathname where the add-on public executables should be installed?'
9543 : determine where add-on html pages go
9544 : There is no standard location, so try to copy the previously-selected
9545 : directory structure for the core html pages.
9546 case "$sitehtml1dir" in
9547 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9548 *) dflt=$sitehtml1dir ;;
9551 ''|' ') dflt=none ;;
9554 rp='Pathname where the site-specific html pages should be installed?'
9556 prefixvar=sitehtml1dir
9559 : determine where add-on library html pages go
9560 : There is no standard location, so try to copy the previously-selected
9561 : directory structure for the core html pages.
9562 case "$sitehtml3dir" in
9563 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9564 *) dflt=$sitehtml3dir ;;
9567 ''|' ') dflt=none ;;
9570 rp='Pathname where the site-specific library html pages should be installed?'
9572 prefixvar=sitehtml3dir
9575 : determine where add-on manual pages go
9576 case "$siteman1dir" in
9577 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9578 *) dflt=$siteman1dir ;;
9581 ''|' ') dflt=none ;;
9584 rp='Pathname where the site-specific manual pages should be installed?'
9586 prefixvar=siteman1dir
9589 : determine where add-on library man pages go
9590 case "$siteman3dir" in
9591 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9592 *) dflt=$siteman3dir ;;
9595 ''|' ') dflt=none ;;
9598 rp='Pathname where the site-specific library manual pages should be installed?'
9600 prefixvar=siteman3dir
9603 : determine where add-on public executable scripts go
9604 case "$sitescript" in
9605 '') dflt=$siteprefix/script
9606 $test -d $dflt || dflt=$sitebin ;;
9607 *) dflt="$sitescript" ;;
9610 rp='Pathname where add-on public executable scripts should be installed?'
9612 prefixvar=sitescript
9615 : see if backtrace exists
9616 set backtrace d_backtrace
9619 : add flags if using c backtrace
9620 case "$usecbacktrace" in
9621 "") usecbacktrace=$undef ;;
9623 case "$d_backtrace" in
9625 case " $ccflags " in
9626 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9627 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9631 echo "This system does not support backtrace" >&4
9632 usecbacktrace=$undef
9638 : Check if faststdio is requested and available
9639 case "$usefaststdio" in
9640 $define|true|[yY]*|'')
9641 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9651 Perl can be built to use 'fast stdio', which means using the stdio
9652 library but also directly manipulating the stdio buffers to enable
9653 faster I/O. Using stdio is better for backward compatibility (especially
9654 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9655 interface has been preferred instead of stdio.
9657 If this doesn't make any sense to you, just accept the default '$dflt'.
9659 rp='Use the "fast stdio" if available?'
9662 y|Y) val="$define" ;;
9668 : define an is-a-typedef? function
9669 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9671 "") inclist="sys/types.h";;
9673 eval "varval=\$$var";
9677 for inc in $inclist; do
9678 echo "#include <$inc>" >>temp.c;
9680 echo "#ifdef $type" >> temp.c;
9681 echo "printf(\"We have $type\");" >> temp.c;
9682 echo "#endif" >> temp.c;
9683 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9684 if $contains $type temp.E >/dev/null 2>&1; then
9690 *) eval "$var=\$varval";;
9693 : define an is-a-typedef? function that prompts if the type is not available.
9694 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9696 "") inclist="sys/types.h";;
9698 eval "varval=\$$var";
9702 for inc in $inclist; do
9703 echo "#include <$inc>" >>temp.c;
9705 echo "#ifdef $type" >> temp.c;
9706 echo "printf(\"We have $type\");" >> temp.c;
9707 echo "#endif" >> temp.c;
9708 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9710 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9711 if $contains $type temp.E >/dev/null 2>&1; then
9712 echo "$type found." >&4;
9715 echo "$type NOT found." >&4;
9721 *) eval "$var=\$varval";;
9724 : see what type lseek is declared as in the kernel
9725 rp="What is the type used for lseek's offset on this system?"
9726 set off_t lseektype long stdio.h sys/types.h
9730 echo "Checking to see how big your file offsets are..." >&4
9732 #include <sys/types.h>
9736 printf("%d\n", (int)sizeof($lseektype));
9741 if eval $compile_ok; then
9742 lseeksize=`$run ./try`
9743 echo "Your file offsets are $lseeksize bytes long."
9747 echo "(I can't seem to compile the test program. Guessing...)"
9748 rp="What is the size of your file offsets (in bytes)?"
9754 : see what type file positions are declared as in the library
9755 rp="What is the type for file position used by fsetpos()?"
9756 set fpos_t fpostype long stdio.h sys/types.h
9759 : Check size for Fpos_t
9762 *_t) zzz="$fpostype" ;;
9765 echo "Checking the size of $zzz..." >&4
9767 #include <sys/types.h>
9774 printf("%d\n", (int)sizeof($fpostype));
9779 if eval $compile_ok; then
9783 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9786 echo "Your $zzz is $fpossize bytes long."
9792 echo "(I can't compile the test program. Guessing...)" >&4
9793 rp="What is the size of your file positions (in bytes)?"
9798 : Check for large file support
9799 # Backward compatibility (uselfs is deprecated).
9801 "$define"|true|[yY]*)
9804 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9806 uselargefiles="$define"
9810 case "$lseeksize:$fpossize" in
9813 You can have files larger than 2 gigabytes.
9816 *) case "$uselargefiles" in
9817 "$undef"|false|[nN]*) dflt='n' ;;
9822 Perl can be built to understand large files (files larger than 2 gigabytes)
9823 on some systems. To do so, Configure can be run with -Duselargefiles.
9825 If this doesn't make any sense to you, just accept the default '$dflt'.
9827 rp='Try to understand large files, if available?'
9830 y|Y) val="$define" ;;
9837 : Look for a hint-file generated 'call-back-unit'. If the
9838 : user has specified that a large files perl is to be built,
9839 : we may need to set or change some other defaults.
9840 if $test -f uselargefiles.cbu; then
9841 echo "Your platform has some specific hints regarding large file builds, using them..."
9842 . ./uselargefiles.cbu
9844 case "$uselargefiles" in
9846 if $test -f uselargefiles.cbu; then
9848 echo "Rechecking to see how big your file offsets are..." >&4
9850 #include <sys/types.h>
9854 printf("%d\n", (int)sizeof($lseektype));
9859 if eval $compile_ok; then
9860 lseeksize=`$run ./try`
9861 $echo "Your file offsets are now $lseeksize bytes long."
9865 echo "(I can't seem to compile the test program. Guessing...)"
9866 rp="What is the size of your file offsets (in bytes)?"
9871 *_t) zzz="$fpostype" ;;
9874 $echo $n "Rechecking the size of $zzz...$c" >&4
9876 #include <sys/types.h>
9883 printf("%d\n", (int)sizeof($fpostype));
9888 if eval $compile_ok; then
9893 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9896 echo " $fpossize bytes." >&4
9902 echo "(I can't compile the test program. Guessing...)" >&4
9903 rp="What is the size of your file positions (in bytes)?"
9912 : Check if we want perlio
9915 : Set the vendorbin variables
9916 case "$vendorprefix" in
9917 '') d_vendorbin="$undef"
9921 *) d_vendorbin="$define"
9922 : determine where vendor-supplied executables go.
9923 case "$vendorbin" in
9924 '') dflt=$vendorprefix/bin ;;
9925 *) dflt="$vendorbin" ;;
9928 rp='Pathname for the vendor-supplied executables directory?'
9931 vendorbinexp="$ansexp"
9937 : Set the vendorhtml1dir variables
9938 case "$vendorprefix" in
9939 '') vendorhtml1dir=''
9940 vendorhtml1direxp=''
9942 *) : determine where vendor-supplied html pages go.
9943 : There is no standard location, so try to copy the previously-selected
9944 : directory structure for the core html pages.
9945 : XXX Better default suggestions would be welcome.
9946 case "$vendorhtml1dir" in
9947 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9948 *) dflt=$vendorhtml1dir ;;
9951 ''|' ') dflt=none ;;
9954 rp='Pathname for the vendor-supplied html pages?'
9956 vendorhtml1dir="$ans"
9957 vendorhtml1direxp="$ansexp"
9960 : Use ' ' for none so value is preserved next time through Configure
9961 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9962 prefixvar=vendorhtml1dir
9965 : Set the vendorhtml3dir variables
9966 case "$vendorprefix" in
9967 '') vendorhtml3dir=''
9968 vendorhtml3direxp=''
9970 *) : determine where vendor-supplied module html pages go.
9971 : There is no standard location, so try to copy the previously-selected
9972 : directory structure for the core html pages.
9973 : XXX Better default suggestions would be welcome.
9974 case "$vendorhtml3dir" in
9975 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9976 *) dflt=$vendorhtml3dir ;;
9979 ''|' ') dflt=none ;;
9982 rp='Pathname for the vendor-supplied html pages?'
9984 vendorhtml3dir="$ans"
9985 vendorhtml3direxp="$ansexp"
9988 : Use ' ' for none so value is preserved next time through Configure
9989 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9990 prefixvar=vendorhtml3dir
9993 : Set the vendorman1dir variables
9994 case "$vendorprefix" in
9995 '') vendorman1dir=''
9998 *) : determine where vendor-supplied manual pages go.
9999 case "$vendorman1dir" in
10000 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10001 *) dflt=$vendorman1dir ;;
10004 ''|' ') dflt=none ;;
10007 rp='Pathname for the vendor-supplied manual section 1 pages?'
10009 vendorman1dir="$ans"
10010 vendorman1direxp="$ansexp"
10013 : Use ' ' for none so value is preserved next time through Configure
10014 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10015 prefixvar=vendorman1dir
10018 : Set the vendorman3dir variables
10019 case "$vendorprefix" in
10020 '') vendorman3dir=''
10021 vendorman3direxp=''
10023 *) : determine where vendor-supplied module manual pages go.
10024 case "$vendorman3dir" in
10025 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10026 *) dflt=$vendorman3dir ;;
10029 ''|' ') dflt=none ;;
10032 rp='Pathname for the vendor-supplied manual section 3 pages?'
10034 vendorman3dir="$ans"
10035 vendorman3direxp="$ansexp"
10038 : Use ' ' for none so value is preserved next time through Configure
10039 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10040 prefixvar=vendorman3dir
10043 : Set the vendorscript variables
10044 case "$vendorprefix" in
10045 '') d_vendorscript="$undef"
10049 *) d_vendorscript="$define"
10050 : determine where vendor-supplied scripts go.
10051 case "$vendorscript" in
10052 '') dflt=$vendorprefix/script
10053 $test -d $dflt || dflt=$vendorbin ;;
10054 *) dflt="$vendorscript" ;;
10058 The installation process will create a directory for
10059 vendor-supplied scripts.
10063 rp='Pathname for the vendor-supplied scripts directory?'
10065 vendorscript="$ans"
10066 vendorscriptexp="$ansexp"
10069 prefixvar=vendorscript
10072 : see if qgcvt exists
10076 : Check what kind of doubles your system has
10077 $echo "Checking the kind of doubles you have..." >&4
10079 #$i_stdlib I_STDLIB
10080 #define DOUBLESIZE $doublesize
10082 #include <stdlib.h>
10085 static const double d = -0.1;
10087 unsigned const char* b = (unsigned const char*)(&d);
10088 #if DOUBLESIZE == 4
10089 if (b[0] == 0xCD && b[3] == 0xBD) {
10090 /* IEEE 754 32-bit little-endian */
10094 if (b[0] == 0xBD && b[3] == 0xCD) {
10095 /* IEEE 754 32-bit big-endian */
10099 if (b[0] == 0xCC && b[3] == 0xCC) {
10100 /* VAX format F, 32-bit PDP-style mixed endian. */
10104 if (b[0] == 0xC0 && b[3] == 0x9A) {
10105 /* IBM single 32-bit */
10110 #if DOUBLESIZE == 8
10111 if (b[0] == 0x9A && b[7] == 0xBF) {
10112 /* IEEE 754 64-bit little-endian */
10116 if (b[0] == 0xBF && b[7] == 0x9A) {
10117 /* IEEE 754 64-bit big-endian */
10121 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10122 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10123 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10124 * 99 99 b9 bf 9a 99 99 99 */
10128 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10129 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10130 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10131 * 99 99 99 9a bf b9 99 99 */
10135 if (b[0] == 0xCC && b[7] == 0xCC) {
10136 /* VAX format D, 64-bit PDP-style mixed endian. */
10140 if (b[0] == 0xD9 && b[7] == 0x99) {
10141 /* VAX format G, 64-bit PDP-style mixed endian. */
10145 if (b[0] == 0xC0 && b[7] == 0x9A) {
10146 /* IBM double 64-bit */
10150 if (b[0] == 0xBF && b[7] == 0xCD) {
10151 /* CRAY single 64-bit */
10156 #if DOUBLESIZE == 16
10157 if (b[0] == 0x9A && b[15] == 0xBF) {
10158 /* IEEE 754 128-bit little-endian */
10162 if (b[0] == 0xBF && b[15] == 0x9A) {
10163 /* IEEE 754 128-bit big-endian */
10168 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10169 * Whether those environments can still build Perl is debatable. */
10170 printf("-1\n"); /* unknown */
10175 if eval $compile; then
10176 doublekind=`$run ./try`
10180 case "$doublekind" in
10181 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10182 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10183 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10184 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10185 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10186 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10187 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10188 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10189 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10190 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10191 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10192 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10193 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10194 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10195 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10197 d_double_style_ieee=$undef
10198 d_double_style_vax=$undef
10199 d_double_style_ibm=$undef
10200 d_double_style_cray=$undef
10201 case "$doublekind" in
10202 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10203 9|10|11) d_double_style_vax=$define ;;
10204 12|13) d_double_style_ibm=$define ;;
10205 14) d_double_style_cray=$define ;;
10207 case "$d_double_style_ieee" in
10209 d_double_has_inf=$define
10210 d_double_has_nan=$define
10211 d_double_has_negative_zero=$define
10212 d_double_has_subnormals=$define
10215 d_double_has_inf=$undef
10216 d_double_has_nan=$undef
10217 d_double_has_negative_zero=$undef
10218 d_double_has_subnormals=$undef
10223 : Check print/scan long double stuff
10226 if $test X"$d_longdbl" = X"$define"; then
10228 echo "Checking how to print long doubles..." >&4
10230 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10231 $cat >try.c <<'EOCP'
10232 #include <sys/types.h>
10235 double d = 123.456;
10236 printf("%.3f\n", d);
10240 if eval $compile; then
10244 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10245 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10246 echo "We will use %f."
10252 if $test X"$sPRIfldbl" = X; then
10253 $cat >try.c <<'EOCP'
10254 #include <sys/types.h>
10257 long double d = 123.456;
10258 printf("%.3Lf\n", d);
10262 if eval $compile; then
10266 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10267 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10268 echo "We will use %Lf."
10274 if $test X"$sPRIfldbl" = X; then
10275 $cat >try.c <<'EOCP'
10276 #include <sys/types.h>
10279 long double d = 123.456;
10280 printf("%.3llf\n", d);
10284 if eval $compile; then
10288 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10289 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10290 echo "We will use %llf."
10296 if $test X"$sPRIfldbl" = X; then
10297 $cat >try.c <<'EOCP'
10298 #include <sys/types.h>
10301 long double d = 123.456;
10302 printf("%.3lf\n", d);
10306 if eval $compile; then
10310 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10311 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10312 echo "We will use %lf."
10318 if $test X"$sPRIfldbl" = X; then
10319 echo "Cannot figure out how to print long doubles." >&4
10321 sSCNfldbl=$sPRIfldbl # expect consistency
10328 case "$sPRIfldbl" in
10329 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10330 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10331 d_SCNfldbl="$undef";
10333 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10334 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10335 d_SCNfldbl="$define";
10339 : Before committing on uselongdouble, see whether that looks sane.
10340 if $test "$uselongdouble" = "$define"; then
10343 echo "Checking if your long double math functions work right..." >&4
10348 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10351 case "$osname:$gccversion" in
10352 aix:) saveccflags="$ccflags"
10353 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10356 if eval $compile_ok; then
10360 3) echo "Your long double math functions are working correctly." >&4 ;;
10361 *) echo "Your long double math functions are broken, not using long doubles." >&4
10362 uselongdouble=$undef
10366 case "$osname:$gccversion" in
10367 aix:) ccflags="$saveccflags" ;; # restore
10371 : Check how to convert floats to strings.
10373 if test "X$d_Gconvert" = X; then
10376 echo "Checking for an efficient way to convert floats to strings."
10378 case "$uselongdouble" in
10379 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10381 case "$d_longdbl" in
10382 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10384 case "$d_PRIgldbl" in
10385 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10388 #ifdef TRY_gconvert
10389 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10390 const char *myname = "gconvert";
10393 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10394 const char *myname = "gcvt";
10397 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10398 const char *myname = "qgcvt";
10399 #define DOUBLETYPE long double
10402 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10403 #ifdef HAS_PRIgldbl
10404 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10406 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10409 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10411 const char *myname = "sprintf";
10415 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10416 #define DOUBLETYPE long double
10418 #define DOUBLETYPE double
10424 #$i_stdlib I_STDLIB
10426 #include <stdlib.h>
10428 #include <string.h>
10430 void checkit(const char *expect, char *got)
10432 if (strcmp(expect, got)) {
10433 printf("%s oddity: Expected %s, got %s\n",
10434 myname, expect, got);
10444 /* This must be 1st test on (which?) platform */
10445 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10446 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10447 checkit("0.1", buf);
10449 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10450 checkit("0.01", buf);
10452 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10453 checkit("0.001", buf);
10455 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10456 checkit("0.0001", buf);
10458 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10459 if (strlen(buf) > 5)
10460 checkit("9e-005", buf); /* for Microsoft ?? */
10462 checkit("9e-05", buf);
10464 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10467 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10468 checkit("1.1", buf);
10470 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10471 checkit("1.01", buf);
10473 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10474 checkit("1.001", buf);
10476 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10477 checkit("1.0001", buf);
10479 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10480 checkit("1.00001", buf);
10482 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10483 checkit("1.000001", buf);
10485 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10488 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10489 checkit("-1", buf);
10491 /* Some Linux gcvt's give 1.e+5 here. */
10492 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10493 checkit("100000", buf);
10495 /* Some Linux gcvt's give -1.e+5 here. */
10496 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10497 checkit("-100000", buf);
10499 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10500 checkit("123.456", buf);
10502 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10503 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10504 /* 34 should be enough to scare even long double
10505 * places into using the e notation. */
10506 if (strlen(buf) > 5)
10507 checkit("1e+034", buf); /* for Microsoft */
10509 checkit("1e+34", buf);
10511 /* For Perl, if you add additional tests here, also add them to
10512 * t/base/num.t for benefit of platforms not using Configure or
10513 * overriding d_Gconvert */
10518 : first add preferred functions to our list
10520 for xxx_convert in $gconvert_preference; do
10521 case $xxx_convert in
10522 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10523 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10526 : then add any others
10527 for xxx_convert in gconvert gcvt sprintf; do
10528 case "$xxx_list" in
10530 *) xxx_list="$xxx_list $xxx_convert" ;;
10534 case "$d_longdbl$uselongdouble" in
10536 : again, add preferred functions to our list first
10538 for xxx_convert in $gconvert_ld_preference; do
10539 case $xxx_convert in
10540 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10541 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10544 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10545 for xxx_convert in qgcvt sprintf $xxx_list; do
10546 case "$xxx_ld_list" in
10547 $xxx_convert*|*" $xxx_convert"*) ;;
10548 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10551 : if sprintf cannot do long doubles, move it to the end
10552 if test "$d_PRIgldbl" != "$define"; then
10553 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10555 : if no qgcvt, remove it
10556 if test "$d_qgcvt" != "$define"; then
10557 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10560 xxx_list="$xxx_ld_list"
10564 for xxx_convert in $xxx_list; do
10565 echo "Trying $xxx_convert..."
10566 $rm -f try try$_o core
10567 set try -DTRY_$xxx_convert
10568 if eval $compile; then
10569 echo "$xxx_convert() found." >&4
10570 if $run ./try; then
10571 echo "I'll use $xxx_convert to convert floats into a string." >&4
10574 echo "...But $xxx_convert didn't work as I expected."
10578 echo "$xxx_convert NOT found." >&4
10583 if test X$xxx_convert = X; then
10584 echo "*** WHOA THERE!!! ***" >&4
10585 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10586 xxx_convert=sprintf
10589 case "$xxx_convert" in
10590 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10591 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10592 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10593 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10594 "$define$define$define")
10595 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10596 "$define$define$undef")
10597 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10598 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10606 : see if _fwalk exists
10610 : see if accept4 exists
10611 set accept4 d_accept4
10614 : Initialize h_fcntl
10617 : Initialize h_sysfile
10620 : access call always available on UNIX
10621 set access d_access
10624 : locate the flags for 'access()'
10625 case "$d_access" in
10628 $cat >access.c <<EOCP
10629 #include <sys/types.h>
10634 #include <sys/file.h>
10637 #include <unistd.h>
10639 #$i_stdlib I_STDLIB
10641 #include <stdlib.h>
10647 : check sys/file.h first, no particular reason here
10648 if $test `./findhdr sys/file.h` && \
10649 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10651 echo "<sys/file.h> defines the *_OK access constants." >&4
10652 elif $test `./findhdr fcntl.h` && \
10653 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10655 echo "<fcntl.h> defines the *_OK access constants." >&4
10656 elif $test `./findhdr unistd.h` && \
10657 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10658 echo "<unistd.h> defines the *_OK access constants." >&4
10660 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10666 : see if accessx exists
10667 set accessx d_accessx
10670 : see if acosh exists
10674 : see if aintl exists
10678 : see if alarm exists
10682 : see if 64bit time functions exists
10684 set ctime64 d_ctime64
10687 set localtime64 d_localtime64
10690 set gmtime64 d_gmtime64
10693 set mktime64 d_mktime64
10696 set difftime64 d_difftime64
10699 set asctime64 d_asctime64
10702 : see if POSIX threads are available
10703 set pthread.h i_pthread
10706 : define a function to check prototypes
10707 $cat > protochk <<EOSH
10710 optimize="$optimize"
10714 usethreads=$usethreads
10715 i_pthread=$i_pthread
10716 pthread_h_first=$pthread_h_first
10719 $cat >> protochk <<'EOSH'
10724 while test $# -ge 2; do
10726 $define) echo "#include <$2>" >> try.c ;;
10727 literal) echo "$2" >> try.c ;;
10729 # Extra magic for the benefit of systems that need pthread.h
10730 # to be included early to correctly detect threadsafe functions.
10731 # Such functions must guarantee themselves, though, that the usethreads
10732 # and i_pthread have been defined, before calling protochk.
10733 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10734 echo "#include <pthread.h>" >> try.c
10739 cat >> try.c <<'EOCP'
10740 #define _(args) args
10742 echo "$foo" >> try.c
10743 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10744 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10750 $eunicefix protochk
10752 : Define hasproto macro for Configure internal use
10753 hasproto='varname=$1; func=$2; shift; shift;
10754 while $test $# -ge 2; do
10756 $define) echo "#include <$2>";;
10757 literal) echo "$2" ;;
10761 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10762 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10763 echo "$func() prototype found.";
10766 echo "$func() prototype NOT found.";
10773 : see if sys/types.h has to be included
10774 set sys/types.h i_systypes
10777 : see if sys/select.h has to be included
10778 set sys/select.h i_sysselct
10781 : Define hasfield macro for Configure internal use
10782 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10783 while $test $# -ge 2; do
10785 $define) echo "#include <$2>";;
10789 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10791 if eval $compile; then
10800 : see if we should include sys/time.h
10803 if test "X$timeincl" = X; then
10804 echo "Testing to see if we should include <sys/time.h>." >&4
10805 $echo $n "I'm now running the test program...$c"
10807 #include <sys/types.h>
10810 #ifdef SYSTIMEKERNEL
10813 #include <sys/time.h>
10816 #include <sys/select.h>
10818 #$i_stdlib I_STDLIB
10820 #include <stdlib.h>
10826 struct timeval bar;
10829 struct timezone tzp;
10831 if (foo.tm_sec == foo.tm_sec)
10834 if (bar.tv_sec == bar.tv_sec)
10841 for s_timezone in '-DS_TIMEZONE' ''; do
10843 for s_timeval in '-DS_TIMEVAL' ''; do
10844 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10845 for i_systime in '-DI_SYSTIME' ''; do
10848 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10849 if eval $compile; then
10850 set X $i_systime $i_systimek $sysselect $s_timeval
10854 $echo $n "Succeeded with $flags$c"
10865 *SYSTIMEKERNEL*) i_systimek="$define"
10866 timeincl=`./findhdr sys/time.h`
10867 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10868 *) i_systimek="$undef";;
10871 *I_SYSTIME*) i_systime="$define"
10872 timeincl=`./findhdr sys/time.h`" $timeincl"
10873 echo "We'll include <sys/time.h>." >&4;;
10874 *) i_systime="$undef";;
10878 : see if struct tm knows about tm_zone
10879 case "$i_systime$i_time" in
10882 echo "Checking to see if your struct tm has tm_zone field..." >&4
10883 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10891 case "$d_tm_tm_zone" in
10892 "$define") echo "Yes, it does." ;;
10893 *) echo "No, it doesn't." ;;
10895 : see if struct tm knows about tm_gmtoff
10896 case "$i_systime$i_time" in
10899 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10900 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10908 case "$d_tm_tm_gmtoff" in
10909 "$define") echo "Yes, it does." ;;
10910 *) echo "No, it doesn't." ;;
10913 : see if asctime_r exists
10914 set asctime_r d_asctime_r
10916 case "$d_asctime_r" in
10918 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10919 case "$d_asctime_r_proto:$usethreads" in
10920 ":define") d_asctime_r_proto=define
10921 set d_asctime_r_proto asctime_r $hdrs
10925 case "$d_asctime_r_proto" in
10927 case "$asctime_r_proto" in
10928 ''|0) try='char* asctime_r(const struct tm*, char*);'
10929 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10931 case "$asctime_r_proto" in
10932 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10933 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10935 case "$asctime_r_proto" in
10936 ''|0) try='int asctime_r(const struct tm*, char*);'
10937 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10939 case "$asctime_r_proto" in
10940 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10941 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10943 case "$asctime_r_proto" in
10944 ''|0) d_asctime_r=undef
10946 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10947 * ) case "$asctime_r_proto" in
10948 REENTRANT_PROTO*) ;;
10949 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10951 echo "Prototype: $try" ;;
10954 *) case "$usethreads" in
10955 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10962 *) asctime_r_proto=0
10966 : see if asinh exists
10970 : see if atanh exists
10974 : see if atolf exists
10978 : see if atoll exists
10982 : Look for GCC-style attribute format
10983 case "$d_attribute_format" in
10986 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10987 $cat >attrib.c <<'EOCP'
10989 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10991 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10992 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10993 echo "Your C compiler doesn't support __attribute__((format))."
10996 echo "Your C compiler supports __attribute__((format))."
11000 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11004 *) val="$d_attribute_format" ;;
11006 set d_attribute_format
11010 : Look for GCC-style attribute format with null format allowed
11011 case "$d_printf_format_null" in
11012 '') case "$d_attribute_format" in
11015 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11016 $cat >attrib.c <<EOCP
11018 #$i_stdlib I_STDLIB
11020 #include <stdlib.h>
11022 #$i_inttypes I_INTTYPES
11024 #include <inttypes.h>
11027 #define intptr_t int
11029 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11030 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11031 int main () { exit(null_printf(NULL)); }
11033 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11034 : run the executable in case it produces a run-time warning
11035 if $run ./attrib >>attrib.out 2>&1; then
11036 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11037 echo "Your C compiler doesn't allow __printf__ format to be null."
11040 echo "Your C compiler allows __printf__ format to be null."
11044 echo "Your C compiler executable failed with __printf__ format null."
11048 echo "Your C compiler fails with __printf__ format null."
11055 *) val="$d_printf_format_null" ;;
11057 set d_printf_format_null
11061 : Look for GCC-style attribute malloc
11062 case "$d_attribute_malloc" in
11065 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11066 $cat >attrib.c <<'EOCP'
11068 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11070 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11071 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11072 echo "Your C compiler doesn't support __attribute__((malloc))."
11075 echo "Your C compiler supports __attribute__((malloc))."
11079 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11083 *) val="$d_attribute_malloc" ;;
11085 set d_attribute_malloc
11089 : Look for GCC-style attribute nonnull
11090 case "$d_attribute_nonnull" in
11093 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11094 $cat >attrib.c <<'EOCP'
11096 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11098 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11099 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11100 echo "Your C compiler doesn't support __attribute__((nonnull))."
11103 echo "Your C compiler supports __attribute__((nonnull))."
11107 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11111 *) val="$d_attribute_nonnull" ;;
11113 set d_attribute_nonnull
11117 : Look for GCC-style attribute noreturn
11118 case "$d_attribute_noreturn" in
11121 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11122 $cat >attrib.c <<'EOCP'
11124 void fall_over_dead( void ) __attribute__((noreturn));
11126 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11127 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11128 echo "Your C compiler doesn't support __attribute__((noreturn))."
11131 echo "Your C compiler supports __attribute__((noreturn))."
11135 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11139 *) val="$d_attribute_noreturn" ;;
11141 set d_attribute_noreturn
11145 : Look for GCC-style attribute pure
11146 case "$d_attribute_pure" in
11149 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11150 $cat >attrib.c <<'EOCP'
11152 int square( int n ) __attribute__((pure));
11154 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11155 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11156 echo "Your C compiler doesn't support __attribute__((pure))."
11159 echo "Your C compiler supports __attribute__((pure))."
11163 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11167 *) val="$d_attribute_pure" ;;
11169 set d_attribute_pure
11173 : Look for GCC-style attribute unused
11174 case "$d_attribute_unused" in
11177 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11178 $cat >attrib.c <<'EOCP'
11180 int do_something( int dummy __attribute__((unused)), int n );
11182 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11183 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11184 echo "Your C compiler doesn't support __attribute__((unused))."
11187 echo "Your C compiler supports __attribute__((unused))."
11191 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11195 *) val="$d_attribute_unused" ;;
11197 set d_attribute_unused
11201 : Look for GCC-style attribute deprecated
11202 case "$d_attribute_deprecated" in
11205 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11206 $cat >attrib.c <<'EOCP'
11208 int I_am_deprecated(void) __attribute__((deprecated));
11210 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11211 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11212 echo "Your C compiler doesn't support __attribute__((deprecated))."
11215 echo "Your C compiler supports __attribute__((deprecated))."
11219 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11223 *) val="$d_attribute_deprecated" ;;
11225 set d_attribute_deprecated
11229 : Look for GCC-style attribute warn_unused_result
11230 case "$d_attribute_warn_unused_result" in
11233 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11234 $cat >attrib.c <<'EOCP'
11236 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11238 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11239 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11240 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11243 echo "Your C compiler supports __attribute__((warn_unused_result))."
11247 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11251 *) val="$d_attribute_warn_unused_result" ;;
11253 set d_attribute_warn_unused_result
11257 : see if getpgrp exists
11258 set getpgrp d_getpgrp
11261 case "$d_getpgrp" in
11264 echo "Checking to see which flavor of getpgrp is in use..."
11266 #$i_unistd I_UNISTD
11267 #include <sys/types.h>
11269 # include <unistd.h>
11271 #$i_stdlib I_STDLIB
11273 #include <stdlib.h>
11277 if (getuid() == 0) {
11278 printf("(I see you are running Configure as super-user...)\n");
11281 #ifdef TRY_BSD_PGRP
11282 if (getpgrp(1) == 0)
11291 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11292 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11294 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11295 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11298 echo "I can't seem to compile and run the test program."
11300 xxx="a USG one, i.e. you use getpgrp()."
11302 # SVR4 systems can appear rather BSD-ish.
11303 case "$i_unistd" in
11305 xxx="a BSD one, i.e. you use getpgrp(pid)."
11309 xxx="probably a USG one, i.e. you use getpgrp()."
11314 echo "Assuming your getpgrp is $xxx" >&4
11323 : see if setpgrp exists
11324 set setpgrp d_setpgrp
11327 case "$d_setpgrp" in
11330 echo "Checking to see which flavor of setpgrp is in use..."
11332 #$i_unistd I_UNISTD
11333 #include <sys/types.h>
11335 # include <unistd.h>
11337 #$i_stdlib I_STDLIB
11339 #include <stdlib.h>
11343 if (getuid() == 0) {
11344 printf("(I see you are running Configure as super-user...)\n");
11347 #ifdef TRY_BSD_PGRP
11348 if (-1 == setpgrp(1, 1))
11351 if (setpgrp() != -1)
11357 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11358 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11360 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11361 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11364 echo "(I can't seem to compile and run the test program.)"
11366 xxx="a USG one, i.e. you use setpgrp()."
11368 # SVR4 systems can appear rather BSD-ish.
11369 case "$i_unistd" in
11371 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11375 xxx="probably a USG one, i.e. you use setpgrp()."
11380 echo "Assuming your setpgrp is $xxx" >&4
11389 : Look for GCC-style __builtin_add_overflow
11390 case "$d_builtin_add_overflow" in
11393 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11394 $cat >try.c <<'EOCP'
11396 const unsigned int uint_max = ~0u;
11397 int target_int = 0;
11398 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11401 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11404 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11411 if eval $compile && $run ./try; then
11412 echo "Your C compiler supports __builtin_add_overflow."
11415 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11419 *) val="$d_builtin_add_overflow" ;;
11422 set d_builtin_add_overflow
11426 : Look for GCC-style __builtin_sub_overflow
11427 case "$d_builtin_sub_overflow" in
11430 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11431 $cat >try.c <<'EOCP'
11433 const unsigned int uint_max = ~0u;
11434 int target_int = 0;
11435 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11438 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11441 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11448 if eval $compile && $run ./try; then
11449 echo "Your C compiler supports __builtin_sub_overflow."
11452 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11456 *) val="$d_builtin_sub_overflow" ;;
11459 set d_builtin_sub_overflow
11463 : Look for GCC-style __builtin_mul_overflow
11464 case "$d_builtin_mul_overflow" in
11467 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11468 $cat >try.c <<'EOCP'
11470 const unsigned int uint_max = ~0u;
11471 int target_int = 0;
11472 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11475 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11478 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11485 if eval $compile && $run ./try; then
11486 echo "Your C compiler supports __builtin_mul_overflow."
11489 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11493 *) val="$d_builtin_mul_overflow" ;;
11496 set d_builtin_mul_overflow
11500 : Look for GCC-style __builtin_choose_expr
11501 case "$d_builtin_choose_expr" in
11504 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11505 $cat >try.c <<'EOCP'
11506 #include <assert.h>
11507 #include <stdlib.h>
11510 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11513 assert( SYRINX(1) == 2112 );
11514 assert( SYRINX(1) != 5150 );
11515 assert( SYRINX(0) == 5150 );
11516 assert( SYRINX(0) != 2112 );
11517 puts( "All good!" );
11523 if eval $compile && $run ./try; then
11524 echo "Your C compiler supports __builtin_choose_expr."
11527 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11531 *) val="$d_builtin_choose_expr" ;;
11534 set d_builtin_choose_expr
11538 : Look for GCC-style __builtin_expect
11539 case "$d_builtin_expect" in
11542 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11543 $cat >try.c <<'EOCP'
11546 if ( __builtin_expect(n, 0) ) n = 1;
11547 /* Remember shell exit code truth is 0, C truth is non-zero */
11552 if eval $compile && $run ./try; then
11553 echo "Your C compiler supports __builtin_expect."
11556 echo "Your C compiler doesn't seem to understand __builtin_expect."
11560 *) val="$d_builtin_expect" ;;
11563 set d_builtin_expect
11567 : see if the Compiler supports C99 variadic macros
11568 echo "Checking for C99 variadic macros." >&4
11571 #include <stdarg.h>
11573 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11577 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11583 if eval $compile && $run ./try 2>&1 >/dev/null; then
11584 case "`$run ./try`" in
11586 echo "You have C99 variadic macros." >&4
11587 d_c99_variadic_macros="$define"
11590 echo "You don't have functional C99 variadic macros." >&4
11591 d_c99_variadic_macros="$undef"
11595 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11596 d_c99_variadic_macros="$undef"
11600 : see if signal is declared as pointer to function returning int or void
11602 xxx=`./findhdr signal.h`
11603 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11604 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11605 echo "You have int (*signal())() instead of void." >&4
11607 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11608 echo "You have void (*signal())()." >&4
11610 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11611 echo "You have int (*signal())() instead of void." >&4
11613 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11614 echo "You have void (*signal())()." >&4
11617 case "$d_voidsig" in
11619 echo "I can't determine whether signal handler returns void or int..." >&4
11621 rp="What type does your signal handler return?"
11624 v*) val="$define";;
11628 echo "As you already told me, signal handler returns void." >&4
11631 *) echo "As you already told me, signal handler returns int." >&4
11638 case "$d_voidsig" in
11639 "$define") signal_t="void";;
11640 *) signal_t="int";;
11644 : check for ability to cast large floats to 32-bit ints.
11646 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11647 if $test "$intsize" -ge 4; then
11654 #$i_stdlib I_STDLIB
11656 #include <stdlib.h>
11658 #include <sys/types.h>
11659 #include <signal.h>
11660 $signal_t blech(int s) { exit(3); }
11667 signal(SIGFPE, blech);
11669 /* Don't let compiler optimize the test away. Store the number
11670 in a writable string for gcc to pass to sscanf under HP-UX.
11672 sprintf(str, "2147483647");
11673 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11677 /* x86 processors will probably give 0x8000 0000, which is a
11678 sign change. We don't want that. We want to mimic SPARC
11679 behavior here, which is to preserve the sign and give
11682 if (i32 != ($xxx) f)
11688 if eval $compile_ok; then
11689 $run ./try 2>/dev/null
11692 echo "(I can't seem to compile the test program--assuming it can't)"
11697 echo "Yup, it can."
11700 echo "Nope, it can't."
11707 : check for ability to cast negative floats to unsigned
11709 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11712 #$i_stdlib I_STDLIB
11714 #include <stdlib.h>
11716 #include <sys/types.h>
11717 #include <signal.h>
11718 $signal_t blech(int s) { exit(7); }
11719 $signal_t blech_in_list(int s) { exit(4); }
11720 unsigned long dummy_long(unsigned long p) { return p; }
11721 unsigned int dummy_int(unsigned int p) { return p; }
11722 unsigned short dummy_short(unsigned short p) { return p; }
11726 unsigned long along;
11728 unsigned short ashort;
11732 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11733 a direct f = -123. assignment. gcc-2.8.0 reportedly
11734 optimized the whole file away
11736 /* Store the number in a writable string for gcc to pass to
11737 sscanf under HP-UX.
11739 sprintf(str, "-123");
11740 sscanf(str, "%lf", &f); /* f = -123.; */
11742 signal(SIGFPE, blech);
11743 along = (unsigned long)f;
11744 aint = (unsigned int)f;
11745 ashort = (unsigned short)f;
11746 if (along != (unsigned long)-123)
11748 if (aint != (unsigned int)-123)
11750 if (ashort != (unsigned short)-123)
11752 sprintf(str, "1073741824.");
11753 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11756 along = (unsigned long)f;
11757 if (along != 0x80000000)
11761 along = (unsigned long)f;
11762 if (along != 0x7fffffff)
11766 along = (unsigned long)f;
11767 if (along != 0x80000001)
11771 signal(SIGFPE, blech_in_list);
11772 sprintf(str, "123.");
11773 sscanf(str, "%lf", &f); /* f = 123.; */
11774 along = dummy_long((unsigned long)f);
11775 aint = dummy_int((unsigned int)f);
11776 ashort = dummy_short((unsigned short)f);
11777 if (along != (unsigned long)123)
11779 if (aint != (unsigned int)123)
11781 if (ashort != (unsigned short)123)
11788 if eval $compile_ok; then
11789 $run ./try 2>/dev/null
11792 echo "(I can't seem to compile the test program--assuming it can't)"
11795 case "$castflags" in
11797 echo "Yup, it can."
11800 echo "Nope, it can't."
11807 : see if cbrt exists
11811 : see if chown exists
11815 : see if chroot exists
11816 set chroot d_chroot
11819 : see if chsize exists
11820 set chsize d_chsize
11823 : see if class exists
11827 : see if clearenv exists
11828 set clearenv d_clearenv
11831 : Define hasstruct macro for Configure internal use
11832 hasstruct='varname=$1; struct=$2; shift; shift;
11833 while $test $# -ge 2; do
11835 $define) echo "#include <$2>";;
11839 echo "int main () { struct $struct foo; }" >> try.c;
11841 if eval $compile; then
11850 : see whether socket exists
11854 $echo $n "Hmm... $c" >&4
11855 if set socket val -f d_socket; eval $csym; $val; then
11856 echo "Looks like you have Berkeley networking support." >&4
11858 if set setsockopt val -f; eval $csym; $val; then
11861 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11862 d_oldsock="$define"
11865 if $contains socklib libc.list >/dev/null 2>&1; then
11866 echo "Looks like you have Berkeley networking support." >&4
11868 : we will have to assume that it supports the 4.2 BSD interface
11871 echo "You don't have Berkeley networking in libc$_a..." >&4
11872 if test "X$d_socket" = "X$define"; then
11873 echo "...but you seem to believe that you have sockets." >&4
11875 for net in net socket
11877 if test -f $sysroot/usr/lib/lib$net$_a; then
11878 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11879 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11880 if $contains socket libc.list >/dev/null 2>&1; then
11885 echo "...but the Wollongong group seems to have hacked it in." >&4
11886 sockethdr="-I$sysroot/usr/netinclude"
11889 echo "Found Berkeley sockets interface in lib$net." >&4
11890 if $contains setsockopt libc.list >/dev/null 2>&1; then
11893 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11894 d_oldsock="$define"
11900 if test "X$d_socket" != "X$define"; then
11901 echo "or anywhere else I see." >&4
11909 : see if socketpair exists
11910 set socketpair d_sockpair
11915 echo "Checking the availability sa_len in the sock struct ..." >&4
11917 #include <sys/types.h>
11918 #include <sys/socket.h>
11920 struct sockaddr sa;
11921 return (sa.sa_len);
11925 set try; if eval $compile; then
11928 set d_sockaddr_sa_len; eval $setvar
11932 echo "Checking the availability struct sockaddr_in6 ..." >&4
11934 #include <sys/types.h>
11935 #include <sys/socket.h>
11936 #include <netinet/in.h>
11938 struct sockaddr_in6 sin6;
11939 return (sin6.sin6_family);
11943 set try; if eval $compile; then
11946 set d_sockaddr_in6; eval $setvar
11950 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11952 #include <sys/types.h>
11953 #include <sys/socket.h>
11954 #include <netinet/in.h>
11956 struct sockaddr_in6 sin6;
11957 return (sin6.sin6_scope_id);
11961 set try; if eval $compile; then
11964 set d_sin6_scope_id; eval $setvar
11968 echo "Checking the availability struct ip_mreq ..." >&4
11970 #include <sys/types.h>
11971 #include <sys/socket.h>
11972 #include <netinet/in.h>
11974 struct ip_mreq mreq;
11975 return (mreq.imr_multiaddr.s_addr);
11979 set try; if eval $compile; then
11982 set d_ip_mreq; eval $setvar
11986 echo "Checking the availability struct ip_mreq_source ..." >&4
11988 #include <sys/types.h>
11989 #include <sys/socket.h>
11990 #include <netinet/in.h>
11992 struct ip_mreq_source mreq;
11993 return (mreq.imr_multiaddr.s_addr);
11997 set try; if eval $compile; then
12000 set d_ip_mreq_source; eval $setvar
12004 echo "Checking the availability struct ipv6_mreq ..." >&4
12006 #include <sys/types.h>
12007 #include <sys/socket.h>
12008 #include <netinet/in.h>
12010 struct ipv6_mreq mreq;
12011 return (mreq.ipv6mr_interface);
12015 set try; if eval $compile; then
12018 set d_ipv6_mreq; eval $setvar
12022 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12024 #include <sys/types.h>
12025 #include <sys/socket.h>
12026 #include <netinet/in.h>
12028 struct ipv6_mreq_source mreq;
12029 return (mreq.imr_multiaddr.s_addr);
12033 set try; if eval $compile; then
12036 set d_ipv6_mreq_source; eval $setvar
12040 echo "Checking the availability of certain socket constants..." >&4
12041 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12042 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12044 #include <sys/types.h>
12045 #include <sys/socket.h>
12051 set try; if eval $compile; then
12054 set d_${enum}; eval $setvar
12058 : see if this is a sys/uio.h system
12059 set sys/uio.h i_sysuio
12062 : Check for cmsghdr support
12064 echo "Checking to see if your system supports struct cmsghdr..." >&4
12065 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12067 case "$d_cmsghdr_s" in
12068 "$define") echo "Yes, it does." ;;
12069 *) echo "No, it doesn't." ;;
12072 : see if copysign exists
12073 set copysign d_copysign
12076 : see if copysignl exists
12077 set copysignl d_copysignl
12080 : see if crypt exists
12085 $define) cryptlib='' ;;
12086 *) if set crypt val -f d_crypt; eval $csym; $val; then
12087 echo 'crypt() found.' >&4
12091 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12092 if $test -z "$cryptlib"; then
12093 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12097 if $test -z "$cryptlib"; then
12098 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12102 if $test -z "$cryptlib"; then
12103 cryptlib=`./loc libcrypt$_a "" $libpth`
12107 if $test -z "$cryptlib"; then
12108 echo 'crypt() NOT found.' >&4
12119 : see if this is a crypt.h system
12120 set crypt.h i_crypt
12123 : see if crypt_r exists
12124 set crypt_r d_crypt_r
12126 case "$d_crypt_r" in
12128 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12129 case "$d_crypt_r_proto:$usethreads" in
12130 ":define") d_crypt_r_proto=define
12131 set d_crypt_r_proto crypt_r $hdrs
12135 case "$d_crypt_r_proto" in
12137 case "$crypt_r_proto" in
12138 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12139 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12141 case "$crypt_r_proto" in
12142 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12143 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12145 case "$crypt_r_proto" in
12146 ''|0) d_crypt_r=undef
12148 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12149 * ) case "$crypt_r_proto" in
12150 REENTRANT_PROTO*) ;;
12151 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12153 echo "Prototype: $try" ;;
12156 *) case "$usethreads" in
12157 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12168 : get csh whereabouts
12170 'csh') val="$undef" ;;
12171 *) val="$define" ;;
12175 : Respect a hint or command line value for full_csh.
12176 case "$full_csh" in
12177 '') full_csh=$csh ;;
12180 : see if ctermid exists
12181 set ctermid d_ctermid
12184 : see if ctermid_r exists
12185 set ctermid_r d_ctermid_r
12187 case "$d_ctermid_r" in
12189 hdrs="$i_systypes sys/types.h define stdio.h "
12190 case "$d_ctermid_r_proto:$usethreads" in
12191 ":define") d_ctermid_r_proto=define
12192 set d_ctermid_r_proto ctermid_r $hdrs
12196 case "$d_ctermid_r_proto" in
12198 case "$ctermid_r_proto" in
12199 ''|0) try='char* ctermid_r(char*);'
12200 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12202 case "$ctermid_r_proto" in
12203 ''|0) d_ctermid_r=undef
12205 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12206 * ) case "$ctermid_r_proto" in
12207 REENTRANT_PROTO*) ;;
12208 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12210 echo "Prototype: $try" ;;
12213 *) case "$usethreads" in
12214 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12221 *) ctermid_r_proto=0
12225 : see if ctime_r exists
12226 set ctime_r d_ctime_r
12228 case "$d_ctime_r" in
12230 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12231 case "$d_ctime_r_proto:$usethreads" in
12232 ":define") d_ctime_r_proto=define
12233 set d_ctime_r_proto ctime_r $hdrs
12237 case "$d_ctime_r_proto" in
12239 case "$ctime_r_proto" in
12240 ''|0) try='char* ctime_r(const time_t*, char*);'
12241 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12243 case "$ctime_r_proto" in
12244 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12245 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12247 case "$ctime_r_proto" in
12248 ''|0) try='int ctime_r(const time_t*, char*);'
12249 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12251 case "$ctime_r_proto" in
12252 ''|0) try='int ctime_r(const time_t*, char*, int);'
12253 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12255 case "$ctime_r_proto" in
12256 ''|0) d_ctime_r=undef
12258 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12259 * ) case "$ctime_r_proto" in
12260 REENTRANT_PROTO*) ;;
12261 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12263 echo "Prototype: $try" ;;
12266 *) case "$usethreads" in
12267 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12278 : see if cuserid exists
12279 set cuserid d_cuserid
12282 : see if dbm.h is available
12283 : see if dbmclose exists
12284 set dbmclose d_dbmclose
12287 case "$d_dbmclose" in
12297 *) set rpcsvc/dbm.h i_rpcsvcdbm
12302 *) echo "We won't be including <dbm.h>"
12312 : see if prototype for dbminit is available
12314 set d_dbminitproto dbminit $i_dbm dbm.h
12317 : see if difftime exists
12318 set difftime d_difftime
12321 : see if this is a dirent system
12323 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12325 echo "<dirent.h> found." >&4
12328 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12329 echo "<sys/dir.h> found." >&4
12332 xinc=`./findhdr sys/ndir.h`
12334 echo "<dirent.h> NOT found." >&4
12339 : Look for type of directory structure.
12341 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12343 case "$direntrytype" in
12345 case "$i_dirent" in
12346 $define) guess1='struct dirent' ;;
12347 *) guess1='struct direct' ;;
12350 *) guess1="$direntrytype"
12355 'struct dirent') guess2='struct direct' ;;
12356 *) guess2='struct dirent' ;;
12359 if $contains "$guess1" try.c >/dev/null 2>&1; then
12360 direntrytype="$guess1"
12361 echo "Your directory entries are $direntrytype." >&4
12362 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12363 direntrytype="$guess2"
12364 echo "Your directory entries seem to be $direntrytype." >&4
12366 echo "I don't recognize your system's directory entries." >&4
12367 rp="What type is used for directory entries on this system?"
12370 direntrytype="$ans"
12374 : see if the directory entry stores field length
12376 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12377 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12378 echo "Good, your directory entry keeps length information in d_namlen." >&4
12381 echo "Your directory entry does not know about the d_namlen field." >&4
12388 : Look for DIR.dd_fd
12389 case "$i_dirent" in
12391 echo "Checking to see if DIR has a dd_fd member variable" >&4
12393 #$i_stdlib I_STDLIB
12395 #include <stdlib.h>
12397 #include <dirent.h>
12407 if eval $compile; then
12408 echo "Yes, it does."
12411 echo "No, it does not."
12416 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12424 : see if this is an sysdir system
12425 set sys/dir.h i_sysdir
12428 : see if this is an sysndir system
12429 set sys/ndir.h i_sysndir
12434 $cat >dirfd.c <<EOM
12436 #$i_stdlib I_STDLIB
12438 #include <stdlib.h>
12440 #$i_dirent I_DIRENT /**/
12441 #$i_sysdir I_SYS_DIR /**/
12442 #$i_sysndir I_SYS_NDIR /**/
12443 #$i_systypes I_SYS_TYPES /**/
12444 #if defined(I_SYS_TYPES)
12445 #include <sys/types.h>
12447 #if defined(I_DIRENT)
12448 #include <dirent.h>
12451 #include <sys/ndir.h>
12454 #include <sys/dir.h>
12459 DIR *dirp = opendir(".");
12460 if (dirfd(dirp) >= 0)
12468 if eval $compile; then
12472 $define) echo "dirfd() found." >&4 ;;
12473 *) echo "dirfd() NOT found." >&4 ;;
12479 : see if dladdr exists
12480 set dladdr d_dladdr
12483 : see if dlerror exists
12486 set dlerror d_dlerror
12490 : see if dlfcn is available
12491 set dlfcn.h i_dlfcn
12494 : Check what extension to use for shared libs
12499 On a few systems, the dynamically loaded modules that perl generates and uses
12500 will need a different extension than shared libs. The default will probably
12506 *) dflt="$dlext" ;;
12508 rp='What is the extension of dynamically loaded modules'
12517 : Check if dlsym need a leading underscore
12523 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12524 $cat >dyna.c <<'EOM'
12531 #$i_stdlib I_STDLIB
12533 #include <stdlib.h>
12537 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12539 #include <sys/types.h>
12544 extern int fred() ;
12553 int mode = RTLD_LAZY ;
12555 handle = dlopen("./dyna.$dlext", mode) ;
12556 if (handle == NULL) {
12561 symbol = dlsym(handle, "fred") ;
12562 if (symbol == NULL) {
12563 /* try putting a leading underscore */
12564 symbol = dlsym(handle, "_fred") ;
12565 if (symbol == NULL) {
12578 : Call the object file tmp-dyna.o in case dlext=o.
12579 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12580 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12581 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12582 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12585 1) echo "Test program failed using dlopen." >&4
12586 echo "Perhaps you should not use dynamic loading." >&4;;
12587 2) echo "Test program failed using dlsym." >&4
12588 echo "Perhaps you should not use dynamic loading." >&4;;
12589 3) echo "dlsym needs a leading underscore" >&4
12591 4) echo "dlsym doesn't need a leading underscore." >&4;;
12594 echo "I can't compile and run the test program." >&4
12595 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12600 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12605 : see if drand48_r exists
12606 set drand48_r d_drand48_r
12608 case "$d_drand48_r" in
12610 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12611 case "$d_drand48_r_proto:$usethreads" in
12612 ":define") d_drand48_r_proto=define
12613 set d_drand48_r_proto drand48_r $hdrs
12617 case "$d_drand48_r_proto" in
12619 case "$drand48_r_proto" in
12620 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12621 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12623 case "$drand48_r_proto" in
12624 ''|0) d_drand48_r=undef
12626 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12627 * ) case "$drand48_r_proto" in
12628 REENTRANT_PROTO*) ;;
12629 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12631 echo "Prototype: $try" ;;
12634 *) case "$usethreads" in
12635 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12642 *) drand48_r_proto=0
12646 : see if prototype for drand48 is available
12648 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12651 : see if dup2 exists
12655 : see if dup3 exists
12659 : see if this is an xlocale.h system
12660 set xlocale.h i_xlocale
12663 : see if newlocale exists
12664 set newlocale d_newlocale
12667 : see if freelocale exists
12668 set freelocale d_freelocale
12671 : see if uselocale exists
12672 set uselocale d_uselocale
12675 : see if duplocale exists
12676 set duplocale d_duplocale
12679 : see if querylocale exists
12680 set querylocale d_querylocale
12683 : see if eaccess exists
12684 set eaccess d_eaccess
12687 : see if endgrent exists
12688 set endgrent d_endgrent
12691 : see if this is an grp system
12697 xxx=`./findhdr grp.h`
12698 $cppstdin $cppflags $cppminus < $xxx >$$.h
12700 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12712 set d_grpasswd; eval $setvar
12716 : see if endgrent_r exists
12717 set endgrent_r d_endgrent_r
12719 case "$d_endgrent_r" in
12721 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12722 case "$d_endgrent_r_proto:$usethreads" in
12723 ":define") d_endgrent_r_proto=define
12724 set d_endgrent_r_proto endgrent_r $hdrs
12728 case "$d_endgrent_r_proto" in
12730 case "$endgrent_r_proto" in
12731 ''|0) try='int endgrent_r(FILE**);'
12732 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12734 case "$endgrent_r_proto" in
12735 ''|0) try='void endgrent_r(FILE**);'
12736 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12738 case "$endgrent_r_proto" in
12739 ''|0) d_endgrent_r=undef
12741 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12742 * ) case "$endgrent_r_proto" in
12743 REENTRANT_PROTO*) ;;
12744 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12746 echo "Prototype: $try" ;;
12749 *) case "$usethreads" in
12750 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12757 *) endgrent_r_proto=0
12761 : see if endhostent exists
12762 set endhostent d_endhent
12765 : see if this is a netdb.h system
12766 set netdb.h i_netdb
12769 : see if endhostent_r exists
12770 set endhostent_r d_endhostent_r
12772 case "$d_endhostent_r" in
12774 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12775 case "$d_endhostent_r_proto:$usethreads" in
12776 ":define") d_endhostent_r_proto=define
12777 set d_endhostent_r_proto endhostent_r $hdrs
12781 case "$d_endhostent_r_proto" in
12783 case "$endhostent_r_proto" in
12784 ''|0) try='int endhostent_r(struct hostent_data*);'
12785 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12787 case "$endhostent_r_proto" in
12788 ''|0) try='void endhostent_r(struct hostent_data*);'
12789 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12791 case "$endhostent_r_proto" in
12792 ''|0) d_endhostent_r=undef
12793 endhostent_r_proto=0
12794 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12795 * ) case "$endhostent_r_proto" in
12796 REENTRANT_PROTO*) ;;
12797 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12799 echo "Prototype: $try" ;;
12802 *) case "$usethreads" in
12803 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12805 d_endhostent_r=undef
12806 endhostent_r_proto=0
12810 *) endhostent_r_proto=0
12814 : see if endnetent exists
12815 set endnetent d_endnent
12818 : see if endnetent_r exists
12819 set endnetent_r d_endnetent_r
12821 case "$d_endnetent_r" in
12823 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12824 case "$d_endnetent_r_proto:$usethreads" in
12825 ":define") d_endnetent_r_proto=define
12826 set d_endnetent_r_proto endnetent_r $hdrs
12830 case "$d_endnetent_r_proto" in
12832 case "$endnetent_r_proto" in
12833 ''|0) try='int endnetent_r(struct netent_data*);'
12834 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12836 case "$endnetent_r_proto" in
12837 ''|0) try='void endnetent_r(struct netent_data*);'
12838 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12840 case "$endnetent_r_proto" in
12841 ''|0) d_endnetent_r=undef
12842 endnetent_r_proto=0
12843 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12844 * ) case "$endnetent_r_proto" in
12845 REENTRANT_PROTO*) ;;
12846 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12848 echo "Prototype: $try" ;;
12851 *) case "$usethreads" in
12852 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12854 d_endnetent_r=undef
12855 endnetent_r_proto=0
12859 *) endnetent_r_proto=0
12863 : see if endprotoent exists
12864 set endprotoent d_endpent
12867 : see if endprotoent_r exists
12868 set endprotoent_r d_endprotoent_r
12870 case "$d_endprotoent_r" in
12872 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12873 case "$d_endprotoent_r_proto:$usethreads" in
12874 ":define") d_endprotoent_r_proto=define
12875 set d_endprotoent_r_proto endprotoent_r $hdrs
12879 case "$d_endprotoent_r_proto" in
12881 case "$endprotoent_r_proto" in
12882 ''|0) try='int endprotoent_r(struct protoent_data*);'
12883 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12885 case "$endprotoent_r_proto" in
12886 ''|0) try='void endprotoent_r(struct protoent_data*);'
12887 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12889 case "$endprotoent_r_proto" in
12890 ''|0) d_endprotoent_r=undef
12891 endprotoent_r_proto=0
12892 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12893 * ) case "$endprotoent_r_proto" in
12894 REENTRANT_PROTO*) ;;
12895 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12897 echo "Prototype: $try" ;;
12900 *) case "$usethreads" in
12901 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12903 d_endprotoent_r=undef
12904 endprotoent_r_proto=0
12908 *) endprotoent_r_proto=0
12912 : see if endpwent exists
12913 set endpwent d_endpwent
12916 : see if this is a pwd.h system
12922 xxx=`./findhdr pwd.h`
12923 $cppstdin $cppflags $cppminus < $xxx >$$.h
12925 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12933 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12941 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12949 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12957 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12965 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12973 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12981 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12993 set d_pwquota; eval $setvar
12994 set d_pwage; eval $setvar
12995 set d_pwchange; eval $setvar
12996 set d_pwclass; eval $setvar
12997 set d_pwexpire; eval $setvar
12998 set d_pwcomment; eval $setvar
12999 set d_pwgecos; eval $setvar
13000 set d_pwpasswd; eval $setvar
13004 : see if endpwent_r exists
13005 set endpwent_r d_endpwent_r
13007 case "$d_endpwent_r" in
13009 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13010 case "$d_endpwent_r_proto:$usethreads" in
13011 ":define") d_endpwent_r_proto=define
13012 set d_endpwent_r_proto endpwent_r $hdrs
13016 case "$d_endpwent_r_proto" in
13018 case "$endpwent_r_proto" in
13019 ''|0) try='int endpwent_r(FILE**);'
13020 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13022 case "$endpwent_r_proto" in
13023 ''|0) try='void endpwent_r(FILE**);'
13024 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13026 case "$endpwent_r_proto" in
13027 ''|0) d_endpwent_r=undef
13029 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13030 * ) case "$endpwent_r_proto" in
13031 REENTRANT_PROTO*) ;;
13032 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13034 echo "Prototype: $try" ;;
13037 *) case "$usethreads" in
13038 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13045 *) endpwent_r_proto=0
13049 : see if endservent exists
13050 set endservent d_endsent
13053 : see if endservent_r exists
13054 set endservent_r d_endservent_r
13056 case "$d_endservent_r" in
13058 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13059 case "$d_endservent_r_proto:$usethreads" in
13060 ":define") d_endservent_r_proto=define
13061 set d_endservent_r_proto endservent_r $hdrs
13065 case "$d_endservent_r_proto" in
13067 case "$endservent_r_proto" in
13068 ''|0) try='int endservent_r(struct servent_data*);'
13069 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13071 case "$endservent_r_proto" in
13072 ''|0) try='void endservent_r(struct servent_data*);'
13073 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13075 case "$endservent_r_proto" in
13076 ''|0) d_endservent_r=undef
13077 endservent_r_proto=0
13078 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13079 * ) case "$endservent_r_proto" in
13080 REENTRANT_PROTO*) ;;
13081 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13083 echo "Prototype: $try" ;;
13086 *) case "$usethreads" in
13087 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13089 d_endservent_r=undef
13090 endservent_r_proto=0
13094 *) endservent_r_proto=0
13098 : Locate the flags for 'open()'
13101 #include <sys/types.h>
13106 #include <sys/file.h>
13108 #$i_stdlib I_STDLIB
13110 #include <stdlib.h>
13121 : check sys/file.h first to get FREAD on Sun
13122 if $test `./findhdr sys/file.h` && \
13123 set try -DI_SYS_FILE && eval $compile; then
13125 echo "<sys/file.h> defines the O_* constants..." >&4
13126 if $run ./try; then
13127 echo "and you have the 3 argument form of open()." >&4
13130 echo "but not the 3 argument form of open(). Oh, well." >&4
13133 elif $test `./findhdr fcntl.h` && \
13134 set try -DI_FCNTL && eval $compile; then
13136 echo "<fcntl.h> defines the O_* constants..." >&4
13137 if $run ./try; then
13138 echo "and you have the 3 argument form of open()." >&4
13141 echo "but not the 3 argument form of open(). Oh, well." >&4
13146 echo "I can't find the O_* constant definitions! You got problems." >&4
13152 : see if this is a sys/file.h system
13157 : do we need to include sys/file.h ?
13161 if $h_sysfile; then
13163 echo "We'll be including <sys/file.h>." >&4
13166 echo "We won't be including <sys/file.h>." >&4
13176 : see if fcntl.h is there
13181 : see if we can include fcntl.h
13187 echo "We'll be including <fcntl.h>." >&4
13190 if $h_sysfile; then
13191 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13193 echo "We won't be including <fcntl.h>." >&4
13205 : see if fork exists
13209 : see if pipe exists
13213 : check for non-blocking I/O stuff
13214 case "$h_sysfile" in
13215 true) echo "#include <sys/file.h>" > head.c;;
13218 true) echo "#include <fcntl.h>" > head.c;;
13219 *) echo "#include <sys/fcntl.h>" > head.c;;
13224 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13225 case "$o_nonblock" in
13227 $cat head.c > try.c
13228 $cat >>try.c <<EOCP
13230 #$i_stdlib I_STDLIB
13232 #include <stdlib.h>
13240 printf("O_NONBLOCK\n");
13244 printf("O_NDELAY\n");
13248 printf("FNDELAY\n");
13255 if eval $compile_ok; then
13256 o_nonblock=`$run ./try`
13257 case "$o_nonblock" in
13258 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13259 *) echo "Seems like we can use $o_nonblock.";;
13262 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13265 *) echo "Using $hint value $o_nonblock.";;
13270 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13273 case "$d_fork:$d_pipe:$d_alarm" in
13274 define:define:define)
13275 $cat head.c > try.c
13276 $cat >>try.c <<EOCP
13278 #include <sys/types.h>
13279 #include <signal.h>
13281 #$i_stdlib I_STDLIB
13283 #include <stdlib.h>
13289 #define MY_O_NONBLOCK $o_nonblock
13290 #ifndef errno /* XXX need better Configure test */
13293 #$i_unistd I_UNISTD
13295 #include <unistd.h>
13297 #include <string.h>
13298 $signal_t blech(int x) { exit(3); }
13300 $cat >> try.c <<'EOCP'
13309 ret = pipe(pd); /* Down: child -> parent */
13312 ret = pipe(pu); /* Up: parent -> child */
13316 close(pd[1]); /* Parent reads from pd[0] */
13317 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13319 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13324 signal(SIGALRM, blech);
13326 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13328 sprintf(string, "%d\n", ret);
13329 ret = write(2, string, strlen(string));
13330 if (ret != strlen(string))
13334 if (errno == EAGAIN) {
13335 printf("EAGAIN\n");
13340 if (errno == EWOULDBLOCK)
13341 printf("EWOULDBLOCK\n");
13344 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13347 sleep(2); /* Give it time to close our pipe */
13349 ret = read(pd[0], buf, 1); /* Should read EOF */
13351 sprintf(string, "%d\n", ret);
13352 ret = write(4, string, strlen(string));
13353 if (ret != strlen(string))
13358 close(pd[0]); /* We write to pd[1] */
13359 close(pu[1]); /* We read from pu[0] */
13360 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13363 close(pd[1]); /* Pipe pd is now fully closed! */
13364 exit(0); /* Bye bye, thank you for playing! */
13368 if eval $compile_ok; then
13369 echo "$startsh" >mtry
13370 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13372 $run ./mtry >/dev/null 2>&1
13374 0) eagain=`$cat try.out`;;
13375 1) echo "Could not perform non-blocking setting!";;
13376 2) echo "I did a successful read() for something that was not there!";;
13377 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13378 4) echo "Could not find F_SETFL!";;
13379 *) echo "Something terribly wrong happened during testing.";;
13381 rd_nodata=`$cat try.ret`
13382 echo "A read() system call with no data present returns $rd_nodata."
13383 case "$rd_nodata" in
13386 echo "(That's peculiar, fixing that to be -1.)"
13392 echo "Forcing errno EAGAIN on read() with no data available."
13396 echo "Your read() sets errno to $eagain when no data is available."
13399 status=`$cat try.err`
13401 0) echo "And it correctly returns 0 to signal EOF.";;
13402 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13403 *) echo "However, your read() returns '$status' on EOF??";;
13406 if test "$status" = "$rd_nodata"; then
13407 echo "WARNING: you can't distinguish between EOF and no data!"
13411 echo "I can't compile the test program--assuming errno EAGAIN will do."
13415 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13424 echo "Using $hint value $eagain."
13425 echo "Your read() returns $rd_nodata when no data is present."
13426 case "$d_eofnblk" in
13427 "$define") echo "And you can see EOF because read() returns 0.";;
13428 "$undef") echo "But you can't see EOF status from read() returned value.";;
13430 echo "(Assuming you can't see EOF status from read anyway.)"
13436 $rm_try head.c mtry
13438 : see if erf exists
13442 : see if erfc exists
13446 : see if exp2 exists
13450 : see if expm1 exists
13454 : see if _ptr and _cnt from stdio act std
13457 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13458 echo "(Looks like you have stdio.h from BSD.)"
13459 case "$stdio_ptr" in
13460 '') stdio_ptr='((fp)->_p)'
13463 *) ptr_lval=$d_stdio_ptr_lval;;
13465 case "$stdio_cnt" in
13466 '') stdio_cnt='((fp)->_r)'
13469 *) cnt_lval=$d_stdio_cnt_lval;;
13471 case "$stdio_base" in
13472 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13474 case "$stdio_bufsiz" in
13475 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13477 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13478 echo "(Looks like you have stdio.h from Linux.)"
13479 case "$stdio_ptr" in
13480 '') stdio_ptr='((fp)->_IO_read_ptr)'
13483 *) ptr_lval=$d_stdio_ptr_lval;;
13485 case "$stdio_cnt" in
13486 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13489 *) cnt_lval=$d_stdio_cnt_lval;;
13491 case "$stdio_base" in
13492 '') stdio_base='((fp)->_IO_read_base)';;
13494 case "$stdio_bufsiz" in
13495 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13498 case "$stdio_ptr" in
13499 '') stdio_ptr='((fp)->_ptr)'
13502 *) ptr_lval=$d_stdio_ptr_lval;;
13504 case "$stdio_cnt" in
13505 '') stdio_cnt='((fp)->_cnt)'
13508 *) cnt_lval=$d_stdio_cnt_lval;;
13510 case "$stdio_base" in
13511 '') stdio_base='((fp)->_base)';;
13513 case "$stdio_bufsiz" in
13514 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13518 : test whether _ptr and _cnt really work
13519 echo "Checking how std your stdio is..." >&4
13522 #$i_stdlib I_STDLIB
13524 #include <stdlib.h>
13526 #define FILE_ptr(fp) $stdio_ptr
13527 #define FILE_cnt(fp) $stdio_cnt
13529 FILE *fp = fopen("try.c", "r");
13532 18 <= FILE_cnt(fp) &&
13533 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13541 if eval $compile && $to try.c; then
13542 if $run ./try; then
13543 echo "Your stdio acts pretty std."
13546 echo "Your stdio isn't very std."
13549 echo "Your stdio doesn't appear very std."
13553 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13554 # direct buffer manipulation no longer works. The Configure tests
13555 # should be changed to correctly detect this, but until then,
13556 # the following check should at least let perl compile and run.
13557 # (This quick fix should be updated before 5.8.1.)
13558 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13559 # A. Dougherty, June 3, 2002.
13560 case "$d_gnulibc" in
13562 case "$gnulibc_version" in
13566 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13575 : Can _ptr be used as an lvalue?
13576 case "$d_stdstdio$ptr_lval" in
13577 $define$define) val=$define ;;
13580 set d_stdio_ptr_lval
13583 : Can _cnt be used as an lvalue?
13584 case "$d_stdstdio$cnt_lval" in
13585 $define$define) val=$define ;;
13588 set d_stdio_cnt_lval
13592 : test whether setting _ptr sets _cnt as a side effect
13593 d_stdio_ptr_lval_sets_cnt="$undef"
13594 d_stdio_ptr_lval_nochange_cnt="$undef"
13595 case "$d_stdio_ptr_lval$d_stdstdio" in
13597 echo "Checking to see what happens if we set the stdio ptr..." >&4
13600 /* Can we scream? */
13601 /* Eat dust sed :-) */
13602 /* In the buffer space, no one can hear you scream. */
13603 #$i_stdlib I_STDLIB
13605 #include <stdlib.h>
13607 #define FILE_ptr(fp) $stdio_ptr
13608 #define FILE_cnt(fp) $stdio_cnt
13609 #include <sys/types.h>
13611 FILE *fp = fopen("try.c", "r");
13616 puts("Fail even to read");
13619 c = getc(fp); /* Read away the first # */
13621 puts("Fail even to read");
13625 18 <= FILE_cnt(fp) &&
13626 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13628 puts("Fail even to read");
13631 ptr = (char*) FILE_ptr(fp);
13632 cnt = (size_t)FILE_cnt(fp);
13634 FILE_ptr(fp) += 42;
13636 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13637 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13640 if (FILE_cnt(fp) <= 20) {
13641 printf ("Fail (<20 chars to test)");
13644 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13645 puts("Fail compare");
13648 if (cnt == FILE_cnt(fp)) {
13649 puts("Pass_unchanged");
13652 if (FILE_cnt(fp) == (cnt - 42)) {
13653 puts("Pass_changed");
13656 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13662 if eval $compile && $to try.c; then
13663 case `$run ./try` in
13665 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13666 d_stdio_ptr_lval_sets_cnt="$define" ;;
13668 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13669 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13671 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13673 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13676 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13682 : see if _base is also standard
13684 case "$d_stdstdio" in
13688 #$i_stdlib I_STDLIB
13690 #include <stdlib.h>
13692 #define FILE_base(fp) $stdio_base
13693 #define FILE_bufsiz(fp) $stdio_bufsiz
13695 FILE *fp = fopen("try.c", "r");
13698 19 <= FILE_bufsiz(fp) &&
13699 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13706 if eval $compile && $to try.c; then
13707 if $run ./try; then
13708 echo "And its _base field acts std."
13711 echo "But its _base field isn't std."
13714 echo "However, it seems to be lacking the _base field."
13722 : see if fast_stdio exists
13724 case "$d_stdstdio:$d_stdio_ptr_lval" in
13726 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13728 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13737 : see if fchdir exists
13738 set fchdir d_fchdir
13741 : see if fchmod exists
13742 set fchmod d_fchmod
13745 : check for openat, unlinkat, renameat, linkat, fchmodat
13746 set openat d_openat
13749 set unlinkat d_unlinkat
13752 set renameat d_renameat
13755 set linkat d_linkat
13758 set fchmodat d_fchmodat
13761 : see if fchown exists
13762 set fchown d_fchown
13765 : see if this is an fcntl system
13769 : See if fcntl-based locking works.
13772 #$i_stdlib I_STDLIB
13774 #include <stdlib.h>
13776 #include <unistd.h>
13778 #include <signal.h>
13779 $signal_t blech(int x) { exit(3); }
13781 #if defined(F_SETLK) && defined(F_SETLKW)
13782 struct flock flock;
13784 fd = open("try.c", O_RDONLY);
13785 flock.l_type = F_RDLCK;
13786 flock.l_whence = SEEK_SET;
13787 flock.l_start = flock.l_len = 0;
13788 signal(SIGALRM, blech);
13790 retval = fcntl(fd, F_SETLK, &flock);
13792 (retval < 0 ? exit(2) : exit(0));
13798 echo "Checking if fcntl-based file locking works... "
13802 if eval $compile_ok; then
13803 if $run ./try; then
13804 echo "Yes, it seems to work."
13807 echo "Nope, it didn't work."
13812 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13813 *** This is (almost) impossible.
13814 *** If your NFS lock daemons are not feeling well, something like
13815 *** this may happen, please investigate. Cannot continue, aborting.
13823 echo "I'm unable to compile the test program, so I'll assume not."
13828 echo "Nope, since you don't even have fcntl()."
13831 set d_fcntl_can_lock
13835 : check for fd_set items
13838 Checking to see how well your C compiler handles fd_set and friends ...
13841 #$i_stdlib I_STDLIB
13843 #include <stdlib.h>
13845 #$i_systime I_SYS_TIME
13846 #$i_sysselct I_SYS_SELECT
13847 #$d_socket HAS_SOCKET
13848 #include <sys/types.h>
13850 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13853 #include <sys/time.h>
13855 #ifdef I_SYS_SELECT
13856 #include <sys/select.h>
13865 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13873 if eval $compile; then
13874 d_fds_bits="$define"
13876 echo "Well, your system knows about the normal fd_set typedef..." >&4
13877 if $run ./try; then
13878 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13879 d_fd_macros="$define"
13882 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13884 d_fd_macros="$undef"
13888 Hmm, your compiler has some difficulty with fd_set. Checking further...
13891 if eval $compile; then
13892 d_fds_bits="$undef"
13894 echo "Well, your system has some sort of fd_set available..." >&4
13895 if $run ./try; then
13896 echo "and you have the normal fd_set macros." >&4
13897 d_fd_macros="$define"
13900 but not the normal fd_set macros! Gross! More work for me...
13902 d_fd_macros="$undef"
13905 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13907 d_fds_bits="$undef"
13908 d_fd_macros="$undef"
13913 : see if fdclose exists
13914 set fdclose d_fdclose
13917 : see if fdim exists
13921 : see if fegetround exists
13922 set fegetround d_fegetround
13925 : see if fgetpos exists
13926 set fgetpos d_fgetpos
13929 : see if finite exists
13930 set finite d_finite
13933 : see if finitel exists
13934 set finitel d_finitel
13937 : see if flock exists
13941 : see if prototype for flock is available
13943 set d_flockproto flock $i_sysfile sys/file.h
13946 : see if fma exists
13950 : see if fmax exists
13954 : see if fmin exists
13958 : see if fp_class exists
13959 set fp_class d_fp_class
13962 : check for fpclassify
13963 echo "Checking to see if you have fpclassify..." >&4
13966 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13969 if eval $compile; then
13971 echo "You have fpclassify."
13974 echo "You do not have fpclassify."
13980 : see if fp_classify exists
13981 set fp_classify d_fp_classify
13984 : see if fp_classl exists
13985 set fp_classl d_fp_classl
13988 : see if pathconf exists
13989 set pathconf d_pathconf
13992 : see if fpathconf exists
13993 set fpathconf d_fpathconf
13996 : see if fpclass exists
13997 set fpclass d_fpclass
14000 : see if fpclassl exists
14001 set fpclassl d_fpclassl
14004 : see if fpgetround exists
14005 set fpgetround d_fpgetround
14008 : check for fpos64_t
14010 echo "Checking to see if you have fpos64_t..." >&4
14013 int main() { fpos64_t x = 7; }
14016 if eval $compile; then
14018 echo "You have fpos64_t."
14021 echo "You do not have fpos64_t."
14022 case "$fpossize" in
14023 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14030 : see if frexpl exists
14031 set frexpl d_frexpl
14034 : see if this is a sys/param system
14035 set sys/param.h i_sysparam
14038 : see if this is a sys/mount.h system
14039 set sys/mount.h i_sysmount
14042 : Check for fs_data_s
14044 echo "Checking to see if your system supports struct fs_data..." >&4
14045 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14047 case "$d_fs_data_s" in
14048 "$define") echo "Yes, it does." ;;
14049 *) echo "No, it doesn't." ;;
14052 : see if fseeko exists
14053 set fseeko d_fseeko
14055 case "$longsize" in
14056 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14059 : see if fsetpos exists
14060 set fsetpos d_fsetpos
14063 : see if fstatfs exists
14064 set fstatfs d_fstatfs
14067 : see if statvfs exists
14068 set statvfs d_statvfs
14071 : see if fstatvfs exists
14072 set fstatvfs d_fstatvfs
14075 : see if fsync exists
14079 : see if ftello exists
14080 set ftello d_ftello
14082 case "$longsize" in
14083 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14086 : check for a working futimes
14089 echo "Checking if you have a working futimes()" >&4
14092 #include <sys/time.h>
14095 #include <stdlib.h>
14100 fd = open ("try.c", O_RDWR);
14101 if (-1 == fd) exit (1);
14102 rv = futimes (fd, NULL);
14103 exit (rv == -1 ? errno : 0);
14107 if eval $compile; then
14111 0) echo "Yes, you have" >&4
14112 d_futimes="$define"
14114 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14118 echo "No, it does not (probably harmless)" >&4
14122 : look for gai_strerror
14124 $cat >try.c <<'EOCP'
14125 #include <sys/types.h>
14126 #include <sys/socket.h>
14130 return (gai_strerror (0) ? 0 : 1);
14135 if eval $compile; then
14138 0) echo "A working gai_strerror() found." >&4
14140 *) echo "gai_strerror() found, but it doesn't work" >&4
14144 echo "gai_strerror() NOT found." >&4
14150 : see if ndbm.h is available
14153 : Compatibility location for RedHat 7.1
14154 set gdbm/ndbm.h i_gdbmndbm
14156 : Compatibility location for Debian 4.0
14157 set gdbm-ndbm.h i_gdbm_ndbm
14161 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14162 : see if dbm_open exists
14163 set dbm_open d_dbm_open
14165 case "$d_dbm_open" in
14168 i_gdbmndbm="$undef"
14169 i_gdbm_ndbm="$undef"
14170 echo "We won't be including <ndbm.h>"
14180 ndbm_hdr_protochk='name=$1; hdr=$2;
14181 eval "ihdr=\$""i_$name";
14183 if $test "$ihdr" = "$define"; then
14184 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14185 case "$d_cplusplus" in
14186 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14187 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14190 $define) $echo "Your <$hdr> seems to have prototypes";;
14191 *) $echo "Your <$hdr> does not seem to have prototypes";;
14194 set "d_${name}_h_uses_prototypes";
14198 eval $ndbm_hdr_protochk
14199 set gdbmndbm gdbm/ndbm.h
14200 eval $ndbm_hdr_protochk
14201 set gdbm_ndbm gdbm-ndbm.h
14202 eval $ndbm_hdr_protochk
14204 : see if getaddrinfo exists
14205 set getaddrinfo d_getaddrinfo
14208 : see if getcwd exists
14209 set getcwd d_getcwd
14212 : see if getespwnam exists
14213 set getespwnam d_getespwnam
14216 : see if getfsstat exists
14217 set getfsstat d_getfsstat
14220 : see if getgrent exists
14221 set getgrent d_getgrent
14224 : see if getgrent_r exists
14225 set getgrent_r d_getgrent_r
14227 case "$d_getgrent_r" in
14229 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14230 case "$d_getgrent_r_proto:$usethreads" in
14231 ":define") d_getgrent_r_proto=define
14232 set d_getgrent_r_proto getgrent_r $hdrs
14236 case "$d_getgrent_r_proto" in
14238 case "$getgrent_r_proto" in
14239 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14240 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14242 case "$getgrent_r_proto" in
14243 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14244 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14246 case "$getgrent_r_proto" in
14247 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14248 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14250 case "$getgrent_r_proto" in
14251 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14252 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14254 case "$getgrent_r_proto" in
14255 ''|0) try='int getgrent_r(struct group*, char*, int);'
14256 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14258 case "$getgrent_r_proto" in
14259 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14260 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14262 case "$getgrent_r_proto" in
14263 ''|0) d_getgrent_r=undef
14265 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14266 * ) case "$getgrent_r_proto" in
14267 REENTRANT_PROTO*) ;;
14268 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14270 echo "Prototype: $try" ;;
14273 *) case "$usethreads" in
14274 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14281 *) getgrent_r_proto=0
14285 : see if getgrgid_r exists
14286 set getgrgid_r d_getgrgid_r
14288 case "$d_getgrgid_r" in
14290 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14291 case "$d_getgrgid_r_proto:$usethreads" in
14292 ":define") d_getgrgid_r_proto=define
14293 set d_getgrgid_r_proto getgrgid_r $hdrs
14297 case "$d_getgrgid_r_proto" in
14299 case "$getgrgid_r_proto" in
14300 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14301 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14303 case "$getgrgid_r_proto" in
14304 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14305 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14307 case "$getgrgid_r_proto" in
14308 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14309 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14311 case "$getgrgid_r_proto" in
14312 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14313 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14315 case "$getgrgid_r_proto" in
14316 ''|0) d_getgrgid_r=undef
14318 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14319 * ) case "$getgrgid_r_proto" in
14320 REENTRANT_PROTO*) ;;
14321 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14323 echo "Prototype: $try" ;;
14326 *) case "$usethreads" in
14327 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14334 *) getgrgid_r_proto=0
14338 : see if getgrnam_r exists
14339 set getgrnam_r d_getgrnam_r
14341 case "$d_getgrnam_r" in
14343 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14344 case "$d_getgrnam_r_proto:$usethreads" in
14345 ":define") d_getgrnam_r_proto=define
14346 set d_getgrnam_r_proto getgrnam_r $hdrs
14350 case "$d_getgrnam_r_proto" in
14352 case "$getgrnam_r_proto" in
14353 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14354 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14356 case "$getgrnam_r_proto" in
14357 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14358 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14360 case "$getgrnam_r_proto" in
14361 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14362 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14364 case "$getgrnam_r_proto" in
14365 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14366 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14368 case "$getgrnam_r_proto" in
14369 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14370 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14372 case "$getgrnam_r_proto" in
14373 ''|0) d_getgrnam_r=undef
14375 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14376 * ) case "$getgrnam_r_proto" in
14377 REENTRANT_PROTO*) ;;
14378 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14380 echo "Prototype: $try" ;;
14383 *) case "$usethreads" in
14384 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14391 *) getgrnam_r_proto=0
14395 : see if gethostbyaddr exists
14396 set gethostbyaddr d_gethbyaddr
14399 : see if gethostbyname exists
14400 set gethostbyname d_gethbyname
14403 : see if gethostent exists
14404 set gethostent d_gethent
14407 : see how we will look up host name
14410 if set gethostname val -f d_gethname; eval $csym; $val; then
14411 echo 'gethostname() found.' >&4
14412 d_gethname="$define"
14415 if set uname val -f d_uname; eval $csym; $val; then
14418 uname() was found, but you're running xenix, and older versions of xenix
14419 have a broken uname(). If you don't really know whether your xenix is old
14420 enough to have a broken system call, use the default answer.
14425 "$define") dflt=n;;
14427 rp='Is your uname() broken?'
14430 n*) d_uname="$define"; call=uname;;
14433 echo 'uname() found.' >&4
14440 case "$d_gethname" in
14441 '') d_gethname="$undef";;
14444 '') d_uname="$undef";;
14446 case "$d_uname$d_gethname" in
14451 Every now and then someone has a $call() that lies about the hostname
14452 but can't be fixed for political or economic reasons. If you wish, I can
14453 pretend $call() isn't there and maybe compute hostname at run-time
14454 thanks to the '$phostname' command.
14457 rp="Shall I ignore $call() from now on?"
14460 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14463 case "$phostname" in
14464 '') aphostname='';;
14465 *) case "$aphostname" in
14467 *) set X $phostname
14471 file=`./loc $file $file $pth`
14472 aphostname=`echo $file $*`
14477 case "$d_uname$d_gethname" in
14480 case "$phostname" in
14482 echo "There will be no way for $package to get your hostname." >&4;;
14484 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14488 case "$d_phostname" in
14489 '') d_phostname="$undef";;
14492 : see if gethostbyaddr_r exists
14493 set gethostbyaddr_r d_gethostbyaddr_r
14495 case "$d_gethostbyaddr_r" in
14497 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14498 case "$d_gethostbyaddr_r_proto:$usethreads" in
14499 ":define") d_gethostbyaddr_r_proto=define
14500 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14504 case "$d_gethostbyaddr_r_proto" in
14506 case "$gethostbyaddr_r_proto" in
14507 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14508 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14510 case "$gethostbyaddr_r_proto" in
14511 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14512 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14514 case "$gethostbyaddr_r_proto" in
14515 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14516 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14518 case "$gethostbyaddr_r_proto" in
14519 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14520 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14522 case "$gethostbyaddr_r_proto" in
14523 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14524 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14526 case "$gethostbyaddr_r_proto" in
14527 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14528 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14530 case "$gethostbyaddr_r_proto" in
14531 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14532 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14534 case "$gethostbyaddr_r_proto" in
14535 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14536 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14538 case "$gethostbyaddr_r_proto" in
14539 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14540 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14542 case "$gethostbyaddr_r_proto" in
14543 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14544 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14546 case "$gethostbyaddr_r_proto" in
14547 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14548 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14550 case "$gethostbyaddr_r_proto" in
14551 ''|0) d_gethostbyaddr_r=undef
14552 gethostbyaddr_r_proto=0
14553 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14554 * ) case "$gethostbyaddr_r_proto" in
14555 REENTRANT_PROTO*) ;;
14556 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14558 echo "Prototype: $try" ;;
14561 *) case "$usethreads" in
14562 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14564 d_gethostbyaddr_r=undef
14565 gethostbyaddr_r_proto=0
14569 *) gethostbyaddr_r_proto=0
14573 : see if gethostbyname_r exists
14574 set gethostbyname_r d_gethostbyname_r
14576 case "$d_gethostbyname_r" in
14578 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14579 case "$d_gethostbyname_r_proto:$usethreads" in
14580 ":define") d_gethostbyname_r_proto=define
14581 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14585 case "$d_gethostbyname_r_proto" in
14587 case "$gethostbyname_r_proto" in
14588 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14589 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14591 case "$gethostbyname_r_proto" in
14592 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14593 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14595 case "$gethostbyname_r_proto" in
14596 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14597 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14599 case "$gethostbyname_r_proto" in
14600 ''|0) d_gethostbyname_r=undef
14601 gethostbyname_r_proto=0
14602 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14603 * ) case "$gethostbyname_r_proto" in
14604 REENTRANT_PROTO*) ;;
14605 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14607 echo "Prototype: $try" ;;
14610 *) case "$usethreads" in
14611 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14613 d_gethostbyname_r=undef
14614 gethostbyname_r_proto=0
14618 *) gethostbyname_r_proto=0
14622 : see if gethostent_r exists
14623 set gethostent_r d_gethostent_r
14625 case "$d_gethostent_r" in
14627 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14628 case "$d_gethostent_r_proto:$usethreads" in
14629 ":define") d_gethostent_r_proto=define
14630 set d_gethostent_r_proto gethostent_r $hdrs
14634 case "$d_gethostent_r_proto" in
14636 case "$gethostent_r_proto" in
14637 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14638 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14640 case "$gethostent_r_proto" in
14641 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14642 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14644 case "$gethostent_r_proto" in
14645 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14646 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14648 case "$gethostent_r_proto" in
14649 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14650 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14652 case "$gethostent_r_proto" in
14653 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14654 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14656 case "$gethostent_r_proto" in
14657 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14658 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14660 case "$gethostent_r_proto" in
14661 ''|0) d_gethostent_r=undef
14662 gethostent_r_proto=0
14663 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14664 * ) case "$gethostent_r_proto" in
14665 REENTRANT_PROTO*) ;;
14666 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14668 echo "Prototype: $try" ;;
14671 *) case "$usethreads" in
14672 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14674 d_gethostent_r=undef
14675 gethostent_r_proto=0
14679 *) gethostent_r_proto=0
14683 : see if prototypes for various gethostxxx netdb.h functions are available
14685 set d_gethostprotos gethostent $i_netdb netdb.h
14688 : see if getitimer exists
14689 set getitimer d_getitimer
14692 : see if getlogin exists
14693 set getlogin d_getlogin
14696 : see if getlogin_r exists
14697 set getlogin_r d_getlogin_r
14699 case "$d_getlogin_r" in
14701 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14702 case "$d_getlogin_r_proto:$usethreads" in
14703 ":define") d_getlogin_r_proto=define
14704 set d_getlogin_r_proto getlogin_r $hdrs
14708 case "$d_getlogin_r_proto" in
14710 case "$getlogin_r_proto" in
14711 ''|0) try='int getlogin_r(char*, size_t);'
14712 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14714 case "$getlogin_r_proto" in
14715 ''|0) try='int getlogin_r(char*, int);'
14716 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14718 case "$getlogin_r_proto" in
14719 ''|0) try='char* getlogin_r(char*, size_t);'
14720 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14722 case "$getlogin_r_proto" in
14723 ''|0) try='char* getlogin_r(char*, int);'
14724 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14726 case "$getlogin_r_proto" in
14727 ''|0) d_getlogin_r=undef
14729 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14730 * ) case "$getlogin_r_proto" in
14731 REENTRANT_PROTO*) ;;
14732 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14734 echo "Prototype: $try" ;;
14737 *) case "$usethreads" in
14738 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14745 *) getlogin_r_proto=0
14749 : see if getmnt exists
14750 set getmnt d_getmnt
14753 : see if getmntent exists
14754 set getmntent d_getmntent
14757 : see if getnameinfo exists
14758 set getnameinfo d_getnameinfo
14761 : see if getnetbyaddr exists
14762 set getnetbyaddr d_getnbyaddr
14765 : see if getnetbyname exists
14766 set getnetbyname d_getnbyname
14769 : see if getnetent exists
14770 set getnetent d_getnent
14773 : see if getnetbyaddr_r exists
14774 set getnetbyaddr_r d_getnetbyaddr_r
14776 case "$d_getnetbyaddr_r" in
14778 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14779 case "$d_getnetbyaddr_r_proto:$usethreads" in
14780 ":define") d_getnetbyaddr_r_proto=define
14781 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14785 case "$d_getnetbyaddr_r_proto" in
14787 case "$getnetbyaddr_r_proto" in
14788 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14789 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14791 case "$getnetbyaddr_r_proto" in
14792 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14793 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14795 case "$getnetbyaddr_r_proto" in
14796 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14797 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14799 case "$getnetbyaddr_r_proto" in
14800 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14801 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14803 case "$getnetbyaddr_r_proto" in
14804 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14805 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14807 case "$getnetbyaddr_r_proto" in
14808 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14809 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14811 case "$getnetbyaddr_r_proto" in
14812 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14813 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14815 case "$getnetbyaddr_r_proto" in
14816 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14817 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14819 case "$getnetbyaddr_r_proto" in
14820 ''|0) d_getnetbyaddr_r=undef
14821 getnetbyaddr_r_proto=0
14822 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14823 * ) case "$getnetbyaddr_r_proto" in
14824 REENTRANT_PROTO*) ;;
14825 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14827 echo "Prototype: $try" ;;
14830 *) case "$usethreads" in
14831 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14833 d_getnetbyaddr_r=undef
14834 getnetbyaddr_r_proto=0
14838 *) getnetbyaddr_r_proto=0
14842 : see if getnetbyname_r exists
14843 set getnetbyname_r d_getnetbyname_r
14845 case "$d_getnetbyname_r" in
14847 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14848 case "$d_getnetbyname_r_proto:$usethreads" in
14849 ":define") d_getnetbyname_r_proto=define
14850 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14854 case "$d_getnetbyname_r_proto" in
14856 case "$getnetbyname_r_proto" in
14857 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14858 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14860 case "$getnetbyname_r_proto" in
14861 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14862 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14864 case "$getnetbyname_r_proto" in
14865 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14866 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14868 case "$getnetbyname_r_proto" in
14869 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14870 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14872 case "$getnetbyname_r_proto" in
14873 ''|0) d_getnetbyname_r=undef
14874 getnetbyname_r_proto=0
14875 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14876 * ) case "$getnetbyname_r_proto" in
14877 REENTRANT_PROTO*) ;;
14878 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14880 echo "Prototype: $try" ;;
14883 *) case "$usethreads" in
14884 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14886 d_getnetbyname_r=undef
14887 getnetbyname_r_proto=0
14891 *) getnetbyname_r_proto=0
14895 : see if getnetent_r exists
14896 set getnetent_r d_getnetent_r
14898 case "$d_getnetent_r" in
14900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14901 case "$d_getnetent_r_proto:$usethreads" in
14902 ":define") d_getnetent_r_proto=define
14903 set d_getnetent_r_proto getnetent_r $hdrs
14907 case "$d_getnetent_r_proto" in
14909 case "$getnetent_r_proto" in
14910 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14911 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14913 case "$getnetent_r_proto" in
14914 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14915 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14917 case "$getnetent_r_proto" in
14918 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14919 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14921 case "$getnetent_r_proto" in
14922 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14923 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14925 case "$getnetent_r_proto" in
14926 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14927 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14929 case "$getnetent_r_proto" in
14930 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14931 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14933 case "$getnetent_r_proto" in
14934 ''|0) d_getnetent_r=undef
14935 getnetent_r_proto=0
14936 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14937 * ) case "$getnetent_r_proto" in
14938 REENTRANT_PROTO*) ;;
14939 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14941 echo "Prototype: $try" ;;
14944 *) case "$usethreads" in
14945 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14947 d_getnetent_r=undef
14948 getnetent_r_proto=0
14952 *) getnetent_r_proto=0
14956 : see if prototypes for various getnetxxx netdb.h functions are available
14958 set d_getnetprotos getnetent $i_netdb netdb.h
14961 : see if getpagesize exists
14962 set getpagesize d_getpagsz
14965 : Optional checks for getprotobyname and getprotobynumber
14967 : see if getprotobyname exists
14968 set getprotobyname d_getpbyname
14971 : see if getprotobynumber exists
14972 set getprotobynumber d_getpbynumber
14975 : see if getprotoent exists
14976 set getprotoent d_getpent
14979 : see if getpgid exists
14980 set getpgid d_getpgid
14983 : see if getpgrp2 exists
14984 set getpgrp2 d_getpgrp2
14987 : see if getppid exists
14988 set getppid d_getppid
14991 : see if getpriority exists
14992 set getpriority d_getprior
14995 : see if getprotobyname_r exists
14996 set getprotobyname_r d_getprotobyname_r
14998 case "$d_getprotobyname_r" in
15000 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15001 case "$d_getprotobyname_r_proto:$usethreads" in
15002 ":define") d_getprotobyname_r_proto=define
15003 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15007 case "$d_getprotobyname_r_proto" in
15009 case "$getprotobyname_r_proto" in
15010 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15011 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15013 case "$getprotobyname_r_proto" in
15014 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15015 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15017 case "$getprotobyname_r_proto" in
15018 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15019 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15021 case "$getprotobyname_r_proto" in
15022 ''|0) d_getprotobyname_r=undef
15023 getprotobyname_r_proto=0
15024 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15025 * ) case "$getprotobyname_r_proto" in
15026 REENTRANT_PROTO*) ;;
15027 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15029 echo "Prototype: $try" ;;
15032 *) case "$usethreads" in
15033 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15035 d_getprotobyname_r=undef
15036 getprotobyname_r_proto=0
15040 *) getprotobyname_r_proto=0
15044 : see if getprotobynumber_r exists
15045 set getprotobynumber_r d_getprotobynumber_r
15047 case "$d_getprotobynumber_r" in
15049 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15050 case "$d_getprotobynumber_r_proto:$usethreads" in
15051 ":define") d_getprotobynumber_r_proto=define
15052 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15056 case "$d_getprotobynumber_r_proto" in
15058 case "$getprotobynumber_r_proto" in
15059 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15060 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15062 case "$getprotobynumber_r_proto" in
15063 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15064 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15066 case "$getprotobynumber_r_proto" in
15067 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15068 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15070 case "$getprotobynumber_r_proto" in
15071 ''|0) d_getprotobynumber_r=undef
15072 getprotobynumber_r_proto=0
15073 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15074 * ) case "$getprotobynumber_r_proto" in
15075 REENTRANT_PROTO*) ;;
15076 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15078 echo "Prototype: $try" ;;
15081 *) case "$usethreads" in
15082 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15084 d_getprotobynumber_r=undef
15085 getprotobynumber_r_proto=0
15089 *) getprotobynumber_r_proto=0
15093 : see if getprotoent_r exists
15094 set getprotoent_r d_getprotoent_r
15096 case "$d_getprotoent_r" in
15098 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15099 case "$d_getprotoent_r_proto:$usethreads" in
15100 ":define") d_getprotoent_r_proto=define
15101 set d_getprotoent_r_proto getprotoent_r $hdrs
15105 case "$d_getprotoent_r_proto" in
15107 case "$getprotoent_r_proto" in
15108 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15109 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15111 case "$getprotoent_r_proto" in
15112 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15113 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15115 case "$getprotoent_r_proto" in
15116 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15117 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15119 case "$getprotoent_r_proto" in
15120 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15121 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15123 case "$getprotoent_r_proto" in
15124 ''|0) d_getprotoent_r=undef
15125 getprotoent_r_proto=0
15126 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15127 * ) case "$getprotoent_r_proto" in
15128 REENTRANT_PROTO*) ;;
15129 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15131 echo "Prototype: $try" ;;
15134 *) case "$usethreads" in
15135 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15137 d_getprotoent_r=undef
15138 getprotoent_r_proto=0
15142 *) getprotoent_r_proto=0
15146 : see if prototypes for various getprotoxxx netdb.h functions are available
15148 set d_getprotoprotos getprotoent $i_netdb netdb.h
15151 : see if getprpwnam exists
15152 set getprpwnam d_getprpwnam
15155 : see if getpwent exists
15156 set getpwent d_getpwent
15159 : see if getpwent_r exists
15160 set getpwent_r d_getpwent_r
15162 case "$d_getpwent_r" in
15164 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15165 case "$d_getpwent_r_proto:$usethreads" in
15166 ":define") d_getpwent_r_proto=define
15167 set d_getpwent_r_proto getpwent_r $hdrs
15171 case "$d_getpwent_r_proto" in
15173 case "$getpwent_r_proto" in
15174 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15175 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15177 case "$getpwent_r_proto" in
15178 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15179 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15181 case "$getpwent_r_proto" in
15182 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15183 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15185 case "$getpwent_r_proto" in
15186 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15187 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15189 case "$getpwent_r_proto" in
15190 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15191 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15193 case "$getpwent_r_proto" in
15194 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15195 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15197 case "$getpwent_r_proto" in
15198 ''|0) d_getpwent_r=undef
15200 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15201 * ) case "$getpwent_r_proto" in
15202 REENTRANT_PROTO*) ;;
15203 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15205 echo "Prototype: $try" ;;
15208 *) case "$usethreads" in
15209 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15216 *) getpwent_r_proto=0
15220 : see if getpwnam_r exists
15221 set getpwnam_r d_getpwnam_r
15223 case "$d_getpwnam_r" in
15225 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15226 case "$d_getpwnam_r_proto:$usethreads" in
15227 ":define") d_getpwnam_r_proto=define
15228 set d_getpwnam_r_proto getpwnam_r $hdrs
15232 case "$d_getpwnam_r_proto" in
15234 case "$getpwnam_r_proto" in
15235 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15236 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15238 case "$getpwnam_r_proto" in
15239 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15240 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15242 case "$getpwnam_r_proto" in
15243 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15244 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15246 case "$getpwnam_r_proto" in
15247 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15248 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15250 case "$getpwnam_r_proto" in
15251 ''|0) d_getpwnam_r=undef
15253 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15254 * ) case "$getpwnam_r_proto" in
15255 REENTRANT_PROTO*) ;;
15256 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15258 echo "Prototype: $try" ;;
15261 *) case "$usethreads" in
15262 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15269 *) getpwnam_r_proto=0
15273 : see if getpwuid_r exists
15274 set getpwuid_r d_getpwuid_r
15276 case "$d_getpwuid_r" in
15278 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15279 case "$d_getpwuid_r_proto:$usethreads" in
15280 ":define") d_getpwuid_r_proto=define
15281 set d_getpwuid_r_proto getpwuid_r $hdrs
15285 case "$d_getpwuid_r_proto" in
15287 case "$getpwuid_r_proto" in
15288 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15289 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15291 case "$getpwuid_r_proto" in
15292 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15293 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15295 case "$getpwuid_r_proto" in
15296 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15297 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15299 case "$getpwuid_r_proto" in
15300 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15301 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15303 case "$getpwuid_r_proto" in
15304 ''|0) d_getpwuid_r=undef
15306 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15307 * ) case "$getpwuid_r_proto" in
15308 REENTRANT_PROTO*) ;;
15309 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15311 echo "Prototype: $try" ;;
15314 *) case "$usethreads" in
15315 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15322 *) getpwuid_r_proto=0
15326 : Optional checks for getsbyname and getsbyport
15328 : see if getservbyname exists
15329 set getservbyname d_getsbyname
15332 : see if getservbyport exists
15333 set getservbyport d_getsbyport
15336 : see if getservent exists
15337 set getservent d_getsent
15340 : see if getservbyname_r exists
15341 set getservbyname_r d_getservbyname_r
15343 case "$d_getservbyname_r" in
15345 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15346 case "$d_getservbyname_r_proto:$usethreads" in
15347 ":define") d_getservbyname_r_proto=define
15348 set d_getservbyname_r_proto getservbyname_r $hdrs
15352 case "$d_getservbyname_r_proto" in
15354 case "$getservbyname_r_proto" in
15355 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15356 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15358 case "$getservbyname_r_proto" in
15359 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15360 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15362 case "$getservbyname_r_proto" in
15363 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15364 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15366 case "$getservbyname_r_proto" in
15367 ''|0) d_getservbyname_r=undef
15368 getservbyname_r_proto=0
15369 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15370 * ) case "$getservbyname_r_proto" in
15371 REENTRANT_PROTO*) ;;
15372 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15374 echo "Prototype: $try" ;;
15377 *) case "$usethreads" in
15378 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15380 d_getservbyname_r=undef
15381 getservbyname_r_proto=0
15385 *) getservbyname_r_proto=0
15389 : see if getservbyport_r exists
15390 set getservbyport_r d_getservbyport_r
15392 case "$d_getservbyport_r" in
15394 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15395 case "$d_getservbyport_r_proto:$usethreads" in
15396 ":define") d_getservbyport_r_proto=define
15397 set d_getservbyport_r_proto getservbyport_r $hdrs
15401 case "$d_getservbyport_r_proto" in
15403 case "$getservbyport_r_proto" in
15404 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15405 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15407 case "$getservbyport_r_proto" in
15408 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15409 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15411 case "$getservbyport_r_proto" in
15412 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15413 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15415 case "$getservbyport_r_proto" in
15416 ''|0) d_getservbyport_r=undef
15417 getservbyport_r_proto=0
15418 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15419 * ) case "$getservbyport_r_proto" in
15420 REENTRANT_PROTO*) ;;
15421 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15423 echo "Prototype: $try" ;;
15426 *) case "$usethreads" in
15427 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15429 d_getservbyport_r=undef
15430 getservbyport_r_proto=0
15434 *) getservbyport_r_proto=0
15438 : see if getservent_r exists
15439 set getservent_r d_getservent_r
15441 case "$d_getservent_r" in
15443 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15444 case "$d_getservent_r_proto:$usethreads" in
15445 ":define") d_getservent_r_proto=define
15446 set d_getservent_r_proto getservent_r $hdrs
15450 case "$d_getservent_r_proto" in
15452 case "$getservent_r_proto" in
15453 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15454 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15456 case "$getservent_r_proto" in
15457 ''|0) try='int getservent_r(struct servent*, char*, int);'
15458 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15460 case "$getservent_r_proto" in
15461 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15462 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15464 case "$getservent_r_proto" in
15465 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15466 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15468 case "$getservent_r_proto" in
15469 ''|0) d_getservent_r=undef
15470 getservent_r_proto=0
15471 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15472 * ) case "$getservent_r_proto" in
15473 REENTRANT_PROTO*) ;;
15474 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15476 echo "Prototype: $try" ;;
15479 *) case "$usethreads" in
15480 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15482 d_getservent_r=undef
15483 getservent_r_proto=0
15487 *) getservent_r_proto=0
15491 : see if prototypes for various getservxxx netdb.h functions are available
15493 set d_getservprotos getservent $i_netdb netdb.h
15496 : see if getspnam exists
15497 set getspnam d_getspnam
15500 : see if this is a shadow.h system
15501 set shadow.h i_shadow
15504 : see if getspnam_r exists
15505 set getspnam_r d_getspnam_r
15507 case "$d_getspnam_r" in
15509 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15510 case "$d_getspnam_r_proto:$usethreads" in
15511 ":define") d_getspnam_r_proto=define
15512 set d_getspnam_r_proto getspnam_r $hdrs
15516 case "$d_getspnam_r_proto" in
15518 case "$getspnam_r_proto" in
15519 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15520 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15522 case "$getspnam_r_proto" in
15523 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15524 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15526 case "$getspnam_r_proto" in
15527 ''|0) d_getspnam_r=undef
15529 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15530 * ) case "$getspnam_r_proto" in
15531 REENTRANT_PROTO*) ;;
15532 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15534 echo "Prototype: $try" ;;
15537 *) case "$usethreads" in
15538 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15545 *) getspnam_r_proto=0
15549 : see if gettimeofday or ftime exists
15550 set gettimeofday d_gettimeod
15552 case "$d_gettimeod" in
15558 val="$undef"; set d_ftime; eval $setvar
15561 case "$d_gettimeod$d_ftime" in
15564 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15568 : see if gmtime_r exists
15569 set gmtime_r d_gmtime_r
15571 case "$d_gmtime_r" in
15573 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15574 case "$d_gmtime_r_proto:$usethreads" in
15575 ":define") d_gmtime_r_proto=define
15576 set d_gmtime_r_proto gmtime_r $hdrs
15580 case "$d_gmtime_r_proto" in
15582 case "$gmtime_r_proto" in
15583 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15584 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15586 case "$gmtime_r_proto" in
15587 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15588 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15590 case "$gmtime_r_proto" in
15591 ''|0) d_gmtime_r=undef
15593 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15594 * ) case "$gmtime_r_proto" in
15595 REENTRANT_PROTO*) ;;
15596 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15598 echo "Prototype: $try" ;;
15601 *) case "$usethreads" in
15602 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15609 *) gmtime_r_proto=0
15613 : see if hasmntopt exists
15614 set hasmntopt d_hasmntopt
15617 : see if this is a netinet/in.h or sys/in.h system
15618 set netinet/in.h i_niin sys/in.h i_sysin
15621 : see if arpa/inet.h has to be included
15622 set arpa/inet.h i_arpainet
15625 : see if htonl --and friends-- exists
15630 : Maybe they are macros.
15633 $cat >htonl.c <<EOM
15635 #include <sys/types.h>
15636 #$i_niin I_NETINET_IN
15638 #$i_arpainet I_ARPA_INET
15639 #ifdef I_NETINET_IN
15640 #include <netinet/in.h>
15643 #include <sys/in.h>
15646 #include <arpa/inet.h>
15649 printf("Defined as a macro.");
15652 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15653 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15655 echo "But it seems to be defined as a macro." >&4
15663 : see if hypot exists
15667 : see if ilogb exists
15671 : see if ilogbl exists
15672 set ilogbl d_ilogbl
15675 : check whether inet_aton exists
15676 set inet_aton d_inetaton
15679 : see if inet_ntop exists
15680 set inet_ntop d_inetntop
15683 : see if inet_pton exists
15684 set inet_pton d_inetpton
15689 $cat >isascii.c <<EOCP
15692 #$i_stdlib I_STDLIB
15694 #include <stdlib.h>
15705 if eval $compile; then
15706 echo "isascii() found." >&4
15709 echo "isascii() NOT found." >&4
15718 $cat >isblank.c <<'EOCP'
15729 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15730 echo "isblank() found." >&4
15733 echo "isblank() NOT found." >&4
15740 : check for isfinite
15741 echo "Checking to see if you have isfinite..." >&4
15744 int main() { return isfinite(0.0); }
15747 if eval $compile; then
15749 echo "You have isfinite."
15752 echo "You do not have isfinite."
15758 : see if isfinitel exists
15759 set isfinitel d_isfinitel
15763 echo "Checking to see if you have isinf..." >&4
15766 int main() { return isinf(0.0); }
15769 if eval $compile; then
15771 echo "You have isinf."
15774 echo "You do not have isinf."
15780 : see if isinfl exists
15781 set isinfl d_isinfl
15785 echo "Checking to see if you have isless..." >&4
15788 int main() { return isless(0.0); }
15791 if eval $compile; then
15793 echo "You have isless."
15796 echo "You do not have isless."
15803 echo "Checking to see if you have isnan..." >&4
15806 int main() { return isnan(0.0); }
15809 if eval $compile; then
15811 echo "You have isnan."
15814 echo "You do not have isnan."
15820 : see if isnanl exists
15821 set isnanl d_isnanl
15824 : check for isnormal
15825 echo "Checking to see if you have isnormal..." >&4
15828 int main() { return isnormal(0.0); }
15831 if eval $compile; then
15833 echo "You have isnormal."
15836 echo "You do not have isnormal."
15846 : see if j0l exists
15850 : see if killpg exists
15851 set killpg d_killpg
15854 : see if localeconv exists
15855 set localeconv d_locconv
15858 : see if libc has the POSIX.1-2008 currency locale rules
15859 case "$d_locconv:$d_lc_monetary_2008" in
15862 #include <locale.h>
15864 struct lconv *lc = localeconv();
15865 char int_p_cs_precedes = lc->int_p_cs_precedes;
15870 if eval $compile; then
15871 d_lc_monetary_2008="$define"
15873 d_lc_monetary_2008="$undef"
15879 : see if lchown exists
15881 $cat > try.c <<'EOCP'
15882 /* System header to define __stub macros and hopefully few prototypes,
15883 which can conflict with char lchown(); below. */
15884 #include <assert.h>
15885 /* Override any gcc2 internal prototype to avoid an error. */
15886 /* We use char because int might match the return type of a gcc2
15887 builtin and then its argument prototype would still apply. */
15890 /* The GNU C library defines this for functions which it implements
15891 to always fail with ENOSYS. Some functions are actually named
15892 something starting with __ and the normal name is an alias. */
15893 #if defined (__stub_lchown) || defined (__stub___lchown)
15901 if eval $compile; then
15902 $echo "lchown() found." >&4
15905 $echo "lchown() NOT found." >&4
15911 : See if number of significant digits in a double precision number is known
15913 $cat >ldbl_dig.c <<EOM
15914 #include <limits.h>
15917 printf("Contains LDBL_DIG");
15920 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15921 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15922 echo "LDBL_DIG found." >&4
15925 echo "LDBL_DIG NOT found." >&4
15932 : see if lgamma exists
15933 set lgamma d_lgamma
15936 : see if lgamma_r exists
15937 set lgamma_r d_lgamma_r
15940 : check to see if math.h defines _LIB_VERSION
15941 d_libm_lib_version="$undef"
15943 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15945 #include <unistd.h>
15947 int main (int argc, char *argv[])
15949 printf ("%d\n", _LIB_VERSION);
15954 if eval $compile; then
15956 echo "Yes, it does ($foo)" >&4
15957 d_libm_lib_version="$define"
15959 echo "No, it does not (probably harmless)" >&4
15963 : see if link exists
15967 : see if llrint exists
15968 set llrint d_llrint
15971 : see if llrintl exists
15972 set llrintl d_llrintl
15975 : see if llround exists
15976 set llround d_llround
15979 : see if llroundl exists
15980 set llroundl d_llroundl
15983 : see if localeconv_l exists
15984 set localeconv_l d_localeconv_l
15987 : see if localtime_r exists
15988 set localtime_r d_localtime_r
15990 case "$d_localtime_r" in
15992 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15993 case "$d_localtime_r_proto:$usethreads" in
15994 ":define") d_localtime_r_proto=define
15995 set d_localtime_r_proto localtime_r $hdrs
15999 case "$d_localtime_r_proto" in
16001 case "$localtime_r_proto" in
16002 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16003 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16005 case "$localtime_r_proto" in
16006 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16007 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16009 case "$localtime_r_proto" in
16010 ''|0) d_localtime_r=undef
16011 localtime_r_proto=0
16012 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16013 * ) case "$localtime_r_proto" in
16014 REENTRANT_PROTO*) ;;
16015 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16017 echo "Prototype: $try" ;;
16020 *) case "$usethreads" in
16021 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16023 d_localtime_r=undef
16024 localtime_r_proto=0
16028 *) localtime_r_proto=0
16032 : see if localtime_r calls tzset
16033 case "$localtime_r_proto" in
16036 /* Does our libc's localtime_r call tzset ?
16037 * return 0 if so, 1 otherwise.
16039 #$i_systypes I_SYS_TYPES
16040 #$i_unistd I_UNISTD
16042 #$i_stdlib I_STDLIB
16043 #$i_malloc I_MALLOC
16045 # include <sys/types.h>
16048 # include <unistd.h>
16054 #include <stdlib.h>
16056 #include <string.h>
16058 # include <malloc.h>
16062 time_t t = time(0L);
16063 char w_tz[]="TZ" "=GMT+5",
16064 e_tz[]="TZ" "=GMT-5",
16065 *tz_e = (char*)malloc(16),
16066 *tz_w = (char*)malloc(16);
16067 struct tm tm_e, tm_w;
16068 memset(&tm_e,'\0',sizeof(struct tm));
16069 memset(&tm_w,'\0',sizeof(struct tm));
16074 localtime_r(&t, &tm_e);
16077 localtime_r(&t, &tm_w);
16079 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16085 if eval $compile; then
16086 if $run ./try; then
16087 d_localtime_r_needs_tzset=undef;
16089 d_localtime_r_needs_tzset=define;
16092 d_localtime_r_needs_tzset=undef;
16096 d_localtime_r_needs_tzset=undef;
16101 : see if lockf exists
16105 : see if log1p exists
16109 : see if log2 exists
16113 : see if logb exists
16117 : see if lrint exists
16121 : see if lrintl exists
16122 set lrintl d_lrintl
16125 : see if lround exists
16126 set lround d_lround
16129 : see if lroundl exists
16130 set lroundl d_lroundl
16133 : see if prototype for lseek is available
16135 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16138 : see if lstat exists
16142 : see if madvise exists
16143 set madvise d_madvise
16146 : see if malloc_size exists
16147 set malloc_size d_malloc_size
16150 : see if malloc_size_good exists
16151 set malloc_good_size d_malloc_good_size
16154 : see if malloc_usable_size exists
16155 set malloc_usable_size d_malloc_usable_size
16158 : see if mblen exists
16162 : see if mbrlen exists
16163 set mbrlen d_mbrlen
16166 : see if mbrtowc exists
16167 set mbrtowc d_mbrtowc
16170 : see if mbstowcs exists
16171 set mbstowcs d_mbstowcs
16174 : see if mbtowc exists
16175 set mbtowc d_mbtowc
16178 : see if memmem exists
16179 : We need both a prototype in string.h and the symbol in libc.
16182 xx1="#$d_gnulibc HAS_GNULIBC"
16183 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16184 xx3='# define _GNU_SOURCE'
16186 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16188 case "$d_memmem_proto" in
16189 define) # see if memmem exists
16190 set memmem d_memmem
16199 : see if memrchr exists
16200 : We need both a prototype in string.h and the symbol in libc.
16203 xx1="#$d_gnulibc HAS_GNULIBC"
16204 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16205 xx3='# define _GNU_SOURCE'
16207 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16209 case "$d_memrchr_proto" in
16210 define) # see if memrchr exists
16211 set memrchr d_memrchr
16220 : see if mkdir exists
16224 : see if mkdtemp exists
16225 set mkdtemp d_mkdtemp
16228 : see if mkfifo exists
16229 set mkfifo d_mkfifo
16232 : see if mkostemp exists
16233 set mkostemp d_mkostemp
16236 : see if mkstemp exists
16237 set mkstemp d_mkstemp
16240 : see if mkstemps exists
16241 set mkstemps d_mkstemps
16244 : see if mktime exists
16245 set mktime d_mktime
16248 : see if sys/mman.h has to be included
16249 set sys/mman.h i_sysmman
16252 : see if mmap exists
16255 : see what shmat returns
16256 : default to something harmless
16258 case "$i_sysmman$d_mmap" in
16260 $cat >mmap.c <<'END'
16261 #include <sys/mman.h>
16264 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16269 echo "and it returns ($mmaptype)." >&4
16273 : see if sqrtl exists
16277 : see if scalbnl exists
16278 set scalbnl d_scalbnl
16281 : see if truncl exists
16282 set truncl d_truncl
16285 : see if modfl exists
16289 : see if prototype for modfl is available
16291 set d_modflproto modfl define math.h
16294 if $test "$uselongdouble" = "$define"; then
16296 if $test "$d_sqrtl" != "$define"; then
16297 message="$message sqrtl"
16299 if $test "$d_modfl" != "$define"; then
16300 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16301 echo "You have both truncl and copysignl, so I can emulate modfl."
16303 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16304 echo "You have both aintl and copysignl, so I can emulate modfl."
16306 message="$message modfl"
16310 if $test "$d_frexpl" != "$define"; then
16311 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16312 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16314 message="$message frexpl"
16317 if $test "$d_ldexpl" != "$define"; then
16318 message="$message ldexpl"
16321 if $test "$message" != ""; then
16324 *** You requested the use of long doubles but you do not seem to have
16325 *** the following mathematical functions needed for long double support:
16327 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16328 *** Cannot continue, aborting.
16336 : see if mprotect exists
16337 set mprotect d_mprotect
16340 : see if msgctl exists
16341 set msgctl d_msgctl
16344 : see if msgget exists
16345 set msgget d_msgget
16348 : see if msgsnd exists
16349 set msgsnd d_msgsnd
16352 : see if msgrcv exists
16353 set msgrcv d_msgrcv
16356 : see how much of the 'msg*(2)' library is present.
16359 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16360 *"$undef"*) h_msg=false;;
16364 case "`ipcs 2>&1`" in
16365 "SVID messages"*"not configured"*)
16366 echo "Your $osname does not have the msg*(2) configured." >&4
16369 set msgctl d_msgctl
16371 set msgget d_msgget
16373 set msgsnd d_msgsnd
16375 set msgrcv d_msgrcv
16381 : we could also check for sys/ipc.h ...
16382 if $h_msg && $test `./findhdr sys/msg.h`; then
16383 echo "You have the full msg*(2) library." >&4
16386 echo "You don't have the full msg*(2) library." >&4
16392 : Check for msghdr_s
16394 echo "Checking to see if your system supports struct msghdr..." >&4
16395 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16397 case "$d_msghdr_s" in
16398 "$define") echo "Yes, it does." ;;
16399 *) echo "No, it doesn't." ;;
16402 : see if msync exists
16406 : see if munmap exists
16407 set munmap d_munmap
16410 : see if nan exists
16414 : see if nanosleep exists
16415 set nanosleep d_nanosleep
16418 : see if nearbyint exists
16419 set nearbyint d_nearbyint
16422 : see if nextafter exists
16423 set nextafter d_nextafter
16426 : see if nexttoward exists
16427 set nexttoward d_nexttoward
16430 : see if nice exists
16434 : see if this is a langinfo.h system
16435 set langinfo.h i_langinfo
16438 : see if nl_langinfo exists
16439 set nl_langinfo d_nl_langinfo
16442 : see if this is a quadmath.h system
16443 set quadmath.h i_quadmath
16446 : Check basic sizes
16448 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16450 case "$use64bitint:$d_quad:$quadtype" in
16453 uvtype="$uquadtype"
16458 uvtype="unsigned long"
16464 case "$uselongdouble:$d_longdbl" in
16466 nvtype="long double"
16467 nvsize=$longdblsize
16474 case "$usequadmath:$i_quadmath" in
16476 nvtype="__float128"
16482 *** You requested the use of the quadmath library, but you
16483 *** do not seem to have the quadmath library installed.
16484 *** Cannot continue, aborting.
16490 define:*) $cat <<EOM >&4
16492 *** You requested the use of the quadmath library, but you
16493 *** do not seem to have the required header, <quadmath.h>.
16495 case "$gccversion" in
16498 *** Your gcc looks a bit old:
16504 *** You are not running a gcc.
16509 *** For the quadmath library you need at least gcc 4.6.
16510 *** Cannot continue, aborting.
16516 $echo "(IV will be "$ivtype", $ivsize bytes)"
16517 $echo "(UV will be "$uvtype", $uvsize bytes)"
16518 $echo "(NV will be "$nvtype", $nvsize bytes)"
16521 #$i_inttypes I_INTTYPES
16523 #include <inttypes.h>
16528 int8_t i = INT8_MAX;
16529 uint8_t u = UINT8_MAX;
16530 printf("int8_t\n");
16533 int16_t i = INT16_MAX;
16534 uint16_t u = UINT16_MAX;
16535 printf("int16_t\n");
16538 int32_t i = INT32_MAX;
16539 uint32_t u = UINT32_MAX;
16540 printf("int32_t\n");
16545 i8type="signed char"
16546 u8type="unsigned char"
16551 '') case "$shortsize" in
16553 u16type="unsigned short"
16561 '') set try -DINT16
16562 if eval $compile; then
16563 case "`$run ./try`" in
16575 '') if $test $shortsize -ge 2; then
16577 u16type="unsigned short"
16585 '') case "$longsize" in
16587 u32type="unsigned long"
16591 *) case "$intsize" in
16593 u32type="unsigned int"
16603 '') set try -DINT32
16604 if eval $compile; then
16605 case "`$run ./try`" in
16617 '') if $test $intsize -ge 4; then
16619 u32type="unsigned int"
16627 '') case "$d_quad:$quadtype" in
16629 i64type="$quadtype"
16630 u64type="$uquadtype"
16638 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16641 #$i_stdlib I_STDLIB
16643 #include <stdlib.h>
16645 #include <sys/types.h>
16646 #include <signal.h>
16648 /* volatile so that the compiler has to store it out to memory */
16649 volatile int bletched = 0;
16650 $signal_t blech(int s) { bletched = 1; }
16655 int n = 8 * $uvsize;
16658 signal(SIGFPE, blech);
16661 for (i = 0; i < n; i++) {
16662 u = u << 1 | ($uvtype)1;
16664 if (($uvtype)d != u)
16668 d = ($nvtype)(u - 1);
16669 if (($uvtype)d != (u - 1))
16676 printf("%d\n", ((i == n) ? -n : i));
16682 d_nv_preserves_uv="$undef"
16683 if eval $compile; then
16684 nv_preserves_uv_bits="`$run ./try`"
16686 case "$nv_preserves_uv_bits" in
16688 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16689 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16690 d_nv_preserves_uv="$define"
16692 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16693 d_nv_preserves_uv="$undef" ;;
16694 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16695 nv_preserves_uv_bits="0" ;;
16699 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16703 typedef $nvtype NV;
16710 while(count < 256) {
16711 /* volatile so that the compiler has to store it out to memory */
16712 volatile NV up = value + 1.0;
16713 volatile NV negated = -value;
16714 volatile NV down = negated - 1.0;
16715 volatile NV got_up = up - value;
16716 int up_good = got_up == 1.0;
16717 int got_down = down - negated;
16718 int down_good = got_down == -1.0;
16720 if (down_good != up_good) {
16722 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16723 up_good, (double) got_up, down_good, (double) got_down,
16724 count, (double) value);
16731 fputs("256.0", stdout);
16734 fputs("2.0", stdout);
16740 fputs("*", stdout);
16746 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16747 count, (double) value);
16753 nv_overflows_integers_at='0'
16754 if eval $compile; then
16760 The largest integer your NVs can preserve is equal to $xxx
16762 nv_overflows_integers_at="$xxx"
16765 Cannot determine the largest integer value your NVs can hold, unexpected output
16772 Cannot determine the largest integer value your NVs can hold
16779 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16782 #$i_stdlib I_STDLIB
16784 #include <stdlib.h>
16786 #include <string.h>
16787 #include <sys/types.h>
16788 #include <signal.h>
16790 /* volatile so that the compiler has to store it out to memory */
16791 volatile int bletched = 0;
16792 $signal_t blech(int s) { bletched = 1; }
16795 int checkit($nvtype d, const char *where) {
16797 unsigned char *p = (unsigned char *)v;
16798 unsigned char *end = p + sizeof(d);
16807 p = (unsigned char *)v;
16808 printf("No - %s: 0x", where);
16810 printf ("%02X", *p++);
16815 int main(int argc, char **argv) {
16818 fail += checkit(d, "0.0");
16820 /* The compiler shouldn't be assuming that bletched is 0 */
16823 fail += checkit(d, "bleched");
16826 signal(SIGFPE, blech);
16829 /* Paranoia - the compiler should have no way of knowing that ANSI says
16830 that argv[argc] will always be NULL. Actually, if it did assume this it
16831 would be buggy, as this is C and main() can be called from elsewhere in
16833 d = argv[argc] ? 1 : 0;
16836 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16839 fail += checkit(d, "ternary");
16841 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16844 printf("No - memset doesn't give 0.0\n");
16845 /* This might just blow up: */
16846 printf("(gives %g)\n", d);
16852 printf("No - something bleched\n");
16857 printf("No - %d fail(s)\n", fail);
16866 d_nv_zero_is_allbits_zero="$undef"
16867 if eval $compile; then
16873 0.0 is represented as all bits zero in memory
16875 d_nv_zero_is_allbits_zero="$define"
16878 0.0 is not represented as all bits zero in memory
16880 d_nv_zero_is_allbits_zero="$undef"
16885 0.0 is not represented as all bits zero in memory
16887 d_nv_zero_is_allbits_zero="$undef"
16893 : check for off64_t
16895 echo "Checking to see if you have off64_t..." >&4
16897 #include <sys/types.h>
16898 #include <unistd.h>
16899 int main() { off64_t x = 7; }
16902 if eval $compile; then
16904 echo "You have off64_t."
16907 echo "You do not have off64_t."
16908 case "$lseeksize" in
16909 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16916 : how to create joinable pthreads
16917 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16919 echo "Checking what constant to use for creating joinable pthreads..." >&4
16920 $cat >try.c <<'EOCP'
16921 #include <pthread.h>
16923 int detachstate = JOINABLE;
16926 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16927 if eval $compile; then
16928 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16929 val="$undef" # Yes, undef.
16930 set d_old_pthread_create_joinable
16933 set old_pthread_create_joinable
16936 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16937 if eval $compile; then
16938 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16940 set d_old_pthread_create_joinable
16942 val=PTHREAD_CREATE_UNDETACHED
16943 set old_pthread_create_joinable
16946 set try -DJOINABLE=__UNDETACHED
16947 if eval $compile; then
16948 echo "You seem to use __UNDETACHED." >&4
16950 set d_old_pthread_create_joinable
16953 set old_pthread_create_joinable
16956 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16958 set d_old_pthread_create_joinable
16961 set old_pthread_create_joinable
16968 d_old_pthread_create_joinable="$undef"
16969 old_pthread_create_joinable=""
16972 : see if pause exists
16976 : see if pipe2 exists
16980 : see if poll exists
16984 : see if prctl exists
16988 : see if prctl supports PR_SET_NAME
16989 d_prctl_set_name=$undef
16994 #include <unistd.h>
16996 #include <sys/prctl.h>
16998 int main (int argc, char *argv[])
17000 return (prctl (PR_SET_NAME, "Test"));
17004 if eval $compile_ok && $run ./try; then
17005 echo "Your prctl (PR_SET_NAME, ...) works"
17006 d_prctl_set_name=$define
17012 : see if readlink exists
17013 set readlink d_readlink
17016 : Check if there is a /proc symlink to the abs path of
17017 : the executing program. We will honor hints of d_procselfexe=$undef
17018 : or procselfexe being non-empty, otherwise will try to determine both
17019 : if we have readlink.
17020 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17021 : referenced, and AmigaOS does not have a proc filesystem anyway.
17024 if $test "X$d_procselfexe" = Xundef; then
17026 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17028 elif $test "X$d_readlink" = Xdefine; then
17029 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17030 : and it feels more tidy to avoid an extra level of symlink
17031 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17032 while test $# -gt 0; do
17035 if $issymlink $try; then
17036 $ls -l $try > reflect
17037 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17038 echo "You have $type-like $try."
17039 procselfexe='"'$try'"'
17041 : This will break out of the loop
17051 : backward compatibility for d_hvfork
17052 if test X$d_hvfork != X; then
17053 d_vfork="$d_hvfork"
17056 : see if there is a vfork
17061 d_pseudofork=$undef
17063 : Ok, but do we want to use it. vfork is reportedly unreliable in
17064 : perl on Solaris 2.x, and probably elsewhere.
17068 case "$usevfork" in
17074 Perl can only use a vfork() that doesn't suffer from strict
17075 restrictions on calling functions or modifying global data in
17076 the child. For example, glibc-2.1 contains such a vfork()
17077 that is unsuitable. If your system provides a proper fork()
17078 call, chances are that you do NOT want perl to use vfork().
17081 rp="Do you still want to use vfork()?"
17086 echo "Ok, we won't use vfork()."
17095 $define) usevfork='true';;
17096 *) usevfork='false';;
17099 : see whether the pthread_atfork exists
17101 #include <pthread.h>
17104 #ifdef PTHREAD_ATFORK
17105 pthread_atfork(NULL,NULL,NULL);
17110 : see if pthread_atfork exists
17111 set try -DPTHREAD_ATFORK
17112 if eval $compile; then
17117 case "$usethreads" in
17120 $define) echo 'pthread_atfork found.' >&4 ;;
17121 *) echo 'pthread_atfork NOT found.' >&4 ;;
17124 set d_pthread_atfork
17127 : see if pthread_attr_setscope exists
17128 set pthread_attr_setscope d_pthread_attr_setscope
17131 : see whether the various POSIXish _yields exist
17133 #include <pthread.h>
17139 #ifdef PTHREAD_YIELD
17142 #ifdef PTHREAD_YIELD_NULL
17143 pthread_yield(NULL);
17149 : see if sched_yield exists
17150 set try -DSCHED_YIELD
17151 if eval $compile; then
17153 sched_yield='sched_yield()'
17157 case "$usethreads" in
17160 $define) echo 'sched_yield() found.' >&4 ;;
17161 *) echo 'sched_yield() NOT found.' >&4 ;;
17167 : see if pthread_yield exists
17168 set try -DPTHREAD_YIELD
17169 if eval $compile; then
17171 case "$sched_yield" in
17172 '') sched_yield='pthread_yield()' ;;
17175 set try -DPTHREAD_YIELD_NULL
17176 if eval $compile; then
17178 case "$sched_yield" in
17179 '') sched_yield='pthread_yield(NULL)' ;;
17185 case "$usethreads" in
17188 $define) echo 'pthread_yield() found.' >&4 ;;
17189 *) echo 'pthread_yield() NOT found.' >&4 ;;
17193 set d_pthread_yield
17195 case "$sched_yield" in
17196 '') sched_yield=undef ;;
17200 : check for ptrdiff_t
17202 echo "Checking to see if you have ptrdiff_t..." >&4
17204 #include <stddef.h>
17205 int main() { ptrdiff_t x = 7; }
17208 if eval $compile; then
17210 echo "You have ptrdiff_t."
17213 echo "You do not have ptrdiff_t."
17219 : see if random_r exists
17220 set random_r d_random_r
17222 case "$d_random_r" in
17224 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17225 case "$d_random_r_proto:$usethreads" in
17226 ":define") d_random_r_proto=define
17227 set d_random_r_proto random_r $hdrs
17231 case "$d_random_r_proto" in
17233 case "$random_r_proto" in
17234 ''|0) try='int random_r(int*, struct random_data*);'
17235 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17237 case "$random_r_proto" in
17238 ''|0) try='int random_r(long*, struct random_data*);'
17239 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17241 case "$random_r_proto" in
17242 ''|0) try='int random_r(struct random_data*, int32_t*);'
17243 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17245 case "$random_r_proto" in
17246 ''|0) d_random_r=undef
17248 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17249 * ) case "$random_r_proto" in
17250 REENTRANT_PROTO*) ;;
17251 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17253 echo "Prototype: $try" ;;
17256 *) case "$usethreads" in
17257 define) echo "random_r has no prototype, not using it." >&4 ;;
17264 *) random_r_proto=0
17268 : see if readdir and friends exist
17269 set readdir d_readdir
17271 set seekdir d_seekdir
17273 set telldir d_telldir
17275 set rewinddir d_rewinddir
17278 : see if readdir64_r exists
17279 set readdir64_r d_readdir64_r
17281 case "$d_readdir64_r" in
17283 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17284 case "$d_readdir64_r_proto:$usethreads" in
17285 ":define") d_readdir64_r_proto=define
17286 set d_readdir64_r_proto readdir64_r $hdrs
17290 case "$d_readdir64_r_proto" in
17292 case "$readdir64_r_proto" in
17293 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17294 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17296 case "$readdir64_r_proto" in
17297 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17298 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17300 case "$readdir64_r_proto" in
17301 ''|0) d_readdir64_r=undef
17302 readdir64_r_proto=0
17303 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17304 * ) case "$readdir64_r_proto" in
17305 REENTRANT_PROTO*) ;;
17306 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17308 echo "Prototype: $try" ;;
17311 *) case "$usethreads" in
17312 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17314 d_readdir64_r=undef
17315 readdir64_r_proto=0
17319 *) readdir64_r_proto=0
17323 : see if readdir_r exists
17324 set readdir_r d_readdir_r
17326 case "$d_readdir_r" in
17328 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17329 case "$d_readdir_r_proto:$usethreads" in
17330 ":define") d_readdir_r_proto=define
17331 set d_readdir_r_proto readdir_r $hdrs
17335 case "$d_readdir_r_proto" in
17337 case "$readdir_r_proto" in
17338 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17339 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17341 case "$readdir_r_proto" in
17342 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17343 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17345 case "$readdir_r_proto" in
17346 ''|0) d_readdir_r=undef
17348 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17349 * ) case "$readdir_r_proto" in
17350 REENTRANT_PROTO*) ;;
17351 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17353 echo "Prototype: $try" ;;
17356 *) case "$usethreads" in
17357 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17364 *) readdir_r_proto=0
17368 : see if readv exists
17372 : see if recvmsg exists
17373 set recvmsg d_recvmsg
17376 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17378 if set regcomp val -f d_regcomp; eval $csym; $val; then
17379 echo 'regcomp() found.' >&4
17380 d_regcomp="$define"
17383 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17384 echo 'regcmp() found.' >&4
17388 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17389 echo 're_comp() found, assuming re_exec() also exists.' >&4
17390 d_re_comp="$define"
17395 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17402 : see if remainder exists
17403 set remainder d_remainder
17406 : see if remquo exists
17407 set remquo d_remquo
17410 : see if rename exists
17411 set rename d_rename
17414 : see if rint exists
17418 : see if rmdir exists
17422 : see if round exists
17426 : see if prototype for sbrk is available
17428 set d_sbrkproto sbrk $i_unistd unistd.h
17431 : see if scalbn exists
17432 set scalbn d_scalbn
17435 : see if select exists
17436 set select d_select
17439 : see if semctl exists
17440 set semctl d_semctl
17443 : see if semget exists
17444 set semget d_semget
17447 : see if semop exists
17451 : see how much of the 'sem*(2)' library is present.
17454 case "$d_semctl$d_semget$d_semop" in
17455 *"$undef"*) h_sem=false;;
17459 case "`ipcs 2>&1`" in
17460 "SVID messages"*"not configured"*)
17461 echo "Your $osname does not have the sem*(2) configured." >&4
17464 set semctl d_semctl
17466 set semget d_semget
17474 : we could also check for sys/ipc.h ...
17475 if $h_sem && $test `./findhdr sys/sem.h`; then
17476 echo "You have the full sem*(2) library." >&4
17479 echo "You don't have the full sem*(2) library." >&4
17485 : see whether sys/sem.h defines union semun
17487 $cat > try.c <<'END'
17488 #include <sys/types.h>
17489 #include <sys/ipc.h>
17490 #include <sys/sem.h>
17491 int main () { union semun semun; semun.buf = 0; }
17494 if eval $compile; then
17495 echo "You have union semun in <sys/sem.h>." >&4
17498 echo "You do not have union semun in <sys/sem.h>." >&4
17505 : see how to do semctl IPC_STAT
17509 $cat > tryh.h <<END
17512 # define S_IRUSR S_IREAD
17513 # define S_IWUSR S_IWRITE
17514 # define S_IXUSR S_IEXEC
17516 # define S_IRUSR 0400
17517 # define S_IWUSR 0200
17518 # define S_IXUSR 0100
17520 # define S_IRGRP (S_IRUSR>>3)
17521 # define S_IWGRP (S_IWUSR>>3)
17522 # define S_IXGRP (S_IXUSR>>3)
17523 # define S_IROTH (S_IRUSR>>6)
17524 # define S_IWOTH (S_IWUSR>>6)
17525 # define S_IXOTH (S_IXUSR>>6)
17528 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17529 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17530 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17533 : see whether semctl IPC_STAT can use union semun
17534 case "$d_semctl_semun" in
17538 #include <sys/types.h>
17539 #include <sys/ipc.h>
17540 #include <sys/sem.h>
17541 #include <sys/stat.h>
17548 #$d_union_semun HAS_UNION_SEMUN
17551 #ifndef HAS_UNION_SEMUN
17554 struct semid_ds *buf;
17555 unsigned short *array;
17561 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17562 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17564 struct semid_ds argbuf;
17567 st = semctl(sem, 0, IPC_STAT, arg);
17571 # endif /* IPC_STAT */
17572 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17574 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17575 # endif /* IPC_RMID */
17576 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17578 #endif /* IPC_PRIVATE && ... */
17579 printf("semget failed: errno = %d\n", errno);
17584 if eval $compile; then
17587 semun) val="$define" ;;
17595 case "$d_semctl_semun" in
17597 echo "You can use union semun for semctl IPC_STAT." >&4
17600 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17605 : see whether semctl IPC_STAT can use struct semid_ds pointer
17606 case "$d_semctl_semid_ds" in
17609 $cat > try.c <<'END'
17610 #include <sys/types.h>
17611 #include <sys/ipc.h>
17612 #include <sys/sem.h>
17613 #include <sys/stat.h>
17622 #ifndef HAS_UNION_SEMUN
17625 struct semid_ds *buf;
17626 unsigned short *array;
17630 struct semid_ds argbuf;
17633 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17634 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17638 st = semctl(sem, 0, IPC_STAT, arg);
17640 printf("semid_ds\n");
17642 # endif /* IPC_STAT */
17643 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17645 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17646 # endif /* IPC_RMID */
17647 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17649 #endif /* IPC_PRIVATE && ... */
17650 printf("semget failed: errno = %d\n", errno);
17656 if eval $compile; then
17659 semid_ds) val="$define" ;;
17663 set d_semctl_semid_ds
17667 case "$d_semctl_semid_ds" in
17669 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17671 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17677 # We do not have the full sem*(2) library, so assume we can not
17683 set d_semctl_semid_ds
17689 : see if sendmsg exists
17690 set sendmsg d_sendmsg
17693 : see if setegid exists
17694 set setegid d_setegid
17697 : see if seteuid exists
17698 set seteuid d_seteuid
17701 : see if setgrent exists
17702 set setgrent d_setgrent
17705 : see if setgrent_r exists
17706 set setgrent_r d_setgrent_r
17708 case "$d_setgrent_r" in
17710 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17711 case "$d_setgrent_r_proto:$usethreads" in
17712 ":define") d_setgrent_r_proto=define
17713 set d_setgrent_r_proto setgrent_r $hdrs
17717 case "$d_setgrent_r_proto" in
17719 case "$setgrent_r_proto" in
17720 ''|0) try='int setgrent_r(FILE**);'
17721 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17723 case "$setgrent_r_proto" in
17724 ''|0) try='void setgrent_r(FILE**);'
17725 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17727 case "$setgrent_r_proto" in
17728 ''|0) d_setgrent_r=undef
17730 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17731 * ) case "$setgrent_r_proto" in
17732 REENTRANT_PROTO*) ;;
17733 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17735 echo "Prototype: $try" ;;
17738 *) case "$usethreads" in
17739 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17746 *) setgrent_r_proto=0
17750 : see if sethostent exists
17751 set sethostent d_sethent
17754 : see if sethostent_r exists
17755 set sethostent_r d_sethostent_r
17757 case "$d_sethostent_r" in
17759 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17760 case "$d_sethostent_r_proto:$usethreads" in
17761 ":define") d_sethostent_r_proto=define
17762 set d_sethostent_r_proto sethostent_r $hdrs
17766 case "$d_sethostent_r_proto" in
17768 case "$sethostent_r_proto" in
17769 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17770 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17772 case "$sethostent_r_proto" in
17773 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17774 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17776 case "$sethostent_r_proto" in
17777 ''|0) d_sethostent_r=undef
17778 sethostent_r_proto=0
17779 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17780 * ) case "$sethostent_r_proto" in
17781 REENTRANT_PROTO*) ;;
17782 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17784 echo "Prototype: $try" ;;
17787 *) case "$usethreads" in
17788 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17790 d_sethostent_r=undef
17791 sethostent_r_proto=0
17795 *) sethostent_r_proto=0
17799 : see if setitimer exists
17800 set setitimer d_setitimer
17803 : see if setlinebuf exists
17804 set setlinebuf d_setlinebuf
17807 : see if locale.h is available
17808 set locale.h i_locale
17811 : see if this system has wctype.h
17812 set wctype.h i_wctype
17815 : see if towupper exists
17816 set towupper d_towupper
17819 : check for setlocale function and behavior
17822 Checking to see if you have setlocale() and its behavior
17825 #include <stdlib.h>
17826 #include <string.h>
17827 #$i_locale I_LOCALE
17829 # include <locale.h>
17831 #$i_wctype I_WCTYPE
17833 # include <wctype.h>
17837 const char * invalid_name = "\a"; /* This is really invalid! */
17838 int accepts_any_locale_name = 0;
17839 int has_C_UTF8 = 0;
17840 unsigned char bad_setlocale = 255;
17842 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17843 * disabled. It's hard to imagine an instance where meaningful locale
17844 * handling could be done without LC_CTYPE */
17845 const char * name = setlocale(LC_CTYPE, "C");
17847 if (name == NULL || strcmp(name, "C") != 0) {
17848 exit(bad_setlocale);
17851 name = setlocale(LC_CTYPE, invalid_name);
17852 if (name != NULL) {
17854 /* Let it pass if it accepts the name but gives back one of the C
17856 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17857 accepts_any_locale_name = 1;
17861 name = setlocale(LC_CTYPE, "C.UTF-8");
17862 if (name != NULL) {
17863 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17865 #$d_towupper HAS_TOWUPPER
17866 #ifdef HAS_TOWUPPER
17868 /* We assume that if the machine doesn't have the C99 towupper, it
17869 * doesn't have C.UTF-8, even if we successfully changed locales to
17870 * include it. This seems safer even on platforms that didn't accept
17871 * the really invalid name */
17873 if (towupper(y_with_diaeresis) == 0x178) {
17883 /* Currently unused code to determine if LC_ALL with disparate values uses
17884 * category = value pairs or positional, and to determine the separator
17885 * between the categories. We could add code so that if the separator were
17886 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
17887 * every possible ASCII separator would fit in the 5 bits available in the
17888 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
17889 * positional, we probably would want to know the order of the categories.
17890 * Using a file between the C program and the shell script would really be
17891 * require to do that */
17894 unsigned char min_separator = ' ' - 1;
17895 unsigned char separator = min_separator;
17896 int uses_name_value_pair_names = 0;
17898 name = setlocale(LC_ALL, "C");
17899 if (name == NULL || strcmp(name, "C") != 0) {
17900 exit(bad_setlocale);
17906 name = setlocale(LC_CTYPE, "C.UTF-8");
17907 if (name == NULL) {
17908 exit(bad_setlocale);
17910 name = setlocale(LC_ALL, NULL);
17911 if (name == NULL) {
17912 exit(bad_setlocale);
17915 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
17917 uses_name_value_pair_names = 1;
17919 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
17922 separator = *(pos - 1);
17926 pos = strstr(name, "C.UTF-8");
17930 else if (pos == name) {
17931 separator = name[sizeof("C.UTF-8") - 1];
17934 separator = *(pos - 1);
17942 exit( 0 /* (separator - min_separator) << 3
17943 | uses_name_value_pair_names << 2
17946 | accepts_any_locale_name);
17951 if eval $compile; then
17952 echo "Your system has setlocale()..." >&4
17955 0) echo "and it seems sane" >&4
17956 d_setlocale="$define"
17957 d_setlocale_accepts_any_locale_name="$undef"
17958 d_has_C_UTF8="false"
17960 1) echo "and it seems sane, but accepts any locale name as valid" >&4
17961 d_setlocale="$define"
17962 d_setlocale_accepts_any_locale_name="$define"
17963 d_has_C_UTF8="false"
17965 2) echo "and it seems sane" >&4
17966 d_setlocale="$define"
17967 d_setlocale_accepts_any_locale_name="$undef"
17968 d_has_C_UTF8="true"
17970 3) echo "and it seems sane, but accepts any locale name as valid" >&4
17971 d_setlocale="$define"
17972 d_setlocale_accepts_any_locale_name="$define"
17973 d_has_C_UTF8="true"
17975 *) echo "but it doesn't seem to work, so we won't use it." >&4
17976 d_setlocale="$undef"
17977 d_setlocale_accepts_any_locale_name="$undef"
17978 d_has_C_UTF8="false"
17982 echo "your system does not have setlocale()" >&4
17983 d_setlocale="$undef"
17984 d_setlocale_accepts_any_locale_name="$undef"
17985 d_has_C_UTF8="false"
17989 : see if setlocale_r exists
17990 set setlocale_r d_setlocale_r
17992 case "$d_setlocale_r" in
17994 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17995 case "$d_setlocale_r_proto:$usethreads" in
17996 ":define") d_setlocale_r_proto=define
17997 set d_setlocale_r_proto setlocale_r $hdrs
18001 case "$d_setlocale_r_proto" in
18003 case "$setlocale_r_proto" in
18004 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18005 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18007 case "$setlocale_r_proto" in
18008 ''|0) d_setlocale_r=undef
18009 setlocale_r_proto=0
18010 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18011 * ) case "$setlocale_r_proto" in
18012 REENTRANT_PROTO*) ;;
18013 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18015 echo "Prototype: $try" ;;
18018 *) case "$usethreads" in
18019 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18021 d_setlocale_r=undef
18022 setlocale_r_proto=0
18026 *) setlocale_r_proto=0
18030 : see if setnetent exists
18031 set setnetent d_setnent
18034 : see if setnetent_r exists
18035 set setnetent_r d_setnetent_r
18037 case "$d_setnetent_r" in
18039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18040 case "$d_setnetent_r_proto:$usethreads" in
18041 ":define") d_setnetent_r_proto=define
18042 set d_setnetent_r_proto setnetent_r $hdrs
18046 case "$d_setnetent_r_proto" in
18048 case "$setnetent_r_proto" in
18049 ''|0) try='int setnetent_r(int, struct netent_data*);'
18050 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18052 case "$setnetent_r_proto" in
18053 ''|0) try='void setnetent_r(int, struct netent_data*);'
18054 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18056 case "$setnetent_r_proto" in
18057 ''|0) d_setnetent_r=undef
18058 setnetent_r_proto=0
18059 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18060 * ) case "$setnetent_r_proto" in
18061 REENTRANT_PROTO*) ;;
18062 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18064 echo "Prototype: $try" ;;
18067 *) case "$usethreads" in
18068 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18070 d_setnetent_r=undef
18071 setnetent_r_proto=0
18075 *) setnetent_r_proto=0
18079 : see if setprotoent exists
18080 set setprotoent d_setpent
18083 : see if setpgid exists
18084 set setpgid d_setpgid
18087 : see if setpgrp2 exists
18088 set setpgrp2 d_setpgrp2
18091 : see if setpriority exists
18092 set setpriority d_setprior
18095 : see if setproctitle exists
18096 set setproctitle d_setproctitle
18099 : see if setprotoent_r exists
18100 set setprotoent_r d_setprotoent_r
18102 case "$d_setprotoent_r" in
18104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18105 case "$d_setprotoent_r_proto:$usethreads" in
18106 ":define") d_setprotoent_r_proto=define
18107 set d_setprotoent_r_proto setprotoent_r $hdrs
18111 case "$d_setprotoent_r_proto" in
18113 case "$setprotoent_r_proto" in
18114 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18115 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18117 case "$setprotoent_r_proto" in
18118 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18119 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18121 case "$setprotoent_r_proto" in
18122 ''|0) d_setprotoent_r=undef
18123 setprotoent_r_proto=0
18124 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18125 * ) case "$setprotoent_r_proto" in
18126 REENTRANT_PROTO*) ;;
18127 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18129 echo "Prototype: $try" ;;
18132 *) case "$usethreads" in
18133 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18135 d_setprotoent_r=undef
18136 setprotoent_r_proto=0
18140 *) setprotoent_r_proto=0
18144 : see if setpwent exists
18145 set setpwent d_setpwent
18148 : see if setpwent_r exists
18149 set setpwent_r d_setpwent_r
18151 case "$d_setpwent_r" in
18153 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18154 case "$d_setpwent_r_proto:$usethreads" in
18155 ":define") d_setpwent_r_proto=define
18156 set d_setpwent_r_proto setpwent_r $hdrs
18160 case "$d_setpwent_r_proto" in
18162 case "$setpwent_r_proto" in
18163 ''|0) try='int setpwent_r(FILE**);'
18164 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18166 case "$setpwent_r_proto" in
18167 ''|0) try='void setpwent_r(FILE**);'
18168 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18170 case "$setpwent_r_proto" in
18171 ''|0) d_setpwent_r=undef
18173 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18174 * ) case "$setpwent_r_proto" in
18175 REENTRANT_PROTO*) ;;
18176 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18178 echo "Prototype: $try" ;;
18181 *) case "$usethreads" in
18182 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18189 *) setpwent_r_proto=0
18193 : see if setregid exists
18194 set setregid d_setregid
18196 set setresgid d_setresgid
18199 : see if setreuid exists
18200 set setreuid d_setreuid
18202 set setresuid d_setresuid
18205 : see if setrgid exists
18206 set setrgid d_setrgid
18209 : see if setruid exists
18210 set setruid d_setruid
18213 : see if setservent exists
18214 set setservent d_setsent
18217 : see if setservent_r exists
18218 set setservent_r d_setservent_r
18220 case "$d_setservent_r" in
18222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18223 case "$d_setservent_r_proto:$usethreads" in
18224 ":define") d_setservent_r_proto=define
18225 set d_setservent_r_proto setservent_r $hdrs
18229 case "$d_setservent_r_proto" in
18231 case "$setservent_r_proto" in
18232 ''|0) try='int setservent_r(int, struct servent_data*);'
18233 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18235 case "$setservent_r_proto" in
18236 ''|0) try='void setservent_r(int, struct servent_data*);'
18237 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18239 case "$setservent_r_proto" in
18240 ''|0) d_setservent_r=undef
18241 setservent_r_proto=0
18242 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18243 * ) case "$setservent_r_proto" in
18244 REENTRANT_PROTO*) ;;
18245 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18247 echo "Prototype: $try" ;;
18250 *) case "$usethreads" in
18251 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18253 d_setservent_r=undef
18254 setservent_r_proto=0
18258 *) setservent_r_proto=0
18262 : see if setsid exists
18263 set setsid d_setsid
18266 : see if setvbuf exists
18267 set setvbuf d_setvbuf
18270 : see if shmctl exists
18271 set shmctl d_shmctl
18274 : see if shmget exists
18275 set shmget d_shmget
18278 : see if shmat exists
18281 : see what shmat returns
18284 $cat >shmat.c <<'END'
18285 #include <sys/shm.h>
18288 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18293 echo "and it returns ($shmattype)." >&4
18294 : see if a prototype for shmat is available
18295 xxx=`./findhdr sys/shm.h`
18296 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18297 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18308 set d_shmatprototype
18311 : see if shmdt exists
18315 : see how much of the 'shm*(2)' library is present.
18318 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18319 *"$undef"*) h_shm=false;;
18323 case "`ipcs 2>&1`" in
18324 "SVID shared memory"*"not configured"*)
18325 echo "Your $osname does not have the shm*(2) configured." >&4
18328 set shmctl d_shmctl
18330 set shmget d_shmget
18340 : we could also check for sys/ipc.h ...
18341 if $h_shm && $test `./findhdr sys/shm.h`; then
18342 echo "You have the full shm*(2) library." >&4
18345 echo "You don't have the full shm*(2) library." >&4
18351 : see if we have sigaction
18353 if set sigaction val -f d_sigaction; eval $csym; $val; then
18354 echo 'sigaction() found.' >&4
18357 #include <sys/types.h>
18358 #include <signal.h>
18359 #$i_stdlib I_STDLIB
18361 #include <stdlib.h>
18365 struct sigaction act, oact;
18367 oact.sa_handler = 0;
18368 /* so that act and oact are used */
18369 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18373 if eval $compile_ok; then
18376 echo "But you don't seem to have a usable struct sigaction." >&4
18380 echo 'sigaction NOT found.' >&4
18383 set d_sigaction; eval $setvar
18386 : see what type pids are declared as in the kernel
18387 rp="What is the type of process ids on this system?"
18388 set pid_t pidtype int stdio.h sys/types.h
18391 : see what type uids are declared as in the kernel
18393 echo "Looking for the type for user ids returned by getuid()."
18394 set uid_t uidtype xxx stdio.h sys/types.h
18398 xxx=`./findhdr sys/user.h`
18399 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18401 unsigned) dflt="$1 $2" ;;
18405 *) dflt="$uidtype";;
18408 uid_t) echo "uid_t found." ;;
18409 *) rp="What is the type for user ids returned by getuid()?"
18415 : Define hasfield_t macro for Configure internal use
18416 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18417 while $test $# -ge 2; do
18419 $define) echo "#include <$2>";;
18423 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18425 if eval $compile; then
18434 : see what siginfo fields we have
18435 case "$d_sigaction" in
18437 echo "Checking if your siginfo_t has si_errno field...">&4
18438 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18441 echo "Checking if your siginfo_t has si_pid field...">&4
18442 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18445 echo "Checking if your siginfo_t has si_uid field...">&4
18446 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18449 echo "Checking if your siginfo_t has si_addr field...">&4
18450 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18453 echo "Checking if your siginfo_t has si_status field...">&4
18454 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18457 echo "Checking if your siginfo_t has si_band field...">&4
18458 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18461 echo "Checking if your siginfo_t has si_value field...">&4
18462 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18465 echo "Checking if your siginfo_t has si_fd field...">&4
18466 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18471 d_siginfo_si_errno="$undef"
18472 d_siginfo_si_pid="$undef"
18473 d_siginfo_si_uid="$undef"
18474 d_siginfo_si_addr="$undef"
18475 d_siginfo_si_status="$undef"
18476 d_siginfo_si_band="$undef"
18477 d_siginfo_si_value="$undef"
18478 d_siginfo_si_fd="$undef"
18482 : see if this is a sunmath.h system
18483 set sunmath.h i_sunmath
18486 : see if signbit exists
18487 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18489 #$i_sunmath I_SUNMATH
18491 #ifdef I_SUNMATH /* Solaris special math library */
18492 # include <sunmath.h>
18495 int main(int argc, char **argv)
18499 if ((signbit(x) == 0) && (signbit(y) != 0))
18507 if eval $compile; then
18508 if $run ./try; then
18512 $echo "Signbit seems to be available, but doesn't work as I expected."
18513 $echo "I won't use it." >&4
18524 : see if sigprocmask exists
18525 set sigprocmask d_sigprocmask
18528 : see if sigsetjmp exists
18530 case "$d_sigsetjmp" in
18533 #include <setjmp.h>
18534 #$i_stdlib I_STDLIB
18536 #include <stdlib.h>
18542 if (sigsetjmp(env,1))
18545 siglongjmp(env, 1);
18550 if eval $compile; then
18551 if $run ./try >/dev/null 2>&1; then
18552 echo "POSIX sigsetjmp found." >&4
18556 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18562 echo "sigsetjmp not found." >&4
18566 *) val="$d_sigsetjmp"
18567 case "$d_sigsetjmp" in
18568 $define) echo "POSIX sigsetjmp found." >&4;;
18569 $undef) echo "sigsetjmp not found." >&4;;
18577 : see if snprintf exists
18578 set snprintf d_snprintf
18581 : see if vsnprintf exists
18582 set vsnprintf d_vsnprintf
18585 case "$d_snprintf-$d_vsnprintf" in
18588 Checking whether your snprintf() and vsnprintf() work okay...
18590 $cat >try.c <<'EOCP'
18591 /* v?snprintf testing logic courtesy of Russ Allbery.
18592 * According to C99:
18593 * - if the buffer is too short it still must be \0-terminated
18594 * - if the buffer is too short the potentially required length
18595 * must be returned and not -1
18596 * - if the buffer is NULL the potentially required length
18597 * must be returned and not -1 or core dump
18600 #include <stdarg.h>
18604 int test (char *format, ...)
18609 va_start (args, format);
18610 count = vsnprintf (buf, sizeof buf, format, args);
18617 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18618 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18622 if eval $compile; then
18625 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18627 Your snprintf() and snprintf() don't seem to be working okay.
18629 d_snprintf="$undef"
18630 d_vsnprintf="$undef"
18634 echo "(I can't seem to compile the test program--assuming they don't)"
18635 d_snprintf="$undef"
18636 d_vsnprintf="$undef"
18642 : see if sockatmark exists
18643 set sockatmark d_sockatmark
18646 : see if prototype for sockatmark is available
18648 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18651 : see if socks5_init exists
18652 set socks5_init d_socks5_init
18655 : see if srand48_r exists
18656 set srand48_r d_srand48_r
18658 case "$d_srand48_r" in
18660 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18661 case "$d_srand48_r_proto:$usethreads" in
18662 ":define") d_srand48_r_proto=define
18663 set d_srand48_r_proto srand48_r $hdrs
18667 case "$d_srand48_r_proto" in
18669 case "$srand48_r_proto" in
18670 ''|0) try='int srand48_r(long, struct drand48_data*);'
18671 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18673 case "$srand48_r_proto" in
18674 ''|0) d_srand48_r=undef
18676 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18677 * ) case "$srand48_r_proto" in
18678 REENTRANT_PROTO*) ;;
18679 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18681 echo "Prototype: $try" ;;
18684 *) case "$usethreads" in
18685 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18692 *) srand48_r_proto=0
18696 : see if srandom_r exists
18697 set srandom_r d_srandom_r
18699 case "$d_srandom_r" in
18701 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18702 case "$d_srandom_r_proto:$usethreads" in
18703 ":define") d_srandom_r_proto=define
18704 set d_srandom_r_proto srandom_r $hdrs
18708 case "$d_srandom_r_proto" in
18710 case "$srandom_r_proto" in
18711 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18712 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18714 case "$srandom_r_proto" in
18715 ''|0) d_srandom_r=undef
18717 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18718 * ) case "$srandom_r_proto" in
18719 REENTRANT_PROTO*) ;;
18720 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18722 echo "Prototype: $try" ;;
18725 *) case "$usethreads" in
18726 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18733 *) srandom_r_proto=0
18737 : see if prototype for setresgid is available
18739 set d_sresgproto setresgid $i_unistd unistd.h
18742 : see if prototype for setresuid is available
18744 set d_sresuproto setresuid $i_unistd unistd.h
18747 : see if stat exists
18751 : see if sys/stat.h is available
18752 set sys/stat.h i_sysstat
18755 : see if stat knows about block sizes
18757 echo "Checking to see if your struct stat has st_blocks field..." >&4
18758 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18761 : see if this is a sys/vfs.h system
18762 set sys/vfs.h i_sysvfs
18765 : see if this is a sys/statfs.h system
18766 set sys/statfs.h i_sysstatfs
18769 : Check for statfs_s
18771 echo "Checking to see if your system supports struct statfs..." >&4
18772 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
18774 case "$d_statfs_s" in
18775 "$define") echo "Yes, it does." ;;
18776 *) echo "No, it doesn't." ;;
18779 : see if struct statfs knows about f_flags
18780 case "$d_statfs_s" in
18783 echo "Checking to see if your struct statfs has f_flags field..." >&4
18784 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
18788 set d_statfs_f_flags
18792 case "$d_statfs_f_flags" in
18793 "$define") echo "Yes, it does." ;;
18794 *) echo "No, it doesn't." ;;
18797 : see what flavor, if any, of static inline is supported
18799 echo "Checking to see if your system supports static inline..."
18800 $cat > try.c <<'EOCP'
18801 #include <stdlib.h>
18802 extern int f_via_a(int x);
18803 extern int f_via_b(int x);
18804 int main(int argc, char **argv)
18813 return EXIT_SUCCESS;
18816 return EXIT_FAILURE;
18820 $cat > a.c <<'EOCP'
18821 static INLINE int f(int x) {
18832 $cat > b.c <<'EOCP'
18833 extern int f(int x);
18841 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18842 case "$perl_static_inline" in
18843 '') # Check the various possibilities, and break out on success.
18844 # For gcc, prefer __inline__, which will still permit
18845 # cflags.SH to add in -ansi.
18846 case "$gccversion" in
18847 '') xxx="inline __inline__ __inline _inline";;
18848 *) xxx="__inline__ inline __inline _inline";;
18850 for inline in $xxx; do
18851 set try -DINLINE=$inline a.c
18852 if eval $compile && $run ./try; then
18853 # Now make sure there is no external linkage of static
18855 set try -DINLINE=$inline -DUSE_B a.c b.c
18856 if eval $compile && $run ./try; then
18857 $echo "Your compiler supports static $inline, " >&4
18858 $echo "but it also creates an external definition," >&4
18859 $echo "so I won't use it." >&4
18862 $echo "Your compiler supports static $inline." >&4
18864 perl_static_inline="static $inline";
18868 $echo "Your compiler does NOT support static $inline." >&4
18873 *inline*) # Some variant of inline exists.
18874 echo "Keeping your $hint value of $perl_static_inline."
18877 static) # No inline capabilities
18878 echo "Keeping your $hint value of $perl_static_inline."
18881 *) # Unrecognized previous value -- blindly trust the supplied
18882 # value and hope it makes sense. Use old value for
18883 # d_static_inline, if there is one.
18884 echo "Keeping your $hint value of $perl_static_inline."
18885 case "$d_static_inline" in
18887 *) val=$d_static_inline ;;
18891 # Fallback to plain 'static' if nothing worked.
18892 case "$perl_static_inline" in
18894 perl_static_inline="static"
18898 set d_static_inline
18900 $rm -f a.[co] b.[co]
18903 : Check stream access
18905 Checking how to access stdio streams by file descriptor number...
18907 case "$stdio_stream_array" in
18908 '') $cat >try.c <<EOCP
18911 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18915 for s in _iob __iob __sF
18917 set try -DSTDIO_STREAM_ARRAY=$s
18918 if eval $compile; then
18919 case "`$run ./try`" in
18920 yes) stdio_stream_array=$s; break ;;
18926 case "$stdio_stream_array" in
18928 I can't figure out how to access stdio streams by file descriptor number.
18930 d_stdio_stream_array="$undef"
18933 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18935 d_stdio_stream_array="$define"
18939 : see if strcoll exists
18940 set strcoll d_strcoll
18943 : see if strerror_l exists
18944 set strerror_l d_strerror_l
18947 : see if strerror_r exists
18948 set strerror_r d_strerror_r
18950 case "$d_strerror_r" in
18952 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18953 case "$d_strerror_r_proto:$usethreads" in
18954 ":define") d_strerror_r_proto=define
18955 set d_strerror_r_proto strerror_r $hdrs
18959 case "$d_strerror_r_proto" in
18961 case "$strerror_r_proto" in
18962 ''|0) try='int strerror_r(int, char*, size_t);'
18963 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18965 case "$strerror_r_proto" in
18966 ''|0) try='int strerror_r(int, char*, int);'
18967 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18969 case "$strerror_r_proto" in
18970 ''|0) try='char* strerror_r(int, char*, size_t);'
18971 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18973 case "$strerror_r_proto" in
18974 ''|0) d_strerror_r=undef
18976 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18977 * ) case "$strerror_r_proto" in
18978 REENTRANT_PROTO*) ;;
18979 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18981 echo "Prototype: $try" ;;
18984 *) case "$usethreads" in
18985 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18992 *) strerror_r_proto=0
18996 : see if strftime exists
18997 set strftime d_strftime
19000 : see if strlcat exists
19001 : We need both a prototype in string.h and the symbol in libc.
19004 xx1="#$d_gnulibc HAS_GNULIBC"
19005 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19006 xx3='# define _GNU_SOURCE'
19008 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19010 case "$d_strlcat_proto" in
19011 define) # see if strlcat exists
19012 set strlcat d_strlcat
19021 : see if strlcpy exists
19022 : We need both a prototype in string.h and the symbol in libc.
19025 xx1="#$d_gnulibc HAS_GNULIBC"
19026 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19027 xx3='# define _GNU_SOURCE'
19029 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19031 case "$d_strlcpy_proto" in
19032 define) # see if strlcpy exists
19033 set strlcpy d_strlcpy
19042 : see if strnlen exists
19043 set strnlen d_strnlen
19046 : see if strtod exists
19047 set strtod d_strtod
19050 : see if strtod_l exists
19051 set strtod_l d_strtod_l
19054 : see if strtol exists
19055 set strtol d_strtol
19058 : see if strtold exists
19059 set strtold d_strtold
19062 : see if strtold_l exists
19063 set strtold_l d_strtold_l
19066 : see if strtoll exists
19067 set strtoll d_strtoll
19070 case "$d_longlong-$d_strtoll" in
19073 Checking whether your strtoll() works okay...
19075 $cat >try.c <<'EOCP'
19078 #define strtoll __strtoll
19081 #define strtoll _strtoll
19084 extern long long int strtoll(char *s, char **, int);
19085 static int bad = 0;
19086 int check(char *s, long long ell, int een) {
19089 gll = strtoll(s, 0, 10);
19090 if (!((gll == ell) && (errno == een)))
19094 check(" 1", 1LL, 0);
19095 check(" 0", 0LL, 0);
19096 check("-1", -1LL, 0);
19097 check("-9223372036854775808", -9223372036854775808LL, 0);
19098 check("-9223372036854775808", -9223372036854775808LL, 0);
19099 check(" 9223372036854775807", 9223372036854775807LL, 0);
19100 check("-9223372036854775808", -9223372036854775808LL, 0);
19101 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19102 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19108 if eval $compile; then
19111 ok) echo "Your strtoll() seems to be working okay." ;;
19113 Your strtoll() doesn't seem to be working okay.
19119 echo "(I can't seem to compile the test program--assuming it doesn't)"
19125 : see if strtoq exists
19126 set strtoq d_strtoq
19129 : see if strtoul exists
19130 set strtoul d_strtoul
19133 case "$d_strtoul" in
19136 Checking whether your strtoul() works okay...
19138 $cat >try.c <<'EOCP'
19141 extern unsigned long int strtoul(char *s, char **, int);
19142 static int bad = 0;
19143 void check(char *s, unsigned long eul, int een) {
19146 gul = strtoul(s, 0, 10);
19147 if (!((gul == eul) && (errno == een)))
19151 check(" 1", 1L, 0);
19152 check(" 0", 0L, 0);
19154 case "$longsize" in
19156 $cat >>try.c <<'EOCP'
19157 check("18446744073709551615", 18446744073709551615UL, 0);
19158 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19159 #if 0 /* strtoul() for /^-/ strings is undefined. */
19160 check("-1", 18446744073709551615UL, 0);
19161 check("-18446744073709551614", 2, 0);
19162 check("-18446744073709551615", 1, 0);
19163 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19164 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19169 $cat >>try.c <<'EOCP'
19170 check("4294967295", 4294967295UL, 0);
19171 check("4294967296", 4294967295UL, ERANGE);
19172 #if 0 /* strtoul() for /^-/ strings is undefined. */
19173 check("-1", 4294967295UL, 0);
19174 check("-4294967294", 2, 0);
19175 check("-4294967295", 1, 0);
19176 check("-4294967296", 4294967295UL, ERANGE);
19177 check("-4294967297", 4294967295UL, ERANGE);
19182 : Should we write these tests to be more portable by sprintf-ing
19183 : ~0 and then manipulating that char string as input for strtol?
19186 $cat >>try.c <<'EOCP'
19193 if eval $compile; then
19194 case "`$run ./try`" in
19195 ok) echo "Your strtoul() seems to be working okay." ;;
19197 Your strtoul() doesn't seem to be working okay.
19203 echo "(I can't seem to compile the test program--assuming it doesn't)"
19209 : see if strtoull exists
19210 set strtoull d_strtoull
19213 case "$d_longlong-$d_strtoull" in
19216 Checking whether your strtoull() works okay...
19218 $cat >try.c <<'EOCP'
19221 #define strtoull __strtoull
19224 extern unsigned long long int strtoull(char *s, char **, int);
19225 static int bad = 0;
19226 int check(char *s, long long eull, int een) {
19229 gull = strtoull(s, 0, 10);
19230 if (!((gull == eull) && (errno == een)))
19234 check(" 1", 1LL, 0);
19235 check(" 0", 0LL, 0);
19236 check("18446744073709551615", 18446744073709551615ULL, 0);
19237 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19238 #if 0 /* strtoull() for /^-/ strings is undefined. */
19239 check("-1", 18446744073709551615ULL, 0);
19240 check("-18446744073709551614", 2LL, 0);
19241 check("-18446744073709551615", 1LL, 0);
19242 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19243 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19250 if eval $compile; then
19251 case "`$run ./try`" in
19252 ok) echo "Your strtoull() seems to be working okay." ;;
19254 Your strtoull() doesn't seem to be working okay.
19256 d_strtoull="$undef"
19260 echo "(I can't seem to compile the test program--assuming it doesn't)"
19261 d_strtoull="$undef"
19266 : see if strtouq exists
19267 set strtouq d_strtouq
19270 case "$d_strtouq" in
19273 Checking whether your strtouq() works okay...
19275 $cat >try.c <<'EOCP'
19278 extern unsigned long long int strtouq(char *s, char **, int);
19279 static int bad = 0;
19280 void check(char *s, unsigned long long eull, int een) {
19281 unsigned long long gull;
19283 gull = strtouq(s, 0, 10);
19284 if (!((gull == eull) && (errno == een)))
19288 check(" 1", 1LL, 0);
19289 check(" 0", 0LL, 0);
19290 check("18446744073709551615", 18446744073709551615ULL, 0);
19291 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19292 #if 0 /* strtouq() for /^-/ strings is undefined. */
19293 check("-1", 18446744073709551615ULL, 0);
19294 check("-18446744073709551614", 2LL, 0);
19295 check("-18446744073709551615", 1LL, 0);
19296 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19297 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19305 if eval $compile; then
19306 case "`$run ./try`" in
19307 ok) echo "Your strtouq() seems to be working okay." ;;
19309 Your strtouq() doesn't seem to be working okay.
19315 echo "(I can't seem to compile the test program--assuming it doesn't)"
19321 : see if strxfrm exists
19322 set strxfrm d_strxfrm
19325 : see if symlink exists
19326 set symlink d_symlink
19329 : see if syscall exists
19330 set syscall d_syscall
19333 : see if prototype for syscall is available
19335 set d_syscallproto syscall $i_unistd unistd.h
19338 : see if sysconf exists
19339 set sysconf d_sysconf
19342 : see if sys_errlist[] exists
19344 if test "X$d_syserrlst" = X; then
19345 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19346 echo "You have sys_errlist[], so we could roll our own strerror."
19347 d_syserrlst="$define"
19349 echo "You don't have sys_errlist[], so strerror() is welcome."
19350 d_syserrlst="$undef"
19354 : see if system exists
19355 set system d_system
19358 : see if tcgetpgrp exists
19359 set tcgetpgrp d_tcgetpgrp
19362 : see if tcsetpgrp exists
19363 set tcsetpgrp d_tcsetpgrp
19366 : see if prototype for telldir is available
19368 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19371 : see if tgamma exists
19372 set tgamma d_tgamma
19375 : check for thread_safe_nl_langinfo_l item
19378 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19381 #$i_stdlib I_STDLIB
19383 # include <stdlib.h>
19385 #include <string.h>
19386 #$i_langinfo I_LANGINFO
19388 # include <langinfo.h>
19390 #$i_pthread I_PTHREAD
19392 # include <pthread.h>
19394 #$i_locale I_LOCALE
19396 # include <locale.h>
19400 thread_start(void * arg)
19402 nl_langinfo(RADIXCHAR);
19406 char * main_buffer;
19407 char save_main_buffer[1000];
19408 pthread_t subthread;
19409 pthread_attr_t attr;
19411 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19413 /* If too large for our generous allowance, just assume we don't have
19415 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19419 strcpy(save_main_buffer, main_buffer);
19421 if (pthread_attr_init(&attr) != 0) {
19425 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19429 if (pthread_join(subthread, NULL) != 0) {
19433 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19436 case "$usethreads" in
19439 if eval $compile; then
19440 echo "Your system has nl_langinfo_l()..." >&4
19441 if $run ./try; then
19442 echo "and it is thread-safe (just as I'd hoped)." >&4
19443 d_thread_safe_nl_langinfo_l="$define"
19444 echo "$d_thread_safe_nl_langinfo_l" >&4
19446 echo "but it isn't thread-safe, so we won't use it." >&4
19449 echo "your system does not have nl_langinfo_l()" >&4
19452 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19454 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19455 d_thread_safe_nl_langinfo_l="$undef"
19459 : see if time exists
19461 if test "X$d_time" = X -o X"$timetype" = X; then
19462 if set time val -f d_time; eval $csym; $val; then
19463 echo 'time() found.' >&4
19465 rp="What is the type returned by time() on this system?"
19466 set time_t timetype long stdio.h sys/types.h
19469 echo 'time() not found, hope that will do.' >&4
19477 : see if timegm exists
19478 set timegm d_timegm
19481 : see if this is a sys/times.h system
19482 set sys/times.h i_systimes
19485 : see if times exists
19487 if set times val -f d_times; eval $csym; $val; then
19488 echo 'times() found.' >&4
19491 case "$i_systimes" in
19492 "$define") inc='sys/times.h';;
19494 rp="What is the type returned by times() on this system?"
19495 set clock_t clocktype long stdio.h sys/types.h $inc
19498 echo 'times() NOT found, hope that will do.' >&4
19503 : see if tmpnam_r exists
19504 set tmpnam_r d_tmpnam_r
19506 case "$d_tmpnam_r" in
19508 hdrs="$i_systypes sys/types.h define stdio.h "
19509 case "$d_tmpnam_r_proto:$usethreads" in
19510 ":define") d_tmpnam_r_proto=define
19511 set d_tmpnam_r_proto tmpnam_r $hdrs
19515 case "$d_tmpnam_r_proto" in
19517 case "$tmpnam_r_proto" in
19518 ''|0) try='char* tmpnam_r(char*);'
19519 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19521 case "$tmpnam_r_proto" in
19522 ''|0) d_tmpnam_r=undef
19524 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19525 * ) case "$tmpnam_r_proto" in
19526 REENTRANT_PROTO*) ;;
19527 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19529 echo "Prototype: $try" ;;
19532 *) case "$usethreads" in
19533 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19540 *) tmpnam_r_proto=0
19544 : see if towlower exists
19545 set towlower d_towlower
19548 : see if trunc exists
19552 : see if truncate exists
19553 set truncate d_truncate
19556 : see if ttyname_r exists
19557 set ttyname_r d_ttyname_r
19559 case "$d_ttyname_r" in
19561 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19562 case "$d_ttyname_r_proto:$usethreads" in
19563 ":define") d_ttyname_r_proto=define
19564 set d_ttyname_r_proto ttyname_r $hdrs
19568 case "$d_ttyname_r_proto" in
19570 case "$ttyname_r_proto" in
19571 ''|0) try='int ttyname_r(int, char*, size_t);'
19572 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19574 case "$ttyname_r_proto" in
19575 ''|0) try='int ttyname_r(int, char*, int);'
19576 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19578 case "$ttyname_r_proto" in
19579 ''|0) try='char* ttyname_r(int, char*, int);'
19580 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19582 case "$ttyname_r_proto" in
19583 ''|0) d_ttyname_r=undef
19585 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19586 * ) case "$ttyname_r_proto" in
19587 REENTRANT_PROTO*) ;;
19588 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19590 echo "Prototype: $try" ;;
19593 *) case "$usethreads" in
19594 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19601 *) ttyname_r_proto=0
19605 : see if tzname[] exists
19607 if set tzname val -a d_tzname; eval $csym; $val; then
19609 echo 'tzname[] found.' >&4
19612 echo 'tzname[] NOT found.' >&4
19617 : Check if is a multiplatform env
19619 darwin) multiarch="$define" ;;
19621 case "$multiarch" in
19622 ''|[nN]*) multiarch="$undef" ;;
19625 : check for ordering of bytes in a UV
19627 case "$multiarch" in
19630 You seem to be doing a multiarchitecture build,
19631 skipping the byteorder check.
19637 case "$byteorder" in
19640 In the following, larger digits indicate more significance. A big-endian
19641 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19642 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19643 machines may have weird orders like 3412. A Cray will report 87654321,
19644 an Alpha will report 12345678. If the test program works the default is
19646 I'm now running the test program...
19650 #$i_stdlib I_STDLIB
19652 #include <stdlib.h>
19654 #include <sys/types.h>
19655 typedef $uvtype UV;
19665 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19667 u.l = (UV)0x04030201;
19668 for (i = 0; i < $uvsize; i++)
19669 printf("%c", u.c[i]+'0');
19676 if eval $compile && $run ./try > /dev/null; then
19679 [1-4][1-4][1-4][1-4]|12345678|87654321)
19680 echo "(The test program ran ok.)"
19681 echo "byteorder=$dflt"
19684 ????|????????) echo "(The test program ran ok.)" ;;
19685 *) echo "(The test program didn't run right for some reason.)" ;;
19690 (I can't seem to compile the test program. Guessing big-endian...)
19693 case "$xxx_prompt" in
19695 rp="What is the order of bytes in $uvtype?"
19708 : Checking 32bit alignedness
19711 Checking to see whether you can access character data unalignedly...
19713 case "$d_u32align" in
19714 '') $cat >try.c <<EOCP
19716 #$i_stdlib I_STDLIB
19718 #include <stdlib.h>
19720 #define U32 $u32type
19721 #define BYTEORDER 0x$byteorder
19723 #include <signal.h>
19725 $signal_t bletch(int s) { exit(4); }
19728 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19729 volatile U8 buf[8];
19733 if (sizeof(U32) != 4) {
19734 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19741 signal(SIGBUS, bletch);
19753 for (i = 0; i < 4; i++) {
19754 up = (U32*)(buf + i);
19755 if (! ((*up == 1 << (8*i)) || /* big-endian */
19756 (*up == 1 << (8*(3-i))) /* little-endian */
19760 printf("read failed (%x)\n", *up);
19766 for (i = 0; i < 4; i++) {
19767 up = (U32*)(buf + i);
19769 if (*up != 0xBeef) {
19770 printf("write failed (%x)\n", *up);
19784 if eval $compile_ok; then
19785 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19786 $run ./try 2>&1 >/dev/null
19789 You can access character data pretty unalignedly.
19791 d_u32align="$undef"
19794 It seems that you must access character data in an aligned manner.
19796 d_u32align="$define"
19800 rp='Can you access character data at unaligned addresses?'
19804 [yY]*) d_u32align="$undef" ;;
19805 *) d_u32align="$define" ;;
19812 : see if ualarm exists
19813 set ualarm d_ualarm
19816 : see if umask exists
19820 : see if unordered exists
19821 set unordered d_unordered
19824 : see if unsetenv exists
19825 set unsetenv d_unsetenv
19828 : see if usleep exists
19829 set usleep d_usleep
19832 : see if prototype for usleep is available
19834 set d_usleepproto usleep $i_unistd unistd.h
19837 : see if ustat exists
19841 : see if closedir exists
19842 set closedir d_closedir
19845 case "$d_closedir" in
19848 echo "Checking whether closedir() returns a status..." >&4
19850 #$i_dirent I_DIRENT /**/
19851 #$i_sysdir I_SYS_DIR /**/
19852 #$i_sysndir I_SYS_NDIR /**/
19853 #$i_systypes I_SYS_TYPES /**/
19855 #if defined(I_SYS_TYPES)
19856 #include <sys/types.h>
19858 #if defined(I_DIRENT)
19859 #include <dirent.h>
19862 #include <sys/ndir.h>
19865 #include <sys/dir.h>
19869 int main() { return closedir(opendir(".")); }
19872 if eval $compile_ok; then
19873 if $run ./try > /dev/null 2>&1 ; then
19874 echo "Yes, it does."
19877 echo "No, it doesn't."
19881 echo "(I can't seem to compile the test program--assuming it doesn't)"
19889 set d_void_closedir
19893 : see if there is a wait4
19897 : see if waitpid exists
19898 set waitpid d_waitpid
19903 $cat >try.c <<'EOCP'
19909 return (wcscmp (s, s) ? 1 : 0);
19914 if eval $compile; then
19917 0) echo "A working wcscmp() found." >&4
19919 *) echo "wcscmp() found, but it doesn't work" >&4
19923 echo "wcscmp() NOT found." >&4
19929 : see if wcstombs exists
19930 set wcstombs d_wcstombs
19935 $cat >try.c <<'EOCP'
19940 wchar_t dst[4], *src = L" ";
19942 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19947 if eval $compile; then
19950 0) echo "A working wcsxfrm() found." >&4
19952 *) echo "wcsxfrm() found, but it doesn't work" >&4
19956 echo "wcsxfrm() NOT found." >&4
19962 : see if wctomb exists
19963 set wctomb d_wctomb
19966 : see if writev exists
19967 set writev d_writev
19970 : check for alignment requirements
19972 case "$alignbytes" in
19973 '') echo "Checking alignment constraints..." >&4
19982 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19987 if eval $compile_ok; then
19991 echo "(I can't seem to compile the test program...)"
19993 case "$multiarch" in
19995 : The usual safe value is 8, but Darwin with -Duselongdouble
19996 : needs 16. Hence, we will take 8 as a minimum, but allow
19997 : Configure to pick a larger value if needed.
19998 if $test "$dflt" -lt 8; then
20000 echo "Setting alignment to 8 for multiarch support.">&4
20005 *) dflt="$alignbytes"
20008 rp="Doubles must be aligned on a how-many-byte boundary?"
20013 : set the base revision
20016 : length of character in bytes. Is always 1, otherwise it is not C
20017 : This used to be a test using sizeof
20020 : Check for the number of bits in a character
20021 case "$charbits" in
20022 '') echo "Checking how long a character is (in bits)..." >&4
20029 for (c = 1, n = 0; c; c <<= 1, n++) ;
20030 printf ("%d\n", n);
20035 if eval $compile_ok; then
20039 echo "(I can't seem to compile the test program. Guessing...)"
20046 rp="What is the length of a character (in bits)?"
20050 case "$charbits" in
20053 Your system has an unsigned character size of $charbits bits, which
20054 is rather unusual (normally it is 8 bits). Perl likely will not work
20055 correctly on your system, with subtle bugs in various places.
20057 rp='Do you really want to continue?'
20061 [yY]) echo >&4 "Okay, continuing." ;;
20066 : how do we concatenate cpp tokens here?
20068 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20069 $cat >cpp_stuff.c <<'EOCP'
20070 #define RCAT(a,b)a/**/b
20071 #define ACAT(a,b)a ## b
20075 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20076 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20077 echo "Oh! Smells like ANSI's been here." >&4
20078 echo "We can catify or stringify, separately or together!"
20080 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20081 echo "Ah, yes! The good old days!" >&4
20082 echo "However, in the good old days we don't know how to stringify and"
20083 echo "catify at the same time."
20087 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20088 You're going to have to edit the values of CAT[2-5] in config.h...
20090 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20094 : see if this is a db.h system
20100 : Check db version.
20102 echo "Checking Berkeley DB version ..." >&4
20104 #include <sys/types.h>
20106 #$i_stdlib I_STDLIB
20108 #include <stdlib.h>
20111 int main(int argc, char *argv[])
20113 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20114 int Major, Minor, Patch ;
20115 unsigned long Version ;
20116 (void)db_version(&Major, &Minor, &Patch) ;
20118 printf("%d %d %d %d %d %d\n",
20119 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20120 Major, Minor, Patch);
20123 printf("You have Berkeley DB Version 2 or greater.\n");
20125 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20126 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20127 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20128 Major, Minor, Patch) ;
20130 /* check that db.h & libdb are compatible */
20131 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20132 printf("db.h and libdb are incompatible.\n") ;
20136 printf("db.h and libdb are compatible.\n") ;
20138 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20139 + DB_VERSION_PATCH ;
20141 /* needs to be >= 2.3.4 */
20142 if (Version < 2003004) {
20143 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20144 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20150 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20155 printf("You have Berkeley DB Version 1.\n");
20156 exit(0); /* DB version < 2: the coast is clear. */
20158 exit(1); /* <db.h> not Berkeley DB? */
20164 if eval $compile_ok && $run ./try; then
20165 echo 'Looks OK.' >&4
20167 db_version_major=$1
20168 db_version_minor=$2
20169 db_version_patch=$3
20171 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20175 : Remove db from list of libraries to use
20176 echo "Removing unusable -ldb from library list" >&4
20177 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20180 echo "libs = $libs" >&4
20190 : Check the return type needed for hash
20192 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20194 #include <sys/types.h>
20197 #ifndef DB_VERSION_MAJOR
20198 u_int32_t hash_cb (const void* ptr, size_t size)
20205 info.hash = hash_cb;
20209 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20210 if $contains warning try.out >>/dev/null 2>&1 ; then
20213 db_hashtype='u_int32_t'
20216 : XXX Maybe we should just give up here.
20217 db_hashtype=u_int32_t
20219 echo "Help: I can't seem to compile the db test program." >&4
20220 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20223 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20225 *) db_hashtype=u_int32_t
20230 : Check the return type needed for prefix
20232 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20234 #include <sys/types.h>
20237 #ifndef DB_VERSION_MAJOR
20238 size_t prefix_cb (const DBT *key1, const DBT *key2)
20245 info.prefix = prefix_cb;
20249 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20250 if $contains warning try.out >>/dev/null 2>&1 ; then
20251 db_prefixtype='int'
20253 db_prefixtype='size_t'
20256 db_prefixtype='size_t'
20257 : XXX Maybe we should just give up here.
20259 echo "Help: I can't seem to compile the db test program." >&4
20260 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20263 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20265 *) db_prefixtype='size_t'
20269 : Include . in @INC
20272 Historically Perl has provided a final fallback of the current working
20273 directory '.' when searching for a library. This, however, can lead to
20274 problems when a Perl program which loads optional modules is called from
20275 a shared directory. This can lead to executing unexpected code.
20279 # When changing to exclude by default:
20280 case "$default_inc_excludes_dot" in
20281 $undef|false|[nN]*) dflt="n" ;;
20284 # To turn exclude off by default:
20285 #case "$default_inc_excludes_dot" in
20286 # $define|true|[yY]*) dflt="y" ;;
20290 rp='Exclude '.' from @INC by default? '
20293 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20294 *) default_inc_excludes_dot="$define" ;;
20297 : Check what kind of inf/nan your system has
20298 $echo "Checking the kind of infinities and nans you have..." >&4
20299 $echo "(The following tests may crash. That's okay.)" >&4
20301 #define DOUBLESIZE $doublesize
20302 #$d_longdbl HAS_LONG_DOUBLE
20303 #ifdef HAS_LONG_DOUBLE
20304 #define LONG_DOUBLESIZE $longdblsize
20305 #define LONG_DOUBLEKIND $longdblkind
20308 #include <string.h>
20310 /* Note that whether the sign bit is on or off
20311 * for NaN depends on the CPU/FPU, and possibly
20312 * can be affected by the build toolchain.
20314 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20315 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20316 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20317 * (respectively) as opposed to the more usual
20318 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20320 * Pre-IEEE-754 floating point format do not even have inf/nan support
20321 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20322 * to even mention, causing immediate SIGFPE or equivalent: this is
20323 * the case with VAX floating point, for example.
20325 static void bytes(void *v, unsigned int n) {
20326 unsigned char *p = (unsigned char *)v;
20328 for (i = 0; i < n; i++) {
20329 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20332 int main(int argc, char *argv[]) {
20333 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20334 * because some compilers are 'smart' and not only warn but refuse to
20335 * compile such 'illegal' values. */
20336 double dinf = exp(1e9);
20337 double dnan = sqrt(-1.0);
20338 #ifdef HAS_LONG_DOUBLE
20339 long double ldinf = (long double)exp(1e9);
20340 long double ldnan = (long double)sqrt(-1.0);
20341 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20342 /* the 80-bit long doubles might have garbage in their excess bytes */
20343 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20344 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20347 switch (argv[1][0]) {
20348 case '1': bytes(&dinf, sizeof(dinf)); break;
20349 case '2': bytes(&dnan, sizeof(dnan)); break;
20350 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20351 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20359 if eval $compile; then
20360 doubleinfbytes=`$run ./try 1`
20361 doublenanbytes=`$run ./try 2`
20362 case "$d_longdbl" in
20364 longdblinfbytes=`$run ./try 3`
20365 longdblnanbytes=`$run ./try 4`
20369 # Defaults in case the above test program failed.
20370 case "$doublekind" in
20371 1) # IEEE 754 32-bit LE
20372 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20373 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20375 2) # IEEE 754 32-bit BE
20376 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20377 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20379 3) # IEEE 754 64-bit LE
20380 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20381 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20383 4) # IEEE 754 64-bit BE
20384 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20385 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20387 5) # IEEE 754 128-bit LE
20388 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20389 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20391 6) # IEEE 754 128-bit BE
20392 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20393 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20395 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20396 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20397 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20399 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20400 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20401 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20403 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20404 doubleinfbytes=$undef
20405 doublenanbytes=$undef
20408 doubleinfbytes=$undef
20409 doublenanbytes=$undef
20412 case "$longdblkind" in
20413 1) # IEEE 754 128-bit LE
20414 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20415 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20417 2) # IEEE 754 128-bit BE
20418 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20419 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20421 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20422 case "$longdblsize" in
20423 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20424 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20425 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20428 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20429 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20432 longdblinfbytes=$undef
20433 longdblnanbytes=$undef
20437 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20438 case "$longdblsize" in
20439 12) # 32-bit system
20440 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20441 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20443 16) # 64-bit system
20444 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20445 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20448 longdblinfbytes=$undef
20449 longdblnanbytes=$undef
20453 5) # 128-bit LE-LE "double double"
20454 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20455 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20457 6) # 128-bit BE-BE "double double"
20458 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20459 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20461 7) # 128-bit LE-BE "double double"
20462 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20463 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20465 8) # 128-bit BE-LE "double double"
20466 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20467 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20469 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20470 longdblinfbytes=$undef
20471 longdblnanbytes=$undef
20474 longdblinfbytes=$undef
20475 longdblnanbytes=$undef
20479 # In case the program crashed the values are empty, turn them undef.
20480 case "$doubleinfbytes" in
20481 '') doubleinfbytes=$undef ;;
20483 case "$doublenanbytes" in
20484 '') doublenanbytes=$undef ;;
20486 case "$longdblinfbytes" in
20487 '') longdblinfbytes=$undef ;;
20489 case "$longdblnanbytes" in
20490 '') longdblnanbytes=$undef ;;
20494 : Check the length of the double mantissa
20495 $echo "Checking how many mantissa bits your doubles have..." >&4
20497 #$i_sunmath I_SUNMATH
20500 # include <sunmath.h>
20502 #ifdef DBL_MANT_DIG
20503 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20506 int main(int argc, char *argv[]) {
20508 printf("%d\n", BITS);
20514 if eval $compile; then
20515 doublemantbits=`$run ./try`
20517 doublemantbits="$undef"
20521 : Check the length of the longdouble mantissa
20522 $echo "Checking how many mantissa bits your long doubles have..." >&4
20524 #$i_sunmath I_SUNMATH
20527 # include <sunmath.h>
20529 #$d_longdbl HAS_LONG_DOUBLE
20530 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20531 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20532 /* This format has no implicit bit. Beware, however, that for
20533 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20534 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20535 * and the top bit must have been one since 387, zero is plain invalid.
20536 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20537 # define BITS LDBL_MANT_DIG
20538 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20539 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20540 * reason e.g. Irix thinks 107. But in any case, we want only
20541 * the number of real bits, the implicit bits are of no interest. */
20542 # define BITS 2 * (DBL_MANT_DIG - 1)
20544 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20548 int main(int argc, char *argv[]) {
20550 printf("%d\n", BITS);
20556 if eval $compile; then
20557 longdblmantbits=`$run ./try`
20559 longdblmantbits="$undef"
20563 : Check the length of the NV mantissa
20564 $echo "Checking how many mantissa bits your NVs have..." >&4
20565 if test "X$usequadmath" = "X$define"; then
20566 nvmantbits=112 # 128-1-15
20568 if test "X$nvsize" = "X$doublesize"; then
20569 nvmantbits="$doublemantbits"
20571 if test "X$nvsize" = "X$longdblsize"; then
20572 nvmantbits="$longdblmantbits"
20574 nvmantbits="$undef"
20579 : How can we generate normalized random numbers ?
20581 echo "Using our internal random number implementation..." >&4
20584 *-Dmy_rand=*|*-Dmy_srand=*)
20585 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20586 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20587 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20588 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20592 randfunc=Perl_drand48
20593 drand01="Perl_drand48()"
20594 seedfunc="Perl_drand48_init"
20598 : Probe whether dtrace builds an object, as newer Illumos requires an input
20599 : object file that uses at least one of the probes defined in the .d file
20600 case "$usedtrace" in
20602 case "$dtracexnolibs" in
20603 $define|true|[yY]*)
20604 dtracexnolibs=$define
20605 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20608 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20609 dtracexnolibs=$define
20610 echo "Your dtrace accepts -xnolibs"
20611 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20612 dtracexnolibs=$undef
20613 echo "Your dtrace doesn't accept -xnolibs"
20615 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20620 dtracexnolibs=$undef
20621 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20624 case $dtracexnolibs in
20625 $define) xnolibs=-xnolibs ;;
20629 case "$dtraceobject" in
20630 $define|true|[yY]*)
20631 dtraceobject=$define
20635 #include "perldtrace.h"
20637 PERL_LOADED_FILE("dummy");
20641 dtraceobject=$undef
20642 if $cc -c -o try.o $optimize $ccflags try.c \
20643 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20644 dtraceobject=$define
20645 echo "Your dtrace builds an object file"
20648 *) dtraceobject=$undef ;;
20650 $rm_try perldtrace.o perldtrace.h
20653 : Determine if this is an EBCDIC system
20655 echo "Determining whether or not we are on an EBCDIC system..." >&4
20656 $cat >try.c <<'EOM'
20659 if ('M'==0xd4) return 0;
20666 if eval $compile_ok; then
20667 if $run ./try; then
20668 echo "You seem to speak EBCDIC." >&4
20671 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20674 echo "I'm unable to compile the test program." >&4
20675 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20681 : Check how to flush
20684 Checking how to flush all pending stdio output...
20686 # I only know how to find the first 32 possibly open files on SunOS.
20687 # See also hints/sunos_4_1.sh and util.c --AD
20689 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20691 $cat >>try.c <<EOCP
20693 #$i_stdlib I_STDLIB
20695 #include <stdlib.h>
20697 #$i_unistd I_UNISTD
20699 # include <unistd.h>
20701 #$d_sysconf HAS_SYSCONF
20702 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20703 #ifdef HAS_STDIO_STREAM_ARRAY
20704 # define STDIO_STREAM_ARRAY $stdio_stream_array
20709 p = fopen("try.out", "w");
20713 # ifdef TRY_FPRINTF
20717 #ifdef TRY_FFLUSH_NULL
20720 #ifdef TRY_FFLUSH_ALL
20722 long open_max = -1;
20723 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20724 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20726 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20727 open_max = sysconf(_SC_OPEN_MAX);
20730 open_max = FOPEN_MAX;
20733 open_max = OPEN_MAX;
20742 # ifdef HAS_STDIO_STREAM_ARRAY
20743 if (open_max > 0) {
20745 for (i = 0; i < open_max; i++)
20746 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20747 STDIO_STREAM_ARRAY[i]._file < open_max &&
20748 STDIO_STREAM_ARRAY[i]._flag)
20749 fflush(&STDIO_STREAM_ARRAY[i]);
20757 : first we have to find out how _not_ to flush
20759 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20761 set try -DTRY_FPUTC
20762 if eval $compile; then
20763 $run ./try 2>/dev/null
20766 if $test ! -s try.out -a "X$code" = X42; then
20772 set try -DTRY_FPRINTF
20773 if eval $compile; then
20774 $run ./try 2>/dev/null
20777 if $test ! -s try.out -a "X$code" = X42; then
20778 output=-DTRY_FPRINTF
20784 : check for fflush NULL behavior
20785 case "$fflushNULL" in
20786 '') set try -DTRY_FFLUSH_NULL $output
20787 if eval $compile; then
20788 $run ./try 2>/dev/null
20791 if $test -s try.out -a "X$code" = X42; then
20792 fflushNULL="`$cat try.out`"
20794 if $test "X$code" != X42; then
20796 (If this test failed, don't worry, we'll try another method shortly.)
20801 $rm -f core try.core core.try.*
20802 case "$fflushNULL" in
20804 Your fflush(NULL) works okay for output streams.
20805 Let's see if it clobbers input pipes...
20807 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20808 # bug that improperly flushes the input end of pipes. So we avoid the
20809 # autoflush on fork/system/exec support for now. :-(
20810 $cat >tryp.c <<EOCP
20813 main(int argc, char **argv)
20819 while ((i = getc(stdin)) != -1
20820 && (*bp++ = i) != '\n'
20821 && bp < &buf[1024])
20824 fprintf(stdout, "%s", buf);
20832 fflushNULL="$define"
20834 if eval $compile; then
20836 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20837 if $test "X$targethost" != X; then
20840 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20842 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20844 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20846 fflush(NULL) seems to behave okay with input streams.
20848 fflushNULL="$define"
20851 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20853 fflushNULL="$undef"
20856 $rm -f core tryp.c tryp.core core.tryp.*
20859 Your fflush(NULL) isn't working (contrary to ANSI C).
20861 fflushNULL="$undef"
20864 Cannot figure out whether your fflush(NULL) works or not.
20865 I'm assuming it doesn't (contrary to ANSI C).
20867 fflushNULL="$undef"
20871 $define|true|[yY]*)
20872 fflushNULL="$define"
20875 fflushNULL="$undef"
20878 : check explicit looping only if NULL did not work, and if the pipe
20879 : bug does not show up on an explicit flush too
20880 case "$fflushNULL" in
20882 $cat >tryp.c <<EOCP
20885 main(int argc, char **argv)
20891 while ((i = getc(stdin)) != -1
20892 && (*bp++ = i) != '\n'
20893 && bp < &buf[1024])
20896 fprintf(stdout, "%s", buf);
20905 if eval $compile; then
20907 if $test "X$targethost" != X; then
20910 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20912 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20914 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20916 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20918 : now check for fflushall behaviour
20919 case "$fflushall" in
20920 '') set try -DTRY_FFLUSH_ALL $output
20921 if eval $compile; then
20923 (Now testing the other method--but note that this also may fail.)
20925 $run ./try 2>/dev/null
20928 if $test -s try.out -a "X$code" = X42; then
20929 fflushall="`$cat try.out`"
20933 case "$fflushall" in
20935 Whew. Flushing explicitly all the stdio streams works.
20937 fflushall="$define"
20940 Sigh. Flushing explicitly all the stdio streams doesn't work.
20945 Cannot figure out whether flushing stdio streams explicitly works or not.
20946 I'm assuming it doesn't.
20952 "$define"|true|[yY]*)
20953 fflushall="$define"
20961 All is futile. Even fflush(stdin) clobbers input pipes!
20968 $rm -f core tryp.c tryp.core core.tryp.*
20970 *) fflushall="$undef"
20974 case "$fflushNULL$fflushall" in
20977 OK, I give up. I cannot figure out how to flush pending stdio output.
20978 We won't be flushing handles at all before fork/exec/popen.
20984 : Store the full pathname to the ar program for use in the C program
20985 : Respect a hint or command line value for full_ar.
20990 : Store the full pathname to the sed program for use in the C program
20993 : see what type gids are declared as in the kernel
20995 echo "Looking for the type for group ids returned by getgid()."
20996 set gid_t gidtype xxx stdio.h sys/types.h
21000 xxx=`./findhdr sys/user.h`
21001 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21003 unsigned) dflt="$1 $2" ;;
21007 *) dflt="$gidtype";;
21010 gid_t) echo "gid_t found." ;;
21011 *) rp="What is the type for group ids returned by getgid()?"
21017 : Check the size of GID
21020 *_t) zzz="$gidtype" ;;
21023 echo "Checking the size of $zzz..." >&4
21025 #include <sys/types.h>
21027 #$i_stdlib I_STDLIB
21029 #include <stdlib.h>
21032 printf("%d\n", (int)sizeof($gidtype));
21037 if eval $compile_ok; then
21041 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21044 echo "Your $zzz is $gidsize bytes long."
21049 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21052 : Check if GID is signed
21055 *_t) zzz="$gidtype" ;;
21058 echo "Checking the sign of $zzz..." >&4
21060 #include <sys/types.h>
21071 if eval $compile; then
21075 echo "(I can't execute the test program--guessing unsigned.)" >&4
21079 1) echo "Your $zzz is unsigned." ;;
21080 -1) echo "Your $zzz is signed." ;;
21086 echo "(I can't compile the test program--guessing unsigned.)" >&4
21089 : Check 64bit sizes
21092 if $test X"$quadtype" != X; then
21094 echo "Checking how to print 64-bit integers..." >&4
21096 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21097 $cat >try.c <<'EOCP'
21098 #include <sys/types.h>
21101 int q = 12345678901;
21102 printf("%ld\n", q);
21106 if eval $compile; then
21110 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21111 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21112 echo "We will use %d."
21118 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21119 $cat >try.c <<'EOCP'
21120 #include <sys/types.h>
21123 long q = 12345678901;
21124 printf("%ld\n", q);
21128 if eval $compile; then
21132 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21133 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21134 echo "We will use %ld."
21140 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21141 $cat >try.c <<'EOCP'
21142 #include <sys/types.h>
21143 #include <inttypes.h>
21146 int64_t q = 12345678901;
21147 printf("%" PRId64 "\n", q);
21151 if eval $compile; then
21155 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21156 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21157 echo "We will use the C9X style."
21163 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21165 #include <sys/types.h>
21168 $quadtype q = 12345678901;
21169 printf("%Ld\n", q);
21173 if eval $compile; then
21177 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21178 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21179 echo "We will use %Ld."
21185 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21186 $cat >try.c <<'EOCP'
21187 #include <sys/types.h>
21190 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21191 printf("%lld\n", q);
21195 if eval $compile; then
21199 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21200 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21201 echo "We will use the %lld style."
21207 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21209 #include <sys/types.h>
21212 $quadtype q = 12345678901;
21213 printf("%qd\n", q);
21217 if eval $compile; then
21221 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21222 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21223 echo "We will use %qd."
21229 if $test X"$sPRId64" = X; then
21230 echo "Cannot figure out how to print 64-bit integers." >&4
21237 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21238 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21240 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21241 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21245 : Check format strings for internal types
21247 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21249 if $test X"$ivsize" = X8; then
21250 ivdformat="$sPRId64"
21251 uvuformat="$sPRIu64"
21252 uvoformat="$sPRIo64"
21253 uvxformat="$sPRIx64"
21254 uvXUformat="$sPRIXU64"
21256 if $test X"$ivsize" = X"$longsize"; then
21263 if $test X"$ivsize" = X"$intsize"; then
21271 if $test X"$ivsize" = X"$shortsize"; then
21282 if $test X"$usequadmath" = X"$define"; then
21290 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21291 nveformat="$sPRIeldbl"
21292 nvfformat="$sPRIfldbl"
21293 nvgformat="$sPRIgldbl"
21294 nvEUformat="$sPRIEUldbl"
21295 nvFUformat="$sPRIFUldbl"
21296 nvGUformat="$sPRIGUldbl"
21307 case "$ivdformat" in
21308 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21313 : Check format string for GID
21316 $echo "Checking the format string to be used for gids..." >&4
21319 -1) if $test X"$gidsize" = X"$ivsize"; then
21320 gidformat="$ivdformat"
21322 if $test X"$gidsize" = X"$longsize"; then
21325 if $test X"$gidsize" = X"$intsize"; then
21328 if $test X"$gidsize" = X"$shortsize"; then
21335 *) if $test X"$gidsize" = X"$uvsize"; then
21336 gidformat="$uvuformat"
21338 if $test X"$gidsize" = X"$longsize"; then
21341 if $test X"$gidsize" = X"$intsize"; then
21344 if $test X"$gidsize" = X"$shortsize"; then
21353 : see if getgroups exists
21354 set getgroups d_getgrps
21357 : see if setgroups exists
21358 set setgroups d_setgrps
21361 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21363 case "$d_getgrps$d_setgrps" in
21365 case "$groupstype" in
21366 '') dflt="$gidtype" ;;
21367 *) dflt="$groupstype" ;;
21370 What type of pointer is the second argument to getgroups() and setgroups()?
21371 Usually this is the same as group ids, $gidtype, but not always.
21374 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21378 *) groupstype="$gidtype";;
21381 : check whether make sets MAKE
21383 echo "Checking if your $make program sets \$(MAKE)..." >&4
21384 case "$make_set_make" in
21386 $sed 's/^X //' > testmake.mak << 'EOF'
21388 X @echo 'maketemp="$(MAKE)"'
21390 case "`$make -f testmake.mak 2>/dev/null`" in
21391 *maketemp=*) make_set_make='#' ;;
21392 *) make_set_make="MAKE=$make" ;;
21394 $rm -f testmake.mak
21397 case "$make_set_make" in
21398 '#') echo "Yup, it does.";;
21399 *) echo "Nope, it doesn't.";;
21402 : see what type is used for mode_t
21403 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21404 set mode_t modetype int stdio.h sys/types.h
21407 : see if we need va_copy
21410 #include <stdarg.h>
21412 #include <stdlib.h>
21413 #include <signal.h>
21416 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21418 return vfprintf(f, fmt, *valp);
21422 myvfprintf(FILE *f, const char *fmt, va_list val)
21424 return ivfprintf(f, fmt, &val);
21428 myprintf(char *fmt, ...)
21431 va_start(val, fmt);
21432 return myvfprintf(stdout, fmt, val);
21436 main(int ac, char **av)
21438 signal(SIGSEGV, exit);
21440 myprintf("%s%cs all right, then\n", "that", '\'');
21445 if eval $compile && $run ./try 2>&1 >/dev/null; then
21446 case "`$run ./try`" in
21447 "that's all right, then")
21453 yes) echo "It seems that you don't need va_copy()." >&4
21454 need_va_copy="$undef"
21456 *) echo "It seems that va_copy() or similar will be needed." >&4
21457 need_va_copy="$define"
21462 : see what type is used for size_t
21463 rp="What is the type used for the length parameter for string functions?"
21464 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21467 : check for type of arguments to gethostbyaddr.
21468 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21469 case "$d_gethbyaddr" in
21473 Checking to see what type of arguments are accepted by gethostbyaddr().
21475 hdrs="$define sys/types.h
21476 $d_socket sys/socket.h
21477 $i_niin netinet/in.h
21479 $i_unistd unistd.h"
21480 : The first arg can 'char *' or 'void *'
21481 : The second arg is some of integral type
21482 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21483 for yyy in size_t long int; do
21484 case "$netdb_host_type" in
21485 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21486 if ./protochk "$try" $hdrs; then
21487 echo "Your system accepts $xxx for the first arg."
21488 echo "...and $yyy for the second arg."
21489 netdb_host_type="$xxx"
21490 netdb_hlen_type="$yyy"
21496 : In case none of those worked, prompt the user.
21497 case "$netdb_host_type" in
21498 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21501 netdb_host_type=$ans
21502 rp='What is the type for the 2nd argument to gethostbyaddr?'
21505 netdb_hlen_type=$ans
21509 *) : no gethostbyaddr, so pick harmless defaults
21510 netdb_host_type='char *'
21511 netdb_hlen_type="$sizetype"
21514 # Remove the "const" if needed. -- but then we'll have a
21516 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21519 : check for type of argument to gethostbyname.
21520 if test "X$netdb_name_type" = X ; then
21521 case "$d_gethbyname" in
21525 Checking to see what type of argument is accepted by gethostbyname().
21527 hdrs="$define sys/types.h
21528 $d_socket sys/socket.h
21529 $i_niin netinet/in.h
21531 $i_unistd unistd.h"
21532 for xxx in "const char *" "char *"; do
21533 case "$netdb_name_type" in
21534 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21535 if ./protochk "$try" $hdrs; then
21536 echo "Your system accepts $xxx."
21537 netdb_name_type="$xxx"
21542 : In case none of those worked, prompt the user.
21543 case "$netdb_name_type" in
21544 '') rp='What is the type for the 1st argument to gethostbyname?'
21547 netdb_name_type=$ans
21551 *) : no gethostbyname, so pick harmless default
21552 netdb_name_type='char *'
21557 : check for type of 1st argument to getnetbyaddr.
21558 if test "X$netdb_net_type" = X ; then
21559 case "$d_getnbyaddr" in
21563 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21565 hdrs="$define sys/types.h
21566 $d_socket sys/socket.h
21567 $i_niin netinet/in.h
21569 $i_unistd unistd.h"
21570 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21571 case "$netdb_net_type" in
21572 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21573 if ./protochk "$try" $hdrs; then
21574 echo "Your system accepts $xxx."
21575 netdb_net_type="$xxx"
21580 : In case none of those worked, prompt the user.
21581 case "$netdb_net_type" in
21582 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21585 netdb_net_type=$ans
21589 *) : no getnetbyaddr, so pick harmless default
21590 netdb_net_type='long'
21594 : locate the preferred pager for this system
21601 [a-zA-Z]:/*) dflt=$pg;;
21605 [a-zA-Z]:/*) dflt=$more;;
21609 [a-zA-Z]:/*) dflt=$less;;
21612 '') dflt=/usr/ucb/more;;
21620 rp='What pager is used on your system?'
21624 : see if ar generates random libraries by itself
21626 echo "Checking how to generate random libraries on your machine..." >&4
21627 echo 'int bar1() { return bar2(); }' > bar1.c
21628 echo 'int bar2() { return 2; }' > bar2.c
21630 #$i_stdlib I_STDLIB
21632 #include <stdlib.h>
21634 int main() { printf("%d\n", bar1()); exit(0); }
21636 $cc $ccflags -c bar1.c >/dev/null 2>&1
21637 $cc $ccflags -c bar2.c >/dev/null 2>&1
21638 $cc $ccflags -c foo.c >/dev/null 2>&1
21639 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21640 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21641 $run ./foobar >/dev/null 2>&1; then
21642 echo "$ar appears to generate random libraries itself."
21644 if [ "X$ranlib" = "X" ]; then
21647 elif $ar s bar$_a >/dev/null 2>&1 &&
21648 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21649 $run ./foobar >/dev/null 2>&1; then
21650 echo "a table of contents needs to be added with '$ar s'."
21653 elif $ar ts bar$_a >/dev/null 2>&1 &&
21654 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21655 $run ./foobar >/dev/null 2>&1; then
21656 echo "a table of contents needs to be added with '$ar ts'."
21663 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21664 $test -f $ranlib || ranlib=''
21667 if $test -n "$ranlib"; then
21668 echo "your system has '$ranlib'; we'll use that."
21671 echo "your system doesn't seem to support random libraries"
21672 echo "so we'll use lorder and tsort to order the libraries."
21679 : Check the max offset that gmtime and localtime accept
21680 echo "Checking max offsets that gmtime () accepts"
21682 case "$sGMTIME_min/$sGMTIME_max" in
21685 #include <sys/types.h>
21693 void gm_check (time_t t, int min_year, int max_year)
21696 if ( tmp == NULL ||
21697 /* Check tm_year overflow */
21698 tmp->tm_year < min_year || tmp->tm_year > max_year)
21709 gm_check (MAXLONG, 69, 0x7fffffff);
21711 if (tmp == NULL || tmp->tm_year < 0) {
21712 for (i = 63; i >= 0; i--) {
21713 time_t x = pt | ((time_t)1 << i);
21714 if (x < 0 || x < pt) continue;
21715 gm_check (x, 69, 0x7fffffff);
21718 printf ("sGMTIME_max=%ld\n", pt);
21727 gm_check (MINLONG, -1900, 70);
21730 for (i = 36; i >= 0; i--) {
21731 time_t x = pt - ((time_t)1 << i);
21732 if (x > 0) continue;
21733 gm_check (x, -1900, 70);
21736 printf ("sGMTIME_min=%ld\n", pt);
21740 int main (int argc, char *argv[])
21742 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21749 if eval $compile; then
21750 eval `$run ./try 2>/dev/null`
21752 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21758 echo "Checking max offsets that localtime () accepts"
21760 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21763 #include <sys/types.h>
21771 void local_check (time_t t, int min_year, int max_year)
21773 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21776 tmp = localtime (&t);
21777 if ( tmp == NULL ||
21778 /* Check tm_year overflow */
21779 tmp->tm_year < min_year || tmp->tm_year > max_year)
21783 } /* local_check */
21790 local_check (MAXLONG, 69, 0x7fffffff);
21792 if (tmp == NULL || tmp->tm_year < 0) {
21793 for (i = 63; i >= 0; i--) {
21794 time_t x = pt | ((time_t)1 << i);
21795 if (x < 0 || x < pt) continue;
21796 local_check (x, 69, 0x7fffffff);
21799 printf ("sLOCALTIME_max=%ld\n", pt);
21808 local_check (MINLONG, -1900, 70);
21811 for (i = 36; i >= 0; i--) {
21812 time_t x = pt - ((time_t)1 << i);
21813 if (x > 0) continue;
21814 local_check (x, -1900, 70);
21817 printf ("sLOCALTIME_min=%ld\n", pt);
21821 int main (int argc, char *argv[])
21829 if eval $compile; then
21830 eval `$run ./try 2>/dev/null`
21832 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21838 : check for type of arguments to select.
21839 case "$selecttype" in
21840 '') case "$d_select" in
21844 Checking to see what type of arguments are accepted by select().
21846 hdrs="$define sys/types.h
21847 $i_systime sys/time.h
21848 $i_sysselct sys/select.h
21849 $d_socket sys/socket.h"
21850 : The first arg can be int, unsigned, or size_t
21851 : The last arg may or may not be 'const'
21853 : void pointer has been seen but using that
21854 : breaks the selectminbits test
21855 for xxx in 'fd_set *' 'int *'; do
21856 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21857 for tmo in 'struct timeval *' 'const struct timeval *'; do
21859 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21860 if ./protochk "$try" $hdrs; then
21861 echo "Your system accepts $xxx."
21870 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21871 case "$d_fd_set" in
21872 $define) dflt="fd_set *" ;;
21881 *) : no select, so pick a harmless default
21888 : check for the select 'width'
21889 case "$selectminbits" in
21890 '') safebits=`expr $ptrsize \* 8`
21891 case "$d_select" in
21895 Checking to see on how many bits at a time your select() operates...
21898 #include <sys/types.h>
21900 #$i_systime I_SYS_TIME
21901 #$i_systimek I_SYS_TIME_KERNEL
21906 # ifdef I_SYS_TIME_KERNEL
21909 # include <sys/time.h>
21910 # ifdef I_SYS_TIME_KERNEL
21914 #$i_sysselct I_SYS_SELECT
21915 #ifdef I_SYS_SELECT
21916 #include <sys/select.h>
21918 #$d_socket HAS_SOCKET
21920 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21923 #$i_stdlib I_STDLIB
21925 #include <stdlib.h>
21928 #define S sizeof(*(b))
21930 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21931 #define NBITS (NBYTES * 8)
21933 char *s = (char *)malloc(NBYTES);
21942 fp = fopen("try.c", "r");
21948 b = ($selecttype)s;
21949 for (i = 0; i < NBITS; i++)
21953 select(fd + 1, b, 0, 0, &t);
21954 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21956 printf("%d\n", i + 1);
21961 if eval $compile_ok; then
21962 selectminbits=`$run ./try 2>/dev/null`
21963 case "$selectminbits" in
21965 Cannot figure out on how many bits at a time your select() operates.
21966 I'll play safe and guess it is $safebits bits.
21968 selectminbits=$safebits
21969 bits="$safebits bits"
21972 *) bits="$selectminbits bits" ;;
21974 echo "Your select() operates on $bits at a time." >&4
21976 rp='What is the minimum number of bits your select() operates on?'
21977 case "$byteorder" in
21978 12345678) dflt=64 ;;
21984 selectminbits="$val"
21988 *) : no select, so pick a harmless default
21989 selectminbits=$safebits
21995 : Trace out the files included by signal.h, then look for SIGxxx names.
21996 case "$sig_num_init" in
21998 if [ "X$fieldn" = X ]; then
21999 : Just make some guesses. We check them later.
22000 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22002 xxx=`echo '#include <signal.h>' |
22003 $cppstdin $cppminus $cppflags 2>/dev/null |
22004 $grep '^[ ]*#.*include' |
22005 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22006 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22009 for xx in $xxx /dev/null ; do
22010 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22012 case "$xxxfiles" in
22013 '') xxxfiles=`./findhdr signal.h` ;;
22016 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22017 print substr($2, 4, 20)
22019 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22020 print substr($3, 4, 20)
22022 : Append some common names just in case the awk scan failed.
22023 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22024 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22025 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22026 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22027 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22029 : generate a few handy files for later
22030 $cat > signal.c <<EOCP
22031 #include <sys/types.h>
22032 #include <signal.h>
22033 #$i_stdlib I_STDLIB
22035 #include <stdlib.h>
22040 /* Strange style to avoid deeply-nested #if/#else/#endif */
22043 # define NSIG (_NSIG)
22049 # define NSIG (SIGMAX+1)
22055 # define NSIG (SIG_MAX+1)
22061 # define NSIG (_SIG_MAX+1)
22067 # define NSIG (MAXSIG+1)
22073 # define NSIG (MAX_SIG+1)
22078 # ifdef SIGARRAYSIZE
22079 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22085 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22089 /* Default to some arbitrary number that's big enough to get most
22090 of the common signals.
22096 printf("NSIG %d\n", NSIG);
22102 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22104 printf "#ifdef SIG"; printf $1; printf "\n"
22105 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22106 printf $1; printf ");\n"
22110 printf "#endif /* JUST_NSIG */\n";
22111 printf "exit(0);\n}\n";
22114 $cat >signal.awk <<'EOP'
22115 BEGIN { ndups = 0 }
22116 $1 ~ /^NSIG$/ { nsig = $2 }
22117 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22118 if ($2 > maxsig) { maxsig = $2 }
22119 if (sig_name[$2]) {
22120 dup_name[ndups] = $1
22121 dup_num[ndups] = $2
22133 printf("NSIG %d\n", nsig);
22134 for (n = 1; n < nsig; n++) {
22136 printf("%s %d\n", sig_name[n], sig_num[n])
22139 printf("NUM%d %d\n", n, n)
22142 for (n = 0; n < ndups; n++) {
22143 printf("%s %d\n", dup_name[n], dup_num[n])
22147 $cat >signal_cmd <<EOS
22149 if $test -s signal.lst; then
22150 echo "Using your existing signal.lst file"
22155 $cat >>signal_cmd <<'EOS'
22158 if eval $compile_ok; then
22159 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22160 $uniq | $awk -f signal.awk >signal.lst
22162 echo "(I can't seem be able to compile the whole test program)" >&4
22163 echo "(I'll try it in little pieces.)" >&4
22164 set signal -DJUST_NSIG
22165 if eval $compile_ok; then
22166 $run ./signal$_exe > signal.nsg
22169 echo "I can't seem to figure out how many signals you have." >&4
22170 echo "Guessing 50." >&4
22171 echo 'NSIG 50' > signal.nsg
22173 : Now look at all the signal names, one at a time.
22174 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22175 $cat > signal.c <<EOCP
22176 #include <sys/types.h>
22177 #include <signal.h>
22180 printf("$xx %d\n", SIG${xx});
22185 if eval $compile; then
22186 echo "SIG${xx} found."
22187 $run ./signal$_exe >> signal.ls1
22189 echo "SIG${xx} NOT found."
22192 if $test -s signal.ls1; then
22193 $cat signal.nsg signal.ls1 |
22194 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22198 if $test -s signal.lst; then
22201 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22202 echo 'kill -l' >signal
22203 set X `csh -f <signal`
22207 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22209 echo $@ | $tr ' ' $trnl | \
22210 $awk '{ printf "%s %d\n", $1, ++s; }
22211 END { printf "NSIG %d\n", ++s }' >signal.lst
22213 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22215 chmod a+x signal_cmd
22216 $eunicefix signal_cmd
22220 : generate list of signal names
22221 case "$sig_num_init" in
22224 case "$sig_name_init" in
22226 *) case "$sig_num_init" in
22227 ''|*,*) doinit=yes ;;
22232 echo "Generating a list of signal names and numbers..." >&4
22234 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22235 sig_name=`$awk 'BEGIN { printf "ZERO " }
22236 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22237 sig_num=`$awk 'BEGIN { printf "0 " }
22238 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22239 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22240 !/^NSIG/ { printf "\"%s\", ", $1 }
22241 END { printf "0\n" }' signal.lst`
22242 sig_num_init=`$awk 'BEGIN { printf "0, " }
22243 !/^NSIG/ { printf "%d, ", $2}
22244 END { printf "0\n"}' signal.lst`
22247 echo "The following $sig_count signals are available:"
22249 echo $sig_name | $awk \
22250 'BEGIN { linelen = 0 }
22252 for (i = 1; i <= NF; i++) {
22253 name = "SIG" $i " "
22254 linelen = linelen + length(name)
22255 if (linelen > 70) {
22257 linelen = length(name)
22263 sig_size=`echo $sig_name | awk '{print NF}'`
22264 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22268 : Check size of size
22270 case "$sizetype" in
22271 *_t) zzz="$sizetype" ;;
22272 *) zzz="filesize" ;;
22274 echo "Checking the size of $zzz..." >&4
22276 #include <sys/types.h>
22278 #$i_stdlib I_STDLIB
22280 #include <stdlib.h>
22283 printf("%d\n", (int)sizeof($sizetype));
22288 if eval $compile_ok; then
22292 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22295 echo "Your $zzz size is $sizesize bytes."
22300 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22303 : check for socklen_t
22305 echo "Checking to see if you have socklen_t..." >&4
22307 #include <sys/types.h>
22308 #$d_socket HAS_SOCKET
22310 #include <sys/socket.h>
22312 int main() { socklen_t x = 16; }
22315 if eval $compile; then
22317 echo "You have socklen_t."
22320 echo "You do not have socklen_t."
22321 case "$sizetype" in
22322 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22329 : see if this is a socks.h system
22330 set socks.h i_socks
22333 : check for type of the size argument to socket calls
22334 case "$d_socket" in
22338 Checking to see what type is the last argument of accept().
22341 case "$d_socklen_t" in
22342 "$define") yyy="$yyy socklen_t"
22344 yyy="$yyy $sizetype int long unsigned"
22345 for xxx in $yyy; do
22346 case "$socksizetype" in
22347 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22348 case "$usesocks" in
22350 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22351 echo "Your system accepts '$xxx *' for the last argument of accept()."
22352 socksizetype="$xxx"
22355 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22356 echo "Your system accepts '$xxx *' for the last argument of accept()."
22357 socksizetype="$xxx"
22364 : In case none of those worked, prompt the user.
22365 case "$socksizetype" in
22366 '') rp='What is the type for socket address structure sizes?'
22373 *) : no sockets, so pick relatively harmless default
22378 : see what type is used for signed size_t
22379 set ssize_t ssizetype int stdio.h sys/types.h
22384 #$i_stdlib I_STDLIB
22386 #include <stdlib.h>
22388 #include <sys/types.h>
22389 #define Size_t $sizetype
22390 #define SSize_t $dflt
22393 if (sizeof(Size_t) == sizeof(SSize_t))
22395 else if (sizeof(Size_t) == sizeof(int))
22404 if eval $compile_ok && $run ./try > /dev/null; then
22405 ssizetype=`$run ./try`
22406 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22409 Help! I can't compile and run the ssize_t test program: please enlighten me!
22410 (This is probably a misconfiguration in your system or libraries, and
22411 you really ought to fix it. Still, I'll try anyway.)
22413 I need a type that is the same size as $sizetype, but is guaranteed to
22414 be signed. Common values are ssize_t, int and long.
22417 rp="What signed type is the same size as $sizetype?"
22423 : Check the size of st_ino
22425 $echo "Checking the size of st_ino..." >&4
22426 $cat > try.c <<EOCP
22427 #include <sys/stat.h>
22429 #$i_stdlib I_STDLIB
22431 #include <stdlib.h>
22435 printf("%d\n", (int)sizeof(st.st_ino));
22440 if eval $compile_ok; then
22444 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22446 *) st_ino_size=$val
22447 $echo "Your st_ino is $st_ino_size bytes long."
22452 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22456 : Check if st_ino is signed
22458 $echo "Checking the sign of st_ino..." >&4
22459 $cat > try.c <<EOCP
22460 #include <sys/stat.h>
22465 if (foo.st_ino < 0)
22472 if eval $compile; then
22476 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22478 *) st_ino_sign=$val
22479 case "$st_ino_sign" in
22480 1) $echo "Your st_ino is unsigned." ;;
22481 -1) $echo "Your st_ino is signed." ;;
22487 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22491 : see what type of char stdio uses.
22493 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22494 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22495 echo "Your stdio uses unsigned chars." >&4
22496 stdchar="unsigned char"
22498 echo "Your stdio uses signed chars." >&4
22503 : Check size of UID
22506 *_t) zzz="$uidtype" ;;
22509 echo "Checking the size of $zzz..." >&4
22511 #include <sys/types.h>
22513 #$i_stdlib I_STDLIB
22515 #include <stdlib.h>
22518 printf("%d\n", (int)sizeof($uidtype));
22523 if eval $compile_ok; then
22527 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22530 echo "Your $zzz is $uidsize bytes long."
22535 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22538 : Check if UID is signed
22541 *_t) zzz="$uidtype" ;;
22544 echo "Checking the sign of $zzz..." >&4
22546 #include <sys/types.h>
22557 if eval $compile; then
22561 echo "(I can't execute the test program--guessing unsigned.)" >&4
22565 1) echo "Your $zzz is unsigned." ;;
22566 -1) echo "Your $zzz is signed." ;;
22572 echo "(I can't compile the test program--guessing unsigned.)" >&4
22575 : Check format string for UID
22577 $echo "Checking the format string to be used for uids..." >&4
22580 -1) if $test X"$uidsize" = X"$ivsize"; then
22581 uidformat="$ivdformat"
22583 if $test X"$uidsize" = X"$longsize"; then
22586 if $test X"$uidsize" = X"$intsize"; then
22589 if $test X"$uidsize" = X"$shortsize"; then
22596 *) if $test X"$uidsize" = X"$uvsize"; then
22597 uidformat="$uvuformat"
22599 if $test X"$uidsize" = X"$longsize"; then
22602 if $test X"$uidsize" = X"$intsize"; then
22605 if $test X"$uidsize" = X"$shortsize"; then
22614 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22616 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22617 $cat >try.c <<'EOM'
22618 /* Intentionally a long probe as I'd like to sanity check that the exact
22619 approach is going to work, as thinking it will work, but only having it
22620 part working at runtime is worse than not having it. */
22622 #include <sys/types.h>
22623 #include <sys/sysctl.h>
22624 #include <sys/param.h>
22626 #include <string.h>
22627 #include <stdlib.h>
22628 #include <unistd.h>
22631 main(int argc, char **argv) {
22633 char *argv_leaf = strrchr(argv[0], '/');
22639 mib[1] = KERN_PROC;
22640 mib[2] = KERN_PROC_PATHNAME;
22644 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22648 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22653 if (size < strlen(argv_leaf) + 1) {
22654 fprintf(stderr, "size %lu is too short for a path\n",
22655 (unsigned long) size);
22659 if (size > MAXPATHLEN * MAXPATHLEN) {
22660 fprintf(stderr, "size %lu is too long for a path\n",
22661 (unsigned long) size);
22665 buffer = (char *)malloc(size);
22671 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22676 if (strlen(buffer) + 1 != size) {
22677 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22678 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22683 if (*buffer != '/') {
22684 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22688 if (strstr(buffer, "/./")) {
22689 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22693 if (strstr(buffer, "/../")) {
22694 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22698 buffer_leaf = strrchr(buffer, '/');
22699 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22700 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22712 if eval $compile; then
22713 if $run ./try; then
22714 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22717 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22721 echo "I'm unable to compile the test program." >&4
22722 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22726 set usekernprocpathname
22729 : Determine if we can use _NSGetExecutablePath to find executing program
22731 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22732 $cat >try.c <<'EOM'
22733 /* Intentionally a long probe as I'd like to sanity check that the exact
22734 approach is going to work, as thinking it will work, but only having it
22735 part working at runtime is worse than not having it. */
22736 #include <mach-o/dyld.h>
22738 #include <stdlib.h>
22739 #include <sys/param.h>
22740 #include <string.h>
22743 main(int argc, char **argv) {
22745 uint32_t size = sizeof(buf);
22749 char *argv_leaf = strrchr(argv[0], '/');
22753 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22757 _NSGetExecutablePath(buf, &size);
22758 if (size > MAXPATHLEN * MAXPATHLEN) {
22759 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22760 (unsigned int) size);
22764 buffer = (char *)malloc(size);
22770 result = _NSGetExecutablePath(buffer, &size);
22772 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22773 result, (unsigned int) size);
22777 tidied = realpath(buffer, NULL);
22779 perror("realpath");
22785 if (*tidied != '/') {
22786 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22790 if (strstr(tidied, "/./")) {
22791 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22795 if (strstr(tidied, "/../")) {
22796 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22800 tidied_leaf = strrchr(tidied, '/');
22801 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22802 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22814 if eval $compile; then
22815 if $run ./try; then
22816 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22819 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22822 echo "I'm unable to compile the test program." >&4
22823 echo "I'll assume no _NSGetExecutablePath here." >&4
22826 set usensgetexecutablepath
22829 : Check if site customization support was requested
22830 case "$usesitecustomize" in
22831 $define|true|[Yy]*)
22832 usesitecustomize="$define"
22835 usesitecustomize="$undef"
22839 : determine compiler compiler
22848 if $test -f "$byacc$_exe"; then
22850 comp="byacc or $comp"
22852 if $test -f "$bison$_exe"; then
22853 comp="$comp or bison -y"
22855 rp="Which compiler compiler ($comp) shall I use?"
22864 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22870 : see if this is a bfd.h system
22874 : see if this is an execinfo.h system
22875 set execinfo.h i_execinfo
22878 : see if this is a fenv.h system
22882 : see if this is a fp.h system
22886 : see if this is a fp_class.h system
22887 set fp_class.h i_fp_class
22890 : see if gdbm.h is available
22895 : see if gdbm_open exists
22896 set gdbm_open d_gdbm_open
22898 case "$d_gdbm_open" in
22901 echo "We won't be including <gdbm.h>"
22910 : see if this is a ieeefp.h system
22911 case "$i_ieeefp" in
22912 '' ) set ieeefp.h i_ieeefp
22917 : see if this is a libutil.h system
22918 set libutil.h i_libutil
22921 : see if mach cthreads are available
22922 if test "X$usethreads" = "X$define"; then
22923 set mach/cthreads.h i_machcthr
22926 i_machcthr="$undef"
22929 : see if this is a mntent.h system
22930 set mntent.h i_mntent
22933 : see if net/errno.h is available
22935 set net/errno.h val
22938 : Unfortunately, it causes problems on some systems. Arrgh.
22941 cat > try.c <<'EOM'
22944 #include <net/errno.h>
22950 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22951 echo "We'll be including <net/errno.h>." >&4
22953 echo "We won't be including <net/errno.h>." >&4
22962 : see if netinet/tcp.h is available
22963 set netinet/tcp.h i_netinettcp
22966 : see if this is a poll.h system
22970 : see if this is a prot.h system
22974 : Preprocessor symbols
22976 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22977 $cat <<'EOSH' > Cppsym.know
22978 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22979 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22980 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22981 arch_pwr ardent ARM ARM32 atarist att386 att3b
22982 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22983 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22984 byteorder byte_order
22985 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22986 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22987 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22988 ELF encore EPI EXTENSIONS
22989 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22990 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22991 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22992 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22993 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22994 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22995 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22996 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22997 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22999 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23000 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23001 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23003 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23004 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23005 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23006 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23007 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23008 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23009 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23010 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23011 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23012 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23013 ns32000 ns32016 ns32332 ns32k nsc32000
23014 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23015 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23016 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23017 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23019 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23020 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23021 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23022 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23023 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23024 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23025 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23026 SYSV4 SYSV5 sysV68 sysV88
23027 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23028 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23029 tower32_800 tower32_850 tss
23030 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23031 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23032 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23033 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23034 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23035 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23037 vax venix VMESA vms
23038 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23039 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23042 # Maybe put other stuff here too.
23043 ./tr '-' '_' <<EOSH >>Cppsym.know
23046 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23047 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23048 $cat Cppsym.know > Cppsym.c
23049 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23050 $rm -f Cppsym.a Cppsym.b Cppsym.c
23051 cat <<EOSH > Cppsym
23053 if $test \$# -gt 0; then
23054 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23055 if $test -s Cppsym.got; then
23062 $tr " " "$trnl" | ./Cppsym.try
23068 cat <<EOSH > Cppsym.try
23070 cat <<'EOCP' > try.c
23073 #define STRINGIFY(a) "a"
23075 #if cpp_stuff == 42
23076 #define StGiFy(a) #a
23077 #define STRINGIFY(a) StGiFy(a)
23079 #if $cpp_stuff != 1 && $cpp_stuff != 42
23080 # include "Bletch: How does this C preprocessor stringify macros?"
23086 cat <<'EOSH' >> Cppsym.try
23088 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23089 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23090 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23091 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23093 echo 'return 0;}' >> try.c
23095 cat <<EOSH >> Cppsym.try
23097 case "$osname-$gccversion" in
23098 irix-) ccflags="\$ccflags -woff 1178" ;;
23099 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23101 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23103 chmod +x Cppsym.try
23104 $eunicefix Cppsym.try
23105 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23106 : Add in any Linux cpp "predefined macros":
23107 case "$osname::$gccversion" in
23108 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23110 rm -f $tHdrH'.h' $tHdrH
23112 # Filter out macro arguments, such as Linux's __INT8_C(c)
23113 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23114 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23115 if [ -s $tHdrH'_cppsym.real' ]; then
23116 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23119 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23122 : now check the C compiler for additional symbols
23123 postprocess_cc_v=''
23125 aix) postprocess_cc_v="|$tr , ' '" ;;
23132 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23135 -D*) echo "\$i" | $sed 's/^-D//';;
23136 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23141 postprocess_cc_v=''
23144 ./ccsym > ccsym1.raw
23145 if $test -s ccsym1.raw; then
23146 $sort ccsym1.raw | $uniq >ccsym.raw
23148 mv ccsym1.raw ccsym.raw
23151 $awk '/\=/ { print $0; next }
23152 { print $0"=1" }' ccsym.raw >ccsym.list
23153 $comm -13 Cppsym.true ccsym.list >ccsym.own
23154 $comm -12 Cppsym.true ccsym.list >ccsym.com
23155 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23157 if $test -z ccsym.raw; then
23158 echo "Your C compiler doesn't seem to define any symbols!" >&4
23160 echo "However, your C preprocessor defines the following symbols:"
23163 cppsymbols=`$cat Cppsym.true`
23164 cppsymbols=`echo $cppsymbols`
23165 cppccsymbols="$cppsymbols"
23167 if $test -s ccsym.com; then
23168 echo "Your C compiler and pre-processor define these symbols:"
23169 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23172 cppccsymbols=`$cat ccsym.com`
23173 cppccsymbols=`echo $cppccsymbols`
23174 $test "$silent" || sleep 1
23176 if $test -s ccsym.cpp; then
23177 $test "$also" && echo " "
23178 echo "Your C pre-processor ${also}defines the following symbols:"
23179 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23181 cppsymbols=`$cat ccsym.cpp`
23182 cppsymbols=`echo $cppsymbols`
23183 $test "$silent" || sleep 1
23185 if $test -s ccsym.own; then
23186 $test "$also" && echo " "
23187 echo "Your C compiler ${also}defines the following cpp symbols:"
23188 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23189 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23190 ccsymbols=`$cat ccsym.own`
23191 ccsymbols=`echo $ccsymbols`
23192 $test "$silent" || sleep 1
23196 : add -D_FORTIFY_SOURCE if feasible and not already there
23197 case "$gccversion" in
23198 [456789].*) case "$optimize$ccflags" in
23199 *-O*) case "$ccflags$cppsymbols" in
23200 *_FORTIFY_SOURCE=*) # Don't add it again.
23201 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23203 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23204 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23208 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23212 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23216 : script used to emit important warnings
23219 if test \$# -gt 0; then
23224 echo "*** WARNING:" >&4
23225 sed -e 's/^/*** /' <msg >&4
23227 cat msg >>config.msg
23228 echo " " >>config.msg
23234 : see if this is a termio system
23238 if $test `./findhdr termios.h`; then
23239 set tcsetattr i_termios
23245 "$define") echo "You have POSIX termios.h... good!" >&4;;
23246 *) if ./Cppsym pyr; then
23247 case "`$run /bin/universe`" in
23248 ucb) if $test `./findhdr sgtty.h`; then
23250 echo "<sgtty.h> found." >&4
23252 echo "System is pyramid with BSD universe."
23253 ./warn "<sgtty.h> not found--you could have problems."
23255 *) if $test `./findhdr termio.h`; then
23257 echo "<termio.h> found." >&4
23259 echo "System is pyramid with USG universe."
23260 ./warn "<termio.h> not found--you could have problems."
23264 if $test `./findhdr termio.h`; then
23265 echo "<termio.h> found." >&4
23267 elif $test `./findhdr sgtty.h`; then
23268 echo "<sgtty.h> found." >&4
23271 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23274 if $test `./findhdr sgtty.h`; then
23275 echo "<sgtty.h> found." >&4
23277 elif $test `./findhdr termio.h`; then
23278 echo "<termio.h> found." >&4
23281 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23285 set i_termio; eval $setvar
23286 val=$val2; set i_sgtty; eval $setvar
23287 val=$val3; set i_termios; eval $setvar
23289 : see if stdbool is available
23290 : we want a real compile instead of Inhdr because some Solaris systems
23291 : have stdbool.h, but it can only be used if the compiler indicates it
23292 : is sufficiently c99-compliant.
23296 #include <stdbool.h>
23301 int main(int argc, char **argv)
23307 if eval $compile; then
23308 echo "<stdbool.h> found." >&4
23311 echo "<stdbool.h> NOT found." >&4
23318 : see if stdint is available
23319 set stdint.h i_stdint
23322 : see if sys/access.h is available
23323 set sys/access.h i_sysaccess
23326 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23327 set sys/filio.h i_sysfilio
23330 if $test `./findhdr sys/ioctl.h`; then
23332 echo '<sys/ioctl.h> found.' >&4
23335 if $test $i_sysfilio = "$define"; then
23336 echo '<sys/ioctl.h> NOT found.' >&4
23338 $test $i_sgtty = "$define" && xxx="sgtty.h"
23339 $test $i_termio = "$define" && xxx="termio.h"
23340 $test $i_termios = "$define" && xxx="termios.h"
23341 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23347 : see if socket ioctl defs are in sys/sockio.h
23349 xxx=`./findhdr sys/sockio.h`
23350 if $test "$xxx"; then
23351 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23353 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23356 echo "No socket ioctls found in <sys/sockio.h>." >&4
23361 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23367 : see if this is a syslog.h system
23368 set syslog.h i_syslog
23371 : see if this is a sys/mode.h system
23372 set sys/mode.h i_sysmode
23375 : see if there is a sys/poll.h file
23376 set sys/poll.h i_syspoll
23379 : see if sys/resource.h has to be included
23380 set sys/resource.h i_sysresrc
23383 : see if sys/security.h is available
23384 set sys/security.h i_syssecrt
23387 : see if this is a sys/statvfs.h system
23388 set sys/statvfs.h i_sysstatvfs
23391 : see if this is a sys/un.h system
23392 set sys/un.h i_sysun
23395 : see if this is a sys/utsname.h system
23396 set sys/utsname.h i_sysutsname
23399 : see if this is a syswait system
23400 set sys/wait.h i_syswait
23403 : see if this is a ustat.h system
23404 set ustat.h i_ustat
23407 : see if this is an utime system
23408 set utime.h i_utime
23411 : see if this is a vfork system
23414 set vfork.h i_vfork
23422 : see if wchar.h is present
23423 set wchar.h i_wchar
23428 echo "Looking for extensions..." >&4
23429 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23430 : contain old or inaccurate or duplicate values.
23431 nonxs_extensions=''
23433 : We do not use find because it might not be available.
23434 : We do not just use MANIFEST because the user may have dropped
23435 : some additional extensions into the source tree and expect them
23438 : Function to recursively find available extensions, ignoring DynaLoader
23439 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23440 : In 5.10.1 and later, extensions are stored in directories
23441 : like File-Glob instead of the older File/Glob/.
23445 DynaLoader|dynaload) ;;
23447 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23448 case "$this_ext" in
23449 Scalar/List/Utils) this_ext="List/Util" ;;
23450 PathTools) this_ext="Cwd" ;;
23452 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23453 if $contains " $this_ext " "$tdir/$$.tmp"; then
23455 echo "Duplicate directories detected for extension $xxx" >&4;
23456 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23457 case "$knowitall" in
23465 echo "Ok. Stopping Configure." >&4;
23466 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23469 echo "Ok. You will need to correct config.sh before running make." >&4;
23471 $ls -1 "$xxx" > "$tdir/$$.tmp";
23472 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23473 xs_extensions="$xs_extensions $this_ext";
23474 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23475 xs_extensions="$xs_extensions $this_ext";
23476 elif $test -d "$xxx"; then
23477 nonxs_extensions="$nonxs_extensions $this_ext";
23479 $rm -f "$tdir/$$.tmp";
23487 eval $find_extensions
23491 eval $find_extensions
23495 eval $find_extensions
23496 set X $xs_extensions
23498 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23499 set X $nonxs_extensions
23501 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23503 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23505 : Now see which are supported on this system.
23507 for xxx in $xs_extensions ; do
23511 amigaos) avail_ext="$avail_ext $xxx" ;;
23516 $define) avail_ext="$avail_ext $xxx" ;;
23519 GDBM_File|gdbm_fil)
23521 $define) avail_ext="$avail_ext $xxx" ;;
23525 : XXX Do we need a useipcsysv variable here
23526 case "${d_msg}${d_sem}${d_shm}" in
23527 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23530 NDBM_File|ndbm_fil)
23533 case "$osname-$use64bitint" in
23536 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23539 *) avail_ext="$avail_ext $xxx" ;;
23544 ODBM_File|odbm_fil)
23545 case "${i_dbm}${i_rpcsvcdbm}" in
23547 case "$d_cplusplus" in
23548 define) ;; # delete as a function name will not work
23549 *) case "$osname-$use64bitint" in
23552 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23555 *) avail_ext="$avail_ext $xxx" ;;
23563 case "$useopcode" in
23564 true|define|y) avail_ext="$avail_ext $xxx" ;;
23568 case "$useposix" in
23569 true|define|y) avail_ext="$avail_ext $xxx" ;;
23573 case "$d_socket" in
23574 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23577 I18N/Langinfo|langinfo)
23578 case "$uselanginfo" in
23579 true|define|y) avail_ext="$avail_ext $xxx" ;;
23582 Sys/Syslog|sys/syslog)
23584 amigaos) ;; # not really very useful on AmigaOS
23586 : XXX syslog requires socket
23587 case "$d_socket" in
23588 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23594 case "$usethreads" in
23596 case "$use5005threads" in
23597 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23601 threads|threads/shared)
23602 # threads and threads::shared are special cases.
23603 # To stop people from asking "Perl 5.8.0 was supposed
23604 # to have this new fancy threads implementation but my
23605 # perl doesn't have it" and from people trying to
23606 # (re)install the threads module using CPAN.pm and
23607 # CPAN.pm then offering to reinstall Perl 5.8.0,
23608 # the threads.pm and threads/shared.pm will always be
23609 # there, croaking informatively ("you need to rebuild
23610 # all of Perl with threads, sorry") when threads haven't
23611 # been compiled in.
23613 avail_ext="$avail_ext $xxx"
23619 cygwin) avail_ext="$avail_ext $xxx" ;;
23622 XS/APItest|xs/apitest)
23623 # This is just for testing. Skip it unless we have dynamic loading.
23626 $define) avail_ext="$avail_ext $xxx" ;;
23629 XS/Typemap|xs/typemap)
23630 # This is just for testing. Skip it unless we have dynamic loading.
23632 $define) avail_ext="$avail_ext $xxx" ;;
23635 *) avail_ext="$avail_ext $xxx"
23644 case "$onlyextensions" in
23646 *) keepextensions=''
23647 echo "You have requested that only certain extensions be included..." >&4
23648 for i in $onlyextensions; do
23649 case " $avail_ext " in
23651 echo "Keeping extension $i."
23652 keepextensions="$keepextensions $i"
23654 *) echo "Ignoring extension $i." ;;
23657 avail_ext="$keepextensions"
23661 case "$noextensions" in
23663 *) keepextensions=''
23664 echo "You have requested that certain extensions be ignored..." >&4
23665 for i in $avail_ext; do
23666 case " $noextensions " in
23667 *" $i "*) echo "Ignoring extension $i." ;;
23668 *) echo "Keeping extension $i.";
23669 keepextensions="$keepextensions $i"
23673 avail_ext="$keepextensions"
23677 : Now see which nonxs extensions are supported on this system.
23678 : For now assume all are.
23680 for xxx in $nonxs_extensions ; do
23684 *) nonxs_ext="$nonxs_ext $xxx"
23696 A number of extensions are supplied with $package. You may choose to
23697 compile these extensions for dynamic loading (the default), compile
23698 them into the $package executable (static loading), or not include
23699 them at all. Answer "none" to include no extensions.
23700 Note that DynaLoader is always built and need not be mentioned here.
23703 case "$dynamic_ext" in
23705 : Exclude those listed in static_ext
23707 for xxx in $avail_ext; do
23708 case " $static_ext " in
23710 *) dflt="$dflt $xxx" ;;
23717 *) dflt="$dynamic_ext"
23718 # Perhaps we are reusing an old out-of-date config.sh.
23721 if test X"$dynamic_ext" != X"$avail_ext"; then
23723 NOTICE: Your previous config.sh list may be incorrect.
23724 The extensions now available to you are
23726 but the default list from your previous config.sh is
23738 rp="What extensions do you wish to load dynamically?"
23741 none) dynamic_ext=' ' ;;
23742 *) dynamic_ext="$ans" ;;
23745 case "$static_ext" in
23747 : Exclude those already listed in dynamic linking
23749 for xxx in $avail_ext; do
23750 case " $dynamic_ext " in
23752 *) dflt="$dflt $xxx" ;;
23759 *) dflt="$static_ext"
23766 rp="What extensions do you wish to load statically?"
23769 none) static_ext=' ' ;;
23770 *) static_ext="$ans" ;;
23775 A number of extensions are supplied with $package. Answer "none"
23776 to include no extensions.
23777 Note that DynaLoader is always built and need not be mentioned here.
23780 case "$static_ext" in
23781 '') dflt="$avail_ext" ;;
23782 *) dflt="$static_ext"
23783 # Perhaps we are reusing an old out-of-date config.sh.
23786 if test X"$static_ext" != X"$avail_ext"; then
23788 NOTICE: Your previous config.sh list may be incorrect.
23789 The extensions now available to you are
23791 but the default list from your previous config.sh is
23800 : Exclude those that are not xs extensions
23804 rp="What extensions do you wish to include?"
23807 none) static_ext=' ' ;;
23808 *) static_ext="$ans" ;;
23813 # Encode is a special case. If we are building Encode as a static
23814 # extension, we need to explicitly list its subextensions as well.
23815 # For other nested extensions, this is handled automatically by
23816 # the appropriate Makefile.PL.
23817 case " $static_ext " in
23818 *" Encode "*) # Add the subextensions of Encode
23820 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23821 static_ext="$static_ext Encode/$xxx"
23822 known_extensions="$known_extensions Encode/$xxx"
23828 set X $dynamic_ext $static_ext $nonxs_ext
23832 # Sanity check: We require an extension suitable for use with
23833 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23834 # should show up as failures in the test suite, but it's helpful to
23835 # catch them now.) The 'extensions' list is normally sorted
23836 # alphabetically, so we need to accept either
23837 # DB_File ... Fcntl ... IO ....
23838 # or something like
23839 # Fcntl ... NDBM_File ... IO ....
23840 case " $extensions" in
23841 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23842 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23843 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23844 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23845 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23849 : Remove libraries needed only for extensions
23850 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23851 : The exception is SunOS 4.x, which needs them.
23852 case "${osname}X${osvers}" in
23856 *) case "$usedl" in
23857 $define|true|[yY]*)
23858 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23862 *) perllibs="$libs"
23868 : Remove build directory name from cppstdin so it can be used from
23869 : either the present location or the final installed location.
23871 : Get out of the UU directory to get correct path name.
23873 case "$cppstdin" in
23875 echo "Stripping down cppstdin path name"
23881 : end of configuration questions
23883 echo "End of configuration questions."
23886 : back to where it started
23887 if test -d ../UU; then
23891 : configuration may be unconditionally patched via a 'config.arch' file
23892 if $test -f config.arch; then
23893 echo "I see a config.arch file, loading it." >&4
23897 : configuration may be patched via a 'config.over' file
23898 if $test -f config.over; then
23901 rp='I see a config.over file. Do you wish to load it?'
23904 n*) echo "OK, I'll ignore it.";;
23906 echo "Configuration override changes have been loaded."
23911 : in case they want portability, strip down executable paths
23912 case "$d_portable" in
23915 echo "Stripping down executable paths..." >&4
23916 for file in $loclist $trylist; do
23918 eval $file=`basename $temp`
23923 : create config.sh file
23925 echo "Creating config.sh..." >&4
23926 $spitshell <<EOT >config.sh
23929 # This file was produced by running the Configure script. It holds all the
23930 # definitions figured out by Configure. Should you modify one of these values,
23931 # do not forget to propagate your changes by running "Configure -der". You may
23932 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23935 # Package name : $package
23936 # Source directory : $src
23937 # Configuration time: $cf_time
23938 # Configured by : $cf_by
23939 # Target system : $myuname
23942 : Add in command line options if available
23943 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23945 $spitshell <<EOT >>config.sh
23954 Revision='$Revision'
23962 alignbytes='$alignbytes'
23963 aphostname='$aphostname'
23964 api_revision='$api_revision'
23965 api_subversion='$api_subversion'
23966 api_version='$api_version'
23967 api_versionstring='$api_versionstring'
23970 archlibexp='$archlibexp'
23971 archname64='$archname64'
23972 archname='$archname'
23973 archobjs='$archobjs'
23974 asctime_r_proto='$asctime_r_proto'
23983 byteorder='$byteorder'
23985 castflags='$castflags'
23988 cccdlflags='$cccdlflags'
23989 ccdlflags='$ccdlflags'
23991 ccflags_uselargefiles='$ccflags_uselargefiles'
23993 ccsymbols='$ccsymbols'
23994 ccversion='$ccversion'
23996 cf_email='$cf_email'
23998 charbits='$charbits'
23999 charsize='$charsize'
24003 clocktype='$clocktype'
24005 compress='$compress'
24006 contains='$contains'
24010 cpp_stuff='$cpp_stuff'
24011 cppccsymbols='$cppccsymbols'
24012 cppflags='$cppflags'
24014 cppminus='$cppminus'
24016 cppstdin='$cppstdin'
24017 cppsymbols='$cppsymbols'
24018 crypt_r_proto='$crypt_r_proto'
24019 cryptlib='$cryptlib'
24021 ctermid_r_proto='$ctermid_r_proto'
24022 ctime_r_proto='$ctime_r_proto'
24023 d_Gconvert='$d_Gconvert'
24024 d_PRIEUldbl='$d_PRIEUldbl'
24025 d_PRIFUldbl='$d_PRIFUldbl'
24026 d_PRIGUldbl='$d_PRIGUldbl'
24027 d_PRIXU64='$d_PRIXU64'
24028 d_PRId64='$d_PRId64'
24029 d_PRIeldbl='$d_PRIeldbl'
24030 d_PRIfldbl='$d_PRIfldbl'
24031 d_PRIgldbl='$d_PRIgldbl'
24032 d_PRIi64='$d_PRIi64'
24033 d_PRIo64='$d_PRIo64'
24034 d_PRIu64='$d_PRIu64'
24035 d_PRIx64='$d_PRIx64'
24036 d_SCNfldbl='$d_SCNfldbl'
24037 d__fwalk='$d__fwalk'
24038 d_accept4='$d_accept4'
24039 d_access='$d_access'
24040 d_accessx='$d_accessx'
24044 d_archlib='$d_archlib'
24045 d_asctime64='$d_asctime64'
24046 d_asctime_r='$d_asctime_r'
24051 d_attribute_deprecated='$d_attribute_deprecated'
24052 d_attribute_format='$d_attribute_format'
24053 d_attribute_malloc='$d_attribute_malloc'
24054 d_attribute_nonnull='$d_attribute_nonnull'
24055 d_attribute_noreturn='$d_attribute_noreturn'
24056 d_attribute_pure='$d_attribute_pure'
24057 d_attribute_unused='$d_attribute_unused'
24058 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24059 d_backtrace='$d_backtrace'
24061 d_bsdgetpgrp='$d_bsdgetpgrp'
24062 d_bsdsetpgrp='$d_bsdsetpgrp'
24063 d_builtin_add_overflow='$d_builtin_add_overflow'
24064 d_builtin_choose_expr='$d_builtin_choose_expr'
24065 d_builtin_expect='$d_builtin_expect'
24066 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24067 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24068 d_c99_variadic_macros='$d_c99_variadic_macros'
24069 d_casti32='$d_casti32'
24070 d_castneg='$d_castneg'
24073 d_chroot='$d_chroot'
24074 d_chsize='$d_chsize'
24076 d_clearenv='$d_clearenv'
24077 d_closedir='$d_closedir'
24078 d_cmsghdr_s='$d_cmsghdr_s'
24079 d_copysign='$d_copysign'
24080 d_copysignl='$d_copysignl'
24081 d_cplusplus='$d_cplusplus'
24083 d_crypt_r='$d_crypt_r'
24085 d_ctermid='$d_ctermid'
24086 d_ctermid_r='$d_ctermid_r'
24087 d_ctime64='$d_ctime64'
24088 d_ctime_r='$d_ctime_r'
24089 d_cuserid='$d_cuserid'
24090 d_dbminitproto='$d_dbminitproto'
24091 d_difftime64='$d_difftime64'
24092 d_difftime='$d_difftime'
24093 d_dir_dd_fd='$d_dir_dd_fd'
24095 d_dirnamlen='$d_dirnamlen'
24096 d_dladdr='$d_dladdr'
24097 d_dlerror='$d_dlerror'
24098 d_dlopen='$d_dlopen'
24099 d_dlsymun='$d_dlsymun'
24100 d_dosuid='$d_dosuid'
24101 d_double_has_inf='$d_double_has_inf'
24102 d_double_has_nan='$d_double_has_nan'
24103 d_double_has_negative_zero='$d_double_has_negative_zero'
24104 d_double_has_subnormals='$d_double_has_subnormals'
24105 d_double_style_cray='$d_double_style_cray'
24106 d_double_style_ibm='$d_double_style_ibm'
24107 d_double_style_ieee='$d_double_style_ieee'
24108 d_double_style_vax='$d_double_style_vax'
24109 d_drand48_r='$d_drand48_r'
24110 d_drand48proto='$d_drand48proto'
24113 d_duplocale='$d_duplocale'
24114 d_eaccess='$d_eaccess'
24115 d_endgrent='$d_endgrent'
24116 d_endgrent_r='$d_endgrent_r'
24117 d_endhent='$d_endhent'
24118 d_endhostent_r='$d_endhostent_r'
24119 d_endnent='$d_endnent'
24120 d_endnetent_r='$d_endnetent_r'
24121 d_endpent='$d_endpent'
24122 d_endprotoent_r='$d_endprotoent_r'
24123 d_endpwent='$d_endpwent'
24124 d_endpwent_r='$d_endpwent_r'
24125 d_endsent='$d_endsent'
24126 d_endservent_r='$d_endservent_r'
24127 d_eofnblk='$d_eofnblk'
24130 d_eunice='$d_eunice'
24133 d_faststdio='$d_faststdio'
24134 d_fchdir='$d_fchdir'
24135 d_fchmod='$d_fchmod'
24136 d_fchmodat='$d_fchmodat'
24137 d_fchown='$d_fchown'
24139 d_fcntl_can_lock='$d_fcntl_can_lock'
24140 d_fd_macros='$d_fd_macros'
24141 d_fd_set='$d_fd_set'
24142 d_fdclose='$d_fdclose'
24144 d_fds_bits='$d_fds_bits'
24145 d_fegetround='$d_fegetround'
24146 d_fgetpos='$d_fgetpos'
24147 d_finite='$d_finite'
24148 d_finitel='$d_finitel'
24149 d_flexfnam='$d_flexfnam'
24151 d_flockproto='$d_flockproto'
24156 d_fp_class='$d_fp_class'
24157 d_fp_classify='$d_fp_classify'
24158 d_fp_classl='$d_fp_classl'
24159 d_fpathconf='$d_fpathconf'
24160 d_fpclass='$d_fpclass'
24161 d_fpclassify='$d_fpclassify'
24162 d_fpclassl='$d_fpclassl'
24163 d_fpgetround='$d_fpgetround'
24164 d_fpos64_t='$d_fpos64_t'
24165 d_freelocale='$d_freelocale'
24166 d_frexpl='$d_frexpl'
24167 d_fs_data_s='$d_fs_data_s'
24168 d_fseeko='$d_fseeko'
24169 d_fsetpos='$d_fsetpos'
24170 d_fstatfs='$d_fstatfs'
24171 d_fstatvfs='$d_fstatvfs'
24173 d_ftello='$d_ftello'
24175 d_futimes='$d_futimes'
24176 d_gai_strerror='$d_gai_strerror'
24177 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24178 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24179 d_getaddrinfo='$d_getaddrinfo'
24180 d_getcwd='$d_getcwd'
24181 d_getespwnam='$d_getespwnam'
24182 d_getfsstat='$d_getfsstat'
24183 d_getgrent='$d_getgrent'
24184 d_getgrent_r='$d_getgrent_r'
24185 d_getgrgid_r='$d_getgrgid_r'
24186 d_getgrnam_r='$d_getgrnam_r'
24187 d_getgrps='$d_getgrps'
24188 d_gethbyaddr='$d_gethbyaddr'
24189 d_gethbyname='$d_gethbyname'
24190 d_gethent='$d_gethent'
24191 d_gethname='$d_gethname'
24192 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24193 d_gethostbyname_r='$d_gethostbyname_r'
24194 d_gethostent_r='$d_gethostent_r'
24195 d_gethostprotos='$d_gethostprotos'
24196 d_getitimer='$d_getitimer'
24197 d_getlogin='$d_getlogin'
24198 d_getlogin_r='$d_getlogin_r'
24199 d_getmnt='$d_getmnt'
24200 d_getmntent='$d_getmntent'
24201 d_getnameinfo='$d_getnameinfo'
24202 d_getnbyaddr='$d_getnbyaddr'
24203 d_getnbyname='$d_getnbyname'
24204 d_getnent='$d_getnent'
24205 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24206 d_getnetbyname_r='$d_getnetbyname_r'
24207 d_getnetent_r='$d_getnetent_r'
24208 d_getnetprotos='$d_getnetprotos'
24209 d_getpagsz='$d_getpagsz'
24210 d_getpbyname='$d_getpbyname'
24211 d_getpbynumber='$d_getpbynumber'
24212 d_getpent='$d_getpent'
24213 d_getpgid='$d_getpgid'
24214 d_getpgrp2='$d_getpgrp2'
24215 d_getpgrp='$d_getpgrp'
24216 d_getppid='$d_getppid'
24217 d_getprior='$d_getprior'
24218 d_getprotobyname_r='$d_getprotobyname_r'
24219 d_getprotobynumber_r='$d_getprotobynumber_r'
24220 d_getprotoent_r='$d_getprotoent_r'
24221 d_getprotoprotos='$d_getprotoprotos'
24222 d_getprpwnam='$d_getprpwnam'
24223 d_getpwent='$d_getpwent'
24224 d_getpwent_r='$d_getpwent_r'
24225 d_getpwnam_r='$d_getpwnam_r'
24226 d_getpwuid_r='$d_getpwuid_r'
24227 d_getsbyname='$d_getsbyname'
24228 d_getsbyport='$d_getsbyport'
24229 d_getsent='$d_getsent'
24230 d_getservbyname_r='$d_getservbyname_r'
24231 d_getservbyport_r='$d_getservbyport_r'
24232 d_getservent_r='$d_getservent_r'
24233 d_getservprotos='$d_getservprotos'
24234 d_getspnam='$d_getspnam'
24235 d_getspnam_r='$d_getspnam_r'
24236 d_gettimeod='$d_gettimeod'
24237 d_gmtime64='$d_gmtime64'
24238 d_gmtime_r='$d_gmtime_r'
24239 d_gnulibc='$d_gnulibc'
24240 d_grpasswd='$d_grpasswd'
24241 d_has_C_UTF8='$d_has_C_UTF8'
24242 d_hasmntopt='$d_hasmntopt'
24246 d_ilogbl='$d_ilogbl'
24247 d_inc_version_list='$d_inc_version_list'
24248 d_inetaton='$d_inetaton'
24249 d_inetntop='$d_inetntop'
24250 d_inetpton='$d_inetpton'
24251 d_int64_t='$d_int64_t'
24252 d_ip_mreq='$d_ip_mreq'
24253 d_ip_mreq_source='$d_ip_mreq_source'
24254 d_ipv6_mreq='$d_ipv6_mreq'
24255 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24256 d_isascii='$d_isascii'
24257 d_isblank='$d_isblank'
24258 d_isfinite='$d_isfinite'
24259 d_isfinitel='$d_isfinitel'
24261 d_isinfl='$d_isinfl'
24262 d_isless='$d_isless'
24264 d_isnanl='$d_isnanl'
24265 d_isnormal='$d_isnormal'
24268 d_killpg='$d_killpg'
24269 d_lc_monetary_2008='$d_lc_monetary_2008'
24270 d_lchown='$d_lchown'
24271 d_ldbl_dig='$d_ldbl_dig'
24272 d_ldexpl='$d_ldexpl'
24273 d_lgamma='$d_lgamma'
24274 d_lgamma_r='$d_lgamma_r'
24275 d_libm_lib_version='$d_libm_lib_version'
24276 d_libname_unique='$d_libname_unique'
24278 d_linkat='$d_linkat'
24279 d_llrint='$d_llrint'
24280 d_llrintl='$d_llrintl'
24281 d_llround='$d_llround'
24282 d_llroundl='$d_llroundl'
24283 d_localeconv_l='$d_localeconv_l'
24284 d_localtime64='$d_localtime64'
24285 d_localtime_r='$d_localtime_r'
24286 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24287 d_locconv='$d_locconv'
24292 d_long_double_style_ieee='$d_long_double_style_ieee'
24293 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24294 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24295 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24296 d_long_double_style_vax='$d_long_double_style_vax'
24297 d_longdbl='$d_longdbl'
24298 d_longlong='$d_longlong'
24300 d_lrintl='$d_lrintl'
24301 d_lround='$d_lround'
24302 d_lroundl='$d_lroundl'
24303 d_lseekproto='$d_lseekproto'
24305 d_madvise='$d_madvise'
24306 d_malloc_good_size='$d_malloc_good_size'
24307 d_malloc_size='$d_malloc_size'
24308 d_malloc_usable_size='$d_malloc_usable_size'
24310 d_mbrlen='$d_mbrlen'
24311 d_mbrtowc='$d_mbrtowc'
24312 d_mbstowcs='$d_mbstowcs'
24313 d_mbtowc='$d_mbtowc'
24314 d_memmem='$d_memmem'
24315 d_memrchr='$d_memrchr'
24317 d_mkdtemp='$d_mkdtemp'
24318 d_mkfifo='$d_mkfifo'
24319 d_mkostemp='$d_mkostemp'
24320 d_mkstemp='$d_mkstemp'
24321 d_mkstemps='$d_mkstemps'
24322 d_mktime64='$d_mktime64'
24323 d_mktime='$d_mktime'
24326 d_modflproto='$d_modflproto'
24327 d_mprotect='$d_mprotect'
24329 d_msg_ctrunc='$d_msg_ctrunc'
24330 d_msg_dontroute='$d_msg_dontroute'
24331 d_msg_oob='$d_msg_oob'
24332 d_msg_peek='$d_msg_peek'
24333 d_msg_proxy='$d_msg_proxy'
24334 d_msgctl='$d_msgctl'
24335 d_msgget='$d_msgget'
24336 d_msghdr_s='$d_msghdr_s'
24337 d_msgrcv='$d_msgrcv'
24338 d_msgsnd='$d_msgsnd'
24340 d_munmap='$d_munmap'
24341 d_mymalloc='$d_mymalloc'
24343 d_nanosleep='$d_nanosleep'
24345 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24346 d_nearbyint='$d_nearbyint'
24347 d_newlocale='$d_newlocale'
24348 d_nextafter='$d_nextafter'
24349 d_nexttoward='$d_nexttoward'
24351 d_nl_langinfo='$d_nl_langinfo'
24352 d_nv_preserves_uv='$d_nv_preserves_uv'
24353 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24354 d_off64_t='$d_off64_t'
24355 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24356 d_oldpthreads='$d_oldpthreads'
24357 d_oldsock='$d_oldsock'
24359 d_openat='$d_openat'
24360 d_pathconf='$d_pathconf'
24362 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24363 d_phostname='$d_phostname'
24367 d_portable='$d_portable'
24369 d_prctl_set_name='$d_prctl_set_name'
24370 d_printf_format_null='$d_printf_format_null'
24371 d_procselfexe='$d_procselfexe'
24372 d_pseudofork='$d_pseudofork'
24373 d_pthread_atfork='$d_pthread_atfork'
24374 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24375 d_pthread_yield='$d_pthread_yield'
24376 d_ptrdiff_t='$d_ptrdiff_t'
24378 d_pwchange='$d_pwchange'
24379 d_pwclass='$d_pwclass'
24380 d_pwcomment='$d_pwcomment'
24381 d_pwexpire='$d_pwexpire'
24382 d_pwgecos='$d_pwgecos'
24383 d_pwpasswd='$d_pwpasswd'
24384 d_pwquota='$d_pwquota'
24387 d_querylocale='$d_querylocale'
24388 d_random_r='$d_random_r'
24389 d_re_comp='$d_re_comp'
24390 d_readdir64_r='$d_readdir64_r'
24391 d_readdir='$d_readdir'
24392 d_readdir_r='$d_readdir_r'
24393 d_readlink='$d_readlink'
24395 d_recvmsg='$d_recvmsg'
24396 d_regcmp='$d_regcmp'
24397 d_regcomp='$d_regcomp'
24398 d_remainder='$d_remainder'
24399 d_remquo='$d_remquo'
24400 d_rename='$d_rename'
24401 d_renameat='$d_renameat'
24402 d_rewinddir='$d_rewinddir'
24406 d_sbrkproto='$d_sbrkproto'
24407 d_scalbn='$d_scalbn'
24408 d_scalbnl='$d_scalbnl'
24409 d_sched_yield='$d_sched_yield'
24410 d_scm_rights='$d_scm_rights'
24411 d_seekdir='$d_seekdir'
24412 d_select='$d_select'
24414 d_semctl='$d_semctl'
24415 d_semctl_semid_ds='$d_semctl_semid_ds'
24416 d_semctl_semun='$d_semctl_semun'
24417 d_semget='$d_semget'
24419 d_sendmsg='$d_sendmsg'
24420 d_setegid='$d_setegid'
24421 d_seteuid='$d_seteuid'
24422 d_setgrent='$d_setgrent'
24423 d_setgrent_r='$d_setgrent_r'
24424 d_setgrps='$d_setgrps'
24425 d_sethent='$d_sethent'
24426 d_sethostent_r='$d_sethostent_r'
24427 d_setitimer='$d_setitimer'
24428 d_setlinebuf='$d_setlinebuf'
24429 d_setlocale='$d_setlocale'
24430 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
24431 d_setlocale_r='$d_setlocale_r'
24432 d_setnent='$d_setnent'
24433 d_setnetent_r='$d_setnetent_r'
24434 d_setpent='$d_setpent'
24435 d_setpgid='$d_setpgid'
24436 d_setpgrp2='$d_setpgrp2'
24437 d_setpgrp='$d_setpgrp'
24438 d_setprior='$d_setprior'
24439 d_setproctitle='$d_setproctitle'
24440 d_setprotoent_r='$d_setprotoent_r'
24441 d_setpwent='$d_setpwent'
24442 d_setpwent_r='$d_setpwent_r'
24443 d_setregid='$d_setregid'
24444 d_setresgid='$d_setresgid'
24445 d_setresuid='$d_setresuid'
24446 d_setreuid='$d_setreuid'
24447 d_setrgid='$d_setrgid'
24448 d_setruid='$d_setruid'
24449 d_setsent='$d_setsent'
24450 d_setservent_r='$d_setservent_r'
24451 d_setsid='$d_setsid'
24452 d_setvbuf='$d_setvbuf'
24455 d_shmatprototype='$d_shmatprototype'
24456 d_shmctl='$d_shmctl'
24458 d_shmget='$d_shmget'
24459 d_sigaction='$d_sigaction'
24460 d_siginfo_si_addr='$d_siginfo_si_addr'
24461 d_siginfo_si_band='$d_siginfo_si_band'
24462 d_siginfo_si_errno='$d_siginfo_si_errno'
24463 d_siginfo_si_fd='$d_siginfo_si_fd'
24464 d_siginfo_si_pid='$d_siginfo_si_pid'
24465 d_siginfo_si_status='$d_siginfo_si_status'
24466 d_siginfo_si_uid='$d_siginfo_si_uid'
24467 d_siginfo_si_value='$d_siginfo_si_value'
24468 d_signbit='$d_signbit'
24469 d_sigprocmask='$d_sigprocmask'
24470 d_sigsetjmp='$d_sigsetjmp'
24471 d_sin6_scope_id='$d_sin6_scope_id'
24472 d_sitearch='$d_sitearch'
24473 d_snprintf='$d_snprintf'
24474 d_sockaddr_in6='$d_sockaddr_in6'
24475 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24476 d_sockatmark='$d_sockatmark'
24477 d_sockatmarkproto='$d_sockatmarkproto'
24478 d_socket='$d_socket'
24479 d_socklen_t='$d_socklen_t'
24480 d_sockpair='$d_sockpair'
24481 d_socks5_init='$d_socks5_init'
24483 d_srand48_r='$d_srand48_r'
24484 d_srandom_r='$d_srandom_r'
24485 d_sresgproto='$d_sresgproto'
24486 d_sresuproto='$d_sresuproto'
24488 d_statblks='$d_statblks'
24489 d_statfs_f_flags='$d_statfs_f_flags'
24490 d_statfs_s='$d_statfs_s'
24491 d_static_inline='$d_static_inline'
24492 d_statvfs='$d_statvfs'
24493 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24494 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24495 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24496 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24497 d_stdio_stream_array='$d_stdio_stream_array'
24498 d_stdiobase='$d_stdiobase'
24499 d_stdstdio='$d_stdstdio'
24500 d_strcoll='$d_strcoll'
24501 d_strerror_l='$d_strerror_l'
24502 d_strerror_r='$d_strerror_r'
24503 d_strftime='$d_strftime'
24504 d_strlcat='$d_strlcat'
24505 d_strlcpy='$d_strlcpy'
24506 d_strnlen='$d_strnlen'
24507 d_strtod='$d_strtod'
24508 d_strtod_l='$d_strtod_l'
24509 d_strtol='$d_strtol'
24510 d_strtold='$d_strtold'
24511 d_strtold_l='$d_strtold_l'
24512 d_strtoll='$d_strtoll'
24513 d_strtoq='$d_strtoq'
24514 d_strtoul='$d_strtoul'
24515 d_strtoull='$d_strtoull'
24516 d_strtouq='$d_strtouq'
24517 d_strxfrm='$d_strxfrm'
24518 d_suidsafe='$d_suidsafe'
24519 d_symlink='$d_symlink'
24520 d_syscall='$d_syscall'
24521 d_syscallproto='$d_syscallproto'
24522 d_sysconf='$d_sysconf'
24523 d_sysernlst='$d_sysernlst'
24524 d_syserrlst='$d_syserrlst'
24525 d_system='$d_system'
24526 d_tcgetpgrp='$d_tcgetpgrp'
24527 d_tcsetpgrp='$d_tcsetpgrp'
24528 d_telldir='$d_telldir'
24529 d_telldirproto='$d_telldirproto'
24530 d_tgamma='$d_tgamma'
24531 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24533 d_timegm='$d_timegm'
24535 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24536 d_tm_tm_zone='$d_tm_tm_zone'
24537 d_tmpnam_r='$d_tmpnam_r'
24538 d_towlower='$d_towlower'
24539 d_towupper='$d_towupper'
24541 d_truncate='$d_truncate'
24542 d_truncl='$d_truncl'
24543 d_ttyname_r='$d_ttyname_r'
24544 d_tzname='$d_tzname'
24545 d_u32align='$d_u32align'
24546 d_ualarm='$d_ualarm'
24549 d_union_semun='$d_union_semun'
24550 d_unlinkat='$d_unlinkat'
24551 d_unordered='$d_unordered'
24552 d_unsetenv='$d_unsetenv'
24553 d_uselocale='$d_uselocale'
24554 d_usleep='$d_usleep'
24555 d_usleepproto='$d_usleepproto'
24557 d_vendorarch='$d_vendorarch'
24558 d_vendorbin='$d_vendorbin'
24559 d_vendorlib='$d_vendorlib'
24560 d_vendorscript='$d_vendorscript'
24562 d_void_closedir='$d_void_closedir'
24563 d_voidsig='$d_voidsig'
24564 d_voidtty='$d_voidtty'
24565 d_vsnprintf='$d_vsnprintf'
24567 d_waitpid='$d_waitpid'
24568 d_wcscmp='$d_wcscmp'
24569 d_wcstombs='$d_wcstombs'
24570 d_wcsxfrm='$d_wcsxfrm'
24571 d_wctomb='$d_wctomb'
24572 d_writev='$d_writev'
24575 db_hashtype='$db_hashtype'
24576 db_prefixtype='$db_prefixtype'
24577 db_version_major='$db_version_major'
24578 db_version_minor='$db_version_minor'
24579 db_version_patch='$db_version_patch'
24580 default_inc_excludes_dot='$default_inc_excludes_dot'
24581 direntrytype='$direntrytype'
24584 doubleinfbytes='$doubleinfbytes'
24585 doublekind='$doublekind'
24586 doublemantbits='$doublemantbits'
24587 doublenanbytes='$doublenanbytes'
24588 doublesize='$doublesize'
24590 drand48_r_proto='$drand48_r_proto'
24592 dtraceobject='$dtraceobject'
24593 dtracexnolibs='$dtracexnolibs'
24594 dynamic_ext='$dynamic_ext'
24600 endgrent_r_proto='$endgrent_r_proto'
24601 endhostent_r_proto='$endhostent_r_proto'
24602 endnetent_r_proto='$endnetent_r_proto'
24603 endprotoent_r_proto='$endprotoent_r_proto'
24604 endpwent_r_proto='$endpwent_r_proto'
24605 endservent_r_proto='$endservent_r_proto'
24606 eunicefix='$eunicefix'
24609 extensions='$extensions'
24610 extern_C='$extern_C'
24612 fflushNULL='$fflushNULL'
24613 fflushall='$fflushall'
24615 firstmakefile='$firstmakefile'
24617 fpossize='$fpossize'
24618 fpostype='$fpostype'
24619 freetype='$freetype'
24622 full_csh='$full_csh'
24623 full_sed='$full_sed'
24624 gccansipedantic='$gccansipedantic'
24625 gccosandvers='$gccosandvers'
24626 gccversion='$gccversion'
24627 getgrent_r_proto='$getgrent_r_proto'
24628 getgrgid_r_proto='$getgrgid_r_proto'
24629 getgrnam_r_proto='$getgrnam_r_proto'
24630 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24631 gethostbyname_r_proto='$gethostbyname_r_proto'
24632 gethostent_r_proto='$gethostent_r_proto'
24633 getlogin_r_proto='$getlogin_r_proto'
24634 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24635 getnetbyname_r_proto='$getnetbyname_r_proto'
24636 getnetent_r_proto='$getnetent_r_proto'
24637 getprotobyname_r_proto='$getprotobyname_r_proto'
24638 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24639 getprotoent_r_proto='$getprotoent_r_proto'
24640 getpwent_r_proto='$getpwent_r_proto'
24641 getpwnam_r_proto='$getpwnam_r_proto'
24642 getpwuid_r_proto='$getpwuid_r_proto'
24643 getservbyname_r_proto='$getservbyname_r_proto'
24644 getservbyport_r_proto='$getservbyport_r_proto'
24645 getservent_r_proto='$getservent_r_proto'
24646 getspnam_r_proto='$getspnam_r_proto'
24647 gidformat='$gidformat'
24653 gmtime_r_proto='$gmtime_r_proto'
24654 gnulibc_version='$gnulibc_version'
24656 groupcat='$groupcat'
24657 groupstype='$groupstype'
24660 h_sysfile='$h_sysfile'
24663 hostgenerate='$hostgenerate'
24664 hostosname='$hostosname'
24665 hostperl='$hostperl'
24666 html1dir='$html1dir'
24667 html1direxp='$html1direxp'
24668 html3dir='$html3dir'
24669 html3direxp='$html3direxp'
24678 i_arpainet='$i_arpainet'
24680 i_bsdioctl='$i_bsdioctl'
24684 i_dirent='$i_dirent'
24686 i_execinfo='$i_execinfo'
24690 i_fp_class='$i_fp_class'
24692 i_gdbm_ndbm='$i_gdbm_ndbm'
24693 i_gdbmndbm='$i_gdbmndbm'
24695 i_ieeefp='$i_ieeefp'
24696 i_inttypes='$i_inttypes'
24697 i_langinfo='$i_langinfo'
24698 i_libutil='$i_libutil'
24699 i_locale='$i_locale'
24700 i_machcthr='$i_machcthr'
24701 i_malloc='$i_malloc'
24702 i_mallocmalloc='$i_mallocmalloc'
24703 i_mntent='$i_mntent'
24706 i_neterrno='$i_neterrno'
24707 i_netinettcp='$i_netinettcp'
24711 i_pthread='$i_pthread'
24713 i_quadmath='$i_quadmath'
24714 i_rpcsvcdbm='$i_rpcsvcdbm'
24716 i_shadow='$i_shadow'
24718 i_stdbool='$i_stdbool'
24719 i_stdint='$i_stdint'
24720 i_stdlib='$i_stdlib'
24721 i_sunmath='$i_sunmath'
24722 i_sysaccess='$i_sysaccess'
24723 i_sysdir='$i_sysdir'
24724 i_sysfile='$i_sysfile'
24725 i_sysfilio='$i_sysfilio'
24727 i_sysioctl='$i_sysioctl'
24728 i_syslog='$i_syslog'
24729 i_sysmman='$i_sysmman'
24730 i_sysmode='$i_sysmode'
24731 i_sysmount='$i_sysmount'
24732 i_sysndir='$i_sysndir'
24733 i_sysparam='$i_sysparam'
24734 i_syspoll='$i_syspoll'
24735 i_sysresrc='$i_sysresrc'
24736 i_syssecrt='$i_syssecrt'
24737 i_sysselct='$i_sysselct'
24738 i_syssockio='$i_syssockio'
24739 i_sysstat='$i_sysstat'
24740 i_sysstatfs='$i_sysstatfs'
24741 i_sysstatvfs='$i_sysstatvfs'
24742 i_systime='$i_systime'
24743 i_systimek='$i_systimek'
24744 i_systimes='$i_systimes'
24745 i_systypes='$i_systypes'
24746 i_sysuio='$i_sysuio'
24748 i_sysutsname='$i_sysutsname'
24749 i_sysvfs='$i_sysvfs'
24750 i_syswait='$i_syswait'
24751 i_termio='$i_termio'
24752 i_termios='$i_termios'
24754 i_unistd='$i_unistd'
24759 i_wctype='$i_wctype'
24760 i_xlocale='$i_xlocale'
24761 ignore_versioned_solibs='$ignore_versioned_solibs'
24762 inc_version_list='$inc_version_list'
24763 inc_version_list_init='$inc_version_list_init'
24767 initialinstalllocation='$initialinstalllocation'
24768 installarchlib='$installarchlib'
24769 installbin='$installbin'
24770 installhtml1dir='$installhtml1dir'
24771 installhtml3dir='$installhtml3dir'
24772 installman1dir='$installman1dir'
24773 installman3dir='$installman3dir'
24774 installprefix='$installprefix'
24775 installprefixexp='$installprefixexp'
24776 installprivlib='$installprivlib'
24777 installscript='$installscript'
24778 installsitearch='$installsitearch'
24779 installsitebin='$installsitebin'
24780 installsitehtml1dir='$installsitehtml1dir'
24781 installsitehtml3dir='$installsitehtml3dir'
24782 installsitelib='$installsitelib'
24783 installsiteman1dir='$installsiteman1dir'
24784 installsiteman3dir='$installsiteman3dir'
24785 installsitescript='$installsitescript'
24786 installstyle='$installstyle'
24787 installusrbinperl='$installusrbinperl'
24788 installvendorarch='$installvendorarch'
24789 installvendorbin='$installvendorbin'
24790 installvendorhtml1dir='$installvendorhtml1dir'
24791 installvendorhtml3dir='$installvendorhtml3dir'
24792 installvendorlib='$installvendorlib'
24793 installvendorman1dir='$installvendorman1dir'
24794 installvendorman3dir='$installvendorman3dir'
24795 installvendorscript='$installvendorscript'
24797 issymlink='$issymlink'
24798 ivdformat='$ivdformat'
24801 known_extensions='$known_extensions'
24804 ld_can_script='$ld_can_script'
24805 lddlflags='$lddlflags'
24807 ldflags_uselargefiles='$ldflags_uselargefiles'
24808 ldlibpthname='$ldlibpthname'
24815 libsdirs='$libsdirs'
24816 libsfiles='$libsfiles'
24817 libsfound='$libsfound'
24818 libspath='$libspath'
24819 libswanted='$libswanted'
24820 libswanted_uselargefiles='$libswanted_uselargefiles'
24826 localtime_r_proto='$localtime_r_proto'
24827 locincpth='$locincpth'
24828 loclibpth='$loclibpth'
24829 longdblinfbytes='$longdblinfbytes'
24830 longdblkind='$longdblkind'
24831 longdblmantbits='$longdblmantbits'
24832 longdblnanbytes='$longdblnanbytes'
24833 longdblsize='$longdblsize'
24834 longlongsize='$longlongsize'
24835 longsize='$longsize'
24839 lseeksize='$lseeksize'
24840 lseektype='$lseektype'
24844 make_set_make='$make_set_make'
24845 mallocobj='$mallocobj'
24846 mallocsrc='$mallocsrc'
24847 malloctype='$malloctype'
24849 man1direxp='$man1direxp'
24852 man3direxp='$man3direxp'
24854 mips_type='$mips_type'
24855 mistrustnm='$mistrustnm'
24857 mmaptype='$mmaptype'
24858 modetype='$modetype'
24860 multiarch='$multiarch'
24862 myarchname='$myarchname'
24863 mydomain='$mydomain'
24864 myhostname='$myhostname'
24867 need_va_copy='$need_va_copy'
24868 netdb_hlen_type='$netdb_hlen_type'
24869 netdb_host_type='$netdb_host_type'
24870 netdb_name_type='$netdb_name_type'
24871 netdb_net_type='$netdb_net_type'
24874 nm_so_opt='$nm_so_opt'
24875 nonxs_ext='$nonxs_ext'
24877 nvEUformat='$nvEUformat'
24878 nvFUformat='$nvFUformat'
24879 nvGUformat='$nvGUformat'
24880 nv_overflows_integers_at='$nv_overflows_integers_at'
24881 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24882 nveformat='$nveformat'
24883 nvfformat='$nvfformat'
24884 nvgformat='$nvgformat'
24885 nvmantbits='$nvmantbits'
24888 o_nonblock='$o_nonblock'
24890 old_pthread_create_joinable='$old_pthread_create_joinable'
24891 optimize='$optimize'
24892 orderlib='$orderlib'
24895 otherlibdirs='$otherlibdirs'
24899 patchlevel='$patchlevel'
24900 path_sep='$path_sep'
24903 perl_patchlevel='$perl_patchlevel'
24904 perl_static_inline='$perl_static_inline'
24905 perladmin='$perladmin'
24906 perllibs='$perllibs'
24907 perlpath='$perlpath'
24909 phostname='$phostname'
24915 prefixexp='$prefixexp'
24917 privlibexp='$privlibexp'
24918 procselfexe='$procselfexe'
24920 quadkind='$quadkind'
24921 quadtype='$quadtype'
24922 randbits='$randbits'
24923 randfunc='$randfunc'
24924 random_r_proto='$random_r_proto'
24925 randseedtype='$randseedtype'
24927 rd_nodata='$rd_nodata'
24928 readdir64_r_proto='$readdir64_r_proto'
24929 readdir_r_proto='$readdir_r_proto'
24930 revision='$revision'
24936 sGMTIME_max='$sGMTIME_max'
24937 sGMTIME_min='$sGMTIME_min'
24938 sLOCALTIME_max='$sLOCALTIME_max'
24939 sLOCALTIME_min='$sLOCALTIME_min'
24940 sPRIEUldbl='$sPRIEUldbl'
24941 sPRIFUldbl='$sPRIFUldbl'
24942 sPRIGUldbl='$sPRIGUldbl'
24943 sPRIXU64='$sPRIXU64'
24945 sPRIeldbl='$sPRIeldbl'
24946 sPRIfldbl='$sPRIfldbl'
24947 sPRIgldbl='$sPRIgldbl'
24952 sSCNfldbl='$sSCNfldbl'
24953 sched_yield='$sched_yield'
24954 scriptdir='$scriptdir'
24955 scriptdirexp='$scriptdirexp'
24957 seedfunc='$seedfunc'
24958 selectminbits='$selectminbits'
24959 selecttype='$selecttype'
24960 sendmail='$sendmail'
24961 setgrent_r_proto='$setgrent_r_proto'
24962 sethostent_r_proto='$sethostent_r_proto'
24963 setlocale_r_proto='$setlocale_r_proto'
24964 setnetent_r_proto='$setnetent_r_proto'
24965 setprotoent_r_proto='$setprotoent_r_proto'
24966 setpwent_r_proto='$setpwent_r_proto'
24967 setservent_r_proto='$setservent_r_proto'
24970 sharpbang='$sharpbang'
24971 shmattype='$shmattype'
24972 shortsize='$shortsize'
24975 sig_count='$sig_count'
24976 sig_name='$sig_name'
24977 sig_name_init='$sig_name_init'
24979 sig_num_init='$sig_num_init'
24980 sig_size='$sig_size'
24981 signal_t='$signal_t'
24982 sitearch='$sitearch'
24983 sitearchexp='$sitearchexp'
24985 sitebinexp='$sitebinexp'
24986 sitehtml1dir='$sitehtml1dir'
24987 sitehtml1direxp='$sitehtml1direxp'
24988 sitehtml3dir='$sitehtml3dir'
24989 sitehtml3direxp='$sitehtml3direxp'
24991 sitelib_stem='$sitelib_stem'
24992 sitelibexp='$sitelibexp'
24993 siteman1dir='$siteman1dir'
24994 siteman1direxp='$siteman1direxp'
24995 siteman3dir='$siteman3dir'
24996 siteman3direxp='$siteman3direxp'
24997 siteprefix='$siteprefix'
24998 siteprefixexp='$siteprefixexp'
24999 sitescript='$sitescript'
25000 sitescriptexp='$sitescriptexp'
25001 sizesize='$sizesize'
25002 sizetype='$sizetype'
25006 sockethdr='$sockethdr'
25007 socketlib='$socketlib'
25008 socksizetype='$socksizetype'
25010 spackage='$spackage'
25011 spitshell='$spitshell'
25012 srand48_r_proto='$srand48_r_proto'
25013 srandom_r_proto='$srandom_r_proto'
25015 ssizetype='$ssizetype'
25016 st_ino_sign='$st_ino_sign'
25017 st_ino_size='$st_ino_size'
25018 startperl='$startperl'
25020 static_ext='$static_ext'
25022 stdio_base='$stdio_base'
25023 stdio_bufsiz='$stdio_bufsiz'
25024 stdio_cnt='$stdio_cnt'
25025 stdio_filbuf='$stdio_filbuf'
25026 stdio_ptr='$stdio_ptr'
25027 stdio_stream_array='$stdio_stream_array'
25028 strerror_r_proto='$strerror_r_proto'
25030 subversion='$subversion'
25035 targetarch='$targetarch'
25036 targetdir='$targetdir'
25037 targetenv='$targetenv'
25038 targethost='$targethost'
25039 targetmkdir='$targetmkdir'
25040 targetport='$targetport'
25041 targetsh='$targetsh'
25045 timeincl='$timeincl'
25046 timetype='$timetype'
25047 tmpnam_r_proto='$tmpnam_r_proto'
25053 ttyname_r_proto='$ttyname_r_proto'
25062 uidformat='$uidformat'
25068 uquadtype='$uquadtype'
25069 use5005threads='$use5005threads'
25070 use64bitall='$use64bitall'
25071 use64bitint='$use64bitint'
25072 usecbacktrace='$usecbacktrace'
25073 usecrosscompile='$usecrosscompile'
25074 usedevel='$usedevel'
25076 usedtrace='$usedtrace'
25077 usefaststdio='$usefaststdio'
25078 useithreads='$useithreads'
25079 usekernprocpathname='$usekernprocpathname'
25080 uselanginfo='$uselanginfo'
25081 uselargefiles='$uselargefiles'
25082 uselongdouble='$uselongdouble'
25083 usemallocwrap='$usemallocwrap'
25084 usemorebits='$usemorebits'
25085 usemultiplicity='$usemultiplicity'
25086 usemymalloc='$usemymalloc'
25088 usensgetexecutablepath='$usensgetexecutablepath'
25089 useopcode='$useopcode'
25090 useperlio='$useperlio'
25091 useposix='$useposix'
25092 usequadmath='$usequadmath'
25093 usereentrant='$usereentrant'
25094 userelocatableinc='$userelocatableinc'
25095 useshrplib='$useshrplib'
25096 usesitecustomize='$usesitecustomize'
25097 usesocks='$usesocks'
25098 usethreads='$usethreads'
25099 usevendorprefix='$usevendorprefix'
25100 useversionedarchname='$useversionedarchname'
25101 usevfork='$usevfork'
25104 uvXUformat='$uvXUformat'
25105 uvoformat='$uvoformat'
25108 uvuformat='$uvuformat'
25109 uvxformat='$uvxformat'
25110 vendorarch='$vendorarch'
25111 vendorarchexp='$vendorarchexp'
25112 vendorbin='$vendorbin'
25113 vendorbinexp='$vendorbinexp'
25114 vendorhtml1dir='$vendorhtml1dir'
25115 vendorhtml1direxp='$vendorhtml1direxp'
25116 vendorhtml3dir='$vendorhtml3dir'
25117 vendorhtml3direxp='$vendorhtml3direxp'
25118 vendorlib='$vendorlib'
25119 vendorlib_stem='$vendorlib_stem'
25120 vendorlibexp='$vendorlibexp'
25121 vendorman1dir='$vendorman1dir'
25122 vendorman1direxp='$vendorman1direxp'
25123 vendorman3dir='$vendorman3dir'
25124 vendorman3direxp='$vendorman3direxp'
25125 vendorprefix='$vendorprefix'
25126 vendorprefixexp='$vendorprefixexp'
25127 vendorscript='$vendorscript'
25128 vendorscriptexp='$vendorscriptexp'
25130 version_patchlevel_string='$version_patchlevel_string'
25131 versiononly='$versiononly'
25135 yaccflags='$yaccflags'
25140 : add special variables
25141 $test -f $src/patchlevel.h && \
25142 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25143 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25144 echo "PERL_CONFIG_SH=true" >>config.sh
25146 : propagate old symbols
25147 if $test -f UU/config.sh; then
25148 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25149 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25150 config.sh config.sh UU/oldconfig.sh |\
25151 $sort | $uniq -u >UU/oldsyms
25152 set X `$cat UU/oldsyms`
25158 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25160 echo ": Variables propagated from previous config.sh file." >>config.sh
25161 for sym in `$cat UU/oldsyms`; do
25162 echo " Propagating $hint variable "'$'"$sym..."
25163 eval 'tmp="$'"${sym}"'"'
25165 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25171 : preserve RCS keywords in files with variable substitution, grrr
25174 : Finish up by extracting the .SH files
25177 echo "Stopping at your request, leaving temporary files around."
25187 If you'd like to make any changes to the config.sh file before I begin
25188 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25191 rp="Press return or use a shell escape to edit config.sh:"
25196 *) : in case they cannot read
25197 sh 1>&4 -c "$ans";;
25202 : if this fails, just run all the .SH files by hand
25211 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25218 Now you need to generate make dependencies by running "$make depend".
25219 You might prefer to run it in background: "$make depend > makedepend.out &"
25220 It can take a while, so you might not want to run it right now.
25225 rp="Run $make depend now?"
25229 $make depend && echo "Now you must run '$make'."
25232 echo "You must run '$make depend' then '$make'."
25235 elif test -f [Mm]akefile; then
25237 echo "Now you must run a $make."
25239 echo "Configure done."
25242 if $test -f Policy.sh; then
25245 If you compile $package on a different machine or from a different object
25246 directory, copy the Policy.sh file from this object directory to the
25247 new one before you run Configure -- this will help you with most of
25248 the policy defaults.
25252 if $test -f UU/config.msg; then
25253 echo "Hmm. I also noted the following information while running:"
25255 $cat UU/config.msg >&4
25257 $rm -f kit*isdone ark*isdone