3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # (with additional metaconfig patches by perlbug@perl.org)
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
385 d_attribute_deprecated=''
386 d_attribute_format=''
387 d_attribute_malloc=''
388 d_attribute_nonnull=''
389 d_attribute_noreturn=''
391 d_attribute_unused=''
392 d_attribute_warn_unused_result=''
393 d_printf_format_null=''
395 d_builtin_choose_expr=''
397 d_builtin_add_overflow=''
398 d_builtin_mul_overflow=''
399 d_builtin_sub_overflow=''
400 d_c99_variadic_macros=''
450 endhostent_r_proto=''
456 endprotoent_r_proto=''
462 endservent_r_proto=''
534 gethostbyaddr_r_proto=''
536 gethostbyname_r_proto=''
538 gethostent_r_proto=''
551 getnetbyaddr_r_proto=''
553 getnetbyname_r_proto=''
567 d_getprotobyname_r=''
568 getprotobyname_r_proto=''
569 d_getprotobynumber_r=''
570 getprotobynumber_r_proto=''
572 getprotoent_r_proto=''
584 getservbyname_r_proto=''
586 getservbyport_r_proto=''
588 getservent_r_proto=''
621 d_lc_monetary_2008=''
626 d_libm_lib_version=''
634 d_localtime_r_needs_tzset=''
642 d_long_double_style_ieee=''
643 d_long_double_style_ieee_doubledouble=''
644 d_long_double_style_ieee_extended=''
645 d_long_double_style_ieee_std=''
646 d_long_double_style_vax=''
659 d_malloc_good_size=''
701 d_thread_safe_nl_langinfo_l=''
715 d_old_pthread_create_joinable=''
716 old_pthread_create_joinable=''
718 d_pthread_attr_setscope=''
763 sethostent_r_proto=''
780 setprotoent_r_proto=''
792 setservent_r_proto=''
805 d_siginfo_si_errno=''
808 d_siginfo_si_status=''
810 d_siginfo_si_value=''
822 d_ipv6_mreq_source=''
851 perl_static_inline=''
856 d_stdio_ptr_lval_nochange_cnt=''
857 d_stdio_ptr_lval_sets_cnt=''
936 default_inc_excludes_dot=''
1002 d_gdbm_ndbm_h_uses_prototypes=''
1003 d_gdbmndbm_h_uses_prototypes=''
1005 d_ndbm_h_uses_prototypes=''
1075 d_inc_version_list=''
1077 inc_version_list_init=''
1085 installusrbinperl=''
1101 ignore_versioned_solibs=''
1117 d_double_has_negative_zero=''
1118 d_double_has_subnormals=''
1119 d_double_style_cray=''
1120 d_double_style_ibm=''
1121 d_double_style_ieee=''
1122 d_double_style_vax=''
1173 d_perl_otherlibdirs=''
1181 api_versionstring=''
1187 version_patchlevel_string=''
1191 d_nv_preserves_uv=''
1192 d_nv_zero_is_allbits_zero=''
1203 nv_overflows_integers_at=''
1204 nv_preserves_uv_bits=''
1276 installsitehtml1dir=''
1279 installsitehtml3dir=''
1286 installsiteman1dir=''
1289 installsiteman3dir=''
1294 installsitescript=''
1312 d_stdio_stream_array=''
1313 stdio_stream_array=''
1331 usekernprocpathname=''
1332 ccflags_uselargefiles=''
1333 ldflags_uselargefiles=''
1334 libswanted_uselargefiles=''
1343 usensgetexecutablepath=''
1356 installvendorarch=''
1363 installvendorhtml1dir=''
1365 vendorhtml1direxp=''
1366 installvendorhtml3dir=''
1368 vendorhtml3direxp=''
1374 installvendorman1dir=''
1377 installvendorman3dir=''
1384 installvendorscript=''
1395 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1398 : We must find out about Eunice early
1400 if test -f /etc/unixtovms; then
1401 eunicefix=/etc/unixtovms
1403 if test -f /etc/unixtovms.exe; then
1404 eunicefix=/etc/unixtovms.exe
1407 : Set executable suffix now -- needed before hints available
1408 if test -f "/libs/version.library"; then
1411 elif test -f "/system/gnu_library/bin/ar.pm"; then
1414 elif test -n "$DJGPP"; then
1417 elif test -f /kern/cookiejar; then
1420 elif test -d c:/. -o -n "$is_os2" ; then
1427 : Possible local include directories to search.
1428 : Set locincpth to "" in a hint file to defeat local include searches.
1429 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1430 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1432 : no include file wanted by default
1435 : Enable -DEBUGGING and -DDEBUGGING from the command line
1439 : Trailing extension. Override this in a hint file, if needed.
1440 : Extra object files, if any, needed on this platform.
1443 : change the next line if compiling for Xenix/286 on Xenix/386
1444 xlibpth='/usr/lib/386 /lib/386'
1445 : Possible local library directories to search.
1446 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1447 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1449 : general looking path for locating libraries
1450 glibpth="/lib /usr/lib $xlibpth"
1451 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1452 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1453 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1454 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1456 : Private path used by Configure to find libraries. Its value
1457 : is prepended to libpth. This variable takes care of special
1458 : machines, like the mips. Usually, it should be empty.
1461 : default library list
1463 : some systems want to use only the non-versioned libso:s
1464 ignore_versioned_solibs=''
1468 : set usei18n_lang=false in your hint file to disable the I18N_Langinfo extension.
1470 : set useposix=false in your hint file to disable the POSIX extension.
1472 : set useopcode=false in your hint file to disable the Opcode extension.
1475 ccflags_uselargefiles=''
1476 ldflags_uselargefiles=''
1477 libswanted_uselargefiles=''
1478 : set usemultiplicity on the Configure command line to enable multiplicity.
1479 : set usesocks on the Configure command line to enable socks.
1481 : set usethreads on the Configure command line to enable threads.
1482 usereentrant='undef'
1483 : List of libraries we want.
1484 : If anyone needs extra -lxxx, put those in a hint file.
1485 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1486 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1487 : We probably want to search /usr/shlib before most other libraries.
1488 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1489 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1490 glibpth="/usr/shlib $glibpth"
1491 : Do not use vfork unless overridden by a hint file.
1494 : Find the basic shell for Bourne shell scripts
1498 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1501 if test -f "$xxx"; then
1504 : Build up a list and do a single loop so we can 'break' out.
1505 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1506 for xxx in sh bash ksh pdksh ash; do
1508 try="$try ${p}/${xxx}"
1512 if test -f "$xxx"; then
1515 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1518 elif test -f "$xxx.exe"; then
1529 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1531 Usually it's in /bin/sh. How did you even get this far?
1532 Please contact me (Perl Maintainers) at perlbug@perl.org and
1533 we'll try to straighten this all out.
1539 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1540 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1543 : see if sh knows # comments
1544 if `$sh -c '#' >/dev/null 2>&1`; then
1548 test -f $xcat$_exe || xcat=/usr/bin/cat
1549 if test ! -f $xcat$_exe; then
1550 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1551 if test -f $p/cat$_exe; then
1556 if test ! -f $xcat$_exe; then
1557 echo "Can't find cat anywhere!"
1561 echo "#!$xcat" >sharp
1564 ./sharp > today 2>/dev/null
1565 if test -s today; then
1568 echo "#! $xcat" > sharp
1571 ./sharp > today 2>/dev/null
1572 if test -s today; then
1580 echo "Your $sh doesn't grok # comments--I will strip them later on."
1583 echo "exec grep -v '^[ ]*#'" >spitshell
1585 $eunicefix spitshell
1586 spitshell=`pwd`/spitshell
1588 echo "I presume that if # doesn't work, #! won't work either!"
1593 : figure out how to guarantee sh startup
1595 '') startsh=${sharpbang}${sh} ;;
1607 : echo "Yup, it does."
1609 echo "Hmm... '$startsh' does not guarantee sh startup..."
1610 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1614 : Save command line options in file UU/cmdline.opt for later use in
1615 : generating config.sh.
1616 cat > cmdline.opt <<EOSH
1617 : Configure command line arguments.
1626 cat >>cmdline.opt <<EOSH
1627 config_arg$argn='$arg'
1629 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1632 arg_exp=`cat cmdl.opt`
1633 args_exp="$args_exp$args_sep'$arg_exp'"
1634 argn=`expr $argn + 1`
1639 : produce awk script to parse command line options
1640 cat >options.awk <<'EOF'
1642 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1644 len = length(optstr);
1645 for (i = 1; i <= len; i++) {
1646 c = substr(optstr, i, 1);
1647 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1658 if (substr(str, 1, 1) != "-") {
1659 printf("'%s'\n", str);
1663 for (i = 2; i <= len; i++) {
1664 c = substr(str, i, 1);
1666 printf("-%s\n", substr(str, i));
1672 printf("'%s'\n", substr(str, i + 1));
1685 : process the command line options
1686 set X `for arg in "$@"; do echo "X$arg"; done |
1687 sed -e s/X// | awk -f options.awk`
1692 : set up default values
1701 rm -f optdef.sh posthint.sh
1702 cat >optdef.sh <<EOS
1708 while test $# -gt 0; do
1710 -d) shift; fastread=yes;;
1711 -e) shift; alldone=cont;;
1715 if test -r "$1"; then
1718 echo "$me: cannot read config file $1." >&2
1724 -h) shift; error=true;;
1725 -r) shift; reuseval=true;;
1726 -s) shift; silent=true; realsilent=true;;
1727 -E) shift; alldone=exit;;
1728 -K) shift; knowitall=true;;
1730 -S) shift; silent=true; extractsh=true;;
1735 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1736 echo "$me: ignoring -D $1" >&2
1739 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1740 *) echo "$1='define'" >> optdef.sh;;
1747 *=) echo "$1" >> optdef.sh;;
1749 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1750 echo "$me: ignoring -U $1" >&2
1752 *) echo "$1='undef'" >> optdef.sh;;
1763 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1767 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1768 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1774 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1775 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1776 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1777 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1778 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1779 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1785 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1787 echo "$yyy=''" >> posthint.sh ;;
1792 echo "$yyy='$zzz'" >> posthint.sh ;;
1794 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1796 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1801 echo "$yyy=$zzz" >> posthint.sh ;;
1802 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1806 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1809 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1817 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1818 [-U symbol] [-U symbol=] [-A command:symbol...]
1819 -d : use defaults for all answers.
1820 -e : go on without questioning past the production of config.sh.
1821 -f : specify an alternate default configuration file.
1822 -h : print this help message and exit (with an error status).
1823 -r : reuse C symbols value if possible (skips costly nm extraction).
1824 -s : silent mode, only echoes questions and essential information.
1825 -D : define symbol to have some value:
1826 -D symbol symbol gets the value 'define'
1827 -D symbol=value symbol gets the value 'value'
1828 common used examples (see INSTALL for more info):
1829 -Duse64bitint use 64bit integers
1830 -Duse64bitall use 64bit integers and pointers
1831 -Dusethreads use thread support
1832 -Dinc_version_list=none do not include older perl trees in @INC
1833 -DEBUGGING=none DEBUGGING options
1834 -Dcc=gcc choose your compiler
1835 -Dprefix=/opt/perl5 choose your destination
1836 -E : stop at the end of questions, after having produced config.sh.
1837 -K : do not use unless you know what you are doing.
1838 -O : ignored for backward compatibility
1839 -S : perform variable substitutions on all .SH files (can mix with -f)
1840 -U : undefine symbol:
1841 -U symbol symbol gets the value 'undef'
1842 -U symbol= symbol gets completely empty
1844 -A : manipulate symbol after the platform specific hints have been applied:
1845 -A append:symbol=value append value to symbol
1846 -A symbol=value like append:, but with a separating space
1847 -A define:symbol=value define symbol to have value
1848 -A clear:symbol define symbol to be ''
1849 -A define:symbol define symbol to be 'define'
1850 -A eval:symbol=value define symbol to be eval of value
1851 -A prepend:symbol=value prepend value to symbol
1852 -A undef:symbol define symbol to be 'undef'
1853 -A undef:symbol= define symbol to be ''
1854 e.g.: -A prepend:libswanted='cl pthread '
1855 -A ccflags=-DSOME_MACRO
1856 -V : print version number and exit (with a zero status).
1863 case "$fastread$alldone" in
1866 case "$extractsh" in
1869 if test ! -t 0; then
1870 echo "Say 'sh Configure', not 'sh <Configure'"
1880 true) exec 1>/dev/null;;
1883 : run the defines and the undefines, if any, but leave the file out there...
1885 grep '\\' optdef.sh >/dev/null 2>&1
1886 if test $? = 0; then
1887 echo "Configure does not support \\ in -D arguments"
1891 : create the posthint manipulation script and leave the file out there...
1896 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1897 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1898 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1899 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1900 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1903 : Some greps do not return status, grrr.
1904 echo "grimblepritz" >grimble
1905 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1907 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1913 : the following should work in any shell
1917 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1918 cat >contains <<'EOSS'
1919 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1924 : Find the path to the source tree
1927 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1931 *) src=`cd ../$src && pwd` ;;
1944 if test -f $rsrc/Configure && \
1945 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1947 : found it, so we are ok.
1950 for src in . .. ../.. ../../.. ../../../..; do
1951 if test -f ../$src/Configure && \
1952 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1963 Sorry, I can't seem to locate the source dir for $package. Please start
1964 Configure with an explicit path -- i.e. /some/path/Configure.
1972 echo "Sources for $package found in \"$src\"." >&4
1976 : script used to extract .SH files with variable substitutions
1977 cat >extract <<'EOS'
1979 echo "Doing variable substitutions on .SH files..."
1980 if test -f MANIFEST; then
1981 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1983 echo "(Looking for .SH files under the source directory.)"
1984 set x `(cd "$src"; find . -name "*.SH" -print)`
1988 0) set x `(cd "$src"; echo *.SH)`; shift;;
1990 if test ! -f "$src/$1"; then
1996 while test $name; do
1997 if test ! -d "$name"; then
1998 create="$name $create";
1999 name=`echo $name | sed -e "s|^[^/]*$||"`;
2000 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2005 for file in $create; do
2014 dir=`expr X$file : 'X\(.*\)/'`
2015 file=`expr X$file : 'X.*/\(.*\)'`
2016 (cd "$dir" && . ./$file)
2026 dir=`expr X$file : 'X\(.*\)/'`
2027 file=`expr X$file : 'X.*/\(.*\)'`
2028 (set x $dir; shift; eval $mkdir_p)
2029 sh <"$src/$dir/$file"
2038 if test -f "$src/config_h.SH"; then
2039 if test ! -f config.h; then
2040 : oops, they left it out of MANIFEST, probably, so do it anyway.
2041 . "$src/config_h.SH"
2046 : extract files and exit if asked to do so
2047 case "$extractsh" in
2049 case "$realsilent" in
2053 case "$config_sh" in
2054 '') config_sh='config.sh';;
2057 echo "Fetching answers from $config_sh..."
2064 echo "Extraction done."
2069 : Eunice requires " " instead of "", can you believe it
2072 echo "Beginning of configuration questions for $package."
2074 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2076 : first determine how to suppress newline on echo command
2078 echo "Checking echo to see how to suppress newlines..."
2079 (echo "hi there\c" ; echo " ") >.echotmp
2080 if $contains c .echotmp >/dev/null 2>&1 ; then
2091 echo $n "The star should be here-->$c"
2095 : Now test for existence of everything in MANIFEST
2097 if test -f "$rsrc/MANIFEST"; then
2098 echo "First let's make sure your kit is complete. Checking..." >&4
2099 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2100 (split -l 50 2>/dev/null || split -50)
2103 for filelist in x??; do
2104 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2105 >/dev/null 2>>"$tmppwd/missing")
2107 if test -s missing; then
2111 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2113 You have the option of continuing the configuration process, despite the
2114 distinct possibility that your kit is damaged, by typing 'y'es. If you
2115 do, don't blame me if something goes wrong. I advise you to type 'n'o
2116 and contact the author (perlbug@perl.org).
2119 echo $n "Continue? [n] $c" >&4
2123 echo "Continuing..." >&4
2127 echo "ABORTING..." >&4
2132 echo "Looks good..."
2135 echo "There is no MANIFEST file. I hope your kit is complete !"
2139 : Find the appropriate value for a newline for tr
2140 if test -n "$DJGPP"; then
2143 if test X"$trnl" = X; then
2144 case "`echo foo | tr '\n' x 2>/dev/null`" in
2148 if test X"$trnl" = X; then
2149 case "`echo foo | tr '\012' x 2>/dev/null`" in
2150 foox) trnl='\012' ;;
2153 if test X"$trnl" = X; then
2154 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2155 fooxy) trnl='\n\r' ;;
2158 if test X"$trnl" = X; then
2161 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2167 : compute the number of columns on the terminal for proper question formatting
2172 : set up the echo used in my read
2173 myecho="case \"\$xxxm\" in
2174 '') echo $n \"\$rp $c\" >&4;;
2176 '') echo $n \"[\$xxxm] $c\";;
2178 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2180 echo $n \"[\$xxxm] $c\" >&4
2182 echo $n \"\$rp [\$xxxm] $c\" >&4
2188 : now set up to do reads with possible shell escape and default assignment
2194 case "\$fastread" in
2195 yes) case "\$dflt" in
2198 case "\$silent-\$rp" in
2203 *) case "\$silent" in
2204 true) case "\$rp" in
2209 while expr "X\$ans" : "X!" >/dev/null; do
2213 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2221 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2230 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2235 echo "(OK, I'll run with -d after this question.)" >&4
2238 echo "*** Sorry, \$1 not supported yet." >&4
2248 echo "*** Substitution done -- please confirm."
2250 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2255 echo "*** Error -- try again."
2262 case "\$ans\$xxxm\$nostick" in
2274 : create .config dir to save info across Configure sessions
2275 test -d ../.config || mkdir ../.config
2276 cat >../.config/README <<EOF
2277 This directory created by Configure to save information that should
2278 persist across sessions for $package.
2280 You may safely delete it if you wish.
2283 : See if we are using a devel version and want that
2284 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2287 usedevel="$define" ;;
2288 *) case "$xversion" in
2291 *** WHOA THERE!!! ***
2293 This is an UNSTABLE DEVELOPMENT release.
2294 The version of this $package distribution is $xversion, that is, odd,
2295 (as opposed to even) and that signifies a development release.
2296 If you want a maintenance release, you want an even-numbered version.
2298 Do ***NOT*** install this into production use.
2299 Data corruption and crashes are possible.
2301 It is most seriously suggested that you do not continue any further
2302 unless you want to help in developing and debugging Perl.
2304 If you *still* want to build perl, you can answer 'y' now,
2305 or pass -Dusedevel to Configure.
2308 rp='Do you really want to continue?'
2312 [yY]) echo >&4 "Okay, continuing."
2313 usedevel="$define" ;;
2314 *) echo >&4 "Okay, bye."
2325 case "$versiononly" in
2326 '') versiononly="$define" ;;
2328 case "$installusrbinperl" in
2329 '') installusrbinperl="$undef" ;;
2334 : general instructions
2337 user=`(logname) 2>/dev/null`
2339 '') user=`whoami 2>&1`;;
2341 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2344 rp='Would you like to see the instructions?'
2355 This installation shell script will examine your system and ask you questions
2356 to determine how the perl5 package should be installed. If you get
2357 stuck on a question, you may use a ! shell escape to start a subshell or
2358 execute a command. Many of the questions will have default answers in square
2359 brackets; typing carriage return will give you the default.
2361 On some of the questions which ask for file or directory names you are allowed
2362 to use the ~name construct to specify the login directory belonging to "name",
2363 even if you don't have a shell which knows about that. Questions where this is
2364 allowed will be marked "(~name ok)".
2368 dflt='Type carriage return to continue'
2372 The prompter used in this script allows you to use shell variables and
2373 backticks in your answers. You may use $1, $2, etc... to refer to the words
2374 in the default answer, as if the default line was a set of arguments given to a
2375 script shell. This means you may also use $* to repeat the whole default line,
2376 so you do not have to re-type everything to add something to the default.
2378 Every time there is a substitution, you will have to confirm. If there is an
2379 error (e.g. an unmatched backtick), the default answer will remain unchanged
2380 and you will be prompted again.
2382 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2383 the questions and use the computed defaults (or the previous answers if there
2384 was already a config.sh file). Type 'Configure -h' for a list of options.
2385 You may also start interactively and then answer '& -d' at any prompt to turn
2386 on the non-interactive behaviour for the remainder of the execution.
2392 Much effort has been expended to ensure that this shell script will run on any
2393 Unix system. If despite that it blows up on yours, your best bet is to edit
2394 Configure and run it again. If you can't run Configure for some reason,
2395 you'll have to generate a config.sh file by hand. Whatever problems you
2396 have, let me (perlbug@perl.org) know how I blew it.
2398 This installation script affects things in two ways:
2400 1) it may do direct variable substitutions on some of the files included
2402 2) it builds a config.h file for inclusion in C programs. You may edit
2403 any of these files as the need arises after running this script.
2405 If you make a mistake on a question, there is no easy way to back up to it
2406 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2407 files. Configure will offer to let you do this before it runs the SH files.
2410 dflt='Type carriage return to continue'
2412 case "$firsttime" in
2413 true) echo $user >>../.config/instruct;;
2417 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2418 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2419 if test "X$sysroot" = X; then
2424 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2425 # _sysroot is used in places where we need --sysroot=foo
2426 # but using the rest of the flags could cause issues.
2427 _sysroot="--sysroot=$sysroot";
2431 ccflags="$ccflags $_sysroot"
2436 ldflags="$ldflags $_sysroot"
2441 cppflags="$cppflags $_sysroot"
2443 # lddlflags updated below in lddlflags section;
2444 # same with cccdlflags
2448 # Adjust some defaults to also use $sysroot
2449 for var in xlibpth loclibpth locincpth glibpth; do
2452 for path in $xxx; do
2453 eval $var=\"\$$var $sysroot$path\"
2459 : find out where common programs are
2461 echo "Locating common programs..." >&4
2474 if test -d \$dir/\$thing; then
2480 for thisthing in \$dir/\$thing; do
2481 : just loop through to pick last item
2483 if test -f \$thisthing; then
2486 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2489 elif test -f \$dir/\$thing.exe; then
2490 if test -n "$DJGPP"; then
2491 echo \$dir/\$thing.exe
2492 elif test "$eunicefix" != ":"; then
2493 : on Eunice apparently
2546 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2547 pth="$pth $sysroot/lib $sysroot/usr/lib"
2548 for file in $loclist; do
2552 if test -f "$xxx"; then
2555 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2556 xxx=`./loc $file $file $pth`
2559 '') xxx=`./loc $file $file $pth`;;
2560 *) xxx=`./loc $xxx $xxx $pth`;;
2562 eval $file=$xxx$_exe
2566 echo $file is in $xxx.
2569 echo $file is in $xxx.
2572 echo "I don't know where '$file' is, and my life depends on it." >&4
2573 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2579 echo "Don't worry if any of the following aren't found..."
2581 for file in $trylist; do
2585 if test -f "$xxx"; then
2588 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2589 xxx=`./loc $file $file $pth`
2592 '') xxx=`./loc $file $file $pth`;;
2593 *) xxx=`./loc $xxx $xxx $pth`;;
2595 eval $file=$xxx$_exe
2599 echo $file is in $xxx.
2602 echo $file is in $xxx.
2605 echo "I don't see $file out there, $say."
2612 echo "Substituting grep for egrep."
2619 *) if $less -R </dev/null >/dev/null 2>&1; then
2620 echo "Substituting less -R for less."
2628 echo "Substituting cp for ln."
2637 echo "I can't find make or gmake, and my life depends on it." >&4
2638 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2646 *) # We can't have osname yet.
2647 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2648 # Assume that gmake, if found, is definitely GNU make
2649 # and prefer it over the system make.
2650 echo "Substituting gmake for make."
2658 echo "Hopefully test is built into your sh."
2661 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2662 echo "Using the test built into your sh."
2670 echo "Hopefully echo is built into your sh."
2675 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2676 $echo $n "hi there$c" >foo1
2677 echo $n "hi there$c" >foo2
2678 if cmp foo1 foo2 >/dev/null 2>&1; then
2679 echo "They are compatible. In fact, they may be identical."
2686 They are not compatible! You are probably running ksh on a non-USG system.
2687 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2688 have echo built in and we may have to run some Bourne shell scripts. That
2689 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2692 $echo $n "The star should be here-->$c"
2699 # This question was auctioned at YAPC::Europe-2007 in Vienna
2700 # I never promised you could answer it. I only auctioned the question.
2702 The following message is sponsored by
2704 Dresden.pm<--The stars should be here.
2706 Dear Perl user, system administrator or package
2707 maintainer, the Perl community sends greetings to
2708 you. Do you (emblematical) greet back [Y/n]? n
2712 : Check what type of C compiler we use
2716 cat <<'EOSC' >>trygcc
2721 int main(int argc, char *argv[]) {
2725 if $cc -o try $ccflags $ldflags try.c; then
2728 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2734 # Skip this test because it gives a false match on output like:
2735 # ./trygcc: line 23: cc: command not found
2736 # case "`$cc -v -c try.c 2>&1`" in
2737 # *gcc*) trygcc=no ;;
2739 if $test X"$trygcc" = Xyes; then
2740 if gcc -o try -c try.c; then
2742 echo "You seem to have a working gcc, though." >&4
2743 # Switching compilers may undo the work of hints files.
2744 # The most common problem is -D_REENTRANT for threads.
2745 # This heuristic catches that case, but gets false positives
2746 # if -Dusethreads was not actually specified. Better to
2747 # bail out here with a useful message than fail
2748 # mysteriously later. Should we perhaps just try to
2749 # re-invoke Configure -Dcc=gcc config_args ?
2750 if $test -f usethreads.cbu; then
2753 *** However, any setting of the C compiler flags (e.g. for thread support)
2754 *** will be lost. It may be necessary for you to restart Configure and
2755 *** add -Dcc=gcc to your Configure command line.
2758 rp="Would you like to go ahead and try gcc anyway?"
2761 rp="Would you like to use it?"
2764 if $test -f myread; then
2767 if $test -f UU/myread; then
2770 echo "Cannot find myread, sorry. Aborting." >&2
2775 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2788 cat <<'EOSC' >>checkcc
2793 int main(int argc, char *argv[]) {
2797 if $cc -o try $ccflags $ldflags try.c; then
2800 if $test X"$despair" = Xyes; then
2801 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2804 You need to find a working C compiler.
2805 Either (purchase and) install the C compiler supplied by your OS vendor,
2806 or for a free C compiler try http://gcc.gnu.org/
2807 I cannot continue any further, aborting.
2816 : determine whether symbolic links are supported
2819 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2820 echo "Symbolic links are supported." >&4
2823 echo "Symbolic links are NOT supported." >&4
2828 : determine whether symbolic links are supported
2832 echo "Checking how to test for symbolic links..." >&4
2834 if $test "X$issymlink" = X; then
2836 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2837 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2839 if test $? = 0; then
2842 echo "Your builtin 'test -h' may be broken." >&4
2845 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2848 if test -f "$p/$test"; then
2857 echo "Trying external '$test -h'." >&4
2858 issymlink="$test -h"
2859 if $test ! -h sym >/dev/null 2>&1; then
2860 echo "External '$test -h' is broken, too." >&4
2868 if $test "X$issymlink" = X; then
2869 if $test -L sym 2>/dev/null; then
2870 issymlink="$test -L"
2871 echo "The builtin '$test -L' worked." >&4
2874 if $test "X$issymlink" != X; then
2875 echo "You can test for symbolic links with '$issymlink'." >&4
2877 echo "I do not know how you can test for symbolic links." >&4
2881 *) echo "No symbolic links, so not testing for their testing..." >&4
2885 : Make symlinks util
2886 case "$mksymlinks" in
2889 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2892 *) case "$lns:$issymlink" in
2893 *"ln"*" -s:"*"test -"?)
2894 echo "Creating the symbolic links..." >&4
2896 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2906 print "# dir = ", dir, "file = ", file
2907 mf[dir] = mf[dir]" "source"/"dir"/"file;
2910 if (d != ".") { print("mkdir -p "d) }
2911 print("ln -sf "mf[d]" "d);
2913 }' source="$src" > UU/mksymlinks.$$
2917 if test ! -d t/base; then
2918 echo "Failed to create the subdirectories. Aborting." >&4
2922 if test ! -f t/base/lex.t; then
2923 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2926 if test ! -f win32/win32.c; then
2927 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2932 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2940 : Check for Cross-Compilation
2941 if $test "X$targethost" = "X"; then
2944 if $test "X$targetenv" = "X"; then
2947 case "$usecrosscompile" in
2949 $echo "Cross-compiling..."
2952 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2953 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2954 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2955 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2956 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2957 # leave out ld, choosing it is more complex
2958 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2959 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2960 # We are in a weird spot. Just before us, some values
2961 # were 'saved', to be restored after the hints are
2962 # run. This means that the changes we made to ar,
2963 # nm and ranlib will get reverted.
2964 # To avoid that, we hijack the saving mechanism and
2965 # have it save our new values.
2966 for file in ar nm ranlib; do
2968 eval $file=$xxx$_exe
2973 case "$targetarch" in
2974 '') echo "Targetarch not defined." >&4; croak=y ;;
2975 *) echo "Using targetarch $targetarch." >&4 ;;
2977 case "$targethost" in
2978 '') echo "Targethost not defined." >&4; croak=n ;;
2979 *) echo "Using targethost $targethost." >&4
2984 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2986 : compile a host miniperl and generate_uudmap, unless we got passed them
2987 if $test "X$hostperl" = X; then
2988 echo "Building host miniperl and generate_uudmap binaries" >&4
2996 $src/Configure -des -Dusedevel -Dmksymlinks
2998 case "$hostgenerate" in
2999 '') $make generate_uudmap
3000 hostgenerate=$src/host/generate_uudmap
3002 "$undef") hostgenerate=''
3005 hostperl=$src/host/miniperl
3008 hostosname=`$hostperl -le 'print $^O'`
3011 usecrosscompile="$undef"
3015 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3016 case "$targethost" in
3017 '') echo "Checking for cross-compile" >&4
3018 case "$usecrosscompile$multiarch" in
3019 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3020 if [ -f Makefile ]; then
3022 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3024 echo "Configure done."
3028 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3035 *) echo "Using targethost $targethost." >&4
3037 /*) run=$src/Cross/run
3038 targetmkdir=$src/Cross/mkdir
3040 from=$src/Cross/from
3042 *) pwd=`$test -f ../Configure & cd ..; pwd`
3044 targetmkdir=$pwd/Cross/mkdir
3046 from=$pwd/Cross/from
3049 case "$targetrun" in
3050 '') targetrun=ssh ;;
3055 case "$targetfrom" in
3056 '') targetfrom=scp ;;
3060 from=$from-$targetfrom
3061 case "$targetdir" in
3063 echo "Guessing targetdir $targetdir." >&4
3066 case "$targetuser" in
3068 echo "Guessing targetuser $targetuser." >&4
3071 case "$targetport" in
3073 echo "Guessing targetport $targetport." >&4
3076 case "$targetfrom" in
3080 case "$targetrun" in
3100 '') cwd=$targetdir ;;
3105 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3111 *) echo "Unknown targetrun '$targetrun'" >&4
3115 case "$targetmkdir" in
3117 cat >$targetmkdir <<EOF
3119 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3121 $chmod a+rx $targetmkdir
3123 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3135 $targetmkdir \`dirname \$f\`
3136 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3139 $targetmkdir $targetdir/\`dirname \$f\`
3140 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3153 $mkdir -p $targetdir/\`dirname \$f\`
3154 $cp \$f $targetdir/\$f || exit 1
3157 $targetmkdir $targetdir/\`dirname \$f\`
3158 $cp \$f $targetdir/\$f || exit 1
3165 *) echo "Unknown targetto '$targetto'" >&4
3169 case "$targetfrom" in
3176 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3181 cp) cat >$from <<EOF
3186 cp $targetdir/\$f . || exit 1
3191 *) echo "Unknown targetfrom '$targetfrom'" >&4
3195 if $test ! -f $run; then
3196 echo "Target 'run' script '$run' not found." >&4
3200 if $test ! -f $to; then
3201 echo "Target 'to' script '$to' not found." >&4
3205 if $test ! -f $from; then
3206 echo "Target 'from' script '$from' not found." >&4
3210 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3214 Using '$run' for remote execution,
3215 and '$from' and '$to'
3216 for remote file transfer.
3222 usecrosscompile="$undef"
3227 : see whether [:lower:] and [:upper:] are supported character classes
3229 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3231 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3235 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3236 # (0xd9 and 0xe2), therefore that is a nice testing point.
3237 if test "X$up" = X -o "X$low" = X; then
3238 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3244 if test "X$up" = X -o "X$low" = X; then
3245 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3251 if test "X$up" = X -o "X$low" = X; then
3252 case "`echo RS | od -x 2>/dev/null`" in
3254 echo "Hey, this might be EBCDIC." >&4
3255 if test "X$up" = X -o "X$low" = X; then
3256 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3257 rs) up='[A-IJ-RS-Z]'
3262 if test "X$up" = X -o "X$low" = X; then
3263 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3273 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3275 echo "Using $up and $low to convert case." >&4
3278 echo "I don't know how to translate letters from upper to lower case." >&4
3279 echo "Your tr is not acting any way I know of." >&4
3283 : set up the translation script tr, must be called with ./tr of course
3287 '[A-Z][a-z]') exec $tr '$up' '$low';;
3288 '[a-z][A-Z]') exec $tr '$low' '$up';;
3295 : Try to determine whether config.sh was made on this system
3296 case "$config_sh" in
3298 myuname=`$uname -a 2>/dev/null`
3299 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3300 # Downcase everything to avoid ambiguity.
3301 # Remove slashes and single quotes so we can use parts of this in
3302 # directory and file names.
3303 # Remove newlines so myuname is sane to use elsewhere.
3304 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3305 # because the A-Z/a-z are not consecutive.
3306 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3307 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3308 newmyuname="$myuname"
3310 case "$knowitall" in
3312 if test -f ../config.sh; then
3313 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3314 eval "`grep myuname= ../config.sh`"
3316 if test "X$myuname" = "X$newmyuname"; then
3324 : Get old answers from old config file if Configure was run on the
3325 : same system, otherwise use the hints.
3328 if test -f config.sh; then
3330 rp="I see a config.sh file. Shall I use it to set the defaults?"
3333 n*|N*) echo "OK, I'll ignore it."
3334 mv config.sh config.sh.old
3335 myuname="$newmyuname"
3337 *) echo "Fetching default answers from your old config.sh file..." >&4
3345 : Older versions did not always set $sh. Catch re-use of such
3355 if test ! -f config.sh; then
3358 First time through, eh? I have some defaults handy for some systems
3359 that need some extra help getting the Configure answers right:
3362 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3364 : Half the following guesses are probably wrong... If you have better
3365 : tests or hints, please send them to perlbug@perl.org
3366 : The metaconfig authors would also appreciate a copy...
3367 $test -f /irix && osname=irix
3368 $test -f /xenix && osname=sco_xenix
3369 $test -f /dynix && osname=dynix
3370 $test -f /dnix && osname=dnix
3371 $test -f /lynx.os && osname=lynxos
3372 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3373 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3374 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3375 $test -f /bin/mips && /bin/mips && osname=mips
3376 $test -d /usr/apollo/bin && osname=apollo
3377 $test -f /etc/saf/_sactab && osname=svr4
3378 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3379 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3380 $test -f /sys/utilities/MultiView && osname=amigaos
3381 if $test -d /MachTen -o -d /MachTen_Folder; then
3383 if $test -x /sbin/version; then
3384 osvers=`/sbin/version | $awk '{print $2}' |
3385 $sed -e 's/[A-Za-z]$//'`
3386 elif $test -x /usr/etc/version; then
3387 osvers=`/usr/etc/version | $awk '{print $2}' |
3388 $sed -e 's/[A-Za-z]$//'`
3394 $test -f /sys/posix.dll &&
3395 $test -f /usr/bin/what &&
3396 set X `/usr/bin/what /sys/posix.dll` &&
3397 $test "$3" = UWIN &&
3401 if $test -f $uname; then
3409 umips) osname=umips ;;
3412 [23]100) osname=mips ;;
3414 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3415 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3418 elif $test -f /etc/kconfig; then
3420 if test "$lns" = "$ln -s"; then
3422 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3424 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3431 if test -n "$DJGPP"; then
3440 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3442 # oslevel can fail with:
3443 # oslevel: Unable to acquire lock.
3444 *not\ found) osvers="$4"."$3" ;;
3445 '<3240'|'<>3240') osvers=3.2.0 ;;
3446 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3447 '=3250'|'>3250') osvers=3.2.5 ;;
3451 bitrig) osname=bitrig
3454 bsd386) osname=bsd386
3457 cygwin*) osname=cygwin
3460 *dc.osx) osname=dcosx
3466 domainos) osname=apollo
3472 dragonfly) osname=dragonfly
3475 dynixptx*) osname=dynixptx
3476 osvers=`echo "$4"|sed 's/^v//'`
3478 freebsd) osname=freebsd
3480 genix) osname=genix ;;
3484 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3497 $test -f /system/lib/libandroid.so && osname=linux-android
3501 netbsd*) osname=netbsd
3504 news-os) osvers="$3"
3506 4*) osname=newsos4 ;;
3510 nonstop-ux) osname=nonstopux ;;
3511 openbsd) osname=openbsd
3517 POSIX-BC | posix-bc ) osname=posix-bc
3520 powerux | power_ux | powermax_os | powermaxos | \
3521 powerunix | power_unix) osname=powerux
3527 solaris) osname=solaris
3529 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3536 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3540 titanos) osname=titanos
3549 ultrix) osname=ultrix
3552 osf1|mls+) case "$5" in
3555 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3558 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3561 hp*) osname=hp_osf1 ;;
3562 mips) osname=mips_osf1 ;;
3565 # UnixWare 7.1.2 is known as Open UNIX 8
3566 openunix|unixware) osname=svr5
3574 $2) case "$osname" in
3578 : svr4.x or possibly later
3588 if test -f /stand/boot ; then
3589 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3590 if test -n "$INITPROG" -a -f "$INITPROG"; then
3591 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3592 if test -n "$isesix"; then
3600 *) if test -f /etc/systemid; then
3602 set `echo $3 | $sed 's/\./ /g'` $4
3603 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3605 elif $test -f $src/hints/sco_$1_$2.sh; then
3607 elif $test -f $src/hints/sco_$1.sh; then
3612 '') : Still unknown. Probably a generic Sys V.
3621 *) case "$osname" in
3622 '') : Still unknown. Probably a generic BSD.
3630 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3631 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3632 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3635 $rm -f UU/kernel.what
3636 elif test -d c:/. -o -n "$is_os2" ; then
3643 case "$targetarch" in
3646 case "$targetarch" in
3648 # Will load qnx.sh, which should change osname to nto
3653 # Catch arm-linux-androideabi, mipsel-linux-android,
3654 # and i686-linux-android
3655 osname=linux-android
3659 # Something like arm-linux-gnueabihf is really just
3666 # XXX perhaps we should just assume
3667 # osvers to be 2, or maybe take the value
3668 # from targetarch. Using $run before the
3669 # hints are run is somewhat icky.
3670 set X `$run $uname -a 2>/dev/null`
3673 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3678 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3685 : Now look for a hint file osname_osvers, unless one has been
3686 : specified already.
3689 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3690 : Also try without trailing minor version numbers.
3691 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3692 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3693 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3694 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3697 *) case "$osvers" in
3700 *) if $test -f $src/hints/$file.sh ; then
3702 elif $test -f $src/hints/$xfile.sh ; then
3704 elif $test -f $src/hints/$xxfile.sh ; then
3706 elif $test -f $src/hints/$xxxfile.sh ; then
3708 elif $test -f $src/hints/$xxxxfile.sh ; then
3710 elif $test -f "$src/hints/${osname}.sh" ; then
3719 if $test -f Policy.sh ; then
3722 none) dflt="Policy" ;;
3723 *) dflt="Policy $dflt" ;;
3728 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3732 if $test -f Policy.sh ; then
3735 There's also a Policy hint file available, which should make the
3736 site-specific (policy) questions easier to answer.
3743 You may give one or more space-separated answers, or "none" if appropriate.
3744 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3745 previous run of Configure, you may specify it as well as or instead of
3746 OS-specific hints. If hints are provided for your OS, you should use them:
3747 although Perl can probably be built without hints on many platforms, using
3748 hints often improve performance and may enable features that Configure can't
3749 set up on its own. If there are no hints that match your OS, specify "none";
3750 DO NOT give a wrong version or a wrong OS.
3754 rp="Which of these apply, if any?"
3757 for file in $tans; do
3758 if $test X$file = XPolicy -a -f Policy.sh; then
3760 $cat Policy.sh >> UU/config.sh
3761 elif $test -f $src/hints/$file.sh; then
3762 . $src/hints/$file.sh
3763 $cat $src/hints/$file.sh >> UU/config.sh
3764 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3767 : Give one chance to correct a possible typo.
3768 echo "$file.sh does not exist"
3770 rp="hint to use instead?"
3772 for file in $ans; do
3773 if $test -f "$src/hints/$file.sh"; then
3774 . $src/hints/$file.sh
3775 $cat $src/hints/$file.sh >> UU/config.sh
3776 elif $test X$ans = X -o X$ans = Xnone ; then
3779 echo "$file.sh does not exist -- ignored."
3786 : Remember our hint file for later.
3787 if $test -f "$src/hints/$file.sh" ; then
3797 echo "Fetching default answers from $config_sh..." >&4
3801 cp $config_sh config.sh 2>/dev/null
3813 : Restore computed paths
3814 for file in $loclist $trylist; do
3815 eval $file="\$_$file"
3820 Configure uses the operating system name and version to set some defaults.
3821 The default value is probably right if the name rings a bell. Otherwise,
3822 since spelling matters for me, either accept the default or answer "none"
3829 ''|' '|none) dflt=none ;;
3830 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3833 *) dflt="$osname" ;;
3835 rp="Operating system name?"
3839 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3845 ''|' '|none) dflt=none ;;
3846 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3847 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3849 ''|' ') dflt=none ;;
3854 *) dflt="$osvers" ;;
3856 rp="Operating system version?"
3866 : who configured the system
3867 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3870 cf_by=`(logname) 2>/dev/null`
3873 cf_by=`(whoami) 2>/dev/null`
3875 "") cf_by=unknown ;;
3880 : decide how portable to be. Allow command line overrides.
3881 case "$d_portable" in
3883 *) d_portable="$define" ;;
3886 : set up shell script to do ~ expansion
3892 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3895 if $test -f /bin/csh; then
3896 /bin/csh -f -c "glob \$1"
3901 name=\`$expr x\$1 : '..\([^/]*\)'\`
3902 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3903 if $test ! -d "\$dir"; then
3905 echo "\$me: can't locate home directory for: \$name" >&2
3910 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3926 : now set up to get a file name
3930 cat <<'EOSC' >>getfile
3946 : getfile will accept an answer from the comma-separated list
3947 : enclosed in parentheses even if it does not meet other criteria.
3948 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3949 fn=`echo $fn | sed 's/(.*)//'`
3955 loc_file=`expr $fn : '.*:\(.*\)'`
3956 fn=`expr $fn : '\(.*\):.*'`
3964 */*) fullpath=true;;
3973 *e*) exp_file=true;;
3976 *p*) nopath_ok=true;;
3981 *d*) type='Directory';;
3982 *l*) type='Locate';;
3987 Locate) what='File';;
3992 case "$d_portable" in
4000 while test "$type"; do
4005 true) rp="$rp (~name ok)";;
4008 if test -f UU/getfile.ok && \
4009 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4028 value=`UU/filexp $ans`
4031 if test "$ans" != "$value"; then
4032 echo "(That expands to $value on this system.)"
4046 /*) value="$ansexp" ;;
4047 [a-zA-Z]:/*) value="$ansexp" ;;
4052 echo "I shall only accept a full path name, as in /bin/ls." >&4
4053 echo "Use a ! shell escape if you wish to check pathnames." >&4
4056 echo "Please give a full path name, starting with slash." >&4
4059 echo "Note that using ~name is ok provided it expands well." >&4
4072 for fp in $gfpth; do
4073 if test "X$fp" = X.; then
4078 if test -f "$pf"; then
4080 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4082 echo "($value is not a plain file, but that's ok.)"
4085 if test X"$type" = X; then
4092 for fp in $gfpth; do
4093 if test "X$fp" = X.; then
4098 direxp="$fp/$ansexp"
4100 if test -d "$direxp"; then
4108 if test -d "$ansexp"; then
4109 echo "(Looking for $loc_file in directory $value.)"
4110 value="$value/$loc_file"
4111 ansexp="$ansexp/$loc_file"
4113 if test -f "$ansexp"; then
4116 case "$nopath_ok" in
4117 true) case "$value" in
4119 *) echo "Assuming $value will be in people's path."
4135 if test "$fastread" = yes; then
4140 rp="$what $value doesn't exist. Use that name anyway?"
4159 test "X$gfpthkeep" != Xy && gfpth=""
4162 : determine root of directory hierarchy where package will be installed.
4165 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4168 dflt=`echo "$prefix" | sed 's/.$//'`
4176 By default, $package will be installed in $dflt/bin, manual pages
4177 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4178 installation directories. Typically this is something like /usr/local.
4179 If you wish to have binaries under /usr/bin but other parts of the
4180 installation under /usr/local, that's ok: you will be prompted
4181 separately for each of the installation directories, the prefix being
4182 only used to set the defaults.
4186 rp='Installation prefix to use?'
4194 *) oldprefix="$prefix";;
4201 : allow them to override the AFS root
4204 *) afsroot=$afsroot ;;
4210 $define|true) afs=true ;;
4211 $undef|false) afs=false ;;
4212 *) if $test -d $afsroot; then
4220 echo "AFS may be running... I'll be extra cautious then..." >&4
4222 echo "AFS does not seem to be running..." >&4
4225 : determine installation prefix for where package is to be installed.
4229 Since you are running AFS, I need to distinguish the directory in which
4230 files will reside from the directory in which they are installed (and from
4231 which they are presumably copied to the former directory by occult means).
4234 case "$installprefix" in
4235 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4236 *) dflt="$installprefix";;
4241 In some special cases, particularly when building $package for distribution,
4242 it is convenient to distinguish the directory in which files should be
4243 installed from the directory ($prefix) in which they will
4244 eventually reside. For most users, these two directories are the same.
4247 case "$installprefix" in
4249 *) dflt=$installprefix;;
4253 rp='What installation prefix should I use for installing files?'
4255 installprefix="$ans"
4256 installprefixexp="$ansexp"
4258 : Perform the prefixexp/installprefixexp correction if necessary
4259 cat <<EOS >installprefix
4262 cat <<'EOSC' >>installprefix
4263 : Change installation prefix, if necessary.
4264 if $test X"$prefix" != X"$installprefix"; then
4265 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4267 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4270 chmod +x installprefix
4271 $eunicefix installprefix
4273 : Set variables such as privlib and privlibexp from the output of ./getfile
4274 : performing the prefixexp/installprefixexp correction if necessary.
4275 cat <<EOS >setprefixvar
4278 cat <<'EOSC' >>setprefixvar
4279 eval "${prefixvar}=\"\$ans\""
4280 eval "${prefixvar}exp=\"\$ansexp\""
4283 chmod +x setprefixvar
4284 $eunicefix setprefixvar
4286 : set up the script used to warn in case of inconsistency
4295 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4297 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4298 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4303 echo "*** WHOA THERE!!! ***" >&4
4304 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4307 rp=" Keep the $hint value?"
4310 y) td=$was; tu=$was;;
4314 : function used to set '$1' to '$val'
4315 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4317 $define$undef) . ./whoa; eval "$var=\$td";;
4318 $undef$define) . ./whoa; eval "$var=\$tu";;
4319 *) eval "$var=$val";;
4322 : get the patchlevel
4324 echo "Getting the current patchlevel..." >&4
4325 if $test -r $rsrc/patchlevel.h;then
4326 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4327 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4328 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4329 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4330 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4331 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4332 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4341 $echo "(You do not have patchlevel.h. Eek.)"
4343 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4344 version_patchlevel_string="version $patchlevel subversion $subversion"
4345 case "$perl_patchlevel" in
4347 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4348 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4352 $echo "(You have $package $version_patchlevel_string.)"
4356 : XXX Should be a Configure test for double-dots in filenames.
4357 version=`echo $revision $patchlevel $subversion | \
4358 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4359 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4360 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4363 version=`echo $revision $patchlevel $subversion | \
4364 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4365 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4366 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4369 : Special case the 5.005_xx maintenance series, which used 5.005
4370 : without any subversion label as a subdirectory in $sitelib
4371 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4372 api_versionstring='5.005'
4375 : Do we want threads support and if so, what type
4376 case "$usethreads" in
4377 $define|true|[yY]*) dflt='y';;
4378 *) # Catch case where user specified ithreads or 5005threads but
4379 # forgot -Dusethreads (A.D. 4/2002)
4380 case "$useithreads$use5005threads" in
4381 *$define*) dflt='y';;
4388 Perl can be built to offer a form of threading support on some systems
4389 To do so, Configure can be run with -Dusethreads.
4391 Note that Perl built with threading support runs slightly slower
4392 and uses slightly more memory than plain Perl.
4394 If this doesn't make any sense to you, just accept the default '$dflt'.
4396 rp='Build a threading Perl?'
4399 y|Y) val="$define" ;;
4405 if $test $patchlevel -lt 9; then
4406 case "$usethreads" in
4408 : Default to ithreads unless overridden on command line or with
4411 case "$use5005threads" in
4413 echo "5.005 threads are no longer supported"
4417 case "$useithreads" in
4418 $undef|false|[nN]*) dflt='n';;
4420 rp='Use the newer interpreter-based ithreads?'
4423 y|Y) val="$define" ;;
4428 : Now set use5005threads to the opposite value.
4429 case "$useithreads" in
4430 $define) val="$undef" ;;
4437 useithreads="$undef"
4438 use5005threads="$undef"
4442 case "$useithreads$use5005threads" in
4446 You cannot have both the ithreads and the 5.005 threads enabled
4447 at the same time. Disabling the 5.005 threads since they are
4448 much less stable than the ithreads.
4451 use5005threads="$undef"
4456 : perl-5.9.x and later
4458 if test X"$usethreads" = "X$define"; then
4459 case "$use5005threads" in
4463 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4470 use5005threads="$undef"
4471 useithreads="$usethreads"
4474 case "$d_oldpthreads" in
4475 '') : Configure tests would be welcome here. For now, assume undef.
4477 *) val="$d_oldpthreads" ;;
4483 : Look for a hint-file generated 'call-back-unit'. If the
4484 : user has specified that a threading perl is to be built,
4485 : we may need to set or change some other defaults.
4486 if $test -f usethreads.cbu; then
4487 echo "Your platform has some specific hints regarding threaded builds, using them..."
4490 case "$usethreads" in
4491 "$define"|true|[yY]*)
4493 (Your platform does not have any specific hints for threaded builds.
4494 Assuming POSIX threads, then.)
4500 : Check if multiplicity is required
4503 Perl can be built so that multiple Perl interpreters can coexist
4504 within the same Perl executable.
4507 case "$useithreads" in
4510 This multiple interpreter support is required for interpreter-based threads.
4514 *) case "$usemultiplicity" in
4515 $define|true|[yY]*) dflt='y';;
4519 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4520 rp='Build Perl for multiplicity?'
4523 y|Y) val="$define" ;;
4531 : Check if morebits is requested
4532 case "$usemorebits" in
4533 "$define"|true|[yY]*)
4534 use64bitint="$define"
4535 uselongdouble="$define"
4536 usemorebits="$define"
4538 *) usemorebits="$undef"
4542 : Determine the C compiler to be used
4548 rp="Use which C compiler?"
4552 : See whether they have no cc but they do have gcc
4554 if $test -f cc.cbu; then
4559 : make some quick guesses about what we are up against
4561 $echo $n "Hmm... $c"
4571 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4572 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4574 echo "Looks kind of like an OSF/1 system, but we'll see..."
4576 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4577 xxx=`./loc addbib blurfl $pth`
4578 if $test -f $xxx; then
4579 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4583 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4584 echo "Looks kind of like an extended USG system, but we'll see..."
4586 echo "Looks kind of like a USG system, but we'll see..."
4590 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4591 echo "Looks kind of like a BSD system, but we'll see..."
4595 echo "Looks kind of like a Version 7 system, but we'll see..."
4598 case "$eunicefix" in
4601 There is, however, a strange, musty smell in the air that reminds me of
4602 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4606 : it so happens the Eunice I know will not run shell scripts in Unix format
4610 echo "Congratulations. You aren't running Eunice."
4614 : Detect OS2. The p_ variable is set above in the Head.U unit.
4615 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4616 : semicolon as a patch separator
4621 I have the feeling something is not exactly right, however...don't tell me...
4622 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4623 (Or you may be running DOS with DJGPP.)
4628 if test -f /xenix; then
4629 echo "Actually, this looks more like a XENIX system..."
4634 echo "It's not Xenix..."
4639 if test -f /venix; then
4640 echo "Actually, this looks more like a VENIX system..."
4647 echo "Nor is it Venix..."
4650 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4651 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4654 : Check if we are using GNU gcc and what its version is
4656 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4660 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4662 printf("%s\n", __VERSION__);
4664 printf("%s\n", "1");
4670 if $cc -o try $ccflags $ldflags try.c; then
4671 gccversion=`$run ./try`
4672 case "$gccversion" in
4673 '') echo "You are not using GNU cc." ;;
4674 *) echo "You are using GNU cc $gccversion."
4680 echo "*** WHOA THERE!!! ***" >&4
4681 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4682 case "$knowitall" in
4684 echo " You'd better start hunting for one and let me know about it." >&4
4690 case "$gccversion" in
4691 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4693 case "$gccversion" in
4694 '') gccosandvers='' ;;
4695 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4696 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4698 case "$gccosandvers" in
4699 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4700 $osname$osvers) ;; # looking good
4701 $osname*) cat <<EOM >&4
4703 *** WHOA THERE!!! ***
4705 Your gcc has not been compiled for the exact release of
4706 your operating system ($gccosandvers versus $osname$osvers).
4708 In general it is a good idea to keep gcc synchronized with
4709 the operating system because otherwise serious problems
4710 may ensue when trying to compile software, like Perl.
4712 I'm trying to be optimistic here, though, and will continue.
4713 If later during the configuration and build icky compilation
4714 problems appear (headerfile conflicts being the most common
4715 manifestation), I suggest reinstalling the gcc to match
4716 your operating system release.
4720 *) gccosandvers='' ;; # failed to parse, better be silent
4728 # gcc 3.* complain about adding -Idirectories that they already know about,
4729 # so we will take those off from locincpth.
4730 case "$gccversion" in
4732 echo "main(){}">try.c
4733 for incdir in $locincpth; do
4734 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4735 grep '^c[cp]p*[01]: warning: changing search order '`
4736 if test "X$warn" != X; then
4737 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4743 # gcc 4.9 by default does some optimizations that break perl.
4744 # see ticket 121505.
4746 # The -fwrapv disables those optimizations (and probably others,) so
4747 # for gcc 4.9 (and later, since the optimizations probably won't go
4748 # away), add -fwrapv unless the user requests -fno-wrapv, which
4749 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4750 # which turns the overflows -fwrapv ignores into runtime errors.
4751 case "$gccversion" in
4752 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4754 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4755 *) ccflags="$ccflags -fwrapv" ;;
4759 : What should the include directory be ?
4760 : Use sysroot if set, so findhdr looks in the right place.
4762 $echo $n "Hmm... $c"
4763 dflt="$sysroot/usr/include"
4766 if $test -f /bin/mips && /bin/mips; then
4767 echo "Looks like a MIPS system..."
4768 $cat >usr.c <<'EOCP'
4769 #ifdef SYSTYPE_BSD43
4773 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4774 dflt='/bsd43/usr/include'
4778 mips_type='System V'
4780 $rm -f usr.c usr.out
4781 echo "and you're compiling with the $mips_type compiler and libraries."
4785 echo "Doesn't look like a MIPS system."
4795 case "$xxx_prompt" in
4798 rp='Where are the include files you want to use?'
4806 : see how we invoke the C preprocessor
4808 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4809 cat <<'EOT' >testcpp.c
4815 if test ! -f cppstdin; then
4816 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4817 # AIX cc -E doesn't show the absolute headerfile
4818 # locations but we'll cheat by using the -M flag.
4819 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
4821 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4824 echo "Keeping your $hint cppstdin wrapper."
4827 wrapper=`pwd`/cppstdin
4831 if $test "X$cppstdin" != "X" && \
4832 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4835 echo "You used to use $cppstdin $cppminus so we'll use that again."
4837 '') echo "But let's see if we can live without a wrapper..." ;;
4839 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4840 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4842 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4845 echo "(However, $cpprun $cpplast does not work, let's see...)"
4853 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4860 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4861 $cc -E <testcpp.c >testcpp.out 2>&1; \
4862 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4863 echo "Yup, it does."
4864 x_cpp="$cc $cppflags -E"
4866 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4867 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4868 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 echo "Yup, it does."
4870 x_cpp="$cc $cppflags -E"
4872 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4873 $cc -P <testcpp.c >testcpp.out 2>&1; \
4874 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4875 echo "Yipee, that works!"
4876 x_cpp="$cc $cppflags -P"
4878 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4879 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4880 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 echo "At long last!"
4882 x_cpp="$cc $cppflags -P"
4884 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4885 $cpp <testcpp.c >testcpp.out 2>&1; \
4886 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4888 x_cpp="$cpp $cppflags"
4890 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4891 $cpp - <testcpp.c >testcpp.out 2>&1; \
4892 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4893 echo "Hooray, it works! I was beginning to wonder."
4894 x_cpp="$cpp $cppflags"
4896 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4897 $wrapper <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4904 rp="No dice. I can't find a C preprocessor. Name one:"
4908 $x_cpp <testcpp.c >testcpp.out 2>&1
4909 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4910 echo "OK, that will do." >&4
4912 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4927 echo "Perhaps can we force $cc -E using a wrapper..."
4928 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4929 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4935 echo "Nope, we'll have to live without it..."
4949 "$wrapper"|'cppstdin') ;;
4950 *) $rm -f $wrapper;;
4952 $rm -f testcpp.c testcpp.out
4954 : Adjust cppfilter for path component separator
4956 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4957 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4961 : Use gcc to determine libpth and incpth
4962 # If using gcc or clang, we can get better values for libpth, incpth
4963 # and usrinc directly from the compiler.
4964 # Note that ccname for clang is also gcc.
4967 $echo 'extern int foo;' > try.c
4968 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4970 if $test $# -gt 0; then
4972 incpth="`$echo $incpth|$sed 's/^ //'`"
4974 j="`$echo $i|$sed 's,/include$,/lib,'`"
4975 if $test -d $j; then
4979 libpth="`$echo $libpth|$sed 's/^ //'`"
4980 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4981 if $test -d $xxx; then
4984 *) libpth="$libpth $xxx";;
4991 '') for i in $incpth; do
4992 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5000 case "$usecrosscompile" in
5003 '') echo "Incpth not defined." >&4; croak=y ;;
5004 *) echo "Using incpth '$incpth'." >&4 ;;
5007 '') echo "Libpth not defined." >&4; croak=y ;;
5008 *) echo "Using libpth '$libpth'." >&4 ;;
5011 '') echo "Usrinc not defined." >&4; croak=y ;;
5012 *) echo "Using usrinc $usrinc." >&4 ;;
5016 if test "X$sysroot" = X; then
5017 echo "Cannot continue, aborting." >&4; exit 1
5019 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5028 : Default value for incpth is just usrinc
5030 '') incpth="$usrinc";;
5033 : Set private lib path
5036 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5041 '') dlist="$loclibpth $plibpth $glibpth";;
5042 *) dlist="$libpth";;
5045 : Now check and see which directories actually exist, avoiding duplicates
5048 if $test -d $xxx; then
5051 *) libpth="$libpth $xxx";;
5057 Some systems have incompatible or broken versions of libraries. Among
5058 the directories listed in the question below, please remove any you
5059 know not to be holding relevant libraries, and add any that are needed.
5060 Say "none" for none.
5064 if test "X$sysroot" != X; then
5066 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5079 rp="Directories to use for library searches?"
5086 : compute shared library extension
5089 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5099 On some systems, shared libraries may be available. Answer 'none' if
5100 you want to suppress searching of shared libraries for the remainder
5101 of this configuration.
5104 rp='What is the file extension used for shared libraries?'
5108 : Does target system insist that shared library basenames are unique
5111 Some dynamic loaders assume that the *basename* of shared library filenames
5112 are globally unique. We'll default this to undef as we assume your system
5113 is not this weird. Set to defined if you're on one of them.
5118 rp='Make shared library basenames unique?'
5121 y|Y) val="$define" ;;
5124 set d_libname_unique
5127 : Define several unixisms.
5128 : Hints files or command line option can be used to override them.
5129 : The convoluted testing is in case hints files set either the old
5132 '') case "$exe_ext" in
5134 *) _exe="$exe_ext" ;;
5139 '') case "$lib_ext" in
5146 '') case "$obj_ext" in
5153 '') case "$path_sep" in
5164 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5166 : Which makefile gets called first. This is used by make depend.
5167 case "$firstmakefile" in
5168 '') firstmakefile='makefile';;
5171 : Check is we will use socks
5173 $define|true|[yY]*) dflt='y';;
5178 Perl can be built to use the SOCKS proxy protocol library. To do so,
5179 Configure must be run with -Dusesocks. If you use SOCKS you also need
5180 to use the PerlIO abstraction layer, this will be implicitly selected.
5182 If this doesn't make any sense to you, just accept the default '$dflt'.
5184 rp='Build Perl for SOCKS?'
5187 y|Y) val="$define" ;;
5193 : Check for uselongdouble support
5195 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5198 case "$uselongdouble" in
5199 $define|true|[yY]*) dflt='y';;
5204 Perl can be built to take advantage of long doubles which
5205 (if available) may give more accuracy and range for floating point numbers.
5207 If this doesn't make any sense to you, just accept the default '$dflt'.
5209 rp='Try to use long doubles if available?'
5212 y|Y) val="$define" ;;
5218 case "$uselongdouble" in
5219 true|[yY]*) uselongdouble="$define" ;;
5222 : Look for a hint-file generated 'call-back-unit'. If the
5223 : user has specified that long doubles should be used,
5224 : we may need to set or change some other defaults.
5225 if $test -f uselongdouble.cbu; then
5226 echo "Your platform has some specific hints regarding long doubles, using them..."
5227 . ./uselongdouble.cbu
5229 case "$uselongdouble" in
5232 (Your platform does not have any specific hints for long doubles.)
5238 : Check if quadmath is requested
5239 case "$usequadmath" in
5240 "$define"|true|[yY]*) usequadmath="$define" ;;
5241 *) usequadmath="$undef" ;;
5244 : Fail if both uselongdouble and usequadmath are requested
5245 case "$usequadmath:$uselongdouble" in
5249 *** You requested the use of the quadmath library and use
5250 *** of long doubles.
5252 *** Please select one or the other.
5258 : Looking for optional libraries
5260 echo "Checking for optional libraries..." >&4
5265 case "$libswanted" in
5266 '') libswanted='c_s';;
5269 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5271 case "$usecbacktrace" in
5272 "$define") libswanted="$libswanted bfd" ;;
5274 case "$usequadmath" in
5275 "$define") libswanted="$libswanted quadmath" ;;
5281 for thisdir in $libpth $xlibpth; do
5282 test -d $thisdir && libspath="$libspath $thisdir"
5284 for thislib in $libswanted; do
5285 for thisdir in $libspath; do
5287 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5288 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5289 $test -f "$xxx" && eval $libscheck
5290 $test -f "$xxx" && libstyle=shared
5291 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5292 $test -f "$xxx" && eval $libscheck
5293 $test -f "$xxx" && libstyle=shared
5295 if test ! -f "$xxx"; then
5296 xxx=$thisdir/lib$thislib.$so
5297 $test -f "$xxx" && eval $libscheck
5298 $test -f "$xxx" && libstyle=shared
5300 if test ! -f "$xxx"; then
5301 xxx=$thisdir/lib$thislib$_a
5302 $test -f "$xxx" && eval $libscheck
5303 $test -f "$xxx" && libstyle=static
5305 if test ! -f "$xxx"; then
5306 xxx=$thisdir/$thislib$_a
5307 $test -f "$xxx" && eval $libscheck
5308 $test -f "$xxx" && libstyle=static
5310 if test ! -f "$xxx"; then
5311 xxx=$thisdir/lib${thislib}_s$_a
5312 $test -f "$xxx" && eval $libscheck
5313 $test -f "$xxx" && libstyle=static
5314 $test -f "$xxx" && thislib=${thislib}_s
5316 if test ! -f "$xxx"; then
5317 xxx=$thisdir/Slib$thislib$_a
5318 $test -f "$xxx" && eval $libscheck
5319 $test -f "$xxx" && libstyle=static
5321 if $test -f "$xxx"; then
5323 shared) echo "Found -l$thislib (shared)." ;;
5324 static) echo "Found -l$thislib." ;;
5325 *) echo "Found -l$thislib ($libstyle)." ;;
5329 *) dflt="$dflt -l$thislib"
5330 libsfound="$libsfound $xxx"
5332 libsfiles="$libsfiles $yyy"
5333 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5334 case " $libsdirs " in
5336 *) libsdirs="$libsdirs $yyy" ;;
5343 if $test ! -f "$xxx"; then
5344 echo "No -l$thislib."
5355 ' '|'') dflt='none';;
5360 In order to compile $package on your machine, a number of libraries
5361 are usually needed. Include any other special libraries here as well.
5362 Say "none" for none. The default list is almost always right.
5366 rp="What libraries to use?"
5373 : determine optimization, if desired, or use for debug flag also
5375 ' '|$undef) dflt='none';;
5377 *) dflt="$optimize";;
5381 By default, $package compiles with the -O flag to use the optimizer.
5382 Alternately, you might want to use the symbolic debugger, which uses
5383 the -g flag (on traditional Unix systems). Either flag can be
5384 specified here. To use neither flag, specify the word "none".
5387 rp="What optimizer/debugger flag should be used?"
5391 'none') optimize=" ";;
5394 : Check what DEBUGGING is required from the command line
5395 : -DEBUGGING or -DDEBUGGING or
5396 : -DEBUGGING=both = -g + -DDEBUGGING
5397 : -DEBUGGING=-g or -Doptimize=-g = -g
5398 : -DEBUGGING=none or -UDEBUGGING =
5399 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5402 *) DEBUGGING=$EBUGGING ;;
5405 case "$DEBUGGING" in
5409 *) optimize="$optimize -g" ;;
5413 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5421 case "$DEBUGGING" in
5422 both|$define) dflt='-DDEBUGGING'
5425 : argument order is deliberate, as the flag will start with - which set could
5426 : think is an option
5427 checkccflag='check=$1; flag=$2; callback=$3;
5429 echo "Checking if your compiler accepts $flag" 2>&1;
5430 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5431 echo "int main(void) { return 0; }" > gcctest.c;
5432 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5433 echo "Yes, it does." 2>&1;
5434 if $test -s gcctest.out ; then
5435 echo "But your platform does not like it:";
5440 echo "Leaving current flags $ccflags alone." 2>&1
5442 *) dflt="$dflt $flag";
5448 echo "Nope, it does not, but that is ok." 2>&1;
5452 : We will not override a previous value, but we might want to
5453 : augment a hint file
5455 default|recommended)
5456 case "$gccversion" in
5457 1*) dflt="$dflt -fpcc-struct-return" ;;
5459 case "$optimize:$DEBUGGING" in
5460 *-g*:old) dflt="$dflt -DDEBUGGING";;
5462 case "$gccversion" in
5463 2*) if $test -d /etc/conf/kconfig.d &&
5464 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5466 # Interactive Systems (ISC) POSIX mode.
5471 case "$gccversion" in
5474 ?*) set strict-aliasing -fno-strict-aliasing
5478 # For gcc, adding -pipe speeds up compilations for some, but apparently
5479 # some assemblers can't read from stdin. (It also slows down compilations
5480 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5481 case "$gccversion" in
5487 # on x86_64 (at least) we require an extra library (libssp) in the
5488 # link command line. This library is not named, so I infer that it is
5489 # an implementation detail that may change. Hence the safest approach
5490 # is to add the flag to the flags passed to the compiler at link time,
5491 # as that way the compiler can do the right implementation dependant
5494 amigaos) ;; # -fstack-protector builds but doesn't work
5495 *) case "$gccversion" in
5496 ?*) set stack-protector-strong -fstack-protector-strong
5499 *-fstack-protector-strong*) ;; # It got added.
5500 *) # Try the plain/older -fstack-protector.
5501 set stack-protector -fstack-protector
5512 case "$mips_type" in
5513 *BSD*|'') inclwanted="$locincpth $usrinc";;
5514 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5516 for thisincl in $inclwanted; do
5517 if $test -d $thisincl; then
5518 if $test x$thisincl != x$usrinc; then
5520 *" -I$thisincl "*);;
5521 *) dflt="$dflt -I$thisincl ";;
5527 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5529 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5537 *) dflt="$dflt -D$2";;
5541 set signal.h LANGUAGE_C; eval $inctest
5545 ccflags="$ccflags -DSOCKS"
5550 default|recommended) dflt="$ccflags $dflt" ;;
5551 *) dflt="$ccflags";;
5560 Your C compiler may want other flags. For this question you should include
5561 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5562 but you should NOT include libraries or ld flags like -lwhatever. If you
5563 want $package to honor its debug switch, you should include -DDEBUGGING here.
5564 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5566 To use no flags, specify the word "none".
5572 rp="Any additional cc flags?"
5579 : the following weeds options from ccflags that are of no interest to cpp
5581 '') cppflags="$ccflags" ;;
5582 *) set X $ccflags; shift
5583 case " $cppflags " in
5584 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5585 *) cppflags="$cppflags $ccflags" ;;
5589 case "$gccversion" in
5590 1*) cppflags="$cppflags -D__GNUC__"
5592 case "$mips_type" in
5594 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5600 echo "Let me guess what the preprocessor flags are..." >&4
5614 *) ftry="$previous $flag";;
5616 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5617 >cpp1.out 2>/dev/null && \
5618 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5619 >cpp2.out 2>/dev/null && \
5620 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5621 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5623 cppflags="$cppflags $ftry"
5633 *-*) echo "They appear to be: $cppflags";;
5635 $rm -f cpp.c cpp?.out
5639 : flags used in final linking phase
5641 '') if ./venix; then
5647 *-posix*) dflt="$dflt -posix" ;;
5650 *) dflt="$ldflags";;
5652 # See note above about -fstack-protector
5654 *-fstack-protector-strong*)
5656 *-fstack-protector-strong*) ;; # Don't add it again
5657 *) dflt="$dflt -fstack-protector-strong" ;;
5660 *-fstack-protector*)
5662 *-fstack-protector*) ;; # Don't add it again
5663 *) dflt="$dflt -fstack-protector" ;;
5668 : Try to guess additional flags to pick up local libraries.
5669 for thislibdir in $libpth; do
5670 case " $loclibpth " in
5673 *"-L$thislibdir "*) ;;
5674 *) dflt="$dflt -L$thislibdir" ;;
5686 Your C linker may need flags. For this question you should
5687 include -L/whatever and any other flags used by the C linker, but you
5688 should NOT include libraries like -lwhatever.
5690 Make sure you include the appropriate -L/path flags if your C linker
5691 does not normally search all of the directories you specified above,
5694 To use no flags, specify the word "none".
5698 rp="Any additional ld flags (NOT including libraries)?"
5704 rmlist="$rmlist pdp11"
5708 echo "Checking your choice of C compiler and flags for coherency..." >&4
5709 $cat > try.c <<'EOF'
5711 int main() { printf("Ok\n"); return(0); }
5713 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5715 $cat >try.msg <<'EOM'
5716 I've tried to compile and run the following simple program:
5719 $cat try.c >> try.msg
5721 $cat >> try.msg <<EOM
5728 and I got the following output:
5732 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5733 if $sh -c "$run ./try " >>try.msg 2>&1; then
5737 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5740 echo "The program compiled OK, but exited with status $?." >>try.msg
5741 rp="You have a problem. Shall I abort Configure"
5745 echo "I can't compile the test program." >>try.msg
5746 rp="You have a BIG problem. Shall I abort Configure"
5752 case "$knowitall" in
5754 echo "(The supplied flags or libraries might be incorrect.)"
5762 *) echo "Ok. Stopping Configure." >&4
5767 n) echo "OK, that should do.";;
5769 $rm_try gcctest gcctest.out
5771 : define a shorthand compile call
5775 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5776 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5780 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5781 : define a shorthand compile call for compilations that should be ok.
5785 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5787 : stub, used only to satisfy other units
5790 : check for lengths of integral types
5794 echo "Checking to see how big your integers are..." >&4
5803 printf("intsize=%d;\n", (int)sizeof(int));
5804 printf("longsize=%d;\n", (int)sizeof(long));
5805 printf("shortsize=%d;\n", (int)sizeof(short));
5810 if eval $compile_ok && $run ./try > /dev/null; then
5812 echo "Your integers are $intsize bytes long."
5813 echo "Your long integers are $longsize bytes long."
5814 echo "Your short integers are $shortsize bytes long."
5818 Help! I can't compile and run the intsize test program: please enlighten me!
5819 (This is probably a misconfiguration in your system or libraries, and
5820 you really ought to fix it. Still, I'll try anyway.)
5824 rp="What is the size of an integer (in bytes)?"
5828 rp="What is the size of a long integer (in bytes)?"
5832 rp="What is the size of a short integer (in bytes)?"
5840 : check for long long
5842 echo "Checking to see if you have long long..." >&4
5843 echo 'int main() { long long x = 7; return 0; }' > try.c
5845 if eval $compile; then
5847 echo "You have long long."
5850 echo "You do not have long long."
5856 : check for length of long long
5857 case "${d_longlong}${longlongsize}" in
5860 echo "Checking to see how big your long longs are..." >&4
5861 $cat >try.c <<'EOCP'
5865 printf("%d\n", (int)sizeof(long long));
5870 if eval $compile_ok; then
5871 longlongsize=`$run ./try`
5872 echo "Your long longs are $longlongsize bytes long."
5876 echo "(I can't seem to compile the test program. Guessing...)"
5877 rp="What is the size of a long long (in bytes)?"
5881 if $test "X$longsize" = "X$longlongsize"; then
5882 echo "(That isn't any different from an ordinary long.)"
5888 : determine filename position in cpp output
5890 echo "Computing filename position in cpp output for #include directives..." >&4
5892 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5897 vos) testaccess=-e ;;
5900 echo '#include <stdio.h>' > foo.c
5903 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5904 $grep '^[ ]*#.*stdio\.h' | \
5905 while read cline; do
5908 while $test \$# -gt 0; do
5909 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5914 pos=\`expr \$pos + 1\`
5928 *) pos="${fieldn}th";;
5930 echo "Your cpp writes the filename in the $pos field of the line."
5932 : locate header file
5937 for usrincdir in $incpth
5939 if test -f \$usrincdir/\$wanted; then
5940 echo "\$usrincdir/\$wanted"
5944 awkprg='{ print \$$fieldn }'
5945 echo "#include <\$wanted>" > foo\$\$.c
5946 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5947 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5948 while read cline; do
5949 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5951 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5952 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5957 # status = 0: grep returned 0 lines, case statement not executed
5958 # status = 1: headerfile found
5959 # status = 2: while loop executed, no headerfile found
5963 if test \$status -eq 1; then
5970 : define an alternate in-header-list? function
5971 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5972 cont=true; xxf="echo \"<\$1> found.\" >&4";
5973 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5974 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5976 case $# in 4) instead=instead;; *) instead="at last";; esac;
5977 while $test "$cont"; do
5979 var=$2; eval "was=\$$2";
5980 if $test "$xxx" && $test -r "$xxx";
5982 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5985 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5986 set $yyy; shift; shift; yyy=$@;
5987 case $# in 0) cont="";;
5988 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5989 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5990 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5991 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5995 do set $yyy; var=$2; eval "was=\$$2";
5996 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5997 set $yyy; shift; shift; yyy=$@;
6000 : see if inttypes.h is available
6001 : we want a real compile instead of Inhdr because some systems
6002 : have an inttypes.h which includes non-existent headers
6005 #include <inttypes.h>
6007 static int32_t foo32 = 0x12345678;
6011 if eval $compile; then
6012 echo "<inttypes.h> found." >&4
6015 echo "<inttypes.h> NOT found." >&4
6024 echo "Checking to see if you have int64_t..." >&4
6026 #include <sys/types.h>
6027 #$i_inttypes I_INTTYPES
6029 #include <inttypes.h>
6031 int main() { int64_t x = 7; }
6034 if eval $compile; then
6036 echo "You have int64_t."
6039 echo "You do not have int64_t."
6045 : Check if 64bit ints have a quad type
6047 echo "Checking which 64-bit integer type we could use..." >&4
6053 val='"unsigned int"'
6058 *) case "$longsize" in
6062 val='"unsigned long"'
6067 *) case "$d_longlong:$longlongsize" in
6072 val='"unsigned long long"'
6077 *) case "$d_int64_t" in
6096 '') echo "Alas, no 64-bit integer types in sight." >&4
6099 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6104 : Do we want 64bit support
6105 case "$uselonglong" in
6106 "$define"|true|[yY]*)
6109 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6111 use64bitint="$define"
6114 case "$use64bits" in
6115 "$define"|true|[yY]*)
6118 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6120 use64bitint="$define"
6123 case "$use64bitints" in
6124 "$define"|true|[yY]*)
6127 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6129 use64bitint="$define"
6132 case "$use64bitsint" in
6133 "$define"|true|[yY]*)
6136 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6138 use64bitint="$define"
6141 case "$uselonglongs" in
6142 "$define"|true|[yY]*)
6145 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6147 use64bitint="$define"
6150 case "$use64bitsall" in
6151 "$define"|true|[yY]*)
6154 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6156 use64bitall="$define"
6161 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6163 case "$use64bitall" in
6164 "$define"|true|[yY]*) use64bitint="$define" ;;
6170 You have natively 64-bit long integers.
6174 *) case "$use64bitint" in
6175 "$define"|true|[yY]*) dflt='y';;
6184 Perl can be built to take advantage of 64-bit integer types
6185 on some systems. To do so, Configure can be run with -Duse64bitint.
6186 Choosing this option will most probably introduce binary incompatibilities.
6188 If this doesn't make any sense to you, just accept the default '$dflt'.
6189 (The default has been chosen based on your configuration.)
6191 rp='Try to use 64-bit integers, if available?'
6194 [yY]*) val="$define" ;;
6202 case "$use64bitall" in
6203 "$define"|true|[yY]*) dflt='y' ;;
6204 *) case "$longsize" in
6212 You may also choose to try maximal 64-bitness. It means using as much
6213 64-bitness as possible on the platform. This in turn means even more
6214 binary incompatibilities. On the other hand, your platform may not
6215 have any more 64-bitness available than what you already have chosen.
6217 If this doesn't make any sense to you, just accept the default '$dflt'.
6218 (The default has been chosen based on your configuration.)
6220 rp='Try to use maximal 64-bit support, if available?'
6223 [yY]*) val="$define" ;;
6228 case "$use64bitall" in
6230 case "$use64bitint" in
6234 Since you have chosen a maximally 64-bit build, I'm also turning on
6235 the use of 64-bit integers.
6237 use64bitint="$define" ;;
6242 : Look for a hint-file generated 'call-back-unit'. If the
6243 : user has specified that a 64-bit perl is to be built,
6244 : we may need to set or change some other defaults.
6245 if $test -f use64bitint.cbu; then
6246 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6249 case "$use64bitint" in
6250 "$define"|true|[yY]*)
6251 : This test was common to all the OpenBSD forks, and seems harmless for
6254 echo "Checking if your C library has broken 64-bit functions..." >&4
6257 typedef $uquadtype myULL;
6264 {4294967303.15, 4294967303ULL},
6265 {4294967294.2, 4294967294ULL},
6266 {4294967295.7, 4294967295ULL},
6269 for (p = test; p->u; p++) {
6270 myULL x = (myULL)p->d;
6281 if eval $compile_ok; then
6282 libcquad=`$run ./try`
6283 echo "Your C library's 64-bit functions are $libcquad."
6285 echo "(I can't seem to compile the test program.)"
6286 echo "Assuming that your C library's 64-bit functions are ok."
6295 *** You have a C library with broken 64-bit functions.
6296 *** 64-bit support does not work reliably in this configuration.
6297 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6298 *** Cannot continue, aborting.
6305 4) case "$archname64" in
6306 '') archname64=64int ;;
6313 : Look for a hint-file generated 'call-back-unit'. If the
6314 : user has specified that a maximally 64-bit perl is to be built,
6315 : we may need to set or change some other defaults.
6316 if $test -f use64bitall.cbu; then
6317 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6320 case "$use64bitall" in
6321 "$define"|true|[yY]*)
6323 4) case "$archname64" in
6324 ''|64int) archname64=64all ;;
6331 case "$d_quad:$use64bitint" in
6335 *** You have chosen to use 64-bit integers,
6336 *** but none can be found.
6337 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6338 *** Cannot continue, aborting.
6345 : Check if we are using the GNU C library
6347 echo "Checking for GNU C Library..." >&4
6349 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6350 alone are insufficient to distinguish different versions, such as
6351 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6352 libc version 2.1.0. A. Dougherty, June 3, 2002.
6358 # ifdef __GLIBC_MINOR__
6359 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6360 # include <gnu/libc-version.h>
6361 printf("%s\n", gnu_get_libc_version());
6363 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6366 printf("%d\n", __GLIBC__);
6375 if eval $compile_ok && $run ./try > glibc.ver; then
6377 gnulibc_version=`$cat glibc.ver`
6378 echo "You are using the GNU C Library version $gnulibc_version"
6382 echo "You are not using the GNU C Library"
6388 : see if nm is to be used to determine whether a symbol is defined or not
6392 case "$d_gnulibc" in
6395 echo "nm probably won't work on the GNU C Library." >&4
6401 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6403 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6404 echo "'nm' won't be sufficient on this system." >&4
6410 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6411 if $test $dflt -gt 20; then
6421 true|$define) dflt=y;;
6428 I can use $nm to extract the symbols from your C libraries. This
6429 is a time consuming task which may generate huge output on the disk (up
6430 to 3 megabytes) but that should make the symbols extraction faster. The
6431 alternative is to skip the 'nm' extraction part and to compile a small
6432 test program instead to determine whether each symbol is present. If
6433 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6434 this may be the best solution.
6436 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6439 rp="Shall I use $nm to extract C symbols from the libraries?"
6442 [Nn]*) usenm=false;;
6451 : nm options which may be necessary
6453 '') if $test -f /mach_boot; then
6455 elif $test -d /usr/ccs/lib; then
6456 nm_opt='-p' # Solaris (and SunOS?)
6457 elif $test -f /dgux; then
6459 elif $test -f /lib64/rld; then
6460 nm_opt='-p' # 64-bit Irix
6466 : nm options which may be necessary for shared libraries but illegal
6467 : for archive libraries. Thank you, Linux.
6468 case "$nm_so_opt" in
6469 '') case "$myuname" in
6471 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6472 nm_so_opt='--dynamic'
6479 : Figure out where the libc is located
6482 : get list of predefined functions in a handy place
6487 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6493 *) for thislib in $libs; do
6496 : Handle C library specially below.
6499 thislib=`echo $thislib | $sed -e 's/^-l//'`
6500 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6502 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6504 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6506 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6508 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6510 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6512 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6517 libnames="$libnames $try"
6519 *) libnames="$libnames $thislib" ;;
6528 for xxx in $libpth; do
6529 $test -r $1 || set $xxx/libc.$so
6530 : The messy sed command sorts on library version numbers.
6532 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6533 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6535 s/[0-9][0-9]*/0000&/g
6536 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6539 $sort | $sed -e 's/^.* //'`
6542 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6543 $test -r $1 || set $sysroot/lib/libsys_s$_a
6549 if $test -r "$1"; then
6550 echo "Your (shared) C library seems to be in $1."
6552 elif $test -r /lib/libc && $test -r /lib/clib; then
6553 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6555 libc='/lib/clib /lib/libc'
6556 if $test -r /lib/syslib; then
6557 echo "(Your math library is in /lib/syslib.)"
6558 libc="$libc /lib/syslib"
6560 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6561 echo "Your C library seems to be in $libc, as you said before."
6562 elif $test -r $incpath/usr/lib/libc$_a; then
6563 libc=$incpath/usr/lib/libc$_a;
6564 echo "Your C library seems to be in $libc. That's fine."
6565 elif $test -r /lib/libc$_a; then
6567 echo "Your C library seems to be in $libc. You're normal."
6569 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6571 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6572 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6573 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6575 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6577 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6580 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6582 if $test -r "$tans"; then
6583 echo "Your C library seems to be in $tans, of all places."
6589 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6593 If the guess above is wrong (which it might be if you're using a strange
6594 compiler, or your machine supports multiple models), you can override it here.
6599 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6601 I can't seem to find your C library. I've looked in the following places:
6604 $sed 's/^/ /' libpath
6607 None of these seems to contain your C library. I need to get its name...
6612 rp='Where is your C library?'
6617 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6618 set X `cat libnames`
6621 case $# in 1) xxx=file; esac
6622 echo "Extracting names from the following $xxx for later perusal:" >&4
6624 $sed 's/^/ /' libnames >&4
6626 $echo $n "This may take a while...$c" >&4
6630 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6631 *) $nm $nm_opt $file 2>/dev/null;;
6636 $grep fprintf libc.tmp > libc.ptf
6637 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6638 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6640 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6665 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6693 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6698 $nm -p $* 2>/dev/null >libc.tmp
6699 $grep fprintf libc.tmp > libc.ptf
6700 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6701 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6707 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6709 if $ar t $libc > libc.tmp && \
6710 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6712 for thisname in $libnames $libc; do
6713 $ar t $thisname >>libc.tmp
6715 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6717 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6718 for thisname in $libnames $libc; do
6719 $ar tv $thisname >>libc.tmp
6720 emximp -o tmp.imp $thisname \
6722 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6723 < tmp.imp >>libc.tmp
6726 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6729 echo "$ar didn't seem to work right." >&4
6730 echo "Maybe this is a Cray...trying bld instead..." >&4
6732 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6735 for thisname in $libnames; do
6737 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6738 $ar t $thisname >>libc.tmp
6742 echo "That didn't work either. Giving up." >&4
6752 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6753 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6755 *) if $test -f /lib/syscalls.exp; then
6757 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6758 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6759 /lib/syscalls.exp >>libc.list
6765 $rm -f libnames libpath
6767 : Check if we are using C++
6769 echo "Checking for C++..." >&4
6770 $cat >try.c <<'EOCP'
6782 if eval $compile_ok && $run ./try; then
6784 echo "You are using a C++ compiler."
6787 echo "You are not using a C++ compiler."
6793 : is a C symbol defined?
6796 -v) tf=libc.tmp; tdc="";;
6797 -a) tf=libc.tmp; tdc="[]";;
6798 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6800 case "$d_cplusplus" in
6801 $define) extern_C="extern \"C\"" ;;
6802 *) extern_C="extern" ;;
6805 case "$reuseval-$4" in
6807 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6812 if $test "$runnm" = true; then
6813 if $contains $tlook $tf >/dev/null 2>&1; then
6815 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6816 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;
6817 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6818 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6822 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6823 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6829 $define) tval=true;;
6836 : define an is-in-libc? function
6837 inlibc='echo " "; td=$define; tu=$undef;
6838 sym=$1; var=$2; eval "was=\$$2";
6840 case "$reuseval$was" in
6850 echo "$sym() found." >&4;
6851 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6853 echo "$sym() NOT found." >&4;
6854 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6858 $define) echo "$sym() found." >&4;;
6859 *) echo "$sym() NOT found." >&4;;
6863 : check for length of double
6865 case "$doublesize" in
6867 echo "Checking to see how big your double precision numbers are..." >&4
6876 printf("%d\n", (int)sizeof(double));
6881 if eval $compile_ok; then
6882 doublesize=`$run ./try`
6883 echo "Your double is $doublesize bytes long."
6886 echo "(I can't seem to compile the test program. Guessing...)"
6887 rp="What is the size of a double precision number (in bytes)?"
6895 : check for long doubles
6897 echo "Checking to see if you have long double..." >&4
6898 echo 'int main() { long double x = 7.0; }' > try.c
6900 if eval $compile; then
6902 echo "You have long double."
6905 echo "You do not have long double."
6911 : see if ldexpl exists
6915 : check for length of long double
6916 case "${d_longdbl}${longdblsize}" in
6919 echo "Checking to see how big your long doubles are..." >&4
6920 $cat >try.c <<'EOCP'
6924 printf("%d\n", sizeof(long double));
6929 if eval $compile; then
6930 longdblsize=`$run ./try`
6931 echo "Your long doubles are $longdblsize bytes long."
6935 echo "(I can't seem to compile the test program. Guessing...)" >&4
6936 rp="What is the size of a long double (in bytes)?"
6940 if $test "X$doublesize" = "X$longdblsize"; then
6941 echo "That isn't any different from an ordinary double."
6942 echo "I'll keep your setting anyway, but you may see some"
6943 echo "harmless compilation warnings."
6949 $echo "Checking the kind of long doubles you have..." >&4
6950 case "$d_longdbl" in
6954 #define LONGDBLSIZE $longdblsize
6955 #define DOUBLESIZE $doublesize
6961 static const long double d = -0.1L;
6963 unsigned const char* b = (unsigned const char*)(&d);
6964 #if DOUBLESIZE == LONGDBLSIZE
6965 printf("0\n"); /* if it floats like double */
6968 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6969 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6970 /* IEEE 754 128-bit little-endian */
6974 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6975 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6980 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6981 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6982 * cannot be trusted. */
6983 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6984 if (b[0] == 0xCD && b[9] == 0xBF) {
6985 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6986 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6987 * Also known as "extended precision". */
6991 if (b[0] == 0xBF && b[9] == 0xCD) {
6992 /* Is there ever big-endian 80-bit, really?
6994 * The Motorola 68881 had another "extended precision" format:
6995 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6996 * for total of 96 bits of bytes. The zero bits were unused.
6997 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6998 * If it ever becomes relevant, this format should be allocated
6999 * a new doublekind code since it's quite different from the Intel x87.
7005 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7006 /* software "double double", the 106 is 53+53.
7007 * but irix thinks it is 107. */
7008 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7009 /* double double 128-bit fully little-endian,
7010 * little-endian doubles in little-endian order,
7011 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7015 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7016 /* double double 128-bit fully big-endian,
7017 * big-endian doubles in big-endian order,
7018 * e.g. PPC/Power and MIPS:
7019 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7023 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7024 /* double double 128-bit mixed endian.
7025 * little-endian doubles in big-endian order,
7027 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7031 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7032 /* double double 128-bit mixed endian,
7033 * big-endian doubles in little-endian order,
7034 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7039 /* We are largely making this up because it may well be
7040 * that the VAX format H was never made available to C,
7041 * only to Fortran. */
7042 #if LONGDBLSIZE == 16 && defined(__vax__)
7043 if (b[0] == 0xFD && b[15] == 0x99) {
7044 /* VAX format H, PDP-11 mixed endian. */
7049 printf("-1\n"); /* unknown */
7054 if eval $compile; then
7055 longdblkind=`$run ./try`
7062 case "$longdblkind" in
7063 0) echo "Your long doubles are doubles." >&4 ;;
7064 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7065 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7066 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7067 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7068 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7069 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7070 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7071 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7072 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7073 *) echo "Cannot figure out your long double." >&4 ;;
7075 d_long_double_style_ieee=$undef
7076 d_long_double_style_ieee_std=$undef
7077 d_long_double_style_ieee_extended=$undef
7078 d_long_double_style_ieee_doubledouble=$undef
7079 d_long_double_style_vax=$undef
7080 case "$longdblkind" in
7081 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7083 case "$longdblkind" in
7084 1|2) d_long_double_style_ieee_std=$define ;;
7086 case "$longdblkind" in
7087 3|4) d_long_double_style_ieee_extended=$define ;;
7089 case "$longdblkind" in
7090 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7092 case "$longdblkind" in
7093 9) d_long_double_style_vax=$define ;;
7097 : determine the architecture name
7099 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7100 tarch=`arch`"-$osname"
7101 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7102 if uname -m > tmparch 2>&1 ; then
7103 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7104 -e 's/$/'"-$osname/" tmparch`
7112 case "$myarchname" in
7115 echo "(Your architecture name used to be $myarchname.)"
7119 case "$targetarch" in
7121 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7126 *) dflt="$archname";;
7128 rp='What is your architecture name'
7132 : optionally add API version to the architecture for versioned archlibs
7133 case "$useversionedarchname" in
7134 $define|true|[yY]*) dflt='y';;
7137 rp='Add the Perl API version to your archname?'
7140 y|Y) useversionedarchname="$define" ;;
7141 *) useversionedarchname="$undef" ;;
7143 case "$useversionedarchname" in
7146 *-$api_versionstring)
7147 echo "...and architecture name already has -$api_versionstring" >&4
7150 archname="$archname-$api_versionstring"
7151 echo "...setting architecture name to $archname." >&4
7157 case "$usethreads" in
7159 echo "Threads selected." >&4
7161 *-thread*) echo "...and architecture name already has -thread." >&4
7163 *) archname="$archname-thread"
7164 echo "...setting architecture name to $archname." >&4
7169 case "$usemultiplicity" in
7171 echo "Multiplicity selected." >&4
7173 *-multi*) echo "...and architecture name already has -multi." >&4
7175 *) archname="$archname-multi"
7176 echo "...setting architecture name to $archname." >&4
7181 case "$use64bitint$use64bitall" in
7183 case "$archname64" in
7185 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7188 case "$use64bitint" in
7189 "$define") echo "64 bit integers selected." >&4 ;;
7191 case "$use64bitall" in
7192 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7195 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7197 *) archname="$archname-$archname64"
7198 echo "...setting architecture name to $archname." >&4
7204 case "$uselongdouble" in
7206 echo "Long doubles selected." >&4
7207 case "$longdblsize" in
7209 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7213 *-ld*) echo "...and architecture name already has -ld." >&4
7215 *) archname="$archname-ld"
7216 echo "...setting architecture name to $archname." >&4
7223 case "$usequadmath" in
7225 echo "quadmath selected." >&4
7227 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7229 *) archname="$archname-quadmath"
7230 echo "...setting architecture name to $archname." >&4
7235 if $test -f archname.cbu; then
7236 echo "Your platform has some specific hints for architecture name, using them..."
7240 : set the prefixit variable, to compute a suitable default value
7241 prefixit='case "$3" in
7243 case "$oldprefix" in
7244 "") eval "$1=\"\$$2\"";;
7251 ""|" ") eval "$1=\"\$$2\"";;
7257 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7259 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7260 /*-$oldprefix/*|\~*-$oldprefix/*)
7261 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7262 *) eval "$1=\"\$$2\"";;
7266 : determine installation style
7267 : For now, try to deduce it from prefix unless it is already set.
7268 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7269 case "$installstyle" in
7270 '') case "$prefix" in
7271 *perl*) dflt='lib';;
7272 *) dflt='lib/perl5' ;;
7275 *) dflt="$installstyle" ;;
7277 : Probably not worth prompting for this since we prompt for all
7278 : the directories individually, and the prompt would be too long and
7282 : determine where public executables go
7287 rp='Pathname where the public executables will reside?'
7289 if $test "X$ansexp" != "X$binexp"; then
7293 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7294 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7295 : this via initialinstalllocation
7298 case "$userelocatableinc" in
7299 $define|true|[yY]*) dflt='y' ;;
7304 Would you like to build Perl so that the installation is relocatable, so that
7305 library paths in @INC are determined relative to the path of the perl binary?
7306 This is not advised for system Perl installs, or if you need to run setid
7307 scripts or scripts under taint mode.
7309 If this doesn't make any sense to you, just accept the default '$dflt'.
7311 rp='Use relocatable @INC?'
7314 y|Y) val="$define" ;;
7317 set userelocatableinc
7320 initialinstalllocation="$binexp"
7321 : Default prefix is now "up one level from where the binaries are"
7322 case "$userelocatableinc" in
7328 installprefixexp=".../.."
7332 : determine where private library files go
7333 : Usual default is /usr/local/lib/perl5/$version.
7334 : Also allow things like /opt/perl/lib/$version, since
7335 : /opt/perl/lib/perl5... would be redundant.
7336 : The default "style" setting is made in installstyle.U
7337 case "$installstyle" in
7338 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7339 *) set dflt privlib lib/$version ;;
7344 There are some auxiliary files for $package that need to be put into a
7345 private library directory that is accessible by everyone.
7350 rp='Pathname where the private library files will reside?'
7355 : set the prefixup variable, to restore leading tilda escape
7356 prefixup='case "$prefixexp" in
7358 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7361 : determine where public architecture dependent libraries go
7364 : privlib default is /usr/local/lib/$package/$version
7365 : archlib default is /usr/local/lib/$package/$version/$archname
7366 : privlib may have an optional trailing /share.
7367 tdflt=`echo $privlib | $sed 's,/share$,,'`
7368 tdflt=$tdflt/$archname
7377 $spackage contains architecture-dependent library files. If you are
7378 sharing libraries in a heterogeneous environment, you might store
7379 these files in a separate location. Otherwise, you can just include
7380 them with the rest of the public library files.
7385 rp='Where do you want to put the public architecture-dependent libraries?'
7389 if $test X"$archlib" = X"$privlib"; then
7395 : see if setuid scripts can be secure
7398 Some kernels have a bug that prevents setuid #! scripts from being
7399 secure. Some sites have disabled setuid #! scripts because of this.
7401 First let's decide if your kernel supports secure setuid #! scripts.
7402 (If setuid #! scripts would be secure but have been disabled anyway,
7403 don't say that they are secure if asked.)
7408 if $test -d /dev/fd; then
7409 echo "#!$ls" >reflect
7410 chmod +x,u+s reflect
7411 ./reflect >flect 2>&1
7412 if $contains "/dev/fd" flect >/dev/null; then
7413 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7417 If you are not sure if they are secure, I can check but I'll need a
7418 username and password different from the one you are using right now.
7419 If you don't have such a username or don't want me to test, simply
7423 rp='Other username to test security of setuid scripts with?'
7428 case "$d_suidsafe" in
7429 '') echo "I'll assume setuid scripts are *not* secure." >&4
7432 echo "Well, the $hint value is *not* secure." >&4
7434 *) echo "Well, the $hint value *is* secure." >&4
7439 $rm -f reflect flect
7440 echo "#!$ls" >reflect
7441 chmod +x,u+s reflect
7444 echo '"su" will (probably) prompt you for '"$ans's password."
7445 su $ans -c './reflect >flect'
7446 if $contains "/dev/fd" flect >/dev/null; then
7447 echo "Okay, it looks like setuid scripts are secure." >&4
7450 echo "I don't think setuid scripts are secure." >&4
7455 rp='Does your kernel have *secure* setuid scripts?'
7458 [yY]*) val="$define";;
7463 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7464 echo "(That's for file descriptors, not floppy disks.)"
7470 $rm -f reflect flect
7472 : now see if they want to do setuid emulation
7473 if $test $patchlevel -lt 11; then
7476 case "$d_suidsafe" in
7479 echo "No need to emulate SUID scripts since they are secure here." >&4
7483 Some systems have disabled setuid scripts, especially systems where
7484 setuid scripts cannot be secure. On systems where setuid scripts have
7485 been disabled, the setuid/setgid bits on scripts are currently
7486 useless. It is possible for $package to detect those bits and emulate
7487 setuid/setgid in a secure fashion. This emulation will only work if
7488 setuid scripts have been disabled in your kernel.
7492 "$define") dflt=y ;;
7495 rp="Do you want to do setuid/setgid emulation?"
7498 [yY]*) val="$define";;
7510 SUID emulation has been removed for 5.12
7511 Please re-run Configure without -Dd_dosuid
7520 : Find perl5.005 or later.
7521 echo "Looking for a previously installed perl5.005 or later... "
7523 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7524 : Check if this perl is recent and can load a simple module
7525 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7528 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7538 '') echo "None found. That's ok.";;
7539 *) echo "Using $perl5." ;;
7542 : Set the siteprefix variables
7545 After $package is installed, you may wish to install various
7546 add-on modules and utilities. Typically, these add-ons will
7547 be installed under $prefix with the rest
7548 of this package. However, you may wish to install such add-ons
7549 elsewhere under a different prefix.
7551 If you do not wish to put everything under a single prefix, that's
7552 ok. You will be prompted for the individual locations; this siteprefix
7553 is only used to suggest the defaults.
7555 The default should be fine for most people.
7559 rp='Installation prefix to use for add-on modules and utilities?'
7560 : XXX Here might be another good place for an installstyle setting.
7561 case "$siteprefix" in
7563 *) dflt=$siteprefix ;;
7566 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7568 case "$siteprefix" in
7572 *) oldsiteprefix="$prefix";;
7577 siteprefixexp="$ansexp"
7579 : determine where site specific libraries go.
7580 : Usual default is /usr/local/lib/perl5/site_perl/$version
7581 : The default "style" setting is made in installstyle.U
7582 : XXX No longer works with Prefixit stuff.
7583 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7585 '') case "$installstyle" in
7586 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7587 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7595 The installation process will create a directory for
7596 site-specific extensions and modules. Most users find it convenient
7597 to place all site-specific files in this directory rather than in the
7598 main distribution directory.
7602 rp='Pathname for the site-specific library files?'
7606 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7608 : Determine list of previous versions to include in @INC
7609 $cat > getverlist <<EOPL
7612 \$api_versionstring = "$api_versionstring";
7613 \$version = "$version";
7614 \$stem = "$sitelib_stem";
7615 \$archname = "$archname";
7617 $cat >> getverlist <<'EOPL'
7618 # The list found is store twice for each entry: the original name, and
7619 # the binary broken down version as pack "sss", so sorting is easy and
7620 # unambiguous. This will work for all versions that have a maximum of
7621 # three digit groups, separate by '.'s or '_'s. Names are extended with
7622 # ".0.0" to ensure at least three elements for the pack.
7623 # -- H.Merijn Brand (m)'06 23-10-2006
7625 # Can't have leading @ because metaconfig interprets it as a command!
7626 ;@inc_version_list=();
7627 # XXX Redo to do opendir/readdir?
7630 ;@candidates = map {
7631 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7632 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7638 ($pversion, $aversion, $vsn5005) = map {
7639 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7640 foreach $d (@candidates) {
7641 if ($d->[1] lt $pversion) {
7642 if ($d->[1] ge $aversion) {
7643 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7645 elsif ($d->[1] ge $vsn5005) {
7646 unshift(@inc_version_list, grep { -d } $d->[0]);
7650 # Skip newer version. I.e. don't look in
7651 # 5.7.0 if we're installing 5.6.1.
7655 if (@inc_version_list) {
7656 print join(' ', @inc_version_list);
7659 # Blank space to preserve value for next Configure run.
7664 case "$inc_version_list" in
7665 '') if test -x "$perl5$exe_ext"; then
7666 dflt=`$perl5 getverlist`
7671 $undef) dflt='none' ;;
7672 *) eval dflt=\"$inc_version_list\" ;;
7675 ''|' ') dflt=none ;;
7682 In order to ease the process of upgrading, this version of perl
7683 can be configured to use modules built and installed with earlier
7684 versions of perl that were installed under $prefix. Specify here
7685 the list of earlier versions that this version of perl should check.
7686 If Configure detected no earlier versions of perl installed under
7687 $prefix, then the list will be empty. Answer 'none' to tell perl
7688 to not search earlier versions.
7690 The default should almost always be sensible, so if you're not sure,
7691 just accept the default.
7694 rp='List of earlier versions to include in @INC?'
7697 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7698 *) inc_version_list="$ans" ;;
7700 case "$inc_version_list" in
7702 inc_version_list_init='0'
7703 d_inc_version_list="$undef"
7705 *) inc_version_list_init=`echo $inc_version_list |
7706 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7707 d_inc_version_list="$define"
7712 : see if malloc/malloc.h has to be included
7713 set malloc/malloc.h i_mallocmalloc
7716 : see if this is a malloc.h system
7717 : we want a real compile instead of Inhdr because some systems have a
7718 : malloc.h that just gives a compile error saying to use stdlib.h instead
7723 #$i_mallocmalloc I_MALLOCMALLOC
7724 #ifdef I_MALLOCMALLOC
7725 # include <malloc/malloc.h>
7728 int main () { return 0; }
7731 if eval $compile; then
7732 echo "<malloc.h> found." >&4
7735 echo "<malloc.h> NOT found." >&4
7742 : check for length of pointer
7746 echo "Checking to see how big your pointers are..." >&4
7755 printf("%d\n", (int)sizeof(void *));
7760 if eval $compile_ok; then
7761 ptrsize=`$run ./try`
7762 echo "Your pointers are $ptrsize bytes long."
7765 echo "(I can't seem to compile the test program. Guessing...)" >&4
7766 rp="What is the size of a pointer (in bytes)?"
7773 case "$use64bitall" in
7774 "$define"|true|[yY]*)
7778 *** You have chosen a maximally 64-bit build,
7779 *** but your pointers are only 4 bytes wide.
7780 *** Please rerun Configure without -Duse64bitall.
7785 *** Since you have quads, you could possibly try with -Duse64bitint.
7790 *** Cannot continue, aborting.
7800 : determine whether to use malloc wrapping
7802 case "$usemallocwrap" in
7803 [yY]*|true|$define) dflt='y' ;;
7804 [nN]*|false|$undef) dflt='n' ;;
7805 *) case "$usedevel" in
7806 [yY]*|true|$define) dflt='y' ;;
7811 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7813 usemallocwrap="$ans"
7816 usemallocwrap="$define" ;;
7818 usemallocwrap="$undef" ;;
7821 : determine which malloc to compile in
7823 case "$usemymalloc" in
7824 [yY]*|true|$define) dflt='y' ;;
7825 [nN]*|false|$undef) dflt='n' ;;
7826 *) case "$ptrsize" in
7830 if test "$useithreads" = "$define"; then dflt='n'; fi
7833 rp="Do you wish to attempt to use the malloc that comes with $package?"
7839 mallocsrc='malloc.c'
7840 mallocobj="malloc$_o"
7841 d_mymalloc="$define"
7844 : Remove malloc from list of libraries to use
7845 echo "Removing unneeded -lmalloc from library list" >&4
7846 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7849 echo "libs = $libs" >&4
7861 : compute the return types of malloc and free
7863 $cat >malloc.c <<END
7867 #include <sys/types.h>
7881 case "$malloctype" in
7883 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7890 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7894 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7901 echo "Your system uses $freetype free(), it would seem." >&4
7903 : determine where site specific architecture-dependent libraries go.
7904 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7905 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7906 : sitelib may have an optional trailing /share.
7908 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7909 dflt="$dflt/$archname"
7914 set sitearch sitearch none
7918 The installation process will also create a directory for
7919 architecture-dependent site-specific extensions and modules.
7923 rp='Pathname for the site-specific architecture-dependent library files?'
7927 if $test X"$sitearch" = X"$sitelib"; then
7930 d_sitearch="$define"
7933 : Set the vendorprefix variables
7936 The installation process will also create a directory for
7937 vendor-supplied add-ons. Vendors who supply perl with their system
7938 may find it convenient to place all vendor-supplied files in this
7939 directory rather than in the main distribution directory. This will
7940 ease upgrades between binary-compatible maintenance versions of perl.
7942 Of course you may also use these directories in whatever way you see
7943 fit. For example, you might use them to access modules shared over a
7944 company-wide network.
7946 The default answer should be fine for most people.
7947 This causes further questions about vendor add-ons to be skipped
7948 and no vendor-specific directories will be configured for perl.
7951 rp='Do you want to configure vendor-specific add-on directories?'
7952 case "$usevendorprefix" in
7953 define|true|[yY]*) dflt=y ;;
7954 *) : User may have set vendorprefix directly on Configure command line.
7955 case "$vendorprefix" in
7964 rp='Installation prefix to use for vendor-supplied add-ons?'
7965 case "$vendorprefix" in
7966 '') dflt="$prefix" ;;
7967 *) dflt=$vendorprefix ;;
7970 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7972 case "$vendorprefix" in
7976 *) oldvendorprefix="$prefix";;
7980 usevendorprefix="$define"
7982 vendorprefixexp="$ansexp"
7984 *) usevendorprefix="$undef"
7990 : Set the vendorlib variables
7991 case "$vendorprefix" in
7992 '') d_vendorlib="$undef"
7996 *) d_vendorlib="$define"
7997 : determine where vendor-supplied modules go.
7998 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7999 case "$vendorlib" in
8001 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8002 case "$installstyle" in
8003 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8004 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8007 *) dflt="$vendorlib"
8011 rp='Pathname for the vendor-supplied library files?'
8014 vendorlibexp="$ansexp"
8017 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8021 : Set the vendorarch variables
8022 case "$vendorprefix" in
8023 '') d_vendorarch="$undef"
8027 *) d_vendorarch="$define"
8028 : determine where vendor-supplied architecture-dependent libraries go.
8029 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8030 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8031 : vendorlib may have an optional trailing /share.
8032 case "$vendorarch" in
8033 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8034 dflt="$dflt/$archname"
8036 *) dflt="$vendorarch" ;;
8039 rp='Pathname for vendor-supplied architecture-dependent files?'
8042 vendorarchexp="$ansexp"
8045 prefixvar=vendorarch
8047 if $test X"$vendorarch" = X"$vendorlib"; then
8048 d_vendorarch="$undef"
8050 d_vendorarch="$define"
8053 : Final catch-all directories to search
8056 Lastly, you can have perl look in other directories for extensions and
8057 modules in addition to those already specified.
8058 These directories will be searched after
8062 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8063 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8065 case "$otherlibdirs" in
8066 ''|' ') dflt='none' ;;
8067 *) dflt="$otherlibdirs" ;;
8070 Enter a colon-separated set of extra paths to include in perl's @INC
8071 search path, or enter 'none' for no extra paths.
8075 rp='Colon-separated list of additional directories for perl to search?'
8078 ' '|''|none) otherlibdirs=' ' ;;
8079 *) otherlibdirs="$ans" ;;
8081 case "$otherlibdirs" in
8085 set d_perl_otherlibdirs
8089 dflt_dtrace='/usr/sbin/dtrace'
8090 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8094 Perl can be built to support DTrace on platforms that support it.
8095 DTrace is a diagnosis and performance analysis tool from Sun.
8097 If this doesn't make any sense to you, just accept the default.
8101 case "$usedtrace" in
8107 dflt_dtrace=$usedtrace
8114 rp='Support DTrace if available?'
8117 y|Y) val="$define" ;;
8123 test "X$usedtrace" != "X$define" && break
8126 rp='Where is the dtrace executable?'
8135 if $dtrace -h -s ../perldtrace.d \
8136 -o perldtrace.tmp >/dev/null 2>&1 \
8137 && rm -f perldtrace.tmp
8140 echo "Good: your $dtrace knows about the -h flag."
8144 *** $me: Fatal Error: $dtrace doesn't support -h flag
8146 *** Your installed dtrace doesn't support the -h switch to compile a D
8147 *** program into a C header. Can't continue.
8159 *** $me: Fatal Error: $dtrace not found.
8166 echo "*** $dtrace was not found."
8172 : See if we want extra modules installed
8179 Perl can be built with extra modules or bundles of modules which
8180 will be fetched from the CPAN and installed alongside Perl.
8182 Notice that you will need access to the CPAN; either via the Internet,
8183 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8184 be asked later to configure the CPAN.pm module which will in turn do
8185 the installation of the rest of the extra modules or bundles.)
8187 Notice also that if the modules require any external software such as
8188 libraries and headers (the libz library and the zlib.h header for the
8189 Compress::Zlib module, for example) you MUST have any such software
8190 already installed, this configuration process will NOT install such
8193 If this doesn't make any sense to you, just accept the default '$dflt'.
8195 rp='Install any extra modules (y or n)?'
8201 Please list any extra modules or bundles to be installed from CPAN,
8202 with spaces between the names. The names can be in any format the
8203 'install' command of CPAN.pm will understand. (Answer 'none',
8204 without the quotes, to install no extra modules or bundles.)
8214 $rm -f ../extras.lst
8216 *) echo "(Saving the list of extras for later...)"
8217 echo "$extras" > ../extras.lst
8225 : determine where html pages for programs go
8226 set html1dir html1dir none
8230 If you wish to install html files for programs in $spackage, indicate
8231 the appropriate directory here. To skip installing html files,
8235 ''|none|$undef|' ') dflt=none ;;
8236 *) dflt=$html1dir ;;
8239 rp="Directory for the main $spackage html pages?"
8243 : Use ' ' for none so value is preserved next time through Configure
8244 $test X"$html1dir" = "X" && html1dir=' '
8246 : determine where html pages for libraries and modules go
8247 set html3dir html3dir none
8251 If you wish to install html files for modules associated with $spackage,
8252 indicate the appropriate directory here. To skip installing html files,
8255 : There is no obvious default. If they have specified html1dir, then
8256 : try to key off that, possibly changing .../html1 into .../html3.
8258 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8259 *) dflt=$html3dir ;;
8262 rp="Directory for the $spackage module html pages?"
8266 : Use ' ' for none so value is preserved next time through Configure
8267 $test X"$html3dir" = "X" && html3dir=' '
8269 : determine whether to install perl also as /usr/bin/perl
8272 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8274 Many scripts expect perl to be installed as /usr/bin/perl.
8276 If you want to, I can install the perl you are about to compile
8277 as /usr/bin/perl (in addition to $bin/perl).
8279 if test -f /usr/bin/perl; then
8282 However, please note that because you already have a /usr/bin/perl,
8283 overwriting that with a new Perl would very probably cause problems.
8284 Therefore I'm assuming you don't want to do that (unless you insist).
8287 case "$installusrbinperl" in
8288 "$define"|[yY]*) dflt='y';;
8294 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8297 case "$installusrbinperl" in
8298 "$undef"|[nN]*) dflt='n';;
8302 rp="Do you want to install perl as /usr/bin/perl?"
8305 [yY]*) val="$define";;
8311 set installusrbinperl
8314 : see if dlopen exists
8316 xxx_ccflags="$ccflags"
8318 : with g++ one needs -shared to get is-in-libc to work for dlopen
8319 case "$gccversion" in
8322 *) case "$d_cplusplus" in
8323 "$define") ccflags="$ccflags -shared" ;;
8330 ccflags="$xxx_ccflags"
8332 : see if this is a unistd.h system
8333 set unistd.h i_unistd
8336 : determine which dynamic loading, if any, to compile in
8338 dldir="ext/DynaLoader"
8351 $define) dflt='y' ;;
8353 : Does a dl_xxx.xs file exist for this operating system
8354 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8357 rp="Do you wish to use dynamic loading?"
8364 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8365 dflt="$dldir/dl_${osname}.xs"
8366 elif $test "$d_dlopen" = "$define" ; then
8367 dflt="$dldir/dl_dlopen.xs"
8372 *) dflt="$dldir/$dlsrc"
8375 echo "The following dynamic loading files are available:"
8376 : Can not go over to $dldir because getfile has path hard-coded in.
8377 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8378 rp="Source file to use for dynamic loading"
8384 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8388 Some systems may require passing special flags to $cc -c to
8389 compile modules that will be used to create a shared library.
8390 To use no flags, say "none".
8393 case "$cccdlflags" in
8394 '') case "$gccversion" in
8395 '') case "$osname" in
8397 irix*) dflt='-KPIC' ;;
8398 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8399 sunos) dflt='-pic' ;;
8403 *) case "$osname" in
8404 darwin) dflt='none' ;;
8405 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8410 *) dflt="$cccdlflags" ;;
8417 # If -Dsysroot was specified, now's the time to add it
8419 if test "X$sysroot" != X; then
8420 case "$gccversion" in
8425 dflt="$dflt --sysroot=$sysroot" ;;
8435 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8438 none) cccdlflags=' ' ;;
8439 *) cccdlflags="$ans" ;;
8444 Some systems use ld to create libraries that can be dynamically loaded,
8445 while other systems (such as those using ELF) use $cc.
8449 : Determine if this is ELF
8451 /* Test for whether ELF binaries are produced */
8463 int i = open("a.out",O_RDONLY);
8466 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8467 exit(0); /* succeed (yes, it is ELF) */
8471 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8477 '') if $test $bin_ELF = "$define"; then
8479 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8483 echo "I'll use ld to build dynamic libraries."
8491 rp="What command should be used to create dynamic libraries?"
8497 Some systems may require passing special flags to $ld to create a
8498 library that can be dynamically loaded. If your ld flags include
8499 -L/other/path options to locate libraries outside your loader's normal
8500 search path, you may need to specify those -L options here as well. To
8501 use no flags, say "none".
8504 case "$lddlflags" in
8505 '') case "$osname" in
8506 haiku) dflt='-shared' ;;
8508 case "$gccversion" in
8509 '') dflt="$dflt +vnocompatwarnings" ;;
8512 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8513 solaris) # See [perl #66604].
8514 # On Solaris 11, gcc -m64 on amd64
8515 # appears not to understand -G. gcc versions at
8516 # least as old as 3.4.3 support -shared, so just
8517 # use that with Solaris 11 and later, but keep
8518 # the old behavior for older Solaris versions.
8519 case "$gccversion" in
8521 *) case "$osvers" in
8522 2.?|2.10) dflt='-G' ;;
8523 *) dflt='-shared' ;;
8528 sunos) dflt='-assert nodefinitions' ;;
8529 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8533 *) dflt="$lddlflags" ;;
8536 : Only do this for gcc, since, for example, qcc has no concept
8538 if $test "X$sysroot" != X; then
8539 case "$gccversion" in
8541 *) dflt="$dflt --sysroot $sysroot" ;;
8545 : Try to guess additional flags to pick up local libraries.
8546 : Be careful not to append to a plain 'none'
8550 for thisflag in $ldflags; do
8555 *) dflt="$dflt $thisflag" ;;
8562 ''|' ') dflt='none' ;;
8566 *-fstack-protector-strong*)
8568 *-fstack-protector-strong*) ;; # Don't add it again
8569 *) dflt="$dflt -fstack-protector-strong" ;;
8572 *-fstack-protector*)
8574 *-fstack-protector*) ;; # Don't add it again
8575 *) dflt="$dflt -fstack-protector" ;;
8580 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8583 none) lddlflags=' ' ;;
8584 *) lddlflags="$ans" ;;
8589 Some systems may require passing special flags to $cc to indicate that
8590 the resulting executable will use dynamic linking. To use no flags,
8594 case "$ccdlflags" in
8595 '') case "$osname" in
8596 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8597 sunos) dflt='none' ;;
8601 *) dflt="$ccdlflags" ;;
8603 rp="Any special flags to pass to $cc to use dynamic linking?"
8606 none) ccdlflags=' ' ;;
8607 *) ccdlflags="$ans" ;;
8619 ld_can_script="$undef"
8620 case "$bin_ELF$usedl" in
8622 # Abuse try.h and a.out names for neat cleanup
8634 if $cc $cccdlflags $ccdlflags $ccflags \
8635 $ldflags $lddlflags -o a.out try.c \
8636 -Wl,--version-script=try.h >/dev/null 2>&1 \
8637 && $test -s a.out ; then
8638 echo "ld supports scripting" >&4
8639 ld_can_script="$define"
8641 echo "ld does not support scripting" >&4
8647 : Do we want a shared libperl?
8651 # No dynamic loading being used, so don't bother even to prompt.
8654 *) case "$useshrplib" in
8655 '') case "$osname" in
8656 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8658 also='Building a shared libperl is required for dynamic loading to work on your system.'
8672 The perl executable is normally obtained by linking perlmain.c with
8673 libperl${_a}, any static extensions (usually just DynaLoader), and
8674 any other libraries needed on this system (such as -lm, etc.). Since
8675 your system supports dynamic loading, it is probably possible to build
8676 a shared libperl.$so. If you will have more than one executable linked
8677 to libperl.$so, this will significantly reduce the size of each
8678 executable, but it may have a noticeable effect on performance. The
8679 default is probably sensible for your system.
8683 rp="Build a shared libperl.$so (y/n)"
8687 useshrplib='true' ;;
8688 *) useshrplib='false' ;;
8693 case "$useshrplib" in
8695 case "$userelocatableinc" in
8697 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8698 echo "See INSTALL for an explanation why that won't work." >&4
8704 # Figure out a good name for libperl.so. Since it gets stored in
8705 # a version-specific architecture-dependent library, the version
8706 # number isn't really that important, except for making cc/ld happy.
8708 # A name such as libperl.so.10.1
8709 majmin="libperl.$so.$patchlevel.$subversion"
8710 # A name such as libperl.so.100
8711 majonly=`echo $patchlevel $subversion |
8712 $awk '{printf "%d%02d", $1, $2}'`
8713 majonly=libperl.$so.$majonly
8714 # I'd prefer to keep the os-specific stuff here to a minimum, and
8715 # rely on figuring it out from the naming of libc.
8716 case "${osname}${osvers}" in
8717 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8720 cygwin*) # ld links now against the dll directly
8721 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8722 majonly=`echo $patchlevel $subversion |
8723 $awk '{printf "%03d%03d", $1, $2}'`
8724 majonly=cygperl5.$majonly.$so
8727 *) # Try to guess based on whether libc has major.minor.
8729 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8730 *libc.$so.[0-9]*) dflt=$majonly ;;
8731 *) dflt=libperl.$so ;;
8741 I need to select a good name for the shared libperl. If your system uses
8742 library names with major and minor numbers, then you might want something
8743 like $majmin. Alternatively, if your system uses a single version
8744 number for shared libraries, then you might want to use $majonly.
8745 Or, your system might be quite happy with a simple libperl.$so.
8747 Since the shared libperl will get installed into a version-specific
8748 architecture-dependent directory, the version number of the shared perl
8749 library probably isn't important, so the default should be o.k.
8752 rp='What name do you want to give to the shared libperl?'
8755 echo "Ok, I'll use $libperl"
8758 libperl="libperl${_a}"
8762 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8766 WARNING: Use of the shrpdir variable for the installation location of
8767 the shared $libperl is not supported. It was never documented and
8768 will not work in this version. Let me (perlbug@perl.org)
8769 know of any problems this may cause.
8775 But your current setting of $shrpdir is
8776 the default anyway, so it's harmless.
8781 Further, your current attempted setting of $shrpdir
8782 conflicts with the value of $archlibexp/CORE
8783 that installperl will use.
8790 # How will the perl executable find the installed shared $libperl?
8791 # Add $xxx to ccdlflags.
8792 # If we can't figure out a command-line option, use $shrpenv to
8793 # set env LD_RUN_PATH. The main perl makefile uses this.
8794 shrpdir=$archlibexp/CORE
8797 if "$useshrplib"; then
8800 # We'll set it in Makefile.SH...
8805 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8806 xxx="-Wl,-R$shrpdir"
8808 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8809 xxx="-Wl,-rpath,$shrpdir"
8812 # hpux doesn't like the default, either.
8813 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8816 # cygwin needs only ldlibpth
8819 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8825 # Only add $xxx if it isn't already in ccdlflags.
8826 case " $ccdlflags " in
8828 *) ccdlflags="$ccdlflags $xxx"
8831 Adding $xxx to the flags
8832 passed to $ld so that the perl executable will find the
8833 installed shared $libperl.
8841 # Fix ccdlflags in AIX for building external extensions.
8842 # (For building Perl itself bare -bE:perl.exp is needed,
8843 # Makefile.SH takes care of this.)
8845 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8847 # Respect a hint or command-line value.
8849 '') shrpenv="$tmp_shrpenv" ;;
8851 case "$ldlibpthname" in
8852 '') ldlibpthname=LD_LIBRARY_PATH ;;
8853 none) ldlibpthname='' ;;
8856 : determine where manual pages are on this system
8860 syspath='/usr/share/man/man1 /usr/man/man1'
8861 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8862 syspath="$syspath /usr/man/u_man/man1"
8863 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8864 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8865 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8866 sysman=`./loc . /usr/man/man1 $syspath`
8869 if $test -d "$sysman"; then
8870 echo "System manual is in $sysman." >&4
8872 echo "Could not find manual pages in source form." >&4
8875 : determine where manual pages go
8876 set man1dir man1dir none
8880 $spackage has manual pages available in source form.
8884 echo "However, you don't have nroff, so they're probably useless to you."
8886 '') man1dir="none";;
8889 echo "If you don't want the manual sources installed, answer 'none'."
8894 lookpath="$prefixexp/share/man/man1"
8895 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8896 lookpath="$lookpath $prefixexp/man/p_man/man1"
8897 lookpath="$lookpath $prefixexp/man/u_man/man1"
8898 lookpath="$lookpath $prefixexp/man/man.1"
8900 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8901 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8911 rp="Where do the main $spackage manual pages (source) go?"
8913 if $test "X$man1direxp" != "X$ansexp"; then
8924 : What suffix to use on installed man pages
8931 rp="What suffix should be used for the main $spackage man pages?"
8933 '') case "$man1dir" in
8947 *) dflt="$man1ext";;
8954 : see if we can have long filenames
8956 first=123456789abcdef
8958 if (echo hi >$first) 2>/dev/null; then
8959 if $test -f 123456789abcde; then
8960 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8963 echo 'You can have filenames longer than 14 characters.'>&4
8968 You can't have filenames longer than 14 chars.
8969 You can't even think about them!
8975 $rm -rf 123456789abcde*
8977 : determine where library module manual pages go
8978 set man3dir man3dir none
8982 $spackage has manual pages for many of the library modules.
8988 However, you don't have nroff, so they're probably useless to you.
8991 '') man3dir="none";;
8995 case "$d_flexfnam" in
8998 However, your system can't handle the long file names like File::Basename.3.
9001 '') man3dir="none";;
9005 echo "If you don't want the manual sources installed, answer 'none'."
9006 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9008 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9009 if $test -d "$privlib/man/man3"; then
9012 WARNING: Previous versions of perl installed man3 pages into
9013 $privlib/man/man3. This version will suggest a
9014 new default of $dflt.
9018 rp='Do you wish to preserve the old behavior?(y/n)'
9021 y*) dflt="$privlib/man/man3" ;;
9026 *) dflt="$man3dir" ;;
9033 rp="Where do the $package library man pages (source) go?"
9043 : What suffix to use on installed man pages
9049 rp="What suffix should be used for the $package library man pages?"
9051 '') case "$man3dir" in
9065 *) dflt="$man3ext";;
9072 : see if we have to deal with yellow pages, now NIS.
9073 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9079 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9087 rp='Are you getting the hosts file via yellow pages?'
9090 y*) hostcat='ypcat hosts';;
9091 *) hostcat='cat /etc/hosts';;
9097 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9100 '') test -f /etc/group && groupcat='cat /etc/group';;
9103 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9106 : now get the host name
9108 echo "Figuring out host name..." >&4
9109 case "$myhostname" in
9111 echo 'Maybe "hostname" will work...'
9112 if tans=`sh -c hostname 2>&1` ; then
9120 if $test "$cont"; then
9122 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9123 if tans=`cat /etc/systemid 2>&1` ; then
9125 phostname='cat /etc/systemid'
9126 echo "Whadyaknow. Xenix always was a bit strange..."
9129 elif $test -r /etc/systemid; then
9130 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9133 if $test "$cont"; then
9134 echo 'No, maybe "uuname -l" will work...'
9135 if tans=`sh -c 'uuname -l' 2>&1` ; then
9137 phostname='uuname -l'
9139 echo 'Strange. Maybe "uname -n" will work...'
9140 if tans=`sh -c 'uname -n' 2>&1` ; then
9142 phostname='uname -n'
9144 echo 'Oh well, maybe I can mine it out of whoami.h...'
9145 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9146 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9147 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9149 case "$myhostname" in
9150 '') echo "Does this machine have an identity crisis or something?"
9153 echo "Well, you said $myhostname before..."
9154 phostname='echo $myhostname';;
9160 case "$myhostname" in
9161 '') myhostname=noname ;;
9163 : you do not want to know about this
9168 if $test "$myhostname" ; then
9170 rp='Your host name appears to be "'$myhostname'".'" Right?"
9178 : bad guess or no guess
9179 while $test "X$myhostname" = X ; do
9181 rp="Please type the (one word) name of your host:"
9186 : translate upper to lower if necessary
9187 case "$myhostname" in
9189 echo "(Normalizing case in your host name)"
9190 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9194 case "$myhostname" in
9196 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9197 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9198 echo "(Trimming domain name from host name--host name is now $myhostname)"
9200 *) case "$mydomain" in
9203 test "X$hostcat" = "Xypcat hosts" &&
9204 ypmatch "$myhostname" hosts 2>/dev/null |\
9205 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9208 test "X$hostcat" != "X" &&
9209 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9210 /[ ]$myhostname[ . ]/p" > hosts
9213 if $test -f hosts; then
9214 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9215 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9216 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9217 hosts | $sort | $uniq | \
9218 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9219 case `$echo X$dflt` in
9220 X*\ *) echo "(Several hosts in the database matched hostname)"
9223 X.) echo "(You do not have fully-qualified names in the hosts database)"
9227 echo "(I cannot locate a hosts database anywhere)"
9232 tans=`./loc resolv.conf X /etc /usr/etc`
9233 if $test -f "$tans"; then
9234 echo "(Attempting domain name extraction from $tans)"
9235 dflt=.`$sed -n -e 's/ / /g' \
9236 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9239 .) dflt=.`$sed -n -e 's/ / /g' \
9240 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9248 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9249 dflt=.`sh -c domainname 2>/dev/null`
9252 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9256 case "$dflt$osname" in
9257 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9258 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9262 .) echo "(Lost all hope -- silly guess then)"
9268 *) dflt="$mydomain";;
9272 rp="What is your domain name?"
9282 : translate upper to lower if necessary
9285 echo "(Normalizing case in your domain name)"
9286 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9290 : a little sanity check here
9291 case "$phostname" in
9294 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9295 $myhostname$mydomain|$myhostname) ;;
9297 case "$phostname" in
9299 echo "(That doesn't agree with your whoami.h file, by the way.)"
9302 echo "(That doesn't agree with your $phostname command, by the way.)"
9310 : determine the e-mail address of the user who is running us
9313 I need to get your e-mail address in Internet format if possible, i.e.
9314 something like user@host.domain. Please answer accurately since I have
9315 no easy means to double check it. The default value provided below
9316 is most probably close to reality but may not be valid from outside
9317 your organization...
9321 while test "$cont"; do
9322 case "$MAILDOMAIN" in
9324 if $test -s /etc/mailname; then
9325 maildomain=`$cat /etc/mailname`
9327 maildomain="$myhostname$mydomain"
9330 *) maildomain="$MAILDOMAIN";;
9333 '') dflt="$cf_by@$maildomain";;
9334 *) dflt="$cf_email";;
9336 rp='What is your e-mail address?'
9342 rp='Address does not look like an Internet one. Use it anyway?'
9356 : Ask e-mail of administrator
9359 If you or somebody else will be maintaining perl at your site, please
9360 fill in the correct e-mail address here so that they may be contacted
9361 if necessary. Currently, the "perlbug" program included with perl
9362 will send mail to this address in addition to perlbug@perl.org. You may
9363 enter "none" for no administrator.
9366 case "$perladmin" in
9367 '') dflt="$cf_email";;
9368 *) dflt="$perladmin";;
9370 rp='Perl administrator e-mail address'
9374 : determine whether to use a version number suffix for installed binaries
9377 Do you want to use a version number suffix for installed binaries? This
9378 will install 'perl$version' instead of 'perl', and likewise for other
9379 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9380 to be installed side-by-side. Unless you are a developer, you probably
9381 do *not* want to do this.
9383 case "$versiononly" in
9384 "$define"|[Yy]*|true) dflt='y' ;;
9387 rp="Do you want to use a version number suffix for installed binaries?"
9390 [yY]*) val="$define";;
9396 case "$versiononly" in
9397 "$define") inc_version_list=''
9398 inc_version_list_init=0
9402 : figure out how to guarantee perl startup
9403 : XXX Note that this currently takes advantage of the bug that binexp ignores
9404 : the Configure -Dinstallprefix setting, which in turn means that under
9405 : relocatable @INC, initialinstalllocation is what binexp started as.
9406 case "$startperl" in
9408 case "$sharpbang" in
9412 I can use the #! construct to start perl on your system. This will
9413 make startup of perl scripts faster, but may cause problems if you
9414 want to share those scripts and perl is not in a standard place
9415 ($initialinstalllocation/perl) on all your platforms. The alternative
9416 is to force a shell by starting the script with a single ':' character.
9419 case "$versiononly" in
9420 "$define") dflt="$initialinstalllocation/perl$version";;
9421 *) dflt="$initialinstalllocation/perl";;
9423 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9426 none) startperl=": # use perl";;
9427 *) startperl="#!$ans"
9428 if $test 30 -lt `echo "$ans" | wc -c`; then
9431 WARNING: Some systems limit the #! command to 32 characters.
9432 If you experience difficulty running Perl scripts with #!, try
9433 installing Perl in a directory with a shorter pathname.
9439 *) startperl=": # use perl"
9444 echo "I'll use $startperl to start perl scripts."
9446 : figure best path for perl in scripts
9449 case "$versiononly" in
9450 "$define") perlpath="$initialinstalllocation/perl$version";;
9451 *) perlpath="$initialinstalllocation/perl";;
9453 case "$startperl" in
9458 I will use the "eval 'exec'" idiom to start Perl on your system.
9459 I can use the full path of your Perl binary for this purpose, but
9460 doing so may cause problems if you want to share those scripts and
9461 Perl is not always in a standard place ($initialinstalllocation/perl).
9464 dflt="$initialinstalllocation/perl"
9465 rp="What path shall I use in \"eval 'exec'\"?"
9472 case "$startperl" in
9474 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9477 : determine where public executable scripts go
9478 set scriptdir scriptdir
9480 case "$scriptdir" in
9483 : guess some guesses
9484 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9485 $test -d /usr/share/bin && dflt=/usr/share/bin
9486 $test -d /usr/local/script && dflt=/usr/local/script
9487 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9488 $test -d $prefixexp/script && dflt=$prefixexp/script
9492 *) dflt="$scriptdir"
9497 Some installations have a separate directory just for executable scripts so
9498 that they can mount it across multiple architectures but keep the scripts in
9499 one spot. You might, for example, have a subdirectory of /usr/share for this.
9500 Or you might just lump your scripts in with all your other executables.
9504 rp='Where do you keep publicly executable scripts?'
9506 if $test "X$ansexp" != "X$scriptdirexp"; then
9512 : A little fix up for an irregularly named variable.
9513 installscript="$installscriptdir"
9515 : determine where add-on public executables go
9517 '') dflt=$siteprefix/bin ;;
9521 rp='Pathname where the add-on public executables should be installed?'
9526 : determine where add-on html pages go
9527 : There is no standard location, so try to copy the previously-selected
9528 : directory structure for the core html pages.
9529 case "$sitehtml1dir" in
9530 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9531 *) dflt=$sitehtml1dir ;;
9534 ''|' ') dflt=none ;;
9537 rp='Pathname where the site-specific html pages should be installed?'
9539 prefixvar=sitehtml1dir
9542 : determine where add-on library html pages go
9543 : There is no standard location, so try to copy the previously-selected
9544 : directory structure for the core html pages.
9545 case "$sitehtml3dir" in
9546 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9547 *) dflt=$sitehtml3dir ;;
9550 ''|' ') dflt=none ;;
9553 rp='Pathname where the site-specific library html pages should be installed?'
9555 prefixvar=sitehtml3dir
9558 : determine where add-on manual pages go
9559 case "$siteman1dir" in
9560 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9561 *) dflt=$siteman1dir ;;
9564 ''|' ') dflt=none ;;
9567 rp='Pathname where the site-specific manual pages should be installed?'
9569 prefixvar=siteman1dir
9572 : determine where add-on library man pages go
9573 case "$siteman3dir" in
9574 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9575 *) dflt=$siteman3dir ;;
9578 ''|' ') dflt=none ;;
9581 rp='Pathname where the site-specific library manual pages should be installed?'
9583 prefixvar=siteman3dir
9586 : determine where add-on public executable scripts go
9587 case "$sitescript" in
9588 '') dflt=$siteprefix/script
9589 $test -d $dflt || dflt=$sitebin ;;
9590 *) dflt="$sitescript" ;;
9593 rp='Pathname where add-on public executable scripts should be installed?'
9595 prefixvar=sitescript
9598 : see if backtrace exists
9599 set backtrace d_backtrace
9602 : add flags if using c backtrace
9603 case "$usecbacktrace" in
9604 "") usecbacktrace=$undef ;;
9606 case "$d_backtrace" in
9608 case " $ccflags " in
9609 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9610 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9614 echo "This system does not support backtrace" >&4
9615 usecbacktrace=$undef
9621 : Check if faststdio is requested and available
9622 case "$usefaststdio" in
9623 $define|true|[yY]*|'')
9624 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9634 Perl can be built to use 'fast stdio', which means using the stdio
9635 library but also directly manipulating the stdio buffers to enable
9636 faster I/O. Using stdio is better for backward compatibility (especially
9637 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9638 interface has been preferred instead of stdio.
9640 If this doesn't make any sense to you, just accept the default '$dflt'.
9642 rp='Use the "fast stdio" if available?'
9645 y|Y) val="$define" ;;
9651 : define an is-a-typedef? function
9652 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9654 "") inclist="sys/types.h";;
9656 eval "varval=\$$var";
9660 for inc in $inclist; do
9661 echo "#include <$inc>" >>temp.c;
9663 echo "#ifdef $type" >> temp.c;
9664 echo "printf(\"We have $type\");" >> temp.c;
9665 echo "#endif" >> temp.c;
9666 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9667 if $contains $type temp.E >/dev/null 2>&1; then
9673 *) eval "$var=\$varval";;
9676 : define an is-a-typedef? function that prompts if the type is not available.
9677 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9679 "") inclist="sys/types.h";;
9681 eval "varval=\$$var";
9685 for inc in $inclist; do
9686 echo "#include <$inc>" >>temp.c;
9688 echo "#ifdef $type" >> temp.c;
9689 echo "printf(\"We have $type\");" >> temp.c;
9690 echo "#endif" >> temp.c;
9691 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9693 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9694 if $contains $type temp.E >/dev/null 2>&1; then
9695 echo "$type found." >&4;
9698 echo "$type NOT found." >&4;
9704 *) eval "$var=\$varval";;
9707 : see what type lseek is declared as in the kernel
9708 rp="What is the type used for lseek's offset on this system?"
9709 set off_t lseektype long stdio.h sys/types.h
9713 echo "Checking to see how big your file offsets are..." >&4
9715 #include <sys/types.h>
9719 printf("%d\n", (int)sizeof($lseektype));
9724 if eval $compile_ok; then
9725 lseeksize=`$run ./try`
9726 echo "Your file offsets are $lseeksize bytes long."
9730 echo "(I can't seem to compile the test program. Guessing...)"
9731 rp="What is the size of your file offsets (in bytes)?"
9737 : see what type file positions are declared as in the library
9738 rp="What is the type for file position used by fsetpos()?"
9739 set fpos_t fpostype long stdio.h sys/types.h
9742 : Check size for Fpos_t
9745 *_t) zzz="$fpostype" ;;
9748 echo "Checking the size of $zzz..." >&4
9750 #include <sys/types.h>
9757 printf("%d\n", (int)sizeof($fpostype));
9762 if eval $compile_ok; then
9766 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9769 echo "Your $zzz is $fpossize bytes long."
9775 echo "(I can't compile the test program. Guessing...)" >&4
9776 rp="What is the size of your file positions (in bytes)?"
9781 : Check for large file support
9782 # Backward compatibility (uselfs is deprecated).
9784 "$define"|true|[yY]*)
9787 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9789 uselargefiles="$define"
9793 case "$lseeksize:$fpossize" in
9796 You can have files larger than 2 gigabytes.
9799 *) case "$uselargefiles" in
9800 "$undef"|false|[nN]*) dflt='n' ;;
9805 Perl can be built to understand large files (files larger than 2 gigabytes)
9806 on some systems. To do so, Configure can be run with -Duselargefiles.
9808 If this doesn't make any sense to you, just accept the default '$dflt'.
9810 rp='Try to understand large files, if available?'
9813 y|Y) val="$define" ;;
9820 : Look for a hint-file generated 'call-back-unit'. If the
9821 : user has specified that a large files perl is to be built,
9822 : we may need to set or change some other defaults.
9823 if $test -f uselargefiles.cbu; then
9824 echo "Your platform has some specific hints regarding large file builds, using them..."
9825 . ./uselargefiles.cbu
9827 case "$uselargefiles" in
9829 if $test -f uselargefiles.cbu; then
9831 echo "Rechecking to see how big your file offsets are..." >&4
9833 #include <sys/types.h>
9837 printf("%d\n", (int)sizeof($lseektype));
9842 if eval $compile_ok; then
9843 lseeksize=`$run ./try`
9844 $echo "Your file offsets are now $lseeksize bytes long."
9848 echo "(I can't seem to compile the test program. Guessing...)"
9849 rp="What is the size of your file offsets (in bytes)?"
9854 *_t) zzz="$fpostype" ;;
9857 $echo $n "Rechecking the size of $zzz...$c" >&4
9859 #include <sys/types.h>
9866 printf("%d\n", (int)sizeof($fpostype));
9871 if eval $compile_ok; then
9876 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9879 echo " $fpossize bytes." >&4
9885 echo "(I can't compile the test program. Guessing...)" >&4
9886 rp="What is the size of your file positions (in bytes)?"
9895 : Check if we want perlio
9898 : Set the vendorbin variables
9899 case "$vendorprefix" in
9900 '') d_vendorbin="$undef"
9904 *) d_vendorbin="$define"
9905 : determine where vendor-supplied executables go.
9906 case "$vendorbin" in
9907 '') dflt=$vendorprefix/bin ;;
9908 *) dflt="$vendorbin" ;;
9911 rp='Pathname for the vendor-supplied executables directory?'
9914 vendorbinexp="$ansexp"
9920 : Set the vendorhtml1dir variables
9921 case "$vendorprefix" in
9922 '') vendorhtml1dir=''
9923 vendorhtml1direxp=''
9925 *) : determine where vendor-supplied html pages go.
9926 : There is no standard location, so try to copy the previously-selected
9927 : directory structure for the core html pages.
9928 : XXX Better default suggestions would be welcome.
9929 case "$vendorhtml1dir" in
9930 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9931 *) dflt=$vendorhtml1dir ;;
9934 ''|' ') dflt=none ;;
9937 rp='Pathname for the vendor-supplied html pages?'
9939 vendorhtml1dir="$ans"
9940 vendorhtml1direxp="$ansexp"
9943 : Use ' ' for none so value is preserved next time through Configure
9944 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9945 prefixvar=vendorhtml1dir
9948 : Set the vendorhtml3dir variables
9949 case "$vendorprefix" in
9950 '') vendorhtml3dir=''
9951 vendorhtml3direxp=''
9953 *) : determine where vendor-supplied module html pages go.
9954 : There is no standard location, so try to copy the previously-selected
9955 : directory structure for the core html pages.
9956 : XXX Better default suggestions would be welcome.
9957 case "$vendorhtml3dir" in
9958 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9959 *) dflt=$vendorhtml3dir ;;
9962 ''|' ') dflt=none ;;
9965 rp='Pathname for the vendor-supplied html pages?'
9967 vendorhtml3dir="$ans"
9968 vendorhtml3direxp="$ansexp"
9971 : Use ' ' for none so value is preserved next time through Configure
9972 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9973 prefixvar=vendorhtml3dir
9976 : Set the vendorman1dir variables
9977 case "$vendorprefix" in
9978 '') vendorman1dir=''
9981 *) : determine where vendor-supplied manual pages go.
9982 case "$vendorman1dir" in
9983 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9984 *) dflt=$vendorman1dir ;;
9987 ''|' ') dflt=none ;;
9990 rp='Pathname for the vendor-supplied manual section 1 pages?'
9992 vendorman1dir="$ans"
9993 vendorman1direxp="$ansexp"
9996 : Use ' ' for none so value is preserved next time through Configure
9997 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9998 prefixvar=vendorman1dir
10001 : Set the vendorman3dir variables
10002 case "$vendorprefix" in
10003 '') vendorman3dir=''
10004 vendorman3direxp=''
10006 *) : determine where vendor-supplied module manual pages go.
10007 case "$vendorman3dir" in
10008 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10009 *) dflt=$vendorman3dir ;;
10012 ''|' ') dflt=none ;;
10015 rp='Pathname for the vendor-supplied manual section 3 pages?'
10017 vendorman3dir="$ans"
10018 vendorman3direxp="$ansexp"
10021 : Use ' ' for none so value is preserved next time through Configure
10022 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10023 prefixvar=vendorman3dir
10026 : Set the vendorscript variables
10027 case "$vendorprefix" in
10028 '') d_vendorscript="$undef"
10032 *) d_vendorscript="$define"
10033 : determine where vendor-supplied scripts go.
10034 case "$vendorscript" in
10035 '') dflt=$vendorprefix/script
10036 $test -d $dflt || dflt=$vendorbin ;;
10037 *) dflt="$vendorscript" ;;
10041 The installation process will create a directory for
10042 vendor-supplied scripts.
10046 rp='Pathname for the vendor-supplied scripts directory?'
10048 vendorscript="$ans"
10049 vendorscriptexp="$ansexp"
10052 prefixvar=vendorscript
10055 : see if qgcvt exists
10059 : Check what kind of doubles your system has
10060 $echo "Checking the kind of doubles you have..." >&4
10062 #$i_stdlib I_STDLIB
10063 #define DOUBLESIZE $doublesize
10065 #include <stdlib.h>
10068 static const double d = -0.1;
10070 unsigned const char* b = (unsigned const char*)(&d);
10071 #if DOUBLESIZE == 4
10072 if (b[0] == 0xCD && b[3] == 0xBD) {
10073 /* IEEE 754 32-bit little-endian */
10077 if (b[0] == 0xBD && b[3] == 0xCD) {
10078 /* IEEE 754 32-bit big-endian */
10082 if (b[0] == 0xCC && b[3] == 0xCC) {
10083 /* VAX format F, 32-bit PDP-style mixed endian. */
10087 if (b[0] == 0xC0 && b[3] == 0x9A) {
10088 /* IBM single 32-bit */
10093 #if DOUBLESIZE == 8
10094 if (b[0] == 0x9A && b[7] == 0xBF) {
10095 /* IEEE 754 64-bit little-endian */
10099 if (b[0] == 0xBF && b[7] == 0x9A) {
10100 /* IEEE 754 64-bit big-endian */
10104 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10105 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10106 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10107 * 99 99 b9 bf 9a 99 99 99 */
10111 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10112 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10113 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10114 * 99 99 99 9a bf b9 99 99 */
10118 if (b[0] == 0xCC && b[7] == 0xCC) {
10119 /* VAX format D, 64-bit PDP-style mixed endian. */
10123 if (b[0] == 0xD9 && b[7] == 0x99) {
10124 /* VAX format G, 64-bit PDP-style mixed endian. */
10128 if (b[0] == 0xC0 && b[7] == 0x9A) {
10129 /* IBM double 64-bit */
10133 if (b[0] == 0xBF && b[7] == 0xCD) {
10134 /* CRAY single 64-bit */
10139 #if DOUBLESIZE == 16
10140 if (b[0] == 0x9A && b[15] == 0xBF) {
10141 /* IEEE 754 128-bit little-endian */
10145 if (b[0] == 0xBF && b[15] == 0x9A) {
10146 /* IEEE 754 128-bit big-endian */
10151 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10152 * Whether those environments can still build Perl is debatable. */
10153 printf("-1\n"); /* unknown */
10158 if eval $compile; then
10159 doublekind=`$run ./try`
10163 case "$doublekind" in
10164 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10165 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10166 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10167 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10168 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10169 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10170 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10171 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10172 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10173 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10174 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10175 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10176 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10177 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10178 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10180 d_double_style_ieee=$undef
10181 d_double_style_vax=$undef
10182 d_double_style_ibm=$undef
10183 d_double_style_cray=$undef
10184 case "$doublekind" in
10185 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10186 9|10|11) d_double_style_vax=$define ;;
10187 12|13) d_double_style_ibm=$define ;;
10188 14) d_double_style_cray=$define ;;
10190 case "$d_double_style_ieee" in
10192 d_double_has_inf=$define
10193 d_double_has_nan=$define
10194 d_double_has_negative_zero=$define
10195 d_double_has_subnormals=$define
10198 d_double_has_inf=$undef
10199 d_double_has_nan=$undef
10200 d_double_has_negative_zero=$undef
10201 d_double_has_subnormals=$undef
10206 : Check print/scan long double stuff
10209 if $test X"$d_longdbl" = X"$define"; then
10211 echo "Checking how to print long doubles..." >&4
10213 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10214 $cat >try.c <<'EOCP'
10215 #include <sys/types.h>
10218 double d = 123.456;
10219 printf("%.3f\n", d);
10223 if eval $compile; then
10227 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10228 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10229 echo "We will use %f."
10235 if $test X"$sPRIfldbl" = X; then
10236 $cat >try.c <<'EOCP'
10237 #include <sys/types.h>
10240 long double d = 123.456;
10241 printf("%.3Lf\n", d);
10245 if eval $compile; then
10249 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10250 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10251 echo "We will use %Lf."
10257 if $test X"$sPRIfldbl" = X; then
10258 $cat >try.c <<'EOCP'
10259 #include <sys/types.h>
10262 long double d = 123.456;
10263 printf("%.3llf\n", d);
10267 if eval $compile; then
10271 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10272 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10273 echo "We will use %llf."
10279 if $test X"$sPRIfldbl" = X; then
10280 $cat >try.c <<'EOCP'
10281 #include <sys/types.h>
10284 long double d = 123.456;
10285 printf("%.3lf\n", d);
10289 if eval $compile; then
10293 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10294 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10295 echo "We will use %lf."
10301 if $test X"$sPRIfldbl" = X; then
10302 echo "Cannot figure out how to print long doubles." >&4
10304 sSCNfldbl=$sPRIfldbl # expect consistency
10311 case "$sPRIfldbl" in
10312 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10313 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10314 d_SCNfldbl="$undef";
10316 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10317 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10318 d_SCNfldbl="$define";
10322 : Before committing on uselongdouble, see whether that looks sane.
10323 if $test "$uselongdouble" = "$define"; then
10326 echo "Checking if your long double math functions work right..." >&4
10331 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10334 case "$osname:$gccversion" in
10335 aix:) saveccflags="$ccflags"
10336 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10339 if eval $compile_ok; then
10343 3) echo "Your long double math functions are working correctly." >&4 ;;
10344 *) echo "Your long double math functions are broken, not using long doubles." >&4
10345 uselongdouble=$undef
10349 case "$osname:$gccversion" in
10350 aix:) ccflags="$saveccflags" ;; # restore
10354 : Check how to convert floats to strings.
10356 if test "X$d_Gconvert" = X; then
10359 echo "Checking for an efficient way to convert floats to strings."
10361 case "$uselongdouble" in
10362 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10364 case "$d_longdbl" in
10365 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10367 case "$d_PRIgldbl" in
10368 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10371 #ifdef TRY_gconvert
10372 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10373 char *myname = "gconvert";
10376 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10377 char *myname = "gcvt";
10380 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10381 char *myname = "qgcvt";
10382 #define DOUBLETYPE long double
10385 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10386 #ifdef HAS_PRIgldbl
10387 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10389 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10392 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10394 char *myname = "sprintf";
10398 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10399 #define DOUBLETYPE long double
10401 #define DOUBLETYPE double
10407 #$i_stdlib I_STDLIB
10409 #include <stdlib.h>
10411 #include <string.h>
10413 int checkit(char *expect, char *got)
10415 if (strcmp(expect, got)) {
10416 printf("%s oddity: Expected %s, got %s\n",
10417 myname, expect, got);
10427 /* This must be 1st test on (which?) platform */
10428 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10429 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10430 checkit("0.1", buf);
10432 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10433 checkit("0.01", buf);
10435 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10436 checkit("0.001", buf);
10438 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10439 checkit("0.0001", buf);
10441 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10442 if (strlen(buf) > 5)
10443 checkit("9e-005", buf); /* for Microsoft ?? */
10445 checkit("9e-05", buf);
10447 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10450 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10451 checkit("1.1", buf);
10453 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10454 checkit("1.01", buf);
10456 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10457 checkit("1.001", buf);
10459 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10460 checkit("1.0001", buf);
10462 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10463 checkit("1.00001", buf);
10465 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10466 checkit("1.000001", buf);
10468 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10471 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10472 checkit("-1", buf);
10474 /* Some Linux gcvt's give 1.e+5 here. */
10475 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10476 checkit("100000", buf);
10478 /* Some Linux gcvt's give -1.e+5 here. */
10479 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10480 checkit("-100000", buf);
10482 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10483 checkit("123.456", buf);
10485 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10486 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10487 /* 34 should be enough to scare even long double
10488 * places into using the e notation. */
10489 if (strlen(buf) > 5)
10490 checkit("1e+034", buf); /* for Microsoft */
10492 checkit("1e+34", buf);
10494 /* For Perl, if you add additional tests here, also add them to
10495 * t/base/num.t for benefit of platforms not using Configure or
10496 * overriding d_Gconvert */
10501 : first add preferred functions to our list
10503 for xxx_convert in $gconvert_preference; do
10504 case $xxx_convert in
10505 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10506 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10509 : then add any others
10510 for xxx_convert in gconvert gcvt sprintf; do
10511 case "$xxx_list" in
10513 *) xxx_list="$xxx_list $xxx_convert" ;;
10517 case "$d_longdbl$uselongdouble" in
10519 : again, add preferred functions to our list first
10521 for xxx_convert in $gconvert_ld_preference; do
10522 case $xxx_convert in
10523 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10524 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10527 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10528 for xxx_convert in qgcvt sprintf $xxx_list; do
10529 case "$xxx_ld_list" in
10530 $xxx_convert*|*" $xxx_convert"*) ;;
10531 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10534 : if sprintf cannot do long doubles, move it to the end
10535 if test "$d_PRIgldbl" != "$define"; then
10536 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10538 : if no qgcvt, remove it
10539 if test "$d_qgcvt" != "$define"; then
10540 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10543 xxx_list="$xxx_ld_list"
10547 for xxx_convert in $xxx_list; do
10548 echo "Trying $xxx_convert..."
10549 $rm -f try try$_o core
10550 set try -DTRY_$xxx_convert
10551 if eval $compile; then
10552 echo "$xxx_convert() found." >&4
10553 if $run ./try; then
10554 echo "I'll use $xxx_convert to convert floats into a string." >&4
10557 echo "...But $xxx_convert didn't work as I expected."
10561 echo "$xxx_convert NOT found." >&4
10565 if test X$xxx_convert = X; then
10566 echo "*** WHOA THERE!!! ***" >&4
10567 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10568 xxx_convert=sprintf
10571 case "$xxx_convert" in
10572 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10573 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10574 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10575 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10576 "$define$define$define")
10577 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10578 "$define$define$undef")
10579 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10580 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10588 : see if _fwalk exists
10592 : see if accept4 exists
10593 set accept4 d_accept4
10596 : Initialize h_fcntl
10599 : Initialize h_sysfile
10602 : access call always available on UNIX
10603 set access d_access
10606 : locate the flags for 'access()'
10607 case "$d_access" in
10610 $cat >access.c <<EOCP
10611 #include <sys/types.h>
10616 #include <sys/file.h>
10619 #include <unistd.h>
10621 #$i_stdlib I_STDLIB
10623 #include <stdlib.h>
10629 : check sys/file.h first, no particular reason here
10630 if $test `./findhdr sys/file.h` && \
10631 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10633 echo "<sys/file.h> defines the *_OK access constants." >&4
10634 elif $test `./findhdr fcntl.h` && \
10635 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10637 echo "<fcntl.h> defines the *_OK access constants." >&4
10638 elif $test `./findhdr unistd.h` && \
10639 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10640 echo "<unistd.h> defines the *_OK access constants." >&4
10642 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10648 : see if accessx exists
10649 set accessx d_accessx
10652 : see if acosh exists
10656 : see if aintl exists
10660 : see if alarm exists
10664 : see if 64bit time functions exists
10666 set ctime64 d_ctime64
10669 set localtime64 d_localtime64
10672 set gmtime64 d_gmtime64
10675 set mktime64 d_mktime64
10678 set difftime64 d_difftime64
10681 set asctime64 d_asctime64
10684 : see if POSIX threads are available
10685 set pthread.h i_pthread
10688 : define a function to check prototypes
10689 $cat > protochk <<EOSH
10692 optimize="$optimize"
10696 usethreads=$usethreads
10697 i_pthread=$i_pthread
10698 pthread_h_first=$pthread_h_first
10701 $cat >> protochk <<'EOSH'
10706 while test $# -ge 2; do
10708 $define) echo "#include <$2>" >> try.c ;;
10709 literal) echo "$2" >> try.c ;;
10711 # Extra magic for the benefit of systems that need pthread.h
10712 # to be included early to correctly detect threadsafe functions.
10713 # Such functions must guarantee themselves, though, that the usethreads
10714 # and i_pthread have been defined, before calling protochk.
10715 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10716 echo "#include <pthread.h>" >> try.c
10721 cat >> try.c <<'EOCP'
10722 #define _(args) args
10724 echo "$foo" >> try.c
10725 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10726 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10732 $eunicefix protochk
10734 : Define hasproto macro for Configure internal use
10735 hasproto='varname=$1; func=$2; shift; shift;
10736 while $test $# -ge 2; do
10738 $define) echo "#include <$2>";;
10742 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10743 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10744 echo "$func() prototype found.";
10747 echo "$func() prototype NOT found.";
10754 : see if sys/types.h has to be included
10755 set sys/types.h i_systypes
10758 : see if sys/select.h has to be included
10759 set sys/select.h i_sysselct
10762 : Define hasfield macro for Configure internal use
10763 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10764 while $test $# -ge 2; do
10766 $define) echo "#include <$2>";;
10770 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10772 if eval $compile; then
10781 : see if we should include sys/time.h
10784 if test "X$timeincl" = X; then
10785 echo "Testing to see if we should include <sys/time.h>." >&4
10786 $echo $n "I'm now running the test program...$c"
10788 #include <sys/types.h>
10791 #ifdef SYSTIMEKERNEL
10794 #include <sys/time.h>
10797 #include <sys/select.h>
10799 #$i_stdlib I_STDLIB
10801 #include <stdlib.h>
10807 struct timeval bar;
10810 struct timezone tzp;
10812 if (foo.tm_sec == foo.tm_sec)
10815 if (bar.tv_sec == bar.tv_sec)
10822 for s_timezone in '-DS_TIMEZONE' ''; do
10824 for s_timeval in '-DS_TIMEVAL' ''; do
10825 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10826 for i_systime in '-DI_SYSTIME' ''; do
10829 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10830 if eval $compile; then
10831 set X $i_systime $i_systimek $sysselect $s_timeval
10835 $echo $n "Succeeded with $flags$c"
10846 *SYSTIMEKERNEL*) i_systimek="$define"
10847 timeincl=`./findhdr sys/time.h`
10848 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10849 *) i_systimek="$undef";;
10852 *I_SYSTIME*) i_systime="$define"
10853 timeincl=`./findhdr sys/time.h`" $timeincl"
10854 echo "We'll include <sys/time.h>." >&4;;
10855 *) i_systime="$undef";;
10859 : see if struct tm knows about tm_zone
10860 case "$i_systime$i_time" in
10863 echo "Checking to see if your struct tm has tm_zone field..." >&4
10864 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10872 case "$d_tm_tm_zone" in
10873 "$define") echo "Yes, it does." ;;
10874 *) echo "No, it doesn't." ;;
10876 : see if struct tm knows about tm_gmtoff
10877 case "$i_systime$i_time" in
10880 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10881 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10889 case "$d_tm_tm_gmtoff" in
10890 "$define") echo "Yes, it does." ;;
10891 *) echo "No, it doesn't." ;;
10894 : see if asctime_r exists
10895 set asctime_r d_asctime_r
10897 case "$d_asctime_r" in
10899 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10900 case "$d_asctime_r_proto:$usethreads" in
10901 ":define") d_asctime_r_proto=define
10902 set d_asctime_r_proto asctime_r $hdrs
10906 case "$d_asctime_r_proto" in
10908 case "$asctime_r_proto" in
10909 ''|0) try='char* asctime_r(const struct tm*, char*);'
10910 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10912 case "$asctime_r_proto" in
10913 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10914 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10916 case "$asctime_r_proto" in
10917 ''|0) try='int asctime_r(const struct tm*, char*);'
10918 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10920 case "$asctime_r_proto" in
10921 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10922 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10924 case "$asctime_r_proto" in
10925 ''|0) d_asctime_r=undef
10927 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10928 * ) case "$asctime_r_proto" in
10929 REENTRANT_PROTO*) ;;
10930 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10932 echo "Prototype: $try" ;;
10935 *) case "$usethreads" in
10936 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10943 *) asctime_r_proto=0
10947 : see if asinh exists
10951 : see if atanh exists
10955 : see if atolf exists
10959 : see if atoll exists
10963 : Look for GCC-style attribute format
10964 case "$d_attribute_format" in
10967 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10968 $cat >attrib.c <<'EOCP'
10970 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10972 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10973 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10974 echo "Your C compiler doesn't support __attribute__((format))."
10977 echo "Your C compiler supports __attribute__((format))."
10981 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10985 *) val="$d_attribute_format" ;;
10987 set d_attribute_format
10991 : Look for GCC-style attribute format with null format allowed
10992 case "$d_printf_format_null" in
10993 '') case "$d_attribute_format" in
10996 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10997 $cat >attrib.c <<EOCP
10999 #$i_stdlib I_STDLIB
11001 #include <stdlib.h>
11003 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11004 int null_printf (char* pat,...) { return (int)pat; }
11005 int main () { exit(null_printf(NULL)); }
11007 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11008 : run the executable in case it produces a run-time warning
11009 if $run ./attrib >>attrib.out 2>&1; then
11010 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11011 echo "Your C compiler doesn't allow __printf__ format to be null."
11014 echo "Your C compiler allows __printf__ format to be null."
11018 echo "Your C compiler executable failed with __printf__ format null."
11022 echo "Your C compiler fails with __printf__ format null."
11029 *) val="$d_printf_format_null" ;;
11031 set d_printf_format_null
11035 : Look for GCC-style attribute malloc
11036 case "$d_attribute_malloc" in
11039 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11040 $cat >attrib.c <<'EOCP'
11042 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11044 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11045 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11046 echo "Your C compiler doesn't support __attribute__((malloc))."
11049 echo "Your C compiler supports __attribute__((malloc))."
11053 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11057 *) val="$d_attribute_malloc" ;;
11059 set d_attribute_malloc
11063 : Look for GCC-style attribute nonnull
11064 case "$d_attribute_nonnull" in
11067 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11068 $cat >attrib.c <<'EOCP'
11070 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11072 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11073 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11074 echo "Your C compiler doesn't support __attribute__((nonnull))."
11077 echo "Your C compiler supports __attribute__((nonnull))."
11081 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11085 *) val="$d_attribute_nonnull" ;;
11087 set d_attribute_nonnull
11091 : Look for GCC-style attribute noreturn
11092 case "$d_attribute_noreturn" in
11095 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11096 $cat >attrib.c <<'EOCP'
11098 void fall_over_dead( void ) __attribute__((noreturn));
11100 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11101 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11102 echo "Your C compiler doesn't support __attribute__((noreturn))."
11105 echo "Your C compiler supports __attribute__((noreturn))."
11109 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11113 *) val="$d_attribute_noreturn" ;;
11115 set d_attribute_noreturn
11119 : Look for GCC-style attribute pure
11120 case "$d_attribute_pure" in
11123 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11124 $cat >attrib.c <<'EOCP'
11126 int square( int n ) __attribute__((pure));
11128 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11129 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11130 echo "Your C compiler doesn't support __attribute__((pure))."
11133 echo "Your C compiler supports __attribute__((pure))."
11137 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11141 *) val="$d_attribute_pure" ;;
11143 set d_attribute_pure
11147 : Look for GCC-style attribute unused
11148 case "$d_attribute_unused" in
11151 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11152 $cat >attrib.c <<'EOCP'
11154 int do_something( int dummy __attribute__((unused)), int n );
11156 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11157 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11158 echo "Your C compiler doesn't support __attribute__((unused))."
11161 echo "Your C compiler supports __attribute__((unused))."
11165 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11169 *) val="$d_attribute_unused" ;;
11171 set d_attribute_unused
11175 : Look for GCC-style attribute deprecated
11176 case "$d_attribute_deprecated" in
11179 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11180 $cat >attrib.c <<'EOCP'
11182 int I_am_deprecated(void) __attribute__((deprecated));
11184 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11185 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11186 echo "Your C compiler doesn't support __attribute__((deprecated))."
11189 echo "Your C compiler supports __attribute__((deprecated))."
11193 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11197 *) val="$d_attribute_deprecated" ;;
11199 set d_attribute_deprecated
11203 : Look for GCC-style attribute warn_unused_result
11204 case "$d_attribute_warn_unused_result" in
11207 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11208 $cat >attrib.c <<'EOCP'
11210 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11212 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11213 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11214 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11217 echo "Your C compiler supports __attribute__((warn_unused_result))."
11221 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11225 *) val="$d_attribute_warn_unused_result" ;;
11227 set d_attribute_warn_unused_result
11231 : see if getpgrp exists
11232 set getpgrp d_getpgrp
11235 case "$d_getpgrp" in
11238 echo "Checking to see which flavor of getpgrp is in use..."
11240 #$i_unistd I_UNISTD
11241 #include <sys/types.h>
11243 # include <unistd.h>
11245 #$i_stdlib I_STDLIB
11247 #include <stdlib.h>
11251 if (getuid() == 0) {
11252 printf("(I see you are running Configure as super-user...)\n");
11255 #ifdef TRY_BSD_PGRP
11256 if (getpgrp(1) == 0)
11265 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11266 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11268 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11269 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11272 echo "I can't seem to compile and run the test program."
11274 xxx="a USG one, i.e. you use getpgrp()."
11276 # SVR4 systems can appear rather BSD-ish.
11277 case "$i_unistd" in
11279 xxx="a BSD one, i.e. you use getpgrp(pid)."
11283 xxx="probably a USG one, i.e. you use getpgrp()."
11288 echo "Assuming your getpgrp is $xxx" >&4
11297 : see if setpgrp exists
11298 set setpgrp d_setpgrp
11301 case "$d_setpgrp" in
11304 echo "Checking to see which flavor of setpgrp is in use..."
11306 #$i_unistd I_UNISTD
11307 #include <sys/types.h>
11309 # include <unistd.h>
11311 #$i_stdlib I_STDLIB
11313 #include <stdlib.h>
11317 if (getuid() == 0) {
11318 printf("(I see you are running Configure as super-user...)\n");
11321 #ifdef TRY_BSD_PGRP
11322 if (-1 == setpgrp(1, 1))
11325 if (setpgrp() != -1)
11331 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11332 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11334 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11335 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11338 echo "(I can't seem to compile and run the test program.)"
11340 xxx="a USG one, i.e. you use setpgrp()."
11342 # SVR4 systems can appear rather BSD-ish.
11343 case "$i_unistd" in
11345 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11349 xxx="probably a USG one, i.e. you use setpgrp()."
11354 echo "Assuming your setpgrp is $xxx" >&4
11363 : Look for GCC-style __builtin_add_overflow
11364 case "$d_builtin_add_overflow" in
11367 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11368 $cat >try.c <<'EOCP'
11370 const unsigned int uint_max = ~0u;
11371 int target_int = 0;
11372 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11375 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11378 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11385 if eval $compile && $run ./try; then
11386 echo "Your C compiler supports __builtin_add_overflow."
11389 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11393 *) val="$d_builtin_add_overflow" ;;
11396 set d_builtin_add_overflow
11400 : Look for GCC-style __builtin_sub_overflow
11401 case "$d_builtin_sub_overflow" in
11404 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11405 $cat >try.c <<'EOCP'
11407 const unsigned int uint_max = ~0u;
11408 int target_int = 0;
11409 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11412 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11415 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11422 if eval $compile && $run ./try; then
11423 echo "Your C compiler supports __builtin_sub_overflow."
11426 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11430 *) val="$d_builtin_sub_overflow" ;;
11433 set d_builtin_sub_overflow
11437 : Look for GCC-style __builtin_mul_overflow
11438 case "$d_builtin_mul_overflow" in
11441 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11442 $cat >try.c <<'EOCP'
11444 const unsigned int uint_max = ~0u;
11445 int target_int = 0;
11446 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11449 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11452 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11459 if eval $compile && $run ./try; then
11460 echo "Your C compiler supports __builtin_mul_overflow."
11463 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11467 *) val="$d_builtin_mul_overflow" ;;
11470 set d_builtin_mul_overflow
11474 : Look for GCC-style __builtin_choose_expr
11475 case "$d_builtin_choose_expr" in
11478 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11479 $cat >try.c <<'EOCP'
11480 #include <assert.h>
11481 #include <stdlib.h>
11484 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11487 assert( SYRINX(1) == 2112 );
11488 assert( SYRINX(1) != 5150 );
11489 assert( SYRINX(0) == 5150 );
11490 assert( SYRINX(0) != 2112 );
11491 puts( "All good!" );
11497 if eval $compile && $run ./try; then
11498 echo "Your C compiler supports __builtin_choose_expr."
11501 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11505 *) val="$d_builtin_choose_expr" ;;
11508 set d_builtin_choose_expr
11512 : Look for GCC-style __builtin_expect
11513 case "$d_builtin_expect" in
11516 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11517 $cat >try.c <<'EOCP'
11520 if ( __builtin_expect(n, 0) ) n = 1;
11521 /* Remember shell exit code truth is 0, C truth is non-zero */
11526 if eval $compile && $run ./try; then
11527 echo "Your C compiler supports __builtin_expect."
11530 echo "Your C compiler doesn't seem to understand __builtin_expect."
11534 *) val="$d_builtin_expect" ;;
11537 set d_builtin_expect
11541 : see if the Compiler supports C99 variadic macros
11542 echo "Checking for C99 variadic macros." >&4
11545 #include <stdarg.h>
11547 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11551 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11557 if eval $compile && $run ./try 2>&1 >/dev/null; then
11558 case "`$run ./try`" in
11560 echo "You have C99 variadic macros." >&4
11561 d_c99_variadic_macros="$define"
11564 echo "You don't have functional C99 variadic macros." >&4
11565 d_c99_variadic_macros="$undef"
11569 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11570 d_c99_variadic_macros="$undef"
11574 : see if signal is declared as pointer to function returning int or void
11576 xxx=`./findhdr signal.h`
11577 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11578 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11579 echo "You have int (*signal())() instead of void." >&4
11581 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11582 echo "You have void (*signal())()." >&4
11584 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11585 echo "You have int (*signal())() instead of void." >&4
11587 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11588 echo "You have void (*signal())()." >&4
11591 case "$d_voidsig" in
11593 echo "I can't determine whether signal handler returns void or int..." >&4
11595 rp="What type does your signal handler return?"
11598 v*) val="$define";;
11602 echo "As you already told me, signal handler returns void." >&4
11605 *) echo "As you already told me, signal handler returns int." >&4
11612 case "$d_voidsig" in
11613 "$define") signal_t="void";;
11614 *) signal_t="int";;
11618 : check for ability to cast large floats to 32-bit ints.
11620 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11621 if $test "$intsize" -ge 4; then
11628 #$i_stdlib I_STDLIB
11630 #include <stdlib.h>
11632 #include <sys/types.h>
11633 #include <signal.h>
11634 $signal_t blech(int s) { exit(3); }
11641 signal(SIGFPE, blech);
11643 /* Don't let compiler optimize the test away. Store the number
11644 in a writable string for gcc to pass to sscanf under HP-UX.
11646 sprintf(str, "2147483647");
11647 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11651 /* x86 processors will probably give 0x8000 0000, which is a
11652 sign change. We don't want that. We want to mimic SPARC
11653 behavior here, which is to preserve the sign and give
11656 if (i32 != ($xxx) f)
11662 if eval $compile_ok; then
11663 $run ./try 2>/dev/null
11666 echo "(I can't seem to compile the test program--assuming it can't)"
11671 echo "Yup, it can."
11674 echo "Nope, it can't."
11681 : check for ability to cast negative floats to unsigned
11683 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11686 #$i_stdlib I_STDLIB
11688 #include <stdlib.h>
11690 #include <sys/types.h>
11691 #include <signal.h>
11692 $signal_t blech(int s) { exit(7); }
11693 $signal_t blech_in_list(int s) { exit(4); }
11694 unsigned long dummy_long(unsigned long p) { return p; }
11695 unsigned int dummy_int(unsigned int p) { return p; }
11696 unsigned short dummy_short(unsigned short p) { return p; }
11700 unsigned long along;
11702 unsigned short ashort;
11706 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11707 a direct f = -123. assignment. gcc-2.8.0 reportedly
11708 optimized the whole file away
11710 /* Store the number in a writable string for gcc to pass to
11711 sscanf under HP-UX.
11713 sprintf(str, "-123");
11714 sscanf(str, "%lf", &f); /* f = -123.; */
11716 signal(SIGFPE, blech);
11717 along = (unsigned long)f;
11718 aint = (unsigned int)f;
11719 ashort = (unsigned short)f;
11720 if (along != (unsigned long)-123)
11722 if (aint != (unsigned int)-123)
11724 if (ashort != (unsigned short)-123)
11726 sprintf(str, "1073741824.");
11727 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11730 along = (unsigned long)f;
11731 if (along != 0x80000000)
11735 along = (unsigned long)f;
11736 if (along != 0x7fffffff)
11740 along = (unsigned long)f;
11741 if (along != 0x80000001)
11745 signal(SIGFPE, blech_in_list);
11746 sprintf(str, "123.");
11747 sscanf(str, "%lf", &f); /* f = 123.; */
11748 along = dummy_long((unsigned long)f);
11749 aint = dummy_int((unsigned int)f);
11750 ashort = dummy_short((unsigned short)f);
11751 if (along != (unsigned long)123)
11753 if (aint != (unsigned int)123)
11755 if (ashort != (unsigned short)123)
11762 if eval $compile_ok; then
11763 $run ./try 2>/dev/null
11766 echo "(I can't seem to compile the test program--assuming it can't)"
11769 case "$castflags" in
11771 echo "Yup, it can."
11774 echo "Nope, it can't."
11781 : see if cbrt exists
11785 : see if chown exists
11789 : see if chroot exists
11790 set chroot d_chroot
11793 : see if chsize exists
11794 set chsize d_chsize
11797 : see if class exists
11801 : see if clearenv exists
11802 set clearenv d_clearenv
11805 : Define hasstruct macro for Configure internal use
11806 hasstruct='varname=$1; struct=$2; shift; shift;
11807 while $test $# -ge 2; do
11809 $define) echo "#include <$2>";;
11813 echo "int main () { struct $struct foo; }" >> try.c;
11815 if eval $compile; then
11824 : see whether socket exists
11828 $echo $n "Hmm... $c" >&4
11829 if set socket val -f d_socket; eval $csym; $val; then
11830 echo "Looks like you have Berkeley networking support." >&4
11832 if set setsockopt val -f; eval $csym; $val; then
11835 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11836 d_oldsock="$define"
11839 if $contains socklib libc.list >/dev/null 2>&1; then
11840 echo "Looks like you have Berkeley networking support." >&4
11842 : we will have to assume that it supports the 4.2 BSD interface
11845 echo "You don't have Berkeley networking in libc$_a..." >&4
11846 if test "X$d_socket" = "X$define"; then
11847 echo "...but you seem to believe that you have sockets." >&4
11849 for net in net socket
11851 if test -f $sysroot/usr/lib/lib$net$_a; then
11852 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11853 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11854 if $contains socket libc.list >/dev/null 2>&1; then
11859 echo "...but the Wollongong group seems to have hacked it in." >&4
11860 sockethdr="-I$sysroot/usr/netinclude"
11863 echo "Found Berkeley sockets interface in lib$net." >&4
11864 if $contains setsockopt libc.list >/dev/null 2>&1; then
11867 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11868 d_oldsock="$define"
11874 if test "X$d_socket" != "X$define"; then
11875 echo "or anywhere else I see." >&4
11883 : see if socketpair exists
11884 set socketpair d_sockpair
11889 echo "Checking the availability sa_len in the sock struct ..." >&4
11891 #include <sys/types.h>
11892 #include <sys/socket.h>
11894 struct sockaddr sa;
11895 return (sa.sa_len);
11899 set try; if eval $compile; then
11902 set d_sockaddr_sa_len; eval $setvar
11906 echo "Checking the availability struct sockaddr_in6 ..." >&4
11908 #include <sys/types.h>
11909 #include <sys/socket.h>
11910 #include <netinet/in.h>
11912 struct sockaddr_in6 sin6;
11913 return (sin6.sin6_family);
11917 set try; if eval $compile; then
11920 set d_sockaddr_in6; eval $setvar
11924 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11926 #include <sys/types.h>
11927 #include <sys/socket.h>
11928 #include <netinet/in.h>
11930 struct sockaddr_in6 sin6;
11931 return (sin6.sin6_scope_id);
11935 set try; if eval $compile; then
11938 set d_sin6_scope_id; eval $setvar
11942 echo "Checking the availability struct ip_mreq ..." >&4
11944 #include <sys/types.h>
11945 #include <sys/socket.h>
11946 #include <netinet/in.h>
11948 struct ip_mreq mreq;
11949 return (mreq.imr_multiaddr.s_addr);
11953 set try; if eval $compile; then
11956 set d_ip_mreq; eval $setvar
11960 echo "Checking the availability struct ip_mreq_source ..." >&4
11962 #include <sys/types.h>
11963 #include <sys/socket.h>
11964 #include <netinet/in.h>
11966 struct ip_mreq_source mreq;
11967 return (mreq.imr_multiaddr.s_addr);
11971 set try; if eval $compile; then
11974 set d_ip_mreq_source; eval $setvar
11978 echo "Checking the availability struct ipv6_mreq ..." >&4
11980 #include <sys/types.h>
11981 #include <sys/socket.h>
11982 #include <netinet/in.h>
11984 struct ipv6_mreq mreq;
11985 return (mreq.ipv6mr_interface);
11989 set try; if eval $compile; then
11992 set d_ipv6_mreq; eval $setvar
11996 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11998 #include <sys/types.h>
11999 #include <sys/socket.h>
12000 #include <netinet/in.h>
12002 struct ipv6_mreq_source mreq;
12003 return (mreq.imr_multiaddr.s_addr);
12007 set try; if eval $compile; then
12010 set d_ipv6_mreq_source; eval $setvar
12014 echo "Checking the availability of certain socket constants..." >&4
12015 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12016 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12018 #include <sys/types.h>
12019 #include <sys/socket.h>
12025 set try; if eval $compile; then
12028 set d_${enum}; eval $setvar
12032 : see if this is a sys/uio.h system
12033 set sys/uio.h i_sysuio
12036 : Check for cmsghdr support
12038 echo "Checking to see if your system supports struct cmsghdr..." >&4
12039 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12041 case "$d_cmsghdr_s" in
12042 "$define") echo "Yes, it does." ;;
12043 *) 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
13708 : see if fchdir exists
13709 set fchdir d_fchdir
13712 : see if fchmod exists
13713 set fchmod d_fchmod
13716 : check for openat, unlinkat, renameat, linkat, fchmodat
13717 set openat d_openat
13720 set unlinkat d_unlinkat
13723 set renameat d_renameat
13726 set linkat d_linkat
13729 set fchmodat d_fchmodat
13732 : see if fchown exists
13733 set fchown d_fchown
13736 : see if this is an fcntl system
13740 : See if fcntl-based locking works.
13743 #$i_stdlib I_STDLIB
13745 #include <stdlib.h>
13747 #include <unistd.h>
13749 #include <signal.h>
13750 $signal_t blech(int x) { exit(3); }
13752 #if defined(F_SETLK) && defined(F_SETLKW)
13753 struct flock flock;
13755 fd = open("try.c", O_RDONLY);
13756 flock.l_type = F_RDLCK;
13757 flock.l_whence = SEEK_SET;
13758 flock.l_start = flock.l_len = 0;
13759 signal(SIGALRM, blech);
13761 retval = fcntl(fd, F_SETLK, &flock);
13763 (retval < 0 ? exit(2) : exit(0));
13769 echo "Checking if fcntl-based file locking works... "
13773 if eval $compile_ok; then
13774 if $run ./try; then
13775 echo "Yes, it seems to work."
13778 echo "Nope, it didn't work."
13783 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13784 *** This is (almost) impossible.
13785 *** If your NFS lock daemons are not feeling well, something like
13786 *** this may happen, please investigate. Cannot continue, aborting.
13794 echo "I'm unable to compile the test program, so I'll assume not."
13799 echo "Nope, since you don't even have fcntl()."
13802 set d_fcntl_can_lock
13806 : check for fd_set items
13809 Checking to see how well your C compiler handles fd_set and friends ...
13812 #$i_stdlib I_STDLIB
13814 #include <stdlib.h>
13816 #$i_systime I_SYS_TIME
13817 #$i_sysselct I_SYS_SELECT
13818 #$d_socket HAS_SOCKET
13819 #include <sys/types.h>
13821 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13824 #include <sys/time.h>
13826 #ifdef I_SYS_SELECT
13827 #include <sys/select.h>
13836 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13844 if eval $compile; then
13845 d_fds_bits="$define"
13847 echo "Well, your system knows about the normal fd_set typedef..." >&4
13848 if $run ./try; then
13849 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13850 d_fd_macros="$define"
13853 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13855 d_fd_macros="$undef"
13859 Hmm, your compiler has some difficulty with fd_set. Checking further...
13862 if eval $compile; then
13863 d_fds_bits="$undef"
13865 echo "Well, your system has some sort of fd_set available..." >&4
13866 if $run ./try; then
13867 echo "and you have the normal fd_set macros." >&4
13868 d_fd_macros="$define"
13871 but not the normal fd_set macros! Gross! More work for me...
13873 d_fd_macros="$undef"
13876 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13878 d_fds_bits="$undef"
13879 d_fd_macros="$undef"
13884 : see if fdclose exists
13885 set fdclose d_fdclose
13888 : see if fdim exists
13892 : see if fegetround exists
13893 set fegetround d_fegetround
13896 : see if fgetpos exists
13897 set fgetpos d_fgetpos
13900 : see if finite exists
13901 set finite d_finite
13904 : see if finitel exists
13905 set finitel d_finitel
13908 : see if flock exists
13912 : see if prototype for flock is available
13914 set d_flockproto flock $i_sysfile sys/file.h
13917 : see if fma exists
13921 : see if fmax exists
13925 : see if fmin exists
13929 : see if fp_class exists
13930 set fp_class d_fp_class
13933 : check for fpclassify
13934 echo "Checking to see if you have fpclassify..." >&4
13937 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13940 if eval $compile; then
13942 echo "You have fpclassify."
13945 echo "You do not have fpclassify."
13951 : see if fp_classify exists
13952 set fp_classify d_fp_classify
13955 : see if fp_classl exists
13956 set fp_classl d_fp_classl
13959 : see if pathconf exists
13960 set pathconf d_pathconf
13963 : see if fpathconf exists
13964 set fpathconf d_fpathconf
13967 : see if fpclass exists
13968 set fpclass d_fpclass
13971 : see if fpclassl exists
13972 set fpclassl d_fpclassl
13975 : see if fpgetround exists
13976 set fpgetround d_fpgetround
13979 : check for fpos64_t
13981 echo "Checking to see if you have fpos64_t..." >&4
13984 int main() { fpos64_t x = 7; }
13987 if eval $compile; then
13989 echo "You have fpos64_t."
13992 echo "You do not have fpos64_t."
13993 case "$fpossize" in
13994 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14001 : see if this is an xlocale.h system
14002 set xlocale.h i_xlocale
14005 : see if newlocale exists
14006 set newlocale d_newlocale
14009 : see if freelocale exists
14010 set freelocale d_freelocale
14013 : see if uselocale exists
14014 set uselocale d_uselocale
14017 : see if duplocale exists
14018 set duplocale d_duplocale
14021 : see if querylocale exists
14022 set querylocale d_querylocale
14025 : see if frexpl exists
14026 set frexpl d_frexpl
14029 : see if this is a sys/param system
14030 set sys/param.h i_sysparam
14033 : see if this is a sys/mount.h system
14034 set sys/mount.h i_sysmount
14037 : Check for fs_data_s
14039 echo "Checking to see if your system supports struct fs_data..." >&4
14040 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14042 case "$d_fs_data_s" in
14043 "$define") echo "Yes, it does." ;;
14044 *) echo "No, it doesn't." ;;
14047 : see if fseeko exists
14048 set fseeko d_fseeko
14050 case "$longsize" in
14051 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14054 : see if fsetpos exists
14055 set fsetpos d_fsetpos
14058 : see if fstatfs exists
14059 set fstatfs d_fstatfs
14062 : see if statvfs exists
14063 set statvfs d_statvfs
14066 : see if fstatvfs exists
14067 set fstatvfs d_fstatvfs
14070 : see if fsync exists
14074 : see if ftello exists
14075 set ftello d_ftello
14077 case "$longsize" in
14078 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14081 : check for a working futimes
14084 echo "Checking if you have a working futimes()" >&4
14087 #include <sys/time.h>
14094 fd = open ("try.c", O_RDWR);
14095 if (-1 == fd) exit (1);
14096 rv = futimes (fd, NULL);
14097 exit (rv == -1 ? errno : 0);
14101 if eval $compile; then
14105 0) echo "Yes, you have" >&4
14106 d_futimes="$define"
14108 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14112 echo "No, it does not (probably harmless)" >&4
14116 : look for gai_strerror
14118 $cat >try.c <<'EOCP'
14119 #include <sys/types.h>
14120 #include <sys/socket.h>
14124 return (gai_strerror (0) ? 0 : 1);
14129 if eval $compile; then
14132 0) echo "A working gai_strerror() found." >&4
14134 *) echo "gai_strerror() found, but it doesn't work" >&4
14138 echo "gai_strerror() NOT found." >&4
14144 : see if ndbm.h is available
14147 : Compatibility location for RedHat 7.1
14148 set gdbm/ndbm.h i_gdbmndbm
14150 : Compatibility location for Debian 4.0
14151 set gdbm-ndbm.h i_gdbm_ndbm
14155 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14156 : see if dbm_open exists
14157 set dbm_open d_dbm_open
14159 case "$d_dbm_open" in
14162 i_gdbmndbm="$undef"
14163 i_gdbm_ndbm="$undef"
14164 echo "We won't be including <ndbm.h>"
14174 ndbm_hdr_protochk='name=$1; hdr=$2;
14175 eval "ihdr=\$""i_$name";
14177 if $test "$ihdr" = "$define"; then
14178 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14179 case "$d_cplusplus" in
14180 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14181 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14184 $define) $echo "Your <$hdr> seems to have prototypes";;
14185 *) $echo "Your <$hdr> does not seem to have prototypes";;
14188 set "d_${name}_h_uses_prototypes";
14192 eval $ndbm_hdr_protochk
14193 set gdbmndbm gdbm/ndbm.h
14194 eval $ndbm_hdr_protochk
14195 set gdbm_ndbm gdbm-ndbm.h
14196 eval $ndbm_hdr_protochk
14198 : see if getaddrinfo exists
14199 set getaddrinfo d_getaddrinfo
14202 : see if getcwd exists
14203 set getcwd d_getcwd
14206 : see if getespwnam exists
14207 set getespwnam d_getespwnam
14210 : see if getfsstat exists
14211 set getfsstat d_getfsstat
14214 : see if getgrent exists
14215 set getgrent d_getgrent
14218 : see if getgrent_r exists
14219 set getgrent_r d_getgrent_r
14221 case "$d_getgrent_r" in
14223 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14224 case "$d_getgrent_r_proto:$usethreads" in
14225 ":define") d_getgrent_r_proto=define
14226 set d_getgrent_r_proto getgrent_r $hdrs
14230 case "$d_getgrent_r_proto" in
14232 case "$getgrent_r_proto" in
14233 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14234 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14236 case "$getgrent_r_proto" in
14237 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14238 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14240 case "$getgrent_r_proto" in
14241 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14242 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14244 case "$getgrent_r_proto" in
14245 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14246 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14248 case "$getgrent_r_proto" in
14249 ''|0) try='int getgrent_r(struct group*, char*, int);'
14250 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14252 case "$getgrent_r_proto" in
14253 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14254 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14256 case "$getgrent_r_proto" in
14257 ''|0) d_getgrent_r=undef
14259 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14260 * ) case "$getgrent_r_proto" in
14261 REENTRANT_PROTO*) ;;
14262 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14264 echo "Prototype: $try" ;;
14267 *) case "$usethreads" in
14268 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14275 *) getgrent_r_proto=0
14279 : see if getgrgid_r exists
14280 set getgrgid_r d_getgrgid_r
14282 case "$d_getgrgid_r" in
14284 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14285 case "$d_getgrgid_r_proto:$usethreads" in
14286 ":define") d_getgrgid_r_proto=define
14287 set d_getgrgid_r_proto getgrgid_r $hdrs
14291 case "$d_getgrgid_r_proto" in
14293 case "$getgrgid_r_proto" in
14294 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14295 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14297 case "$getgrgid_r_proto" in
14298 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14299 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14301 case "$getgrgid_r_proto" in
14302 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14303 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14305 case "$getgrgid_r_proto" in
14306 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14307 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14309 case "$getgrgid_r_proto" in
14310 ''|0) d_getgrgid_r=undef
14312 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14313 * ) case "$getgrgid_r_proto" in
14314 REENTRANT_PROTO*) ;;
14315 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14317 echo "Prototype: $try" ;;
14320 *) case "$usethreads" in
14321 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14328 *) getgrgid_r_proto=0
14332 : see if getgrnam_r exists
14333 set getgrnam_r d_getgrnam_r
14335 case "$d_getgrnam_r" in
14337 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14338 case "$d_getgrnam_r_proto:$usethreads" in
14339 ":define") d_getgrnam_r_proto=define
14340 set d_getgrnam_r_proto getgrnam_r $hdrs
14344 case "$d_getgrnam_r_proto" in
14346 case "$getgrnam_r_proto" in
14347 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14348 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14350 case "$getgrnam_r_proto" in
14351 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14352 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14354 case "$getgrnam_r_proto" in
14355 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14356 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14358 case "$getgrnam_r_proto" in
14359 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14360 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14362 case "$getgrnam_r_proto" in
14363 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14364 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14366 case "$getgrnam_r_proto" in
14367 ''|0) d_getgrnam_r=undef
14369 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14370 * ) case "$getgrnam_r_proto" in
14371 REENTRANT_PROTO*) ;;
14372 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14374 echo "Prototype: $try" ;;
14377 *) case "$usethreads" in
14378 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14385 *) getgrnam_r_proto=0
14389 : see if gethostbyaddr exists
14390 set gethostbyaddr d_gethbyaddr
14393 : see if gethostbyname exists
14394 set gethostbyname d_gethbyname
14397 : see if gethostent exists
14398 set gethostent d_gethent
14401 : see how we will look up host name
14404 if set gethostname val -f d_gethname; eval $csym; $val; then
14405 echo 'gethostname() found.' >&4
14406 d_gethname="$define"
14409 if set uname val -f d_uname; eval $csym; $val; then
14412 uname() was found, but you're running xenix, and older versions of xenix
14413 have a broken uname(). If you don't really know whether your xenix is old
14414 enough to have a broken system call, use the default answer.
14419 "$define") dflt=n;;
14421 rp='Is your uname() broken?'
14424 n*) d_uname="$define"; call=uname;;
14427 echo 'uname() found.' >&4
14434 case "$d_gethname" in
14435 '') d_gethname="$undef";;
14438 '') d_uname="$undef";;
14440 case "$d_uname$d_gethname" in
14445 Every now and then someone has a $call() that lies about the hostname
14446 but can't be fixed for political or economic reasons. If you wish, I can
14447 pretend $call() isn't there and maybe compute hostname at run-time
14448 thanks to the '$phostname' command.
14451 rp="Shall I ignore $call() from now on?"
14454 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14457 case "$phostname" in
14458 '') aphostname='';;
14459 *) case "$aphostname" in
14461 *) set X $phostname
14465 file=`./loc $file $file $pth`
14466 aphostname=`echo $file $*`
14471 case "$d_uname$d_gethname" in
14474 case "$phostname" in
14476 echo "There will be no way for $package to get your hostname." >&4;;
14478 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14482 case "$d_phostname" in
14483 '') d_phostname="$undef";;
14486 : see if gethostbyaddr_r exists
14487 set gethostbyaddr_r d_gethostbyaddr_r
14489 case "$d_gethostbyaddr_r" in
14491 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14492 case "$d_gethostbyaddr_r_proto:$usethreads" in
14493 ":define") d_gethostbyaddr_r_proto=define
14494 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14498 case "$d_gethostbyaddr_r_proto" in
14500 case "$gethostbyaddr_r_proto" in
14501 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14502 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14504 case "$gethostbyaddr_r_proto" in
14505 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14506 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14508 case "$gethostbyaddr_r_proto" in
14509 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14510 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14512 case "$gethostbyaddr_r_proto" in
14513 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14514 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14516 case "$gethostbyaddr_r_proto" in
14517 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14518 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14520 case "$gethostbyaddr_r_proto" in
14521 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14522 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14524 case "$gethostbyaddr_r_proto" in
14525 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14526 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14528 case "$gethostbyaddr_r_proto" in
14529 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14530 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14532 case "$gethostbyaddr_r_proto" in
14533 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14534 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14536 case "$gethostbyaddr_r_proto" in
14537 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14538 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14540 case "$gethostbyaddr_r_proto" in
14541 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14542 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14544 case "$gethostbyaddr_r_proto" in
14545 ''|0) d_gethostbyaddr_r=undef
14546 gethostbyaddr_r_proto=0
14547 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14548 * ) case "$gethostbyaddr_r_proto" in
14549 REENTRANT_PROTO*) ;;
14550 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14552 echo "Prototype: $try" ;;
14555 *) case "$usethreads" in
14556 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14558 d_gethostbyaddr_r=undef
14559 gethostbyaddr_r_proto=0
14563 *) gethostbyaddr_r_proto=0
14567 : see if gethostbyname_r exists
14568 set gethostbyname_r d_gethostbyname_r
14570 case "$d_gethostbyname_r" in
14572 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14573 case "$d_gethostbyname_r_proto:$usethreads" in
14574 ":define") d_gethostbyname_r_proto=define
14575 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14579 case "$d_gethostbyname_r_proto" in
14581 case "$gethostbyname_r_proto" in
14582 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14583 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14585 case "$gethostbyname_r_proto" in
14586 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14587 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14589 case "$gethostbyname_r_proto" in
14590 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14591 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14593 case "$gethostbyname_r_proto" in
14594 ''|0) d_gethostbyname_r=undef
14595 gethostbyname_r_proto=0
14596 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14597 * ) case "$gethostbyname_r_proto" in
14598 REENTRANT_PROTO*) ;;
14599 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14601 echo "Prototype: $try" ;;
14604 *) case "$usethreads" in
14605 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14607 d_gethostbyname_r=undef
14608 gethostbyname_r_proto=0
14612 *) gethostbyname_r_proto=0
14616 : see if gethostent_r exists
14617 set gethostent_r d_gethostent_r
14619 case "$d_gethostent_r" in
14621 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14622 case "$d_gethostent_r_proto:$usethreads" in
14623 ":define") d_gethostent_r_proto=define
14624 set d_gethostent_r_proto gethostent_r $hdrs
14628 case "$d_gethostent_r_proto" in
14630 case "$gethostent_r_proto" in
14631 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14632 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14634 case "$gethostent_r_proto" in
14635 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14636 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14638 case "$gethostent_r_proto" in
14639 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14640 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14642 case "$gethostent_r_proto" in
14643 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14644 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14646 case "$gethostent_r_proto" in
14647 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14648 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14650 case "$gethostent_r_proto" in
14651 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14652 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14654 case "$gethostent_r_proto" in
14655 ''|0) d_gethostent_r=undef
14656 gethostent_r_proto=0
14657 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14658 * ) case "$gethostent_r_proto" in
14659 REENTRANT_PROTO*) ;;
14660 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14662 echo "Prototype: $try" ;;
14665 *) case "$usethreads" in
14666 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14668 d_gethostent_r=undef
14669 gethostent_r_proto=0
14673 *) gethostent_r_proto=0
14677 : see if prototypes for various gethostxxx netdb.h functions are available
14679 set d_gethostprotos gethostent $i_netdb netdb.h
14682 : see if getitimer exists
14683 set getitimer d_getitimer
14686 : see if getlogin exists
14687 set getlogin d_getlogin
14690 : see if getlogin_r exists
14691 set getlogin_r d_getlogin_r
14693 case "$d_getlogin_r" in
14695 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14696 case "$d_getlogin_r_proto:$usethreads" in
14697 ":define") d_getlogin_r_proto=define
14698 set d_getlogin_r_proto getlogin_r $hdrs
14702 case "$d_getlogin_r_proto" in
14704 case "$getlogin_r_proto" in
14705 ''|0) try='int getlogin_r(char*, size_t);'
14706 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14708 case "$getlogin_r_proto" in
14709 ''|0) try='int getlogin_r(char*, int);'
14710 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14712 case "$getlogin_r_proto" in
14713 ''|0) try='char* getlogin_r(char*, size_t);'
14714 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14716 case "$getlogin_r_proto" in
14717 ''|0) try='char* getlogin_r(char*, int);'
14718 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14720 case "$getlogin_r_proto" in
14721 ''|0) d_getlogin_r=undef
14723 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14724 * ) case "$getlogin_r_proto" in
14725 REENTRANT_PROTO*) ;;
14726 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14728 echo "Prototype: $try" ;;
14731 *) case "$usethreads" in
14732 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14739 *) getlogin_r_proto=0
14743 : see if getmnt exists
14744 set getmnt d_getmnt
14747 : see if getmntent exists
14748 set getmntent d_getmntent
14751 : see if getnameinfo exists
14752 set getnameinfo d_getnameinfo
14755 : see if getnetbyaddr exists
14756 set getnetbyaddr d_getnbyaddr
14759 : see if getnetbyname exists
14760 set getnetbyname d_getnbyname
14763 : see if getnetent exists
14764 set getnetent d_getnent
14767 : see if getnetbyaddr_r exists
14768 set getnetbyaddr_r d_getnetbyaddr_r
14770 case "$d_getnetbyaddr_r" in
14772 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14773 case "$d_getnetbyaddr_r_proto:$usethreads" in
14774 ":define") d_getnetbyaddr_r_proto=define
14775 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14779 case "$d_getnetbyaddr_r_proto" in
14781 case "$getnetbyaddr_r_proto" in
14782 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14783 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14785 case "$getnetbyaddr_r_proto" in
14786 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14787 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14789 case "$getnetbyaddr_r_proto" in
14790 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14791 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14793 case "$getnetbyaddr_r_proto" in
14794 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14795 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14797 case "$getnetbyaddr_r_proto" in
14798 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14799 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14801 case "$getnetbyaddr_r_proto" in
14802 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14803 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14805 case "$getnetbyaddr_r_proto" in
14806 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14807 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14809 case "$getnetbyaddr_r_proto" in
14810 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14811 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14813 case "$getnetbyaddr_r_proto" in
14814 ''|0) d_getnetbyaddr_r=undef
14815 getnetbyaddr_r_proto=0
14816 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14817 * ) case "$getnetbyaddr_r_proto" in
14818 REENTRANT_PROTO*) ;;
14819 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14821 echo "Prototype: $try" ;;
14824 *) case "$usethreads" in
14825 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14827 d_getnetbyaddr_r=undef
14828 getnetbyaddr_r_proto=0
14832 *) getnetbyaddr_r_proto=0
14836 : see if getnetbyname_r exists
14837 set getnetbyname_r d_getnetbyname_r
14839 case "$d_getnetbyname_r" in
14841 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14842 case "$d_getnetbyname_r_proto:$usethreads" in
14843 ":define") d_getnetbyname_r_proto=define
14844 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14848 case "$d_getnetbyname_r_proto" in
14850 case "$getnetbyname_r_proto" in
14851 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14852 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14854 case "$getnetbyname_r_proto" in
14855 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14856 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14858 case "$getnetbyname_r_proto" in
14859 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14860 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14862 case "$getnetbyname_r_proto" in
14863 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14864 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14866 case "$getnetbyname_r_proto" in
14867 ''|0) d_getnetbyname_r=undef
14868 getnetbyname_r_proto=0
14869 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14870 * ) case "$getnetbyname_r_proto" in
14871 REENTRANT_PROTO*) ;;
14872 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14874 echo "Prototype: $try" ;;
14877 *) case "$usethreads" in
14878 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14880 d_getnetbyname_r=undef
14881 getnetbyname_r_proto=0
14885 *) getnetbyname_r_proto=0
14889 : see if getnetent_r exists
14890 set getnetent_r d_getnetent_r
14892 case "$d_getnetent_r" in
14894 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14895 case "$d_getnetent_r_proto:$usethreads" in
14896 ":define") d_getnetent_r_proto=define
14897 set d_getnetent_r_proto getnetent_r $hdrs
14901 case "$d_getnetent_r_proto" in
14903 case "$getnetent_r_proto" in
14904 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14905 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14907 case "$getnetent_r_proto" in
14908 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14909 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14911 case "$getnetent_r_proto" in
14912 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14913 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14915 case "$getnetent_r_proto" in
14916 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14917 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14919 case "$getnetent_r_proto" in
14920 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14921 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14923 case "$getnetent_r_proto" in
14924 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14925 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14927 case "$getnetent_r_proto" in
14928 ''|0) d_getnetent_r=undef
14929 getnetent_r_proto=0
14930 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14931 * ) case "$getnetent_r_proto" in
14932 REENTRANT_PROTO*) ;;
14933 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14935 echo "Prototype: $try" ;;
14938 *) case "$usethreads" in
14939 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14941 d_getnetent_r=undef
14942 getnetent_r_proto=0
14946 *) getnetent_r_proto=0
14950 : see if prototypes for various getnetxxx netdb.h functions are available
14952 set d_getnetprotos getnetent $i_netdb netdb.h
14955 : see if getpagesize exists
14956 set getpagesize d_getpagsz
14959 : Optional checks for getprotobyname and getprotobynumber
14961 : see if getprotobyname exists
14962 set getprotobyname d_getpbyname
14965 : see if getprotobynumber exists
14966 set getprotobynumber d_getpbynumber
14969 : see if getprotoent exists
14970 set getprotoent d_getpent
14973 : see if getpgid exists
14974 set getpgid d_getpgid
14977 : see if getpgrp2 exists
14978 set getpgrp2 d_getpgrp2
14981 : see if getppid exists
14982 set getppid d_getppid
14985 : see if getpriority exists
14986 set getpriority d_getprior
14989 : see if getprotobyname_r exists
14990 set getprotobyname_r d_getprotobyname_r
14992 case "$d_getprotobyname_r" in
14994 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14995 case "$d_getprotobyname_r_proto:$usethreads" in
14996 ":define") d_getprotobyname_r_proto=define
14997 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15001 case "$d_getprotobyname_r_proto" in
15003 case "$getprotobyname_r_proto" in
15004 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15005 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15007 case "$getprotobyname_r_proto" in
15008 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15009 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15011 case "$getprotobyname_r_proto" in
15012 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15013 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15015 case "$getprotobyname_r_proto" in
15016 ''|0) d_getprotobyname_r=undef
15017 getprotobyname_r_proto=0
15018 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15019 * ) case "$getprotobyname_r_proto" in
15020 REENTRANT_PROTO*) ;;
15021 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15023 echo "Prototype: $try" ;;
15026 *) case "$usethreads" in
15027 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15029 d_getprotobyname_r=undef
15030 getprotobyname_r_proto=0
15034 *) getprotobyname_r_proto=0
15038 : see if getprotobynumber_r exists
15039 set getprotobynumber_r d_getprotobynumber_r
15041 case "$d_getprotobynumber_r" in
15043 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15044 case "$d_getprotobynumber_r_proto:$usethreads" in
15045 ":define") d_getprotobynumber_r_proto=define
15046 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15050 case "$d_getprotobynumber_r_proto" in
15052 case "$getprotobynumber_r_proto" in
15053 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15054 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15056 case "$getprotobynumber_r_proto" in
15057 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15058 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15060 case "$getprotobynumber_r_proto" in
15061 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15062 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15064 case "$getprotobynumber_r_proto" in
15065 ''|0) d_getprotobynumber_r=undef
15066 getprotobynumber_r_proto=0
15067 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15068 * ) case "$getprotobynumber_r_proto" in
15069 REENTRANT_PROTO*) ;;
15070 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15072 echo "Prototype: $try" ;;
15075 *) case "$usethreads" in
15076 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15078 d_getprotobynumber_r=undef
15079 getprotobynumber_r_proto=0
15083 *) getprotobynumber_r_proto=0
15087 : see if getprotoent_r exists
15088 set getprotoent_r d_getprotoent_r
15090 case "$d_getprotoent_r" in
15092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15093 case "$d_getprotoent_r_proto:$usethreads" in
15094 ":define") d_getprotoent_r_proto=define
15095 set d_getprotoent_r_proto getprotoent_r $hdrs
15099 case "$d_getprotoent_r_proto" in
15101 case "$getprotoent_r_proto" in
15102 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15103 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15105 case "$getprotoent_r_proto" in
15106 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15107 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15109 case "$getprotoent_r_proto" in
15110 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15111 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15113 case "$getprotoent_r_proto" in
15114 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15115 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15117 case "$getprotoent_r_proto" in
15118 ''|0) d_getprotoent_r=undef
15119 getprotoent_r_proto=0
15120 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15121 * ) case "$getprotoent_r_proto" in
15122 REENTRANT_PROTO*) ;;
15123 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15125 echo "Prototype: $try" ;;
15128 *) case "$usethreads" in
15129 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15131 d_getprotoent_r=undef
15132 getprotoent_r_proto=0
15136 *) getprotoent_r_proto=0
15140 : see if prototypes for various getprotoxxx netdb.h functions are available
15142 set d_getprotoprotos getprotoent $i_netdb netdb.h
15145 : see if getprpwnam exists
15146 set getprpwnam d_getprpwnam
15149 : see if getpwent exists
15150 set getpwent d_getpwent
15153 : see if getpwent_r exists
15154 set getpwent_r d_getpwent_r
15156 case "$d_getpwent_r" in
15158 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15159 case "$d_getpwent_r_proto:$usethreads" in
15160 ":define") d_getpwent_r_proto=define
15161 set d_getpwent_r_proto getpwent_r $hdrs
15165 case "$d_getpwent_r_proto" in
15167 case "$getpwent_r_proto" in
15168 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15169 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15171 case "$getpwent_r_proto" in
15172 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15173 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15175 case "$getpwent_r_proto" in
15176 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15177 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15179 case "$getpwent_r_proto" in
15180 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15181 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15183 case "$getpwent_r_proto" in
15184 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15185 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15187 case "$getpwent_r_proto" in
15188 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15189 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15191 case "$getpwent_r_proto" in
15192 ''|0) d_getpwent_r=undef
15194 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15195 * ) case "$getpwent_r_proto" in
15196 REENTRANT_PROTO*) ;;
15197 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15199 echo "Prototype: $try" ;;
15202 *) case "$usethreads" in
15203 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15210 *) getpwent_r_proto=0
15214 : see if getpwnam_r exists
15215 set getpwnam_r d_getpwnam_r
15217 case "$d_getpwnam_r" in
15219 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15220 case "$d_getpwnam_r_proto:$usethreads" in
15221 ":define") d_getpwnam_r_proto=define
15222 set d_getpwnam_r_proto getpwnam_r $hdrs
15226 case "$d_getpwnam_r_proto" in
15228 case "$getpwnam_r_proto" in
15229 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15230 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15232 case "$getpwnam_r_proto" in
15233 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15234 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15236 case "$getpwnam_r_proto" in
15237 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15238 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15240 case "$getpwnam_r_proto" in
15241 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15242 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15244 case "$getpwnam_r_proto" in
15245 ''|0) d_getpwnam_r=undef
15247 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15248 * ) case "$getpwnam_r_proto" in
15249 REENTRANT_PROTO*) ;;
15250 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15252 echo "Prototype: $try" ;;
15255 *) case "$usethreads" in
15256 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15263 *) getpwnam_r_proto=0
15267 : see if getpwuid_r exists
15268 set getpwuid_r d_getpwuid_r
15270 case "$d_getpwuid_r" in
15272 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15273 case "$d_getpwuid_r_proto:$usethreads" in
15274 ":define") d_getpwuid_r_proto=define
15275 set d_getpwuid_r_proto getpwuid_r $hdrs
15279 case "$d_getpwuid_r_proto" in
15281 case "$getpwuid_r_proto" in
15282 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15283 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15285 case "$getpwuid_r_proto" in
15286 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15287 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15289 case "$getpwuid_r_proto" in
15290 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15291 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15293 case "$getpwuid_r_proto" in
15294 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15295 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15297 case "$getpwuid_r_proto" in
15298 ''|0) d_getpwuid_r=undef
15300 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15301 * ) case "$getpwuid_r_proto" in
15302 REENTRANT_PROTO*) ;;
15303 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15305 echo "Prototype: $try" ;;
15308 *) case "$usethreads" in
15309 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15316 *) getpwuid_r_proto=0
15320 : Optional checks for getsbyname and getsbyport
15322 : see if getservbyname exists
15323 set getservbyname d_getsbyname
15326 : see if getservbyport exists
15327 set getservbyport d_getsbyport
15330 : see if getservent exists
15331 set getservent d_getsent
15334 : see if getservbyname_r exists
15335 set getservbyname_r d_getservbyname_r
15337 case "$d_getservbyname_r" in
15339 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15340 case "$d_getservbyname_r_proto:$usethreads" in
15341 ":define") d_getservbyname_r_proto=define
15342 set d_getservbyname_r_proto getservbyname_r $hdrs
15346 case "$d_getservbyname_r_proto" in
15348 case "$getservbyname_r_proto" in
15349 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15350 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15352 case "$getservbyname_r_proto" in
15353 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15354 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15356 case "$getservbyname_r_proto" in
15357 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15358 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15360 case "$getservbyname_r_proto" in
15361 ''|0) d_getservbyname_r=undef
15362 getservbyname_r_proto=0
15363 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15364 * ) case "$getservbyname_r_proto" in
15365 REENTRANT_PROTO*) ;;
15366 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15368 echo "Prototype: $try" ;;
15371 *) case "$usethreads" in
15372 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15374 d_getservbyname_r=undef
15375 getservbyname_r_proto=0
15379 *) getservbyname_r_proto=0
15383 : see if getservbyport_r exists
15384 set getservbyport_r d_getservbyport_r
15386 case "$d_getservbyport_r" in
15388 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15389 case "$d_getservbyport_r_proto:$usethreads" in
15390 ":define") d_getservbyport_r_proto=define
15391 set d_getservbyport_r_proto getservbyport_r $hdrs
15395 case "$d_getservbyport_r_proto" in
15397 case "$getservbyport_r_proto" in
15398 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15399 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15401 case "$getservbyport_r_proto" in
15402 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15403 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15405 case "$getservbyport_r_proto" in
15406 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15407 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15409 case "$getservbyport_r_proto" in
15410 ''|0) d_getservbyport_r=undef
15411 getservbyport_r_proto=0
15412 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15413 * ) case "$getservbyport_r_proto" in
15414 REENTRANT_PROTO*) ;;
15415 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15417 echo "Prototype: $try" ;;
15420 *) case "$usethreads" in
15421 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15423 d_getservbyport_r=undef
15424 getservbyport_r_proto=0
15428 *) getservbyport_r_proto=0
15432 : see if getservent_r exists
15433 set getservent_r d_getservent_r
15435 case "$d_getservent_r" in
15437 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15438 case "$d_getservent_r_proto:$usethreads" in
15439 ":define") d_getservent_r_proto=define
15440 set d_getservent_r_proto getservent_r $hdrs
15444 case "$d_getservent_r_proto" in
15446 case "$getservent_r_proto" in
15447 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15448 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15450 case "$getservent_r_proto" in
15451 ''|0) try='int getservent_r(struct servent*, char*, int);'
15452 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15454 case "$getservent_r_proto" in
15455 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15456 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15458 case "$getservent_r_proto" in
15459 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15460 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15462 case "$getservent_r_proto" in
15463 ''|0) d_getservent_r=undef
15464 getservent_r_proto=0
15465 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15466 * ) case "$getservent_r_proto" in
15467 REENTRANT_PROTO*) ;;
15468 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15470 echo "Prototype: $try" ;;
15473 *) case "$usethreads" in
15474 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15476 d_getservent_r=undef
15477 getservent_r_proto=0
15481 *) getservent_r_proto=0
15485 : see if prototypes for various getservxxx netdb.h functions are available
15487 set d_getservprotos getservent $i_netdb netdb.h
15490 : see if getspnam exists
15491 set getspnam d_getspnam
15494 : see if this is a shadow.h system
15495 set shadow.h i_shadow
15498 : see if getspnam_r exists
15499 set getspnam_r d_getspnam_r
15501 case "$d_getspnam_r" in
15503 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15504 case "$d_getspnam_r_proto:$usethreads" in
15505 ":define") d_getspnam_r_proto=define
15506 set d_getspnam_r_proto getspnam_r $hdrs
15510 case "$d_getspnam_r_proto" in
15512 case "$getspnam_r_proto" in
15513 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15514 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15516 case "$getspnam_r_proto" in
15517 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15518 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15520 case "$getspnam_r_proto" in
15521 ''|0) d_getspnam_r=undef
15523 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15524 * ) case "$getspnam_r_proto" in
15525 REENTRANT_PROTO*) ;;
15526 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15528 echo "Prototype: $try" ;;
15531 *) case "$usethreads" in
15532 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15539 *) getspnam_r_proto=0
15543 : see if gettimeofday or ftime exists
15544 set gettimeofday d_gettimeod
15546 case "$d_gettimeod" in
15552 val="$undef"; set d_ftime; eval $setvar
15555 case "$d_gettimeod$d_ftime" in
15558 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15562 : see if gmtime_r exists
15563 set gmtime_r d_gmtime_r
15565 case "$d_gmtime_r" in
15567 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15568 case "$d_gmtime_r_proto:$usethreads" in
15569 ":define") d_gmtime_r_proto=define
15570 set d_gmtime_r_proto gmtime_r $hdrs
15574 case "$d_gmtime_r_proto" in
15576 case "$gmtime_r_proto" in
15577 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15578 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15580 case "$gmtime_r_proto" in
15581 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15582 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15584 case "$gmtime_r_proto" in
15585 ''|0) d_gmtime_r=undef
15587 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15588 * ) case "$gmtime_r_proto" in
15589 REENTRANT_PROTO*) ;;
15590 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15592 echo "Prototype: $try" ;;
15595 *) case "$usethreads" in
15596 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15603 *) gmtime_r_proto=0
15607 : see if hasmntopt exists
15608 set hasmntopt d_hasmntopt
15611 : see if this is a netinet/in.h or sys/in.h system
15612 set netinet/in.h i_niin sys/in.h i_sysin
15615 : see if arpa/inet.h has to be included
15616 set arpa/inet.h i_arpainet
15619 : see if htonl --and friends-- exists
15624 : Maybe they are macros.
15627 $cat >htonl.c <<EOM
15629 #include <sys/types.h>
15630 #$i_niin I_NETINET_IN
15632 #$i_arpainet I_ARPA_INET
15633 #ifdef I_NETINET_IN
15634 #include <netinet/in.h>
15637 #include <sys/in.h>
15640 #include <arpa/inet.h>
15643 printf("Defined as a macro.");
15646 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15647 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15649 echo "But it seems to be defined as a macro." >&4
15657 : see if hypot exists
15661 : see if ilogb exists
15665 : see if ilogbl exists
15666 set ilogbl d_ilogbl
15669 : check whether inet_aton exists
15670 set inet_aton d_inetaton
15673 : see if inet_ntop exists
15674 set inet_ntop d_inetntop
15677 : see if inet_pton exists
15678 set inet_pton d_inetpton
15683 $cat >isascii.c <<EOCP
15686 #$i_stdlib I_STDLIB
15688 #include <stdlib.h>
15699 if eval $compile; then
15700 echo "isascii() found." >&4
15703 echo "isascii() NOT found." >&4
15712 $cat >isblank.c <<'EOCP'
15723 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15724 echo "isblank() found." >&4
15727 echo "isblank() NOT found." >&4
15734 : check for isfinite
15735 echo "Checking to see if you have isfinite..." >&4
15738 int main() { return isfinite(0.0); }
15741 if eval $compile; then
15743 echo "You have isfinite."
15746 echo "You do not have isfinite."
15752 : see if isfinitel exists
15753 set isfinitel d_isfinitel
15757 echo "Checking to see if you have isinf..." >&4
15760 int main() { return isinf(0.0); }
15763 if eval $compile; then
15765 echo "You have isinf."
15768 echo "You do not have isinf."
15774 : see if isinfl exists
15775 set isinfl d_isinfl
15779 echo "Checking to see if you have isless..." >&4
15782 int main() { return isless(0.0); }
15785 if eval $compile; then
15787 echo "You have isless."
15790 echo "You do not have isless."
15797 echo "Checking to see if you have isnan..." >&4
15800 int main() { return isnan(0.0); }
15803 if eval $compile; then
15805 echo "You have isnan."
15808 echo "You do not have isnan."
15814 : see if isnanl exists
15815 set isnanl d_isnanl
15818 : check for isnormal
15819 echo "Checking to see if you have isnormal..." >&4
15822 int main() { return isnormal(0.0); }
15825 if eval $compile; then
15827 echo "You have isnormal."
15830 echo "You do not have isnormal."
15840 : see if j0l exists
15844 : see if killpg exists
15845 set killpg d_killpg
15848 : see if localeconv exists
15849 set localeconv d_locconv
15852 : see if libc has the POSIX.1-2008 currency locale rules
15853 case "$d_locconv:$d_lc_monetary_2008" in
15856 #include <locale.h>
15858 struct lconv *lc = localeconv();
15859 char int_p_cs_precedes = lc->int_p_cs_precedes;
15864 if eval $compile; then
15865 d_lc_monetary_2008="$define"
15867 d_lc_monetary_2008="$undef"
15873 : see if lchown exists
15875 $cat > try.c <<'EOCP'
15876 /* System header to define __stub macros and hopefully few prototypes,
15877 which can conflict with char lchown(); below. */
15878 #include <assert.h>
15879 /* Override any gcc2 internal prototype to avoid an error. */
15880 /* We use char because int might match the return type of a gcc2
15881 builtin and then its argument prototype would still apply. */
15884 /* The GNU C library defines this for functions which it implements
15885 to always fail with ENOSYS. Some functions are actually named
15886 something starting with __ and the normal name is an alias. */
15887 #if defined (__stub_lchown) || defined (__stub___lchown)
15895 if eval $compile; then
15896 $echo "lchown() found." >&4
15899 $echo "lchown() NOT found." >&4
15905 : See if number of significant digits in a double precision number is known
15907 $cat >ldbl_dig.c <<EOM
15908 #include <limits.h>
15911 printf("Contains LDBL_DIG");
15914 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15915 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15916 echo "LDBL_DIG found." >&4
15919 echo "LDBL_DIG NOT found." >&4
15926 : see if lgamma exists
15927 set lgamma d_lgamma
15930 : see if lgamma_r exists
15931 set lgamma_r d_lgamma_r
15934 : check to see if math.h defines _LIB_VERSION
15935 d_libm_lib_version="$undef"
15937 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15939 #include <unistd.h>
15941 int main (int argc, char *argv[])
15943 printf ("%d\n", _LIB_VERSION);
15948 if eval $compile; then
15950 echo "Yes, it does ($foo)" >&4
15951 d_libm_lib_version="$define"
15953 echo "No, it does not (probably harmless)" >&4
15957 : see if link exists
15961 : see if llrint exists
15962 set llrint d_llrint
15965 : see if llrintl exists
15966 set llrintl d_llrintl
15969 : see if llround exists
15970 set llround d_llround
15973 : see if llroundl exists
15974 set llroundl d_llroundl
15977 : see if localeconv_l exists
15978 set localeconv_l d_localeconv_l
15981 : see if localtime_r exists
15982 set localtime_r d_localtime_r
15984 case "$d_localtime_r" in
15986 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15987 case "$d_localtime_r_proto:$usethreads" in
15988 ":define") d_localtime_r_proto=define
15989 set d_localtime_r_proto localtime_r $hdrs
15993 case "$d_localtime_r_proto" in
15995 case "$localtime_r_proto" in
15996 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15997 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15999 case "$localtime_r_proto" in
16000 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16001 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16003 case "$localtime_r_proto" in
16004 ''|0) d_localtime_r=undef
16005 localtime_r_proto=0
16006 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16007 * ) case "$localtime_r_proto" in
16008 REENTRANT_PROTO*) ;;
16009 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16011 echo "Prototype: $try" ;;
16014 *) case "$usethreads" in
16015 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16017 d_localtime_r=undef
16018 localtime_r_proto=0
16022 *) localtime_r_proto=0
16026 : see if localtime_r calls tzset
16027 case "$localtime_r_proto" in
16030 /* Does our libc's localtime_r call tzset ?
16031 * return 0 if so, 1 otherwise.
16033 #$i_systypes I_SYS_TYPES
16034 #$i_unistd I_UNISTD
16036 #$i_stdlib I_STDLIB
16037 #$i_malloc I_MALLOC
16039 # include <sys/types.h>
16042 # include <unistd.h>
16048 #include <stdlib.h>
16050 #include <string.h>
16052 # include <malloc.h>
16056 time_t t = time(0L);
16057 char w_tz[]="TZ" "=GMT+5",
16058 e_tz[]="TZ" "=GMT-5",
16059 *tz_e = (char*)malloc(16),
16060 *tz_w = (char*)malloc(16);
16061 struct tm tm_e, tm_w;
16062 memset(&tm_e,'\0',sizeof(struct tm));
16063 memset(&tm_w,'\0',sizeof(struct tm));
16068 localtime_r(&t, &tm_e);
16071 localtime_r(&t, &tm_w);
16073 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16079 if eval $compile; then
16080 if $run ./try; then
16081 d_localtime_r_needs_tzset=undef;
16083 d_localtime_r_needs_tzset=define;
16086 d_localtime_r_needs_tzset=undef;
16090 d_localtime_r_needs_tzset=undef;
16095 : see if lockf exists
16099 : see if log1p exists
16103 : see if log2 exists
16107 : see if logb exists
16111 : see if lrint exists
16115 : see if lrintl exists
16116 set lrintl d_lrintl
16119 : see if lround exists
16120 set lround d_lround
16123 : see if lroundl exists
16124 set lroundl d_lroundl
16127 : see if prototype for lseek is available
16129 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16132 : see if lstat exists
16136 : see if madvise exists
16137 set madvise d_madvise
16140 : see if malloc_size exists
16141 set malloc_size d_malloc_size
16144 : see if malloc_size_good exists
16145 set malloc_good_size d_malloc_good_size
16148 : see if mblen exists
16152 : see if mbrlen exists
16153 set mbrlen d_mbrlen
16156 : see if mbrtowc exists
16157 set mbrtowc d_mbrtowc
16160 : see if mbstowcs exists
16161 set mbstowcs d_mbstowcs
16164 : see if mbtowc exists
16165 set mbtowc d_mbtowc
16168 : see if memmem exists
16169 set memmem d_memmem
16172 : see if memrchr exists
16173 set memrchr d_memrchr
16176 : see if mkdir exists
16180 : see if mkdtemp exists
16181 set mkdtemp d_mkdtemp
16184 : see if mkfifo exists
16185 set mkfifo d_mkfifo
16188 : see if mkostemp exists
16189 set mkostemp d_mkostemp
16192 : see if mkstemp exists
16193 set mkstemp d_mkstemp
16196 : see if mkstemps exists
16197 set mkstemps d_mkstemps
16200 : see if mktime exists
16201 set mktime d_mktime
16204 : see if sys/mman.h has to be included
16205 set sys/mman.h i_sysmman
16208 : see if mmap exists
16211 : see what shmat returns
16212 : default to something harmless
16214 case "$i_sysmman$d_mmap" in
16216 $cat >mmap.c <<'END'
16217 #include <sys/mman.h>
16220 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16225 echo "and it returns ($mmaptype)." >&4
16229 : see if sqrtl exists
16233 : see if scalbnl exists
16234 set scalbnl d_scalbnl
16237 : see if truncl exists
16238 set truncl d_truncl
16241 : see if modfl exists
16245 : see if prototype for modfl is available
16247 set d_modflproto modfl define math.h
16250 if $test "$uselongdouble" = "$define"; then
16252 if $test "$d_sqrtl" != "$define"; then
16253 message="$message sqrtl"
16255 if $test "$d_modfl" != "$define"; then
16256 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16257 echo "You have both truncl and copysignl, so I can emulate modfl."
16259 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16260 echo "You have both aintl and copysignl, so I can emulate modfl."
16262 message="$message modfl"
16266 if $test "$d_frexpl" != "$define"; then
16267 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16268 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16270 message="$message frexpl"
16273 if $test "$d_ldexpl" != "$define"; then
16274 message="$message ldexpl"
16277 if $test "$message" != ""; then
16280 *** You requested the use of long doubles but you do not seem to have
16281 *** the following mathematical functions needed for long double support:
16283 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16284 *** Cannot continue, aborting.
16292 : see if mprotect exists
16293 set mprotect d_mprotect
16296 : see if msgctl exists
16297 set msgctl d_msgctl
16300 : see if msgget exists
16301 set msgget d_msgget
16304 : see if msgsnd exists
16305 set msgsnd d_msgsnd
16308 : see if msgrcv exists
16309 set msgrcv d_msgrcv
16312 : see how much of the 'msg*(2)' library is present.
16315 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16316 *"$undef"*) h_msg=false;;
16320 case "`ipcs 2>&1`" in
16321 "SVID messages"*"not configured"*)
16322 echo "Your $osname does not have the msg*(2) configured." >&4
16325 set msgctl d_msgctl
16327 set msgget d_msgget
16329 set msgsnd d_msgsnd
16331 set msgrcv d_msgrcv
16337 : we could also check for sys/ipc.h ...
16338 if $h_msg && $test `./findhdr sys/msg.h`; then
16339 echo "You have the full msg*(2) library." >&4
16342 echo "You don't have the full msg*(2) library." >&4
16348 : Check for msghdr_s
16350 echo "Checking to see if your system supports struct msghdr..." >&4
16351 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16353 case "$d_msghdr_s" in
16354 "$define") echo "Yes, it does." ;;
16355 *) echo "No, it doesn't." ;;
16358 : see if msync exists
16362 : see if munmap exists
16363 set munmap d_munmap
16366 : see if nan exists
16370 : see if nanosleep exists
16371 set nanosleep d_nanosleep
16374 : see if nearbyint exists
16375 set nearbyint d_nearbyint
16378 : see if nextafter exists
16379 set nextafter d_nextafter
16382 : see if nexttoward exists
16383 set nexttoward d_nexttoward
16386 : see if nice exists
16390 : see if this is a langinfo.h system
16391 set langinfo.h i_langinfo
16394 : see if nl_langinfo exists
16395 set nl_langinfo d_nl_langinfo
16398 : see if this is a quadmath.h system
16399 set quadmath.h i_quadmath
16402 : Check basic sizes
16404 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16406 case "$use64bitint:$d_quad:$quadtype" in
16409 uvtype="$uquadtype"
16414 uvtype="unsigned long"
16420 case "$uselongdouble:$d_longdbl" in
16422 nvtype="long double"
16423 nvsize=$longdblsize
16430 case "$usequadmath:$i_quadmath" in
16432 nvtype="__float128"
16438 *** You requested the use of the quadmath library, but you
16439 *** do not seem to have the quadmath library installed.
16440 *** Cannot continue, aborting.
16446 define:*) $cat <<EOM >&4
16448 *** You requested the use of the quadmath library, but you
16449 *** do not seem to have the required header, <quadmath.h>.
16451 case "$gccversion" in
16454 *** Your gcc looks a bit old:
16460 *** You are not running a gcc.
16465 *** For the quadmath library you need at least gcc 4.6.
16466 *** Cannot continue, aborting.
16472 $echo "(IV will be "$ivtype", $ivsize bytes)"
16473 $echo "(UV will be "$uvtype", $uvsize bytes)"
16474 $echo "(NV will be "$nvtype", $nvsize bytes)"
16477 #$i_inttypes I_INTTYPES
16479 #include <inttypes.h>
16484 int8_t i = INT8_MAX;
16485 uint8_t u = UINT8_MAX;
16486 printf("int8_t\n");
16489 int16_t i = INT16_MAX;
16490 uint16_t u = UINT16_MAX;
16491 printf("int16_t\n");
16494 int32_t i = INT32_MAX;
16495 uint32_t u = UINT32_MAX;
16496 printf("int32_t\n");
16501 i8type="signed char"
16502 u8type="unsigned char"
16507 '') case "$shortsize" in
16509 u16type="unsigned short"
16517 '') set try -DINT16
16518 if eval $compile; then
16519 case "`$run ./try`" in
16531 '') if $test $shortsize -ge 2; then
16533 u16type="unsigned short"
16541 '') case "$longsize" in
16543 u32type="unsigned long"
16547 *) case "$intsize" in
16549 u32type="unsigned int"
16559 '') set try -DINT32
16560 if eval $compile; then
16561 case "`$run ./try`" in
16573 '') if $test $intsize -ge 4; then
16575 u32type="unsigned int"
16583 '') case "$d_quad:$quadtype" in
16585 i64type="$quadtype"
16586 u64type="$uquadtype"
16594 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16597 #$i_stdlib I_STDLIB
16599 #include <stdlib.h>
16601 #include <sys/types.h>
16602 #include <signal.h>
16604 /* volatile so that the compiler has to store it out to memory */
16605 volatile int bletched = 0;
16606 $signal_t blech(int s) { bletched = 1; }
16611 int n = 8 * $uvsize;
16614 signal(SIGFPE, blech);
16617 for (i = 0; i < n; i++) {
16618 u = u << 1 | ($uvtype)1;
16620 if (($uvtype)d != u)
16624 d = ($nvtype)(u - 1);
16625 if (($uvtype)d != (u - 1))
16632 printf("%d\n", ((i == n) ? -n : i));
16638 d_nv_preserves_uv="$undef"
16639 if eval $compile; then
16640 nv_preserves_uv_bits="`$run ./try`"
16642 case "$nv_preserves_uv_bits" in
16644 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16645 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16646 d_nv_preserves_uv="$define"
16648 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16649 d_nv_preserves_uv="$undef" ;;
16650 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16651 nv_preserves_uv_bits="0" ;;
16655 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16659 typedef $nvtype NV;
16666 while(count < 256) {
16667 /* volatile so that the compiler has to store it out to memory */
16668 volatile NV up = value + 1.0;
16669 volatile NV negated = -value;
16670 volatile NV down = negated - 1.0;
16671 volatile NV got_up = up - value;
16672 int up_good = got_up == 1.0;
16673 int got_down = down - negated;
16674 int down_good = got_down == -1.0;
16676 if (down_good != up_good) {
16678 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16679 up_good, (double) got_up, down_good, (double) got_down,
16680 count, (double) value);
16687 fputs("256.0", stdout);
16690 fputs("2.0", stdout);
16696 fputs("*", stdout);
16702 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16703 count, (double) value);
16709 nv_overflows_integers_at='0'
16710 if eval $compile; then
16716 The largest integer your NVs can preserve is equal to $xxx
16718 nv_overflows_integers_at="$xxx"
16721 Cannot determine the largest integer value your NVs can hold, unexpected output
16728 Cannot determine the largest integer value your NVs can hold
16735 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16738 #$i_stdlib I_STDLIB
16740 #include <stdlib.h>
16742 #include <string.h>
16743 #include <sys/types.h>
16744 #include <signal.h>
16746 /* volatile so that the compiler has to store it out to memory */
16747 volatile int bletched = 0;
16748 $signal_t blech(int s) { bletched = 1; }
16751 int checkit($nvtype d, const char *where) {
16753 unsigned char *p = (unsigned char *)v;
16754 unsigned char *end = p + sizeof(d);
16763 p = (unsigned char *)v;
16764 printf("No - %s: 0x", where);
16766 printf ("%02X", *p++);
16771 int main(int argc, char **argv) {
16774 fail += checkit(d, "0.0");
16776 /* The compiler shouldn't be assuming that bletched is 0 */
16779 fail += checkit(d, "bleched");
16782 signal(SIGFPE, blech);
16785 /* Paranoia - the compiler should have no way of knowing that ANSI says
16786 that argv[argc] will always be NULL. Actually, if it did assume this it
16787 would be buggy, as this is C and main() can be called from elsewhere in
16789 d = argv[argc] ? 1 : 0;
16792 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16795 fail += checkit(d, "ternary");
16797 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16800 printf("No - memset doesn't give 0.0\n");
16801 /* This might just blow up: */
16802 printf("(gives %g)\n", d);
16808 printf("No - something bleched\n");
16813 printf("No - %d fail(s)\n", fail);
16822 d_nv_zero_is_allbits_zero="$undef"
16823 if eval $compile; then
16829 0.0 is represented as all bits zero in memory
16831 d_nv_zero_is_allbits_zero="$define"
16834 0.0 is not represented as all bits zero in memory
16836 d_nv_zero_is_allbits_zero="$undef"
16841 0.0 is not represented as all bits zero in memory
16843 d_nv_zero_is_allbits_zero="$undef"
16849 : check for off64_t
16851 echo "Checking to see if you have off64_t..." >&4
16853 #include <sys/types.h>
16854 #include <unistd.h>
16855 int main() { off64_t x = 7; }
16858 if eval $compile; then
16860 echo "You have off64_t."
16863 echo "You do not have off64_t."
16864 case "$lseeksize" in
16865 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16872 : how to create joinable pthreads
16873 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16875 echo "Checking what constant to use for creating joinable pthreads..." >&4
16876 $cat >try.c <<'EOCP'
16877 #include <pthread.h>
16879 int detachstate = JOINABLE;
16882 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16883 if eval $compile; then
16884 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16885 val="$undef" # Yes, undef.
16886 set d_old_pthread_create_joinable
16889 set old_pthread_create_joinable
16892 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16893 if eval $compile; then
16894 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16896 set d_old_pthread_create_joinable
16898 val=PTHREAD_CREATE_UNDETACHED
16899 set old_pthread_create_joinable
16902 set try -DJOINABLE=__UNDETACHED
16903 if eval $compile; then
16904 echo "You seem to use __UNDETACHED." >&4
16906 set d_old_pthread_create_joinable
16909 set old_pthread_create_joinable
16912 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16914 set d_old_pthread_create_joinable
16917 set old_pthread_create_joinable
16924 d_old_pthread_create_joinable="$undef"
16925 old_pthread_create_joinable=""
16928 : see if pause exists
16932 : see if pipe2 exists
16936 : see if poll exists
16940 : see if prctl exists
16944 : see if prctl supports PR_SET_NAME
16945 d_prctl_set_name=$undef
16950 #include <unistd.h>
16952 #include <sys/prctl.h>
16954 int main (int argc, char *argv[])
16956 return (prctl (PR_SET_NAME, "Test"));
16960 if eval $compile_ok && $run ./try; then
16961 echo "Your prctl (PR_SET_NAME, ...) works"
16962 d_prctl_set_name=$define
16968 : see if readlink exists
16969 set readlink d_readlink
16972 : Check if there is a /proc symlink to the abs path of
16973 : the executing program. We will honor hints of d_procselfexe=$undef
16974 : or procselfexe being non-empty, otherwise will try to determine both
16975 : if we have readlink.
16976 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
16977 : referenced, and AmigaOS does not have a proc filesystem anyway.
16980 if $test "X$d_procselfexe" = Xundef; then
16982 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
16984 elif $test "X$d_readlink" = Xdefine; then
16985 : NetBSD first as /proc/self is a symlink to /proc/curproc,
16986 : and it feels more tidy to avoid an extra level of symlink
16987 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16988 while test $# -gt 0; do
16991 if $issymlink $try; then
16992 $ls -l $try > reflect
16993 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16994 echo "You have $type-like $try."
16995 procselfexe='"'$try'"'
16997 : This will break out of the loop
17007 : backward compatibility for d_hvfork
17008 if test X$d_hvfork != X; then
17009 d_vfork="$d_hvfork"
17012 : see if there is a vfork
17017 d_pseudofork=$undef
17019 : Ok, but do we want to use it. vfork is reportedly unreliable in
17020 : perl on Solaris 2.x, and probably elsewhere.
17024 case "$usevfork" in
17030 Perl can only use a vfork() that doesn't suffer from strict
17031 restrictions on calling functions or modifying global data in
17032 the child. For example, glibc-2.1 contains such a vfork()
17033 that is unsuitable. If your system provides a proper fork()
17034 call, chances are that you do NOT want perl to use vfork().
17037 rp="Do you still want to use vfork()?"
17042 echo "Ok, we won't use vfork()."
17051 $define) usevfork='true';;
17052 *) usevfork='false';;
17055 : see whether the pthread_atfork exists
17057 #include <pthread.h>
17060 #ifdef PTHREAD_ATFORK
17061 pthread_atfork(NULL,NULL,NULL);
17066 : see if pthread_atfork exists
17067 set try -DPTHREAD_ATFORK
17068 if eval $compile; then
17073 case "$usethreads" in
17076 $define) echo 'pthread_atfork found.' >&4 ;;
17077 *) echo 'pthread_atfork NOT found.' >&4 ;;
17080 set d_pthread_atfork
17083 : see if pthread_attr_setscope exists
17084 set pthread_attr_setscope d_pthread_attr_setscope
17087 : see whether the various POSIXish _yields exist
17089 #include <pthread.h>
17095 #ifdef PTHREAD_YIELD
17098 #ifdef PTHREAD_YIELD_NULL
17099 pthread_yield(NULL);
17105 : see if sched_yield exists
17106 set try -DSCHED_YIELD
17107 if eval $compile; then
17109 sched_yield='sched_yield()'
17113 case "$usethreads" in
17116 $define) echo 'sched_yield() found.' >&4 ;;
17117 *) echo 'sched_yield() NOT found.' >&4 ;;
17123 : see if pthread_yield exists
17124 set try -DPTHREAD_YIELD
17125 if eval $compile; then
17127 case "$sched_yield" in
17128 '') sched_yield='pthread_yield()' ;;
17131 set try -DPTHREAD_YIELD_NULL
17132 if eval $compile; then
17134 case "$sched_yield" in
17135 '') sched_yield='pthread_yield(NULL)' ;;
17141 case "$usethreads" in
17144 $define) echo 'pthread_yield() found.' >&4 ;;
17145 *) echo 'pthread_yield() NOT found.' >&4 ;;
17149 set d_pthread_yield
17151 case "$sched_yield" in
17152 '') sched_yield=undef ;;
17156 : check for ptrdiff_t
17158 echo "Checking to see if you have ptrdiff_t..." >&4
17160 #include <stddef.h>
17161 int main() { ptrdiff_t x = 7; }
17164 if eval $compile; then
17166 echo "You have ptrdiff_t."
17169 echo "You do not have ptrdiff_t."
17175 : see if random_r exists
17176 set random_r d_random_r
17178 case "$d_random_r" in
17180 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17181 case "$d_random_r_proto:$usethreads" in
17182 ":define") d_random_r_proto=define
17183 set d_random_r_proto random_r $hdrs
17187 case "$d_random_r_proto" in
17189 case "$random_r_proto" in
17190 ''|0) try='int random_r(int*, struct random_data*);'
17191 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17193 case "$random_r_proto" in
17194 ''|0) try='int random_r(long*, struct random_data*);'
17195 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17197 case "$random_r_proto" in
17198 ''|0) try='int random_r(struct random_data*, int32_t*);'
17199 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17201 case "$random_r_proto" in
17202 ''|0) d_random_r=undef
17204 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17205 * ) case "$random_r_proto" in
17206 REENTRANT_PROTO*) ;;
17207 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17209 echo "Prototype: $try" ;;
17212 *) case "$usethreads" in
17213 define) echo "random_r has no prototype, not using it." >&4 ;;
17220 *) random_r_proto=0
17224 : see if readdir and friends exist
17225 set readdir d_readdir
17227 set seekdir d_seekdir
17229 set telldir d_telldir
17231 set rewinddir d_rewinddir
17234 : see if readdir64_r exists
17235 set readdir64_r d_readdir64_r
17237 case "$d_readdir64_r" in
17239 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17240 case "$d_readdir64_r_proto:$usethreads" in
17241 ":define") d_readdir64_r_proto=define
17242 set d_readdir64_r_proto readdir64_r $hdrs
17246 case "$d_readdir64_r_proto" in
17248 case "$readdir64_r_proto" in
17249 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17250 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17252 case "$readdir64_r_proto" in
17253 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17254 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17256 case "$readdir64_r_proto" in
17257 ''|0) d_readdir64_r=undef
17258 readdir64_r_proto=0
17259 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17260 * ) case "$readdir64_r_proto" in
17261 REENTRANT_PROTO*) ;;
17262 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17264 echo "Prototype: $try" ;;
17267 *) case "$usethreads" in
17268 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17270 d_readdir64_r=undef
17271 readdir64_r_proto=0
17275 *) readdir64_r_proto=0
17279 : see if readdir_r exists
17280 set readdir_r d_readdir_r
17282 case "$d_readdir_r" in
17284 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17285 case "$d_readdir_r_proto:$usethreads" in
17286 ":define") d_readdir_r_proto=define
17287 set d_readdir_r_proto readdir_r $hdrs
17291 case "$d_readdir_r_proto" in
17293 case "$readdir_r_proto" in
17294 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17295 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17297 case "$readdir_r_proto" in
17298 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17299 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17301 case "$readdir_r_proto" in
17302 ''|0) d_readdir_r=undef
17304 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17305 * ) case "$readdir_r_proto" in
17306 REENTRANT_PROTO*) ;;
17307 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17309 echo "Prototype: $try" ;;
17312 *) case "$usethreads" in
17313 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17320 *) readdir_r_proto=0
17324 : see if readv exists
17328 : see if recvmsg exists
17329 set recvmsg d_recvmsg
17332 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17334 if set regcomp val -f d_regcomp; eval $csym; $val; then
17335 echo 'regcomp() found.' >&4
17336 d_regcomp="$define"
17339 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17340 echo 'regcmp() found.' >&4
17344 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17345 echo 're_comp() found, assuming re_exec() also exists.' >&4
17346 d_re_comp="$define"
17351 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17358 : see if remainder exists
17359 set remainder d_remainder
17362 : see if remquo exists
17363 set remquo d_remquo
17366 : see if rename exists
17367 set rename d_rename
17370 : see if rint exists
17374 : see if rmdir exists
17378 : see if round exists
17382 : see if prototype for sbrk is available
17384 set d_sbrkproto sbrk $i_unistd unistd.h
17387 : see if scalbn exists
17388 set scalbn d_scalbn
17391 : see if select exists
17392 set select d_select
17395 : see if semctl exists
17396 set semctl d_semctl
17399 : see if semget exists
17400 set semget d_semget
17403 : see if semop exists
17407 : see how much of the 'sem*(2)' library is present.
17410 case "$d_semctl$d_semget$d_semop" in
17411 *"$undef"*) h_sem=false;;
17415 case "`ipcs 2>&1`" in
17416 "SVID messages"*"not configured"*)
17417 echo "Your $osname does not have the sem*(2) configured." >&4
17420 set semctl d_semctl
17422 set semget d_semget
17430 : we could also check for sys/ipc.h ...
17431 if $h_sem && $test `./findhdr sys/sem.h`; then
17432 echo "You have the full sem*(2) library." >&4
17435 echo "You don't have the full sem*(2) library." >&4
17441 : see whether sys/sem.h defines union semun
17443 $cat > try.c <<'END'
17444 #include <sys/types.h>
17445 #include <sys/ipc.h>
17446 #include <sys/sem.h>
17447 int main () { union semun semun; semun.buf = 0; }
17450 if eval $compile; then
17451 echo "You have union semun in <sys/sem.h>." >&4
17454 echo "You do not have union semun in <sys/sem.h>." >&4
17461 : see how to do semctl IPC_STAT
17465 $cat > tryh.h <<END
17468 # define S_IRUSR S_IREAD
17469 # define S_IWUSR S_IWRITE
17470 # define S_IXUSR S_IEXEC
17472 # define S_IRUSR 0400
17473 # define S_IWUSR 0200
17474 # define S_IXUSR 0100
17476 # define S_IRGRP (S_IRUSR>>3)
17477 # define S_IWGRP (S_IWUSR>>3)
17478 # define S_IXGRP (S_IXUSR>>3)
17479 # define S_IROTH (S_IRUSR>>6)
17480 # define S_IWOTH (S_IWUSR>>6)
17481 # define S_IXOTH (S_IXUSR>>6)
17484 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17485 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17486 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17489 : see whether semctl IPC_STAT can use union semun
17490 case "$d_semctl_semun" in
17494 #include <sys/types.h>
17495 #include <sys/ipc.h>
17496 #include <sys/sem.h>
17497 #include <sys/stat.h>
17504 #$d_union_semun HAS_UNION_SEMUN
17507 #ifndef HAS_UNION_SEMUN
17510 struct semid_ds *buf;
17511 unsigned short *array;
17517 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17518 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17520 struct semid_ds argbuf;
17523 st = semctl(sem, 0, IPC_STAT, arg);
17527 # endif /* IPC_STAT */
17528 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17530 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17531 # endif /* IPC_RMID */
17532 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17534 #endif /* IPC_PRIVATE && ... */
17535 printf("semget failed: errno = %d\n", errno);
17540 if eval $compile; then
17543 semun) val="$define" ;;
17551 case "$d_semctl_semun" in
17553 echo "You can use union semun for semctl IPC_STAT." >&4
17556 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17561 : see whether semctl IPC_STAT can use struct semid_ds pointer
17562 case "$d_semctl_semid_ds" in
17565 $cat > try.c <<'END'
17566 #include <sys/types.h>
17567 #include <sys/ipc.h>
17568 #include <sys/sem.h>
17569 #include <sys/stat.h>
17577 struct semid_ds arg;
17580 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17581 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17584 st = semctl(sem, 0, IPC_STAT, &arg);
17586 printf("semid_ds\n");
17588 # endif /* IPC_STAT */
17589 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17591 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17592 # endif /* IPC_RMID */
17593 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17595 #endif /* IPC_PRIVATE && ... */
17596 printf("semget failed: errno = %d\n", errno);
17602 if eval $compile; then
17605 semid_ds) val="$define" ;;
17609 set d_semctl_semid_ds
17613 case "$d_semctl_semid_ds" in
17615 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17617 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17623 # We do not have the full sem*(2) library, so assume we can not
17629 set d_semctl_semid_ds
17635 : see if sendmsg exists
17636 set sendmsg d_sendmsg
17639 : see if setegid exists
17640 set setegid d_setegid
17643 : see if seteuid exists
17644 set seteuid d_seteuid
17647 : see if setgrent exists
17648 set setgrent d_setgrent
17651 : see if setgrent_r exists
17652 set setgrent_r d_setgrent_r
17654 case "$d_setgrent_r" in
17656 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17657 case "$d_setgrent_r_proto:$usethreads" in
17658 ":define") d_setgrent_r_proto=define
17659 set d_setgrent_r_proto setgrent_r $hdrs
17663 case "$d_setgrent_r_proto" in
17665 case "$setgrent_r_proto" in
17666 ''|0) try='int setgrent_r(FILE**);'
17667 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17669 case "$setgrent_r_proto" in
17670 ''|0) try='void setgrent_r(FILE**);'
17671 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17673 case "$setgrent_r_proto" in
17674 ''|0) d_setgrent_r=undef
17676 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17677 * ) case "$setgrent_r_proto" in
17678 REENTRANT_PROTO*) ;;
17679 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17681 echo "Prototype: $try" ;;
17684 *) case "$usethreads" in
17685 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17692 *) setgrent_r_proto=0
17696 : see if sethostent exists
17697 set sethostent d_sethent
17700 : see if sethostent_r exists
17701 set sethostent_r d_sethostent_r
17703 case "$d_sethostent_r" in
17705 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17706 case "$d_sethostent_r_proto:$usethreads" in
17707 ":define") d_sethostent_r_proto=define
17708 set d_sethostent_r_proto sethostent_r $hdrs
17712 case "$d_sethostent_r_proto" in
17714 case "$sethostent_r_proto" in
17715 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17716 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17718 case "$sethostent_r_proto" in
17719 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17720 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17722 case "$sethostent_r_proto" in
17723 ''|0) d_sethostent_r=undef
17724 sethostent_r_proto=0
17725 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17726 * ) case "$sethostent_r_proto" in
17727 REENTRANT_PROTO*) ;;
17728 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17730 echo "Prototype: $try" ;;
17733 *) case "$usethreads" in
17734 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17736 d_sethostent_r=undef
17737 sethostent_r_proto=0
17741 *) sethostent_r_proto=0
17745 : see if setitimer exists
17746 set setitimer d_setitimer
17749 : see if setlinebuf exists
17750 set setlinebuf d_setlinebuf
17753 : see if setlocale exists
17754 set setlocale d_setlocale
17757 : see if locale.h is available
17758 set locale.h i_locale
17761 : see if setlocale_r exists
17762 set setlocale_r d_setlocale_r
17764 case "$d_setlocale_r" in
17766 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17767 case "$d_setlocale_r_proto:$usethreads" in
17768 ":define") d_setlocale_r_proto=define
17769 set d_setlocale_r_proto setlocale_r $hdrs
17773 case "$d_setlocale_r_proto" in
17775 case "$setlocale_r_proto" in
17776 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17777 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17779 case "$setlocale_r_proto" in
17780 ''|0) d_setlocale_r=undef
17781 setlocale_r_proto=0
17782 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17783 * ) case "$setlocale_r_proto" in
17784 REENTRANT_PROTO*) ;;
17785 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17787 echo "Prototype: $try" ;;
17790 *) case "$usethreads" in
17791 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17793 d_setlocale_r=undef
17794 setlocale_r_proto=0
17798 *) setlocale_r_proto=0
17802 : see if setnetent exists
17803 set setnetent d_setnent
17806 : see if setnetent_r exists
17807 set setnetent_r d_setnetent_r
17809 case "$d_setnetent_r" in
17811 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17812 case "$d_setnetent_r_proto:$usethreads" in
17813 ":define") d_setnetent_r_proto=define
17814 set d_setnetent_r_proto setnetent_r $hdrs
17818 case "$d_setnetent_r_proto" in
17820 case "$setnetent_r_proto" in
17821 ''|0) try='int setnetent_r(int, struct netent_data*);'
17822 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17824 case "$setnetent_r_proto" in
17825 ''|0) try='void setnetent_r(int, struct netent_data*);'
17826 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17828 case "$setnetent_r_proto" in
17829 ''|0) d_setnetent_r=undef
17830 setnetent_r_proto=0
17831 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17832 * ) case "$setnetent_r_proto" in
17833 REENTRANT_PROTO*) ;;
17834 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17836 echo "Prototype: $try" ;;
17839 *) case "$usethreads" in
17840 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17842 d_setnetent_r=undef
17843 setnetent_r_proto=0
17847 *) setnetent_r_proto=0
17851 : see if setprotoent exists
17852 set setprotoent d_setpent
17855 : see if setpgid exists
17856 set setpgid d_setpgid
17859 : see if setpgrp2 exists
17860 set setpgrp2 d_setpgrp2
17863 : see if setpriority exists
17864 set setpriority d_setprior
17867 : see if setproctitle exists
17868 set setproctitle d_setproctitle
17871 : see if setprotoent_r exists
17872 set setprotoent_r d_setprotoent_r
17874 case "$d_setprotoent_r" in
17876 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17877 case "$d_setprotoent_r_proto:$usethreads" in
17878 ":define") d_setprotoent_r_proto=define
17879 set d_setprotoent_r_proto setprotoent_r $hdrs
17883 case "$d_setprotoent_r_proto" in
17885 case "$setprotoent_r_proto" in
17886 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17887 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17889 case "$setprotoent_r_proto" in
17890 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17891 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17893 case "$setprotoent_r_proto" in
17894 ''|0) d_setprotoent_r=undef
17895 setprotoent_r_proto=0
17896 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17897 * ) case "$setprotoent_r_proto" in
17898 REENTRANT_PROTO*) ;;
17899 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17901 echo "Prototype: $try" ;;
17904 *) case "$usethreads" in
17905 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17907 d_setprotoent_r=undef
17908 setprotoent_r_proto=0
17912 *) setprotoent_r_proto=0
17916 : see if setpwent exists
17917 set setpwent d_setpwent
17920 : see if setpwent_r exists
17921 set setpwent_r d_setpwent_r
17923 case "$d_setpwent_r" in
17925 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17926 case "$d_setpwent_r_proto:$usethreads" in
17927 ":define") d_setpwent_r_proto=define
17928 set d_setpwent_r_proto setpwent_r $hdrs
17932 case "$d_setpwent_r_proto" in
17934 case "$setpwent_r_proto" in
17935 ''|0) try='int setpwent_r(FILE**);'
17936 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17938 case "$setpwent_r_proto" in
17939 ''|0) try='void setpwent_r(FILE**);'
17940 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17942 case "$setpwent_r_proto" in
17943 ''|0) d_setpwent_r=undef
17945 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17946 * ) case "$setpwent_r_proto" in
17947 REENTRANT_PROTO*) ;;
17948 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17950 echo "Prototype: $try" ;;
17953 *) case "$usethreads" in
17954 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17961 *) setpwent_r_proto=0
17965 : see if setregid exists
17966 set setregid d_setregid
17968 set setresgid d_setresgid
17971 : see if setreuid exists
17972 set setreuid d_setreuid
17974 set setresuid d_setresuid
17977 : see if setrgid exists
17978 set setrgid d_setrgid
17981 : see if setruid exists
17982 set setruid d_setruid
17985 : see if setservent exists
17986 set setservent d_setsent
17989 : see if setservent_r exists
17990 set setservent_r d_setservent_r
17992 case "$d_setservent_r" in
17994 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17995 case "$d_setservent_r_proto:$usethreads" in
17996 ":define") d_setservent_r_proto=define
17997 set d_setservent_r_proto setservent_r $hdrs
18001 case "$d_setservent_r_proto" in
18003 case "$setservent_r_proto" in
18004 ''|0) try='int setservent_r(int, struct servent_data*);'
18005 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18007 case "$setservent_r_proto" in
18008 ''|0) try='void setservent_r(int, struct servent_data*);'
18009 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18011 case "$setservent_r_proto" in
18012 ''|0) d_setservent_r=undef
18013 setservent_r_proto=0
18014 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18015 * ) case "$setservent_r_proto" in
18016 REENTRANT_PROTO*) ;;
18017 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18019 echo "Prototype: $try" ;;
18022 *) case "$usethreads" in
18023 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18025 d_setservent_r=undef
18026 setservent_r_proto=0
18030 *) setservent_r_proto=0
18034 : see if setsid exists
18035 set setsid d_setsid
18038 : see if setvbuf exists
18039 set setvbuf d_setvbuf
18042 : see if shmctl exists
18043 set shmctl d_shmctl
18046 : see if shmget exists
18047 set shmget d_shmget
18050 : see if shmat exists
18053 : see what shmat returns
18056 $cat >shmat.c <<'END'
18057 #include <sys/shm.h>
18060 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18065 echo "and it returns ($shmattype)." >&4
18066 : see if a prototype for shmat is available
18067 xxx=`./findhdr sys/shm.h`
18068 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18069 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18080 set d_shmatprototype
18083 : see if shmdt exists
18087 : see how much of the 'shm*(2)' library is present.
18090 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18091 *"$undef"*) h_shm=false;;
18095 case "`ipcs 2>&1`" in
18096 "SVID shared memory"*"not configured"*)
18097 echo "Your $osname does not have the shm*(2) configured." >&4
18100 set shmctl d_shmctl
18102 set shmget d_shmget
18112 : we could also check for sys/ipc.h ...
18113 if $h_shm && $test `./findhdr sys/shm.h`; then
18114 echo "You have the full shm*(2) library." >&4
18117 echo "You don't have the full shm*(2) library." >&4
18123 : see if we have sigaction
18125 if set sigaction val -f d_sigaction; eval $csym; $val; then
18126 echo 'sigaction() found.' >&4
18129 #include <sys/types.h>
18130 #include <signal.h>
18131 #$i_stdlib I_STDLIB
18133 #include <stdlib.h>
18137 struct sigaction act, oact;
18139 oact.sa_handler = 0;
18140 /* so that act and oact are used */
18141 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18145 if eval $compile_ok; then
18148 echo "But you don't seem to have a usable struct sigaction." >&4
18152 echo 'sigaction NOT found.' >&4
18155 set d_sigaction; eval $setvar
18158 : see what type pids are declared as in the kernel
18159 rp="What is the type of process ids on this system?"
18160 set pid_t pidtype int stdio.h sys/types.h
18163 : see what type uids are declared as in the kernel
18165 echo "Looking for the type for user ids returned by getuid()."
18166 set uid_t uidtype xxx stdio.h sys/types.h
18170 xxx=`./findhdr sys/user.h`
18171 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18173 unsigned) dflt="$1 $2" ;;
18177 *) dflt="$uidtype";;
18180 uid_t) echo "uid_t found." ;;
18181 *) rp="What is the type for user ids returned by getuid()?"
18187 : Define hasfield_t macro for Configure internal use
18188 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18189 while $test $# -ge 2; do
18191 $define) echo "#include <$2>";;
18195 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18197 if eval $compile; then
18206 : see what siginfo fields we have
18207 case "$d_sigaction" in
18209 echo "Checking if your siginfo_t has si_errno field...">&4
18210 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18213 echo "Checking if your siginfo_t has si_pid field...">&4
18214 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18217 echo "Checking if your siginfo_t has si_uid field...">&4
18218 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18221 echo "Checking if your siginfo_t has si_addr field...">&4
18222 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18225 echo "Checking if your siginfo_t has si_status field...">&4
18226 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18229 echo "Checking if your siginfo_t has si_band field...">&4
18230 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18233 echo "Checking if your siginfo_t has si_value field...">&4
18234 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18237 echo "Checking if your siginfo_t has si_fd field...">&4
18238 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18243 d_siginfo_si_errno="$undef"
18244 d_siginfo_si_pid="$undef"
18245 d_siginfo_si_uid="$undef"
18246 d_siginfo_si_addr="$undef"
18247 d_siginfo_si_status="$undef"
18248 d_siginfo_si_band="$undef"
18249 d_siginfo_si_value="$undef"
18250 d_siginfo_si_fd="$undef"
18254 : see if this is a sunmath.h system
18255 set sunmath.h i_sunmath
18258 : see if signbit exists
18259 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18261 #$i_sunmath I_SUNMATH
18263 #ifdef I_SUNMATH /* Solaris special math library */
18264 # include <sunmath.h>
18267 int main(int argc, char **argv)
18271 if ((signbit(x) == 0) && (signbit(y) != 0))
18279 if eval $compile; then
18280 if $run ./try; then
18284 $echo "Signbit seems to be available, but doesn't work as I expected."
18285 $echo "I won't use it." >&4
18296 : see if sigprocmask exists
18297 set sigprocmask d_sigprocmask
18300 : see if sigsetjmp exists
18302 case "$d_sigsetjmp" in
18305 #include <setjmp.h>
18306 #$i_stdlib I_STDLIB
18308 #include <stdlib.h>
18314 if (sigsetjmp(env,1))
18317 siglongjmp(env, 1);
18322 if eval $compile; then
18323 if $run ./try >/dev/null 2>&1; then
18324 echo "POSIX sigsetjmp found." >&4
18328 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18334 echo "sigsetjmp not found." >&4
18338 *) val="$d_sigsetjmp"
18339 case "$d_sigsetjmp" in
18340 $define) echo "POSIX sigsetjmp found." >&4;;
18341 $undef) echo "sigsetjmp not found." >&4;;
18349 : see if snprintf exists
18350 set snprintf d_snprintf
18353 : see if vsnprintf exists
18354 set vsnprintf d_vsnprintf
18357 case "$d_snprintf-$d_vsnprintf" in
18360 Checking whether your snprintf() and vsnprintf() work okay...
18362 $cat >try.c <<'EOCP'
18363 /* v?snprintf testing logic courtesy of Russ Allbery.
18364 * According to C99:
18365 * - if the buffer is too short it still must be \0-terminated
18366 * - if the buffer is too short the potentially required length
18367 * must be returned and not -1
18368 * - if the buffer is NULL the potentially required length
18369 * must be returned and not -1 or core dump
18372 #include <stdarg.h>
18376 int test (char *format, ...)
18381 va_start (args, format);
18382 count = vsnprintf (buf, sizeof buf, format, args);
18389 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18390 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18394 if eval $compile; then
18397 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18399 Your snprintf() and snprintf() don't seem to be working okay.
18401 d_snprintf="$undef"
18402 d_vsnprintf="$undef"
18406 echo "(I can't seem to compile the test program--assuming they don't)"
18407 d_snprintf="$undef"
18408 d_vsnprintf="$undef"
18414 : see if sockatmark exists
18415 set sockatmark d_sockatmark
18418 : see if prototype for sockatmark is available
18420 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18423 : see if socks5_init exists
18424 set socks5_init d_socks5_init
18427 : see if srand48_r exists
18428 set srand48_r d_srand48_r
18430 case "$d_srand48_r" in
18432 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18433 case "$d_srand48_r_proto:$usethreads" in
18434 ":define") d_srand48_r_proto=define
18435 set d_srand48_r_proto srand48_r $hdrs
18439 case "$d_srand48_r_proto" in
18441 case "$srand48_r_proto" in
18442 ''|0) try='int srand48_r(long, struct drand48_data*);'
18443 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18445 case "$srand48_r_proto" in
18446 ''|0) d_srand48_r=undef
18448 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18449 * ) case "$srand48_r_proto" in
18450 REENTRANT_PROTO*) ;;
18451 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18453 echo "Prototype: $try" ;;
18456 *) case "$usethreads" in
18457 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18464 *) srand48_r_proto=0
18468 : see if srandom_r exists
18469 set srandom_r d_srandom_r
18471 case "$d_srandom_r" in
18473 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18474 case "$d_srandom_r_proto:$usethreads" in
18475 ":define") d_srandom_r_proto=define
18476 set d_srandom_r_proto srandom_r $hdrs
18480 case "$d_srandom_r_proto" in
18482 case "$srandom_r_proto" in
18483 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18484 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18486 case "$srandom_r_proto" in
18487 ''|0) d_srandom_r=undef
18489 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18490 * ) case "$srandom_r_proto" in
18491 REENTRANT_PROTO*) ;;
18492 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18494 echo "Prototype: $try" ;;
18497 *) case "$usethreads" in
18498 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18505 *) srandom_r_proto=0
18509 : see if prototype for setresgid is available
18511 set d_sresgproto setresgid $i_unistd unistd.h
18514 : see if prototype for setresuid is available
18516 set d_sresuproto setresuid $i_unistd unistd.h
18519 : see if stat exists
18523 : see if sys/stat.h is available
18524 set sys/stat.h i_sysstat
18527 : see if stat knows about block sizes
18529 echo "Checking to see if your struct stat has st_blocks field..." >&4
18530 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18533 : see if this is a sys/vfs.h system
18534 set sys/vfs.h i_sysvfs
18537 : see if this is a sys/statfs.h system
18538 set sys/statfs.h i_sysstatfs
18541 : Check for statfs_s
18543 echo "Checking to see if your system supports struct statfs..." >&4
18544 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
18546 case "$d_statfs_s" in
18547 "$define") echo "Yes, it does." ;;
18548 *) echo "No, it doesn't." ;;
18551 : see if struct statfs knows about f_flags
18552 case "$d_statfs_s" in
18555 echo "Checking to see if your struct statfs has f_flags field..." >&4
18556 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
18560 set d_statfs_f_flags
18564 case "$d_statfs_f_flags" in
18565 "$define") echo "Yes, it does." ;;
18566 *) echo "No, it doesn't." ;;
18569 : see what flavor, if any, of static inline is supported
18571 echo "Checking to see if your system supports static inline..."
18572 $cat > try.c <<'EOCP'
18573 #include <stdlib.h>
18574 extern int f_via_a(int x);
18575 extern int f_via_b(int x);
18576 int main(int argc, char **argv)
18585 return EXIT_SUCCESS;
18588 return EXIT_FAILURE;
18592 $cat > a.c <<'EOCP'
18593 static INLINE int f(int x) {
18604 $cat > b.c <<'EOCP'
18605 extern int f(int x);
18613 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18614 case "$perl_static_inline" in
18615 '') # Check the various possibilities, and break out on success.
18616 # For gcc, prefer __inline__, which will still permit
18617 # cflags.SH to add in -ansi.
18618 case "$gccversion" in
18619 '') xxx="inline __inline__ __inline _inline";;
18620 *) xxx="__inline__ inline __inline _inline";;
18622 for inline in $xxx; do
18623 set try -DINLINE=$inline a.c
18624 if eval $compile && $run ./try; then
18625 # Now make sure there is no external linkage of static
18627 set try -DINLINE=$inline -DUSE_B a.c b.c
18628 if eval $compile && $run ./try; then
18629 $echo "Your compiler supports static $inline, " >&4
18630 $echo "but it also creates an external definition," >&4
18631 $echo "so I won't use it." >&4
18634 $echo "Your compiler supports static $inline." >&4
18636 perl_static_inline="static $inline";
18640 $echo "Your compiler does NOT support static $inline." >&4
18645 *inline*) # Some variant of inline exists.
18646 echo "Keeping your $hint value of $perl_static_inline."
18649 static) # No inline capabilities
18650 echo "Keeping your $hint value of $perl_static_inline."
18653 *) # Unrecognized previous value -- blindly trust the supplied
18654 # value and hope it makes sense. Use old value for
18655 # d_static_inline, if there is one.
18656 echo "Keeping your $hint value of $perl_static_inline."
18657 case "$d_static_inline" in
18659 *) val=$d_static_inline ;;
18663 # Fallback to plain 'static' if nothing worked.
18664 case "$perl_static_inline" in
18666 perl_static_inline="static"
18670 set d_static_inline
18672 $rm -f a.[co] b.[co]
18675 : Check stream access
18677 Checking how to access stdio streams by file descriptor number...
18679 case "$stdio_stream_array" in
18680 '') $cat >try.c <<EOCP
18683 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18687 for s in _iob __iob __sF
18689 set try -DSTDIO_STREAM_ARRAY=$s
18690 if eval $compile; then
18691 case "`$run ./try`" in
18692 yes) stdio_stream_array=$s; break ;;
18698 case "$stdio_stream_array" in
18700 I can't figure out how to access stdio streams by file descriptor number.
18702 d_stdio_stream_array="$undef"
18705 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18707 d_stdio_stream_array="$define"
18711 : see if strcoll exists
18712 set strcoll d_strcoll
18715 : see if strerror_l exists
18716 set strerror_l d_strerror_l
18719 : see if strerror_r exists
18720 set strerror_r d_strerror_r
18722 case "$d_strerror_r" in
18724 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18725 case "$d_strerror_r_proto:$usethreads" in
18726 ":define") d_strerror_r_proto=define
18727 set d_strerror_r_proto strerror_r $hdrs
18731 case "$d_strerror_r_proto" in
18733 case "$strerror_r_proto" in
18734 ''|0) try='int strerror_r(int, char*, size_t);'
18735 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18737 case "$strerror_r_proto" in
18738 ''|0) try='int strerror_r(int, char*, int);'
18739 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18741 case "$strerror_r_proto" in
18742 ''|0) try='char* strerror_r(int, char*, size_t);'
18743 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18745 case "$strerror_r_proto" in
18746 ''|0) d_strerror_r=undef
18748 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18749 * ) case "$strerror_r_proto" in
18750 REENTRANT_PROTO*) ;;
18751 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18753 echo "Prototype: $try" ;;
18756 *) case "$usethreads" in
18757 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18764 *) strerror_r_proto=0
18768 : see if strftime exists
18769 set strftime d_strftime
18772 : see if strlcat exists
18773 set strlcat d_strlcat
18776 : see if strlcpy exists
18777 set strlcpy d_strlcpy
18780 : see if strnlen exists
18781 set strnlen d_strnlen
18784 : see if strtod exists
18785 set strtod d_strtod
18788 : see if strtol exists
18789 set strtol d_strtol
18792 : see if strtold exists
18793 set strtold d_strtold
18796 : see if strtold_l exists
18797 set strtold_l d_strtold_l
18800 : see if strtoll exists
18801 set strtoll d_strtoll
18804 case "$d_longlong-$d_strtoll" in
18807 Checking whether your strtoll() works okay...
18809 $cat >try.c <<'EOCP'
18812 #define strtoll __strtoll
18815 #define strtoll _strtoll
18818 extern long long int strtoll(char *s, char **, int);
18819 static int bad = 0;
18820 int check(char *s, long long ell, int een) {
18823 gll = strtoll(s, 0, 10);
18824 if (!((gll == ell) && (errno == een)))
18828 check(" 1", 1LL, 0);
18829 check(" 0", 0LL, 0);
18830 check("-1", -1LL, 0);
18831 check("-9223372036854775808", -9223372036854775808LL, 0);
18832 check("-9223372036854775808", -9223372036854775808LL, 0);
18833 check(" 9223372036854775807", 9223372036854775807LL, 0);
18834 check("-9223372036854775808", -9223372036854775808LL, 0);
18835 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18836 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18842 if eval $compile; then
18845 ok) echo "Your strtoll() seems to be working okay." ;;
18847 Your strtoll() doesn't seem to be working okay.
18853 echo "(I can't seem to compile the test program--assuming it doesn't)"
18859 : see if strtoq exists
18860 set strtoq d_strtoq
18863 : see if strtoul exists
18864 set strtoul d_strtoul
18867 case "$d_strtoul" in
18870 Checking whether your strtoul() works okay...
18872 $cat >try.c <<'EOCP'
18875 extern unsigned long int strtoul(char *s, char **, int);
18876 static int bad = 0;
18877 void check(char *s, unsigned long eul, int een) {
18880 gul = strtoul(s, 0, 10);
18881 if (!((gul == eul) && (errno == een)))
18885 check(" 1", 1L, 0);
18886 check(" 0", 0L, 0);
18888 case "$longsize" in
18890 $cat >>try.c <<'EOCP'
18891 check("18446744073709551615", 18446744073709551615UL, 0);
18892 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18893 #if 0 /* strtoul() for /^-/ strings is undefined. */
18894 check("-1", 18446744073709551615UL, 0);
18895 check("-18446744073709551614", 2, 0);
18896 check("-18446744073709551615", 1, 0);
18897 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18898 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18903 $cat >>try.c <<'EOCP'
18904 check("4294967295", 4294967295UL, 0);
18905 check("4294967296", 4294967295UL, ERANGE);
18906 #if 0 /* strtoul() for /^-/ strings is undefined. */
18907 check("-1", 4294967295UL, 0);
18908 check("-4294967294", 2, 0);
18909 check("-4294967295", 1, 0);
18910 check("-4294967296", 4294967295UL, ERANGE);
18911 check("-4294967297", 4294967295UL, ERANGE);
18916 : Should we write these tests to be more portable by sprintf-ing
18917 : ~0 and then manipulating that char string as input for strtol?
18920 $cat >>try.c <<'EOCP'
18927 if eval $compile; then
18928 case "`$run ./try`" in
18929 ok) echo "Your strtoul() seems to be working okay." ;;
18931 Your strtoul() doesn't seem to be working okay.
18937 echo "(I can't seem to compile the test program--assuming it doesn't)"
18943 : see if strtoull exists
18944 set strtoull d_strtoull
18947 case "$d_longlong-$d_strtoull" in
18950 Checking whether your strtoull() works okay...
18952 $cat >try.c <<'EOCP'
18955 #define strtoull __strtoull
18958 extern unsigned long long int strtoull(char *s, char **, int);
18959 static int bad = 0;
18960 int check(char *s, long long eull, int een) {
18963 gull = strtoull(s, 0, 10);
18964 if (!((gull == eull) && (errno == een)))
18968 check(" 1", 1LL, 0);
18969 check(" 0", 0LL, 0);
18970 check("18446744073709551615", 18446744073709551615ULL, 0);
18971 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18972 #if 0 /* strtoull() for /^-/ strings is undefined. */
18973 check("-1", 18446744073709551615ULL, 0);
18974 check("-18446744073709551614", 2LL, 0);
18975 check("-18446744073709551615", 1LL, 0);
18976 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18977 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18984 if eval $compile; then
18985 case "`$run ./try`" in
18986 ok) echo "Your strtoull() seems to be working okay." ;;
18988 Your strtoull() doesn't seem to be working okay.
18990 d_strtoull="$undef"
18994 echo "(I can't seem to compile the test program--assuming it doesn't)"
18995 d_strtoull="$undef"
19000 : see if strtouq exists
19001 set strtouq d_strtouq
19004 case "$d_strtouq" in
19007 Checking whether your strtouq() works okay...
19009 $cat >try.c <<'EOCP'
19012 extern unsigned long long int strtouq(char *s, char **, int);
19013 static int bad = 0;
19014 void check(char *s, unsigned long long eull, int een) {
19015 unsigned long long gull;
19017 gull = strtouq(s, 0, 10);
19018 if (!((gull == eull) && (errno == een)))
19022 check(" 1", 1LL, 0);
19023 check(" 0", 0LL, 0);
19024 check("18446744073709551615", 18446744073709551615ULL, 0);
19025 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19026 #if 0 /* strtouq() for /^-/ strings is undefined. */
19027 check("-1", 18446744073709551615ULL, 0);
19028 check("-18446744073709551614", 2LL, 0);
19029 check("-18446744073709551615", 1LL, 0);
19030 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19031 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19039 if eval $compile; then
19040 case "`$run ./try`" in
19041 ok) echo "Your strtouq() seems to be working okay." ;;
19043 Your strtouq() doesn't seem to be working okay.
19049 echo "(I can't seem to compile the test program--assuming it doesn't)"
19055 : see if strxfrm exists
19056 set strxfrm d_strxfrm
19059 : see if symlink exists
19060 set symlink d_symlink
19063 : see if syscall exists
19064 set syscall d_syscall
19067 : see if prototype for syscall is available
19069 set d_syscallproto syscall $i_unistd unistd.h
19072 : see if sysconf exists
19073 set sysconf d_sysconf
19076 : see if sys_errlist[] exists
19078 if test "X$d_syserrlst" = X; then
19079 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19080 echo "You have sys_errlist[], so we could roll our own strerror."
19081 d_syserrlst="$define"
19083 echo "You don't have sys_errlist[], so strerror() is welcome."
19084 d_syserrlst="$undef"
19088 : see if system exists
19089 set system d_system
19092 : see if tcgetpgrp exists
19093 set tcgetpgrp d_tcgetpgrp
19096 : see if tcsetpgrp exists
19097 set tcsetpgrp d_tcsetpgrp
19100 : see if prototype for telldir is available
19102 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19105 : see if tgamma exists
19106 set tgamma d_tgamma
19109 : check for thread_safe_nl_langinfo_l item
19112 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19115 #$i_stdlib I_STDLIB
19117 # include <stdlib.h>
19119 #include <string.h>
19120 #$i_langinfo I_LANGINFO
19122 # include <langinfo.h>
19124 #$i_pthread I_PTHREAD
19126 # include <pthread.h>
19128 #$i_locale I_LOCALE
19130 # include <locale.h>
19134 thread_start(void * arg)
19136 nl_langinfo(RADIXCHAR);
19140 char * main_buffer;
19141 char save_main_buffer[1000];
19142 pthread_t subthread;
19143 pthread_attr_t attr;
19145 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19147 /* If too large for our generous allowance, just assume we don't have
19149 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19153 strcpy(save_main_buffer, main_buffer);
19155 if (pthread_attr_init(&attr) != 0) {
19159 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19163 if (pthread_join(subthread, NULL) != 0) {
19167 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19170 case "$usethreads" in
19173 if eval $compile; then
19174 echo "Your system has nl_langinfo_l()..." >&4
19175 if $run ./try; then
19176 echo "and it is thread-safe (just as I'd hoped)." >&4
19177 d_thread_safe_nl_langinfo_l="$define"
19178 echo "$d_thread_safe_nl_langinfo_l" >&4
19180 echo "but it isn't thread-safe, so we won't use it." >&4
19183 echo "your system does not have nl_langinfo_l()" >&4
19186 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19188 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19189 d_thread_safe_nl_langinfo_l="$undef"
19193 : see if time exists
19195 if test "X$d_time" = X -o X"$timetype" = X; then
19196 if set time val -f d_time; eval $csym; $val; then
19197 echo 'time() found.' >&4
19199 rp="What is the type returned by time() on this system?"
19200 set time_t timetype long stdio.h sys/types.h
19203 echo 'time() not found, hope that will do.' >&4
19211 : see if timegm exists
19212 set timegm d_timegm
19215 : see if this is a sys/times.h system
19216 set sys/times.h i_systimes
19219 : see if times exists
19221 if set times val -f d_times; eval $csym; $val; then
19222 echo 'times() found.' >&4
19225 case "$i_systimes" in
19226 "$define") inc='sys/times.h';;
19228 rp="What is the type returned by times() on this system?"
19229 set clock_t clocktype long stdio.h sys/types.h $inc
19232 echo 'times() NOT found, hope that will do.' >&4
19237 : see if tmpnam_r exists
19238 set tmpnam_r d_tmpnam_r
19240 case "$d_tmpnam_r" in
19242 hdrs="$i_systypes sys/types.h define stdio.h "
19243 case "$d_tmpnam_r_proto:$usethreads" in
19244 ":define") d_tmpnam_r_proto=define
19245 set d_tmpnam_r_proto tmpnam_r $hdrs
19249 case "$d_tmpnam_r_proto" in
19251 case "$tmpnam_r_proto" in
19252 ''|0) try='char* tmpnam_r(char*);'
19253 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19255 case "$tmpnam_r_proto" in
19256 ''|0) d_tmpnam_r=undef
19258 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19259 * ) case "$tmpnam_r_proto" in
19260 REENTRANT_PROTO*) ;;
19261 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19263 echo "Prototype: $try" ;;
19266 *) case "$usethreads" in
19267 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19274 *) tmpnam_r_proto=0
19278 : see if trunc exists
19282 : see if truncate exists
19283 set truncate d_truncate
19286 : see if ttyname_r exists
19287 set ttyname_r d_ttyname_r
19289 case "$d_ttyname_r" in
19291 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19292 case "$d_ttyname_r_proto:$usethreads" in
19293 ":define") d_ttyname_r_proto=define
19294 set d_ttyname_r_proto ttyname_r $hdrs
19298 case "$d_ttyname_r_proto" in
19300 case "$ttyname_r_proto" in
19301 ''|0) try='int ttyname_r(int, char*, size_t);'
19302 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19304 case "$ttyname_r_proto" in
19305 ''|0) try='int ttyname_r(int, char*, int);'
19306 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19308 case "$ttyname_r_proto" in
19309 ''|0) try='char* ttyname_r(int, char*, int);'
19310 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19312 case "$ttyname_r_proto" in
19313 ''|0) d_ttyname_r=undef
19315 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19316 * ) case "$ttyname_r_proto" in
19317 REENTRANT_PROTO*) ;;
19318 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19320 echo "Prototype: $try" ;;
19323 *) case "$usethreads" in
19324 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19331 *) ttyname_r_proto=0
19335 : see if tzname[] exists
19337 if set tzname val -a d_tzname; eval $csym; $val; then
19339 echo 'tzname[] found.' >&4
19342 echo 'tzname[] NOT found.' >&4
19347 : Check if is a multiplatform env
19349 darwin) multiarch="$define" ;;
19351 case "$multiarch" in
19352 ''|[nN]*) multiarch="$undef" ;;
19355 : check for ordering of bytes in a UV
19357 case "$multiarch" in
19360 You seem to be doing a multiarchitecture build,
19361 skipping the byteorder check.
19367 case "$byteorder" in
19370 In the following, larger digits indicate more significance. A big-endian
19371 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19372 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19373 machines may have weird orders like 3412. A Cray will report 87654321,
19374 an Alpha will report 12345678. If the test program works the default is
19376 I'm now running the test program...
19380 #$i_stdlib I_STDLIB
19382 #include <stdlib.h>
19384 #include <sys/types.h>
19385 typedef $uvtype UV;
19395 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19397 u.l = (UV)0x04030201;
19398 for (i = 0; i < $uvsize; i++)
19399 printf("%c", u.c[i]+'0');
19406 if eval $compile && $run ./try > /dev/null; then
19409 [1-4][1-4][1-4][1-4]|12345678|87654321)
19410 echo "(The test program ran ok.)"
19411 echo "byteorder=$dflt"
19414 ????|????????) echo "(The test program ran ok.)" ;;
19415 *) echo "(The test program didn't run right for some reason.)" ;;
19420 (I can't seem to compile the test program. Guessing big-endian...)
19423 case "$xxx_prompt" in
19425 rp="What is the order of bytes in $uvtype?"
19438 : Checking 32bit alignedness
19441 Checking to see whether you can access character data unalignedly...
19443 case "$d_u32align" in
19444 '') $cat >try.c <<EOCP
19446 #$i_stdlib I_STDLIB
19448 #include <stdlib.h>
19450 #define U32 $u32type
19451 #define BYTEORDER 0x$byteorder
19453 #include <signal.h>
19455 $signal_t bletch(int s) { exit(4); }
19458 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19459 volatile U8 buf[8];
19463 if (sizeof(U32) != 4) {
19464 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19471 signal(SIGBUS, bletch);
19483 for (i = 0; i < 4; i++) {
19484 up = (U32*)(buf + i);
19485 if (! ((*up == 1 << (8*i)) || /* big-endian */
19486 (*up == 1 << (8*(3-i))) /* little-endian */
19490 printf("read failed (%x)\n", *up);
19496 for (i = 0; i < 4; i++) {
19497 up = (U32*)(buf + i);
19499 if (*up != 0xBeef) {
19500 printf("write failed (%x)\n", *up);
19514 if eval $compile_ok; then
19515 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19516 $run ./try 2>&1 >/dev/null
19519 You can access character data pretty unalignedly.
19521 d_u32align="$undef"
19524 It seems that you must access character data in an aligned manner.
19526 d_u32align="$define"
19530 rp='Can you access character data at unaligned addresses?'
19534 [yY]*) d_u32align="$undef" ;;
19535 *) d_u32align="$define" ;;
19542 : see if ualarm exists
19543 set ualarm d_ualarm
19546 : see if umask exists
19550 : see if unordered exists
19551 set unordered d_unordered
19554 : see if unsetenv exists
19555 set unsetenv d_unsetenv
19558 : see if usleep exists
19559 set usleep d_usleep
19562 : see if prototype for usleep is available
19564 set d_usleepproto usleep $i_unistd unistd.h
19567 : see if ustat exists
19571 : see if closedir exists
19572 set closedir d_closedir
19575 case "$d_closedir" in
19578 echo "Checking whether closedir() returns a status..." >&4
19580 #$i_dirent I_DIRENT /**/
19581 #$i_sysdir I_SYS_DIR /**/
19582 #$i_sysndir I_SYS_NDIR /**/
19583 #$i_systypes I_SYS_TYPES /**/
19585 #if defined(I_SYS_TYPES)
19586 #include <sys/types.h>
19588 #if defined(I_DIRENT)
19589 #include <dirent.h>
19592 #include <sys/ndir.h>
19595 #include <sys/dir.h>
19599 int main() { return closedir(opendir(".")); }
19602 if eval $compile_ok; then
19603 if $run ./try > /dev/null 2>&1 ; then
19604 echo "Yes, it does."
19607 echo "No, it doesn't."
19611 echo "(I can't seem to compile the test program--assuming it doesn't)"
19619 set d_void_closedir
19623 : see if there is a wait4
19627 : see if waitpid exists
19628 set waitpid d_waitpid
19633 $cat >try.c <<'EOCP'
19639 return (wcscmp (s, s) ? 1 : 0);
19644 if eval $compile; then
19647 0) echo "A working wcscmp() found." >&4
19649 *) echo "wcscmp() found, but it doesn't work" >&4
19653 echo "wcscmp() NOT found." >&4
19659 : see if wcstombs exists
19660 set wcstombs d_wcstombs
19665 $cat >try.c <<'EOCP'
19670 wchar_t dst[4], *src = L" ";
19672 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19677 if eval $compile; then
19680 0) echo "A working wcsxfrm() found." >&4
19682 *) echo "wcsxfrm() found, but it doesn't work" >&4
19686 echo "wcsxfrm() NOT found." >&4
19692 : see if wctomb exists
19693 set wctomb d_wctomb
19696 : see if writev exists
19697 set writev d_writev
19700 : check for alignment requirements
19702 case "$alignbytes" in
19703 '') echo "Checking alignment constraints..." >&4
19712 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19717 if eval $compile_ok; then
19721 echo "(I can't seem to compile the test program...)"
19723 case "$multiarch" in
19725 : The usual safe value is 8, but Darwin with -Duselongdouble
19726 : needs 16. Hence, we will take 8 as a minimum, but allow
19727 : Configure to pick a larger value if needed.
19728 if $test "$dflt" -lt 8; then
19730 echo "Setting alignment to 8 for multiarch support.">&4
19735 *) dflt="$alignbytes"
19738 rp="Doubles must be aligned on a how-many-byte boundary?"
19743 : set the base revision
19746 : length of character in bytes. Is always 1, otherwise it is not C
19747 : This used to be a test using sizeof
19750 : Check for the number of bits in a character
19751 case "$charbits" in
19752 '') echo "Checking how long a character is (in bits)..." >&4
19759 for (c = 1, n = 0; c; c <<= 1, n++) ;
19760 printf ("%d\n", n);
19765 if eval $compile_ok; then
19769 echo "(I can't seem to compile the test program. Guessing...)"
19776 rp="What is the length of a character (in bits)?"
19780 case "$charbits" in
19783 Your system has an unsigned character size of $charbits bits, which
19784 is rather unusual (normally it is 8 bits). Perl likely will not work
19785 correctly on your system, with subtle bugs in various places.
19787 rp='Do you really want to continue?'
19791 [yY]) echo >&4 "Okay, continuing." ;;
19796 : how do we concatenate cpp tokens here?
19798 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19799 $cat >cpp_stuff.c <<'EOCP'
19800 #define RCAT(a,b)a/**/b
19801 #define ACAT(a,b)a ## b
19805 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19806 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19807 echo "Oh! Smells like ANSI's been here." >&4
19808 echo "We can catify or stringify, separately or together!"
19810 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19811 echo "Ah, yes! The good old days!" >&4
19812 echo "However, in the good old days we don't know how to stringify and"
19813 echo "catify at the same time."
19817 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19818 You're going to have to edit the values of CAT[2-5] in config.h...
19820 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19824 : see if this is a db.h system
19830 : Check db version.
19832 echo "Checking Berkeley DB version ..." >&4
19838 #include <sys/types.h>
19840 #$i_stdlib I_STDLIB
19842 #include <stdlib.h>
19845 int main(int argc, char *argv[])
19847 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19848 int Major, Minor, Patch ;
19849 unsigned long Version ;
19850 (void)db_version(&Major, &Minor, &Patch) ;
19852 printf("%d %d %d %d %d %d\n",
19853 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19854 Major, Minor, Patch);
19857 printf("You have Berkeley DB Version 2 or greater.\n");
19859 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19860 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19861 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19862 Major, Minor, Patch) ;
19864 /* check that db.h & libdb are compatible */
19865 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19866 printf("db.h and libdb are incompatible.\n") ;
19870 printf("db.h and libdb are compatible.\n") ;
19872 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19873 + DB_VERSION_PATCH ;
19875 /* needs to be >= 2.3.4 */
19876 if (Version < 2003004) {
19877 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19878 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19884 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19889 printf("You have Berkeley DB Version 1.\n");
19890 exit(0); /* DB version < 2: the coast is clear. */
19892 exit(1); /* <db.h> not Berkeley DB? */
19898 if eval $compile_ok && $run ./try; then
19899 echo 'Looks OK.' >&4
19901 db_version_major=$1
19902 db_version_minor=$2
19903 db_version_patch=$3
19905 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19909 : Remove db from list of libraries to use
19910 echo "Removing unusable -ldb from library list" >&4
19911 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19914 echo "libs = $libs" >&4
19924 : Check the return type needed for hash
19926 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19932 #include <sys/types.h>
19935 #ifndef DB_VERSION_MAJOR
19936 u_int32_t hash_cb (const void* ptr, size_t size)
19942 info.hash = hash_cb;
19946 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19947 if $contains warning try.out >>/dev/null 2>&1 ; then
19950 db_hashtype='u_int32_t'
19953 : XXX Maybe we should just give up here.
19954 db_hashtype=u_int32_t
19956 echo "Help: I can't seem to compile the db test program." >&4
19957 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19960 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19962 *) db_hashtype=u_int32_t
19967 : Check the return type needed for prefix
19969 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19975 #include <sys/types.h>
19978 #ifndef DB_VERSION_MAJOR
19979 size_t prefix_cb (const DBT *key1, const DBT *key2)
19985 info.prefix = prefix_cb;
19989 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19990 if $contains warning try.out >>/dev/null 2>&1 ; then
19991 db_prefixtype='int'
19993 db_prefixtype='size_t'
19996 db_prefixtype='size_t'
19997 : XXX Maybe we should just give up here.
19999 echo "Help: I can't seem to compile the db test program." >&4
20000 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20003 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20005 *) db_prefixtype='size_t'
20009 : Include . in @INC
20012 Historically Perl has provided a final fallback of the current working
20013 directory '.' when searching for a library. This, however, can lead to
20014 problems when a Perl program which loads optional modules is called from
20015 a shared directory. This can lead to executing unexpected code.
20019 # When changing to exclude by default:
20020 case "$default_inc_excludes_dot" in
20021 $undef|false|[nN]*) dflt="n" ;;
20024 # To turn exclude off by default:
20025 #case "$default_inc_excludes_dot" in
20026 # $define|true|[yY]*) dflt="y" ;;
20030 rp='Exclude '.' from @INC by default? '
20033 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20034 *) default_inc_excludes_dot="$define" ;;
20037 : Check what kind of inf/nan your system has
20038 $echo "Checking the kind of infinities and nans you have..." >&4
20039 $echo "(The following tests may crash. That's okay.)" >&4
20041 #define DOUBLESIZE $doublesize
20042 #$d_longdbl HAS_LONG_DOUBLE
20043 #ifdef HAS_LONG_DOUBLE
20044 #define LONG_DOUBLESIZE $longdblsize
20045 #define LONG_DOUBLEKIND $longdblkind
20048 #include <string.h>
20050 /* Note that whether the sign bit is on or off
20051 * for NaN depends on the CPU/FPU, and possibly
20052 * can be affected by the build toolchain.
20054 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20055 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20056 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20057 * (respectively) as opposed to the more usual
20058 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20060 * Pre-IEEE-754 floating point format do not even have inf/nan support
20061 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20062 * to even mention, causing immediate SIGFPE or equivalent: this is
20063 * the case with VAX floating point, for example.
20065 static void bytes(void *v, unsigned int n) {
20066 unsigned char *p = (unsigned char *)v;
20068 for (i = 0; i < n; i++) {
20069 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20072 int main(int argc, char *argv[]) {
20073 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20074 * because some compilers are 'smart' and not only warn but refuse to
20075 * compile such 'illegal' values. */
20076 double dinf = exp(1e9);
20077 double dnan = sqrt(-1.0);
20078 #ifdef HAS_LONG_DOUBLE
20079 long double ldinf = (long double)exp(1e9);
20080 long double ldnan = (long double)sqrt(-1.0);
20081 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20082 /* the 80-bit long doubles might have garbage in their excess bytes */
20083 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20084 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20087 switch (argv[1][0]) {
20088 case '1': bytes(&dinf, sizeof(dinf)); break;
20089 case '2': bytes(&dnan, sizeof(dnan)); break;
20090 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20091 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20099 if eval $compile; then
20100 doubleinfbytes=`$run ./try 1`
20101 doublenanbytes=`$run ./try 2`
20102 case "$d_longdbl" in
20104 longdblinfbytes=`$run ./try 3`
20105 longdblnanbytes=`$run ./try 4`
20109 # Defaults in case the above test program failed.
20110 case "$doublekind" in
20111 1) # IEEE 754 32-bit LE
20112 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20113 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20115 2) # IEEE 754 32-bit BE
20116 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20117 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20119 3) # IEEE 754 64-bit LE
20120 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20121 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20123 4) # IEEE 754 64-bit BE
20124 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20125 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20127 5) # IEEE 754 128-bit LE
20128 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20129 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20131 6) # IEEE 754 128-bit BE
20132 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20133 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20135 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20136 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20137 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20139 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20140 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20141 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20143 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20144 doubleinfbytes=$undef
20145 doublenanbytes=$undef
20148 doubleinfbytes=$undef
20149 doublenanbytes=$undef
20152 case "$longdblkind" in
20153 1) # IEEE 754 128-bit LE
20154 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20155 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20157 2) # IEEE 754 128-bit BE
20158 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20159 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20161 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20162 case "$longdblsize" in
20163 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20164 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20165 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20168 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20169 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20172 longdblinfbytes=$undef
20173 longdblnanbytes=$undef
20177 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20178 case "$longdblsize" in
20179 12) # 32-bit system
20180 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20181 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20183 16) # 64-bit system
20184 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20185 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20188 longdblinfbytes=$undef
20189 longdblnanbytes=$undef
20193 5) # 128-bit LE-LE "double double"
20194 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20195 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20197 6) # 128-bit BE-BE "double double"
20198 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20199 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20201 7) # 128-bit LE-BE "double double"
20202 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20203 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20205 8) # 128-bit BE-LE "double double"
20206 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20207 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20209 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20210 longdblinfbytes=$undef
20211 longdblnanbytes=$undef
20214 longdblinfbytes=$undef
20215 longdblnanbytes=$undef
20219 # In case the program crashed the values are empty, turn them undef.
20220 case "$doubleinfbytes" in
20221 '') doubleinfbytes=$undef ;;
20223 case "$doublenanbytes" in
20224 '') doublenanbytes=$undef ;;
20226 case "$longdblinfbytes" in
20227 '') longdblinfbytes=$undef ;;
20229 case "$longdblnanbytes" in
20230 '') longdblnanbytes=$undef ;;
20234 : Check the length of the double mantissa
20235 $echo "Checking how many mantissa bits your doubles have..." >&4
20237 #$i_sunmath I_SUNMATH
20240 # include <sunmath.h>
20242 #ifdef DBL_MANT_DIG
20243 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20246 int main(int argc, char *argv[]) {
20248 printf("%d\n", BITS);
20254 if eval $compile; then
20255 doublemantbits=`$run ./try`
20257 doublemantbits="$undef"
20261 : Check the length of the longdouble mantissa
20262 $echo "Checking how many mantissa bits your long doubles have..." >&4
20264 #$i_sunmath I_SUNMATH
20267 # include <sunmath.h>
20269 #$d_longdbl HAS_LONG_DOUBLE
20270 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20271 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20272 /* This format has no implicit bit. Beware, however, that for
20273 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20274 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20275 * and the top bit must have been one since 387, zero is plain invalid.
20276 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20277 # define BITS LDBL_MANT_DIG
20278 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20279 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20280 * reason e.g. Irix thinks 107. But in any case, we want only
20281 * the number of real bits, the implicit bits are of no interest. */
20282 # define BITS 2 * (DBL_MANT_DIG - 1)
20284 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20288 int main(int argc, char *argv[]) {
20290 printf("%d\n", BITS);
20296 if eval $compile; then
20297 longdblmantbits=`$run ./try`
20299 longdblmantbits="$undef"
20303 : Check the length of the NV mantissa
20304 $echo "Checking how many mantissa bits your NVs have..." >&4
20305 if test "X$usequadmath" = "X$define"; then
20306 nvmantbits=112 # 128-1-15
20308 if test "X$nvsize" = "X$doublesize"; then
20309 nvmantbits="$doublemantbits"
20311 if test "X$nvsize" = "X$longdblsize"; then
20312 nvmantbits="$longdblmantbits"
20314 nvmantbits="$undef"
20319 : How can we generate normalized random numbers ?
20321 echo "Using our internal random number implementation..." >&4
20324 *-Dmy_rand=*|*-Dmy_srand=*)
20325 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20326 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20327 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20328 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20332 randfunc=Perl_drand48
20333 drand01="Perl_drand48()"
20334 seedfunc="Perl_drand48_init"
20338 : Probe whether dtrace builds an object, as newer Illumos requires an input
20339 : object file that uses at least one of the probes defined in the .d file
20340 case "$usedtrace" in
20342 case "$dtracexnolibs" in
20343 $define|true|[yY]*)
20344 dtracexnolibs=$define
20345 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20348 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20349 dtracexnolibs=$define
20350 echo "Your dtrace accepts -xnolibs"
20351 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20352 dtracexnolibs=$undef
20353 echo "Your dtrace doesn't accept -xnolibs"
20355 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20360 dtracexnolibs=$undef
20361 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20364 case $dtracexnolibs in
20365 $define) xnolibs=-xnolibs ;;
20369 case "$dtraceobject" in
20370 $define|true|[yY]*)
20371 dtraceobject=$define
20375 #include "perldtrace.h"
20377 PERL_LOADED_FILE("dummy");
20381 dtraceobject=$undef
20382 if $cc -c -o try.o $optimize $ccflags try.c \
20383 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20384 dtraceobject=$define
20385 echo "Your dtrace builds an object file"
20388 *) dtraceobject=$undef ;;
20390 $rm_try perldtrace.o perldtrace.h
20393 : Determine if this is an EBCDIC system
20395 echo "Determining whether or not we are on an EBCDIC system..." >&4
20396 $cat >try.c <<'EOM'
20399 if ('M'==0xd4) return 0;
20406 if eval $compile_ok; then
20407 if $run ./try; then
20408 echo "You seem to speak EBCDIC." >&4
20411 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20414 echo "I'm unable to compile the test program." >&4
20415 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20421 : Check how to flush
20424 Checking how to flush all pending stdio output...
20426 # I only know how to find the first 32 possibly open files on SunOS.
20427 # See also hints/sunos_4_1.sh and util.c --AD
20429 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20431 $cat >>try.c <<EOCP
20433 #$i_stdlib I_STDLIB
20435 #include <stdlib.h>
20437 #$i_unistd I_UNISTD
20439 # include <unistd.h>
20441 #$d_sysconf HAS_SYSCONF
20442 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20443 #ifdef HAS_STDIO_STREAM_ARRAY
20444 # define STDIO_STREAM_ARRAY $stdio_stream_array
20449 p = fopen("try.out", "w");
20453 # ifdef TRY_FPRINTF
20457 #ifdef TRY_FFLUSH_NULL
20460 #ifdef TRY_FFLUSH_ALL
20462 long open_max = -1;
20463 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20464 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20466 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20467 open_max = sysconf(_SC_OPEN_MAX);
20470 open_max = FOPEN_MAX;
20473 open_max = OPEN_MAX;
20482 # ifdef HAS_STDIO_STREAM_ARRAY
20483 if (open_max > 0) {
20485 for (i = 0; i < open_max; i++)
20486 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20487 STDIO_STREAM_ARRAY[i]._file < open_max &&
20488 STDIO_STREAM_ARRAY[i]._flag)
20489 fflush(&STDIO_STREAM_ARRAY[i]);
20497 : first we have to find out how _not_ to flush
20499 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20501 set try -DTRY_FPUTC
20502 if eval $compile; then
20503 $run ./try 2>/dev/null
20506 if $test ! -s try.out -a "X$code" = X42; then
20512 set try -DTRY_FPRINTF
20513 if eval $compile; then
20514 $run ./try 2>/dev/null
20517 if $test ! -s try.out -a "X$code" = X42; then
20518 output=-DTRY_FPRINTF
20524 : check for fflush NULL behavior
20525 case "$fflushNULL" in
20526 '') set try -DTRY_FFLUSH_NULL $output
20527 if eval $compile; then
20528 $run ./try 2>/dev/null
20531 if $test -s try.out -a "X$code" = X42; then
20532 fflushNULL="`$cat try.out`"
20534 if $test "X$code" != X42; then
20536 (If this test failed, don't worry, we'll try another method shortly.)
20541 $rm -f core try.core core.try.*
20542 case "$fflushNULL" in
20544 Your fflush(NULL) works okay for output streams.
20545 Let's see if it clobbers input pipes...
20547 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20548 # bug that improperly flushes the input end of pipes. So we avoid the
20549 # autoflush on fork/system/exec support for now. :-(
20550 $cat >tryp.c <<EOCP
20553 main(int argc, char **argv)
20559 while ((i = getc(stdin)) != -1
20560 && (*bp++ = i) != '\n'
20561 && bp < &buf[1024])
20564 fprintf(stdout, "%s", buf);
20572 fflushNULL="$define"
20574 if eval $compile; then
20576 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20577 if $test "X$targethost" != X; then
20580 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20582 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20584 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20586 fflush(NULL) seems to behave okay with input streams.
20588 fflushNULL="$define"
20591 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20593 fflushNULL="$undef"
20596 $rm -f core tryp.c tryp.core core.tryp.*
20599 Your fflush(NULL) isn't working (contrary to ANSI C).
20601 fflushNULL="$undef"
20604 Cannot figure out whether your fflush(NULL) works or not.
20605 I'm assuming it doesn't (contrary to ANSI C).
20607 fflushNULL="$undef"
20611 $define|true|[yY]*)
20612 fflushNULL="$define"
20615 fflushNULL="$undef"
20618 : check explicit looping only if NULL did not work, and if the pipe
20619 : bug does not show up on an explicit flush too
20620 case "$fflushNULL" in
20622 $cat >tryp.c <<EOCP
20625 main(int argc, char **argv)
20631 while ((i = getc(stdin)) != -1
20632 && (*bp++ = i) != '\n'
20633 && bp < &buf[1024])
20636 fprintf(stdout, "%s", buf);
20645 if eval $compile; then
20647 if $test "X$targethost" != X; then
20650 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20652 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20654 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20656 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20658 : now check for fflushall behaviour
20659 case "$fflushall" in
20660 '') set try -DTRY_FFLUSH_ALL $output
20661 if eval $compile; then
20663 (Now testing the other method--but note that this also may fail.)
20665 $run ./try 2>/dev/null
20668 if $test -s try.out -a "X$code" = X42; then
20669 fflushall="`$cat try.out`"
20673 case "$fflushall" in
20675 Whew. Flushing explicitly all the stdio streams works.
20677 fflushall="$define"
20680 Sigh. Flushing explicitly all the stdio streams doesn't work.
20685 Cannot figure out whether flushing stdio streams explicitly works or not.
20686 I'm assuming it doesn't.
20692 "$define"|true|[yY]*)
20693 fflushall="$define"
20701 All is futile. Even fflush(stdin) clobbers input pipes!
20708 $rm -f core tryp.c tryp.core core.tryp.*
20710 *) fflushall="$undef"
20714 case "$fflushNULL$fflushall" in
20717 OK, I give up. I cannot figure out how to flush pending stdio output.
20718 We won't be flushing handles at all before fork/exec/popen.
20724 : Store the full pathname to the ar program for use in the C program
20725 : Respect a hint or command line value for full_ar.
20730 : Store the full pathname to the sed program for use in the C program
20733 : see what type gids are declared as in the kernel
20735 echo "Looking for the type for group ids returned by getgid()."
20736 set gid_t gidtype xxx stdio.h sys/types.h
20740 xxx=`./findhdr sys/user.h`
20741 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20743 unsigned) dflt="$1 $2" ;;
20747 *) dflt="$gidtype";;
20750 gid_t) echo "gid_t found." ;;
20751 *) rp="What is the type for group ids returned by getgid()?"
20757 : Check the size of GID
20760 *_t) zzz="$gidtype" ;;
20763 echo "Checking the size of $zzz..." >&4
20765 #include <sys/types.h>
20767 #$i_stdlib I_STDLIB
20769 #include <stdlib.h>
20772 printf("%d\n", (int)sizeof($gidtype));
20777 if eval $compile_ok; then
20781 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20784 echo "Your $zzz is $gidsize bytes long."
20789 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20792 : Check if GID is signed
20795 *_t) zzz="$gidtype" ;;
20798 echo "Checking the sign of $zzz..." >&4
20800 #include <sys/types.h>
20811 if eval $compile; then
20815 echo "(I can't execute the test program--guessing unsigned.)" >&4
20819 1) echo "Your $zzz is unsigned." ;;
20820 -1) echo "Your $zzz is signed." ;;
20826 echo "(I can't compile the test program--guessing unsigned.)" >&4
20829 : Check 64bit sizes
20832 if $test X"$quadtype" != X; then
20834 echo "Checking how to print 64-bit integers..." >&4
20836 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20837 $cat >try.c <<'EOCP'
20838 #include <sys/types.h>
20841 int q = 12345678901;
20842 printf("%ld\n", q);
20846 if eval $compile; then
20850 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20851 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20852 echo "We will use %d."
20858 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20859 $cat >try.c <<'EOCP'
20860 #include <sys/types.h>
20863 long q = 12345678901;
20864 printf("%ld\n", q);
20868 if eval $compile; then
20872 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20873 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20874 echo "We will use %ld."
20880 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20881 $cat >try.c <<'EOCP'
20882 #include <sys/types.h>
20883 #include <inttypes.h>
20886 int64_t q = 12345678901;
20887 printf("%" PRId64 "\n", q);
20891 if eval $compile; then
20895 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20896 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20897 echo "We will use the C9X style."
20903 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20905 #include <sys/types.h>
20908 $quadtype q = 12345678901;
20909 printf("%Ld\n", q);
20913 if eval $compile; then
20917 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20918 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20919 echo "We will use %Ld."
20925 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20926 $cat >try.c <<'EOCP'
20927 #include <sys/types.h>
20930 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20931 printf("%lld\n", q);
20935 if eval $compile; then
20939 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20940 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20941 echo "We will use the %lld style."
20947 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20949 #include <sys/types.h>
20952 $quadtype q = 12345678901;
20953 printf("%qd\n", q);
20957 if eval $compile; then
20961 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20962 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20963 echo "We will use %qd."
20969 if $test X"$sPRId64" = X; then
20970 echo "Cannot figure out how to print 64-bit integers." >&4
20977 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20978 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20980 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20981 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20985 : Check format strings for internal types
20987 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20989 if $test X"$ivsize" = X8; then
20990 ivdformat="$sPRId64"
20991 uvuformat="$sPRIu64"
20992 uvoformat="$sPRIo64"
20993 uvxformat="$sPRIx64"
20994 uvXUformat="$sPRIXU64"
20996 if $test X"$ivsize" = X"$longsize"; then
21003 if $test X"$ivsize" = X"$intsize"; then
21011 if $test X"$ivsize" = X"$shortsize"; then
21022 if $test X"$usequadmath" = X"$define"; then
21030 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21031 nveformat="$sPRIeldbl"
21032 nvfformat="$sPRIfldbl"
21033 nvgformat="$sPRIgldbl"
21034 nvEUformat="$sPRIEUldbl"
21035 nvFUformat="$sPRIFUldbl"
21036 nvGUformat="$sPRIGUldbl"
21047 case "$ivdformat" in
21048 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21053 : Check format string for GID
21056 $echo "Checking the format string to be used for gids..." >&4
21059 -1) if $test X"$gidsize" = X"$ivsize"; then
21060 gidformat="$ivdformat"
21062 if $test X"$gidsize" = X"$longsize"; then
21065 if $test X"$gidsize" = X"$intsize"; then
21068 if $test X"$gidsize" = X"$shortsize"; then
21075 *) if $test X"$gidsize" = X"$uvsize"; then
21076 gidformat="$uvuformat"
21078 if $test X"$gidsize" = X"$longsize"; then
21081 if $test X"$gidsize" = X"$intsize"; then
21084 if $test X"$gidsize" = X"$shortsize"; then
21093 : see if getgroups exists
21094 set getgroups d_getgrps
21097 : see if setgroups exists
21098 set setgroups d_setgrps
21101 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21103 case "$d_getgrps$d_setgrps" in
21105 case "$groupstype" in
21106 '') dflt="$gidtype" ;;
21107 *) dflt="$groupstype" ;;
21110 What type of pointer is the second argument to getgroups() and setgroups()?
21111 Usually this is the same as group ids, $gidtype, but not always.
21114 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21118 *) groupstype="$gidtype";;
21121 : check whether make sets MAKE
21123 echo "Checking if your $make program sets \$(MAKE)..." >&4
21124 case "$make_set_make" in
21126 $sed 's/^X //' > testmake.mak << 'EOF'
21128 X @echo 'maketemp="$(MAKE)"'
21130 case "`$make -f testmake.mak 2>/dev/null`" in
21131 *maketemp=*) make_set_make='#' ;;
21132 *) make_set_make="MAKE=$make" ;;
21134 $rm -f testmake.mak
21137 case "$make_set_make" in
21138 '#') echo "Yup, it does.";;
21139 *) echo "Nope, it doesn't.";;
21142 : see what type is used for mode_t
21143 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21144 set mode_t modetype int stdio.h sys/types.h
21147 : see if we need va_copy
21150 #include <stdarg.h>
21152 #include <stdlib.h>
21153 #include <signal.h>
21156 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21158 return vfprintf(f, fmt, *valp);
21162 myvfprintf(FILE *f, const char *fmt, va_list val)
21164 return ivfprintf(f, fmt, &val);
21168 myprintf(char *fmt, ...)
21171 va_start(val, fmt);
21172 return myvfprintf(stdout, fmt, val);
21176 main(int ac, char **av)
21178 signal(SIGSEGV, exit);
21180 myprintf("%s%cs all right, then\n", "that", '\'');
21185 if eval $compile && $run ./try 2>&1 >/dev/null; then
21186 case "`$run ./try`" in
21187 "that's all right, then")
21193 yes) echo "It seems that you don't need va_copy()." >&4
21194 need_va_copy="$undef"
21196 *) echo "It seems that va_copy() or similar will be needed." >&4
21197 need_va_copy="$define"
21202 : see what type is used for size_t
21203 rp="What is the type used for the length parameter for string functions?"
21204 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21207 : check for type of arguments to gethostbyaddr.
21208 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21209 case "$d_gethbyaddr" in
21213 Checking to see what type of arguments are accepted by gethostbyaddr().
21215 hdrs="$define sys/types.h
21216 $d_socket sys/socket.h
21217 $i_niin netinet/in.h
21219 $i_unistd unistd.h"
21220 : The first arg can 'char *' or 'void *'
21221 : The second arg is some of integral type
21222 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21223 for yyy in size_t long int; do
21224 case "$netdb_host_type" in
21225 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21226 if ./protochk "$try" $hdrs; then
21227 echo "Your system accepts $xxx for the first arg."
21228 echo "...and $yyy for the second arg."
21229 netdb_host_type="$xxx"
21230 netdb_hlen_type="$yyy"
21236 : In case none of those worked, prompt the user.
21237 case "$netdb_host_type" in
21238 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21241 netdb_host_type=$ans
21242 rp='What is the type for the 2nd argument to gethostbyaddr?'
21245 netdb_hlen_type=$ans
21249 *) : no gethostbyaddr, so pick harmless defaults
21250 netdb_host_type='char *'
21251 netdb_hlen_type="$sizetype"
21254 # Remove the "const" if needed. -- but then we'll have a
21256 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21259 : check for type of argument to gethostbyname.
21260 if test "X$netdb_name_type" = X ; then
21261 case "$d_gethbyname" in
21265 Checking to see what type of argument is accepted by gethostbyname().
21267 hdrs="$define sys/types.h
21268 $d_socket sys/socket.h
21269 $i_niin netinet/in.h
21271 $i_unistd unistd.h"
21272 for xxx in "const char *" "char *"; do
21273 case "$netdb_name_type" in
21274 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21275 if ./protochk "$try" $hdrs; then
21276 echo "Your system accepts $xxx."
21277 netdb_name_type="$xxx"
21282 : In case none of those worked, prompt the user.
21283 case "$netdb_name_type" in
21284 '') rp='What is the type for the 1st argument to gethostbyname?'
21287 netdb_name_type=$ans
21291 *) : no gethostbyname, so pick harmless default
21292 netdb_name_type='char *'
21297 : check for type of 1st argument to getnetbyaddr.
21298 if test "X$netdb_net_type" = X ; then
21299 case "$d_getnbyaddr" in
21303 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21305 hdrs="$define sys/types.h
21306 $d_socket sys/socket.h
21307 $i_niin netinet/in.h
21309 $i_unistd unistd.h"
21310 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21311 case "$netdb_net_type" in
21312 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21313 if ./protochk "$try" $hdrs; then
21314 echo "Your system accepts $xxx."
21315 netdb_net_type="$xxx"
21320 : In case none of those worked, prompt the user.
21321 case "$netdb_net_type" in
21322 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21325 netdb_net_type=$ans
21329 *) : no getnetbyaddr, so pick harmless default
21330 netdb_net_type='long'
21334 : locate the preferred pager for this system
21341 [a-zA-Z]:/*) dflt=$pg;;
21345 [a-zA-Z]:/*) dflt=$more;;
21349 [a-zA-Z]:/*) dflt=$less;;
21352 '') dflt=/usr/ucb/more;;
21360 rp='What pager is used on your system?'
21364 : see if ar generates random libraries by itself
21366 echo "Checking how to generate random libraries on your machine..." >&4
21367 echo 'int bar1() { return bar2(); }' > bar1.c
21368 echo 'int bar2() { return 2; }' > bar2.c
21370 #$i_stdlib I_STDLIB
21372 #include <stdlib.h>
21374 int main() { printf("%d\n", bar1()); exit(0); }
21376 $cc $ccflags -c bar1.c >/dev/null 2>&1
21377 $cc $ccflags -c bar2.c >/dev/null 2>&1
21378 $cc $ccflags -c foo.c >/dev/null 2>&1
21379 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21380 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21381 $run ./foobar >/dev/null 2>&1; then
21382 echo "$ar appears to generate random libraries itself."
21384 if [ "X$ranlib" = "X" ]; then
21387 elif $ar s bar$_a >/dev/null 2>&1 &&
21388 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21389 $run ./foobar >/dev/null 2>&1; then
21390 echo "a table of contents needs to be added with '$ar s'."
21393 elif $ar ts bar$_a >/dev/null 2>&1 &&
21394 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21395 $run ./foobar >/dev/null 2>&1; then
21396 echo "a table of contents needs to be added with '$ar ts'."
21403 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21404 $test -f $ranlib || ranlib=''
21407 if $test -n "$ranlib"; then
21408 echo "your system has '$ranlib'; we'll use that."
21411 echo "your system doesn't seem to support random libraries"
21412 echo "so we'll use lorder and tsort to order the libraries."
21419 : Check the max offset that gmtime and localtime accept
21420 echo "Checking max offsets that gmtime () accepts"
21422 case "$sGMTIME_min/$sGMTIME_max" in
21425 #include <sys/types.h>
21433 void gm_check (time_t t, int min_year, int max_year)
21436 if ( tmp == NULL ||
21437 /* Check tm_year overflow */
21438 tmp->tm_year < min_year || tmp->tm_year > max_year)
21449 gm_check (MAXLONG, 69, 0x7fffffff);
21451 if (tmp == NULL || tmp->tm_year < 0) {
21452 for (i = 63; i >= 0; i--) {
21453 time_t x = pt | ((time_t)1 << i);
21454 if (x < 0 || x < pt) continue;
21455 gm_check (x, 69, 0x7fffffff);
21458 printf ("sGMTIME_max=%ld\n", pt);
21467 gm_check (MINLONG, -1900, 70);
21470 for (i = 36; i >= 0; i--) {
21471 time_t x = pt - ((time_t)1 << i);
21472 if (x > 0) continue;
21473 gm_check (x, -1900, 70);
21476 printf ("sGMTIME_min=%ld\n", pt);
21480 int main (int argc, char *argv[])
21482 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21489 if eval $compile; then
21490 eval `$run ./try 2>/dev/null`
21492 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21498 echo "Checking max offsets that localtime () accepts"
21500 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21503 #include <sys/types.h>
21511 void local_check (time_t t, int min_year, int max_year)
21513 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21516 tmp = localtime (&t);
21517 if ( tmp == NULL ||
21518 /* Check tm_year overflow */
21519 tmp->tm_year < min_year || tmp->tm_year > max_year)
21523 } /* local_check */
21530 local_check (MAXLONG, 69, 0x7fffffff);
21532 if (tmp == NULL || tmp->tm_year < 0) {
21533 for (i = 63; i >= 0; i--) {
21534 time_t x = pt | ((time_t)1 << i);
21535 if (x < 0 || x < pt) continue;
21536 local_check (x, 69, 0x7fffffff);
21539 printf ("sLOCALTIME_max=%ld\n", pt);
21548 local_check (MINLONG, -1900, 70);
21551 for (i = 36; i >= 0; i--) {
21552 time_t x = pt - ((time_t)1 << i);
21553 if (x > 0) continue;
21554 local_check (x, -1900, 70);
21557 printf ("sLOCALTIME_min=%ld\n", pt);
21561 int main (int argc, char *argv[])
21569 if eval $compile; then
21570 eval `$run ./try 2>/dev/null`
21572 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21578 : check for type of arguments to select.
21579 case "$selecttype" in
21580 '') case "$d_select" in
21584 Checking to see what type of arguments are accepted by select().
21586 hdrs="$define sys/types.h
21587 $i_systime sys/time.h
21588 $i_sysselct sys/select.h
21589 $d_socket sys/socket.h"
21590 : The first arg can be int, unsigned, or size_t
21591 : The last arg may or may not be 'const'
21593 : void pointer has been seen but using that
21594 : breaks the selectminbits test
21595 for xxx in 'fd_set *' 'int *'; do
21596 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21597 for tmo in 'struct timeval *' 'const struct timeval *'; do
21599 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21600 if ./protochk "$try" $hdrs; then
21601 echo "Your system accepts $xxx."
21610 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21611 case "$d_fd_set" in
21612 $define) dflt="fd_set *" ;;
21621 *) : no select, so pick a harmless default
21628 : check for the select 'width'
21629 case "$selectminbits" in
21630 '') safebits=`expr $ptrsize \* 8`
21631 case "$d_select" in
21635 Checking to see on how many bits at a time your select() operates...
21638 #include <sys/types.h>
21640 #$i_systime I_SYS_TIME
21641 #$i_systimek I_SYS_TIME_KERNEL
21646 # ifdef I_SYS_TIME_KERNEL
21649 # include <sys/time.h>
21650 # ifdef I_SYS_TIME_KERNEL
21654 #$i_sysselct I_SYS_SELECT
21655 #ifdef I_SYS_SELECT
21656 #include <sys/select.h>
21658 #$d_socket HAS_SOCKET
21660 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21663 #$i_stdlib I_STDLIB
21665 #include <stdlib.h>
21668 #define S sizeof(*(b))
21670 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21671 #define NBITS (NBYTES * 8)
21673 char *s = (char *)malloc(NBYTES);
21682 fp = fopen("try.c", "r");
21688 b = ($selecttype)s;
21689 for (i = 0; i < NBITS; i++)
21693 select(fd + 1, b, 0, 0, &t);
21694 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21696 printf("%d\n", i + 1);
21701 if eval $compile_ok; then
21702 selectminbits=`$run ./try 2>/dev/null`
21703 case "$selectminbits" in
21705 Cannot figure out on how many bits at a time your select() operates.
21706 I'll play safe and guess it is $safebits bits.
21708 selectminbits=$safebits
21709 bits="$safebits bits"
21712 *) bits="$selectminbits bits" ;;
21714 echo "Your select() operates on $bits at a time." >&4
21716 rp='What is the minimum number of bits your select() operates on?'
21717 case "$byteorder" in
21718 12345678) dflt=64 ;;
21724 selectminbits="$val"
21728 *) : no select, so pick a harmless default
21729 selectminbits=$safebits
21735 : Trace out the files included by signal.h, then look for SIGxxx names.
21736 case "$sig_num_init" in
21738 if [ "X$fieldn" = X ]; then
21739 : Just make some guesses. We check them later.
21740 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21742 xxx=`echo '#include <signal.h>' |
21743 $cppstdin $cppminus $cppflags 2>/dev/null |
21744 $grep '^[ ]*#.*include' |
21745 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21746 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21749 for xx in $xxx /dev/null ; do
21750 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21752 case "$xxxfiles" in
21753 '') xxxfiles=`./findhdr signal.h` ;;
21756 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21757 print substr($2, 4, 20)
21759 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21760 print substr($3, 4, 20)
21762 : Append some common names just in case the awk scan failed.
21763 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21764 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21765 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21766 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21767 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21769 : generate a few handy files for later
21770 $cat > signal.c <<EOCP
21771 #include <sys/types.h>
21772 #include <signal.h>
21773 #$i_stdlib I_STDLIB
21775 #include <stdlib.h>
21780 /* Strange style to avoid deeply-nested #if/#else/#endif */
21783 # define NSIG (_NSIG)
21789 # define NSIG (SIGMAX+1)
21795 # define NSIG (SIG_MAX+1)
21801 # define NSIG (_SIG_MAX+1)
21807 # define NSIG (MAXSIG+1)
21813 # define NSIG (MAX_SIG+1)
21818 # ifdef SIGARRAYSIZE
21819 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21825 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21829 /* Default to some arbitrary number that's big enough to get most
21830 of the common signals.
21836 printf("NSIG %d\n", NSIG);
21842 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21844 printf "#ifdef SIG"; printf $1; printf "\n"
21845 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21846 printf $1; printf ");\n"
21850 printf "#endif /* JUST_NSIG */\n";
21851 printf "exit(0);\n}\n";
21854 $cat >signal.awk <<'EOP'
21855 BEGIN { ndups = 0 }
21856 $1 ~ /^NSIG$/ { nsig = $2 }
21857 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21858 if ($2 > maxsig) { maxsig = $2 }
21859 if (sig_name[$2]) {
21860 dup_name[ndups] = $1
21861 dup_num[ndups] = $2
21873 printf("NSIG %d\n", nsig);
21874 for (n = 1; n < nsig; n++) {
21876 printf("%s %d\n", sig_name[n], sig_num[n])
21879 printf("NUM%d %d\n", n, n)
21882 for (n = 0; n < ndups; n++) {
21883 printf("%s %d\n", dup_name[n], dup_num[n])
21887 $cat >signal_cmd <<EOS
21889 if $test -s signal.lst; then
21890 echo "Using your existing signal.lst file"
21895 $cat >>signal_cmd <<'EOS'
21898 if eval $compile_ok; then
21899 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21900 $uniq | $awk -f signal.awk >signal.lst
21902 echo "(I can't seem be able to compile the whole test program)" >&4
21903 echo "(I'll try it in little pieces.)" >&4
21904 set signal -DJUST_NSIG
21905 if eval $compile_ok; then
21906 $run ./signal$_exe > signal.nsg
21909 echo "I can't seem to figure out how many signals you have." >&4
21910 echo "Guessing 50." >&4
21911 echo 'NSIG 50' > signal.nsg
21913 : Now look at all the signal names, one at a time.
21914 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21915 $cat > signal.c <<EOCP
21916 #include <sys/types.h>
21917 #include <signal.h>
21920 printf("$xx %d\n", SIG${xx});
21925 if eval $compile; then
21926 echo "SIG${xx} found."
21927 $run ./signal$_exe >> signal.ls1
21929 echo "SIG${xx} NOT found."
21932 if $test -s signal.ls1; then
21933 $cat signal.nsg signal.ls1 |
21934 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21938 if $test -s signal.lst; then
21941 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21942 echo 'kill -l' >signal
21943 set X `csh -f <signal`
21947 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21949 echo $@ | $tr ' ' $trnl | \
21950 $awk '{ printf "%s %d\n", $1, ++s; }
21951 END { printf "NSIG %d\n", ++s }' >signal.lst
21953 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21955 chmod a+x signal_cmd
21956 $eunicefix signal_cmd
21960 : generate list of signal names
21961 case "$sig_num_init" in
21964 case "$sig_name_init" in
21966 *) case "$sig_num_init" in
21967 ''|*,*) doinit=yes ;;
21972 echo "Generating a list of signal names and numbers..." >&4
21974 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21975 sig_name=`$awk 'BEGIN { printf "ZERO " }
21976 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21977 sig_num=`$awk 'BEGIN { printf "0 " }
21978 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21979 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21980 !/^NSIG/ { printf "\"%s\", ", $1 }
21981 END { printf "0\n" }' signal.lst`
21982 sig_num_init=`$awk 'BEGIN { printf "0, " }
21983 !/^NSIG/ { printf "%d, ", $2}
21984 END { printf "0\n"}' signal.lst`
21987 echo "The following $sig_count signals are available:"
21989 echo $sig_name | $awk \
21990 'BEGIN { linelen = 0 }
21992 for (i = 1; i <= NF; i++) {
21993 name = "SIG" $i " "
21994 linelen = linelen + length(name)
21995 if (linelen > 70) {
21997 linelen = length(name)
22003 sig_size=`echo $sig_name | awk '{print NF}'`
22004 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22008 : Check size of size
22010 case "$sizetype" in
22011 *_t) zzz="$sizetype" ;;
22012 *) zzz="filesize" ;;
22014 echo "Checking the size of $zzz..." >&4
22016 #include <sys/types.h>
22018 #$i_stdlib I_STDLIB
22020 #include <stdlib.h>
22023 printf("%d\n", (int)sizeof($sizetype));
22028 if eval $compile_ok; then
22032 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22035 echo "Your $zzz size is $sizesize bytes."
22040 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22043 : check for socklen_t
22045 echo "Checking to see if you have socklen_t..." >&4
22047 #include <sys/types.h>
22048 #$d_socket HAS_SOCKET
22050 #include <sys/socket.h>
22052 int main() { socklen_t x = 16; }
22055 if eval $compile; then
22057 echo "You have socklen_t."
22060 echo "You do not have socklen_t."
22061 case "$sizetype" in
22062 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22069 : see if this is a socks.h system
22070 set socks.h i_socks
22073 : check for type of the size argument to socket calls
22074 case "$d_socket" in
22078 Checking to see what type is the last argument of accept().
22081 case "$d_socklen_t" in
22082 "$define") yyy="$yyy socklen_t"
22084 yyy="$yyy $sizetype int long unsigned"
22085 for xxx in $yyy; do
22086 case "$socksizetype" in
22087 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22088 case "$usesocks" in
22090 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22091 echo "Your system accepts '$xxx *' for the last argument of accept()."
22092 socksizetype="$xxx"
22095 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22096 echo "Your system accepts '$xxx *' for the last argument of accept()."
22097 socksizetype="$xxx"
22104 : In case none of those worked, prompt the user.
22105 case "$socksizetype" in
22106 '') rp='What is the type for socket address structure sizes?'
22113 *) : no sockets, so pick relatively harmless default
22118 : see what type is used for signed size_t
22119 set ssize_t ssizetype int stdio.h sys/types.h
22124 #$i_stdlib I_STDLIB
22126 #include <stdlib.h>
22128 #include <sys/types.h>
22129 #define Size_t $sizetype
22130 #define SSize_t $dflt
22133 if (sizeof(Size_t) == sizeof(SSize_t))
22135 else if (sizeof(Size_t) == sizeof(int))
22144 if eval $compile_ok && $run ./try > /dev/null; then
22145 ssizetype=`$run ./try`
22146 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22149 Help! I can't compile and run the ssize_t test program: please enlighten me!
22150 (This is probably a misconfiguration in your system or libraries, and
22151 you really ought to fix it. Still, I'll try anyway.)
22153 I need a type that is the same size as $sizetype, but is guaranteed to
22154 be signed. Common values are ssize_t, int and long.
22157 rp="What signed type is the same size as $sizetype?"
22163 : Check the size of st_ino
22165 $echo "Checking the size of st_ino..." >&4
22166 $cat > try.c <<EOCP
22167 #include <sys/stat.h>
22169 #$i_stdlib I_STDLIB
22171 #include <stdlib.h>
22175 printf("%d\n", (int)sizeof(st.st_ino));
22180 if eval $compile_ok; then
22184 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22186 *) st_ino_size=$val
22187 $echo "Your st_ino is $st_ino_size bytes long."
22192 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22196 : Check if st_ino is signed
22198 $echo "Checking the sign of st_ino..." >&4
22199 $cat > try.c <<EOCP
22200 #include <sys/stat.h>
22205 if (foo.st_ino < 0)
22212 if eval $compile; then
22216 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22218 *) st_ino_sign=$val
22219 case "$st_ino_sign" in
22220 1) $echo "Your st_ino is unsigned." ;;
22221 -1) $echo "Your st_ino is signed." ;;
22227 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22231 : see what type of char stdio uses.
22233 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22234 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22235 echo "Your stdio uses unsigned chars." >&4
22236 stdchar="unsigned char"
22238 echo "Your stdio uses signed chars." >&4
22243 : Check size of UID
22246 *_t) zzz="$uidtype" ;;
22249 echo "Checking the size of $zzz..." >&4
22251 #include <sys/types.h>
22253 #$i_stdlib I_STDLIB
22255 #include <stdlib.h>
22258 printf("%d\n", (int)sizeof($uidtype));
22263 if eval $compile_ok; then
22267 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22270 echo "Your $zzz is $uidsize bytes long."
22275 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22278 : Check if UID is signed
22281 *_t) zzz="$uidtype" ;;
22284 echo "Checking the sign of $zzz..." >&4
22286 #include <sys/types.h>
22297 if eval $compile; then
22301 echo "(I can't execute the test program--guessing unsigned.)" >&4
22305 1) echo "Your $zzz is unsigned." ;;
22306 -1) echo "Your $zzz is signed." ;;
22312 echo "(I can't compile the test program--guessing unsigned.)" >&4
22315 : Check format string for UID
22317 $echo "Checking the format string to be used for uids..." >&4
22320 -1) if $test X"$uidsize" = X"$ivsize"; then
22321 uidformat="$ivdformat"
22323 if $test X"$uidsize" = X"$longsize"; then
22326 if $test X"$uidsize" = X"$intsize"; then
22329 if $test X"$uidsize" = X"$shortsize"; then
22336 *) if $test X"$uidsize" = X"$uvsize"; then
22337 uidformat="$uvuformat"
22339 if $test X"$uidsize" = X"$longsize"; then
22342 if $test X"$uidsize" = X"$intsize"; then
22345 if $test X"$uidsize" = X"$shortsize"; then
22354 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22356 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22357 $cat >try.c <<'EOM'
22358 /* Intentionally a long probe as I'd like to sanity check that the exact
22359 approach is going to work, as thinking it will work, but only having it
22360 part working at runtime is worse than not having it. */
22362 #include <sys/types.h>
22363 #include <sys/sysctl.h>
22364 #include <sys/param.h>
22366 #include <string.h>
22367 #include <stdlib.h>
22368 #include <unistd.h>
22371 main(int argc, char **argv) {
22373 char *argv_leaf = strrchr(argv[0], '/');
22379 mib[1] = KERN_PROC;
22380 mib[2] = KERN_PROC_PATHNAME;
22384 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22388 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22393 if (size < strlen(argv_leaf) + 1) {
22394 fprintf(stderr, "size %lu is too short for a path\n",
22395 (unsigned long) size);
22399 if (size > MAXPATHLEN * MAXPATHLEN) {
22400 fprintf(stderr, "size %lu is too long for a path\n",
22401 (unsigned long) size);
22405 buffer = (char *)malloc(size);
22411 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22416 if (strlen(buffer) + 1 != size) {
22417 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22418 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22423 if (*buffer != '/') {
22424 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22428 if (strstr(buffer, "/./")) {
22429 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22433 if (strstr(buffer, "/../")) {
22434 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22438 buffer_leaf = strrchr(buffer, '/');
22439 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22440 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22452 if eval $compile; then
22453 if $run ./try; then
22454 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22457 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22461 echo "I'm unable to compile the test program." >&4
22462 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22466 set usekernprocpathname
22469 : Determine if we can use _NSGetExecutablePath to find executing program
22471 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22472 $cat >try.c <<'EOM'
22473 /* Intentionally a long probe as I'd like to sanity check that the exact
22474 approach is going to work, as thinking it will work, but only having it
22475 part working at runtime is worse than not having it. */
22476 #include <mach-o/dyld.h>
22478 #include <stdlib.h>
22479 #include <sys/param.h>
22480 #include <string.h>
22483 main(int argc, char **argv) {
22485 uint32_t size = sizeof(buf);
22489 char *argv_leaf = strrchr(argv[0], '/');
22493 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22497 _NSGetExecutablePath(buf, &size);
22498 if (size > MAXPATHLEN * MAXPATHLEN) {
22499 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22500 (unsigned int) size);
22504 buffer = (char *)malloc(size);
22510 result = _NSGetExecutablePath(buffer, &size);
22512 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22513 result, (unsigned int) size);
22517 tidied = realpath(buffer, NULL);
22519 perror("realpath");
22525 if (*tidied != '/') {
22526 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22530 if (strstr(tidied, "/./")) {
22531 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22535 if (strstr(tidied, "/../")) {
22536 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22540 tidied_leaf = strrchr(tidied, '/');
22541 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22542 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22554 if eval $compile; then
22555 if $run ./try; then
22556 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22559 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22562 echo "I'm unable to compile the test program." >&4
22563 echo "I'll assume no _NSGetExecutablePath here." >&4
22566 set usensgetexecutablepath
22569 : Check if site customization support was requested
22570 case "$usesitecustomize" in
22571 $define|true|[Yy]*)
22572 usesitecustomize="$define"
22575 usesitecustomize="$undef"
22579 : determine compiler compiler
22588 if $test -f "$byacc$_exe"; then
22590 comp="byacc or $comp"
22592 if $test -f "$bison$_exe"; then
22593 comp="$comp or bison -y"
22595 rp="Which compiler compiler ($comp) shall I use?"
22604 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22610 : see if this is a bfd.h system
22614 : see if this is an execinfo.h system
22615 set execinfo.h i_execinfo
22618 : see if this is a fenv.h system
22622 : see if this is a fp.h system
22626 : see if this is a fp_class.h system
22627 set fp_class.h i_fp_class
22630 : see if gdbm.h is available
22635 : see if gdbm_open exists
22636 set gdbm_open d_gdbm_open
22638 case "$d_gdbm_open" in
22641 echo "We won't be including <gdbm.h>"
22650 : see if this is a ieeefp.h system
22651 case "$i_ieeefp" in
22652 '' ) set ieeefp.h i_ieeefp
22657 : see if this is a libutil.h system
22658 set libutil.h i_libutil
22661 : see if mach cthreads are available
22662 if test "X$usethreads" = "X$define"; then
22663 set mach/cthreads.h i_machcthr
22666 i_machcthr="$undef"
22669 : see if this is a mntent.h system
22670 set mntent.h i_mntent
22673 : see if net/errno.h is available
22675 set net/errno.h val
22678 : Unfortunately, it causes problems on some systems. Arrgh.
22681 cat > try.c <<'EOM'
22684 #include <net/errno.h>
22690 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22691 echo "We'll be including <net/errno.h>." >&4
22693 echo "We won't be including <net/errno.h>." >&4
22702 : see if netinet/tcp.h is available
22703 set netinet/tcp.h i_netinettcp
22706 : see if this is a poll.h system
22710 : see if this is a prot.h system
22714 : Preprocessor symbols
22716 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22717 $cat <<'EOSH' > Cppsym.know
22718 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22719 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22720 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22721 arch_pwr ardent ARM ARM32 atarist att386 att3b
22722 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22723 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22724 byteorder byte_order
22725 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22726 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22727 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22728 ELF encore EPI EXTENSIONS
22729 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22730 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22731 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22732 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22733 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22734 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22735 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22736 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22737 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22739 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22740 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22741 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22743 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22744 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22745 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22746 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22747 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22748 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22749 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22750 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22751 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22752 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22753 ns32000 ns32016 ns32332 ns32k nsc32000
22754 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22755 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22756 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22757 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22759 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22760 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22761 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22762 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22763 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22764 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22765 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22766 SYSV4 SYSV5 sysV68 sysV88
22767 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22768 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22769 tower32_800 tower32_850 tss
22770 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22771 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22772 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22773 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22774 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22775 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22777 vax venix VMESA vms
22778 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22779 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22782 # Maybe put other stuff here too.
22783 ./tr '-' '_' <<EOSH >>Cppsym.know
22786 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22787 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22788 $cat Cppsym.know > Cppsym.c
22789 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22790 $rm -f Cppsym.a Cppsym.b Cppsym.c
22791 cat <<EOSH > Cppsym
22793 if $test \$# -gt 0; then
22794 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22795 if $test -s Cppsym.got; then
22802 $tr " " "$trnl" | ./Cppsym.try
22808 cat <<EOSH > Cppsym.try
22810 cat <<'EOCP' > try.c
22813 #define STRINGIFY(a) "a"
22815 #if cpp_stuff == 42
22816 #define StGiFy(a) #a
22817 #define STRINGIFY(a) StGiFy(a)
22819 #if $cpp_stuff != 1 && $cpp_stuff != 42
22820 # include "Bletch: How does this C preprocessor stringify macros?"
22826 cat <<'EOSH' >> Cppsym.try
22828 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22829 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22830 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22831 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22833 echo 'return 0;}' >> try.c
22835 cat <<EOSH >> Cppsym.try
22837 case "$osname-$gccversion" in
22838 irix-) ccflags="\$ccflags -woff 1178" ;;
22839 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22841 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
22843 chmod +x Cppsym.try
22844 $eunicefix Cppsym.try
22845 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22846 : Add in any Linux cpp "predefined macros":
22847 case "$osname::$gccversion" in
22848 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22850 rm -f $tHdrH'.h' $tHdrH
22852 # Filter out macro arguments, such as Linux's __INT8_C(c)
22853 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22854 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22855 if [ -s $tHdrH'_cppsym.real' ]; then
22856 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22859 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22862 : now check the C compiler for additional symbols
22863 postprocess_cc_v=''
22865 aix) postprocess_cc_v="|$tr , ' '" ;;
22872 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22875 -D*) echo "\$i" | $sed 's/^-D//';;
22876 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22881 postprocess_cc_v=''
22884 ./ccsym > ccsym1.raw
22885 if $test -s ccsym1.raw; then
22886 $sort ccsym1.raw | $uniq >ccsym.raw
22888 mv ccsym1.raw ccsym.raw
22891 $awk '/\=/ { print $0; next }
22892 { print $0"=1" }' ccsym.raw >ccsym.list
22893 $comm -13 Cppsym.true ccsym.list >ccsym.own
22894 $comm -12 Cppsym.true ccsym.list >ccsym.com
22895 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22897 if $test -z ccsym.raw; then
22898 echo "Your C compiler doesn't seem to define any symbols!" >&4
22900 echo "However, your C preprocessor defines the following symbols:"
22903 cppsymbols=`$cat Cppsym.true`
22904 cppsymbols=`echo $cppsymbols`
22905 cppccsymbols="$cppsymbols"
22907 if $test -s ccsym.com; then
22908 echo "Your C compiler and pre-processor define these symbols:"
22909 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22912 cppccsymbols=`$cat ccsym.com`
22913 cppccsymbols=`echo $cppccsymbols`
22914 $test "$silent" || sleep 1
22916 if $test -s ccsym.cpp; then
22917 $test "$also" && echo " "
22918 echo "Your C pre-processor ${also}defines the following symbols:"
22919 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22921 cppsymbols=`$cat ccsym.cpp`
22922 cppsymbols=`echo $cppsymbols`
22923 $test "$silent" || sleep 1
22925 if $test -s ccsym.own; then
22926 $test "$also" && echo " "
22927 echo "Your C compiler ${also}defines the following cpp symbols:"
22928 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22929 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22930 ccsymbols=`$cat ccsym.own`
22931 ccsymbols=`echo $ccsymbols`
22932 $test "$silent" || sleep 1
22936 : add -D_FORTIFY_SOURCE if feasible and not already there
22937 case "$gccversion" in
22938 [4567].*) case "$optimize$ccflags" in
22939 *-O*) case "$ccflags$cppsymbols" in
22940 *_FORTIFY_SOURCE=*) # Don't add it again.
22941 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22943 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22944 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22948 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22952 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
22956 : script used to emit important warnings
22959 if test \$# -gt 0; then
22964 echo "*** WARNING:" >&4
22965 sed -e 's/^/*** /' <msg >&4
22967 cat msg >>config.msg
22968 echo " " >>config.msg
22974 : see if this is a termio system
22978 if $test `./findhdr termios.h`; then
22979 set tcsetattr i_termios
22985 "$define") echo "You have POSIX termios.h... good!" >&4;;
22986 *) if ./Cppsym pyr; then
22987 case "`$run /bin/universe`" in
22988 ucb) if $test `./findhdr sgtty.h`; then
22990 echo "<sgtty.h> found." >&4
22992 echo "System is pyramid with BSD universe."
22993 ./warn "<sgtty.h> not found--you could have problems."
22995 *) if $test `./findhdr termio.h`; then
22997 echo "<termio.h> found." >&4
22999 echo "System is pyramid with USG universe."
23000 ./warn "<termio.h> not found--you could have problems."
23004 if $test `./findhdr termio.h`; then
23005 echo "<termio.h> found." >&4
23007 elif $test `./findhdr sgtty.h`; then
23008 echo "<sgtty.h> found." >&4
23011 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23014 if $test `./findhdr sgtty.h`; then
23015 echo "<sgtty.h> found." >&4
23017 elif $test `./findhdr termio.h`; then
23018 echo "<termio.h> found." >&4
23021 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23025 set i_termio; eval $setvar
23026 val=$val2; set i_sgtty; eval $setvar
23027 val=$val3; set i_termios; eval $setvar
23029 : see if stdbool is available
23030 : we want a real compile instead of Inhdr because some Solaris systems
23031 : have stdbool.h, but it can only be used if the compiler indicates it
23032 : is sufficiently c99-compliant.
23036 #include <stdbool.h>
23041 int main(int argc, char **argv)
23047 if eval $compile; then
23048 echo "<stdbool.h> found." >&4
23051 echo "<stdbool.h> NOT found." >&4
23058 : see if stdint is available
23059 set stdint.h i_stdint
23062 : see if sys/access.h is available
23063 set sys/access.h i_sysaccess
23066 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23067 set sys/filio.h i_sysfilio
23070 if $test `./findhdr sys/ioctl.h`; then
23072 echo '<sys/ioctl.h> found.' >&4
23075 if $test $i_sysfilio = "$define"; then
23076 echo '<sys/ioctl.h> NOT found.' >&4
23078 $test $i_sgtty = "$define" && xxx="sgtty.h"
23079 $test $i_termio = "$define" && xxx="termio.h"
23080 $test $i_termios = "$define" && xxx="termios.h"
23081 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23087 : see if socket ioctl defs are in sys/sockio.h
23089 xxx=`./findhdr sys/sockio.h`
23090 if $test "$xxx"; then
23091 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23093 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23096 echo "No socket ioctls found in <sys/sockio.h>." >&4
23101 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23107 : see if this is a syslog.h system
23108 set syslog.h i_syslog
23111 : see if this is a sys/mode.h system
23112 set sys/mode.h i_sysmode
23115 : see if there is a sys/poll.h file
23116 set sys/poll.h i_syspoll
23119 : see if sys/resource.h has to be included
23120 set sys/resource.h i_sysresrc
23123 : see if sys/security.h is available
23124 set sys/security.h i_syssecrt
23127 : see if this is a sys/statvfs.h system
23128 set sys/statvfs.h i_sysstatvfs
23131 : see if this is a sys/un.h system
23132 set sys/un.h i_sysun
23135 : see if this is a sys/utsname.h system
23136 set sys/utsname.h i_sysutsname
23139 : see if this is a syswait system
23140 set sys/wait.h i_syswait
23143 : see if this is a ustat.h system
23144 set ustat.h i_ustat
23147 : see if this is an utime system
23148 set utime.h i_utime
23151 : see if this is a vfork system
23154 set vfork.h i_vfork
23162 : see if wchar.h is present
23163 set wchar.h i_wchar
23168 echo "Looking for extensions..." >&4
23169 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23170 : contain old or inaccurate or duplicate values.
23171 nonxs_extensions=''
23173 : We do not use find because it might not be available.
23174 : We do not just use MANIFEST because the user may have dropped
23175 : some additional extensions into the source tree and expect them
23178 : Function to recursively find available extensions, ignoring DynaLoader
23179 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23180 : In 5.10.1 and later, extensions are stored in directories
23181 : like File-Glob instead of the older File/Glob/.
23185 DynaLoader|dynaload) ;;
23187 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23188 case "$this_ext" in
23189 Scalar/List/Utils) this_ext="List/Util" ;;
23190 PathTools) this_ext="Cwd" ;;
23192 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23193 if $contains " $this_ext " "$tdir/$$.tmp"; then
23195 echo "Duplicate directories detected for extension $xxx" >&4;
23196 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23197 case "$knowitall" in
23205 echo "Ok. Stopping Configure." >&4;
23206 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23209 echo "Ok. You will need to correct config.sh before running make." >&4;
23211 $ls -1 "$xxx" > "$tdir/$$.tmp";
23212 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23213 xs_extensions="$xs_extensions $this_ext";
23214 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23215 xs_extensions="$xs_extensions $this_ext";
23216 elif $test -d "$xxx"; then
23217 nonxs_extensions="$nonxs_extensions $this_ext";
23219 $rm -f "$tdir/$$.tmp";
23227 eval $find_extensions
23231 eval $find_extensions
23235 eval $find_extensions
23236 set X $xs_extensions
23238 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23239 set X $nonxs_extensions
23241 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23243 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23245 : Now see which are supported on this system.
23247 for xxx in $xs_extensions ; do
23251 amigaos) avail_ext="$avail_ext $xxx" ;;
23256 $define) avail_ext="$avail_ext $xxx" ;;
23259 GDBM_File|gdbm_fil)
23261 $define) avail_ext="$avail_ext $xxx" ;;
23264 I18N/Langinfo|i18n_lan)
23265 case "$usei18n_lang" in
23266 true|define|y) avail_ext="$avail_ext $xxx" ;;
23270 : XXX Do we need a useipcsysv variable here
23271 case "${d_msg}${d_sem}${d_shm}" in
23272 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23275 NDBM_File|ndbm_fil)
23278 case "$osname-$use64bitint" in
23281 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23284 *) avail_ext="$avail_ext $xxx" ;;
23289 ODBM_File|odbm_fil)
23290 case "${i_dbm}${i_rpcsvcdbm}" in
23292 case "$d_cplusplus" in
23293 define) ;; # delete as a function name will not work
23294 *) case "$osname-$use64bitint" in
23297 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23300 *) avail_ext="$avail_ext $xxx" ;;
23308 case "$useopcode" in
23309 true|define|y) avail_ext="$avail_ext $xxx" ;;
23313 case "$useposix" in
23314 true|define|y) avail_ext="$avail_ext $xxx" ;;
23318 case "$d_socket" in
23319 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23322 Sys/Syslog|sys/syslog)
23324 amigaos) ;; # not really very useful on AmigaOS
23326 : XXX syslog requires socket
23327 case "$d_socket" in
23328 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23334 case "$usethreads" in
23336 case "$use5005threads" in
23337 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23341 threads|threads/shared)
23342 # threads and threads::shared are special cases.
23343 # To stop people from asking "Perl 5.8.0 was supposed
23344 # to have this new fancy threads implementation but my
23345 # perl doesn't have it" and from people trying to
23346 # (re)install the threads module using CPAN.pm and
23347 # CPAN.pm then offering to reinstall Perl 5.8.0,
23348 # the threads.pm and threads/shared.pm will always be
23349 # there, croaking informatively ("you need to rebuild
23350 # all of Perl with threads, sorry") when threads haven't
23351 # been compiled in.
23353 avail_ext="$avail_ext $xxx"
23359 cygwin) avail_ext="$avail_ext $xxx" ;;
23362 XS/APItest|xs/apitest)
23363 # This is just for testing. Skip it unless we have dynamic loading.
23366 $define) avail_ext="$avail_ext $xxx" ;;
23369 XS/Typemap|xs/typemap)
23370 # This is just for testing. Skip it unless we have dynamic loading.
23372 $define) avail_ext="$avail_ext $xxx" ;;
23375 *) avail_ext="$avail_ext $xxx"
23384 case "$onlyextensions" in
23386 *) keepextensions=''
23387 echo "You have requested that only certain extensions be included..." >&4
23388 for i in $onlyextensions; do
23389 case " $avail_ext " in
23391 echo "Keeping extension $i."
23392 keepextensions="$keepextensions $i"
23394 *) echo "Ignoring extension $i." ;;
23397 avail_ext="$keepextensions"
23401 case "$noextensions" in
23403 *) keepextensions=''
23404 echo "You have requested that certain extensions be ignored..." >&4
23405 for i in $avail_ext; do
23406 case " $noextensions " in
23407 *" $i "*) echo "Ignoring extension $i." ;;
23408 *) echo "Keeping extension $i.";
23409 keepextensions="$keepextensions $i"
23413 avail_ext="$keepextensions"
23417 : Now see which nonxs extensions are supported on this system.
23418 : For now assume all are.
23420 for xxx in $nonxs_extensions ; do
23424 *) nonxs_ext="$nonxs_ext $xxx"
23436 A number of extensions are supplied with $package. You may choose to
23437 compile these extensions for dynamic loading (the default), compile
23438 them into the $package executable (static loading), or not include
23439 them at all. Answer "none" to include no extensions.
23440 Note that DynaLoader is always built and need not be mentioned here.
23443 case "$dynamic_ext" in
23445 : Exclude those listed in static_ext
23447 for xxx in $avail_ext; do
23448 case " $static_ext " in
23450 *) dflt="$dflt $xxx" ;;
23457 *) dflt="$dynamic_ext"
23458 # Perhaps we are reusing an old out-of-date config.sh.
23461 if test X"$dynamic_ext" != X"$avail_ext"; then
23463 NOTICE: Your previous config.sh list may be incorrect.
23464 The extensions now available to you are
23466 but the default list from your previous config.sh is
23478 rp="What extensions do you wish to load dynamically?"
23481 none) dynamic_ext=' ' ;;
23482 *) dynamic_ext="$ans" ;;
23485 case "$static_ext" in
23487 : Exclude those already listed in dynamic linking
23489 for xxx in $avail_ext; do
23490 case " $dynamic_ext " in
23492 *) dflt="$dflt $xxx" ;;
23499 *) dflt="$static_ext"
23506 rp="What extensions do you wish to load statically?"
23509 none) static_ext=' ' ;;
23510 *) static_ext="$ans" ;;
23515 A number of extensions are supplied with $package. Answer "none"
23516 to include no extensions.
23517 Note that DynaLoader is always built and need not be mentioned here.
23520 case "$static_ext" in
23521 '') dflt="$avail_ext" ;;
23522 *) dflt="$static_ext"
23523 # Perhaps we are reusing an old out-of-date config.sh.
23526 if test X"$static_ext" != X"$avail_ext"; then
23528 NOTICE: Your previous config.sh list may be incorrect.
23529 The extensions now available to you are
23531 but the default list from your previous config.sh is
23540 : Exclude those that are not xs extensions
23544 rp="What extensions do you wish to include?"
23547 none) static_ext=' ' ;;
23548 *) static_ext="$ans" ;;
23553 # Encode is a special case. If we are building Encode as a static
23554 # extension, we need to explicitly list its subextensions as well.
23555 # For other nested extensions, this is handled automatically by
23556 # the appropriate Makefile.PL.
23557 case " $static_ext " in
23558 *" Encode "*) # Add the subextensions of Encode
23560 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23561 static_ext="$static_ext Encode/$xxx"
23562 known_extensions="$known_extensions Encode/$xxx"
23568 set X $dynamic_ext $static_ext $nonxs_ext
23572 # Sanity check: We require an extension suitable for use with
23573 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23574 # should show up as failures in the test suite, but it's helpful to
23575 # catch them now.) The 'extensions' list is normally sorted
23576 # alphabetically, so we need to accept either
23577 # DB_File ... Fcntl ... IO ....
23578 # or something like
23579 # Fcntl ... NDBM_File ... IO ....
23580 case " $extensions" in
23581 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23582 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23583 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23584 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23585 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23589 : Remove libraries needed only for extensions
23590 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23591 : The exception is SunOS 4.x, which needs them.
23592 case "${osname}X${osvers}" in
23596 *) case "$usedl" in
23597 $define|true|[yY]*)
23598 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23602 *) perllibs="$libs"
23608 : Remove build directory name from cppstdin so it can be used from
23609 : either the present location or the final installed location.
23611 : Get out of the UU directory to get correct path name.
23613 case "$cppstdin" in
23615 echo "Stripping down cppstdin path name"
23621 : end of configuration questions
23623 echo "End of configuration questions."
23626 : back to where it started
23627 if test -d ../UU; then
23631 : configuration may be unconditionally patched via a 'config.arch' file
23632 if $test -f config.arch; then
23633 echo "I see a config.arch file, loading it." >&4
23637 : configuration may be patched via a 'config.over' file
23638 if $test -f config.over; then
23641 rp='I see a config.over file. Do you wish to load it?'
23644 n*) echo "OK, I'll ignore it.";;
23646 echo "Configuration override changes have been loaded."
23651 : in case they want portability, strip down executable paths
23652 case "$d_portable" in
23655 echo "Stripping down executable paths..." >&4
23656 for file in $loclist $trylist; do
23658 eval $file=`basename $temp`
23663 : create config.sh file
23665 echo "Creating config.sh..." >&4
23666 $spitshell <<EOT >config.sh
23669 # This file was produced by running the Configure script. It holds all the
23670 # definitions figured out by Configure. Should you modify one of these values,
23671 # do not forget to propagate your changes by running "Configure -der". You may
23672 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23675 # Package name : $package
23676 # Source directory : $src
23677 # Configuration time: $cf_time
23678 # Configured by : $cf_by
23679 # Target system : $myuname
23682 : Add in command line options if available
23683 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23685 $spitshell <<EOT >>config.sh
23694 Revision='$Revision'
23702 alignbytes='$alignbytes'
23703 aphostname='$aphostname'
23704 api_revision='$api_revision'
23705 api_subversion='$api_subversion'
23706 api_version='$api_version'
23707 api_versionstring='$api_versionstring'
23710 archlibexp='$archlibexp'
23711 archname64='$archname64'
23712 archname='$archname'
23713 archobjs='$archobjs'
23714 asctime_r_proto='$asctime_r_proto'
23723 byteorder='$byteorder'
23725 castflags='$castflags'
23728 cccdlflags='$cccdlflags'
23729 ccdlflags='$ccdlflags'
23731 ccflags_uselargefiles='$ccflags_uselargefiles'
23733 ccsymbols='$ccsymbols'
23734 ccversion='$ccversion'
23736 cf_email='$cf_email'
23738 charbits='$charbits'
23739 charsize='$charsize'
23743 clocktype='$clocktype'
23745 compress='$compress'
23746 contains='$contains'
23750 cpp_stuff='$cpp_stuff'
23751 cppccsymbols='$cppccsymbols'
23752 cppflags='$cppflags'
23754 cppminus='$cppminus'
23756 cppstdin='$cppstdin'
23757 cppsymbols='$cppsymbols'
23758 crypt_r_proto='$crypt_r_proto'
23759 cryptlib='$cryptlib'
23761 ctermid_r_proto='$ctermid_r_proto'
23762 ctime_r_proto='$ctime_r_proto'
23763 d_Gconvert='$d_Gconvert'
23764 d_PRIEUldbl='$d_PRIEUldbl'
23765 d_PRIFUldbl='$d_PRIFUldbl'
23766 d_PRIGUldbl='$d_PRIGUldbl'
23767 d_PRIXU64='$d_PRIXU64'
23768 d_PRId64='$d_PRId64'
23769 d_PRIeldbl='$d_PRIeldbl'
23770 d_PRIfldbl='$d_PRIfldbl'
23771 d_PRIgldbl='$d_PRIgldbl'
23772 d_PRIi64='$d_PRIi64'
23773 d_PRIo64='$d_PRIo64'
23774 d_PRIu64='$d_PRIu64'
23775 d_PRIx64='$d_PRIx64'
23776 d_SCNfldbl='$d_SCNfldbl'
23777 d__fwalk='$d__fwalk'
23778 d_accept4='$d_accept4'
23779 d_access='$d_access'
23780 d_accessx='$d_accessx'
23784 d_archlib='$d_archlib'
23785 d_asctime64='$d_asctime64'
23786 d_asctime_r='$d_asctime_r'
23791 d_attribute_deprecated='$d_attribute_deprecated'
23792 d_attribute_format='$d_attribute_format'
23793 d_attribute_malloc='$d_attribute_malloc'
23794 d_attribute_nonnull='$d_attribute_nonnull'
23795 d_attribute_noreturn='$d_attribute_noreturn'
23796 d_attribute_pure='$d_attribute_pure'
23797 d_attribute_unused='$d_attribute_unused'
23798 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23799 d_backtrace='$d_backtrace'
23801 d_bsdgetpgrp='$d_bsdgetpgrp'
23802 d_bsdsetpgrp='$d_bsdsetpgrp'
23803 d_builtin_add_overflow='$d_builtin_add_overflow'
23804 d_builtin_choose_expr='$d_builtin_choose_expr'
23805 d_builtin_expect='$d_builtin_expect'
23806 d_builtin_mul_overflow='$d_builtin_mul_overflow'
23807 d_builtin_sub_overflow='$d_builtin_sub_overflow'
23808 d_c99_variadic_macros='$d_c99_variadic_macros'
23809 d_casti32='$d_casti32'
23810 d_castneg='$d_castneg'
23813 d_chroot='$d_chroot'
23814 d_chsize='$d_chsize'
23816 d_clearenv='$d_clearenv'
23817 d_closedir='$d_closedir'
23818 d_cmsghdr_s='$d_cmsghdr_s'
23820 d_copysign='$d_copysign'
23821 d_copysignl='$d_copysignl'
23822 d_cplusplus='$d_cplusplus'
23824 d_crypt_r='$d_crypt_r'
23826 d_ctermid='$d_ctermid'
23827 d_ctermid_r='$d_ctermid_r'
23828 d_ctime64='$d_ctime64'
23829 d_ctime_r='$d_ctime_r'
23830 d_cuserid='$d_cuserid'
23831 d_dbminitproto='$d_dbminitproto'
23832 d_difftime64='$d_difftime64'
23833 d_difftime='$d_difftime'
23834 d_dir_dd_fd='$d_dir_dd_fd'
23836 d_dirnamlen='$d_dirnamlen'
23837 d_dladdr='$d_dladdr'
23838 d_dlerror='$d_dlerror'
23839 d_dlopen='$d_dlopen'
23840 d_dlsymun='$d_dlsymun'
23841 d_dosuid='$d_dosuid'
23842 d_double_has_inf='$d_double_has_inf'
23843 d_double_has_nan='$d_double_has_nan'
23844 d_double_has_negative_zero='$d_double_has_negative_zero'
23845 d_double_has_subnormals='$d_double_has_subnormals'
23846 d_double_style_cray='$d_double_style_cray'
23847 d_double_style_ibm='$d_double_style_ibm'
23848 d_double_style_ieee='$d_double_style_ieee'
23849 d_double_style_vax='$d_double_style_vax'
23850 d_drand48_r='$d_drand48_r'
23851 d_drand48proto='$d_drand48proto'
23854 d_duplocale='$d_duplocale'
23855 d_eaccess='$d_eaccess'
23856 d_endgrent='$d_endgrent'
23857 d_endgrent_r='$d_endgrent_r'
23858 d_endhent='$d_endhent'
23859 d_endhostent_r='$d_endhostent_r'
23860 d_endnent='$d_endnent'
23861 d_endnetent_r='$d_endnetent_r'
23862 d_endpent='$d_endpent'
23863 d_endprotoent_r='$d_endprotoent_r'
23864 d_endpwent='$d_endpwent'
23865 d_endpwent_r='$d_endpwent_r'
23866 d_endsent='$d_endsent'
23867 d_endservent_r='$d_endservent_r'
23868 d_eofnblk='$d_eofnblk'
23871 d_eunice='$d_eunice'
23874 d_faststdio='$d_faststdio'
23875 d_fchdir='$d_fchdir'
23876 d_fchmod='$d_fchmod'
23877 d_fchmodat='$d_fchmodat'
23878 d_fchown='$d_fchown'
23880 d_fcntl_can_lock='$d_fcntl_can_lock'
23881 d_fd_macros='$d_fd_macros'
23882 d_fd_set='$d_fd_set'
23883 d_fdclose='$d_fdclose'
23885 d_fds_bits='$d_fds_bits'
23886 d_fegetround='$d_fegetround'
23887 d_fgetpos='$d_fgetpos'
23888 d_finite='$d_finite'
23889 d_finitel='$d_finitel'
23890 d_flexfnam='$d_flexfnam'
23892 d_flockproto='$d_flockproto'
23897 d_fp_class='$d_fp_class'
23898 d_fp_classify='$d_fp_classify'
23899 d_fp_classl='$d_fp_classl'
23900 d_fpathconf='$d_fpathconf'
23901 d_fpclass='$d_fpclass'
23902 d_fpclassify='$d_fpclassify'
23903 d_fpclassl='$d_fpclassl'
23904 d_fpgetround='$d_fpgetround'
23905 d_fpos64_t='$d_fpos64_t'
23906 d_freelocale='$d_freelocale'
23907 d_frexpl='$d_frexpl'
23908 d_fs_data_s='$d_fs_data_s'
23909 d_fseeko='$d_fseeko'
23910 d_fsetpos='$d_fsetpos'
23911 d_fstatfs='$d_fstatfs'
23912 d_fstatvfs='$d_fstatvfs'
23914 d_ftello='$d_ftello'
23916 d_futimes='$d_futimes'
23917 d_gai_strerror='$d_gai_strerror'
23918 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23919 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23920 d_getaddrinfo='$d_getaddrinfo'
23921 d_getcwd='$d_getcwd'
23922 d_getespwnam='$d_getespwnam'
23923 d_getfsstat='$d_getfsstat'
23924 d_getgrent='$d_getgrent'
23925 d_getgrent_r='$d_getgrent_r'
23926 d_getgrgid_r='$d_getgrgid_r'
23927 d_getgrnam_r='$d_getgrnam_r'
23928 d_getgrps='$d_getgrps'
23929 d_gethbyaddr='$d_gethbyaddr'
23930 d_gethbyname='$d_gethbyname'
23931 d_gethent='$d_gethent'
23932 d_gethname='$d_gethname'
23933 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23934 d_gethostbyname_r='$d_gethostbyname_r'
23935 d_gethostent_r='$d_gethostent_r'
23936 d_gethostprotos='$d_gethostprotos'
23937 d_getitimer='$d_getitimer'
23938 d_getlogin='$d_getlogin'
23939 d_getlogin_r='$d_getlogin_r'
23940 d_getmnt='$d_getmnt'
23941 d_getmntent='$d_getmntent'
23942 d_getnameinfo='$d_getnameinfo'
23943 d_getnbyaddr='$d_getnbyaddr'
23944 d_getnbyname='$d_getnbyname'
23945 d_getnent='$d_getnent'
23946 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23947 d_getnetbyname_r='$d_getnetbyname_r'
23948 d_getnetent_r='$d_getnetent_r'
23949 d_getnetprotos='$d_getnetprotos'
23950 d_getpagsz='$d_getpagsz'
23951 d_getpbyname='$d_getpbyname'
23952 d_getpbynumber='$d_getpbynumber'
23953 d_getpent='$d_getpent'
23954 d_getpgid='$d_getpgid'
23955 d_getpgrp2='$d_getpgrp2'
23956 d_getpgrp='$d_getpgrp'
23957 d_getppid='$d_getppid'
23958 d_getprior='$d_getprior'
23959 d_getprotobyname_r='$d_getprotobyname_r'
23960 d_getprotobynumber_r='$d_getprotobynumber_r'
23961 d_getprotoent_r='$d_getprotoent_r'
23962 d_getprotoprotos='$d_getprotoprotos'
23963 d_getprpwnam='$d_getprpwnam'
23964 d_getpwent='$d_getpwent'
23965 d_getpwent_r='$d_getpwent_r'
23966 d_getpwnam_r='$d_getpwnam_r'
23967 d_getpwuid_r='$d_getpwuid_r'
23968 d_getsbyname='$d_getsbyname'
23969 d_getsbyport='$d_getsbyport'
23970 d_getsent='$d_getsent'
23971 d_getservbyname_r='$d_getservbyname_r'
23972 d_getservbyport_r='$d_getservbyport_r'
23973 d_getservent_r='$d_getservent_r'
23974 d_getservprotos='$d_getservprotos'
23975 d_getspnam='$d_getspnam'
23976 d_getspnam_r='$d_getspnam_r'
23977 d_gettimeod='$d_gettimeod'
23978 d_gmtime64='$d_gmtime64'
23979 d_gmtime_r='$d_gmtime_r'
23980 d_gnulibc='$d_gnulibc'
23981 d_grpasswd='$d_grpasswd'
23982 d_hasmntopt='$d_hasmntopt'
23986 d_ilogbl='$d_ilogbl'
23987 d_inc_version_list='$d_inc_version_list'
23988 d_inetaton='$d_inetaton'
23989 d_inetntop='$d_inetntop'
23990 d_inetpton='$d_inetpton'
23991 d_int64_t='$d_int64_t'
23992 d_ip_mreq='$d_ip_mreq'
23993 d_ip_mreq_source='$d_ip_mreq_source'
23994 d_ipv6_mreq='$d_ipv6_mreq'
23995 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23996 d_isascii='$d_isascii'
23997 d_isblank='$d_isblank'
23998 d_isfinite='$d_isfinite'
23999 d_isfinitel='$d_isfinitel'
24001 d_isinfl='$d_isinfl'
24002 d_isless='$d_isless'
24004 d_isnanl='$d_isnanl'
24005 d_isnormal='$d_isnormal'
24008 d_killpg='$d_killpg'
24009 d_lc_monetary_2008='$d_lc_monetary_2008'
24010 d_lchown='$d_lchown'
24011 d_ldbl_dig='$d_ldbl_dig'
24012 d_ldexpl='$d_ldexpl'
24013 d_lgamma='$d_lgamma'
24014 d_lgamma_r='$d_lgamma_r'
24015 d_libm_lib_version='$d_libm_lib_version'
24016 d_libname_unique='$d_libname_unique'
24018 d_linkat='$d_linkat'
24019 d_llrint='$d_llrint'
24020 d_llrintl='$d_llrintl'
24021 d_llround='$d_llround'
24022 d_llroundl='$d_llroundl'
24023 d_localeconv_l='$d_localeconv_l'
24024 d_localtime64='$d_localtime64'
24025 d_localtime_r='$d_localtime_r'
24026 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24027 d_locconv='$d_locconv'
24032 d_long_double_style_ieee='$d_long_double_style_ieee'
24033 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24034 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24035 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24036 d_long_double_style_vax='$d_long_double_style_vax'
24037 d_longdbl='$d_longdbl'
24038 d_longlong='$d_longlong'
24040 d_lrintl='$d_lrintl'
24041 d_lround='$d_lround'
24042 d_lroundl='$d_lroundl'
24043 d_lseekproto='$d_lseekproto'
24045 d_madvise='$d_madvise'
24046 d_malloc_good_size='$d_malloc_good_size'
24047 d_malloc_size='$d_malloc_size'
24049 d_mbrlen='$d_mbrlen'
24050 d_mbrtowc='$d_mbrtowc'
24051 d_mbstowcs='$d_mbstowcs'
24052 d_mbtowc='$d_mbtowc'
24053 d_memmem='$d_memmem'
24054 d_memrchr='$d_memrchr'
24056 d_mkdtemp='$d_mkdtemp'
24057 d_mkfifo='$d_mkfifo'
24058 d_mkostemp='$d_mkostemp'
24059 d_mkstemp='$d_mkstemp'
24060 d_mkstemps='$d_mkstemps'
24061 d_mktime64='$d_mktime64'
24062 d_mktime='$d_mktime'
24065 d_modflproto='$d_modflproto'
24066 d_mprotect='$d_mprotect'
24068 d_msg_ctrunc='$d_msg_ctrunc'
24069 d_msg_dontroute='$d_msg_dontroute'
24070 d_msg_oob='$d_msg_oob'
24071 d_msg_peek='$d_msg_peek'
24072 d_msg_proxy='$d_msg_proxy'
24073 d_msgctl='$d_msgctl'
24074 d_msgget='$d_msgget'
24075 d_msghdr_s='$d_msghdr_s'
24076 d_msgrcv='$d_msgrcv'
24077 d_msgsnd='$d_msgsnd'
24079 d_munmap='$d_munmap'
24080 d_mymalloc='$d_mymalloc'
24082 d_nanosleep='$d_nanosleep'
24084 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24085 d_nearbyint='$d_nearbyint'
24086 d_newlocale='$d_newlocale'
24087 d_nextafter='$d_nextafter'
24088 d_nexttoward='$d_nexttoward'
24090 d_nl_langinfo='$d_nl_langinfo'
24091 d_nv_preserves_uv='$d_nv_preserves_uv'
24092 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24093 d_off64_t='$d_off64_t'
24094 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24095 d_oldpthreads='$d_oldpthreads'
24096 d_oldsock='$d_oldsock'
24098 d_openat='$d_openat'
24099 d_pathconf='$d_pathconf'
24101 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24102 d_phostname='$d_phostname'
24106 d_portable='$d_portable'
24108 d_prctl_set_name='$d_prctl_set_name'
24109 d_printf_format_null='$d_printf_format_null'
24110 d_procselfexe='$d_procselfexe'
24111 d_pseudofork='$d_pseudofork'
24112 d_pthread_atfork='$d_pthread_atfork'
24113 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24114 d_pthread_yield='$d_pthread_yield'
24115 d_ptrdiff_t='$d_ptrdiff_t'
24117 d_pwchange='$d_pwchange'
24118 d_pwclass='$d_pwclass'
24119 d_pwcomment='$d_pwcomment'
24120 d_pwexpire='$d_pwexpire'
24121 d_pwgecos='$d_pwgecos'
24122 d_pwpasswd='$d_pwpasswd'
24123 d_pwquota='$d_pwquota'
24126 d_querylocale='$d_querylocale'
24127 d_random_r='$d_random_r'
24128 d_re_comp='$d_re_comp'
24129 d_readdir64_r='$d_readdir64_r'
24130 d_readdir='$d_readdir'
24131 d_readdir_r='$d_readdir_r'
24132 d_readlink='$d_readlink'
24134 d_recvmsg='$d_recvmsg'
24135 d_regcmp='$d_regcmp'
24136 d_regcomp='$d_regcomp'
24137 d_remainder='$d_remainder'
24138 d_remquo='$d_remquo'
24139 d_rename='$d_rename'
24140 d_renameat='$d_renameat'
24141 d_rewinddir='$d_rewinddir'
24145 d_sbrkproto='$d_sbrkproto'
24146 d_scalbn='$d_scalbn'
24147 d_scalbnl='$d_scalbnl'
24148 d_sched_yield='$d_sched_yield'
24149 d_scm_rights='$d_scm_rights'
24150 d_seekdir='$d_seekdir'
24151 d_select='$d_select'
24153 d_semctl='$d_semctl'
24154 d_semctl_semid_ds='$d_semctl_semid_ds'
24155 d_semctl_semun='$d_semctl_semun'
24156 d_semget='$d_semget'
24158 d_sendmsg='$d_sendmsg'
24159 d_setegid='$d_setegid'
24160 d_seteuid='$d_seteuid'
24161 d_setgrent='$d_setgrent'
24162 d_setgrent_r='$d_setgrent_r'
24163 d_setgrps='$d_setgrps'
24164 d_sethent='$d_sethent'
24165 d_sethostent_r='$d_sethostent_r'
24166 d_setitimer='$d_setitimer'
24167 d_setlinebuf='$d_setlinebuf'
24168 d_setlocale='$d_setlocale'
24169 d_setlocale_r='$d_setlocale_r'
24170 d_setnent='$d_setnent'
24171 d_setnetent_r='$d_setnetent_r'
24172 d_setpent='$d_setpent'
24173 d_setpgid='$d_setpgid'
24174 d_setpgrp2='$d_setpgrp2'
24175 d_setpgrp='$d_setpgrp'
24176 d_setprior='$d_setprior'
24177 d_setproctitle='$d_setproctitle'
24178 d_setprotoent_r='$d_setprotoent_r'
24179 d_setpwent='$d_setpwent'
24180 d_setpwent_r='$d_setpwent_r'
24181 d_setregid='$d_setregid'
24182 d_setresgid='$d_setresgid'
24183 d_setresuid='$d_setresuid'
24184 d_setreuid='$d_setreuid'
24185 d_setrgid='$d_setrgid'
24186 d_setruid='$d_setruid'
24187 d_setsent='$d_setsent'
24188 d_setservent_r='$d_setservent_r'
24189 d_setsid='$d_setsid'
24190 d_setvbuf='$d_setvbuf'
24193 d_shmatprototype='$d_shmatprototype'
24194 d_shmctl='$d_shmctl'
24196 d_shmget='$d_shmget'
24197 d_sigaction='$d_sigaction'
24198 d_siginfo_si_addr='$d_siginfo_si_addr'
24199 d_siginfo_si_band='$d_siginfo_si_band'
24200 d_siginfo_si_errno='$d_siginfo_si_errno'
24201 d_siginfo_si_fd='$d_siginfo_si_fd'
24202 d_siginfo_si_pid='$d_siginfo_si_pid'
24203 d_siginfo_si_status='$d_siginfo_si_status'
24204 d_siginfo_si_uid='$d_siginfo_si_uid'
24205 d_siginfo_si_value='$d_siginfo_si_value'
24206 d_signbit='$d_signbit'
24207 d_sigprocmask='$d_sigprocmask'
24208 d_sigsetjmp='$d_sigsetjmp'
24209 d_sin6_scope_id='$d_sin6_scope_id'
24210 d_sitearch='$d_sitearch'
24211 d_snprintf='$d_snprintf'
24212 d_sockaddr_in6='$d_sockaddr_in6'
24213 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24214 d_sockatmark='$d_sockatmark'
24215 d_sockatmarkproto='$d_sockatmarkproto'
24216 d_socket='$d_socket'
24217 d_socklen_t='$d_socklen_t'
24218 d_sockpair='$d_sockpair'
24219 d_socks5_init='$d_socks5_init'
24221 d_srand48_r='$d_srand48_r'
24222 d_srandom_r='$d_srandom_r'
24223 d_sresgproto='$d_sresgproto'
24224 d_sresuproto='$d_sresuproto'
24226 d_statblks='$d_statblks'
24227 d_statfs_f_flags='$d_statfs_f_flags'
24228 d_statfs_s='$d_statfs_s'
24229 d_static_inline='$d_static_inline'
24230 d_statvfs='$d_statvfs'
24231 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24232 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24233 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24234 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24235 d_stdio_stream_array='$d_stdio_stream_array'
24236 d_stdiobase='$d_stdiobase'
24237 d_stdstdio='$d_stdstdio'
24238 d_strcoll='$d_strcoll'
24239 d_strerror_l='$d_strerror_l'
24240 d_strerror_r='$d_strerror_r'
24241 d_strftime='$d_strftime'
24242 d_strlcat='$d_strlcat'
24243 d_strlcpy='$d_strlcpy'
24244 d_strnlen='$d_strnlen'
24245 d_strtod='$d_strtod'
24246 d_strtol='$d_strtol'
24247 d_strtold='$d_strtold'
24248 d_strtold_l='$d_strtold_l'
24249 d_strtoll='$d_strtoll'
24250 d_strtoq='$d_strtoq'
24251 d_strtoul='$d_strtoul'
24252 d_strtoull='$d_strtoull'
24253 d_strtouq='$d_strtouq'
24254 d_strxfrm='$d_strxfrm'
24255 d_suidsafe='$d_suidsafe'
24256 d_symlink='$d_symlink'
24257 d_syscall='$d_syscall'
24258 d_syscallproto='$d_syscallproto'
24259 d_sysconf='$d_sysconf'
24260 d_sysernlst='$d_sysernlst'
24261 d_syserrlst='$d_syserrlst'
24262 d_system='$d_system'
24263 d_tcgetpgrp='$d_tcgetpgrp'
24264 d_tcsetpgrp='$d_tcsetpgrp'
24265 d_telldir='$d_telldir'
24266 d_telldirproto='$d_telldirproto'
24267 d_tgamma='$d_tgamma'
24268 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24270 d_timegm='$d_timegm'
24272 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24273 d_tm_tm_zone='$d_tm_tm_zone'
24274 d_tmpnam_r='$d_tmpnam_r'
24276 d_truncate='$d_truncate'
24277 d_truncl='$d_truncl'
24278 d_ttyname_r='$d_ttyname_r'
24279 d_tzname='$d_tzname'
24280 d_u32align='$d_u32align'
24281 d_ualarm='$d_ualarm'
24284 d_union_semun='$d_union_semun'
24285 d_unlinkat='$d_unlinkat'
24286 d_unordered='$d_unordered'
24287 d_unsetenv='$d_unsetenv'
24288 d_uselocale='$d_uselocale'
24289 d_usleep='$d_usleep'
24290 d_usleepproto='$d_usleepproto'
24292 d_vendorarch='$d_vendorarch'
24293 d_vendorbin='$d_vendorbin'
24294 d_vendorlib='$d_vendorlib'
24295 d_vendorscript='$d_vendorscript'
24297 d_void_closedir='$d_void_closedir'
24298 d_voidsig='$d_voidsig'
24299 d_voidtty='$d_voidtty'
24300 d_vsnprintf='$d_vsnprintf'
24302 d_waitpid='$d_waitpid'
24303 d_wcscmp='$d_wcscmp'
24304 d_wcstombs='$d_wcstombs'
24305 d_wcsxfrm='$d_wcsxfrm'
24306 d_wctomb='$d_wctomb'
24307 d_writev='$d_writev'
24310 db_hashtype='$db_hashtype'
24311 db_prefixtype='$db_prefixtype'
24312 db_version_major='$db_version_major'
24313 db_version_minor='$db_version_minor'
24314 db_version_patch='$db_version_patch'
24315 default_inc_excludes_dot='$default_inc_excludes_dot'
24316 direntrytype='$direntrytype'
24319 doubleinfbytes='$doubleinfbytes'
24320 doublekind='$doublekind'
24321 doublemantbits='$doublemantbits'
24322 doublenanbytes='$doublenanbytes'
24323 doublesize='$doublesize'
24325 drand48_r_proto='$drand48_r_proto'
24327 dtraceobject='$dtraceobject'
24328 dtracexnolibs='$dtracexnolibs'
24329 dynamic_ext='$dynamic_ext'
24335 endgrent_r_proto='$endgrent_r_proto'
24336 endhostent_r_proto='$endhostent_r_proto'
24337 endnetent_r_proto='$endnetent_r_proto'
24338 endprotoent_r_proto='$endprotoent_r_proto'
24339 endpwent_r_proto='$endpwent_r_proto'
24340 endservent_r_proto='$endservent_r_proto'
24341 eunicefix='$eunicefix'
24344 extensions='$extensions'
24345 extern_C='$extern_C'
24347 fflushNULL='$fflushNULL'
24348 fflushall='$fflushall'
24350 firstmakefile='$firstmakefile'
24352 fpossize='$fpossize'
24353 fpostype='$fpostype'
24354 freetype='$freetype'
24357 full_csh='$full_csh'
24358 full_sed='$full_sed'
24359 gccansipedantic='$gccansipedantic'
24360 gccosandvers='$gccosandvers'
24361 gccversion='$gccversion'
24362 getgrent_r_proto='$getgrent_r_proto'
24363 getgrgid_r_proto='$getgrgid_r_proto'
24364 getgrnam_r_proto='$getgrnam_r_proto'
24365 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24366 gethostbyname_r_proto='$gethostbyname_r_proto'
24367 gethostent_r_proto='$gethostent_r_proto'
24368 getlogin_r_proto='$getlogin_r_proto'
24369 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24370 getnetbyname_r_proto='$getnetbyname_r_proto'
24371 getnetent_r_proto='$getnetent_r_proto'
24372 getprotobyname_r_proto='$getprotobyname_r_proto'
24373 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24374 getprotoent_r_proto='$getprotoent_r_proto'
24375 getpwent_r_proto='$getpwent_r_proto'
24376 getpwnam_r_proto='$getpwnam_r_proto'
24377 getpwuid_r_proto='$getpwuid_r_proto'
24378 getservbyname_r_proto='$getservbyname_r_proto'
24379 getservbyport_r_proto='$getservbyport_r_proto'
24380 getservent_r_proto='$getservent_r_proto'
24381 getspnam_r_proto='$getspnam_r_proto'
24382 gidformat='$gidformat'
24388 gmtime_r_proto='$gmtime_r_proto'
24389 gnulibc_version='$gnulibc_version'
24391 groupcat='$groupcat'
24392 groupstype='$groupstype'
24395 h_sysfile='$h_sysfile'
24398 hostgenerate='$hostgenerate'
24399 hostosname='$hostosname'
24400 hostperl='$hostperl'
24401 html1dir='$html1dir'
24402 html1direxp='$html1direxp'
24403 html3dir='$html3dir'
24404 html3direxp='$html3direxp'
24413 i_arpainet='$i_arpainet'
24415 i_bsdioctl='$i_bsdioctl'
24419 i_dirent='$i_dirent'
24421 i_execinfo='$i_execinfo'
24425 i_fp_class='$i_fp_class'
24427 i_gdbm_ndbm='$i_gdbm_ndbm'
24428 i_gdbmndbm='$i_gdbmndbm'
24430 i_ieeefp='$i_ieeefp'
24431 i_inttypes='$i_inttypes'
24432 i_langinfo='$i_langinfo'
24433 i_libutil='$i_libutil'
24434 i_locale='$i_locale'
24435 i_machcthr='$i_machcthr'
24436 i_malloc='$i_malloc'
24437 i_mallocmalloc='$i_mallocmalloc'
24438 i_mntent='$i_mntent'
24441 i_neterrno='$i_neterrno'
24442 i_netinettcp='$i_netinettcp'
24446 i_pthread='$i_pthread'
24448 i_quadmath='$i_quadmath'
24449 i_rpcsvcdbm='$i_rpcsvcdbm'
24451 i_shadow='$i_shadow'
24453 i_stdbool='$i_stdbool'
24454 i_stdint='$i_stdint'
24455 i_stdlib='$i_stdlib'
24456 i_sunmath='$i_sunmath'
24457 i_sysaccess='$i_sysaccess'
24458 i_sysdir='$i_sysdir'
24459 i_sysfile='$i_sysfile'
24460 i_sysfilio='$i_sysfilio'
24462 i_sysioctl='$i_sysioctl'
24463 i_syslog='$i_syslog'
24464 i_sysmman='$i_sysmman'
24465 i_sysmode='$i_sysmode'
24466 i_sysmount='$i_sysmount'
24467 i_sysndir='$i_sysndir'
24468 i_sysparam='$i_sysparam'
24469 i_syspoll='$i_syspoll'
24470 i_sysresrc='$i_sysresrc'
24471 i_syssecrt='$i_syssecrt'
24472 i_sysselct='$i_sysselct'
24473 i_syssockio='$i_syssockio'
24474 i_sysstat='$i_sysstat'
24475 i_sysstatfs='$i_sysstatfs'
24476 i_sysstatvfs='$i_sysstatvfs'
24477 i_systime='$i_systime'
24478 i_systimek='$i_systimek'
24479 i_systimes='$i_systimes'
24480 i_systypes='$i_systypes'
24481 i_sysuio='$i_sysuio'
24483 i_sysutsname='$i_sysutsname'
24484 i_sysvfs='$i_sysvfs'
24485 i_syswait='$i_syswait'
24486 i_termio='$i_termio'
24487 i_termios='$i_termios'
24489 i_unistd='$i_unistd'
24494 i_xlocale='$i_xlocale'
24495 ignore_versioned_solibs='$ignore_versioned_solibs'
24496 inc_version_list='$inc_version_list'
24497 inc_version_list_init='$inc_version_list_init'
24501 initialinstalllocation='$initialinstalllocation'
24502 installarchlib='$installarchlib'
24503 installbin='$installbin'
24504 installhtml1dir='$installhtml1dir'
24505 installhtml3dir='$installhtml3dir'
24506 installman1dir='$installman1dir'
24507 installman3dir='$installman3dir'
24508 installprefix='$installprefix'
24509 installprefixexp='$installprefixexp'
24510 installprivlib='$installprivlib'
24511 installscript='$installscript'
24512 installsitearch='$installsitearch'
24513 installsitebin='$installsitebin'
24514 installsitehtml1dir='$installsitehtml1dir'
24515 installsitehtml3dir='$installsitehtml3dir'
24516 installsitelib='$installsitelib'
24517 installsiteman1dir='$installsiteman1dir'
24518 installsiteman3dir='$installsiteman3dir'
24519 installsitescript='$installsitescript'
24520 installstyle='$installstyle'
24521 installusrbinperl='$installusrbinperl'
24522 installvendorarch='$installvendorarch'
24523 installvendorbin='$installvendorbin'
24524 installvendorhtml1dir='$installvendorhtml1dir'
24525 installvendorhtml3dir='$installvendorhtml3dir'
24526 installvendorlib='$installvendorlib'
24527 installvendorman1dir='$installvendorman1dir'
24528 installvendorman3dir='$installvendorman3dir'
24529 installvendorscript='$installvendorscript'
24531 issymlink='$issymlink'
24532 ivdformat='$ivdformat'
24535 known_extensions='$known_extensions'
24538 ld_can_script='$ld_can_script'
24539 lddlflags='$lddlflags'
24541 ldflags_uselargefiles='$ldflags_uselargefiles'
24542 ldlibpthname='$ldlibpthname'
24549 libsdirs='$libsdirs'
24550 libsfiles='$libsfiles'
24551 libsfound='$libsfound'
24552 libspath='$libspath'
24553 libswanted='$libswanted'
24554 libswanted_uselargefiles='$libswanted_uselargefiles'
24560 localtime_r_proto='$localtime_r_proto'
24561 locincpth='$locincpth'
24562 loclibpth='$loclibpth'
24563 longdblinfbytes='$longdblinfbytes'
24564 longdblkind='$longdblkind'
24565 longdblmantbits='$longdblmantbits'
24566 longdblnanbytes='$longdblnanbytes'
24567 longdblsize='$longdblsize'
24568 longlongsize='$longlongsize'
24569 longsize='$longsize'
24573 lseeksize='$lseeksize'
24574 lseektype='$lseektype'
24578 make_set_make='$make_set_make'
24579 mallocobj='$mallocobj'
24580 mallocsrc='$mallocsrc'
24581 malloctype='$malloctype'
24583 man1direxp='$man1direxp'
24586 man3direxp='$man3direxp'
24588 mips_type='$mips_type'
24589 mistrustnm='$mistrustnm'
24591 mmaptype='$mmaptype'
24592 modetype='$modetype'
24594 multiarch='$multiarch'
24596 myarchname='$myarchname'
24597 mydomain='$mydomain'
24598 myhostname='$myhostname'
24601 need_va_copy='$need_va_copy'
24602 netdb_hlen_type='$netdb_hlen_type'
24603 netdb_host_type='$netdb_host_type'
24604 netdb_name_type='$netdb_name_type'
24605 netdb_net_type='$netdb_net_type'
24608 nm_so_opt='$nm_so_opt'
24609 nonxs_ext='$nonxs_ext'
24611 nvEUformat='$nvEUformat'
24612 nvFUformat='$nvFUformat'
24613 nvGUformat='$nvGUformat'
24614 nv_overflows_integers_at='$nv_overflows_integers_at'
24615 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24616 nveformat='$nveformat'
24617 nvfformat='$nvfformat'
24618 nvgformat='$nvgformat'
24619 nvmantbits='$nvmantbits'
24622 o_nonblock='$o_nonblock'
24624 old_pthread_create_joinable='$old_pthread_create_joinable'
24625 optimize='$optimize'
24626 orderlib='$orderlib'
24629 otherlibdirs='$otherlibdirs'
24633 patchlevel='$patchlevel'
24634 path_sep='$path_sep'
24637 perl_patchlevel='$perl_patchlevel'
24638 perl_static_inline='$perl_static_inline'
24639 perladmin='$perladmin'
24640 perllibs='$perllibs'
24641 perlpath='$perlpath'
24643 phostname='$phostname'
24649 prefixexp='$prefixexp'
24651 privlibexp='$privlibexp'
24652 procselfexe='$procselfexe'
24654 quadkind='$quadkind'
24655 quadtype='$quadtype'
24656 randbits='$randbits'
24657 randfunc='$randfunc'
24658 random_r_proto='$random_r_proto'
24659 randseedtype='$randseedtype'
24661 rd_nodata='$rd_nodata'
24662 readdir64_r_proto='$readdir64_r_proto'
24663 readdir_r_proto='$readdir_r_proto'
24664 revision='$revision'
24670 sGMTIME_max='$sGMTIME_max'
24671 sGMTIME_min='$sGMTIME_min'
24672 sLOCALTIME_max='$sLOCALTIME_max'
24673 sLOCALTIME_min='$sLOCALTIME_min'
24674 sPRIEUldbl='$sPRIEUldbl'
24675 sPRIFUldbl='$sPRIFUldbl'
24676 sPRIGUldbl='$sPRIGUldbl'
24677 sPRIXU64='$sPRIXU64'
24679 sPRIeldbl='$sPRIeldbl'
24680 sPRIfldbl='$sPRIfldbl'
24681 sPRIgldbl='$sPRIgldbl'
24686 sSCNfldbl='$sSCNfldbl'
24687 sched_yield='$sched_yield'
24688 scriptdir='$scriptdir'
24689 scriptdirexp='$scriptdirexp'
24691 seedfunc='$seedfunc'
24692 selectminbits='$selectminbits'
24693 selecttype='$selecttype'
24694 sendmail='$sendmail'
24695 setgrent_r_proto='$setgrent_r_proto'
24696 sethostent_r_proto='$sethostent_r_proto'
24697 setlocale_r_proto='$setlocale_r_proto'
24698 setnetent_r_proto='$setnetent_r_proto'
24699 setprotoent_r_proto='$setprotoent_r_proto'
24700 setpwent_r_proto='$setpwent_r_proto'
24701 setservent_r_proto='$setservent_r_proto'
24704 sharpbang='$sharpbang'
24705 shmattype='$shmattype'
24706 shortsize='$shortsize'
24709 sig_count='$sig_count'
24710 sig_name='$sig_name'
24711 sig_name_init='$sig_name_init'
24713 sig_num_init='$sig_num_init'
24714 sig_size='$sig_size'
24715 signal_t='$signal_t'
24716 sitearch='$sitearch'
24717 sitearchexp='$sitearchexp'
24719 sitebinexp='$sitebinexp'
24720 sitehtml1dir='$sitehtml1dir'
24721 sitehtml1direxp='$sitehtml1direxp'
24722 sitehtml3dir='$sitehtml3dir'
24723 sitehtml3direxp='$sitehtml3direxp'
24725 sitelib_stem='$sitelib_stem'
24726 sitelibexp='$sitelibexp'
24727 siteman1dir='$siteman1dir'
24728 siteman1direxp='$siteman1direxp'
24729 siteman3dir='$siteman3dir'
24730 siteman3direxp='$siteman3direxp'
24731 siteprefix='$siteprefix'
24732 siteprefixexp='$siteprefixexp'
24733 sitescript='$sitescript'
24734 sitescriptexp='$sitescriptexp'
24735 sizesize='$sizesize'
24736 sizetype='$sizetype'
24740 sockethdr='$sockethdr'
24741 socketlib='$socketlib'
24742 socksizetype='$socksizetype'
24744 spackage='$spackage'
24745 spitshell='$spitshell'
24746 srand48_r_proto='$srand48_r_proto'
24747 srandom_r_proto='$srandom_r_proto'
24749 ssizetype='$ssizetype'
24750 st_ino_sign='$st_ino_sign'
24751 st_ino_size='$st_ino_size'
24752 startperl='$startperl'
24754 static_ext='$static_ext'
24756 stdio_base='$stdio_base'
24757 stdio_bufsiz='$stdio_bufsiz'
24758 stdio_cnt='$stdio_cnt'
24759 stdio_filbuf='$stdio_filbuf'
24760 stdio_ptr='$stdio_ptr'
24761 stdio_stream_array='$stdio_stream_array'
24762 strerror_r_proto='$strerror_r_proto'
24764 subversion='$subversion'
24769 targetarch='$targetarch'
24770 targetdir='$targetdir'
24771 targetenv='$targetenv'
24772 targethost='$targethost'
24773 targetmkdir='$targetmkdir'
24774 targetport='$targetport'
24775 targetsh='$targetsh'
24779 timeincl='$timeincl'
24780 timetype='$timetype'
24781 tmpnam_r_proto='$tmpnam_r_proto'
24787 ttyname_r_proto='$ttyname_r_proto'
24796 uidformat='$uidformat'
24802 uquadtype='$uquadtype'
24803 use5005threads='$use5005threads'
24804 use64bitall='$use64bitall'
24805 use64bitint='$use64bitint'
24806 usecbacktrace='$usecbacktrace'
24807 usecrosscompile='$usecrosscompile'
24808 usedevel='$usedevel'
24810 usedtrace='$usedtrace'
24811 usefaststdio='$usefaststdio'
24812 usei18n_lang='$i18n_lang'
24813 useithreads='$useithreads'
24814 usekernprocpathname='$usekernprocpathname'
24815 uselargefiles='$uselargefiles'
24816 uselongdouble='$uselongdouble'
24817 usemallocwrap='$usemallocwrap'
24818 usemorebits='$usemorebits'
24819 usemultiplicity='$usemultiplicity'
24820 usemymalloc='$usemymalloc'
24822 usensgetexecutablepath='$usensgetexecutablepath'
24823 useopcode='$useopcode'
24824 useperlio='$useperlio'
24825 useposix='$useposix'
24826 usequadmath='$usequadmath'
24827 usereentrant='$usereentrant'
24828 userelocatableinc='$userelocatableinc'
24829 useshrplib='$useshrplib'
24830 usesitecustomize='$usesitecustomize'
24831 usesocks='$usesocks'
24832 usethreads='$usethreads'
24833 usevendorprefix='$usevendorprefix'
24834 useversionedarchname='$useversionedarchname'
24835 usevfork='$usevfork'
24838 uvXUformat='$uvXUformat'
24839 uvoformat='$uvoformat'
24842 uvuformat='$uvuformat'
24843 uvxformat='$uvxformat'
24844 vendorarch='$vendorarch'
24845 vendorarchexp='$vendorarchexp'
24846 vendorbin='$vendorbin'
24847 vendorbinexp='$vendorbinexp'
24848 vendorhtml1dir='$vendorhtml1dir'
24849 vendorhtml1direxp='$vendorhtml1direxp'
24850 vendorhtml3dir='$vendorhtml3dir'
24851 vendorhtml3direxp='$vendorhtml3direxp'
24852 vendorlib='$vendorlib'
24853 vendorlib_stem='$vendorlib_stem'
24854 vendorlibexp='$vendorlibexp'
24855 vendorman1dir='$vendorman1dir'
24856 vendorman1direxp='$vendorman1direxp'
24857 vendorman3dir='$vendorman3dir'
24858 vendorman3direxp='$vendorman3direxp'
24859 vendorprefix='$vendorprefix'
24860 vendorprefixexp='$vendorprefixexp'
24861 vendorscript='$vendorscript'
24862 vendorscriptexp='$vendorscriptexp'
24864 version_patchlevel_string='$version_patchlevel_string'
24865 versiononly='$versiononly'
24869 yaccflags='$yaccflags'
24874 : add special variables
24875 $test -f $src/patchlevel.h && \
24876 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24877 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24878 echo "PERL_CONFIG_SH=true" >>config.sh
24880 : propagate old symbols
24881 if $test -f UU/config.sh; then
24882 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24883 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24884 config.sh config.sh UU/oldconfig.sh |\
24885 $sort | $uniq -u >UU/oldsyms
24886 set X `$cat UU/oldsyms`
24892 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24894 echo ": Variables propagated from previous config.sh file." >>config.sh
24895 for sym in `$cat UU/oldsyms`; do
24896 echo " Propagating $hint variable "'$'"$sym..."
24897 eval 'tmp="$'"${sym}"'"'
24899 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24905 : preserve RCS keywords in files with variable substitution, grrr
24908 : Finish up by extracting the .SH files
24911 echo "Stopping at your request, leaving temporary files around."
24921 If you'd like to make any changes to the config.sh file before I begin
24922 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24925 rp="Press return or use a shell escape to edit config.sh:"
24930 *) : in case they cannot read
24931 sh 1>&4 -c "$ans";;
24936 : if this fails, just run all the .SH files by hand
24945 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24952 Now you need to generate make dependencies by running "$make depend".
24953 You might prefer to run it in background: "$make depend > makedepend.out &"
24954 It can take a while, so you might not want to run it right now.
24959 rp="Run $make depend now?"
24963 $make depend && echo "Now you must run '$make'."
24966 echo "You must run '$make depend' then '$make'."
24969 elif test -f [Mm]akefile; then
24971 echo "Now you must run a $make."
24973 echo "Configure done."
24976 if $test -f Policy.sh; then
24979 If you compile $package on a different machine or from a different object
24980 directory, copy the Policy.sh file from this object directory to the
24981 new one before you run Configure -- this will help you with most of
24982 the policy defaults.
24986 if $test -f UU/config.msg; then
24987 echo "Hmm. I also noted the following information while running:"
24989 $cat UU/config.msg >&4
24991 $rm -f kit*isdone ark*isdone