3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # (with additional metaconfig patches by perlbug@perl.org)
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
345 useversionedarchname=''
351 initialinstalllocation=''
384 d_attribute_deprecated=''
385 d_attribute_format=''
386 d_attribute_malloc=''
387 d_attribute_nonnull=''
388 d_attribute_noreturn=''
390 d_attribute_unused=''
391 d_attribute_warn_unused_result=''
392 d_printf_format_null=''
394 d_builtin_choose_expr=''
396 d_builtin_add_overflow=''
397 d_builtin_mul_overflow=''
398 d_builtin_sub_overflow=''
399 d_c99_variadic_macros=''
449 endhostent_r_proto=''
455 endprotoent_r_proto=''
461 endservent_r_proto=''
533 gethostbyaddr_r_proto=''
535 gethostbyname_r_proto=''
537 gethostent_r_proto=''
550 getnetbyaddr_r_proto=''
552 getnetbyname_r_proto=''
566 d_getprotobyname_r=''
567 getprotobyname_r_proto=''
568 d_getprotobynumber_r=''
569 getprotobynumber_r_proto=''
571 getprotoent_r_proto=''
583 getservbyname_r_proto=''
585 getservbyport_r_proto=''
587 getservent_r_proto=''
620 d_lc_monetary_2008=''
625 d_libm_lib_version=''
633 d_localtime_r_needs_tzset=''
641 d_long_double_style_ieee=''
642 d_long_double_style_ieee_doubledouble=''
643 d_long_double_style_ieee_extended=''
644 d_long_double_style_ieee_std=''
645 d_long_double_style_vax=''
658 d_malloc_good_size=''
700 d_thread_safe_nl_langinfo_l=''
714 d_old_pthread_create_joinable=''
715 old_pthread_create_joinable=''
717 d_pthread_attr_setscope=''
762 sethostent_r_proto=''
779 setprotoent_r_proto=''
791 setservent_r_proto=''
804 d_siginfo_si_errno=''
807 d_siginfo_si_status=''
809 d_siginfo_si_value=''
821 d_ipv6_mreq_source=''
850 perl_static_inline=''
855 d_stdio_ptr_lval_nochange_cnt=''
856 d_stdio_ptr_lval_sets_cnt=''
935 default_inc_excludes_dot=''
1001 d_gdbm_ndbm_h_uses_prototypes=''
1002 d_gdbmndbm_h_uses_prototypes=''
1004 d_ndbm_h_uses_prototypes=''
1074 d_inc_version_list=''
1076 inc_version_list_init=''
1084 installusrbinperl=''
1100 ignore_versioned_solibs=''
1116 d_double_has_negative_zero=''
1117 d_double_has_subnormals=''
1118 d_double_style_cray=''
1119 d_double_style_ibm=''
1120 d_double_style_ieee=''
1121 d_double_style_vax=''
1172 d_perl_otherlibdirs=''
1180 api_versionstring=''
1186 version_patchlevel_string=''
1190 d_nv_preserves_uv=''
1191 d_nv_zero_is_allbits_zero=''
1202 nv_overflows_integers_at=''
1203 nv_preserves_uv_bits=''
1275 installsitehtml1dir=''
1278 installsitehtml3dir=''
1285 installsiteman1dir=''
1288 installsiteman3dir=''
1293 installsitescript=''
1311 d_stdio_stream_array=''
1312 stdio_stream_array=''
1330 usekernprocpathname=''
1331 ccflags_uselargefiles=''
1332 ldflags_uselargefiles=''
1333 libswanted_uselargefiles=''
1342 usensgetexecutablepath=''
1355 installvendorarch=''
1362 installvendorhtml1dir=''
1364 vendorhtml1direxp=''
1365 installvendorhtml3dir=''
1367 vendorhtml3direxp=''
1373 installvendorman1dir=''
1376 installvendorman3dir=''
1383 installvendorscript=''
1394 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1397 : We must find out about Eunice early
1399 if test -f /etc/unixtovms; then
1400 eunicefix=/etc/unixtovms
1402 if test -f /etc/unixtovms.exe; then
1403 eunicefix=/etc/unixtovms.exe
1406 : Set executable suffix now -- needed before hints available
1407 if test -f "/libs/version.library"; then
1410 elif test -f "/system/gnu_library/bin/ar.pm"; then
1413 elif test -n "$DJGPP"; then
1416 elif test -f /kern/cookiejar; then
1419 elif test -d c:/. -o -n "$is_os2" ; then
1426 : Possible local include directories to search.
1427 : Set locincpth to "" in a hint file to defeat local include searches.
1428 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1429 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1431 : no include file wanted by default
1434 : Enable -DEBUGGING and -DDEBUGGING from the command line
1438 : Trailing extension. Override this in a hint file, if needed.
1439 : Extra object files, if any, needed on this platform.
1442 : change the next line if compiling for Xenix/286 on Xenix/386
1443 xlibpth='/usr/lib/386 /lib/386'
1444 : Possible local library directories to search.
1445 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1446 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1448 : general looking path for locating libraries
1449 glibpth="/lib /usr/lib $xlibpth"
1450 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1451 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1452 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1453 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1455 : Private path used by Configure to find libraries. Its value
1456 : is prepended to libpth. This variable takes care of special
1457 : machines, like the mips. Usually, it should be empty.
1460 : default library list
1462 : some systems want to use only the non-versioned libso:s
1463 ignore_versioned_solibs=''
1467 : set useposix=false in your hint file to disable the POSIX extension.
1469 : set useopcode=false in your hint file to disable the Opcode extension.
1472 ccflags_uselargefiles=''
1473 ldflags_uselargefiles=''
1474 libswanted_uselargefiles=''
1475 : set usemultiplicity on the Configure command line to enable multiplicity.
1476 : set usesocks on the Configure command line to enable socks.
1478 : set usethreads on the Configure command line to enable threads.
1479 usereentrant='undef'
1480 : List of libraries we want.
1481 : If anyone needs extra -lxxx, put those in a hint file.
1482 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1483 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1484 : We probably want to search /usr/shlib before most other libraries.
1485 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1486 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1487 glibpth="/usr/shlib $glibpth"
1488 : Do not use vfork unless overridden by a hint file.
1491 : Find the basic shell for Bourne shell scripts
1495 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1498 if test -f "$xxx"; then
1501 : Build up a list and do a single loop so we can 'break' out.
1502 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1503 for xxx in sh bash ksh pdksh ash; do
1505 try="$try ${p}/${xxx}"
1509 if test -f "$xxx"; then
1512 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1515 elif test -f "$xxx.exe"; then
1526 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1528 Usually it's in /bin/sh. How did you even get this far?
1529 Please contact me (Perl Maintainers) at perlbug@perl.org and
1530 we'll try to straighten this all out.
1536 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1537 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1540 : see if sh knows # comments
1541 if `$sh -c '#' >/dev/null 2>&1`; then
1545 test -f $xcat$_exe || xcat=/usr/bin/cat
1546 if test ! -f $xcat$_exe; then
1547 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1548 if test -f $p/cat$_exe; then
1553 if test ! -f $xcat$_exe; then
1554 echo "Can't find cat anywhere!"
1558 echo "#!$xcat" >sharp
1561 ./sharp > today 2>/dev/null
1562 if test -s today; then
1565 echo "#! $xcat" > sharp
1568 ./sharp > today 2>/dev/null
1569 if test -s today; then
1577 echo "Your $sh doesn't grok # comments--I will strip them later on."
1580 echo "exec grep -v '^[ ]*#'" >spitshell
1582 $eunicefix spitshell
1583 spitshell=`pwd`/spitshell
1585 echo "I presume that if # doesn't work, #! won't work either!"
1590 : figure out how to guarantee sh startup
1592 '') startsh=${sharpbang}${sh} ;;
1604 : echo "Yup, it does."
1606 echo "Hmm... '$startsh' does not guarantee sh startup..."
1607 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1611 : Save command line options in file UU/cmdline.opt for later use in
1612 : generating config.sh.
1613 cat > cmdline.opt <<EOSH
1614 : Configure command line arguments.
1623 cat >>cmdline.opt <<EOSH
1624 config_arg$argn='$arg'
1626 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1629 arg_exp=`cat cmdl.opt`
1630 args_exp="$args_exp$args_sep'$arg_exp'"
1631 argn=`expr $argn + 1`
1636 : produce awk script to parse command line options
1637 cat >options.awk <<'EOF'
1639 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1641 len = length(optstr);
1642 for (i = 1; i <= len; i++) {
1643 c = substr(optstr, i, 1);
1644 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1655 if (substr(str, 1, 1) != "-") {
1656 printf("'%s'\n", str);
1660 for (i = 2; i <= len; i++) {
1661 c = substr(str, i, 1);
1663 printf("-%s\n", substr(str, i));
1669 printf("'%s'\n", substr(str, i + 1));
1682 : process the command line options
1683 set X `for arg in "$@"; do echo "X$arg"; done |
1684 sed -e s/X// | awk -f options.awk`
1689 : set up default values
1698 rm -f optdef.sh posthint.sh
1699 cat >optdef.sh <<EOS
1705 while test $# -gt 0; do
1707 -d) shift; fastread=yes;;
1708 -e) shift; alldone=cont;;
1712 if test -r "$1"; then
1715 echo "$me: cannot read config file $1." >&2
1721 -h) shift; error=true;;
1722 -r) shift; reuseval=true;;
1723 -s) shift; silent=true; realsilent=true;;
1724 -E) shift; alldone=exit;;
1725 -K) shift; knowitall=true;;
1727 -S) shift; silent=true; extractsh=true;;
1732 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1733 echo "$me: ignoring -D $1" >&2
1736 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1737 *) echo "$1='define'" >> optdef.sh;;
1744 *=) echo "$1" >> optdef.sh;;
1746 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1747 echo "$me: ignoring -U $1" >&2
1749 *) echo "$1='undef'" >> optdef.sh;;
1760 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1764 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1765 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1771 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1772 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1773 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1774 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1775 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1776 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1782 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1784 echo "$yyy=''" >> posthint.sh ;;
1789 echo "$yyy='$zzz'" >> posthint.sh ;;
1791 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1793 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1798 echo "$yyy=$zzz" >> posthint.sh ;;
1799 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1803 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1806 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1814 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1815 [-U symbol] [-U symbol=] [-A command:symbol...]
1816 -d : use defaults for all answers.
1817 -e : go on without questioning past the production of config.sh.
1818 -f : specify an alternate default configuration file.
1819 -h : print this help message and exit (with an error status).
1820 -r : reuse C symbols value if possible (skips costly nm extraction).
1821 -s : silent mode, only echoes questions and essential information.
1822 -D : define symbol to have some value:
1823 -D symbol symbol gets the value 'define'
1824 -D symbol=value symbol gets the value 'value'
1825 common used examples (see INSTALL for more info):
1826 -Duse64bitint use 64bit integers
1827 -Duse64bitall use 64bit integers and pointers
1828 -Dusethreads use thread support
1829 -Dinc_version_list=none do not include older perl trees in @INC
1830 -DEBUGGING=none DEBUGGING options
1831 -Dcc=gcc choose your compiler
1832 -Dprefix=/opt/perl5 choose your destination
1833 -E : stop at the end of questions, after having produced config.sh.
1834 -K : do not use unless you know what you are doing.
1835 -O : ignored for backward compatibility
1836 -S : perform variable substitutions on all .SH files (can mix with -f)
1837 -U : undefine symbol:
1838 -U symbol symbol gets the value 'undef'
1839 -U symbol= symbol gets completely empty
1841 -A : manipulate symbol after the platform specific hints have been applied:
1842 -A append:symbol=value append value to symbol
1843 -A symbol=value like append:, but with a separating space
1844 -A define:symbol=value define symbol to have value
1845 -A clear:symbol define symbol to be ''
1846 -A define:symbol define symbol to be 'define'
1847 -A eval:symbol=value define symbol to be eval of value
1848 -A prepend:symbol=value prepend value to symbol
1849 -A undef:symbol define symbol to be 'undef'
1850 -A undef:symbol= define symbol to be ''
1851 e.g.: -A prepend:libswanted='cl pthread '
1852 -A ccflags=-DSOME_MACRO
1853 -V : print version number and exit (with a zero status).
1860 case "$fastread$alldone" in
1863 case "$extractsh" in
1866 if test ! -t 0; then
1867 echo "Say 'sh Configure', not 'sh <Configure'"
1877 true) exec 1>/dev/null;;
1880 : run the defines and the undefines, if any, but leave the file out there...
1882 grep '\\' optdef.sh >/dev/null 2>&1
1883 if test $? = 0; then
1884 echo "Configure does not support \\ in -D arguments"
1888 : create the posthint manipulation script and leave the file out there...
1893 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1894 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1895 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1896 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1897 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1900 : Some greps do not return status, grrr.
1901 echo "grimblepritz" >grimble
1902 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1904 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1910 : the following should work in any shell
1914 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1915 cat >contains <<'EOSS'
1916 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1921 : Find the path to the source tree
1924 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1928 *) src=`cd ../$src && pwd` ;;
1941 if test -f $rsrc/Configure && \
1942 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1944 : found it, so we are ok.
1947 for src in . .. ../.. ../../.. ../../../..; do
1948 if test -f ../$src/Configure && \
1949 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1960 Sorry, I can't seem to locate the source dir for $package. Please start
1961 Configure with an explicit path -- i.e. /some/path/Configure.
1969 echo "Sources for $package found in \"$src\"." >&4
1973 : script used to extract .SH files with variable substitutions
1974 cat >extract <<'EOS'
1976 echo "Doing variable substitutions on .SH files..."
1977 if test -f MANIFEST; then
1978 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1980 echo "(Looking for .SH files under the source directory.)"
1981 set x `(cd "$src"; find . -name "*.SH" -print)`
1985 0) set x `(cd "$src"; echo *.SH)`; shift;;
1987 if test ! -f "$src/$1"; then
1993 while test $name; do
1994 if test ! -d "$name"; then
1995 create="$name $create";
1996 name=`echo $name | sed -e "s|^[^/]*$||"`;
1997 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2002 for file in $create; do
2011 dir=`expr X$file : 'X\(.*\)/'`
2012 file=`expr X$file : 'X.*/\(.*\)'`
2013 (cd "$dir" && . ./$file)
2023 dir=`expr X$file : 'X\(.*\)/'`
2024 file=`expr X$file : 'X.*/\(.*\)'`
2025 (set x $dir; shift; eval $mkdir_p)
2026 sh <"$src/$dir/$file"
2035 if test -f "$src/config_h.SH"; then
2036 if test ! -f config.h; then
2037 : oops, they left it out of MANIFEST, probably, so do it anyway.
2038 . "$src/config_h.SH"
2043 : extract files and exit if asked to do so
2044 case "$extractsh" in
2046 case "$realsilent" in
2050 case "$config_sh" in
2051 '') config_sh='config.sh';;
2054 echo "Fetching answers from $config_sh..."
2061 echo "Extraction done."
2066 : Eunice requires " " instead of "", can you believe it
2069 echo "Beginning of configuration questions for $package."
2071 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2073 : first determine how to suppress newline on echo command
2075 echo "Checking echo to see how to suppress newlines..."
2076 (echo "hi there\c" ; echo " ") >.echotmp
2077 if $contains c .echotmp >/dev/null 2>&1 ; then
2088 echo $n "The star should be here-->$c"
2092 : Now test for existence of everything in MANIFEST
2094 if test -f "$rsrc/MANIFEST"; then
2095 echo "First let's make sure your kit is complete. Checking..." >&4
2096 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2097 (split -l 50 2>/dev/null || split -50)
2100 for filelist in x??; do
2101 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2102 >/dev/null 2>>"$tmppwd/missing")
2104 if test -s missing; then
2108 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2110 You have the option of continuing the configuration process, despite the
2111 distinct possibility that your kit is damaged, by typing 'y'es. If you
2112 do, don't blame me if something goes wrong. I advise you to type 'n'o
2113 and contact the author (perlbug@perl.org).
2116 echo $n "Continue? [n] $c" >&4
2120 echo "Continuing..." >&4
2124 echo "ABORTING..." >&4
2129 echo "Looks good..."
2132 echo "There is no MANIFEST file. I hope your kit is complete !"
2136 : Find the appropriate value for a newline for tr
2137 if test -n "$DJGPP"; then
2140 if test X"$trnl" = X; then
2141 case "`echo foo | tr '\n' x 2>/dev/null`" in
2145 if test X"$trnl" = X; then
2146 case "`echo foo | tr '\012' x 2>/dev/null`" in
2147 foox) trnl='\012' ;;
2150 if test X"$trnl" = X; then
2151 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2152 fooxy) trnl='\n\r' ;;
2155 if test X"$trnl" = X; then
2158 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2164 : compute the number of columns on the terminal for proper question formatting
2169 : set up the echo used in my read
2170 myecho="case \"\$xxxm\" in
2171 '') echo $n \"\$rp $c\" >&4;;
2173 '') echo $n \"[\$xxxm] $c\";;
2175 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2177 echo $n \"[\$xxxm] $c\" >&4
2179 echo $n \"\$rp [\$xxxm] $c\" >&4
2185 : now set up to do reads with possible shell escape and default assignment
2191 case "\$fastread" in
2192 yes) case "\$dflt" in
2195 case "\$silent-\$rp" in
2200 *) case "\$silent" in
2201 true) case "\$rp" in
2206 while expr "X\$ans" : "X!" >/dev/null; do
2210 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2218 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2227 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2232 echo "(OK, I'll run with -d after this question.)" >&4
2235 echo "*** Sorry, \$1 not supported yet." >&4
2245 echo "*** Substitution done -- please confirm."
2247 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2252 echo "*** Error -- try again."
2259 case "\$ans\$xxxm\$nostick" in
2271 : create .config dir to save info across Configure sessions
2272 test -d ../.config || mkdir ../.config
2273 cat >../.config/README <<EOF
2274 This directory created by Configure to save information that should
2275 persist across sessions for $package.
2277 You may safely delete it if you wish.
2280 : See if we are using a devel version and want that
2281 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2284 usedevel="$define" ;;
2285 *) case "$xversion" in
2288 *** WHOA THERE!!! ***
2290 This is an UNSTABLE DEVELOPMENT release.
2291 The version of this $package distribution is $xversion, that is, odd,
2292 (as opposed to even) and that signifies a development release.
2293 If you want a maintenance release, you want an even-numbered version.
2295 Do ***NOT*** install this into production use.
2296 Data corruption and crashes are possible.
2298 It is most seriously suggested that you do not continue any further
2299 unless you want to help in developing and debugging Perl.
2301 If you *still* want to build perl, you can answer 'y' now,
2302 or pass -Dusedevel to Configure.
2305 rp='Do you really want to continue?'
2309 [yY]) echo >&4 "Okay, continuing."
2310 usedevel="$define" ;;
2311 *) echo >&4 "Okay, bye."
2322 case "$versiononly" in
2323 '') versiononly="$define" ;;
2325 case "$installusrbinperl" in
2326 '') installusrbinperl="$undef" ;;
2331 : general instructions
2334 user=`(logname) 2>/dev/null`
2336 '') user=`whoami 2>&1`;;
2338 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2341 rp='Would you like to see the instructions?'
2352 This installation shell script will examine your system and ask you questions
2353 to determine how the perl5 package should be installed. If you get
2354 stuck on a question, you may use a ! shell escape to start a subshell or
2355 execute a command. Many of the questions will have default answers in square
2356 brackets; typing carriage return will give you the default.
2358 On some of the questions which ask for file or directory names you are allowed
2359 to use the ~name construct to specify the login directory belonging to "name",
2360 even if you don't have a shell which knows about that. Questions where this is
2361 allowed will be marked "(~name ok)".
2365 dflt='Type carriage return to continue'
2369 The prompter used in this script allows you to use shell variables and
2370 backticks in your answers. You may use $1, $2, etc... to refer to the words
2371 in the default answer, as if the default line was a set of arguments given to a
2372 script shell. This means you may also use $* to repeat the whole default line,
2373 so you do not have to re-type everything to add something to the default.
2375 Every time there is a substitution, you will have to confirm. If there is an
2376 error (e.g. an unmatched backtick), the default answer will remain unchanged
2377 and you will be prompted again.
2379 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2380 the questions and use the computed defaults (or the previous answers if there
2381 was already a config.sh file). Type 'Configure -h' for a list of options.
2382 You may also start interactively and then answer '& -d' at any prompt to turn
2383 on the non-interactive behaviour for the remainder of the execution.
2389 Much effort has been expended to ensure that this shell script will run on any
2390 Unix system. If despite that it blows up on yours, your best bet is to edit
2391 Configure and run it again. If you can't run Configure for some reason,
2392 you'll have to generate a config.sh file by hand. Whatever problems you
2393 have, let me (perlbug@perl.org) know how I blew it.
2395 This installation script affects things in two ways:
2397 1) it may do direct variable substitutions on some of the files included
2399 2) it builds a config.h file for inclusion in C programs. You may edit
2400 any of these files as the need arises after running this script.
2402 If you make a mistake on a question, there is no easy way to back up to it
2403 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2404 files. Configure will offer to let you do this before it runs the SH files.
2407 dflt='Type carriage return to continue'
2409 case "$firsttime" in
2410 true) echo $user >>../.config/instruct;;
2414 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2415 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2416 if test "X$sysroot" = X; then
2421 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2422 # _sysroot is used in places where we need --sysroot=foo
2423 # but using the rest of the flags could cause issues.
2424 _sysroot="--sysroot=$sysroot";
2428 ccflags="$ccflags $_sysroot"
2433 ldflags="$ldflags $_sysroot"
2438 cppflags="$cppflags $_sysroot"
2440 # lddlflags updated below in lddlflags section;
2441 # same with cccdlflags
2445 # Adjust some defaults to also use $sysroot
2446 for var in xlibpth loclibpth locincpth glibpth; do
2449 for path in $xxx; do
2450 eval $var=\"\$$var $sysroot$path\"
2456 : find out where common programs are
2458 echo "Locating common programs..." >&4
2471 if test -d \$dir/\$thing; then
2477 for thisthing in \$dir/\$thing; do
2478 : just loop through to pick last item
2480 if test -f \$thisthing; then
2483 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2486 elif test -f \$dir/\$thing.exe; then
2487 if test -n "$DJGPP"; then
2488 echo \$dir/\$thing.exe
2489 elif test "$eunicefix" != ":"; then
2490 : on Eunice apparently
2543 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2544 pth="$pth $sysroot/lib $sysroot/usr/lib"
2545 for file in $loclist; do
2549 if test -f "$xxx"; then
2552 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2553 xxx=`./loc $file $file $pth`
2556 '') xxx=`./loc $file $file $pth`;;
2557 *) xxx=`./loc $xxx $xxx $pth`;;
2559 eval $file=$xxx$_exe
2563 echo $file is in $xxx.
2566 echo $file is in $xxx.
2569 echo "I don't know where '$file' is, and my life depends on it." >&4
2570 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2576 echo "Don't worry if any of the following aren't found..."
2578 for file in $trylist; do
2582 if test -f "$xxx"; then
2585 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2586 xxx=`./loc $file $file $pth`
2589 '') xxx=`./loc $file $file $pth`;;
2590 *) xxx=`./loc $xxx $xxx $pth`;;
2592 eval $file=$xxx$_exe
2596 echo $file is in $xxx.
2599 echo $file is in $xxx.
2602 echo "I don't see $file out there, $say."
2609 echo "Substituting grep for egrep."
2616 *) if $less -R </dev/null >/dev/null 2>&1; then
2617 echo "Substituting less -R for less."
2625 echo "Substituting cp for ln."
2634 echo "I can't find make or gmake, and my life depends on it." >&4
2635 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2643 *) # We can't have osname yet.
2644 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2645 # Assume that gmake, if found, is definitely GNU make
2646 # and prefer it over the system make.
2647 echo "Substituting gmake for make."
2655 echo "Hopefully test is built into your sh."
2658 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2659 echo "Using the test built into your sh."
2667 echo "Hopefully echo is built into your sh."
2672 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2673 $echo $n "hi there$c" >foo1
2674 echo $n "hi there$c" >foo2
2675 if cmp foo1 foo2 >/dev/null 2>&1; then
2676 echo "They are compatible. In fact, they may be identical."
2683 They are not compatible! You are probably running ksh on a non-USG system.
2684 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2685 have echo built in and we may have to run some Bourne shell scripts. That
2686 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2689 $echo $n "The star should be here-->$c"
2696 # This question was auctioned at YAPC::Europe-2007 in Vienna
2697 # I never promised you could answer it. I only auctioned the question.
2699 The following message is sponsored by
2701 Dresden.pm<--The stars should be here.
2703 Dear Perl user, system administrator or package
2704 maintainer, the Perl community sends greetings to
2705 you. Do you (emblematical) greet back [Y/n]? n
2709 : Check what type of C compiler we use
2713 cat <<'EOSC' >>trygcc
2718 int main(int argc, char *argv[]) {
2722 if $cc -o try $ccflags $ldflags try.c; then
2725 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2731 # Skip this test because it gives a false match on output like:
2732 # ./trygcc: line 23: cc: command not found
2733 # case "`$cc -v -c try.c 2>&1`" in
2734 # *gcc*) trygcc=no ;;
2736 if $test X"$trygcc" = Xyes; then
2737 if gcc -o try -c try.c; then
2739 echo "You seem to have a working gcc, though." >&4
2740 # Switching compilers may undo the work of hints files.
2741 # The most common problem is -D_REENTRANT for threads.
2742 # This heuristic catches that case, but gets false positives
2743 # if -Dusethreads was not actually specified. Better to
2744 # bail out here with a useful message than fail
2745 # mysteriously later. Should we perhaps just try to
2746 # re-invoke Configure -Dcc=gcc config_args ?
2747 if $test -f usethreads.cbu; then
2750 *** However, any setting of the C compiler flags (e.g. for thread support)
2751 *** will be lost. It may be necessary for you to restart Configure and
2752 *** add -Dcc=gcc to your Configure command line.
2755 rp="Would you like to go ahead and try gcc anyway?"
2758 rp="Would you like to use it?"
2761 if $test -f myread; then
2764 if $test -f UU/myread; then
2767 echo "Cannot find myread, sorry. Aborting." >&2
2772 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2785 cat <<'EOSC' >>checkcc
2790 int main(int argc, char *argv[]) {
2794 if $cc -o try $ccflags $ldflags try.c; then
2797 if $test X"$despair" = Xyes; then
2798 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2801 You need to find a working C compiler.
2802 Either (purchase and) install the C compiler supplied by your OS vendor,
2803 or for a free C compiler try http://gcc.gnu.org/
2804 I cannot continue any further, aborting.
2813 : determine whether symbolic links are supported
2816 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2817 echo "Symbolic links are supported." >&4
2820 echo "Symbolic links are NOT supported." >&4
2825 : determine whether symbolic links are supported
2829 echo "Checking how to test for symbolic links..." >&4
2831 if $test "X$issymlink" = X; then
2833 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2834 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2836 if test $? = 0; then
2839 echo "Your builtin 'test -h' may be broken." >&4
2842 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2845 if test -f "$p/$test"; then
2854 echo "Trying external '$test -h'." >&4
2855 issymlink="$test -h"
2856 if $test ! -h sym >/dev/null 2>&1; then
2857 echo "External '$test -h' is broken, too." >&4
2865 if $test "X$issymlink" = X; then
2866 if $test -L sym 2>/dev/null; then
2867 issymlink="$test -L"
2868 echo "The builtin '$test -L' worked." >&4
2871 if $test "X$issymlink" != X; then
2872 echo "You can test for symbolic links with '$issymlink'." >&4
2874 echo "I do not know how you can test for symbolic links." >&4
2878 *) echo "No symbolic links, so not testing for their testing..." >&4
2882 : Make symlinks util
2883 case "$mksymlinks" in
2886 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2889 *) case "$lns:$issymlink" in
2890 *"ln"*" -s:"*"test -"?)
2891 echo "Creating the symbolic links..." >&4
2893 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2903 print "# dir = ", dir, "file = ", file
2904 mf[dir] = mf[dir]" "source"/"dir"/"file;
2907 if (d != ".") { print("mkdir -p "d) }
2908 print("ln -sf "mf[d]" "d);
2910 }' source="$src" > UU/mksymlinks.$$
2914 if test ! -d t/base; then
2915 echo "Failed to create the subdirectories. Aborting." >&4
2919 if test ! -f t/base/lex.t; then
2920 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2923 if test ! -f win32/win32.c; then
2924 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2929 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2937 : Check for Cross-Compilation
2938 if $test "X$targethost" = "X"; then
2941 if $test "X$targetenv" = "X"; then
2944 case "$usecrosscompile" in
2946 $echo "Cross-compiling..."
2949 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2950 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2951 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2952 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2953 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2954 # leave out ld, choosing it is more complex
2955 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2956 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2957 # We are in a weird spot. Just before us, some values
2958 # were 'saved', to be restored after the hints are
2959 # run. This means that the changes we made to ar,
2960 # nm and ranlib will get reverted.
2961 # To avoid that, we hijack the saving mechanism and
2962 # have it save our new values.
2963 for file in ar nm ranlib; do
2965 eval $file=$xxx$_exe
2970 case "$targetarch" in
2971 '') echo "Targetarch not defined." >&4; croak=y ;;
2972 *) echo "Using targetarch $targetarch." >&4 ;;
2974 case "$targethost" in
2975 '') echo "Targethost not defined." >&4; croak=n ;;
2976 *) echo "Using targethost $targethost." >&4
2981 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2983 : compile a host miniperl and generate_uudmap, unless we got passed them
2984 if $test "X$hostperl" = X; then
2985 echo "Building host miniperl and generate_uudmap binaries" >&4
2993 $src/Configure -des -Dusedevel -Dmksymlinks
2995 case "$hostgenerate" in
2996 '') $make generate_uudmap
2997 hostgenerate=$src/host/generate_uudmap
2999 "$undef") hostgenerate=''
3002 hostperl=$src/host/miniperl
3005 hostosname=`$hostperl -le 'print $^O'`
3008 usecrosscompile="$undef"
3012 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3013 case "$targethost" in
3014 '') echo "Checking for cross-compile" >&4
3015 case "$usecrosscompile$multiarch" in
3016 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3017 if [ -f Makefile ]; then
3019 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3021 echo "Configure done."
3025 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3032 *) echo "Using targethost $targethost." >&4
3034 /*) run=$src/Cross/run
3035 targetmkdir=$src/Cross/mkdir
3037 from=$src/Cross/from
3039 *) pwd=`$test -f ../Configure & cd ..; pwd`
3041 targetmkdir=$pwd/Cross/mkdir
3043 from=$pwd/Cross/from
3046 case "$targetrun" in
3047 '') targetrun=ssh ;;
3052 case "$targetfrom" in
3053 '') targetfrom=scp ;;
3057 from=$from-$targetfrom
3058 case "$targetdir" in
3060 echo "Guessing targetdir $targetdir." >&4
3063 case "$targetuser" in
3065 echo "Guessing targetuser $targetuser." >&4
3068 case "$targetport" in
3070 echo "Guessing targetport $targetport." >&4
3073 case "$targetfrom" in
3077 case "$targetrun" in
3097 '') cwd=$targetdir ;;
3102 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3108 *) echo "Unknown targetrun '$targetrun'" >&4
3112 case "$targetmkdir" in
3114 cat >$targetmkdir <<EOF
3116 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3118 $chmod a+rx $targetmkdir
3120 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3132 $targetmkdir \`dirname \$f\`
3133 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3136 $targetmkdir $targetdir/\`dirname \$f\`
3137 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3150 $mkdir -p $targetdir/\`dirname \$f\`
3151 $cp \$f $targetdir/\$f || exit 1
3154 $targetmkdir $targetdir/\`dirname \$f\`
3155 $cp \$f $targetdir/\$f || exit 1
3162 *) echo "Unknown targetto '$targetto'" >&4
3166 case "$targetfrom" in
3173 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3178 cp) cat >$from <<EOF
3183 cp $targetdir/\$f . || exit 1
3188 *) echo "Unknown targetfrom '$targetfrom'" >&4
3192 if $test ! -f $run; then
3193 echo "Target 'run' script '$run' not found." >&4
3197 if $test ! -f $to; then
3198 echo "Target 'to' script '$to' not found." >&4
3202 if $test ! -f $from; then
3203 echo "Target 'from' script '$from' not found." >&4
3207 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3211 Using '$run' for remote execution,
3212 and '$from' and '$to'
3213 for remote file transfer.
3219 usecrosscompile="$undef"
3224 : see whether [:lower:] and [:upper:] are supported character classes
3226 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3228 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3232 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3233 # (0xd9 and 0xe2), therefore that is a nice testing point.
3234 if test "X$up" = X -o "X$low" = X; then
3235 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3241 if test "X$up" = X -o "X$low" = X; then
3242 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3248 if test "X$up" = X -o "X$low" = X; then
3249 case "`echo RS | od -x 2>/dev/null`" in
3251 echo "Hey, this might be EBCDIC." >&4
3252 if test "X$up" = X -o "X$low" = X; then
3253 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3254 rs) up='[A-IJ-RS-Z]'
3259 if test "X$up" = X -o "X$low" = X; then
3260 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3270 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3272 echo "Using $up and $low to convert case." >&4
3275 echo "I don't know how to translate letters from upper to lower case." >&4
3276 echo "Your tr is not acting any way I know of." >&4
3280 : set up the translation script tr, must be called with ./tr of course
3284 '[A-Z][a-z]') exec $tr '$up' '$low';;
3285 '[a-z][A-Z]') exec $tr '$low' '$up';;
3292 : Try to determine whether config.sh was made on this system
3293 case "$config_sh" in
3295 myuname=`$uname -a 2>/dev/null`
3296 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3297 # Downcase everything to avoid ambiguity.
3298 # Remove slashes and single quotes so we can use parts of this in
3299 # directory and file names.
3300 # Remove newlines so myuname is sane to use elsewhere.
3301 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3302 # because the A-Z/a-z are not consecutive.
3303 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3304 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3305 newmyuname="$myuname"
3307 case "$knowitall" in
3309 if test -f ../config.sh; then
3310 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3311 eval "`grep myuname= ../config.sh`"
3313 if test "X$myuname" = "X$newmyuname"; then
3321 : Get old answers from old config file if Configure was run on the
3322 : same system, otherwise use the hints.
3325 if test -f config.sh; then
3327 rp="I see a config.sh file. Shall I use it to set the defaults?"
3330 n*|N*) echo "OK, I'll ignore it."
3331 mv config.sh config.sh.old
3332 myuname="$newmyuname"
3334 *) echo "Fetching default answers from your old config.sh file..." >&4
3342 : Older versions did not always set $sh. Catch re-use of such
3352 if test ! -f config.sh; then
3355 First time through, eh? I have some defaults handy for some systems
3356 that need some extra help getting the Configure answers right:
3359 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3361 : Half the following guesses are probably wrong... If you have better
3362 : tests or hints, please send them to perlbug@perl.org
3363 : The metaconfig authors would also appreciate a copy...
3364 $test -f /irix && osname=irix
3365 $test -f /xenix && osname=sco_xenix
3366 $test -f /dynix && osname=dynix
3367 $test -f /dnix && osname=dnix
3368 $test -f /lynx.os && osname=lynxos
3369 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3370 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3371 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3372 $test -f /bin/mips && /bin/mips && osname=mips
3373 $test -d /usr/apollo/bin && osname=apollo
3374 $test -f /etc/saf/_sactab && osname=svr4
3375 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3376 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3377 $test -f /sys/utilities/MultiView && osname=amigaos
3378 if $test -d /MachTen -o -d /MachTen_Folder; then
3380 if $test -x /sbin/version; then
3381 osvers=`/sbin/version | $awk '{print $2}' |
3382 $sed -e 's/[A-Za-z]$//'`
3383 elif $test -x /usr/etc/version; then
3384 osvers=`/usr/etc/version | $awk '{print $2}' |
3385 $sed -e 's/[A-Za-z]$//'`
3391 $test -f /sys/posix.dll &&
3392 $test -f /usr/bin/what &&
3393 set X `/usr/bin/what /sys/posix.dll` &&
3394 $test "$3" = UWIN &&
3398 if $test -f $uname; then
3406 umips) osname=umips ;;
3409 [23]100) osname=mips ;;
3411 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3412 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3415 elif $test -f /etc/kconfig; then
3417 if test "$lns" = "$ln -s"; then
3419 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3421 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3428 if test -n "$DJGPP"; then
3437 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3439 # oslevel can fail with:
3440 # oslevel: Unable to acquire lock.
3441 *not\ found) osvers="$4"."$3" ;;
3442 '<3240'|'<>3240') osvers=3.2.0 ;;
3443 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3444 '=3250'|'>3250') osvers=3.2.5 ;;
3448 bitrig) osname=bitrig
3451 bsd386) osname=bsd386
3454 cygwin*) osname=cygwin
3457 *dc.osx) osname=dcosx
3463 domainos) osname=apollo
3469 dragonfly) osname=dragonfly
3472 dynixptx*) osname=dynixptx
3473 osvers=`echo "$4"|sed 's/^v//'`
3475 freebsd) osname=freebsd
3477 genix) osname=genix ;;
3481 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3494 $test -f /system/lib/libandroid.so && osname=linux-android
3498 netbsd*) osname=netbsd
3501 news-os) osvers="$3"
3503 4*) osname=newsos4 ;;
3507 nonstop-ux) osname=nonstopux ;;
3508 openbsd) osname=openbsd
3514 POSIX-BC | posix-bc ) osname=posix-bc
3517 powerux | power_ux | powermax_os | powermaxos | \
3518 powerunix | power_unix) osname=powerux
3524 solaris) osname=solaris
3526 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3533 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3537 titanos) osname=titanos
3546 ultrix) osname=ultrix
3549 osf1|mls+) case "$5" in
3552 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3555 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3558 hp*) osname=hp_osf1 ;;
3559 mips) osname=mips_osf1 ;;
3562 # UnixWare 7.1.2 is known as Open UNIX 8
3563 openunix|unixware) osname=svr5
3571 $2) case "$osname" in
3575 : svr4.x or possibly later
3585 if test -f /stand/boot ; then
3586 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3587 if test -n "$INITPROG" -a -f "$INITPROG"; then
3588 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3589 if test -n "$isesix"; then
3597 *) if test -f /etc/systemid; then
3599 set `echo $3 | $sed 's/\./ /g'` $4
3600 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3602 elif $test -f $src/hints/sco_$1_$2.sh; then
3604 elif $test -f $src/hints/sco_$1.sh; then
3609 '') : Still unknown. Probably a generic Sys V.
3618 *) case "$osname" in
3619 '') : Still unknown. Probably a generic BSD.
3627 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3628 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3629 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3632 $rm -f UU/kernel.what
3633 elif test -d c:/. -o -n "$is_os2" ; then
3640 case "$targetarch" in
3643 case "$targetarch" in
3645 # Will load qnx.sh, which should change osname to nto
3650 # Catch arm-linux-androideabi, mipsel-linux-android,
3651 # and i686-linux-android
3652 osname=linux-android
3656 # Something like arm-linux-gnueabihf is really just
3663 # XXX perhaps we should just assume
3664 # osvers to be 2, or maybe take the value
3665 # from targetarch. Using $run before the
3666 # hints are run is somewhat icky.
3667 set X `$run $uname -a 2>/dev/null`
3670 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3675 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3682 : Now look for a hint file osname_osvers, unless one has been
3683 : specified already.
3686 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3687 : Also try without trailing minor version numbers.
3688 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3689 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3690 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3691 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3694 *) case "$osvers" in
3697 *) if $test -f $src/hints/$file.sh ; then
3699 elif $test -f $src/hints/$xfile.sh ; then
3701 elif $test -f $src/hints/$xxfile.sh ; then
3703 elif $test -f $src/hints/$xxxfile.sh ; then
3705 elif $test -f $src/hints/$xxxxfile.sh ; then
3707 elif $test -f "$src/hints/${osname}.sh" ; then
3716 if $test -f Policy.sh ; then
3719 none) dflt="Policy" ;;
3720 *) dflt="Policy $dflt" ;;
3725 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3729 if $test -f Policy.sh ; then
3732 There's also a Policy hint file available, which should make the
3733 site-specific (policy) questions easier to answer.
3740 You may give one or more space-separated answers, or "none" if appropriate.
3741 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3742 previous run of Configure, you may specify it as well as or instead of
3743 OS-specific hints. If hints are provided for your OS, you should use them:
3744 although Perl can probably be built without hints on many platforms, using
3745 hints often improve performance and may enable features that Configure can't
3746 set up on its own. If there are no hints that match your OS, specify "none";
3747 DO NOT give a wrong version or a wrong OS.
3751 rp="Which of these apply, if any?"
3754 for file in $tans; do
3755 if $test X$file = XPolicy -a -f Policy.sh; then
3757 $cat Policy.sh >> UU/config.sh
3758 elif $test -f $src/hints/$file.sh; then
3759 . $src/hints/$file.sh
3760 $cat $src/hints/$file.sh >> UU/config.sh
3761 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3764 : Give one chance to correct a possible typo.
3765 echo "$file.sh does not exist"
3767 rp="hint to use instead?"
3769 for file in $ans; do
3770 if $test -f "$src/hints/$file.sh"; then
3771 . $src/hints/$file.sh
3772 $cat $src/hints/$file.sh >> UU/config.sh
3773 elif $test X$ans = X -o X$ans = Xnone ; then
3776 echo "$file.sh does not exist -- ignored."
3783 : Remember our hint file for later.
3784 if $test -f "$src/hints/$file.sh" ; then
3794 echo "Fetching default answers from $config_sh..." >&4
3798 cp $config_sh config.sh 2>/dev/null
3810 : Restore computed paths
3811 for file in $loclist $trylist; do
3812 eval $file="\$_$file"
3817 Configure uses the operating system name and version to set some defaults.
3818 The default value is probably right if the name rings a bell. Otherwise,
3819 since spelling matters for me, either accept the default or answer "none"
3826 ''|' '|none) dflt=none ;;
3827 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3830 *) dflt="$osname" ;;
3832 rp="Operating system name?"
3836 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3842 ''|' '|none) dflt=none ;;
3843 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3844 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3846 ''|' ') dflt=none ;;
3851 *) dflt="$osvers" ;;
3853 rp="Operating system version?"
3863 : who configured the system
3864 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3867 cf_by=`(logname) 2>/dev/null`
3870 cf_by=`(whoami) 2>/dev/null`
3872 "") cf_by=unknown ;;
3877 : decide how portable to be. Allow command line overrides.
3878 case "$d_portable" in
3880 *) d_portable="$define" ;;
3883 : set up shell script to do ~ expansion
3889 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3892 if $test -f /bin/csh; then
3893 /bin/csh -f -c "glob \$1"
3898 name=\`$expr x\$1 : '..\([^/]*\)'\`
3899 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3900 if $test ! -d "\$dir"; then
3902 echo "\$me: can't locate home directory for: \$name" >&2
3907 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3923 : now set up to get a file name
3927 cat <<'EOSC' >>getfile
3943 : getfile will accept an answer from the comma-separated list
3944 : enclosed in parentheses even if it does not meet other criteria.
3945 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3946 fn=`echo $fn | sed 's/(.*)//'`
3952 loc_file=`expr $fn : '.*:\(.*\)'`
3953 fn=`expr $fn : '\(.*\):.*'`
3961 */*) fullpath=true;;
3970 *e*) exp_file=true;;
3973 *p*) nopath_ok=true;;
3978 *d*) type='Directory';;
3979 *l*) type='Locate';;
3984 Locate) what='File';;
3989 case "$d_portable" in
3997 while test "$type"; do
4002 true) rp="$rp (~name ok)";;
4005 if test -f UU/getfile.ok && \
4006 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4025 value=`UU/filexp $ans`
4028 if test "$ans" != "$value"; then
4029 echo "(That expands to $value on this system.)"
4043 /*) value="$ansexp" ;;
4044 [a-zA-Z]:/*) value="$ansexp" ;;
4049 echo "I shall only accept a full path name, as in /bin/ls." >&4
4050 echo "Use a ! shell escape if you wish to check pathnames." >&4
4053 echo "Please give a full path name, starting with slash." >&4
4056 echo "Note that using ~name is ok provided it expands well." >&4
4069 for fp in $gfpth; do
4070 if test "X$fp" = X.; then
4075 if test -f "$pf"; then
4077 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4079 echo "($value is not a plain file, but that's ok.)"
4082 if test X"$type" = X; then
4089 for fp in $gfpth; do
4090 if test "X$fp" = X.; then
4095 direxp="$fp/$ansexp"
4097 if test -d "$direxp"; then
4105 if test -d "$ansexp"; then
4106 echo "(Looking for $loc_file in directory $value.)"
4107 value="$value/$loc_file"
4108 ansexp="$ansexp/$loc_file"
4110 if test -f "$ansexp"; then
4113 case "$nopath_ok" in
4114 true) case "$value" in
4116 *) echo "Assuming $value will be in people's path."
4132 if test "$fastread" = yes; then
4137 rp="$what $value doesn't exist. Use that name anyway?"
4156 test "X$gfpthkeep" != Xy && gfpth=""
4159 : determine root of directory hierarchy where package will be installed.
4162 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4165 dflt=`echo "$prefix" | sed 's/.$//'`
4173 By default, $package will be installed in $dflt/bin, manual pages
4174 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4175 installation directories. Typically this is something like /usr/local.
4176 If you wish to have binaries under /usr/bin but other parts of the
4177 installation under /usr/local, that's ok: you will be prompted
4178 separately for each of the installation directories, the prefix being
4179 only used to set the defaults.
4183 rp='Installation prefix to use?'
4191 *) oldprefix="$prefix";;
4198 : allow them to override the AFS root
4201 *) afsroot=$afsroot ;;
4207 $define|true) afs=true ;;
4208 $undef|false) afs=false ;;
4209 *) if $test -d $afsroot; then
4217 echo "AFS may be running... I'll be extra cautious then..." >&4
4219 echo "AFS does not seem to be running..." >&4
4222 : determine installation prefix for where package is to be installed.
4226 Since you are running AFS, I need to distinguish the directory in which
4227 files will reside from the directory in which they are installed (and from
4228 which they are presumably copied to the former directory by occult means).
4231 case "$installprefix" in
4232 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4233 *) dflt="$installprefix";;
4238 In some special cases, particularly when building $package for distribution,
4239 it is convenient to distinguish the directory in which files should be
4240 installed from the directory ($prefix) in which they will
4241 eventually reside. For most users, these two directories are the same.
4244 case "$installprefix" in
4246 *) dflt=$installprefix;;
4250 rp='What installation prefix should I use for installing files?'
4252 installprefix="$ans"
4253 installprefixexp="$ansexp"
4255 : Perform the prefixexp/installprefixexp correction if necessary
4256 cat <<EOS >installprefix
4259 cat <<'EOSC' >>installprefix
4260 : Change installation prefix, if necessary.
4261 if $test X"$prefix" != X"$installprefix"; then
4262 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4264 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4267 chmod +x installprefix
4268 $eunicefix installprefix
4270 : Set variables such as privlib and privlibexp from the output of ./getfile
4271 : performing the prefixexp/installprefixexp correction if necessary.
4272 cat <<EOS >setprefixvar
4275 cat <<'EOSC' >>setprefixvar
4276 eval "${prefixvar}=\"\$ans\""
4277 eval "${prefixvar}exp=\"\$ansexp\""
4280 chmod +x setprefixvar
4281 $eunicefix setprefixvar
4283 : set up the script used to warn in case of inconsistency
4292 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4294 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4295 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4300 echo "*** WHOA THERE!!! ***" >&4
4301 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4304 rp=" Keep the $hint value?"
4307 y) td=$was; tu=$was;;
4311 : function used to set '$1' to '$val'
4312 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4314 $define$undef) . ./whoa; eval "$var=\$td";;
4315 $undef$define) . ./whoa; eval "$var=\$tu";;
4316 *) eval "$var=$val";;
4319 : get the patchlevel
4321 echo "Getting the current patchlevel..." >&4
4322 if $test -r $rsrc/patchlevel.h;then
4323 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4324 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4325 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4326 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4327 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4328 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4329 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4338 $echo "(You do not have patchlevel.h. Eek.)"
4340 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4341 version_patchlevel_string="version $patchlevel subversion $subversion"
4342 case "$perl_patchlevel" in
4344 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4345 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4349 $echo "(You have $package $version_patchlevel_string.)"
4353 : XXX Should be a Configure test for double-dots in filenames.
4354 version=`echo $revision $patchlevel $subversion | \
4355 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4356 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4357 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4360 version=`echo $revision $patchlevel $subversion | \
4361 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4362 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4363 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4366 : Special case the 5.005_xx maintenance series, which used 5.005
4367 : without any subversion label as a subdirectory in $sitelib
4368 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4369 api_versionstring='5.005'
4372 : Do we want threads support and if so, what type
4373 case "$usethreads" in
4374 $define|true|[yY]*) dflt='y';;
4375 *) # Catch case where user specified ithreads or 5005threads but
4376 # forgot -Dusethreads (A.D. 4/2002)
4377 case "$useithreads$use5005threads" in
4378 *$define*) dflt='y';;
4385 Perl can be built to offer a form of threading support on some systems
4386 To do so, Configure can be run with -Dusethreads.
4388 Note that Perl built with threading support runs slightly slower
4389 and uses slightly more memory than plain Perl.
4391 If this doesn't make any sense to you, just accept the default '$dflt'.
4393 rp='Build a threading Perl?'
4396 y|Y) val="$define" ;;
4402 if $test $patchlevel -lt 9; then
4403 case "$usethreads" in
4405 : Default to ithreads unless overridden on command line or with
4408 case "$use5005threads" in
4410 echo "5.005 threads are no longer supported"
4414 case "$useithreads" in
4415 $undef|false|[nN]*) dflt='n';;
4417 rp='Use the newer interpreter-based ithreads?'
4420 y|Y) val="$define" ;;
4425 : Now set use5005threads to the opposite value.
4426 case "$useithreads" in
4427 $define) val="$undef" ;;
4434 useithreads="$undef"
4435 use5005threads="$undef"
4439 case "$useithreads$use5005threads" in
4443 You cannot have both the ithreads and the 5.005 threads enabled
4444 at the same time. Disabling the 5.005 threads since they are
4445 much less stable than the ithreads.
4448 use5005threads="$undef"
4453 : perl-5.9.x and later
4455 if test X"$usethreads" = "X$define"; then
4456 case "$use5005threads" in
4460 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4467 use5005threads="$undef"
4468 useithreads="$usethreads"
4471 case "$d_oldpthreads" in
4472 '') : Configure tests would be welcome here. For now, assume undef.
4474 *) val="$d_oldpthreads" ;;
4480 : Look for a hint-file generated 'call-back-unit'. If the
4481 : user has specified that a threading perl is to be built,
4482 : we may need to set or change some other defaults.
4483 if $test -f usethreads.cbu; then
4484 echo "Your platform has some specific hints regarding threaded builds, using them..."
4487 case "$usethreads" in
4488 "$define"|true|[yY]*)
4490 (Your platform does not have any specific hints for threaded builds.
4491 Assuming POSIX threads, then.)
4497 : Check if multiplicity is required
4500 Perl can be built so that multiple Perl interpreters can coexist
4501 within the same Perl executable.
4504 case "$useithreads" in
4507 This multiple interpreter support is required for interpreter-based threads.
4511 *) case "$usemultiplicity" in
4512 $define|true|[yY]*) dflt='y';;
4516 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4517 rp='Build Perl for multiplicity?'
4520 y|Y) val="$define" ;;
4528 : Check if morebits is requested
4529 case "$usemorebits" in
4530 "$define"|true|[yY]*)
4531 use64bitint="$define"
4532 uselongdouble="$define"
4533 usemorebits="$define"
4535 *) usemorebits="$undef"
4539 : Determine the C compiler to be used
4545 rp="Use which C compiler?"
4549 : See whether they have no cc but they do have gcc
4551 if $test -f cc.cbu; then
4556 : make some quick guesses about what we are up against
4558 $echo $n "Hmm... $c"
4568 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4569 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4571 echo "Looks kind of like an OSF/1 system, but we'll see..."
4573 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4574 xxx=`./loc addbib blurfl $pth`
4575 if $test -f $xxx; then
4576 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4580 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4581 echo "Looks kind of like an extended USG system, but we'll see..."
4583 echo "Looks kind of like a USG system, but we'll see..."
4587 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4588 echo "Looks kind of like a BSD system, but we'll see..."
4592 echo "Looks kind of like a Version 7 system, but we'll see..."
4595 case "$eunicefix" in
4598 There is, however, a strange, musty smell in the air that reminds me of
4599 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4603 : it so happens the Eunice I know will not run shell scripts in Unix format
4607 echo "Congratulations. You aren't running Eunice."
4611 : Detect OS2. The p_ variable is set above in the Head.U unit.
4612 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4613 : semicolon as a patch separator
4618 I have the feeling something is not exactly right, however...don't tell me...
4619 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4620 (Or you may be running DOS with DJGPP.)
4625 if test -f /xenix; then
4626 echo "Actually, this looks more like a XENIX system..."
4631 echo "It's not Xenix..."
4636 if test -f /venix; then
4637 echo "Actually, this looks more like a VENIX system..."
4644 echo "Nor is it Venix..."
4647 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4648 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4651 : Check if we are using GNU gcc and what its version is
4653 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4657 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4659 printf("%s\n", __VERSION__);
4661 printf("%s\n", "1");
4667 if $cc -o try $ccflags $ldflags try.c; then
4668 gccversion=`$run ./try`
4669 case "$gccversion" in
4670 '') echo "You are not using GNU cc." ;;
4671 *) echo "You are using GNU cc $gccversion."
4677 echo "*** WHOA THERE!!! ***" >&4
4678 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4679 case "$knowitall" in
4681 echo " You'd better start hunting for one and let me know about it." >&4
4687 case "$gccversion" in
4688 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4690 case "$gccversion" in
4691 '') gccosandvers='' ;;
4692 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4693 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4695 case "$gccosandvers" in
4696 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4697 $osname$osvers) ;; # looking good
4698 $osname*) cat <<EOM >&4
4700 *** WHOA THERE!!! ***
4702 Your gcc has not been compiled for the exact release of
4703 your operating system ($gccosandvers versus $osname$osvers).
4705 In general it is a good idea to keep gcc synchronized with
4706 the operating system because otherwise serious problems
4707 may ensue when trying to compile software, like Perl.
4709 I'm trying to be optimistic here, though, and will continue.
4710 If later during the configuration and build icky compilation
4711 problems appear (headerfile conflicts being the most common
4712 manifestation), I suggest reinstalling the gcc to match
4713 your operating system release.
4717 *) gccosandvers='' ;; # failed to parse, better be silent
4725 # gcc 3.* complain about adding -Idirectories that they already know about,
4726 # so we will take those off from locincpth.
4727 case "$gccversion" in
4729 echo "main(){}">try.c
4730 for incdir in $locincpth; do
4731 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4732 grep '^c[cp]p*[01]: warning: changing search order '`
4733 if test "X$warn" != X; then
4734 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4740 # gcc 4.9 by default does some optimizations that break perl.
4741 # see ticket 121505.
4743 # The -fwrapv disables those optimizations (and probably others,) so
4744 # for gcc 4.9 (and later, since the optimizations probably won't go
4745 # away), add -fwrapv unless the user requests -fno-wrapv, which
4746 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4747 # which turns the overflows -fwrapv ignores into runtime errors.
4748 case "$gccversion" in
4749 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4751 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4752 *) ccflags="$ccflags -fwrapv" ;;
4756 : What should the include directory be ?
4757 : Use sysroot if set, so findhdr looks in the right place.
4759 $echo $n "Hmm... $c"
4760 dflt="$sysroot/usr/include"
4763 if $test -f /bin/mips && /bin/mips; then
4764 echo "Looks like a MIPS system..."
4765 $cat >usr.c <<'EOCP'
4766 #ifdef SYSTYPE_BSD43
4770 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4771 dflt='/bsd43/usr/include'
4775 mips_type='System V'
4777 $rm -f usr.c usr.out
4778 echo "and you're compiling with the $mips_type compiler and libraries."
4782 echo "Doesn't look like a MIPS system."
4792 case "$xxx_prompt" in
4795 rp='Where are the include files you want to use?'
4803 : see how we invoke the C preprocessor
4805 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4806 cat <<'EOT' >testcpp.c
4812 if test ! -f cppstdin; then
4813 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4814 # AIX cc -E doesn't show the absolute headerfile
4815 # locations but we'll cheat by using the -M flag.
4816 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
4818 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4821 echo "Keeping your $hint cppstdin wrapper."
4824 wrapper=`pwd`/cppstdin
4828 if $test "X$cppstdin" != "X" && \
4829 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4830 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4832 echo "You used to use $cppstdin $cppminus so we'll use that again."
4834 '') echo "But let's see if we can live without a wrapper..." ;;
4836 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4837 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4839 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4842 echo "(However, $cpprun $cpplast does not work, let's see...)"
4850 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4857 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4858 $cc -E <testcpp.c >testcpp.out 2>&1; \
4859 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4860 echo "Yup, it does."
4861 x_cpp="$cc $cppflags -E"
4863 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4864 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4865 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4866 echo "Yup, it does."
4867 x_cpp="$cc $cppflags -E"
4869 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4870 $cc -P <testcpp.c >testcpp.out 2>&1; \
4871 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4872 echo "Yipee, that works!"
4873 x_cpp="$cc $cppflags -P"
4875 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4876 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4878 echo "At long last!"
4879 x_cpp="$cc $cppflags -P"
4881 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4882 $cpp <testcpp.c >testcpp.out 2>&1; \
4883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 x_cpp="$cpp $cppflags"
4887 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4888 $cpp - <testcpp.c >testcpp.out 2>&1; \
4889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4890 echo "Hooray, it works! I was beginning to wonder."
4891 x_cpp="$cpp $cppflags"
4893 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4894 $wrapper <testcpp.c >testcpp.out 2>&1; \
4895 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4901 rp="No dice. I can't find a C preprocessor. Name one:"
4905 $x_cpp <testcpp.c >testcpp.out 2>&1
4906 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4907 echo "OK, that will do." >&4
4909 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4924 echo "Perhaps can we force $cc -E using a wrapper..."
4925 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4926 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4932 echo "Nope, we'll have to live without it..."
4946 "$wrapper"|'cppstdin') ;;
4947 *) $rm -f $wrapper;;
4949 $rm -f testcpp.c testcpp.out
4951 : Adjust cppfilter for path component separator
4953 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4954 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4958 : Use gcc to determine libpth and incpth
4959 # If using gcc or clang, we can get better values for libpth, incpth
4960 # and usrinc directly from the compiler.
4961 # Note that ccname for clang is also gcc.
4964 $echo 'extern int foo;' > try.c
4965 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4967 if $test $# -gt 0; then
4969 incpth="`$echo $incpth|$sed 's/^ //'`"
4971 j="`$echo $i|$sed 's,/include$,/lib,'`"
4972 if $test -d $j; then
4976 libpth="`$echo $libpth|$sed 's/^ //'`"
4977 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4978 if $test -d $xxx; then
4981 *) libpth="$libpth $xxx";;
4988 '') for i in $incpth; do
4989 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4997 case "$usecrosscompile" in
5000 '') echo "Incpth not defined." >&4; croak=y ;;
5001 *) echo "Using incpth '$incpth'." >&4 ;;
5004 '') echo "Libpth not defined." >&4; croak=y ;;
5005 *) echo "Using libpth '$libpth'." >&4 ;;
5008 '') echo "Usrinc not defined." >&4; croak=y ;;
5009 *) echo "Using usrinc $usrinc." >&4 ;;
5013 if test "X$sysroot" = X; then
5014 echo "Cannot continue, aborting." >&4; exit 1
5016 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5025 : Default value for incpth is just usrinc
5027 '') incpth="$usrinc";;
5030 : Set private lib path
5033 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5038 '') dlist="$loclibpth $plibpth $glibpth";;
5039 *) dlist="$libpth";;
5042 : Now check and see which directories actually exist, avoiding duplicates
5045 if $test -d $xxx; then
5048 *) libpth="$libpth $xxx";;
5054 Some systems have incompatible or broken versions of libraries. Among
5055 the directories listed in the question below, please remove any you
5056 know not to be holding relevant libraries, and add any that are needed.
5057 Say "none" for none.
5061 if test "X$sysroot" != X; then
5063 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5076 rp="Directories to use for library searches?"
5083 : compute shared library extension
5086 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5096 On some systems, shared libraries may be available. Answer 'none' if
5097 you want to suppress searching of shared libraries for the remainder
5098 of this configuration.
5101 rp='What is the file extension used for shared libraries?'
5105 : Does target system insist that shared library basenames are unique
5108 Some dynamic loaders assume that the *basename* of shared library filenames
5109 are globally unique. We'll default this to undef as we assume your system
5110 is not this weird. Set to defined if you're on one of them.
5115 rp='Make shared library basenames unique?'
5118 y|Y) val="$define" ;;
5121 set d_libname_unique
5124 : Define several unixisms.
5125 : Hints files or command line option can be used to override them.
5126 : The convoluted testing is in case hints files set either the old
5129 '') case "$exe_ext" in
5131 *) _exe="$exe_ext" ;;
5136 '') case "$lib_ext" in
5143 '') case "$obj_ext" in
5150 '') case "$path_sep" in
5161 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5163 : Which makefile gets called first. This is used by make depend.
5164 case "$firstmakefile" in
5165 '') firstmakefile='makefile';;
5168 : Check is we will use socks
5170 $define|true|[yY]*) dflt='y';;
5175 Perl can be built to use the SOCKS proxy protocol library. To do so,
5176 Configure must be run with -Dusesocks. If you use SOCKS you also need
5177 to use the PerlIO abstraction layer, this will be implicitly selected.
5179 If this doesn't make any sense to you, just accept the default '$dflt'.
5181 rp='Build Perl for SOCKS?'
5184 y|Y) val="$define" ;;
5190 : Check for uselongdouble support
5192 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5195 case "$uselongdouble" in
5196 $define|true|[yY]*) dflt='y';;
5201 Perl can be built to take advantage of long doubles which
5202 (if available) may give more accuracy and range for floating point numbers.
5204 If this doesn't make any sense to you, just accept the default '$dflt'.
5206 rp='Try to use long doubles if available?'
5209 y|Y) val="$define" ;;
5215 case "$uselongdouble" in
5216 true|[yY]*) uselongdouble="$define" ;;
5219 : Look for a hint-file generated 'call-back-unit'. If the
5220 : user has specified that long doubles should be used,
5221 : we may need to set or change some other defaults.
5222 if $test -f uselongdouble.cbu; then
5223 echo "Your platform has some specific hints regarding long doubles, using them..."
5224 . ./uselongdouble.cbu
5226 case "$uselongdouble" in
5229 (Your platform does not have any specific hints for long doubles.)
5235 : Check if quadmath is requested
5236 case "$usequadmath" in
5237 "$define"|true|[yY]*) usequadmath="$define" ;;
5238 *) usequadmath="$undef" ;;
5241 : Fail if both uselongdouble and usequadmath are requested
5242 case "$usequadmath:$uselongdouble" in
5246 *** You requested the use of the quadmath library and use
5247 *** of long doubles.
5249 *** Please select one or the other.
5255 : Looking for optional libraries
5257 echo "Checking for optional libraries..." >&4
5262 case "$libswanted" in
5263 '') libswanted='c_s';;
5266 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5268 case "$usecbacktrace" in
5269 "$define") libswanted="$libswanted bfd" ;;
5271 case "$usequadmath" in
5272 "$define") libswanted="$libswanted quadmath" ;;
5278 for thisdir in $libpth $xlibpth; do
5279 test -d $thisdir && libspath="$libspath $thisdir"
5281 for thislib in $libswanted; do
5282 for thisdir in $libspath; do
5284 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5285 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5286 $test -f "$xxx" && eval $libscheck
5287 $test -f "$xxx" && libstyle=shared
5288 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5289 $test -f "$xxx" && eval $libscheck
5290 $test -f "$xxx" && libstyle=shared
5292 if test ! -f "$xxx"; then
5293 xxx=$thisdir/lib$thislib.$so
5294 $test -f "$xxx" && eval $libscheck
5295 $test -f "$xxx" && libstyle=shared
5297 if test ! -f "$xxx"; then
5298 xxx=$thisdir/lib$thislib$_a
5299 $test -f "$xxx" && eval $libscheck
5300 $test -f "$xxx" && libstyle=static
5302 if test ! -f "$xxx"; then
5303 xxx=$thisdir/$thislib$_a
5304 $test -f "$xxx" && eval $libscheck
5305 $test -f "$xxx" && libstyle=static
5307 if test ! -f "$xxx"; then
5308 xxx=$thisdir/lib${thislib}_s$_a
5309 $test -f "$xxx" && eval $libscheck
5310 $test -f "$xxx" && libstyle=static
5311 $test -f "$xxx" && thislib=${thislib}_s
5313 if test ! -f "$xxx"; then
5314 xxx=$thisdir/Slib$thislib$_a
5315 $test -f "$xxx" && eval $libscheck
5316 $test -f "$xxx" && libstyle=static
5318 if $test -f "$xxx"; then
5320 shared) echo "Found -l$thislib (shared)." ;;
5321 static) echo "Found -l$thislib." ;;
5322 *) echo "Found -l$thislib ($libstyle)." ;;
5326 *) dflt="$dflt -l$thislib"
5327 libsfound="$libsfound $xxx"
5329 libsfiles="$libsfiles $yyy"
5330 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5331 case " $libsdirs " in
5333 *) libsdirs="$libsdirs $yyy" ;;
5340 if $test ! -f "$xxx"; then
5341 echo "No -l$thislib."
5352 ' '|'') dflt='none';;
5357 In order to compile $package on your machine, a number of libraries
5358 are usually needed. Include any other special libraries here as well.
5359 Say "none" for none. The default list is almost always right.
5363 rp="What libraries to use?"
5370 : determine optimization, if desired, or use for debug flag also
5372 ' '|$undef) dflt='none';;
5374 *) dflt="$optimize";;
5378 By default, $package compiles with the -O flag to use the optimizer.
5379 Alternately, you might want to use the symbolic debugger, which uses
5380 the -g flag (on traditional Unix systems). Either flag can be
5381 specified here. To use neither flag, specify the word "none".
5384 rp="What optimizer/debugger flag should be used?"
5388 'none') optimize=" ";;
5391 : Check what DEBUGGING is required from the command line
5392 : -DEBUGGING or -DDEBUGGING or
5393 : -DEBUGGING=both = -g + -DDEBUGGING
5394 : -DEBUGGING=-g or -Doptimize=-g = -g
5395 : -DEBUGGING=none or -UDEBUGGING =
5396 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5399 *) DEBUGGING=$EBUGGING ;;
5402 case "$DEBUGGING" in
5406 *) optimize="$optimize -g" ;;
5410 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5418 case "$DEBUGGING" in
5419 both|$define) dflt='-DDEBUGGING'
5422 : argument order is deliberate, as the flag will start with - which set could
5423 : think is an option
5424 checkccflag='check=$1; flag=$2; callback=$3;
5426 echo "Checking if your compiler accepts $flag" 2>&1;
5427 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5428 echo "int main(void) { return 0; }" > gcctest.c;
5429 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5430 echo "Yes, it does." 2>&1;
5431 if $test -s gcctest.out ; then
5432 echo "But your platform does not like it:";
5437 echo "Leaving current flags $ccflags alone." 2>&1
5439 *) dflt="$dflt $flag";
5445 echo "Nope, it does not, but that is ok." 2>&1;
5449 : We will not override a previous value, but we might want to
5450 : augment a hint file
5452 default|recommended)
5453 case "$gccversion" in
5454 1*) dflt="$dflt -fpcc-struct-return" ;;
5456 case "$optimize:$DEBUGGING" in
5457 *-g*:old) dflt="$dflt -DDEBUGGING";;
5459 case "$gccversion" in
5460 2*) if $test -d /etc/conf/kconfig.d &&
5461 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5463 # Interactive Systems (ISC) POSIX mode.
5468 case "$gccversion" in
5471 ?*) set strict-aliasing -fno-strict-aliasing
5475 # For gcc, adding -pipe speeds up compilations for some, but apparently
5476 # some assemblers can't read from stdin. (It also slows down compilations
5477 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5478 case "$gccversion" in
5484 # on x86_64 (at least) we require an extra library (libssp) in the
5485 # link command line. This library is not named, so I infer that it is
5486 # an implementation detail that may change. Hence the safest approach
5487 # is to add the flag to the flags passed to the compiler at link time,
5488 # as that way the compiler can do the right implementation dependant
5491 amigaos) ;; # -fstack-protector builds but doesn't work
5492 *) case "$gccversion" in
5493 ?*) set stack-protector-strong -fstack-protector-strong
5496 *-fstack-protector-strong*) ;; # It got added.
5497 *) # Try the plain/older -fstack-protector.
5498 set stack-protector -fstack-protector
5509 case "$mips_type" in
5510 *BSD*|'') inclwanted="$locincpth $usrinc";;
5511 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5513 for thisincl in $inclwanted; do
5514 if $test -d $thisincl; then
5515 if $test x$thisincl != x$usrinc; then
5517 *" -I$thisincl "*);;
5518 *) dflt="$dflt -I$thisincl ";;
5524 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5526 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5534 *) dflt="$dflt -D$2";;
5538 set signal.h LANGUAGE_C; eval $inctest
5542 ccflags="$ccflags -DSOCKS"
5547 default|recommended) dflt="$ccflags $dflt" ;;
5548 *) dflt="$ccflags";;
5557 Your C compiler may want other flags. For this question you should include
5558 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5559 but you should NOT include libraries or ld flags like -lwhatever. If you
5560 want $package to honor its debug switch, you should include -DDEBUGGING here.
5561 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5563 To use no flags, specify the word "none".
5569 rp="Any additional cc flags?"
5576 : the following weeds options from ccflags that are of no interest to cpp
5578 '') cppflags="$ccflags" ;;
5579 *) set X $ccflags; shift
5580 case " $cppflags " in
5581 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5582 *) cppflags="$cppflags $ccflags" ;;
5586 case "$gccversion" in
5587 1*) cppflags="$cppflags -D__GNUC__"
5589 case "$mips_type" in
5591 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5597 echo "Let me guess what the preprocessor flags are..." >&4
5611 *) ftry="$previous $flag";;
5613 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5614 >cpp1.out 2>/dev/null && \
5615 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5616 >cpp2.out 2>/dev/null && \
5617 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5618 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5620 cppflags="$cppflags $ftry"
5630 *-*) echo "They appear to be: $cppflags";;
5632 $rm -f cpp.c cpp?.out
5636 : flags used in final linking phase
5638 '') if ./venix; then
5644 *-posix*) dflt="$dflt -posix" ;;
5647 *) dflt="$ldflags";;
5649 # See note above about -fstack-protector
5651 *-fstack-protector-strong*)
5653 *-fstack-protector-strong*) ;; # Don't add it again
5654 *) dflt="$dflt -fstack-protector-strong" ;;
5657 *-fstack-protector*)
5659 *-fstack-protector*) ;; # Don't add it again
5660 *) dflt="$dflt -fstack-protector" ;;
5665 : Try to guess additional flags to pick up local libraries.
5666 for thislibdir in $libpth; do
5667 case " $loclibpth " in
5670 *"-L$thislibdir "*) ;;
5671 *) dflt="$dflt -L$thislibdir" ;;
5683 Your C linker may need flags. For this question you should
5684 include -L/whatever and any other flags used by the C linker, but you
5685 should NOT include libraries like -lwhatever.
5687 Make sure you include the appropriate -L/path flags if your C linker
5688 does not normally search all of the directories you specified above,
5691 To use no flags, specify the word "none".
5695 rp="Any additional ld flags (NOT including libraries)?"
5701 rmlist="$rmlist pdp11"
5705 echo "Checking your choice of C compiler and flags for coherency..." >&4
5706 $cat > try.c <<'EOF'
5708 int main() { printf("Ok\n"); return(0); }
5710 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5712 $cat >try.msg <<'EOM'
5713 I've tried to compile and run the following simple program:
5716 $cat try.c >> try.msg
5718 $cat >> try.msg <<EOM
5725 and I got the following output:
5729 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5730 if $sh -c "$run ./try " >>try.msg 2>&1; then
5734 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5737 echo "The program compiled OK, but exited with status $?." >>try.msg
5738 rp="You have a problem. Shall I abort Configure"
5742 echo "I can't compile the test program." >>try.msg
5743 rp="You have a BIG problem. Shall I abort Configure"
5749 case "$knowitall" in
5751 echo "(The supplied flags or libraries might be incorrect.)"
5759 *) echo "Ok. Stopping Configure." >&4
5764 n) echo "OK, that should do.";;
5766 $rm_try gcctest gcctest.out
5768 : define a shorthand compile call
5772 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5773 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5777 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5778 : define a shorthand compile call for compilations that should be ok.
5782 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5784 : stub, used only to satisfy other units
5787 : check for lengths of integral types
5791 echo "Checking to see how big your integers are..." >&4
5800 printf("intsize=%d;\n", (int)sizeof(int));
5801 printf("longsize=%d;\n", (int)sizeof(long));
5802 printf("shortsize=%d;\n", (int)sizeof(short));
5807 if eval $compile_ok && $run ./try > /dev/null; then
5809 echo "Your integers are $intsize bytes long."
5810 echo "Your long integers are $longsize bytes long."
5811 echo "Your short integers are $shortsize bytes long."
5815 Help! I can't compile and run the intsize test program: please enlighten me!
5816 (This is probably a misconfiguration in your system or libraries, and
5817 you really ought to fix it. Still, I'll try anyway.)
5821 rp="What is the size of an integer (in bytes)?"
5825 rp="What is the size of a long integer (in bytes)?"
5829 rp="What is the size of a short integer (in bytes)?"
5837 : check for long long
5839 echo "Checking to see if you have long long..." >&4
5840 echo 'int main() { long long x = 7; return 0; }' > try.c
5842 if eval $compile; then
5844 echo "You have long long."
5847 echo "You do not have long long."
5853 : check for length of long long
5854 case "${d_longlong}${longlongsize}" in
5857 echo "Checking to see how big your long longs are..." >&4
5858 $cat >try.c <<'EOCP'
5862 printf("%d\n", (int)sizeof(long long));
5867 if eval $compile_ok; then
5868 longlongsize=`$run ./try`
5869 echo "Your long longs are $longlongsize bytes long."
5873 echo "(I can't seem to compile the test program. Guessing...)"
5874 rp="What is the size of a long long (in bytes)?"
5878 if $test "X$longsize" = "X$longlongsize"; then
5879 echo "(That isn't any different from an ordinary long.)"
5885 : determine filename position in cpp output
5887 echo "Computing filename position in cpp output for #include directives..." >&4
5889 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5894 vos) testaccess=-e ;;
5897 echo '#include <stdio.h>' > foo.c
5900 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5901 $grep '^[ ]*#.*stdio\.h' | \
5902 while read cline; do
5905 while $test \$# -gt 0; do
5906 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5911 pos=\`expr \$pos + 1\`
5925 *) pos="${fieldn}th";;
5927 echo "Your cpp writes the filename in the $pos field of the line."
5929 : locate header file
5934 for usrincdir in $incpth
5936 if test -f \$usrincdir/\$wanted; then
5937 echo "\$usrincdir/\$wanted"
5941 awkprg='{ print \$$fieldn }'
5942 echo "#include <\$wanted>" > foo\$\$.c
5943 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5944 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5945 while read cline; do
5946 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5948 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5949 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5954 # status = 0: grep returned 0 lines, case statement not executed
5955 # status = 1: headerfile found
5956 # status = 2: while loop executed, no headerfile found
5960 if test \$status -eq 1; then
5967 : define an alternate in-header-list? function
5968 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5969 cont=true; xxf="echo \"<\$1> found.\" >&4";
5970 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5971 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5973 case $# in 4) instead=instead;; *) instead="at last";; esac;
5974 while $test "$cont"; do
5976 var=$2; eval "was=\$$2";
5977 if $test "$xxx" && $test -r "$xxx";
5979 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5982 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5983 set $yyy; shift; shift; yyy=$@;
5984 case $# in 0) cont="";;
5985 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5986 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5987 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5988 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5992 do set $yyy; var=$2; eval "was=\$$2";
5993 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5994 set $yyy; shift; shift; yyy=$@;
5997 : see if inttypes.h is available
5998 : we want a real compile instead of Inhdr because some systems
5999 : have an inttypes.h which includes non-existent headers
6002 #include <inttypes.h>
6004 static int32_t foo32 = 0x12345678;
6008 if eval $compile; then
6009 echo "<inttypes.h> found." >&4
6012 echo "<inttypes.h> NOT found." >&4
6021 echo "Checking to see if you have int64_t..." >&4
6023 #include <sys/types.h>
6024 #$i_inttypes I_INTTYPES
6026 #include <inttypes.h>
6028 int main() { int64_t x = 7; }
6031 if eval $compile; then
6033 echo "You have int64_t."
6036 echo "You do not have int64_t."
6042 : Check if 64bit ints have a quad type
6044 echo "Checking which 64-bit integer type we could use..." >&4
6050 val='"unsigned int"'
6055 *) case "$longsize" in
6059 val='"unsigned long"'
6064 *) case "$d_longlong:$longlongsize" in
6069 val='"unsigned long long"'
6074 *) case "$d_int64_t" in
6093 '') echo "Alas, no 64-bit integer types in sight." >&4
6096 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6101 : Do we want 64bit support
6102 case "$uselonglong" in
6103 "$define"|true|[yY]*)
6106 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6108 use64bitint="$define"
6111 case "$use64bits" in
6112 "$define"|true|[yY]*)
6115 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6117 use64bitint="$define"
6120 case "$use64bitints" in
6121 "$define"|true|[yY]*)
6124 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6126 use64bitint="$define"
6129 case "$use64bitsint" in
6130 "$define"|true|[yY]*)
6133 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6135 use64bitint="$define"
6138 case "$uselonglongs" in
6139 "$define"|true|[yY]*)
6142 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6144 use64bitint="$define"
6147 case "$use64bitsall" in
6148 "$define"|true|[yY]*)
6151 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6153 use64bitall="$define"
6158 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6160 case "$use64bitall" in
6161 "$define"|true|[yY]*) use64bitint="$define" ;;
6167 You have natively 64-bit long integers.
6171 *) case "$use64bitint" in
6172 "$define"|true|[yY]*) dflt='y';;
6181 Perl can be built to take advantage of 64-bit integer types
6182 on some systems. To do so, Configure can be run with -Duse64bitint.
6183 Choosing this option will most probably introduce binary incompatibilities.
6185 If this doesn't make any sense to you, just accept the default '$dflt'.
6186 (The default has been chosen based on your configuration.)
6188 rp='Try to use 64-bit integers, if available?'
6191 [yY]*) val="$define" ;;
6199 case "$use64bitall" in
6200 "$define"|true|[yY]*) dflt='y' ;;
6201 *) case "$longsize" in
6209 You may also choose to try maximal 64-bitness. It means using as much
6210 64-bitness as possible on the platform. This in turn means even more
6211 binary incompatibilities. On the other hand, your platform may not
6212 have any more 64-bitness available than what you already have chosen.
6214 If this doesn't make any sense to you, just accept the default '$dflt'.
6215 (The default has been chosen based on your configuration.)
6217 rp='Try to use maximal 64-bit support, if available?'
6220 [yY]*) val="$define" ;;
6225 case "$use64bitall" in
6227 case "$use64bitint" in
6231 Since you have chosen a maximally 64-bit build, I'm also turning on
6232 the use of 64-bit integers.
6234 use64bitint="$define" ;;
6239 : Look for a hint-file generated 'call-back-unit'. If the
6240 : user has specified that a 64-bit perl is to be built,
6241 : we may need to set or change some other defaults.
6242 if $test -f use64bitint.cbu; then
6243 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6246 case "$use64bitint" in
6247 "$define"|true|[yY]*)
6248 : This test was common to all the OpenBSD forks, and seems harmless for
6251 echo "Checking if your C library has broken 64-bit functions..." >&4
6254 typedef $uquadtype myULL;
6261 {4294967303.15, 4294967303ULL},
6262 {4294967294.2, 4294967294ULL},
6263 {4294967295.7, 4294967295ULL},
6266 for (p = test; p->u; p++) {
6267 myULL x = (myULL)p->d;
6278 if eval $compile_ok; then
6279 libcquad=`$run ./try`
6280 echo "Your C library's 64-bit functions are $libcquad."
6282 echo "(I can't seem to compile the test program.)"
6283 echo "Assuming that your C library's 64-bit functions are ok."
6292 *** You have a C library with broken 64-bit functions.
6293 *** 64-bit support does not work reliably in this configuration.
6294 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6295 *** Cannot continue, aborting.
6302 4) case "$archname64" in
6303 '') archname64=64int ;;
6310 : Look for a hint-file generated 'call-back-unit'. If the
6311 : user has specified that a maximally 64-bit perl is to be built,
6312 : we may need to set or change some other defaults.
6313 if $test -f use64bitall.cbu; then
6314 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6317 case "$use64bitall" in
6318 "$define"|true|[yY]*)
6320 4) case "$archname64" in
6321 ''|64int) archname64=64all ;;
6328 case "$d_quad:$use64bitint" in
6332 *** You have chosen to use 64-bit integers,
6333 *** but none can be found.
6334 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6335 *** Cannot continue, aborting.
6342 : Check if we are using the GNU C library
6344 echo "Checking for GNU C Library..." >&4
6346 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6347 alone are insufficient to distinguish different versions, such as
6348 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6349 libc version 2.1.0. A. Dougherty, June 3, 2002.
6355 # ifdef __GLIBC_MINOR__
6356 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6357 # include <gnu/libc-version.h>
6358 printf("%s\n", gnu_get_libc_version());
6360 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6363 printf("%d\n", __GLIBC__);
6372 if eval $compile_ok && $run ./try > glibc.ver; then
6374 gnulibc_version=`$cat glibc.ver`
6375 echo "You are using the GNU C Library version $gnulibc_version"
6379 echo "You are not using the GNU C Library"
6385 : see if nm is to be used to determine whether a symbol is defined or not
6389 case "$d_gnulibc" in
6392 echo "nm probably won't work on the GNU C Library." >&4
6398 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6400 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6401 echo "'nm' won't be sufficient on this system." >&4
6407 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6408 if $test $dflt -gt 20; then
6418 true|$define) dflt=y;;
6425 I can use $nm to extract the symbols from your C libraries. This
6426 is a time consuming task which may generate huge output on the disk (up
6427 to 3 megabytes) but that should make the symbols extraction faster. The
6428 alternative is to skip the 'nm' extraction part and to compile a small
6429 test program instead to determine whether each symbol is present. If
6430 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6431 this may be the best solution.
6433 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6436 rp="Shall I use $nm to extract C symbols from the libraries?"
6439 [Nn]*) usenm=false;;
6448 : nm options which may be necessary
6450 '') if $test -f /mach_boot; then
6452 elif $test -d /usr/ccs/lib; then
6453 nm_opt='-p' # Solaris (and SunOS?)
6454 elif $test -f /dgux; then
6456 elif $test -f /lib64/rld; then
6457 nm_opt='-p' # 64-bit Irix
6463 : nm options which may be necessary for shared libraries but illegal
6464 : for archive libraries. Thank you, Linux.
6465 case "$nm_so_opt" in
6466 '') case "$myuname" in
6468 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6469 nm_so_opt='--dynamic'
6476 : Figure out where the libc is located
6479 : get list of predefined functions in a handy place
6484 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6490 *) for thislib in $libs; do
6493 : Handle C library specially below.
6496 thislib=`echo $thislib | $sed -e 's/^-l//'`
6497 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6499 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6501 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6503 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6505 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6507 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6509 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6514 libnames="$libnames $try"
6516 *) libnames="$libnames $thislib" ;;
6525 for xxx in $libpth; do
6526 $test -r $1 || set $xxx/libc.$so
6527 : The messy sed command sorts on library version numbers.
6529 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6530 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6532 s/[0-9][0-9]*/0000&/g
6533 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6536 $sort | $sed -e 's/^.* //'`
6539 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6540 $test -r $1 || set $sysroot/lib/libsys_s$_a
6546 if $test -r "$1"; then
6547 echo "Your (shared) C library seems to be in $1."
6549 elif $test -r /lib/libc && $test -r /lib/clib; then
6550 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6552 libc='/lib/clib /lib/libc'
6553 if $test -r /lib/syslib; then
6554 echo "(Your math library is in /lib/syslib.)"
6555 libc="$libc /lib/syslib"
6557 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6558 echo "Your C library seems to be in $libc, as you said before."
6559 elif $test -r $incpath/usr/lib/libc$_a; then
6560 libc=$incpath/usr/lib/libc$_a;
6561 echo "Your C library seems to be in $libc. That's fine."
6562 elif $test -r /lib/libc$_a; then
6564 echo "Your C library seems to be in $libc. You're normal."
6566 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6568 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6569 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6570 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6572 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6574 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6577 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6579 if $test -r "$tans"; then
6580 echo "Your C library seems to be in $tans, of all places."
6586 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6590 If the guess above is wrong (which it might be if you're using a strange
6591 compiler, or your machine supports multiple models), you can override it here.
6596 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6598 I can't seem to find your C library. I've looked in the following places:
6601 $sed 's/^/ /' libpath
6604 None of these seems to contain your C library. I need to get its name...
6609 rp='Where is your C library?'
6614 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6615 set X `cat libnames`
6618 case $# in 1) xxx=file; esac
6619 echo "Extracting names from the following $xxx for later perusal:" >&4
6621 $sed 's/^/ /' libnames >&4
6623 $echo $n "This may take a while...$c" >&4
6627 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6628 *) $nm $nm_opt $file 2>/dev/null;;
6633 $grep fprintf libc.tmp > libc.ptf
6634 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6635 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6637 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6641 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6645 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6649 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6653 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6662 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6666 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6670 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6674 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6678 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6682 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6690 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6695 $nm -p $* 2>/dev/null >libc.tmp
6696 $grep fprintf libc.tmp > libc.ptf
6697 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6698 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6704 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6706 if $ar t $libc > libc.tmp && \
6707 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6709 for thisname in $libnames $libc; do
6710 $ar t $thisname >>libc.tmp
6712 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6714 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6715 for thisname in $libnames $libc; do
6716 $ar tv $thisname >>libc.tmp
6717 emximp -o tmp.imp $thisname \
6719 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6720 < tmp.imp >>libc.tmp
6723 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6726 echo "$ar didn't seem to work right." >&4
6727 echo "Maybe this is a Cray...trying bld instead..." >&4
6729 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6732 for thisname in $libnames; do
6734 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6735 $ar t $thisname >>libc.tmp
6739 echo "That didn't work either. Giving up." >&4
6749 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6750 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6752 *) if $test -f /lib/syscalls.exp; then
6754 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6755 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6756 /lib/syscalls.exp >>libc.list
6762 $rm -f libnames libpath
6764 : Check if we are using C++
6766 echo "Checking for C++..." >&4
6767 $cat >try.c <<'EOCP'
6779 if eval $compile_ok && $run ./try; then
6781 echo "You are using a C++ compiler."
6784 echo "You are not using a C++ compiler."
6790 : is a C symbol defined?
6793 -v) tf=libc.tmp; tdc="";;
6794 -a) tf=libc.tmp; tdc="[]";;
6795 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6797 case "$d_cplusplus" in
6798 $define) extern_C="extern \"C\"" ;;
6799 *) extern_C="extern" ;;
6802 case "$reuseval-$4" in
6804 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6809 if $test "$runnm" = true; then
6810 if $contains $tlook $tf >/dev/null 2>&1; then
6812 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6813 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;
6814 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6815 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6819 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;
6820 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6826 $define) tval=true;;
6833 : define an is-in-libc? function
6834 inlibc='echo " "; td=$define; tu=$undef;
6835 sym=$1; var=$2; eval "was=\$$2";
6837 case "$reuseval$was" in
6847 echo "$sym() found." >&4;
6848 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6850 echo "$sym() NOT found." >&4;
6851 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6855 $define) echo "$sym() found." >&4;;
6856 *) echo "$sym() NOT found." >&4;;
6860 : check for length of double
6862 case "$doublesize" in
6864 echo "Checking to see how big your double precision numbers are..." >&4
6873 printf("%d\n", (int)sizeof(double));
6878 if eval $compile_ok; then
6879 doublesize=`$run ./try`
6880 echo "Your double is $doublesize bytes long."
6883 echo "(I can't seem to compile the test program. Guessing...)"
6884 rp="What is the size of a double precision number (in bytes)?"
6892 : check for long doubles
6894 echo "Checking to see if you have long double..." >&4
6895 echo 'int main() { long double x = 7.0; }' > try.c
6897 if eval $compile; then
6899 echo "You have long double."
6902 echo "You do not have long double."
6908 : see if ldexpl exists
6912 : check for length of long double
6913 case "${d_longdbl}${longdblsize}" in
6916 echo "Checking to see how big your long doubles are..." >&4
6917 $cat >try.c <<'EOCP'
6921 printf("%d\n", sizeof(long double));
6926 if eval $compile; then
6927 longdblsize=`$run ./try`
6928 echo "Your long doubles are $longdblsize bytes long."
6932 echo "(I can't seem to compile the test program. Guessing...)" >&4
6933 rp="What is the size of a long double (in bytes)?"
6937 if $test "X$doublesize" = "X$longdblsize"; then
6938 echo "That isn't any different from an ordinary double."
6939 echo "I'll keep your setting anyway, but you may see some"
6940 echo "harmless compilation warnings."
6946 $echo "Checking the kind of long doubles you have..." >&4
6947 case "$d_longdbl" in
6951 #define LONGDBLSIZE $longdblsize
6952 #define DOUBLESIZE $doublesize
6958 static const long double d = -0.1L;
6960 unsigned const char* b = (unsigned const char*)(&d);
6961 #if DOUBLESIZE == LONGDBLSIZE
6962 printf("0\n"); /* if it floats like double */
6965 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6966 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6967 /* IEEE 754 128-bit little-endian */
6971 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6972 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6977 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6978 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6979 * cannot be trusted. */
6980 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6981 if (b[0] == 0xCD && b[9] == 0xBF) {
6982 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6983 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6984 * Also known as "extended precision". */
6988 if (b[0] == 0xBF && b[9] == 0xCD) {
6989 /* Is there ever big-endian 80-bit, really?
6991 * The Motorola 68881 had another "extended precision" format:
6992 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6993 * for total of 96 bits of bytes. The zero bits were unused.
6994 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6995 * If it ever becomes relevant, this format should be allocated
6996 * a new doublekind code since it's quite different from the Intel x87.
7002 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7003 /* software "double double", the 106 is 53+53.
7004 * but irix thinks it is 107. */
7005 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7006 /* double double 128-bit fully little-endian,
7007 * little-endian doubles in little-endian order,
7008 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7012 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7013 /* double double 128-bit fully big-endian,
7014 * big-endian doubles in big-endian order,
7015 * e.g. PPC/Power and MIPS:
7016 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7020 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7021 /* double double 128-bit mixed endian.
7022 * little-endian doubles in big-endian order,
7024 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7028 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7029 /* double double 128-bit mixed endian,
7030 * big-endian doubles in little-endian order,
7031 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7036 /* We are largely making this up because it may well be
7037 * that the VAX format H was never made available to C,
7038 * only to Fortran. */
7039 #if LONGDBLSIZE == 16 && defined(__vax__)
7040 if (b[0] == 0xFD && b[15] == 0x99) {
7041 /* VAX format H, PDP-11 mixed endian. */
7046 printf("-1\n"); /* unknown */
7051 if eval $compile; then
7052 longdblkind=`$run ./try`
7059 case "$longdblkind" in
7060 0) echo "Your long doubles are doubles." >&4 ;;
7061 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7062 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7063 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7064 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7065 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7066 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7067 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7068 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7069 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7070 *) echo "Cannot figure out your long double." >&4 ;;
7072 d_long_double_style_ieee=$undef
7073 d_long_double_style_ieee_std=$undef
7074 d_long_double_style_ieee_extended=$undef
7075 d_long_double_style_ieee_doubledouble=$undef
7076 d_long_double_style_vax=$undef
7077 case "$longdblkind" in
7078 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7080 case "$longdblkind" in
7081 1|2) d_long_double_style_ieee_std=$define ;;
7083 case "$longdblkind" in
7084 3|4) d_long_double_style_ieee_extended=$define ;;
7086 case "$longdblkind" in
7087 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7089 case "$longdblkind" in
7090 9) d_long_double_style_vax=$define ;;
7094 : determine the architecture name
7096 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7097 tarch=`arch`"-$osname"
7098 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7099 if uname -m > tmparch 2>&1 ; then
7100 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7101 -e 's/$/'"-$osname/" tmparch`
7109 case "$myarchname" in
7112 echo "(Your architecture name used to be $myarchname.)"
7116 case "$targetarch" in
7118 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7123 *) dflt="$archname";;
7125 rp='What is your architecture name'
7129 : optionally add API version to the architecture for versioned archlibs
7130 case "$useversionedarchname" in
7131 $define|true|[yY]*) dflt='y';;
7134 rp='Add the Perl API version to your archname?'
7137 y|Y) useversionedarchname="$define" ;;
7138 *) useversionedarchname="$undef" ;;
7140 case "$useversionedarchname" in
7143 *-$api_versionstring)
7144 echo "...and architecture name already has -$api_versionstring" >&4
7147 archname="$archname-$api_versionstring"
7148 echo "...setting architecture name to $archname." >&4
7154 case "$usethreads" in
7156 echo "Threads selected." >&4
7158 *-thread*) echo "...and architecture name already has -thread." >&4
7160 *) archname="$archname-thread"
7161 echo "...setting architecture name to $archname." >&4
7166 case "$usemultiplicity" in
7168 echo "Multiplicity selected." >&4
7170 *-multi*) echo "...and architecture name already has -multi." >&4
7172 *) archname="$archname-multi"
7173 echo "...setting architecture name to $archname." >&4
7178 case "$use64bitint$use64bitall" in
7180 case "$archname64" in
7182 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7185 case "$use64bitint" in
7186 "$define") echo "64 bit integers selected." >&4 ;;
7188 case "$use64bitall" in
7189 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7192 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7194 *) archname="$archname-$archname64"
7195 echo "...setting architecture name to $archname." >&4
7201 case "$uselongdouble" in
7203 echo "Long doubles selected." >&4
7204 case "$longdblsize" in
7206 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7210 *-ld*) echo "...and architecture name already has -ld." >&4
7212 *) archname="$archname-ld"
7213 echo "...setting architecture name to $archname." >&4
7220 case "$usequadmath" in
7222 echo "quadmath selected." >&4
7224 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7226 *) archname="$archname-quadmath"
7227 echo "...setting architecture name to $archname." >&4
7232 if $test -f archname.cbu; then
7233 echo "Your platform has some specific hints for architecture name, using them..."
7237 : set the prefixit variable, to compute a suitable default value
7238 prefixit='case "$3" in
7240 case "$oldprefix" in
7241 "") eval "$1=\"\$$2\"";;
7248 ""|" ") eval "$1=\"\$$2\"";;
7254 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7256 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7257 /*-$oldprefix/*|\~*-$oldprefix/*)
7258 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7259 *) eval "$1=\"\$$2\"";;
7263 : determine installation style
7264 : For now, try to deduce it from prefix unless it is already set.
7265 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7266 case "$installstyle" in
7267 '') case "$prefix" in
7268 *perl*) dflt='lib';;
7269 *) dflt='lib/perl5' ;;
7272 *) dflt="$installstyle" ;;
7274 : Probably not worth prompting for this since we prompt for all
7275 : the directories individually, and the prompt would be too long and
7279 : determine where public executables go
7284 rp='Pathname where the public executables will reside?'
7286 if $test "X$ansexp" != "X$binexp"; then
7290 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7291 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7292 : this via initialinstalllocation
7295 case "$userelocatableinc" in
7296 $define|true|[yY]*) dflt='y' ;;
7301 Would you like to build Perl so that the installation is relocatable, so that
7302 library paths in @INC are determined relative to the path of the perl binary?
7303 This is not advised for system Perl installs, or if you need to run setid
7304 scripts or scripts under taint mode.
7306 If this doesn't make any sense to you, just accept the default '$dflt'.
7308 rp='Use relocatable @INC?'
7311 y|Y) val="$define" ;;
7314 set userelocatableinc
7317 initialinstalllocation="$binexp"
7318 : Default prefix is now "up one level from where the binaries are"
7319 case "$userelocatableinc" in
7325 installprefixexp=".../.."
7329 : determine where private library files go
7330 : Usual default is /usr/local/lib/perl5/$version.
7331 : Also allow things like /opt/perl/lib/$version, since
7332 : /opt/perl/lib/perl5... would be redundant.
7333 : The default "style" setting is made in installstyle.U
7334 case "$installstyle" in
7335 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7336 *) set dflt privlib lib/$version ;;
7341 There are some auxiliary files for $package that need to be put into a
7342 private library directory that is accessible by everyone.
7347 rp='Pathname where the private library files will reside?'
7352 : set the prefixup variable, to restore leading tilda escape
7353 prefixup='case "$prefixexp" in
7355 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7358 : determine where public architecture dependent libraries go
7361 : privlib default is /usr/local/lib/$package/$version
7362 : archlib default is /usr/local/lib/$package/$version/$archname
7363 : privlib may have an optional trailing /share.
7364 tdflt=`echo $privlib | $sed 's,/share$,,'`
7365 tdflt=$tdflt/$archname
7374 $spackage contains architecture-dependent library files. If you are
7375 sharing libraries in a heterogeneous environment, you might store
7376 these files in a separate location. Otherwise, you can just include
7377 them with the rest of the public library files.
7382 rp='Where do you want to put the public architecture-dependent libraries?'
7386 if $test X"$archlib" = X"$privlib"; then
7392 : see if setuid scripts can be secure
7395 Some kernels have a bug that prevents setuid #! scripts from being
7396 secure. Some sites have disabled setuid #! scripts because of this.
7398 First let's decide if your kernel supports secure setuid #! scripts.
7399 (If setuid #! scripts would be secure but have been disabled anyway,
7400 don't say that they are secure if asked.)
7405 if $test -d /dev/fd; then
7406 echo "#!$ls" >reflect
7407 chmod +x,u+s reflect
7408 ./reflect >flect 2>&1
7409 if $contains "/dev/fd" flect >/dev/null; then
7410 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7414 If you are not sure if they are secure, I can check but I'll need a
7415 username and password different from the one you are using right now.
7416 If you don't have such a username or don't want me to test, simply
7420 rp='Other username to test security of setuid scripts with?'
7425 case "$d_suidsafe" in
7426 '') echo "I'll assume setuid scripts are *not* secure." >&4
7429 echo "Well, the $hint value is *not* secure." >&4
7431 *) echo "Well, the $hint value *is* secure." >&4
7436 $rm -f reflect flect
7437 echo "#!$ls" >reflect
7438 chmod +x,u+s reflect
7441 echo '"su" will (probably) prompt you for '"$ans's password."
7442 su $ans -c './reflect >flect'
7443 if $contains "/dev/fd" flect >/dev/null; then
7444 echo "Okay, it looks like setuid scripts are secure." >&4
7447 echo "I don't think setuid scripts are secure." >&4
7452 rp='Does your kernel have *secure* setuid scripts?'
7455 [yY]*) val="$define";;
7460 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7461 echo "(That's for file descriptors, not floppy disks.)"
7467 $rm -f reflect flect
7469 : now see if they want to do setuid emulation
7470 if $test $patchlevel -lt 11; then
7473 case "$d_suidsafe" in
7476 echo "No need to emulate SUID scripts since they are secure here." >&4
7480 Some systems have disabled setuid scripts, especially systems where
7481 setuid scripts cannot be secure. On systems where setuid scripts have
7482 been disabled, the setuid/setgid bits on scripts are currently
7483 useless. It is possible for $package to detect those bits and emulate
7484 setuid/setgid in a secure fashion. This emulation will only work if
7485 setuid scripts have been disabled in your kernel.
7489 "$define") dflt=y ;;
7492 rp="Do you want to do setuid/setgid emulation?"
7495 [yY]*) val="$define";;
7507 SUID emulation has been removed for 5.12
7508 Please re-run Configure without -Dd_dosuid
7517 : Find perl5.005 or later.
7518 echo "Looking for a previously installed perl5.005 or later... "
7520 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7521 : Check if this perl is recent and can load a simple module
7522 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7525 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7535 '') echo "None found. That's ok.";;
7536 *) echo "Using $perl5." ;;
7539 : Set the siteprefix variables
7542 After $package is installed, you may wish to install various
7543 add-on modules and utilities. Typically, these add-ons will
7544 be installed under $prefix with the rest
7545 of this package. However, you may wish to install such add-ons
7546 elsewhere under a different prefix.
7548 If you do not wish to put everything under a single prefix, that's
7549 ok. You will be prompted for the individual locations; this siteprefix
7550 is only used to suggest the defaults.
7552 The default should be fine for most people.
7556 rp='Installation prefix to use for add-on modules and utilities?'
7557 : XXX Here might be another good place for an installstyle setting.
7558 case "$siteprefix" in
7560 *) dflt=$siteprefix ;;
7563 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7565 case "$siteprefix" in
7569 *) oldsiteprefix="$prefix";;
7574 siteprefixexp="$ansexp"
7576 : determine where site specific libraries go.
7577 : Usual default is /usr/local/lib/perl5/site_perl/$version
7578 : The default "style" setting is made in installstyle.U
7579 : XXX No longer works with Prefixit stuff.
7580 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7582 '') case "$installstyle" in
7583 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7584 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7592 The installation process will create a directory for
7593 site-specific extensions and modules. Most users find it convenient
7594 to place all site-specific files in this directory rather than in the
7595 main distribution directory.
7599 rp='Pathname for the site-specific library files?'
7603 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7605 : Determine list of previous versions to include in @INC
7606 $cat > getverlist <<EOPL
7609 \$api_versionstring = "$api_versionstring";
7610 \$version = "$version";
7611 \$stem = "$sitelib_stem";
7612 \$archname = "$archname";
7614 $cat >> getverlist <<'EOPL'
7615 # The list found is store twice for each entry: the original name, and
7616 # the binary broken down version as pack "sss", so sorting is easy and
7617 # unambiguous. This will work for all versions that have a maximum of
7618 # three digit groups, separate by '.'s or '_'s. Names are extended with
7619 # ".0.0" to ensure at least three elements for the pack.
7620 # -- H.Merijn Brand (m)'06 23-10-2006
7622 # Can't have leading @ because metaconfig interprets it as a command!
7623 ;@inc_version_list=();
7624 # XXX Redo to do opendir/readdir?
7627 ;@candidates = map {
7628 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7629 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7635 ($pversion, $aversion, $vsn5005) = map {
7636 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7637 foreach $d (@candidates) {
7638 if ($d->[1] lt $pversion) {
7639 if ($d->[1] ge $aversion) {
7640 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7642 elsif ($d->[1] ge $vsn5005) {
7643 unshift(@inc_version_list, grep { -d } $d->[0]);
7647 # Skip newer version. I.e. don't look in
7648 # 5.7.0 if we're installing 5.6.1.
7652 if (@inc_version_list) {
7653 print join(' ', @inc_version_list);
7656 # Blank space to preserve value for next Configure run.
7661 case "$inc_version_list" in
7662 '') if test -x "$perl5$exe_ext"; then
7663 dflt=`$perl5 getverlist`
7668 $undef) dflt='none' ;;
7669 *) eval dflt=\"$inc_version_list\" ;;
7672 ''|' ') dflt=none ;;
7679 In order to ease the process of upgrading, this version of perl
7680 can be configured to use modules built and installed with earlier
7681 versions of perl that were installed under $prefix. Specify here
7682 the list of earlier versions that this version of perl should check.
7683 If Configure detected no earlier versions of perl installed under
7684 $prefix, then the list will be empty. Answer 'none' to tell perl
7685 to not search earlier versions.
7687 The default should almost always be sensible, so if you're not sure,
7688 just accept the default.
7691 rp='List of earlier versions to include in @INC?'
7694 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7695 *) inc_version_list="$ans" ;;
7697 case "$inc_version_list" in
7699 inc_version_list_init='0'
7700 d_inc_version_list="$undef"
7702 *) inc_version_list_init=`echo $inc_version_list |
7703 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7704 d_inc_version_list="$define"
7709 : see if malloc/malloc.h has to be included
7710 set malloc/malloc.h i_mallocmalloc
7713 : see if this is a malloc.h system
7714 : we want a real compile instead of Inhdr because some systems have a
7715 : malloc.h that just gives a compile error saying to use stdlib.h instead
7720 #$i_mallocmalloc I_MALLOCMALLOC
7721 #ifdef I_MALLOCMALLOC
7722 # include <malloc/malloc.h>
7725 int main () { return 0; }
7728 if eval $compile; then
7729 echo "<malloc.h> found." >&4
7732 echo "<malloc.h> NOT found." >&4
7739 : check for length of pointer
7743 echo "Checking to see how big your pointers are..." >&4
7752 printf("%d\n", (int)sizeof(void *));
7757 if eval $compile_ok; then
7758 ptrsize=`$run ./try`
7759 echo "Your pointers are $ptrsize bytes long."
7762 echo "(I can't seem to compile the test program. Guessing...)" >&4
7763 rp="What is the size of a pointer (in bytes)?"
7770 case "$use64bitall" in
7771 "$define"|true|[yY]*)
7775 *** You have chosen a maximally 64-bit build,
7776 *** but your pointers are only 4 bytes wide.
7777 *** Please rerun Configure without -Duse64bitall.
7782 *** Since you have quads, you could possibly try with -Duse64bitint.
7787 *** Cannot continue, aborting.
7798 : determine whether to use malloc wrapping
7800 case "$usemallocwrap" in
7801 [yY]*|true|$define) dflt='y' ;;
7802 [nN]*|false|$undef) dflt='n' ;;
7803 *) case "$usedevel" in
7804 [yY]*|true|$define) dflt='y' ;;
7809 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7811 usemallocwrap="$ans"
7814 usemallocwrap="$define" ;;
7816 usemallocwrap="$undef" ;;
7819 : determine which malloc to compile in
7821 case "$usemymalloc" in
7822 [yY]*|true|$define) dflt='y' ;;
7823 [nN]*|false|$undef) dflt='n' ;;
7824 *) case "$ptrsize" in
7828 if test "$useithreads" = "$define"; then dflt='n'; fi
7831 rp="Do you wish to attempt to use the malloc that comes with $package?"
7837 mallocsrc='malloc.c'
7838 mallocobj="malloc$_o"
7839 d_mymalloc="$define"
7842 : Remove malloc from list of libraries to use
7843 echo "Removing unneeded -lmalloc from library list" >&4
7844 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7847 echo "libs = $libs" >&4
7859 : compute the return types of malloc and free
7861 $cat >malloc.c <<END
7865 #include <sys/types.h>
7879 case "$malloctype" in
7881 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7888 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7892 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7899 echo "Your system uses $freetype free(), it would seem." >&4
7901 : determine where site specific architecture-dependent libraries go.
7902 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7903 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7904 : sitelib may have an optional trailing /share.
7906 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7907 dflt="$dflt/$archname"
7912 set sitearch sitearch none
7916 The installation process will also create a directory for
7917 architecture-dependent site-specific extensions and modules.
7921 rp='Pathname for the site-specific architecture-dependent library files?'
7925 if $test X"$sitearch" = X"$sitelib"; then
7928 d_sitearch="$define"
7931 : Set the vendorprefix variables
7934 The installation process will also create a directory for
7935 vendor-supplied add-ons. Vendors who supply perl with their system
7936 may find it convenient to place all vendor-supplied files in this
7937 directory rather than in the main distribution directory. This will
7938 ease upgrades between binary-compatible maintenance versions of perl.
7940 Of course you may also use these directories in whatever way you see
7941 fit. For example, you might use them to access modules shared over a
7942 company-wide network.
7944 The default answer should be fine for most people.
7945 This causes further questions about vendor add-ons to be skipped
7946 and no vendor-specific directories will be configured for perl.
7949 rp='Do you want to configure vendor-specific add-on directories?'
7950 case "$usevendorprefix" in
7951 define|true|[yY]*) dflt=y ;;
7952 *) : User may have set vendorprefix directly on Configure command line.
7953 case "$vendorprefix" in
7962 rp='Installation prefix to use for vendor-supplied add-ons?'
7963 case "$vendorprefix" in
7964 '') dflt="$prefix" ;;
7965 *) dflt=$vendorprefix ;;
7968 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7970 case "$vendorprefix" in
7974 *) oldvendorprefix="$prefix";;
7978 usevendorprefix="$define"
7980 vendorprefixexp="$ansexp"
7982 *) usevendorprefix="$undef"
7988 : Set the vendorlib variables
7989 case "$vendorprefix" in
7990 '') d_vendorlib="$undef"
7994 *) d_vendorlib="$define"
7995 : determine where vendor-supplied modules go.
7996 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7997 case "$vendorlib" in
7999 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8000 case "$installstyle" in
8001 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8002 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8005 *) dflt="$vendorlib"
8009 rp='Pathname for the vendor-supplied library files?'
8012 vendorlibexp="$ansexp"
8015 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8019 : Set the vendorarch variables
8020 case "$vendorprefix" in
8021 '') d_vendorarch="$undef"
8025 *) d_vendorarch="$define"
8026 : determine where vendor-supplied architecture-dependent libraries go.
8027 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8028 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8029 : vendorlib may have an optional trailing /share.
8030 case "$vendorarch" in
8031 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8032 dflt="$dflt/$archname"
8034 *) dflt="$vendorarch" ;;
8037 rp='Pathname for vendor-supplied architecture-dependent files?'
8040 vendorarchexp="$ansexp"
8043 prefixvar=vendorarch
8045 if $test X"$vendorarch" = X"$vendorlib"; then
8046 d_vendorarch="$undef"
8048 d_vendorarch="$define"
8051 : Final catch-all directories to search
8054 Lastly, you can have perl look in other directories for extensions and
8055 modules in addition to those already specified.
8056 These directories will be searched after
8060 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8061 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8063 case "$otherlibdirs" in
8064 ''|' ') dflt='none' ;;
8065 *) dflt="$otherlibdirs" ;;
8068 Enter a colon-separated set of extra paths to include in perl's @INC
8069 search path, or enter 'none' for no extra paths.
8073 rp='Colon-separated list of additional directories for perl to search?'
8076 ' '|''|none) otherlibdirs=' ' ;;
8077 *) otherlibdirs="$ans" ;;
8079 case "$otherlibdirs" in
8083 set d_perl_otherlibdirs
8087 dflt_dtrace='/usr/sbin/dtrace'
8088 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8092 Perl can be built to support DTrace on platforms that support it.
8093 DTrace is a diagnosis and performance analysis tool from Sun.
8095 If this doesn't make any sense to you, just accept the default.
8099 case "$usedtrace" in
8105 dflt_dtrace=$usedtrace
8112 rp='Support DTrace if available?'
8115 y|Y) val="$define" ;;
8121 test "X$usedtrace" != "X$define" && break
8124 rp='Where is the dtrace executable?'
8133 if $dtrace -h -s ../perldtrace.d \
8134 -o perldtrace.tmp >/dev/null 2>&1 \
8135 && rm -f perldtrace.tmp
8138 echo "Good: your $dtrace knows about the -h flag."
8142 *** $me: Fatal Error: $dtrace doesn't support -h flag
8144 *** Your installed dtrace doesn't support the -h switch to compile a D
8145 *** program into a C header. Can't continue.
8157 *** $me: Fatal Error: $dtrace not found.
8164 echo "*** $dtrace was not found."
8170 : See if we want extra modules installed
8177 Perl can be built with extra modules or bundles of modules which
8178 will be fetched from the CPAN and installed alongside Perl.
8180 Notice that you will need access to the CPAN; either via the Internet,
8181 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8182 be asked later to configure the CPAN.pm module which will in turn do
8183 the installation of the rest of the extra modules or bundles.)
8185 Notice also that if the modules require any external software such as
8186 libraries and headers (the libz library and the zlib.h header for the
8187 Compress::Zlib module, for example) you MUST have any such software
8188 already installed, this configuration process will NOT install such
8191 If this doesn't make any sense to you, just accept the default '$dflt'.
8193 rp='Install any extra modules (y or n)?'
8199 Please list any extra modules or bundles to be installed from CPAN,
8200 with spaces between the names. The names can be in any format the
8201 'install' command of CPAN.pm will understand. (Answer 'none',
8202 without the quotes, to install no extra modules or bundles.)
8212 $rm -f ../extras.lst
8214 *) echo "(Saving the list of extras for later...)"
8215 echo "$extras" > ../extras.lst
8223 : determine where html pages for programs go
8224 set html1dir html1dir none
8228 If you wish to install html files for programs in $spackage, indicate
8229 the appropriate directory here. To skip installing html files,
8233 ''|none|$undef|' ') dflt=none ;;
8234 *) dflt=$html1dir ;;
8237 rp="Directory for the main $spackage html pages?"
8241 : Use ' ' for none so value is preserved next time through Configure
8242 $test X"$html1dir" = "X" && html1dir=' '
8244 : determine where html pages for libraries and modules go
8245 set html3dir html3dir none
8249 If you wish to install html files for modules associated with $spackage,
8250 indicate the appropriate directory here. To skip installing html files,
8253 : There is no obvious default. If they have specified html1dir, then
8254 : try to key off that, possibly changing .../html1 into .../html3.
8256 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8257 *) dflt=$html3dir ;;
8260 rp="Directory for the $spackage module html pages?"
8264 : Use ' ' for none so value is preserved next time through Configure
8265 $test X"$html3dir" = "X" && html3dir=' '
8267 : determine whether to install perl also as /usr/bin/perl
8270 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8272 Many scripts expect perl to be installed as /usr/bin/perl.
8274 If you want to, I can install the perl you are about to compile
8275 as /usr/bin/perl (in addition to $bin/perl).
8277 if test -f /usr/bin/perl; then
8280 However, please note that because you already have a /usr/bin/perl,
8281 overwriting that with a new Perl would very probably cause problems.
8282 Therefore I'm assuming you don't want to do that (unless you insist).
8285 case "$installusrbinperl" in
8286 "$define"|[yY]*) dflt='y';;
8292 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8295 case "$installusrbinperl" in
8296 "$undef"|[nN]*) dflt='n';;
8300 rp="Do you want to install perl as /usr/bin/perl?"
8303 [yY]*) val="$define";;
8309 set installusrbinperl
8312 : see if dlopen exists
8314 xxx_ccflags="$ccflags"
8316 : with g++ one needs -shared to get is-in-libc to work for dlopen
8317 case "$gccversion" in
8320 *) case "$d_cplusplus" in
8321 "$define") ccflags="$ccflags -shared" ;;
8328 ccflags="$xxx_ccflags"
8330 : see if this is a unistd.h system
8331 set unistd.h i_unistd
8334 : determine which dynamic loading, if any, to compile in
8336 dldir="ext/DynaLoader"
8349 $define) dflt='y' ;;
8351 : Does a dl_xxx.xs file exist for this operating system
8352 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8355 rp="Do you wish to use dynamic loading?"
8362 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8363 dflt="$dldir/dl_${osname}.xs"
8364 elif $test "$d_dlopen" = "$define" ; then
8365 dflt="$dldir/dl_dlopen.xs"
8370 *) dflt="$dldir/$dlsrc"
8373 echo "The following dynamic loading files are available:"
8374 : Can not go over to $dldir because getfile has path hard-coded in.
8375 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8376 rp="Source file to use for dynamic loading"
8382 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8386 Some systems may require passing special flags to $cc -c to
8387 compile modules that will be used to create a shared library.
8388 To use no flags, say "none".
8391 case "$cccdlflags" in
8392 '') case "$gccversion" in
8393 '') case "$osname" in
8395 irix*) dflt='-KPIC' ;;
8396 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8397 sunos) dflt='-pic' ;;
8401 *) case "$osname" in
8402 darwin) dflt='none' ;;
8403 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8408 *) dflt="$cccdlflags" ;;
8415 # If -Dsysroot was specified, now's the time to add it
8417 if test "X$sysroot" != X; then
8418 case "$gccversion" in
8423 dflt="$dflt --sysroot=$sysroot" ;;
8433 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8436 none) cccdlflags=' ' ;;
8437 *) cccdlflags="$ans" ;;
8442 Some systems use ld to create libraries that can be dynamically loaded,
8443 while other systems (such as those using ELF) use $cc.
8447 : Determine if this is ELF
8449 /* Test for whether ELF binaries are produced */
8461 int i = open("a.out",O_RDONLY);
8464 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8465 exit(0); /* succeed (yes, it is ELF) */
8469 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8475 '') if $test $bin_ELF = "$define"; then
8477 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8481 echo "I'll use ld to build dynamic libraries."
8489 rp="What command should be used to create dynamic libraries?"
8495 Some systems may require passing special flags to $ld to create a
8496 library that can be dynamically loaded. If your ld flags include
8497 -L/other/path options to locate libraries outside your loader's normal
8498 search path, you may need to specify those -L options here as well. To
8499 use no flags, say "none".
8502 case "$lddlflags" in
8503 '') case "$osname" in
8504 haiku) dflt='-shared' ;;
8506 case "$gccversion" in
8507 '') dflt="$dflt +vnocompatwarnings" ;;
8510 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8511 solaris) # See [perl #66604].
8512 # On Solaris 11, gcc -m64 on amd64
8513 # appears not to understand -G. gcc versions at
8514 # least as old as 3.4.3 support -shared, so just
8515 # use that with Solaris 11 and later, but keep
8516 # the old behavior for older Solaris versions.
8517 case "$gccversion" in
8519 *) case "$osvers" in
8520 2.?|2.10) dflt='-G' ;;
8521 *) dflt='-shared' ;;
8526 sunos) dflt='-assert nodefinitions' ;;
8527 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8531 *) dflt="$lddlflags" ;;
8534 : Only do this for gcc, since, for example, qcc has no concept
8536 if $test "X$sysroot" != X; then
8537 case "$gccversion" in
8539 *) dflt="$dflt --sysroot $sysroot" ;;
8543 : Try to guess additional flags to pick up local libraries.
8544 : Be careful not to append to a plain 'none'
8548 for thisflag in $ldflags; do
8553 *) dflt="$dflt $thisflag" ;;
8560 ''|' ') dflt='none' ;;
8564 *-fstack-protector-strong*)
8566 *-fstack-protector-strong*) ;; # Don't add it again
8567 *) dflt="$dflt -fstack-protector-strong" ;;
8570 *-fstack-protector*)
8572 *-fstack-protector*) ;; # Don't add it again
8573 *) dflt="$dflt -fstack-protector" ;;
8578 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8581 none) lddlflags=' ' ;;
8582 *) lddlflags="$ans" ;;
8587 Some systems may require passing special flags to $cc to indicate that
8588 the resulting executable will use dynamic linking. To use no flags,
8592 case "$ccdlflags" in
8593 '') case "$osname" in
8594 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8595 sunos) dflt='none' ;;
8599 *) dflt="$ccdlflags" ;;
8601 rp="Any special flags to pass to $cc to use dynamic linking?"
8604 none) ccdlflags=' ' ;;
8605 *) ccdlflags="$ans" ;;
8617 ld_can_script="$undef"
8618 case "$bin_ELF$usedl" in
8620 # Abuse try.h and a.out names for neat cleanup
8632 if $cc $cccdlflags $ccdlflags $ccflags \
8633 $ldflags $lddlflags -o a.out try.c \
8634 -Wl,--version-script=try.h >/dev/null 2>&1 \
8635 && $test -s a.out ; then
8636 echo "ld supports scripting" >&4
8637 ld_can_script="$define"
8639 echo "ld does not support scripting" >&4
8645 : Do we want a shared libperl?
8649 # No dynamic loading being used, so don't bother even to prompt.
8652 *) case "$useshrplib" in
8653 '') case "$osname" in
8654 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8656 also='Building a shared libperl is required for dynamic loading to work on your system.'
8670 The perl executable is normally obtained by linking perlmain.c with
8671 libperl${_a}, any static extensions (usually just DynaLoader), and
8672 any other libraries needed on this system (such as -lm, etc.). Since
8673 your system supports dynamic loading, it is probably possible to build
8674 a shared libperl.$so. If you will have more than one executable linked
8675 to libperl.$so, this will significantly reduce the size of each
8676 executable, but it may have a noticeable effect on performance. The
8677 default is probably sensible for your system.
8681 rp="Build a shared libperl.$so (y/n)"
8685 useshrplib='true' ;;
8686 *) useshrplib='false' ;;
8691 case "$useshrplib" in
8693 case "$userelocatableinc" in
8695 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8696 echo "See INSTALL for an explanation why that won't work." >&4
8702 # Figure out a good name for libperl.so. Since it gets stored in
8703 # a version-specific architecture-dependent library, the version
8704 # number isn't really that important, except for making cc/ld happy.
8706 # A name such as libperl.so.10.1
8707 majmin="libperl.$so.$patchlevel.$subversion"
8708 # A name such as libperl.so.100
8709 majonly=`echo $patchlevel $subversion |
8710 $awk '{printf "%d%02d", $1, $2}'`
8711 majonly=libperl.$so.$majonly
8712 # I'd prefer to keep the os-specific stuff here to a minimum, and
8713 # rely on figuring it out from the naming of libc.
8714 case "${osname}${osvers}" in
8715 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8718 cygwin*) # ld links now against the dll directly
8719 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8720 majonly=`echo $patchlevel $subversion |
8721 $awk '{printf "%03d%03d", $1, $2}'`
8722 majonly=cygperl5.$majonly.$so
8725 *) # Try to guess based on whether libc has major.minor.
8727 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8728 *libc.$so.[0-9]*) dflt=$majonly ;;
8729 *) dflt=libperl.$so ;;
8739 I need to select a good name for the shared libperl. If your system uses
8740 library names with major and minor numbers, then you might want something
8741 like $majmin. Alternatively, if your system uses a single version
8742 number for shared libraries, then you might want to use $majonly.
8743 Or, your system might be quite happy with a simple libperl.$so.
8745 Since the shared libperl will get installed into a version-specific
8746 architecture-dependent directory, the version number of the shared perl
8747 library probably isn't important, so the default should be o.k.
8750 rp='What name do you want to give to the shared libperl?'
8753 echo "Ok, I'll use $libperl"
8756 libperl="libperl${_a}"
8760 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8764 WARNING: Use of the shrpdir variable for the installation location of
8765 the shared $libperl is not supported. It was never documented and
8766 will not work in this version. Let me (perlbug@perl.org)
8767 know of any problems this may cause.
8773 But your current setting of $shrpdir is
8774 the default anyway, so it's harmless.
8779 Further, your current attempted setting of $shrpdir
8780 conflicts with the value of $archlibexp/CORE
8781 that installperl will use.
8788 # How will the perl executable find the installed shared $libperl?
8789 # Add $xxx to ccdlflags.
8790 # If we can't figure out a command-line option, use $shrpenv to
8791 # set env LD_RUN_PATH. The main perl makefile uses this.
8792 shrpdir=$archlibexp/CORE
8795 if "$useshrplib"; then
8798 # We'll set it in Makefile.SH...
8803 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8804 xxx="-Wl,-R$shrpdir"
8806 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8807 xxx="-Wl,-rpath,$shrpdir"
8810 # hpux doesn't like the default, either.
8811 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8814 # cygwin needs only ldlibpth
8817 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8823 # Only add $xxx if it isn't already in ccdlflags.
8824 case " $ccdlflags " in
8826 *) ccdlflags="$ccdlflags $xxx"
8829 Adding $xxx to the flags
8830 passed to $ld so that the perl executable will find the
8831 installed shared $libperl.
8839 # Fix ccdlflags in AIX for building external extensions.
8840 # (For building Perl itself bare -bE:perl.exp is needed,
8841 # Makefile.SH takes care of this.)
8843 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8845 # Respect a hint or command-line value.
8847 '') shrpenv="$tmp_shrpenv" ;;
8849 case "$ldlibpthname" in
8850 '') ldlibpthname=LD_LIBRARY_PATH ;;
8851 none) ldlibpthname='' ;;
8854 : determine where manual pages are on this system
8858 syspath='/usr/share/man/man1 /usr/man/man1'
8859 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8860 syspath="$syspath /usr/man/u_man/man1"
8861 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8862 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8863 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8864 sysman=`./loc . /usr/man/man1 $syspath`
8867 if $test -d "$sysman"; then
8868 echo "System manual is in $sysman." >&4
8870 echo "Could not find manual pages in source form." >&4
8873 : determine where manual pages go
8874 set man1dir man1dir none
8878 $spackage has manual pages available in source form.
8882 echo "However, you don't have nroff, so they're probably useless to you."
8884 '') man1dir="none";;
8887 echo "If you don't want the manual sources installed, answer 'none'."
8892 lookpath="$prefixexp/share/man/man1"
8893 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8894 lookpath="$lookpath $prefixexp/man/p_man/man1"
8895 lookpath="$lookpath $prefixexp/man/u_man/man1"
8896 lookpath="$lookpath $prefixexp/man/man.1"
8898 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8899 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8909 rp="Where do the main $spackage manual pages (source) go?"
8911 if $test "X$man1direxp" != "X$ansexp"; then
8922 : What suffix to use on installed man pages
8929 rp="What suffix should be used for the main $spackage man pages?"
8931 '') case "$man1dir" in
8945 *) dflt="$man1ext";;
8952 : see if we can have long filenames
8954 first=123456789abcdef
8956 if (echo hi >$first) 2>/dev/null; then
8957 if $test -f 123456789abcde; then
8958 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8961 echo 'You can have filenames longer than 14 characters.'>&4
8966 You can't have filenames longer than 14 chars.
8967 You can't even think about them!
8973 $rm -rf 123456789abcde*
8975 : determine where library module manual pages go
8976 set man3dir man3dir none
8980 $spackage has manual pages for many of the library modules.
8986 However, you don't have nroff, so they're probably useless to you.
8989 '') man3dir="none";;
8993 case "$d_flexfnam" in
8996 However, your system can't handle the long file names like File::Basename.3.
8999 '') man3dir="none";;
9003 echo "If you don't want the manual sources installed, answer 'none'."
9004 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9006 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9007 if $test -d "$privlib/man/man3"; then
9010 WARNING: Previous versions of perl installed man3 pages into
9011 $privlib/man/man3. This version will suggest a
9012 new default of $dflt.
9016 rp='Do you wish to preserve the old behavior?(y/n)'
9019 y*) dflt="$privlib/man/man3" ;;
9024 *) dflt="$man3dir" ;;
9031 rp="Where do the $package library man pages (source) go?"
9041 : What suffix to use on installed man pages
9047 rp="What suffix should be used for the $package library man pages?"
9049 '') case "$man3dir" in
9063 *) dflt="$man3ext";;
9070 : see if we have to deal with yellow pages, now NIS.
9071 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9077 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9085 rp='Are you getting the hosts file via yellow pages?'
9088 y*) hostcat='ypcat hosts';;
9089 *) hostcat='cat /etc/hosts';;
9095 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9098 '') test -f /etc/group && groupcat='cat /etc/group';;
9101 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9104 : now get the host name
9106 echo "Figuring out host name..." >&4
9107 case "$myhostname" in
9109 echo 'Maybe "hostname" will work...'
9110 if tans=`sh -c hostname 2>&1` ; then
9118 if $test "$cont"; then
9120 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9121 if tans=`cat /etc/systemid 2>&1` ; then
9123 phostname='cat /etc/systemid'
9124 echo "Whadyaknow. Xenix always was a bit strange..."
9127 elif $test -r /etc/systemid; then
9128 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9131 if $test "$cont"; then
9132 echo 'No, maybe "uuname -l" will work...'
9133 if tans=`sh -c 'uuname -l' 2>&1` ; then
9135 phostname='uuname -l'
9137 echo 'Strange. Maybe "uname -n" will work...'
9138 if tans=`sh -c 'uname -n' 2>&1` ; then
9140 phostname='uname -n'
9142 echo 'Oh well, maybe I can mine it out of whoami.h...'
9143 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9144 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9145 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9147 case "$myhostname" in
9148 '') echo "Does this machine have an identity crisis or something?"
9151 echo "Well, you said $myhostname before..."
9152 phostname='echo $myhostname';;
9158 case "$myhostname" in
9159 '') myhostname=noname ;;
9161 : you do not want to know about this
9166 if $test "$myhostname" ; then
9168 rp='Your host name appears to be "'$myhostname'".'" Right?"
9176 : bad guess or no guess
9177 while $test "X$myhostname" = X ; do
9179 rp="Please type the (one word) name of your host:"
9184 : translate upper to lower if necessary
9185 case "$myhostname" in
9187 echo "(Normalizing case in your host name)"
9188 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9192 case "$myhostname" in
9194 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9195 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9196 echo "(Trimming domain name from host name--host name is now $myhostname)"
9198 *) case "$mydomain" in
9201 test "X$hostcat" = "Xypcat hosts" &&
9202 ypmatch "$myhostname" hosts 2>/dev/null |\
9203 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9206 test "X$hostcat" != "X" &&
9207 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9208 /[ ]$myhostname[ . ]/p" > hosts
9211 if $test -f hosts; then
9212 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9213 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9214 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9215 hosts | $sort | $uniq | \
9216 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9217 case `$echo X$dflt` in
9218 X*\ *) echo "(Several hosts in the database matched hostname)"
9221 X.) echo "(You do not have fully-qualified names in the hosts database)"
9225 echo "(I cannot locate a hosts database anywhere)"
9230 tans=`./loc resolv.conf X /etc /usr/etc`
9231 if $test -f "$tans"; then
9232 echo "(Attempting domain name extraction from $tans)"
9233 dflt=.`$sed -n -e 's/ / /g' \
9234 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9237 .) dflt=.`$sed -n -e 's/ / /g' \
9238 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9246 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9247 dflt=.`sh -c domainname 2>/dev/null`
9250 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9254 case "$dflt$osname" in
9255 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9256 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9260 .) echo "(Lost all hope -- silly guess then)"
9266 *) dflt="$mydomain";;
9270 rp="What is your domain name?"
9280 : translate upper to lower if necessary
9283 echo "(Normalizing case in your domain name)"
9284 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9288 : a little sanity check here
9289 case "$phostname" in
9292 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9293 $myhostname$mydomain|$myhostname) ;;
9295 case "$phostname" in
9297 echo "(That doesn't agree with your whoami.h file, by the way.)"
9300 echo "(That doesn't agree with your $phostname command, by the way.)"
9308 : determine the e-mail address of the user who is running us
9311 I need to get your e-mail address in Internet format if possible, i.e.
9312 something like user@host.domain. Please answer accurately since I have
9313 no easy means to double check it. The default value provided below
9314 is most probably close to reality but may not be valid from outside
9315 your organization...
9319 while test "$cont"; do
9320 case "$MAILDOMAIN" in
9322 if $test -s /etc/mailname; then
9323 maildomain=`$cat /etc/mailname`
9325 maildomain="$myhostname$mydomain"
9328 *) maildomain="$MAILDOMAIN";;
9331 '') dflt="$cf_by@$maildomain";;
9332 *) dflt="$cf_email";;
9334 rp='What is your e-mail address?'
9340 rp='Address does not look like an Internet one. Use it anyway?'
9354 : Ask e-mail of administrator
9357 If you or somebody else will be maintaining perl at your site, please
9358 fill in the correct e-mail address here so that they may be contacted
9359 if necessary. Currently, the "perlbug" program included with perl
9360 will send mail to this address in addition to perlbug@perl.org. You may
9361 enter "none" for no administrator.
9364 case "$perladmin" in
9365 '') dflt="$cf_email";;
9366 *) dflt="$perladmin";;
9368 rp='Perl administrator e-mail address'
9372 : determine whether to use a version number suffix for installed binaries
9375 Do you want to use a version number suffix for installed binaries? This
9376 will install 'perl$version' instead of 'perl', and likewise for other
9377 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9378 to be installed side-by-side. Unless you are a developer, you probably
9379 do *not* want to do this.
9381 case "$versiononly" in
9382 "$define"|[Yy]*|true) dflt='y' ;;
9385 rp="Do you want to use a version number suffix for installed binaries?"
9388 [yY]*) val="$define";;
9394 case "$versiononly" in
9395 "$define") inc_version_list=''
9396 inc_version_list_init=0
9400 : figure out how to guarantee perl startup
9401 : XXX Note that this currently takes advantage of the bug that binexp ignores
9402 : the Configure -Dinstallprefix setting, which in turn means that under
9403 : relocatable @INC, initialinstalllocation is what binexp started as.
9404 case "$startperl" in
9406 case "$sharpbang" in
9410 I can use the #! construct to start perl on your system. This will
9411 make startup of perl scripts faster, but may cause problems if you
9412 want to share those scripts and perl is not in a standard place
9413 ($initialinstalllocation/perl) on all your platforms. The alternative
9414 is to force a shell by starting the script with a single ':' character.
9417 case "$versiononly" in
9418 "$define") dflt="$initialinstalllocation/perl$version";;
9419 *) dflt="$initialinstalllocation/perl";;
9421 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9424 none) startperl=": # use perl";;
9425 *) startperl="#!$ans"
9426 if $test 30 -lt `echo "$ans" | wc -c`; then
9429 WARNING: Some systems limit the #! command to 32 characters.
9430 If you experience difficulty running Perl scripts with #!, try
9431 installing Perl in a directory with a shorter pathname.
9437 *) startperl=": # use perl"
9442 echo "I'll use $startperl to start perl scripts."
9444 : figure best path for perl in scripts
9447 case "$versiononly" in
9448 "$define") perlpath="$initialinstalllocation/perl$version";;
9449 *) perlpath="$initialinstalllocation/perl";;
9451 case "$startperl" in
9456 I will use the "eval 'exec'" idiom to start Perl on your system.
9457 I can use the full path of your Perl binary for this purpose, but
9458 doing so may cause problems if you want to share those scripts and
9459 Perl is not always in a standard place ($initialinstalllocation/perl).
9462 dflt="$initialinstalllocation/perl"
9463 rp="What path shall I use in \"eval 'exec'\"?"
9470 case "$startperl" in
9472 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9475 : determine where public executable scripts go
9476 set scriptdir scriptdir
9478 case "$scriptdir" in
9481 : guess some guesses
9482 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9483 $test -d /usr/share/bin && dflt=/usr/share/bin
9484 $test -d /usr/local/script && dflt=/usr/local/script
9485 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9486 $test -d $prefixexp/script && dflt=$prefixexp/script
9490 *) dflt="$scriptdir"
9495 Some installations have a separate directory just for executable scripts so
9496 that they can mount it across multiple architectures but keep the scripts in
9497 one spot. You might, for example, have a subdirectory of /usr/share for this.
9498 Or you might just lump your scripts in with all your other executables.
9502 rp='Where do you keep publicly executable scripts?'
9504 if $test "X$ansexp" != "X$scriptdirexp"; then
9510 : A little fix up for an irregularly named variable.
9511 installscript="$installscriptdir"
9513 : determine where add-on public executables go
9515 '') dflt=$siteprefix/bin ;;
9519 rp='Pathname where the add-on public executables should be installed?'
9524 : determine where add-on html pages go
9525 : There is no standard location, so try to copy the previously-selected
9526 : directory structure for the core html pages.
9527 case "$sitehtml1dir" in
9528 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9529 *) dflt=$sitehtml1dir ;;
9532 ''|' ') dflt=none ;;
9535 rp='Pathname where the site-specific html pages should be installed?'
9537 prefixvar=sitehtml1dir
9540 : determine where add-on library html pages go
9541 : There is no standard location, so try to copy the previously-selected
9542 : directory structure for the core html pages.
9543 case "$sitehtml3dir" in
9544 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9545 *) dflt=$sitehtml3dir ;;
9548 ''|' ') dflt=none ;;
9551 rp='Pathname where the site-specific library html pages should be installed?'
9553 prefixvar=sitehtml3dir
9556 : determine where add-on manual pages go
9557 case "$siteman1dir" in
9558 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9559 *) dflt=$siteman1dir ;;
9562 ''|' ') dflt=none ;;
9565 rp='Pathname where the site-specific manual pages should be installed?'
9567 prefixvar=siteman1dir
9570 : determine where add-on library man pages go
9571 case "$siteman3dir" in
9572 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9573 *) dflt=$siteman3dir ;;
9576 ''|' ') dflt=none ;;
9579 rp='Pathname where the site-specific library manual pages should be installed?'
9581 prefixvar=siteman3dir
9584 : determine where add-on public executable scripts go
9585 case "$sitescript" in
9586 '') dflt=$siteprefix/script
9587 $test -d $dflt || dflt=$sitebin ;;
9588 *) dflt="$sitescript" ;;
9591 rp='Pathname where add-on public executable scripts should be installed?'
9593 prefixvar=sitescript
9596 : see if backtrace exists
9597 set backtrace d_backtrace
9600 : add flags if using c backtrace
9601 case "$usecbacktrace" in
9602 "") usecbacktrace=$undef ;;
9604 case "$d_backtrace" in
9606 case " $ccflags " in
9607 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9608 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9612 echo "This system does not support backtrace" >&4
9613 usecbacktrace=$undef
9619 : Check if faststdio is requested and available
9620 case "$usefaststdio" in
9621 $define|true|[yY]*|'')
9622 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9632 Perl can be built to use 'fast stdio', which means using the stdio
9633 library but also directly manipulating the stdio buffers to enable
9634 faster I/O. Using stdio is better for backward compatibility (especially
9635 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9636 interface has been preferred instead of stdio.
9638 If this doesn't make any sense to you, just accept the default '$dflt'.
9640 rp='Use the "fast stdio" if available?'
9643 y|Y) val="$define" ;;
9650 : define an is-a-typedef? function
9651 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9653 "") inclist="sys/types.h";;
9655 eval "varval=\$$var";
9659 for inc in $inclist; do
9660 echo "#include <$inc>" >>temp.c;
9662 echo "#ifdef $type" >> temp.c;
9663 echo "printf(\"We have $type\");" >> temp.c;
9664 echo "#endif" >> temp.c;
9665 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9666 if $contains $type temp.E >/dev/null 2>&1; then
9672 *) eval "$var=\$varval";;
9675 : define an is-a-typedef? function that prompts if the type is not available.
9676 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9678 "") inclist="sys/types.h";;
9680 eval "varval=\$$var";
9684 for inc in $inclist; do
9685 echo "#include <$inc>" >>temp.c;
9687 echo "#ifdef $type" >> temp.c;
9688 echo "printf(\"We have $type\");" >> temp.c;
9689 echo "#endif" >> temp.c;
9690 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9692 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9693 if $contains $type temp.E >/dev/null 2>&1; then
9694 echo "$type found." >&4;
9697 echo "$type NOT found." >&4;
9703 *) eval "$var=\$varval";;
9706 : see what type lseek is declared as in the kernel
9707 rp="What is the type used for lseek's offset on this system?"
9708 set off_t lseektype long stdio.h sys/types.h
9712 echo "Checking to see how big your file offsets are..." >&4
9714 #include <sys/types.h>
9718 printf("%d\n", (int)sizeof($lseektype));
9723 if eval $compile_ok; then
9724 lseeksize=`$run ./try`
9725 echo "Your file offsets are $lseeksize bytes long."
9729 echo "(I can't seem to compile the test program. Guessing...)"
9730 rp="What is the size of your file offsets (in bytes)?"
9736 : see what type file positions are declared as in the library
9737 rp="What is the type for file position used by fsetpos()?"
9738 set fpos_t fpostype long stdio.h sys/types.h
9741 : Check size for Fpos_t
9744 *_t) zzz="$fpostype" ;;
9747 echo "Checking the size of $zzz..." >&4
9749 #include <sys/types.h>
9756 printf("%d\n", (int)sizeof($fpostype));
9761 if eval $compile_ok; then
9765 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9768 echo "Your $zzz is $fpossize bytes long."
9774 echo "(I can't compile the test program. Guessing...)" >&4
9775 rp="What is the size of your file positions (in bytes)?"
9780 : Check for large file support
9781 # Backward compatibility (uselfs is deprecated).
9783 "$define"|true|[yY]*)
9786 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9788 uselargefiles="$define"
9792 case "$lseeksize:$fpossize" in
9795 You can have files larger than 2 gigabytes.
9798 *) case "$uselargefiles" in
9799 "$undef"|false|[nN]*) dflt='n' ;;
9804 Perl can be built to understand large files (files larger than 2 gigabytes)
9805 on some systems. To do so, Configure can be run with -Duselargefiles.
9807 If this doesn't make any sense to you, just accept the default '$dflt'.
9809 rp='Try to understand large files, if available?'
9812 y|Y) val="$define" ;;
9819 : Look for a hint-file generated 'call-back-unit'. If the
9820 : user has specified that a large files perl is to be built,
9821 : we may need to set or change some other defaults.
9822 if $test -f uselargefiles.cbu; then
9823 echo "Your platform has some specific hints regarding large file builds, using them..."
9824 . ./uselargefiles.cbu
9826 case "$uselargefiles" in
9828 if $test -f uselargefiles.cbu; then
9830 echo "Rechecking to see how big your file offsets are..." >&4
9832 #include <sys/types.h>
9836 printf("%d\n", (int)sizeof($lseektype));
9841 if eval $compile_ok; then
9842 lseeksize=`$run ./try`
9843 $echo "Your file offsets are now $lseeksize bytes long."
9847 echo "(I can't seem to compile the test program. Guessing...)"
9848 rp="What is the size of your file offsets (in bytes)?"
9853 *_t) zzz="$fpostype" ;;
9856 $echo $n "Rechecking the size of $zzz...$c" >&4
9858 #include <sys/types.h>
9865 printf("%d\n", (int)sizeof($fpostype));
9870 if eval $compile_ok; then
9875 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9878 echo " $fpossize bytes." >&4
9884 echo "(I can't compile the test program. Guessing...)" >&4
9885 rp="What is the size of your file positions (in bytes)?"
9894 : Check if we want perlio
9897 : Set the vendorbin variables
9898 case "$vendorprefix" in
9899 '') d_vendorbin="$undef"
9903 *) d_vendorbin="$define"
9904 : determine where vendor-supplied executables go.
9905 case "$vendorbin" in
9906 '') dflt=$vendorprefix/bin ;;
9907 *) dflt="$vendorbin" ;;
9910 rp='Pathname for the vendor-supplied executables directory?'
9913 vendorbinexp="$ansexp"
9919 : Set the vendorhtml1dir variables
9920 case "$vendorprefix" in
9921 '') vendorhtml1dir=''
9922 vendorhtml1direxp=''
9924 *) : determine where vendor-supplied html pages go.
9925 : There is no standard location, so try to copy the previously-selected
9926 : directory structure for the core html pages.
9927 : XXX Better default suggestions would be welcome.
9928 case "$vendorhtml1dir" in
9929 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9930 *) dflt=$vendorhtml1dir ;;
9933 ''|' ') dflt=none ;;
9936 rp='Pathname for the vendor-supplied html pages?'
9938 vendorhtml1dir="$ans"
9939 vendorhtml1direxp="$ansexp"
9942 : Use ' ' for none so value is preserved next time through Configure
9943 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9944 prefixvar=vendorhtml1dir
9947 : Set the vendorhtml3dir variables
9948 case "$vendorprefix" in
9949 '') vendorhtml3dir=''
9950 vendorhtml3direxp=''
9952 *) : determine where vendor-supplied module html pages go.
9953 : There is no standard location, so try to copy the previously-selected
9954 : directory structure for the core html pages.
9955 : XXX Better default suggestions would be welcome.
9956 case "$vendorhtml3dir" in
9957 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9958 *) dflt=$vendorhtml3dir ;;
9961 ''|' ') dflt=none ;;
9964 rp='Pathname for the vendor-supplied html pages?'
9966 vendorhtml3dir="$ans"
9967 vendorhtml3direxp="$ansexp"
9970 : Use ' ' for none so value is preserved next time through Configure
9971 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9972 prefixvar=vendorhtml3dir
9975 : Set the vendorman1dir variables
9976 case "$vendorprefix" in
9977 '') vendorman1dir=''
9980 *) : determine where vendor-supplied manual pages go.
9981 case "$vendorman1dir" in
9982 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9983 *) dflt=$vendorman1dir ;;
9986 ''|' ') dflt=none ;;
9989 rp='Pathname for the vendor-supplied manual section 1 pages?'
9991 vendorman1dir="$ans"
9992 vendorman1direxp="$ansexp"
9995 : Use ' ' for none so value is preserved next time through Configure
9996 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9997 prefixvar=vendorman1dir
10000 : Set the vendorman3dir variables
10001 case "$vendorprefix" in
10002 '') vendorman3dir=''
10003 vendorman3direxp=''
10005 *) : determine where vendor-supplied module manual pages go.
10006 case "$vendorman3dir" in
10007 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10008 *) dflt=$vendorman3dir ;;
10011 ''|' ') dflt=none ;;
10014 rp='Pathname for the vendor-supplied manual section 3 pages?'
10016 vendorman3dir="$ans"
10017 vendorman3direxp="$ansexp"
10020 : Use ' ' for none so value is preserved next time through Configure
10021 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10022 prefixvar=vendorman3dir
10025 : Set the vendorscript variables
10026 case "$vendorprefix" in
10027 '') d_vendorscript="$undef"
10031 *) d_vendorscript="$define"
10032 : determine where vendor-supplied scripts go.
10033 case "$vendorscript" in
10034 '') dflt=$vendorprefix/script
10035 $test -d $dflt || dflt=$vendorbin ;;
10036 *) dflt="$vendorscript" ;;
10040 The installation process will create a directory for
10041 vendor-supplied scripts.
10045 rp='Pathname for the vendor-supplied scripts directory?'
10047 vendorscript="$ans"
10048 vendorscriptexp="$ansexp"
10051 prefixvar=vendorscript
10054 : see if qgcvt exists
10058 : Check what kind of doubles your system has
10059 $echo "Checking the kind of doubles you have..." >&4
10061 #$i_stdlib I_STDLIB
10062 #define DOUBLESIZE $doublesize
10064 #include <stdlib.h>
10067 static const double d = -0.1;
10069 unsigned const char* b = (unsigned const char*)(&d);
10070 #if DOUBLESIZE == 4
10071 if (b[0] == 0xCD && b[3] == 0xBD) {
10072 /* IEEE 754 32-bit little-endian */
10076 if (b[0] == 0xBD && b[3] == 0xCD) {
10077 /* IEEE 754 32-bit big-endian */
10081 if (b[0] == 0xCC && b[3] == 0xCC) {
10082 /* VAX format F, 32-bit PDP-style mixed endian. */
10086 if (b[0] == 0xC0 && b[3] == 0x9A) {
10087 /* IBM single 32-bit */
10092 #if DOUBLESIZE == 8
10093 if (b[0] == 0x9A && b[7] == 0xBF) {
10094 /* IEEE 754 64-bit little-endian */
10098 if (b[0] == 0xBF && b[7] == 0x9A) {
10099 /* IEEE 754 64-bit big-endian */
10103 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10104 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10105 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10106 * 99 99 b9 bf 9a 99 99 99 */
10110 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10111 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10112 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10113 * 99 99 99 9a bf b9 99 99 */
10117 if (b[0] == 0xCC && b[7] == 0xCC) {
10118 /* VAX format D, 64-bit PDP-style mixed endian. */
10122 if (b[0] == 0xD9 && b[7] == 0x99) {
10123 /* VAX format G, 64-bit PDP-style mixed endian. */
10127 if (b[0] == 0xC0 && b[7] == 0x9A) {
10128 /* IBM double 64-bit */
10132 if (b[0] == 0xBF && b[7] == 0xCD) {
10133 /* CRAY single 64-bit */
10138 #if DOUBLESIZE == 16
10139 if (b[0] == 0x9A && b[15] == 0xBF) {
10140 /* IEEE 754 128-bit little-endian */
10144 if (b[0] == 0xBF && b[15] == 0x9A) {
10145 /* IEEE 754 128-bit big-endian */
10150 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10151 * Whether those environments can still build Perl is debatable. */
10152 printf("-1\n"); /* unknown */
10157 if eval $compile; then
10158 doublekind=`$run ./try`
10162 case "$doublekind" in
10163 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10164 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10165 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10166 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10167 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10168 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10169 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10170 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10171 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10172 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10173 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10174 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10175 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10176 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10177 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10179 d_double_style_ieee=$undef
10180 d_double_style_vax=$undef
10181 d_double_style_ibm=$undef
10182 d_double_style_cray=$undef
10183 case "$doublekind" in
10184 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10185 9|10|11) d_double_style_vax=$define ;;
10186 12|13) d_double_style_ibm=$define ;;
10187 14) d_double_style_cray=$define ;;
10189 case "$d_double_style_ieee" in
10191 d_double_has_inf=$define
10192 d_double_has_nan=$define
10193 d_double_has_negative_zero=$define
10194 d_double_has_subnormals=$define
10197 d_double_has_inf=$undef
10198 d_double_has_nan=$undef
10199 d_double_has_negative_zero=$undef
10200 d_double_has_subnormals=$undef
10205 : Check print/scan long double stuff
10208 if $test X"$d_longdbl" = X"$define"; then
10210 echo "Checking how to print long doubles..." >&4
10212 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10213 $cat >try.c <<'EOCP'
10214 #include <sys/types.h>
10217 double d = 123.456;
10218 printf("%.3f\n", d);
10222 if eval $compile; then
10226 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10227 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10228 echo "We will use %f."
10234 if $test X"$sPRIfldbl" = X; then
10235 $cat >try.c <<'EOCP'
10236 #include <sys/types.h>
10239 long double d = 123.456;
10240 printf("%.3Lf\n", d);
10244 if eval $compile; then
10248 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10249 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10250 echo "We will use %Lf."
10256 if $test X"$sPRIfldbl" = X; then
10257 $cat >try.c <<'EOCP'
10258 #include <sys/types.h>
10261 long double d = 123.456;
10262 printf("%.3llf\n", d);
10266 if eval $compile; then
10270 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10271 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10272 echo "We will use %llf."
10278 if $test X"$sPRIfldbl" = X; then
10279 $cat >try.c <<'EOCP'
10280 #include <sys/types.h>
10283 long double d = 123.456;
10284 printf("%.3lf\n", d);
10288 if eval $compile; then
10292 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10293 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10294 echo "We will use %lf."
10300 if $test X"$sPRIfldbl" = X; then
10301 echo "Cannot figure out how to print long doubles." >&4
10303 sSCNfldbl=$sPRIfldbl # expect consistency
10310 case "$sPRIfldbl" in
10311 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10312 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10313 d_SCNfldbl="$undef";
10315 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10316 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10317 d_SCNfldbl="$define";
10321 : Before committing on uselongdouble, see whether that looks sane.
10322 if $test "$uselongdouble" = "$define"; then
10325 echo "Checking if your long double math functions work right..." >&4
10330 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10333 case "$osname:$gccversion" in
10334 aix:) saveccflags="$ccflags"
10335 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10338 if eval $compile_ok; then
10342 3) echo "Your long double math functions are working correctly." >&4 ;;
10343 *) echo "Your long double math functions are broken, not using long doubles." >&4
10344 uselongdouble=$undef
10348 case "$osname:$gccversion" in
10349 aix:) ccflags="$saveccflags" ;; # restore
10353 : Check how to convert floats to strings.
10355 if test "X$d_Gconvert" = X; then
10358 echo "Checking for an efficient way to convert floats to strings."
10360 case "$uselongdouble" in
10361 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10363 case "$d_longdbl" in
10364 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10366 case "$d_PRIgldbl" in
10367 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10370 #ifdef TRY_gconvert
10371 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10372 char *myname = "gconvert";
10375 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10376 char *myname = "gcvt";
10379 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10380 char *myname = "qgcvt";
10381 #define DOUBLETYPE long double
10384 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10385 #ifdef HAS_PRIgldbl
10386 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10388 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10391 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10393 char *myname = "sprintf";
10397 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10398 #define DOUBLETYPE long double
10400 #define DOUBLETYPE double
10406 #$i_stdlib I_STDLIB
10408 #include <stdlib.h>
10410 #include <string.h>
10412 int checkit(char *expect, char *got)
10414 if (strcmp(expect, got)) {
10415 printf("%s oddity: Expected %s, got %s\n",
10416 myname, expect, got);
10426 /* This must be 1st test on (which?) platform */
10427 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10428 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10429 checkit("0.1", buf);
10431 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10432 checkit("0.01", buf);
10434 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10435 checkit("0.001", buf);
10437 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10438 checkit("0.0001", buf);
10440 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10441 if (strlen(buf) > 5)
10442 checkit("9e-005", buf); /* for Microsoft ?? */
10444 checkit("9e-05", buf);
10446 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10449 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10450 checkit("1.1", buf);
10452 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10453 checkit("1.01", buf);
10455 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10456 checkit("1.001", buf);
10458 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10459 checkit("1.0001", buf);
10461 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10462 checkit("1.00001", buf);
10464 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10465 checkit("1.000001", buf);
10467 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10470 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10471 checkit("-1", buf);
10473 /* Some Linux gcvt's give 1.e+5 here. */
10474 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10475 checkit("100000", buf);
10477 /* Some Linux gcvt's give -1.e+5 here. */
10478 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10479 checkit("-100000", buf);
10481 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10482 checkit("123.456", buf);
10484 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10485 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10486 /* 34 should be enough to scare even long double
10487 * places into using the e notation. */
10488 if (strlen(buf) > 5)
10489 checkit("1e+034", buf); /* for Microsoft */
10491 checkit("1e+34", buf);
10493 /* For Perl, if you add additional tests here, also add them to
10494 * t/base/num.t for benefit of platforms not using Configure or
10495 * overriding d_Gconvert */
10500 : first add preferred functions to our list
10502 for xxx_convert in $gconvert_preference; do
10503 case $xxx_convert in
10504 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10505 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10508 : then add any others
10509 for xxx_convert in gconvert gcvt sprintf; do
10510 case "$xxx_list" in
10512 *) xxx_list="$xxx_list $xxx_convert" ;;
10516 case "$d_longdbl$uselongdouble" in
10518 : again, add preferred functions to our list first
10520 for xxx_convert in $gconvert_ld_preference; do
10521 case $xxx_convert in
10522 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10523 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10526 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10527 for xxx_convert in qgcvt sprintf $xxx_list; do
10528 case "$xxx_ld_list" in
10529 $xxx_convert*|*" $xxx_convert"*) ;;
10530 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10533 : if sprintf cannot do long doubles, move it to the end
10534 if test "$d_PRIgldbl" != "$define"; then
10535 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10537 : if no qgcvt, remove it
10538 if test "$d_qgcvt" != "$define"; then
10539 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10542 xxx_list="$xxx_ld_list"
10546 for xxx_convert in $xxx_list; do
10547 echo "Trying $xxx_convert..."
10548 $rm -f try try$_o core
10549 set try -DTRY_$xxx_convert
10550 if eval $compile; then
10551 echo "$xxx_convert() found." >&4
10552 if $run ./try; then
10553 echo "I'll use $xxx_convert to convert floats into a string." >&4
10556 echo "...But $xxx_convert didn't work as I expected."
10560 echo "$xxx_convert NOT found." >&4
10564 if test X$xxx_convert = X; then
10565 echo "*** WHOA THERE!!! ***" >&4
10566 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10567 xxx_convert=sprintf
10570 case "$xxx_convert" in
10571 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10572 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10573 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10574 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10575 "$define$define$define")
10576 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10577 "$define$define$undef")
10578 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10579 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10587 : see if _fwalk exists
10591 : see if accept4 exists
10592 set accept4 d_accept4
10595 : Initialize h_fcntl
10598 : Initialize h_sysfile
10601 : access call always available on UNIX
10602 set access d_access
10605 : locate the flags for 'access()'
10606 case "$d_access" in
10609 $cat >access.c <<EOCP
10610 #include <sys/types.h>
10615 #include <sys/file.h>
10618 #include <unistd.h>
10620 #$i_stdlib I_STDLIB
10622 #include <stdlib.h>
10628 : check sys/file.h first, no particular reason here
10629 if $test `./findhdr sys/file.h` && \
10630 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10632 echo "<sys/file.h> defines the *_OK access constants." >&4
10633 elif $test `./findhdr fcntl.h` && \
10634 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10636 echo "<fcntl.h> defines the *_OK access constants." >&4
10637 elif $test `./findhdr unistd.h` && \
10638 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10639 echo "<unistd.h> defines the *_OK access constants." >&4
10641 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10647 : see if accessx exists
10648 set accessx d_accessx
10651 : see if acosh exists
10655 : see if aintl exists
10659 : see if alarm exists
10663 : see if 64bit time functions exists
10665 set ctime64 d_ctime64
10668 set localtime64 d_localtime64
10671 set gmtime64 d_gmtime64
10674 set mktime64 d_mktime64
10677 set difftime64 d_difftime64
10680 set asctime64 d_asctime64
10683 : see if POSIX threads are available
10684 set pthread.h i_pthread
10687 : define a function to check prototypes
10688 $cat > protochk <<EOSH
10691 optimize="$optimize"
10695 usethreads=$usethreads
10696 i_pthread=$i_pthread
10697 pthread_h_first=$pthread_h_first
10700 $cat >> protochk <<'EOSH'
10705 while test $# -ge 2; do
10707 $define) echo "#include <$2>" >> try.c ;;
10708 literal) echo "$2" >> try.c ;;
10710 # Extra magic for the benefit of systems that need pthread.h
10711 # to be included early to correctly detect threadsafe functions.
10712 # Such functions must guarantee themselves, though, that the usethreads
10713 # and i_pthread have been defined, before calling protochk.
10714 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10715 echo "#include <pthread.h>" >> try.c
10720 cat >> try.c <<'EOCP'
10721 #define _(args) args
10723 echo "$foo" >> try.c
10724 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10725 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10731 $eunicefix protochk
10733 : Define hasproto macro for Configure internal use
10734 hasproto='varname=$1; func=$2; shift; shift;
10735 while $test $# -ge 2; do
10737 $define) echo "#include <$2>";;
10741 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10742 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10743 echo "$func() prototype found.";
10746 echo "$func() prototype NOT found.";
10753 : see if sys/types.h has to be included
10754 set sys/types.h i_systypes
10757 : see if sys/select.h has to be included
10758 set sys/select.h i_sysselct
10761 : Define hasfield macro for Configure internal use
10762 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10763 while $test $# -ge 2; do
10765 $define) echo "#include <$2>";;
10769 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10771 if eval $compile; then
10780 : see if we should include sys/time.h
10783 if test "X$timeincl" = X; then
10784 echo "Testing to see if we should include <sys/time.h>." >&4
10785 $echo $n "I'm now running the test program...$c"
10787 #include <sys/types.h>
10790 #ifdef SYSTIMEKERNEL
10793 #include <sys/time.h>
10796 #include <sys/select.h>
10798 #$i_stdlib I_STDLIB
10800 #include <stdlib.h>
10806 struct timeval bar;
10809 struct timezone tzp;
10811 if (foo.tm_sec == foo.tm_sec)
10814 if (bar.tv_sec == bar.tv_sec)
10821 for s_timezone in '-DS_TIMEZONE' ''; do
10823 for s_timeval in '-DS_TIMEVAL' ''; do
10824 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10825 for i_systime in '-DI_SYSTIME' ''; do
10828 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10829 if eval $compile; then
10830 set X $i_systime $i_systimek $sysselect $s_timeval
10834 $echo $n "Succeeded with $flags$c"
10845 *SYSTIMEKERNEL*) i_systimek="$define"
10846 timeincl=`./findhdr sys/time.h`
10847 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10848 *) i_systimek="$undef";;
10851 *I_SYSTIME*) i_systime="$define"
10852 timeincl=`./findhdr sys/time.h`" $timeincl"
10853 echo "We'll include <sys/time.h>." >&4;;
10854 *) i_systime="$undef";;
10858 : see if struct tm knows about tm_zone
10859 case "$i_systime$i_time" in
10862 echo "Checking to see if your struct tm has tm_zone field..." >&4
10863 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10871 case "$d_tm_tm_zone" in
10872 "$define") echo "Yes, it does." ;;
10873 *) echo "No, it doesn't." ;;
10875 : see if struct tm knows about tm_gmtoff
10876 case "$i_systime$i_time" in
10879 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10880 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10888 case "$d_tm_tm_gmtoff" in
10889 "$define") echo "Yes, it does." ;;
10890 *) echo "No, it doesn't." ;;
10893 : see if asctime_r exists
10894 set asctime_r d_asctime_r
10896 case "$d_asctime_r" in
10898 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10899 case "$d_asctime_r_proto:$usethreads" in
10900 ":define") d_asctime_r_proto=define
10901 set d_asctime_r_proto asctime_r $hdrs
10905 case "$d_asctime_r_proto" in
10907 case "$asctime_r_proto" in
10908 ''|0) try='char* asctime_r(const struct tm*, char*);'
10909 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10911 case "$asctime_r_proto" in
10912 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10913 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10915 case "$asctime_r_proto" in
10916 ''|0) try='int asctime_r(const struct tm*, char*);'
10917 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10919 case "$asctime_r_proto" in
10920 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10921 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10923 case "$asctime_r_proto" in
10924 ''|0) d_asctime_r=undef
10926 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10927 * ) case "$asctime_r_proto" in
10928 REENTRANT_PROTO*) ;;
10929 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10931 echo "Prototype: $try" ;;
10934 *) case "$usethreads" in
10935 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10942 *) asctime_r_proto=0
10946 : see if asinh exists
10950 : see if atanh exists
10954 : see if atolf exists
10958 : see if atoll exists
10962 : Look for GCC-style attribute format
10963 case "$d_attribute_format" in
10966 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10967 $cat >attrib.c <<'EOCP'
10969 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10971 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10972 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10973 echo "Your C compiler doesn't support __attribute__((format))."
10976 echo "Your C compiler supports __attribute__((format))."
10980 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10984 *) val="$d_attribute_format" ;;
10986 set d_attribute_format
10990 : Look for GCC-style attribute format with null format allowed
10991 case "$d_printf_format_null" in
10992 '') case "$d_attribute_format" in
10995 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10996 $cat >attrib.c <<EOCP
10998 #$i_stdlib I_STDLIB
11000 #include <stdlib.h>
11002 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11003 int null_printf (char* pat,...) { return (int)pat; }
11004 int main () { exit(null_printf(NULL)); }
11006 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11007 : run the executable in case it produces a run-time warning
11008 if $run ./attrib >>attrib.out 2>&1; then
11009 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11010 echo "Your C compiler doesn't allow __printf__ format to be null."
11013 echo "Your C compiler allows __printf__ format to be null."
11017 echo "Your C compiler executable failed with __printf__ format null."
11021 echo "Your C compiler fails with __printf__ format null."
11028 *) val="$d_printf_format_null" ;;
11030 set d_printf_format_null
11034 : Look for GCC-style attribute malloc
11035 case "$d_attribute_malloc" in
11038 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11039 $cat >attrib.c <<'EOCP'
11041 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11043 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11044 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11045 echo "Your C compiler doesn't support __attribute__((malloc))."
11048 echo "Your C compiler supports __attribute__((malloc))."
11052 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11056 *) val="$d_attribute_malloc" ;;
11058 set d_attribute_malloc
11062 : Look for GCC-style attribute nonnull
11063 case "$d_attribute_nonnull" in
11066 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11067 $cat >attrib.c <<'EOCP'
11069 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11071 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11072 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11073 echo "Your C compiler doesn't support __attribute__((nonnull))."
11076 echo "Your C compiler supports __attribute__((nonnull))."
11080 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11084 *) val="$d_attribute_nonnull" ;;
11086 set d_attribute_nonnull
11090 : Look for GCC-style attribute noreturn
11091 case "$d_attribute_noreturn" in
11094 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11095 $cat >attrib.c <<'EOCP'
11097 void fall_over_dead( void ) __attribute__((noreturn));
11099 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11100 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11101 echo "Your C compiler doesn't support __attribute__((noreturn))."
11104 echo "Your C compiler supports __attribute__((noreturn))."
11108 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11112 *) val="$d_attribute_noreturn" ;;
11114 set d_attribute_noreturn
11118 : Look for GCC-style attribute pure
11119 case "$d_attribute_pure" in
11122 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11123 $cat >attrib.c <<'EOCP'
11125 int square( int n ) __attribute__((pure));
11127 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11128 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11129 echo "Your C compiler doesn't support __attribute__((pure))."
11132 echo "Your C compiler supports __attribute__((pure))."
11136 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11140 *) val="$d_attribute_pure" ;;
11142 set d_attribute_pure
11146 : Look for GCC-style attribute unused
11147 case "$d_attribute_unused" in
11150 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11151 $cat >attrib.c <<'EOCP'
11153 int do_something( int dummy __attribute__((unused)), int n );
11155 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11156 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11157 echo "Your C compiler doesn't support __attribute__((unused))."
11160 echo "Your C compiler supports __attribute__((unused))."
11164 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11168 *) val="$d_attribute_unused" ;;
11170 set d_attribute_unused
11174 : Look for GCC-style attribute deprecated
11175 case "$d_attribute_deprecated" in
11178 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11179 $cat >attrib.c <<'EOCP'
11181 int I_am_deprecated(void) __attribute__((deprecated));
11183 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11184 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11185 echo "Your C compiler doesn't support __attribute__((deprecated))."
11188 echo "Your C compiler supports __attribute__((deprecated))."
11192 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11196 *) val="$d_attribute_deprecated" ;;
11198 set d_attribute_deprecated
11202 : Look for GCC-style attribute warn_unused_result
11203 case "$d_attribute_warn_unused_result" in
11206 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11207 $cat >attrib.c <<'EOCP'
11209 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11211 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11212 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11213 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11216 echo "Your C compiler supports __attribute__((warn_unused_result))."
11220 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11224 *) val="$d_attribute_warn_unused_result" ;;
11226 set d_attribute_warn_unused_result
11230 : see if getpgrp exists
11231 set getpgrp d_getpgrp
11234 case "$d_getpgrp" in
11237 echo "Checking to see which flavor of getpgrp is in use..."
11239 #$i_unistd I_UNISTD
11240 #include <sys/types.h>
11242 # include <unistd.h>
11244 #$i_stdlib I_STDLIB
11246 #include <stdlib.h>
11250 if (getuid() == 0) {
11251 printf("(I see you are running Configure as super-user...)\n");
11254 #ifdef TRY_BSD_PGRP
11255 if (getpgrp(1) == 0)
11264 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11265 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11267 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11268 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11271 echo "I can't seem to compile and run the test program."
11273 xxx="a USG one, i.e. you use getpgrp()."
11275 # SVR4 systems can appear rather BSD-ish.
11276 case "$i_unistd" in
11278 xxx="a BSD one, i.e. you use getpgrp(pid)."
11282 xxx="probably a USG one, i.e. you use getpgrp()."
11287 echo "Assuming your getpgrp is $xxx" >&4
11296 : see if setpgrp exists
11297 set setpgrp d_setpgrp
11300 case "$d_setpgrp" in
11303 echo "Checking to see which flavor of setpgrp is in use..."
11305 #$i_unistd I_UNISTD
11306 #include <sys/types.h>
11308 # include <unistd.h>
11310 #$i_stdlib I_STDLIB
11312 #include <stdlib.h>
11316 if (getuid() == 0) {
11317 printf("(I see you are running Configure as super-user...)\n");
11320 #ifdef TRY_BSD_PGRP
11321 if (-1 == setpgrp(1, 1))
11324 if (setpgrp() != -1)
11330 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11331 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11333 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11334 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11337 echo "(I can't seem to compile and run the test program.)"
11339 xxx="a USG one, i.e. you use setpgrp()."
11341 # SVR4 systems can appear rather BSD-ish.
11342 case "$i_unistd" in
11344 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11348 xxx="probably a USG one, i.e. you use setpgrp()."
11353 echo "Assuming your setpgrp is $xxx" >&4
11362 : Look for GCC-style __builtin_add_overflow
11363 case "$d_builtin_add_overflow" in
11366 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11367 $cat >try.c <<'EOCP'
11369 const unsigned int uint_max = ~0u;
11370 int target_int = 0;
11371 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11374 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11377 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11384 if eval $compile && $run ./try; then
11385 echo "Your C compiler supports __builtin_add_overflow."
11388 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11392 *) val="$d_builtin_add_overflow" ;;
11395 set d_builtin_add_overflow
11399 : Look for GCC-style __builtin_sub_overflow
11400 case "$d_builtin_sub_overflow" in
11403 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11404 $cat >try.c <<'EOCP'
11406 const unsigned int uint_max = ~0u;
11407 int target_int = 0;
11408 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11411 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11414 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11421 if eval $compile && $run ./try; then
11422 echo "Your C compiler supports __builtin_sub_overflow."
11425 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11429 *) val="$d_builtin_sub_overflow" ;;
11432 set d_builtin_sub_overflow
11436 : Look for GCC-style __builtin_mul_overflow
11437 case "$d_builtin_mul_overflow" in
11440 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11441 $cat >try.c <<'EOCP'
11443 const unsigned int uint_max = ~0u;
11444 int target_int = 0;
11445 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11448 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11451 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11458 if eval $compile && $run ./try; then
11459 echo "Your C compiler supports __builtin_mul_overflow."
11462 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11466 *) val="$d_builtin_mul_overflow" ;;
11469 set d_builtin_mul_overflow
11473 : Look for GCC-style __builtin_choose_expr
11474 case "$d_builtin_choose_expr" in
11477 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11478 $cat >try.c <<'EOCP'
11479 #include <assert.h>
11480 #include <stdlib.h>
11483 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11486 assert( SYRINX(1) == 2112 );
11487 assert( SYRINX(1) != 5150 );
11488 assert( SYRINX(0) == 5150 );
11489 assert( SYRINX(0) != 2112 );
11490 puts( "All good!" );
11496 if eval $compile && $run ./try; then
11497 echo "Your C compiler supports __builtin_choose_expr."
11500 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11504 *) val="$d_builtin_choose_expr" ;;
11507 set d_builtin_choose_expr
11511 : Look for GCC-style __builtin_expect
11512 case "$d_builtin_expect" in
11515 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11516 $cat >try.c <<'EOCP'
11519 if ( __builtin_expect(n, 0) ) n = 1;
11520 /* Remember shell exit code truth is 0, C truth is non-zero */
11525 if eval $compile && $run ./try; then
11526 echo "Your C compiler supports __builtin_expect."
11529 echo "Your C compiler doesn't seem to understand __builtin_expect."
11533 *) val="$d_builtin_expect" ;;
11536 set d_builtin_expect
11540 : see if the Compiler supports C99 variadic macros
11541 echo "Checking for C99 variadic macros." >&4
11544 #include <stdarg.h>
11546 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11550 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11556 if eval $compile && $run ./try 2>&1 >/dev/null; then
11557 case "`$run ./try`" in
11559 echo "You have C99 variadic macros." >&4
11560 d_c99_variadic_macros="$define"
11563 echo "You don't have functional C99 variadic macros." >&4
11564 d_c99_variadic_macros="$undef"
11568 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11569 d_c99_variadic_macros="$undef"
11573 : see if signal is declared as pointer to function returning int or void
11575 xxx=`./findhdr signal.h`
11576 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11577 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11578 echo "You have int (*signal())() instead of void." >&4
11580 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11581 echo "You have void (*signal())()." >&4
11583 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11584 echo "You have int (*signal())() instead of void." >&4
11586 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11587 echo "You have void (*signal())()." >&4
11590 case "$d_voidsig" in
11592 echo "I can't determine whether signal handler returns void or int..." >&4
11594 rp="What type does your signal handler return?"
11597 v*) val="$define";;
11601 echo "As you already told me, signal handler returns void." >&4
11604 *) echo "As you already told me, signal handler returns int." >&4
11611 case "$d_voidsig" in
11612 "$define") signal_t="void";;
11613 *) signal_t="int";;
11617 : check for ability to cast large floats to 32-bit ints.
11619 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11620 if $test "$intsize" -ge 4; then
11627 #$i_stdlib I_STDLIB
11629 #include <stdlib.h>
11631 #include <sys/types.h>
11632 #include <signal.h>
11633 $signal_t blech(int s) { exit(3); }
11640 signal(SIGFPE, blech);
11642 /* Don't let compiler optimize the test away. Store the number
11643 in a writable string for gcc to pass to sscanf under HP-UX.
11645 sprintf(str, "2147483647");
11646 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11650 /* x86 processors will probably give 0x8000 0000, which is a
11651 sign change. We don't want that. We want to mimic SPARC
11652 behavior here, which is to preserve the sign and give
11655 if (i32 != ($xxx) f)
11661 if eval $compile_ok; then
11662 $run ./try 2>/dev/null
11665 echo "(I can't seem to compile the test program--assuming it can't)"
11670 echo "Yup, it can."
11673 echo "Nope, it can't."
11680 : check for ability to cast negative floats to unsigned
11682 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11685 #$i_stdlib I_STDLIB
11687 #include <stdlib.h>
11689 #include <sys/types.h>
11690 #include <signal.h>
11691 $signal_t blech(int s) { exit(7); }
11692 $signal_t blech_in_list(int s) { exit(4); }
11693 unsigned long dummy_long(unsigned long p) { return p; }
11694 unsigned int dummy_int(unsigned int p) { return p; }
11695 unsigned short dummy_short(unsigned short p) { return p; }
11699 unsigned long along;
11701 unsigned short ashort;
11705 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11706 a direct f = -123. assignment. gcc-2.8.0 reportedly
11707 optimized the whole file away
11709 /* Store the number in a writable string for gcc to pass to
11710 sscanf under HP-UX.
11712 sprintf(str, "-123");
11713 sscanf(str, "%lf", &f); /* f = -123.; */
11715 signal(SIGFPE, blech);
11716 along = (unsigned long)f;
11717 aint = (unsigned int)f;
11718 ashort = (unsigned short)f;
11719 if (along != (unsigned long)-123)
11721 if (aint != (unsigned int)-123)
11723 if (ashort != (unsigned short)-123)
11725 sprintf(str, "1073741824.");
11726 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11729 along = (unsigned long)f;
11730 if (along != 0x80000000)
11734 along = (unsigned long)f;
11735 if (along != 0x7fffffff)
11739 along = (unsigned long)f;
11740 if (along != 0x80000001)
11744 signal(SIGFPE, blech_in_list);
11745 sprintf(str, "123.");
11746 sscanf(str, "%lf", &f); /* f = 123.; */
11747 along = dummy_long((unsigned long)f);
11748 aint = dummy_int((unsigned int)f);
11749 ashort = dummy_short((unsigned short)f);
11750 if (along != (unsigned long)123)
11752 if (aint != (unsigned int)123)
11754 if (ashort != (unsigned short)123)
11761 if eval $compile_ok; then
11762 $run ./try 2>/dev/null
11765 echo "(I can't seem to compile the test program--assuming it can't)"
11768 case "$castflags" in
11770 echo "Yup, it can."
11773 echo "Nope, it can't."
11780 : see if cbrt exists
11784 : see if chown exists
11788 : see if chroot exists
11789 set chroot d_chroot
11792 : see if chsize exists
11793 set chsize d_chsize
11796 : see if class exists
11800 : see if clearenv exists
11801 set clearenv d_clearenv
11804 : Define hasstruct macro for Configure internal use
11805 hasstruct='varname=$1; struct=$2; shift; shift;
11806 while $test $# -ge 2; do
11808 $define) echo "#include <$2>";;
11812 echo "int main () { struct $struct foo; }" >> try.c;
11814 if eval $compile; then
11823 : see whether socket exists
11827 $echo $n "Hmm... $c" >&4
11828 if set socket val -f d_socket; eval $csym; $val; then
11829 echo "Looks like you have Berkeley networking support." >&4
11831 if set setsockopt val -f; eval $csym; $val; then
11834 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11835 d_oldsock="$define"
11838 if $contains socklib libc.list >/dev/null 2>&1; then
11839 echo "Looks like you have Berkeley networking support." >&4
11841 : we will have to assume that it supports the 4.2 BSD interface
11844 echo "You don't have Berkeley networking in libc$_a..." >&4
11845 if test "X$d_socket" = "X$define"; then
11846 echo "...but you seem to believe that you have sockets." >&4
11848 for net in net socket
11850 if test -f $sysroot/usr/lib/lib$net$_a; then
11851 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11852 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11853 if $contains socket libc.list >/dev/null 2>&1; then
11858 echo "...but the Wollongong group seems to have hacked it in." >&4
11859 sockethdr="-I$sysroot/usr/netinclude"
11862 echo "Found Berkeley sockets interface in lib$net." >&4
11863 if $contains setsockopt libc.list >/dev/null 2>&1; then
11866 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11867 d_oldsock="$define"
11873 if test "X$d_socket" != "X$define"; then
11874 echo "or anywhere else I see." >&4
11882 : see if socketpair exists
11883 set socketpair d_sockpair
11888 echo "Checking the availability sa_len in the sock struct ..." >&4
11890 #include <sys/types.h>
11891 #include <sys/socket.h>
11893 struct sockaddr sa;
11894 return (sa.sa_len);
11898 set try; if eval $compile; then
11901 set d_sockaddr_sa_len; eval $setvar
11905 echo "Checking the availability struct sockaddr_in6 ..." >&4
11907 #include <sys/types.h>
11908 #include <sys/socket.h>
11909 #include <netinet/in.h>
11911 struct sockaddr_in6 sin6;
11912 return (sin6.sin6_family);
11916 set try; if eval $compile; then
11919 set d_sockaddr_in6; eval $setvar
11923 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11925 #include <sys/types.h>
11926 #include <sys/socket.h>
11927 #include <netinet/in.h>
11929 struct sockaddr_in6 sin6;
11930 return (sin6.sin6_scope_id);
11934 set try; if eval $compile; then
11937 set d_sin6_scope_id; eval $setvar
11941 echo "Checking the availability struct ip_mreq ..." >&4
11943 #include <sys/types.h>
11944 #include <sys/socket.h>
11945 #include <netinet/in.h>
11947 struct ip_mreq mreq;
11948 return (mreq.imr_multiaddr.s_addr);
11952 set try; if eval $compile; then
11955 set d_ip_mreq; eval $setvar
11959 echo "Checking the availability struct ip_mreq_source ..." >&4
11961 #include <sys/types.h>
11962 #include <sys/socket.h>
11963 #include <netinet/in.h>
11965 struct ip_mreq_source mreq;
11966 return (mreq.imr_multiaddr.s_addr);
11970 set try; if eval $compile; then
11973 set d_ip_mreq_source; eval $setvar
11977 echo "Checking the availability struct ipv6_mreq ..." >&4
11979 #include <sys/types.h>
11980 #include <sys/socket.h>
11981 #include <netinet/in.h>
11983 struct ipv6_mreq mreq;
11984 return (mreq.ipv6mr_interface);
11988 set try; if eval $compile; then
11991 set d_ipv6_mreq; eval $setvar
11995 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11997 #include <sys/types.h>
11998 #include <sys/socket.h>
11999 #include <netinet/in.h>
12001 struct ipv6_mreq_source mreq;
12002 return (mreq.imr_multiaddr.s_addr);
12006 set try; if eval $compile; then
12009 set d_ipv6_mreq_source; eval $setvar
12013 echo "Checking the availability of certain socket constants..." >&4
12014 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12015 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12017 #include <sys/types.h>
12018 #include <sys/socket.h>
12024 set try; if eval $compile; then
12027 set d_${enum}; eval $setvar
12031 : see if this is a sys/uio.h system
12032 set sys/uio.h i_sysuio
12035 : Check for cmsghdr support
12037 echo "Checking to see if your system supports struct cmsghdr..." >&4
12038 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12040 case "$d_cmsghdr_s" in
12041 "$define") echo "Yes, it does." ;;
12042 *) echo "No, it doesn't." ;;
12046 : check for const keyword
12048 echo 'Checking to see if your C compiler knows about "const"...' >&4
12049 $cat >const.c <<'EOCP'
12050 typedef struct spug { int drokk; } spug;
12054 const spug y = { 0 };
12057 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12059 echo "Yup, it does."
12062 echo "Nope, it doesn't."
12067 : see if copysign exists
12068 set copysign d_copysign
12071 : see if copysignl exists
12072 set copysignl d_copysignl
12075 : see if crypt exists
12080 $define) cryptlib='' ;;
12081 *) if set crypt val -f d_crypt; eval $csym; $val; then
12082 echo 'crypt() found.' >&4
12086 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12087 if $test -z "$cryptlib"; then
12088 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12092 if $test -z "$cryptlib"; then
12093 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12097 if $test -z "$cryptlib"; then
12098 cryptlib=`./loc libcrypt$_a "" $libpth`
12102 if $test -z "$cryptlib"; then
12103 echo 'crypt() NOT found.' >&4
12114 : see if this is a crypt.h system
12115 set crypt.h i_crypt
12118 : see if crypt_r exists
12119 set crypt_r d_crypt_r
12121 case "$d_crypt_r" in
12123 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12124 case "$d_crypt_r_proto:$usethreads" in
12125 ":define") d_crypt_r_proto=define
12126 set d_crypt_r_proto crypt_r $hdrs
12130 case "$d_crypt_r_proto" in
12132 case "$crypt_r_proto" in
12133 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12134 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12136 case "$crypt_r_proto" in
12137 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12138 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12140 case "$crypt_r_proto" in
12141 ''|0) d_crypt_r=undef
12143 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12144 * ) case "$crypt_r_proto" in
12145 REENTRANT_PROTO*) ;;
12146 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12148 echo "Prototype: $try" ;;
12151 *) case "$usethreads" in
12152 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12163 : get csh whereabouts
12165 'csh') val="$undef" ;;
12166 *) val="$define" ;;
12170 : Respect a hint or command line value for full_csh.
12171 case "$full_csh" in
12172 '') full_csh=$csh ;;
12175 : see if ctermid exists
12176 set ctermid d_ctermid
12179 : see if ctermid_r exists
12180 set ctermid_r d_ctermid_r
12182 case "$d_ctermid_r" in
12184 hdrs="$i_systypes sys/types.h define stdio.h "
12185 case "$d_ctermid_r_proto:$usethreads" in
12186 ":define") d_ctermid_r_proto=define
12187 set d_ctermid_r_proto ctermid_r $hdrs
12191 case "$d_ctermid_r_proto" in
12193 case "$ctermid_r_proto" in
12194 ''|0) try='char* ctermid_r(char*);'
12195 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12197 case "$ctermid_r_proto" in
12198 ''|0) d_ctermid_r=undef
12200 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12201 * ) case "$ctermid_r_proto" in
12202 REENTRANT_PROTO*) ;;
12203 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12205 echo "Prototype: $try" ;;
12208 *) case "$usethreads" in
12209 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12216 *) ctermid_r_proto=0
12220 : see if ctime_r exists
12221 set ctime_r d_ctime_r
12223 case "$d_ctime_r" in
12225 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12226 case "$d_ctime_r_proto:$usethreads" in
12227 ":define") d_ctime_r_proto=define
12228 set d_ctime_r_proto ctime_r $hdrs
12232 case "$d_ctime_r_proto" in
12234 case "$ctime_r_proto" in
12235 ''|0) try='char* ctime_r(const time_t*, char*);'
12236 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12238 case "$ctime_r_proto" in
12239 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12240 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12242 case "$ctime_r_proto" in
12243 ''|0) try='int ctime_r(const time_t*, char*);'
12244 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12246 case "$ctime_r_proto" in
12247 ''|0) try='int ctime_r(const time_t*, char*, int);'
12248 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12250 case "$ctime_r_proto" in
12251 ''|0) d_ctime_r=undef
12253 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12254 * ) case "$ctime_r_proto" in
12255 REENTRANT_PROTO*) ;;
12256 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12258 echo "Prototype: $try" ;;
12261 *) case "$usethreads" in
12262 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12273 : see if cuserid exists
12274 set cuserid d_cuserid
12277 : see if dbm.h is available
12278 : see if dbmclose exists
12279 set dbmclose d_dbmclose
12282 case "$d_dbmclose" in
12292 *) set rpcsvc/dbm.h i_rpcsvcdbm
12297 *) echo "We won't be including <dbm.h>"
12307 : see if prototype for dbminit is available
12309 set d_dbminitproto dbminit $i_dbm dbm.h
12312 : see if difftime exists
12313 set difftime d_difftime
12316 : see if this is a dirent system
12318 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12320 echo "<dirent.h> found." >&4
12323 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12324 echo "<sys/dir.h> found." >&4
12327 xinc=`./findhdr sys/ndir.h`
12329 echo "<dirent.h> NOT found." >&4
12334 : Look for type of directory structure.
12336 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12338 case "$direntrytype" in
12340 case "$i_dirent" in
12341 $define) guess1='struct dirent' ;;
12342 *) guess1='struct direct' ;;
12345 *) guess1="$direntrytype"
12350 'struct dirent') guess2='struct direct' ;;
12351 *) guess2='struct dirent' ;;
12354 if $contains "$guess1" try.c >/dev/null 2>&1; then
12355 direntrytype="$guess1"
12356 echo "Your directory entries are $direntrytype." >&4
12357 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12358 direntrytype="$guess2"
12359 echo "Your directory entries seem to be $direntrytype." >&4
12361 echo "I don't recognize your system's directory entries." >&4
12362 rp="What type is used for directory entries on this system?"
12365 direntrytype="$ans"
12369 : see if the directory entry stores field length
12371 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12372 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12373 echo "Good, your directory entry keeps length information in d_namlen." >&4
12376 echo "Your directory entry does not know about the d_namlen field." >&4
12383 : Look for DIR.dd_fd
12384 case "$i_dirent" in
12386 echo "Checking to see if DIR has a dd_fd member variable" >&4
12388 #$i_stdlib I_STDLIB
12390 #include <stdlib.h>
12392 #include <dirent.h>
12402 if eval $compile; then
12403 echo "Yes, it does."
12406 echo "No, it does not."
12411 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12419 : see if this is an sysdir system
12420 set sys/dir.h i_sysdir
12423 : see if this is an sysndir system
12424 set sys/ndir.h i_sysndir
12429 $cat >dirfd.c <<EOM
12431 #$i_stdlib I_STDLIB
12433 #include <stdlib.h>
12435 #$i_dirent I_DIRENT /**/
12436 #$i_sysdir I_SYS_DIR /**/
12437 #$i_sysndir I_SYS_NDIR /**/
12438 #$i_systypes I_SYS_TYPES /**/
12439 #if defined(I_SYS_TYPES)
12440 #include <sys/types.h>
12442 #if defined(I_DIRENT)
12443 #include <dirent.h>
12446 #include <sys/ndir.h>
12449 #include <sys/dir.h>
12454 DIR *dirp = opendir(".");
12455 if (dirfd(dirp) >= 0)
12463 if eval $compile; then
12467 $define) echo "dirfd() found." >&4 ;;
12468 *) echo "dirfd() NOT found." >&4 ;;
12474 : see if dladdr exists
12475 set dladdr d_dladdr
12478 : see if dlerror exists
12481 set dlerror d_dlerror
12485 : see if dlfcn is available
12486 set dlfcn.h i_dlfcn
12489 : Check what extension to use for shared libs
12494 On a few systems, the dynamically loaded modules that perl generates and uses
12495 will need a different extension than shared libs. The default will probably
12501 *) dflt="$dlext" ;;
12503 rp='What is the extension of dynamically loaded modules'
12512 : Check if dlsym need a leading underscore
12518 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12519 $cat >dyna.c <<'EOM'
12526 #$i_stdlib I_STDLIB
12528 #include <stdlib.h>
12532 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12534 #include <sys/types.h>
12539 extern int fred() ;
12548 int mode = RTLD_LAZY ;
12550 handle = dlopen("./dyna.$dlext", mode) ;
12551 if (handle == NULL) {
12556 symbol = dlsym(handle, "fred") ;
12557 if (symbol == NULL) {
12558 /* try putting a leading underscore */
12559 symbol = dlsym(handle, "_fred") ;
12560 if (symbol == NULL) {
12573 : Call the object file tmp-dyna.o in case dlext=o.
12574 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12575 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12576 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12577 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12580 1) echo "Test program failed using dlopen." >&4
12581 echo "Perhaps you should not use dynamic loading." >&4;;
12582 2) echo "Test program failed using dlsym." >&4
12583 echo "Perhaps you should not use dynamic loading." >&4;;
12584 3) echo "dlsym needs a leading underscore" >&4
12586 4) echo "dlsym doesn't need a leading underscore." >&4;;
12589 echo "I can't compile and run the test program." >&4
12590 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12595 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12600 : see if drand48_r exists
12601 set drand48_r d_drand48_r
12603 case "$d_drand48_r" in
12605 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12606 case "$d_drand48_r_proto:$usethreads" in
12607 ":define") d_drand48_r_proto=define
12608 set d_drand48_r_proto drand48_r $hdrs
12612 case "$d_drand48_r_proto" in
12614 case "$drand48_r_proto" in
12615 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12616 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12618 case "$drand48_r_proto" in
12619 ''|0) d_drand48_r=undef
12621 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12622 * ) case "$drand48_r_proto" in
12623 REENTRANT_PROTO*) ;;
12624 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12626 echo "Prototype: $try" ;;
12629 *) case "$usethreads" in
12630 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12637 *) drand48_r_proto=0
12641 : see if prototype for drand48 is available
12643 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12646 : see if dup2 exists
12650 : see if dup3 exists
12654 : see if eaccess exists
12655 set eaccess d_eaccess
12658 : see if endgrent exists
12659 set endgrent d_endgrent
12662 : see if this is an grp system
12668 xxx=`./findhdr grp.h`
12669 $cppstdin $cppflags $cppminus < $xxx >$$.h
12671 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12683 set d_grpasswd; eval $setvar
12687 : see if endgrent_r exists
12688 set endgrent_r d_endgrent_r
12690 case "$d_endgrent_r" in
12692 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12693 case "$d_endgrent_r_proto:$usethreads" in
12694 ":define") d_endgrent_r_proto=define
12695 set d_endgrent_r_proto endgrent_r $hdrs
12699 case "$d_endgrent_r_proto" in
12701 case "$endgrent_r_proto" in
12702 ''|0) try='int endgrent_r(FILE**);'
12703 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12705 case "$endgrent_r_proto" in
12706 ''|0) try='void endgrent_r(FILE**);'
12707 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12709 case "$endgrent_r_proto" in
12710 ''|0) d_endgrent_r=undef
12712 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12713 * ) case "$endgrent_r_proto" in
12714 REENTRANT_PROTO*) ;;
12715 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12717 echo "Prototype: $try" ;;
12720 *) case "$usethreads" in
12721 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12728 *) endgrent_r_proto=0
12732 : see if endhostent exists
12733 set endhostent d_endhent
12736 : see if this is a netdb.h system
12737 set netdb.h i_netdb
12740 : see if endhostent_r exists
12741 set endhostent_r d_endhostent_r
12743 case "$d_endhostent_r" in
12745 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12746 case "$d_endhostent_r_proto:$usethreads" in
12747 ":define") d_endhostent_r_proto=define
12748 set d_endhostent_r_proto endhostent_r $hdrs
12752 case "$d_endhostent_r_proto" in
12754 case "$endhostent_r_proto" in
12755 ''|0) try='int endhostent_r(struct hostent_data*);'
12756 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12758 case "$endhostent_r_proto" in
12759 ''|0) try='void endhostent_r(struct hostent_data*);'
12760 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12762 case "$endhostent_r_proto" in
12763 ''|0) d_endhostent_r=undef
12764 endhostent_r_proto=0
12765 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12766 * ) case "$endhostent_r_proto" in
12767 REENTRANT_PROTO*) ;;
12768 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12770 echo "Prototype: $try" ;;
12773 *) case "$usethreads" in
12774 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12776 d_endhostent_r=undef
12777 endhostent_r_proto=0
12781 *) endhostent_r_proto=0
12785 : see if endnetent exists
12786 set endnetent d_endnent
12789 : see if endnetent_r exists
12790 set endnetent_r d_endnetent_r
12792 case "$d_endnetent_r" in
12794 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12795 case "$d_endnetent_r_proto:$usethreads" in
12796 ":define") d_endnetent_r_proto=define
12797 set d_endnetent_r_proto endnetent_r $hdrs
12801 case "$d_endnetent_r_proto" in
12803 case "$endnetent_r_proto" in
12804 ''|0) try='int endnetent_r(struct netent_data*);'
12805 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12807 case "$endnetent_r_proto" in
12808 ''|0) try='void endnetent_r(struct netent_data*);'
12809 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12811 case "$endnetent_r_proto" in
12812 ''|0) d_endnetent_r=undef
12813 endnetent_r_proto=0
12814 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12815 * ) case "$endnetent_r_proto" in
12816 REENTRANT_PROTO*) ;;
12817 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12819 echo "Prototype: $try" ;;
12822 *) case "$usethreads" in
12823 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12825 d_endnetent_r=undef
12826 endnetent_r_proto=0
12830 *) endnetent_r_proto=0
12834 : see if endprotoent exists
12835 set endprotoent d_endpent
12838 : see if endprotoent_r exists
12839 set endprotoent_r d_endprotoent_r
12841 case "$d_endprotoent_r" in
12843 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12844 case "$d_endprotoent_r_proto:$usethreads" in
12845 ":define") d_endprotoent_r_proto=define
12846 set d_endprotoent_r_proto endprotoent_r $hdrs
12850 case "$d_endprotoent_r_proto" in
12852 case "$endprotoent_r_proto" in
12853 ''|0) try='int endprotoent_r(struct protoent_data*);'
12854 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12856 case "$endprotoent_r_proto" in
12857 ''|0) try='void endprotoent_r(struct protoent_data*);'
12858 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12860 case "$endprotoent_r_proto" in
12861 ''|0) d_endprotoent_r=undef
12862 endprotoent_r_proto=0
12863 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12864 * ) case "$endprotoent_r_proto" in
12865 REENTRANT_PROTO*) ;;
12866 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12868 echo "Prototype: $try" ;;
12871 *) case "$usethreads" in
12872 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12874 d_endprotoent_r=undef
12875 endprotoent_r_proto=0
12879 *) endprotoent_r_proto=0
12883 : see if endpwent exists
12884 set endpwent d_endpwent
12887 : see if this is a pwd.h system
12893 xxx=`./findhdr pwd.h`
12894 $cppstdin $cppflags $cppminus < $xxx >$$.h
12896 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12904 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12912 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12920 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12928 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12936 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12944 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12952 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12964 set d_pwquota; eval $setvar
12965 set d_pwage; eval $setvar
12966 set d_pwchange; eval $setvar
12967 set d_pwclass; eval $setvar
12968 set d_pwexpire; eval $setvar
12969 set d_pwcomment; eval $setvar
12970 set d_pwgecos; eval $setvar
12971 set d_pwpasswd; eval $setvar
12975 : see if endpwent_r exists
12976 set endpwent_r d_endpwent_r
12978 case "$d_endpwent_r" in
12980 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12981 case "$d_endpwent_r_proto:$usethreads" in
12982 ":define") d_endpwent_r_proto=define
12983 set d_endpwent_r_proto endpwent_r $hdrs
12987 case "$d_endpwent_r_proto" in
12989 case "$endpwent_r_proto" in
12990 ''|0) try='int endpwent_r(FILE**);'
12991 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12993 case "$endpwent_r_proto" in
12994 ''|0) try='void endpwent_r(FILE**);'
12995 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12997 case "$endpwent_r_proto" in
12998 ''|0) d_endpwent_r=undef
13000 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13001 * ) case "$endpwent_r_proto" in
13002 REENTRANT_PROTO*) ;;
13003 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13005 echo "Prototype: $try" ;;
13008 *) case "$usethreads" in
13009 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13016 *) endpwent_r_proto=0
13020 : see if endservent exists
13021 set endservent d_endsent
13024 : see if endservent_r exists
13025 set endservent_r d_endservent_r
13027 case "$d_endservent_r" in
13029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13030 case "$d_endservent_r_proto:$usethreads" in
13031 ":define") d_endservent_r_proto=define
13032 set d_endservent_r_proto endservent_r $hdrs
13036 case "$d_endservent_r_proto" in
13038 case "$endservent_r_proto" in
13039 ''|0) try='int endservent_r(struct servent_data*);'
13040 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13042 case "$endservent_r_proto" in
13043 ''|0) try='void endservent_r(struct servent_data*);'
13044 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13046 case "$endservent_r_proto" in
13047 ''|0) d_endservent_r=undef
13048 endservent_r_proto=0
13049 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13050 * ) case "$endservent_r_proto" in
13051 REENTRANT_PROTO*) ;;
13052 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13054 echo "Prototype: $try" ;;
13057 *) case "$usethreads" in
13058 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13060 d_endservent_r=undef
13061 endservent_r_proto=0
13065 *) endservent_r_proto=0
13069 : Locate the flags for 'open()'
13072 #include <sys/types.h>
13077 #include <sys/file.h>
13079 #$i_stdlib I_STDLIB
13081 #include <stdlib.h>
13092 : check sys/file.h first to get FREAD on Sun
13093 if $test `./findhdr sys/file.h` && \
13094 set try -DI_SYS_FILE && eval $compile; then
13096 echo "<sys/file.h> defines the O_* constants..." >&4
13097 if $run ./try; then
13098 echo "and you have the 3 argument form of open()." >&4
13101 echo "but not the 3 argument form of open(). Oh, well." >&4
13104 elif $test `./findhdr fcntl.h` && \
13105 set try -DI_FCNTL && eval $compile; then
13107 echo "<fcntl.h> defines the O_* constants..." >&4
13108 if $run ./try; then
13109 echo "and you have the 3 argument form of open()." >&4
13112 echo "but not the 3 argument form of open(). Oh, well." >&4
13117 echo "I can't find the O_* constant definitions! You got problems." >&4
13123 : see if this is a sys/file.h system
13128 : do we need to include sys/file.h ?
13132 if $h_sysfile; then
13134 echo "We'll be including <sys/file.h>." >&4
13137 echo "We won't be including <sys/file.h>." >&4
13147 : see if fcntl.h is there
13152 : see if we can include fcntl.h
13158 echo "We'll be including <fcntl.h>." >&4
13161 if $h_sysfile; then
13162 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13164 echo "We won't be including <fcntl.h>." >&4
13176 : see if fork exists
13180 : see if pipe exists
13184 : check for non-blocking I/O stuff
13185 case "$h_sysfile" in
13186 true) echo "#include <sys/file.h>" > head.c;;
13189 true) echo "#include <fcntl.h>" > head.c;;
13190 *) echo "#include <sys/fcntl.h>" > head.c;;
13195 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13196 case "$o_nonblock" in
13198 $cat head.c > try.c
13199 $cat >>try.c <<EOCP
13201 #$i_stdlib I_STDLIB
13203 #include <stdlib.h>
13211 printf("O_NONBLOCK\n");
13215 printf("O_NDELAY\n");
13219 printf("FNDELAY\n");
13226 if eval $compile_ok; then
13227 o_nonblock=`$run ./try`
13228 case "$o_nonblock" in
13229 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13230 *) echo "Seems like we can use $o_nonblock.";;
13233 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13236 *) echo "Using $hint value $o_nonblock.";;
13241 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13244 case "$d_fork:$d_pipe:$d_alarm" in
13245 define:define:define)
13246 $cat head.c > try.c
13247 $cat >>try.c <<EOCP
13249 #include <sys/types.h>
13250 #include <signal.h>
13252 #$i_stdlib I_STDLIB
13254 #include <stdlib.h>
13260 #define MY_O_NONBLOCK $o_nonblock
13261 #ifndef errno /* XXX need better Configure test */
13264 #$i_unistd I_UNISTD
13266 #include <unistd.h>
13268 #include <string.h>
13269 $signal_t blech(int x) { exit(3); }
13271 $cat >> try.c <<'EOCP'
13280 ret = pipe(pd); /* Down: child -> parent */
13283 ret = pipe(pu); /* Up: parent -> child */
13287 close(pd[1]); /* Parent reads from pd[0] */
13288 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13290 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13295 signal(SIGALRM, blech);
13297 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13299 sprintf(string, "%d\n", ret);
13300 ret = write(2, string, strlen(string));
13301 if (ret != strlen(string))
13305 if (errno == EAGAIN) {
13306 printf("EAGAIN\n");
13311 if (errno == EWOULDBLOCK)
13312 printf("EWOULDBLOCK\n");
13315 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13318 sleep(2); /* Give it time to close our pipe */
13320 ret = read(pd[0], buf, 1); /* Should read EOF */
13322 sprintf(string, "%d\n", ret);
13323 ret = write(4, string, strlen(string));
13324 if (ret != strlen(string))
13329 close(pd[0]); /* We write to pd[1] */
13330 close(pu[1]); /* We read from pu[0] */
13331 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13334 close(pd[1]); /* Pipe pd is now fully closed! */
13335 exit(0); /* Bye bye, thank you for playing! */
13339 if eval $compile_ok; then
13340 echo "$startsh" >mtry
13341 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13343 $run ./mtry >/dev/null 2>&1
13345 0) eagain=`$cat try.out`;;
13346 1) echo "Could not perform non-blocking setting!";;
13347 2) echo "I did a successful read() for something that was not there!";;
13348 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13349 4) echo "Could not find F_SETFL!";;
13350 *) echo "Something terribly wrong happened during testing.";;
13352 rd_nodata=`$cat try.ret`
13353 echo "A read() system call with no data present returns $rd_nodata."
13354 case "$rd_nodata" in
13357 echo "(That's peculiar, fixing that to be -1.)"
13363 echo "Forcing errno EAGAIN on read() with no data available."
13367 echo "Your read() sets errno to $eagain when no data is available."
13370 status=`$cat try.err`
13372 0) echo "And it correctly returns 0 to signal EOF.";;
13373 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13374 *) echo "However, your read() returns '$status' on EOF??";;
13377 if test "$status" = "$rd_nodata"; then
13378 echo "WARNING: you can't distinguish between EOF and no data!"
13382 echo "I can't compile the test program--assuming errno EAGAIN will do."
13386 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13395 echo "Using $hint value $eagain."
13396 echo "Your read() returns $rd_nodata when no data is present."
13397 case "$d_eofnblk" in
13398 "$define") echo "And you can see EOF because read() returns 0.";;
13399 "$undef") echo "But you can't see EOF status from read() returned value.";;
13401 echo "(Assuming you can't see EOF status from read anyway.)"
13407 $rm_try head.c mtry
13409 : see if erf exists
13413 : see if erfc exists
13417 : see if exp2 exists
13421 : see if expm1 exists
13425 : see if _ptr and _cnt from stdio act std
13428 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13429 echo "(Looks like you have stdio.h from BSD.)"
13430 case "$stdio_ptr" in
13431 '') stdio_ptr='((fp)->_p)'
13434 *) ptr_lval=$d_stdio_ptr_lval;;
13436 case "$stdio_cnt" in
13437 '') stdio_cnt='((fp)->_r)'
13440 *) cnt_lval=$d_stdio_cnt_lval;;
13442 case "$stdio_base" in
13443 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13445 case "$stdio_bufsiz" in
13446 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13448 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13449 echo "(Looks like you have stdio.h from Linux.)"
13450 case "$stdio_ptr" in
13451 '') stdio_ptr='((fp)->_IO_read_ptr)'
13454 *) ptr_lval=$d_stdio_ptr_lval;;
13456 case "$stdio_cnt" in
13457 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13460 *) cnt_lval=$d_stdio_cnt_lval;;
13462 case "$stdio_base" in
13463 '') stdio_base='((fp)->_IO_read_base)';;
13465 case "$stdio_bufsiz" in
13466 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13469 case "$stdio_ptr" in
13470 '') stdio_ptr='((fp)->_ptr)'
13473 *) ptr_lval=$d_stdio_ptr_lval;;
13475 case "$stdio_cnt" in
13476 '') stdio_cnt='((fp)->_cnt)'
13479 *) cnt_lval=$d_stdio_cnt_lval;;
13481 case "$stdio_base" in
13482 '') stdio_base='((fp)->_base)';;
13484 case "$stdio_bufsiz" in
13485 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13489 : test whether _ptr and _cnt really work
13490 echo "Checking how std your stdio is..." >&4
13493 #$i_stdlib I_STDLIB
13495 #include <stdlib.h>
13497 #define FILE_ptr(fp) $stdio_ptr
13498 #define FILE_cnt(fp) $stdio_cnt
13500 FILE *fp = fopen("try.c", "r");
13503 18 <= FILE_cnt(fp) &&
13504 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13512 if eval $compile && $to try.c; then
13513 if $run ./try; then
13514 echo "Your stdio acts pretty std."
13517 echo "Your stdio isn't very std."
13520 echo "Your stdio doesn't appear very std."
13524 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13525 # direct buffer manipulation no longer works. The Configure tests
13526 # should be changed to correctly detect this, but until then,
13527 # the following check should at least let perl compile and run.
13528 # (This quick fix should be updated before 5.8.1.)
13529 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13530 # A. Dougherty, June 3, 2002.
13531 case "$d_gnulibc" in
13533 case "$gnulibc_version" in
13537 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13546 : Can _ptr be used as an lvalue?
13547 case "$d_stdstdio$ptr_lval" in
13548 $define$define) val=$define ;;
13551 set d_stdio_ptr_lval
13554 : Can _cnt be used as an lvalue?
13555 case "$d_stdstdio$cnt_lval" in
13556 $define$define) val=$define ;;
13559 set d_stdio_cnt_lval
13563 : test whether setting _ptr sets _cnt as a side effect
13564 d_stdio_ptr_lval_sets_cnt="$undef"
13565 d_stdio_ptr_lval_nochange_cnt="$undef"
13566 case "$d_stdio_ptr_lval$d_stdstdio" in
13568 echo "Checking to see what happens if we set the stdio ptr..." >&4
13571 /* Can we scream? */
13572 /* Eat dust sed :-) */
13573 /* In the buffer space, no one can hear you scream. */
13574 #$i_stdlib I_STDLIB
13576 #include <stdlib.h>
13578 #define FILE_ptr(fp) $stdio_ptr
13579 #define FILE_cnt(fp) $stdio_cnt
13580 #include <sys/types.h>
13582 FILE *fp = fopen("try.c", "r");
13587 puts("Fail even to read");
13590 c = getc(fp); /* Read away the first # */
13592 puts("Fail even to read");
13596 18 <= FILE_cnt(fp) &&
13597 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13599 puts("Fail even to read");
13602 ptr = (char*) FILE_ptr(fp);
13603 cnt = (size_t)FILE_cnt(fp);
13605 FILE_ptr(fp) += 42;
13607 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13608 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13611 if (FILE_cnt(fp) <= 20) {
13612 printf ("Fail (<20 chars to test)");
13615 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13616 puts("Fail compare");
13619 if (cnt == FILE_cnt(fp)) {
13620 puts("Pass_unchanged");
13623 if (FILE_cnt(fp) == (cnt - 42)) {
13624 puts("Pass_changed");
13627 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13633 if eval $compile && $to try.c; then
13634 case `$run ./try` in
13636 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13637 d_stdio_ptr_lval_sets_cnt="$define" ;;
13639 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13640 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13642 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13644 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13647 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13653 : see if _base is also standard
13655 case "$d_stdstdio" in
13659 #$i_stdlib I_STDLIB
13661 #include <stdlib.h>
13663 #define FILE_base(fp) $stdio_base
13664 #define FILE_bufsiz(fp) $stdio_bufsiz
13666 FILE *fp = fopen("try.c", "r");
13669 19 <= FILE_bufsiz(fp) &&
13670 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13677 if eval $compile && $to try.c; then
13678 if $run ./try; then
13679 echo "And its _base field acts std."
13682 echo "But its _base field isn't std."
13685 echo "However, it seems to be lacking the _base field."
13693 : see if fast_stdio exists
13695 case "$d_stdstdio:$d_stdio_ptr_lval" in
13697 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13699 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13710 : see if fchdir exists
13711 set fchdir d_fchdir
13714 : see if fchmod exists
13715 set fchmod d_fchmod
13718 : check for openat, unlinkat, renameat, linkat, fchmodat
13719 set openat d_openat
13722 set unlinkat d_unlinkat
13725 set renameat d_renameat
13728 set linkat d_linkat
13731 set fchmodat d_fchmodat
13734 : see if fchown exists
13735 set fchown d_fchown
13738 : see if this is an fcntl system
13742 : See if fcntl-based locking works.
13745 #$i_stdlib I_STDLIB
13747 #include <stdlib.h>
13749 #include <unistd.h>
13751 #include <signal.h>
13752 $signal_t blech(int x) { exit(3); }
13754 #if defined(F_SETLK) && defined(F_SETLKW)
13755 struct flock flock;
13757 fd = open("try.c", O_RDONLY);
13758 flock.l_type = F_RDLCK;
13759 flock.l_whence = SEEK_SET;
13760 flock.l_start = flock.l_len = 0;
13761 signal(SIGALRM, blech);
13763 retval = fcntl(fd, F_SETLK, &flock);
13765 (retval < 0 ? exit(2) : exit(0));
13771 echo "Checking if fcntl-based file locking works... "
13775 if eval $compile_ok; then
13776 if $run ./try; then
13777 echo "Yes, it seems to work."
13780 echo "Nope, it didn't work."
13785 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13786 *** This is (almost) impossible.
13787 *** If your NFS lock daemons are not feeling well, something like
13788 *** this may happen, please investigate. Cannot continue, aborting.
13796 echo "I'm unable to compile the test program, so I'll assume not."
13801 echo "Nope, since you don't even have fcntl()."
13804 set d_fcntl_can_lock
13808 : check for fd_set items
13811 Checking to see how well your C compiler handles fd_set and friends ...
13814 #$i_stdlib I_STDLIB
13816 #include <stdlib.h>
13818 #$i_systime I_SYS_TIME
13819 #$i_sysselct I_SYS_SELECT
13820 #$d_socket HAS_SOCKET
13821 #include <sys/types.h>
13823 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13826 #include <sys/time.h>
13828 #ifdef I_SYS_SELECT
13829 #include <sys/select.h>
13838 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13846 if eval $compile; then
13847 d_fds_bits="$define"
13849 echo "Well, your system knows about the normal fd_set typedef..." >&4
13850 if $run ./try; then
13851 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13852 d_fd_macros="$define"
13855 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13857 d_fd_macros="$undef"
13861 Hmm, your compiler has some difficulty with fd_set. Checking further...
13864 if eval $compile; then
13865 d_fds_bits="$undef"
13867 echo "Well, your system has some sort of fd_set available..." >&4
13868 if $run ./try; then
13869 echo "and you have the normal fd_set macros." >&4
13870 d_fd_macros="$define"
13873 but not the normal fd_set macros! Gross! More work for me...
13875 d_fd_macros="$undef"
13878 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13880 d_fds_bits="$undef"
13881 d_fd_macros="$undef"
13886 : see if fdclose exists
13887 set fdclose d_fdclose
13890 : see if fdim exists
13894 : see if fegetround exists
13895 set fegetround d_fegetround
13898 : see if fgetpos exists
13899 set fgetpos d_fgetpos
13902 : see if finite exists
13903 set finite d_finite
13906 : see if finitel exists
13907 set finitel d_finitel
13910 : see if flock exists
13914 : see if prototype for flock is available
13916 set d_flockproto flock $i_sysfile sys/file.h
13919 : see if fma exists
13923 : see if fmax exists
13927 : see if fmin exists
13931 : see if fp_class exists
13932 set fp_class d_fp_class
13935 : check for fpclassify
13936 echo "Checking to see if you have fpclassify..." >&4
13939 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13942 if eval $compile; then
13944 echo "You have fpclassify."
13947 echo "You do not have fpclassify."
13953 : see if fp_classify exists
13954 set fp_classify d_fp_classify
13957 : see if fp_classl exists
13958 set fp_classl d_fp_classl
13961 : see if pathconf exists
13962 set pathconf d_pathconf
13965 : see if fpathconf exists
13966 set fpathconf d_fpathconf
13969 : see if fpclass exists
13970 set fpclass d_fpclass
13973 : see if fpclassl exists
13974 set fpclassl d_fpclassl
13977 : see if fpgetround exists
13978 set fpgetround d_fpgetround
13981 : check for fpos64_t
13983 echo "Checking to see if you have fpos64_t..." >&4
13986 int main() { fpos64_t x = 7; }
13989 if eval $compile; then
13991 echo "You have fpos64_t."
13994 echo "You do not have fpos64_t."
13995 case "$fpossize" in
13996 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14003 : see if this is an xlocale.h system
14004 set xlocale.h i_xlocale
14007 : see if newlocale exists
14008 set newlocale d_newlocale
14011 : see if freelocale exists
14012 set freelocale d_freelocale
14015 : see if uselocale exists
14016 set uselocale d_uselocale
14019 : see if duplocale exists
14020 set duplocale d_duplocale
14023 : see if querylocale exists
14024 set querylocale d_querylocale
14027 : see if frexpl exists
14028 set frexpl d_frexpl
14031 : see if this is a sys/param system
14032 set sys/param.h i_sysparam
14035 : see if this is a sys/mount.h system
14036 set sys/mount.h i_sysmount
14039 : Check for fs_data_s
14041 echo "Checking to see if your system supports struct fs_data..." >&4
14042 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14044 case "$d_fs_data_s" in
14045 "$define") echo "Yes, it does." ;;
14046 *) echo "No, it doesn't." ;;
14049 : see if fseeko exists
14050 set fseeko d_fseeko
14052 case "$longsize" in
14053 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14056 : see if fsetpos exists
14057 set fsetpos d_fsetpos
14060 : see if fstatfs exists
14061 set fstatfs d_fstatfs
14064 : see if statvfs exists
14065 set statvfs d_statvfs
14068 : see if fstatvfs exists
14069 set fstatvfs d_fstatvfs
14073 : see if fsync exists
14077 : see if ftello exists
14078 set ftello d_ftello
14080 case "$longsize" in
14081 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14084 : check for a working futimes
14087 echo "Checking if you have a working futimes()" >&4
14090 #include <sys/time.h>
14097 fd = open ("try.c", O_RDWR);
14098 if (-1 == fd) exit (1);
14099 rv = futimes (fd, NULL);
14100 exit (rv == -1 ? errno : 0);
14104 if eval $compile; then
14108 0) echo "Yes, you have" >&4
14109 d_futimes="$define"
14111 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14115 echo "No, it does not (probably harmless)" >&4
14119 : look for gai_strerror
14121 $cat >try.c <<'EOCP'
14122 #include <sys/types.h>
14123 #include <sys/socket.h>
14127 return (gai_strerror (0) ? 0 : 1);
14132 if eval $compile; then
14135 0) echo "A working gai_strerror() found." >&4
14137 *) echo "gai_strerror() found, but it doesn't work" >&4
14141 echo "gai_strerror() NOT found." >&4
14147 : see if ndbm.h is available
14150 : Compatibility location for RedHat 7.1
14151 set gdbm/ndbm.h i_gdbmndbm
14153 : Compatibility location for Debian 4.0
14154 set gdbm-ndbm.h i_gdbm_ndbm
14158 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14159 : see if dbm_open exists
14160 set dbm_open d_dbm_open
14162 case "$d_dbm_open" in
14165 i_gdbmndbm="$undef"
14166 i_gdbm_ndbm="$undef"
14167 echo "We won't be including <ndbm.h>"
14177 ndbm_hdr_protochk='name=$1; hdr=$2;
14178 eval "ihdr=\$""i_$name";
14180 if $test "$ihdr" = "$define"; then
14181 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14182 case "$d_cplusplus" in
14183 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14184 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14187 $define) $echo "Your <$hdr> seems to have prototypes";;
14188 *) $echo "Your <$hdr> does not seem to have prototypes";;
14191 set "d_${name}_h_uses_prototypes";
14195 eval $ndbm_hdr_protochk
14196 set gdbmndbm gdbm/ndbm.h
14197 eval $ndbm_hdr_protochk
14198 set gdbm_ndbm gdbm-ndbm.h
14199 eval $ndbm_hdr_protochk
14201 : see if getaddrinfo exists
14202 set getaddrinfo d_getaddrinfo
14205 : see if getcwd exists
14206 set getcwd d_getcwd
14209 : see if getespwnam exists
14210 set getespwnam d_getespwnam
14213 : see if getfsstat exists
14214 set getfsstat d_getfsstat
14217 : see if getgrent exists
14218 set getgrent d_getgrent
14221 : see if getgrent_r exists
14222 set getgrent_r d_getgrent_r
14224 case "$d_getgrent_r" in
14226 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14227 case "$d_getgrent_r_proto:$usethreads" in
14228 ":define") d_getgrent_r_proto=define
14229 set d_getgrent_r_proto getgrent_r $hdrs
14233 case "$d_getgrent_r_proto" in
14235 case "$getgrent_r_proto" in
14236 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14237 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14239 case "$getgrent_r_proto" in
14240 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14241 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14243 case "$getgrent_r_proto" in
14244 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14245 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14247 case "$getgrent_r_proto" in
14248 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14249 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14251 case "$getgrent_r_proto" in
14252 ''|0) try='int getgrent_r(struct group*, char*, int);'
14253 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14255 case "$getgrent_r_proto" in
14256 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14257 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14259 case "$getgrent_r_proto" in
14260 ''|0) d_getgrent_r=undef
14262 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14263 * ) case "$getgrent_r_proto" in
14264 REENTRANT_PROTO*) ;;
14265 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14267 echo "Prototype: $try" ;;
14270 *) case "$usethreads" in
14271 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14278 *) getgrent_r_proto=0
14282 : see if getgrgid_r exists
14283 set getgrgid_r d_getgrgid_r
14285 case "$d_getgrgid_r" in
14287 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14288 case "$d_getgrgid_r_proto:$usethreads" in
14289 ":define") d_getgrgid_r_proto=define
14290 set d_getgrgid_r_proto getgrgid_r $hdrs
14294 case "$d_getgrgid_r_proto" in
14296 case "$getgrgid_r_proto" in
14297 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14298 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14300 case "$getgrgid_r_proto" in
14301 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14302 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14304 case "$getgrgid_r_proto" in
14305 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14306 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14308 case "$getgrgid_r_proto" in
14309 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14310 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14312 case "$getgrgid_r_proto" in
14313 ''|0) d_getgrgid_r=undef
14315 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14316 * ) case "$getgrgid_r_proto" in
14317 REENTRANT_PROTO*) ;;
14318 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14320 echo "Prototype: $try" ;;
14323 *) case "$usethreads" in
14324 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14331 *) getgrgid_r_proto=0
14335 : see if getgrnam_r exists
14336 set getgrnam_r d_getgrnam_r
14338 case "$d_getgrnam_r" in
14340 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14341 case "$d_getgrnam_r_proto:$usethreads" in
14342 ":define") d_getgrnam_r_proto=define
14343 set d_getgrnam_r_proto getgrnam_r $hdrs
14347 case "$d_getgrnam_r_proto" in
14349 case "$getgrnam_r_proto" in
14350 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14351 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14353 case "$getgrnam_r_proto" in
14354 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14355 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14357 case "$getgrnam_r_proto" in
14358 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14359 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14361 case "$getgrnam_r_proto" in
14362 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14363 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14365 case "$getgrnam_r_proto" in
14366 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14367 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14369 case "$getgrnam_r_proto" in
14370 ''|0) d_getgrnam_r=undef
14372 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14373 * ) case "$getgrnam_r_proto" in
14374 REENTRANT_PROTO*) ;;
14375 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14377 echo "Prototype: $try" ;;
14380 *) case "$usethreads" in
14381 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14388 *) getgrnam_r_proto=0
14392 : see if gethostbyaddr exists
14393 set gethostbyaddr d_gethbyaddr
14396 : see if gethostbyname exists
14397 set gethostbyname d_gethbyname
14400 : see if gethostent exists
14401 set gethostent d_gethent
14404 : see how we will look up host name
14407 if set gethostname val -f d_gethname; eval $csym; $val; then
14408 echo 'gethostname() found.' >&4
14409 d_gethname="$define"
14412 if set uname val -f d_uname; eval $csym; $val; then
14415 uname() was found, but you're running xenix, and older versions of xenix
14416 have a broken uname(). If you don't really know whether your xenix is old
14417 enough to have a broken system call, use the default answer.
14422 "$define") dflt=n;;
14424 rp='Is your uname() broken?'
14427 n*) d_uname="$define"; call=uname;;
14430 echo 'uname() found.' >&4
14437 case "$d_gethname" in
14438 '') d_gethname="$undef";;
14441 '') d_uname="$undef";;
14443 case "$d_uname$d_gethname" in
14448 Every now and then someone has a $call() that lies about the hostname
14449 but can't be fixed for political or economic reasons. If you wish, I can
14450 pretend $call() isn't there and maybe compute hostname at run-time
14451 thanks to the '$phostname' command.
14454 rp="Shall I ignore $call() from now on?"
14457 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14460 case "$phostname" in
14461 '') aphostname='';;
14462 *) case "$aphostname" in
14464 *) set X $phostname
14468 file=`./loc $file $file $pth`
14469 aphostname=`echo $file $*`
14474 case "$d_uname$d_gethname" in
14477 case "$phostname" in
14479 echo "There will be no way for $package to get your hostname." >&4;;
14481 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14485 case "$d_phostname" in
14486 '') d_phostname="$undef";;
14489 : see if gethostbyaddr_r exists
14490 set gethostbyaddr_r d_gethostbyaddr_r
14492 case "$d_gethostbyaddr_r" in
14494 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14495 case "$d_gethostbyaddr_r_proto:$usethreads" in
14496 ":define") d_gethostbyaddr_r_proto=define
14497 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14501 case "$d_gethostbyaddr_r_proto" in
14503 case "$gethostbyaddr_r_proto" in
14504 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14505 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14507 case "$gethostbyaddr_r_proto" in
14508 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14509 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14511 case "$gethostbyaddr_r_proto" in
14512 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14513 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14515 case "$gethostbyaddr_r_proto" in
14516 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14517 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14519 case "$gethostbyaddr_r_proto" in
14520 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14521 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14523 case "$gethostbyaddr_r_proto" in
14524 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14525 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14527 case "$gethostbyaddr_r_proto" in
14528 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14529 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14531 case "$gethostbyaddr_r_proto" in
14532 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14533 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14535 case "$gethostbyaddr_r_proto" in
14536 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14537 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14539 case "$gethostbyaddr_r_proto" in
14540 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14541 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14543 case "$gethostbyaddr_r_proto" in
14544 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14545 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14547 case "$gethostbyaddr_r_proto" in
14548 ''|0) d_gethostbyaddr_r=undef
14549 gethostbyaddr_r_proto=0
14550 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14551 * ) case "$gethostbyaddr_r_proto" in
14552 REENTRANT_PROTO*) ;;
14553 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14555 echo "Prototype: $try" ;;
14558 *) case "$usethreads" in
14559 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14561 d_gethostbyaddr_r=undef
14562 gethostbyaddr_r_proto=0
14566 *) gethostbyaddr_r_proto=0
14570 : see if gethostbyname_r exists
14571 set gethostbyname_r d_gethostbyname_r
14573 case "$d_gethostbyname_r" in
14575 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14576 case "$d_gethostbyname_r_proto:$usethreads" in
14577 ":define") d_gethostbyname_r_proto=define
14578 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14582 case "$d_gethostbyname_r_proto" in
14584 case "$gethostbyname_r_proto" in
14585 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14586 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14588 case "$gethostbyname_r_proto" in
14589 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14590 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14592 case "$gethostbyname_r_proto" in
14593 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14594 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14596 case "$gethostbyname_r_proto" in
14597 ''|0) d_gethostbyname_r=undef
14598 gethostbyname_r_proto=0
14599 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14600 * ) case "$gethostbyname_r_proto" in
14601 REENTRANT_PROTO*) ;;
14602 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14604 echo "Prototype: $try" ;;
14607 *) case "$usethreads" in
14608 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14610 d_gethostbyname_r=undef
14611 gethostbyname_r_proto=0
14615 *) gethostbyname_r_proto=0
14619 : see if gethostent_r exists
14620 set gethostent_r d_gethostent_r
14622 case "$d_gethostent_r" in
14624 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14625 case "$d_gethostent_r_proto:$usethreads" in
14626 ":define") d_gethostent_r_proto=define
14627 set d_gethostent_r_proto gethostent_r $hdrs
14631 case "$d_gethostent_r_proto" in
14633 case "$gethostent_r_proto" in
14634 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14635 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14637 case "$gethostent_r_proto" in
14638 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14639 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14641 case "$gethostent_r_proto" in
14642 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14643 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14645 case "$gethostent_r_proto" in
14646 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14647 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14649 case "$gethostent_r_proto" in
14650 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14651 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14653 case "$gethostent_r_proto" in
14654 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14655 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14657 case "$gethostent_r_proto" in
14658 ''|0) d_gethostent_r=undef
14659 gethostent_r_proto=0
14660 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14661 * ) case "$gethostent_r_proto" in
14662 REENTRANT_PROTO*) ;;
14663 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14665 echo "Prototype: $try" ;;
14668 *) case "$usethreads" in
14669 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14671 d_gethostent_r=undef
14672 gethostent_r_proto=0
14676 *) gethostent_r_proto=0
14680 : see if prototypes for various gethostxxx netdb.h functions are available
14682 set d_gethostprotos gethostent $i_netdb netdb.h
14685 : see if getitimer exists
14686 set getitimer d_getitimer
14689 : see if getlogin exists
14690 set getlogin d_getlogin
14693 : see if getlogin_r exists
14694 set getlogin_r d_getlogin_r
14696 case "$d_getlogin_r" in
14698 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14699 case "$d_getlogin_r_proto:$usethreads" in
14700 ":define") d_getlogin_r_proto=define
14701 set d_getlogin_r_proto getlogin_r $hdrs
14705 case "$d_getlogin_r_proto" in
14707 case "$getlogin_r_proto" in
14708 ''|0) try='int getlogin_r(char*, size_t);'
14709 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14711 case "$getlogin_r_proto" in
14712 ''|0) try='int getlogin_r(char*, int);'
14713 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14715 case "$getlogin_r_proto" in
14716 ''|0) try='char* getlogin_r(char*, size_t);'
14717 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14719 case "$getlogin_r_proto" in
14720 ''|0) try='char* getlogin_r(char*, int);'
14721 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14723 case "$getlogin_r_proto" in
14724 ''|0) d_getlogin_r=undef
14726 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14727 * ) case "$getlogin_r_proto" in
14728 REENTRANT_PROTO*) ;;
14729 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14731 echo "Prototype: $try" ;;
14734 *) case "$usethreads" in
14735 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14742 *) getlogin_r_proto=0
14746 : see if getmnt exists
14747 set getmnt d_getmnt
14750 : see if getmntent exists
14751 set getmntent d_getmntent
14754 : see if getnameinfo exists
14755 set getnameinfo d_getnameinfo
14758 : see if getnetbyaddr exists
14759 set getnetbyaddr d_getnbyaddr
14762 : see if getnetbyname exists
14763 set getnetbyname d_getnbyname
14766 : see if getnetent exists
14767 set getnetent d_getnent
14770 : see if getnetbyaddr_r exists
14771 set getnetbyaddr_r d_getnetbyaddr_r
14773 case "$d_getnetbyaddr_r" in
14775 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14776 case "$d_getnetbyaddr_r_proto:$usethreads" in
14777 ":define") d_getnetbyaddr_r_proto=define
14778 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14782 case "$d_getnetbyaddr_r_proto" in
14784 case "$getnetbyaddr_r_proto" in
14785 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14786 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14788 case "$getnetbyaddr_r_proto" in
14789 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14790 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14792 case "$getnetbyaddr_r_proto" in
14793 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14794 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14796 case "$getnetbyaddr_r_proto" in
14797 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14798 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14800 case "$getnetbyaddr_r_proto" in
14801 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14802 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14804 case "$getnetbyaddr_r_proto" in
14805 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14806 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14808 case "$getnetbyaddr_r_proto" in
14809 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14810 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14812 case "$getnetbyaddr_r_proto" in
14813 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14814 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14816 case "$getnetbyaddr_r_proto" in
14817 ''|0) d_getnetbyaddr_r=undef
14818 getnetbyaddr_r_proto=0
14819 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14820 * ) case "$getnetbyaddr_r_proto" in
14821 REENTRANT_PROTO*) ;;
14822 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14824 echo "Prototype: $try" ;;
14827 *) case "$usethreads" in
14828 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14830 d_getnetbyaddr_r=undef
14831 getnetbyaddr_r_proto=0
14835 *) getnetbyaddr_r_proto=0
14839 : see if getnetbyname_r exists
14840 set getnetbyname_r d_getnetbyname_r
14842 case "$d_getnetbyname_r" in
14844 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14845 case "$d_getnetbyname_r_proto:$usethreads" in
14846 ":define") d_getnetbyname_r_proto=define
14847 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14851 case "$d_getnetbyname_r_proto" in
14853 case "$getnetbyname_r_proto" in
14854 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14855 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14857 case "$getnetbyname_r_proto" in
14858 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14859 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14861 case "$getnetbyname_r_proto" in
14862 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14863 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14865 case "$getnetbyname_r_proto" in
14866 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14867 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14869 case "$getnetbyname_r_proto" in
14870 ''|0) d_getnetbyname_r=undef
14871 getnetbyname_r_proto=0
14872 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14873 * ) case "$getnetbyname_r_proto" in
14874 REENTRANT_PROTO*) ;;
14875 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14877 echo "Prototype: $try" ;;
14880 *) case "$usethreads" in
14881 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14883 d_getnetbyname_r=undef
14884 getnetbyname_r_proto=0
14888 *) getnetbyname_r_proto=0
14892 : see if getnetent_r exists
14893 set getnetent_r d_getnetent_r
14895 case "$d_getnetent_r" in
14897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14898 case "$d_getnetent_r_proto:$usethreads" in
14899 ":define") d_getnetent_r_proto=define
14900 set d_getnetent_r_proto getnetent_r $hdrs
14904 case "$d_getnetent_r_proto" in
14906 case "$getnetent_r_proto" in
14907 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14908 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14910 case "$getnetent_r_proto" in
14911 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14912 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14914 case "$getnetent_r_proto" in
14915 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14916 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14918 case "$getnetent_r_proto" in
14919 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14920 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14922 case "$getnetent_r_proto" in
14923 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14924 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14926 case "$getnetent_r_proto" in
14927 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14928 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14930 case "$getnetent_r_proto" in
14931 ''|0) d_getnetent_r=undef
14932 getnetent_r_proto=0
14933 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14934 * ) case "$getnetent_r_proto" in
14935 REENTRANT_PROTO*) ;;
14936 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14938 echo "Prototype: $try" ;;
14941 *) case "$usethreads" in
14942 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14944 d_getnetent_r=undef
14945 getnetent_r_proto=0
14949 *) getnetent_r_proto=0
14953 : see if prototypes for various getnetxxx netdb.h functions are available
14955 set d_getnetprotos getnetent $i_netdb netdb.h
14958 : see if getpagesize exists
14959 set getpagesize d_getpagsz
14962 : Optional checks for getprotobyname and getprotobynumber
14964 : see if getprotobyname exists
14965 set getprotobyname d_getpbyname
14968 : see if getprotobynumber exists
14969 set getprotobynumber d_getpbynumber
14972 : see if getprotoent exists
14973 set getprotoent d_getpent
14976 : see if getpgid exists
14977 set getpgid d_getpgid
14980 : see if getpgrp2 exists
14981 set getpgrp2 d_getpgrp2
14984 : see if getppid exists
14985 set getppid d_getppid
14988 : see if getpriority exists
14989 set getpriority d_getprior
14992 : see if getprotobyname_r exists
14993 set getprotobyname_r d_getprotobyname_r
14995 case "$d_getprotobyname_r" in
14997 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14998 case "$d_getprotobyname_r_proto:$usethreads" in
14999 ":define") d_getprotobyname_r_proto=define
15000 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15004 case "$d_getprotobyname_r_proto" in
15006 case "$getprotobyname_r_proto" in
15007 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15008 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15010 case "$getprotobyname_r_proto" in
15011 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15012 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15014 case "$getprotobyname_r_proto" in
15015 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15016 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15018 case "$getprotobyname_r_proto" in
15019 ''|0) d_getprotobyname_r=undef
15020 getprotobyname_r_proto=0
15021 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15022 * ) case "$getprotobyname_r_proto" in
15023 REENTRANT_PROTO*) ;;
15024 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15026 echo "Prototype: $try" ;;
15029 *) case "$usethreads" in
15030 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15032 d_getprotobyname_r=undef
15033 getprotobyname_r_proto=0
15037 *) getprotobyname_r_proto=0
15041 : see if getprotobynumber_r exists
15042 set getprotobynumber_r d_getprotobynumber_r
15044 case "$d_getprotobynumber_r" in
15046 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15047 case "$d_getprotobynumber_r_proto:$usethreads" in
15048 ":define") d_getprotobynumber_r_proto=define
15049 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15053 case "$d_getprotobynumber_r_proto" in
15055 case "$getprotobynumber_r_proto" in
15056 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15057 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15059 case "$getprotobynumber_r_proto" in
15060 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15061 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15063 case "$getprotobynumber_r_proto" in
15064 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15065 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15067 case "$getprotobynumber_r_proto" in
15068 ''|0) d_getprotobynumber_r=undef
15069 getprotobynumber_r_proto=0
15070 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15071 * ) case "$getprotobynumber_r_proto" in
15072 REENTRANT_PROTO*) ;;
15073 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15075 echo "Prototype: $try" ;;
15078 *) case "$usethreads" in
15079 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15081 d_getprotobynumber_r=undef
15082 getprotobynumber_r_proto=0
15086 *) getprotobynumber_r_proto=0
15090 : see if getprotoent_r exists
15091 set getprotoent_r d_getprotoent_r
15093 case "$d_getprotoent_r" in
15095 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15096 case "$d_getprotoent_r_proto:$usethreads" in
15097 ":define") d_getprotoent_r_proto=define
15098 set d_getprotoent_r_proto getprotoent_r $hdrs
15102 case "$d_getprotoent_r_proto" in
15104 case "$getprotoent_r_proto" in
15105 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15106 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15108 case "$getprotoent_r_proto" in
15109 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15110 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15112 case "$getprotoent_r_proto" in
15113 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15114 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15116 case "$getprotoent_r_proto" in
15117 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15118 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15120 case "$getprotoent_r_proto" in
15121 ''|0) d_getprotoent_r=undef
15122 getprotoent_r_proto=0
15123 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15124 * ) case "$getprotoent_r_proto" in
15125 REENTRANT_PROTO*) ;;
15126 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15128 echo "Prototype: $try" ;;
15131 *) case "$usethreads" in
15132 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15134 d_getprotoent_r=undef
15135 getprotoent_r_proto=0
15139 *) getprotoent_r_proto=0
15143 : see if prototypes for various getprotoxxx netdb.h functions are available
15145 set d_getprotoprotos getprotoent $i_netdb netdb.h
15148 : see if getprpwnam exists
15149 set getprpwnam d_getprpwnam
15152 : see if getpwent exists
15153 set getpwent d_getpwent
15156 : see if getpwent_r exists
15157 set getpwent_r d_getpwent_r
15159 case "$d_getpwent_r" in
15161 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15162 case "$d_getpwent_r_proto:$usethreads" in
15163 ":define") d_getpwent_r_proto=define
15164 set d_getpwent_r_proto getpwent_r $hdrs
15168 case "$d_getpwent_r_proto" in
15170 case "$getpwent_r_proto" in
15171 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15172 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15174 case "$getpwent_r_proto" in
15175 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15176 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15178 case "$getpwent_r_proto" in
15179 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15180 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15182 case "$getpwent_r_proto" in
15183 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15184 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15186 case "$getpwent_r_proto" in
15187 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15188 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15190 case "$getpwent_r_proto" in
15191 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15192 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15194 case "$getpwent_r_proto" in
15195 ''|0) d_getpwent_r=undef
15197 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15198 * ) case "$getpwent_r_proto" in
15199 REENTRANT_PROTO*) ;;
15200 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15202 echo "Prototype: $try" ;;
15205 *) case "$usethreads" in
15206 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15213 *) getpwent_r_proto=0
15217 : see if getpwnam_r exists
15218 set getpwnam_r d_getpwnam_r
15220 case "$d_getpwnam_r" in
15222 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15223 case "$d_getpwnam_r_proto:$usethreads" in
15224 ":define") d_getpwnam_r_proto=define
15225 set d_getpwnam_r_proto getpwnam_r $hdrs
15229 case "$d_getpwnam_r_proto" in
15231 case "$getpwnam_r_proto" in
15232 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15233 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15235 case "$getpwnam_r_proto" in
15236 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15237 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15239 case "$getpwnam_r_proto" in
15240 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15241 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15243 case "$getpwnam_r_proto" in
15244 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15245 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15247 case "$getpwnam_r_proto" in
15248 ''|0) d_getpwnam_r=undef
15250 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15251 * ) case "$getpwnam_r_proto" in
15252 REENTRANT_PROTO*) ;;
15253 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15255 echo "Prototype: $try" ;;
15258 *) case "$usethreads" in
15259 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15266 *) getpwnam_r_proto=0
15270 : see if getpwuid_r exists
15271 set getpwuid_r d_getpwuid_r
15273 case "$d_getpwuid_r" in
15275 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15276 case "$d_getpwuid_r_proto:$usethreads" in
15277 ":define") d_getpwuid_r_proto=define
15278 set d_getpwuid_r_proto getpwuid_r $hdrs
15282 case "$d_getpwuid_r_proto" in
15284 case "$getpwuid_r_proto" in
15285 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15286 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15288 case "$getpwuid_r_proto" in
15289 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15290 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15292 case "$getpwuid_r_proto" in
15293 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15294 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15296 case "$getpwuid_r_proto" in
15297 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15298 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15300 case "$getpwuid_r_proto" in
15301 ''|0) d_getpwuid_r=undef
15303 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15304 * ) case "$getpwuid_r_proto" in
15305 REENTRANT_PROTO*) ;;
15306 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15308 echo "Prototype: $try" ;;
15311 *) case "$usethreads" in
15312 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15319 *) getpwuid_r_proto=0
15323 : Optional checks for getsbyname and getsbyport
15325 : see if getservbyname exists
15326 set getservbyname d_getsbyname
15329 : see if getservbyport exists
15330 set getservbyport d_getsbyport
15333 : see if getservent exists
15334 set getservent d_getsent
15337 : see if getservbyname_r exists
15338 set getservbyname_r d_getservbyname_r
15340 case "$d_getservbyname_r" in
15342 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15343 case "$d_getservbyname_r_proto:$usethreads" in
15344 ":define") d_getservbyname_r_proto=define
15345 set d_getservbyname_r_proto getservbyname_r $hdrs
15349 case "$d_getservbyname_r_proto" in
15351 case "$getservbyname_r_proto" in
15352 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15353 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15355 case "$getservbyname_r_proto" in
15356 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15357 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15359 case "$getservbyname_r_proto" in
15360 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15361 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15363 case "$getservbyname_r_proto" in
15364 ''|0) d_getservbyname_r=undef
15365 getservbyname_r_proto=0
15366 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15367 * ) case "$getservbyname_r_proto" in
15368 REENTRANT_PROTO*) ;;
15369 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15371 echo "Prototype: $try" ;;
15374 *) case "$usethreads" in
15375 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15377 d_getservbyname_r=undef
15378 getservbyname_r_proto=0
15382 *) getservbyname_r_proto=0
15386 : see if getservbyport_r exists
15387 set getservbyport_r d_getservbyport_r
15389 case "$d_getservbyport_r" in
15391 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15392 case "$d_getservbyport_r_proto:$usethreads" in
15393 ":define") d_getservbyport_r_proto=define
15394 set d_getservbyport_r_proto getservbyport_r $hdrs
15398 case "$d_getservbyport_r_proto" in
15400 case "$getservbyport_r_proto" in
15401 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15402 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15404 case "$getservbyport_r_proto" in
15405 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15406 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15408 case "$getservbyport_r_proto" in
15409 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15410 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15412 case "$getservbyport_r_proto" in
15413 ''|0) d_getservbyport_r=undef
15414 getservbyport_r_proto=0
15415 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15416 * ) case "$getservbyport_r_proto" in
15417 REENTRANT_PROTO*) ;;
15418 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15420 echo "Prototype: $try" ;;
15423 *) case "$usethreads" in
15424 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15426 d_getservbyport_r=undef
15427 getservbyport_r_proto=0
15431 *) getservbyport_r_proto=0
15435 : see if getservent_r exists
15436 set getservent_r d_getservent_r
15438 case "$d_getservent_r" in
15440 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15441 case "$d_getservent_r_proto:$usethreads" in
15442 ":define") d_getservent_r_proto=define
15443 set d_getservent_r_proto getservent_r $hdrs
15447 case "$d_getservent_r_proto" in
15449 case "$getservent_r_proto" in
15450 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15451 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15453 case "$getservent_r_proto" in
15454 ''|0) try='int getservent_r(struct servent*, char*, int);'
15455 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15457 case "$getservent_r_proto" in
15458 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15459 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15461 case "$getservent_r_proto" in
15462 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15463 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15465 case "$getservent_r_proto" in
15466 ''|0) d_getservent_r=undef
15467 getservent_r_proto=0
15468 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15469 * ) case "$getservent_r_proto" in
15470 REENTRANT_PROTO*) ;;
15471 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15473 echo "Prototype: $try" ;;
15476 *) case "$usethreads" in
15477 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15479 d_getservent_r=undef
15480 getservent_r_proto=0
15484 *) getservent_r_proto=0
15488 : see if prototypes for various getservxxx netdb.h functions are available
15490 set d_getservprotos getservent $i_netdb netdb.h
15493 : see if getspnam exists
15494 set getspnam d_getspnam
15497 : see if this is a shadow.h system
15498 set shadow.h i_shadow
15501 : see if getspnam_r exists
15502 set getspnam_r d_getspnam_r
15504 case "$d_getspnam_r" in
15506 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15507 case "$d_getspnam_r_proto:$usethreads" in
15508 ":define") d_getspnam_r_proto=define
15509 set d_getspnam_r_proto getspnam_r $hdrs
15513 case "$d_getspnam_r_proto" in
15515 case "$getspnam_r_proto" in
15516 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15517 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15519 case "$getspnam_r_proto" in
15520 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15521 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15523 case "$getspnam_r_proto" in
15524 ''|0) d_getspnam_r=undef
15526 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15527 * ) case "$getspnam_r_proto" in
15528 REENTRANT_PROTO*) ;;
15529 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15531 echo "Prototype: $try" ;;
15534 *) case "$usethreads" in
15535 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15542 *) getspnam_r_proto=0
15546 : see if gettimeofday or ftime exists
15547 set gettimeofday d_gettimeod
15549 case "$d_gettimeod" in
15555 val="$undef"; set d_ftime; eval $setvar
15558 case "$d_gettimeod$d_ftime" in
15561 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15565 : see if gmtime_r exists
15566 set gmtime_r d_gmtime_r
15568 case "$d_gmtime_r" in
15570 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15571 case "$d_gmtime_r_proto:$usethreads" in
15572 ":define") d_gmtime_r_proto=define
15573 set d_gmtime_r_proto gmtime_r $hdrs
15577 case "$d_gmtime_r_proto" in
15579 case "$gmtime_r_proto" in
15580 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15581 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15583 case "$gmtime_r_proto" in
15584 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15585 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15587 case "$gmtime_r_proto" in
15588 ''|0) d_gmtime_r=undef
15590 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15591 * ) case "$gmtime_r_proto" in
15592 REENTRANT_PROTO*) ;;
15593 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15595 echo "Prototype: $try" ;;
15598 *) case "$usethreads" in
15599 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15606 *) gmtime_r_proto=0
15610 : see if hasmntopt exists
15611 set hasmntopt d_hasmntopt
15614 : see if this is a netinet/in.h or sys/in.h system
15615 set netinet/in.h i_niin sys/in.h i_sysin
15618 : see if arpa/inet.h has to be included
15619 set arpa/inet.h i_arpainet
15622 : see if htonl --and friends-- exists
15627 : Maybe they are macros.
15630 $cat >htonl.c <<EOM
15632 #include <sys/types.h>
15633 #$i_niin I_NETINET_IN
15635 #$i_arpainet I_ARPA_INET
15636 #ifdef I_NETINET_IN
15637 #include <netinet/in.h>
15640 #include <sys/in.h>
15643 #include <arpa/inet.h>
15646 printf("Defined as a macro.");
15649 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15650 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15652 echo "But it seems to be defined as a macro." >&4
15660 : see if hypot exists
15664 : see if ilogb exists
15668 : see if ilogbl exists
15669 set ilogbl d_ilogbl
15672 : check whether inet_aton exists
15673 set inet_aton d_inetaton
15676 : see if inet_ntop exists
15677 set inet_ntop d_inetntop
15680 : see if inet_pton exists
15681 set inet_pton d_inetpton
15686 $cat >isascii.c <<EOCP
15689 #$i_stdlib I_STDLIB
15691 #include <stdlib.h>
15702 if eval $compile; then
15703 echo "isascii() found." >&4
15706 echo "isascii() NOT found." >&4
15715 $cat >isblank.c <<'EOCP'
15726 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15727 echo "isblank() found." >&4
15730 echo "isblank() NOT found." >&4
15737 : check for isfinite
15738 echo "Checking to see if you have isfinite..." >&4
15741 int main() { return isfinite(0.0); }
15744 if eval $compile; then
15746 echo "You have isfinite."
15749 echo "You do not have isfinite."
15755 : see if isfinitel exists
15756 set isfinitel d_isfinitel
15760 echo "Checking to see if you have isinf..." >&4
15763 int main() { return isinf(0.0); }
15766 if eval $compile; then
15768 echo "You have isinf."
15771 echo "You do not have isinf."
15777 : see if isinfl exists
15778 set isinfl d_isinfl
15782 echo "Checking to see if you have isless..." >&4
15785 int main() { return isless(0.0); }
15788 if eval $compile; then
15790 echo "You have isless."
15793 echo "You do not have isless."
15800 echo "Checking to see if you have isnan..." >&4
15803 int main() { return isnan(0.0); }
15806 if eval $compile; then
15808 echo "You have isnan."
15811 echo "You do not have isnan."
15817 : see if isnanl exists
15818 set isnanl d_isnanl
15821 : check for isnormal
15822 echo "Checking to see if you have isnormal..." >&4
15825 int main() { return isnormal(0.0); }
15828 if eval $compile; then
15830 echo "You have isnormal."
15833 echo "You do not have isnormal."
15843 : see if j0l exists
15847 : see if killpg exists
15848 set killpg d_killpg
15851 : see if localeconv exists
15852 set localeconv d_locconv
15855 : see if libc has the POSIX.1-2008 currency locale rules
15856 case "$d_locconv:$d_lc_monetary_2008" in
15859 #include <locale.h>
15861 struct lconv *lc = localeconv();
15862 char int_p_cs_precedes = lc->int_p_cs_precedes;
15867 if eval $compile; then
15868 d_lc_monetary_2008="$define"
15870 d_lc_monetary_2008="$undef"
15876 : see if lchown exists
15878 $cat > try.c <<'EOCP'
15879 /* System header to define __stub macros and hopefully few prototypes,
15880 which can conflict with char lchown(); below. */
15881 #include <assert.h>
15882 /* Override any gcc2 internal prototype to avoid an error. */
15883 /* We use char because int might match the return type of a gcc2
15884 builtin and then its argument prototype would still apply. */
15887 /* The GNU C library defines this for functions which it implements
15888 to always fail with ENOSYS. Some functions are actually named
15889 something starting with __ and the normal name is an alias. */
15890 #if defined (__stub_lchown) || defined (__stub___lchown)
15898 if eval $compile; then
15899 $echo "lchown() found." >&4
15902 $echo "lchown() NOT found." >&4
15908 : See if number of significant digits in a double precision number is known
15910 $cat >ldbl_dig.c <<EOM
15911 #include <limits.h>
15914 printf("Contains LDBL_DIG");
15917 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15918 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15919 echo "LDBL_DIG found." >&4
15922 echo "LDBL_DIG NOT found." >&4
15929 : see if lgamma exists
15930 set lgamma d_lgamma
15933 : see if lgamma_r exists
15934 set lgamma_r d_lgamma_r
15937 : check to see if math.h defines _LIB_VERSION
15938 d_libm_lib_version="$undef"
15940 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15942 #include <unistd.h>
15944 int main (int argc, char *argv[])
15946 printf ("%d\n", _LIB_VERSION);
15951 if eval $compile; then
15953 echo "Yes, it does ($foo)" >&4
15954 d_libm_lib_version="$define"
15956 echo "No, it does not (probably harmless)" >&4
15960 : see if link exists
15964 : see if llrint exists
15965 set llrint d_llrint
15968 : see if llrintl exists
15969 set llrintl d_llrintl
15972 : see if llround exists
15973 set llround d_llround
15976 : see if llroundl exists
15977 set llroundl d_llroundl
15980 : see if localeconv_l exists
15981 set localeconv_l d_localeconv_l
15984 : see if localtime_r exists
15985 set localtime_r d_localtime_r
15987 case "$d_localtime_r" in
15989 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15990 case "$d_localtime_r_proto:$usethreads" in
15991 ":define") d_localtime_r_proto=define
15992 set d_localtime_r_proto localtime_r $hdrs
15996 case "$d_localtime_r_proto" in
15998 case "$localtime_r_proto" in
15999 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16000 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16002 case "$localtime_r_proto" in
16003 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16004 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16006 case "$localtime_r_proto" in
16007 ''|0) d_localtime_r=undef
16008 localtime_r_proto=0
16009 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16010 * ) case "$localtime_r_proto" in
16011 REENTRANT_PROTO*) ;;
16012 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16014 echo "Prototype: $try" ;;
16017 *) case "$usethreads" in
16018 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16020 d_localtime_r=undef
16021 localtime_r_proto=0
16025 *) localtime_r_proto=0
16029 : see if localtime_r calls tzset
16030 case "$localtime_r_proto" in
16033 /* Does our libc's localtime_r call tzset ?
16034 * return 0 if so, 1 otherwise.
16036 #$i_systypes I_SYS_TYPES
16037 #$i_unistd I_UNISTD
16039 #$i_stdlib I_STDLIB
16040 #$i_malloc I_MALLOC
16042 # include <sys/types.h>
16045 # include <unistd.h>
16051 #include <stdlib.h>
16053 #include <string.h>
16055 # include <malloc.h>
16059 time_t t = time(0L);
16060 char w_tz[]="TZ" "=GMT+5",
16061 e_tz[]="TZ" "=GMT-5",
16062 *tz_e = (char*)malloc(16),
16063 *tz_w = (char*)malloc(16);
16064 struct tm tm_e, tm_w;
16065 memset(&tm_e,'\0',sizeof(struct tm));
16066 memset(&tm_w,'\0',sizeof(struct tm));
16071 localtime_r(&t, &tm_e);
16074 localtime_r(&t, &tm_w);
16076 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16082 if eval $compile; then
16083 if $run ./try; then
16084 d_localtime_r_needs_tzset=undef;
16086 d_localtime_r_needs_tzset=define;
16089 d_localtime_r_needs_tzset=undef;
16093 d_localtime_r_needs_tzset=undef;
16098 : see if lockf exists
16102 : see if log1p exists
16106 : see if log2 exists
16110 : see if logb exists
16114 : see if lrint exists
16118 : see if lrintl exists
16119 set lrintl d_lrintl
16122 : see if lround exists
16123 set lround d_lround
16126 : see if lroundl exists
16127 set lroundl d_lroundl
16130 : see if prototype for lseek is available
16132 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16135 : see if lstat exists
16139 : see if madvise exists
16140 set madvise d_madvise
16143 : see if malloc_size exists
16144 set malloc_size d_malloc_size
16147 : see if malloc_size_good exists
16148 set malloc_good_size d_malloc_good_size
16151 : see if mblen exists
16155 : see if mbrlen exists
16156 set mbrlen d_mbrlen
16159 : see if mbrtowc exists
16160 set mbrtowc d_mbrtowc
16163 : see if mbstowcs exists
16164 set mbstowcs d_mbstowcs
16167 : see if mbtowc exists
16168 set mbtowc d_mbtowc
16171 : see if memmem exists
16172 set memmem d_memmem
16175 : see if memrchr exists
16176 set memrchr d_memrchr
16179 : see if mkdir exists
16183 : see if mkdtemp exists
16184 set mkdtemp d_mkdtemp
16187 : see if mkfifo exists
16188 set mkfifo d_mkfifo
16191 : see if mkostemp exists
16192 set mkostemp d_mkostemp
16195 : see if mkstemp exists
16196 set mkstemp d_mkstemp
16199 : see if mkstemps exists
16200 set mkstemps d_mkstemps
16203 : see if mktime exists
16204 set mktime d_mktime
16207 : see if sys/mman.h has to be included
16208 set sys/mman.h i_sysmman
16211 : see if mmap exists
16214 : see what shmat returns
16215 : default to something harmless
16217 case "$i_sysmman$d_mmap" in
16219 $cat >mmap.c <<'END'
16220 #include <sys/mman.h>
16223 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16228 echo "and it returns ($mmaptype)." >&4
16234 : see if sqrtl exists
16238 : see if scalbnl exists
16239 set scalbnl d_scalbnl
16242 : see if truncl exists
16243 set truncl d_truncl
16246 : see if modfl exists
16250 : see if prototype for modfl is available
16252 set d_modflproto modfl define math.h
16255 if $test "$uselongdouble" = "$define"; then
16257 if $test "$d_sqrtl" != "$define"; then
16258 message="$message sqrtl"
16260 if $test "$d_modfl" != "$define"; then
16261 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16262 echo "You have both truncl and copysignl, so I can emulate modfl."
16264 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16265 echo "You have both aintl and copysignl, so I can emulate modfl."
16267 message="$message modfl"
16271 if $test "$d_frexpl" != "$define"; then
16272 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16273 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16275 message="$message frexpl"
16278 if $test "$d_ldexpl" != "$define"; then
16279 message="$message ldexpl"
16282 if $test "$message" != ""; then
16285 *** You requested the use of long doubles but you do not seem to have
16286 *** the following mathematical functions needed for long double support:
16288 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16289 *** Cannot continue, aborting.
16297 : see if mprotect exists
16298 set mprotect d_mprotect
16301 : see if msgctl exists
16302 set msgctl d_msgctl
16305 : see if msgget exists
16306 set msgget d_msgget
16309 : see if msgsnd exists
16310 set msgsnd d_msgsnd
16313 : see if msgrcv exists
16314 set msgrcv d_msgrcv
16317 : see how much of the 'msg*(2)' library is present.
16320 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16321 *"$undef"*) h_msg=false;;
16325 case "`ipcs 2>&1`" in
16326 "SVID messages"*"not configured"*)
16327 echo "Your $osname does not have the msg*(2) configured." >&4
16330 set msgctl d_msgctl
16332 set msgget d_msgget
16334 set msgsnd d_msgsnd
16336 set msgrcv d_msgrcv
16342 : we could also check for sys/ipc.h ...
16343 if $h_msg && $test `./findhdr sys/msg.h`; then
16344 echo "You have the full msg*(2) library." >&4
16347 echo "You don't have the full msg*(2) library." >&4
16353 : Check for msghdr_s
16355 echo "Checking to see if your system supports struct msghdr..." >&4
16356 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16358 case "$d_msghdr_s" in
16359 "$define") echo "Yes, it does." ;;
16360 *) echo "No, it doesn't." ;;
16364 : see if msync exists
16368 : see if munmap exists
16369 set munmap d_munmap
16372 : see if nan exists
16376 : see if nanosleep exists
16377 set nanosleep d_nanosleep
16380 : see if nearbyint exists
16381 set nearbyint d_nearbyint
16384 : see if nextafter exists
16385 set nextafter d_nextafter
16388 : see if nexttoward exists
16389 set nexttoward d_nexttoward
16392 : see if nice exists
16396 : see if this is a langinfo.h system
16397 set langinfo.h i_langinfo
16400 : see if nl_langinfo exists
16401 set nl_langinfo d_nl_langinfo
16404 : see if this is a quadmath.h system
16405 set quadmath.h i_quadmath
16408 : Check basic sizes
16410 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16412 case "$use64bitint:$d_quad:$quadtype" in
16415 uvtype="$uquadtype"
16420 uvtype="unsigned long"
16426 case "$uselongdouble:$d_longdbl" in
16428 nvtype="long double"
16429 nvsize=$longdblsize
16436 case "$usequadmath:$i_quadmath" in
16438 nvtype="__float128"
16444 *** You requested the use of the quadmath library, but you
16445 *** do not seem to have the quadmath library installed.
16446 *** Cannot continue, aborting.
16452 define:*) $cat <<EOM >&4
16454 *** You requested the use of the quadmath library, but you
16455 *** do not seem to have the required header, <quadmath.h>.
16457 case "$gccversion" in
16460 *** Your gcc looks a bit old:
16466 *** You are not running a gcc.
16471 *** For the quadmath library you need at least gcc 4.6.
16472 *** Cannot continue, aborting.
16478 $echo "(IV will be "$ivtype", $ivsize bytes)"
16479 $echo "(UV will be "$uvtype", $uvsize bytes)"
16480 $echo "(NV will be "$nvtype", $nvsize bytes)"
16483 #$i_inttypes I_INTTYPES
16485 #include <inttypes.h>
16490 int8_t i = INT8_MAX;
16491 uint8_t u = UINT8_MAX;
16492 printf("int8_t\n");
16495 int16_t i = INT16_MAX;
16496 uint16_t u = UINT16_MAX;
16497 printf("int16_t\n");
16500 int32_t i = INT32_MAX;
16501 uint32_t u = UINT32_MAX;
16502 printf("int32_t\n");
16507 i8type="signed char"
16508 u8type="unsigned char"
16513 '') case "$shortsize" in
16515 u16type="unsigned short"
16523 '') set try -DINT16
16524 if eval $compile; then
16525 case "`$run ./try`" in
16537 '') if $test $shortsize -ge 2; then
16539 u16type="unsigned short"
16547 '') case "$longsize" in
16549 u32type="unsigned long"
16553 *) case "$intsize" in
16555 u32type="unsigned int"
16565 '') set try -DINT32
16566 if eval $compile; then
16567 case "`$run ./try`" in
16579 '') if $test $intsize -ge 4; then
16581 u32type="unsigned int"
16589 '') case "$d_quad:$quadtype" in
16591 i64type="$quadtype"
16592 u64type="$uquadtype"
16600 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16603 #$i_stdlib I_STDLIB
16605 #include <stdlib.h>
16607 #include <sys/types.h>
16608 #include <signal.h>
16610 /* volatile so that the compiler has to store it out to memory */
16611 volatile int bletched = 0;
16612 $signal_t blech(int s) { bletched = 1; }
16617 int n = 8 * $uvsize;
16620 signal(SIGFPE, blech);
16623 for (i = 0; i < n; i++) {
16624 u = u << 1 | ($uvtype)1;
16626 if (($uvtype)d != u)
16630 d = ($nvtype)(u - 1);
16631 if (($uvtype)d != (u - 1))
16638 printf("%d\n", ((i == n) ? -n : i));
16644 d_nv_preserves_uv="$undef"
16645 if eval $compile; then
16646 nv_preserves_uv_bits="`$run ./try`"
16648 case "$nv_preserves_uv_bits" in
16650 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16651 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16652 d_nv_preserves_uv="$define"
16654 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16655 d_nv_preserves_uv="$undef" ;;
16656 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16657 nv_preserves_uv_bits="0" ;;
16661 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16665 typedef $nvtype NV;
16672 while(count < 256) {
16673 /* volatile so that the compiler has to store it out to memory */
16674 volatile NV up = value + 1.0;
16675 volatile NV negated = -value;
16676 volatile NV down = negated - 1.0;
16677 volatile NV got_up = up - value;
16678 int up_good = got_up == 1.0;
16679 int got_down = down - negated;
16680 int down_good = got_down == -1.0;
16682 if (down_good != up_good) {
16684 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16685 up_good, (double) got_up, down_good, (double) got_down,
16686 count, (double) value);
16693 fputs("256.0", stdout);
16696 fputs("2.0", stdout);
16702 fputs("*", stdout);
16708 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16709 count, (double) value);
16715 nv_overflows_integers_at='0'
16716 if eval $compile; then
16722 The largest integer your NVs can preserve is equal to $xxx
16724 nv_overflows_integers_at="$xxx"
16727 Cannot determine the largest integer value your NVs can hold, unexpected output
16734 Cannot determine the largest integer value your NVs can hold
16741 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16744 #$i_stdlib I_STDLIB
16746 #include <stdlib.h>
16748 #include <string.h>
16749 #include <sys/types.h>
16750 #include <signal.h>
16752 /* volatile so that the compiler has to store it out to memory */
16753 volatile int bletched = 0;
16754 $signal_t blech(int s) { bletched = 1; }
16757 int checkit($nvtype d, const char *where) {
16759 unsigned char *p = (unsigned char *)v;
16760 unsigned char *end = p + sizeof(d);
16769 p = (unsigned char *)v;
16770 printf("No - %s: 0x", where);
16772 printf ("%02X", *p++);
16777 int main(int argc, char **argv) {
16780 fail += checkit(d, "0.0");
16782 /* The compiler shouldn't be assuming that bletched is 0 */
16785 fail += checkit(d, "bleched");
16788 signal(SIGFPE, blech);
16791 /* Paranoia - the compiler should have no way of knowing that ANSI says
16792 that argv[argc] will always be NULL. Actually, if it did assume this it
16793 would be buggy, as this is C and main() can be called from elsewhere in
16795 d = argv[argc] ? 1 : 0;
16798 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16801 fail += checkit(d, "ternary");
16803 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16806 printf("No - memset doesn't give 0.0\n");
16807 /* This might just blow up: */
16808 printf("(gives %g)\n", d);
16814 printf("No - something bleched\n");
16819 printf("No - %d fail(s)\n", fail);
16828 d_nv_zero_is_allbits_zero="$undef"
16829 if eval $compile; then
16835 0.0 is represented as all bits zero in memory
16837 d_nv_zero_is_allbits_zero="$define"
16840 0.0 is not represented as all bits zero in memory
16842 d_nv_zero_is_allbits_zero="$undef"
16847 0.0 is not represented as all bits zero in memory
16849 d_nv_zero_is_allbits_zero="$undef"
16855 : check for off64_t
16857 echo "Checking to see if you have off64_t..." >&4
16859 #include <sys/types.h>
16860 #include <unistd.h>
16861 int main() { off64_t x = 7; }
16864 if eval $compile; then
16866 echo "You have off64_t."
16869 echo "You do not have off64_t."
16870 case "$lseeksize" in
16871 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16878 : how to create joinable pthreads
16879 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16881 echo "Checking what constant to use for creating joinable pthreads..." >&4
16882 $cat >try.c <<'EOCP'
16883 #include <pthread.h>
16885 int detachstate = JOINABLE;
16888 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16889 if eval $compile; then
16890 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16891 val="$undef" # Yes, undef.
16892 set d_old_pthread_create_joinable
16895 set old_pthread_create_joinable
16898 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16899 if eval $compile; then
16900 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16902 set d_old_pthread_create_joinable
16904 val=PTHREAD_CREATE_UNDETACHED
16905 set old_pthread_create_joinable
16908 set try -DJOINABLE=__UNDETACHED
16909 if eval $compile; then
16910 echo "You seem to use __UNDETACHED." >&4
16912 set d_old_pthread_create_joinable
16915 set old_pthread_create_joinable
16918 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16920 set d_old_pthread_create_joinable
16923 set old_pthread_create_joinable
16930 d_old_pthread_create_joinable="$undef"
16931 old_pthread_create_joinable=""
16934 : see if pause exists
16938 : see if pipe2 exists
16942 : see if poll exists
16946 : see if prctl exists
16950 : see if prctl supports PR_SET_NAME
16951 d_prctl_set_name=$undef
16956 #include <unistd.h>
16958 #include <sys/prctl.h>
16960 int main (int argc, char *argv[])
16962 return (prctl (PR_SET_NAME, "Test"));
16966 if eval $compile_ok && $run ./try; then
16967 echo "Your prctl (PR_SET_NAME, ...) works"
16968 d_prctl_set_name=$define
16974 : see if readlink exists
16975 set readlink d_readlink
16978 : Check if there is a /proc symlink to the abs path of
16979 : the executing program. We will honor hints of d_procselfexe=$undef
16980 : or procselfexe being non-empty, otherwise will try to determine both
16981 : if we have readlink.
16982 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
16983 : referenced, and AmigaOS does not have a proc filesystem anyway.
16986 if $test "X$d_procselfexe" = Xundef; then
16988 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
16990 elif $test "X$d_readlink" = Xdefine; then
16991 : NetBSD first as /proc/self is a symlink to /proc/curproc,
16992 : and it feels more tidy to avoid an extra level of symlink
16993 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16994 while test $# -gt 0; do
16997 if $issymlink $try; then
16998 $ls -l $try > reflect
16999 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17000 echo "You have $type-like $try."
17001 procselfexe='"'$try'"'
17003 : This will break out of the loop
17013 : backward compatibility for d_hvfork
17014 if test X$d_hvfork != X; then
17015 d_vfork="$d_hvfork"
17018 : see if there is a vfork
17023 d_pseudofork=$undef
17025 : Ok, but do we want to use it. vfork is reportedly unreliable in
17026 : perl on Solaris 2.x, and probably elsewhere.
17030 case "$usevfork" in
17036 Perl can only use a vfork() that doesn't suffer from strict
17037 restrictions on calling functions or modifying global data in
17038 the child. For example, glibc-2.1 contains such a vfork()
17039 that is unsuitable. If your system provides a proper fork()
17040 call, chances are that you do NOT want perl to use vfork().
17043 rp="Do you still want to use vfork()?"
17048 echo "Ok, we won't use vfork()."
17057 $define) usevfork='true';;
17058 *) usevfork='false';;
17061 : see whether the pthread_atfork exists
17063 #include <pthread.h>
17066 #ifdef PTHREAD_ATFORK
17067 pthread_atfork(NULL,NULL,NULL);
17072 : see if pthread_atfork exists
17073 set try -DPTHREAD_ATFORK
17074 if eval $compile; then
17079 case "$usethreads" in
17082 $define) echo 'pthread_atfork found.' >&4 ;;
17083 *) echo 'pthread_atfork NOT found.' >&4 ;;
17086 set d_pthread_atfork
17089 : see if pthread_attr_setscope exists
17090 set pthread_attr_setscope d_pthread_attr_setscope
17093 : see whether the various POSIXish _yields exist
17095 #include <pthread.h>
17101 #ifdef PTHREAD_YIELD
17104 #ifdef PTHREAD_YIELD_NULL
17105 pthread_yield(NULL);
17111 : see if sched_yield exists
17112 set try -DSCHED_YIELD
17113 if eval $compile; then
17115 sched_yield='sched_yield()'
17119 case "$usethreads" in
17122 $define) echo 'sched_yield() found.' >&4 ;;
17123 *) echo 'sched_yield() NOT found.' >&4 ;;
17129 : see if pthread_yield exists
17130 set try -DPTHREAD_YIELD
17131 if eval $compile; then
17133 case "$sched_yield" in
17134 '') sched_yield='pthread_yield()' ;;
17137 set try -DPTHREAD_YIELD_NULL
17138 if eval $compile; then
17140 case "$sched_yield" in
17141 '') sched_yield='pthread_yield(NULL)' ;;
17147 case "$usethreads" in
17150 $define) echo 'pthread_yield() found.' >&4 ;;
17151 *) echo 'pthread_yield() NOT found.' >&4 ;;
17155 set d_pthread_yield
17157 case "$sched_yield" in
17158 '') sched_yield=undef ;;
17162 : check for ptrdiff_t
17164 echo "Checking to see if you have ptrdiff_t..." >&4
17166 #include <stddef.h>
17167 int main() { ptrdiff_t x = 7; }
17170 if eval $compile; then
17172 echo "You have ptrdiff_t."
17175 echo "You do not have ptrdiff_t."
17181 : see if random_r exists
17182 set random_r d_random_r
17184 case "$d_random_r" in
17186 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17187 case "$d_random_r_proto:$usethreads" in
17188 ":define") d_random_r_proto=define
17189 set d_random_r_proto random_r $hdrs
17193 case "$d_random_r_proto" in
17195 case "$random_r_proto" in
17196 ''|0) try='int random_r(int*, struct random_data*);'
17197 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17199 case "$random_r_proto" in
17200 ''|0) try='int random_r(long*, struct random_data*);'
17201 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17203 case "$random_r_proto" in
17204 ''|0) try='int random_r(struct random_data*, int32_t*);'
17205 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17207 case "$random_r_proto" in
17208 ''|0) d_random_r=undef
17210 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17211 * ) case "$random_r_proto" in
17212 REENTRANT_PROTO*) ;;
17213 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17215 echo "Prototype: $try" ;;
17218 *) case "$usethreads" in
17219 define) echo "random_r has no prototype, not using it." >&4 ;;
17226 *) random_r_proto=0
17230 : see if readdir and friends exist
17231 set readdir d_readdir
17233 set seekdir d_seekdir
17235 set telldir d_telldir
17237 set rewinddir d_rewinddir
17240 : see if readdir64_r exists
17241 set readdir64_r d_readdir64_r
17243 case "$d_readdir64_r" in
17245 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17246 case "$d_readdir64_r_proto:$usethreads" in
17247 ":define") d_readdir64_r_proto=define
17248 set d_readdir64_r_proto readdir64_r $hdrs
17252 case "$d_readdir64_r_proto" in
17254 case "$readdir64_r_proto" in
17255 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17256 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17258 case "$readdir64_r_proto" in
17259 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17260 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17262 case "$readdir64_r_proto" in
17263 ''|0) d_readdir64_r=undef
17264 readdir64_r_proto=0
17265 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17266 * ) case "$readdir64_r_proto" in
17267 REENTRANT_PROTO*) ;;
17268 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17270 echo "Prototype: $try" ;;
17273 *) case "$usethreads" in
17274 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17276 d_readdir64_r=undef
17277 readdir64_r_proto=0
17281 *) readdir64_r_proto=0
17285 : see if readdir_r exists
17286 set readdir_r d_readdir_r
17288 case "$d_readdir_r" in
17290 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17291 case "$d_readdir_r_proto:$usethreads" in
17292 ":define") d_readdir_r_proto=define
17293 set d_readdir_r_proto readdir_r $hdrs
17297 case "$d_readdir_r_proto" in
17299 case "$readdir_r_proto" in
17300 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17301 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17303 case "$readdir_r_proto" in
17304 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17305 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17307 case "$readdir_r_proto" in
17308 ''|0) d_readdir_r=undef
17310 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17311 * ) case "$readdir_r_proto" in
17312 REENTRANT_PROTO*) ;;
17313 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17315 echo "Prototype: $try" ;;
17318 *) case "$usethreads" in
17319 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17326 *) readdir_r_proto=0
17330 : see if readv exists
17334 : see if recvmsg exists
17335 set recvmsg d_recvmsg
17338 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17340 if set regcomp val -f d_regcomp; eval $csym; $val; then
17341 echo 'regcomp() found.' >&4
17342 d_regcomp="$define"
17345 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17346 echo 'regcmp() found.' >&4
17350 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17351 echo 're_comp() found, assuming re_exec() also exists.' >&4
17352 d_re_comp="$define"
17357 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17364 : see if remainder exists
17365 set remainder d_remainder
17368 : see if remquo exists
17369 set remquo d_remquo
17372 : see if rename exists
17373 set rename d_rename
17376 : see if rint exists
17380 : see if rmdir exists
17384 : see if round exists
17388 : see if prototype for sbrk is available
17390 set d_sbrkproto sbrk $i_unistd unistd.h
17393 : see if scalbn exists
17394 set scalbn d_scalbn
17397 : see if select exists
17398 set select d_select
17401 : see if semctl exists
17402 set semctl d_semctl
17405 : see if semget exists
17406 set semget d_semget
17409 : see if semop exists
17413 : see how much of the 'sem*(2)' library is present.
17416 case "$d_semctl$d_semget$d_semop" in
17417 *"$undef"*) h_sem=false;;
17421 case "`ipcs 2>&1`" in
17422 "SVID messages"*"not configured"*)
17423 echo "Your $osname does not have the sem*(2) configured." >&4
17426 set semctl d_semctl
17428 set semget d_semget
17436 : we could also check for sys/ipc.h ...
17437 if $h_sem && $test `./findhdr sys/sem.h`; then
17438 echo "You have the full sem*(2) library." >&4
17441 echo "You don't have the full sem*(2) library." >&4
17447 : see whether sys/sem.h defines union semun
17449 $cat > try.c <<'END'
17450 #include <sys/types.h>
17451 #include <sys/ipc.h>
17452 #include <sys/sem.h>
17453 int main () { union semun semun; semun.buf = 0; }
17456 if eval $compile; then
17457 echo "You have union semun in <sys/sem.h>." >&4
17460 echo "You do not have union semun in <sys/sem.h>." >&4
17467 : see how to do semctl IPC_STAT
17471 $cat > tryh.h <<END
17474 # define S_IRUSR S_IREAD
17475 # define S_IWUSR S_IWRITE
17476 # define S_IXUSR S_IEXEC
17478 # define S_IRUSR 0400
17479 # define S_IWUSR 0200
17480 # define S_IXUSR 0100
17482 # define S_IRGRP (S_IRUSR>>3)
17483 # define S_IWGRP (S_IWUSR>>3)
17484 # define S_IXGRP (S_IXUSR>>3)
17485 # define S_IROTH (S_IRUSR>>6)
17486 # define S_IWOTH (S_IWUSR>>6)
17487 # define S_IXOTH (S_IXUSR>>6)
17490 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17491 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17492 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17495 : see whether semctl IPC_STAT can use union semun
17496 case "$d_semctl_semun" in
17500 #include <sys/types.h>
17501 #include <sys/ipc.h>
17502 #include <sys/sem.h>
17503 #include <sys/stat.h>
17510 #$d_union_semun HAS_UNION_SEMUN
17513 #ifndef HAS_UNION_SEMUN
17516 struct semid_ds *buf;
17517 unsigned short *array;
17523 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17524 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17526 struct semid_ds argbuf;
17529 st = semctl(sem, 0, IPC_STAT, arg);
17533 # endif /* IPC_STAT */
17534 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17536 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17537 # endif /* IPC_RMID */
17538 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17540 #endif /* IPC_PRIVATE && ... */
17541 printf("semget failed: errno = %d\n", errno);
17546 if eval $compile; then
17549 semun) val="$define" ;;
17557 case "$d_semctl_semun" in
17559 echo "You can use union semun for semctl IPC_STAT." >&4
17562 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17567 : see whether semctl IPC_STAT can use struct semid_ds pointer
17568 case "$d_semctl_semid_ds" in
17571 $cat > try.c <<'END'
17572 #include <sys/types.h>
17573 #include <sys/ipc.h>
17574 #include <sys/sem.h>
17575 #include <sys/stat.h>
17583 struct semid_ds arg;
17586 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17587 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17590 st = semctl(sem, 0, IPC_STAT, &arg);
17592 printf("semid_ds\n");
17594 # endif /* IPC_STAT */
17595 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17597 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17598 # endif /* IPC_RMID */
17599 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17601 #endif /* IPC_PRIVATE && ... */
17602 printf("semget failed: errno = %d\n", errno);
17608 if eval $compile; then
17611 semid_ds) val="$define" ;;
17615 set d_semctl_semid_ds
17619 case "$d_semctl_semid_ds" in
17621 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17623 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17629 # We do not have the full sem*(2) library, so assume we can not
17635 set d_semctl_semid_ds
17641 : see if sendmsg exists
17642 set sendmsg d_sendmsg
17645 : see if setegid exists
17646 set setegid d_setegid
17649 : see if seteuid exists
17650 set seteuid d_seteuid
17653 : see if setgrent exists
17654 set setgrent d_setgrent
17657 : see if setgrent_r exists
17658 set setgrent_r d_setgrent_r
17660 case "$d_setgrent_r" in
17662 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17663 case "$d_setgrent_r_proto:$usethreads" in
17664 ":define") d_setgrent_r_proto=define
17665 set d_setgrent_r_proto setgrent_r $hdrs
17669 case "$d_setgrent_r_proto" in
17671 case "$setgrent_r_proto" in
17672 ''|0) try='int setgrent_r(FILE**);'
17673 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17675 case "$setgrent_r_proto" in
17676 ''|0) try='void setgrent_r(FILE**);'
17677 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17679 case "$setgrent_r_proto" in
17680 ''|0) d_setgrent_r=undef
17682 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17683 * ) case "$setgrent_r_proto" in
17684 REENTRANT_PROTO*) ;;
17685 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17687 echo "Prototype: $try" ;;
17690 *) case "$usethreads" in
17691 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17698 *) setgrent_r_proto=0
17702 : see if sethostent exists
17703 set sethostent d_sethent
17706 : see if sethostent_r exists
17707 set sethostent_r d_sethostent_r
17709 case "$d_sethostent_r" in
17711 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17712 case "$d_sethostent_r_proto:$usethreads" in
17713 ":define") d_sethostent_r_proto=define
17714 set d_sethostent_r_proto sethostent_r $hdrs
17718 case "$d_sethostent_r_proto" in
17720 case "$sethostent_r_proto" in
17721 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17722 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17724 case "$sethostent_r_proto" in
17725 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17726 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17728 case "$sethostent_r_proto" in
17729 ''|0) d_sethostent_r=undef
17730 sethostent_r_proto=0
17731 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17732 * ) case "$sethostent_r_proto" in
17733 REENTRANT_PROTO*) ;;
17734 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17736 echo "Prototype: $try" ;;
17739 *) case "$usethreads" in
17740 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17742 d_sethostent_r=undef
17743 sethostent_r_proto=0
17747 *) sethostent_r_proto=0
17751 : see if setitimer exists
17752 set setitimer d_setitimer
17755 : see if setlinebuf exists
17756 set setlinebuf d_setlinebuf
17759 : see if setlocale exists
17760 set setlocale d_setlocale
17763 : see if locale.h is available
17764 set locale.h i_locale
17767 : see if setlocale_r exists
17768 set setlocale_r d_setlocale_r
17770 case "$d_setlocale_r" in
17772 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17773 case "$d_setlocale_r_proto:$usethreads" in
17774 ":define") d_setlocale_r_proto=define
17775 set d_setlocale_r_proto setlocale_r $hdrs
17779 case "$d_setlocale_r_proto" in
17781 case "$setlocale_r_proto" in
17782 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17783 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17785 case "$setlocale_r_proto" in
17786 ''|0) d_setlocale_r=undef
17787 setlocale_r_proto=0
17788 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17789 * ) case "$setlocale_r_proto" in
17790 REENTRANT_PROTO*) ;;
17791 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17793 echo "Prototype: $try" ;;
17796 *) case "$usethreads" in
17797 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17799 d_setlocale_r=undef
17800 setlocale_r_proto=0
17804 *) setlocale_r_proto=0
17808 : see if setnetent exists
17809 set setnetent d_setnent
17812 : see if setnetent_r exists
17813 set setnetent_r d_setnetent_r
17815 case "$d_setnetent_r" in
17817 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17818 case "$d_setnetent_r_proto:$usethreads" in
17819 ":define") d_setnetent_r_proto=define
17820 set d_setnetent_r_proto setnetent_r $hdrs
17824 case "$d_setnetent_r_proto" in
17826 case "$setnetent_r_proto" in
17827 ''|0) try='int setnetent_r(int, struct netent_data*);'
17828 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17830 case "$setnetent_r_proto" in
17831 ''|0) try='void setnetent_r(int, struct netent_data*);'
17832 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17834 case "$setnetent_r_proto" in
17835 ''|0) d_setnetent_r=undef
17836 setnetent_r_proto=0
17837 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17838 * ) case "$setnetent_r_proto" in
17839 REENTRANT_PROTO*) ;;
17840 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17842 echo "Prototype: $try" ;;
17845 *) case "$usethreads" in
17846 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17848 d_setnetent_r=undef
17849 setnetent_r_proto=0
17853 *) setnetent_r_proto=0
17857 : see if setprotoent exists
17858 set setprotoent d_setpent
17861 : see if setpgid exists
17862 set setpgid d_setpgid
17865 : see if setpgrp2 exists
17866 set setpgrp2 d_setpgrp2
17869 : see if setpriority exists
17870 set setpriority d_setprior
17873 : see if setproctitle exists
17874 set setproctitle d_setproctitle
17877 : see if setprotoent_r exists
17878 set setprotoent_r d_setprotoent_r
17880 case "$d_setprotoent_r" in
17882 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17883 case "$d_setprotoent_r_proto:$usethreads" in
17884 ":define") d_setprotoent_r_proto=define
17885 set d_setprotoent_r_proto setprotoent_r $hdrs
17889 case "$d_setprotoent_r_proto" in
17891 case "$setprotoent_r_proto" in
17892 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17893 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17895 case "$setprotoent_r_proto" in
17896 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17897 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17899 case "$setprotoent_r_proto" in
17900 ''|0) d_setprotoent_r=undef
17901 setprotoent_r_proto=0
17902 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17903 * ) case "$setprotoent_r_proto" in
17904 REENTRANT_PROTO*) ;;
17905 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17907 echo "Prototype: $try" ;;
17910 *) case "$usethreads" in
17911 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17913 d_setprotoent_r=undef
17914 setprotoent_r_proto=0
17918 *) setprotoent_r_proto=0
17922 : see if setpwent exists
17923 set setpwent d_setpwent
17926 : see if setpwent_r exists
17927 set setpwent_r d_setpwent_r
17929 case "$d_setpwent_r" in
17931 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17932 case "$d_setpwent_r_proto:$usethreads" in
17933 ":define") d_setpwent_r_proto=define
17934 set d_setpwent_r_proto setpwent_r $hdrs
17938 case "$d_setpwent_r_proto" in
17940 case "$setpwent_r_proto" in
17941 ''|0) try='int setpwent_r(FILE**);'
17942 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17944 case "$setpwent_r_proto" in
17945 ''|0) try='void setpwent_r(FILE**);'
17946 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17948 case "$setpwent_r_proto" in
17949 ''|0) d_setpwent_r=undef
17951 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17952 * ) case "$setpwent_r_proto" in
17953 REENTRANT_PROTO*) ;;
17954 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17956 echo "Prototype: $try" ;;
17959 *) case "$usethreads" in
17960 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17967 *) setpwent_r_proto=0
17971 : see if setregid exists
17972 set setregid d_setregid
17974 set setresgid d_setresgid
17977 : see if setreuid exists
17978 set setreuid d_setreuid
17980 set setresuid d_setresuid
17983 : see if setrgid exists
17984 set setrgid d_setrgid
17987 : see if setruid exists
17988 set setruid d_setruid
17991 : see if setservent exists
17992 set setservent d_setsent
17995 : see if setservent_r exists
17996 set setservent_r d_setservent_r
17998 case "$d_setservent_r" in
18000 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18001 case "$d_setservent_r_proto:$usethreads" in
18002 ":define") d_setservent_r_proto=define
18003 set d_setservent_r_proto setservent_r $hdrs
18007 case "$d_setservent_r_proto" in
18009 case "$setservent_r_proto" in
18010 ''|0) try='int setservent_r(int, struct servent_data*);'
18011 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18013 case "$setservent_r_proto" in
18014 ''|0) try='void setservent_r(int, struct servent_data*);'
18015 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18017 case "$setservent_r_proto" in
18018 ''|0) d_setservent_r=undef
18019 setservent_r_proto=0
18020 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18021 * ) case "$setservent_r_proto" in
18022 REENTRANT_PROTO*) ;;
18023 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18025 echo "Prototype: $try" ;;
18028 *) case "$usethreads" in
18029 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18031 d_setservent_r=undef
18032 setservent_r_proto=0
18036 *) setservent_r_proto=0
18040 : see if setsid exists
18041 set setsid d_setsid
18044 : see if setvbuf exists
18045 set setvbuf d_setvbuf
18048 : see if shmctl exists
18049 set shmctl d_shmctl
18052 : see if shmget exists
18053 set shmget d_shmget
18056 : see if shmat exists
18059 : see what shmat returns
18062 $cat >shmat.c <<'END'
18063 #include <sys/shm.h>
18066 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18071 echo "and it returns ($shmattype)." >&4
18072 : see if a prototype for shmat is available
18073 xxx=`./findhdr sys/shm.h`
18074 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18075 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18086 set d_shmatprototype
18089 : see if shmdt exists
18093 : see how much of the 'shm*(2)' library is present.
18096 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18097 *"$undef"*) h_shm=false;;
18101 case "`ipcs 2>&1`" in
18102 "SVID shared memory"*"not configured"*)
18103 echo "Your $osname does not have the shm*(2) configured." >&4
18106 set shmctl d_shmctl
18108 set shmget d_shmget
18118 : we could also check for sys/ipc.h ...
18119 if $h_shm && $test `./findhdr sys/shm.h`; then
18120 echo "You have the full shm*(2) library." >&4
18123 echo "You don't have the full shm*(2) library." >&4
18129 : see if we have sigaction
18131 if set sigaction val -f d_sigaction; eval $csym; $val; then
18132 echo 'sigaction() found.' >&4
18135 #include <sys/types.h>
18136 #include <signal.h>
18137 #$i_stdlib I_STDLIB
18139 #include <stdlib.h>
18143 struct sigaction act, oact;
18145 oact.sa_handler = 0;
18146 /* so that act and oact are used */
18147 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18151 if eval $compile_ok; then
18154 echo "But you don't seem to have a usable struct sigaction." >&4
18158 echo 'sigaction NOT found.' >&4
18161 set d_sigaction; eval $setvar
18164 : see what type pids are declared as in the kernel
18165 rp="What is the type of process ids on this system?"
18166 set pid_t pidtype int stdio.h sys/types.h
18169 : see what type uids are declared as in the kernel
18171 echo "Looking for the type for user ids returned by getuid()."
18172 set uid_t uidtype xxx stdio.h sys/types.h
18176 xxx=`./findhdr sys/user.h`
18177 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18179 unsigned) dflt="$1 $2" ;;
18183 *) dflt="$uidtype";;
18186 uid_t) echo "uid_t found." ;;
18187 *) rp="What is the type for user ids returned by getuid()?"
18193 : Define hasfield_t macro for Configure internal use
18194 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18195 while $test $# -ge 2; do
18197 $define) echo "#include <$2>";;
18201 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18203 if eval $compile; then
18212 : see what siginfo fields we have
18213 case "$d_sigaction" in
18215 echo "Checking if your siginfo_t has si_errno field...">&4
18216 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18219 echo "Checking if your siginfo_t has si_pid field...">&4
18220 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18223 echo "Checking if your siginfo_t has si_uid field...">&4
18224 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18227 echo "Checking if your siginfo_t has si_addr field...">&4
18228 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18231 echo "Checking if your siginfo_t has si_status field...">&4
18232 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18235 echo "Checking if your siginfo_t has si_band field...">&4
18236 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18239 echo "Checking if your siginfo_t has si_value field...">&4
18240 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18243 echo "Checking if your siginfo_t has si_fd field...">&4
18244 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18249 d_siginfo_si_errno="$undef"
18250 d_siginfo_si_pid="$undef"
18251 d_siginfo_si_uid="$undef"
18252 d_siginfo_si_addr="$undef"
18253 d_siginfo_si_status="$undef"
18254 d_siginfo_si_band="$undef"
18255 d_siginfo_si_value="$undef"
18256 d_siginfo_si_fd="$undef"
18260 : see if this is a sunmath.h system
18261 set sunmath.h i_sunmath
18264 : see if signbit exists
18265 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18267 #$i_sunmath I_SUNMATH
18269 #ifdef I_SUNMATH /* Solaris special math library */
18270 # include <sunmath.h>
18273 int main(int argc, char **argv)
18277 if ((signbit(x) == 0) && (signbit(y) != 0))
18285 if eval $compile; then
18286 if $run ./try; then
18290 $echo "Signbit seems to be available, but doesn't work as I expected."
18291 $echo "I won't use it." >&4
18302 : see if sigprocmask exists
18303 set sigprocmask d_sigprocmask
18306 : see if sigsetjmp exists
18308 case "$d_sigsetjmp" in
18311 #include <setjmp.h>
18312 #$i_stdlib I_STDLIB
18314 #include <stdlib.h>
18320 if (sigsetjmp(env,1))
18323 siglongjmp(env, 1);
18328 if eval $compile; then
18329 if $run ./try >/dev/null 2>&1; then
18330 echo "POSIX sigsetjmp found." >&4
18334 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18340 echo "sigsetjmp not found." >&4
18344 *) val="$d_sigsetjmp"
18345 case "$d_sigsetjmp" in
18346 $define) echo "POSIX sigsetjmp found." >&4;;
18347 $undef) echo "sigsetjmp not found." >&4;;
18355 : see if snprintf exists
18356 set snprintf d_snprintf
18359 : see if vsnprintf exists
18360 set vsnprintf d_vsnprintf
18363 case "$d_snprintf-$d_vsnprintf" in
18366 Checking whether your snprintf() and vsnprintf() work okay...
18368 $cat >try.c <<'EOCP'
18369 /* v?snprintf testing logic courtesy of Russ Allbery.
18370 * According to C99:
18371 * - if the buffer is too short it still must be \0-terminated
18372 * - if the buffer is too short the potentially required length
18373 * must be returned and not -1
18374 * - if the buffer is NULL the potentially required length
18375 * must be returned and not -1 or core dump
18378 #include <stdarg.h>
18382 int test (char *format, ...)
18387 va_start (args, format);
18388 count = vsnprintf (buf, sizeof buf, format, args);
18395 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18396 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18400 if eval $compile; then
18403 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18405 Your snprintf() and snprintf() don't seem to be working okay.
18407 d_snprintf="$undef"
18408 d_vsnprintf="$undef"
18412 echo "(I can't seem to compile the test program--assuming they don't)"
18413 d_snprintf="$undef"
18414 d_vsnprintf="$undef"
18420 : see if sockatmark exists
18421 set sockatmark d_sockatmark
18424 : see if prototype for sockatmark is available
18426 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18429 : see if socks5_init exists
18430 set socks5_init d_socks5_init
18433 : see if srand48_r exists
18434 set srand48_r d_srand48_r
18436 case "$d_srand48_r" in
18438 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18439 case "$d_srand48_r_proto:$usethreads" in
18440 ":define") d_srand48_r_proto=define
18441 set d_srand48_r_proto srand48_r $hdrs
18445 case "$d_srand48_r_proto" in
18447 case "$srand48_r_proto" in
18448 ''|0) try='int srand48_r(long, struct drand48_data*);'
18449 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18451 case "$srand48_r_proto" in
18452 ''|0) d_srand48_r=undef
18454 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18455 * ) case "$srand48_r_proto" in
18456 REENTRANT_PROTO*) ;;
18457 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18459 echo "Prototype: $try" ;;
18462 *) case "$usethreads" in
18463 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18470 *) srand48_r_proto=0
18474 : see if srandom_r exists
18475 set srandom_r d_srandom_r
18477 case "$d_srandom_r" in
18479 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18480 case "$d_srandom_r_proto:$usethreads" in
18481 ":define") d_srandom_r_proto=define
18482 set d_srandom_r_proto srandom_r $hdrs
18486 case "$d_srandom_r_proto" in
18488 case "$srandom_r_proto" in
18489 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18490 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18492 case "$srandom_r_proto" in
18493 ''|0) d_srandom_r=undef
18495 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18496 * ) case "$srandom_r_proto" in
18497 REENTRANT_PROTO*) ;;
18498 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18500 echo "Prototype: $try" ;;
18503 *) case "$usethreads" in
18504 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18511 *) srandom_r_proto=0
18515 : see if prototype for setresgid is available
18517 set d_sresgproto setresgid $i_unistd unistd.h
18520 : see if prototype for setresuid is available
18522 set d_sresuproto setresuid $i_unistd unistd.h
18525 : see if stat exists
18529 : see if sys/stat.h is available
18530 set sys/stat.h i_sysstat
18533 : see if stat knows about block sizes
18535 echo "Checking to see if your struct stat has st_blocks field..." >&4
18536 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18539 : see if this is a sys/vfs.h system
18540 set sys/vfs.h i_sysvfs
18543 : see if this is a sys/statfs.h system
18544 set sys/statfs.h i_sysstatfs
18547 : Check for statfs_s
18549 echo "Checking to see if your system supports struct statfs..." >&4
18550 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
18552 case "$d_statfs_s" in
18553 "$define") echo "Yes, it does." ;;
18554 *) echo "No, it doesn't." ;;
18558 : see if struct statfs knows about f_flags
18559 case "$d_statfs_s" in
18562 echo "Checking to see if your struct statfs has f_flags field..." >&4
18563 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
18567 set d_statfs_f_flags
18571 case "$d_statfs_f_flags" in
18572 "$define") echo "Yes, it does." ;;
18573 *) echo "No, it doesn't." ;;
18576 : see what flavor, if any, of static inline is supported
18578 echo "Checking to see if your system supports static inline..."
18579 $cat > try.c <<'EOCP'
18580 #include <stdlib.h>
18581 extern int f_via_a(int x);
18582 extern int f_via_b(int x);
18583 int main(int argc, char **argv)
18592 return EXIT_SUCCESS;
18595 return EXIT_FAILURE;
18599 $cat > a.c <<'EOCP'
18600 static INLINE int f(int x) {
18611 $cat > b.c <<'EOCP'
18612 extern int f(int x);
18620 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18621 case "$perl_static_inline" in
18622 '') # Check the various possibilities, and break out on success.
18623 # For gcc, prefer __inline__, which will still permit
18624 # cflags.SH to add in -ansi.
18625 case "$gccversion" in
18626 '') xxx="inline __inline__ __inline _inline";;
18627 *) xxx="__inline__ inline __inline _inline";;
18629 for inline in $xxx; do
18630 set try -DINLINE=$inline a.c
18631 if eval $compile && $run ./try; then
18632 # Now make sure there is no external linkage of static
18634 set try -DINLINE=$inline -DUSE_B a.c b.c
18635 if eval $compile && $run ./try; then
18636 $echo "Your compiler supports static $inline, " >&4
18637 $echo "but it also creates an external definition," >&4
18638 $echo "so I won't use it." >&4
18641 $echo "Your compiler supports static $inline." >&4
18643 perl_static_inline="static $inline";
18647 $echo "Your compiler does NOT support static $inline." >&4
18652 *inline*) # Some variant of inline exists.
18653 echo "Keeping your $hint value of $perl_static_inline."
18656 static) # No inline capabilities
18657 echo "Keeping your $hint value of $perl_static_inline."
18660 *) # Unrecognized previous value -- blindly trust the supplied
18661 # value and hope it makes sense. Use old value for
18662 # d_static_inline, if there is one.
18663 echo "Keeping your $hint value of $perl_static_inline."
18664 case "$d_static_inline" in
18666 *) val=$d_static_inline ;;
18670 # Fallback to plain 'static' if nothing worked.
18671 case "$perl_static_inline" in
18673 perl_static_inline="static"
18677 set d_static_inline
18679 $rm -f a.[co] b.[co]
18682 : Check stream access
18684 Checking how to access stdio streams by file descriptor number...
18686 case "$stdio_stream_array" in
18687 '') $cat >try.c <<EOCP
18690 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18694 for s in _iob __iob __sF
18696 set try -DSTDIO_STREAM_ARRAY=$s
18697 if eval $compile; then
18698 case "`$run ./try`" in
18699 yes) stdio_stream_array=$s; break ;;
18705 case "$stdio_stream_array" in
18707 I can't figure out how to access stdio streams by file descriptor number.
18709 d_stdio_stream_array="$undef"
18712 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18714 d_stdio_stream_array="$define"
18718 : see if strcoll exists
18719 set strcoll d_strcoll
18722 : see if strerror_l exists
18723 set strerror_l d_strerror_l
18726 : see if strerror_r exists
18727 set strerror_r d_strerror_r
18729 case "$d_strerror_r" in
18731 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18732 case "$d_strerror_r_proto:$usethreads" in
18733 ":define") d_strerror_r_proto=define
18734 set d_strerror_r_proto strerror_r $hdrs
18738 case "$d_strerror_r_proto" in
18740 case "$strerror_r_proto" in
18741 ''|0) try='int strerror_r(int, char*, size_t);'
18742 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18744 case "$strerror_r_proto" in
18745 ''|0) try='int strerror_r(int, char*, int);'
18746 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18748 case "$strerror_r_proto" in
18749 ''|0) try='char* strerror_r(int, char*, size_t);'
18750 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18752 case "$strerror_r_proto" in
18753 ''|0) d_strerror_r=undef
18755 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18756 * ) case "$strerror_r_proto" in
18757 REENTRANT_PROTO*) ;;
18758 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18760 echo "Prototype: $try" ;;
18763 *) case "$usethreads" in
18764 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18771 *) strerror_r_proto=0
18775 : see if strftime exists
18776 set strftime d_strftime
18779 : see if strlcat exists
18780 set strlcat d_strlcat
18783 : see if strlcpy exists
18784 set strlcpy d_strlcpy
18787 : see if strnlen exists
18788 set strnlen d_strnlen
18791 : see if strtod exists
18792 set strtod d_strtod
18795 : see if strtol exists
18796 set strtol d_strtol
18799 : see if strtold exists
18800 set strtold d_strtold
18803 : see if strtold_l exists
18804 set strtold_l d_strtold_l
18807 : see if strtoll exists
18808 set strtoll d_strtoll
18811 case "$d_longlong-$d_strtoll" in
18814 Checking whether your strtoll() works okay...
18816 $cat >try.c <<'EOCP'
18819 #define strtoll __strtoll
18822 #define strtoll _strtoll
18825 extern long long int strtoll(char *s, char **, int);
18826 static int bad = 0;
18827 int check(char *s, long long ell, int een) {
18830 gll = strtoll(s, 0, 10);
18831 if (!((gll == ell) && (errno == een)))
18835 check(" 1", 1LL, 0);
18836 check(" 0", 0LL, 0);
18837 check("-1", -1LL, 0);
18838 check("-9223372036854775808", -9223372036854775808LL, 0);
18839 check("-9223372036854775808", -9223372036854775808LL, 0);
18840 check(" 9223372036854775807", 9223372036854775807LL, 0);
18841 check("-9223372036854775808", -9223372036854775808LL, 0);
18842 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18843 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18849 if eval $compile; then
18852 ok) echo "Your strtoll() seems to be working okay." ;;
18854 Your strtoll() doesn't seem to be working okay.
18860 echo "(I can't seem to compile the test program--assuming it doesn't)"
18866 : see if strtoq exists
18867 set strtoq d_strtoq
18870 : see if strtoul exists
18871 set strtoul d_strtoul
18874 case "$d_strtoul" in
18877 Checking whether your strtoul() works okay...
18879 $cat >try.c <<'EOCP'
18882 extern unsigned long int strtoul(char *s, char **, int);
18883 static int bad = 0;
18884 void check(char *s, unsigned long eul, int een) {
18887 gul = strtoul(s, 0, 10);
18888 if (!((gul == eul) && (errno == een)))
18892 check(" 1", 1L, 0);
18893 check(" 0", 0L, 0);
18895 case "$longsize" in
18897 $cat >>try.c <<'EOCP'
18898 check("18446744073709551615", 18446744073709551615UL, 0);
18899 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18900 #if 0 /* strtoul() for /^-/ strings is undefined. */
18901 check("-1", 18446744073709551615UL, 0);
18902 check("-18446744073709551614", 2, 0);
18903 check("-18446744073709551615", 1, 0);
18904 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18905 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18910 $cat >>try.c <<'EOCP'
18911 check("4294967295", 4294967295UL, 0);
18912 check("4294967296", 4294967295UL, ERANGE);
18913 #if 0 /* strtoul() for /^-/ strings is undefined. */
18914 check("-1", 4294967295UL, 0);
18915 check("-4294967294", 2, 0);
18916 check("-4294967295", 1, 0);
18917 check("-4294967296", 4294967295UL, ERANGE);
18918 check("-4294967297", 4294967295UL, ERANGE);
18923 : Should we write these tests to be more portable by sprintf-ing
18924 : ~0 and then manipulating that char string as input for strtol?
18927 $cat >>try.c <<'EOCP'
18934 if eval $compile; then
18935 case "`$run ./try`" in
18936 ok) echo "Your strtoul() seems to be working okay." ;;
18938 Your strtoul() doesn't seem to be working okay.
18944 echo "(I can't seem to compile the test program--assuming it doesn't)"
18950 : see if strtoull exists
18951 set strtoull d_strtoull
18954 case "$d_longlong-$d_strtoull" in
18957 Checking whether your strtoull() works okay...
18959 $cat >try.c <<'EOCP'
18962 #define strtoull __strtoull
18965 extern unsigned long long int strtoull(char *s, char **, int);
18966 static int bad = 0;
18967 int check(char *s, long long eull, int een) {
18970 gull = strtoull(s, 0, 10);
18971 if (!((gull == eull) && (errno == een)))
18975 check(" 1", 1LL, 0);
18976 check(" 0", 0LL, 0);
18977 check("18446744073709551615", 18446744073709551615ULL, 0);
18978 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18979 #if 0 /* strtoull() for /^-/ strings is undefined. */
18980 check("-1", 18446744073709551615ULL, 0);
18981 check("-18446744073709551614", 2LL, 0);
18982 check("-18446744073709551615", 1LL, 0);
18983 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18984 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18991 if eval $compile; then
18992 case "`$run ./try`" in
18993 ok) echo "Your strtoull() seems to be working okay." ;;
18995 Your strtoull() doesn't seem to be working okay.
18997 d_strtoull="$undef"
19001 echo "(I can't seem to compile the test program--assuming it doesn't)"
19002 d_strtoull="$undef"
19007 : see if strtouq exists
19008 set strtouq d_strtouq
19011 case "$d_strtouq" in
19014 Checking whether your strtouq() works okay...
19016 $cat >try.c <<'EOCP'
19019 extern unsigned long long int strtouq(char *s, char **, int);
19020 static int bad = 0;
19021 void check(char *s, unsigned long long eull, int een) {
19022 unsigned long long gull;
19024 gull = strtouq(s, 0, 10);
19025 if (!((gull == eull) && (errno == een)))
19029 check(" 1", 1LL, 0);
19030 check(" 0", 0LL, 0);
19031 check("18446744073709551615", 18446744073709551615ULL, 0);
19032 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19033 #if 0 /* strtouq() for /^-/ strings is undefined. */
19034 check("-1", 18446744073709551615ULL, 0);
19035 check("-18446744073709551614", 2LL, 0);
19036 check("-18446744073709551615", 1LL, 0);
19037 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19038 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19046 if eval $compile; then
19047 case "`$run ./try`" in
19048 ok) echo "Your strtouq() seems to be working okay." ;;
19050 Your strtouq() doesn't seem to be working okay.
19056 echo "(I can't seem to compile the test program--assuming it doesn't)"
19062 : see if strxfrm exists
19063 set strxfrm d_strxfrm
19066 : see if symlink exists
19067 set symlink d_symlink
19070 : see if syscall exists
19071 set syscall d_syscall
19074 : see if prototype for syscall is available
19076 set d_syscallproto syscall $i_unistd unistd.h
19079 : see if sysconf exists
19080 set sysconf d_sysconf
19083 : see if sys_errlist[] exists
19085 if test "X$d_syserrlst" = X; then
19086 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19087 echo "You have sys_errlist[], so we could roll our own strerror."
19088 d_syserrlst="$define"
19090 echo "You don't have sys_errlist[], so strerror() is welcome."
19091 d_syserrlst="$undef"
19095 : see if system exists
19096 set system d_system
19099 : see if tcgetpgrp exists
19100 set tcgetpgrp d_tcgetpgrp
19103 : see if tcsetpgrp exists
19104 set tcsetpgrp d_tcsetpgrp
19107 : see if prototype for telldir is available
19109 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19112 : see if tgamma exists
19113 set tgamma d_tgamma
19116 : check for thread_safe_nl_langinfo_l item
19119 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19122 #$i_stdlib I_STDLIB
19124 # include <stdlib.h>
19126 #include <string.h>
19127 #$i_langinfo I_LANGINFO
19129 # include <langinfo.h>
19131 #$i_pthread I_PTHREAD
19133 # include <pthread.h>
19135 #$i_locale I_LOCALE
19137 # include <locale.h>
19141 thread_start(void * arg)
19143 nl_langinfo(RADIXCHAR);
19147 char * main_buffer;
19148 char save_main_buffer[1000];
19149 pthread_t subthread;
19150 pthread_attr_t attr;
19152 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19154 /* If too large for our generous allowance, just assume we don't have
19156 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19160 strcpy(save_main_buffer, main_buffer);
19162 if (pthread_attr_init(&attr) != 0) {
19166 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19170 if (pthread_join(subthread, NULL) != 0) {
19174 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19177 case "$usethreads" in
19180 if eval $compile; then
19181 echo "Your system has nl_langinfo_l()..." >&4
19182 if $run ./try; then
19183 echo "and it is thread-safe (just as I'd hoped)." >&4
19184 d_thread_safe_nl_langinfo_l="$define"
19185 echo "$d_thread_safe_nl_langinfo_l" >&4
19187 echo "but it isn't thread-safe, so we won't use it." >&4
19190 echo "your system does not have nl_langinfo_l()" >&4
19193 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19195 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19196 d_thread_safe_nl_langinfo_l="$undef"
19200 : see if time exists
19202 if test "X$d_time" = X -o X"$timetype" = X; then
19203 if set time val -f d_time; eval $csym; $val; then
19204 echo 'time() found.' >&4
19206 rp="What is the type returned by time() on this system?"
19207 set time_t timetype long stdio.h sys/types.h
19210 echo 'time() not found, hope that will do.' >&4
19218 : see if timegm exists
19219 set timegm d_timegm
19222 : see if this is a sys/times.h system
19223 set sys/times.h i_systimes
19226 : see if times exists
19228 if set times val -f d_times; eval $csym; $val; then
19229 echo 'times() found.' >&4
19232 case "$i_systimes" in
19233 "$define") inc='sys/times.h';;
19235 rp="What is the type returned by times() on this system?"
19236 set clock_t clocktype long stdio.h sys/types.h $inc
19239 echo 'times() NOT found, hope that will do.' >&4
19244 : see if tmpnam_r exists
19245 set tmpnam_r d_tmpnam_r
19247 case "$d_tmpnam_r" in
19249 hdrs="$i_systypes sys/types.h define stdio.h "
19250 case "$d_tmpnam_r_proto:$usethreads" in
19251 ":define") d_tmpnam_r_proto=define
19252 set d_tmpnam_r_proto tmpnam_r $hdrs
19256 case "$d_tmpnam_r_proto" in
19258 case "$tmpnam_r_proto" in
19259 ''|0) try='char* tmpnam_r(char*);'
19260 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19262 case "$tmpnam_r_proto" in
19263 ''|0) d_tmpnam_r=undef
19265 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19266 * ) case "$tmpnam_r_proto" in
19267 REENTRANT_PROTO*) ;;
19268 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19270 echo "Prototype: $try" ;;
19273 *) case "$usethreads" in
19274 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19281 *) tmpnam_r_proto=0
19285 : see if trunc exists
19289 : see if truncate exists
19290 set truncate d_truncate
19293 : see if ttyname_r exists
19294 set ttyname_r d_ttyname_r
19296 case "$d_ttyname_r" in
19298 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19299 case "$d_ttyname_r_proto:$usethreads" in
19300 ":define") d_ttyname_r_proto=define
19301 set d_ttyname_r_proto ttyname_r $hdrs
19305 case "$d_ttyname_r_proto" in
19307 case "$ttyname_r_proto" in
19308 ''|0) try='int ttyname_r(int, char*, size_t);'
19309 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19311 case "$ttyname_r_proto" in
19312 ''|0) try='int ttyname_r(int, char*, int);'
19313 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19315 case "$ttyname_r_proto" in
19316 ''|0) try='char* ttyname_r(int, char*, int);'
19317 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19319 case "$ttyname_r_proto" in
19320 ''|0) d_ttyname_r=undef
19322 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19323 * ) case "$ttyname_r_proto" in
19324 REENTRANT_PROTO*) ;;
19325 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19327 echo "Prototype: $try" ;;
19330 *) case "$usethreads" in
19331 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19338 *) ttyname_r_proto=0
19342 : see if tzname[] exists
19344 if set tzname val -a d_tzname; eval $csym; $val; then
19346 echo 'tzname[] found.' >&4
19349 echo 'tzname[] NOT found.' >&4
19354 : Check if is a multiplatform env
19356 darwin) multiarch="$define" ;;
19358 case "$multiarch" in
19359 ''|[nN]*) multiarch="$undef" ;;
19362 : check for ordering of bytes in a UV
19364 case "$multiarch" in
19367 You seem to be doing a multiarchitecture build,
19368 skipping the byteorder check.
19374 case "$byteorder" in
19377 In the following, larger digits indicate more significance. A big-endian
19378 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19379 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19380 machines may have weird orders like 3412. A Cray will report 87654321,
19381 an Alpha will report 12345678. If the test program works the default is
19383 I'm now running the test program...
19387 #$i_stdlib I_STDLIB
19389 #include <stdlib.h>
19391 #include <sys/types.h>
19392 typedef $uvtype UV;
19402 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19404 u.l = (UV)0x04030201;
19405 for (i = 0; i < $uvsize; i++)
19406 printf("%c", u.c[i]+'0');
19413 if eval $compile && $run ./try > /dev/null; then
19416 [1-4][1-4][1-4][1-4]|12345678|87654321)
19417 echo "(The test program ran ok.)"
19418 echo "byteorder=$dflt"
19421 ????|????????) echo "(The test program ran ok.)" ;;
19422 *) echo "(The test program didn't run right for some reason.)" ;;
19427 (I can't seem to compile the test program. Guessing big-endian...)
19430 case "$xxx_prompt" in
19432 rp="What is the order of bytes in $uvtype?"
19445 : Checking 32bit alignedness
19448 Checking to see whether you can access character data unalignedly...
19450 case "$d_u32align" in
19451 '') $cat >try.c <<EOCP
19453 #$i_stdlib I_STDLIB
19455 #include <stdlib.h>
19457 #define U32 $u32type
19458 #define BYTEORDER 0x$byteorder
19460 #include <signal.h>
19462 $signal_t bletch(int s) { exit(4); }
19465 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19466 volatile U8 buf[8];
19470 if (sizeof(U32) != 4) {
19471 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19478 signal(SIGBUS, bletch);
19490 for (i = 0; i < 4; i++) {
19491 up = (U32*)(buf + i);
19492 if (! ((*up == 1 << (8*i)) || /* big-endian */
19493 (*up == 1 << (8*(3-i))) /* little-endian */
19497 printf("read failed (%x)\n", *up);
19503 for (i = 0; i < 4; i++) {
19504 up = (U32*)(buf + i);
19506 if (*up != 0xBeef) {
19507 printf("write failed (%x)\n", *up);
19521 if eval $compile_ok; then
19522 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19523 $run ./try 2>&1 >/dev/null
19526 You can access character data pretty unalignedly.
19528 d_u32align="$undef"
19531 It seems that you must access character data in an aligned manner.
19533 d_u32align="$define"
19537 rp='Can you access character data at unaligned addresses?'
19541 [yY]*) d_u32align="$undef" ;;
19542 *) d_u32align="$define" ;;
19549 : see if ualarm exists
19550 set ualarm d_ualarm
19553 : see if umask exists
19557 : see if unordered exists
19558 set unordered d_unordered
19561 : see if unsetenv exists
19562 set unsetenv d_unsetenv
19565 : see if usleep exists
19566 set usleep d_usleep
19569 : see if prototype for usleep is available
19571 set d_usleepproto usleep $i_unistd unistd.h
19574 : see if ustat exists
19578 : see if closedir exists
19579 set closedir d_closedir
19582 case "$d_closedir" in
19585 echo "Checking whether closedir() returns a status..." >&4
19587 #$i_dirent I_DIRENT /**/
19588 #$i_sysdir I_SYS_DIR /**/
19589 #$i_sysndir I_SYS_NDIR /**/
19590 #$i_systypes I_SYS_TYPES /**/
19592 #if defined(I_SYS_TYPES)
19593 #include <sys/types.h>
19595 #if defined(I_DIRENT)
19596 #include <dirent.h>
19599 #include <sys/ndir.h>
19602 #include <sys/dir.h>
19606 int main() { return closedir(opendir(".")); }
19609 if eval $compile_ok; then
19610 if $run ./try > /dev/null 2>&1 ; then
19611 echo "Yes, it does."
19614 echo "No, it doesn't."
19618 echo "(I can't seem to compile the test program--assuming it doesn't)"
19626 set d_void_closedir
19630 : see if there is a wait4
19634 : see if waitpid exists
19635 set waitpid d_waitpid
19640 $cat >try.c <<'EOCP'
19646 return (wcscmp (s, s) ? 1 : 0);
19651 if eval $compile; then
19654 0) echo "A working wcscmp() found." >&4
19656 *) echo "wcscmp() found, but it doesn't work" >&4
19660 echo "wcscmp() NOT found." >&4
19666 : see if wcstombs exists
19667 set wcstombs d_wcstombs
19672 $cat >try.c <<'EOCP'
19677 wchar_t dst[4], *src = L" ";
19679 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19684 if eval $compile; then
19687 0) echo "A working wcsxfrm() found." >&4
19689 *) echo "wcsxfrm() found, but it doesn't work" >&4
19693 echo "wcsxfrm() NOT found." >&4
19699 : see if wctomb exists
19700 set wctomb d_wctomb
19703 : see if writev exists
19704 set writev d_writev
19707 : check for alignment requirements
19709 case "$alignbytes" in
19710 '') echo "Checking alignment constraints..." >&4
19719 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19724 if eval $compile_ok; then
19728 echo "(I can't seem to compile the test program...)"
19730 case "$multiarch" in
19732 : The usual safe value is 8, but Darwin with -Duselongdouble
19733 : needs 16. Hence, we will take 8 as a minimum, but allow
19734 : Configure to pick a larger value if needed.
19735 if $test "$dflt" -lt 8; then
19737 echo "Setting alignment to 8 for multiarch support.">&4
19742 *) dflt="$alignbytes"
19745 rp="Doubles must be aligned on a how-many-byte boundary?"
19750 : set the base revision
19753 : length of character in bytes. Is always 1, otherwise it is not C
19754 : This used to be a test using sizeof
19757 : Check for the number of bits in a character
19758 case "$charbits" in
19759 '') echo "Checking how long a character is (in bits)..." >&4
19766 for (c = 1, n = 0; c; c <<= 1, n++) ;
19767 printf ("%d\n", n);
19772 if eval $compile_ok; then
19776 echo "(I can't seem to compile the test program. Guessing...)"
19783 rp="What is the length of a character (in bits)?"
19787 case "$charbits" in
19790 Your system has an unsigned character size of $charbits bits, which
19791 is rather unusual (normally it is 8 bits). Perl likely will not work
19792 correctly on your system, with subtle bugs in various places.
19794 rp='Do you really want to continue?'
19798 [yY]) echo >&4 "Okay, continuing." ;;
19803 : how do we concatenate cpp tokens here?
19805 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19806 $cat >cpp_stuff.c <<'EOCP'
19807 #define RCAT(a,b)a/**/b
19808 #define ACAT(a,b)a ## b
19812 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19813 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19814 echo "Oh! Smells like ANSI's been here." >&4
19815 echo "We can catify or stringify, separately or together!"
19817 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19818 echo "Ah, yes! The good old days!" >&4
19819 echo "However, in the good old days we don't know how to stringify and"
19820 echo "catify at the same time."
19824 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19825 You're going to have to edit the values of CAT[2-5] in config.h...
19827 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19831 : see if this is a db.h system
19837 : Check db version.
19839 echo "Checking Berkeley DB version ..." >&4
19845 #include <sys/types.h>
19847 #$i_stdlib I_STDLIB
19849 #include <stdlib.h>
19852 int main(int argc, char *argv[])
19854 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19855 int Major, Minor, Patch ;
19856 unsigned long Version ;
19857 (void)db_version(&Major, &Minor, &Patch) ;
19859 printf("%d %d %d %d %d %d\n",
19860 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19861 Major, Minor, Patch);
19864 printf("You have Berkeley DB Version 2 or greater.\n");
19866 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19867 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19868 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19869 Major, Minor, Patch) ;
19871 /* check that db.h & libdb are compatible */
19872 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19873 printf("db.h and libdb are incompatible.\n") ;
19877 printf("db.h and libdb are compatible.\n") ;
19879 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19880 + DB_VERSION_PATCH ;
19882 /* needs to be >= 2.3.4 */
19883 if (Version < 2003004) {
19884 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19885 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19891 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19896 printf("You have Berkeley DB Version 1.\n");
19897 exit(0); /* DB version < 2: the coast is clear. */
19899 exit(1); /* <db.h> not Berkeley DB? */
19905 if eval $compile_ok && $run ./try; then
19906 echo 'Looks OK.' >&4
19908 db_version_major=$1
19909 db_version_minor=$2
19910 db_version_patch=$3
19912 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19916 : Remove db from list of libraries to use
19917 echo "Removing unusable -ldb from library list" >&4
19918 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19921 echo "libs = $libs" >&4
19931 : Check the return type needed for hash
19933 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19939 #include <sys/types.h>
19942 #ifndef DB_VERSION_MAJOR
19943 u_int32_t hash_cb (const void* ptr, size_t size)
19949 info.hash = hash_cb;
19953 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19954 if $contains warning try.out >>/dev/null 2>&1 ; then
19957 db_hashtype='u_int32_t'
19960 : XXX Maybe we should just give up here.
19961 db_hashtype=u_int32_t
19963 echo "Help: I can't seem to compile the db test program." >&4
19964 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19967 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19969 *) db_hashtype=u_int32_t
19974 : Check the return type needed for prefix
19976 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19982 #include <sys/types.h>
19985 #ifndef DB_VERSION_MAJOR
19986 size_t prefix_cb (const DBT *key1, const DBT *key2)
19992 info.prefix = prefix_cb;
19996 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19997 if $contains warning try.out >>/dev/null 2>&1 ; then
19998 db_prefixtype='int'
20000 db_prefixtype='size_t'
20003 db_prefixtype='size_t'
20004 : XXX Maybe we should just give up here.
20006 echo "Help: I can't seem to compile the db test program." >&4
20007 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20010 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20012 *) db_prefixtype='size_t'
20016 : Include . in @INC
20019 Historically Perl has provided a final fallback of the current working
20020 directory '.' when searching for a library. This, however, can lead to
20021 problems when a Perl program which loads optional modules is called from
20022 a shared directory. This can lead to executing unexpected code.
20026 # When changing to exclude by default:
20027 case "$default_inc_excludes_dot" in
20028 $undef|false|[nN]*) dflt="n" ;;
20031 # To turn exclude off by default:
20032 #case "$default_inc_excludes_dot" in
20033 # $define|true|[yY]*) dflt="y" ;;
20037 rp='Exclude '.' from @INC by default? '
20040 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20041 *) default_inc_excludes_dot="$define" ;;
20044 : Check what kind of inf/nan your system has
20045 $echo "Checking the kind of infinities and nans you have..." >&4
20046 $echo "(The following tests may crash. That's okay.)" >&4
20048 #define DOUBLESIZE $doublesize
20049 #$d_longdbl HAS_LONG_DOUBLE
20050 #ifdef HAS_LONG_DOUBLE
20051 #define LONG_DOUBLESIZE $longdblsize
20052 #define LONG_DOUBLEKIND $longdblkind
20055 #include <string.h>
20057 /* Note that whether the sign bit is on or off
20058 * for NaN depends on the CPU/FPU, and possibly
20059 * can be affected by the build toolchain.
20061 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20062 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20063 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20064 * (respectively) as opposed to the more usual
20065 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20067 * Pre-IEEE-754 floating point format do not even have inf/nan support
20068 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20069 * to even mention, causing immediate SIGFPE or equivalent: this is
20070 * the case with VAX floating point, for example.
20072 static void bytes(void *v, unsigned int n) {
20073 unsigned char *p = (unsigned char *)v;
20075 for (i = 0; i < n; i++) {
20076 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20079 int main(int argc, char *argv[]) {
20080 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20081 * because some compilers are 'smart' and not only warn but refuse to
20082 * compile such 'illegal' values. */
20083 double dinf = exp(1e9);
20084 double dnan = sqrt(-1.0);
20085 #ifdef HAS_LONG_DOUBLE
20086 long double ldinf = (long double)exp(1e9);
20087 long double ldnan = (long double)sqrt(-1.0);
20088 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20089 /* the 80-bit long doubles might have garbage in their excess bytes */
20090 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20091 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20094 switch (argv[1][0]) {
20095 case '1': bytes(&dinf, sizeof(dinf)); break;
20096 case '2': bytes(&dnan, sizeof(dnan)); break;
20097 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20098 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20106 if eval $compile; then
20107 doubleinfbytes=`$run ./try 1`
20108 doublenanbytes=`$run ./try 2`
20109 case "$d_longdbl" in
20111 longdblinfbytes=`$run ./try 3`
20112 longdblnanbytes=`$run ./try 4`
20116 # Defaults in case the above test program failed.
20117 case "$doublekind" in
20118 1) # IEEE 754 32-bit LE
20119 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20120 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20122 2) # IEEE 754 32-bit BE
20123 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20124 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20126 3) # IEEE 754 64-bit LE
20127 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20128 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20130 4) # IEEE 754 64-bit BE
20131 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20132 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20134 5) # IEEE 754 128-bit LE
20135 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20136 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20138 6) # IEEE 754 128-bit BE
20139 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20140 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20142 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20143 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20144 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20146 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20147 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20148 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20150 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20151 doubleinfbytes=$undef
20152 doublenanbytes=$undef
20155 doubleinfbytes=$undef
20156 doublenanbytes=$undef
20159 case "$longdblkind" in
20160 1) # IEEE 754 128-bit LE
20161 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20162 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20164 2) # IEEE 754 128-bit BE
20165 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20166 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20168 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20169 case "$longdblsize" in
20170 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20171 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20172 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20175 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20176 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20179 longdblinfbytes=$undef
20180 longdblnanbytes=$undef
20184 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20185 case "$longdblsize" in
20186 12) # 32-bit system
20187 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20188 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20190 16) # 64-bit system
20191 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20192 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20195 longdblinfbytes=$undef
20196 longdblnanbytes=$undef
20200 5) # 128-bit LE-LE "double double"
20201 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20202 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20204 6) # 128-bit BE-BE "double double"
20205 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20206 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20208 7) # 128-bit LE-BE "double double"
20209 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20210 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20212 8) # 128-bit BE-LE "double double"
20213 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20214 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20216 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20217 longdblinfbytes=$undef
20218 longdblnanbytes=$undef
20221 longdblinfbytes=$undef
20222 longdblnanbytes=$undef
20226 # In case the program crashed the values are empty, turn them undef.
20227 case "$doubleinfbytes" in
20228 '') doubleinfbytes=$undef ;;
20230 case "$doublenanbytes" in
20231 '') doublenanbytes=$undef ;;
20233 case "$longdblinfbytes" in
20234 '') longdblinfbytes=$undef ;;
20236 case "$longdblnanbytes" in
20237 '') longdblnanbytes=$undef ;;
20241 : Check the length of the double mantissa
20242 $echo "Checking how many mantissa bits your doubles have..." >&4
20244 #$i_sunmath I_SUNMATH
20247 # include <sunmath.h>
20249 #ifdef DBL_MANT_DIG
20250 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20253 int main(int argc, char *argv[]) {
20255 printf("%d\n", BITS);
20261 if eval $compile; then
20262 doublemantbits=`$run ./try`
20264 doublemantbits="$undef"
20268 : Check the length of the longdouble mantissa
20269 $echo "Checking how many mantissa bits your long doubles have..." >&4
20271 #$i_sunmath I_SUNMATH
20274 # include <sunmath.h>
20276 #$d_longdbl HAS_LONG_DOUBLE
20277 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20278 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20279 /* This format has no implicit bit. Beware, however, that for
20280 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20281 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20282 * and the top bit must have been one since 387, zero is plain invalid.
20283 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20284 # define BITS LDBL_MANT_DIG
20285 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20286 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20287 * reason e.g. Irix thinks 107. But in any case, we want only
20288 * the number of real bits, the implicit bits are of no interest. */
20289 # define BITS 2 * (DBL_MANT_DIG - 1)
20291 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20295 int main(int argc, char *argv[]) {
20297 printf("%d\n", BITS);
20303 if eval $compile; then
20304 longdblmantbits=`$run ./try`
20306 longdblmantbits="$undef"
20310 : Check the length of the NV mantissa
20311 $echo "Checking how many mantissa bits your NVs have..." >&4
20312 if test "X$usequadmath" = "X$define"; then
20313 nvmantbits=112 # 128-1-15
20315 if test "X$nvsize" = "X$doublesize"; then
20316 nvmantbits="$doublemantbits"
20318 if test "X$nvsize" = "X$longdblsize"; then
20319 nvmantbits="$longdblmantbits"
20321 nvmantbits="$undef"
20326 : How can we generate normalized random numbers ?
20328 echo "Using our internal random number implementation..." >&4
20331 *-Dmy_rand=*|*-Dmy_srand=*)
20332 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20333 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20334 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20335 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20339 randfunc=Perl_drand48
20340 drand01="Perl_drand48()"
20341 seedfunc="Perl_drand48_init"
20345 : Probe whether dtrace builds an object, as newer Illumos requires an input
20346 : object file that uses at least one of the probes defined in the .d file
20347 case "$usedtrace" in
20349 case "$dtracexnolibs" in
20350 $define|true|[yY]*)
20351 dtracexnolibs=$define
20352 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20355 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20356 dtracexnolibs=$define
20357 echo "Your dtrace accepts -xnolibs"
20358 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20359 dtracexnolibs=$undef
20360 echo "Your dtrace doesn't accept -xnolibs"
20362 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20367 dtracexnolibs=$undef
20368 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20371 case $dtracexnolibs in
20372 $define) xnolibs=-xnolibs ;;
20376 case "$dtraceobject" in
20377 $define|true|[yY]*)
20378 dtraceobject=$define
20382 #include "perldtrace.h"
20384 PERL_LOADED_FILE("dummy");
20388 dtraceobject=$undef
20389 if $cc -c -o try.o $optimize $ccflags try.c \
20390 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20391 dtraceobject=$define
20392 echo "Your dtrace builds an object file"
20395 *) dtraceobject=$undef ;;
20397 $rm_try perldtrace.o perldtrace.h
20400 : Determine if this is an EBCDIC system
20402 echo "Determining whether or not we are on an EBCDIC system..." >&4
20403 $cat >try.c <<'EOM'
20406 if ('M'==0xd4) return 0;
20413 if eval $compile_ok; then
20414 if $run ./try; then
20415 echo "You seem to speak EBCDIC." >&4
20418 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20421 echo "I'm unable to compile the test program." >&4
20422 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20428 : Check how to flush
20431 Checking how to flush all pending stdio output...
20433 # I only know how to find the first 32 possibly open files on SunOS.
20434 # See also hints/sunos_4_1.sh and util.c --AD
20436 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20438 $cat >>try.c <<EOCP
20440 #$i_stdlib I_STDLIB
20442 #include <stdlib.h>
20444 #$i_unistd I_UNISTD
20446 # include <unistd.h>
20448 #$d_sysconf HAS_SYSCONF
20449 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20450 #ifdef HAS_STDIO_STREAM_ARRAY
20451 # define STDIO_STREAM_ARRAY $stdio_stream_array
20456 p = fopen("try.out", "w");
20460 # ifdef TRY_FPRINTF
20464 #ifdef TRY_FFLUSH_NULL
20467 #ifdef TRY_FFLUSH_ALL
20469 long open_max = -1;
20470 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20471 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20473 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20474 open_max = sysconf(_SC_OPEN_MAX);
20477 open_max = FOPEN_MAX;
20480 open_max = OPEN_MAX;
20489 # ifdef HAS_STDIO_STREAM_ARRAY
20490 if (open_max > 0) {
20492 for (i = 0; i < open_max; i++)
20493 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20494 STDIO_STREAM_ARRAY[i]._file < open_max &&
20495 STDIO_STREAM_ARRAY[i]._flag)
20496 fflush(&STDIO_STREAM_ARRAY[i]);
20504 : first we have to find out how _not_ to flush
20506 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20508 set try -DTRY_FPUTC
20509 if eval $compile; then
20510 $run ./try 2>/dev/null
20513 if $test ! -s try.out -a "X$code" = X42; then
20519 set try -DTRY_FPRINTF
20520 if eval $compile; then
20521 $run ./try 2>/dev/null
20524 if $test ! -s try.out -a "X$code" = X42; then
20525 output=-DTRY_FPRINTF
20531 : check for fflush NULL behavior
20532 case "$fflushNULL" in
20533 '') set try -DTRY_FFLUSH_NULL $output
20534 if eval $compile; then
20535 $run ./try 2>/dev/null
20538 if $test -s try.out -a "X$code" = X42; then
20539 fflushNULL="`$cat try.out`"
20541 if $test "X$code" != X42; then
20543 (If this test failed, don't worry, we'll try another method shortly.)
20548 $rm -f core try.core core.try.*
20549 case "$fflushNULL" in
20551 Your fflush(NULL) works okay for output streams.
20552 Let's see if it clobbers input pipes...
20554 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20555 # bug that improperly flushes the input end of pipes. So we avoid the
20556 # autoflush on fork/system/exec support for now. :-(
20557 $cat >tryp.c <<EOCP
20560 main(int argc, char **argv)
20566 while ((i = getc(stdin)) != -1
20567 && (*bp++ = i) != '\n'
20568 && bp < &buf[1024])
20571 fprintf(stdout, "%s", buf);
20579 fflushNULL="$define"
20581 if eval $compile; then
20583 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20584 if $test "X$targethost" != X; then
20587 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20589 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20591 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20593 fflush(NULL) seems to behave okay with input streams.
20595 fflushNULL="$define"
20598 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20600 fflushNULL="$undef"
20603 $rm -f core tryp.c tryp.core core.tryp.*
20606 Your fflush(NULL) isn't working (contrary to ANSI C).
20608 fflushNULL="$undef"
20611 Cannot figure out whether your fflush(NULL) works or not.
20612 I'm assuming it doesn't (contrary to ANSI C).
20614 fflushNULL="$undef"
20618 $define|true|[yY]*)
20619 fflushNULL="$define"
20622 fflushNULL="$undef"
20625 : check explicit looping only if NULL did not work, and if the pipe
20626 : bug does not show up on an explicit flush too
20627 case "$fflushNULL" in
20629 $cat >tryp.c <<EOCP
20632 main(int argc, char **argv)
20638 while ((i = getc(stdin)) != -1
20639 && (*bp++ = i) != '\n'
20640 && bp < &buf[1024])
20643 fprintf(stdout, "%s", buf);
20652 if eval $compile; then
20654 if $test "X$targethost" != X; then
20657 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20659 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20661 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20663 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20665 : now check for fflushall behaviour
20666 case "$fflushall" in
20667 '') set try -DTRY_FFLUSH_ALL $output
20668 if eval $compile; then
20670 (Now testing the other method--but note that this also may fail.)
20672 $run ./try 2>/dev/null
20675 if $test -s try.out -a "X$code" = X42; then
20676 fflushall="`$cat try.out`"
20680 case "$fflushall" in
20682 Whew. Flushing explicitly all the stdio streams works.
20684 fflushall="$define"
20687 Sigh. Flushing explicitly all the stdio streams doesn't work.
20692 Cannot figure out whether flushing stdio streams explicitly works or not.
20693 I'm assuming it doesn't.
20699 "$define"|true|[yY]*)
20700 fflushall="$define"
20708 All is futile. Even fflush(stdin) clobbers input pipes!
20715 $rm -f core tryp.c tryp.core core.tryp.*
20717 *) fflushall="$undef"
20721 case "$fflushNULL$fflushall" in
20724 OK, I give up. I cannot figure out how to flush pending stdio output.
20725 We won't be flushing handles at all before fork/exec/popen.
20731 : Store the full pathname to the ar program for use in the C program
20732 : Respect a hint or command line value for full_ar.
20737 : Store the full pathname to the sed program for use in the C program
20740 : see what type gids are declared as in the kernel
20742 echo "Looking for the type for group ids returned by getgid()."
20743 set gid_t gidtype xxx stdio.h sys/types.h
20747 xxx=`./findhdr sys/user.h`
20748 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20750 unsigned) dflt="$1 $2" ;;
20754 *) dflt="$gidtype";;
20757 gid_t) echo "gid_t found." ;;
20758 *) rp="What is the type for group ids returned by getgid()?"
20764 : Check the size of GID
20767 *_t) zzz="$gidtype" ;;
20770 echo "Checking the size of $zzz..." >&4
20772 #include <sys/types.h>
20774 #$i_stdlib I_STDLIB
20776 #include <stdlib.h>
20779 printf("%d\n", (int)sizeof($gidtype));
20784 if eval $compile_ok; then
20788 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20791 echo "Your $zzz is $gidsize bytes long."
20796 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20800 : Check if GID is signed
20803 *_t) zzz="$gidtype" ;;
20806 echo "Checking the sign of $zzz..." >&4
20808 #include <sys/types.h>
20819 if eval $compile; then
20823 echo "(I can't execute the test program--guessing unsigned.)" >&4
20827 1) echo "Your $zzz is unsigned." ;;
20828 -1) echo "Your $zzz is signed." ;;
20834 echo "(I can't compile the test program--guessing unsigned.)" >&4
20838 : Check 64bit sizes
20841 if $test X"$quadtype" != X; then
20843 echo "Checking how to print 64-bit integers..." >&4
20845 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20846 $cat >try.c <<'EOCP'
20847 #include <sys/types.h>
20850 int q = 12345678901;
20851 printf("%ld\n", q);
20855 if eval $compile; then
20859 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20860 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20861 echo "We will use %d."
20867 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20868 $cat >try.c <<'EOCP'
20869 #include <sys/types.h>
20872 long q = 12345678901;
20873 printf("%ld\n", q);
20877 if eval $compile; then
20881 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20882 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20883 echo "We will use %ld."
20889 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20890 $cat >try.c <<'EOCP'
20891 #include <sys/types.h>
20892 #include <inttypes.h>
20895 int64_t q = 12345678901;
20896 printf("%" PRId64 "\n", q);
20900 if eval $compile; then
20904 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20905 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20906 echo "We will use the C9X style."
20912 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20914 #include <sys/types.h>
20917 $quadtype q = 12345678901;
20918 printf("%Ld\n", q);
20922 if eval $compile; then
20926 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20927 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20928 echo "We will use %Ld."
20934 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20935 $cat >try.c <<'EOCP'
20936 #include <sys/types.h>
20939 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20940 printf("%lld\n", q);
20944 if eval $compile; then
20948 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20949 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20950 echo "We will use the %lld style."
20956 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20958 #include <sys/types.h>
20961 $quadtype q = 12345678901;
20962 printf("%qd\n", q);
20966 if eval $compile; then
20970 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20971 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20972 echo "We will use %qd."
20978 if $test X"$sPRId64" = X; then
20979 echo "Cannot figure out how to print 64-bit integers." >&4
20986 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20987 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20989 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20990 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20994 : Check format strings for internal types
20996 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20998 if $test X"$ivsize" = X8; then
20999 ivdformat="$sPRId64"
21000 uvuformat="$sPRIu64"
21001 uvoformat="$sPRIo64"
21002 uvxformat="$sPRIx64"
21003 uvXUformat="$sPRIXU64"
21005 if $test X"$ivsize" = X"$longsize"; then
21012 if $test X"$ivsize" = X"$intsize"; then
21020 if $test X"$ivsize" = X"$shortsize"; then
21031 if $test X"$usequadmath" = X"$define"; then
21039 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21040 nveformat="$sPRIeldbl"
21041 nvfformat="$sPRIfldbl"
21042 nvgformat="$sPRIgldbl"
21043 nvEUformat="$sPRIEUldbl"
21044 nvFUformat="$sPRIFUldbl"
21045 nvGUformat="$sPRIGUldbl"
21056 case "$ivdformat" in
21057 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21062 : Check format string for GID
21065 $echo "Checking the format string to be used for gids..." >&4
21068 -1) if $test X"$gidsize" = X"$ivsize"; then
21069 gidformat="$ivdformat"
21071 if $test X"$gidsize" = X"$longsize"; then
21074 if $test X"$gidsize" = X"$intsize"; then
21077 if $test X"$gidsize" = X"$shortsize"; then
21084 *) if $test X"$gidsize" = X"$uvsize"; then
21085 gidformat="$uvuformat"
21087 if $test X"$gidsize" = X"$longsize"; then
21090 if $test X"$gidsize" = X"$intsize"; then
21093 if $test X"$gidsize" = X"$shortsize"; then
21102 : see if getgroups exists
21103 set getgroups d_getgrps
21106 : see if setgroups exists
21107 set setgroups d_setgrps
21110 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21112 case "$d_getgrps$d_setgrps" in
21114 case "$groupstype" in
21115 '') dflt="$gidtype" ;;
21116 *) dflt="$groupstype" ;;
21119 What type of pointer is the second argument to getgroups() and setgroups()?
21120 Usually this is the same as group ids, $gidtype, but not always.
21123 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21127 *) groupstype="$gidtype";;
21130 : check whether make sets MAKE
21132 echo "Checking if your $make program sets \$(MAKE)..." >&4
21133 case "$make_set_make" in
21135 $sed 's/^X //' > testmake.mak << 'EOF'
21137 X @echo 'maketemp="$(MAKE)"'
21139 case "`$make -f testmake.mak 2>/dev/null`" in
21140 *maketemp=*) make_set_make='#' ;;
21141 *) make_set_make="MAKE=$make" ;;
21143 $rm -f testmake.mak
21146 case "$make_set_make" in
21147 '#') echo "Yup, it does.";;
21148 *) echo "Nope, it doesn't.";;
21151 : see what type is used for mode_t
21152 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21153 set mode_t modetype int stdio.h sys/types.h
21156 : see if we need va_copy
21159 #include <stdarg.h>
21161 #include <stdlib.h>
21162 #include <signal.h>
21165 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21167 return vfprintf(f, fmt, *valp);
21171 myvfprintf(FILE *f, const char *fmt, va_list val)
21173 return ivfprintf(f, fmt, &val);
21177 myprintf(char *fmt, ...)
21180 va_start(val, fmt);
21181 return myvfprintf(stdout, fmt, val);
21185 main(int ac, char **av)
21187 signal(SIGSEGV, exit);
21189 myprintf("%s%cs all right, then\n", "that", '\'');
21194 if eval $compile && $run ./try 2>&1 >/dev/null; then
21195 case "`$run ./try`" in
21196 "that's all right, then")
21202 yes) echo "It seems that you don't need va_copy()." >&4
21203 need_va_copy="$undef"
21205 *) echo "It seems that va_copy() or similar will be needed." >&4
21206 need_va_copy="$define"
21211 : see what type is used for size_t
21212 rp="What is the type used for the length parameter for string functions?"
21213 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21216 : check for type of arguments to gethostbyaddr.
21217 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21218 case "$d_gethbyaddr" in
21222 Checking to see what type of arguments are accepted by gethostbyaddr().
21224 hdrs="$define sys/types.h
21225 $d_socket sys/socket.h
21226 $i_niin netinet/in.h
21228 $i_unistd unistd.h"
21229 : The first arg can 'char *' or 'void *'
21230 : The second arg is some of integral type
21231 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21232 for yyy in size_t long int; do
21233 case "$netdb_host_type" in
21234 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21235 if ./protochk "$try" $hdrs; then
21236 echo "Your system accepts $xxx for the first arg."
21237 echo "...and $yyy for the second arg."
21238 netdb_host_type="$xxx"
21239 netdb_hlen_type="$yyy"
21245 : In case none of those worked, prompt the user.
21246 case "$netdb_host_type" in
21247 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21250 netdb_host_type=$ans
21251 rp='What is the type for the 2nd argument to gethostbyaddr?'
21254 netdb_hlen_type=$ans
21258 *) : no gethostbyaddr, so pick harmless defaults
21259 netdb_host_type='char *'
21260 netdb_hlen_type="$sizetype"
21263 # Remove the "const" if needed. -- but then we'll have a
21265 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21268 : check for type of argument to gethostbyname.
21269 if test "X$netdb_name_type" = X ; then
21270 case "$d_gethbyname" in
21274 Checking to see what type of argument is accepted by gethostbyname().
21276 hdrs="$define sys/types.h
21277 $d_socket sys/socket.h
21278 $i_niin netinet/in.h
21280 $i_unistd unistd.h"
21281 for xxx in "const char *" "char *"; do
21282 case "$netdb_name_type" in
21283 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21284 if ./protochk "$try" $hdrs; then
21285 echo "Your system accepts $xxx."
21286 netdb_name_type="$xxx"
21291 : In case none of those worked, prompt the user.
21292 case "$netdb_name_type" in
21293 '') rp='What is the type for the 1st argument to gethostbyname?'
21296 netdb_name_type=$ans
21300 *) : no gethostbyname, so pick harmless default
21301 netdb_name_type='char *'
21306 : check for type of 1st argument to getnetbyaddr.
21307 if test "X$netdb_net_type" = X ; then
21308 case "$d_getnbyaddr" in
21312 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21314 hdrs="$define sys/types.h
21315 $d_socket sys/socket.h
21316 $i_niin netinet/in.h
21318 $i_unistd unistd.h"
21319 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21320 case "$netdb_net_type" in
21321 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21322 if ./protochk "$try" $hdrs; then
21323 echo "Your system accepts $xxx."
21324 netdb_net_type="$xxx"
21329 : In case none of those worked, prompt the user.
21330 case "$netdb_net_type" in
21331 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21334 netdb_net_type=$ans
21338 *) : no getnetbyaddr, so pick harmless default
21339 netdb_net_type='long'
21343 : locate the preferred pager for this system
21350 [a-zA-Z]:/*) dflt=$pg;;
21354 [a-zA-Z]:/*) dflt=$more;;
21358 [a-zA-Z]:/*) dflt=$less;;
21361 '') dflt=/usr/ucb/more;;
21369 rp='What pager is used on your system?'
21373 : see if ar generates random libraries by itself
21375 echo "Checking how to generate random libraries on your machine..." >&4
21376 echo 'int bar1() { return bar2(); }' > bar1.c
21377 echo 'int bar2() { return 2; }' > bar2.c
21379 #$i_stdlib I_STDLIB
21381 #include <stdlib.h>
21383 int main() { printf("%d\n", bar1()); exit(0); }
21385 $cc $ccflags -c bar1.c >/dev/null 2>&1
21386 $cc $ccflags -c bar2.c >/dev/null 2>&1
21387 $cc $ccflags -c foo.c >/dev/null 2>&1
21388 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21389 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21390 $run ./foobar >/dev/null 2>&1; then
21391 echo "$ar appears to generate random libraries itself."
21393 if [ "X$ranlib" = "X" ]; then
21396 elif $ar s bar$_a >/dev/null 2>&1 &&
21397 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21398 $run ./foobar >/dev/null 2>&1; then
21399 echo "a table of contents needs to be added with '$ar s'."
21402 elif $ar ts bar$_a >/dev/null 2>&1 &&
21403 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21404 $run ./foobar >/dev/null 2>&1; then
21405 echo "a table of contents needs to be added with '$ar ts'."
21412 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21413 $test -f $ranlib || ranlib=''
21416 if $test -n "$ranlib"; then
21417 echo "your system has '$ranlib'; we'll use that."
21420 echo "your system doesn't seem to support random libraries"
21421 echo "so we'll use lorder and tsort to order the libraries."
21428 : Check the max offset that gmtime and localtime accept
21429 echo "Checking max offsets that gmtime () accepts"
21431 case "$sGMTIME_min/$sGMTIME_max" in
21434 #include <sys/types.h>
21442 void gm_check (time_t t, int min_year, int max_year)
21445 if ( tmp == NULL ||
21446 /* Check tm_year overflow */
21447 tmp->tm_year < min_year || tmp->tm_year > max_year)
21458 gm_check (MAXLONG, 69, 0x7fffffff);
21460 if (tmp == NULL || tmp->tm_year < 0) {
21461 for (i = 63; i >= 0; i--) {
21462 time_t x = pt | ((time_t)1 << i);
21463 if (x < 0 || x < pt) continue;
21464 gm_check (x, 69, 0x7fffffff);
21467 printf ("sGMTIME_max=%ld\n", pt);
21476 gm_check (MINLONG, -1900, 70);
21479 for (i = 36; i >= 0; i--) {
21480 time_t x = pt - ((time_t)1 << i);
21481 if (x > 0) continue;
21482 gm_check (x, -1900, 70);
21485 printf ("sGMTIME_min=%ld\n", pt);
21489 int main (int argc, char *argv[])
21491 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21498 if eval $compile; then
21499 eval `$run ./try 2>/dev/null`
21501 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21507 echo "Checking max offsets that localtime () accepts"
21509 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21512 #include <sys/types.h>
21520 void local_check (time_t t, int min_year, int max_year)
21522 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21525 tmp = localtime (&t);
21526 if ( tmp == NULL ||
21527 /* Check tm_year overflow */
21528 tmp->tm_year < min_year || tmp->tm_year > max_year)
21532 } /* local_check */
21539 local_check (MAXLONG, 69, 0x7fffffff);
21541 if (tmp == NULL || tmp->tm_year < 0) {
21542 for (i = 63; i >= 0; i--) {
21543 time_t x = pt | ((time_t)1 << i);
21544 if (x < 0 || x < pt) continue;
21545 local_check (x, 69, 0x7fffffff);
21548 printf ("sLOCALTIME_max=%ld\n", pt);
21557 local_check (MINLONG, -1900, 70);
21560 for (i = 36; i >= 0; i--) {
21561 time_t x = pt - ((time_t)1 << i);
21562 if (x > 0) continue;
21563 local_check (x, -1900, 70);
21566 printf ("sLOCALTIME_min=%ld\n", pt);
21570 int main (int argc, char *argv[])
21578 if eval $compile; then
21579 eval `$run ./try 2>/dev/null`
21581 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21587 : check for type of arguments to select.
21588 case "$selecttype" in
21589 '') case "$d_select" in
21593 Checking to see what type of arguments are accepted by select().
21595 hdrs="$define sys/types.h
21596 $i_systime sys/time.h
21597 $i_sysselct sys/select.h
21598 $d_socket sys/socket.h"
21599 : The first arg can be int, unsigned, or size_t
21600 : The last arg may or may not be 'const'
21602 : void pointer has been seen but using that
21603 : breaks the selectminbits test
21604 for xxx in 'fd_set *' 'int *'; do
21605 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21606 for tmo in 'struct timeval *' 'const struct timeval *'; do
21608 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21609 if ./protochk "$try" $hdrs; then
21610 echo "Your system accepts $xxx."
21619 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21620 case "$d_fd_set" in
21621 $define) dflt="fd_set *" ;;
21630 *) : no select, so pick a harmless default
21637 : check for the select 'width'
21638 case "$selectminbits" in
21639 '') safebits=`expr $ptrsize \* 8`
21640 case "$d_select" in
21644 Checking to see on how many bits at a time your select() operates...
21647 #include <sys/types.h>
21649 #$i_systime I_SYS_TIME
21650 #$i_systimek I_SYS_TIME_KERNEL
21655 # ifdef I_SYS_TIME_KERNEL
21658 # include <sys/time.h>
21659 # ifdef I_SYS_TIME_KERNEL
21663 #$i_sysselct I_SYS_SELECT
21664 #ifdef I_SYS_SELECT
21665 #include <sys/select.h>
21667 #$d_socket HAS_SOCKET
21669 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21672 #$i_stdlib I_STDLIB
21674 #include <stdlib.h>
21677 #define S sizeof(*(b))
21679 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21680 #define NBITS (NBYTES * 8)
21682 char *s = (char *)malloc(NBYTES);
21691 fp = fopen("try.c", "r");
21697 b = ($selecttype)s;
21698 for (i = 0; i < NBITS; i++)
21702 select(fd + 1, b, 0, 0, &t);
21703 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21705 printf("%d\n", i + 1);
21710 if eval $compile_ok; then
21711 selectminbits=`$run ./try 2>/dev/null`
21712 case "$selectminbits" in
21714 Cannot figure out on how many bits at a time your select() operates.
21715 I'll play safe and guess it is $safebits bits.
21717 selectminbits=$safebits
21718 bits="$safebits bits"
21721 *) bits="$selectminbits bits" ;;
21723 echo "Your select() operates on $bits at a time." >&4
21725 rp='What is the minimum number of bits your select() operates on?'
21726 case "$byteorder" in
21727 12345678) dflt=64 ;;
21733 selectminbits="$val"
21737 *) : no select, so pick a harmless default
21738 selectminbits=$safebits
21744 : Trace out the files included by signal.h, then look for SIGxxx names.
21745 case "$sig_num_init" in
21747 if [ "X$fieldn" = X ]; then
21748 : Just make some guesses. We check them later.
21749 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21751 xxx=`echo '#include <signal.h>' |
21752 $cppstdin $cppminus $cppflags 2>/dev/null |
21753 $grep '^[ ]*#.*include' |
21754 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21755 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21758 for xx in $xxx /dev/null ; do
21759 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21761 case "$xxxfiles" in
21762 '') xxxfiles=`./findhdr signal.h` ;;
21765 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21766 print substr($2, 4, 20)
21768 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21769 print substr($3, 4, 20)
21771 : Append some common names just in case the awk scan failed.
21772 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21773 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21774 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21775 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21776 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21778 : generate a few handy files for later
21779 $cat > signal.c <<EOCP
21780 #include <sys/types.h>
21781 #include <signal.h>
21782 #$i_stdlib I_STDLIB
21784 #include <stdlib.h>
21789 /* Strange style to avoid deeply-nested #if/#else/#endif */
21792 # define NSIG (_NSIG)
21798 # define NSIG (SIGMAX+1)
21804 # define NSIG (SIG_MAX+1)
21810 # define NSIG (_SIG_MAX+1)
21816 # define NSIG (MAXSIG+1)
21822 # define NSIG (MAX_SIG+1)
21827 # ifdef SIGARRAYSIZE
21828 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21834 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21838 /* Default to some arbitrary number that's big enough to get most
21839 of the common signals.
21845 printf("NSIG %d\n", NSIG);
21851 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21853 printf "#ifdef SIG"; printf $1; printf "\n"
21854 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21855 printf $1; printf ");\n"
21859 printf "#endif /* JUST_NSIG */\n";
21860 printf "exit(0);\n}\n";
21863 $cat >signal.awk <<'EOP'
21864 BEGIN { ndups = 0 }
21865 $1 ~ /^NSIG$/ { nsig = $2 }
21866 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21867 if ($2 > maxsig) { maxsig = $2 }
21868 if (sig_name[$2]) {
21869 dup_name[ndups] = $1
21870 dup_num[ndups] = $2
21882 printf("NSIG %d\n", nsig);
21883 for (n = 1; n < nsig; n++) {
21885 printf("%s %d\n", sig_name[n], sig_num[n])
21888 printf("NUM%d %d\n", n, n)
21891 for (n = 0; n < ndups; n++) {
21892 printf("%s %d\n", dup_name[n], dup_num[n])
21896 $cat >signal_cmd <<EOS
21898 if $test -s signal.lst; then
21899 echo "Using your existing signal.lst file"
21904 $cat >>signal_cmd <<'EOS'
21907 if eval $compile_ok; then
21908 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21909 $uniq | $awk -f signal.awk >signal.lst
21911 echo "(I can't seem be able to compile the whole test program)" >&4
21912 echo "(I'll try it in little pieces.)" >&4
21913 set signal -DJUST_NSIG
21914 if eval $compile_ok; then
21915 $run ./signal$_exe > signal.nsg
21918 echo "I can't seem to figure out how many signals you have." >&4
21919 echo "Guessing 50." >&4
21920 echo 'NSIG 50' > signal.nsg
21922 : Now look at all the signal names, one at a time.
21923 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21924 $cat > signal.c <<EOCP
21925 #include <sys/types.h>
21926 #include <signal.h>
21929 printf("$xx %d\n", SIG${xx});
21934 if eval $compile; then
21935 echo "SIG${xx} found."
21936 $run ./signal$_exe >> signal.ls1
21938 echo "SIG${xx} NOT found."
21941 if $test -s signal.ls1; then
21942 $cat signal.nsg signal.ls1 |
21943 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21947 if $test -s signal.lst; then
21950 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21951 echo 'kill -l' >signal
21952 set X `csh -f <signal`
21956 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21958 echo $@ | $tr ' ' $trnl | \
21959 $awk '{ printf "%s %d\n", $1, ++s; }
21960 END { printf "NSIG %d\n", ++s }' >signal.lst
21962 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21964 chmod a+x signal_cmd
21965 $eunicefix signal_cmd
21969 : generate list of signal names
21970 case "$sig_num_init" in
21973 case "$sig_name_init" in
21975 *) case "$sig_num_init" in
21976 ''|*,*) doinit=yes ;;
21981 echo "Generating a list of signal names and numbers..." >&4
21983 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21984 sig_name=`$awk 'BEGIN { printf "ZERO " }
21985 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21986 sig_num=`$awk 'BEGIN { printf "0 " }
21987 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21988 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21989 !/^NSIG/ { printf "\"%s\", ", $1 }
21990 END { printf "0\n" }' signal.lst`
21991 sig_num_init=`$awk 'BEGIN { printf "0, " }
21992 !/^NSIG/ { printf "%d, ", $2}
21993 END { printf "0\n"}' signal.lst`
21996 echo "The following $sig_count signals are available:"
21998 echo $sig_name | $awk \
21999 'BEGIN { linelen = 0 }
22001 for (i = 1; i <= NF; i++) {
22002 name = "SIG" $i " "
22003 linelen = linelen + length(name)
22004 if (linelen > 70) {
22006 linelen = length(name)
22012 sig_size=`echo $sig_name | awk '{print NF}'`
22013 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22017 : Check size of size
22019 case "$sizetype" in
22020 *_t) zzz="$sizetype" ;;
22021 *) zzz="filesize" ;;
22023 echo "Checking the size of $zzz..." >&4
22025 #include <sys/types.h>
22027 #$i_stdlib I_STDLIB
22029 #include <stdlib.h>
22032 printf("%d\n", (int)sizeof($sizetype));
22037 if eval $compile_ok; then
22041 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22044 echo "Your $zzz size is $sizesize bytes."
22049 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22053 : check for socklen_t
22055 echo "Checking to see if you have socklen_t..." >&4
22057 #include <sys/types.h>
22058 #$d_socket HAS_SOCKET
22060 #include <sys/socket.h>
22062 int main() { socklen_t x = 16; }
22065 if eval $compile; then
22067 echo "You have socklen_t."
22070 echo "You do not have socklen_t."
22071 case "$sizetype" in
22072 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22079 : see if this is a socks.h system
22080 set socks.h i_socks
22083 : check for type of the size argument to socket calls
22084 case "$d_socket" in
22088 Checking to see what type is the last argument of accept().
22091 case "$d_socklen_t" in
22092 "$define") yyy="$yyy socklen_t"
22094 yyy="$yyy $sizetype int long unsigned"
22095 for xxx in $yyy; do
22096 case "$socksizetype" in
22097 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22098 case "$usesocks" in
22100 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22101 echo "Your system accepts '$xxx *' for the last argument of accept()."
22102 socksizetype="$xxx"
22105 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22106 echo "Your system accepts '$xxx *' for the last argument of accept()."
22107 socksizetype="$xxx"
22114 : In case none of those worked, prompt the user.
22115 case "$socksizetype" in
22116 '') rp='What is the type for socket address structure sizes?'
22123 *) : no sockets, so pick relatively harmless default
22128 : see what type is used for signed size_t
22129 set ssize_t ssizetype int stdio.h sys/types.h
22134 #$i_stdlib I_STDLIB
22136 #include <stdlib.h>
22138 #include <sys/types.h>
22139 #define Size_t $sizetype
22140 #define SSize_t $dflt
22143 if (sizeof(Size_t) == sizeof(SSize_t))
22145 else if (sizeof(Size_t) == sizeof(int))
22154 if eval $compile_ok && $run ./try > /dev/null; then
22155 ssizetype=`$run ./try`
22156 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22159 Help! I can't compile and run the ssize_t test program: please enlighten me!
22160 (This is probably a misconfiguration in your system or libraries, and
22161 you really ought to fix it. Still, I'll try anyway.)
22163 I need a type that is the same size as $sizetype, but is guaranteed to
22164 be signed. Common values are ssize_t, int and long.
22167 rp="What signed type is the same size as $sizetype?"
22173 : Check the size of st_ino
22175 $echo "Checking the size of st_ino..." >&4
22176 $cat > try.c <<EOCP
22177 #include <sys/stat.h>
22179 #$i_stdlib I_STDLIB
22181 #include <stdlib.h>
22185 printf("%d\n", (int)sizeof(st.st_ino));
22190 if eval $compile_ok; then
22194 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22196 *) st_ino_size=$val
22197 $echo "Your st_ino is $st_ino_size bytes long."
22202 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22206 : Check if st_ino is signed
22208 $echo "Checking the sign of st_ino..." >&4
22209 $cat > try.c <<EOCP
22210 #include <sys/stat.h>
22215 if (foo.st_ino < 0)
22222 if eval $compile; then
22226 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22228 *) st_ino_sign=$val
22229 case "$st_ino_sign" in
22230 1) $echo "Your st_ino is unsigned." ;;
22231 -1) $echo "Your st_ino is signed." ;;
22237 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22241 : see what type of char stdio uses.
22243 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22244 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22245 echo "Your stdio uses unsigned chars." >&4
22246 stdchar="unsigned char"
22248 echo "Your stdio uses signed chars." >&4
22253 : Check size of UID
22256 *_t) zzz="$uidtype" ;;
22259 echo "Checking the size of $zzz..." >&4
22261 #include <sys/types.h>
22263 #$i_stdlib I_STDLIB
22265 #include <stdlib.h>
22268 printf("%d\n", (int)sizeof($uidtype));
22273 if eval $compile_ok; then
22277 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22280 echo "Your $zzz is $uidsize bytes long."
22285 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22288 : Check if UID is signed
22291 *_t) zzz="$uidtype" ;;
22294 echo "Checking the sign of $zzz..." >&4
22296 #include <sys/types.h>
22307 if eval $compile; then
22311 echo "(I can't execute the test program--guessing unsigned.)" >&4
22315 1) echo "Your $zzz is unsigned." ;;
22316 -1) echo "Your $zzz is signed." ;;
22322 echo "(I can't compile the test program--guessing unsigned.)" >&4
22326 : Check format string for UID
22328 $echo "Checking the format string to be used for uids..." >&4
22331 -1) if $test X"$uidsize" = X"$ivsize"; then
22332 uidformat="$ivdformat"
22334 if $test X"$uidsize" = X"$longsize"; then
22337 if $test X"$uidsize" = X"$intsize"; then
22340 if $test X"$uidsize" = X"$shortsize"; then
22347 *) if $test X"$uidsize" = X"$uvsize"; then
22348 uidformat="$uvuformat"
22350 if $test X"$uidsize" = X"$longsize"; then
22353 if $test X"$uidsize" = X"$intsize"; then
22356 if $test X"$uidsize" = X"$shortsize"; then
22365 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22367 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22368 $cat >try.c <<'EOM'
22369 /* Intentionally a long probe as I'd like to sanity check that the exact
22370 approach is going to work, as thinking it will work, but only having it
22371 part working at runtime is worse than not having it. */
22373 #include <sys/types.h>
22374 #include <sys/sysctl.h>
22375 #include <sys/param.h>
22377 #include <string.h>
22378 #include <stdlib.h>
22379 #include <unistd.h>
22382 main(int argc, char **argv) {
22384 char *argv_leaf = strrchr(argv[0], '/');
22390 mib[1] = KERN_PROC;
22391 mib[2] = KERN_PROC_PATHNAME;
22395 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22399 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22404 if (size < strlen(argv_leaf) + 1) {
22405 fprintf(stderr, "size %lu is too short for a path\n",
22406 (unsigned long) size);
22410 if (size > MAXPATHLEN * MAXPATHLEN) {
22411 fprintf(stderr, "size %lu is too long for a path\n",
22412 (unsigned long) size);
22416 buffer = (char *)malloc(size);
22422 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22427 if (strlen(buffer) + 1 != size) {
22428 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22429 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22434 if (*buffer != '/') {
22435 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22439 if (strstr(buffer, "/./")) {
22440 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22444 if (strstr(buffer, "/../")) {
22445 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22449 buffer_leaf = strrchr(buffer, '/');
22450 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22451 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22463 if eval $compile; then
22464 if $run ./try; then
22465 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22468 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22472 echo "I'm unable to compile the test program." >&4
22473 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22477 set usekernprocpathname
22480 : Determine if we can use _NSGetExecutablePath to find executing program
22482 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22483 $cat >try.c <<'EOM'
22484 /* Intentionally a long probe as I'd like to sanity check that the exact
22485 approach is going to work, as thinking it will work, but only having it
22486 part working at runtime is worse than not having it. */
22487 #include <mach-o/dyld.h>
22489 #include <stdlib.h>
22490 #include <sys/param.h>
22491 #include <string.h>
22494 main(int argc, char **argv) {
22496 uint32_t size = sizeof(buf);
22500 char *argv_leaf = strrchr(argv[0], '/');
22504 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22508 _NSGetExecutablePath(buf, &size);
22509 if (size > MAXPATHLEN * MAXPATHLEN) {
22510 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22511 (unsigned int) size);
22515 buffer = (char *)malloc(size);
22521 result = _NSGetExecutablePath(buffer, &size);
22523 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22524 result, (unsigned int) size);
22528 tidied = realpath(buffer, NULL);
22530 perror("realpath");
22536 if (*tidied != '/') {
22537 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22541 if (strstr(tidied, "/./")) {
22542 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22546 if (strstr(tidied, "/../")) {
22547 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22551 tidied_leaf = strrchr(tidied, '/');
22552 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22553 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22565 if eval $compile; then
22566 if $run ./try; then
22567 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22570 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22573 echo "I'm unable to compile the test program." >&4
22574 echo "I'll assume no _NSGetExecutablePath here." >&4
22577 set usensgetexecutablepath
22580 : Check if site customization support was requested
22581 case "$usesitecustomize" in
22582 $define|true|[Yy]*)
22583 usesitecustomize="$define"
22586 usesitecustomize="$undef"
22590 : determine compiler compiler
22599 if $test -f "$byacc$_exe"; then
22601 comp="byacc or $comp"
22603 if $test -f "$bison$_exe"; then
22604 comp="$comp or bison -y"
22606 rp="Which compiler compiler ($comp) shall I use?"
22615 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22621 : see if this is a bfd.h system
22625 : see if this is an execinfo.h system
22626 set execinfo.h i_execinfo
22629 : see if this is a fenv.h system
22633 : see if this is a fp.h system
22637 : see if this is a fp_class.h system
22638 set fp_class.h i_fp_class
22641 : see if gdbm.h is available
22646 : see if gdbm_open exists
22647 set gdbm_open d_gdbm_open
22649 case "$d_gdbm_open" in
22652 echo "We won't be including <gdbm.h>"
22661 : see if this is a ieeefp.h system
22662 case "$i_ieeefp" in
22663 '' ) set ieeefp.h i_ieeefp
22668 : see if this is a libutil.h system
22669 set libutil.h i_libutil
22672 : see if mach cthreads are available
22673 if test "X$usethreads" = "X$define"; then
22674 set mach/cthreads.h i_machcthr
22677 i_machcthr="$undef"
22680 : see if this is a mntent.h system
22681 set mntent.h i_mntent
22684 : see if net/errno.h is available
22686 set net/errno.h val
22689 : Unfortunately, it causes problems on some systems. Arrgh.
22692 cat > try.c <<'EOM'
22695 #include <net/errno.h>
22701 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22702 echo "We'll be including <net/errno.h>." >&4
22704 echo "We won't be including <net/errno.h>." >&4
22713 : see if netinet/tcp.h is available
22714 set netinet/tcp.h i_netinettcp
22717 : see if this is a poll.h system
22721 : see if this is a prot.h system
22725 : Preprocessor symbols
22727 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22728 $cat <<'EOSH' > Cppsym.know
22729 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22730 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22731 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22732 arch_pwr ardent ARM ARM32 atarist att386 att3b
22733 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22734 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22735 byteorder byte_order
22736 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22737 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22738 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22739 ELF encore EPI EXTENSIONS
22740 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22741 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22742 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22743 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22744 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22745 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22746 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22747 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22748 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22750 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22751 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22752 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22754 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22755 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22756 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22757 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22758 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22759 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22760 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22761 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22762 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22763 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22764 ns32000 ns32016 ns32332 ns32k nsc32000
22765 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22766 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22767 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22768 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22770 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22771 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22772 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22773 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22774 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22775 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22776 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22777 SYSV4 SYSV5 sysV68 sysV88
22778 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22779 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22780 tower32_800 tower32_850 tss
22781 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22782 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22783 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22784 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22785 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22786 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22788 vax venix VMESA vms
22789 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22790 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22793 # Maybe put other stuff here too.
22794 ./tr '-' '_' <<EOSH >>Cppsym.know
22797 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22798 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22799 $cat Cppsym.know > Cppsym.c
22800 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22801 $rm -f Cppsym.a Cppsym.b Cppsym.c
22802 cat <<EOSH > Cppsym
22804 if $test \$# -gt 0; then
22805 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22806 if $test -s Cppsym.got; then
22813 $tr " " "$trnl" | ./Cppsym.try
22819 cat <<EOSH > Cppsym.try
22821 cat <<'EOCP' > try.c
22824 #define STRINGIFY(a) "a"
22826 #if cpp_stuff == 42
22827 #define StGiFy(a) #a
22828 #define STRINGIFY(a) StGiFy(a)
22830 #if $cpp_stuff != 1 && $cpp_stuff != 42
22831 # include "Bletch: How does this C preprocessor stringify macros?"
22837 cat <<'EOSH' >> Cppsym.try
22839 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22840 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22841 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22842 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22844 echo 'return 0;}' >> try.c
22846 cat <<EOSH >> Cppsym.try
22848 case "$osname-$gccversion" in
22849 irix-) ccflags="\$ccflags -woff 1178" ;;
22850 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22852 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
22854 chmod +x Cppsym.try
22855 $eunicefix Cppsym.try
22856 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22857 : Add in any Linux cpp "predefined macros":
22858 case "$osname::$gccversion" in
22859 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22861 rm -f $tHdrH'.h' $tHdrH
22863 # Filter out macro arguments, such as Linux's __INT8_C(c)
22864 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22865 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22866 if [ -s $tHdrH'_cppsym.real' ]; then
22867 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22870 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22873 : now check the C compiler for additional symbols
22874 postprocess_cc_v=''
22876 aix) postprocess_cc_v="|$tr , ' '" ;;
22883 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22886 -D*) echo "\$i" | $sed 's/^-D//';;
22887 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22892 postprocess_cc_v=''
22895 ./ccsym > ccsym1.raw
22896 if $test -s ccsym1.raw; then
22897 $sort ccsym1.raw | $uniq >ccsym.raw
22899 mv ccsym1.raw ccsym.raw
22902 $awk '/\=/ { print $0; next }
22903 { print $0"=1" }' ccsym.raw >ccsym.list
22904 $comm -13 Cppsym.true ccsym.list >ccsym.own
22905 $comm -12 Cppsym.true ccsym.list >ccsym.com
22906 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22908 if $test -z ccsym.raw; then
22909 echo "Your C compiler doesn't seem to define any symbols!" >&4
22911 echo "However, your C preprocessor defines the following symbols:"
22914 cppsymbols=`$cat Cppsym.true`
22915 cppsymbols=`echo $cppsymbols`
22916 cppccsymbols="$cppsymbols"
22918 if $test -s ccsym.com; then
22919 echo "Your C compiler and pre-processor define these symbols:"
22920 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22923 cppccsymbols=`$cat ccsym.com`
22924 cppccsymbols=`echo $cppccsymbols`
22925 $test "$silent" || sleep 1
22927 if $test -s ccsym.cpp; then
22928 $test "$also" && echo " "
22929 echo "Your C pre-processor ${also}defines the following symbols:"
22930 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22932 cppsymbols=`$cat ccsym.cpp`
22933 cppsymbols=`echo $cppsymbols`
22934 $test "$silent" || sleep 1
22936 if $test -s ccsym.own; then
22937 $test "$also" && echo " "
22938 echo "Your C compiler ${also}defines the following cpp symbols:"
22939 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22940 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22941 ccsymbols=`$cat ccsym.own`
22942 ccsymbols=`echo $ccsymbols`
22943 $test "$silent" || sleep 1
22947 : add -D_FORTIFY_SOURCE if feasible and not already there
22948 case "$gccversion" in
22949 [4567].*) case "$optimize$ccflags" in
22950 *-O*) case "$ccflags$cppsymbols" in
22951 *_FORTIFY_SOURCE=*) # Don't add it again.
22952 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22954 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22955 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22959 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22963 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
22967 : script used to emit important warnings
22970 if test \$# -gt 0; then
22975 echo "*** WARNING:" >&4
22976 sed -e 's/^/*** /' <msg >&4
22978 cat msg >>config.msg
22979 echo " " >>config.msg
22985 : see if this is a termio system
22989 if $test `./findhdr termios.h`; then
22990 set tcsetattr i_termios
22996 "$define") echo "You have POSIX termios.h... good!" >&4;;
22997 *) if ./Cppsym pyr; then
22998 case "`$run /bin/universe`" in
22999 ucb) if $test `./findhdr sgtty.h`; then
23001 echo "<sgtty.h> found." >&4
23003 echo "System is pyramid with BSD universe."
23004 ./warn "<sgtty.h> not found--you could have problems."
23006 *) if $test `./findhdr termio.h`; then
23008 echo "<termio.h> found." >&4
23010 echo "System is pyramid with USG universe."
23011 ./warn "<termio.h> not found--you could have problems."
23015 if $test `./findhdr termio.h`; then
23016 echo "<termio.h> found." >&4
23018 elif $test `./findhdr sgtty.h`; then
23019 echo "<sgtty.h> found." >&4
23022 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23025 if $test `./findhdr sgtty.h`; then
23026 echo "<sgtty.h> found." >&4
23028 elif $test `./findhdr termio.h`; then
23029 echo "<termio.h> found." >&4
23032 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23036 set i_termio; eval $setvar
23037 val=$val2; set i_sgtty; eval $setvar
23038 val=$val3; set i_termios; eval $setvar
23040 : see if stdbool is available
23041 : we want a real compile instead of Inhdr because some Solaris systems
23042 : have stdbool.h, but it can only be used if the compiler indicates it
23043 : is sufficiently c99-compliant.
23047 #include <stdbool.h>
23052 int main(int argc, char **argv)
23058 if eval $compile; then
23059 echo "<stdbool.h> found." >&4
23062 echo "<stdbool.h> NOT found." >&4
23069 : see if stdint is available
23070 set stdint.h i_stdint
23073 : see if sys/access.h is available
23074 set sys/access.h i_sysaccess
23077 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23078 set sys/filio.h i_sysfilio
23081 if $test `./findhdr sys/ioctl.h`; then
23083 echo '<sys/ioctl.h> found.' >&4
23086 if $test $i_sysfilio = "$define"; then
23087 echo '<sys/ioctl.h> NOT found.' >&4
23089 $test $i_sgtty = "$define" && xxx="sgtty.h"
23090 $test $i_termio = "$define" && xxx="termio.h"
23091 $test $i_termios = "$define" && xxx="termios.h"
23092 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23098 : see if socket ioctl defs are in sys/sockio.h
23100 xxx=`./findhdr sys/sockio.h`
23101 if $test "$xxx"; then
23102 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23104 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23107 echo "No socket ioctls found in <sys/sockio.h>." >&4
23112 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23118 : see if this is a syslog.h system
23119 set syslog.h i_syslog
23122 : see if this is a sys/mode.h system
23123 set sys/mode.h i_sysmode
23126 : see if there is a sys/poll.h file
23127 set sys/poll.h i_syspoll
23130 : see if sys/resource.h has to be included
23131 set sys/resource.h i_sysresrc
23134 : see if sys/security.h is available
23135 set sys/security.h i_syssecrt
23138 : see if this is a sys/statvfs.h system
23139 set sys/statvfs.h i_sysstatvfs
23142 : see if this is a sys/un.h system
23143 set sys/un.h i_sysun
23146 : see if this is a sys/utsname.h system
23147 set sys/utsname.h i_sysutsname
23150 : see if this is a syswait system
23151 set sys/wait.h i_syswait
23154 : see if this is a ustat.h system
23155 set ustat.h i_ustat
23158 : see if this is an utime system
23159 set utime.h i_utime
23162 : see if this is a vfork system
23165 set vfork.h i_vfork
23173 : see if wchar.h is present
23174 set wchar.h i_wchar
23179 echo "Looking for extensions..." >&4
23180 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23181 : contain old or inaccurate or duplicate values.
23182 nonxs_extensions=''
23184 : We do not use find because it might not be available.
23185 : We do not just use MANIFEST because the user may have dropped
23186 : some additional extensions into the source tree and expect them
23189 : Function to recursively find available extensions, ignoring DynaLoader
23190 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23191 : In 5.10.1 and later, extensions are stored in directories
23192 : like File-Glob instead of the older File/Glob/.
23196 DynaLoader|dynaload) ;;
23198 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23199 case "$this_ext" in
23200 Scalar/List/Utils) this_ext="List/Util" ;;
23201 PathTools) this_ext="Cwd" ;;
23203 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23204 if $contains " $this_ext " "$tdir/$$.tmp"; then
23206 echo "Duplicate directories detected for extension $xxx" >&4;
23207 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23208 case "$knowitall" in
23216 echo "Ok. Stopping Configure." >&4;
23217 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23220 echo "Ok. You will need to correct config.sh before running make." >&4;
23222 $ls -1 "$xxx" > "$tdir/$$.tmp";
23223 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23224 xs_extensions="$xs_extensions $this_ext";
23225 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23226 xs_extensions="$xs_extensions $this_ext";
23227 elif $test -d "$xxx"; then
23228 nonxs_extensions="$nonxs_extensions $this_ext";
23230 $rm -f "$tdir/$$.tmp";
23238 eval $find_extensions
23242 eval $find_extensions
23246 eval $find_extensions
23247 set X $xs_extensions
23249 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23250 set X $nonxs_extensions
23252 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23254 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23256 : Now see which are supported on this system.
23258 for xxx in $xs_extensions ; do
23262 amigaos) avail_ext="$avail_ext $xxx" ;;
23267 $define) avail_ext="$avail_ext $xxx" ;;
23270 GDBM_File|gdbm_fil)
23272 $define) avail_ext="$avail_ext $xxx" ;;
23275 I18N/Langinfo|i18n_lan)
23276 case "$i_langinfo$d_nl_langinfo" in
23277 $define$define) avail_ext="$avail_ext $xxx" ;;
23281 : XXX Do we need a useipcsysv variable here
23282 case "${d_msg}${d_sem}${d_shm}" in
23283 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23286 NDBM_File|ndbm_fil)
23289 case "$osname-$use64bitint" in
23292 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23295 *) avail_ext="$avail_ext $xxx" ;;
23300 ODBM_File|odbm_fil)
23301 case "${i_dbm}${i_rpcsvcdbm}" in
23303 case "$d_cplusplus" in
23304 define) ;; # delete as a function name will not work
23305 *) case "$osname-$use64bitint" in
23308 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23311 *) avail_ext="$avail_ext $xxx" ;;
23319 case "$useopcode" in
23320 true|define|y) avail_ext="$avail_ext $xxx" ;;
23324 case "$useposix" in
23325 true|define|y) avail_ext="$avail_ext $xxx" ;;
23329 case "$d_socket" in
23330 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23333 Sys/Syslog|sys/syslog)
23335 amigaos) ;; # not really very useful on AmigaOS
23337 : XXX syslog requires socket
23338 case "$d_socket" in
23339 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23345 case "$usethreads" in
23347 case "$use5005threads" in
23348 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23352 threads|threads/shared)
23353 # threads and threads::shared are special cases.
23354 # To stop people from asking "Perl 5.8.0 was supposed
23355 # to have this new fancy threads implementation but my
23356 # perl doesn't have it" and from people trying to
23357 # (re)install the threads module using CPAN.pm and
23358 # CPAN.pm then offering to reinstall Perl 5.8.0,
23359 # the threads.pm and threads/shared.pm will always be
23360 # there, croaking informatively ("you need to rebuild
23361 # all of Perl with threads, sorry") when threads haven't
23362 # been compiled in.
23364 avail_ext="$avail_ext $xxx"
23370 cygwin) avail_ext="$avail_ext $xxx" ;;
23373 XS/APItest|xs/apitest)
23374 # This is just for testing. Skip it unless we have dynamic loading.
23377 $define) avail_ext="$avail_ext $xxx" ;;
23380 XS/Typemap|xs/typemap)
23381 # This is just for testing. Skip it unless we have dynamic loading.
23383 $define) avail_ext="$avail_ext $xxx" ;;
23386 *) avail_ext="$avail_ext $xxx"
23395 case "$onlyextensions" in
23397 *) keepextensions=''
23398 echo "You have requested that only certain extensions be included..." >&4
23399 for i in $onlyextensions; do
23400 case " $avail_ext " in
23402 echo "Keeping extension $i."
23403 keepextensions="$keepextensions $i"
23405 *) echo "Ignoring extension $i." ;;
23408 avail_ext="$keepextensions"
23412 case "$noextensions" in
23414 *) keepextensions=''
23415 echo "You have requested that certain extensions be ignored..." >&4
23416 for i in $avail_ext; do
23417 case " $noextensions " in
23418 *" $i "*) echo "Ignoring extension $i." ;;
23419 *) echo "Keeping extension $i.";
23420 keepextensions="$keepextensions $i"
23424 avail_ext="$keepextensions"
23428 : Now see which nonxs extensions are supported on this system.
23429 : For now assume all are.
23431 for xxx in $nonxs_extensions ; do
23435 *) nonxs_ext="$nonxs_ext $xxx"
23447 A number of extensions are supplied with $package. You may choose to
23448 compile these extensions for dynamic loading (the default), compile
23449 them into the $package executable (static loading), or not include
23450 them at all. Answer "none" to include no extensions.
23451 Note that DynaLoader is always built and need not be mentioned here.
23454 case "$dynamic_ext" in
23456 : Exclude those listed in static_ext
23458 for xxx in $avail_ext; do
23459 case " $static_ext " in
23461 *) dflt="$dflt $xxx" ;;
23468 *) dflt="$dynamic_ext"
23469 # Perhaps we are reusing an old out-of-date config.sh.
23472 if test X"$dynamic_ext" != X"$avail_ext"; then
23474 NOTICE: Your previous config.sh list may be incorrect.
23475 The extensions now available to you are
23477 but the default list from your previous config.sh is
23489 rp="What extensions do you wish to load dynamically?"
23492 none) dynamic_ext=' ' ;;
23493 *) dynamic_ext="$ans" ;;
23496 case "$static_ext" in
23498 : Exclude those already listed in dynamic linking
23500 for xxx in $avail_ext; do
23501 case " $dynamic_ext " in
23503 *) dflt="$dflt $xxx" ;;
23510 *) dflt="$static_ext"
23517 rp="What extensions do you wish to load statically?"
23520 none) static_ext=' ' ;;
23521 *) static_ext="$ans" ;;
23526 A number of extensions are supplied with $package. Answer "none"
23527 to include no extensions.
23528 Note that DynaLoader is always built and need not be mentioned here.
23531 case "$static_ext" in
23532 '') dflt="$avail_ext" ;;
23533 *) dflt="$static_ext"
23534 # Perhaps we are reusing an old out-of-date config.sh.
23537 if test X"$static_ext" != X"$avail_ext"; then
23539 NOTICE: Your previous config.sh list may be incorrect.
23540 The extensions now available to you are
23542 but the default list from your previous config.sh is
23551 : Exclude those that are not xs extensions
23555 rp="What extensions do you wish to include?"
23558 none) static_ext=' ' ;;
23559 *) static_ext="$ans" ;;
23564 # Encode is a special case. If we are building Encode as a static
23565 # extension, we need to explicitly list its subextensions as well.
23566 # For other nested extensions, this is handled automatically by
23567 # the appropriate Makefile.PL.
23568 case " $static_ext " in
23569 *" Encode "*) # Add the subextensions of Encode
23571 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23572 static_ext="$static_ext Encode/$xxx"
23573 known_extensions="$known_extensions Encode/$xxx"
23579 set X $dynamic_ext $static_ext $nonxs_ext
23583 # Sanity check: We require an extension suitable for use with
23584 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23585 # should show up as failures in the test suite, but it's helpful to
23586 # catch them now.) The 'extensions' list is normally sorted
23587 # alphabetically, so we need to accept either
23588 # DB_File ... Fcntl ... IO ....
23589 # or something like
23590 # Fcntl ... NDBM_File ... IO ....
23591 case " $extensions" in
23592 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23593 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23594 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23595 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23596 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23600 : Remove libraries needed only for extensions
23601 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23602 : The exception is SunOS 4.x, which needs them.
23603 case "${osname}X${osvers}" in
23607 *) case "$usedl" in
23608 $define|true|[yY]*)
23609 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23613 *) perllibs="$libs"
23619 : Remove build directory name from cppstdin so it can be used from
23620 : either the present location or the final installed location.
23622 : Get out of the UU directory to get correct path name.
23624 case "$cppstdin" in
23626 echo "Stripping down cppstdin path name"
23632 : end of configuration questions
23634 echo "End of configuration questions."
23637 : back to where it started
23638 if test -d ../UU; then
23642 : configuration may be unconditionally patched via a 'config.arch' file
23643 if $test -f config.arch; then
23644 echo "I see a config.arch file, loading it." >&4
23648 : configuration may be patched via a 'config.over' file
23649 if $test -f config.over; then
23652 rp='I see a config.over file. Do you wish to load it?'
23655 n*) echo "OK, I'll ignore it.";;
23657 echo "Configuration override changes have been loaded."
23662 : in case they want portability, strip down executable paths
23663 case "$d_portable" in
23666 echo "Stripping down executable paths..." >&4
23667 for file in $loclist $trylist; do
23669 eval $file=`basename $temp`
23674 : create config.sh file
23676 echo "Creating config.sh..." >&4
23677 $spitshell <<EOT >config.sh
23680 # This file was produced by running the Configure script. It holds all the
23681 # definitions figured out by Configure. Should you modify one of these values,
23682 # do not forget to propagate your changes by running "Configure -der". You may
23683 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23686 # Package name : $package
23687 # Source directory : $src
23688 # Configuration time: $cf_time
23689 # Configured by : $cf_by
23690 # Target system : $myuname
23693 : Add in command line options if available
23694 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23696 $spitshell <<EOT >>config.sh
23705 Revision='$Revision'
23713 alignbytes='$alignbytes'
23714 aphostname='$aphostname'
23715 api_revision='$api_revision'
23716 api_subversion='$api_subversion'
23717 api_version='$api_version'
23718 api_versionstring='$api_versionstring'
23721 archlibexp='$archlibexp'
23722 archname64='$archname64'
23723 archname='$archname'
23724 archobjs='$archobjs'
23725 asctime_r_proto='$asctime_r_proto'
23734 byteorder='$byteorder'
23736 castflags='$castflags'
23739 cccdlflags='$cccdlflags'
23740 ccdlflags='$ccdlflags'
23742 ccflags_uselargefiles='$ccflags_uselargefiles'
23744 ccsymbols='$ccsymbols'
23745 ccversion='$ccversion'
23747 cf_email='$cf_email'
23749 charbits='$charbits'
23750 charsize='$charsize'
23754 clocktype='$clocktype'
23756 compress='$compress'
23757 contains='$contains'
23761 cpp_stuff='$cpp_stuff'
23762 cppccsymbols='$cppccsymbols'
23763 cppflags='$cppflags'
23765 cppminus='$cppminus'
23767 cppstdin='$cppstdin'
23768 cppsymbols='$cppsymbols'
23769 crypt_r_proto='$crypt_r_proto'
23770 cryptlib='$cryptlib'
23772 ctermid_r_proto='$ctermid_r_proto'
23773 ctime_r_proto='$ctime_r_proto'
23774 d_Gconvert='$d_Gconvert'
23775 d_PRIEUldbl='$d_PRIEUldbl'
23776 d_PRIFUldbl='$d_PRIFUldbl'
23777 d_PRIGUldbl='$d_PRIGUldbl'
23778 d_PRIXU64='$d_PRIXU64'
23779 d_PRId64='$d_PRId64'
23780 d_PRIeldbl='$d_PRIeldbl'
23781 d_PRIfldbl='$d_PRIfldbl'
23782 d_PRIgldbl='$d_PRIgldbl'
23783 d_PRIi64='$d_PRIi64'
23784 d_PRIo64='$d_PRIo64'
23785 d_PRIu64='$d_PRIu64'
23786 d_PRIx64='$d_PRIx64'
23787 d_SCNfldbl='$d_SCNfldbl'
23788 d__fwalk='$d__fwalk'
23789 d_accept4='$d_accept4'
23790 d_access='$d_access'
23791 d_accessx='$d_accessx'
23795 d_archlib='$d_archlib'
23796 d_asctime64='$d_asctime64'
23797 d_asctime_r='$d_asctime_r'
23802 d_attribute_deprecated='$d_attribute_deprecated'
23803 d_attribute_format='$d_attribute_format'
23804 d_attribute_malloc='$d_attribute_malloc'
23805 d_attribute_nonnull='$d_attribute_nonnull'
23806 d_attribute_noreturn='$d_attribute_noreturn'
23807 d_attribute_pure='$d_attribute_pure'
23808 d_attribute_unused='$d_attribute_unused'
23809 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23810 d_backtrace='$d_backtrace'
23812 d_bsdgetpgrp='$d_bsdgetpgrp'
23813 d_bsdsetpgrp='$d_bsdsetpgrp'
23814 d_builtin_add_overflow='$d_builtin_add_overflow'
23815 d_builtin_choose_expr='$d_builtin_choose_expr'
23816 d_builtin_expect='$d_builtin_expect'
23817 d_builtin_mul_overflow='$d_builtin_mul_overflow'
23818 d_builtin_sub_overflow='$d_builtin_sub_overflow'
23819 d_c99_variadic_macros='$d_c99_variadic_macros'
23820 d_casti32='$d_casti32'
23821 d_castneg='$d_castneg'
23824 d_chroot='$d_chroot'
23825 d_chsize='$d_chsize'
23827 d_clearenv='$d_clearenv'
23828 d_closedir='$d_closedir'
23829 d_cmsghdr_s='$d_cmsghdr_s'
23831 d_copysign='$d_copysign'
23832 d_copysignl='$d_copysignl'
23833 d_cplusplus='$d_cplusplus'
23835 d_crypt_r='$d_crypt_r'
23837 d_ctermid='$d_ctermid'
23838 d_ctermid_r='$d_ctermid_r'
23839 d_ctime64='$d_ctime64'
23840 d_ctime_r='$d_ctime_r'
23841 d_cuserid='$d_cuserid'
23842 d_dbminitproto='$d_dbminitproto'
23843 d_difftime64='$d_difftime64'
23844 d_difftime='$d_difftime'
23845 d_dir_dd_fd='$d_dir_dd_fd'
23847 d_dirnamlen='$d_dirnamlen'
23848 d_dladdr='$d_dladdr'
23849 d_dlerror='$d_dlerror'
23850 d_dlopen='$d_dlopen'
23851 d_dlsymun='$d_dlsymun'
23852 d_dosuid='$d_dosuid'
23853 d_double_has_inf='$d_double_has_inf'
23854 d_double_has_nan='$d_double_has_nan'
23855 d_double_has_negative_zero='$d_double_has_negative_zero'
23856 d_double_has_subnormals='$d_double_has_subnormals'
23857 d_double_style_cray='$d_double_style_cray'
23858 d_double_style_ibm='$d_double_style_ibm'
23859 d_double_style_ieee='$d_double_style_ieee'
23860 d_double_style_vax='$d_double_style_vax'
23861 d_drand48_r='$d_drand48_r'
23862 d_drand48proto='$d_drand48proto'
23865 d_duplocale='$d_duplocale'
23866 d_eaccess='$d_eaccess'
23867 d_endgrent='$d_endgrent'
23868 d_endgrent_r='$d_endgrent_r'
23869 d_endhent='$d_endhent'
23870 d_endhostent_r='$d_endhostent_r'
23871 d_endnent='$d_endnent'
23872 d_endnetent_r='$d_endnetent_r'
23873 d_endpent='$d_endpent'
23874 d_endprotoent_r='$d_endprotoent_r'
23875 d_endpwent='$d_endpwent'
23876 d_endpwent_r='$d_endpwent_r'
23877 d_endsent='$d_endsent'
23878 d_endservent_r='$d_endservent_r'
23879 d_eofnblk='$d_eofnblk'
23882 d_eunice='$d_eunice'
23885 d_faststdio='$d_faststdio'
23886 d_fchdir='$d_fchdir'
23887 d_fchmod='$d_fchmod'
23888 d_fchmodat='$d_fchmodat'
23889 d_fchown='$d_fchown'
23891 d_fcntl_can_lock='$d_fcntl_can_lock'
23892 d_fd_macros='$d_fd_macros'
23893 d_fd_set='$d_fd_set'
23894 d_fdclose='$d_fdclose'
23896 d_fds_bits='$d_fds_bits'
23897 d_fegetround='$d_fegetround'
23898 d_fgetpos='$d_fgetpos'
23899 d_finite='$d_finite'
23900 d_finitel='$d_finitel'
23901 d_flexfnam='$d_flexfnam'
23903 d_flockproto='$d_flockproto'
23908 d_fp_class='$d_fp_class'
23909 d_fp_classify='$d_fp_classify'
23910 d_fp_classl='$d_fp_classl'
23911 d_fpathconf='$d_fpathconf'
23912 d_fpclass='$d_fpclass'
23913 d_fpclassify='$d_fpclassify'
23914 d_fpclassl='$d_fpclassl'
23915 d_fpgetround='$d_fpgetround'
23916 d_fpos64_t='$d_fpos64_t'
23917 d_freelocale='$d_freelocale'
23918 d_frexpl='$d_frexpl'
23919 d_fs_data_s='$d_fs_data_s'
23920 d_fseeko='$d_fseeko'
23921 d_fsetpos='$d_fsetpos'
23922 d_fstatfs='$d_fstatfs'
23923 d_fstatvfs='$d_fstatvfs'
23925 d_ftello='$d_ftello'
23927 d_futimes='$d_futimes'
23928 d_gai_strerror='$d_gai_strerror'
23929 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23930 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23931 d_getaddrinfo='$d_getaddrinfo'
23932 d_getcwd='$d_getcwd'
23933 d_getespwnam='$d_getespwnam'
23934 d_getfsstat='$d_getfsstat'
23935 d_getgrent='$d_getgrent'
23936 d_getgrent_r='$d_getgrent_r'
23937 d_getgrgid_r='$d_getgrgid_r'
23938 d_getgrnam_r='$d_getgrnam_r'
23939 d_getgrps='$d_getgrps'
23940 d_gethbyaddr='$d_gethbyaddr'
23941 d_gethbyname='$d_gethbyname'
23942 d_gethent='$d_gethent'
23943 d_gethname='$d_gethname'
23944 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23945 d_gethostbyname_r='$d_gethostbyname_r'
23946 d_gethostent_r='$d_gethostent_r'
23947 d_gethostprotos='$d_gethostprotos'
23948 d_getitimer='$d_getitimer'
23949 d_getlogin='$d_getlogin'
23950 d_getlogin_r='$d_getlogin_r'
23951 d_getmnt='$d_getmnt'
23952 d_getmntent='$d_getmntent'
23953 d_getnameinfo='$d_getnameinfo'
23954 d_getnbyaddr='$d_getnbyaddr'
23955 d_getnbyname='$d_getnbyname'
23956 d_getnent='$d_getnent'
23957 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23958 d_getnetbyname_r='$d_getnetbyname_r'
23959 d_getnetent_r='$d_getnetent_r'
23960 d_getnetprotos='$d_getnetprotos'
23961 d_getpagsz='$d_getpagsz'
23962 d_getpbyname='$d_getpbyname'
23963 d_getpbynumber='$d_getpbynumber'
23964 d_getpent='$d_getpent'
23965 d_getpgid='$d_getpgid'
23966 d_getpgrp2='$d_getpgrp2'
23967 d_getpgrp='$d_getpgrp'
23968 d_getppid='$d_getppid'
23969 d_getprior='$d_getprior'
23970 d_getprotobyname_r='$d_getprotobyname_r'
23971 d_getprotobynumber_r='$d_getprotobynumber_r'
23972 d_getprotoent_r='$d_getprotoent_r'
23973 d_getprotoprotos='$d_getprotoprotos'
23974 d_getprpwnam='$d_getprpwnam'
23975 d_getpwent='$d_getpwent'
23976 d_getpwent_r='$d_getpwent_r'
23977 d_getpwnam_r='$d_getpwnam_r'
23978 d_getpwuid_r='$d_getpwuid_r'
23979 d_getsbyname='$d_getsbyname'
23980 d_getsbyport='$d_getsbyport'
23981 d_getsent='$d_getsent'
23982 d_getservbyname_r='$d_getservbyname_r'
23983 d_getservbyport_r='$d_getservbyport_r'
23984 d_getservent_r='$d_getservent_r'
23985 d_getservprotos='$d_getservprotos'
23986 d_getspnam='$d_getspnam'
23987 d_getspnam_r='$d_getspnam_r'
23988 d_gettimeod='$d_gettimeod'
23989 d_gmtime64='$d_gmtime64'
23990 d_gmtime_r='$d_gmtime_r'
23991 d_gnulibc='$d_gnulibc'
23992 d_grpasswd='$d_grpasswd'
23993 d_hasmntopt='$d_hasmntopt'
23997 d_ilogbl='$d_ilogbl'
23998 d_inc_version_list='$d_inc_version_list'
23999 d_inetaton='$d_inetaton'
24000 d_inetntop='$d_inetntop'
24001 d_inetpton='$d_inetpton'
24002 d_int64_t='$d_int64_t'
24003 d_ip_mreq='$d_ip_mreq'
24004 d_ip_mreq_source='$d_ip_mreq_source'
24005 d_ipv6_mreq='$d_ipv6_mreq'
24006 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24007 d_isascii='$d_isascii'
24008 d_isblank='$d_isblank'
24009 d_isfinite='$d_isfinite'
24010 d_isfinitel='$d_isfinitel'
24012 d_isinfl='$d_isinfl'
24013 d_isless='$d_isless'
24015 d_isnanl='$d_isnanl'
24016 d_isnormal='$d_isnormal'
24019 d_killpg='$d_killpg'
24020 d_lc_monetary_2008='$d_lc_monetary_2008'
24021 d_lchown='$d_lchown'
24022 d_ldbl_dig='$d_ldbl_dig'
24023 d_ldexpl='$d_ldexpl'
24024 d_lgamma='$d_lgamma'
24025 d_lgamma_r='$d_lgamma_r'
24026 d_libm_lib_version='$d_libm_lib_version'
24027 d_libname_unique='$d_libname_unique'
24029 d_linkat='$d_linkat'
24030 d_llrint='$d_llrint'
24031 d_llrintl='$d_llrintl'
24032 d_llround='$d_llround'
24033 d_llroundl='$d_llroundl'
24034 d_localeconv_l='$d_localeconv_l'
24035 d_localtime64='$d_localtime64'
24036 d_localtime_r='$d_localtime_r'
24037 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24038 d_locconv='$d_locconv'
24043 d_long_double_style_ieee='$d_long_double_style_ieee'
24044 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24045 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24046 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24047 d_long_double_style_vax='$d_long_double_style_vax'
24048 d_longdbl='$d_longdbl'
24049 d_longlong='$d_longlong'
24051 d_lrintl='$d_lrintl'
24052 d_lround='$d_lround'
24053 d_lroundl='$d_lroundl'
24054 d_lseekproto='$d_lseekproto'
24056 d_madvise='$d_madvise'
24057 d_malloc_good_size='$d_malloc_good_size'
24058 d_malloc_size='$d_malloc_size'
24060 d_mbrlen='$d_mbrlen'
24061 d_mbrtowc='$d_mbrtowc'
24062 d_mbstowcs='$d_mbstowcs'
24063 d_mbtowc='$d_mbtowc'
24064 d_memmem='$d_memmem'
24065 d_memrchr='$d_memrchr'
24067 d_mkdtemp='$d_mkdtemp'
24068 d_mkfifo='$d_mkfifo'
24069 d_mkostemp='$d_mkostemp'
24070 d_mkstemp='$d_mkstemp'
24071 d_mkstemps='$d_mkstemps'
24072 d_mktime64='$d_mktime64'
24073 d_mktime='$d_mktime'
24076 d_modflproto='$d_modflproto'
24077 d_mprotect='$d_mprotect'
24079 d_msg_ctrunc='$d_msg_ctrunc'
24080 d_msg_dontroute='$d_msg_dontroute'
24081 d_msg_oob='$d_msg_oob'
24082 d_msg_peek='$d_msg_peek'
24083 d_msg_proxy='$d_msg_proxy'
24084 d_msgctl='$d_msgctl'
24085 d_msgget='$d_msgget'
24086 d_msghdr_s='$d_msghdr_s'
24087 d_msgrcv='$d_msgrcv'
24088 d_msgsnd='$d_msgsnd'
24090 d_munmap='$d_munmap'
24091 d_mymalloc='$d_mymalloc'
24093 d_nanosleep='$d_nanosleep'
24095 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24096 d_nearbyint='$d_nearbyint'
24097 d_newlocale='$d_newlocale'
24098 d_nextafter='$d_nextafter'
24099 d_nexttoward='$d_nexttoward'
24101 d_nl_langinfo='$d_nl_langinfo'
24102 d_nv_preserves_uv='$d_nv_preserves_uv'
24103 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24104 d_off64_t='$d_off64_t'
24105 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24106 d_oldpthreads='$d_oldpthreads'
24107 d_oldsock='$d_oldsock'
24109 d_openat='$d_openat'
24110 d_pathconf='$d_pathconf'
24112 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24113 d_phostname='$d_phostname'
24117 d_portable='$d_portable'
24119 d_prctl_set_name='$d_prctl_set_name'
24120 d_printf_format_null='$d_printf_format_null'
24121 d_procselfexe='$d_procselfexe'
24122 d_pseudofork='$d_pseudofork'
24123 d_pthread_atfork='$d_pthread_atfork'
24124 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24125 d_pthread_yield='$d_pthread_yield'
24126 d_ptrdiff_t='$d_ptrdiff_t'
24128 d_pwchange='$d_pwchange'
24129 d_pwclass='$d_pwclass'
24130 d_pwcomment='$d_pwcomment'
24131 d_pwexpire='$d_pwexpire'
24132 d_pwgecos='$d_pwgecos'
24133 d_pwpasswd='$d_pwpasswd'
24134 d_pwquota='$d_pwquota'
24137 d_querylocale='$d_querylocale'
24138 d_random_r='$d_random_r'
24139 d_re_comp='$d_re_comp'
24140 d_readdir64_r='$d_readdir64_r'
24141 d_readdir='$d_readdir'
24142 d_readdir_r='$d_readdir_r'
24143 d_readlink='$d_readlink'
24145 d_recvmsg='$d_recvmsg'
24146 d_regcmp='$d_regcmp'
24147 d_regcomp='$d_regcomp'
24148 d_remainder='$d_remainder'
24149 d_remquo='$d_remquo'
24150 d_rename='$d_rename'
24151 d_renameat='$d_renameat'
24152 d_rewinddir='$d_rewinddir'
24156 d_sbrkproto='$d_sbrkproto'
24157 d_scalbn='$d_scalbn'
24158 d_scalbnl='$d_scalbnl'
24159 d_sched_yield='$d_sched_yield'
24160 d_scm_rights='$d_scm_rights'
24161 d_seekdir='$d_seekdir'
24162 d_select='$d_select'
24164 d_semctl='$d_semctl'
24165 d_semctl_semid_ds='$d_semctl_semid_ds'
24166 d_semctl_semun='$d_semctl_semun'
24167 d_semget='$d_semget'
24169 d_sendmsg='$d_sendmsg'
24170 d_setegid='$d_setegid'
24171 d_seteuid='$d_seteuid'
24172 d_setgrent='$d_setgrent'
24173 d_setgrent_r='$d_setgrent_r'
24174 d_setgrps='$d_setgrps'
24175 d_sethent='$d_sethent'
24176 d_sethostent_r='$d_sethostent_r'
24177 d_setitimer='$d_setitimer'
24178 d_setlinebuf='$d_setlinebuf'
24179 d_setlocale='$d_setlocale'
24180 d_setlocale_r='$d_setlocale_r'
24181 d_setnent='$d_setnent'
24182 d_setnetent_r='$d_setnetent_r'
24183 d_setpent='$d_setpent'
24184 d_setpgid='$d_setpgid'
24185 d_setpgrp2='$d_setpgrp2'
24186 d_setpgrp='$d_setpgrp'
24187 d_setprior='$d_setprior'
24188 d_setproctitle='$d_setproctitle'
24189 d_setprotoent_r='$d_setprotoent_r'
24190 d_setpwent='$d_setpwent'
24191 d_setpwent_r='$d_setpwent_r'
24192 d_setregid='$d_setregid'
24193 d_setresgid='$d_setresgid'
24194 d_setresuid='$d_setresuid'
24195 d_setreuid='$d_setreuid'
24196 d_setrgid='$d_setrgid'
24197 d_setruid='$d_setruid'
24198 d_setsent='$d_setsent'
24199 d_setservent_r='$d_setservent_r'
24200 d_setsid='$d_setsid'
24201 d_setvbuf='$d_setvbuf'
24204 d_shmatprototype='$d_shmatprototype'
24205 d_shmctl='$d_shmctl'
24207 d_shmget='$d_shmget'
24208 d_sigaction='$d_sigaction'
24209 d_siginfo_si_addr='$d_siginfo_si_addr'
24210 d_siginfo_si_band='$d_siginfo_si_band'
24211 d_siginfo_si_errno='$d_siginfo_si_errno'
24212 d_siginfo_si_fd='$d_siginfo_si_fd'
24213 d_siginfo_si_pid='$d_siginfo_si_pid'
24214 d_siginfo_si_status='$d_siginfo_si_status'
24215 d_siginfo_si_uid='$d_siginfo_si_uid'
24216 d_siginfo_si_value='$d_siginfo_si_value'
24217 d_signbit='$d_signbit'
24218 d_sigprocmask='$d_sigprocmask'
24219 d_sigsetjmp='$d_sigsetjmp'
24220 d_sin6_scope_id='$d_sin6_scope_id'
24221 d_sitearch='$d_sitearch'
24222 d_snprintf='$d_snprintf'
24223 d_sockaddr_in6='$d_sockaddr_in6'
24224 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24225 d_sockatmark='$d_sockatmark'
24226 d_sockatmarkproto='$d_sockatmarkproto'
24227 d_socket='$d_socket'
24228 d_socklen_t='$d_socklen_t'
24229 d_sockpair='$d_sockpair'
24230 d_socks5_init='$d_socks5_init'
24232 d_srand48_r='$d_srand48_r'
24233 d_srandom_r='$d_srandom_r'
24234 d_sresgproto='$d_sresgproto'
24235 d_sresuproto='$d_sresuproto'
24237 d_statblks='$d_statblks'
24238 d_statfs_f_flags='$d_statfs_f_flags'
24239 d_statfs_s='$d_statfs_s'
24240 d_static_inline='$d_static_inline'
24241 d_statvfs='$d_statvfs'
24242 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24243 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24244 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24245 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24246 d_stdio_stream_array='$d_stdio_stream_array'
24247 d_stdiobase='$d_stdiobase'
24248 d_stdstdio='$d_stdstdio'
24249 d_strcoll='$d_strcoll'
24250 d_strerror_l='$d_strerror_l'
24251 d_strerror_r='$d_strerror_r'
24252 d_strftime='$d_strftime'
24253 d_strlcat='$d_strlcat'
24254 d_strlcpy='$d_strlcpy'
24255 d_strnlen='$d_strnlen'
24256 d_strtod='$d_strtod'
24257 d_strtol='$d_strtol'
24258 d_strtold='$d_strtold'
24259 d_strtold_l='$d_strtold_l'
24260 d_strtoll='$d_strtoll'
24261 d_strtoq='$d_strtoq'
24262 d_strtoul='$d_strtoul'
24263 d_strtoull='$d_strtoull'
24264 d_strtouq='$d_strtouq'
24265 d_strxfrm='$d_strxfrm'
24266 d_suidsafe='$d_suidsafe'
24267 d_symlink='$d_symlink'
24268 d_syscall='$d_syscall'
24269 d_syscallproto='$d_syscallproto'
24270 d_sysconf='$d_sysconf'
24271 d_sysernlst='$d_sysernlst'
24272 d_syserrlst='$d_syserrlst'
24273 d_system='$d_system'
24274 d_tcgetpgrp='$d_tcgetpgrp'
24275 d_tcsetpgrp='$d_tcsetpgrp'
24276 d_telldir='$d_telldir'
24277 d_telldirproto='$d_telldirproto'
24278 d_tgamma='$d_tgamma'
24279 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24281 d_timegm='$d_timegm'
24283 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24284 d_tm_tm_zone='$d_tm_tm_zone'
24285 d_tmpnam_r='$d_tmpnam_r'
24287 d_truncate='$d_truncate'
24288 d_truncl='$d_truncl'
24289 d_ttyname_r='$d_ttyname_r'
24290 d_tzname='$d_tzname'
24291 d_u32align='$d_u32align'
24292 d_ualarm='$d_ualarm'
24295 d_union_semun='$d_union_semun'
24296 d_unlinkat='$d_unlinkat'
24297 d_unordered='$d_unordered'
24298 d_unsetenv='$d_unsetenv'
24299 d_uselocale='$d_uselocale'
24300 d_usleep='$d_usleep'
24301 d_usleepproto='$d_usleepproto'
24303 d_vendorarch='$d_vendorarch'
24304 d_vendorbin='$d_vendorbin'
24305 d_vendorlib='$d_vendorlib'
24306 d_vendorscript='$d_vendorscript'
24308 d_void_closedir='$d_void_closedir'
24309 d_voidsig='$d_voidsig'
24310 d_voidtty='$d_voidtty'
24311 d_vsnprintf='$d_vsnprintf'
24313 d_waitpid='$d_waitpid'
24314 d_wcscmp='$d_wcscmp'
24315 d_wcstombs='$d_wcstombs'
24316 d_wcsxfrm='$d_wcsxfrm'
24317 d_wctomb='$d_wctomb'
24318 d_writev='$d_writev'
24321 db_hashtype='$db_hashtype'
24322 db_prefixtype='$db_prefixtype'
24323 db_version_major='$db_version_major'
24324 db_version_minor='$db_version_minor'
24325 db_version_patch='$db_version_patch'
24326 default_inc_excludes_dot='$default_inc_excludes_dot'
24327 direntrytype='$direntrytype'
24330 doubleinfbytes='$doubleinfbytes'
24331 doublekind='$doublekind'
24332 doublemantbits='$doublemantbits'
24333 doublenanbytes='$doublenanbytes'
24334 doublesize='$doublesize'
24336 drand48_r_proto='$drand48_r_proto'
24338 dtraceobject='$dtraceobject'
24339 dtracexnolibs='$dtracexnolibs'
24340 dynamic_ext='$dynamic_ext'
24346 endgrent_r_proto='$endgrent_r_proto'
24347 endhostent_r_proto='$endhostent_r_proto'
24348 endnetent_r_proto='$endnetent_r_proto'
24349 endprotoent_r_proto='$endprotoent_r_proto'
24350 endpwent_r_proto='$endpwent_r_proto'
24351 endservent_r_proto='$endservent_r_proto'
24352 eunicefix='$eunicefix'
24355 extensions='$extensions'
24356 extern_C='$extern_C'
24358 fflushNULL='$fflushNULL'
24359 fflushall='$fflushall'
24361 firstmakefile='$firstmakefile'
24363 fpossize='$fpossize'
24364 fpostype='$fpostype'
24365 freetype='$freetype'
24368 full_csh='$full_csh'
24369 full_sed='$full_sed'
24370 gccansipedantic='$gccansipedantic'
24371 gccosandvers='$gccosandvers'
24372 gccversion='$gccversion'
24373 getgrent_r_proto='$getgrent_r_proto'
24374 getgrgid_r_proto='$getgrgid_r_proto'
24375 getgrnam_r_proto='$getgrnam_r_proto'
24376 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24377 gethostbyname_r_proto='$gethostbyname_r_proto'
24378 gethostent_r_proto='$gethostent_r_proto'
24379 getlogin_r_proto='$getlogin_r_proto'
24380 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24381 getnetbyname_r_proto='$getnetbyname_r_proto'
24382 getnetent_r_proto='$getnetent_r_proto'
24383 getprotobyname_r_proto='$getprotobyname_r_proto'
24384 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24385 getprotoent_r_proto='$getprotoent_r_proto'
24386 getpwent_r_proto='$getpwent_r_proto'
24387 getpwnam_r_proto='$getpwnam_r_proto'
24388 getpwuid_r_proto='$getpwuid_r_proto'
24389 getservbyname_r_proto='$getservbyname_r_proto'
24390 getservbyport_r_proto='$getservbyport_r_proto'
24391 getservent_r_proto='$getservent_r_proto'
24392 getspnam_r_proto='$getspnam_r_proto'
24393 gidformat='$gidformat'
24399 gmtime_r_proto='$gmtime_r_proto'
24400 gnulibc_version='$gnulibc_version'
24402 groupcat='$groupcat'
24403 groupstype='$groupstype'
24406 h_sysfile='$h_sysfile'
24409 hostgenerate='$hostgenerate'
24410 hostosname='$hostosname'
24411 hostperl='$hostperl'
24412 html1dir='$html1dir'
24413 html1direxp='$html1direxp'
24414 html3dir='$html3dir'
24415 html3direxp='$html3direxp'
24424 i_arpainet='$i_arpainet'
24426 i_bsdioctl='$i_bsdioctl'
24430 i_dirent='$i_dirent'
24432 i_execinfo='$i_execinfo'
24436 i_fp_class='$i_fp_class'
24438 i_gdbm_ndbm='$i_gdbm_ndbm'
24439 i_gdbmndbm='$i_gdbmndbm'
24441 i_ieeefp='$i_ieeefp'
24442 i_inttypes='$i_inttypes'
24443 i_langinfo='$i_langinfo'
24444 i_libutil='$i_libutil'
24445 i_locale='$i_locale'
24446 i_machcthr='$i_machcthr'
24447 i_malloc='$i_malloc'
24448 i_mallocmalloc='$i_mallocmalloc'
24449 i_mntent='$i_mntent'
24452 i_neterrno='$i_neterrno'
24453 i_netinettcp='$i_netinettcp'
24457 i_pthread='$i_pthread'
24459 i_quadmath='$i_quadmath'
24460 i_rpcsvcdbm='$i_rpcsvcdbm'
24462 i_shadow='$i_shadow'
24464 i_stdbool='$i_stdbool'
24465 i_stdint='$i_stdint'
24466 i_stdlib='$i_stdlib'
24467 i_sunmath='$i_sunmath'
24468 i_sysaccess='$i_sysaccess'
24469 i_sysdir='$i_sysdir'
24470 i_sysfile='$i_sysfile'
24471 i_sysfilio='$i_sysfilio'
24473 i_sysioctl='$i_sysioctl'
24474 i_syslog='$i_syslog'
24475 i_sysmman='$i_sysmman'
24476 i_sysmode='$i_sysmode'
24477 i_sysmount='$i_sysmount'
24478 i_sysndir='$i_sysndir'
24479 i_sysparam='$i_sysparam'
24480 i_syspoll='$i_syspoll'
24481 i_sysresrc='$i_sysresrc'
24482 i_syssecrt='$i_syssecrt'
24483 i_sysselct='$i_sysselct'
24484 i_syssockio='$i_syssockio'
24485 i_sysstat='$i_sysstat'
24486 i_sysstatfs='$i_sysstatfs'
24487 i_sysstatvfs='$i_sysstatvfs'
24488 i_systime='$i_systime'
24489 i_systimek='$i_systimek'
24490 i_systimes='$i_systimes'
24491 i_systypes='$i_systypes'
24492 i_sysuio='$i_sysuio'
24494 i_sysutsname='$i_sysutsname'
24495 i_sysvfs='$i_sysvfs'
24496 i_syswait='$i_syswait'
24497 i_termio='$i_termio'
24498 i_termios='$i_termios'
24500 i_unistd='$i_unistd'
24505 i_xlocale='$i_xlocale'
24506 ignore_versioned_solibs='$ignore_versioned_solibs'
24507 inc_version_list='$inc_version_list'
24508 inc_version_list_init='$inc_version_list_init'
24512 initialinstalllocation='$initialinstalllocation'
24513 installarchlib='$installarchlib'
24514 installbin='$installbin'
24515 installhtml1dir='$installhtml1dir'
24516 installhtml3dir='$installhtml3dir'
24517 installman1dir='$installman1dir'
24518 installman3dir='$installman3dir'
24519 installprefix='$installprefix'
24520 installprefixexp='$installprefixexp'
24521 installprivlib='$installprivlib'
24522 installscript='$installscript'
24523 installsitearch='$installsitearch'
24524 installsitebin='$installsitebin'
24525 installsitehtml1dir='$installsitehtml1dir'
24526 installsitehtml3dir='$installsitehtml3dir'
24527 installsitelib='$installsitelib'
24528 installsiteman1dir='$installsiteman1dir'
24529 installsiteman3dir='$installsiteman3dir'
24530 installsitescript='$installsitescript'
24531 installstyle='$installstyle'
24532 installusrbinperl='$installusrbinperl'
24533 installvendorarch='$installvendorarch'
24534 installvendorbin='$installvendorbin'
24535 installvendorhtml1dir='$installvendorhtml1dir'
24536 installvendorhtml3dir='$installvendorhtml3dir'
24537 installvendorlib='$installvendorlib'
24538 installvendorman1dir='$installvendorman1dir'
24539 installvendorman3dir='$installvendorman3dir'
24540 installvendorscript='$installvendorscript'
24542 issymlink='$issymlink'
24543 ivdformat='$ivdformat'
24546 known_extensions='$known_extensions'
24549 ld_can_script='$ld_can_script'
24550 lddlflags='$lddlflags'
24552 ldflags_uselargefiles='$ldflags_uselargefiles'
24553 ldlibpthname='$ldlibpthname'
24560 libsdirs='$libsdirs'
24561 libsfiles='$libsfiles'
24562 libsfound='$libsfound'
24563 libspath='$libspath'
24564 libswanted='$libswanted'
24565 libswanted_uselargefiles='$libswanted_uselargefiles'
24571 localtime_r_proto='$localtime_r_proto'
24572 locincpth='$locincpth'
24573 loclibpth='$loclibpth'
24574 longdblinfbytes='$longdblinfbytes'
24575 longdblkind='$longdblkind'
24576 longdblmantbits='$longdblmantbits'
24577 longdblnanbytes='$longdblnanbytes'
24578 longdblsize='$longdblsize'
24579 longlongsize='$longlongsize'
24580 longsize='$longsize'
24584 lseeksize='$lseeksize'
24585 lseektype='$lseektype'
24589 make_set_make='$make_set_make'
24590 mallocobj='$mallocobj'
24591 mallocsrc='$mallocsrc'
24592 malloctype='$malloctype'
24594 man1direxp='$man1direxp'
24597 man3direxp='$man3direxp'
24599 mips_type='$mips_type'
24600 mistrustnm='$mistrustnm'
24602 mmaptype='$mmaptype'
24603 modetype='$modetype'
24605 multiarch='$multiarch'
24607 myarchname='$myarchname'
24608 mydomain='$mydomain'
24609 myhostname='$myhostname'
24612 need_va_copy='$need_va_copy'
24613 netdb_hlen_type='$netdb_hlen_type'
24614 netdb_host_type='$netdb_host_type'
24615 netdb_name_type='$netdb_name_type'
24616 netdb_net_type='$netdb_net_type'
24619 nm_so_opt='$nm_so_opt'
24620 nonxs_ext='$nonxs_ext'
24622 nvEUformat='$nvEUformat'
24623 nvFUformat='$nvFUformat'
24624 nvGUformat='$nvGUformat'
24625 nv_overflows_integers_at='$nv_overflows_integers_at'
24626 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24627 nveformat='$nveformat'
24628 nvfformat='$nvfformat'
24629 nvgformat='$nvgformat'
24630 nvmantbits='$nvmantbits'
24633 o_nonblock='$o_nonblock'
24635 old_pthread_create_joinable='$old_pthread_create_joinable'
24636 optimize='$optimize'
24637 orderlib='$orderlib'
24640 otherlibdirs='$otherlibdirs'
24644 patchlevel='$patchlevel'
24645 path_sep='$path_sep'
24648 perl_patchlevel='$perl_patchlevel'
24649 perl_static_inline='$perl_static_inline'
24650 perladmin='$perladmin'
24651 perllibs='$perllibs'
24652 perlpath='$perlpath'
24654 phostname='$phostname'
24660 prefixexp='$prefixexp'
24662 privlibexp='$privlibexp'
24663 procselfexe='$procselfexe'
24665 quadkind='$quadkind'
24666 quadtype='$quadtype'
24667 randbits='$randbits'
24668 randfunc='$randfunc'
24669 random_r_proto='$random_r_proto'
24670 randseedtype='$randseedtype'
24672 rd_nodata='$rd_nodata'
24673 readdir64_r_proto='$readdir64_r_proto'
24674 readdir_r_proto='$readdir_r_proto'
24675 revision='$revision'
24681 sGMTIME_max='$sGMTIME_max'
24682 sGMTIME_min='$sGMTIME_min'
24683 sLOCALTIME_max='$sLOCALTIME_max'
24684 sLOCALTIME_min='$sLOCALTIME_min'
24685 sPRIEUldbl='$sPRIEUldbl'
24686 sPRIFUldbl='$sPRIFUldbl'
24687 sPRIGUldbl='$sPRIGUldbl'
24688 sPRIXU64='$sPRIXU64'
24690 sPRIeldbl='$sPRIeldbl'
24691 sPRIfldbl='$sPRIfldbl'
24692 sPRIgldbl='$sPRIgldbl'
24697 sSCNfldbl='$sSCNfldbl'
24698 sched_yield='$sched_yield'
24699 scriptdir='$scriptdir'
24700 scriptdirexp='$scriptdirexp'
24702 seedfunc='$seedfunc'
24703 selectminbits='$selectminbits'
24704 selecttype='$selecttype'
24705 sendmail='$sendmail'
24706 setgrent_r_proto='$setgrent_r_proto'
24707 sethostent_r_proto='$sethostent_r_proto'
24708 setlocale_r_proto='$setlocale_r_proto'
24709 setnetent_r_proto='$setnetent_r_proto'
24710 setprotoent_r_proto='$setprotoent_r_proto'
24711 setpwent_r_proto='$setpwent_r_proto'
24712 setservent_r_proto='$setservent_r_proto'
24715 sharpbang='$sharpbang'
24716 shmattype='$shmattype'
24717 shortsize='$shortsize'
24720 sig_count='$sig_count'
24721 sig_name='$sig_name'
24722 sig_name_init='$sig_name_init'
24724 sig_num_init='$sig_num_init'
24725 sig_size='$sig_size'
24726 signal_t='$signal_t'
24727 sitearch='$sitearch'
24728 sitearchexp='$sitearchexp'
24730 sitebinexp='$sitebinexp'
24731 sitehtml1dir='$sitehtml1dir'
24732 sitehtml1direxp='$sitehtml1direxp'
24733 sitehtml3dir='$sitehtml3dir'
24734 sitehtml3direxp='$sitehtml3direxp'
24736 sitelib_stem='$sitelib_stem'
24737 sitelibexp='$sitelibexp'
24738 siteman1dir='$siteman1dir'
24739 siteman1direxp='$siteman1direxp'
24740 siteman3dir='$siteman3dir'
24741 siteman3direxp='$siteman3direxp'
24742 siteprefix='$siteprefix'
24743 siteprefixexp='$siteprefixexp'
24744 sitescript='$sitescript'
24745 sitescriptexp='$sitescriptexp'
24746 sizesize='$sizesize'
24747 sizetype='$sizetype'
24751 sockethdr='$sockethdr'
24752 socketlib='$socketlib'
24753 socksizetype='$socksizetype'
24755 spackage='$spackage'
24756 spitshell='$spitshell'
24757 srand48_r_proto='$srand48_r_proto'
24758 srandom_r_proto='$srandom_r_proto'
24760 ssizetype='$ssizetype'
24761 st_ino_sign='$st_ino_sign'
24762 st_ino_size='$st_ino_size'
24763 startperl='$startperl'
24765 static_ext='$static_ext'
24767 stdio_base='$stdio_base'
24768 stdio_bufsiz='$stdio_bufsiz'
24769 stdio_cnt='$stdio_cnt'
24770 stdio_filbuf='$stdio_filbuf'
24771 stdio_ptr='$stdio_ptr'
24772 stdio_stream_array='$stdio_stream_array'
24773 strerror_r_proto='$strerror_r_proto'
24775 subversion='$subversion'
24780 targetarch='$targetarch'
24781 targetdir='$targetdir'
24782 targetenv='$targetenv'
24783 targethost='$targethost'
24784 targetmkdir='$targetmkdir'
24785 targetport='$targetport'
24786 targetsh='$targetsh'
24790 timeincl='$timeincl'
24791 timetype='$timetype'
24792 tmpnam_r_proto='$tmpnam_r_proto'
24798 ttyname_r_proto='$ttyname_r_proto'
24807 uidformat='$uidformat'
24813 uquadtype='$uquadtype'
24814 use5005threads='$use5005threads'
24815 use64bitall='$use64bitall'
24816 use64bitint='$use64bitint'
24817 usecbacktrace='$usecbacktrace'
24818 usecrosscompile='$usecrosscompile'
24819 usedevel='$usedevel'
24821 usedtrace='$usedtrace'
24822 usefaststdio='$usefaststdio'
24823 useithreads='$useithreads'
24824 usekernprocpathname='$usekernprocpathname'
24825 uselargefiles='$uselargefiles'
24826 uselongdouble='$uselongdouble'
24827 usemallocwrap='$usemallocwrap'
24828 usemorebits='$usemorebits'
24829 usemultiplicity='$usemultiplicity'
24830 usemymalloc='$usemymalloc'
24832 usensgetexecutablepath='$usensgetexecutablepath'
24833 useopcode='$useopcode'
24834 useperlio='$useperlio'
24835 useposix='$useposix'
24836 usequadmath='$usequadmath'
24837 usereentrant='$usereentrant'
24838 userelocatableinc='$userelocatableinc'
24839 useshrplib='$useshrplib'
24840 usesitecustomize='$usesitecustomize'
24841 usesocks='$usesocks'
24842 usethreads='$usethreads'
24843 usevendorprefix='$usevendorprefix'
24844 useversionedarchname='$useversionedarchname'
24845 usevfork='$usevfork'
24848 uvXUformat='$uvXUformat'
24849 uvoformat='$uvoformat'
24852 uvuformat='$uvuformat'
24853 uvxformat='$uvxformat'
24854 vendorarch='$vendorarch'
24855 vendorarchexp='$vendorarchexp'
24856 vendorbin='$vendorbin'
24857 vendorbinexp='$vendorbinexp'
24858 vendorhtml1dir='$vendorhtml1dir'
24859 vendorhtml1direxp='$vendorhtml1direxp'
24860 vendorhtml3dir='$vendorhtml3dir'
24861 vendorhtml3direxp='$vendorhtml3direxp'
24862 vendorlib='$vendorlib'
24863 vendorlib_stem='$vendorlib_stem'
24864 vendorlibexp='$vendorlibexp'
24865 vendorman1dir='$vendorman1dir'
24866 vendorman1direxp='$vendorman1direxp'
24867 vendorman3dir='$vendorman3dir'
24868 vendorman3direxp='$vendorman3direxp'
24869 vendorprefix='$vendorprefix'
24870 vendorprefixexp='$vendorprefixexp'
24871 vendorscript='$vendorscript'
24872 vendorscriptexp='$vendorscriptexp'
24874 version_patchlevel_string='$version_patchlevel_string'
24875 versiononly='$versiononly'
24879 yaccflags='$yaccflags'
24884 : add special variables
24885 $test -f $src/patchlevel.h && \
24886 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24887 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24888 echo "PERL_CONFIG_SH=true" >>config.sh
24890 : propagate old symbols
24891 if $test -f UU/config.sh; then
24892 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24893 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24894 config.sh config.sh UU/oldconfig.sh |\
24895 $sort | $uniq -u >UU/oldsyms
24896 set X `$cat UU/oldsyms`
24902 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24904 echo ": Variables propagated from previous config.sh file." >>config.sh
24905 for sym in `$cat UU/oldsyms`; do
24906 echo " Propagating $hint variable "'$'"$sym..."
24907 eval 'tmp="$'"${sym}"'"'
24909 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24915 : preserve RCS keywords in files with variable substitution, grrr
24918 : Finish up by extracting the .SH files
24921 echo "Stopping at your request, leaving temporary files around."
24931 If you'd like to make any changes to the config.sh file before I begin
24932 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24935 rp="Press return or use a shell escape to edit config.sh:"
24940 *) : in case they cannot read
24941 sh 1>&4 -c "$ans";;
24946 : if this fails, just run all the .SH files by hand
24955 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24962 Now you need to generate make dependencies by running "$make depend".
24963 You might prefer to run it in background: "$make depend > makedepend.out &"
24964 It can take a while, so you might not want to run it right now.
24969 rp="Run $make depend now?"
24973 $make depend && echo "Now you must run '$make'."
24976 echo "You must run '$make depend' then '$make'."
24979 elif test -f [Mm]akefile; then
24981 echo "Now you must run a $make."
24983 echo "Configure done."
24986 if $test -f Policy.sh; then
24989 If you compile $package on a different machine or from a different object
24990 directory, copy the Policy.sh file from this object directory to the
24991 new one before you run Configure -- this will help you with most of
24992 the policy defaults.
24996 if $test -f UU/config.msg; then
24997 echo "Hmm. I also noted the following information while running:"
24999 $cat UU/config.msg >&4
25001 $rm -f kit*isdone ark*isdone