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=''
450 endhostent_r_proto=''
456 endprotoent_r_proto=''
462 endservent_r_proto=''
534 gethostbyaddr_r_proto=''
536 gethostbyname_r_proto=''
538 gethostent_r_proto=''
551 getnetbyaddr_r_proto=''
553 getnetbyname_r_proto=''
567 d_getprotobyname_r=''
568 getprotobyname_r_proto=''
569 d_getprotobynumber_r=''
570 getprotobynumber_r_proto=''
572 getprotoent_r_proto=''
584 getservbyname_r_proto=''
586 getservbyport_r_proto=''
588 getservent_r_proto=''
621 d_lc_monetary_2008=''
626 d_libm_lib_version=''
634 d_localtime_r_needs_tzset=''
642 d_long_double_style_ieee=''
643 d_long_double_style_ieee_doubledouble=''
644 d_long_double_style_ieee_extended=''
645 d_long_double_style_ieee_std=''
646 d_long_double_style_vax=''
659 d_malloc_good_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=''
780 setprotoent_r_proto=''
792 setservent_r_proto=''
805 d_siginfo_si_errno=''
808 d_siginfo_si_status=''
810 d_siginfo_si_value=''
822 d_ipv6_mreq_source=''
851 perl_static_inline=''
856 d_stdio_ptr_lval_nochange_cnt=''
857 d_stdio_ptr_lval_sets_cnt=''
937 default_inc_excludes_dot=''
1003 d_gdbm_ndbm_h_uses_prototypes=''
1004 d_gdbmndbm_h_uses_prototypes=''
1006 d_ndbm_h_uses_prototypes=''
1076 d_inc_version_list=''
1078 inc_version_list_init=''
1086 installusrbinperl=''
1102 ignore_versioned_solibs=''
1118 d_double_has_negative_zero=''
1119 d_double_has_subnormals=''
1120 d_double_style_cray=''
1121 d_double_style_ibm=''
1122 d_double_style_ieee=''
1123 d_double_style_vax=''
1174 d_perl_otherlibdirs=''
1182 api_versionstring=''
1188 version_patchlevel_string=''
1192 d_nv_preserves_uv=''
1193 d_nv_zero_is_allbits_zero=''
1204 nv_overflows_integers_at=''
1205 nv_preserves_uv_bits=''
1277 installsitehtml1dir=''
1280 installsitehtml3dir=''
1287 installsiteman1dir=''
1290 installsiteman3dir=''
1295 installsitescript=''
1313 d_stdio_stream_array=''
1314 stdio_stream_array=''
1332 usekernprocpathname=''
1333 ccflags_uselargefiles=''
1334 ldflags_uselargefiles=''
1335 libswanted_uselargefiles=''
1344 usensgetexecutablepath=''
1357 installvendorarch=''
1364 installvendorhtml1dir=''
1366 vendorhtml1direxp=''
1367 installvendorhtml3dir=''
1369 vendorhtml3direxp=''
1375 installvendorman1dir=''
1378 installvendorman3dir=''
1385 installvendorscript=''
1396 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1399 : We must find out about Eunice early
1401 if test -f /etc/unixtovms; then
1402 eunicefix=/etc/unixtovms
1404 if test -f /etc/unixtovms.exe; then
1405 eunicefix=/etc/unixtovms.exe
1408 : Set executable suffix now -- needed before hints available
1409 if test -f "/libs/version.library"; then
1412 elif test -f "/system/gnu_library/bin/ar.pm"; then
1415 elif test -n "$DJGPP"; then
1418 elif test -f /kern/cookiejar; then
1421 elif test -d c:/. -o -n "$is_os2" ; then
1428 : Possible local include directories to search.
1429 : Set locincpth to "" in a hint file to defeat local include searches.
1430 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1431 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1433 : no include file wanted by default
1436 : Enable -DEBUGGING and -DDEBUGGING from the command line
1440 : Trailing extension. Override this in a hint file, if needed.
1441 : Extra object files, if any, needed on this platform.
1444 : change the next line if compiling for Xenix/286 on Xenix/386
1445 xlibpth='/usr/lib/386 /lib/386'
1446 : Possible local library directories to search.
1447 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1448 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1450 : general looking path for locating libraries
1451 glibpth="/lib /usr/lib $xlibpth"
1452 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1453 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1454 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1455 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1457 : Private path used by Configure to find libraries. Its value
1458 : is prepended to libpth. This variable takes care of special
1459 : machines, like the mips. Usually, it should be empty.
1462 : default library list
1464 : some systems want to use only the non-versioned libso:s
1465 ignore_versioned_solibs=''
1469 : set useposix=false in your hint file to disable the POSIX extension.
1471 : set useopcode=false in your hint file to disable the Opcode extension.
1473 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1476 ccflags_uselargefiles=''
1477 ldflags_uselargefiles=''
1478 libswanted_uselargefiles=''
1479 : set usemultiplicity on the Configure command line to enable multiplicity.
1480 : set usesocks on the Configure command line to enable socks.
1482 : set usethreads on the Configure command line to enable threads.
1483 usereentrant='undef'
1484 : List of libraries we want.
1485 : If anyone needs extra -lxxx, put those in a hint file.
1486 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1487 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1488 : We probably want to search /usr/shlib before most other libraries.
1489 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1490 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1491 glibpth="/usr/shlib $glibpth"
1492 : Do not use vfork unless overridden by a hint file.
1495 : Find the basic shell for Bourne shell scripts
1499 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1502 if test -f "$xxx"; then
1505 : Build up a list and do a single loop so we can 'break' out.
1506 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1507 for xxx in sh bash ksh pdksh ash; do
1509 try="$try ${p}/${xxx}"
1513 if test -f "$xxx"; then
1516 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1519 elif test -f "$xxx.exe"; then
1530 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1532 Usually it's in /bin/sh. How did you even get this far?
1533 Please contact me (Perl Maintainers) at perlbug@perl.org and
1534 we'll try to straighten this all out.
1540 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1541 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1544 : see if sh knows # comments
1545 if `$sh -c '#' >/dev/null 2>&1`; then
1549 test -f $xcat$_exe || xcat=/usr/bin/cat
1550 if test ! -f $xcat$_exe; then
1551 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1552 if test -f $p/cat$_exe; then
1557 if test ! -f $xcat$_exe; then
1558 echo "Can't find cat anywhere!"
1562 echo "#!$xcat" >sharp
1565 ./sharp > today 2>/dev/null
1566 if test -s today; then
1569 echo "#! $xcat" > sharp
1572 ./sharp > today 2>/dev/null
1573 if test -s today; then
1581 echo "Your $sh doesn't grok # comments--I will strip them later on."
1584 echo "exec grep -v '^[ ]*#'" >spitshell
1586 $eunicefix spitshell
1587 spitshell=`pwd`/spitshell
1589 echo "I presume that if # doesn't work, #! won't work either!"
1594 : figure out how to guarantee sh startup
1596 '') startsh=${sharpbang}${sh} ;;
1608 : echo "Yup, it does."
1610 echo "Hmm... '$startsh' does not guarantee sh startup..."
1611 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1615 : Save command line options in file UU/cmdline.opt for later use in
1616 : generating config.sh.
1617 cat > cmdline.opt <<EOSH
1618 : Configure command line arguments.
1627 cat >>cmdline.opt <<EOSH
1628 config_arg$argn='$arg'
1630 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1633 arg_exp=`cat cmdl.opt`
1634 args_exp="$args_exp$args_sep'$arg_exp'"
1635 argn=`expr $argn + 1`
1640 : produce awk script to parse command line options
1641 cat >options.awk <<'EOF'
1643 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1645 len = length(optstr);
1646 for (i = 1; i <= len; i++) {
1647 c = substr(optstr, i, 1);
1648 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1659 if (substr(str, 1, 1) != "-") {
1660 printf("'%s'\n", str);
1664 for (i = 2; i <= len; i++) {
1665 c = substr(str, i, 1);
1667 printf("-%s\n", substr(str, i));
1673 printf("'%s'\n", substr(str, i + 1));
1686 : process the command line options
1687 set X `for arg in "$@"; do echo "X$arg"; done |
1688 sed -e s/X// | awk -f options.awk`
1693 : set up default values
1702 rm -f optdef.sh posthint.sh
1703 cat >optdef.sh <<EOS
1709 while test $# -gt 0; do
1711 -d) shift; fastread=yes;;
1712 -e) shift; alldone=cont;;
1716 if test -r "$1"; then
1719 echo "$me: cannot read config file $1." >&2
1725 -h) shift; error=true;;
1726 -r) shift; reuseval=true;;
1727 -s) shift; silent=true; realsilent=true;;
1728 -E) shift; alldone=exit;;
1729 -K) shift; knowitall=true;;
1731 -S) shift; silent=true; extractsh=true;;
1736 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1737 echo "$me: ignoring -D $1" >&2
1740 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1741 *) echo "$1='define'" >> optdef.sh;;
1748 *=) echo "$1" >> optdef.sh;;
1750 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1751 echo "$me: ignoring -U $1" >&2
1753 *) echo "$1='undef'" >> optdef.sh;;
1764 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1768 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1769 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1775 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1776 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1777 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1778 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1779 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1780 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1786 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1788 echo "$yyy=''" >> posthint.sh ;;
1793 echo "$yyy='$zzz'" >> posthint.sh ;;
1795 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1797 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1802 echo "$yyy=$zzz" >> posthint.sh ;;
1803 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1807 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1810 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1818 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1819 [-U symbol] [-U symbol=] [-A command:symbol...]
1820 -d : use defaults for all answers.
1821 -e : go on without questioning past the production of config.sh.
1822 -f : specify an alternate default configuration file.
1823 -h : print this help message and exit (with an error status).
1824 -r : reuse C symbols value if possible (skips costly nm extraction).
1825 -s : silent mode, only echoes questions and essential information.
1826 -D : define symbol to have some value:
1827 -D symbol symbol gets the value 'define'
1828 -D symbol=value symbol gets the value 'value'
1829 common used examples (see INSTALL for more info):
1830 -Duse64bitint use 64bit integers
1831 -Duse64bitall use 64bit integers and pointers
1832 -Dusethreads use thread support
1833 -Dinc_version_list=none do not include older perl trees in @INC
1834 -DEBUGGING=none DEBUGGING options
1835 -Dcc=gcc choose your compiler
1836 -Dprefix=/opt/perl5 choose your destination
1837 -E : stop at the end of questions, after having produced config.sh.
1838 -K : do not use unless you know what you are doing.
1839 -O : ignored for backward compatibility
1840 -S : perform variable substitutions on all .SH files (can mix with -f)
1841 -U : undefine symbol:
1842 -U symbol symbol gets the value 'undef'
1843 -U symbol= symbol gets completely empty
1845 -A : manipulate symbol after the platform specific hints have been applied:
1846 -A append:symbol=value append value to symbol
1847 -A symbol=value like append:, but with a separating space
1848 -A define:symbol=value define symbol to have value
1849 -A clear:symbol define symbol to be ''
1850 -A define:symbol define symbol to be 'define'
1851 -A eval:symbol=value define symbol to be eval of value
1852 -A prepend:symbol=value prepend value to symbol
1853 -A undef:symbol define symbol to be 'undef'
1854 -A undef:symbol= define symbol to be ''
1855 e.g.: -A prepend:libswanted='cl pthread '
1856 -A ccflags=-DSOME_MACRO
1857 -V : print version number and exit (with a zero status).
1864 case "$fastread$alldone" in
1867 case "$extractsh" in
1870 if test ! -t 0; then
1871 echo "Say 'sh Configure', not 'sh <Configure'"
1881 true) exec 1>/dev/null;;
1884 : run the defines and the undefines, if any, but leave the file out there...
1886 grep '\\' optdef.sh >/dev/null 2>&1
1887 if test $? = 0; then
1888 echo "Configure does not support \\ in -D arguments"
1892 : create the posthint manipulation script and leave the file out there...
1897 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1898 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1899 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1900 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1901 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1904 : Some greps do not return status, grrr.
1905 echo "grimblepritz" >grimble
1906 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1908 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1914 : the following should work in any shell
1918 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1919 cat >contains <<'EOSS'
1920 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1925 : Find the path to the source tree
1928 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1932 *) src=`cd ../$src && pwd` ;;
1945 if test -f $rsrc/Configure && \
1946 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1948 : found it, so we are ok.
1951 for src in . .. ../.. ../../.. ../../../..; do
1952 if test -f ../$src/Configure && \
1953 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1964 Sorry, I can't seem to locate the source dir for $package. Please start
1965 Configure with an explicit path -- i.e. /some/path/Configure.
1973 echo "Sources for $package found in \"$src\"." >&4
1977 : script used to extract .SH files with variable substitutions
1978 cat >extract <<'EOS'
1980 echo "Doing variable substitutions on .SH files..."
1981 if test -f MANIFEST; then
1982 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1984 echo "(Looking for .SH files under the source directory.)"
1985 set x `(cd "$src"; find . -name "*.SH" -print)`
1989 0) set x `(cd "$src"; echo *.SH)`; shift;;
1991 if test ! -f "$src/$1"; then
1997 while test $name; do
1998 if test ! -d "$name"; then
1999 create="$name $create";
2000 name=`echo $name | sed -e "s|^[^/]*$||"`;
2001 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2006 for file in $create; do
2015 dir=`expr X$file : 'X\(.*\)/'`
2016 file=`expr X$file : 'X.*/\(.*\)'`
2017 (cd "$dir" && . ./$file)
2027 dir=`expr X$file : 'X\(.*\)/'`
2028 file=`expr X$file : 'X.*/\(.*\)'`
2029 (set x $dir; shift; eval $mkdir_p)
2030 sh <"$src/$dir/$file"
2039 if test -f "$src/config_h.SH"; then
2040 if test ! -f config.h; then
2041 : oops, they left it out of MANIFEST, probably, so do it anyway.
2042 . "$src/config_h.SH"
2047 : extract files and exit if asked to do so
2048 case "$extractsh" in
2050 case "$realsilent" in
2054 case "$config_sh" in
2055 '') config_sh='config.sh';;
2058 echo "Fetching answers from $config_sh..."
2065 echo "Extraction done."
2070 : Eunice requires " " instead of "", can you believe it
2073 echo "Beginning of configuration questions for $package."
2075 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2077 : first determine how to suppress newline on echo command
2079 echo "Checking echo to see how to suppress newlines..."
2080 (echo "hi there\c" ; echo " ") >.echotmp
2081 if $contains c .echotmp >/dev/null 2>&1 ; then
2092 echo $n "The star should be here-->$c"
2096 : Now test for existence of everything in MANIFEST
2098 if test -f "$rsrc/MANIFEST"; then
2099 echo "First let's make sure your kit is complete. Checking..." >&4
2100 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2101 (split -l 50 2>/dev/null || split -50)
2104 for filelist in x??; do
2105 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2106 >/dev/null 2>>"$tmppwd/missing")
2108 if test -s missing; then
2112 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2114 You have the option of continuing the configuration process, despite the
2115 distinct possibility that your kit is damaged, by typing 'y'es. If you
2116 do, don't blame me if something goes wrong. I advise you to type 'n'o
2117 and contact the author (perlbug@perl.org).
2120 echo $n "Continue? [n] $c" >&4
2124 echo "Continuing..." >&4
2128 echo "ABORTING..." >&4
2133 echo "Looks good..."
2136 echo "There is no MANIFEST file. I hope your kit is complete !"
2140 : Find the appropriate value for a newline for tr
2141 if test -n "$DJGPP"; then
2144 if test X"$trnl" = X; then
2145 case "`echo foo | tr '\n' x 2>/dev/null`" in
2149 if test X"$trnl" = X; then
2150 case "`echo foo | tr '\012' x 2>/dev/null`" in
2151 foox) trnl='\012' ;;
2154 if test X"$trnl" = X; then
2155 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2156 fooxy) trnl='\n\r' ;;
2159 if test X"$trnl" = X; then
2162 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2168 : compute the number of columns on the terminal for proper question formatting
2173 : set up the echo used in my read
2174 myecho="case \"\$xxxm\" in
2175 '') echo $n \"\$rp $c\" >&4;;
2177 '') echo $n \"[\$xxxm] $c\";;
2179 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2181 echo $n \"[\$xxxm] $c\" >&4
2183 echo $n \"\$rp [\$xxxm] $c\" >&4
2189 : now set up to do reads with possible shell escape and default assignment
2195 case "\$fastread" in
2196 yes) case "\$dflt" in
2199 case "\$silent-\$rp" in
2204 *) case "\$silent" in
2205 true) case "\$rp" in
2210 while expr "X\$ans" : "X!" >/dev/null; do
2214 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2222 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2231 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2236 echo "(OK, I'll run with -d after this question.)" >&4
2239 echo "*** Sorry, \$1 not supported yet." >&4
2249 echo "*** Substitution done -- please confirm."
2251 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2256 echo "*** Error -- try again."
2263 case "\$ans\$xxxm\$nostick" in
2275 : create .config dir to save info across Configure sessions
2276 test -d ../.config || mkdir ../.config
2277 cat >../.config/README <<EOF
2278 This directory created by Configure to save information that should
2279 persist across sessions for $package.
2281 You may safely delete it if you wish.
2284 : See if we are using a devel version and want that
2285 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2288 usedevel="$define" ;;
2289 *) case "$xversion" in
2292 *** WHOA THERE!!! ***
2294 This is an UNSTABLE DEVELOPMENT release.
2295 The version of this $package distribution is $xversion, that is, odd,
2296 (as opposed to even) and that signifies a development release.
2297 If you want a maintenance release, you want an even-numbered version.
2299 Do ***NOT*** install this into production use.
2300 Data corruption and crashes are possible.
2302 It is most seriously suggested that you do not continue any further
2303 unless you want to help in developing and debugging Perl.
2305 If you *still* want to build perl, you can answer 'y' now,
2306 or pass -Dusedevel to Configure.
2309 rp='Do you really want to continue?'
2313 [yY]) echo >&4 "Okay, continuing."
2314 usedevel="$define" ;;
2315 *) echo >&4 "Okay, bye."
2326 case "$versiononly" in
2327 '') versiononly="$define" ;;
2329 case "$installusrbinperl" in
2330 '') installusrbinperl="$undef" ;;
2335 : general instructions
2338 user=`(logname) 2>/dev/null`
2340 '') user=`whoami 2>&1`;;
2342 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2345 rp='Would you like to see the instructions?'
2356 This installation shell script will examine your system and ask you questions
2357 to determine how the perl5 package should be installed. If you get
2358 stuck on a question, you may use a ! shell escape to start a subshell or
2359 execute a command. Many of the questions will have default answers in square
2360 brackets; typing carriage return will give you the default.
2362 On some of the questions which ask for file or directory names you are allowed
2363 to use the ~name construct to specify the login directory belonging to "name",
2364 even if you don't have a shell which knows about that. Questions where this is
2365 allowed will be marked "(~name ok)".
2369 dflt='Type carriage return to continue'
2373 The prompter used in this script allows you to use shell variables and
2374 backticks in your answers. You may use $1, $2, etc... to refer to the words
2375 in the default answer, as if the default line was a set of arguments given to a
2376 script shell. This means you may also use $* to repeat the whole default line,
2377 so you do not have to re-type everything to add something to the default.
2379 Every time there is a substitution, you will have to confirm. If there is an
2380 error (e.g. an unmatched backtick), the default answer will remain unchanged
2381 and you will be prompted again.
2383 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2384 the questions and use the computed defaults (or the previous answers if there
2385 was already a config.sh file). Type 'Configure -h' for a list of options.
2386 You may also start interactively and then answer '& -d' at any prompt to turn
2387 on the non-interactive behaviour for the remainder of the execution.
2393 Much effort has been expended to ensure that this shell script will run on any
2394 Unix system. If despite that it blows up on yours, your best bet is to edit
2395 Configure and run it again. If you can't run Configure for some reason,
2396 you'll have to generate a config.sh file by hand. Whatever problems you
2397 have, let me (perlbug@perl.org) know how I blew it.
2399 This installation script affects things in two ways:
2401 1) it may do direct variable substitutions on some of the files included
2403 2) it builds a config.h file for inclusion in C programs. You may edit
2404 any of these files as the need arises after running this script.
2406 If you make a mistake on a question, there is no easy way to back up to it
2407 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2408 files. Configure will offer to let you do this before it runs the SH files.
2411 dflt='Type carriage return to continue'
2413 case "$firsttime" in
2414 true) echo $user >>../.config/instruct;;
2418 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2419 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2420 if test "X$sysroot" = X; then
2425 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2426 # _sysroot is used in places where we need --sysroot=foo
2427 # but using the rest of the flags could cause issues.
2428 _sysroot="--sysroot=$sysroot";
2432 ccflags="$ccflags $_sysroot"
2437 ldflags="$ldflags $_sysroot"
2442 cppflags="$cppflags $_sysroot"
2444 # lddlflags updated below in lddlflags section;
2445 # same with cccdlflags
2449 # Adjust some defaults to also use $sysroot
2450 for var in xlibpth loclibpth locincpth glibpth; do
2453 for path in $xxx; do
2454 eval $var=\"\$$var $sysroot$path\"
2460 : find out where common programs are
2462 echo "Locating common programs..." >&4
2475 if test -d \$dir/\$thing; then
2481 for thisthing in \$dir/\$thing; do
2482 : just loop through to pick last item
2484 if test -f \$thisthing; then
2487 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2490 elif test -f \$dir/\$thing.exe; then
2491 if test -n "$DJGPP"; then
2492 echo \$dir/\$thing.exe
2493 elif test "$eunicefix" != ":"; then
2494 : on Eunice apparently
2547 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2548 pth="$pth $sysroot/lib $sysroot/usr/lib"
2549 for file in $loclist; do
2553 if test -f "$xxx"; then
2556 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2557 xxx=`./loc $file $file $pth`
2560 '') xxx=`./loc $file $file $pth`;;
2561 *) xxx=`./loc $xxx $xxx $pth`;;
2563 eval $file=$xxx$_exe
2567 echo $file is in $xxx.
2570 echo $file is in $xxx.
2573 echo "I don't know where '$file' is, and my life depends on it." >&4
2574 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2580 echo "Don't worry if any of the following aren't found..."
2582 for file in $trylist; do
2586 if test -f "$xxx"; then
2589 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2590 xxx=`./loc $file $file $pth`
2593 '') xxx=`./loc $file $file $pth`;;
2594 *) xxx=`./loc $xxx $xxx $pth`;;
2596 eval $file=$xxx$_exe
2600 echo $file is in $xxx.
2603 echo $file is in $xxx.
2606 echo "I don't see $file out there, $say."
2613 echo "Substituting grep for egrep."
2620 *) if $less -R </dev/null >/dev/null 2>&1; then
2621 echo "Substituting less -R for less."
2629 echo "Substituting cp for ln."
2638 echo "I can't find make or gmake, and my life depends on it." >&4
2639 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2647 *) # We can't have osname yet.
2648 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2649 # Assume that gmake, if found, is definitely GNU make
2650 # and prefer it over the system make.
2651 echo "Substituting gmake for make."
2659 echo "Hopefully test is built into your sh."
2662 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2663 echo "Using the test built into your sh."
2671 echo "Hopefully echo is built into your sh."
2676 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2677 $echo $n "hi there$c" >foo1
2678 echo $n "hi there$c" >foo2
2679 if cmp foo1 foo2 >/dev/null 2>&1; then
2680 echo "They are compatible. In fact, they may be identical."
2687 They are not compatible! You are probably running ksh on a non-USG system.
2688 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2689 have echo built in and we may have to run some Bourne shell scripts. That
2690 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2693 $echo $n "The star should be here-->$c"
2700 # This question was auctioned at YAPC::Europe-2007 in Vienna
2701 # I never promised you could answer it. I only auctioned the question.
2703 The following message is sponsored by
2705 Dresden.pm<--The stars should be here.
2707 Dear Perl user, system administrator or package
2708 maintainer, the Perl community sends greetings to
2709 you. Do you (emblematical) greet back [Y/n]? n
2713 : Check what type of C compiler we use
2717 cat <<'EOSC' >>trygcc
2722 int main(int argc, char *argv[]) {
2726 if $cc -o try $ccflags $ldflags try.c; then
2729 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2735 # Skip this test because it gives a false match on output like:
2736 # ./trygcc: line 23: cc: command not found
2737 # case "`$cc -v -c try.c 2>&1`" in
2738 # *gcc*) trygcc=no ;;
2740 if $test X"$trygcc" = Xyes; then
2741 if gcc -o try -c try.c; then
2743 echo "You seem to have a working gcc, though." >&4
2744 # Switching compilers may undo the work of hints files.
2745 # The most common problem is -D_REENTRANT for threads.
2746 # This heuristic catches that case, but gets false positives
2747 # if -Dusethreads was not actually specified. Better to
2748 # bail out here with a useful message than fail
2749 # mysteriously later. Should we perhaps just try to
2750 # re-invoke Configure -Dcc=gcc config_args ?
2751 if $test -f usethreads.cbu; then
2754 *** However, any setting of the C compiler flags (e.g. for thread support)
2755 *** will be lost. It may be necessary for you to restart Configure and
2756 *** add -Dcc=gcc to your Configure command line.
2759 rp="Would you like to go ahead and try gcc anyway?"
2762 rp="Would you like to use it?"
2765 if $test -f myread; then
2768 if $test -f UU/myread; then
2771 echo "Cannot find myread, sorry. Aborting." >&2
2776 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2789 cat <<'EOSC' >>checkcc
2794 int main(int argc, char *argv[]) {
2798 if $cc -o try $ccflags $ldflags try.c; then
2801 if $test X"$despair" = Xyes; then
2802 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2805 You need to find a working C compiler.
2806 Either (purchase and) install the C compiler supplied by your OS vendor,
2807 or for a free C compiler try http://gcc.gnu.org/
2808 I cannot continue any further, aborting.
2817 : determine whether symbolic links are supported
2820 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2821 echo "Symbolic links are supported." >&4
2824 echo "Symbolic links are NOT supported." >&4
2829 : determine whether symbolic links are supported
2833 echo "Checking how to test for symbolic links..." >&4
2835 if $test "X$issymlink" = X; then
2837 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2838 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2840 if test $? = 0; then
2843 echo "Your builtin 'test -h' may be broken." >&4
2846 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2849 if test -f "$p/$test"; then
2858 echo "Trying external '$test -h'." >&4
2859 issymlink="$test -h"
2860 if $test ! -h sym >/dev/null 2>&1; then
2861 echo "External '$test -h' is broken, too." >&4
2869 if $test "X$issymlink" = X; then
2870 if $test -L sym 2>/dev/null; then
2871 issymlink="$test -L"
2872 echo "The builtin '$test -L' worked." >&4
2875 if $test "X$issymlink" != X; then
2876 echo "You can test for symbolic links with '$issymlink'." >&4
2878 echo "I do not know how you can test for symbolic links." >&4
2882 *) echo "No symbolic links, so not testing for their testing..." >&4
2886 : Make symlinks util
2887 case "$mksymlinks" in
2890 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2893 *) case "$lns:$issymlink" in
2894 *"ln"*" -s:"*"test -"?)
2895 echo "Creating the symbolic links..." >&4
2897 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2907 print "# dir = ", dir, "file = ", file
2908 mf[dir] = mf[dir]" "source"/"dir"/"file;
2911 if (d != ".") { print("mkdir -p "d) }
2912 print("ln -sf "mf[d]" "d);
2914 }' source="$src" > UU/mksymlinks.$$
2918 if test ! -d t/base; then
2919 echo "Failed to create the subdirectories. Aborting." >&4
2923 if test ! -f t/base/lex.t; then
2924 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2927 if test ! -f win32/win32.c; then
2928 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2933 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2941 : Check for Cross-Compilation
2942 if $test "X$targethost" = "X"; then
2945 if $test "X$targetenv" = "X"; then
2948 case "$usecrosscompile" in
2950 $echo "Cross-compiling..."
2953 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2954 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2955 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2956 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2957 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2958 # leave out ld, choosing it is more complex
2959 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2960 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2961 # We are in a weird spot. Just before us, some values
2962 # were 'saved', to be restored after the hints are
2963 # run. This means that the changes we made to ar,
2964 # nm and ranlib will get reverted.
2965 # To avoid that, we hijack the saving mechanism and
2966 # have it save our new values.
2967 for file in ar nm ranlib; do
2969 eval $file=$xxx$_exe
2974 case "$targetarch" in
2975 '') echo "Targetarch not defined." >&4; croak=y ;;
2976 *) echo "Using targetarch $targetarch." >&4 ;;
2978 case "$targethost" in
2979 '') echo "Targethost not defined." >&4; croak=n ;;
2980 *) echo "Using targethost $targethost." >&4
2985 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2987 : compile a host miniperl and generate_uudmap, unless we got passed them
2988 if $test "X$hostperl" = X; then
2989 echo "Building host miniperl and generate_uudmap binaries" >&4
2997 $src/Configure -des -Dusedevel -Dmksymlinks
2999 case "$hostgenerate" in
3000 '') $make generate_uudmap
3001 hostgenerate=$src/host/generate_uudmap
3003 "$undef") hostgenerate=''
3006 hostperl=$src/host/miniperl
3009 hostosname=`$hostperl -le 'print $^O'`
3012 usecrosscompile="$undef"
3016 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3017 case "$targethost" in
3018 '') echo "Checking for cross-compile" >&4
3019 case "$usecrosscompile$multiarch" in
3020 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3021 if [ -f Makefile ]; then
3023 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3025 echo "Configure done."
3029 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3036 *) echo "Using targethost $targethost." >&4
3038 /*) run=$src/Cross/run
3039 targetmkdir=$src/Cross/mkdir
3041 from=$src/Cross/from
3043 *) pwd=`$test -f ../Configure & cd ..; pwd`
3045 targetmkdir=$pwd/Cross/mkdir
3047 from=$pwd/Cross/from
3050 case "$targetrun" in
3051 '') targetrun=ssh ;;
3056 case "$targetfrom" in
3057 '') targetfrom=scp ;;
3061 from=$from-$targetfrom
3062 case "$targetdir" in
3064 echo "Guessing targetdir $targetdir." >&4
3067 case "$targetuser" in
3069 echo "Guessing targetuser $targetuser." >&4
3072 case "$targetport" in
3074 echo "Guessing targetport $targetport." >&4
3077 case "$targetfrom" in
3081 case "$targetrun" in
3101 '') cwd=$targetdir ;;
3106 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3112 *) echo "Unknown targetrun '$targetrun'" >&4
3116 case "$targetmkdir" in
3118 cat >$targetmkdir <<EOF
3120 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3122 $chmod a+rx $targetmkdir
3124 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3136 $targetmkdir \`dirname \$f\`
3137 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3140 $targetmkdir $targetdir/\`dirname \$f\`
3141 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3154 $mkdir -p $targetdir/\`dirname \$f\`
3155 $cp \$f $targetdir/\$f || exit 1
3158 $targetmkdir $targetdir/\`dirname \$f\`
3159 $cp \$f $targetdir/\$f || exit 1
3166 *) echo "Unknown targetto '$targetto'" >&4
3170 case "$targetfrom" in
3177 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3182 cp) cat >$from <<EOF
3187 cp $targetdir/\$f . || exit 1
3192 *) echo "Unknown targetfrom '$targetfrom'" >&4
3196 if $test ! -f $run; then
3197 echo "Target 'run' script '$run' not found." >&4
3201 if $test ! -f $to; then
3202 echo "Target 'to' script '$to' not found." >&4
3206 if $test ! -f $from; then
3207 echo "Target 'from' script '$from' not found." >&4
3211 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3215 Using '$run' for remote execution,
3216 and '$from' and '$to'
3217 for remote file transfer.
3223 usecrosscompile="$undef"
3228 : see whether [:lower:] and [:upper:] are supported character classes
3230 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3232 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3236 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3237 # (0xd9 and 0xe2), therefore that is a nice testing point.
3238 if test "X$up" = X -o "X$low" = X; then
3239 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3245 if test "X$up" = X -o "X$low" = X; then
3246 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3252 if test "X$up" = X -o "X$low" = X; then
3253 case "`echo RS | od -x 2>/dev/null`" in
3255 echo "Hey, this might be EBCDIC." >&4
3256 if test "X$up" = X -o "X$low" = X; then
3257 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3258 rs) up='[A-IJ-RS-Z]'
3263 if test "X$up" = X -o "X$low" = X; then
3264 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3274 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3276 echo "Using $up and $low to convert case." >&4
3279 echo "I don't know how to translate letters from upper to lower case." >&4
3280 echo "Your tr is not acting any way I know of." >&4
3284 : set up the translation script tr, must be called with ./tr of course
3288 '[A-Z][a-z]') exec $tr '$up' '$low';;
3289 '[a-z][A-Z]') exec $tr '$low' '$up';;
3296 : Try to determine whether config.sh was made on this system
3297 case "$config_sh" in
3299 myuname=`$uname -a 2>/dev/null`
3300 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3301 # Downcase everything to avoid ambiguity.
3302 # Remove slashes and single quotes so we can use parts of this in
3303 # directory and file names.
3304 # Remove newlines so myuname is sane to use elsewhere.
3305 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3306 # because the A-Z/a-z are not consecutive.
3307 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3308 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3309 newmyuname="$myuname"
3311 case "$knowitall" in
3313 if test -f ../config.sh; then
3314 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3315 eval "`grep myuname= ../config.sh`"
3317 if test "X$myuname" = "X$newmyuname"; then
3325 : Get old answers from old config file if Configure was run on the
3326 : same system, otherwise use the hints.
3329 if test -f config.sh; then
3331 rp="I see a config.sh file. Shall I use it to set the defaults?"
3334 n*|N*) echo "OK, I'll ignore it."
3335 mv config.sh config.sh.old
3336 myuname="$newmyuname"
3338 *) echo "Fetching default answers from your old config.sh file..." >&4
3346 : Older versions did not always set $sh. Catch re-use of such
3356 if test ! -f config.sh; then
3359 First time through, eh? I have some defaults handy for some systems
3360 that need some extra help getting the Configure answers right:
3363 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3365 : Half the following guesses are probably wrong... If you have better
3366 : tests or hints, please send them to perlbug@perl.org
3367 : The metaconfig authors would also appreciate a copy...
3368 $test -f /irix && osname=irix
3369 $test -f /xenix && osname=sco_xenix
3370 $test -f /dynix && osname=dynix
3371 $test -f /dnix && osname=dnix
3372 $test -f /lynx.os && osname=lynxos
3373 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3374 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3375 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3376 $test -f /bin/mips && /bin/mips && osname=mips
3377 $test -d /usr/apollo/bin && osname=apollo
3378 $test -f /etc/saf/_sactab && osname=svr4
3379 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3380 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3381 $test -f /sys/utilities/MultiView && osname=amigaos
3382 if $test -d /MachTen -o -d /MachTen_Folder; then
3384 if $test -x /sbin/version; then
3385 osvers=`/sbin/version | $awk '{print $2}' |
3386 $sed -e 's/[A-Za-z]$//'`
3387 elif $test -x /usr/etc/version; then
3388 osvers=`/usr/etc/version | $awk '{print $2}' |
3389 $sed -e 's/[A-Za-z]$//'`
3395 $test -f /sys/posix.dll &&
3396 $test -f /usr/bin/what &&
3397 set X `/usr/bin/what /sys/posix.dll` &&
3398 $test "$3" = UWIN &&
3402 if $test -f $uname; then
3410 umips) osname=umips ;;
3413 [23]100) osname=mips ;;
3415 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3416 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3419 elif $test -f /etc/kconfig; then
3421 if test "$lns" = "$ln -s"; then
3423 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3425 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3432 if test -n "$DJGPP"; then
3441 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3443 # oslevel can fail with:
3444 # oslevel: Unable to acquire lock.
3445 *not\ found) osvers="$4"."$3" ;;
3446 '<3240'|'<>3240') osvers=3.2.0 ;;
3447 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3448 '=3250'|'>3250') osvers=3.2.5 ;;
3452 bitrig) osname=bitrig
3455 bsd386) osname=bsd386
3458 cygwin*) osname=cygwin
3461 *dc.osx) osname=dcosx
3467 domainos) osname=apollo
3473 dragonfly) osname=dragonfly
3476 dynixptx*) osname=dynixptx
3477 osvers=`echo "$4"|sed 's/^v//'`
3479 freebsd) osname=freebsd
3481 genix) osname=genix ;;
3485 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3498 $test -f /system/lib/libandroid.so && osname=linux-android
3505 netbsd*) osname=netbsd
3508 news-os) osvers="$3"
3510 4*) osname=newsos4 ;;
3514 nonstop-ux) osname=nonstopux ;;
3515 openbsd) osname=openbsd
3521 POSIX-BC | posix-bc ) osname=posix-bc
3524 powerux | power_ux | powermax_os | powermaxos | \
3525 powerunix | power_unix) osname=powerux
3531 solaris) osname=solaris
3533 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3540 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3544 titanos) osname=titanos
3553 ultrix) osname=ultrix
3556 osf1|mls+) case "$5" in
3559 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3562 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3565 hp*) osname=hp_osf1 ;;
3566 mips) osname=mips_osf1 ;;
3569 # UnixWare 7.1.2 is known as Open UNIX 8
3570 openunix|unixware) osname=svr5
3578 $2) case "$osname" in
3582 : svr4.x or possibly later
3592 if test -f /stand/boot ; then
3593 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3594 if test -n "$INITPROG" -a -f "$INITPROG"; then
3595 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3596 if test -n "$isesix"; then
3604 *) if test -f /etc/systemid; then
3606 set `echo $3 | $sed 's/\./ /g'` $4
3607 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3609 elif $test -f $src/hints/sco_$1_$2.sh; then
3611 elif $test -f $src/hints/sco_$1.sh; then
3616 '') : Still unknown. Probably a generic Sys V.
3625 *) case "$osname" in
3626 '') : Still unknown. Probably a generic BSD.
3634 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3635 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3636 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3639 $rm -f UU/kernel.what
3640 elif test -d c:/. -o -n "$is_os2" ; then
3647 case "$targetarch" in
3650 case "$targetarch" in
3652 # Will load qnx.sh, which should change osname to nto
3657 # Catch arm-linux-androideabi, mipsel-linux-android,
3658 # and i686-linux-android
3659 osname=linux-android
3663 # Something like arm-linux-gnueabihf is really just
3670 # XXX perhaps we should just assume
3671 # osvers to be 2, or maybe take the value
3672 # from targetarch. Using $run before the
3673 # hints are run is somewhat icky.
3674 set X `$run $uname -a 2>/dev/null`
3677 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3682 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3689 : Now look for a hint file osname_osvers, unless one has been
3690 : specified already.
3693 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3694 : Also try without trailing minor version numbers.
3695 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3696 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3697 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3698 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3701 *) case "$osvers" in
3704 *) if $test -f $src/hints/$file.sh ; then
3706 elif $test -f $src/hints/$xfile.sh ; then
3708 elif $test -f $src/hints/$xxfile.sh ; then
3710 elif $test -f $src/hints/$xxxfile.sh ; then
3712 elif $test -f $src/hints/$xxxxfile.sh ; then
3714 elif $test -f "$src/hints/${osname}.sh" ; then
3723 if $test -f Policy.sh ; then
3726 none) dflt="Policy" ;;
3727 *) dflt="Policy $dflt" ;;
3732 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3736 if $test -f Policy.sh ; then
3739 There's also a Policy hint file available, which should make the
3740 site-specific (policy) questions easier to answer.
3747 You may give one or more space-separated answers, or "none" if appropriate.
3748 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3749 previous run of Configure, you may specify it as well as or instead of
3750 OS-specific hints. If hints are provided for your OS, you should use them:
3751 although Perl can probably be built without hints on many platforms, using
3752 hints often improve performance and may enable features that Configure can't
3753 set up on its own. If there are no hints that match your OS, specify "none";
3754 DO NOT give a wrong version or a wrong OS.
3758 rp="Which of these apply, if any?"
3761 for file in $tans; do
3762 if $test X$file = XPolicy -a -f Policy.sh; then
3764 $cat Policy.sh >> UU/config.sh
3765 elif $test -f $src/hints/$file.sh; then
3766 . $src/hints/$file.sh
3767 $cat $src/hints/$file.sh >> UU/config.sh
3768 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3771 : Give one chance to correct a possible typo.
3772 echo "$file.sh does not exist"
3774 rp="hint to use instead?"
3776 for file in $ans; do
3777 if $test -f "$src/hints/$file.sh"; then
3778 . $src/hints/$file.sh
3779 $cat $src/hints/$file.sh >> UU/config.sh
3780 elif $test X$ans = X -o X$ans = Xnone ; then
3783 echo "$file.sh does not exist -- ignored."
3790 : Remember our hint file for later.
3791 if $test -f "$src/hints/$file.sh" ; then
3801 echo "Fetching default answers from $config_sh..." >&4
3805 cp $config_sh config.sh 2>/dev/null
3817 : Restore computed paths
3818 for file in $loclist $trylist; do
3819 eval $file="\$_$file"
3824 Configure uses the operating system name and version to set some defaults.
3825 The default value is probably right if the name rings a bell. Otherwise,
3826 since spelling matters for me, either accept the default or answer "none"
3833 ''|' '|none) dflt=none ;;
3834 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3837 *) dflt="$osname" ;;
3839 rp="Operating system name?"
3843 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3849 ''|' '|none) dflt=none ;;
3850 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3851 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3853 ''|' ') dflt=none ;;
3858 *) dflt="$osvers" ;;
3860 rp="Operating system version?"
3870 : who configured the system
3871 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3874 cf_by=`(logname) 2>/dev/null`
3877 cf_by=`(whoami) 2>/dev/null`
3879 "") cf_by=unknown ;;
3884 : decide how portable to be. Allow command line overrides.
3885 case "$d_portable" in
3887 *) d_portable="$define" ;;
3890 : set up shell script to do ~ expansion
3896 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3899 if $test -f /bin/csh; then
3900 /bin/csh -f -c "glob \$1"
3905 name=\`$expr x\$1 : '..\([^/]*\)'\`
3906 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3907 if $test ! -d "\$dir"; then
3909 echo "\$me: can't locate home directory for: \$name" >&2
3914 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3930 : now set up to get a file name
3934 cat <<'EOSC' >>getfile
3950 : getfile will accept an answer from the comma-separated list
3951 : enclosed in parentheses even if it does not meet other criteria.
3952 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3953 fn=`echo $fn | sed 's/(.*)//'`
3959 loc_file=`expr $fn : '.*:\(.*\)'`
3960 fn=`expr $fn : '\(.*\):.*'`
3968 */*) fullpath=true;;
3977 *e*) exp_file=true;;
3980 *p*) nopath_ok=true;;
3985 *d*) type='Directory';;
3986 *l*) type='Locate';;
3991 Locate) what='File';;
3996 case "$d_portable" in
4004 while test "$type"; do
4009 true) rp="$rp (~name ok)";;
4012 if test -f UU/getfile.ok && \
4013 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4032 value=`UU/filexp $ans`
4035 if test "$ans" != "$value"; then
4036 echo "(That expands to $value on this system.)"
4050 /*) value="$ansexp" ;;
4051 [a-zA-Z]:/*) value="$ansexp" ;;
4056 echo "I shall only accept a full path name, as in /bin/ls." >&4
4057 echo "Use a ! shell escape if you wish to check pathnames." >&4
4060 echo "Please give a full path name, starting with slash." >&4
4063 echo "Note that using ~name is ok provided it expands well." >&4
4076 for fp in $gfpth; do
4077 if test "X$fp" = X.; then
4082 if test -f "$pf"; then
4084 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4086 echo "($value is not a plain file, but that's ok.)"
4089 if test X"$type" = X; then
4096 for fp in $gfpth; do
4097 if test "X$fp" = X.; then
4102 direxp="$fp/$ansexp"
4104 if test -d "$direxp"; then
4112 if test -d "$ansexp"; then
4113 echo "(Looking for $loc_file in directory $value.)"
4114 value="$value/$loc_file"
4115 ansexp="$ansexp/$loc_file"
4117 if test -f "$ansexp"; then
4120 case "$nopath_ok" in
4121 true) case "$value" in
4123 *) echo "Assuming $value will be in people's path."
4139 if test "$fastread" = yes; then
4144 rp="$what $value doesn't exist. Use that name anyway?"
4163 test "X$gfpthkeep" != Xy && gfpth=""
4166 : determine root of directory hierarchy where package will be installed.
4169 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4172 dflt=`echo "$prefix" | sed 's/.$//'`
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?'
4198 *) oldprefix="$prefix";;
4205 : allow them to override the AFS root
4208 *) afsroot=$afsroot ;;
4214 $define|true) afs=true ;;
4215 $undef|false) afs=false ;;
4216 *) if $test -d $afsroot; then
4224 echo "AFS may be running... I'll be extra cautious then..." >&4
4226 echo "AFS does not seem to be running..." >&4
4229 : determine installation prefix for where package is to be installed.
4233 Since you are running AFS, I need to distinguish the directory in which
4234 files will reside from the directory in which they are installed (and from
4235 which they are presumably copied to the former directory by occult means).
4238 case "$installprefix" in
4239 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4240 *) dflt="$installprefix";;
4245 In some special cases, particularly when building $package for distribution,
4246 it is convenient to distinguish the directory in which files should be
4247 installed from the directory ($prefix) in which they will
4248 eventually reside. For most users, these two directories are the same.
4251 case "$installprefix" in
4253 *) dflt=$installprefix;;
4257 rp='What installation prefix should I use for installing files?'
4259 installprefix="$ans"
4260 installprefixexp="$ansexp"
4262 : Perform the prefixexp/installprefixexp correction if necessary
4263 cat <<EOS >installprefix
4266 cat <<'EOSC' >>installprefix
4267 : Change installation prefix, if necessary.
4268 if $test X"$prefix" != X"$installprefix"; then
4269 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4271 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4274 chmod +x installprefix
4275 $eunicefix installprefix
4277 : Set variables such as privlib and privlibexp from the output of ./getfile
4278 : performing the prefixexp/installprefixexp correction if necessary.
4279 cat <<EOS >setprefixvar
4282 cat <<'EOSC' >>setprefixvar
4283 eval "${prefixvar}=\"\$ans\""
4284 eval "${prefixvar}exp=\"\$ansexp\""
4287 chmod +x setprefixvar
4288 $eunicefix setprefixvar
4290 : set up the script used to warn in case of inconsistency
4299 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4301 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4302 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4307 echo "*** WHOA THERE!!! ***" >&4
4308 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4311 rp=" Keep the $hint value?"
4314 y) td=$was; tu=$was;;
4318 : function used to set '$1' to '$val'
4319 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4321 $define$undef) . ./whoa; eval "$var=\$td";;
4322 $undef$define) . ./whoa; eval "$var=\$tu";;
4323 *) eval "$var=$val";;
4326 : get the patchlevel
4328 echo "Getting the current patchlevel..." >&4
4329 if $test -r $rsrc/patchlevel.h;then
4330 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4331 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4332 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4333 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4334 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4335 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4336 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4345 $echo "(You do not have patchlevel.h. Eek.)"
4347 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4348 version_patchlevel_string="version $patchlevel subversion $subversion"
4349 case "$perl_patchlevel" in
4351 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4352 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4356 $echo "(You have $package $version_patchlevel_string.)"
4360 : XXX Should be a Configure test for double-dots in filenames.
4361 version=`echo $revision $patchlevel $subversion | \
4362 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4363 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4364 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4367 version=`echo $revision $patchlevel $subversion | \
4368 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4369 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4370 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4373 : Special case the 5.005_xx maintenance series, which used 5.005
4374 : without any subversion label as a subdirectory in $sitelib
4375 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4376 api_versionstring='5.005'
4379 : Do we want threads support and if so, what type
4380 case "$usethreads" in
4381 $define|true|[yY]*) dflt='y';;
4382 *) # Catch case where user specified ithreads or 5005threads but
4383 # forgot -Dusethreads (A.D. 4/2002)
4384 case "$useithreads$use5005threads" in
4385 *$define*) dflt='y';;
4392 Perl can be built to offer a form of threading support on some systems
4393 To do so, Configure can be run with -Dusethreads.
4395 Note that Perl built with threading support runs slightly slower
4396 and uses slightly more memory than plain Perl.
4398 If this doesn't make any sense to you, just accept the default '$dflt'.
4400 rp='Build a threading Perl?'
4403 y|Y) val="$define" ;;
4409 if $test $patchlevel -lt 9; then
4410 case "$usethreads" in
4412 : Default to ithreads unless overridden on command line or with
4415 case "$use5005threads" in
4417 echo "5.005 threads are no longer supported"
4421 case "$useithreads" in
4422 $undef|false|[nN]*) dflt='n';;
4424 rp='Use the newer interpreter-based ithreads?'
4427 y|Y) val="$define" ;;
4432 : Now set use5005threads to the opposite value.
4433 case "$useithreads" in
4434 $define) val="$undef" ;;
4441 useithreads="$undef"
4442 use5005threads="$undef"
4446 case "$useithreads$use5005threads" in
4450 You cannot have both the ithreads and the 5.005 threads enabled
4451 at the same time. Disabling the 5.005 threads since they are
4452 much less stable than the ithreads.
4455 use5005threads="$undef"
4460 : perl-5.9.x and later
4462 if test X"$usethreads" = "X$define"; then
4463 case "$use5005threads" in
4467 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4474 use5005threads="$undef"
4475 useithreads="$usethreads"
4478 case "$d_oldpthreads" in
4479 '') : Configure tests would be welcome here. For now, assume undef.
4481 *) val="$d_oldpthreads" ;;
4487 : Look for a hint-file generated 'call-back-unit'. If the
4488 : user has specified that a threading perl is to be built,
4489 : we may need to set or change some other defaults.
4490 if $test -f usethreads.cbu; then
4491 echo "Your platform has some specific hints regarding threaded builds, using them..."
4494 case "$usethreads" in
4495 "$define"|true|[yY]*)
4497 (Your platform does not have any specific hints for threaded builds.
4498 Assuming POSIX threads, then.)
4504 : Check if multiplicity is required
4507 Perl can be built so that multiple Perl interpreters can coexist
4508 within the same Perl executable.
4511 case "$useithreads" in
4514 This multiple interpreter support is required for interpreter-based threads.
4518 *) case "$usemultiplicity" in
4519 $define|true|[yY]*) dflt='y';;
4523 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4524 rp='Build Perl for multiplicity?'
4527 y|Y) val="$define" ;;
4535 : Check if morebits is requested
4536 case "$usemorebits" in
4537 "$define"|true|[yY]*)
4538 use64bitint="$define"
4539 uselongdouble="$define"
4540 usemorebits="$define"
4542 *) usemorebits="$undef"
4546 : Determine the C compiler to be used
4552 rp="Use which C compiler?"
4556 : See whether they have no cc but they do have gcc
4558 if $test -f cc.cbu; then
4563 : make some quick guesses about what we are up against
4565 $echo $n "Hmm... $c"
4575 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4576 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4578 echo "Looks kind of like an OSF/1 system, but we'll see..."
4580 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4581 xxx=`./loc addbib blurfl $pth`
4582 if $test -f $xxx; then
4583 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4587 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4588 echo "Looks kind of like an extended USG system, but we'll see..."
4590 echo "Looks kind of like a USG system, but we'll see..."
4594 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4595 echo "Looks kind of like a BSD system, but we'll see..."
4599 echo "Looks kind of like a Version 7 system, but we'll see..."
4602 case "$eunicefix" in
4605 There is, however, a strange, musty smell in the air that reminds me of
4606 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4610 : it so happens the Eunice I know will not run shell scripts in Unix format
4614 echo "Congratulations. You aren't running Eunice."
4618 : Detect OS2. The p_ variable is set above in the Head.U unit.
4619 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4620 : semicolon as a patch separator
4625 I have the feeling something is not exactly right, however...don't tell me...
4626 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4627 (Or you may be running DOS with DJGPP.)
4632 if test -f /xenix; then
4633 echo "Actually, this looks more like a XENIX system..."
4638 echo "It's not Xenix..."
4643 if test -f /venix; then
4644 echo "Actually, this looks more like a VENIX system..."
4651 echo "Nor is it Venix..."
4654 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4655 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4658 : Check if we are using GNU gcc and what its version is
4660 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4664 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4666 printf("%s\n", __VERSION__);
4668 printf("%s\n", "1");
4674 if $cc -o try $ccflags $ldflags try.c; then
4675 gccversion=`$run ./try`
4676 case "$gccversion" in
4677 '') echo "You are not using GNU cc." ;;
4678 *) echo "You are using GNU cc $gccversion."
4684 echo "*** WHOA THERE!!! ***" >&4
4685 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4686 case "$knowitall" in
4688 echo " You'd better start hunting for one and let me know about it." >&4
4694 case "$gccversion" in
4695 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4697 case "$gccversion" in
4698 '') gccosandvers='' ;;
4699 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4700 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4702 case "$gccosandvers" in
4703 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4704 $osname$osvers) ;; # looking good
4705 $osname*) cat <<EOM >&4
4707 *** WHOA THERE!!! ***
4709 Your gcc has not been compiled for the exact release of
4710 your operating system ($gccosandvers versus $osname$osvers).
4712 In general it is a good idea to keep gcc synchronized with
4713 the operating system because otherwise serious problems
4714 may ensue when trying to compile software, like Perl.
4716 I'm trying to be optimistic here, though, and will continue.
4717 If later during the configuration and build icky compilation
4718 problems appear (headerfile conflicts being the most common
4719 manifestation), I suggest reinstalling the gcc to match
4720 your operating system release.
4724 *) gccosandvers='' ;; # failed to parse, better be silent
4732 # gcc 3.* complain about adding -Idirectories that they already know about,
4733 # so we will take those off from locincpth.
4734 case "$gccversion" in
4736 echo "main(){}">try.c
4737 for incdir in $locincpth; do
4738 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4739 grep '^c[cp]p*[01]: warning: changing search order '`
4740 if test "X$warn" != X; then
4741 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4747 # gcc 4.9 by default does some optimizations that break perl.
4748 # see ticket 121505.
4750 # The -fwrapv disables those optimizations (and probably others,) so
4751 # for gcc 4.9 (and later, since the optimizations probably won't go
4752 # away), add -fwrapv unless the user requests -fno-wrapv, which
4753 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4754 # which turns the overflows -fwrapv ignores into runtime errors.
4755 case "$gccversion" in
4756 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4758 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4759 *) ccflags="$ccflags -fwrapv" ;;
4763 : What should the include directory be ?
4764 : Use sysroot if set, so findhdr looks in the right place.
4766 $echo $n "Hmm... $c"
4767 dflt="$sysroot/usr/include"
4770 if $test -f /bin/mips && /bin/mips; then
4771 echo "Looks like a MIPS system..."
4772 $cat >usr.c <<'EOCP'
4773 #ifdef SYSTYPE_BSD43
4777 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4778 dflt='/bsd43/usr/include'
4782 mips_type='System V'
4784 $rm -f usr.c usr.out
4785 echo "and you're compiling with the $mips_type compiler and libraries."
4789 echo "Doesn't look like a MIPS system."
4799 case "$xxx_prompt" in
4802 rp='Where are the include files you want to use?'
4810 : see how we invoke the C preprocessor
4812 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4813 cat <<'EOT' >testcpp.c
4819 if test ! -f cppstdin; then
4820 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4821 # AIX cc -E doesn't show the absolute headerfile
4822 # locations but we'll cheat by using the -M flag.
4823 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
4825 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4828 echo "Keeping your $hint cppstdin wrapper."
4831 wrapper=`pwd`/cppstdin
4835 if $test "X$cppstdin" != "X" && \
4836 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4837 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4839 echo "You used to use $cppstdin $cppminus so we'll use that again."
4841 '') echo "But let's see if we can live without a wrapper..." ;;
4843 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4844 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4846 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4849 echo "(However, $cpprun $cpplast does not work, let's see...)"
4857 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4864 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4865 $cc -E <testcpp.c >testcpp.out 2>&1; \
4866 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4867 echo "Yup, it does."
4868 x_cpp="$cc $cppflags -E"
4870 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4871 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4872 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4873 echo "Yup, it does."
4874 x_cpp="$cc $cppflags -E"
4876 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4877 $cc -P <testcpp.c >testcpp.out 2>&1; \
4878 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 echo "Yipee, that works!"
4880 x_cpp="$cc $cppflags -P"
4882 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4883 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4884 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 echo "At long last!"
4886 x_cpp="$cc $cppflags -P"
4888 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4889 $cpp <testcpp.c >testcpp.out 2>&1; \
4890 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4892 x_cpp="$cpp $cppflags"
4894 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4895 $cpp - <testcpp.c >testcpp.out 2>&1; \
4896 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4897 echo "Hooray, it works! I was beginning to wonder."
4898 x_cpp="$cpp $cppflags"
4900 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4901 $wrapper <testcpp.c >testcpp.out 2>&1; \
4902 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4908 rp="No dice. I can't find a C preprocessor. Name one:"
4912 $x_cpp <testcpp.c >testcpp.out 2>&1
4913 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4914 echo "OK, that will do." >&4
4916 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4931 echo "Perhaps can we force $cc -E using a wrapper..."
4932 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4933 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4939 echo "Nope, we'll have to live without it..."
4953 "$wrapper"|'cppstdin') ;;
4954 *) $rm -f $wrapper;;
4956 $rm -f testcpp.c testcpp.out
4958 : Adjust cppfilter for path component separator
4960 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4961 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4965 : Use gcc to determine libpth and incpth
4966 # If using gcc or clang, we can get better values for libpth, incpth
4967 # and usrinc directly from the compiler.
4968 # Note that ccname for clang is also gcc.
4971 $echo 'extern int foo;' > try.c
4972 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4974 if $test $# -gt 0; then
4976 incpth="`$echo $incpth|$sed 's/^ //'`"
4978 j="`$echo $i|$sed 's,/include$,/lib,'`"
4979 if $test -d $j; then
4983 libpth="`$echo $libpth|$sed 's/^ //'`"
4984 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4985 if $test -d $xxx; then
4988 *) libpth="$libpth $xxx";;
4995 '') for i in $incpth; do
4996 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5004 case "$usecrosscompile" in
5007 '') echo "Incpth not defined." >&4; croak=y ;;
5008 *) echo "Using incpth '$incpth'." >&4 ;;
5011 '') echo "Libpth not defined." >&4; croak=y ;;
5012 *) echo "Using libpth '$libpth'." >&4 ;;
5015 '') echo "Usrinc not defined." >&4; croak=y ;;
5016 *) echo "Using usrinc $usrinc." >&4 ;;
5020 if test "X$sysroot" = X; then
5021 echo "Cannot continue, aborting." >&4; exit 1
5023 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5032 : Default value for incpth is just usrinc
5034 '') incpth="$usrinc";;
5037 : Set private lib path
5040 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5045 '') dlist="$loclibpth $plibpth $glibpth";;
5046 *) dlist="$libpth";;
5049 : Now check and see which directories actually exist, avoiding duplicates
5052 if $test -d $xxx; then
5055 *) libpth="$libpth $xxx";;
5061 Some systems have incompatible or broken versions of libraries. Among
5062 the directories listed in the question below, please remove any you
5063 know not to be holding relevant libraries, and add any that are needed.
5064 Say "none" for none.
5068 if test "X$sysroot" != X; then
5070 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5083 rp="Directories to use for library searches?"
5090 : compute shared library extension
5093 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5103 On some systems, shared libraries may be available. Answer 'none' if
5104 you want to suppress searching of shared libraries for the remainder
5105 of this configuration.
5108 rp='What is the file extension used for shared libraries?'
5112 : Does target system insist that shared library basenames are unique
5115 Some dynamic loaders assume that the *basename* of shared library filenames
5116 are globally unique. We'll default this to undef as we assume your system
5117 is not this weird. Set to defined if you're on one of them.
5122 rp='Make shared library basenames unique?'
5125 y|Y) val="$define" ;;
5128 set d_libname_unique
5131 : Define several unixisms.
5132 : Hints files or command line option can be used to override them.
5133 : The convoluted testing is in case hints files set either the old
5136 '') case "$exe_ext" in
5138 *) _exe="$exe_ext" ;;
5143 '') case "$lib_ext" in
5150 '') case "$obj_ext" in
5157 '') case "$path_sep" in
5168 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5170 : Which makefile gets called first. This is used by make depend.
5171 case "$firstmakefile" in
5172 '') firstmakefile='makefile';;
5175 : Check is we will use socks
5177 $define|true|[yY]*) dflt='y';;
5182 Perl can be built to use the SOCKS proxy protocol library. To do so,
5183 Configure must be run with -Dusesocks. If you use SOCKS you also need
5184 to use the PerlIO abstraction layer, this will be implicitly selected.
5186 If this doesn't make any sense to you, just accept the default '$dflt'.
5188 rp='Build Perl for SOCKS?'
5191 y|Y) val="$define" ;;
5197 : Check for uselongdouble support
5199 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5202 case "$uselongdouble" in
5203 $define|true|[yY]*) dflt='y';;
5208 Perl can be built to take advantage of long doubles which
5209 (if available) may give more accuracy and range for floating point numbers.
5211 If this doesn't make any sense to you, just accept the default '$dflt'.
5213 rp='Try to use long doubles if available?'
5216 y|Y) val="$define" ;;
5222 case "$uselongdouble" in
5223 true|[yY]*) uselongdouble="$define" ;;
5226 : Look for a hint-file generated 'call-back-unit'. If the
5227 : user has specified that long doubles should be used,
5228 : we may need to set or change some other defaults.
5229 if $test -f uselongdouble.cbu; then
5230 echo "Your platform has some specific hints regarding long doubles, using them..."
5231 . ./uselongdouble.cbu
5233 case "$uselongdouble" in
5236 (Your platform does not have any specific hints for long doubles.)
5242 : Check if quadmath is requested
5243 case "$usequadmath" in
5244 "$define"|true|[yY]*) usequadmath="$define" ;;
5245 *) usequadmath="$undef" ;;
5248 : Fail if both uselongdouble and usequadmath are requested
5249 case "$usequadmath:$uselongdouble" in
5253 *** You requested the use of the quadmath library and use
5254 *** of long doubles.
5256 *** Please select one or the other.
5262 : Looking for optional libraries
5264 echo "Checking for optional libraries..." >&4
5269 case "$libswanted" in
5270 '') libswanted='c_s';;
5273 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5275 case "$usecbacktrace" in
5276 "$define") libswanted="$libswanted bfd" ;;
5278 case "$usequadmath" in
5279 "$define") libswanted="$libswanted quadmath" ;;
5285 for thisdir in $libpth $xlibpth; do
5286 test -d $thisdir && libspath="$libspath $thisdir"
5288 for thislib in $libswanted; do
5289 for thisdir in $libspath; do
5291 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5292 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5293 $test -f "$xxx" && eval $libscheck
5294 $test -f "$xxx" && libstyle=shared
5295 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5296 $test -f "$xxx" && eval $libscheck
5297 $test -f "$xxx" && libstyle=shared
5299 if test ! -f "$xxx"; then
5300 xxx=$thisdir/lib$thislib.$so
5301 $test -f "$xxx" && eval $libscheck
5302 $test -f "$xxx" && libstyle=shared
5304 if test ! -f "$xxx"; then
5305 xxx=$thisdir/lib$thislib$_a
5306 $test -f "$xxx" && eval $libscheck
5307 $test -f "$xxx" && libstyle=static
5309 if test ! -f "$xxx"; then
5310 xxx=$thisdir/$thislib$_a
5311 $test -f "$xxx" && eval $libscheck
5312 $test -f "$xxx" && libstyle=static
5314 if test ! -f "$xxx"; then
5315 xxx=$thisdir/lib${thislib}_s$_a
5316 $test -f "$xxx" && eval $libscheck
5317 $test -f "$xxx" && libstyle=static
5318 $test -f "$xxx" && thislib=${thislib}_s
5320 if test ! -f "$xxx"; then
5321 xxx=$thisdir/Slib$thislib$_a
5322 $test -f "$xxx" && eval $libscheck
5323 $test -f "$xxx" && libstyle=static
5325 if $test -f "$xxx"; then
5327 shared) echo "Found -l$thislib (shared)." ;;
5328 static) echo "Found -l$thislib." ;;
5329 *) echo "Found -l$thislib ($libstyle)." ;;
5333 *) dflt="$dflt -l$thislib"
5334 libsfound="$libsfound $xxx"
5336 libsfiles="$libsfiles $yyy"
5337 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5338 case " $libsdirs " in
5340 *) libsdirs="$libsdirs $yyy" ;;
5347 if $test ! -f "$xxx"; then
5348 echo "No -l$thislib."
5359 ' '|'') dflt='none';;
5364 In order to compile $package on your machine, a number of libraries
5365 are usually needed. Include any other special libraries here as well.
5366 Say "none" for none. The default list is almost always right.
5370 rp="What libraries to use?"
5377 : determine optimization, if desired, or use for debug flag also
5379 ' '|$undef) dflt='none';;
5381 *) dflt="$optimize";;
5385 By default, $package compiles with the -O flag to use the optimizer.
5386 Alternately, you might want to use the symbolic debugger, which uses
5387 the -g flag (on traditional Unix systems). Either flag can be
5388 specified here. To use neither flag, specify the word "none".
5391 rp="What optimizer/debugger flag should be used?"
5395 'none') optimize=" ";;
5398 : Check what DEBUGGING is required from the command line
5399 : -DEBUGGING or -DDEBUGGING or
5400 : -DEBUGGING=both = -g + -DDEBUGGING
5401 : -DEBUGGING=-g or -Doptimize=-g = -g
5402 : -DEBUGGING=none or -UDEBUGGING =
5403 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5406 *) DEBUGGING=$EBUGGING ;;
5409 case "$DEBUGGING" in
5413 *) optimize="$optimize -g" ;;
5417 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5425 case "$DEBUGGING" in
5426 both|$define) dflt='-DDEBUGGING'
5429 : argument order is deliberate, as the flag will start with - which set could
5430 : think is an option
5431 checkccflag='check=$1; flag=$2; callback=$3;
5433 echo "Checking if your compiler accepts $flag" 2>&1;
5434 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5435 echo "int main(void) { return 0; }" > gcctest.c;
5436 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5437 echo "Yes, it does." 2>&1;
5438 if $test -s gcctest.out ; then
5439 echo "But your platform does not like it:";
5444 echo "Leaving current flags $ccflags alone." 2>&1
5446 *) dflt="$dflt $flag";
5452 echo "Nope, it does not, but that is ok." 2>&1;
5456 : We will not override a previous value, but we might want to
5457 : augment a hint file
5459 default|recommended)
5460 case "$gccversion" in
5461 1*) dflt="$dflt -fpcc-struct-return" ;;
5463 case "$optimize:$DEBUGGING" in
5464 *-g*:old) dflt="$dflt -DDEBUGGING";;
5466 case "$gccversion" in
5467 2*) if $test -d /etc/conf/kconfig.d &&
5468 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5470 # Interactive Systems (ISC) POSIX mode.
5475 case "$gccversion" in
5478 ?*) set strict-aliasing -fno-strict-aliasing
5482 # For gcc, adding -pipe speeds up compilations for some, but apparently
5483 # some assemblers can't read from stdin. (It also slows down compilations
5484 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5485 case "$gccversion" in
5491 # on x86_64 (at least) we require an extra library (libssp) in the
5492 # link command line. This library is not named, so I infer that it is
5493 # an implementation detail that may change. Hence the safest approach
5494 # is to add the flag to the flags passed to the compiler at link time,
5495 # as that way the compiler can do the right implementation dependant
5498 amigaos) ;; # -fstack-protector builds but doesn't work
5499 *) case "$gccversion" in
5500 ?*) set stack-protector-strong -fstack-protector-strong
5503 *-fstack-protector-strong*) ;; # It got added.
5504 *) # Try the plain/older -fstack-protector.
5505 set stack-protector -fstack-protector
5516 case "$mips_type" in
5517 *BSD*|'') inclwanted="$locincpth $usrinc";;
5518 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5520 for thisincl in $inclwanted; do
5521 if $test -d $thisincl; then
5522 if $test x$thisincl != x$usrinc; then
5524 *" -I$thisincl "*);;
5525 *) dflt="$dflt -I$thisincl ";;
5531 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5533 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5541 *) dflt="$dflt -D$2";;
5545 set signal.h LANGUAGE_C; eval $inctest
5549 ccflags="$ccflags -DSOCKS"
5554 default|recommended) dflt="$ccflags $dflt" ;;
5555 *) dflt="$ccflags";;
5564 Your C compiler may want other flags. For this question you should include
5565 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5566 but you should NOT include libraries or ld flags like -lwhatever. If you
5567 want $package to honor its debug switch, you should include -DDEBUGGING here.
5568 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5570 To use no flags, specify the word "none".
5576 rp="Any additional cc flags?"
5583 : the following weeds options from ccflags that are of no interest to cpp
5585 '') cppflags="$ccflags" ;;
5586 *) set X $ccflags; shift
5587 case " $cppflags " in
5588 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5589 *) cppflags="$cppflags $ccflags" ;;
5593 case "$gccversion" in
5594 1*) cppflags="$cppflags -D__GNUC__"
5596 case "$mips_type" in
5598 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5604 echo "Let me guess what the preprocessor flags are..." >&4
5618 *) ftry="$previous $flag";;
5620 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5621 >cpp1.out 2>/dev/null && \
5622 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5623 >cpp2.out 2>/dev/null && \
5624 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5625 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5627 cppflags="$cppflags $ftry"
5637 *-*) echo "They appear to be: $cppflags";;
5639 $rm -f cpp.c cpp?.out
5643 : flags used in final linking phase
5645 '') if ./venix; then
5651 *-posix*) dflt="$dflt -posix" ;;
5654 *) dflt="$ldflags";;
5656 # See note above about -fstack-protector
5658 *-fstack-protector-strong*)
5660 *-fstack-protector-strong*) ;; # Don't add it again
5661 *) dflt="$dflt -fstack-protector-strong" ;;
5664 *-fstack-protector*)
5666 *-fstack-protector*) ;; # Don't add it again
5667 *) dflt="$dflt -fstack-protector" ;;
5672 : Try to guess additional flags to pick up local libraries.
5673 for thislibdir in $libpth; do
5674 case " $loclibpth " in
5677 *"-L$thislibdir "*) ;;
5678 *) dflt="$dflt -L$thislibdir" ;;
5690 Your C linker may need flags. For this question you should
5691 include -L/whatever and any other flags used by the C linker, but you
5692 should NOT include libraries like -lwhatever.
5694 Make sure you include the appropriate -L/path flags if your C linker
5695 does not normally search all of the directories you specified above,
5698 To use no flags, specify the word "none".
5702 rp="Any additional ld flags (NOT including libraries)?"
5708 rmlist="$rmlist pdp11"
5712 echo "Checking your choice of C compiler and flags for coherency..." >&4
5713 $cat > try.c <<'EOF'
5715 int main() { printf("Ok\n"); return(0); }
5717 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5719 $cat >try.msg <<'EOM'
5720 I've tried to compile and run the following simple program:
5723 $cat try.c >> try.msg
5725 $cat >> try.msg <<EOM
5732 and I got the following output:
5736 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5737 if $sh -c "$run ./try " >>try.msg 2>&1; then
5741 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5744 echo "The program compiled OK, but exited with status $?." >>try.msg
5745 rp="You have a problem. Shall I abort Configure"
5749 echo "I can't compile the test program." >>try.msg
5750 rp="You have a BIG problem. Shall I abort Configure"
5756 case "$knowitall" in
5758 echo "(The supplied flags or libraries might be incorrect.)"
5766 *) echo "Ok. Stopping Configure." >&4
5771 n) echo "OK, that should do.";;
5773 $rm_try gcctest gcctest.out
5775 : define a shorthand compile call
5779 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5780 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5784 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5785 : define a shorthand compile call for compilations that should be ok.
5789 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5791 : stub, used only to satisfy other units
5794 : check for lengths of integral types
5798 echo "Checking to see how big your integers are..." >&4
5807 printf("intsize=%d;\n", (int)sizeof(int));
5808 printf("longsize=%d;\n", (int)sizeof(long));
5809 printf("shortsize=%d;\n", (int)sizeof(short));
5814 if eval $compile_ok && $run ./try > /dev/null; then
5816 echo "Your integers are $intsize bytes long."
5817 echo "Your long integers are $longsize bytes long."
5818 echo "Your short integers are $shortsize bytes long."
5822 Help! I can't compile and run the intsize test program: please enlighten me!
5823 (This is probably a misconfiguration in your system or libraries, and
5824 you really ought to fix it. Still, I'll try anyway.)
5828 rp="What is the size of an integer (in bytes)?"
5832 rp="What is the size of a long integer (in bytes)?"
5836 rp="What is the size of a short integer (in bytes)?"
5844 : check for long long
5846 echo "Checking to see if you have long long..." >&4
5847 echo 'int main() { long long x = 7; return 0; }' > try.c
5849 if eval $compile; then
5851 echo "You have long long."
5854 echo "You do not have long long."
5860 : check for length of long long
5861 case "${d_longlong}${longlongsize}" in
5864 echo "Checking to see how big your long longs are..." >&4
5865 $cat >try.c <<'EOCP'
5869 printf("%d\n", (int)sizeof(long long));
5874 if eval $compile_ok; then
5875 longlongsize=`$run ./try`
5876 echo "Your long longs are $longlongsize bytes long."
5880 echo "(I can't seem to compile the test program. Guessing...)"
5881 rp="What is the size of a long long (in bytes)?"
5885 if $test "X$longsize" = "X$longlongsize"; then
5886 echo "(That isn't any different from an ordinary long.)"
5892 : determine filename position in cpp output
5894 echo "Computing filename position in cpp output for #include directives..." >&4
5896 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5901 vos) testaccess=-e ;;
5904 echo '#include <stdio.h>' > foo.c
5907 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5908 $grep '^[ ]*#.*stdio\.h' | \
5909 while read cline; do
5912 while $test \$# -gt 0; do
5913 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5918 pos=\`expr \$pos + 1\`
5932 *) pos="${fieldn}th";;
5934 echo "Your cpp writes the filename in the $pos field of the line."
5936 : locate header file
5941 for usrincdir in $incpth
5943 if test -f \$usrincdir/\$wanted; then
5944 echo "\$usrincdir/\$wanted"
5948 awkprg='{ print \$$fieldn }'
5949 echo "#include <\$wanted>" > foo\$\$.c
5950 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5951 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5952 while read cline; do
5953 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5955 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5956 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5961 # status = 0: grep returned 0 lines, case statement not executed
5962 # status = 1: headerfile found
5963 # status = 2: while loop executed, no headerfile found
5967 if test \$status -eq 1; then
5974 : define an alternate in-header-list? function
5975 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5976 cont=true; xxf="echo \"<\$1> found.\" >&4";
5977 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5978 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5980 case $# in 4) instead=instead;; *) instead="at last";; esac;
5981 while $test "$cont"; do
5983 var=$2; eval "was=\$$2";
5984 if $test "$xxx" && $test -r "$xxx";
5986 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5989 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5990 set $yyy; shift; shift; yyy=$@;
5991 case $# in 0) cont="";;
5992 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5993 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5994 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5995 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5999 do set $yyy; var=$2; eval "was=\$$2";
6000 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
6001 set $yyy; shift; shift; yyy=$@;
6004 : see if inttypes.h is available
6005 : we want a real compile instead of Inhdr because some systems
6006 : have an inttypes.h which includes non-existent headers
6009 #include <inttypes.h>
6011 static int32_t foo32 = 0x12345678;
6015 if eval $compile; then
6016 echo "<inttypes.h> found." >&4
6019 echo "<inttypes.h> NOT found." >&4
6028 echo "Checking to see if you have int64_t..." >&4
6030 #include <sys/types.h>
6031 #$i_inttypes I_INTTYPES
6033 #include <inttypes.h>
6035 int main() { int64_t x = 7; }
6038 if eval $compile; then
6040 echo "You have int64_t."
6043 echo "You do not have int64_t."
6049 : Check if 64bit ints have a quad type
6051 echo "Checking which 64-bit integer type we could use..." >&4
6057 val='"unsigned int"'
6062 *) case "$longsize" in
6066 val='"unsigned long"'
6071 *) case "$d_longlong:$longlongsize" in
6076 val='"unsigned long long"'
6081 *) case "$d_int64_t" in
6100 '') echo "Alas, no 64-bit integer types in sight." >&4
6103 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6108 : Do we want 64bit support
6109 case "$uselonglong" in
6110 "$define"|true|[yY]*)
6113 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6115 use64bitint="$define"
6118 case "$use64bits" in
6119 "$define"|true|[yY]*)
6122 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6124 use64bitint="$define"
6127 case "$use64bitints" in
6128 "$define"|true|[yY]*)
6131 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6133 use64bitint="$define"
6136 case "$use64bitsint" in
6137 "$define"|true|[yY]*)
6140 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6142 use64bitint="$define"
6145 case "$uselonglongs" in
6146 "$define"|true|[yY]*)
6149 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6151 use64bitint="$define"
6154 case "$use64bitsall" in
6155 "$define"|true|[yY]*)
6158 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6160 use64bitall="$define"
6165 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6167 case "$use64bitall" in
6168 "$define"|true|[yY]*) use64bitint="$define" ;;
6174 You have natively 64-bit long integers.
6178 *) case "$use64bitint" in
6179 "$define"|true|[yY]*) dflt='y';;
6188 Perl can be built to take advantage of 64-bit integer types
6189 on some systems. To do so, Configure can be run with -Duse64bitint.
6190 Choosing this option will most probably introduce binary incompatibilities.
6192 If this doesn't make any sense to you, just accept the default '$dflt'.
6193 (The default has been chosen based on your configuration.)
6195 rp='Try to use 64-bit integers, if available?'
6198 [yY]*) val="$define" ;;
6206 case "$use64bitall" in
6207 "$define"|true|[yY]*) dflt='y' ;;
6208 *) case "$longsize" in
6216 You may also choose to try maximal 64-bitness. It means using as much
6217 64-bitness as possible on the platform. This in turn means even more
6218 binary incompatibilities. On the other hand, your platform may not
6219 have any more 64-bitness available than what you already have chosen.
6221 If this doesn't make any sense to you, just accept the default '$dflt'.
6222 (The default has been chosen based on your configuration.)
6224 rp='Try to use maximal 64-bit support, if available?'
6227 [yY]*) val="$define" ;;
6232 case "$use64bitall" in
6234 case "$use64bitint" in
6238 Since you have chosen a maximally 64-bit build, I'm also turning on
6239 the use of 64-bit integers.
6241 use64bitint="$define" ;;
6246 : Look for a hint-file generated 'call-back-unit'. If the
6247 : user has specified that a 64-bit perl is to be built,
6248 : we may need to set or change some other defaults.
6249 if $test -f use64bitint.cbu; then
6250 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6253 case "$use64bitint" in
6254 "$define"|true|[yY]*)
6255 : This test was common to all the OpenBSD forks, and seems harmless for
6258 echo "Checking if your C library has broken 64-bit functions..." >&4
6261 typedef $uquadtype myULL;
6268 {4294967303.15, 4294967303ULL},
6269 {4294967294.2, 4294967294ULL},
6270 {4294967295.7, 4294967295ULL},
6273 for (p = test; p->u; p++) {
6274 myULL x = (myULL)p->d;
6285 if eval $compile_ok; then
6286 libcquad=`$run ./try`
6287 echo "Your C library's 64-bit functions are $libcquad."
6289 echo "(I can't seem to compile the test program.)"
6290 echo "Assuming that your C library's 64-bit functions are ok."
6299 *** You have a C library with broken 64-bit functions.
6300 *** 64-bit support does not work reliably in this configuration.
6301 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6302 *** Cannot continue, aborting.
6309 4) case "$archname64" in
6310 '') archname64=64int ;;
6317 : Look for a hint-file generated 'call-back-unit'. If the
6318 : user has specified that a maximally 64-bit perl is to be built,
6319 : we may need to set or change some other defaults.
6320 if $test -f use64bitall.cbu; then
6321 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6324 case "$use64bitall" in
6325 "$define"|true|[yY]*)
6327 4) case "$archname64" in
6328 ''|64int) archname64=64all ;;
6335 case "$d_quad:$use64bitint" in
6339 *** You have chosen to use 64-bit integers,
6340 *** but none can be found.
6341 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6342 *** Cannot continue, aborting.
6349 : Check if we are using the GNU C library
6351 echo "Checking for GNU C Library..." >&4
6353 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6354 alone are insufficient to distinguish different versions, such as
6355 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6356 libc version 2.1.0. A. Dougherty, June 3, 2002.
6362 # ifdef __GLIBC_MINOR__
6363 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6364 # include <gnu/libc-version.h>
6365 printf("%s\n", gnu_get_libc_version());
6367 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6370 printf("%d\n", __GLIBC__);
6379 if eval $compile_ok && $run ./try > glibc.ver; then
6381 gnulibc_version=`$cat glibc.ver`
6382 echo "You are using the GNU C Library version $gnulibc_version"
6386 echo "You are not using the GNU C Library"
6392 : see if nm is to be used to determine whether a symbol is defined or not
6396 case "$d_gnulibc" in
6399 echo "nm probably won't work on the GNU C Library." >&4
6405 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6407 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6408 echo "'nm' won't be sufficient on this system." >&4
6414 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6415 if $test $dflt -gt 20; then
6425 true|$define) dflt=y;;
6432 I can use $nm to extract the symbols from your C libraries. This
6433 is a time consuming task which may generate huge output on the disk (up
6434 to 3 megabytes) but that should make the symbols extraction faster. The
6435 alternative is to skip the 'nm' extraction part and to compile a small
6436 test program instead to determine whether each symbol is present. If
6437 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6438 this may be the best solution.
6440 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6443 rp="Shall I use $nm to extract C symbols from the libraries?"
6446 [Nn]*) usenm=false;;
6455 : nm options which may be necessary
6457 '') if $test -f /mach_boot; then
6459 elif $test -d /usr/ccs/lib; then
6460 nm_opt='-p' # Solaris (and SunOS?)
6461 elif $test -f /dgux; then
6463 elif $test -f /lib64/rld; then
6464 nm_opt='-p' # 64-bit Irix
6470 : nm options which may be necessary for shared libraries but illegal
6471 : for archive libraries. Thank you, Linux.
6472 case "$nm_so_opt" in
6473 '') case "$myuname" in
6475 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6476 nm_so_opt='--dynamic'
6483 : Figure out where the libc is located
6486 : get list of predefined functions in a handy place
6491 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6497 *) for thislib in $libs; do
6500 : Handle C library specially below.
6503 thislib=`echo $thislib | $sed -e 's/^-l//'`
6504 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6506 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6508 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6510 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6512 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6514 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6516 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6521 libnames="$libnames $try"
6523 *) libnames="$libnames $thislib" ;;
6532 for xxx in $libpth; do
6533 $test -r $1 || set $xxx/libc.$so
6534 : The messy sed command sorts on library version numbers.
6536 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6537 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6539 s/[0-9][0-9]*/0000&/g
6540 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6543 $sort | $sed -e 's/^.* //'`
6546 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6547 $test -r $1 || set $sysroot/lib/libsys_s$_a
6553 if $test -r "$1"; then
6554 echo "Your (shared) C library seems to be in $1."
6556 elif $test -r /lib/libc && $test -r /lib/clib; then
6557 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6559 libc='/lib/clib /lib/libc'
6560 if $test -r /lib/syslib; then
6561 echo "(Your math library is in /lib/syslib.)"
6562 libc="$libc /lib/syslib"
6564 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6565 echo "Your C library seems to be in $libc, as you said before."
6566 elif $test -r $incpath/usr/lib/libc$_a; then
6567 libc=$incpath/usr/lib/libc$_a;
6568 echo "Your C library seems to be in $libc. That's fine."
6569 elif $test -r /lib/libc$_a; then
6571 echo "Your C library seems to be in $libc. You're normal."
6573 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6575 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6576 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6577 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6579 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6581 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6584 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6586 if $test -r "$tans"; then
6587 echo "Your C library seems to be in $tans, of all places."
6593 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6597 If the guess above is wrong (which it might be if you're using a strange
6598 compiler, or your machine supports multiple models), you can override it here.
6603 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6605 I can't seem to find your C library. I've looked in the following places:
6608 $sed 's/^/ /' libpath
6611 None of these seems to contain your C library. I need to get its name...
6616 rp='Where is your C library?'
6621 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6622 set X `cat libnames`
6625 case $# in 1) xxx=file; esac
6626 echo "Extracting names from the following $xxx for later perusal:" >&4
6628 $sed 's/^/ /' libnames >&4
6630 $echo $n "This may take a while...$c" >&4
6634 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6635 *) $nm $nm_opt $file 2>/dev/null;;
6640 $grep fprintf libc.tmp > libc.ptf
6641 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6642 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6644 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6669 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6693 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6697 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6699 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6702 $nm -p $* 2>/dev/null >libc.tmp
6703 $grep fprintf libc.tmp > libc.ptf
6704 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6705 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6711 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6713 if $ar t $libc > libc.tmp && \
6714 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6716 for thisname in $libnames $libc; do
6717 $ar t $thisname >>libc.tmp
6719 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6721 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6722 for thisname in $libnames $libc; do
6723 $ar tv $thisname >>libc.tmp
6724 emximp -o tmp.imp $thisname \
6726 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6727 < tmp.imp >>libc.tmp
6730 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6733 echo "$ar didn't seem to work right." >&4
6734 echo "Maybe this is a Cray...trying bld instead..." >&4
6736 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6739 for thisname in $libnames; do
6741 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6742 $ar t $thisname >>libc.tmp
6746 echo "That didn't work either. Giving up." >&4
6756 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6757 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6759 *) if $test -f /lib/syscalls.exp; then
6761 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6762 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6763 /lib/syscalls.exp >>libc.list
6769 $rm -f libnames libpath
6771 : Check if we are using C++
6773 echo "Checking for C++..." >&4
6774 $cat >try.c <<'EOCP'
6786 if eval $compile_ok && $run ./try; then
6788 echo "You are using a C++ compiler."
6791 echo "You are not using a C++ compiler."
6797 : is a C symbol defined?
6800 -v) tf=libc.tmp; tdc="";;
6801 -a) tf=libc.tmp; tdc="[]";;
6802 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6804 case "$d_cplusplus" in
6805 $define) extern_C="extern \"C\"" ;;
6806 *) extern_C="extern" ;;
6809 case "$reuseval-$4" in
6811 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6816 if $test "$runnm" = true; then
6817 if $contains $tlook $tf >/dev/null 2>&1; then
6819 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6820 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;
6821 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6822 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6826 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;
6827 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6833 $define) tval=true;;
6840 : define an is-in-libc? function
6841 inlibc='echo " "; td=$define; tu=$undef;
6842 sym=$1; var=$2; eval "was=\$$2";
6844 case "$reuseval$was" in
6854 echo "$sym() found." >&4;
6855 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6857 echo "$sym() NOT found." >&4;
6858 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6862 $define) echo "$sym() found." >&4;;
6863 *) echo "$sym() NOT found." >&4;;
6867 : check for length of double
6869 case "$doublesize" in
6871 echo "Checking to see how big your double precision numbers are..." >&4
6880 printf("%d\n", (int)sizeof(double));
6885 if eval $compile_ok; then
6886 doublesize=`$run ./try`
6887 echo "Your double is $doublesize bytes long."
6890 echo "(I can't seem to compile the test program. Guessing...)"
6891 rp="What is the size of a double precision number (in bytes)?"
6899 : check for long doubles
6901 echo "Checking to see if you have long double..." >&4
6902 echo 'int main() { long double x = 7.0; }' > try.c
6904 if eval $compile; then
6906 echo "You have long double."
6909 echo "You do not have long double."
6915 : see if ldexpl exists
6919 : check for length of long double
6920 case "${d_longdbl}${longdblsize}" in
6923 echo "Checking to see how big your long doubles are..." >&4
6924 $cat >try.c <<'EOCP'
6928 printf("%d\n", sizeof(long double));
6933 if eval $compile; then
6934 longdblsize=`$run ./try`
6935 echo "Your long doubles are $longdblsize bytes long."
6939 echo "(I can't seem to compile the test program. Guessing...)" >&4
6940 rp="What is the size of a long double (in bytes)?"
6944 if $test "X$doublesize" = "X$longdblsize"; then
6945 echo "That isn't any different from an ordinary double."
6946 echo "I'll keep your setting anyway, but you may see some"
6947 echo "harmless compilation warnings."
6953 $echo "Checking the kind of long doubles you have..." >&4
6954 case "$d_longdbl" in
6958 #define LONGDBLSIZE $longdblsize
6959 #define DOUBLESIZE $doublesize
6965 static const long double d = -0.1L;
6967 unsigned const char* b = (unsigned const char*)(&d);
6968 #if DOUBLESIZE == LONGDBLSIZE
6969 printf("0\n"); /* if it floats like double */
6972 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6973 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6974 /* IEEE 754 128-bit little-endian */
6978 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6979 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6984 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6985 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6986 * cannot be trusted. */
6987 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6988 if (b[0] == 0xCD && b[9] == 0xBF) {
6989 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6990 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6991 * Also known as "extended precision". */
6995 if (b[0] == 0xBF && b[9] == 0xCD) {
6996 /* Is there ever big-endian 80-bit, really?
6998 * The Motorola 68881 had another "extended precision" format:
6999 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7000 * for total of 96 bits of bytes. The zero bits were unused.
7001 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7002 * If it ever becomes relevant, this format should be allocated
7003 * a new doublekind code since it's quite different from the Intel x87.
7009 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7010 /* software "double double", the 106 is 53+53.
7011 * but irix thinks it is 107. */
7012 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7013 /* double double 128-bit fully little-endian,
7014 * little-endian doubles in little-endian order,
7015 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7019 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7020 /* double double 128-bit fully big-endian,
7021 * big-endian doubles in big-endian order,
7022 * e.g. PPC/Power and MIPS:
7023 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7027 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7028 /* double double 128-bit mixed endian.
7029 * little-endian doubles in big-endian order,
7031 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7035 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7036 /* double double 128-bit mixed endian,
7037 * big-endian doubles in little-endian order,
7038 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7043 /* We are largely making this up because it may well be
7044 * that the VAX format H was never made available to C,
7045 * only to Fortran. */
7046 #if LONGDBLSIZE == 16 && defined(__vax__)
7047 if (b[0] == 0xFD && b[15] == 0x99) {
7048 /* VAX format H, PDP-11 mixed endian. */
7053 printf("-1\n"); /* unknown */
7058 if eval $compile; then
7059 longdblkind=`$run ./try`
7066 case "$longdblkind" in
7067 0) echo "Your long doubles are doubles." >&4 ;;
7068 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7069 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7070 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7071 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7072 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7073 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7074 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7075 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7076 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7077 *) echo "Cannot figure out your long double." >&4 ;;
7079 d_long_double_style_ieee=$undef
7080 d_long_double_style_ieee_std=$undef
7081 d_long_double_style_ieee_extended=$undef
7082 d_long_double_style_ieee_doubledouble=$undef
7083 d_long_double_style_vax=$undef
7084 case "$longdblkind" in
7085 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7087 case "$longdblkind" in
7088 1|2) d_long_double_style_ieee_std=$define ;;
7090 case "$longdblkind" in
7091 3|4) d_long_double_style_ieee_extended=$define ;;
7093 case "$longdblkind" in
7094 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7096 case "$longdblkind" in
7097 9) d_long_double_style_vax=$define ;;
7101 : determine the architecture name
7103 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7104 tarch=`arch`"-$osname"
7105 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7106 if uname -m > tmparch 2>&1 ; then
7107 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7108 -e 's/$/'"-$osname/" tmparch`
7116 case "$myarchname" in
7119 echo "(Your architecture name used to be $myarchname.)"
7123 case "$targetarch" in
7125 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7130 *) dflt="$archname";;
7132 rp='What is your architecture name'
7136 : optionally add API version to the architecture for versioned archlibs
7137 case "$useversionedarchname" in
7138 $define|true|[yY]*) dflt='y';;
7141 rp='Add the Perl API version to your archname?'
7144 y|Y) useversionedarchname="$define" ;;
7145 *) useversionedarchname="$undef" ;;
7147 case "$useversionedarchname" in
7150 *-$api_versionstring)
7151 echo "...and architecture name already has -$api_versionstring" >&4
7154 archname="$archname-$api_versionstring"
7155 echo "...setting architecture name to $archname." >&4
7161 case "$usethreads" in
7163 echo "Threads selected." >&4
7165 *-thread*) echo "...and architecture name already has -thread." >&4
7167 *) archname="$archname-thread"
7168 echo "...setting architecture name to $archname." >&4
7173 case "$usemultiplicity" in
7175 echo "Multiplicity selected." >&4
7177 *-multi*) echo "...and architecture name already has -multi." >&4
7179 *) archname="$archname-multi"
7180 echo "...setting architecture name to $archname." >&4
7185 case "$use64bitint$use64bitall" in
7187 case "$archname64" in
7189 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7192 case "$use64bitint" in
7193 "$define") echo "64 bit integers selected." >&4 ;;
7195 case "$use64bitall" in
7196 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7199 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7201 *) archname="$archname-$archname64"
7202 echo "...setting architecture name to $archname." >&4
7208 case "$uselongdouble" in
7210 echo "Long doubles selected." >&4
7211 case "$longdblsize" in
7213 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7217 *-ld*) echo "...and architecture name already has -ld." >&4
7219 *) archname="$archname-ld"
7220 echo "...setting architecture name to $archname." >&4
7227 case "$usequadmath" in
7229 echo "quadmath selected." >&4
7231 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7233 *) archname="$archname-quadmath"
7234 echo "...setting architecture name to $archname." >&4
7239 if $test -f archname.cbu; then
7240 echo "Your platform has some specific hints for architecture name, using them..."
7244 : set the prefixit variable, to compute a suitable default value
7245 prefixit='case "$3" in
7247 case "$oldprefix" in
7248 "") eval "$1=\"\$$2\"";;
7255 ""|" ") eval "$1=\"\$$2\"";;
7261 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7263 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7264 /*-$oldprefix/*|\~*-$oldprefix/*)
7265 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7266 *) eval "$1=\"\$$2\"";;
7270 : determine installation style
7271 : For now, try to deduce it from prefix unless it is already set.
7272 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7273 case "$installstyle" in
7274 '') case "$prefix" in
7275 *perl*) dflt='lib';;
7276 *) dflt='lib/perl5' ;;
7279 *) dflt="$installstyle" ;;
7281 : Probably not worth prompting for this since we prompt for all
7282 : the directories individually, and the prompt would be too long and
7286 : determine where public executables go
7291 rp='Pathname where the public executables will reside?'
7293 if $test "X$ansexp" != "X$binexp"; then
7297 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7298 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7299 : this via initialinstalllocation
7302 case "$userelocatableinc" in
7303 $define|true|[yY]*) dflt='y' ;;
7308 Would you like to build Perl so that the installation is relocatable, so that
7309 library paths in @INC are determined relative to the path of the perl binary?
7310 This is not advised for system Perl installs, or if you need to run setid
7311 scripts or scripts under taint mode.
7313 If this doesn't make any sense to you, just accept the default '$dflt'.
7315 rp='Use relocatable @INC?'
7318 y|Y) val="$define" ;;
7321 set userelocatableinc
7324 initialinstalllocation="$binexp"
7325 : Default prefix is now "up one level from where the binaries are"
7326 case "$userelocatableinc" in
7332 installprefixexp=".../.."
7336 : determine where private library files go
7337 : Usual default is /usr/local/lib/perl5/$version.
7338 : Also allow things like /opt/perl/lib/$version, since
7339 : /opt/perl/lib/perl5... would be redundant.
7340 : The default "style" setting is made in installstyle.U
7341 case "$installstyle" in
7342 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7343 *) set dflt privlib lib/$version ;;
7348 There are some auxiliary files for $package that need to be put into a
7349 private library directory that is accessible by everyone.
7354 rp='Pathname where the private library files will reside?'
7359 : set the prefixup variable, to restore leading tilda escape
7360 prefixup='case "$prefixexp" in
7362 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7365 : determine where public architecture dependent libraries go
7368 : privlib default is /usr/local/lib/$package/$version
7369 : archlib default is /usr/local/lib/$package/$version/$archname
7370 : privlib may have an optional trailing /share.
7371 tdflt=`echo $privlib | $sed 's,/share$,,'`
7372 tdflt=$tdflt/$archname
7381 $spackage contains architecture-dependent library files. If you are
7382 sharing libraries in a heterogeneous environment, you might store
7383 these files in a separate location. Otherwise, you can just include
7384 them with the rest of the public library files.
7389 rp='Where do you want to put the public architecture-dependent libraries?'
7393 if $test X"$archlib" = X"$privlib"; then
7399 : see if setuid scripts can be secure
7402 Some kernels have a bug that prevents setuid #! scripts from being
7403 secure. Some sites have disabled setuid #! scripts because of this.
7405 First let's decide if your kernel supports secure setuid #! scripts.
7406 (If setuid #! scripts would be secure but have been disabled anyway,
7407 don't say that they are secure if asked.)
7412 if $test -d /dev/fd; then
7413 echo "#!$ls" >reflect
7414 chmod +x,u+s reflect
7415 ./reflect >flect 2>&1
7416 if $contains "/dev/fd" flect >/dev/null; then
7417 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7421 If you are not sure if they are secure, I can check but I'll need a
7422 username and password different from the one you are using right now.
7423 If you don't have such a username or don't want me to test, simply
7427 rp='Other username to test security of setuid scripts with?'
7432 case "$d_suidsafe" in
7433 '') echo "I'll assume setuid scripts are *not* secure." >&4
7436 echo "Well, the $hint value is *not* secure." >&4
7438 *) echo "Well, the $hint value *is* secure." >&4
7443 $rm -f reflect flect
7444 echo "#!$ls" >reflect
7445 chmod +x,u+s reflect
7448 echo '"su" will (probably) prompt you for '"$ans's password."
7449 su $ans -c './reflect >flect'
7450 if $contains "/dev/fd" flect >/dev/null; then
7451 echo "Okay, it looks like setuid scripts are secure." >&4
7454 echo "I don't think setuid scripts are secure." >&4
7459 rp='Does your kernel have *secure* setuid scripts?'
7462 [yY]*) val="$define";;
7467 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7468 echo "(That's for file descriptors, not floppy disks.)"
7474 $rm -f reflect flect
7476 : now see if they want to do setuid emulation
7477 if $test $patchlevel -lt 11; then
7480 case "$d_suidsafe" in
7483 echo "No need to emulate SUID scripts since they are secure here." >&4
7487 Some systems have disabled setuid scripts, especially systems where
7488 setuid scripts cannot be secure. On systems where setuid scripts have
7489 been disabled, the setuid/setgid bits on scripts are currently
7490 useless. It is possible for $package to detect those bits and emulate
7491 setuid/setgid in a secure fashion. This emulation will only work if
7492 setuid scripts have been disabled in your kernel.
7496 "$define") dflt=y ;;
7499 rp="Do you want to do setuid/setgid emulation?"
7502 [yY]*) val="$define";;
7514 SUID emulation has been removed for 5.12
7515 Please re-run Configure without -Dd_dosuid
7524 : Find perl5.005 or later.
7525 echo "Looking for a previously installed perl5.005 or later... "
7527 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7528 : Check if this perl is recent and can load a simple module
7529 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7532 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7542 '') echo "None found. That's ok.";;
7543 *) echo "Using $perl5." ;;
7546 : Set the siteprefix variables
7549 After $package is installed, you may wish to install various
7550 add-on modules and utilities. Typically, these add-ons will
7551 be installed under $prefix with the rest
7552 of this package. However, you may wish to install such add-ons
7553 elsewhere under a different prefix.
7555 If you do not wish to put everything under a single prefix, that's
7556 ok. You will be prompted for the individual locations; this siteprefix
7557 is only used to suggest the defaults.
7559 The default should be fine for most people.
7563 rp='Installation prefix to use for add-on modules and utilities?'
7564 : XXX Here might be another good place for an installstyle setting.
7565 case "$siteprefix" in
7567 *) dflt=$siteprefix ;;
7570 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7572 case "$siteprefix" in
7576 *) oldsiteprefix="$prefix";;
7581 siteprefixexp="$ansexp"
7583 : determine where site specific libraries go.
7584 : Usual default is /usr/local/lib/perl5/site_perl/$version
7585 : The default "style" setting is made in installstyle.U
7586 : XXX No longer works with Prefixit stuff.
7587 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7589 '') case "$installstyle" in
7590 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7591 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7599 The installation process will create a directory for
7600 site-specific extensions and modules. Most users find it convenient
7601 to place all site-specific files in this directory rather than in the
7602 main distribution directory.
7606 rp='Pathname for the site-specific library files?'
7610 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7612 : Determine list of previous versions to include in @INC
7613 $cat > getverlist <<EOPL
7616 \$api_versionstring = "$api_versionstring";
7617 \$version = "$version";
7618 \$stem = "$sitelib_stem";
7619 \$archname = "$archname";
7621 $cat >> getverlist <<'EOPL'
7622 # The list found is store twice for each entry: the original name, and
7623 # the binary broken down version as pack "sss", so sorting is easy and
7624 # unambiguous. This will work for all versions that have a maximum of
7625 # three digit groups, separate by '.'s or '_'s. Names are extended with
7626 # ".0.0" to ensure at least three elements for the pack.
7627 # -- H.Merijn Brand (m)'06 23-10-2006
7629 # Can't have leading @ because metaconfig interprets it as a command!
7630 ;@inc_version_list=();
7631 # XXX Redo to do opendir/readdir?
7634 ;@candidates = map {
7635 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7636 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7642 ($pversion, $aversion, $vsn5005) = map {
7643 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7644 foreach $d (@candidates) {
7645 if ($d->[1] lt $pversion) {
7646 if ($d->[1] ge $aversion) {
7647 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7649 elsif ($d->[1] ge $vsn5005) {
7650 unshift(@inc_version_list, grep { -d } $d->[0]);
7654 # Skip newer version. I.e. don't look in
7655 # 5.7.0 if we're installing 5.6.1.
7659 if (@inc_version_list) {
7660 print join(' ', @inc_version_list);
7663 # Blank space to preserve value for next Configure run.
7668 case "$inc_version_list" in
7669 '') if test -x "$perl5$exe_ext"; then
7670 dflt=`$perl5 getverlist`
7675 $undef) dflt='none' ;;
7676 *) eval dflt=\"$inc_version_list\" ;;
7679 ''|' ') dflt=none ;;
7686 In order to ease the process of upgrading, this version of perl
7687 can be configured to use modules built and installed with earlier
7688 versions of perl that were installed under $prefix. Specify here
7689 the list of earlier versions that this version of perl should check.
7690 If Configure detected no earlier versions of perl installed under
7691 $prefix, then the list will be empty. Answer 'none' to tell perl
7692 to not search earlier versions.
7694 The default should almost always be sensible, so if you're not sure,
7695 just accept the default.
7698 rp='List of earlier versions to include in @INC?'
7701 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7702 *) inc_version_list="$ans" ;;
7704 case "$inc_version_list" in
7706 inc_version_list_init='0'
7707 d_inc_version_list="$undef"
7709 *) inc_version_list_init=`echo $inc_version_list |
7710 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7711 d_inc_version_list="$define"
7716 : see if malloc/malloc.h has to be included
7717 set malloc/malloc.h i_mallocmalloc
7720 : see if this is a malloc.h system
7721 : we want a real compile instead of Inhdr because some systems have a
7722 : malloc.h that just gives a compile error saying to use stdlib.h instead
7727 #$i_mallocmalloc I_MALLOCMALLOC
7728 #ifdef I_MALLOCMALLOC
7729 # include <malloc/malloc.h>
7732 int main () { return 0; }
7735 if eval $compile; then
7736 echo "<malloc.h> found." >&4
7739 echo "<malloc.h> NOT found." >&4
7746 : check for length of pointer
7750 echo "Checking to see how big your pointers are..." >&4
7759 printf("%d\n", (int)sizeof(void *));
7764 if eval $compile_ok; then
7765 ptrsize=`$run ./try`
7766 echo "Your pointers are $ptrsize bytes long."
7769 echo "(I can't seem to compile the test program. Guessing...)" >&4
7770 rp="What is the size of a pointer (in bytes)?"
7777 case "$use64bitall" in
7778 "$define"|true|[yY]*)
7782 *** You have chosen a maximally 64-bit build,
7783 *** but your pointers are only 4 bytes wide.
7784 *** Please rerun Configure without -Duse64bitall.
7789 *** Since you have quads, you could possibly try with -Duse64bitint.
7794 *** Cannot continue, aborting.
7804 : determine whether to use malloc wrapping
7806 case "$usemallocwrap" in
7807 [yY]*|true|$define) dflt='y' ;;
7808 [nN]*|false|$undef) dflt='n' ;;
7809 *) case "$usedevel" in
7810 [yY]*|true|$define) dflt='y' ;;
7815 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7817 usemallocwrap="$ans"
7820 usemallocwrap="$define" ;;
7822 usemallocwrap="$undef" ;;
7825 : determine which malloc to compile in
7827 case "$usemymalloc" in
7828 [yY]*|true|$define) dflt='y' ;;
7829 [nN]*|false|$undef) dflt='n' ;;
7830 *) case "$ptrsize" in
7834 if test "$useithreads" = "$define"; then dflt='n'; fi
7837 rp="Do you wish to attempt to use the malloc that comes with $package?"
7843 mallocsrc='malloc.c'
7844 mallocobj="malloc$_o"
7845 d_mymalloc="$define"
7848 : Remove malloc from list of libraries to use
7849 echo "Removing unneeded -lmalloc from library list" >&4
7850 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7853 echo "libs = $libs" >&4
7865 : compute the return types of malloc and free
7867 $cat >malloc.c <<END
7871 #include <sys/types.h>
7885 case "$malloctype" in
7887 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7894 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7898 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7905 echo "Your system uses $freetype free(), it would seem." >&4
7907 : determine where site specific architecture-dependent libraries go.
7908 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7909 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7910 : sitelib may have an optional trailing /share.
7912 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7913 dflt="$dflt/$archname"
7918 set sitearch sitearch none
7922 The installation process will also create a directory for
7923 architecture-dependent site-specific extensions and modules.
7927 rp='Pathname for the site-specific architecture-dependent library files?'
7931 if $test X"$sitearch" = X"$sitelib"; then
7934 d_sitearch="$define"
7937 : Set the vendorprefix variables
7940 The installation process will also create a directory for
7941 vendor-supplied add-ons. Vendors who supply perl with their system
7942 may find it convenient to place all vendor-supplied files in this
7943 directory rather than in the main distribution directory. This will
7944 ease upgrades between binary-compatible maintenance versions of perl.
7946 Of course you may also use these directories in whatever way you see
7947 fit. For example, you might use them to access modules shared over a
7948 company-wide network.
7950 The default answer should be fine for most people.
7951 This causes further questions about vendor add-ons to be skipped
7952 and no vendor-specific directories will be configured for perl.
7955 rp='Do you want to configure vendor-specific add-on directories?'
7956 case "$usevendorprefix" in
7957 define|true|[yY]*) dflt=y ;;
7958 *) : User may have set vendorprefix directly on Configure command line.
7959 case "$vendorprefix" in
7968 rp='Installation prefix to use for vendor-supplied add-ons?'
7969 case "$vendorprefix" in
7970 '') dflt="$prefix" ;;
7971 *) dflt=$vendorprefix ;;
7974 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7976 case "$vendorprefix" in
7980 *) oldvendorprefix="$prefix";;
7984 usevendorprefix="$define"
7986 vendorprefixexp="$ansexp"
7988 *) usevendorprefix="$undef"
7994 : Set the vendorlib variables
7995 case "$vendorprefix" in
7996 '') d_vendorlib="$undef"
8000 *) d_vendorlib="$define"
8001 : determine where vendor-supplied modules go.
8002 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8003 case "$vendorlib" in
8005 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8006 case "$installstyle" in
8007 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8008 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8011 *) dflt="$vendorlib"
8015 rp='Pathname for the vendor-supplied library files?'
8018 vendorlibexp="$ansexp"
8021 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8025 : Set the vendorarch variables
8026 case "$vendorprefix" in
8027 '') d_vendorarch="$undef"
8031 *) d_vendorarch="$define"
8032 : determine where vendor-supplied architecture-dependent libraries go.
8033 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8034 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8035 : vendorlib may have an optional trailing /share.
8036 case "$vendorarch" in
8037 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8038 dflt="$dflt/$archname"
8040 *) dflt="$vendorarch" ;;
8043 rp='Pathname for vendor-supplied architecture-dependent files?'
8046 vendorarchexp="$ansexp"
8049 prefixvar=vendorarch
8051 if $test X"$vendorarch" = X"$vendorlib"; then
8052 d_vendorarch="$undef"
8054 d_vendorarch="$define"
8057 : Final catch-all directories to search
8060 Lastly, you can have perl look in other directories for extensions and
8061 modules in addition to those already specified.
8062 These directories will be searched after
8066 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8067 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8069 case "$otherlibdirs" in
8070 ''|' ') dflt='none' ;;
8071 *) dflt="$otherlibdirs" ;;
8074 Enter a colon-separated set of extra paths to include in perl's @INC
8075 search path, or enter 'none' for no extra paths.
8079 rp='Colon-separated list of additional directories for perl to search?'
8082 ' '|''|none) otherlibdirs=' ' ;;
8083 *) otherlibdirs="$ans" ;;
8085 case "$otherlibdirs" in
8089 set d_perl_otherlibdirs
8093 dflt_dtrace='/usr/sbin/dtrace'
8094 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8098 Perl can be built to support DTrace on platforms that support it.
8099 DTrace is a diagnosis and performance analysis tool from Sun.
8101 If this doesn't make any sense to you, just accept the default.
8105 case "$usedtrace" in
8111 dflt_dtrace=$usedtrace
8118 rp='Support DTrace if available?'
8121 y|Y) val="$define" ;;
8127 test "X$usedtrace" != "X$define" && break
8130 rp='Where is the dtrace executable?'
8139 if $dtrace -h -s ../perldtrace.d \
8140 -o perldtrace.tmp >/dev/null 2>&1 \
8141 && rm -f perldtrace.tmp
8144 echo "Good: your $dtrace knows about the -h flag."
8148 *** $me: Fatal Error: $dtrace doesn't support -h flag
8150 *** Your installed dtrace doesn't support the -h switch to compile a D
8151 *** program into a C header. Can't continue.
8163 *** $me: Fatal Error: $dtrace not found.
8170 echo "*** $dtrace was not found."
8176 : See if we want extra modules installed
8183 Perl can be built with extra modules or bundles of modules which
8184 will be fetched from the CPAN and installed alongside Perl.
8186 Notice that you will need access to the CPAN; either via the Internet,
8187 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8188 be asked later to configure the CPAN.pm module which will in turn do
8189 the installation of the rest of the extra modules or bundles.)
8191 Notice also that if the modules require any external software such as
8192 libraries and headers (the libz library and the zlib.h header for the
8193 Compress::Zlib module, for example) you MUST have any such software
8194 already installed, this configuration process will NOT install such
8197 If this doesn't make any sense to you, just accept the default '$dflt'.
8199 rp='Install any extra modules (y or n)?'
8205 Please list any extra modules or bundles to be installed from CPAN,
8206 with spaces between the names. The names can be in any format the
8207 'install' command of CPAN.pm will understand. (Answer 'none',
8208 without the quotes, to install no extra modules or bundles.)
8218 $rm -f ../extras.lst
8220 *) echo "(Saving the list of extras for later...)"
8221 echo "$extras" > ../extras.lst
8229 : determine where html pages for programs go
8230 set html1dir html1dir none
8234 If you wish to install html files for programs in $spackage, indicate
8235 the appropriate directory here. To skip installing html files,
8239 ''|none|$undef|' ') dflt=none ;;
8240 *) dflt=$html1dir ;;
8243 rp="Directory for the main $spackage html pages?"
8247 : Use ' ' for none so value is preserved next time through Configure
8248 $test X"$html1dir" = "X" && html1dir=' '
8250 : determine where html pages for libraries and modules go
8251 set html3dir html3dir none
8255 If you wish to install html files for modules associated with $spackage,
8256 indicate the appropriate directory here. To skip installing html files,
8259 : There is no obvious default. If they have specified html1dir, then
8260 : try to key off that, possibly changing .../html1 into .../html3.
8262 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8263 *) dflt=$html3dir ;;
8266 rp="Directory for the $spackage module html pages?"
8270 : Use ' ' for none so value is preserved next time through Configure
8271 $test X"$html3dir" = "X" && html3dir=' '
8273 : determine whether to install perl also as /usr/bin/perl
8276 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8278 Many scripts expect perl to be installed as /usr/bin/perl.
8280 If you want to, I can install the perl you are about to compile
8281 as /usr/bin/perl (in addition to $bin/perl).
8283 if test -f /usr/bin/perl; then
8286 However, please note that because you already have a /usr/bin/perl,
8287 overwriting that with a new Perl would very probably cause problems.
8288 Therefore I'm assuming you don't want to do that (unless you insist).
8291 case "$installusrbinperl" in
8292 "$define"|[yY]*) dflt='y';;
8298 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8301 case "$installusrbinperl" in
8302 "$undef"|[nN]*) dflt='n';;
8306 rp="Do you want to install perl as /usr/bin/perl?"
8309 [yY]*) val="$define";;
8315 set installusrbinperl
8318 : see if dlopen exists
8320 xxx_ccflags="$ccflags"
8322 : with g++ one needs -shared to get is-in-libc to work for dlopen
8323 case "$gccversion" in
8326 *) case "$d_cplusplus" in
8327 "$define") ccflags="$ccflags -shared" ;;
8334 ccflags="$xxx_ccflags"
8336 : see if this is a unistd.h system
8337 set unistd.h i_unistd
8340 : determine which dynamic loading, if any, to compile in
8342 dldir="ext/DynaLoader"
8355 $define) dflt='y' ;;
8357 : Does a dl_xxx.xs file exist for this operating system
8358 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8361 rp="Do you wish to use dynamic loading?"
8368 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8369 dflt="$dldir/dl_${osname}.xs"
8370 elif $test "$d_dlopen" = "$define" ; then
8371 dflt="$dldir/dl_dlopen.xs"
8376 *) dflt="$dldir/$dlsrc"
8379 echo "The following dynamic loading files are available:"
8380 : Can not go over to $dldir because getfile has path hard-coded in.
8381 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8382 rp="Source file to use for dynamic loading"
8388 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8392 Some systems may require passing special flags to $cc -c to
8393 compile modules that will be used to create a shared library.
8394 To use no flags, say "none".
8397 case "$cccdlflags" in
8398 '') case "$gccversion" in
8399 '') case "$osname" in
8401 irix*) dflt='-KPIC' ;;
8402 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8403 sunos) dflt='-pic' ;;
8407 *) case "$osname" in
8408 darwin) dflt='none' ;;
8409 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8414 *) dflt="$cccdlflags" ;;
8421 # If -Dsysroot was specified, now's the time to add it
8423 if test "X$sysroot" != X; then
8424 case "$gccversion" in
8429 dflt="$dflt --sysroot=$sysroot" ;;
8439 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8442 none) cccdlflags=' ' ;;
8443 *) cccdlflags="$ans" ;;
8448 Some systems use ld to create libraries that can be dynamically loaded,
8449 while other systems (such as those using ELF) use $cc.
8453 : Determine if this is ELF
8455 /* Test for whether ELF binaries are produced */
8467 int i = open("a.out",O_RDONLY);
8470 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8471 exit(0); /* succeed (yes, it is ELF) */
8475 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8481 '') if $test $bin_ELF = "$define"; then
8483 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8487 echo "I'll use ld to build dynamic libraries."
8495 rp="What command should be used to create dynamic libraries?"
8501 Some systems may require passing special flags to $ld to create a
8502 library that can be dynamically loaded. If your ld flags include
8503 -L/other/path options to locate libraries outside your loader's normal
8504 search path, you may need to specify those -L options here as well. To
8505 use no flags, say "none".
8508 case "$lddlflags" in
8509 '') case "$osname" in
8510 haiku) dflt='-shared' ;;
8512 case "$gccversion" in
8513 '') dflt="$dflt +vnocompatwarnings" ;;
8516 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8517 solaris) # See [perl #66604].
8518 # On Solaris 11, gcc -m64 on amd64
8519 # appears not to understand -G. gcc versions at
8520 # least as old as 3.4.3 support -shared, so just
8521 # use that with Solaris 11 and later, but keep
8522 # the old behavior for older Solaris versions.
8523 case "$gccversion" in
8525 *) case "$osvers" in
8526 2.?|2.10) dflt='-G' ;;
8527 *) dflt='-shared' ;;
8532 sunos) dflt='-assert nodefinitions' ;;
8533 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8537 *) dflt="$lddlflags" ;;
8540 : Only do this for gcc, since, for example, qcc has no concept
8542 if $test "X$sysroot" != X; then
8543 case "$gccversion" in
8545 *) dflt="$dflt --sysroot $sysroot" ;;
8549 : Try to guess additional flags to pick up local libraries.
8550 : Be careful not to append to a plain 'none'
8554 for thisflag in $ldflags; do
8559 *) dflt="$dflt $thisflag" ;;
8566 ''|' ') dflt='none' ;;
8570 *-fstack-protector-strong*)
8572 *-fstack-protector-strong*) ;; # Don't add it again
8573 *) dflt="$dflt -fstack-protector-strong" ;;
8576 *-fstack-protector*)
8578 *-fstack-protector*) ;; # Don't add it again
8579 *) dflt="$dflt -fstack-protector" ;;
8584 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8587 none) lddlflags=' ' ;;
8588 *) lddlflags="$ans" ;;
8593 Some systems may require passing special flags to $cc to indicate that
8594 the resulting executable will use dynamic linking. To use no flags,
8598 case "$ccdlflags" in
8599 '') case "$osname" in
8600 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8601 sunos) dflt='none' ;;
8605 *) dflt="$ccdlflags" ;;
8607 rp="Any special flags to pass to $cc to use dynamic linking?"
8610 none) ccdlflags=' ' ;;
8611 *) ccdlflags="$ans" ;;
8623 ld_can_script="$undef"
8624 case "$bin_ELF$usedl" in
8626 # Abuse try.h and a.out names for neat cleanup
8638 if $cc $cccdlflags $ccdlflags $ccflags \
8639 $ldflags $lddlflags -o a.out try.c \
8640 -Wl,--version-script=try.h >/dev/null 2>&1 \
8641 && $test -s a.out ; then
8642 echo "ld supports scripting" >&4
8643 ld_can_script="$define"
8645 echo "ld does not support scripting" >&4
8651 : Do we want a shared libperl?
8655 # No dynamic loading being used, so don't bother even to prompt.
8658 *) case "$useshrplib" in
8659 '') case "$osname" in
8660 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8662 also='Building a shared libperl is required for dynamic loading to work on your system.'
8676 The perl executable is normally obtained by linking perlmain.c with
8677 libperl${_a}, any static extensions (usually just DynaLoader), and
8678 any other libraries needed on this system (such as -lm, etc.). Since
8679 your system supports dynamic loading, it is probably possible to build
8680 a shared libperl.$so. If you will have more than one executable linked
8681 to libperl.$so, this will significantly reduce the size of each
8682 executable, but it may have a noticeable effect on performance. The
8683 default is probably sensible for your system.
8687 rp="Build a shared libperl.$so (y/n)"
8691 useshrplib='true' ;;
8692 *) useshrplib='false' ;;
8697 case "$useshrplib" in
8699 case "$userelocatableinc" in
8701 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8702 echo "See INSTALL for an explanation why that won't work." >&4
8708 # Figure out a good name for libperl.so. Since it gets stored in
8709 # a version-specific architecture-dependent library, the version
8710 # number isn't really that important, except for making cc/ld happy.
8712 # A name such as libperl.so.10.1
8713 majmin="libperl.$so.$patchlevel.$subversion"
8714 # A name such as libperl.so.100
8715 majonly=`echo $patchlevel $subversion |
8716 $awk '{printf "%d%02d", $1, $2}'`
8717 majonly=libperl.$so.$majonly
8718 # I'd prefer to keep the os-specific stuff here to a minimum, and
8719 # rely on figuring it out from the naming of libc.
8720 case "${osname}${osvers}" in
8721 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8724 cygwin*) # ld links now against the dll directly
8725 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8726 majonly=`echo $patchlevel $subversion |
8727 $awk '{printf "%03d%03d", $1, $2}'`
8728 majonly=cygperl5.$majonly.$so
8731 *) # Try to guess based on whether libc has major.minor.
8733 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8734 *libc.$so.[0-9]*) dflt=$majonly ;;
8735 *) dflt=libperl.$so ;;
8745 I need to select a good name for the shared libperl. If your system uses
8746 library names with major and minor numbers, then you might want something
8747 like $majmin. Alternatively, if your system uses a single version
8748 number for shared libraries, then you might want to use $majonly.
8749 Or, your system might be quite happy with a simple libperl.$so.
8751 Since the shared libperl will get installed into a version-specific
8752 architecture-dependent directory, the version number of the shared perl
8753 library probably isn't important, so the default should be o.k.
8756 rp='What name do you want to give to the shared libperl?'
8759 echo "Ok, I'll use $libperl"
8762 libperl="libperl${_a}"
8766 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8770 WARNING: Use of the shrpdir variable for the installation location of
8771 the shared $libperl is not supported. It was never documented and
8772 will not work in this version. Let me (perlbug@perl.org)
8773 know of any problems this may cause.
8779 But your current setting of $shrpdir is
8780 the default anyway, so it's harmless.
8785 Further, your current attempted setting of $shrpdir
8786 conflicts with the value of $archlibexp/CORE
8787 that installperl will use.
8794 # How will the perl executable find the installed shared $libperl?
8795 # Add $xxx to ccdlflags.
8796 # If we can't figure out a command-line option, use $shrpenv to
8797 # set env LD_RUN_PATH. The main perl makefile uses this.
8798 shrpdir=$archlibexp/CORE
8801 if "$useshrplib"; then
8804 # We'll set it in Makefile.SH...
8809 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8810 xxx="-Wl,-R$shrpdir"
8812 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8813 xxx="-Wl,-rpath,$shrpdir"
8816 # hpux doesn't like the default, either.
8817 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8820 # cygwin needs only ldlibpth
8823 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8829 # Only add $xxx if it isn't already in ccdlflags.
8830 case " $ccdlflags " in
8832 *) ccdlflags="$ccdlflags $xxx"
8835 Adding $xxx to the flags
8836 passed to $ld so that the perl executable will find the
8837 installed shared $libperl.
8845 # Fix ccdlflags in AIX for building external extensions.
8846 # (For building Perl itself bare -bE:perl.exp is needed,
8847 # Makefile.SH takes care of this.)
8849 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8851 # Respect a hint or command-line value.
8853 '') shrpenv="$tmp_shrpenv" ;;
8855 case "$ldlibpthname" in
8856 '') ldlibpthname=LD_LIBRARY_PATH ;;
8857 none) ldlibpthname='' ;;
8860 : determine where manual pages are on this system
8864 syspath='/usr/share/man/man1 /usr/man/man1'
8865 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8866 syspath="$syspath /usr/man/u_man/man1"
8867 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8868 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8869 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8870 sysman=`./loc . /usr/man/man1 $syspath`
8873 if $test -d "$sysman"; then
8874 echo "System manual is in $sysman." >&4
8876 echo "Could not find manual pages in source form." >&4
8879 : determine where manual pages go
8880 set man1dir man1dir none
8884 $spackage has manual pages available in source form.
8888 echo "However, you don't have nroff, so they're probably useless to you."
8890 '') man1dir="none";;
8893 echo "If you don't want the manual sources installed, answer 'none'."
8898 lookpath="$prefixexp/share/man/man1"
8899 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8900 lookpath="$lookpath $prefixexp/man/p_man/man1"
8901 lookpath="$lookpath $prefixexp/man/u_man/man1"
8902 lookpath="$lookpath $prefixexp/man/man.1"
8904 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8905 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8915 rp="Where do the main $spackage manual pages (source) go?"
8917 if $test "X$man1direxp" != "X$ansexp"; then
8928 : What suffix to use on installed man pages
8935 rp="What suffix should be used for the main $spackage man pages?"
8937 '') case "$man1dir" in
8951 *) dflt="$man1ext";;
8958 : see if we can have long filenames
8960 first=123456789abcdef
8962 if (echo hi >$first) 2>/dev/null; then
8963 if $test -f 123456789abcde; then
8964 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8967 echo 'You can have filenames longer than 14 characters.'>&4
8972 You can't have filenames longer than 14 chars.
8973 You can't even think about them!
8979 $rm -rf 123456789abcde*
8981 : determine where library module manual pages go
8982 set man3dir man3dir none
8986 $spackage has manual pages for many of the library modules.
8992 However, you don't have nroff, so they're probably useless to you.
8995 '') man3dir="none";;
8999 case "$d_flexfnam" in
9002 However, your system can't handle the long file names like File::Basename.3.
9005 '') man3dir="none";;
9009 echo "If you don't want the manual sources installed, answer 'none'."
9010 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9012 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9013 if $test -d "$privlib/man/man3"; then
9016 WARNING: Previous versions of perl installed man3 pages into
9017 $privlib/man/man3. This version will suggest a
9018 new default of $dflt.
9022 rp='Do you wish to preserve the old behavior?(y/n)'
9025 y*) dflt="$privlib/man/man3" ;;
9030 *) dflt="$man3dir" ;;
9037 rp="Where do the $package library man pages (source) go?"
9047 : What suffix to use on installed man pages
9053 rp="What suffix should be used for the $package library man pages?"
9055 '') case "$man3dir" in
9069 *) dflt="$man3ext";;
9076 : see if we have to deal with yellow pages, now NIS.
9077 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9083 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9091 rp='Are you getting the hosts file via yellow pages?'
9094 y*) hostcat='ypcat hosts';;
9095 *) hostcat='cat /etc/hosts';;
9101 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9104 '') test -f /etc/group && groupcat='cat /etc/group';;
9107 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9110 : now get the host name
9112 echo "Figuring out host name..." >&4
9113 case "$myhostname" in
9115 echo 'Maybe "hostname" will work...'
9116 if tans=`sh -c hostname 2>&1` ; then
9124 if $test "$cont"; then
9126 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9127 if tans=`cat /etc/systemid 2>&1` ; then
9129 phostname='cat /etc/systemid'
9130 echo "Whadyaknow. Xenix always was a bit strange..."
9133 elif $test -r /etc/systemid; then
9134 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9137 if $test "$cont"; then
9138 echo 'No, maybe "uuname -l" will work...'
9139 if tans=`sh -c 'uuname -l' 2>&1` ; then
9141 phostname='uuname -l'
9143 echo 'Strange. Maybe "uname -n" will work...'
9144 if tans=`sh -c 'uname -n' 2>&1` ; then
9146 phostname='uname -n'
9148 echo 'Oh well, maybe I can mine it out of whoami.h...'
9149 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9150 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9151 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9153 case "$myhostname" in
9154 '') echo "Does this machine have an identity crisis or something?"
9157 echo "Well, you said $myhostname before..."
9158 phostname='echo $myhostname';;
9164 case "$myhostname" in
9165 '') myhostname=noname ;;
9167 : you do not want to know about this
9172 if $test "$myhostname" ; then
9174 rp='Your host name appears to be "'$myhostname'".'" Right?"
9182 : bad guess or no guess
9183 while $test "X$myhostname" = X ; do
9185 rp="Please type the (one word) name of your host:"
9190 : translate upper to lower if necessary
9191 case "$myhostname" in
9193 echo "(Normalizing case in your host name)"
9194 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9198 case "$myhostname" in
9200 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9201 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9202 echo "(Trimming domain name from host name--host name is now $myhostname)"
9204 *) case "$mydomain" in
9207 test "X$hostcat" = "Xypcat hosts" &&
9208 ypmatch "$myhostname" hosts 2>/dev/null |\
9209 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9212 test "X$hostcat" != "X" &&
9213 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9214 /[ ]$myhostname[ . ]/p" > hosts
9217 if $test -f hosts; then
9218 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9219 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9220 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9221 hosts | $sort | $uniq | \
9222 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9223 case `$echo X$dflt` in
9224 X*\ *) echo "(Several hosts in the database matched hostname)"
9227 X.) echo "(You do not have fully-qualified names in the hosts database)"
9231 echo "(I cannot locate a hosts database anywhere)"
9236 tans=`./loc resolv.conf X /etc /usr/etc`
9237 if $test -f "$tans"; then
9238 echo "(Attempting domain name extraction from $tans)"
9239 dflt=.`$sed -n -e 's/ / /g' \
9240 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9243 .) dflt=.`$sed -n -e 's/ / /g' \
9244 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9252 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9253 dflt=.`sh -c domainname 2>/dev/null`
9256 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9260 case "$dflt$osname" in
9261 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9262 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9266 .) echo "(Lost all hope -- silly guess then)"
9272 *) dflt="$mydomain";;
9276 rp="What is your domain name?"
9286 : translate upper to lower if necessary
9289 echo "(Normalizing case in your domain name)"
9290 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9294 : a little sanity check here
9295 case "$phostname" in
9298 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9299 $myhostname$mydomain|$myhostname) ;;
9301 case "$phostname" in
9303 echo "(That doesn't agree with your whoami.h file, by the way.)"
9306 echo "(That doesn't agree with your $phostname command, by the way.)"
9314 : determine the e-mail address of the user who is running us
9317 I need to get your e-mail address in Internet format if possible, i.e.
9318 something like user@host.domain. Please answer accurately since I have
9319 no easy means to double check it. The default value provided below
9320 is most probably close to reality but may not be valid from outside
9321 your organization...
9325 while test "$cont"; do
9326 case "$MAILDOMAIN" in
9328 if $test -s /etc/mailname; then
9329 maildomain=`$cat /etc/mailname`
9331 maildomain="$myhostname$mydomain"
9334 *) maildomain="$MAILDOMAIN";;
9337 '') dflt="$cf_by@$maildomain";;
9338 *) dflt="$cf_email";;
9340 rp='What is your e-mail address?'
9346 rp='Address does not look like an Internet one. Use it anyway?'
9360 : Ask e-mail of administrator
9363 If you or somebody else will be maintaining perl at your site, please
9364 fill in the correct e-mail address here so that they may be contacted
9365 if necessary. Currently, the "perlbug" program included with perl
9366 will send mail to this address in addition to perlbug@perl.org. You may
9367 enter "none" for no administrator.
9370 case "$perladmin" in
9371 '') dflt="$cf_email";;
9372 *) dflt="$perladmin";;
9374 rp='Perl administrator e-mail address'
9378 : determine whether to use a version number suffix for installed binaries
9381 Do you want to use a version number suffix for installed binaries? This
9382 will install 'perl$version' instead of 'perl', and likewise for other
9383 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9384 to be installed side-by-side. Unless you are a developer, you probably
9385 do *not* want to do this.
9387 case "$versiononly" in
9388 "$define"|[Yy]*|true) dflt='y' ;;
9391 rp="Do you want to use a version number suffix for installed binaries?"
9394 [yY]*) val="$define";;
9400 case "$versiononly" in
9401 "$define") inc_version_list=''
9402 inc_version_list_init=0
9406 : figure out how to guarantee perl startup
9407 : XXX Note that this currently takes advantage of the bug that binexp ignores
9408 : the Configure -Dinstallprefix setting, which in turn means that under
9409 : relocatable @INC, initialinstalllocation is what binexp started as.
9410 case "$startperl" in
9412 case "$sharpbang" in
9416 I can use the #! construct to start perl on your system. This will
9417 make startup of perl scripts faster, but may cause problems if you
9418 want to share those scripts and perl is not in a standard place
9419 ($initialinstalllocation/perl) on all your platforms. The alternative
9420 is to force a shell by starting the script with a single ':' character.
9423 case "$versiononly" in
9424 "$define") dflt="$initialinstalllocation/perl$version";;
9425 *) dflt="$initialinstalllocation/perl";;
9427 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9430 none) startperl=": # use perl";;
9431 *) startperl="#!$ans"
9432 if $test 30 -lt `echo "$ans" | wc -c`; then
9435 WARNING: Some systems limit the #! command to 32 characters.
9436 If you experience difficulty running Perl scripts with #!, try
9437 installing Perl in a directory with a shorter pathname.
9443 *) startperl=": # use perl"
9448 echo "I'll use $startperl to start perl scripts."
9450 : figure best path for perl in scripts
9453 case "$versiononly" in
9454 "$define") perlpath="$initialinstalllocation/perl$version";;
9455 *) perlpath="$initialinstalllocation/perl";;
9457 case "$startperl" in
9462 I will use the "eval 'exec'" idiom to start Perl on your system.
9463 I can use the full path of your Perl binary for this purpose, but
9464 doing so may cause problems if you want to share those scripts and
9465 Perl is not always in a standard place ($initialinstalllocation/perl).
9468 dflt="$initialinstalllocation/perl"
9469 rp="What path shall I use in \"eval 'exec'\"?"
9476 case "$startperl" in
9478 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9481 : determine where public executable scripts go
9482 set scriptdir scriptdir
9484 case "$scriptdir" in
9487 : guess some guesses
9488 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9489 $test -d /usr/share/bin && dflt=/usr/share/bin
9490 $test -d /usr/local/script && dflt=/usr/local/script
9491 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9492 $test -d $prefixexp/script && dflt=$prefixexp/script
9496 *) dflt="$scriptdir"
9501 Some installations have a separate directory just for executable scripts so
9502 that they can mount it across multiple architectures but keep the scripts in
9503 one spot. You might, for example, have a subdirectory of /usr/share for this.
9504 Or you might just lump your scripts in with all your other executables.
9508 rp='Where do you keep publicly executable scripts?'
9510 if $test "X$ansexp" != "X$scriptdirexp"; then
9516 : A little fix up for an irregularly named variable.
9517 installscript="$installscriptdir"
9519 : determine where add-on public executables go
9521 '') dflt=$siteprefix/bin ;;
9525 rp='Pathname where the add-on public executables should be installed?'
9530 : determine where add-on html pages go
9531 : There is no standard location, so try to copy the previously-selected
9532 : directory structure for the core html pages.
9533 case "$sitehtml1dir" in
9534 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9535 *) dflt=$sitehtml1dir ;;
9538 ''|' ') dflt=none ;;
9541 rp='Pathname where the site-specific html pages should be installed?'
9543 prefixvar=sitehtml1dir
9546 : determine where add-on library html pages go
9547 : There is no standard location, so try to copy the previously-selected
9548 : directory structure for the core html pages.
9549 case "$sitehtml3dir" in
9550 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9551 *) dflt=$sitehtml3dir ;;
9554 ''|' ') dflt=none ;;
9557 rp='Pathname where the site-specific library html pages should be installed?'
9559 prefixvar=sitehtml3dir
9562 : determine where add-on manual pages go
9563 case "$siteman1dir" in
9564 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9565 *) dflt=$siteman1dir ;;
9568 ''|' ') dflt=none ;;
9571 rp='Pathname where the site-specific manual pages should be installed?'
9573 prefixvar=siteman1dir
9576 : determine where add-on library man pages go
9577 case "$siteman3dir" in
9578 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9579 *) dflt=$siteman3dir ;;
9582 ''|' ') dflt=none ;;
9585 rp='Pathname where the site-specific library manual pages should be installed?'
9587 prefixvar=siteman3dir
9590 : determine where add-on public executable scripts go
9591 case "$sitescript" in
9592 '') dflt=$siteprefix/script
9593 $test -d $dflt || dflt=$sitebin ;;
9594 *) dflt="$sitescript" ;;
9597 rp='Pathname where add-on public executable scripts should be installed?'
9599 prefixvar=sitescript
9602 : see if backtrace exists
9603 set backtrace d_backtrace
9606 : add flags if using c backtrace
9607 case "$usecbacktrace" in
9608 "") usecbacktrace=$undef ;;
9610 case "$d_backtrace" in
9612 case " $ccflags " in
9613 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9614 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9618 echo "This system does not support backtrace" >&4
9619 usecbacktrace=$undef
9625 : Check if faststdio is requested and available
9626 case "$usefaststdio" in
9627 $define|true|[yY]*|'')
9628 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9638 Perl can be built to use 'fast stdio', which means using the stdio
9639 library but also directly manipulating the stdio buffers to enable
9640 faster I/O. Using stdio is better for backward compatibility (especially
9641 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9642 interface has been preferred instead of stdio.
9644 If this doesn't make any sense to you, just accept the default '$dflt'.
9646 rp='Use the "fast stdio" if available?'
9649 y|Y) val="$define" ;;
9655 : define an is-a-typedef? function
9656 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9658 "") inclist="sys/types.h";;
9660 eval "varval=\$$var";
9664 for inc in $inclist; do
9665 echo "#include <$inc>" >>temp.c;
9667 echo "#ifdef $type" >> temp.c;
9668 echo "printf(\"We have $type\");" >> temp.c;
9669 echo "#endif" >> temp.c;
9670 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9671 if $contains $type temp.E >/dev/null 2>&1; then
9677 *) eval "$var=\$varval";;
9680 : define an is-a-typedef? function that prompts if the type is not available.
9681 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9683 "") inclist="sys/types.h";;
9685 eval "varval=\$$var";
9689 for inc in $inclist; do
9690 echo "#include <$inc>" >>temp.c;
9692 echo "#ifdef $type" >> temp.c;
9693 echo "printf(\"We have $type\");" >> temp.c;
9694 echo "#endif" >> temp.c;
9695 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9697 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9698 if $contains $type temp.E >/dev/null 2>&1; then
9699 echo "$type found." >&4;
9702 echo "$type NOT found." >&4;
9708 *) eval "$var=\$varval";;
9711 : see what type lseek is declared as in the kernel
9712 rp="What is the type used for lseek's offset on this system?"
9713 set off_t lseektype long stdio.h sys/types.h
9717 echo "Checking to see how big your file offsets are..." >&4
9719 #include <sys/types.h>
9723 printf("%d\n", (int)sizeof($lseektype));
9728 if eval $compile_ok; then
9729 lseeksize=`$run ./try`
9730 echo "Your file offsets are $lseeksize bytes long."
9734 echo "(I can't seem to compile the test program. Guessing...)"
9735 rp="What is the size of your file offsets (in bytes)?"
9741 : see what type file positions are declared as in the library
9742 rp="What is the type for file position used by fsetpos()?"
9743 set fpos_t fpostype long stdio.h sys/types.h
9746 : Check size for Fpos_t
9749 *_t) zzz="$fpostype" ;;
9752 echo "Checking the size of $zzz..." >&4
9754 #include <sys/types.h>
9761 printf("%d\n", (int)sizeof($fpostype));
9766 if eval $compile_ok; then
9770 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9773 echo "Your $zzz is $fpossize bytes long."
9779 echo "(I can't compile the test program. Guessing...)" >&4
9780 rp="What is the size of your file positions (in bytes)?"
9785 : Check for large file support
9786 # Backward compatibility (uselfs is deprecated).
9788 "$define"|true|[yY]*)
9791 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9793 uselargefiles="$define"
9797 case "$lseeksize:$fpossize" in
9800 You can have files larger than 2 gigabytes.
9803 *) case "$uselargefiles" in
9804 "$undef"|false|[nN]*) dflt='n' ;;
9809 Perl can be built to understand large files (files larger than 2 gigabytes)
9810 on some systems. To do so, Configure can be run with -Duselargefiles.
9812 If this doesn't make any sense to you, just accept the default '$dflt'.
9814 rp='Try to understand large files, if available?'
9817 y|Y) val="$define" ;;
9824 : Look for a hint-file generated 'call-back-unit'. If the
9825 : user has specified that a large files perl is to be built,
9826 : we may need to set or change some other defaults.
9827 if $test -f uselargefiles.cbu; then
9828 echo "Your platform has some specific hints regarding large file builds, using them..."
9829 . ./uselargefiles.cbu
9831 case "$uselargefiles" in
9833 if $test -f uselargefiles.cbu; then
9835 echo "Rechecking to see how big your file offsets are..." >&4
9837 #include <sys/types.h>
9841 printf("%d\n", (int)sizeof($lseektype));
9846 if eval $compile_ok; then
9847 lseeksize=`$run ./try`
9848 $echo "Your file offsets are now $lseeksize bytes long."
9852 echo "(I can't seem to compile the test program. Guessing...)"
9853 rp="What is the size of your file offsets (in bytes)?"
9858 *_t) zzz="$fpostype" ;;
9861 $echo $n "Rechecking the size of $zzz...$c" >&4
9863 #include <sys/types.h>
9870 printf("%d\n", (int)sizeof($fpostype));
9875 if eval $compile_ok; then
9880 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9883 echo " $fpossize bytes." >&4
9889 echo "(I can't compile the test program. Guessing...)" >&4
9890 rp="What is the size of your file positions (in bytes)?"
9899 : Check if we want perlio
9902 : Set the vendorbin variables
9903 case "$vendorprefix" in
9904 '') d_vendorbin="$undef"
9908 *) d_vendorbin="$define"
9909 : determine where vendor-supplied executables go.
9910 case "$vendorbin" in
9911 '') dflt=$vendorprefix/bin ;;
9912 *) dflt="$vendorbin" ;;
9915 rp='Pathname for the vendor-supplied executables directory?'
9918 vendorbinexp="$ansexp"
9924 : Set the vendorhtml1dir variables
9925 case "$vendorprefix" in
9926 '') vendorhtml1dir=''
9927 vendorhtml1direxp=''
9929 *) : determine where vendor-supplied html pages go.
9930 : There is no standard location, so try to copy the previously-selected
9931 : directory structure for the core html pages.
9932 : XXX Better default suggestions would be welcome.
9933 case "$vendorhtml1dir" in
9934 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9935 *) dflt=$vendorhtml1dir ;;
9938 ''|' ') dflt=none ;;
9941 rp='Pathname for the vendor-supplied html pages?'
9943 vendorhtml1dir="$ans"
9944 vendorhtml1direxp="$ansexp"
9947 : Use ' ' for none so value is preserved next time through Configure
9948 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9949 prefixvar=vendorhtml1dir
9952 : Set the vendorhtml3dir variables
9953 case "$vendorprefix" in
9954 '') vendorhtml3dir=''
9955 vendorhtml3direxp=''
9957 *) : determine where vendor-supplied module html pages go.
9958 : There is no standard location, so try to copy the previously-selected
9959 : directory structure for the core html pages.
9960 : XXX Better default suggestions would be welcome.
9961 case "$vendorhtml3dir" in
9962 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9963 *) dflt=$vendorhtml3dir ;;
9966 ''|' ') dflt=none ;;
9969 rp='Pathname for the vendor-supplied html pages?'
9971 vendorhtml3dir="$ans"
9972 vendorhtml3direxp="$ansexp"
9975 : Use ' ' for none so value is preserved next time through Configure
9976 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9977 prefixvar=vendorhtml3dir
9980 : Set the vendorman1dir variables
9981 case "$vendorprefix" in
9982 '') vendorman1dir=''
9985 *) : determine where vendor-supplied manual pages go.
9986 case "$vendorman1dir" in
9987 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9988 *) dflt=$vendorman1dir ;;
9991 ''|' ') dflt=none ;;
9994 rp='Pathname for the vendor-supplied manual section 1 pages?'
9996 vendorman1dir="$ans"
9997 vendorman1direxp="$ansexp"
10000 : Use ' ' for none so value is preserved next time through Configure
10001 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10002 prefixvar=vendorman1dir
10005 : Set the vendorman3dir variables
10006 case "$vendorprefix" in
10007 '') vendorman3dir=''
10008 vendorman3direxp=''
10010 *) : determine where vendor-supplied module manual pages go.
10011 case "$vendorman3dir" in
10012 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10013 *) dflt=$vendorman3dir ;;
10016 ''|' ') dflt=none ;;
10019 rp='Pathname for the vendor-supplied manual section 3 pages?'
10021 vendorman3dir="$ans"
10022 vendorman3direxp="$ansexp"
10025 : Use ' ' for none so value is preserved next time through Configure
10026 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10027 prefixvar=vendorman3dir
10030 : Set the vendorscript variables
10031 case "$vendorprefix" in
10032 '') d_vendorscript="$undef"
10036 *) d_vendorscript="$define"
10037 : determine where vendor-supplied scripts go.
10038 case "$vendorscript" in
10039 '') dflt=$vendorprefix/script
10040 $test -d $dflt || dflt=$vendorbin ;;
10041 *) dflt="$vendorscript" ;;
10045 The installation process will create a directory for
10046 vendor-supplied scripts.
10050 rp='Pathname for the vendor-supplied scripts directory?'
10052 vendorscript="$ans"
10053 vendorscriptexp="$ansexp"
10056 prefixvar=vendorscript
10059 : see if qgcvt exists
10063 : Check what kind of doubles your system has
10064 $echo "Checking the kind of doubles you have..." >&4
10066 #$i_stdlib I_STDLIB
10067 #define DOUBLESIZE $doublesize
10069 #include <stdlib.h>
10072 static const double d = -0.1;
10074 unsigned const char* b = (unsigned const char*)(&d);
10075 #if DOUBLESIZE == 4
10076 if (b[0] == 0xCD && b[3] == 0xBD) {
10077 /* IEEE 754 32-bit little-endian */
10081 if (b[0] == 0xBD && b[3] == 0xCD) {
10082 /* IEEE 754 32-bit big-endian */
10086 if (b[0] == 0xCC && b[3] == 0xCC) {
10087 /* VAX format F, 32-bit PDP-style mixed endian. */
10091 if (b[0] == 0xC0 && b[3] == 0x9A) {
10092 /* IBM single 32-bit */
10097 #if DOUBLESIZE == 8
10098 if (b[0] == 0x9A && b[7] == 0xBF) {
10099 /* IEEE 754 64-bit little-endian */
10103 if (b[0] == 0xBF && b[7] == 0x9A) {
10104 /* IEEE 754 64-bit big-endian */
10108 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10109 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10110 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10111 * 99 99 b9 bf 9a 99 99 99 */
10115 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10116 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10117 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10118 * 99 99 99 9a bf b9 99 99 */
10122 if (b[0] == 0xCC && b[7] == 0xCC) {
10123 /* VAX format D, 64-bit PDP-style mixed endian. */
10127 if (b[0] == 0xD9 && b[7] == 0x99) {
10128 /* VAX format G, 64-bit PDP-style mixed endian. */
10132 if (b[0] == 0xC0 && b[7] == 0x9A) {
10133 /* IBM double 64-bit */
10137 if (b[0] == 0xBF && b[7] == 0xCD) {
10138 /* CRAY single 64-bit */
10143 #if DOUBLESIZE == 16
10144 if (b[0] == 0x9A && b[15] == 0xBF) {
10145 /* IEEE 754 128-bit little-endian */
10149 if (b[0] == 0xBF && b[15] == 0x9A) {
10150 /* IEEE 754 128-bit big-endian */
10155 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10156 * Whether those environments can still build Perl is debatable. */
10157 printf("-1\n"); /* unknown */
10162 if eval $compile; then
10163 doublekind=`$run ./try`
10167 case "$doublekind" in
10168 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10169 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10170 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10171 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10172 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10173 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10174 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10175 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10176 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10177 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10178 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10179 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10180 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10181 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10182 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10184 d_double_style_ieee=$undef
10185 d_double_style_vax=$undef
10186 d_double_style_ibm=$undef
10187 d_double_style_cray=$undef
10188 case "$doublekind" in
10189 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10190 9|10|11) d_double_style_vax=$define ;;
10191 12|13) d_double_style_ibm=$define ;;
10192 14) d_double_style_cray=$define ;;
10194 case "$d_double_style_ieee" in
10196 d_double_has_inf=$define
10197 d_double_has_nan=$define
10198 d_double_has_negative_zero=$define
10199 d_double_has_subnormals=$define
10202 d_double_has_inf=$undef
10203 d_double_has_nan=$undef
10204 d_double_has_negative_zero=$undef
10205 d_double_has_subnormals=$undef
10210 : Check print/scan long double stuff
10213 if $test X"$d_longdbl" = X"$define"; then
10215 echo "Checking how to print long doubles..." >&4
10217 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10218 $cat >try.c <<'EOCP'
10219 #include <sys/types.h>
10222 double d = 123.456;
10223 printf("%.3f\n", d);
10227 if eval $compile; then
10231 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10232 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10233 echo "We will use %f."
10239 if $test X"$sPRIfldbl" = X; then
10240 $cat >try.c <<'EOCP'
10241 #include <sys/types.h>
10244 long double d = 123.456;
10245 printf("%.3Lf\n", d);
10249 if eval $compile; then
10253 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10254 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10255 echo "We will use %Lf."
10261 if $test X"$sPRIfldbl" = X; then
10262 $cat >try.c <<'EOCP'
10263 #include <sys/types.h>
10266 long double d = 123.456;
10267 printf("%.3llf\n", d);
10271 if eval $compile; then
10275 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10276 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10277 echo "We will use %llf."
10283 if $test X"$sPRIfldbl" = X; then
10284 $cat >try.c <<'EOCP'
10285 #include <sys/types.h>
10288 long double d = 123.456;
10289 printf("%.3lf\n", d);
10293 if eval $compile; then
10297 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10298 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10299 echo "We will use %lf."
10305 if $test X"$sPRIfldbl" = X; then
10306 echo "Cannot figure out how to print long doubles." >&4
10308 sSCNfldbl=$sPRIfldbl # expect consistency
10315 case "$sPRIfldbl" in
10316 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10317 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10318 d_SCNfldbl="$undef";
10320 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10321 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10322 d_SCNfldbl="$define";
10326 : Before committing on uselongdouble, see whether that looks sane.
10327 if $test "$uselongdouble" = "$define"; then
10330 echo "Checking if your long double math functions work right..." >&4
10335 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10338 case "$osname:$gccversion" in
10339 aix:) saveccflags="$ccflags"
10340 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10343 if eval $compile_ok; then
10347 3) echo "Your long double math functions are working correctly." >&4 ;;
10348 *) echo "Your long double math functions are broken, not using long doubles." >&4
10349 uselongdouble=$undef
10353 case "$osname:$gccversion" in
10354 aix:) ccflags="$saveccflags" ;; # restore
10358 : Check how to convert floats to strings.
10360 if test "X$d_Gconvert" = X; then
10363 echo "Checking for an efficient way to convert floats to strings."
10365 case "$uselongdouble" in
10366 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10368 case "$d_longdbl" in
10369 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10371 case "$d_PRIgldbl" in
10372 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10375 #ifdef TRY_gconvert
10376 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10377 char *myname = "gconvert";
10380 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10381 char *myname = "gcvt";
10384 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10385 char *myname = "qgcvt";
10386 #define DOUBLETYPE long double
10389 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10390 #ifdef HAS_PRIgldbl
10391 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10393 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10396 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10398 char *myname = "sprintf";
10402 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10403 #define DOUBLETYPE long double
10405 #define DOUBLETYPE double
10411 #$i_stdlib I_STDLIB
10413 #include <stdlib.h>
10415 #include <string.h>
10417 int checkit(char *expect, char *got)
10419 if (strcmp(expect, got)) {
10420 printf("%s oddity: Expected %s, got %s\n",
10421 myname, expect, got);
10431 /* This must be 1st test on (which?) platform */
10432 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10433 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10434 checkit("0.1", buf);
10436 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10437 checkit("0.01", buf);
10439 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10440 checkit("0.001", buf);
10442 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10443 checkit("0.0001", buf);
10445 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10446 if (strlen(buf) > 5)
10447 checkit("9e-005", buf); /* for Microsoft ?? */
10449 checkit("9e-05", buf);
10451 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10454 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10455 checkit("1.1", buf);
10457 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10458 checkit("1.01", buf);
10460 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10461 checkit("1.001", buf);
10463 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10464 checkit("1.0001", buf);
10466 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10467 checkit("1.00001", buf);
10469 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10470 checkit("1.000001", buf);
10472 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10475 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10476 checkit("-1", buf);
10478 /* Some Linux gcvt's give 1.e+5 here. */
10479 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10480 checkit("100000", buf);
10482 /* Some Linux gcvt's give -1.e+5 here. */
10483 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10484 checkit("-100000", buf);
10486 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10487 checkit("123.456", buf);
10489 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10490 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10491 /* 34 should be enough to scare even long double
10492 * places into using the e notation. */
10493 if (strlen(buf) > 5)
10494 checkit("1e+034", buf); /* for Microsoft */
10496 checkit("1e+34", buf);
10498 /* For Perl, if you add additional tests here, also add them to
10499 * t/base/num.t for benefit of platforms not using Configure or
10500 * overriding d_Gconvert */
10505 : first add preferred functions to our list
10507 for xxx_convert in $gconvert_preference; do
10508 case $xxx_convert in
10509 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10510 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10513 : then add any others
10514 for xxx_convert in gconvert gcvt sprintf; do
10515 case "$xxx_list" in
10517 *) xxx_list="$xxx_list $xxx_convert" ;;
10521 case "$d_longdbl$uselongdouble" in
10523 : again, add preferred functions to our list first
10525 for xxx_convert in $gconvert_ld_preference; do
10526 case $xxx_convert in
10527 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10528 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10531 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10532 for xxx_convert in qgcvt sprintf $xxx_list; do
10533 case "$xxx_ld_list" in
10534 $xxx_convert*|*" $xxx_convert"*) ;;
10535 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10538 : if sprintf cannot do long doubles, move it to the end
10539 if test "$d_PRIgldbl" != "$define"; then
10540 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10542 : if no qgcvt, remove it
10543 if test "$d_qgcvt" != "$define"; then
10544 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10547 xxx_list="$xxx_ld_list"
10551 for xxx_convert in $xxx_list; do
10552 echo "Trying $xxx_convert..."
10553 $rm -f try try$_o core
10554 set try -DTRY_$xxx_convert
10555 if eval $compile; then
10556 echo "$xxx_convert() found." >&4
10557 if $run ./try; then
10558 echo "I'll use $xxx_convert to convert floats into a string." >&4
10561 echo "...But $xxx_convert didn't work as I expected."
10565 echo "$xxx_convert NOT found." >&4
10569 if test X$xxx_convert = X; then
10570 echo "*** WHOA THERE!!! ***" >&4
10571 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10572 xxx_convert=sprintf
10575 case "$xxx_convert" in
10576 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10577 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10578 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10579 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10580 "$define$define$define")
10581 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10582 "$define$define$undef")
10583 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10584 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10592 : see if _fwalk exists
10596 : see if accept4 exists
10597 set accept4 d_accept4
10600 : Initialize h_fcntl
10603 : Initialize h_sysfile
10606 : access call always available on UNIX
10607 set access d_access
10610 : locate the flags for 'access()'
10611 case "$d_access" in
10614 $cat >access.c <<EOCP
10615 #include <sys/types.h>
10620 #include <sys/file.h>
10623 #include <unistd.h>
10625 #$i_stdlib I_STDLIB
10627 #include <stdlib.h>
10633 : check sys/file.h first, no particular reason here
10634 if $test `./findhdr sys/file.h` && \
10635 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10637 echo "<sys/file.h> defines the *_OK access constants." >&4
10638 elif $test `./findhdr fcntl.h` && \
10639 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10641 echo "<fcntl.h> defines the *_OK access constants." >&4
10642 elif $test `./findhdr unistd.h` && \
10643 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10644 echo "<unistd.h> defines the *_OK access constants." >&4
10646 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10652 : see if accessx exists
10653 set accessx d_accessx
10656 : see if acosh exists
10660 : see if aintl exists
10664 : see if alarm exists
10668 : see if 64bit time functions exists
10670 set ctime64 d_ctime64
10673 set localtime64 d_localtime64
10676 set gmtime64 d_gmtime64
10679 set mktime64 d_mktime64
10682 set difftime64 d_difftime64
10685 set asctime64 d_asctime64
10688 : see if POSIX threads are available
10689 set pthread.h i_pthread
10692 : define a function to check prototypes
10693 $cat > protochk <<EOSH
10696 optimize="$optimize"
10700 usethreads=$usethreads
10701 i_pthread=$i_pthread
10702 pthread_h_first=$pthread_h_first
10705 $cat >> protochk <<'EOSH'
10710 while test $# -ge 2; do
10712 $define) echo "#include <$2>" >> try.c ;;
10713 literal) echo "$2" >> try.c ;;
10715 # Extra magic for the benefit of systems that need pthread.h
10716 # to be included early to correctly detect threadsafe functions.
10717 # Such functions must guarantee themselves, though, that the usethreads
10718 # and i_pthread have been defined, before calling protochk.
10719 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10720 echo "#include <pthread.h>" >> try.c
10725 cat >> try.c <<'EOCP'
10726 #define _(args) args
10728 echo "$foo" >> try.c
10729 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10730 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10736 $eunicefix protochk
10738 : Define hasproto macro for Configure internal use
10739 hasproto='varname=$1; func=$2; shift; shift;
10740 while $test $# -ge 2; do
10742 $define) echo "#include <$2>";;
10746 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10747 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10748 echo "$func() prototype found.";
10751 echo "$func() prototype NOT found.";
10758 : see if sys/types.h has to be included
10759 set sys/types.h i_systypes
10762 : see if sys/select.h has to be included
10763 set sys/select.h i_sysselct
10766 : Define hasfield macro for Configure internal use
10767 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10768 while $test $# -ge 2; do
10770 $define) echo "#include <$2>";;
10774 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10776 if eval $compile; then
10785 : see if we should include sys/time.h
10788 if test "X$timeincl" = X; then
10789 echo "Testing to see if we should include <sys/time.h>." >&4
10790 $echo $n "I'm now running the test program...$c"
10792 #include <sys/types.h>
10795 #ifdef SYSTIMEKERNEL
10798 #include <sys/time.h>
10801 #include <sys/select.h>
10803 #$i_stdlib I_STDLIB
10805 #include <stdlib.h>
10811 struct timeval bar;
10814 struct timezone tzp;
10816 if (foo.tm_sec == foo.tm_sec)
10819 if (bar.tv_sec == bar.tv_sec)
10826 for s_timezone in '-DS_TIMEZONE' ''; do
10828 for s_timeval in '-DS_TIMEVAL' ''; do
10829 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10830 for i_systime in '-DI_SYSTIME' ''; do
10833 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10834 if eval $compile; then
10835 set X $i_systime $i_systimek $sysselect $s_timeval
10839 $echo $n "Succeeded with $flags$c"
10850 *SYSTIMEKERNEL*) i_systimek="$define"
10851 timeincl=`./findhdr sys/time.h`
10852 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10853 *) i_systimek="$undef";;
10856 *I_SYSTIME*) i_systime="$define"
10857 timeincl=`./findhdr sys/time.h`" $timeincl"
10858 echo "We'll include <sys/time.h>." >&4;;
10859 *) i_systime="$undef";;
10863 : see if struct tm knows about tm_zone
10864 case "$i_systime$i_time" in
10867 echo "Checking to see if your struct tm has tm_zone field..." >&4
10868 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10876 case "$d_tm_tm_zone" in
10877 "$define") echo "Yes, it does." ;;
10878 *) echo "No, it doesn't." ;;
10880 : see if struct tm knows about tm_gmtoff
10881 case "$i_systime$i_time" in
10884 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10885 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10893 case "$d_tm_tm_gmtoff" in
10894 "$define") echo "Yes, it does." ;;
10895 *) echo "No, it doesn't." ;;
10898 : see if asctime_r exists
10899 set asctime_r d_asctime_r
10901 case "$d_asctime_r" in
10903 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10904 case "$d_asctime_r_proto:$usethreads" in
10905 ":define") d_asctime_r_proto=define
10906 set d_asctime_r_proto asctime_r $hdrs
10910 case "$d_asctime_r_proto" in
10912 case "$asctime_r_proto" in
10913 ''|0) try='char* asctime_r(const struct tm*, char*);'
10914 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10916 case "$asctime_r_proto" in
10917 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10918 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10920 case "$asctime_r_proto" in
10921 ''|0) try='int asctime_r(const struct tm*, char*);'
10922 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10924 case "$asctime_r_proto" in
10925 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10926 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10928 case "$asctime_r_proto" in
10929 ''|0) d_asctime_r=undef
10931 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10932 * ) case "$asctime_r_proto" in
10933 REENTRANT_PROTO*) ;;
10934 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10936 echo "Prototype: $try" ;;
10939 *) case "$usethreads" in
10940 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10947 *) asctime_r_proto=0
10951 : see if asinh exists
10955 : see if atanh exists
10959 : see if atolf exists
10963 : see if atoll exists
10967 : Look for GCC-style attribute format
10968 case "$d_attribute_format" in
10971 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10972 $cat >attrib.c <<'EOCP'
10974 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10976 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10977 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10978 echo "Your C compiler doesn't support __attribute__((format))."
10981 echo "Your C compiler supports __attribute__((format))."
10985 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10989 *) val="$d_attribute_format" ;;
10991 set d_attribute_format
10995 : Look for GCC-style attribute format with null format allowed
10996 case "$d_printf_format_null" in
10997 '') case "$d_attribute_format" in
11000 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11001 $cat >attrib.c <<EOCP
11003 #$i_stdlib I_STDLIB
11005 #include <stdlib.h>
11007 #$i_inttypes I_INTTYPES
11009 #include <inttypes.h>
11012 #define intptr_t int
11014 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11015 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11016 int main () { exit(null_printf(NULL)); }
11018 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11019 : run the executable in case it produces a run-time warning
11020 if $run ./attrib >>attrib.out 2>&1; then
11021 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11022 echo "Your C compiler doesn't allow __printf__ format to be null."
11025 echo "Your C compiler allows __printf__ format to be null."
11029 echo "Your C compiler executable failed with __printf__ format null."
11033 echo "Your C compiler fails with __printf__ format null."
11040 *) val="$d_printf_format_null" ;;
11042 set d_printf_format_null
11046 : Look for GCC-style attribute malloc
11047 case "$d_attribute_malloc" in
11050 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11051 $cat >attrib.c <<'EOCP'
11053 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11055 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11056 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11057 echo "Your C compiler doesn't support __attribute__((malloc))."
11060 echo "Your C compiler supports __attribute__((malloc))."
11064 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11068 *) val="$d_attribute_malloc" ;;
11070 set d_attribute_malloc
11074 : Look for GCC-style attribute nonnull
11075 case "$d_attribute_nonnull" in
11078 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11079 $cat >attrib.c <<'EOCP'
11081 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11083 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11084 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11085 echo "Your C compiler doesn't support __attribute__((nonnull))."
11088 echo "Your C compiler supports __attribute__((nonnull))."
11092 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11096 *) val="$d_attribute_nonnull" ;;
11098 set d_attribute_nonnull
11102 : Look for GCC-style attribute noreturn
11103 case "$d_attribute_noreturn" in
11106 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11107 $cat >attrib.c <<'EOCP'
11109 void fall_over_dead( void ) __attribute__((noreturn));
11111 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11112 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11113 echo "Your C compiler doesn't support __attribute__((noreturn))."
11116 echo "Your C compiler supports __attribute__((noreturn))."
11120 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11124 *) val="$d_attribute_noreturn" ;;
11126 set d_attribute_noreturn
11130 : Look for GCC-style attribute pure
11131 case "$d_attribute_pure" in
11134 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11135 $cat >attrib.c <<'EOCP'
11137 int square( int n ) __attribute__((pure));
11139 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11140 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11141 echo "Your C compiler doesn't support __attribute__((pure))."
11144 echo "Your C compiler supports __attribute__((pure))."
11148 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11152 *) val="$d_attribute_pure" ;;
11154 set d_attribute_pure
11158 : Look for GCC-style attribute unused
11159 case "$d_attribute_unused" in
11162 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11163 $cat >attrib.c <<'EOCP'
11165 int do_something( int dummy __attribute__((unused)), int n );
11167 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11168 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11169 echo "Your C compiler doesn't support __attribute__((unused))."
11172 echo "Your C compiler supports __attribute__((unused))."
11176 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11180 *) val="$d_attribute_unused" ;;
11182 set d_attribute_unused
11186 : Look for GCC-style attribute deprecated
11187 case "$d_attribute_deprecated" in
11190 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11191 $cat >attrib.c <<'EOCP'
11193 int I_am_deprecated(void) __attribute__((deprecated));
11195 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11196 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11197 echo "Your C compiler doesn't support __attribute__((deprecated))."
11200 echo "Your C compiler supports __attribute__((deprecated))."
11204 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11208 *) val="$d_attribute_deprecated" ;;
11210 set d_attribute_deprecated
11214 : Look for GCC-style attribute warn_unused_result
11215 case "$d_attribute_warn_unused_result" in
11218 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11219 $cat >attrib.c <<'EOCP'
11221 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11223 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11224 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11225 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11228 echo "Your C compiler supports __attribute__((warn_unused_result))."
11232 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11236 *) val="$d_attribute_warn_unused_result" ;;
11238 set d_attribute_warn_unused_result
11242 : see if getpgrp exists
11243 set getpgrp d_getpgrp
11246 case "$d_getpgrp" in
11249 echo "Checking to see which flavor of getpgrp is in use..."
11251 #$i_unistd I_UNISTD
11252 #include <sys/types.h>
11254 # include <unistd.h>
11256 #$i_stdlib I_STDLIB
11258 #include <stdlib.h>
11262 if (getuid() == 0) {
11263 printf("(I see you are running Configure as super-user...)\n");
11266 #ifdef TRY_BSD_PGRP
11267 if (getpgrp(1) == 0)
11276 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11277 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11279 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11280 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11283 echo "I can't seem to compile and run the test program."
11285 xxx="a USG one, i.e. you use getpgrp()."
11287 # SVR4 systems can appear rather BSD-ish.
11288 case "$i_unistd" in
11290 xxx="a BSD one, i.e. you use getpgrp(pid)."
11294 xxx="probably a USG one, i.e. you use getpgrp()."
11299 echo "Assuming your getpgrp is $xxx" >&4
11308 : see if setpgrp exists
11309 set setpgrp d_setpgrp
11312 case "$d_setpgrp" in
11315 echo "Checking to see which flavor of setpgrp is in use..."
11317 #$i_unistd I_UNISTD
11318 #include <sys/types.h>
11320 # include <unistd.h>
11322 #$i_stdlib I_STDLIB
11324 #include <stdlib.h>
11328 if (getuid() == 0) {
11329 printf("(I see you are running Configure as super-user...)\n");
11332 #ifdef TRY_BSD_PGRP
11333 if (-1 == setpgrp(1, 1))
11336 if (setpgrp() != -1)
11342 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11343 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11345 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11346 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11349 echo "(I can't seem to compile and run the test program.)"
11351 xxx="a USG one, i.e. you use setpgrp()."
11353 # SVR4 systems can appear rather BSD-ish.
11354 case "$i_unistd" in
11356 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11360 xxx="probably a USG one, i.e. you use setpgrp()."
11365 echo "Assuming your setpgrp is $xxx" >&4
11374 : Look for GCC-style __builtin_add_overflow
11375 case "$d_builtin_add_overflow" in
11378 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11379 $cat >try.c <<'EOCP'
11381 const unsigned int uint_max = ~0u;
11382 int target_int = 0;
11383 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11386 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11389 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11396 if eval $compile && $run ./try; then
11397 echo "Your C compiler supports __builtin_add_overflow."
11400 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11404 *) val="$d_builtin_add_overflow" ;;
11407 set d_builtin_add_overflow
11411 : Look for GCC-style __builtin_sub_overflow
11412 case "$d_builtin_sub_overflow" in
11415 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11416 $cat >try.c <<'EOCP'
11418 const unsigned int uint_max = ~0u;
11419 int target_int = 0;
11420 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11423 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11426 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11433 if eval $compile && $run ./try; then
11434 echo "Your C compiler supports __builtin_sub_overflow."
11437 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11441 *) val="$d_builtin_sub_overflow" ;;
11444 set d_builtin_sub_overflow
11448 : Look for GCC-style __builtin_mul_overflow
11449 case "$d_builtin_mul_overflow" in
11452 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11453 $cat >try.c <<'EOCP'
11455 const unsigned int uint_max = ~0u;
11456 int target_int = 0;
11457 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11460 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11463 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11470 if eval $compile && $run ./try; then
11471 echo "Your C compiler supports __builtin_mul_overflow."
11474 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11478 *) val="$d_builtin_mul_overflow" ;;
11481 set d_builtin_mul_overflow
11485 : Look for GCC-style __builtin_choose_expr
11486 case "$d_builtin_choose_expr" in
11489 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11490 $cat >try.c <<'EOCP'
11491 #include <assert.h>
11492 #include <stdlib.h>
11495 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11498 assert( SYRINX(1) == 2112 );
11499 assert( SYRINX(1) != 5150 );
11500 assert( SYRINX(0) == 5150 );
11501 assert( SYRINX(0) != 2112 );
11502 puts( "All good!" );
11508 if eval $compile && $run ./try; then
11509 echo "Your C compiler supports __builtin_choose_expr."
11512 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11516 *) val="$d_builtin_choose_expr" ;;
11519 set d_builtin_choose_expr
11523 : Look for GCC-style __builtin_expect
11524 case "$d_builtin_expect" in
11527 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11528 $cat >try.c <<'EOCP'
11531 if ( __builtin_expect(n, 0) ) n = 1;
11532 /* Remember shell exit code truth is 0, C truth is non-zero */
11537 if eval $compile && $run ./try; then
11538 echo "Your C compiler supports __builtin_expect."
11541 echo "Your C compiler doesn't seem to understand __builtin_expect."
11545 *) val="$d_builtin_expect" ;;
11548 set d_builtin_expect
11552 : see if the Compiler supports C99 variadic macros
11553 echo "Checking for C99 variadic macros." >&4
11556 #include <stdarg.h>
11558 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11562 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11568 if eval $compile && $run ./try 2>&1 >/dev/null; then
11569 case "`$run ./try`" in
11571 echo "You have C99 variadic macros." >&4
11572 d_c99_variadic_macros="$define"
11575 echo "You don't have functional C99 variadic macros." >&4
11576 d_c99_variadic_macros="$undef"
11580 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11581 d_c99_variadic_macros="$undef"
11585 : see if signal is declared as pointer to function returning int or void
11587 xxx=`./findhdr signal.h`
11588 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11589 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11590 echo "You have int (*signal())() instead of void." >&4
11592 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11593 echo "You have void (*signal())()." >&4
11595 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11596 echo "You have int (*signal())() instead of void." >&4
11598 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11599 echo "You have void (*signal())()." >&4
11602 case "$d_voidsig" in
11604 echo "I can't determine whether signal handler returns void or int..." >&4
11606 rp="What type does your signal handler return?"
11609 v*) val="$define";;
11613 echo "As you already told me, signal handler returns void." >&4
11616 *) echo "As you already told me, signal handler returns int." >&4
11623 case "$d_voidsig" in
11624 "$define") signal_t="void";;
11625 *) signal_t="int";;
11629 : check for ability to cast large floats to 32-bit ints.
11631 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11632 if $test "$intsize" -ge 4; then
11639 #$i_stdlib I_STDLIB
11641 #include <stdlib.h>
11643 #include <sys/types.h>
11644 #include <signal.h>
11645 $signal_t blech(int s) { exit(3); }
11652 signal(SIGFPE, blech);
11654 /* Don't let compiler optimize the test away. Store the number
11655 in a writable string for gcc to pass to sscanf under HP-UX.
11657 sprintf(str, "2147483647");
11658 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11662 /* x86 processors will probably give 0x8000 0000, which is a
11663 sign change. We don't want that. We want to mimic SPARC
11664 behavior here, which is to preserve the sign and give
11667 if (i32 != ($xxx) f)
11673 if eval $compile_ok; then
11674 $run ./try 2>/dev/null
11677 echo "(I can't seem to compile the test program--assuming it can't)"
11682 echo "Yup, it can."
11685 echo "Nope, it can't."
11692 : check for ability to cast negative floats to unsigned
11694 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11697 #$i_stdlib I_STDLIB
11699 #include <stdlib.h>
11701 #include <sys/types.h>
11702 #include <signal.h>
11703 $signal_t blech(int s) { exit(7); }
11704 $signal_t blech_in_list(int s) { exit(4); }
11705 unsigned long dummy_long(unsigned long p) { return p; }
11706 unsigned int dummy_int(unsigned int p) { return p; }
11707 unsigned short dummy_short(unsigned short p) { return p; }
11711 unsigned long along;
11713 unsigned short ashort;
11717 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11718 a direct f = -123. assignment. gcc-2.8.0 reportedly
11719 optimized the whole file away
11721 /* Store the number in a writable string for gcc to pass to
11722 sscanf under HP-UX.
11724 sprintf(str, "-123");
11725 sscanf(str, "%lf", &f); /* f = -123.; */
11727 signal(SIGFPE, blech);
11728 along = (unsigned long)f;
11729 aint = (unsigned int)f;
11730 ashort = (unsigned short)f;
11731 if (along != (unsigned long)-123)
11733 if (aint != (unsigned int)-123)
11735 if (ashort != (unsigned short)-123)
11737 sprintf(str, "1073741824.");
11738 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11741 along = (unsigned long)f;
11742 if (along != 0x80000000)
11746 along = (unsigned long)f;
11747 if (along != 0x7fffffff)
11751 along = (unsigned long)f;
11752 if (along != 0x80000001)
11756 signal(SIGFPE, blech_in_list);
11757 sprintf(str, "123.");
11758 sscanf(str, "%lf", &f); /* f = 123.; */
11759 along = dummy_long((unsigned long)f);
11760 aint = dummy_int((unsigned int)f);
11761 ashort = dummy_short((unsigned short)f);
11762 if (along != (unsigned long)123)
11764 if (aint != (unsigned int)123)
11766 if (ashort != (unsigned short)123)
11773 if eval $compile_ok; then
11774 $run ./try 2>/dev/null
11777 echo "(I can't seem to compile the test program--assuming it can't)"
11780 case "$castflags" in
11782 echo "Yup, it can."
11785 echo "Nope, it can't."
11792 : see if cbrt exists
11796 : see if chown exists
11800 : see if chroot exists
11801 set chroot d_chroot
11804 : see if chsize exists
11805 set chsize d_chsize
11808 : see if class exists
11812 : see if clearenv exists
11813 set clearenv d_clearenv
11816 : Define hasstruct macro for Configure internal use
11817 hasstruct='varname=$1; struct=$2; shift; shift;
11818 while $test $# -ge 2; do
11820 $define) echo "#include <$2>";;
11824 echo "int main () { struct $struct foo; }" >> try.c;
11826 if eval $compile; then
11835 : see whether socket exists
11839 $echo $n "Hmm... $c" >&4
11840 if set socket val -f d_socket; eval $csym; $val; then
11841 echo "Looks like you have Berkeley networking support." >&4
11843 if set setsockopt val -f; eval $csym; $val; then
11846 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11847 d_oldsock="$define"
11850 if $contains socklib libc.list >/dev/null 2>&1; then
11851 echo "Looks like you have Berkeley networking support." >&4
11853 : we will have to assume that it supports the 4.2 BSD interface
11856 echo "You don't have Berkeley networking in libc$_a..." >&4
11857 if test "X$d_socket" = "X$define"; then
11858 echo "...but you seem to believe that you have sockets." >&4
11860 for net in net socket
11862 if test -f $sysroot/usr/lib/lib$net$_a; then
11863 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11864 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11865 if $contains socket libc.list >/dev/null 2>&1; then
11870 echo "...but the Wollongong group seems to have hacked it in." >&4
11871 sockethdr="-I$sysroot/usr/netinclude"
11874 echo "Found Berkeley sockets interface in lib$net." >&4
11875 if $contains setsockopt libc.list >/dev/null 2>&1; then
11878 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11879 d_oldsock="$define"
11885 if test "X$d_socket" != "X$define"; then
11886 echo "or anywhere else I see." >&4
11894 : see if socketpair exists
11895 set socketpair d_sockpair
11900 echo "Checking the availability sa_len in the sock struct ..." >&4
11902 #include <sys/types.h>
11903 #include <sys/socket.h>
11905 struct sockaddr sa;
11906 return (sa.sa_len);
11910 set try; if eval $compile; then
11913 set d_sockaddr_sa_len; eval $setvar
11917 echo "Checking the availability struct sockaddr_in6 ..." >&4
11919 #include <sys/types.h>
11920 #include <sys/socket.h>
11921 #include <netinet/in.h>
11923 struct sockaddr_in6 sin6;
11924 return (sin6.sin6_family);
11928 set try; if eval $compile; then
11931 set d_sockaddr_in6; eval $setvar
11935 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11937 #include <sys/types.h>
11938 #include <sys/socket.h>
11939 #include <netinet/in.h>
11941 struct sockaddr_in6 sin6;
11942 return (sin6.sin6_scope_id);
11946 set try; if eval $compile; then
11949 set d_sin6_scope_id; eval $setvar
11953 echo "Checking the availability struct ip_mreq ..." >&4
11955 #include <sys/types.h>
11956 #include <sys/socket.h>
11957 #include <netinet/in.h>
11959 struct ip_mreq mreq;
11960 return (mreq.imr_multiaddr.s_addr);
11964 set try; if eval $compile; then
11967 set d_ip_mreq; eval $setvar
11971 echo "Checking the availability struct ip_mreq_source ..." >&4
11973 #include <sys/types.h>
11974 #include <sys/socket.h>
11975 #include <netinet/in.h>
11977 struct ip_mreq_source mreq;
11978 return (mreq.imr_multiaddr.s_addr);
11982 set try; if eval $compile; then
11985 set d_ip_mreq_source; eval $setvar
11989 echo "Checking the availability struct ipv6_mreq ..." >&4
11991 #include <sys/types.h>
11992 #include <sys/socket.h>
11993 #include <netinet/in.h>
11995 struct ipv6_mreq mreq;
11996 return (mreq.ipv6mr_interface);
12000 set try; if eval $compile; then
12003 set d_ipv6_mreq; eval $setvar
12007 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12009 #include <sys/types.h>
12010 #include <sys/socket.h>
12011 #include <netinet/in.h>
12013 struct ipv6_mreq_source mreq;
12014 return (mreq.imr_multiaddr.s_addr);
12018 set try; if eval $compile; then
12021 set d_ipv6_mreq_source; eval $setvar
12025 echo "Checking the availability of certain socket constants..." >&4
12026 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12027 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12029 #include <sys/types.h>
12030 #include <sys/socket.h>
12036 set try; if eval $compile; then
12039 set d_${enum}; eval $setvar
12043 : see if this is a sys/uio.h system
12044 set sys/uio.h i_sysuio
12047 : Check for cmsghdr support
12049 echo "Checking to see if your system supports struct cmsghdr..." >&4
12050 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12052 case "$d_cmsghdr_s" in
12053 "$define") echo "Yes, it does." ;;
12054 *) echo "No, it doesn't." ;;
12057 : check for const keyword
12059 echo 'Checking to see if your C compiler knows about "const"...' >&4
12060 $cat >const.c <<'EOCP'
12061 typedef struct spug { int drokk; } spug;
12065 const spug y = { 0 };
12068 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12070 echo "Yup, it does."
12073 echo "Nope, it doesn't."
12078 : see if copysign exists
12079 set copysign d_copysign
12082 : see if copysignl exists
12083 set copysignl d_copysignl
12086 : see if crypt exists
12091 $define) cryptlib='' ;;
12092 *) if set crypt val -f d_crypt; eval $csym; $val; then
12093 echo 'crypt() found.' >&4
12097 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12098 if $test -z "$cryptlib"; then
12099 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12103 if $test -z "$cryptlib"; then
12104 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12108 if $test -z "$cryptlib"; then
12109 cryptlib=`./loc libcrypt$_a "" $libpth`
12113 if $test -z "$cryptlib"; then
12114 echo 'crypt() NOT found.' >&4
12125 : see if this is a crypt.h system
12126 set crypt.h i_crypt
12129 : see if crypt_r exists
12130 set crypt_r d_crypt_r
12132 case "$d_crypt_r" in
12134 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12135 case "$d_crypt_r_proto:$usethreads" in
12136 ":define") d_crypt_r_proto=define
12137 set d_crypt_r_proto crypt_r $hdrs
12141 case "$d_crypt_r_proto" in
12143 case "$crypt_r_proto" in
12144 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12145 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12147 case "$crypt_r_proto" in
12148 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12149 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12151 case "$crypt_r_proto" in
12152 ''|0) d_crypt_r=undef
12154 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12155 * ) case "$crypt_r_proto" in
12156 REENTRANT_PROTO*) ;;
12157 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12159 echo "Prototype: $try" ;;
12162 *) case "$usethreads" in
12163 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12174 : get csh whereabouts
12176 'csh') val="$undef" ;;
12177 *) val="$define" ;;
12181 : Respect a hint or command line value for full_csh.
12182 case "$full_csh" in
12183 '') full_csh=$csh ;;
12186 : see if ctermid exists
12187 set ctermid d_ctermid
12190 : see if ctermid_r exists
12191 set ctermid_r d_ctermid_r
12193 case "$d_ctermid_r" in
12195 hdrs="$i_systypes sys/types.h define stdio.h "
12196 case "$d_ctermid_r_proto:$usethreads" in
12197 ":define") d_ctermid_r_proto=define
12198 set d_ctermid_r_proto ctermid_r $hdrs
12202 case "$d_ctermid_r_proto" in
12204 case "$ctermid_r_proto" in
12205 ''|0) try='char* ctermid_r(char*);'
12206 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12208 case "$ctermid_r_proto" in
12209 ''|0) d_ctermid_r=undef
12211 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12212 * ) case "$ctermid_r_proto" in
12213 REENTRANT_PROTO*) ;;
12214 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12216 echo "Prototype: $try" ;;
12219 *) case "$usethreads" in
12220 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12227 *) ctermid_r_proto=0
12231 : see if ctime_r exists
12232 set ctime_r d_ctime_r
12234 case "$d_ctime_r" in
12236 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12237 case "$d_ctime_r_proto:$usethreads" in
12238 ":define") d_ctime_r_proto=define
12239 set d_ctime_r_proto ctime_r $hdrs
12243 case "$d_ctime_r_proto" in
12245 case "$ctime_r_proto" in
12246 ''|0) try='char* ctime_r(const time_t*, char*);'
12247 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12249 case "$ctime_r_proto" in
12250 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12251 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12253 case "$ctime_r_proto" in
12254 ''|0) try='int ctime_r(const time_t*, char*);'
12255 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12257 case "$ctime_r_proto" in
12258 ''|0) try='int ctime_r(const time_t*, char*, int);'
12259 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12261 case "$ctime_r_proto" in
12262 ''|0) d_ctime_r=undef
12264 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12265 * ) case "$ctime_r_proto" in
12266 REENTRANT_PROTO*) ;;
12267 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12269 echo "Prototype: $try" ;;
12272 *) case "$usethreads" in
12273 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12284 : see if cuserid exists
12285 set cuserid d_cuserid
12288 : see if dbm.h is available
12289 : see if dbmclose exists
12290 set dbmclose d_dbmclose
12293 case "$d_dbmclose" in
12303 *) set rpcsvc/dbm.h i_rpcsvcdbm
12308 *) echo "We won't be including <dbm.h>"
12318 : see if prototype for dbminit is available
12320 set d_dbminitproto dbminit $i_dbm dbm.h
12323 : see if difftime exists
12324 set difftime d_difftime
12327 : see if this is a dirent system
12329 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12331 echo "<dirent.h> found." >&4
12334 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12335 echo "<sys/dir.h> found." >&4
12338 xinc=`./findhdr sys/ndir.h`
12340 echo "<dirent.h> NOT found." >&4
12345 : Look for type of directory structure.
12347 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12349 case "$direntrytype" in
12351 case "$i_dirent" in
12352 $define) guess1='struct dirent' ;;
12353 *) guess1='struct direct' ;;
12356 *) guess1="$direntrytype"
12361 'struct dirent') guess2='struct direct' ;;
12362 *) guess2='struct dirent' ;;
12365 if $contains "$guess1" try.c >/dev/null 2>&1; then
12366 direntrytype="$guess1"
12367 echo "Your directory entries are $direntrytype." >&4
12368 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12369 direntrytype="$guess2"
12370 echo "Your directory entries seem to be $direntrytype." >&4
12372 echo "I don't recognize your system's directory entries." >&4
12373 rp="What type is used for directory entries on this system?"
12376 direntrytype="$ans"
12380 : see if the directory entry stores field length
12382 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12383 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12384 echo "Good, your directory entry keeps length information in d_namlen." >&4
12387 echo "Your directory entry does not know about the d_namlen field." >&4
12394 : Look for DIR.dd_fd
12395 case "$i_dirent" in
12397 echo "Checking to see if DIR has a dd_fd member variable" >&4
12399 #$i_stdlib I_STDLIB
12401 #include <stdlib.h>
12403 #include <dirent.h>
12413 if eval $compile; then
12414 echo "Yes, it does."
12417 echo "No, it does not."
12422 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12430 : see if this is an sysdir system
12431 set sys/dir.h i_sysdir
12434 : see if this is an sysndir system
12435 set sys/ndir.h i_sysndir
12440 $cat >dirfd.c <<EOM
12442 #$i_stdlib I_STDLIB
12444 #include <stdlib.h>
12446 #$i_dirent I_DIRENT /**/
12447 #$i_sysdir I_SYS_DIR /**/
12448 #$i_sysndir I_SYS_NDIR /**/
12449 #$i_systypes I_SYS_TYPES /**/
12450 #if defined(I_SYS_TYPES)
12451 #include <sys/types.h>
12453 #if defined(I_DIRENT)
12454 #include <dirent.h>
12457 #include <sys/ndir.h>
12460 #include <sys/dir.h>
12465 DIR *dirp = opendir(".");
12466 if (dirfd(dirp) >= 0)
12474 if eval $compile; then
12478 $define) echo "dirfd() found." >&4 ;;
12479 *) echo "dirfd() NOT found." >&4 ;;
12485 : see if dladdr exists
12486 set dladdr d_dladdr
12489 : see if dlerror exists
12492 set dlerror d_dlerror
12496 : see if dlfcn is available
12497 set dlfcn.h i_dlfcn
12500 : Check what extension to use for shared libs
12505 On a few systems, the dynamically loaded modules that perl generates and uses
12506 will need a different extension than shared libs. The default will probably
12512 *) dflt="$dlext" ;;
12514 rp='What is the extension of dynamically loaded modules'
12523 : Check if dlsym need a leading underscore
12529 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12530 $cat >dyna.c <<'EOM'
12537 #$i_stdlib I_STDLIB
12539 #include <stdlib.h>
12543 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12545 #include <sys/types.h>
12550 extern int fred() ;
12559 int mode = RTLD_LAZY ;
12561 handle = dlopen("./dyna.$dlext", mode) ;
12562 if (handle == NULL) {
12567 symbol = dlsym(handle, "fred") ;
12568 if (symbol == NULL) {
12569 /* try putting a leading underscore */
12570 symbol = dlsym(handle, "_fred") ;
12571 if (symbol == NULL) {
12584 : Call the object file tmp-dyna.o in case dlext=o.
12585 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12586 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12587 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12588 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12591 1) echo "Test program failed using dlopen." >&4
12592 echo "Perhaps you should not use dynamic loading." >&4;;
12593 2) echo "Test program failed using dlsym." >&4
12594 echo "Perhaps you should not use dynamic loading." >&4;;
12595 3) echo "dlsym needs a leading underscore" >&4
12597 4) echo "dlsym doesn't need a leading underscore." >&4;;
12600 echo "I can't compile and run the test program." >&4
12601 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12606 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12611 : see if drand48_r exists
12612 set drand48_r d_drand48_r
12614 case "$d_drand48_r" in
12616 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12617 case "$d_drand48_r_proto:$usethreads" in
12618 ":define") d_drand48_r_proto=define
12619 set d_drand48_r_proto drand48_r $hdrs
12623 case "$d_drand48_r_proto" in
12625 case "$drand48_r_proto" in
12626 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12627 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12629 case "$drand48_r_proto" in
12630 ''|0) d_drand48_r=undef
12632 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12633 * ) case "$drand48_r_proto" in
12634 REENTRANT_PROTO*) ;;
12635 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12637 echo "Prototype: $try" ;;
12640 *) case "$usethreads" in
12641 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12648 *) drand48_r_proto=0
12652 : see if prototype for drand48 is available
12654 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12657 : see if dup2 exists
12661 : see if dup3 exists
12665 : see if this is an xlocale.h system
12666 set xlocale.h i_xlocale
12669 : see if newlocale exists
12670 set newlocale d_newlocale
12673 : see if freelocale exists
12674 set freelocale d_freelocale
12677 : see if uselocale exists
12678 set uselocale d_uselocale
12681 : see if duplocale exists
12682 set duplocale d_duplocale
12685 : see if querylocale exists
12686 set querylocale d_querylocale
12689 : see if eaccess exists
12690 set eaccess d_eaccess
12693 : see if endgrent exists
12694 set endgrent d_endgrent
12697 : see if this is an grp system
12703 xxx=`./findhdr grp.h`
12704 $cppstdin $cppflags $cppminus < $xxx >$$.h
12706 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12718 set d_grpasswd; eval $setvar
12722 : see if endgrent_r exists
12723 set endgrent_r d_endgrent_r
12725 case "$d_endgrent_r" in
12727 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12728 case "$d_endgrent_r_proto:$usethreads" in
12729 ":define") d_endgrent_r_proto=define
12730 set d_endgrent_r_proto endgrent_r $hdrs
12734 case "$d_endgrent_r_proto" in
12736 case "$endgrent_r_proto" in
12737 ''|0) try='int endgrent_r(FILE**);'
12738 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12740 case "$endgrent_r_proto" in
12741 ''|0) try='void endgrent_r(FILE**);'
12742 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12744 case "$endgrent_r_proto" in
12745 ''|0) d_endgrent_r=undef
12747 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12748 * ) case "$endgrent_r_proto" in
12749 REENTRANT_PROTO*) ;;
12750 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12752 echo "Prototype: $try" ;;
12755 *) case "$usethreads" in
12756 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12763 *) endgrent_r_proto=0
12767 : see if endhostent exists
12768 set endhostent d_endhent
12771 : see if this is a netdb.h system
12772 set netdb.h i_netdb
12775 : see if endhostent_r exists
12776 set endhostent_r d_endhostent_r
12778 case "$d_endhostent_r" in
12780 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12781 case "$d_endhostent_r_proto:$usethreads" in
12782 ":define") d_endhostent_r_proto=define
12783 set d_endhostent_r_proto endhostent_r $hdrs
12787 case "$d_endhostent_r_proto" in
12789 case "$endhostent_r_proto" in
12790 ''|0) try='int endhostent_r(struct hostent_data*);'
12791 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12793 case "$endhostent_r_proto" in
12794 ''|0) try='void endhostent_r(struct hostent_data*);'
12795 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12797 case "$endhostent_r_proto" in
12798 ''|0) d_endhostent_r=undef
12799 endhostent_r_proto=0
12800 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12801 * ) case "$endhostent_r_proto" in
12802 REENTRANT_PROTO*) ;;
12803 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12805 echo "Prototype: $try" ;;
12808 *) case "$usethreads" in
12809 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12811 d_endhostent_r=undef
12812 endhostent_r_proto=0
12816 *) endhostent_r_proto=0
12820 : see if endnetent exists
12821 set endnetent d_endnent
12824 : see if endnetent_r exists
12825 set endnetent_r d_endnetent_r
12827 case "$d_endnetent_r" in
12829 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12830 case "$d_endnetent_r_proto:$usethreads" in
12831 ":define") d_endnetent_r_proto=define
12832 set d_endnetent_r_proto endnetent_r $hdrs
12836 case "$d_endnetent_r_proto" in
12838 case "$endnetent_r_proto" in
12839 ''|0) try='int endnetent_r(struct netent_data*);'
12840 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12842 case "$endnetent_r_proto" in
12843 ''|0) try='void endnetent_r(struct netent_data*);'
12844 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12846 case "$endnetent_r_proto" in
12847 ''|0) d_endnetent_r=undef
12848 endnetent_r_proto=0
12849 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12850 * ) case "$endnetent_r_proto" in
12851 REENTRANT_PROTO*) ;;
12852 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12854 echo "Prototype: $try" ;;
12857 *) case "$usethreads" in
12858 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12860 d_endnetent_r=undef
12861 endnetent_r_proto=0
12865 *) endnetent_r_proto=0
12869 : see if endprotoent exists
12870 set endprotoent d_endpent
12873 : see if endprotoent_r exists
12874 set endprotoent_r d_endprotoent_r
12876 case "$d_endprotoent_r" in
12878 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12879 case "$d_endprotoent_r_proto:$usethreads" in
12880 ":define") d_endprotoent_r_proto=define
12881 set d_endprotoent_r_proto endprotoent_r $hdrs
12885 case "$d_endprotoent_r_proto" in
12887 case "$endprotoent_r_proto" in
12888 ''|0) try='int endprotoent_r(struct protoent_data*);'
12889 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12891 case "$endprotoent_r_proto" in
12892 ''|0) try='void endprotoent_r(struct protoent_data*);'
12893 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12895 case "$endprotoent_r_proto" in
12896 ''|0) d_endprotoent_r=undef
12897 endprotoent_r_proto=0
12898 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12899 * ) case "$endprotoent_r_proto" in
12900 REENTRANT_PROTO*) ;;
12901 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12903 echo "Prototype: $try" ;;
12906 *) case "$usethreads" in
12907 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12909 d_endprotoent_r=undef
12910 endprotoent_r_proto=0
12914 *) endprotoent_r_proto=0
12918 : see if endpwent exists
12919 set endpwent d_endpwent
12922 : see if this is a pwd.h system
12928 xxx=`./findhdr pwd.h`
12929 $cppstdin $cppflags $cppminus < $xxx >$$.h
12931 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12939 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12947 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12955 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12963 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12971 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12979 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12987 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12999 set d_pwquota; eval $setvar
13000 set d_pwage; eval $setvar
13001 set d_pwchange; eval $setvar
13002 set d_pwclass; eval $setvar
13003 set d_pwexpire; eval $setvar
13004 set d_pwcomment; eval $setvar
13005 set d_pwgecos; eval $setvar
13006 set d_pwpasswd; eval $setvar
13010 : see if endpwent_r exists
13011 set endpwent_r d_endpwent_r
13013 case "$d_endpwent_r" in
13015 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13016 case "$d_endpwent_r_proto:$usethreads" in
13017 ":define") d_endpwent_r_proto=define
13018 set d_endpwent_r_proto endpwent_r $hdrs
13022 case "$d_endpwent_r_proto" in
13024 case "$endpwent_r_proto" in
13025 ''|0) try='int endpwent_r(FILE**);'
13026 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13028 case "$endpwent_r_proto" in
13029 ''|0) try='void endpwent_r(FILE**);'
13030 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13032 case "$endpwent_r_proto" in
13033 ''|0) d_endpwent_r=undef
13035 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13036 * ) case "$endpwent_r_proto" in
13037 REENTRANT_PROTO*) ;;
13038 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13040 echo "Prototype: $try" ;;
13043 *) case "$usethreads" in
13044 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13051 *) endpwent_r_proto=0
13055 : see if endservent exists
13056 set endservent d_endsent
13059 : see if endservent_r exists
13060 set endservent_r d_endservent_r
13062 case "$d_endservent_r" in
13064 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13065 case "$d_endservent_r_proto:$usethreads" in
13066 ":define") d_endservent_r_proto=define
13067 set d_endservent_r_proto endservent_r $hdrs
13071 case "$d_endservent_r_proto" in
13073 case "$endservent_r_proto" in
13074 ''|0) try='int endservent_r(struct servent_data*);'
13075 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13077 case "$endservent_r_proto" in
13078 ''|0) try='void endservent_r(struct servent_data*);'
13079 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13081 case "$endservent_r_proto" in
13082 ''|0) d_endservent_r=undef
13083 endservent_r_proto=0
13084 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13085 * ) case "$endservent_r_proto" in
13086 REENTRANT_PROTO*) ;;
13087 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13089 echo "Prototype: $try" ;;
13092 *) case "$usethreads" in
13093 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13095 d_endservent_r=undef
13096 endservent_r_proto=0
13100 *) endservent_r_proto=0
13104 : Locate the flags for 'open()'
13107 #include <sys/types.h>
13112 #include <sys/file.h>
13114 #$i_stdlib I_STDLIB
13116 #include <stdlib.h>
13127 : check sys/file.h first to get FREAD on Sun
13128 if $test `./findhdr sys/file.h` && \
13129 set try -DI_SYS_FILE && eval $compile; then
13131 echo "<sys/file.h> defines the O_* constants..." >&4
13132 if $run ./try; then
13133 echo "and you have the 3 argument form of open()." >&4
13136 echo "but not the 3 argument form of open(). Oh, well." >&4
13139 elif $test `./findhdr fcntl.h` && \
13140 set try -DI_FCNTL && eval $compile; then
13142 echo "<fcntl.h> defines the O_* constants..." >&4
13143 if $run ./try; then
13144 echo "and you have the 3 argument form of open()." >&4
13147 echo "but not the 3 argument form of open(). Oh, well." >&4
13152 echo "I can't find the O_* constant definitions! You got problems." >&4
13158 : see if this is a sys/file.h system
13163 : do we need to include sys/file.h ?
13167 if $h_sysfile; then
13169 echo "We'll be including <sys/file.h>." >&4
13172 echo "We won't be including <sys/file.h>." >&4
13182 : see if fcntl.h is there
13187 : see if we can include fcntl.h
13193 echo "We'll be including <fcntl.h>." >&4
13196 if $h_sysfile; then
13197 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13199 echo "We won't be including <fcntl.h>." >&4
13211 : see if fork exists
13215 : see if pipe exists
13219 : check for non-blocking I/O stuff
13220 case "$h_sysfile" in
13221 true) echo "#include <sys/file.h>" > head.c;;
13224 true) echo "#include <fcntl.h>" > head.c;;
13225 *) echo "#include <sys/fcntl.h>" > head.c;;
13230 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13231 case "$o_nonblock" in
13233 $cat head.c > try.c
13234 $cat >>try.c <<EOCP
13236 #$i_stdlib I_STDLIB
13238 #include <stdlib.h>
13246 printf("O_NONBLOCK\n");
13250 printf("O_NDELAY\n");
13254 printf("FNDELAY\n");
13261 if eval $compile_ok; then
13262 o_nonblock=`$run ./try`
13263 case "$o_nonblock" in
13264 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13265 *) echo "Seems like we can use $o_nonblock.";;
13268 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13271 *) echo "Using $hint value $o_nonblock.";;
13276 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13279 case "$d_fork:$d_pipe:$d_alarm" in
13280 define:define:define)
13281 $cat head.c > try.c
13282 $cat >>try.c <<EOCP
13284 #include <sys/types.h>
13285 #include <signal.h>
13287 #$i_stdlib I_STDLIB
13289 #include <stdlib.h>
13295 #define MY_O_NONBLOCK $o_nonblock
13296 #ifndef errno /* XXX need better Configure test */
13299 #$i_unistd I_UNISTD
13301 #include <unistd.h>
13303 #include <string.h>
13304 $signal_t blech(int x) { exit(3); }
13306 $cat >> try.c <<'EOCP'
13315 ret = pipe(pd); /* Down: child -> parent */
13318 ret = pipe(pu); /* Up: parent -> child */
13322 close(pd[1]); /* Parent reads from pd[0] */
13323 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13325 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13330 signal(SIGALRM, blech);
13332 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13334 sprintf(string, "%d\n", ret);
13335 ret = write(2, string, strlen(string));
13336 if (ret != strlen(string))
13340 if (errno == EAGAIN) {
13341 printf("EAGAIN\n");
13346 if (errno == EWOULDBLOCK)
13347 printf("EWOULDBLOCK\n");
13350 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13353 sleep(2); /* Give it time to close our pipe */
13355 ret = read(pd[0], buf, 1); /* Should read EOF */
13357 sprintf(string, "%d\n", ret);
13358 ret = write(4, string, strlen(string));
13359 if (ret != strlen(string))
13364 close(pd[0]); /* We write to pd[1] */
13365 close(pu[1]); /* We read from pu[0] */
13366 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13369 close(pd[1]); /* Pipe pd is now fully closed! */
13370 exit(0); /* Bye bye, thank you for playing! */
13374 if eval $compile_ok; then
13375 echo "$startsh" >mtry
13376 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13378 $run ./mtry >/dev/null 2>&1
13380 0) eagain=`$cat try.out`;;
13381 1) echo "Could not perform non-blocking setting!";;
13382 2) echo "I did a successful read() for something that was not there!";;
13383 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13384 4) echo "Could not find F_SETFL!";;
13385 *) echo "Something terribly wrong happened during testing.";;
13387 rd_nodata=`$cat try.ret`
13388 echo "A read() system call with no data present returns $rd_nodata."
13389 case "$rd_nodata" in
13392 echo "(That's peculiar, fixing that to be -1.)"
13398 echo "Forcing errno EAGAIN on read() with no data available."
13402 echo "Your read() sets errno to $eagain when no data is available."
13405 status=`$cat try.err`
13407 0) echo "And it correctly returns 0 to signal EOF.";;
13408 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13409 *) echo "However, your read() returns '$status' on EOF??";;
13412 if test "$status" = "$rd_nodata"; then
13413 echo "WARNING: you can't distinguish between EOF and no data!"
13417 echo "I can't compile the test program--assuming errno EAGAIN will do."
13421 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13430 echo "Using $hint value $eagain."
13431 echo "Your read() returns $rd_nodata when no data is present."
13432 case "$d_eofnblk" in
13433 "$define") echo "And you can see EOF because read() returns 0.";;
13434 "$undef") echo "But you can't see EOF status from read() returned value.";;
13436 echo "(Assuming you can't see EOF status from read anyway.)"
13442 $rm_try head.c mtry
13444 : see if erf exists
13448 : see if erfc exists
13452 : see if exp2 exists
13456 : see if expm1 exists
13460 : see if _ptr and _cnt from stdio act std
13463 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13464 echo "(Looks like you have stdio.h from BSD.)"
13465 case "$stdio_ptr" in
13466 '') stdio_ptr='((fp)->_p)'
13469 *) ptr_lval=$d_stdio_ptr_lval;;
13471 case "$stdio_cnt" in
13472 '') stdio_cnt='((fp)->_r)'
13475 *) cnt_lval=$d_stdio_cnt_lval;;
13477 case "$stdio_base" in
13478 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13480 case "$stdio_bufsiz" in
13481 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13483 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13484 echo "(Looks like you have stdio.h from Linux.)"
13485 case "$stdio_ptr" in
13486 '') stdio_ptr='((fp)->_IO_read_ptr)'
13489 *) ptr_lval=$d_stdio_ptr_lval;;
13491 case "$stdio_cnt" in
13492 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13495 *) cnt_lval=$d_stdio_cnt_lval;;
13497 case "$stdio_base" in
13498 '') stdio_base='((fp)->_IO_read_base)';;
13500 case "$stdio_bufsiz" in
13501 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13504 case "$stdio_ptr" in
13505 '') stdio_ptr='((fp)->_ptr)'
13508 *) ptr_lval=$d_stdio_ptr_lval;;
13510 case "$stdio_cnt" in
13511 '') stdio_cnt='((fp)->_cnt)'
13514 *) cnt_lval=$d_stdio_cnt_lval;;
13516 case "$stdio_base" in
13517 '') stdio_base='((fp)->_base)';;
13519 case "$stdio_bufsiz" in
13520 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13524 : test whether _ptr and _cnt really work
13525 echo "Checking how std your stdio is..." >&4
13528 #$i_stdlib I_STDLIB
13530 #include <stdlib.h>
13532 #define FILE_ptr(fp) $stdio_ptr
13533 #define FILE_cnt(fp) $stdio_cnt
13535 FILE *fp = fopen("try.c", "r");
13538 18 <= FILE_cnt(fp) &&
13539 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13547 if eval $compile && $to try.c; then
13548 if $run ./try; then
13549 echo "Your stdio acts pretty std."
13552 echo "Your stdio isn't very std."
13555 echo "Your stdio doesn't appear very std."
13559 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13560 # direct buffer manipulation no longer works. The Configure tests
13561 # should be changed to correctly detect this, but until then,
13562 # the following check should at least let perl compile and run.
13563 # (This quick fix should be updated before 5.8.1.)
13564 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13565 # A. Dougherty, June 3, 2002.
13566 case "$d_gnulibc" in
13568 case "$gnulibc_version" in
13572 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13581 : Can _ptr be used as an lvalue?
13582 case "$d_stdstdio$ptr_lval" in
13583 $define$define) val=$define ;;
13586 set d_stdio_ptr_lval
13589 : Can _cnt be used as an lvalue?
13590 case "$d_stdstdio$cnt_lval" in
13591 $define$define) val=$define ;;
13594 set d_stdio_cnt_lval
13598 : test whether setting _ptr sets _cnt as a side effect
13599 d_stdio_ptr_lval_sets_cnt="$undef"
13600 d_stdio_ptr_lval_nochange_cnt="$undef"
13601 case "$d_stdio_ptr_lval$d_stdstdio" in
13603 echo "Checking to see what happens if we set the stdio ptr..." >&4
13606 /* Can we scream? */
13607 /* Eat dust sed :-) */
13608 /* In the buffer space, no one can hear you scream. */
13609 #$i_stdlib I_STDLIB
13611 #include <stdlib.h>
13613 #define FILE_ptr(fp) $stdio_ptr
13614 #define FILE_cnt(fp) $stdio_cnt
13615 #include <sys/types.h>
13617 FILE *fp = fopen("try.c", "r");
13622 puts("Fail even to read");
13625 c = getc(fp); /* Read away the first # */
13627 puts("Fail even to read");
13631 18 <= FILE_cnt(fp) &&
13632 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13634 puts("Fail even to read");
13637 ptr = (char*) FILE_ptr(fp);
13638 cnt = (size_t)FILE_cnt(fp);
13640 FILE_ptr(fp) += 42;
13642 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13643 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13646 if (FILE_cnt(fp) <= 20) {
13647 printf ("Fail (<20 chars to test)");
13650 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13651 puts("Fail compare");
13654 if (cnt == FILE_cnt(fp)) {
13655 puts("Pass_unchanged");
13658 if (FILE_cnt(fp) == (cnt - 42)) {
13659 puts("Pass_changed");
13662 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13668 if eval $compile && $to try.c; then
13669 case `$run ./try` in
13671 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13672 d_stdio_ptr_lval_sets_cnt="$define" ;;
13674 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13675 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13677 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13679 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13682 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13688 : see if _base is also standard
13690 case "$d_stdstdio" in
13694 #$i_stdlib I_STDLIB
13696 #include <stdlib.h>
13698 #define FILE_base(fp) $stdio_base
13699 #define FILE_bufsiz(fp) $stdio_bufsiz
13701 FILE *fp = fopen("try.c", "r");
13704 19 <= FILE_bufsiz(fp) &&
13705 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13712 if eval $compile && $to try.c; then
13713 if $run ./try; then
13714 echo "And its _base field acts std."
13717 echo "But its _base field isn't std."
13720 echo "However, it seems to be lacking the _base field."
13728 : see if fast_stdio exists
13730 case "$d_stdstdio:$d_stdio_ptr_lval" in
13732 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13734 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13743 : see if fchdir exists
13744 set fchdir d_fchdir
13747 : see if fchmod exists
13748 set fchmod d_fchmod
13751 : check for openat, unlinkat, renameat, linkat, fchmodat
13752 set openat d_openat
13755 set unlinkat d_unlinkat
13758 set renameat d_renameat
13761 set linkat d_linkat
13764 set fchmodat d_fchmodat
13767 : see if fchown exists
13768 set fchown d_fchown
13771 : see if this is an fcntl system
13775 : See if fcntl-based locking works.
13778 #$i_stdlib I_STDLIB
13780 #include <stdlib.h>
13782 #include <unistd.h>
13784 #include <signal.h>
13785 $signal_t blech(int x) { exit(3); }
13787 #if defined(F_SETLK) && defined(F_SETLKW)
13788 struct flock flock;
13790 fd = open("try.c", O_RDONLY);
13791 flock.l_type = F_RDLCK;
13792 flock.l_whence = SEEK_SET;
13793 flock.l_start = flock.l_len = 0;
13794 signal(SIGALRM, blech);
13796 retval = fcntl(fd, F_SETLK, &flock);
13798 (retval < 0 ? exit(2) : exit(0));
13804 echo "Checking if fcntl-based file locking works... "
13808 if eval $compile_ok; then
13809 if $run ./try; then
13810 echo "Yes, it seems to work."
13813 echo "Nope, it didn't work."
13818 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13819 *** This is (almost) impossible.
13820 *** If your NFS lock daemons are not feeling well, something like
13821 *** this may happen, please investigate. Cannot continue, aborting.
13829 echo "I'm unable to compile the test program, so I'll assume not."
13834 echo "Nope, since you don't even have fcntl()."
13837 set d_fcntl_can_lock
13841 : check for fd_set items
13844 Checking to see how well your C compiler handles fd_set and friends ...
13847 #$i_stdlib I_STDLIB
13849 #include <stdlib.h>
13851 #$i_systime I_SYS_TIME
13852 #$i_sysselct I_SYS_SELECT
13853 #$d_socket HAS_SOCKET
13854 #include <sys/types.h>
13856 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13859 #include <sys/time.h>
13861 #ifdef I_SYS_SELECT
13862 #include <sys/select.h>
13871 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13879 if eval $compile; then
13880 d_fds_bits="$define"
13882 echo "Well, your system knows about the normal fd_set typedef..." >&4
13883 if $run ./try; then
13884 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13885 d_fd_macros="$define"
13888 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13890 d_fd_macros="$undef"
13894 Hmm, your compiler has some difficulty with fd_set. Checking further...
13897 if eval $compile; then
13898 d_fds_bits="$undef"
13900 echo "Well, your system has some sort of fd_set available..." >&4
13901 if $run ./try; then
13902 echo "and you have the normal fd_set macros." >&4
13903 d_fd_macros="$define"
13906 but not the normal fd_set macros! Gross! More work for me...
13908 d_fd_macros="$undef"
13911 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13913 d_fds_bits="$undef"
13914 d_fd_macros="$undef"
13919 : see if fdclose exists
13920 set fdclose d_fdclose
13923 : see if fdim exists
13927 : see if fegetround exists
13928 set fegetround d_fegetround
13931 : see if fgetpos exists
13932 set fgetpos d_fgetpos
13935 : see if finite exists
13936 set finite d_finite
13939 : see if finitel exists
13940 set finitel d_finitel
13943 : see if flock exists
13947 : see if prototype for flock is available
13949 set d_flockproto flock $i_sysfile sys/file.h
13952 : see if fma exists
13956 : see if fmax exists
13960 : see if fmin exists
13964 : see if fp_class exists
13965 set fp_class d_fp_class
13968 : check for fpclassify
13969 echo "Checking to see if you have fpclassify..." >&4
13972 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13975 if eval $compile; then
13977 echo "You have fpclassify."
13980 echo "You do not have fpclassify."
13986 : see if fp_classify exists
13987 set fp_classify d_fp_classify
13990 : see if fp_classl exists
13991 set fp_classl d_fp_classl
13994 : see if pathconf exists
13995 set pathconf d_pathconf
13998 : see if fpathconf exists
13999 set fpathconf d_fpathconf
14002 : see if fpclass exists
14003 set fpclass d_fpclass
14006 : see if fpclassl exists
14007 set fpclassl d_fpclassl
14010 : see if fpgetround exists
14011 set fpgetround d_fpgetround
14014 : check for fpos64_t
14016 echo "Checking to see if you have fpos64_t..." >&4
14019 int main() { fpos64_t x = 7; }
14022 if eval $compile; then
14024 echo "You have fpos64_t."
14027 echo "You do not have fpos64_t."
14028 case "$fpossize" in
14029 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14036 : see if frexpl exists
14037 set frexpl d_frexpl
14040 : see if this is a sys/param system
14041 set sys/param.h i_sysparam
14044 : see if this is a sys/mount.h system
14045 set sys/mount.h i_sysmount
14048 : Check for fs_data_s
14050 echo "Checking to see if your system supports struct fs_data..." >&4
14051 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14053 case "$d_fs_data_s" in
14054 "$define") echo "Yes, it does." ;;
14055 *) echo "No, it doesn't." ;;
14058 : see if fseeko exists
14059 set fseeko d_fseeko
14061 case "$longsize" in
14062 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14065 : see if fsetpos exists
14066 set fsetpos d_fsetpos
14069 : see if fstatfs exists
14070 set fstatfs d_fstatfs
14073 : see if statvfs exists
14074 set statvfs d_statvfs
14077 : see if fstatvfs exists
14078 set fstatvfs d_fstatvfs
14081 : see if fsync exists
14085 : see if ftello exists
14086 set ftello d_ftello
14088 case "$longsize" in
14089 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14092 : check for a working futimes
14095 echo "Checking if you have a working futimes()" >&4
14098 #include <sys/time.h>
14105 fd = open ("try.c", O_RDWR);
14106 if (-1 == fd) exit (1);
14107 rv = futimes (fd, NULL);
14108 exit (rv == -1 ? errno : 0);
14112 if eval $compile; then
14116 0) echo "Yes, you have" >&4
14117 d_futimes="$define"
14119 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14123 echo "No, it does not (probably harmless)" >&4
14127 : look for gai_strerror
14129 $cat >try.c <<'EOCP'
14130 #include <sys/types.h>
14131 #include <sys/socket.h>
14135 return (gai_strerror (0) ? 0 : 1);
14140 if eval $compile; then
14143 0) echo "A working gai_strerror() found." >&4
14145 *) echo "gai_strerror() found, but it doesn't work" >&4
14149 echo "gai_strerror() NOT found." >&4
14155 : see if ndbm.h is available
14158 : Compatibility location for RedHat 7.1
14159 set gdbm/ndbm.h i_gdbmndbm
14161 : Compatibility location for Debian 4.0
14162 set gdbm-ndbm.h i_gdbm_ndbm
14166 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14167 : see if dbm_open exists
14168 set dbm_open d_dbm_open
14170 case "$d_dbm_open" in
14173 i_gdbmndbm="$undef"
14174 i_gdbm_ndbm="$undef"
14175 echo "We won't be including <ndbm.h>"
14185 ndbm_hdr_protochk='name=$1; hdr=$2;
14186 eval "ihdr=\$""i_$name";
14188 if $test "$ihdr" = "$define"; then
14189 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14190 case "$d_cplusplus" in
14191 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14192 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14195 $define) $echo "Your <$hdr> seems to have prototypes";;
14196 *) $echo "Your <$hdr> does not seem to have prototypes";;
14199 set "d_${name}_h_uses_prototypes";
14203 eval $ndbm_hdr_protochk
14204 set gdbmndbm gdbm/ndbm.h
14205 eval $ndbm_hdr_protochk
14206 set gdbm_ndbm gdbm-ndbm.h
14207 eval $ndbm_hdr_protochk
14209 : see if getaddrinfo exists
14210 set getaddrinfo d_getaddrinfo
14213 : see if getcwd exists
14214 set getcwd d_getcwd
14217 : see if getespwnam exists
14218 set getespwnam d_getespwnam
14221 : see if getfsstat exists
14222 set getfsstat d_getfsstat
14225 : see if getgrent exists
14226 set getgrent d_getgrent
14229 : see if getgrent_r exists
14230 set getgrent_r d_getgrent_r
14232 case "$d_getgrent_r" in
14234 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14235 case "$d_getgrent_r_proto:$usethreads" in
14236 ":define") d_getgrent_r_proto=define
14237 set d_getgrent_r_proto getgrent_r $hdrs
14241 case "$d_getgrent_r_proto" in
14243 case "$getgrent_r_proto" in
14244 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14245 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14247 case "$getgrent_r_proto" in
14248 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14249 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14251 case "$getgrent_r_proto" in
14252 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14253 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14255 case "$getgrent_r_proto" in
14256 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14257 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14259 case "$getgrent_r_proto" in
14260 ''|0) try='int getgrent_r(struct group*, char*, int);'
14261 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14263 case "$getgrent_r_proto" in
14264 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14265 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14267 case "$getgrent_r_proto" in
14268 ''|0) d_getgrent_r=undef
14270 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14271 * ) case "$getgrent_r_proto" in
14272 REENTRANT_PROTO*) ;;
14273 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14275 echo "Prototype: $try" ;;
14278 *) case "$usethreads" in
14279 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14286 *) getgrent_r_proto=0
14290 : see if getgrgid_r exists
14291 set getgrgid_r d_getgrgid_r
14293 case "$d_getgrgid_r" in
14295 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14296 case "$d_getgrgid_r_proto:$usethreads" in
14297 ":define") d_getgrgid_r_proto=define
14298 set d_getgrgid_r_proto getgrgid_r $hdrs
14302 case "$d_getgrgid_r_proto" in
14304 case "$getgrgid_r_proto" in
14305 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14306 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14308 case "$getgrgid_r_proto" in
14309 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14310 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14312 case "$getgrgid_r_proto" in
14313 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14314 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14316 case "$getgrgid_r_proto" in
14317 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14318 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14320 case "$getgrgid_r_proto" in
14321 ''|0) d_getgrgid_r=undef
14323 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14324 * ) case "$getgrgid_r_proto" in
14325 REENTRANT_PROTO*) ;;
14326 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14328 echo "Prototype: $try" ;;
14331 *) case "$usethreads" in
14332 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14339 *) getgrgid_r_proto=0
14343 : see if getgrnam_r exists
14344 set getgrnam_r d_getgrnam_r
14346 case "$d_getgrnam_r" in
14348 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14349 case "$d_getgrnam_r_proto:$usethreads" in
14350 ":define") d_getgrnam_r_proto=define
14351 set d_getgrnam_r_proto getgrnam_r $hdrs
14355 case "$d_getgrnam_r_proto" in
14357 case "$getgrnam_r_proto" in
14358 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14359 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14361 case "$getgrnam_r_proto" in
14362 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14363 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14365 case "$getgrnam_r_proto" in
14366 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14367 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14369 case "$getgrnam_r_proto" in
14370 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14371 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14373 case "$getgrnam_r_proto" in
14374 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14375 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14377 case "$getgrnam_r_proto" in
14378 ''|0) d_getgrnam_r=undef
14380 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14381 * ) case "$getgrnam_r_proto" in
14382 REENTRANT_PROTO*) ;;
14383 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14385 echo "Prototype: $try" ;;
14388 *) case "$usethreads" in
14389 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14396 *) getgrnam_r_proto=0
14400 : see if gethostbyaddr exists
14401 set gethostbyaddr d_gethbyaddr
14404 : see if gethostbyname exists
14405 set gethostbyname d_gethbyname
14408 : see if gethostent exists
14409 set gethostent d_gethent
14412 : see how we will look up host name
14415 if set gethostname val -f d_gethname; eval $csym; $val; then
14416 echo 'gethostname() found.' >&4
14417 d_gethname="$define"
14420 if set uname val -f d_uname; eval $csym; $val; then
14423 uname() was found, but you're running xenix, and older versions of xenix
14424 have a broken uname(). If you don't really know whether your xenix is old
14425 enough to have a broken system call, use the default answer.
14430 "$define") dflt=n;;
14432 rp='Is your uname() broken?'
14435 n*) d_uname="$define"; call=uname;;
14438 echo 'uname() found.' >&4
14445 case "$d_gethname" in
14446 '') d_gethname="$undef";;
14449 '') d_uname="$undef";;
14451 case "$d_uname$d_gethname" in
14456 Every now and then someone has a $call() that lies about the hostname
14457 but can't be fixed for political or economic reasons. If you wish, I can
14458 pretend $call() isn't there and maybe compute hostname at run-time
14459 thanks to the '$phostname' command.
14462 rp="Shall I ignore $call() from now on?"
14465 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14468 case "$phostname" in
14469 '') aphostname='';;
14470 *) case "$aphostname" in
14472 *) set X $phostname
14476 file=`./loc $file $file $pth`
14477 aphostname=`echo $file $*`
14482 case "$d_uname$d_gethname" in
14485 case "$phostname" in
14487 echo "There will be no way for $package to get your hostname." >&4;;
14489 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14493 case "$d_phostname" in
14494 '') d_phostname="$undef";;
14497 : see if gethostbyaddr_r exists
14498 set gethostbyaddr_r d_gethostbyaddr_r
14500 case "$d_gethostbyaddr_r" in
14502 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14503 case "$d_gethostbyaddr_r_proto:$usethreads" in
14504 ":define") d_gethostbyaddr_r_proto=define
14505 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14509 case "$d_gethostbyaddr_r_proto" in
14511 case "$gethostbyaddr_r_proto" in
14512 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14513 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14515 case "$gethostbyaddr_r_proto" in
14516 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14517 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14519 case "$gethostbyaddr_r_proto" in
14520 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14521 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14523 case "$gethostbyaddr_r_proto" in
14524 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14525 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14527 case "$gethostbyaddr_r_proto" in
14528 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14529 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14531 case "$gethostbyaddr_r_proto" in
14532 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14533 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14535 case "$gethostbyaddr_r_proto" in
14536 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14537 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14539 case "$gethostbyaddr_r_proto" in
14540 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14541 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14543 case "$gethostbyaddr_r_proto" in
14544 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14545 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14547 case "$gethostbyaddr_r_proto" in
14548 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14549 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14551 case "$gethostbyaddr_r_proto" in
14552 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14553 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14555 case "$gethostbyaddr_r_proto" in
14556 ''|0) d_gethostbyaddr_r=undef
14557 gethostbyaddr_r_proto=0
14558 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14559 * ) case "$gethostbyaddr_r_proto" in
14560 REENTRANT_PROTO*) ;;
14561 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14563 echo "Prototype: $try" ;;
14566 *) case "$usethreads" in
14567 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14569 d_gethostbyaddr_r=undef
14570 gethostbyaddr_r_proto=0
14574 *) gethostbyaddr_r_proto=0
14578 : see if gethostbyname_r exists
14579 set gethostbyname_r d_gethostbyname_r
14581 case "$d_gethostbyname_r" in
14583 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14584 case "$d_gethostbyname_r_proto:$usethreads" in
14585 ":define") d_gethostbyname_r_proto=define
14586 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14590 case "$d_gethostbyname_r_proto" in
14592 case "$gethostbyname_r_proto" in
14593 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14594 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14596 case "$gethostbyname_r_proto" in
14597 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14598 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14600 case "$gethostbyname_r_proto" in
14601 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14602 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14604 case "$gethostbyname_r_proto" in
14605 ''|0) d_gethostbyname_r=undef
14606 gethostbyname_r_proto=0
14607 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14608 * ) case "$gethostbyname_r_proto" in
14609 REENTRANT_PROTO*) ;;
14610 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14612 echo "Prototype: $try" ;;
14615 *) case "$usethreads" in
14616 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14618 d_gethostbyname_r=undef
14619 gethostbyname_r_proto=0
14623 *) gethostbyname_r_proto=0
14627 : see if gethostent_r exists
14628 set gethostent_r d_gethostent_r
14630 case "$d_gethostent_r" in
14632 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14633 case "$d_gethostent_r_proto:$usethreads" in
14634 ":define") d_gethostent_r_proto=define
14635 set d_gethostent_r_proto gethostent_r $hdrs
14639 case "$d_gethostent_r_proto" in
14641 case "$gethostent_r_proto" in
14642 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14643 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14645 case "$gethostent_r_proto" in
14646 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14647 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14649 case "$gethostent_r_proto" in
14650 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14651 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14653 case "$gethostent_r_proto" in
14654 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14655 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14657 case "$gethostent_r_proto" in
14658 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14659 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14661 case "$gethostent_r_proto" in
14662 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14663 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14665 case "$gethostent_r_proto" in
14666 ''|0) d_gethostent_r=undef
14667 gethostent_r_proto=0
14668 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14669 * ) case "$gethostent_r_proto" in
14670 REENTRANT_PROTO*) ;;
14671 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14673 echo "Prototype: $try" ;;
14676 *) case "$usethreads" in
14677 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14679 d_gethostent_r=undef
14680 gethostent_r_proto=0
14684 *) gethostent_r_proto=0
14688 : see if prototypes for various gethostxxx netdb.h functions are available
14690 set d_gethostprotos gethostent $i_netdb netdb.h
14693 : see if getitimer exists
14694 set getitimer d_getitimer
14697 : see if getlogin exists
14698 set getlogin d_getlogin
14701 : see if getlogin_r exists
14702 set getlogin_r d_getlogin_r
14704 case "$d_getlogin_r" in
14706 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14707 case "$d_getlogin_r_proto:$usethreads" in
14708 ":define") d_getlogin_r_proto=define
14709 set d_getlogin_r_proto getlogin_r $hdrs
14713 case "$d_getlogin_r_proto" in
14715 case "$getlogin_r_proto" in
14716 ''|0) try='int getlogin_r(char*, size_t);'
14717 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14719 case "$getlogin_r_proto" in
14720 ''|0) try='int getlogin_r(char*, int);'
14721 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14723 case "$getlogin_r_proto" in
14724 ''|0) try='char* getlogin_r(char*, size_t);'
14725 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14727 case "$getlogin_r_proto" in
14728 ''|0) try='char* getlogin_r(char*, int);'
14729 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14731 case "$getlogin_r_proto" in
14732 ''|0) d_getlogin_r=undef
14734 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14735 * ) case "$getlogin_r_proto" in
14736 REENTRANT_PROTO*) ;;
14737 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14739 echo "Prototype: $try" ;;
14742 *) case "$usethreads" in
14743 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14750 *) getlogin_r_proto=0
14754 : see if getmnt exists
14755 set getmnt d_getmnt
14758 : see if getmntent exists
14759 set getmntent d_getmntent
14762 : see if getnameinfo exists
14763 set getnameinfo d_getnameinfo
14766 : see if getnetbyaddr exists
14767 set getnetbyaddr d_getnbyaddr
14770 : see if getnetbyname exists
14771 set getnetbyname d_getnbyname
14774 : see if getnetent exists
14775 set getnetent d_getnent
14778 : see if getnetbyaddr_r exists
14779 set getnetbyaddr_r d_getnetbyaddr_r
14781 case "$d_getnetbyaddr_r" in
14783 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14784 case "$d_getnetbyaddr_r_proto:$usethreads" in
14785 ":define") d_getnetbyaddr_r_proto=define
14786 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14790 case "$d_getnetbyaddr_r_proto" in
14792 case "$getnetbyaddr_r_proto" in
14793 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14794 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14796 case "$getnetbyaddr_r_proto" in
14797 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14798 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14800 case "$getnetbyaddr_r_proto" in
14801 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14802 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14804 case "$getnetbyaddr_r_proto" in
14805 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14806 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14808 case "$getnetbyaddr_r_proto" in
14809 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14810 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14812 case "$getnetbyaddr_r_proto" in
14813 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14814 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14816 case "$getnetbyaddr_r_proto" in
14817 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14818 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14820 case "$getnetbyaddr_r_proto" in
14821 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14822 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14824 case "$getnetbyaddr_r_proto" in
14825 ''|0) d_getnetbyaddr_r=undef
14826 getnetbyaddr_r_proto=0
14827 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14828 * ) case "$getnetbyaddr_r_proto" in
14829 REENTRANT_PROTO*) ;;
14830 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14832 echo "Prototype: $try" ;;
14835 *) case "$usethreads" in
14836 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14838 d_getnetbyaddr_r=undef
14839 getnetbyaddr_r_proto=0
14843 *) getnetbyaddr_r_proto=0
14847 : see if getnetbyname_r exists
14848 set getnetbyname_r d_getnetbyname_r
14850 case "$d_getnetbyname_r" in
14852 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14853 case "$d_getnetbyname_r_proto:$usethreads" in
14854 ":define") d_getnetbyname_r_proto=define
14855 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14859 case "$d_getnetbyname_r_proto" in
14861 case "$getnetbyname_r_proto" in
14862 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14863 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14865 case "$getnetbyname_r_proto" in
14866 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14867 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14869 case "$getnetbyname_r_proto" in
14870 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14871 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14873 case "$getnetbyname_r_proto" in
14874 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14875 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14877 case "$getnetbyname_r_proto" in
14878 ''|0) d_getnetbyname_r=undef
14879 getnetbyname_r_proto=0
14880 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14881 * ) case "$getnetbyname_r_proto" in
14882 REENTRANT_PROTO*) ;;
14883 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14885 echo "Prototype: $try" ;;
14888 *) case "$usethreads" in
14889 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14891 d_getnetbyname_r=undef
14892 getnetbyname_r_proto=0
14896 *) getnetbyname_r_proto=0
14900 : see if getnetent_r exists
14901 set getnetent_r d_getnetent_r
14903 case "$d_getnetent_r" in
14905 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14906 case "$d_getnetent_r_proto:$usethreads" in
14907 ":define") d_getnetent_r_proto=define
14908 set d_getnetent_r_proto getnetent_r $hdrs
14912 case "$d_getnetent_r_proto" in
14914 case "$getnetent_r_proto" in
14915 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14916 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14918 case "$getnetent_r_proto" in
14919 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14920 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14922 case "$getnetent_r_proto" in
14923 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14924 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14926 case "$getnetent_r_proto" in
14927 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14928 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14930 case "$getnetent_r_proto" in
14931 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14932 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14934 case "$getnetent_r_proto" in
14935 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14936 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14938 case "$getnetent_r_proto" in
14939 ''|0) d_getnetent_r=undef
14940 getnetent_r_proto=0
14941 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14942 * ) case "$getnetent_r_proto" in
14943 REENTRANT_PROTO*) ;;
14944 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14946 echo "Prototype: $try" ;;
14949 *) case "$usethreads" in
14950 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14952 d_getnetent_r=undef
14953 getnetent_r_proto=0
14957 *) getnetent_r_proto=0
14961 : see if prototypes for various getnetxxx netdb.h functions are available
14963 set d_getnetprotos getnetent $i_netdb netdb.h
14966 : see if getpagesize exists
14967 set getpagesize d_getpagsz
14970 : Optional checks for getprotobyname and getprotobynumber
14972 : see if getprotobyname exists
14973 set getprotobyname d_getpbyname
14976 : see if getprotobynumber exists
14977 set getprotobynumber d_getpbynumber
14980 : see if getprotoent exists
14981 set getprotoent d_getpent
14984 : see if getpgid exists
14985 set getpgid d_getpgid
14988 : see if getpgrp2 exists
14989 set getpgrp2 d_getpgrp2
14992 : see if getppid exists
14993 set getppid d_getppid
14996 : see if getpriority exists
14997 set getpriority d_getprior
15000 : see if getprotobyname_r exists
15001 set getprotobyname_r d_getprotobyname_r
15003 case "$d_getprotobyname_r" in
15005 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15006 case "$d_getprotobyname_r_proto:$usethreads" in
15007 ":define") d_getprotobyname_r_proto=define
15008 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15012 case "$d_getprotobyname_r_proto" in
15014 case "$getprotobyname_r_proto" in
15015 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15016 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15018 case "$getprotobyname_r_proto" in
15019 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15020 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15022 case "$getprotobyname_r_proto" in
15023 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15024 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15026 case "$getprotobyname_r_proto" in
15027 ''|0) d_getprotobyname_r=undef
15028 getprotobyname_r_proto=0
15029 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15030 * ) case "$getprotobyname_r_proto" in
15031 REENTRANT_PROTO*) ;;
15032 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15034 echo "Prototype: $try" ;;
15037 *) case "$usethreads" in
15038 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15040 d_getprotobyname_r=undef
15041 getprotobyname_r_proto=0
15045 *) getprotobyname_r_proto=0
15049 : see if getprotobynumber_r exists
15050 set getprotobynumber_r d_getprotobynumber_r
15052 case "$d_getprotobynumber_r" in
15054 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15055 case "$d_getprotobynumber_r_proto:$usethreads" in
15056 ":define") d_getprotobynumber_r_proto=define
15057 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15061 case "$d_getprotobynumber_r_proto" in
15063 case "$getprotobynumber_r_proto" in
15064 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15065 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15067 case "$getprotobynumber_r_proto" in
15068 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15069 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15071 case "$getprotobynumber_r_proto" in
15072 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15073 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15075 case "$getprotobynumber_r_proto" in
15076 ''|0) d_getprotobynumber_r=undef
15077 getprotobynumber_r_proto=0
15078 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15079 * ) case "$getprotobynumber_r_proto" in
15080 REENTRANT_PROTO*) ;;
15081 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15083 echo "Prototype: $try" ;;
15086 *) case "$usethreads" in
15087 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15089 d_getprotobynumber_r=undef
15090 getprotobynumber_r_proto=0
15094 *) getprotobynumber_r_proto=0
15098 : see if getprotoent_r exists
15099 set getprotoent_r d_getprotoent_r
15101 case "$d_getprotoent_r" in
15103 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15104 case "$d_getprotoent_r_proto:$usethreads" in
15105 ":define") d_getprotoent_r_proto=define
15106 set d_getprotoent_r_proto getprotoent_r $hdrs
15110 case "$d_getprotoent_r_proto" in
15112 case "$getprotoent_r_proto" in
15113 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15114 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15116 case "$getprotoent_r_proto" in
15117 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15118 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15120 case "$getprotoent_r_proto" in
15121 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15122 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15124 case "$getprotoent_r_proto" in
15125 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15126 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15128 case "$getprotoent_r_proto" in
15129 ''|0) d_getprotoent_r=undef
15130 getprotoent_r_proto=0
15131 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15132 * ) case "$getprotoent_r_proto" in
15133 REENTRANT_PROTO*) ;;
15134 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15136 echo "Prototype: $try" ;;
15139 *) case "$usethreads" in
15140 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15142 d_getprotoent_r=undef
15143 getprotoent_r_proto=0
15147 *) getprotoent_r_proto=0
15151 : see if prototypes for various getprotoxxx netdb.h functions are available
15153 set d_getprotoprotos getprotoent $i_netdb netdb.h
15156 : see if getprpwnam exists
15157 set getprpwnam d_getprpwnam
15160 : see if getpwent exists
15161 set getpwent d_getpwent
15164 : see if getpwent_r exists
15165 set getpwent_r d_getpwent_r
15167 case "$d_getpwent_r" in
15169 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15170 case "$d_getpwent_r_proto:$usethreads" in
15171 ":define") d_getpwent_r_proto=define
15172 set d_getpwent_r_proto getpwent_r $hdrs
15176 case "$d_getpwent_r_proto" in
15178 case "$getpwent_r_proto" in
15179 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15180 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15182 case "$getpwent_r_proto" in
15183 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15184 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15186 case "$getpwent_r_proto" in
15187 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15188 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15190 case "$getpwent_r_proto" in
15191 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15192 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15194 case "$getpwent_r_proto" in
15195 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15196 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15198 case "$getpwent_r_proto" in
15199 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15200 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15202 case "$getpwent_r_proto" in
15203 ''|0) d_getpwent_r=undef
15205 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15206 * ) case "$getpwent_r_proto" in
15207 REENTRANT_PROTO*) ;;
15208 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15210 echo "Prototype: $try" ;;
15213 *) case "$usethreads" in
15214 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15221 *) getpwent_r_proto=0
15225 : see if getpwnam_r exists
15226 set getpwnam_r d_getpwnam_r
15228 case "$d_getpwnam_r" in
15230 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15231 case "$d_getpwnam_r_proto:$usethreads" in
15232 ":define") d_getpwnam_r_proto=define
15233 set d_getpwnam_r_proto getpwnam_r $hdrs
15237 case "$d_getpwnam_r_proto" in
15239 case "$getpwnam_r_proto" in
15240 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15241 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15243 case "$getpwnam_r_proto" in
15244 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15245 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15247 case "$getpwnam_r_proto" in
15248 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15249 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15251 case "$getpwnam_r_proto" in
15252 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15253 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15255 case "$getpwnam_r_proto" in
15256 ''|0) d_getpwnam_r=undef
15258 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15259 * ) case "$getpwnam_r_proto" in
15260 REENTRANT_PROTO*) ;;
15261 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15263 echo "Prototype: $try" ;;
15266 *) case "$usethreads" in
15267 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15274 *) getpwnam_r_proto=0
15278 : see if getpwuid_r exists
15279 set getpwuid_r d_getpwuid_r
15281 case "$d_getpwuid_r" in
15283 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15284 case "$d_getpwuid_r_proto:$usethreads" in
15285 ":define") d_getpwuid_r_proto=define
15286 set d_getpwuid_r_proto getpwuid_r $hdrs
15290 case "$d_getpwuid_r_proto" in
15292 case "$getpwuid_r_proto" in
15293 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15294 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15296 case "$getpwuid_r_proto" in
15297 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15298 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15300 case "$getpwuid_r_proto" in
15301 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15302 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15304 case "$getpwuid_r_proto" in
15305 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15306 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15308 case "$getpwuid_r_proto" in
15309 ''|0) d_getpwuid_r=undef
15311 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15312 * ) case "$getpwuid_r_proto" in
15313 REENTRANT_PROTO*) ;;
15314 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15316 echo "Prototype: $try" ;;
15319 *) case "$usethreads" in
15320 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15327 *) getpwuid_r_proto=0
15331 : Optional checks for getsbyname and getsbyport
15333 : see if getservbyname exists
15334 set getservbyname d_getsbyname
15337 : see if getservbyport exists
15338 set getservbyport d_getsbyport
15341 : see if getservent exists
15342 set getservent d_getsent
15345 : see if getservbyname_r exists
15346 set getservbyname_r d_getservbyname_r
15348 case "$d_getservbyname_r" in
15350 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15351 case "$d_getservbyname_r_proto:$usethreads" in
15352 ":define") d_getservbyname_r_proto=define
15353 set d_getservbyname_r_proto getservbyname_r $hdrs
15357 case "$d_getservbyname_r_proto" in
15359 case "$getservbyname_r_proto" in
15360 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15361 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15363 case "$getservbyname_r_proto" in
15364 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15365 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15367 case "$getservbyname_r_proto" in
15368 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15369 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15371 case "$getservbyname_r_proto" in
15372 ''|0) d_getservbyname_r=undef
15373 getservbyname_r_proto=0
15374 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15375 * ) case "$getservbyname_r_proto" in
15376 REENTRANT_PROTO*) ;;
15377 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15379 echo "Prototype: $try" ;;
15382 *) case "$usethreads" in
15383 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15385 d_getservbyname_r=undef
15386 getservbyname_r_proto=0
15390 *) getservbyname_r_proto=0
15394 : see if getservbyport_r exists
15395 set getservbyport_r d_getservbyport_r
15397 case "$d_getservbyport_r" in
15399 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15400 case "$d_getservbyport_r_proto:$usethreads" in
15401 ":define") d_getservbyport_r_proto=define
15402 set d_getservbyport_r_proto getservbyport_r $hdrs
15406 case "$d_getservbyport_r_proto" in
15408 case "$getservbyport_r_proto" in
15409 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15410 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15412 case "$getservbyport_r_proto" in
15413 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15414 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15416 case "$getservbyport_r_proto" in
15417 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15418 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15420 case "$getservbyport_r_proto" in
15421 ''|0) d_getservbyport_r=undef
15422 getservbyport_r_proto=0
15423 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15424 * ) case "$getservbyport_r_proto" in
15425 REENTRANT_PROTO*) ;;
15426 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15428 echo "Prototype: $try" ;;
15431 *) case "$usethreads" in
15432 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15434 d_getservbyport_r=undef
15435 getservbyport_r_proto=0
15439 *) getservbyport_r_proto=0
15443 : see if getservent_r exists
15444 set getservent_r d_getservent_r
15446 case "$d_getservent_r" in
15448 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15449 case "$d_getservent_r_proto:$usethreads" in
15450 ":define") d_getservent_r_proto=define
15451 set d_getservent_r_proto getservent_r $hdrs
15455 case "$d_getservent_r_proto" in
15457 case "$getservent_r_proto" in
15458 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15459 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15461 case "$getservent_r_proto" in
15462 ''|0) try='int getservent_r(struct servent*, char*, int);'
15463 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15465 case "$getservent_r_proto" in
15466 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15467 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15469 case "$getservent_r_proto" in
15470 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15471 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15473 case "$getservent_r_proto" in
15474 ''|0) d_getservent_r=undef
15475 getservent_r_proto=0
15476 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15477 * ) case "$getservent_r_proto" in
15478 REENTRANT_PROTO*) ;;
15479 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15481 echo "Prototype: $try" ;;
15484 *) case "$usethreads" in
15485 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15487 d_getservent_r=undef
15488 getservent_r_proto=0
15492 *) getservent_r_proto=0
15496 : see if prototypes for various getservxxx netdb.h functions are available
15498 set d_getservprotos getservent $i_netdb netdb.h
15501 : see if getspnam exists
15502 set getspnam d_getspnam
15505 : see if this is a shadow.h system
15506 set shadow.h i_shadow
15509 : see if getspnam_r exists
15510 set getspnam_r d_getspnam_r
15512 case "$d_getspnam_r" in
15514 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15515 case "$d_getspnam_r_proto:$usethreads" in
15516 ":define") d_getspnam_r_proto=define
15517 set d_getspnam_r_proto getspnam_r $hdrs
15521 case "$d_getspnam_r_proto" in
15523 case "$getspnam_r_proto" in
15524 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15525 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15527 case "$getspnam_r_proto" in
15528 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15529 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15531 case "$getspnam_r_proto" in
15532 ''|0) d_getspnam_r=undef
15534 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15535 * ) case "$getspnam_r_proto" in
15536 REENTRANT_PROTO*) ;;
15537 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15539 echo "Prototype: $try" ;;
15542 *) case "$usethreads" in
15543 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15550 *) getspnam_r_proto=0
15554 : see if gettimeofday or ftime exists
15555 set gettimeofday d_gettimeod
15557 case "$d_gettimeod" in
15563 val="$undef"; set d_ftime; eval $setvar
15566 case "$d_gettimeod$d_ftime" in
15569 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15573 : see if gmtime_r exists
15574 set gmtime_r d_gmtime_r
15576 case "$d_gmtime_r" in
15578 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15579 case "$d_gmtime_r_proto:$usethreads" in
15580 ":define") d_gmtime_r_proto=define
15581 set d_gmtime_r_proto gmtime_r $hdrs
15585 case "$d_gmtime_r_proto" in
15587 case "$gmtime_r_proto" in
15588 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15589 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15591 case "$gmtime_r_proto" in
15592 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15593 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15595 case "$gmtime_r_proto" in
15596 ''|0) d_gmtime_r=undef
15598 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15599 * ) case "$gmtime_r_proto" in
15600 REENTRANT_PROTO*) ;;
15601 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15603 echo "Prototype: $try" ;;
15606 *) case "$usethreads" in
15607 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15614 *) gmtime_r_proto=0
15618 : see if hasmntopt exists
15619 set hasmntopt d_hasmntopt
15622 : see if this is a netinet/in.h or sys/in.h system
15623 set netinet/in.h i_niin sys/in.h i_sysin
15626 : see if arpa/inet.h has to be included
15627 set arpa/inet.h i_arpainet
15630 : see if htonl --and friends-- exists
15635 : Maybe they are macros.
15638 $cat >htonl.c <<EOM
15640 #include <sys/types.h>
15641 #$i_niin I_NETINET_IN
15643 #$i_arpainet I_ARPA_INET
15644 #ifdef I_NETINET_IN
15645 #include <netinet/in.h>
15648 #include <sys/in.h>
15651 #include <arpa/inet.h>
15654 printf("Defined as a macro.");
15657 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15658 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15660 echo "But it seems to be defined as a macro." >&4
15668 : see if hypot exists
15672 : see if ilogb exists
15676 : see if ilogbl exists
15677 set ilogbl d_ilogbl
15680 : check whether inet_aton exists
15681 set inet_aton d_inetaton
15684 : see if inet_ntop exists
15685 set inet_ntop d_inetntop
15688 : see if inet_pton exists
15689 set inet_pton d_inetpton
15694 $cat >isascii.c <<EOCP
15697 #$i_stdlib I_STDLIB
15699 #include <stdlib.h>
15710 if eval $compile; then
15711 echo "isascii() found." >&4
15714 echo "isascii() NOT found." >&4
15723 $cat >isblank.c <<'EOCP'
15734 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15735 echo "isblank() found." >&4
15738 echo "isblank() NOT found." >&4
15745 : check for isfinite
15746 echo "Checking to see if you have isfinite..." >&4
15749 int main() { return isfinite(0.0); }
15752 if eval $compile; then
15754 echo "You have isfinite."
15757 echo "You do not have isfinite."
15763 : see if isfinitel exists
15764 set isfinitel d_isfinitel
15768 echo "Checking to see if you have isinf..." >&4
15771 int main() { return isinf(0.0); }
15774 if eval $compile; then
15776 echo "You have isinf."
15779 echo "You do not have isinf."
15785 : see if isinfl exists
15786 set isinfl d_isinfl
15790 echo "Checking to see if you have isless..." >&4
15793 int main() { return isless(0.0); }
15796 if eval $compile; then
15798 echo "You have isless."
15801 echo "You do not have isless."
15808 echo "Checking to see if you have isnan..." >&4
15811 int main() { return isnan(0.0); }
15814 if eval $compile; then
15816 echo "You have isnan."
15819 echo "You do not have isnan."
15825 : see if isnanl exists
15826 set isnanl d_isnanl
15829 : check for isnormal
15830 echo "Checking to see if you have isnormal..." >&4
15833 int main() { return isnormal(0.0); }
15836 if eval $compile; then
15838 echo "You have isnormal."
15841 echo "You do not have isnormal."
15851 : see if j0l exists
15855 : see if killpg exists
15856 set killpg d_killpg
15859 : see if localeconv exists
15860 set localeconv d_locconv
15863 : see if libc has the POSIX.1-2008 currency locale rules
15864 case "$d_locconv:$d_lc_monetary_2008" in
15867 #include <locale.h>
15869 struct lconv *lc = localeconv();
15870 char int_p_cs_precedes = lc->int_p_cs_precedes;
15875 if eval $compile; then
15876 d_lc_monetary_2008="$define"
15878 d_lc_monetary_2008="$undef"
15884 : see if lchown exists
15886 $cat > try.c <<'EOCP'
15887 /* System header to define __stub macros and hopefully few prototypes,
15888 which can conflict with char lchown(); below. */
15889 #include <assert.h>
15890 /* Override any gcc2 internal prototype to avoid an error. */
15891 /* We use char because int might match the return type of a gcc2
15892 builtin and then its argument prototype would still apply. */
15895 /* The GNU C library defines this for functions which it implements
15896 to always fail with ENOSYS. Some functions are actually named
15897 something starting with __ and the normal name is an alias. */
15898 #if defined (__stub_lchown) || defined (__stub___lchown)
15906 if eval $compile; then
15907 $echo "lchown() found." >&4
15910 $echo "lchown() NOT found." >&4
15916 : See if number of significant digits in a double precision number is known
15918 $cat >ldbl_dig.c <<EOM
15919 #include <limits.h>
15922 printf("Contains LDBL_DIG");
15925 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15926 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15927 echo "LDBL_DIG found." >&4
15930 echo "LDBL_DIG NOT found." >&4
15937 : see if lgamma exists
15938 set lgamma d_lgamma
15941 : see if lgamma_r exists
15942 set lgamma_r d_lgamma_r
15945 : check to see if math.h defines _LIB_VERSION
15946 d_libm_lib_version="$undef"
15948 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15950 #include <unistd.h>
15952 int main (int argc, char *argv[])
15954 printf ("%d\n", _LIB_VERSION);
15959 if eval $compile; then
15961 echo "Yes, it does ($foo)" >&4
15962 d_libm_lib_version="$define"
15964 echo "No, it does not (probably harmless)" >&4
15968 : see if link exists
15972 : see if llrint exists
15973 set llrint d_llrint
15976 : see if llrintl exists
15977 set llrintl d_llrintl
15980 : see if llround exists
15981 set llround d_llround
15984 : see if llroundl exists
15985 set llroundl d_llroundl
15988 : see if localeconv_l exists
15989 set localeconv_l d_localeconv_l
15992 : see if localtime_r exists
15993 set localtime_r d_localtime_r
15995 case "$d_localtime_r" in
15997 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15998 case "$d_localtime_r_proto:$usethreads" in
15999 ":define") d_localtime_r_proto=define
16000 set d_localtime_r_proto localtime_r $hdrs
16004 case "$d_localtime_r_proto" in
16006 case "$localtime_r_proto" in
16007 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16008 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16010 case "$localtime_r_proto" in
16011 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16012 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16014 case "$localtime_r_proto" in
16015 ''|0) d_localtime_r=undef
16016 localtime_r_proto=0
16017 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16018 * ) case "$localtime_r_proto" in
16019 REENTRANT_PROTO*) ;;
16020 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16022 echo "Prototype: $try" ;;
16025 *) case "$usethreads" in
16026 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16028 d_localtime_r=undef
16029 localtime_r_proto=0
16033 *) localtime_r_proto=0
16037 : see if localtime_r calls tzset
16038 case "$localtime_r_proto" in
16041 /* Does our libc's localtime_r call tzset ?
16042 * return 0 if so, 1 otherwise.
16044 #$i_systypes I_SYS_TYPES
16045 #$i_unistd I_UNISTD
16047 #$i_stdlib I_STDLIB
16048 #$i_malloc I_MALLOC
16050 # include <sys/types.h>
16053 # include <unistd.h>
16059 #include <stdlib.h>
16061 #include <string.h>
16063 # include <malloc.h>
16067 time_t t = time(0L);
16068 char w_tz[]="TZ" "=GMT+5",
16069 e_tz[]="TZ" "=GMT-5",
16070 *tz_e = (char*)malloc(16),
16071 *tz_w = (char*)malloc(16);
16072 struct tm tm_e, tm_w;
16073 memset(&tm_e,'\0',sizeof(struct tm));
16074 memset(&tm_w,'\0',sizeof(struct tm));
16079 localtime_r(&t, &tm_e);
16082 localtime_r(&t, &tm_w);
16084 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16090 if eval $compile; then
16091 if $run ./try; then
16092 d_localtime_r_needs_tzset=undef;
16094 d_localtime_r_needs_tzset=define;
16097 d_localtime_r_needs_tzset=undef;
16101 d_localtime_r_needs_tzset=undef;
16106 : see if lockf exists
16110 : see if log1p exists
16114 : see if log2 exists
16118 : see if logb exists
16122 : see if lrint exists
16126 : see if lrintl exists
16127 set lrintl d_lrintl
16130 : see if lround exists
16131 set lround d_lround
16134 : see if lroundl exists
16135 set lroundl d_lroundl
16138 : see if prototype for lseek is available
16140 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16143 : see if lstat exists
16147 : see if madvise exists
16148 set madvise d_madvise
16151 : see if malloc_size exists
16152 set malloc_size d_malloc_size
16155 : see if malloc_size_good exists
16156 set malloc_good_size d_malloc_good_size
16159 : see if mblen exists
16163 : see if mbrlen exists
16164 set mbrlen d_mbrlen
16167 : see if mbrtowc exists
16168 set mbrtowc d_mbrtowc
16171 : see if mbstowcs exists
16172 set mbstowcs d_mbstowcs
16175 : see if mbtowc exists
16176 set mbtowc d_mbtowc
16179 : see if memmem exists
16180 set memmem d_memmem
16183 : see if memrchr exists
16184 set memrchr d_memrchr
16187 : see if mkdir exists
16191 : see if mkdtemp exists
16192 set mkdtemp d_mkdtemp
16195 : see if mkfifo exists
16196 set mkfifo d_mkfifo
16199 : see if mkostemp exists
16200 set mkostemp d_mkostemp
16203 : see if mkstemp exists
16204 set mkstemp d_mkstemp
16207 : see if mkstemps exists
16208 set mkstemps d_mkstemps
16211 : see if mktime exists
16212 set mktime d_mktime
16215 : see if sys/mman.h has to be included
16216 set sys/mman.h i_sysmman
16219 : see if mmap exists
16222 : see what shmat returns
16223 : default to something harmless
16225 case "$i_sysmman$d_mmap" in
16227 $cat >mmap.c <<'END'
16228 #include <sys/mman.h>
16231 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16236 echo "and it returns ($mmaptype)." >&4
16240 : see if sqrtl exists
16244 : see if scalbnl exists
16245 set scalbnl d_scalbnl
16248 : see if truncl exists
16249 set truncl d_truncl
16252 : see if modfl exists
16256 : see if prototype for modfl is available
16258 set d_modflproto modfl define math.h
16261 if $test "$uselongdouble" = "$define"; then
16263 if $test "$d_sqrtl" != "$define"; then
16264 message="$message sqrtl"
16266 if $test "$d_modfl" != "$define"; then
16267 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16268 echo "You have both truncl and copysignl, so I can emulate modfl."
16270 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16271 echo "You have both aintl and copysignl, so I can emulate modfl."
16273 message="$message modfl"
16277 if $test "$d_frexpl" != "$define"; then
16278 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16279 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16281 message="$message frexpl"
16284 if $test "$d_ldexpl" != "$define"; then
16285 message="$message ldexpl"
16288 if $test "$message" != ""; then
16291 *** You requested the use of long doubles but you do not seem to have
16292 *** the following mathematical functions needed for long double support:
16294 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16295 *** Cannot continue, aborting.
16303 : see if mprotect exists
16304 set mprotect d_mprotect
16307 : see if msgctl exists
16308 set msgctl d_msgctl
16311 : see if msgget exists
16312 set msgget d_msgget
16315 : see if msgsnd exists
16316 set msgsnd d_msgsnd
16319 : see if msgrcv exists
16320 set msgrcv d_msgrcv
16323 : see how much of the 'msg*(2)' library is present.
16326 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16327 *"$undef"*) h_msg=false;;
16331 case "`ipcs 2>&1`" in
16332 "SVID messages"*"not configured"*)
16333 echo "Your $osname does not have the msg*(2) configured." >&4
16336 set msgctl d_msgctl
16338 set msgget d_msgget
16340 set msgsnd d_msgsnd
16342 set msgrcv d_msgrcv
16348 : we could also check for sys/ipc.h ...
16349 if $h_msg && $test `./findhdr sys/msg.h`; then
16350 echo "You have the full msg*(2) library." >&4
16353 echo "You don't have the full msg*(2) library." >&4
16359 : Check for msghdr_s
16361 echo "Checking to see if your system supports struct msghdr..." >&4
16362 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16364 case "$d_msghdr_s" in
16365 "$define") echo "Yes, it does." ;;
16366 *) echo "No, it doesn't." ;;
16369 : see if msync exists
16373 : see if munmap exists
16374 set munmap d_munmap
16377 : see if nan exists
16381 : see if nanosleep exists
16382 set nanosleep d_nanosleep
16385 : see if nearbyint exists
16386 set nearbyint d_nearbyint
16389 : see if nextafter exists
16390 set nextafter d_nextafter
16393 : see if nexttoward exists
16394 set nexttoward d_nexttoward
16397 : see if nice exists
16401 : see if this is a langinfo.h system
16402 set langinfo.h i_langinfo
16405 : see if nl_langinfo exists
16406 set nl_langinfo d_nl_langinfo
16409 : see if this is a quadmath.h system
16410 set quadmath.h i_quadmath
16413 : Check basic sizes
16415 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16417 case "$use64bitint:$d_quad:$quadtype" in
16420 uvtype="$uquadtype"
16425 uvtype="unsigned long"
16431 case "$uselongdouble:$d_longdbl" in
16433 nvtype="long double"
16434 nvsize=$longdblsize
16441 case "$usequadmath:$i_quadmath" in
16443 nvtype="__float128"
16449 *** You requested the use of the quadmath library, but you
16450 *** do not seem to have the quadmath library installed.
16451 *** Cannot continue, aborting.
16457 define:*) $cat <<EOM >&4
16459 *** You requested the use of the quadmath library, but you
16460 *** do not seem to have the required header, <quadmath.h>.
16462 case "$gccversion" in
16465 *** Your gcc looks a bit old:
16471 *** You are not running a gcc.
16476 *** For the quadmath library you need at least gcc 4.6.
16477 *** Cannot continue, aborting.
16483 $echo "(IV will be "$ivtype", $ivsize bytes)"
16484 $echo "(UV will be "$uvtype", $uvsize bytes)"
16485 $echo "(NV will be "$nvtype", $nvsize bytes)"
16488 #$i_inttypes I_INTTYPES
16490 #include <inttypes.h>
16495 int8_t i = INT8_MAX;
16496 uint8_t u = UINT8_MAX;
16497 printf("int8_t\n");
16500 int16_t i = INT16_MAX;
16501 uint16_t u = UINT16_MAX;
16502 printf("int16_t\n");
16505 int32_t i = INT32_MAX;
16506 uint32_t u = UINT32_MAX;
16507 printf("int32_t\n");
16512 i8type="signed char"
16513 u8type="unsigned char"
16518 '') case "$shortsize" in
16520 u16type="unsigned short"
16528 '') set try -DINT16
16529 if eval $compile; then
16530 case "`$run ./try`" in
16542 '') if $test $shortsize -ge 2; then
16544 u16type="unsigned short"
16552 '') case "$longsize" in
16554 u32type="unsigned long"
16558 *) case "$intsize" in
16560 u32type="unsigned int"
16570 '') set try -DINT32
16571 if eval $compile; then
16572 case "`$run ./try`" in
16584 '') if $test $intsize -ge 4; then
16586 u32type="unsigned int"
16594 '') case "$d_quad:$quadtype" in
16596 i64type="$quadtype"
16597 u64type="$uquadtype"
16605 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16608 #$i_stdlib I_STDLIB
16610 #include <stdlib.h>
16612 #include <sys/types.h>
16613 #include <signal.h>
16615 /* volatile so that the compiler has to store it out to memory */
16616 volatile int bletched = 0;
16617 $signal_t blech(int s) { bletched = 1; }
16622 int n = 8 * $uvsize;
16625 signal(SIGFPE, blech);
16628 for (i = 0; i < n; i++) {
16629 u = u << 1 | ($uvtype)1;
16631 if (($uvtype)d != u)
16635 d = ($nvtype)(u - 1);
16636 if (($uvtype)d != (u - 1))
16643 printf("%d\n", ((i == n) ? -n : i));
16649 d_nv_preserves_uv="$undef"
16650 if eval $compile; then
16651 nv_preserves_uv_bits="`$run ./try`"
16653 case "$nv_preserves_uv_bits" in
16655 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16656 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16657 d_nv_preserves_uv="$define"
16659 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16660 d_nv_preserves_uv="$undef" ;;
16661 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16662 nv_preserves_uv_bits="0" ;;
16666 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16670 typedef $nvtype NV;
16677 while(count < 256) {
16678 /* volatile so that the compiler has to store it out to memory */
16679 volatile NV up = value + 1.0;
16680 volatile NV negated = -value;
16681 volatile NV down = negated - 1.0;
16682 volatile NV got_up = up - value;
16683 int up_good = got_up == 1.0;
16684 int got_down = down - negated;
16685 int down_good = got_down == -1.0;
16687 if (down_good != up_good) {
16689 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16690 up_good, (double) got_up, down_good, (double) got_down,
16691 count, (double) value);
16698 fputs("256.0", stdout);
16701 fputs("2.0", stdout);
16707 fputs("*", stdout);
16713 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16714 count, (double) value);
16720 nv_overflows_integers_at='0'
16721 if eval $compile; then
16727 The largest integer your NVs can preserve is equal to $xxx
16729 nv_overflows_integers_at="$xxx"
16732 Cannot determine the largest integer value your NVs can hold, unexpected output
16739 Cannot determine the largest integer value your NVs can hold
16746 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16749 #$i_stdlib I_STDLIB
16751 #include <stdlib.h>
16753 #include <string.h>
16754 #include <sys/types.h>
16755 #include <signal.h>
16757 /* volatile so that the compiler has to store it out to memory */
16758 volatile int bletched = 0;
16759 $signal_t blech(int s) { bletched = 1; }
16762 int checkit($nvtype d, const char *where) {
16764 unsigned char *p = (unsigned char *)v;
16765 unsigned char *end = p + sizeof(d);
16774 p = (unsigned char *)v;
16775 printf("No - %s: 0x", where);
16777 printf ("%02X", *p++);
16782 int main(int argc, char **argv) {
16785 fail += checkit(d, "0.0");
16787 /* The compiler shouldn't be assuming that bletched is 0 */
16790 fail += checkit(d, "bleched");
16793 signal(SIGFPE, blech);
16796 /* Paranoia - the compiler should have no way of knowing that ANSI says
16797 that argv[argc] will always be NULL. Actually, if it did assume this it
16798 would be buggy, as this is C and main() can be called from elsewhere in
16800 d = argv[argc] ? 1 : 0;
16803 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16806 fail += checkit(d, "ternary");
16808 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16811 printf("No - memset doesn't give 0.0\n");
16812 /* This might just blow up: */
16813 printf("(gives %g)\n", d);
16819 printf("No - something bleched\n");
16824 printf("No - %d fail(s)\n", fail);
16833 d_nv_zero_is_allbits_zero="$undef"
16834 if eval $compile; then
16840 0.0 is represented as all bits zero in memory
16842 d_nv_zero_is_allbits_zero="$define"
16845 0.0 is not represented as all bits zero in memory
16847 d_nv_zero_is_allbits_zero="$undef"
16852 0.0 is not represented as all bits zero in memory
16854 d_nv_zero_is_allbits_zero="$undef"
16860 : check for off64_t
16862 echo "Checking to see if you have off64_t..." >&4
16864 #include <sys/types.h>
16865 #include <unistd.h>
16866 int main() { off64_t x = 7; }
16869 if eval $compile; then
16871 echo "You have off64_t."
16874 echo "You do not have off64_t."
16875 case "$lseeksize" in
16876 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16883 : how to create joinable pthreads
16884 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16886 echo "Checking what constant to use for creating joinable pthreads..." >&4
16887 $cat >try.c <<'EOCP'
16888 #include <pthread.h>
16890 int detachstate = JOINABLE;
16893 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16894 if eval $compile; then
16895 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16896 val="$undef" # Yes, undef.
16897 set d_old_pthread_create_joinable
16900 set old_pthread_create_joinable
16903 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16904 if eval $compile; then
16905 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16907 set d_old_pthread_create_joinable
16909 val=PTHREAD_CREATE_UNDETACHED
16910 set old_pthread_create_joinable
16913 set try -DJOINABLE=__UNDETACHED
16914 if eval $compile; then
16915 echo "You seem to use __UNDETACHED." >&4
16917 set d_old_pthread_create_joinable
16920 set old_pthread_create_joinable
16923 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16925 set d_old_pthread_create_joinable
16928 set old_pthread_create_joinable
16935 d_old_pthread_create_joinable="$undef"
16936 old_pthread_create_joinable=""
16939 : see if pause exists
16943 : see if pipe2 exists
16947 : see if poll exists
16951 : see if prctl exists
16955 : see if prctl supports PR_SET_NAME
16956 d_prctl_set_name=$undef
16961 #include <unistd.h>
16963 #include <sys/prctl.h>
16965 int main (int argc, char *argv[])
16967 return (prctl (PR_SET_NAME, "Test"));
16971 if eval $compile_ok && $run ./try; then
16972 echo "Your prctl (PR_SET_NAME, ...) works"
16973 d_prctl_set_name=$define
16979 : see if readlink exists
16980 set readlink d_readlink
16983 : Check if there is a /proc symlink to the abs path of
16984 : the executing program. We will honor hints of d_procselfexe=$undef
16985 : or procselfexe being non-empty, otherwise will try to determine both
16986 : if we have readlink.
16987 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
16988 : referenced, and AmigaOS does not have a proc filesystem anyway.
16991 if $test "X$d_procselfexe" = Xundef; then
16993 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
16995 elif $test "X$d_readlink" = Xdefine; then
16996 : NetBSD first as /proc/self is a symlink to /proc/curproc,
16997 : and it feels more tidy to avoid an extra level of symlink
16998 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16999 while test $# -gt 0; do
17002 if $issymlink $try; then
17003 $ls -l $try > reflect
17004 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17005 echo "You have $type-like $try."
17006 procselfexe='"'$try'"'
17008 : This will break out of the loop
17018 : backward compatibility for d_hvfork
17019 if test X$d_hvfork != X; then
17020 d_vfork="$d_hvfork"
17023 : see if there is a vfork
17028 d_pseudofork=$undef
17030 : Ok, but do we want to use it. vfork is reportedly unreliable in
17031 : perl on Solaris 2.x, and probably elsewhere.
17035 case "$usevfork" in
17041 Perl can only use a vfork() that doesn't suffer from strict
17042 restrictions on calling functions or modifying global data in
17043 the child. For example, glibc-2.1 contains such a vfork()
17044 that is unsuitable. If your system provides a proper fork()
17045 call, chances are that you do NOT want perl to use vfork().
17048 rp="Do you still want to use vfork()?"
17053 echo "Ok, we won't use vfork()."
17062 $define) usevfork='true';;
17063 *) usevfork='false';;
17066 : see whether the pthread_atfork exists
17068 #include <pthread.h>
17071 #ifdef PTHREAD_ATFORK
17072 pthread_atfork(NULL,NULL,NULL);
17077 : see if pthread_atfork exists
17078 set try -DPTHREAD_ATFORK
17079 if eval $compile; then
17084 case "$usethreads" in
17087 $define) echo 'pthread_atfork found.' >&4 ;;
17088 *) echo 'pthread_atfork NOT found.' >&4 ;;
17091 set d_pthread_atfork
17094 : see if pthread_attr_setscope exists
17095 set pthread_attr_setscope d_pthread_attr_setscope
17098 : see whether the various POSIXish _yields exist
17100 #include <pthread.h>
17106 #ifdef PTHREAD_YIELD
17109 #ifdef PTHREAD_YIELD_NULL
17110 pthread_yield(NULL);
17116 : see if sched_yield exists
17117 set try -DSCHED_YIELD
17118 if eval $compile; then
17120 sched_yield='sched_yield()'
17124 case "$usethreads" in
17127 $define) echo 'sched_yield() found.' >&4 ;;
17128 *) echo 'sched_yield() NOT found.' >&4 ;;
17134 : see if pthread_yield exists
17135 set try -DPTHREAD_YIELD
17136 if eval $compile; then
17138 case "$sched_yield" in
17139 '') sched_yield='pthread_yield()' ;;
17142 set try -DPTHREAD_YIELD_NULL
17143 if eval $compile; then
17145 case "$sched_yield" in
17146 '') sched_yield='pthread_yield(NULL)' ;;
17152 case "$usethreads" in
17155 $define) echo 'pthread_yield() found.' >&4 ;;
17156 *) echo 'pthread_yield() NOT found.' >&4 ;;
17160 set d_pthread_yield
17162 case "$sched_yield" in
17163 '') sched_yield=undef ;;
17167 : check for ptrdiff_t
17169 echo "Checking to see if you have ptrdiff_t..." >&4
17171 #include <stddef.h>
17172 int main() { ptrdiff_t x = 7; }
17175 if eval $compile; then
17177 echo "You have ptrdiff_t."
17180 echo "You do not have ptrdiff_t."
17186 : see if random_r exists
17187 set random_r d_random_r
17189 case "$d_random_r" in
17191 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17192 case "$d_random_r_proto:$usethreads" in
17193 ":define") d_random_r_proto=define
17194 set d_random_r_proto random_r $hdrs
17198 case "$d_random_r_proto" in
17200 case "$random_r_proto" in
17201 ''|0) try='int random_r(int*, struct random_data*);'
17202 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17204 case "$random_r_proto" in
17205 ''|0) try='int random_r(long*, struct random_data*);'
17206 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17208 case "$random_r_proto" in
17209 ''|0) try='int random_r(struct random_data*, int32_t*);'
17210 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17212 case "$random_r_proto" in
17213 ''|0) d_random_r=undef
17215 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17216 * ) case "$random_r_proto" in
17217 REENTRANT_PROTO*) ;;
17218 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17220 echo "Prototype: $try" ;;
17223 *) case "$usethreads" in
17224 define) echo "random_r has no prototype, not using it." >&4 ;;
17231 *) random_r_proto=0
17235 : see if readdir and friends exist
17236 set readdir d_readdir
17238 set seekdir d_seekdir
17240 set telldir d_telldir
17242 set rewinddir d_rewinddir
17245 : see if readdir64_r exists
17246 set readdir64_r d_readdir64_r
17248 case "$d_readdir64_r" in
17250 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17251 case "$d_readdir64_r_proto:$usethreads" in
17252 ":define") d_readdir64_r_proto=define
17253 set d_readdir64_r_proto readdir64_r $hdrs
17257 case "$d_readdir64_r_proto" in
17259 case "$readdir64_r_proto" in
17260 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17261 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17263 case "$readdir64_r_proto" in
17264 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17265 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17267 case "$readdir64_r_proto" in
17268 ''|0) d_readdir64_r=undef
17269 readdir64_r_proto=0
17270 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17271 * ) case "$readdir64_r_proto" in
17272 REENTRANT_PROTO*) ;;
17273 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17275 echo "Prototype: $try" ;;
17278 *) case "$usethreads" in
17279 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17281 d_readdir64_r=undef
17282 readdir64_r_proto=0
17286 *) readdir64_r_proto=0
17290 : see if readdir_r exists
17291 set readdir_r d_readdir_r
17293 case "$d_readdir_r" in
17295 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17296 case "$d_readdir_r_proto:$usethreads" in
17297 ":define") d_readdir_r_proto=define
17298 set d_readdir_r_proto readdir_r $hdrs
17302 case "$d_readdir_r_proto" in
17304 case "$readdir_r_proto" in
17305 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17306 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17308 case "$readdir_r_proto" in
17309 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17310 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17312 case "$readdir_r_proto" in
17313 ''|0) d_readdir_r=undef
17315 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17316 * ) case "$readdir_r_proto" in
17317 REENTRANT_PROTO*) ;;
17318 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17320 echo "Prototype: $try" ;;
17323 *) case "$usethreads" in
17324 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17331 *) readdir_r_proto=0
17335 : see if readv exists
17339 : see if recvmsg exists
17340 set recvmsg d_recvmsg
17343 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17345 if set regcomp val -f d_regcomp; eval $csym; $val; then
17346 echo 'regcomp() found.' >&4
17347 d_regcomp="$define"
17350 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17351 echo 'regcmp() found.' >&4
17355 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17356 echo 're_comp() found, assuming re_exec() also exists.' >&4
17357 d_re_comp="$define"
17362 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17369 : see if remainder exists
17370 set remainder d_remainder
17373 : see if remquo exists
17374 set remquo d_remquo
17377 : see if rename exists
17378 set rename d_rename
17381 : see if rint exists
17385 : see if rmdir exists
17389 : see if round exists
17393 : see if prototype for sbrk is available
17395 set d_sbrkproto sbrk $i_unistd unistd.h
17398 : see if scalbn exists
17399 set scalbn d_scalbn
17402 : see if select exists
17403 set select d_select
17406 : see if semctl exists
17407 set semctl d_semctl
17410 : see if semget exists
17411 set semget d_semget
17414 : see if semop exists
17418 : see how much of the 'sem*(2)' library is present.
17421 case "$d_semctl$d_semget$d_semop" in
17422 *"$undef"*) h_sem=false;;
17426 case "`ipcs 2>&1`" in
17427 "SVID messages"*"not configured"*)
17428 echo "Your $osname does not have the sem*(2) configured." >&4
17431 set semctl d_semctl
17433 set semget d_semget
17441 : we could also check for sys/ipc.h ...
17442 if $h_sem && $test `./findhdr sys/sem.h`; then
17443 echo "You have the full sem*(2) library." >&4
17446 echo "You don't have the full sem*(2) library." >&4
17452 : see whether sys/sem.h defines union semun
17454 $cat > try.c <<'END'
17455 #include <sys/types.h>
17456 #include <sys/ipc.h>
17457 #include <sys/sem.h>
17458 int main () { union semun semun; semun.buf = 0; }
17461 if eval $compile; then
17462 echo "You have union semun in <sys/sem.h>." >&4
17465 echo "You do not have union semun in <sys/sem.h>." >&4
17472 : see how to do semctl IPC_STAT
17476 $cat > tryh.h <<END
17479 # define S_IRUSR S_IREAD
17480 # define S_IWUSR S_IWRITE
17481 # define S_IXUSR S_IEXEC
17483 # define S_IRUSR 0400
17484 # define S_IWUSR 0200
17485 # define S_IXUSR 0100
17487 # define S_IRGRP (S_IRUSR>>3)
17488 # define S_IWGRP (S_IWUSR>>3)
17489 # define S_IXGRP (S_IXUSR>>3)
17490 # define S_IROTH (S_IRUSR>>6)
17491 # define S_IWOTH (S_IWUSR>>6)
17492 # define S_IXOTH (S_IXUSR>>6)
17495 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17496 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17497 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17500 : see whether semctl IPC_STAT can use union semun
17501 case "$d_semctl_semun" in
17505 #include <sys/types.h>
17506 #include <sys/ipc.h>
17507 #include <sys/sem.h>
17508 #include <sys/stat.h>
17515 #$d_union_semun HAS_UNION_SEMUN
17518 #ifndef HAS_UNION_SEMUN
17521 struct semid_ds *buf;
17522 unsigned short *array;
17528 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17529 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17531 struct semid_ds argbuf;
17534 st = semctl(sem, 0, IPC_STAT, arg);
17538 # endif /* IPC_STAT */
17539 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17541 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17542 # endif /* IPC_RMID */
17543 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17545 #endif /* IPC_PRIVATE && ... */
17546 printf("semget failed: errno = %d\n", errno);
17551 if eval $compile; then
17554 semun) val="$define" ;;
17562 case "$d_semctl_semun" in
17564 echo "You can use union semun for semctl IPC_STAT." >&4
17567 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17572 : see whether semctl IPC_STAT can use struct semid_ds pointer
17573 case "$d_semctl_semid_ds" in
17576 $cat > try.c <<'END'
17577 #include <sys/types.h>
17578 #include <sys/ipc.h>
17579 #include <sys/sem.h>
17580 #include <sys/stat.h>
17589 #ifndef HAS_UNION_SEMUN
17592 struct semid_ds *buf;
17593 unsigned short *array;
17597 struct semid_ds argbuf;
17600 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17601 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17605 st = semctl(sem, 0, IPC_STAT, arg);
17607 printf("semid_ds\n");
17609 # endif /* IPC_STAT */
17610 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17612 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17613 # endif /* IPC_RMID */
17614 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17616 #endif /* IPC_PRIVATE && ... */
17617 printf("semget failed: errno = %d\n", errno);
17623 if eval $compile; then
17626 semid_ds) val="$define" ;;
17630 set d_semctl_semid_ds
17634 case "$d_semctl_semid_ds" in
17636 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17638 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17644 # We do not have the full sem*(2) library, so assume we can not
17650 set d_semctl_semid_ds
17656 : see if sendmsg exists
17657 set sendmsg d_sendmsg
17660 : see if setegid exists
17661 set setegid d_setegid
17664 : see if seteuid exists
17665 set seteuid d_seteuid
17668 : see if setgrent exists
17669 set setgrent d_setgrent
17672 : see if setgrent_r exists
17673 set setgrent_r d_setgrent_r
17675 case "$d_setgrent_r" in
17677 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17678 case "$d_setgrent_r_proto:$usethreads" in
17679 ":define") d_setgrent_r_proto=define
17680 set d_setgrent_r_proto setgrent_r $hdrs
17684 case "$d_setgrent_r_proto" in
17686 case "$setgrent_r_proto" in
17687 ''|0) try='int setgrent_r(FILE**);'
17688 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17690 case "$setgrent_r_proto" in
17691 ''|0) try='void setgrent_r(FILE**);'
17692 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17694 case "$setgrent_r_proto" in
17695 ''|0) d_setgrent_r=undef
17697 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17698 * ) case "$setgrent_r_proto" in
17699 REENTRANT_PROTO*) ;;
17700 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17702 echo "Prototype: $try" ;;
17705 *) case "$usethreads" in
17706 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17713 *) setgrent_r_proto=0
17717 : see if sethostent exists
17718 set sethostent d_sethent
17721 : see if sethostent_r exists
17722 set sethostent_r d_sethostent_r
17724 case "$d_sethostent_r" in
17726 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17727 case "$d_sethostent_r_proto:$usethreads" in
17728 ":define") d_sethostent_r_proto=define
17729 set d_sethostent_r_proto sethostent_r $hdrs
17733 case "$d_sethostent_r_proto" in
17735 case "$sethostent_r_proto" in
17736 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17737 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17739 case "$sethostent_r_proto" in
17740 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17741 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17743 case "$sethostent_r_proto" in
17744 ''|0) d_sethostent_r=undef
17745 sethostent_r_proto=0
17746 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17747 * ) case "$sethostent_r_proto" in
17748 REENTRANT_PROTO*) ;;
17749 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17751 echo "Prototype: $try" ;;
17754 *) case "$usethreads" in
17755 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17757 d_sethostent_r=undef
17758 sethostent_r_proto=0
17762 *) sethostent_r_proto=0
17766 : see if setitimer exists
17767 set setitimer d_setitimer
17770 : see if setlinebuf exists
17771 set setlinebuf d_setlinebuf
17774 : see if setlocale exists
17775 set setlocale d_setlocale
17778 : see if locale.h is available
17779 set locale.h i_locale
17782 : see if setlocale_r exists
17783 set setlocale_r d_setlocale_r
17785 case "$d_setlocale_r" in
17787 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17788 case "$d_setlocale_r_proto:$usethreads" in
17789 ":define") d_setlocale_r_proto=define
17790 set d_setlocale_r_proto setlocale_r $hdrs
17794 case "$d_setlocale_r_proto" in
17796 case "$setlocale_r_proto" in
17797 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17798 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17800 case "$setlocale_r_proto" in
17801 ''|0) d_setlocale_r=undef
17802 setlocale_r_proto=0
17803 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17804 * ) case "$setlocale_r_proto" in
17805 REENTRANT_PROTO*) ;;
17806 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17808 echo "Prototype: $try" ;;
17811 *) case "$usethreads" in
17812 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17814 d_setlocale_r=undef
17815 setlocale_r_proto=0
17819 *) setlocale_r_proto=0
17823 : see if setnetent exists
17824 set setnetent d_setnent
17827 : see if setnetent_r exists
17828 set setnetent_r d_setnetent_r
17830 case "$d_setnetent_r" in
17832 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17833 case "$d_setnetent_r_proto:$usethreads" in
17834 ":define") d_setnetent_r_proto=define
17835 set d_setnetent_r_proto setnetent_r $hdrs
17839 case "$d_setnetent_r_proto" in
17841 case "$setnetent_r_proto" in
17842 ''|0) try='int setnetent_r(int, struct netent_data*);'
17843 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17845 case "$setnetent_r_proto" in
17846 ''|0) try='void setnetent_r(int, struct netent_data*);'
17847 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17849 case "$setnetent_r_proto" in
17850 ''|0) d_setnetent_r=undef
17851 setnetent_r_proto=0
17852 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17853 * ) case "$setnetent_r_proto" in
17854 REENTRANT_PROTO*) ;;
17855 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17857 echo "Prototype: $try" ;;
17860 *) case "$usethreads" in
17861 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17863 d_setnetent_r=undef
17864 setnetent_r_proto=0
17868 *) setnetent_r_proto=0
17872 : see if setprotoent exists
17873 set setprotoent d_setpent
17876 : see if setpgid exists
17877 set setpgid d_setpgid
17880 : see if setpgrp2 exists
17881 set setpgrp2 d_setpgrp2
17884 : see if setpriority exists
17885 set setpriority d_setprior
17888 : see if setproctitle exists
17889 set setproctitle d_setproctitle
17892 : see if setprotoent_r exists
17893 set setprotoent_r d_setprotoent_r
17895 case "$d_setprotoent_r" in
17897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17898 case "$d_setprotoent_r_proto:$usethreads" in
17899 ":define") d_setprotoent_r_proto=define
17900 set d_setprotoent_r_proto setprotoent_r $hdrs
17904 case "$d_setprotoent_r_proto" in
17906 case "$setprotoent_r_proto" in
17907 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17908 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17910 case "$setprotoent_r_proto" in
17911 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17912 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17914 case "$setprotoent_r_proto" in
17915 ''|0) d_setprotoent_r=undef
17916 setprotoent_r_proto=0
17917 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17918 * ) case "$setprotoent_r_proto" in
17919 REENTRANT_PROTO*) ;;
17920 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17922 echo "Prototype: $try" ;;
17925 *) case "$usethreads" in
17926 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17928 d_setprotoent_r=undef
17929 setprotoent_r_proto=0
17933 *) setprotoent_r_proto=0
17937 : see if setpwent exists
17938 set setpwent d_setpwent
17941 : see if setpwent_r exists
17942 set setpwent_r d_setpwent_r
17944 case "$d_setpwent_r" in
17946 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17947 case "$d_setpwent_r_proto:$usethreads" in
17948 ":define") d_setpwent_r_proto=define
17949 set d_setpwent_r_proto setpwent_r $hdrs
17953 case "$d_setpwent_r_proto" in
17955 case "$setpwent_r_proto" in
17956 ''|0) try='int setpwent_r(FILE**);'
17957 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17959 case "$setpwent_r_proto" in
17960 ''|0) try='void setpwent_r(FILE**);'
17961 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17963 case "$setpwent_r_proto" in
17964 ''|0) d_setpwent_r=undef
17966 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17967 * ) case "$setpwent_r_proto" in
17968 REENTRANT_PROTO*) ;;
17969 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17971 echo "Prototype: $try" ;;
17974 *) case "$usethreads" in
17975 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17982 *) setpwent_r_proto=0
17986 : see if setregid exists
17987 set setregid d_setregid
17989 set setresgid d_setresgid
17992 : see if setreuid exists
17993 set setreuid d_setreuid
17995 set setresuid d_setresuid
17998 : see if setrgid exists
17999 set setrgid d_setrgid
18002 : see if setruid exists
18003 set setruid d_setruid
18006 : see if setservent exists
18007 set setservent d_setsent
18010 : see if setservent_r exists
18011 set setservent_r d_setservent_r
18013 case "$d_setservent_r" in
18015 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18016 case "$d_setservent_r_proto:$usethreads" in
18017 ":define") d_setservent_r_proto=define
18018 set d_setservent_r_proto setservent_r $hdrs
18022 case "$d_setservent_r_proto" in
18024 case "$setservent_r_proto" in
18025 ''|0) try='int setservent_r(int, struct servent_data*);'
18026 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18028 case "$setservent_r_proto" in
18029 ''|0) try='void setservent_r(int, struct servent_data*);'
18030 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18032 case "$setservent_r_proto" in
18033 ''|0) d_setservent_r=undef
18034 setservent_r_proto=0
18035 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18036 * ) case "$setservent_r_proto" in
18037 REENTRANT_PROTO*) ;;
18038 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18040 echo "Prototype: $try" ;;
18043 *) case "$usethreads" in
18044 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18046 d_setservent_r=undef
18047 setservent_r_proto=0
18051 *) setservent_r_proto=0
18055 : see if setsid exists
18056 set setsid d_setsid
18059 : see if setvbuf exists
18060 set setvbuf d_setvbuf
18063 : see if shmctl exists
18064 set shmctl d_shmctl
18067 : see if shmget exists
18068 set shmget d_shmget
18071 : see if shmat exists
18074 : see what shmat returns
18077 $cat >shmat.c <<'END'
18078 #include <sys/shm.h>
18081 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18086 echo "and it returns ($shmattype)." >&4
18087 : see if a prototype for shmat is available
18088 xxx=`./findhdr sys/shm.h`
18089 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18090 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18101 set d_shmatprototype
18104 : see if shmdt exists
18108 : see how much of the 'shm*(2)' library is present.
18111 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18112 *"$undef"*) h_shm=false;;
18116 case "`ipcs 2>&1`" in
18117 "SVID shared memory"*"not configured"*)
18118 echo "Your $osname does not have the shm*(2) configured." >&4
18121 set shmctl d_shmctl
18123 set shmget d_shmget
18133 : we could also check for sys/ipc.h ...
18134 if $h_shm && $test `./findhdr sys/shm.h`; then
18135 echo "You have the full shm*(2) library." >&4
18138 echo "You don't have the full shm*(2) library." >&4
18144 : see if we have sigaction
18146 if set sigaction val -f d_sigaction; eval $csym; $val; then
18147 echo 'sigaction() found.' >&4
18150 #include <sys/types.h>
18151 #include <signal.h>
18152 #$i_stdlib I_STDLIB
18154 #include <stdlib.h>
18158 struct sigaction act, oact;
18160 oact.sa_handler = 0;
18161 /* so that act and oact are used */
18162 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18166 if eval $compile_ok; then
18169 echo "But you don't seem to have a usable struct sigaction." >&4
18173 echo 'sigaction NOT found.' >&4
18176 set d_sigaction; eval $setvar
18179 : see what type pids are declared as in the kernel
18180 rp="What is the type of process ids on this system?"
18181 set pid_t pidtype int stdio.h sys/types.h
18184 : see what type uids are declared as in the kernel
18186 echo "Looking for the type for user ids returned by getuid()."
18187 set uid_t uidtype xxx stdio.h sys/types.h
18191 xxx=`./findhdr sys/user.h`
18192 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18194 unsigned) dflt="$1 $2" ;;
18198 *) dflt="$uidtype";;
18201 uid_t) echo "uid_t found." ;;
18202 *) rp="What is the type for user ids returned by getuid()?"
18208 : Define hasfield_t macro for Configure internal use
18209 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18210 while $test $# -ge 2; do
18212 $define) echo "#include <$2>";;
18216 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18218 if eval $compile; then
18227 : see what siginfo fields we have
18228 case "$d_sigaction" in
18230 echo "Checking if your siginfo_t has si_errno field...">&4
18231 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18234 echo "Checking if your siginfo_t has si_pid field...">&4
18235 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18238 echo "Checking if your siginfo_t has si_uid field...">&4
18239 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18242 echo "Checking if your siginfo_t has si_addr field...">&4
18243 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18246 echo "Checking if your siginfo_t has si_status field...">&4
18247 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18250 echo "Checking if your siginfo_t has si_band field...">&4
18251 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18254 echo "Checking if your siginfo_t has si_value field...">&4
18255 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18258 echo "Checking if your siginfo_t has si_fd field...">&4
18259 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18264 d_siginfo_si_errno="$undef"
18265 d_siginfo_si_pid="$undef"
18266 d_siginfo_si_uid="$undef"
18267 d_siginfo_si_addr="$undef"
18268 d_siginfo_si_status="$undef"
18269 d_siginfo_si_band="$undef"
18270 d_siginfo_si_value="$undef"
18271 d_siginfo_si_fd="$undef"
18275 : see if this is a sunmath.h system
18276 set sunmath.h i_sunmath
18279 : see if signbit exists
18280 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18282 #$i_sunmath I_SUNMATH
18284 #ifdef I_SUNMATH /* Solaris special math library */
18285 # include <sunmath.h>
18288 int main(int argc, char **argv)
18292 if ((signbit(x) == 0) && (signbit(y) != 0))
18300 if eval $compile; then
18301 if $run ./try; then
18305 $echo "Signbit seems to be available, but doesn't work as I expected."
18306 $echo "I won't use it." >&4
18317 : see if sigprocmask exists
18318 set sigprocmask d_sigprocmask
18321 : see if sigsetjmp exists
18323 case "$d_sigsetjmp" in
18326 #include <setjmp.h>
18327 #$i_stdlib I_STDLIB
18329 #include <stdlib.h>
18335 if (sigsetjmp(env,1))
18338 siglongjmp(env, 1);
18343 if eval $compile; then
18344 if $run ./try >/dev/null 2>&1; then
18345 echo "POSIX sigsetjmp found." >&4
18349 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18355 echo "sigsetjmp not found." >&4
18359 *) val="$d_sigsetjmp"
18360 case "$d_sigsetjmp" in
18361 $define) echo "POSIX sigsetjmp found." >&4;;
18362 $undef) echo "sigsetjmp not found." >&4;;
18370 : see if snprintf exists
18371 set snprintf d_snprintf
18374 : see if vsnprintf exists
18375 set vsnprintf d_vsnprintf
18378 case "$d_snprintf-$d_vsnprintf" in
18381 Checking whether your snprintf() and vsnprintf() work okay...
18383 $cat >try.c <<'EOCP'
18384 /* v?snprintf testing logic courtesy of Russ Allbery.
18385 * According to C99:
18386 * - if the buffer is too short it still must be \0-terminated
18387 * - if the buffer is too short the potentially required length
18388 * must be returned and not -1
18389 * - if the buffer is NULL the potentially required length
18390 * must be returned and not -1 or core dump
18393 #include <stdarg.h>
18397 int test (char *format, ...)
18402 va_start (args, format);
18403 count = vsnprintf (buf, sizeof buf, format, args);
18410 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18411 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18415 if eval $compile; then
18418 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18420 Your snprintf() and snprintf() don't seem to be working okay.
18422 d_snprintf="$undef"
18423 d_vsnprintf="$undef"
18427 echo "(I can't seem to compile the test program--assuming they don't)"
18428 d_snprintf="$undef"
18429 d_vsnprintf="$undef"
18435 : see if sockatmark exists
18436 set sockatmark d_sockatmark
18439 : see if prototype for sockatmark is available
18441 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18444 : see if socks5_init exists
18445 set socks5_init d_socks5_init
18448 : see if srand48_r exists
18449 set srand48_r d_srand48_r
18451 case "$d_srand48_r" in
18453 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18454 case "$d_srand48_r_proto:$usethreads" in
18455 ":define") d_srand48_r_proto=define
18456 set d_srand48_r_proto srand48_r $hdrs
18460 case "$d_srand48_r_proto" in
18462 case "$srand48_r_proto" in
18463 ''|0) try='int srand48_r(long, struct drand48_data*);'
18464 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18466 case "$srand48_r_proto" in
18467 ''|0) d_srand48_r=undef
18469 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18470 * ) case "$srand48_r_proto" in
18471 REENTRANT_PROTO*) ;;
18472 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18474 echo "Prototype: $try" ;;
18477 *) case "$usethreads" in
18478 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18485 *) srand48_r_proto=0
18489 : see if srandom_r exists
18490 set srandom_r d_srandom_r
18492 case "$d_srandom_r" in
18494 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18495 case "$d_srandom_r_proto:$usethreads" in
18496 ":define") d_srandom_r_proto=define
18497 set d_srandom_r_proto srandom_r $hdrs
18501 case "$d_srandom_r_proto" in
18503 case "$srandom_r_proto" in
18504 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18505 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18507 case "$srandom_r_proto" in
18508 ''|0) d_srandom_r=undef
18510 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18511 * ) case "$srandom_r_proto" in
18512 REENTRANT_PROTO*) ;;
18513 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18515 echo "Prototype: $try" ;;
18518 *) case "$usethreads" in
18519 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18526 *) srandom_r_proto=0
18530 : see if prototype for setresgid is available
18532 set d_sresgproto setresgid $i_unistd unistd.h
18535 : see if prototype for setresuid is available
18537 set d_sresuproto setresuid $i_unistd unistd.h
18540 : see if stat exists
18544 : see if sys/stat.h is available
18545 set sys/stat.h i_sysstat
18548 : see if stat knows about block sizes
18550 echo "Checking to see if your struct stat has st_blocks field..." >&4
18551 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18554 : see if this is a sys/vfs.h system
18555 set sys/vfs.h i_sysvfs
18558 : see if this is a sys/statfs.h system
18559 set sys/statfs.h i_sysstatfs
18562 : Check for statfs_s
18564 echo "Checking to see if your system supports struct statfs..." >&4
18565 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
18567 case "$d_statfs_s" in
18568 "$define") echo "Yes, it does." ;;
18569 *) echo "No, it doesn't." ;;
18572 : see if struct statfs knows about f_flags
18573 case "$d_statfs_s" in
18576 echo "Checking to see if your struct statfs has f_flags field..." >&4
18577 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
18581 set d_statfs_f_flags
18585 case "$d_statfs_f_flags" in
18586 "$define") echo "Yes, it does." ;;
18587 *) echo "No, it doesn't." ;;
18590 : see what flavor, if any, of static inline is supported
18592 echo "Checking to see if your system supports static inline..."
18593 $cat > try.c <<'EOCP'
18594 #include <stdlib.h>
18595 extern int f_via_a(int x);
18596 extern int f_via_b(int x);
18597 int main(int argc, char **argv)
18606 return EXIT_SUCCESS;
18609 return EXIT_FAILURE;
18613 $cat > a.c <<'EOCP'
18614 static INLINE int f(int x) {
18625 $cat > b.c <<'EOCP'
18626 extern int f(int x);
18634 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18635 case "$perl_static_inline" in
18636 '') # Check the various possibilities, and break out on success.
18637 # For gcc, prefer __inline__, which will still permit
18638 # cflags.SH to add in -ansi.
18639 case "$gccversion" in
18640 '') xxx="inline __inline__ __inline _inline";;
18641 *) xxx="__inline__ inline __inline _inline";;
18643 for inline in $xxx; do
18644 set try -DINLINE=$inline a.c
18645 if eval $compile && $run ./try; then
18646 # Now make sure there is no external linkage of static
18648 set try -DINLINE=$inline -DUSE_B a.c b.c
18649 if eval $compile && $run ./try; then
18650 $echo "Your compiler supports static $inline, " >&4
18651 $echo "but it also creates an external definition," >&4
18652 $echo "so I won't use it." >&4
18655 $echo "Your compiler supports static $inline." >&4
18657 perl_static_inline="static $inline";
18661 $echo "Your compiler does NOT support static $inline." >&4
18666 *inline*) # Some variant of inline exists.
18667 echo "Keeping your $hint value of $perl_static_inline."
18670 static) # No inline capabilities
18671 echo "Keeping your $hint value of $perl_static_inline."
18674 *) # Unrecognized previous value -- blindly trust the supplied
18675 # value and hope it makes sense. Use old value for
18676 # d_static_inline, if there is one.
18677 echo "Keeping your $hint value of $perl_static_inline."
18678 case "$d_static_inline" in
18680 *) val=$d_static_inline ;;
18684 # Fallback to plain 'static' if nothing worked.
18685 case "$perl_static_inline" in
18687 perl_static_inline="static"
18691 set d_static_inline
18693 $rm -f a.[co] b.[co]
18696 : Check stream access
18698 Checking how to access stdio streams by file descriptor number...
18700 case "$stdio_stream_array" in
18701 '') $cat >try.c <<EOCP
18704 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18708 for s in _iob __iob __sF
18710 set try -DSTDIO_STREAM_ARRAY=$s
18711 if eval $compile; then
18712 case "`$run ./try`" in
18713 yes) stdio_stream_array=$s; break ;;
18719 case "$stdio_stream_array" in
18721 I can't figure out how to access stdio streams by file descriptor number.
18723 d_stdio_stream_array="$undef"
18726 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18728 d_stdio_stream_array="$define"
18732 : see if strcoll exists
18733 set strcoll d_strcoll
18736 : see if strerror_l exists
18737 set strerror_l d_strerror_l
18740 : see if strerror_r exists
18741 set strerror_r d_strerror_r
18743 case "$d_strerror_r" in
18745 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18746 case "$d_strerror_r_proto:$usethreads" in
18747 ":define") d_strerror_r_proto=define
18748 set d_strerror_r_proto strerror_r $hdrs
18752 case "$d_strerror_r_proto" in
18754 case "$strerror_r_proto" in
18755 ''|0) try='int strerror_r(int, char*, size_t);'
18756 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18758 case "$strerror_r_proto" in
18759 ''|0) try='int strerror_r(int, char*, int);'
18760 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18762 case "$strerror_r_proto" in
18763 ''|0) try='char* strerror_r(int, char*, size_t);'
18764 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18766 case "$strerror_r_proto" in
18767 ''|0) d_strerror_r=undef
18769 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18770 * ) case "$strerror_r_proto" in
18771 REENTRANT_PROTO*) ;;
18772 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18774 echo "Prototype: $try" ;;
18777 *) case "$usethreads" in
18778 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18785 *) strerror_r_proto=0
18789 : see if strftime exists
18790 set strftime d_strftime
18793 : see if strlcat exists
18794 set strlcat d_strlcat
18797 : see if strlcpy exists
18798 set strlcpy d_strlcpy
18801 : see if strnlen exists
18802 set strnlen d_strnlen
18805 : see if strtod exists
18806 set strtod d_strtod
18809 : see if strtod_l exists
18810 set strtod_l d_strtod_l
18813 : see if strtol exists
18814 set strtol d_strtol
18817 : see if strtold exists
18818 set strtold d_strtold
18821 : see if strtold_l exists
18822 set strtold_l d_strtold_l
18825 : see if strtoll exists
18826 set strtoll d_strtoll
18829 case "$d_longlong-$d_strtoll" in
18832 Checking whether your strtoll() works okay...
18834 $cat >try.c <<'EOCP'
18837 #define strtoll __strtoll
18840 #define strtoll _strtoll
18843 extern long long int strtoll(char *s, char **, int);
18844 static int bad = 0;
18845 int check(char *s, long long ell, int een) {
18848 gll = strtoll(s, 0, 10);
18849 if (!((gll == ell) && (errno == een)))
18853 check(" 1", 1LL, 0);
18854 check(" 0", 0LL, 0);
18855 check("-1", -1LL, 0);
18856 check("-9223372036854775808", -9223372036854775808LL, 0);
18857 check("-9223372036854775808", -9223372036854775808LL, 0);
18858 check(" 9223372036854775807", 9223372036854775807LL, 0);
18859 check("-9223372036854775808", -9223372036854775808LL, 0);
18860 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18861 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18867 if eval $compile; then
18870 ok) echo "Your strtoll() seems to be working okay." ;;
18872 Your strtoll() doesn't seem to be working okay.
18878 echo "(I can't seem to compile the test program--assuming it doesn't)"
18884 : see if strtoq exists
18885 set strtoq d_strtoq
18888 : see if strtoul exists
18889 set strtoul d_strtoul
18892 case "$d_strtoul" in
18895 Checking whether your strtoul() works okay...
18897 $cat >try.c <<'EOCP'
18900 extern unsigned long int strtoul(char *s, char **, int);
18901 static int bad = 0;
18902 void check(char *s, unsigned long eul, int een) {
18905 gul = strtoul(s, 0, 10);
18906 if (!((gul == eul) && (errno == een)))
18910 check(" 1", 1L, 0);
18911 check(" 0", 0L, 0);
18913 case "$longsize" in
18915 $cat >>try.c <<'EOCP'
18916 check("18446744073709551615", 18446744073709551615UL, 0);
18917 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18918 #if 0 /* strtoul() for /^-/ strings is undefined. */
18919 check("-1", 18446744073709551615UL, 0);
18920 check("-18446744073709551614", 2, 0);
18921 check("-18446744073709551615", 1, 0);
18922 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18923 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18928 $cat >>try.c <<'EOCP'
18929 check("4294967295", 4294967295UL, 0);
18930 check("4294967296", 4294967295UL, ERANGE);
18931 #if 0 /* strtoul() for /^-/ strings is undefined. */
18932 check("-1", 4294967295UL, 0);
18933 check("-4294967294", 2, 0);
18934 check("-4294967295", 1, 0);
18935 check("-4294967296", 4294967295UL, ERANGE);
18936 check("-4294967297", 4294967295UL, ERANGE);
18941 : Should we write these tests to be more portable by sprintf-ing
18942 : ~0 and then manipulating that char string as input for strtol?
18945 $cat >>try.c <<'EOCP'
18952 if eval $compile; then
18953 case "`$run ./try`" in
18954 ok) echo "Your strtoul() seems to be working okay." ;;
18956 Your strtoul() doesn't seem to be working okay.
18962 echo "(I can't seem to compile the test program--assuming it doesn't)"
18968 : see if strtoull exists
18969 set strtoull d_strtoull
18972 case "$d_longlong-$d_strtoull" in
18975 Checking whether your strtoull() works okay...
18977 $cat >try.c <<'EOCP'
18980 #define strtoull __strtoull
18983 extern unsigned long long int strtoull(char *s, char **, int);
18984 static int bad = 0;
18985 int check(char *s, long long eull, int een) {
18988 gull = strtoull(s, 0, 10);
18989 if (!((gull == eull) && (errno == een)))
18993 check(" 1", 1LL, 0);
18994 check(" 0", 0LL, 0);
18995 check("18446744073709551615", 18446744073709551615ULL, 0);
18996 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18997 #if 0 /* strtoull() for /^-/ strings is undefined. */
18998 check("-1", 18446744073709551615ULL, 0);
18999 check("-18446744073709551614", 2LL, 0);
19000 check("-18446744073709551615", 1LL, 0);
19001 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19002 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19009 if eval $compile; then
19010 case "`$run ./try`" in
19011 ok) echo "Your strtoull() seems to be working okay." ;;
19013 Your strtoull() doesn't seem to be working okay.
19015 d_strtoull="$undef"
19019 echo "(I can't seem to compile the test program--assuming it doesn't)"
19020 d_strtoull="$undef"
19025 : see if strtouq exists
19026 set strtouq d_strtouq
19029 case "$d_strtouq" in
19032 Checking whether your strtouq() works okay...
19034 $cat >try.c <<'EOCP'
19037 extern unsigned long long int strtouq(char *s, char **, int);
19038 static int bad = 0;
19039 void check(char *s, unsigned long long eull, int een) {
19040 unsigned long long gull;
19042 gull = strtouq(s, 0, 10);
19043 if (!((gull == eull) && (errno == een)))
19047 check(" 1", 1LL, 0);
19048 check(" 0", 0LL, 0);
19049 check("18446744073709551615", 18446744073709551615ULL, 0);
19050 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19051 #if 0 /* strtouq() for /^-/ strings is undefined. */
19052 check("-1", 18446744073709551615ULL, 0);
19053 check("-18446744073709551614", 2LL, 0);
19054 check("-18446744073709551615", 1LL, 0);
19055 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19056 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19064 if eval $compile; then
19065 case "`$run ./try`" in
19066 ok) echo "Your strtouq() seems to be working okay." ;;
19068 Your strtouq() doesn't seem to be working okay.
19074 echo "(I can't seem to compile the test program--assuming it doesn't)"
19080 : see if strxfrm exists
19081 set strxfrm d_strxfrm
19084 : see if symlink exists
19085 set symlink d_symlink
19088 : see if syscall exists
19089 set syscall d_syscall
19092 : see if prototype for syscall is available
19094 set d_syscallproto syscall $i_unistd unistd.h
19097 : see if sysconf exists
19098 set sysconf d_sysconf
19101 : see if sys_errlist[] exists
19103 if test "X$d_syserrlst" = X; then
19104 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19105 echo "You have sys_errlist[], so we could roll our own strerror."
19106 d_syserrlst="$define"
19108 echo "You don't have sys_errlist[], so strerror() is welcome."
19109 d_syserrlst="$undef"
19113 : see if system exists
19114 set system d_system
19117 : see if tcgetpgrp exists
19118 set tcgetpgrp d_tcgetpgrp
19121 : see if tcsetpgrp exists
19122 set tcsetpgrp d_tcsetpgrp
19125 : see if prototype for telldir is available
19127 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19130 : see if tgamma exists
19131 set tgamma d_tgamma
19134 : check for thread_safe_nl_langinfo_l item
19137 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19140 #$i_stdlib I_STDLIB
19142 # include <stdlib.h>
19144 #include <string.h>
19145 #$i_langinfo I_LANGINFO
19147 # include <langinfo.h>
19149 #$i_pthread I_PTHREAD
19151 # include <pthread.h>
19153 #$i_locale I_LOCALE
19155 # include <locale.h>
19159 thread_start(void * arg)
19161 nl_langinfo(RADIXCHAR);
19165 char * main_buffer;
19166 char save_main_buffer[1000];
19167 pthread_t subthread;
19168 pthread_attr_t attr;
19170 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19172 /* If too large for our generous allowance, just assume we don't have
19174 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19178 strcpy(save_main_buffer, main_buffer);
19180 if (pthread_attr_init(&attr) != 0) {
19184 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19188 if (pthread_join(subthread, NULL) != 0) {
19192 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19195 case "$usethreads" in
19198 if eval $compile; then
19199 echo "Your system has nl_langinfo_l()..." >&4
19200 if $run ./try; then
19201 echo "and it is thread-safe (just as I'd hoped)." >&4
19202 d_thread_safe_nl_langinfo_l="$define"
19203 echo "$d_thread_safe_nl_langinfo_l" >&4
19205 echo "but it isn't thread-safe, so we won't use it." >&4
19208 echo "your system does not have nl_langinfo_l()" >&4
19211 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19213 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19214 d_thread_safe_nl_langinfo_l="$undef"
19218 : see if time exists
19220 if test "X$d_time" = X -o X"$timetype" = X; then
19221 if set time val -f d_time; eval $csym; $val; then
19222 echo 'time() found.' >&4
19224 rp="What is the type returned by time() on this system?"
19225 set time_t timetype long stdio.h sys/types.h
19228 echo 'time() not found, hope that will do.' >&4
19236 : see if timegm exists
19237 set timegm d_timegm
19240 : see if this is a sys/times.h system
19241 set sys/times.h i_systimes
19244 : see if times exists
19246 if set times val -f d_times; eval $csym; $val; then
19247 echo 'times() found.' >&4
19250 case "$i_systimes" in
19251 "$define") inc='sys/times.h';;
19253 rp="What is the type returned by times() on this system?"
19254 set clock_t clocktype long stdio.h sys/types.h $inc
19257 echo 'times() NOT found, hope that will do.' >&4
19262 : see if tmpnam_r exists
19263 set tmpnam_r d_tmpnam_r
19265 case "$d_tmpnam_r" in
19267 hdrs="$i_systypes sys/types.h define stdio.h "
19268 case "$d_tmpnam_r_proto:$usethreads" in
19269 ":define") d_tmpnam_r_proto=define
19270 set d_tmpnam_r_proto tmpnam_r $hdrs
19274 case "$d_tmpnam_r_proto" in
19276 case "$tmpnam_r_proto" in
19277 ''|0) try='char* tmpnam_r(char*);'
19278 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19280 case "$tmpnam_r_proto" in
19281 ''|0) d_tmpnam_r=undef
19283 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19284 * ) case "$tmpnam_r_proto" in
19285 REENTRANT_PROTO*) ;;
19286 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19288 echo "Prototype: $try" ;;
19291 *) case "$usethreads" in
19292 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19299 *) tmpnam_r_proto=0
19303 : see if trunc exists
19307 : see if truncate exists
19308 set truncate d_truncate
19311 : see if ttyname_r exists
19312 set ttyname_r d_ttyname_r
19314 case "$d_ttyname_r" in
19316 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19317 case "$d_ttyname_r_proto:$usethreads" in
19318 ":define") d_ttyname_r_proto=define
19319 set d_ttyname_r_proto ttyname_r $hdrs
19323 case "$d_ttyname_r_proto" in
19325 case "$ttyname_r_proto" in
19326 ''|0) try='int ttyname_r(int, char*, size_t);'
19327 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19329 case "$ttyname_r_proto" in
19330 ''|0) try='int ttyname_r(int, char*, int);'
19331 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19333 case "$ttyname_r_proto" in
19334 ''|0) try='char* ttyname_r(int, char*, int);'
19335 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19337 case "$ttyname_r_proto" in
19338 ''|0) d_ttyname_r=undef
19340 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19341 * ) case "$ttyname_r_proto" in
19342 REENTRANT_PROTO*) ;;
19343 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19345 echo "Prototype: $try" ;;
19348 *) case "$usethreads" in
19349 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19356 *) ttyname_r_proto=0
19360 : see if tzname[] exists
19362 if set tzname val -a d_tzname; eval $csym; $val; then
19364 echo 'tzname[] found.' >&4
19367 echo 'tzname[] NOT found.' >&4
19372 : Check if is a multiplatform env
19374 darwin) multiarch="$define" ;;
19376 case "$multiarch" in
19377 ''|[nN]*) multiarch="$undef" ;;
19380 : check for ordering of bytes in a UV
19382 case "$multiarch" in
19385 You seem to be doing a multiarchitecture build,
19386 skipping the byteorder check.
19392 case "$byteorder" in
19395 In the following, larger digits indicate more significance. A big-endian
19396 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19397 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19398 machines may have weird orders like 3412. A Cray will report 87654321,
19399 an Alpha will report 12345678. If the test program works the default is
19401 I'm now running the test program...
19405 #$i_stdlib I_STDLIB
19407 #include <stdlib.h>
19409 #include <sys/types.h>
19410 typedef $uvtype UV;
19420 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19422 u.l = (UV)0x04030201;
19423 for (i = 0; i < $uvsize; i++)
19424 printf("%c", u.c[i]+'0');
19431 if eval $compile && $run ./try > /dev/null; then
19434 [1-4][1-4][1-4][1-4]|12345678|87654321)
19435 echo "(The test program ran ok.)"
19436 echo "byteorder=$dflt"
19439 ????|????????) echo "(The test program ran ok.)" ;;
19440 *) echo "(The test program didn't run right for some reason.)" ;;
19445 (I can't seem to compile the test program. Guessing big-endian...)
19448 case "$xxx_prompt" in
19450 rp="What is the order of bytes in $uvtype?"
19463 : Checking 32bit alignedness
19466 Checking to see whether you can access character data unalignedly...
19468 case "$d_u32align" in
19469 '') $cat >try.c <<EOCP
19471 #$i_stdlib I_STDLIB
19473 #include <stdlib.h>
19475 #define U32 $u32type
19476 #define BYTEORDER 0x$byteorder
19478 #include <signal.h>
19480 $signal_t bletch(int s) { exit(4); }
19483 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19484 volatile U8 buf[8];
19488 if (sizeof(U32) != 4) {
19489 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19496 signal(SIGBUS, bletch);
19508 for (i = 0; i < 4; i++) {
19509 up = (U32*)(buf + i);
19510 if (! ((*up == 1 << (8*i)) || /* big-endian */
19511 (*up == 1 << (8*(3-i))) /* little-endian */
19515 printf("read failed (%x)\n", *up);
19521 for (i = 0; i < 4; i++) {
19522 up = (U32*)(buf + i);
19524 if (*up != 0xBeef) {
19525 printf("write failed (%x)\n", *up);
19539 if eval $compile_ok; then
19540 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19541 $run ./try 2>&1 >/dev/null
19544 You can access character data pretty unalignedly.
19546 d_u32align="$undef"
19549 It seems that you must access character data in an aligned manner.
19551 d_u32align="$define"
19555 rp='Can you access character data at unaligned addresses?'
19559 [yY]*) d_u32align="$undef" ;;
19560 *) d_u32align="$define" ;;
19567 : see if ualarm exists
19568 set ualarm d_ualarm
19571 : see if umask exists
19575 : see if unordered exists
19576 set unordered d_unordered
19579 : see if unsetenv exists
19580 set unsetenv d_unsetenv
19583 : see if usleep exists
19584 set usleep d_usleep
19587 : see if prototype for usleep is available
19589 set d_usleepproto usleep $i_unistd unistd.h
19592 : see if ustat exists
19596 : see if closedir exists
19597 set closedir d_closedir
19600 case "$d_closedir" in
19603 echo "Checking whether closedir() returns a status..." >&4
19605 #$i_dirent I_DIRENT /**/
19606 #$i_sysdir I_SYS_DIR /**/
19607 #$i_sysndir I_SYS_NDIR /**/
19608 #$i_systypes I_SYS_TYPES /**/
19610 #if defined(I_SYS_TYPES)
19611 #include <sys/types.h>
19613 #if defined(I_DIRENT)
19614 #include <dirent.h>
19617 #include <sys/ndir.h>
19620 #include <sys/dir.h>
19624 int main() { return closedir(opendir(".")); }
19627 if eval $compile_ok; then
19628 if $run ./try > /dev/null 2>&1 ; then
19629 echo "Yes, it does."
19632 echo "No, it doesn't."
19636 echo "(I can't seem to compile the test program--assuming it doesn't)"
19644 set d_void_closedir
19648 : see if there is a wait4
19652 : see if waitpid exists
19653 set waitpid d_waitpid
19658 $cat >try.c <<'EOCP'
19664 return (wcscmp (s, s) ? 1 : 0);
19669 if eval $compile; then
19672 0) echo "A working wcscmp() found." >&4
19674 *) echo "wcscmp() found, but it doesn't work" >&4
19678 echo "wcscmp() NOT found." >&4
19684 : see if wcstombs exists
19685 set wcstombs d_wcstombs
19690 $cat >try.c <<'EOCP'
19695 wchar_t dst[4], *src = L" ";
19697 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19702 if eval $compile; then
19705 0) echo "A working wcsxfrm() found." >&4
19707 *) echo "wcsxfrm() found, but it doesn't work" >&4
19711 echo "wcsxfrm() NOT found." >&4
19717 : see if wctomb exists
19718 set wctomb d_wctomb
19721 : see if writev exists
19722 set writev d_writev
19725 : check for alignment requirements
19727 case "$alignbytes" in
19728 '') echo "Checking alignment constraints..." >&4
19737 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19742 if eval $compile_ok; then
19746 echo "(I can't seem to compile the test program...)"
19748 case "$multiarch" in
19750 : The usual safe value is 8, but Darwin with -Duselongdouble
19751 : needs 16. Hence, we will take 8 as a minimum, but allow
19752 : Configure to pick a larger value if needed.
19753 if $test "$dflt" -lt 8; then
19755 echo "Setting alignment to 8 for multiarch support.">&4
19760 *) dflt="$alignbytes"
19763 rp="Doubles must be aligned on a how-many-byte boundary?"
19768 : set the base revision
19771 : length of character in bytes. Is always 1, otherwise it is not C
19772 : This used to be a test using sizeof
19775 : Check for the number of bits in a character
19776 case "$charbits" in
19777 '') echo "Checking how long a character is (in bits)..." >&4
19784 for (c = 1, n = 0; c; c <<= 1, n++) ;
19785 printf ("%d\n", n);
19790 if eval $compile_ok; then
19794 echo "(I can't seem to compile the test program. Guessing...)"
19801 rp="What is the length of a character (in bits)?"
19805 case "$charbits" in
19808 Your system has an unsigned character size of $charbits bits, which
19809 is rather unusual (normally it is 8 bits). Perl likely will not work
19810 correctly on your system, with subtle bugs in various places.
19812 rp='Do you really want to continue?'
19816 [yY]) echo >&4 "Okay, continuing." ;;
19821 : how do we concatenate cpp tokens here?
19823 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19824 $cat >cpp_stuff.c <<'EOCP'
19825 #define RCAT(a,b)a/**/b
19826 #define ACAT(a,b)a ## b
19830 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19831 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19832 echo "Oh! Smells like ANSI's been here." >&4
19833 echo "We can catify or stringify, separately or together!"
19835 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19836 echo "Ah, yes! The good old days!" >&4
19837 echo "However, in the good old days we don't know how to stringify and"
19838 echo "catify at the same time."
19842 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19843 You're going to have to edit the values of CAT[2-5] in config.h...
19845 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19849 : see if this is a db.h system
19855 : Check db version.
19857 echo "Checking Berkeley DB version ..." >&4
19863 #include <sys/types.h>
19865 #$i_stdlib I_STDLIB
19867 #include <stdlib.h>
19870 int main(int argc, char *argv[])
19872 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19873 int Major, Minor, Patch ;
19874 unsigned long Version ;
19875 (void)db_version(&Major, &Minor, &Patch) ;
19877 printf("%d %d %d %d %d %d\n",
19878 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19879 Major, Minor, Patch);
19882 printf("You have Berkeley DB Version 2 or greater.\n");
19884 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19885 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19886 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19887 Major, Minor, Patch) ;
19889 /* check that db.h & libdb are compatible */
19890 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19891 printf("db.h and libdb are incompatible.\n") ;
19895 printf("db.h and libdb are compatible.\n") ;
19897 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19898 + DB_VERSION_PATCH ;
19900 /* needs to be >= 2.3.4 */
19901 if (Version < 2003004) {
19902 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19903 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19909 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19914 printf("You have Berkeley DB Version 1.\n");
19915 exit(0); /* DB version < 2: the coast is clear. */
19917 exit(1); /* <db.h> not Berkeley DB? */
19923 if eval $compile_ok && $run ./try; then
19924 echo 'Looks OK.' >&4
19926 db_version_major=$1
19927 db_version_minor=$2
19928 db_version_patch=$3
19930 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19934 : Remove db from list of libraries to use
19935 echo "Removing unusable -ldb from library list" >&4
19936 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19939 echo "libs = $libs" >&4
19949 : Check the return type needed for hash
19951 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19957 #include <sys/types.h>
19960 #ifndef DB_VERSION_MAJOR
19961 u_int32_t hash_cb (const void* ptr, size_t size)
19968 info.hash = hash_cb;
19972 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19973 if $contains warning try.out >>/dev/null 2>&1 ; then
19976 db_hashtype='u_int32_t'
19979 : XXX Maybe we should just give up here.
19980 db_hashtype=u_int32_t
19982 echo "Help: I can't seem to compile the db test program." >&4
19983 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19986 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19988 *) db_hashtype=u_int32_t
19993 : Check the return type needed for prefix
19995 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20001 #include <sys/types.h>
20004 #ifndef DB_VERSION_MAJOR
20005 size_t prefix_cb (const DBT *key1, const DBT *key2)
20012 info.prefix = prefix_cb;
20016 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20017 if $contains warning try.out >>/dev/null 2>&1 ; then
20018 db_prefixtype='int'
20020 db_prefixtype='size_t'
20023 db_prefixtype='size_t'
20024 : XXX Maybe we should just give up here.
20026 echo "Help: I can't seem to compile the db test program." >&4
20027 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20030 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20032 *) db_prefixtype='size_t'
20036 : Include . in @INC
20039 Historically Perl has provided a final fallback of the current working
20040 directory '.' when searching for a library. This, however, can lead to
20041 problems when a Perl program which loads optional modules is called from
20042 a shared directory. This can lead to executing unexpected code.
20046 # When changing to exclude by default:
20047 case "$default_inc_excludes_dot" in
20048 $undef|false|[nN]*) dflt="n" ;;
20051 # To turn exclude off by default:
20052 #case "$default_inc_excludes_dot" in
20053 # $define|true|[yY]*) dflt="y" ;;
20057 rp='Exclude '.' from @INC by default? '
20060 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20061 *) default_inc_excludes_dot="$define" ;;
20064 : Check what kind of inf/nan your system has
20065 $echo "Checking the kind of infinities and nans you have..." >&4
20066 $echo "(The following tests may crash. That's okay.)" >&4
20068 #define DOUBLESIZE $doublesize
20069 #$d_longdbl HAS_LONG_DOUBLE
20070 #ifdef HAS_LONG_DOUBLE
20071 #define LONG_DOUBLESIZE $longdblsize
20072 #define LONG_DOUBLEKIND $longdblkind
20075 #include <string.h>
20077 /* Note that whether the sign bit is on or off
20078 * for NaN depends on the CPU/FPU, and possibly
20079 * can be affected by the build toolchain.
20081 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20082 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20083 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20084 * (respectively) as opposed to the more usual
20085 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20087 * Pre-IEEE-754 floating point format do not even have inf/nan support
20088 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20089 * to even mention, causing immediate SIGFPE or equivalent: this is
20090 * the case with VAX floating point, for example.
20092 static void bytes(void *v, unsigned int n) {
20093 unsigned char *p = (unsigned char *)v;
20095 for (i = 0; i < n; i++) {
20096 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20099 int main(int argc, char *argv[]) {
20100 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20101 * because some compilers are 'smart' and not only warn but refuse to
20102 * compile such 'illegal' values. */
20103 double dinf = exp(1e9);
20104 double dnan = sqrt(-1.0);
20105 #ifdef HAS_LONG_DOUBLE
20106 long double ldinf = (long double)exp(1e9);
20107 long double ldnan = (long double)sqrt(-1.0);
20108 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20109 /* the 80-bit long doubles might have garbage in their excess bytes */
20110 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20111 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20114 switch (argv[1][0]) {
20115 case '1': bytes(&dinf, sizeof(dinf)); break;
20116 case '2': bytes(&dnan, sizeof(dnan)); break;
20117 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20118 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20126 if eval $compile; then
20127 doubleinfbytes=`$run ./try 1`
20128 doublenanbytes=`$run ./try 2`
20129 case "$d_longdbl" in
20131 longdblinfbytes=`$run ./try 3`
20132 longdblnanbytes=`$run ./try 4`
20136 # Defaults in case the above test program failed.
20137 case "$doublekind" in
20138 1) # IEEE 754 32-bit LE
20139 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20140 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20142 2) # IEEE 754 32-bit BE
20143 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20144 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20146 3) # IEEE 754 64-bit LE
20147 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20148 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20150 4) # IEEE 754 64-bit BE
20151 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20152 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20154 5) # IEEE 754 128-bit LE
20155 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20156 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20158 6) # IEEE 754 128-bit BE
20159 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20160 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20162 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20163 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20164 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20166 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20167 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20168 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20170 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20171 doubleinfbytes=$undef
20172 doublenanbytes=$undef
20175 doubleinfbytes=$undef
20176 doublenanbytes=$undef
20179 case "$longdblkind" in
20180 1) # IEEE 754 128-bit LE
20181 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20182 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20184 2) # IEEE 754 128-bit BE
20185 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20186 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20188 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20189 case "$longdblsize" in
20190 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20191 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20192 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20195 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20196 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20199 longdblinfbytes=$undef
20200 longdblnanbytes=$undef
20204 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20205 case "$longdblsize" in
20206 12) # 32-bit system
20207 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20208 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20210 16) # 64-bit system
20211 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20212 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20215 longdblinfbytes=$undef
20216 longdblnanbytes=$undef
20220 5) # 128-bit LE-LE "double double"
20221 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20222 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20224 6) # 128-bit BE-BE "double double"
20225 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20226 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20228 7) # 128-bit LE-BE "double double"
20229 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20230 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20232 8) # 128-bit BE-LE "double double"
20233 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20234 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20236 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20237 longdblinfbytes=$undef
20238 longdblnanbytes=$undef
20241 longdblinfbytes=$undef
20242 longdblnanbytes=$undef
20246 # In case the program crashed the values are empty, turn them undef.
20247 case "$doubleinfbytes" in
20248 '') doubleinfbytes=$undef ;;
20250 case "$doublenanbytes" in
20251 '') doublenanbytes=$undef ;;
20253 case "$longdblinfbytes" in
20254 '') longdblinfbytes=$undef ;;
20256 case "$longdblnanbytes" in
20257 '') longdblnanbytes=$undef ;;
20261 : Check the length of the double mantissa
20262 $echo "Checking how many mantissa bits your doubles have..." >&4
20264 #$i_sunmath I_SUNMATH
20267 # include <sunmath.h>
20269 #ifdef DBL_MANT_DIG
20270 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20273 int main(int argc, char *argv[]) {
20275 printf("%d\n", BITS);
20281 if eval $compile; then
20282 doublemantbits=`$run ./try`
20284 doublemantbits="$undef"
20288 : Check the length of the longdouble mantissa
20289 $echo "Checking how many mantissa bits your long doubles have..." >&4
20291 #$i_sunmath I_SUNMATH
20294 # include <sunmath.h>
20296 #$d_longdbl HAS_LONG_DOUBLE
20297 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20298 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20299 /* This format has no implicit bit. Beware, however, that for
20300 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20301 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20302 * and the top bit must have been one since 387, zero is plain invalid.
20303 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20304 # define BITS LDBL_MANT_DIG
20305 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20306 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20307 * reason e.g. Irix thinks 107. But in any case, we want only
20308 * the number of real bits, the implicit bits are of no interest. */
20309 # define BITS 2 * (DBL_MANT_DIG - 1)
20311 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20315 int main(int argc, char *argv[]) {
20317 printf("%d\n", BITS);
20323 if eval $compile; then
20324 longdblmantbits=`$run ./try`
20326 longdblmantbits="$undef"
20330 : Check the length of the NV mantissa
20331 $echo "Checking how many mantissa bits your NVs have..." >&4
20332 if test "X$usequadmath" = "X$define"; then
20333 nvmantbits=112 # 128-1-15
20335 if test "X$nvsize" = "X$doublesize"; then
20336 nvmantbits="$doublemantbits"
20338 if test "X$nvsize" = "X$longdblsize"; then
20339 nvmantbits="$longdblmantbits"
20341 nvmantbits="$undef"
20346 : How can we generate normalized random numbers ?
20348 echo "Using our internal random number implementation..." >&4
20351 *-Dmy_rand=*|*-Dmy_srand=*)
20352 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20353 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20354 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20355 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20359 randfunc=Perl_drand48
20360 drand01="Perl_drand48()"
20361 seedfunc="Perl_drand48_init"
20365 : Probe whether dtrace builds an object, as newer Illumos requires an input
20366 : object file that uses at least one of the probes defined in the .d file
20367 case "$usedtrace" in
20369 case "$dtracexnolibs" in
20370 $define|true|[yY]*)
20371 dtracexnolibs=$define
20372 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20375 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20376 dtracexnolibs=$define
20377 echo "Your dtrace accepts -xnolibs"
20378 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20379 dtracexnolibs=$undef
20380 echo "Your dtrace doesn't accept -xnolibs"
20382 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20387 dtracexnolibs=$undef
20388 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20391 case $dtracexnolibs in
20392 $define) xnolibs=-xnolibs ;;
20396 case "$dtraceobject" in
20397 $define|true|[yY]*)
20398 dtraceobject=$define
20402 #include "perldtrace.h"
20404 PERL_LOADED_FILE("dummy");
20408 dtraceobject=$undef
20409 if $cc -c -o try.o $optimize $ccflags try.c \
20410 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20411 dtraceobject=$define
20412 echo "Your dtrace builds an object file"
20415 *) dtraceobject=$undef ;;
20417 $rm_try perldtrace.o perldtrace.h
20420 : Determine if this is an EBCDIC system
20422 echo "Determining whether or not we are on an EBCDIC system..." >&4
20423 $cat >try.c <<'EOM'
20426 if ('M'==0xd4) return 0;
20433 if eval $compile_ok; then
20434 if $run ./try; then
20435 echo "You seem to speak EBCDIC." >&4
20438 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20441 echo "I'm unable to compile the test program." >&4
20442 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20448 : Check how to flush
20451 Checking how to flush all pending stdio output...
20453 # I only know how to find the first 32 possibly open files on SunOS.
20454 # See also hints/sunos_4_1.sh and util.c --AD
20456 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20458 $cat >>try.c <<EOCP
20460 #$i_stdlib I_STDLIB
20462 #include <stdlib.h>
20464 #$i_unistd I_UNISTD
20466 # include <unistd.h>
20468 #$d_sysconf HAS_SYSCONF
20469 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20470 #ifdef HAS_STDIO_STREAM_ARRAY
20471 # define STDIO_STREAM_ARRAY $stdio_stream_array
20476 p = fopen("try.out", "w");
20480 # ifdef TRY_FPRINTF
20484 #ifdef TRY_FFLUSH_NULL
20487 #ifdef TRY_FFLUSH_ALL
20489 long open_max = -1;
20490 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20491 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20493 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20494 open_max = sysconf(_SC_OPEN_MAX);
20497 open_max = FOPEN_MAX;
20500 open_max = OPEN_MAX;
20509 # ifdef HAS_STDIO_STREAM_ARRAY
20510 if (open_max > 0) {
20512 for (i = 0; i < open_max; i++)
20513 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20514 STDIO_STREAM_ARRAY[i]._file < open_max &&
20515 STDIO_STREAM_ARRAY[i]._flag)
20516 fflush(&STDIO_STREAM_ARRAY[i]);
20524 : first we have to find out how _not_ to flush
20526 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20528 set try -DTRY_FPUTC
20529 if eval $compile; then
20530 $run ./try 2>/dev/null
20533 if $test ! -s try.out -a "X$code" = X42; then
20539 set try -DTRY_FPRINTF
20540 if eval $compile; then
20541 $run ./try 2>/dev/null
20544 if $test ! -s try.out -a "X$code" = X42; then
20545 output=-DTRY_FPRINTF
20551 : check for fflush NULL behavior
20552 case "$fflushNULL" in
20553 '') set try -DTRY_FFLUSH_NULL $output
20554 if eval $compile; then
20555 $run ./try 2>/dev/null
20558 if $test -s try.out -a "X$code" = X42; then
20559 fflushNULL="`$cat try.out`"
20561 if $test "X$code" != X42; then
20563 (If this test failed, don't worry, we'll try another method shortly.)
20568 $rm -f core try.core core.try.*
20569 case "$fflushNULL" in
20571 Your fflush(NULL) works okay for output streams.
20572 Let's see if it clobbers input pipes...
20574 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20575 # bug that improperly flushes the input end of pipes. So we avoid the
20576 # autoflush on fork/system/exec support for now. :-(
20577 $cat >tryp.c <<EOCP
20580 main(int argc, char **argv)
20586 while ((i = getc(stdin)) != -1
20587 && (*bp++ = i) != '\n'
20588 && bp < &buf[1024])
20591 fprintf(stdout, "%s", buf);
20599 fflushNULL="$define"
20601 if eval $compile; then
20603 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20604 if $test "X$targethost" != X; then
20607 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20609 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20611 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20613 fflush(NULL) seems to behave okay with input streams.
20615 fflushNULL="$define"
20618 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20620 fflushNULL="$undef"
20623 $rm -f core tryp.c tryp.core core.tryp.*
20626 Your fflush(NULL) isn't working (contrary to ANSI C).
20628 fflushNULL="$undef"
20631 Cannot figure out whether your fflush(NULL) works or not.
20632 I'm assuming it doesn't (contrary to ANSI C).
20634 fflushNULL="$undef"
20638 $define|true|[yY]*)
20639 fflushNULL="$define"
20642 fflushNULL="$undef"
20645 : check explicit looping only if NULL did not work, and if the pipe
20646 : bug does not show up on an explicit flush too
20647 case "$fflushNULL" in
20649 $cat >tryp.c <<EOCP
20652 main(int argc, char **argv)
20658 while ((i = getc(stdin)) != -1
20659 && (*bp++ = i) != '\n'
20660 && bp < &buf[1024])
20663 fprintf(stdout, "%s", buf);
20672 if eval $compile; then
20674 if $test "X$targethost" != X; then
20677 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20679 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20681 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20683 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20685 : now check for fflushall behaviour
20686 case "$fflushall" in
20687 '') set try -DTRY_FFLUSH_ALL $output
20688 if eval $compile; then
20690 (Now testing the other method--but note that this also may fail.)
20692 $run ./try 2>/dev/null
20695 if $test -s try.out -a "X$code" = X42; then
20696 fflushall="`$cat try.out`"
20700 case "$fflushall" in
20702 Whew. Flushing explicitly all the stdio streams works.
20704 fflushall="$define"
20707 Sigh. Flushing explicitly all the stdio streams doesn't work.
20712 Cannot figure out whether flushing stdio streams explicitly works or not.
20713 I'm assuming it doesn't.
20719 "$define"|true|[yY]*)
20720 fflushall="$define"
20728 All is futile. Even fflush(stdin) clobbers input pipes!
20735 $rm -f core tryp.c tryp.core core.tryp.*
20737 *) fflushall="$undef"
20741 case "$fflushNULL$fflushall" in
20744 OK, I give up. I cannot figure out how to flush pending stdio output.
20745 We won't be flushing handles at all before fork/exec/popen.
20751 : Store the full pathname to the ar program for use in the C program
20752 : Respect a hint or command line value for full_ar.
20757 : Store the full pathname to the sed program for use in the C program
20760 : see what type gids are declared as in the kernel
20762 echo "Looking for the type for group ids returned by getgid()."
20763 set gid_t gidtype xxx stdio.h sys/types.h
20767 xxx=`./findhdr sys/user.h`
20768 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20770 unsigned) dflt="$1 $2" ;;
20774 *) dflt="$gidtype";;
20777 gid_t) echo "gid_t found." ;;
20778 *) rp="What is the type for group ids returned by getgid()?"
20784 : Check the size of GID
20787 *_t) zzz="$gidtype" ;;
20790 echo "Checking the size of $zzz..." >&4
20792 #include <sys/types.h>
20794 #$i_stdlib I_STDLIB
20796 #include <stdlib.h>
20799 printf("%d\n", (int)sizeof($gidtype));
20804 if eval $compile_ok; then
20808 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20811 echo "Your $zzz is $gidsize bytes long."
20816 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20819 : Check if GID is signed
20822 *_t) zzz="$gidtype" ;;
20825 echo "Checking the sign of $zzz..." >&4
20827 #include <sys/types.h>
20838 if eval $compile; then
20842 echo "(I can't execute the test program--guessing unsigned.)" >&4
20846 1) echo "Your $zzz is unsigned." ;;
20847 -1) echo "Your $zzz is signed." ;;
20853 echo "(I can't compile the test program--guessing unsigned.)" >&4
20856 : Check 64bit sizes
20859 if $test X"$quadtype" != X; then
20861 echo "Checking how to print 64-bit integers..." >&4
20863 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20864 $cat >try.c <<'EOCP'
20865 #include <sys/types.h>
20868 int q = 12345678901;
20869 printf("%ld\n", q);
20873 if eval $compile; then
20877 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20878 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20879 echo "We will use %d."
20885 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20886 $cat >try.c <<'EOCP'
20887 #include <sys/types.h>
20890 long q = 12345678901;
20891 printf("%ld\n", q);
20895 if eval $compile; then
20899 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20900 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20901 echo "We will use %ld."
20907 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20908 $cat >try.c <<'EOCP'
20909 #include <sys/types.h>
20910 #include <inttypes.h>
20913 int64_t q = 12345678901;
20914 printf("%" PRId64 "\n", q);
20918 if eval $compile; then
20922 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20923 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20924 echo "We will use the C9X style."
20930 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20932 #include <sys/types.h>
20935 $quadtype q = 12345678901;
20936 printf("%Ld\n", q);
20940 if eval $compile; then
20944 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20945 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20946 echo "We will use %Ld."
20952 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20953 $cat >try.c <<'EOCP'
20954 #include <sys/types.h>
20957 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20958 printf("%lld\n", q);
20962 if eval $compile; then
20966 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20967 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20968 echo "We will use the %lld style."
20974 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20976 #include <sys/types.h>
20979 $quadtype q = 12345678901;
20980 printf("%qd\n", q);
20984 if eval $compile; then
20988 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20989 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20990 echo "We will use %qd."
20996 if $test X"$sPRId64" = X; then
20997 echo "Cannot figure out how to print 64-bit integers." >&4
21004 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21005 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21007 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21008 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21012 : Check format strings for internal types
21014 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21016 if $test X"$ivsize" = X8; then
21017 ivdformat="$sPRId64"
21018 uvuformat="$sPRIu64"
21019 uvoformat="$sPRIo64"
21020 uvxformat="$sPRIx64"
21021 uvXUformat="$sPRIXU64"
21023 if $test X"$ivsize" = X"$longsize"; then
21030 if $test X"$ivsize" = X"$intsize"; then
21038 if $test X"$ivsize" = X"$shortsize"; then
21049 if $test X"$usequadmath" = X"$define"; then
21057 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21058 nveformat="$sPRIeldbl"
21059 nvfformat="$sPRIfldbl"
21060 nvgformat="$sPRIgldbl"
21061 nvEUformat="$sPRIEUldbl"
21062 nvFUformat="$sPRIFUldbl"
21063 nvGUformat="$sPRIGUldbl"
21074 case "$ivdformat" in
21075 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21080 : Check format string for GID
21083 $echo "Checking the format string to be used for gids..." >&4
21086 -1) if $test X"$gidsize" = X"$ivsize"; then
21087 gidformat="$ivdformat"
21089 if $test X"$gidsize" = X"$longsize"; then
21092 if $test X"$gidsize" = X"$intsize"; then
21095 if $test X"$gidsize" = X"$shortsize"; then
21102 *) if $test X"$gidsize" = X"$uvsize"; then
21103 gidformat="$uvuformat"
21105 if $test X"$gidsize" = X"$longsize"; then
21108 if $test X"$gidsize" = X"$intsize"; then
21111 if $test X"$gidsize" = X"$shortsize"; then
21120 : see if getgroups exists
21121 set getgroups d_getgrps
21124 : see if setgroups exists
21125 set setgroups d_setgrps
21128 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21130 case "$d_getgrps$d_setgrps" in
21132 case "$groupstype" in
21133 '') dflt="$gidtype" ;;
21134 *) dflt="$groupstype" ;;
21137 What type of pointer is the second argument to getgroups() and setgroups()?
21138 Usually this is the same as group ids, $gidtype, but not always.
21141 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21145 *) groupstype="$gidtype";;
21148 : check whether make sets MAKE
21150 echo "Checking if your $make program sets \$(MAKE)..." >&4
21151 case "$make_set_make" in
21153 $sed 's/^X //' > testmake.mak << 'EOF'
21155 X @echo 'maketemp="$(MAKE)"'
21157 case "`$make -f testmake.mak 2>/dev/null`" in
21158 *maketemp=*) make_set_make='#' ;;
21159 *) make_set_make="MAKE=$make" ;;
21161 $rm -f testmake.mak
21164 case "$make_set_make" in
21165 '#') echo "Yup, it does.";;
21166 *) echo "Nope, it doesn't.";;
21169 : see what type is used for mode_t
21170 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21171 set mode_t modetype int stdio.h sys/types.h
21174 : see if we need va_copy
21177 #include <stdarg.h>
21179 #include <stdlib.h>
21180 #include <signal.h>
21183 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21185 return vfprintf(f, fmt, *valp);
21189 myvfprintf(FILE *f, const char *fmt, va_list val)
21191 return ivfprintf(f, fmt, &val);
21195 myprintf(char *fmt, ...)
21198 va_start(val, fmt);
21199 return myvfprintf(stdout, fmt, val);
21203 main(int ac, char **av)
21205 signal(SIGSEGV, exit);
21207 myprintf("%s%cs all right, then\n", "that", '\'');
21212 if eval $compile && $run ./try 2>&1 >/dev/null; then
21213 case "`$run ./try`" in
21214 "that's all right, then")
21220 yes) echo "It seems that you don't need va_copy()." >&4
21221 need_va_copy="$undef"
21223 *) echo "It seems that va_copy() or similar will be needed." >&4
21224 need_va_copy="$define"
21229 : see what type is used for size_t
21230 rp="What is the type used for the length parameter for string functions?"
21231 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21234 : check for type of arguments to gethostbyaddr.
21235 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21236 case "$d_gethbyaddr" in
21240 Checking to see what type of arguments are accepted by gethostbyaddr().
21242 hdrs="$define sys/types.h
21243 $d_socket sys/socket.h
21244 $i_niin netinet/in.h
21246 $i_unistd unistd.h"
21247 : The first arg can 'char *' or 'void *'
21248 : The second arg is some of integral type
21249 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21250 for yyy in size_t long int; do
21251 case "$netdb_host_type" in
21252 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21253 if ./protochk "$try" $hdrs; then
21254 echo "Your system accepts $xxx for the first arg."
21255 echo "...and $yyy for the second arg."
21256 netdb_host_type="$xxx"
21257 netdb_hlen_type="$yyy"
21263 : In case none of those worked, prompt the user.
21264 case "$netdb_host_type" in
21265 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21268 netdb_host_type=$ans
21269 rp='What is the type for the 2nd argument to gethostbyaddr?'
21272 netdb_hlen_type=$ans
21276 *) : no gethostbyaddr, so pick harmless defaults
21277 netdb_host_type='char *'
21278 netdb_hlen_type="$sizetype"
21281 # Remove the "const" if needed. -- but then we'll have a
21283 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21286 : check for type of argument to gethostbyname.
21287 if test "X$netdb_name_type" = X ; then
21288 case "$d_gethbyname" in
21292 Checking to see what type of argument is accepted by gethostbyname().
21294 hdrs="$define sys/types.h
21295 $d_socket sys/socket.h
21296 $i_niin netinet/in.h
21298 $i_unistd unistd.h"
21299 for xxx in "const char *" "char *"; do
21300 case "$netdb_name_type" in
21301 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21302 if ./protochk "$try" $hdrs; then
21303 echo "Your system accepts $xxx."
21304 netdb_name_type="$xxx"
21309 : In case none of those worked, prompt the user.
21310 case "$netdb_name_type" in
21311 '') rp='What is the type for the 1st argument to gethostbyname?'
21314 netdb_name_type=$ans
21318 *) : no gethostbyname, so pick harmless default
21319 netdb_name_type='char *'
21324 : check for type of 1st argument to getnetbyaddr.
21325 if test "X$netdb_net_type" = X ; then
21326 case "$d_getnbyaddr" in
21330 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21332 hdrs="$define sys/types.h
21333 $d_socket sys/socket.h
21334 $i_niin netinet/in.h
21336 $i_unistd unistd.h"
21337 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21338 case "$netdb_net_type" in
21339 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21340 if ./protochk "$try" $hdrs; then
21341 echo "Your system accepts $xxx."
21342 netdb_net_type="$xxx"
21347 : In case none of those worked, prompt the user.
21348 case "$netdb_net_type" in
21349 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21352 netdb_net_type=$ans
21356 *) : no getnetbyaddr, so pick harmless default
21357 netdb_net_type='long'
21361 : locate the preferred pager for this system
21368 [a-zA-Z]:/*) dflt=$pg;;
21372 [a-zA-Z]:/*) dflt=$more;;
21376 [a-zA-Z]:/*) dflt=$less;;
21379 '') dflt=/usr/ucb/more;;
21387 rp='What pager is used on your system?'
21391 : see if ar generates random libraries by itself
21393 echo "Checking how to generate random libraries on your machine..." >&4
21394 echo 'int bar1() { return bar2(); }' > bar1.c
21395 echo 'int bar2() { return 2; }' > bar2.c
21397 #$i_stdlib I_STDLIB
21399 #include <stdlib.h>
21401 int main() { printf("%d\n", bar1()); exit(0); }
21403 $cc $ccflags -c bar1.c >/dev/null 2>&1
21404 $cc $ccflags -c bar2.c >/dev/null 2>&1
21405 $cc $ccflags -c foo.c >/dev/null 2>&1
21406 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21407 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21408 $run ./foobar >/dev/null 2>&1; then
21409 echo "$ar appears to generate random libraries itself."
21411 if [ "X$ranlib" = "X" ]; then
21414 elif $ar s bar$_a >/dev/null 2>&1 &&
21415 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21416 $run ./foobar >/dev/null 2>&1; then
21417 echo "a table of contents needs to be added with '$ar s'."
21420 elif $ar ts bar$_a >/dev/null 2>&1 &&
21421 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21422 $run ./foobar >/dev/null 2>&1; then
21423 echo "a table of contents needs to be added with '$ar ts'."
21430 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21431 $test -f $ranlib || ranlib=''
21434 if $test -n "$ranlib"; then
21435 echo "your system has '$ranlib'; we'll use that."
21438 echo "your system doesn't seem to support random libraries"
21439 echo "so we'll use lorder and tsort to order the libraries."
21446 : Check the max offset that gmtime and localtime accept
21447 echo "Checking max offsets that gmtime () accepts"
21449 case "$sGMTIME_min/$sGMTIME_max" in
21452 #include <sys/types.h>
21460 void gm_check (time_t t, int min_year, int max_year)
21463 if ( tmp == NULL ||
21464 /* Check tm_year overflow */
21465 tmp->tm_year < min_year || tmp->tm_year > max_year)
21476 gm_check (MAXLONG, 69, 0x7fffffff);
21478 if (tmp == NULL || tmp->tm_year < 0) {
21479 for (i = 63; i >= 0; i--) {
21480 time_t x = pt | ((time_t)1 << i);
21481 if (x < 0 || x < pt) continue;
21482 gm_check (x, 69, 0x7fffffff);
21485 printf ("sGMTIME_max=%ld\n", pt);
21494 gm_check (MINLONG, -1900, 70);
21497 for (i = 36; i >= 0; i--) {
21498 time_t x = pt - ((time_t)1 << i);
21499 if (x > 0) continue;
21500 gm_check (x, -1900, 70);
21503 printf ("sGMTIME_min=%ld\n", pt);
21507 int main (int argc, char *argv[])
21509 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21516 if eval $compile; then
21517 eval `$run ./try 2>/dev/null`
21519 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21525 echo "Checking max offsets that localtime () accepts"
21527 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21530 #include <sys/types.h>
21538 void local_check (time_t t, int min_year, int max_year)
21540 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21543 tmp = localtime (&t);
21544 if ( tmp == NULL ||
21545 /* Check tm_year overflow */
21546 tmp->tm_year < min_year || tmp->tm_year > max_year)
21550 } /* local_check */
21557 local_check (MAXLONG, 69, 0x7fffffff);
21559 if (tmp == NULL || tmp->tm_year < 0) {
21560 for (i = 63; i >= 0; i--) {
21561 time_t x = pt | ((time_t)1 << i);
21562 if (x < 0 || x < pt) continue;
21563 local_check (x, 69, 0x7fffffff);
21566 printf ("sLOCALTIME_max=%ld\n", pt);
21575 local_check (MINLONG, -1900, 70);
21578 for (i = 36; i >= 0; i--) {
21579 time_t x = pt - ((time_t)1 << i);
21580 if (x > 0) continue;
21581 local_check (x, -1900, 70);
21584 printf ("sLOCALTIME_min=%ld\n", pt);
21588 int main (int argc, char *argv[])
21596 if eval $compile; then
21597 eval `$run ./try 2>/dev/null`
21599 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21605 : check for type of arguments to select.
21606 case "$selecttype" in
21607 '') case "$d_select" in
21611 Checking to see what type of arguments are accepted by select().
21613 hdrs="$define sys/types.h
21614 $i_systime sys/time.h
21615 $i_sysselct sys/select.h
21616 $d_socket sys/socket.h"
21617 : The first arg can be int, unsigned, or size_t
21618 : The last arg may or may not be 'const'
21620 : void pointer has been seen but using that
21621 : breaks the selectminbits test
21622 for xxx in 'fd_set *' 'int *'; do
21623 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21624 for tmo in 'struct timeval *' 'const struct timeval *'; do
21626 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21627 if ./protochk "$try" $hdrs; then
21628 echo "Your system accepts $xxx."
21637 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21638 case "$d_fd_set" in
21639 $define) dflt="fd_set *" ;;
21648 *) : no select, so pick a harmless default
21655 : check for the select 'width'
21656 case "$selectminbits" in
21657 '') safebits=`expr $ptrsize \* 8`
21658 case "$d_select" in
21662 Checking to see on how many bits at a time your select() operates...
21665 #include <sys/types.h>
21667 #$i_systime I_SYS_TIME
21668 #$i_systimek I_SYS_TIME_KERNEL
21673 # ifdef I_SYS_TIME_KERNEL
21676 # include <sys/time.h>
21677 # ifdef I_SYS_TIME_KERNEL
21681 #$i_sysselct I_SYS_SELECT
21682 #ifdef I_SYS_SELECT
21683 #include <sys/select.h>
21685 #$d_socket HAS_SOCKET
21687 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21690 #$i_stdlib I_STDLIB
21692 #include <stdlib.h>
21695 #define S sizeof(*(b))
21697 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21698 #define NBITS (NBYTES * 8)
21700 char *s = (char *)malloc(NBYTES);
21709 fp = fopen("try.c", "r");
21715 b = ($selecttype)s;
21716 for (i = 0; i < NBITS; i++)
21720 select(fd + 1, b, 0, 0, &t);
21721 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21723 printf("%d\n", i + 1);
21728 if eval $compile_ok; then
21729 selectminbits=`$run ./try 2>/dev/null`
21730 case "$selectminbits" in
21732 Cannot figure out on how many bits at a time your select() operates.
21733 I'll play safe and guess it is $safebits bits.
21735 selectminbits=$safebits
21736 bits="$safebits bits"
21739 *) bits="$selectminbits bits" ;;
21741 echo "Your select() operates on $bits at a time." >&4
21743 rp='What is the minimum number of bits your select() operates on?'
21744 case "$byteorder" in
21745 12345678) dflt=64 ;;
21751 selectminbits="$val"
21755 *) : no select, so pick a harmless default
21756 selectminbits=$safebits
21762 : Trace out the files included by signal.h, then look for SIGxxx names.
21763 case "$sig_num_init" in
21765 if [ "X$fieldn" = X ]; then
21766 : Just make some guesses. We check them later.
21767 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21769 xxx=`echo '#include <signal.h>' |
21770 $cppstdin $cppminus $cppflags 2>/dev/null |
21771 $grep '^[ ]*#.*include' |
21772 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21773 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21776 for xx in $xxx /dev/null ; do
21777 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21779 case "$xxxfiles" in
21780 '') xxxfiles=`./findhdr signal.h` ;;
21783 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21784 print substr($2, 4, 20)
21786 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21787 print substr($3, 4, 20)
21789 : Append some common names just in case the awk scan failed.
21790 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21791 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21792 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21793 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21794 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21796 : generate a few handy files for later
21797 $cat > signal.c <<EOCP
21798 #include <sys/types.h>
21799 #include <signal.h>
21800 #$i_stdlib I_STDLIB
21802 #include <stdlib.h>
21807 /* Strange style to avoid deeply-nested #if/#else/#endif */
21810 # define NSIG (_NSIG)
21816 # define NSIG (SIGMAX+1)
21822 # define NSIG (SIG_MAX+1)
21828 # define NSIG (_SIG_MAX+1)
21834 # define NSIG (MAXSIG+1)
21840 # define NSIG (MAX_SIG+1)
21845 # ifdef SIGARRAYSIZE
21846 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21852 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21856 /* Default to some arbitrary number that's big enough to get most
21857 of the common signals.
21863 printf("NSIG %d\n", NSIG);
21869 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21871 printf "#ifdef SIG"; printf $1; printf "\n"
21872 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21873 printf $1; printf ");\n"
21877 printf "#endif /* JUST_NSIG */\n";
21878 printf "exit(0);\n}\n";
21881 $cat >signal.awk <<'EOP'
21882 BEGIN { ndups = 0 }
21883 $1 ~ /^NSIG$/ { nsig = $2 }
21884 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21885 if ($2 > maxsig) { maxsig = $2 }
21886 if (sig_name[$2]) {
21887 dup_name[ndups] = $1
21888 dup_num[ndups] = $2
21900 printf("NSIG %d\n", nsig);
21901 for (n = 1; n < nsig; n++) {
21903 printf("%s %d\n", sig_name[n], sig_num[n])
21906 printf("NUM%d %d\n", n, n)
21909 for (n = 0; n < ndups; n++) {
21910 printf("%s %d\n", dup_name[n], dup_num[n])
21914 $cat >signal_cmd <<EOS
21916 if $test -s signal.lst; then
21917 echo "Using your existing signal.lst file"
21922 $cat >>signal_cmd <<'EOS'
21925 if eval $compile_ok; then
21926 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21927 $uniq | $awk -f signal.awk >signal.lst
21929 echo "(I can't seem be able to compile the whole test program)" >&4
21930 echo "(I'll try it in little pieces.)" >&4
21931 set signal -DJUST_NSIG
21932 if eval $compile_ok; then
21933 $run ./signal$_exe > signal.nsg
21936 echo "I can't seem to figure out how many signals you have." >&4
21937 echo "Guessing 50." >&4
21938 echo 'NSIG 50' > signal.nsg
21940 : Now look at all the signal names, one at a time.
21941 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21942 $cat > signal.c <<EOCP
21943 #include <sys/types.h>
21944 #include <signal.h>
21947 printf("$xx %d\n", SIG${xx});
21952 if eval $compile; then
21953 echo "SIG${xx} found."
21954 $run ./signal$_exe >> signal.ls1
21956 echo "SIG${xx} NOT found."
21959 if $test -s signal.ls1; then
21960 $cat signal.nsg signal.ls1 |
21961 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21965 if $test -s signal.lst; then
21968 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21969 echo 'kill -l' >signal
21970 set X `csh -f <signal`
21974 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21976 echo $@ | $tr ' ' $trnl | \
21977 $awk '{ printf "%s %d\n", $1, ++s; }
21978 END { printf "NSIG %d\n", ++s }' >signal.lst
21980 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21982 chmod a+x signal_cmd
21983 $eunicefix signal_cmd
21987 : generate list of signal names
21988 case "$sig_num_init" in
21991 case "$sig_name_init" in
21993 *) case "$sig_num_init" in
21994 ''|*,*) doinit=yes ;;
21999 echo "Generating a list of signal names and numbers..." >&4
22001 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22002 sig_name=`$awk 'BEGIN { printf "ZERO " }
22003 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22004 sig_num=`$awk 'BEGIN { printf "0 " }
22005 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22006 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22007 !/^NSIG/ { printf "\"%s\", ", $1 }
22008 END { printf "0\n" }' signal.lst`
22009 sig_num_init=`$awk 'BEGIN { printf "0, " }
22010 !/^NSIG/ { printf "%d, ", $2}
22011 END { printf "0\n"}' signal.lst`
22014 echo "The following $sig_count signals are available:"
22016 echo $sig_name | $awk \
22017 'BEGIN { linelen = 0 }
22019 for (i = 1; i <= NF; i++) {
22020 name = "SIG" $i " "
22021 linelen = linelen + length(name)
22022 if (linelen > 70) {
22024 linelen = length(name)
22030 sig_size=`echo $sig_name | awk '{print NF}'`
22031 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22035 : Check size of size
22037 case "$sizetype" in
22038 *_t) zzz="$sizetype" ;;
22039 *) zzz="filesize" ;;
22041 echo "Checking the size of $zzz..." >&4
22043 #include <sys/types.h>
22045 #$i_stdlib I_STDLIB
22047 #include <stdlib.h>
22050 printf("%d\n", (int)sizeof($sizetype));
22055 if eval $compile_ok; then
22059 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22062 echo "Your $zzz size is $sizesize bytes."
22067 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22070 : check for socklen_t
22072 echo "Checking to see if you have socklen_t..." >&4
22074 #include <sys/types.h>
22075 #$d_socket HAS_SOCKET
22077 #include <sys/socket.h>
22079 int main() { socklen_t x = 16; }
22082 if eval $compile; then
22084 echo "You have socklen_t."
22087 echo "You do not have socklen_t."
22088 case "$sizetype" in
22089 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22096 : see if this is a socks.h system
22097 set socks.h i_socks
22100 : check for type of the size argument to socket calls
22101 case "$d_socket" in
22105 Checking to see what type is the last argument of accept().
22108 case "$d_socklen_t" in
22109 "$define") yyy="$yyy socklen_t"
22111 yyy="$yyy $sizetype int long unsigned"
22112 for xxx in $yyy; do
22113 case "$socksizetype" in
22114 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22115 case "$usesocks" in
22117 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22118 echo "Your system accepts '$xxx *' for the last argument of accept()."
22119 socksizetype="$xxx"
22122 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22123 echo "Your system accepts '$xxx *' for the last argument of accept()."
22124 socksizetype="$xxx"
22131 : In case none of those worked, prompt the user.
22132 case "$socksizetype" in
22133 '') rp='What is the type for socket address structure sizes?'
22140 *) : no sockets, so pick relatively harmless default
22145 : see what type is used for signed size_t
22146 set ssize_t ssizetype int stdio.h sys/types.h
22151 #$i_stdlib I_STDLIB
22153 #include <stdlib.h>
22155 #include <sys/types.h>
22156 #define Size_t $sizetype
22157 #define SSize_t $dflt
22160 if (sizeof(Size_t) == sizeof(SSize_t))
22162 else if (sizeof(Size_t) == sizeof(int))
22171 if eval $compile_ok && $run ./try > /dev/null; then
22172 ssizetype=`$run ./try`
22173 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22176 Help! I can't compile and run the ssize_t test program: please enlighten me!
22177 (This is probably a misconfiguration in your system or libraries, and
22178 you really ought to fix it. Still, I'll try anyway.)
22180 I need a type that is the same size as $sizetype, but is guaranteed to
22181 be signed. Common values are ssize_t, int and long.
22184 rp="What signed type is the same size as $sizetype?"
22190 : Check the size of st_ino
22192 $echo "Checking the size of st_ino..." >&4
22193 $cat > try.c <<EOCP
22194 #include <sys/stat.h>
22196 #$i_stdlib I_STDLIB
22198 #include <stdlib.h>
22202 printf("%d\n", (int)sizeof(st.st_ino));
22207 if eval $compile_ok; then
22211 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22213 *) st_ino_size=$val
22214 $echo "Your st_ino is $st_ino_size bytes long."
22219 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22223 : Check if st_ino is signed
22225 $echo "Checking the sign of st_ino..." >&4
22226 $cat > try.c <<EOCP
22227 #include <sys/stat.h>
22232 if (foo.st_ino < 0)
22239 if eval $compile; then
22243 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22245 *) st_ino_sign=$val
22246 case "$st_ino_sign" in
22247 1) $echo "Your st_ino is unsigned." ;;
22248 -1) $echo "Your st_ino is signed." ;;
22254 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22258 : see what type of char stdio uses.
22260 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22261 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22262 echo "Your stdio uses unsigned chars." >&4
22263 stdchar="unsigned char"
22265 echo "Your stdio uses signed chars." >&4
22270 : Check size of UID
22273 *_t) zzz="$uidtype" ;;
22276 echo "Checking the size of $zzz..." >&4
22278 #include <sys/types.h>
22280 #$i_stdlib I_STDLIB
22282 #include <stdlib.h>
22285 printf("%d\n", (int)sizeof($uidtype));
22290 if eval $compile_ok; then
22294 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22297 echo "Your $zzz is $uidsize bytes long."
22302 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22305 : Check if UID is signed
22308 *_t) zzz="$uidtype" ;;
22311 echo "Checking the sign of $zzz..." >&4
22313 #include <sys/types.h>
22324 if eval $compile; then
22328 echo "(I can't execute the test program--guessing unsigned.)" >&4
22332 1) echo "Your $zzz is unsigned." ;;
22333 -1) echo "Your $zzz is signed." ;;
22339 echo "(I can't compile the test program--guessing unsigned.)" >&4
22342 : Check format string for UID
22344 $echo "Checking the format string to be used for uids..." >&4
22347 -1) if $test X"$uidsize" = X"$ivsize"; then
22348 uidformat="$ivdformat"
22350 if $test X"$uidsize" = X"$longsize"; then
22353 if $test X"$uidsize" = X"$intsize"; then
22356 if $test X"$uidsize" = X"$shortsize"; then
22363 *) if $test X"$uidsize" = X"$uvsize"; then
22364 uidformat="$uvuformat"
22366 if $test X"$uidsize" = X"$longsize"; then
22369 if $test X"$uidsize" = X"$intsize"; then
22372 if $test X"$uidsize" = X"$shortsize"; then
22381 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22383 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22384 $cat >try.c <<'EOM'
22385 /* Intentionally a long probe as I'd like to sanity check that the exact
22386 approach is going to work, as thinking it will work, but only having it
22387 part working at runtime is worse than not having it. */
22389 #include <sys/types.h>
22390 #include <sys/sysctl.h>
22391 #include <sys/param.h>
22393 #include <string.h>
22394 #include <stdlib.h>
22395 #include <unistd.h>
22398 main(int argc, char **argv) {
22400 char *argv_leaf = strrchr(argv[0], '/');
22406 mib[1] = KERN_PROC;
22407 mib[2] = KERN_PROC_PATHNAME;
22411 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22415 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22420 if (size < strlen(argv_leaf) + 1) {
22421 fprintf(stderr, "size %lu is too short for a path\n",
22422 (unsigned long) size);
22426 if (size > MAXPATHLEN * MAXPATHLEN) {
22427 fprintf(stderr, "size %lu is too long for a path\n",
22428 (unsigned long) size);
22432 buffer = (char *)malloc(size);
22438 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22443 if (strlen(buffer) + 1 != size) {
22444 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22445 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22450 if (*buffer != '/') {
22451 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22455 if (strstr(buffer, "/./")) {
22456 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22460 if (strstr(buffer, "/../")) {
22461 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22465 buffer_leaf = strrchr(buffer, '/');
22466 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22467 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22479 if eval $compile; then
22480 if $run ./try; then
22481 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22484 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22488 echo "I'm unable to compile the test program." >&4
22489 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22493 set usekernprocpathname
22496 : Determine if we can use _NSGetExecutablePath to find executing program
22498 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22499 $cat >try.c <<'EOM'
22500 /* Intentionally a long probe as I'd like to sanity check that the exact
22501 approach is going to work, as thinking it will work, but only having it
22502 part working at runtime is worse than not having it. */
22503 #include <mach-o/dyld.h>
22505 #include <stdlib.h>
22506 #include <sys/param.h>
22507 #include <string.h>
22510 main(int argc, char **argv) {
22512 uint32_t size = sizeof(buf);
22516 char *argv_leaf = strrchr(argv[0], '/');
22520 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22524 _NSGetExecutablePath(buf, &size);
22525 if (size > MAXPATHLEN * MAXPATHLEN) {
22526 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22527 (unsigned int) size);
22531 buffer = (char *)malloc(size);
22537 result = _NSGetExecutablePath(buffer, &size);
22539 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22540 result, (unsigned int) size);
22544 tidied = realpath(buffer, NULL);
22546 perror("realpath");
22552 if (*tidied != '/') {
22553 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22557 if (strstr(tidied, "/./")) {
22558 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22562 if (strstr(tidied, "/../")) {
22563 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22567 tidied_leaf = strrchr(tidied, '/');
22568 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22569 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22581 if eval $compile; then
22582 if $run ./try; then
22583 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22586 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22589 echo "I'm unable to compile the test program." >&4
22590 echo "I'll assume no _NSGetExecutablePath here." >&4
22593 set usensgetexecutablepath
22596 : Check if site customization support was requested
22597 case "$usesitecustomize" in
22598 $define|true|[Yy]*)
22599 usesitecustomize="$define"
22602 usesitecustomize="$undef"
22606 : determine compiler compiler
22615 if $test -f "$byacc$_exe"; then
22617 comp="byacc or $comp"
22619 if $test -f "$bison$_exe"; then
22620 comp="$comp or bison -y"
22622 rp="Which compiler compiler ($comp) shall I use?"
22631 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22637 : see if this is a bfd.h system
22641 : see if this is an execinfo.h system
22642 set execinfo.h i_execinfo
22645 : see if this is a fenv.h system
22649 : see if this is a fp.h system
22653 : see if this is a fp_class.h system
22654 set fp_class.h i_fp_class
22657 : see if gdbm.h is available
22662 : see if gdbm_open exists
22663 set gdbm_open d_gdbm_open
22665 case "$d_gdbm_open" in
22668 echo "We won't be including <gdbm.h>"
22677 : see if this is a ieeefp.h system
22678 case "$i_ieeefp" in
22679 '' ) set ieeefp.h i_ieeefp
22684 : see if this is a libutil.h system
22685 set libutil.h i_libutil
22688 : see if mach cthreads are available
22689 if test "X$usethreads" = "X$define"; then
22690 set mach/cthreads.h i_machcthr
22693 i_machcthr="$undef"
22696 : see if this is a mntent.h system
22697 set mntent.h i_mntent
22700 : see if net/errno.h is available
22702 set net/errno.h val
22705 : Unfortunately, it causes problems on some systems. Arrgh.
22708 cat > try.c <<'EOM'
22711 #include <net/errno.h>
22717 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22718 echo "We'll be including <net/errno.h>." >&4
22720 echo "We won't be including <net/errno.h>." >&4
22729 : see if netinet/tcp.h is available
22730 set netinet/tcp.h i_netinettcp
22733 : see if this is a poll.h system
22737 : see if this is a prot.h system
22741 : Preprocessor symbols
22743 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22744 $cat <<'EOSH' > Cppsym.know
22745 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22746 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22747 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22748 arch_pwr ardent ARM ARM32 atarist att386 att3b
22749 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22750 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22751 byteorder byte_order
22752 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22753 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22754 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22755 ELF encore EPI EXTENSIONS
22756 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22757 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22758 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22759 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22760 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22761 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22762 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22763 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22764 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22766 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22767 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22768 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22770 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22771 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22772 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22773 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22774 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22775 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22776 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22777 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22778 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22779 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22780 ns32000 ns32016 ns32332 ns32k nsc32000
22781 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22782 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22783 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22784 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22786 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22787 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22788 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22789 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22790 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22791 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22792 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22793 SYSV4 SYSV5 sysV68 sysV88
22794 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22795 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22796 tower32_800 tower32_850 tss
22797 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22798 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22799 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22800 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22801 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22802 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22804 vax venix VMESA vms
22805 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22806 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22809 # Maybe put other stuff here too.
22810 ./tr '-' '_' <<EOSH >>Cppsym.know
22813 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22814 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22815 $cat Cppsym.know > Cppsym.c
22816 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22817 $rm -f Cppsym.a Cppsym.b Cppsym.c
22818 cat <<EOSH > Cppsym
22820 if $test \$# -gt 0; then
22821 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22822 if $test -s Cppsym.got; then
22829 $tr " " "$trnl" | ./Cppsym.try
22835 cat <<EOSH > Cppsym.try
22837 cat <<'EOCP' > try.c
22840 #define STRINGIFY(a) "a"
22842 #if cpp_stuff == 42
22843 #define StGiFy(a) #a
22844 #define STRINGIFY(a) StGiFy(a)
22846 #if $cpp_stuff != 1 && $cpp_stuff != 42
22847 # include "Bletch: How does this C preprocessor stringify macros?"
22853 cat <<'EOSH' >> Cppsym.try
22855 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22856 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22857 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22858 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22860 echo 'return 0;}' >> try.c
22862 cat <<EOSH >> Cppsym.try
22864 case "$osname-$gccversion" in
22865 irix-) ccflags="\$ccflags -woff 1178" ;;
22866 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22868 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
22870 chmod +x Cppsym.try
22871 $eunicefix Cppsym.try
22872 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22873 : Add in any Linux cpp "predefined macros":
22874 case "$osname::$gccversion" in
22875 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22877 rm -f $tHdrH'.h' $tHdrH
22879 # Filter out macro arguments, such as Linux's __INT8_C(c)
22880 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22881 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22882 if [ -s $tHdrH'_cppsym.real' ]; then
22883 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22886 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22889 : now check the C compiler for additional symbols
22890 postprocess_cc_v=''
22892 aix) postprocess_cc_v="|$tr , ' '" ;;
22899 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22902 -D*) echo "\$i" | $sed 's/^-D//';;
22903 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22908 postprocess_cc_v=''
22911 ./ccsym > ccsym1.raw
22912 if $test -s ccsym1.raw; then
22913 $sort ccsym1.raw | $uniq >ccsym.raw
22915 mv ccsym1.raw ccsym.raw
22918 $awk '/\=/ { print $0; next }
22919 { print $0"=1" }' ccsym.raw >ccsym.list
22920 $comm -13 Cppsym.true ccsym.list >ccsym.own
22921 $comm -12 Cppsym.true ccsym.list >ccsym.com
22922 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22924 if $test -z ccsym.raw; then
22925 echo "Your C compiler doesn't seem to define any symbols!" >&4
22927 echo "However, your C preprocessor defines the following symbols:"
22930 cppsymbols=`$cat Cppsym.true`
22931 cppsymbols=`echo $cppsymbols`
22932 cppccsymbols="$cppsymbols"
22934 if $test -s ccsym.com; then
22935 echo "Your C compiler and pre-processor define these symbols:"
22936 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22939 cppccsymbols=`$cat ccsym.com`
22940 cppccsymbols=`echo $cppccsymbols`
22941 $test "$silent" || sleep 1
22943 if $test -s ccsym.cpp; then
22944 $test "$also" && echo " "
22945 echo "Your C pre-processor ${also}defines the following symbols:"
22946 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22948 cppsymbols=`$cat ccsym.cpp`
22949 cppsymbols=`echo $cppsymbols`
22950 $test "$silent" || sleep 1
22952 if $test -s ccsym.own; then
22953 $test "$also" && echo " "
22954 echo "Your C compiler ${also}defines the following cpp symbols:"
22955 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22956 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22957 ccsymbols=`$cat ccsym.own`
22958 ccsymbols=`echo $ccsymbols`
22959 $test "$silent" || sleep 1
22963 : add -D_FORTIFY_SOURCE if feasible and not already there
22964 case "$gccversion" in
22965 [456789].*) case "$optimize$ccflags" in
22966 *-O*) case "$ccflags$cppsymbols" in
22967 *_FORTIFY_SOURCE=*) # Don't add it again.
22968 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22970 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22971 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22975 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22979 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
22983 : script used to emit important warnings
22986 if test \$# -gt 0; then
22991 echo "*** WARNING:" >&4
22992 sed -e 's/^/*** /' <msg >&4
22994 cat msg >>config.msg
22995 echo " " >>config.msg
23001 : see if this is a termio system
23005 if $test `./findhdr termios.h`; then
23006 set tcsetattr i_termios
23012 "$define") echo "You have POSIX termios.h... good!" >&4;;
23013 *) if ./Cppsym pyr; then
23014 case "`$run /bin/universe`" in
23015 ucb) if $test `./findhdr sgtty.h`; then
23017 echo "<sgtty.h> found." >&4
23019 echo "System is pyramid with BSD universe."
23020 ./warn "<sgtty.h> not found--you could have problems."
23022 *) if $test `./findhdr termio.h`; then
23024 echo "<termio.h> found." >&4
23026 echo "System is pyramid with USG universe."
23027 ./warn "<termio.h> not found--you could have problems."
23031 if $test `./findhdr termio.h`; then
23032 echo "<termio.h> found." >&4
23034 elif $test `./findhdr sgtty.h`; then
23035 echo "<sgtty.h> found." >&4
23038 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23041 if $test `./findhdr sgtty.h`; then
23042 echo "<sgtty.h> found." >&4
23044 elif $test `./findhdr termio.h`; then
23045 echo "<termio.h> found." >&4
23048 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23052 set i_termio; eval $setvar
23053 val=$val2; set i_sgtty; eval $setvar
23054 val=$val3; set i_termios; eval $setvar
23056 : see if stdbool is available
23057 : we want a real compile instead of Inhdr because some Solaris systems
23058 : have stdbool.h, but it can only be used if the compiler indicates it
23059 : is sufficiently c99-compliant.
23063 #include <stdbool.h>
23068 int main(int argc, char **argv)
23074 if eval $compile; then
23075 echo "<stdbool.h> found." >&4
23078 echo "<stdbool.h> NOT found." >&4
23085 : see if stdint is available
23086 set stdint.h i_stdint
23089 : see if sys/access.h is available
23090 set sys/access.h i_sysaccess
23093 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23094 set sys/filio.h i_sysfilio
23097 if $test `./findhdr sys/ioctl.h`; then
23099 echo '<sys/ioctl.h> found.' >&4
23102 if $test $i_sysfilio = "$define"; then
23103 echo '<sys/ioctl.h> NOT found.' >&4
23105 $test $i_sgtty = "$define" && xxx="sgtty.h"
23106 $test $i_termio = "$define" && xxx="termio.h"
23107 $test $i_termios = "$define" && xxx="termios.h"
23108 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23114 : see if socket ioctl defs are in sys/sockio.h
23116 xxx=`./findhdr sys/sockio.h`
23117 if $test "$xxx"; then
23118 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23120 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23123 echo "No socket ioctls found in <sys/sockio.h>." >&4
23128 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23134 : see if this is a syslog.h system
23135 set syslog.h i_syslog
23138 : see if this is a sys/mode.h system
23139 set sys/mode.h i_sysmode
23142 : see if there is a sys/poll.h file
23143 set sys/poll.h i_syspoll
23146 : see if sys/resource.h has to be included
23147 set sys/resource.h i_sysresrc
23150 : see if sys/security.h is available
23151 set sys/security.h i_syssecrt
23154 : see if this is a sys/statvfs.h system
23155 set sys/statvfs.h i_sysstatvfs
23158 : see if this is a sys/un.h system
23159 set sys/un.h i_sysun
23162 : see if this is a sys/utsname.h system
23163 set sys/utsname.h i_sysutsname
23166 : see if this is a syswait system
23167 set sys/wait.h i_syswait
23170 : see if this is a ustat.h system
23171 set ustat.h i_ustat
23174 : see if this is an utime system
23175 set utime.h i_utime
23178 : see if this is a vfork system
23181 set vfork.h i_vfork
23189 : see if wchar.h is present
23190 set wchar.h i_wchar
23195 echo "Looking for extensions..." >&4
23196 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23197 : contain old or inaccurate or duplicate values.
23198 nonxs_extensions=''
23200 : We do not use find because it might not be available.
23201 : We do not just use MANIFEST because the user may have dropped
23202 : some additional extensions into the source tree and expect them
23205 : Function to recursively find available extensions, ignoring DynaLoader
23206 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23207 : In 5.10.1 and later, extensions are stored in directories
23208 : like File-Glob instead of the older File/Glob/.
23212 DynaLoader|dynaload) ;;
23214 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23215 case "$this_ext" in
23216 Scalar/List/Utils) this_ext="List/Util" ;;
23217 PathTools) this_ext="Cwd" ;;
23219 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23220 if $contains " $this_ext " "$tdir/$$.tmp"; then
23222 echo "Duplicate directories detected for extension $xxx" >&4;
23223 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23224 case "$knowitall" in
23232 echo "Ok. Stopping Configure." >&4;
23233 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23236 echo "Ok. You will need to correct config.sh before running make." >&4;
23238 $ls -1 "$xxx" > "$tdir/$$.tmp";
23239 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23240 xs_extensions="$xs_extensions $this_ext";
23241 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23242 xs_extensions="$xs_extensions $this_ext";
23243 elif $test -d "$xxx"; then
23244 nonxs_extensions="$nonxs_extensions $this_ext";
23246 $rm -f "$tdir/$$.tmp";
23254 eval $find_extensions
23258 eval $find_extensions
23262 eval $find_extensions
23263 set X $xs_extensions
23265 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23266 set X $nonxs_extensions
23268 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23270 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23272 : Now see which are supported on this system.
23274 for xxx in $xs_extensions ; do
23278 amigaos) avail_ext="$avail_ext $xxx" ;;
23283 $define) avail_ext="$avail_ext $xxx" ;;
23286 GDBM_File|gdbm_fil)
23288 $define) avail_ext="$avail_ext $xxx" ;;
23292 : XXX Do we need a useipcsysv variable here
23293 case "${d_msg}${d_sem}${d_shm}" in
23294 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23297 NDBM_File|ndbm_fil)
23300 case "$osname-$use64bitint" in
23303 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23306 *) avail_ext="$avail_ext $xxx" ;;
23311 ODBM_File|odbm_fil)
23312 case "${i_dbm}${i_rpcsvcdbm}" in
23314 case "$d_cplusplus" in
23315 define) ;; # delete as a function name will not work
23316 *) case "$osname-$use64bitint" in
23319 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23322 *) avail_ext="$avail_ext $xxx" ;;
23330 case "$useopcode" in
23331 true|define|y) avail_ext="$avail_ext $xxx" ;;
23335 case "$useposix" in
23336 true|define|y) avail_ext="$avail_ext $xxx" ;;
23340 case "$d_socket" in
23341 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23344 I18N/Langinfo|langinfo)
23345 case "$uselanginfo" in
23346 true|define|y) avail_ext="$avail_ext $xxx" ;;
23349 Sys/Syslog|sys/syslog)
23351 amigaos) ;; # not really very useful on AmigaOS
23353 : XXX syslog requires socket
23354 case "$d_socket" in
23355 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23361 case "$usethreads" in
23363 case "$use5005threads" in
23364 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23368 threads|threads/shared)
23369 # threads and threads::shared are special cases.
23370 # To stop people from asking "Perl 5.8.0 was supposed
23371 # to have this new fancy threads implementation but my
23372 # perl doesn't have it" and from people trying to
23373 # (re)install the threads module using CPAN.pm and
23374 # CPAN.pm then offering to reinstall Perl 5.8.0,
23375 # the threads.pm and threads/shared.pm will always be
23376 # there, croaking informatively ("you need to rebuild
23377 # all of Perl with threads, sorry") when threads haven't
23378 # been compiled in.
23380 avail_ext="$avail_ext $xxx"
23386 cygwin) avail_ext="$avail_ext $xxx" ;;
23389 XS/APItest|xs/apitest)
23390 # This is just for testing. Skip it unless we have dynamic loading.
23393 $define) avail_ext="$avail_ext $xxx" ;;
23396 XS/Typemap|xs/typemap)
23397 # This is just for testing. Skip it unless we have dynamic loading.
23399 $define) avail_ext="$avail_ext $xxx" ;;
23402 *) avail_ext="$avail_ext $xxx"
23411 case "$onlyextensions" in
23413 *) keepextensions=''
23414 echo "You have requested that only certain extensions be included..." >&4
23415 for i in $onlyextensions; do
23416 case " $avail_ext " in
23418 echo "Keeping extension $i."
23419 keepextensions="$keepextensions $i"
23421 *) echo "Ignoring extension $i." ;;
23424 avail_ext="$keepextensions"
23428 case "$noextensions" in
23430 *) keepextensions=''
23431 echo "You have requested that certain extensions be ignored..." >&4
23432 for i in $avail_ext; do
23433 case " $noextensions " in
23434 *" $i "*) echo "Ignoring extension $i." ;;
23435 *) echo "Keeping extension $i.";
23436 keepextensions="$keepextensions $i"
23440 avail_ext="$keepextensions"
23444 : Now see which nonxs extensions are supported on this system.
23445 : For now assume all are.
23447 for xxx in $nonxs_extensions ; do
23451 *) nonxs_ext="$nonxs_ext $xxx"
23463 A number of extensions are supplied with $package. You may choose to
23464 compile these extensions for dynamic loading (the default), compile
23465 them into the $package executable (static loading), or not include
23466 them at all. Answer "none" to include no extensions.
23467 Note that DynaLoader is always built and need not be mentioned here.
23470 case "$dynamic_ext" in
23472 : Exclude those listed in static_ext
23474 for xxx in $avail_ext; do
23475 case " $static_ext " in
23477 *) dflt="$dflt $xxx" ;;
23484 *) dflt="$dynamic_ext"
23485 # Perhaps we are reusing an old out-of-date config.sh.
23488 if test X"$dynamic_ext" != X"$avail_ext"; then
23490 NOTICE: Your previous config.sh list may be incorrect.
23491 The extensions now available to you are
23493 but the default list from your previous config.sh is
23505 rp="What extensions do you wish to load dynamically?"
23508 none) dynamic_ext=' ' ;;
23509 *) dynamic_ext="$ans" ;;
23512 case "$static_ext" in
23514 : Exclude those already listed in dynamic linking
23516 for xxx in $avail_ext; do
23517 case " $dynamic_ext " in
23519 *) dflt="$dflt $xxx" ;;
23526 *) dflt="$static_ext"
23533 rp="What extensions do you wish to load statically?"
23536 none) static_ext=' ' ;;
23537 *) static_ext="$ans" ;;
23542 A number of extensions are supplied with $package. Answer "none"
23543 to include no extensions.
23544 Note that DynaLoader is always built and need not be mentioned here.
23547 case "$static_ext" in
23548 '') dflt="$avail_ext" ;;
23549 *) dflt="$static_ext"
23550 # Perhaps we are reusing an old out-of-date config.sh.
23553 if test X"$static_ext" != X"$avail_ext"; then
23555 NOTICE: Your previous config.sh list may be incorrect.
23556 The extensions now available to you are
23558 but the default list from your previous config.sh is
23567 : Exclude those that are not xs extensions
23571 rp="What extensions do you wish to include?"
23574 none) static_ext=' ' ;;
23575 *) static_ext="$ans" ;;
23580 # Encode is a special case. If we are building Encode as a static
23581 # extension, we need to explicitly list its subextensions as well.
23582 # For other nested extensions, this is handled automatically by
23583 # the appropriate Makefile.PL.
23584 case " $static_ext " in
23585 *" Encode "*) # Add the subextensions of Encode
23587 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23588 static_ext="$static_ext Encode/$xxx"
23589 known_extensions="$known_extensions Encode/$xxx"
23595 set X $dynamic_ext $static_ext $nonxs_ext
23599 # Sanity check: We require an extension suitable for use with
23600 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23601 # should show up as failures in the test suite, but it's helpful to
23602 # catch them now.) The 'extensions' list is normally sorted
23603 # alphabetically, so we need to accept either
23604 # DB_File ... Fcntl ... IO ....
23605 # or something like
23606 # Fcntl ... NDBM_File ... IO ....
23607 case " $extensions" in
23608 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23609 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23610 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23611 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23612 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23616 : Remove libraries needed only for extensions
23617 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23618 : The exception is SunOS 4.x, which needs them.
23619 case "${osname}X${osvers}" in
23623 *) case "$usedl" in
23624 $define|true|[yY]*)
23625 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23629 *) perllibs="$libs"
23635 : Remove build directory name from cppstdin so it can be used from
23636 : either the present location or the final installed location.
23638 : Get out of the UU directory to get correct path name.
23640 case "$cppstdin" in
23642 echo "Stripping down cppstdin path name"
23648 : end of configuration questions
23650 echo "End of configuration questions."
23653 : back to where it started
23654 if test -d ../UU; then
23658 : configuration may be unconditionally patched via a 'config.arch' file
23659 if $test -f config.arch; then
23660 echo "I see a config.arch file, loading it." >&4
23664 : configuration may be patched via a 'config.over' file
23665 if $test -f config.over; then
23668 rp='I see a config.over file. Do you wish to load it?'
23671 n*) echo "OK, I'll ignore it.";;
23673 echo "Configuration override changes have been loaded."
23678 : in case they want portability, strip down executable paths
23679 case "$d_portable" in
23682 echo "Stripping down executable paths..." >&4
23683 for file in $loclist $trylist; do
23685 eval $file=`basename $temp`
23690 : create config.sh file
23692 echo "Creating config.sh..." >&4
23693 $spitshell <<EOT >config.sh
23696 # This file was produced by running the Configure script. It holds all the
23697 # definitions figured out by Configure. Should you modify one of these values,
23698 # do not forget to propagate your changes by running "Configure -der". You may
23699 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23702 # Package name : $package
23703 # Source directory : $src
23704 # Configuration time: $cf_time
23705 # Configured by : $cf_by
23706 # Target system : $myuname
23709 : Add in command line options if available
23710 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23712 $spitshell <<EOT >>config.sh
23721 Revision='$Revision'
23729 alignbytes='$alignbytes'
23730 aphostname='$aphostname'
23731 api_revision='$api_revision'
23732 api_subversion='$api_subversion'
23733 api_version='$api_version'
23734 api_versionstring='$api_versionstring'
23737 archlibexp='$archlibexp'
23738 archname64='$archname64'
23739 archname='$archname'
23740 archobjs='$archobjs'
23741 asctime_r_proto='$asctime_r_proto'
23750 byteorder='$byteorder'
23752 castflags='$castflags'
23755 cccdlflags='$cccdlflags'
23756 ccdlflags='$ccdlflags'
23758 ccflags_uselargefiles='$ccflags_uselargefiles'
23760 ccsymbols='$ccsymbols'
23761 ccversion='$ccversion'
23763 cf_email='$cf_email'
23765 charbits='$charbits'
23766 charsize='$charsize'
23770 clocktype='$clocktype'
23772 compress='$compress'
23773 contains='$contains'
23777 cpp_stuff='$cpp_stuff'
23778 cppccsymbols='$cppccsymbols'
23779 cppflags='$cppflags'
23781 cppminus='$cppminus'
23783 cppstdin='$cppstdin'
23784 cppsymbols='$cppsymbols'
23785 crypt_r_proto='$crypt_r_proto'
23786 cryptlib='$cryptlib'
23788 ctermid_r_proto='$ctermid_r_proto'
23789 ctime_r_proto='$ctime_r_proto'
23790 d_Gconvert='$d_Gconvert'
23791 d_PRIEUldbl='$d_PRIEUldbl'
23792 d_PRIFUldbl='$d_PRIFUldbl'
23793 d_PRIGUldbl='$d_PRIGUldbl'
23794 d_PRIXU64='$d_PRIXU64'
23795 d_PRId64='$d_PRId64'
23796 d_PRIeldbl='$d_PRIeldbl'
23797 d_PRIfldbl='$d_PRIfldbl'
23798 d_PRIgldbl='$d_PRIgldbl'
23799 d_PRIi64='$d_PRIi64'
23800 d_PRIo64='$d_PRIo64'
23801 d_PRIu64='$d_PRIu64'
23802 d_PRIx64='$d_PRIx64'
23803 d_SCNfldbl='$d_SCNfldbl'
23804 d__fwalk='$d__fwalk'
23805 d_accept4='$d_accept4'
23806 d_access='$d_access'
23807 d_accessx='$d_accessx'
23811 d_archlib='$d_archlib'
23812 d_asctime64='$d_asctime64'
23813 d_asctime_r='$d_asctime_r'
23818 d_attribute_deprecated='$d_attribute_deprecated'
23819 d_attribute_format='$d_attribute_format'
23820 d_attribute_malloc='$d_attribute_malloc'
23821 d_attribute_nonnull='$d_attribute_nonnull'
23822 d_attribute_noreturn='$d_attribute_noreturn'
23823 d_attribute_pure='$d_attribute_pure'
23824 d_attribute_unused='$d_attribute_unused'
23825 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23826 d_backtrace='$d_backtrace'
23828 d_bsdgetpgrp='$d_bsdgetpgrp'
23829 d_bsdsetpgrp='$d_bsdsetpgrp'
23830 d_builtin_add_overflow='$d_builtin_add_overflow'
23831 d_builtin_choose_expr='$d_builtin_choose_expr'
23832 d_builtin_expect='$d_builtin_expect'
23833 d_builtin_mul_overflow='$d_builtin_mul_overflow'
23834 d_builtin_sub_overflow='$d_builtin_sub_overflow'
23835 d_c99_variadic_macros='$d_c99_variadic_macros'
23836 d_casti32='$d_casti32'
23837 d_castneg='$d_castneg'
23840 d_chroot='$d_chroot'
23841 d_chsize='$d_chsize'
23843 d_clearenv='$d_clearenv'
23844 d_closedir='$d_closedir'
23845 d_cmsghdr_s='$d_cmsghdr_s'
23847 d_copysign='$d_copysign'
23848 d_copysignl='$d_copysignl'
23849 d_cplusplus='$d_cplusplus'
23851 d_crypt_r='$d_crypt_r'
23853 d_ctermid='$d_ctermid'
23854 d_ctermid_r='$d_ctermid_r'
23855 d_ctime64='$d_ctime64'
23856 d_ctime_r='$d_ctime_r'
23857 d_cuserid='$d_cuserid'
23858 d_dbminitproto='$d_dbminitproto'
23859 d_difftime64='$d_difftime64'
23860 d_difftime='$d_difftime'
23861 d_dir_dd_fd='$d_dir_dd_fd'
23863 d_dirnamlen='$d_dirnamlen'
23864 d_dladdr='$d_dladdr'
23865 d_dlerror='$d_dlerror'
23866 d_dlopen='$d_dlopen'
23867 d_dlsymun='$d_dlsymun'
23868 d_dosuid='$d_dosuid'
23869 d_double_has_inf='$d_double_has_inf'
23870 d_double_has_nan='$d_double_has_nan'
23871 d_double_has_negative_zero='$d_double_has_negative_zero'
23872 d_double_has_subnormals='$d_double_has_subnormals'
23873 d_double_style_cray='$d_double_style_cray'
23874 d_double_style_ibm='$d_double_style_ibm'
23875 d_double_style_ieee='$d_double_style_ieee'
23876 d_double_style_vax='$d_double_style_vax'
23877 d_drand48_r='$d_drand48_r'
23878 d_drand48proto='$d_drand48proto'
23881 d_duplocale='$d_duplocale'
23882 d_eaccess='$d_eaccess'
23883 d_endgrent='$d_endgrent'
23884 d_endgrent_r='$d_endgrent_r'
23885 d_endhent='$d_endhent'
23886 d_endhostent_r='$d_endhostent_r'
23887 d_endnent='$d_endnent'
23888 d_endnetent_r='$d_endnetent_r'
23889 d_endpent='$d_endpent'
23890 d_endprotoent_r='$d_endprotoent_r'
23891 d_endpwent='$d_endpwent'
23892 d_endpwent_r='$d_endpwent_r'
23893 d_endsent='$d_endsent'
23894 d_endservent_r='$d_endservent_r'
23895 d_eofnblk='$d_eofnblk'
23898 d_eunice='$d_eunice'
23901 d_faststdio='$d_faststdio'
23902 d_fchdir='$d_fchdir'
23903 d_fchmod='$d_fchmod'
23904 d_fchmodat='$d_fchmodat'
23905 d_fchown='$d_fchown'
23907 d_fcntl_can_lock='$d_fcntl_can_lock'
23908 d_fd_macros='$d_fd_macros'
23909 d_fd_set='$d_fd_set'
23910 d_fdclose='$d_fdclose'
23912 d_fds_bits='$d_fds_bits'
23913 d_fegetround='$d_fegetround'
23914 d_fgetpos='$d_fgetpos'
23915 d_finite='$d_finite'
23916 d_finitel='$d_finitel'
23917 d_flexfnam='$d_flexfnam'
23919 d_flockproto='$d_flockproto'
23924 d_fp_class='$d_fp_class'
23925 d_fp_classify='$d_fp_classify'
23926 d_fp_classl='$d_fp_classl'
23927 d_fpathconf='$d_fpathconf'
23928 d_fpclass='$d_fpclass'
23929 d_fpclassify='$d_fpclassify'
23930 d_fpclassl='$d_fpclassl'
23931 d_fpgetround='$d_fpgetround'
23932 d_fpos64_t='$d_fpos64_t'
23933 d_freelocale='$d_freelocale'
23934 d_frexpl='$d_frexpl'
23935 d_fs_data_s='$d_fs_data_s'
23936 d_fseeko='$d_fseeko'
23937 d_fsetpos='$d_fsetpos'
23938 d_fstatfs='$d_fstatfs'
23939 d_fstatvfs='$d_fstatvfs'
23941 d_ftello='$d_ftello'
23943 d_futimes='$d_futimes'
23944 d_gai_strerror='$d_gai_strerror'
23945 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23946 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23947 d_getaddrinfo='$d_getaddrinfo'
23948 d_getcwd='$d_getcwd'
23949 d_getespwnam='$d_getespwnam'
23950 d_getfsstat='$d_getfsstat'
23951 d_getgrent='$d_getgrent'
23952 d_getgrent_r='$d_getgrent_r'
23953 d_getgrgid_r='$d_getgrgid_r'
23954 d_getgrnam_r='$d_getgrnam_r'
23955 d_getgrps='$d_getgrps'
23956 d_gethbyaddr='$d_gethbyaddr'
23957 d_gethbyname='$d_gethbyname'
23958 d_gethent='$d_gethent'
23959 d_gethname='$d_gethname'
23960 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23961 d_gethostbyname_r='$d_gethostbyname_r'
23962 d_gethostent_r='$d_gethostent_r'
23963 d_gethostprotos='$d_gethostprotos'
23964 d_getitimer='$d_getitimer'
23965 d_getlogin='$d_getlogin'
23966 d_getlogin_r='$d_getlogin_r'
23967 d_getmnt='$d_getmnt'
23968 d_getmntent='$d_getmntent'
23969 d_getnameinfo='$d_getnameinfo'
23970 d_getnbyaddr='$d_getnbyaddr'
23971 d_getnbyname='$d_getnbyname'
23972 d_getnent='$d_getnent'
23973 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23974 d_getnetbyname_r='$d_getnetbyname_r'
23975 d_getnetent_r='$d_getnetent_r'
23976 d_getnetprotos='$d_getnetprotos'
23977 d_getpagsz='$d_getpagsz'
23978 d_getpbyname='$d_getpbyname'
23979 d_getpbynumber='$d_getpbynumber'
23980 d_getpent='$d_getpent'
23981 d_getpgid='$d_getpgid'
23982 d_getpgrp2='$d_getpgrp2'
23983 d_getpgrp='$d_getpgrp'
23984 d_getppid='$d_getppid'
23985 d_getprior='$d_getprior'
23986 d_getprotobyname_r='$d_getprotobyname_r'
23987 d_getprotobynumber_r='$d_getprotobynumber_r'
23988 d_getprotoent_r='$d_getprotoent_r'
23989 d_getprotoprotos='$d_getprotoprotos'
23990 d_getprpwnam='$d_getprpwnam'
23991 d_getpwent='$d_getpwent'
23992 d_getpwent_r='$d_getpwent_r'
23993 d_getpwnam_r='$d_getpwnam_r'
23994 d_getpwuid_r='$d_getpwuid_r'
23995 d_getsbyname='$d_getsbyname'
23996 d_getsbyport='$d_getsbyport'
23997 d_getsent='$d_getsent'
23998 d_getservbyname_r='$d_getservbyname_r'
23999 d_getservbyport_r='$d_getservbyport_r'
24000 d_getservent_r='$d_getservent_r'
24001 d_getservprotos='$d_getservprotos'
24002 d_getspnam='$d_getspnam'
24003 d_getspnam_r='$d_getspnam_r'
24004 d_gettimeod='$d_gettimeod'
24005 d_gmtime64='$d_gmtime64'
24006 d_gmtime_r='$d_gmtime_r'
24007 d_gnulibc='$d_gnulibc'
24008 d_grpasswd='$d_grpasswd'
24009 d_hasmntopt='$d_hasmntopt'
24013 d_ilogbl='$d_ilogbl'
24014 d_inc_version_list='$d_inc_version_list'
24015 d_inetaton='$d_inetaton'
24016 d_inetntop='$d_inetntop'
24017 d_inetpton='$d_inetpton'
24018 d_int64_t='$d_int64_t'
24019 d_ip_mreq='$d_ip_mreq'
24020 d_ip_mreq_source='$d_ip_mreq_source'
24021 d_ipv6_mreq='$d_ipv6_mreq'
24022 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24023 d_isascii='$d_isascii'
24024 d_isblank='$d_isblank'
24025 d_isfinite='$d_isfinite'
24026 d_isfinitel='$d_isfinitel'
24028 d_isinfl='$d_isinfl'
24029 d_isless='$d_isless'
24031 d_isnanl='$d_isnanl'
24032 d_isnormal='$d_isnormal'
24035 d_killpg='$d_killpg'
24036 d_lc_monetary_2008='$d_lc_monetary_2008'
24037 d_lchown='$d_lchown'
24038 d_ldbl_dig='$d_ldbl_dig'
24039 d_ldexpl='$d_ldexpl'
24040 d_lgamma='$d_lgamma'
24041 d_lgamma_r='$d_lgamma_r'
24042 d_libm_lib_version='$d_libm_lib_version'
24043 d_libname_unique='$d_libname_unique'
24045 d_linkat='$d_linkat'
24046 d_llrint='$d_llrint'
24047 d_llrintl='$d_llrintl'
24048 d_llround='$d_llround'
24049 d_llroundl='$d_llroundl'
24050 d_localeconv_l='$d_localeconv_l'
24051 d_localtime64='$d_localtime64'
24052 d_localtime_r='$d_localtime_r'
24053 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24054 d_locconv='$d_locconv'
24059 d_long_double_style_ieee='$d_long_double_style_ieee'
24060 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24061 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24062 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24063 d_long_double_style_vax='$d_long_double_style_vax'
24064 d_longdbl='$d_longdbl'
24065 d_longlong='$d_longlong'
24067 d_lrintl='$d_lrintl'
24068 d_lround='$d_lround'
24069 d_lroundl='$d_lroundl'
24070 d_lseekproto='$d_lseekproto'
24072 d_madvise='$d_madvise'
24073 d_malloc_good_size='$d_malloc_good_size'
24074 d_malloc_size='$d_malloc_size'
24076 d_mbrlen='$d_mbrlen'
24077 d_mbrtowc='$d_mbrtowc'
24078 d_mbstowcs='$d_mbstowcs'
24079 d_mbtowc='$d_mbtowc'
24080 d_memmem='$d_memmem'
24081 d_memrchr='$d_memrchr'
24083 d_mkdtemp='$d_mkdtemp'
24084 d_mkfifo='$d_mkfifo'
24085 d_mkostemp='$d_mkostemp'
24086 d_mkstemp='$d_mkstemp'
24087 d_mkstemps='$d_mkstemps'
24088 d_mktime64='$d_mktime64'
24089 d_mktime='$d_mktime'
24092 d_modflproto='$d_modflproto'
24093 d_mprotect='$d_mprotect'
24095 d_msg_ctrunc='$d_msg_ctrunc'
24096 d_msg_dontroute='$d_msg_dontroute'
24097 d_msg_oob='$d_msg_oob'
24098 d_msg_peek='$d_msg_peek'
24099 d_msg_proxy='$d_msg_proxy'
24100 d_msgctl='$d_msgctl'
24101 d_msgget='$d_msgget'
24102 d_msghdr_s='$d_msghdr_s'
24103 d_msgrcv='$d_msgrcv'
24104 d_msgsnd='$d_msgsnd'
24106 d_munmap='$d_munmap'
24107 d_mymalloc='$d_mymalloc'
24109 d_nanosleep='$d_nanosleep'
24111 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24112 d_nearbyint='$d_nearbyint'
24113 d_newlocale='$d_newlocale'
24114 d_nextafter='$d_nextafter'
24115 d_nexttoward='$d_nexttoward'
24117 d_nl_langinfo='$d_nl_langinfo'
24118 d_nv_preserves_uv='$d_nv_preserves_uv'
24119 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24120 d_off64_t='$d_off64_t'
24121 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24122 d_oldpthreads='$d_oldpthreads'
24123 d_oldsock='$d_oldsock'
24125 d_openat='$d_openat'
24126 d_pathconf='$d_pathconf'
24128 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24129 d_phostname='$d_phostname'
24133 d_portable='$d_portable'
24135 d_prctl_set_name='$d_prctl_set_name'
24136 d_printf_format_null='$d_printf_format_null'
24137 d_procselfexe='$d_procselfexe'
24138 d_pseudofork='$d_pseudofork'
24139 d_pthread_atfork='$d_pthread_atfork'
24140 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24141 d_pthread_yield='$d_pthread_yield'
24142 d_ptrdiff_t='$d_ptrdiff_t'
24144 d_pwchange='$d_pwchange'
24145 d_pwclass='$d_pwclass'
24146 d_pwcomment='$d_pwcomment'
24147 d_pwexpire='$d_pwexpire'
24148 d_pwgecos='$d_pwgecos'
24149 d_pwpasswd='$d_pwpasswd'
24150 d_pwquota='$d_pwquota'
24153 d_querylocale='$d_querylocale'
24154 d_random_r='$d_random_r'
24155 d_re_comp='$d_re_comp'
24156 d_readdir64_r='$d_readdir64_r'
24157 d_readdir='$d_readdir'
24158 d_readdir_r='$d_readdir_r'
24159 d_readlink='$d_readlink'
24161 d_recvmsg='$d_recvmsg'
24162 d_regcmp='$d_regcmp'
24163 d_regcomp='$d_regcomp'
24164 d_remainder='$d_remainder'
24165 d_remquo='$d_remquo'
24166 d_rename='$d_rename'
24167 d_renameat='$d_renameat'
24168 d_rewinddir='$d_rewinddir'
24172 d_sbrkproto='$d_sbrkproto'
24173 d_scalbn='$d_scalbn'
24174 d_scalbnl='$d_scalbnl'
24175 d_sched_yield='$d_sched_yield'
24176 d_scm_rights='$d_scm_rights'
24177 d_seekdir='$d_seekdir'
24178 d_select='$d_select'
24180 d_semctl='$d_semctl'
24181 d_semctl_semid_ds='$d_semctl_semid_ds'
24182 d_semctl_semun='$d_semctl_semun'
24183 d_semget='$d_semget'
24185 d_sendmsg='$d_sendmsg'
24186 d_setegid='$d_setegid'
24187 d_seteuid='$d_seteuid'
24188 d_setgrent='$d_setgrent'
24189 d_setgrent_r='$d_setgrent_r'
24190 d_setgrps='$d_setgrps'
24191 d_sethent='$d_sethent'
24192 d_sethostent_r='$d_sethostent_r'
24193 d_setitimer='$d_setitimer'
24194 d_setlinebuf='$d_setlinebuf'
24195 d_setlocale='$d_setlocale'
24196 d_setlocale_r='$d_setlocale_r'
24197 d_setnent='$d_setnent'
24198 d_setnetent_r='$d_setnetent_r'
24199 d_setpent='$d_setpent'
24200 d_setpgid='$d_setpgid'
24201 d_setpgrp2='$d_setpgrp2'
24202 d_setpgrp='$d_setpgrp'
24203 d_setprior='$d_setprior'
24204 d_setproctitle='$d_setproctitle'
24205 d_setprotoent_r='$d_setprotoent_r'
24206 d_setpwent='$d_setpwent'
24207 d_setpwent_r='$d_setpwent_r'
24208 d_setregid='$d_setregid'
24209 d_setresgid='$d_setresgid'
24210 d_setresuid='$d_setresuid'
24211 d_setreuid='$d_setreuid'
24212 d_setrgid='$d_setrgid'
24213 d_setruid='$d_setruid'
24214 d_setsent='$d_setsent'
24215 d_setservent_r='$d_setservent_r'
24216 d_setsid='$d_setsid'
24217 d_setvbuf='$d_setvbuf'
24220 d_shmatprototype='$d_shmatprototype'
24221 d_shmctl='$d_shmctl'
24223 d_shmget='$d_shmget'
24224 d_sigaction='$d_sigaction'
24225 d_siginfo_si_addr='$d_siginfo_si_addr'
24226 d_siginfo_si_band='$d_siginfo_si_band'
24227 d_siginfo_si_errno='$d_siginfo_si_errno'
24228 d_siginfo_si_fd='$d_siginfo_si_fd'
24229 d_siginfo_si_pid='$d_siginfo_si_pid'
24230 d_siginfo_si_status='$d_siginfo_si_status'
24231 d_siginfo_si_uid='$d_siginfo_si_uid'
24232 d_siginfo_si_value='$d_siginfo_si_value'
24233 d_signbit='$d_signbit'
24234 d_sigprocmask='$d_sigprocmask'
24235 d_sigsetjmp='$d_sigsetjmp'
24236 d_sin6_scope_id='$d_sin6_scope_id'
24237 d_sitearch='$d_sitearch'
24238 d_snprintf='$d_snprintf'
24239 d_sockaddr_in6='$d_sockaddr_in6'
24240 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24241 d_sockatmark='$d_sockatmark'
24242 d_sockatmarkproto='$d_sockatmarkproto'
24243 d_socket='$d_socket'
24244 d_socklen_t='$d_socklen_t'
24245 d_sockpair='$d_sockpair'
24246 d_socks5_init='$d_socks5_init'
24248 d_srand48_r='$d_srand48_r'
24249 d_srandom_r='$d_srandom_r'
24250 d_sresgproto='$d_sresgproto'
24251 d_sresuproto='$d_sresuproto'
24253 d_statblks='$d_statblks'
24254 d_statfs_f_flags='$d_statfs_f_flags'
24255 d_statfs_s='$d_statfs_s'
24256 d_static_inline='$d_static_inline'
24257 d_statvfs='$d_statvfs'
24258 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24259 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24260 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24261 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24262 d_stdio_stream_array='$d_stdio_stream_array'
24263 d_stdiobase='$d_stdiobase'
24264 d_stdstdio='$d_stdstdio'
24265 d_strcoll='$d_strcoll'
24266 d_strerror_l='$d_strerror_l'
24267 d_strerror_r='$d_strerror_r'
24268 d_strftime='$d_strftime'
24269 d_strlcat='$d_strlcat'
24270 d_strlcpy='$d_strlcpy'
24271 d_strnlen='$d_strnlen'
24272 d_strtod='$d_strtod'
24273 d_strtod_l='$d_strtod_l'
24274 d_strtol='$d_strtol'
24275 d_strtold='$d_strtold'
24276 d_strtold_l='$d_strtold_l'
24277 d_strtoll='$d_strtoll'
24278 d_strtoq='$d_strtoq'
24279 d_strtoul='$d_strtoul'
24280 d_strtoull='$d_strtoull'
24281 d_strtouq='$d_strtouq'
24282 d_strxfrm='$d_strxfrm'
24283 d_suidsafe='$d_suidsafe'
24284 d_symlink='$d_symlink'
24285 d_syscall='$d_syscall'
24286 d_syscallproto='$d_syscallproto'
24287 d_sysconf='$d_sysconf'
24288 d_sysernlst='$d_sysernlst'
24289 d_syserrlst='$d_syserrlst'
24290 d_system='$d_system'
24291 d_tcgetpgrp='$d_tcgetpgrp'
24292 d_tcsetpgrp='$d_tcsetpgrp'
24293 d_telldir='$d_telldir'
24294 d_telldirproto='$d_telldirproto'
24295 d_tgamma='$d_tgamma'
24296 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24298 d_timegm='$d_timegm'
24300 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24301 d_tm_tm_zone='$d_tm_tm_zone'
24302 d_tmpnam_r='$d_tmpnam_r'
24304 d_truncate='$d_truncate'
24305 d_truncl='$d_truncl'
24306 d_ttyname_r='$d_ttyname_r'
24307 d_tzname='$d_tzname'
24308 d_u32align='$d_u32align'
24309 d_ualarm='$d_ualarm'
24312 d_union_semun='$d_union_semun'
24313 d_unlinkat='$d_unlinkat'
24314 d_unordered='$d_unordered'
24315 d_unsetenv='$d_unsetenv'
24316 d_uselocale='$d_uselocale'
24317 d_usleep='$d_usleep'
24318 d_usleepproto='$d_usleepproto'
24320 d_vendorarch='$d_vendorarch'
24321 d_vendorbin='$d_vendorbin'
24322 d_vendorlib='$d_vendorlib'
24323 d_vendorscript='$d_vendorscript'
24325 d_void_closedir='$d_void_closedir'
24326 d_voidsig='$d_voidsig'
24327 d_voidtty='$d_voidtty'
24328 d_vsnprintf='$d_vsnprintf'
24330 d_waitpid='$d_waitpid'
24331 d_wcscmp='$d_wcscmp'
24332 d_wcstombs='$d_wcstombs'
24333 d_wcsxfrm='$d_wcsxfrm'
24334 d_wctomb='$d_wctomb'
24335 d_writev='$d_writev'
24338 db_hashtype='$db_hashtype'
24339 db_prefixtype='$db_prefixtype'
24340 db_version_major='$db_version_major'
24341 db_version_minor='$db_version_minor'
24342 db_version_patch='$db_version_patch'
24343 default_inc_excludes_dot='$default_inc_excludes_dot'
24344 direntrytype='$direntrytype'
24347 doubleinfbytes='$doubleinfbytes'
24348 doublekind='$doublekind'
24349 doublemantbits='$doublemantbits'
24350 doublenanbytes='$doublenanbytes'
24351 doublesize='$doublesize'
24353 drand48_r_proto='$drand48_r_proto'
24355 dtraceobject='$dtraceobject'
24356 dtracexnolibs='$dtracexnolibs'
24357 dynamic_ext='$dynamic_ext'
24363 endgrent_r_proto='$endgrent_r_proto'
24364 endhostent_r_proto='$endhostent_r_proto'
24365 endnetent_r_proto='$endnetent_r_proto'
24366 endprotoent_r_proto='$endprotoent_r_proto'
24367 endpwent_r_proto='$endpwent_r_proto'
24368 endservent_r_proto='$endservent_r_proto'
24369 eunicefix='$eunicefix'
24372 extensions='$extensions'
24373 extern_C='$extern_C'
24375 fflushNULL='$fflushNULL'
24376 fflushall='$fflushall'
24378 firstmakefile='$firstmakefile'
24380 fpossize='$fpossize'
24381 fpostype='$fpostype'
24382 freetype='$freetype'
24385 full_csh='$full_csh'
24386 full_sed='$full_sed'
24387 gccansipedantic='$gccansipedantic'
24388 gccosandvers='$gccosandvers'
24389 gccversion='$gccversion'
24390 getgrent_r_proto='$getgrent_r_proto'
24391 getgrgid_r_proto='$getgrgid_r_proto'
24392 getgrnam_r_proto='$getgrnam_r_proto'
24393 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24394 gethostbyname_r_proto='$gethostbyname_r_proto'
24395 gethostent_r_proto='$gethostent_r_proto'
24396 getlogin_r_proto='$getlogin_r_proto'
24397 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24398 getnetbyname_r_proto='$getnetbyname_r_proto'
24399 getnetent_r_proto='$getnetent_r_proto'
24400 getprotobyname_r_proto='$getprotobyname_r_proto'
24401 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24402 getprotoent_r_proto='$getprotoent_r_proto'
24403 getpwent_r_proto='$getpwent_r_proto'
24404 getpwnam_r_proto='$getpwnam_r_proto'
24405 getpwuid_r_proto='$getpwuid_r_proto'
24406 getservbyname_r_proto='$getservbyname_r_proto'
24407 getservbyport_r_proto='$getservbyport_r_proto'
24408 getservent_r_proto='$getservent_r_proto'
24409 getspnam_r_proto='$getspnam_r_proto'
24410 gidformat='$gidformat'
24416 gmtime_r_proto='$gmtime_r_proto'
24417 gnulibc_version='$gnulibc_version'
24419 groupcat='$groupcat'
24420 groupstype='$groupstype'
24423 h_sysfile='$h_sysfile'
24426 hostgenerate='$hostgenerate'
24427 hostosname='$hostosname'
24428 hostperl='$hostperl'
24429 html1dir='$html1dir'
24430 html1direxp='$html1direxp'
24431 html3dir='$html3dir'
24432 html3direxp='$html3direxp'
24441 i_arpainet='$i_arpainet'
24443 i_bsdioctl='$i_bsdioctl'
24447 i_dirent='$i_dirent'
24449 i_execinfo='$i_execinfo'
24453 i_fp_class='$i_fp_class'
24455 i_gdbm_ndbm='$i_gdbm_ndbm'
24456 i_gdbmndbm='$i_gdbmndbm'
24458 i_ieeefp='$i_ieeefp'
24459 i_inttypes='$i_inttypes'
24460 i_langinfo='$i_langinfo'
24461 i_libutil='$i_libutil'
24462 i_locale='$i_locale'
24463 i_machcthr='$i_machcthr'
24464 i_malloc='$i_malloc'
24465 i_mallocmalloc='$i_mallocmalloc'
24466 i_mntent='$i_mntent'
24469 i_neterrno='$i_neterrno'
24470 i_netinettcp='$i_netinettcp'
24474 i_pthread='$i_pthread'
24476 i_quadmath='$i_quadmath'
24477 i_rpcsvcdbm='$i_rpcsvcdbm'
24479 i_shadow='$i_shadow'
24481 i_stdbool='$i_stdbool'
24482 i_stdint='$i_stdint'
24483 i_stdlib='$i_stdlib'
24484 i_sunmath='$i_sunmath'
24485 i_sysaccess='$i_sysaccess'
24486 i_sysdir='$i_sysdir'
24487 i_sysfile='$i_sysfile'
24488 i_sysfilio='$i_sysfilio'
24490 i_sysioctl='$i_sysioctl'
24491 i_syslog='$i_syslog'
24492 i_sysmman='$i_sysmman'
24493 i_sysmode='$i_sysmode'
24494 i_sysmount='$i_sysmount'
24495 i_sysndir='$i_sysndir'
24496 i_sysparam='$i_sysparam'
24497 i_syspoll='$i_syspoll'
24498 i_sysresrc='$i_sysresrc'
24499 i_syssecrt='$i_syssecrt'
24500 i_sysselct='$i_sysselct'
24501 i_syssockio='$i_syssockio'
24502 i_sysstat='$i_sysstat'
24503 i_sysstatfs='$i_sysstatfs'
24504 i_sysstatvfs='$i_sysstatvfs'
24505 i_systime='$i_systime'
24506 i_systimek='$i_systimek'
24507 i_systimes='$i_systimes'
24508 i_systypes='$i_systypes'
24509 i_sysuio='$i_sysuio'
24511 i_sysutsname='$i_sysutsname'
24512 i_sysvfs='$i_sysvfs'
24513 i_syswait='$i_syswait'
24514 i_termio='$i_termio'
24515 i_termios='$i_termios'
24517 i_unistd='$i_unistd'
24522 i_xlocale='$i_xlocale'
24523 ignore_versioned_solibs='$ignore_versioned_solibs'
24524 inc_version_list='$inc_version_list'
24525 inc_version_list_init='$inc_version_list_init'
24529 initialinstalllocation='$initialinstalllocation'
24530 installarchlib='$installarchlib'
24531 installbin='$installbin'
24532 installhtml1dir='$installhtml1dir'
24533 installhtml3dir='$installhtml3dir'
24534 installman1dir='$installman1dir'
24535 installman3dir='$installman3dir'
24536 installprefix='$installprefix'
24537 installprefixexp='$installprefixexp'
24538 installprivlib='$installprivlib'
24539 installscript='$installscript'
24540 installsitearch='$installsitearch'
24541 installsitebin='$installsitebin'
24542 installsitehtml1dir='$installsitehtml1dir'
24543 installsitehtml3dir='$installsitehtml3dir'
24544 installsitelib='$installsitelib'
24545 installsiteman1dir='$installsiteman1dir'
24546 installsiteman3dir='$installsiteman3dir'
24547 installsitescript='$installsitescript'
24548 installstyle='$installstyle'
24549 installusrbinperl='$installusrbinperl'
24550 installvendorarch='$installvendorarch'
24551 installvendorbin='$installvendorbin'
24552 installvendorhtml1dir='$installvendorhtml1dir'
24553 installvendorhtml3dir='$installvendorhtml3dir'
24554 installvendorlib='$installvendorlib'
24555 installvendorman1dir='$installvendorman1dir'
24556 installvendorman3dir='$installvendorman3dir'
24557 installvendorscript='$installvendorscript'
24559 issymlink='$issymlink'
24560 ivdformat='$ivdformat'
24563 known_extensions='$known_extensions'
24566 ld_can_script='$ld_can_script'
24567 lddlflags='$lddlflags'
24569 ldflags_uselargefiles='$ldflags_uselargefiles'
24570 ldlibpthname='$ldlibpthname'
24577 libsdirs='$libsdirs'
24578 libsfiles='$libsfiles'
24579 libsfound='$libsfound'
24580 libspath='$libspath'
24581 libswanted='$libswanted'
24582 libswanted_uselargefiles='$libswanted_uselargefiles'
24588 localtime_r_proto='$localtime_r_proto'
24589 locincpth='$locincpth'
24590 loclibpth='$loclibpth'
24591 longdblinfbytes='$longdblinfbytes'
24592 longdblkind='$longdblkind'
24593 longdblmantbits='$longdblmantbits'
24594 longdblnanbytes='$longdblnanbytes'
24595 longdblsize='$longdblsize'
24596 longlongsize='$longlongsize'
24597 longsize='$longsize'
24601 lseeksize='$lseeksize'
24602 lseektype='$lseektype'
24606 make_set_make='$make_set_make'
24607 mallocobj='$mallocobj'
24608 mallocsrc='$mallocsrc'
24609 malloctype='$malloctype'
24611 man1direxp='$man1direxp'
24614 man3direxp='$man3direxp'
24616 mips_type='$mips_type'
24617 mistrustnm='$mistrustnm'
24619 mmaptype='$mmaptype'
24620 modetype='$modetype'
24622 multiarch='$multiarch'
24624 myarchname='$myarchname'
24625 mydomain='$mydomain'
24626 myhostname='$myhostname'
24629 need_va_copy='$need_va_copy'
24630 netdb_hlen_type='$netdb_hlen_type'
24631 netdb_host_type='$netdb_host_type'
24632 netdb_name_type='$netdb_name_type'
24633 netdb_net_type='$netdb_net_type'
24636 nm_so_opt='$nm_so_opt'
24637 nonxs_ext='$nonxs_ext'
24639 nvEUformat='$nvEUformat'
24640 nvFUformat='$nvFUformat'
24641 nvGUformat='$nvGUformat'
24642 nv_overflows_integers_at='$nv_overflows_integers_at'
24643 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24644 nveformat='$nveformat'
24645 nvfformat='$nvfformat'
24646 nvgformat='$nvgformat'
24647 nvmantbits='$nvmantbits'
24650 o_nonblock='$o_nonblock'
24652 old_pthread_create_joinable='$old_pthread_create_joinable'
24653 optimize='$optimize'
24654 orderlib='$orderlib'
24657 otherlibdirs='$otherlibdirs'
24661 patchlevel='$patchlevel'
24662 path_sep='$path_sep'
24665 perl_patchlevel='$perl_patchlevel'
24666 perl_static_inline='$perl_static_inline'
24667 perladmin='$perladmin'
24668 perllibs='$perllibs'
24669 perlpath='$perlpath'
24671 phostname='$phostname'
24677 prefixexp='$prefixexp'
24679 privlibexp='$privlibexp'
24680 procselfexe='$procselfexe'
24682 quadkind='$quadkind'
24683 quadtype='$quadtype'
24684 randbits='$randbits'
24685 randfunc='$randfunc'
24686 random_r_proto='$random_r_proto'
24687 randseedtype='$randseedtype'
24689 rd_nodata='$rd_nodata'
24690 readdir64_r_proto='$readdir64_r_proto'
24691 readdir_r_proto='$readdir_r_proto'
24692 revision='$revision'
24698 sGMTIME_max='$sGMTIME_max'
24699 sGMTIME_min='$sGMTIME_min'
24700 sLOCALTIME_max='$sLOCALTIME_max'
24701 sLOCALTIME_min='$sLOCALTIME_min'
24702 sPRIEUldbl='$sPRIEUldbl'
24703 sPRIFUldbl='$sPRIFUldbl'
24704 sPRIGUldbl='$sPRIGUldbl'
24705 sPRIXU64='$sPRIXU64'
24707 sPRIeldbl='$sPRIeldbl'
24708 sPRIfldbl='$sPRIfldbl'
24709 sPRIgldbl='$sPRIgldbl'
24714 sSCNfldbl='$sSCNfldbl'
24715 sched_yield='$sched_yield'
24716 scriptdir='$scriptdir'
24717 scriptdirexp='$scriptdirexp'
24719 seedfunc='$seedfunc'
24720 selectminbits='$selectminbits'
24721 selecttype='$selecttype'
24722 sendmail='$sendmail'
24723 setgrent_r_proto='$setgrent_r_proto'
24724 sethostent_r_proto='$sethostent_r_proto'
24725 setlocale_r_proto='$setlocale_r_proto'
24726 setnetent_r_proto='$setnetent_r_proto'
24727 setprotoent_r_proto='$setprotoent_r_proto'
24728 setpwent_r_proto='$setpwent_r_proto'
24729 setservent_r_proto='$setservent_r_proto'
24732 sharpbang='$sharpbang'
24733 shmattype='$shmattype'
24734 shortsize='$shortsize'
24737 sig_count='$sig_count'
24738 sig_name='$sig_name'
24739 sig_name_init='$sig_name_init'
24741 sig_num_init='$sig_num_init'
24742 sig_size='$sig_size'
24743 signal_t='$signal_t'
24744 sitearch='$sitearch'
24745 sitearchexp='$sitearchexp'
24747 sitebinexp='$sitebinexp'
24748 sitehtml1dir='$sitehtml1dir'
24749 sitehtml1direxp='$sitehtml1direxp'
24750 sitehtml3dir='$sitehtml3dir'
24751 sitehtml3direxp='$sitehtml3direxp'
24753 sitelib_stem='$sitelib_stem'
24754 sitelibexp='$sitelibexp'
24755 siteman1dir='$siteman1dir'
24756 siteman1direxp='$siteman1direxp'
24757 siteman3dir='$siteman3dir'
24758 siteman3direxp='$siteman3direxp'
24759 siteprefix='$siteprefix'
24760 siteprefixexp='$siteprefixexp'
24761 sitescript='$sitescript'
24762 sitescriptexp='$sitescriptexp'
24763 sizesize='$sizesize'
24764 sizetype='$sizetype'
24768 sockethdr='$sockethdr'
24769 socketlib='$socketlib'
24770 socksizetype='$socksizetype'
24772 spackage='$spackage'
24773 spitshell='$spitshell'
24774 srand48_r_proto='$srand48_r_proto'
24775 srandom_r_proto='$srandom_r_proto'
24777 ssizetype='$ssizetype'
24778 st_ino_sign='$st_ino_sign'
24779 st_ino_size='$st_ino_size'
24780 startperl='$startperl'
24782 static_ext='$static_ext'
24784 stdio_base='$stdio_base'
24785 stdio_bufsiz='$stdio_bufsiz'
24786 stdio_cnt='$stdio_cnt'
24787 stdio_filbuf='$stdio_filbuf'
24788 stdio_ptr='$stdio_ptr'
24789 stdio_stream_array='$stdio_stream_array'
24790 strerror_r_proto='$strerror_r_proto'
24792 subversion='$subversion'
24797 targetarch='$targetarch'
24798 targetdir='$targetdir'
24799 targetenv='$targetenv'
24800 targethost='$targethost'
24801 targetmkdir='$targetmkdir'
24802 targetport='$targetport'
24803 targetsh='$targetsh'
24807 timeincl='$timeincl'
24808 timetype='$timetype'
24809 tmpnam_r_proto='$tmpnam_r_proto'
24815 ttyname_r_proto='$ttyname_r_proto'
24824 uidformat='$uidformat'
24830 uquadtype='$uquadtype'
24831 use5005threads='$use5005threads'
24832 use64bitall='$use64bitall'
24833 use64bitint='$use64bitint'
24834 usecbacktrace='$usecbacktrace'
24835 usecrosscompile='$usecrosscompile'
24836 usedevel='$usedevel'
24838 usedtrace='$usedtrace'
24839 usefaststdio='$usefaststdio'
24840 useithreads='$useithreads'
24841 usekernprocpathname='$usekernprocpathname'
24842 uselanginfo='$uselanginfo'
24843 uselargefiles='$uselargefiles'
24844 uselongdouble='$uselongdouble'
24845 usemallocwrap='$usemallocwrap'
24846 usemorebits='$usemorebits'
24847 usemultiplicity='$usemultiplicity'
24848 usemymalloc='$usemymalloc'
24850 usensgetexecutablepath='$usensgetexecutablepath'
24851 useopcode='$useopcode'
24852 useperlio='$useperlio'
24853 useposix='$useposix'
24854 usequadmath='$usequadmath'
24855 usereentrant='$usereentrant'
24856 userelocatableinc='$userelocatableinc'
24857 useshrplib='$useshrplib'
24858 usesitecustomize='$usesitecustomize'
24859 usesocks='$usesocks'
24860 usethreads='$usethreads'
24861 usevendorprefix='$usevendorprefix'
24862 useversionedarchname='$useversionedarchname'
24863 usevfork='$usevfork'
24866 uvXUformat='$uvXUformat'
24867 uvoformat='$uvoformat'
24870 uvuformat='$uvuformat'
24871 uvxformat='$uvxformat'
24872 vendorarch='$vendorarch'
24873 vendorarchexp='$vendorarchexp'
24874 vendorbin='$vendorbin'
24875 vendorbinexp='$vendorbinexp'
24876 vendorhtml1dir='$vendorhtml1dir'
24877 vendorhtml1direxp='$vendorhtml1direxp'
24878 vendorhtml3dir='$vendorhtml3dir'
24879 vendorhtml3direxp='$vendorhtml3direxp'
24880 vendorlib='$vendorlib'
24881 vendorlib_stem='$vendorlib_stem'
24882 vendorlibexp='$vendorlibexp'
24883 vendorman1dir='$vendorman1dir'
24884 vendorman1direxp='$vendorman1direxp'
24885 vendorman3dir='$vendorman3dir'
24886 vendorman3direxp='$vendorman3direxp'
24887 vendorprefix='$vendorprefix'
24888 vendorprefixexp='$vendorprefixexp'
24889 vendorscript='$vendorscript'
24890 vendorscriptexp='$vendorscriptexp'
24892 version_patchlevel_string='$version_patchlevel_string'
24893 versiononly='$versiononly'
24897 yaccflags='$yaccflags'
24902 : add special variables
24903 $test -f $src/patchlevel.h && \
24904 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24905 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24906 echo "PERL_CONFIG_SH=true" >>config.sh
24908 : propagate old symbols
24909 if $test -f UU/config.sh; then
24910 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24911 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24912 config.sh config.sh UU/oldconfig.sh |\
24913 $sort | $uniq -u >UU/oldsyms
24914 set X `$cat UU/oldsyms`
24920 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24922 echo ": Variables propagated from previous config.sh file." >>config.sh
24923 for sym in `$cat UU/oldsyms`; do
24924 echo " Propagating $hint variable "'$'"$sym..."
24925 eval 'tmp="$'"${sym}"'"'
24927 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24933 : preserve RCS keywords in files with variable substitution, grrr
24936 : Finish up by extracting the .SH files
24939 echo "Stopping at your request, leaving temporary files around."
24949 If you'd like to make any changes to the config.sh file before I begin
24950 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24953 rp="Press return or use a shell escape to edit config.sh:"
24958 *) : in case they cannot read
24959 sh 1>&4 -c "$ans";;
24964 : if this fails, just run all the .SH files by hand
24973 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24980 Now you need to generate make dependencies by running "$make depend".
24981 You might prefer to run it in background: "$make depend > makedepend.out &"
24982 It can take a while, so you might not want to run it right now.
24987 rp="Run $make depend now?"
24991 $make depend && echo "Now you must run '$make'."
24994 echo "You must run '$make depend' then '$make'."
24997 elif test -f [Mm]akefile; then
24999 echo "Now you must run a $make."
25001 echo "Configure done."
25004 if $test -f Policy.sh; then
25007 If you compile $package on a different machine or from a different object
25008 directory, copy the Policy.sh file from this object directory to the
25009 new one before you run Configure -- this will help you with most of
25010 the policy defaults.
25014 if $test -f UU/config.msg; then
25015 echo "Hmm. I also noted the following information while running:"
25017 $cat UU/config.msg >&4
25019 $rm -f kit*isdone ark*isdone