3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # (with additional metaconfig patches by perlbug@perl.org)
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
345 useversionedarchname=''
351 initialinstalllocation=''
383 d_attribute_deprecated=''
384 d_attribute_format=''
385 d_attribute_malloc=''
386 d_attribute_nonnull=''
387 d_attribute_noreturn=''
389 d_attribute_unused=''
390 d_attribute_warn_unused_result=''
391 d_printf_format_null=''
393 d_builtin_choose_expr=''
395 d_builtin_add_overflow=''
396 d_builtin_mul_overflow=''
397 d_builtin_sub_overflow=''
398 d_c99_variadic_macros=''
447 endhostent_r_proto=''
453 endprotoent_r_proto=''
459 endservent_r_proto=''
531 gethostbyaddr_r_proto=''
533 gethostbyname_r_proto=''
535 gethostent_r_proto=''
548 getnetbyaddr_r_proto=''
550 getnetbyname_r_proto=''
564 d_getprotobyname_r=''
565 getprotobyname_r_proto=''
566 d_getprotobynumber_r=''
567 getprotobynumber_r_proto=''
569 getprotoent_r_proto=''
581 getservbyname_r_proto=''
583 getservbyport_r_proto=''
585 getservent_r_proto=''
618 d_lc_monetary_2008=''
623 d_libm_lib_version=''
631 d_localtime_r_needs_tzset=''
639 d_long_double_style_ieee=''
640 d_long_double_style_ieee_doubledouble=''
641 d_long_double_style_ieee_extended=''
642 d_long_double_style_ieee_std=''
643 d_long_double_style_vax=''
656 d_malloc_good_size=''
697 d_thread_safe_nl_langinfo_l=''
710 d_old_pthread_create_joinable=''
711 old_pthread_create_joinable=''
713 d_pthread_attr_setscope=''
758 sethostent_r_proto=''
775 setprotoent_r_proto=''
787 setservent_r_proto=''
800 d_siginfo_si_errno=''
803 d_siginfo_si_status=''
805 d_siginfo_si_value=''
815 d_ipv6_mreq_source=''
844 perl_static_inline=''
849 d_stdio_ptr_lval_nochange_cnt=''
850 d_stdio_ptr_lval_sets_cnt=''
929 default_inc_excludes_dot=''
995 d_gdbm_ndbm_h_uses_prototypes=''
996 d_gdbmndbm_h_uses_prototypes=''
998 d_ndbm_h_uses_prototypes=''
1068 d_inc_version_list=''
1070 inc_version_list_init=''
1078 installusrbinperl=''
1094 ignore_versioned_solibs=''
1110 d_double_has_negative_zero=''
1111 d_double_has_subnormals=''
1112 d_double_style_cray=''
1113 d_double_style_ibm=''
1114 d_double_style_ieee=''
1115 d_double_style_vax=''
1166 d_perl_otherlibdirs=''
1174 api_versionstring=''
1180 version_patchlevel_string=''
1184 d_nv_preserves_uv=''
1185 d_nv_zero_is_allbits_zero=''
1196 nv_overflows_integers_at=''
1197 nv_preserves_uv_bits=''
1269 installsitehtml1dir=''
1272 installsitehtml3dir=''
1279 installsiteman1dir=''
1282 installsiteman3dir=''
1287 installsitescript=''
1305 d_stdio_stream_array=''
1306 stdio_stream_array=''
1324 usekernprocpathname=''
1325 ccflags_uselargefiles=''
1326 ldflags_uselargefiles=''
1327 libswanted_uselargefiles=''
1336 usensgetexecutablepath=''
1349 installvendorarch=''
1356 installvendorhtml1dir=''
1358 vendorhtml1direxp=''
1359 installvendorhtml3dir=''
1361 vendorhtml3direxp=''
1367 installvendorman1dir=''
1370 installvendorman3dir=''
1377 installvendorscript=''
1388 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1391 : We must find out about Eunice early
1393 if test -f /etc/unixtovms; then
1394 eunicefix=/etc/unixtovms
1396 if test -f /etc/unixtovms.exe; then
1397 eunicefix=/etc/unixtovms.exe
1400 : Set executable suffix now -- needed before hints available
1401 if test -f "/libs/version.library"; then
1404 elif test -f "/system/gnu_library/bin/ar.pm"; then
1407 elif test -n "$DJGPP"; then
1410 elif test -f /kern/cookiejar; then
1413 elif test -d c:/. -o -n "$is_os2" ; then
1420 : Possible local include directories to search.
1421 : Set locincpth to "" in a hint file to defeat local include searches.
1422 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1423 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1425 : no include file wanted by default
1428 : Enable -DEBUGGING and -DDEBUGGING from the command line
1432 : Trailing extension. Override this in a hint file, if needed.
1433 : Extra object files, if any, needed on this platform.
1436 : change the next line if compiling for Xenix/286 on Xenix/386
1437 xlibpth='/usr/lib/386 /lib/386'
1438 : Possible local library directories to search.
1439 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1440 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1442 : general looking path for locating libraries
1443 glibpth="/lib /usr/lib $xlibpth"
1444 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1445 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1446 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1447 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1449 : Private path used by Configure to find libraries. Its value
1450 : is prepended to libpth. This variable takes care of special
1451 : machines, like the mips. Usually, it should be empty.
1454 : default library list
1456 : some systems want to use only the non-versioned libso:s
1457 ignore_versioned_solibs=''
1461 : set useposix=false in your hint file to disable the POSIX extension.
1463 : set useopcode=false in your hint file to disable the Opcode extension.
1466 ccflags_uselargefiles=''
1467 ldflags_uselargefiles=''
1468 libswanted_uselargefiles=''
1469 : set usemultiplicity on the Configure command line to enable multiplicity.
1470 : set usesocks on the Configure command line to enable socks.
1472 : set usethreads on the Configure command line to enable threads.
1473 usereentrant='undef'
1474 : List of libraries we want.
1475 : If anyone needs extra -lxxx, put those in a hint file.
1476 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1477 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1478 : We probably want to search /usr/shlib before most other libraries.
1479 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1480 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1481 glibpth="/usr/shlib $glibpth"
1482 : Do not use vfork unless overridden by a hint file.
1485 : Find the basic shell for Bourne shell scripts
1489 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1492 if test -f "$xxx"; then
1495 : Build up a list and do a single loop so we can 'break' out.
1496 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1497 for xxx in sh bash ksh pdksh ash; do
1499 try="$try ${p}/${xxx}"
1503 if test -f "$xxx"; then
1506 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1509 elif test -f "$xxx.exe"; then
1520 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1522 Usually it's in /bin/sh. How did you even get this far?
1523 Please contact me (Perl Maintainers) at perlbug@perl.org and
1524 we'll try to straighten this all out.
1530 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1531 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1534 : see if sh knows # comments
1535 if `$sh -c '#' >/dev/null 2>&1`; then
1539 test -f $xcat$_exe || xcat=/usr/bin/cat
1540 if test ! -f $xcat$_exe; then
1541 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1542 if test -f $p/cat$_exe; then
1547 if test ! -f $xcat$_exe; then
1548 echo "Can't find cat anywhere!"
1552 echo "#!$xcat" >sharp
1555 ./sharp > today 2>/dev/null
1556 if test -s today; then
1559 echo "#! $xcat" > sharp
1562 ./sharp > today 2>/dev/null
1563 if test -s today; then
1571 echo "Your $sh doesn't grok # comments--I will strip them later on."
1574 echo "exec grep -v '^[ ]*#'" >spitshell
1576 $eunicefix spitshell
1577 spitshell=`pwd`/spitshell
1579 echo "I presume that if # doesn't work, #! won't work either!"
1584 : figure out how to guarantee sh startup
1586 '') startsh=${sharpbang}${sh} ;;
1598 : echo "Yup, it does."
1600 echo "Hmm... '$startsh' does not guarantee sh startup..."
1601 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1605 : Save command line options in file UU/cmdline.opt for later use in
1606 : generating config.sh.
1607 cat > cmdline.opt <<EOSH
1608 : Configure command line arguments.
1617 cat >>cmdline.opt <<EOSH
1618 config_arg$argn='$arg'
1620 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1623 arg_exp=`cat cmdl.opt`
1624 args_exp="$args_exp$args_sep'$arg_exp'"
1625 argn=`expr $argn + 1`
1630 : produce awk script to parse command line options
1631 cat >options.awk <<'EOF'
1633 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1635 len = length(optstr);
1636 for (i = 1; i <= len; i++) {
1637 c = substr(optstr, i, 1);
1638 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1649 if (substr(str, 1, 1) != "-") {
1650 printf("'%s'\n", str);
1654 for (i = 2; i <= len; i++) {
1655 c = substr(str, i, 1);
1657 printf("-%s\n", substr(str, i));
1663 printf("'%s'\n", substr(str, i + 1));
1676 : process the command line options
1677 set X `for arg in "$@"; do echo "X$arg"; done |
1678 sed -e s/X// | awk -f options.awk`
1683 : set up default values
1692 rm -f optdef.sh posthint.sh
1693 cat >optdef.sh <<EOS
1699 while test $# -gt 0; do
1701 -d) shift; fastread=yes;;
1702 -e) shift; alldone=cont;;
1706 if test -r "$1"; then
1709 echo "$me: cannot read config file $1." >&2
1715 -h) shift; error=true;;
1716 -r) shift; reuseval=true;;
1717 -s) shift; silent=true; realsilent=true;;
1718 -E) shift; alldone=exit;;
1719 -K) shift; knowitall=true;;
1721 -S) shift; silent=true; extractsh=true;;
1726 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1727 echo "$me: ignoring -D $1" >&2
1730 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1731 *) echo "$1='define'" >> optdef.sh;;
1738 *=) echo "$1" >> optdef.sh;;
1740 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1741 echo "$me: ignoring -U $1" >&2
1743 *) echo "$1='undef'" >> optdef.sh;;
1754 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1758 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1759 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1765 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1766 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1767 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1768 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1769 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1770 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1776 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1778 echo "$yyy=''" >> posthint.sh ;;
1783 echo "$yyy='$zzz'" >> posthint.sh ;;
1785 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1787 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1792 echo "$yyy=$zzz" >> posthint.sh ;;
1793 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1797 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1800 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1808 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1809 [-U symbol] [-U symbol=] [-A command:symbol...]
1810 -d : use defaults for all answers.
1811 -e : go on without questioning past the production of config.sh.
1812 -f : specify an alternate default configuration file.
1813 -h : print this help message and exit (with an error status).
1814 -r : reuse C symbols value if possible (skips costly nm extraction).
1815 -s : silent mode, only echoes questions and essential information.
1816 -D : define symbol to have some value:
1817 -D symbol symbol gets the value 'define'
1818 -D symbol=value symbol gets the value 'value'
1819 common used examples (see INSTALL for more info):
1820 -Duse64bitint use 64bit integers
1821 -Duse64bitall use 64bit integers and pointers
1822 -Dusethreads use thread support
1823 -Dinc_version_list=none do not include older perl trees in @INC
1824 -DEBUGGING=none DEBUGGING options
1825 -Dcc=gcc choose your compiler
1826 -Dprefix=/opt/perl5 choose your destination
1827 -E : stop at the end of questions, after having produced config.sh.
1828 -K : do not use unless you know what you are doing.
1829 -O : ignored for backward compatibility
1830 -S : perform variable substitutions on all .SH files (can mix with -f)
1831 -U : undefine symbol:
1832 -U symbol symbol gets the value 'undef'
1833 -U symbol= symbol gets completely empty
1835 -A : manipulate symbol after the platform specific hints have been applied:
1836 -A append:symbol=value append value to symbol
1837 -A symbol=value like append:, but with a separating space
1838 -A define:symbol=value define symbol to have value
1839 -A clear:symbol define symbol to be ''
1840 -A define:symbol define symbol to be 'define'
1841 -A eval:symbol=value define symbol to be eval of value
1842 -A prepend:symbol=value prepend value to symbol
1843 -A undef:symbol define symbol to be 'undef'
1844 -A undef:symbol= define symbol to be ''
1845 e.g.: -A prepend:libswanted='cl pthread '
1846 -A ccflags=-DSOME_MACRO
1847 -V : print version number and exit (with a zero status).
1854 case "$fastread$alldone" in
1857 case "$extractsh" in
1860 if test ! -t 0; then
1861 echo "Say 'sh Configure', not 'sh <Configure'"
1871 true) exec 1>/dev/null;;
1874 : run the defines and the undefines, if any, but leave the file out there...
1876 grep '\\' optdef.sh >/dev/null 2>&1
1877 if test $? = 0; then
1878 echo "Configure does not support \\ in -D arguments"
1882 : create the posthint manipulation script and leave the file out there...
1887 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1888 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1889 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1890 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1891 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1894 : Some greps do not return status, grrr.
1895 echo "grimblepritz" >grimble
1896 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1898 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1904 : the following should work in any shell
1908 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1909 cat >contains <<'EOSS'
1910 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1915 : Find the path to the source tree
1918 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1922 *) src=`cd ../$src && pwd` ;;
1935 if test -f $rsrc/Configure && \
1936 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1938 : found it, so we are ok.
1941 for src in . .. ../.. ../../.. ../../../..; do
1942 if test -f ../$src/Configure && \
1943 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1954 Sorry, I can't seem to locate the source dir for $package. Please start
1955 Configure with an explicit path -- i.e. /some/path/Configure.
1963 echo "Sources for $package found in \"$src\"." >&4
1967 : script used to extract .SH files with variable substitutions
1968 cat >extract <<'EOS'
1970 echo "Doing variable substitutions on .SH files..."
1971 if test -f MANIFEST; then
1972 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1974 echo "(Looking for .SH files under the source directory.)"
1975 set x `(cd "$src"; find . -name "*.SH" -print)`
1979 0) set x `(cd "$src"; echo *.SH)`; shift;;
1981 if test ! -f "$src/$1"; then
1987 while test $name; do
1988 if test ! -d "$name"; then
1989 create="$name $create";
1990 name=`echo $name | sed -e "s|^[^/]*$||"`;
1991 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1996 for file in $create; do
2005 dir=`expr X$file : 'X\(.*\)/'`
2006 file=`expr X$file : 'X.*/\(.*\)'`
2007 (cd "$dir" && . ./$file)
2017 dir=`expr X$file : 'X\(.*\)/'`
2018 file=`expr X$file : 'X.*/\(.*\)'`
2019 (set x $dir; shift; eval $mkdir_p)
2020 sh <"$src/$dir/$file"
2029 if test -f "$src/config_h.SH"; then
2030 if test ! -f config.h; then
2031 : oops, they left it out of MANIFEST, probably, so do it anyway.
2032 . "$src/config_h.SH"
2037 : extract files and exit if asked to do so
2038 case "$extractsh" in
2040 case "$realsilent" in
2044 case "$config_sh" in
2045 '') config_sh='config.sh';;
2048 echo "Fetching answers from $config_sh..."
2055 echo "Extraction done."
2060 : Eunice requires " " instead of "", can you believe it
2063 echo "Beginning of configuration questions for $package."
2065 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2067 : first determine how to suppress newline on echo command
2069 echo "Checking echo to see how to suppress newlines..."
2070 (echo "hi there\c" ; echo " ") >.echotmp
2071 if $contains c .echotmp >/dev/null 2>&1 ; then
2082 echo $n "The star should be here-->$c"
2086 : Now test for existence of everything in MANIFEST
2088 if test -f "$rsrc/MANIFEST"; then
2089 echo "First let's make sure your kit is complete. Checking..." >&4
2090 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2091 (split -l 50 2>/dev/null || split -50)
2094 for filelist in x??; do
2095 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2096 >/dev/null 2>>"$tmppwd/missing")
2098 if test -s missing; then
2102 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2104 You have the option of continuing the configuration process, despite the
2105 distinct possibility that your kit is damaged, by typing 'y'es. If you
2106 do, don't blame me if something goes wrong. I advise you to type 'n'o
2107 and contact the author (perlbug@perl.org).
2110 echo $n "Continue? [n] $c" >&4
2114 echo "Continuing..." >&4
2118 echo "ABORTING..." >&4
2123 echo "Looks good..."
2126 echo "There is no MANIFEST file. I hope your kit is complete !"
2130 : Find the appropriate value for a newline for tr
2131 if test -n "$DJGPP"; then
2134 if test X"$trnl" = X; then
2135 case "`echo foo | tr '\n' x 2>/dev/null`" in
2139 if test X"$trnl" = X; then
2140 case "`echo foo | tr '\012' x 2>/dev/null`" in
2141 foox) trnl='\012' ;;
2144 if test X"$trnl" = X; then
2145 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2146 fooxy) trnl='\n\r' ;;
2149 if test X"$trnl" = X; then
2152 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2158 : compute the number of columns on the terminal for proper question formatting
2163 : set up the echo used in my read
2164 myecho="case \"\$xxxm\" in
2165 '') echo $n \"\$rp $c\" >&4;;
2167 '') echo $n \"[\$xxxm] $c\";;
2169 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2171 echo $n \"[\$xxxm] $c\" >&4
2173 echo $n \"\$rp [\$xxxm] $c\" >&4
2179 : now set up to do reads with possible shell escape and default assignment
2185 case "\$fastread" in
2186 yes) case "\$dflt" in
2189 case "\$silent-\$rp" in
2194 *) case "\$silent" in
2195 true) case "\$rp" in
2200 while expr "X\$ans" : "X!" >/dev/null; do
2204 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2212 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2221 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2226 echo "(OK, I'll run with -d after this question.)" >&4
2229 echo "*** Sorry, \$1 not supported yet." >&4
2239 echo "*** Substitution done -- please confirm."
2241 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2246 echo "*** Error -- try again."
2253 case "\$ans\$xxxm\$nostick" in
2265 : create .config dir to save info across Configure sessions
2266 test -d ../.config || mkdir ../.config
2267 cat >../.config/README <<EOF
2268 This directory created by Configure to save information that should
2269 persist across sessions for $package.
2271 You may safely delete it if you wish.
2274 : See if we are using a devel version and want that
2275 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2278 usedevel="$define" ;;
2279 *) case "$xversion" in
2282 *** WHOA THERE!!! ***
2284 This is an UNSTABLE DEVELOPMENT release.
2285 The version of this $package distribution is $xversion, that is, odd,
2286 (as opposed to even) and that signifies a development release.
2287 If you want a maintenance release, you want an even-numbered version.
2289 Do ***NOT*** install this into production use.
2290 Data corruption and crashes are possible.
2292 It is most seriously suggested that you do not continue any further
2293 unless you want to help in developing and debugging Perl.
2295 If you *still* want to build perl, you can answer 'y' now,
2296 or pass -Dusedevel to Configure.
2299 rp='Do you really want to continue?'
2303 [yY]) echo >&4 "Okay, continuing."
2304 usedevel="$define" ;;
2305 *) echo >&4 "Okay, bye."
2316 case "$versiononly" in
2317 '') versiononly="$define" ;;
2319 case "$installusrbinperl" in
2320 '') installusrbinperl="$undef" ;;
2325 : general instructions
2328 user=`(logname) 2>/dev/null`
2330 '') user=`whoami 2>&1`;;
2332 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2335 rp='Would you like to see the instructions?'
2346 This installation shell script will examine your system and ask you questions
2347 to determine how the perl5 package should be installed. If you get
2348 stuck on a question, you may use a ! shell escape to start a subshell or
2349 execute a command. Many of the questions will have default answers in square
2350 brackets; typing carriage return will give you the default.
2352 On some of the questions which ask for file or directory names you are allowed
2353 to use the ~name construct to specify the login directory belonging to "name",
2354 even if you don't have a shell which knows about that. Questions where this is
2355 allowed will be marked "(~name ok)".
2359 dflt='Type carriage return to continue'
2363 The prompter used in this script allows you to use shell variables and
2364 backticks in your answers. You may use $1, $2, etc... to refer to the words
2365 in the default answer, as if the default line was a set of arguments given to a
2366 script shell. This means you may also use $* to repeat the whole default line,
2367 so you do not have to re-type everything to add something to the default.
2369 Every time there is a substitution, you will have to confirm. If there is an
2370 error (e.g. an unmatched backtick), the default answer will remain unchanged
2371 and you will be prompted again.
2373 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2374 the questions and use the computed defaults (or the previous answers if there
2375 was already a config.sh file). Type 'Configure -h' for a list of options.
2376 You may also start interactively and then answer '& -d' at any prompt to turn
2377 on the non-interactive behaviour for the remainder of the execution.
2383 Much effort has been expended to ensure that this shell script will run on any
2384 Unix system. If despite that it blows up on yours, your best bet is to edit
2385 Configure and run it again. If you can't run Configure for some reason,
2386 you'll have to generate a config.sh file by hand. Whatever problems you
2387 have, let me (perlbug@perl.org) know how I blew it.
2389 This installation script affects things in two ways:
2391 1) it may do direct variable substitutions on some of the files included
2393 2) it builds a config.h file for inclusion in C programs. You may edit
2394 any of these files as the need arises after running this script.
2396 If you make a mistake on a question, there is no easy way to back up to it
2397 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2398 files. Configure will offer to let you do this before it runs the SH files.
2401 dflt='Type carriage return to continue'
2403 case "$firsttime" in
2404 true) echo $user >>../.config/instruct;;
2408 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2409 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2410 if test "X$sysroot" = X; then
2415 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2416 # _sysroot is used in places where we need --sysroot=foo
2417 # but using the rest of the flags could cause issues.
2418 _sysroot="--sysroot=$sysroot";
2422 ccflags="$ccflags $_sysroot"
2427 ldflags="$ldflags $_sysroot"
2432 cppflags="$cppflags $_sysroot"
2434 # lddlflags updated below in lddlflags section;
2435 # same with cccdlflags
2439 # Adjust some defaults to also use $sysroot
2440 for var in xlibpth loclibpth locincpth glibpth; do
2443 for path in $xxx; do
2444 eval $var=\"\$$var $sysroot$path\"
2450 : find out where common programs are
2452 echo "Locating common programs..." >&4
2465 if test -d \$dir/\$thing; then
2471 for thisthing in \$dir/\$thing; do
2472 : just loop through to pick last item
2474 if test -f \$thisthing; then
2477 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2480 elif test -f \$dir/\$thing.exe; then
2481 if test -n "$DJGPP"; then
2482 echo \$dir/\$thing.exe
2483 elif test "$eunicefix" != ":"; then
2484 : on Eunice apparently
2537 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2538 pth="$pth $sysroot/lib $sysroot/usr/lib"
2539 for file in $loclist; do
2543 if test -f "$xxx"; then
2546 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2547 xxx=`./loc $file $file $pth`
2550 '') xxx=`./loc $file $file $pth`;;
2551 *) xxx=`./loc $xxx $xxx $pth`;;
2553 eval $file=$xxx$_exe
2557 echo $file is in $xxx.
2560 echo $file is in $xxx.
2563 echo "I don't know where '$file' is, and my life depends on it." >&4
2564 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2570 echo "Don't worry if any of the following aren't found..."
2572 for file in $trylist; do
2576 if test -f "$xxx"; then
2579 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2580 xxx=`./loc $file $file $pth`
2583 '') xxx=`./loc $file $file $pth`;;
2584 *) xxx=`./loc $xxx $xxx $pth`;;
2586 eval $file=$xxx$_exe
2590 echo $file is in $xxx.
2593 echo $file is in $xxx.
2596 echo "I don't see $file out there, $say."
2603 echo "Substituting grep for egrep."
2610 *) if $less -R </dev/null >/dev/null 2>&1; then
2611 echo "Substituting less -R for less."
2619 echo "Substituting cp for ln."
2628 echo "I can't find make or gmake, and my life depends on it." >&4
2629 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2637 *) # We can't have osname yet.
2638 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2639 # Assume that gmake, if found, is definitely GNU make
2640 # and prefer it over the system make.
2641 echo "Substituting gmake for make."
2649 echo "Hopefully test is built into your sh."
2652 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2653 echo "Using the test built into your sh."
2661 echo "Hopefully echo is built into your sh."
2666 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2667 $echo $n "hi there$c" >foo1
2668 echo $n "hi there$c" >foo2
2669 if cmp foo1 foo2 >/dev/null 2>&1; then
2670 echo "They are compatible. In fact, they may be identical."
2677 They are not compatible! You are probably running ksh on a non-USG system.
2678 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2679 have echo built in and we may have to run some Bourne shell scripts. That
2680 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2683 $echo $n "The star should be here-->$c"
2690 # This question was auctioned at YAPC::Europe-2007 in Vienna
2691 # I never promised you could answer it. I only auctioned the question.
2693 The following message is sponsored by
2695 Dresden.pm<--The stars should be here.
2697 Dear Perl user, system administrator or package
2698 maintainer, the Perl community sends greetings to
2699 you. Do you (emblematical) greet back [Y/n]? n
2703 : Check what type of C compiler we use
2707 cat <<'EOSC' >>trygcc
2712 int main(int argc, char *argv[]) {
2716 if $cc -o try $ccflags $ldflags try.c; then
2719 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2725 # Skip this test because it gives a false match on output like:
2726 # ./trygcc: line 23: cc: command not found
2727 # case "`$cc -v -c try.c 2>&1`" in
2728 # *gcc*) trygcc=no ;;
2730 if $test X"$trygcc" = Xyes; then
2731 if gcc -o try -c try.c; then
2733 echo "You seem to have a working gcc, though." >&4
2734 # Switching compilers may undo the work of hints files.
2735 # The most common problem is -D_REENTRANT for threads.
2736 # This heuristic catches that case, but gets false positives
2737 # if -Dusethreads was not actually specified. Better to
2738 # bail out here with a useful message than fail
2739 # mysteriously later. Should we perhaps just try to
2740 # re-invoke Configure -Dcc=gcc config_args ?
2741 if $test -f usethreads.cbu; then
2744 *** However, any setting of the C compiler flags (e.g. for thread support)
2745 *** will be lost. It may be necessary for you to restart Configure and
2746 *** add -Dcc=gcc to your Configure command line.
2749 rp="Would you like to go ahead and try gcc anyway?"
2752 rp="Would you like to use it?"
2755 if $test -f myread; then
2758 if $test -f UU/myread; then
2761 echo "Cannot find myread, sorry. Aborting." >&2
2766 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2779 cat <<'EOSC' >>checkcc
2784 int main(int argc, char *argv[]) {
2788 if $cc -o try $ccflags $ldflags try.c; then
2791 if $test X"$despair" = Xyes; then
2792 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2795 You need to find a working C compiler.
2796 Either (purchase and) install the C compiler supplied by your OS vendor,
2797 or for a free C compiler try http://gcc.gnu.org/
2798 I cannot continue any further, aborting.
2807 : determine whether symbolic links are supported
2810 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2811 echo "Symbolic links are supported." >&4
2814 echo "Symbolic links are NOT supported." >&4
2819 : determine whether symbolic links are supported
2823 echo "Checking how to test for symbolic links..." >&4
2825 if $test "X$issymlink" = X; then
2827 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2828 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2830 if test $? = 0; then
2833 echo "Your builtin 'test -h' may be broken." >&4
2836 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2839 if test -f "$p/$test"; then
2848 echo "Trying external '$test -h'." >&4
2849 issymlink="$test -h"
2850 if $test ! -h sym >/dev/null 2>&1; then
2851 echo "External '$test -h' is broken, too." >&4
2859 if $test "X$issymlink" = X; then
2860 if $test -L sym 2>/dev/null; then
2861 issymlink="$test -L"
2862 echo "The builtin '$test -L' worked." >&4
2865 if $test "X$issymlink" != X; then
2866 echo "You can test for symbolic links with '$issymlink'." >&4
2868 echo "I do not know how you can test for symbolic links." >&4
2872 *) echo "No symbolic links, so not testing for their testing..." >&4
2876 : Make symlinks util
2877 case "$mksymlinks" in
2880 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2883 *) case "$lns:$issymlink" in
2884 *"ln"*" -s:"*"test -"?)
2885 echo "Creating the symbolic links..." >&4
2887 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2897 print "# dir = ", dir, "file = ", file
2898 mf[dir] = mf[dir]" "source"/"dir"/"file;
2901 if (d != ".") { print("mkdir -p "d) }
2902 print("ln -sf "mf[d]" "d);
2904 }' source="$src" > UU/mksymlinks.$$
2908 if test ! -d t/base; then
2909 echo "Failed to create the subdirectories. Aborting." >&4
2913 if test ! -f t/base/lex.t; then
2914 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2917 if test ! -f win32/win32.c; then
2918 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2923 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2931 : Check for Cross-Compilation
2932 if $test "X$targethost" = "X"; then
2935 if $test "X$targetenv" = "X"; then
2938 case "$usecrosscompile" in
2940 $echo "Cross-compiling..."
2943 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2944 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2945 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2946 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2947 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2948 # leave out ld, choosing it is more complex
2949 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2950 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2951 # We are in a weird spot. Just before us, some values
2952 # were 'saved', to be restored after the hints are
2953 # run. This means that the changes we made to ar,
2954 # nm and ranlib will get reverted.
2955 # To avoid that, we hijack the saving mechanism and
2956 # have it save our new values.
2957 for file in ar nm ranlib; do
2959 eval $file=$xxx$_exe
2964 case "$targetarch" in
2965 '') echo "Targetarch not defined." >&4; croak=y ;;
2966 *) echo "Using targetarch $targetarch." >&4 ;;
2968 case "$targethost" in
2969 '') echo "Targethost not defined." >&4; croak=n ;;
2970 *) echo "Using targethost $targethost." >&4
2975 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2977 : compile a host miniperl and generate_uudmap, unless we got passed them
2978 if $test "X$hostperl" = X; then
2979 echo "Building host miniperl and generate_uudmap binaries" >&4
2987 $src/Configure -des -Dusedevel -Dmksymlinks
2989 case "$hostgenerate" in
2990 '') $make generate_uudmap
2991 hostgenerate=$src/host/generate_uudmap
2993 "$undef") hostgenerate=''
2996 hostperl=$src/host/miniperl
2999 hostosname=`$hostperl -le 'print $^O'`
3002 usecrosscompile="$undef"
3006 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3007 case "$targethost" in
3008 '') echo "Checking for cross-compile" >&4
3009 case "$usecrosscompile$multiarch" in
3010 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3011 if [ -f Makefile ]; then
3013 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3015 echo "Configure done."
3019 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3026 *) echo "Using targethost $targethost." >&4
3028 /*) run=$src/Cross/run
3029 targetmkdir=$src/Cross/mkdir
3031 from=$src/Cross/from
3033 *) pwd=`$test -f ../Configure & cd ..; pwd`
3035 targetmkdir=$pwd/Cross/mkdir
3037 from=$pwd/Cross/from
3040 case "$targetrun" in
3041 '') targetrun=ssh ;;
3046 case "$targetfrom" in
3047 '') targetfrom=scp ;;
3051 from=$from-$targetfrom
3052 case "$targetdir" in
3054 echo "Guessing targetdir $targetdir." >&4
3057 case "$targetuser" in
3059 echo "Guessing targetuser $targetuser." >&4
3062 case "$targetport" in
3064 echo "Guessing targetport $targetport." >&4
3067 case "$targetfrom" in
3071 case "$targetrun" in
3091 '') cwd=$targetdir ;;
3096 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3102 *) echo "Unknown targetrun '$targetrun'" >&4
3106 case "$targetmkdir" in
3108 cat >$targetmkdir <<EOF
3110 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3112 $chmod a+rx $targetmkdir
3114 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3126 $targetmkdir \`dirname \$f\`
3127 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3130 $targetmkdir $targetdir/\`dirname \$f\`
3131 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3144 $mkdir -p $targetdir/\`dirname \$f\`
3145 $cp \$f $targetdir/\$f || exit 1
3148 $targetmkdir $targetdir/\`dirname \$f\`
3149 $cp \$f $targetdir/\$f || exit 1
3156 *) echo "Unknown targetto '$targetto'" >&4
3160 case "$targetfrom" in
3167 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3172 cp) cat >$from <<EOF
3177 cp $targetdir/\$f . || exit 1
3182 *) echo "Unknown targetfrom '$targetfrom'" >&4
3186 if $test ! -f $run; then
3187 echo "Target 'run' script '$run' not found." >&4
3191 if $test ! -f $to; then
3192 echo "Target 'to' script '$to' not found." >&4
3196 if $test ! -f $from; then
3197 echo "Target 'from' script '$from' not found." >&4
3201 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3205 Using '$run' for remote execution,
3206 and '$from' and '$to'
3207 for remote file transfer.
3213 usecrosscompile="$undef"
3218 : see whether [:lower:] and [:upper:] are supported character classes
3220 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3222 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3226 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3227 # (0xd9 and 0xe2), therefore that is a nice testing point.
3228 if test "X$up" = X -o "X$low" = X; then
3229 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3235 if test "X$up" = X -o "X$low" = X; then
3236 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3242 if test "X$up" = X -o "X$low" = X; then
3243 case "`echo RS | od -x 2>/dev/null`" in
3245 echo "Hey, this might be EBCDIC." >&4
3246 if test "X$up" = X -o "X$low" = X; then
3247 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3248 rs) up='[A-IJ-RS-Z]'
3253 if test "X$up" = X -o "X$low" = X; then
3254 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3264 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3266 echo "Using $up and $low to convert case." >&4
3269 echo "I don't know how to translate letters from upper to lower case." >&4
3270 echo "Your tr is not acting any way I know of." >&4
3274 : set up the translation script tr, must be called with ./tr of course
3278 '[A-Z][a-z]') exec $tr '$up' '$low';;
3279 '[a-z][A-Z]') exec $tr '$low' '$up';;
3286 : Try to determine whether config.sh was made on this system
3287 case "$config_sh" in
3289 myuname=`$uname -a 2>/dev/null`
3290 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3291 # Downcase everything to avoid ambiguity.
3292 # Remove slashes and single quotes so we can use parts of this in
3293 # directory and file names.
3294 # Remove newlines so myuname is sane to use elsewhere.
3295 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3296 # because the A-Z/a-z are not consecutive.
3297 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3298 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3299 newmyuname="$myuname"
3301 case "$knowitall" in
3303 if test -f ../config.sh; then
3304 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3305 eval "`grep myuname= ../config.sh`"
3307 if test "X$myuname" = "X$newmyuname"; then
3315 : Get old answers from old config file if Configure was run on the
3316 : same system, otherwise use the hints.
3319 if test -f config.sh; then
3321 rp="I see a config.sh file. Shall I use it to set the defaults?"
3324 n*|N*) echo "OK, I'll ignore it."
3325 mv config.sh config.sh.old
3326 myuname="$newmyuname"
3328 *) echo "Fetching default answers from your old config.sh file..." >&4
3336 : Older versions did not always set $sh. Catch re-use of such
3346 if test ! -f config.sh; then
3349 First time through, eh? I have some defaults handy for some systems
3350 that need some extra help getting the Configure answers right:
3353 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3355 : Half the following guesses are probably wrong... If you have better
3356 : tests or hints, please send them to perlbug@perl.org
3357 : The metaconfig authors would also appreciate a copy...
3358 $test -f /irix && osname=irix
3359 $test -f /xenix && osname=sco_xenix
3360 $test -f /dynix && osname=dynix
3361 $test -f /dnix && osname=dnix
3362 $test -f /lynx.os && osname=lynxos
3363 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3364 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3365 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3366 $test -f /bin/mips && /bin/mips && osname=mips
3367 $test -d /usr/apollo/bin && osname=apollo
3368 $test -f /etc/saf/_sactab && osname=svr4
3369 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3370 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3371 $test -f /sys/utilities/MultiView && osname=amigaos
3372 if $test -d /MachTen -o -d /MachTen_Folder; then
3374 if $test -x /sbin/version; then
3375 osvers=`/sbin/version | $awk '{print $2}' |
3376 $sed -e 's/[A-Za-z]$//'`
3377 elif $test -x /usr/etc/version; then
3378 osvers=`/usr/etc/version | $awk '{print $2}' |
3379 $sed -e 's/[A-Za-z]$//'`
3385 $test -f /sys/posix.dll &&
3386 $test -f /usr/bin/what &&
3387 set X `/usr/bin/what /sys/posix.dll` &&
3388 $test "$3" = UWIN &&
3392 if $test -f $uname; then
3400 umips) osname=umips ;;
3403 [23]100) osname=mips ;;
3405 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3406 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3409 elif $test -f /etc/kconfig; then
3411 if test "$lns" = "$ln -s"; then
3413 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3415 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3422 if test -n "$DJGPP"; then
3431 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3433 # oslevel can fail with:
3434 # oslevel: Unable to acquire lock.
3435 *not\ found) osvers="$4"."$3" ;;
3436 '<3240'|'<>3240') osvers=3.2.0 ;;
3437 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3438 '=3250'|'>3250') osvers=3.2.5 ;;
3442 bitrig) osname=bitrig
3445 bsd386) osname=bsd386
3448 cygwin*) osname=cygwin
3451 *dc.osx) osname=dcosx
3457 domainos) osname=apollo
3463 dragonfly) osname=dragonfly
3466 dynixptx*) osname=dynixptx
3467 osvers=`echo "$4"|sed 's/^v//'`
3469 freebsd) osname=freebsd
3471 genix) osname=genix ;;
3475 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3488 $test -f /system/lib/libandroid.so && osname=linux-android
3492 netbsd*) osname=netbsd
3495 news-os) osvers="$3"
3497 4*) osname=newsos4 ;;
3501 nonstop-ux) osname=nonstopux ;;
3502 openbsd) osname=openbsd
3508 POSIX-BC | posix-bc ) osname=posix-bc
3511 powerux | power_ux | powermax_os | powermaxos | \
3512 powerunix | power_unix) osname=powerux
3518 solaris) osname=solaris
3520 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3527 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3531 titanos) osname=titanos
3540 ultrix) osname=ultrix
3543 osf1|mls+) case "$5" in
3546 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3549 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3552 hp*) osname=hp_osf1 ;;
3553 mips) osname=mips_osf1 ;;
3556 # UnixWare 7.1.2 is known as Open UNIX 8
3557 openunix|unixware) osname=svr5
3565 $2) case "$osname" in
3569 : svr4.x or possibly later
3579 if test -f /stand/boot ; then
3580 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3581 if test -n "$INITPROG" -a -f "$INITPROG"; then
3582 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3583 if test -n "$isesix"; then
3591 *) if test -f /etc/systemid; then
3593 set `echo $3 | $sed 's/\./ /g'` $4
3594 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3596 elif $test -f $src/hints/sco_$1_$2.sh; then
3598 elif $test -f $src/hints/sco_$1.sh; then
3603 '') : Still unknown. Probably a generic Sys V.
3612 *) case "$osname" in
3613 '') : Still unknown. Probably a generic BSD.
3621 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3622 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3623 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3626 $rm -f UU/kernel.what
3627 elif test -d c:/. -o -n "$is_os2" ; then
3634 case "$targetarch" in
3637 case "$targetarch" in
3639 # Will load qnx.sh, which should change osname to nto
3644 # Catch arm-linux-androideabi, mipsel-linux-android,
3645 # and i686-linux-android
3646 osname=linux-android
3650 # Something like arm-linux-gnueabihf is really just
3657 # XXX perhaps we should just assume
3658 # osvers to be 2, or maybe take the value
3659 # from targetarch. Using $run before the
3660 # hints are run is somewhat icky.
3661 set X `$run $uname -a 2>/dev/null`
3664 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3669 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3676 : Now look for a hint file osname_osvers, unless one has been
3677 : specified already.
3680 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3681 : Also try without trailing minor version numbers.
3682 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3683 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3684 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3685 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3688 *) case "$osvers" in
3691 *) if $test -f $src/hints/$file.sh ; then
3693 elif $test -f $src/hints/$xfile.sh ; then
3695 elif $test -f $src/hints/$xxfile.sh ; then
3697 elif $test -f $src/hints/$xxxfile.sh ; then
3699 elif $test -f $src/hints/$xxxxfile.sh ; then
3701 elif $test -f "$src/hints/${osname}.sh" ; then
3710 if $test -f Policy.sh ; then
3713 none) dflt="Policy" ;;
3714 *) dflt="Policy $dflt" ;;
3719 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3723 if $test -f Policy.sh ; then
3726 There's also a Policy hint file available, which should make the
3727 site-specific (policy) questions easier to answer.
3734 You may give one or more space-separated answers, or "none" if appropriate.
3735 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3736 previous run of Configure, you may specify it as well as or instead of
3737 OS-specific hints. If hints are provided for your OS, you should use them:
3738 although Perl can probably be built without hints on many platforms, using
3739 hints often improve performance and may enable features that Configure can't
3740 set up on its own. If there are no hints that match your OS, specify "none";
3741 DO NOT give a wrong version or a wrong OS.
3745 rp="Which of these apply, if any?"
3748 for file in $tans; do
3749 if $test X$file = XPolicy -a -f Policy.sh; then
3751 $cat Policy.sh >> UU/config.sh
3752 elif $test -f $src/hints/$file.sh; then
3753 . $src/hints/$file.sh
3754 $cat $src/hints/$file.sh >> UU/config.sh
3755 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3758 : Give one chance to correct a possible typo.
3759 echo "$file.sh does not exist"
3761 rp="hint to use instead?"
3763 for file in $ans; do
3764 if $test -f "$src/hints/$file.sh"; then
3765 . $src/hints/$file.sh
3766 $cat $src/hints/$file.sh >> UU/config.sh
3767 elif $test X$ans = X -o X$ans = Xnone ; then
3770 echo "$file.sh does not exist -- ignored."
3777 : Remember our hint file for later.
3778 if $test -f "$src/hints/$file.sh" ; then
3788 echo "Fetching default answers from $config_sh..." >&4
3792 cp $config_sh config.sh 2>/dev/null
3804 : Restore computed paths
3805 for file in $loclist $trylist; do
3806 eval $file="\$_$file"
3811 Configure uses the operating system name and version to set some defaults.
3812 The default value is probably right if the name rings a bell. Otherwise,
3813 since spelling matters for me, either accept the default or answer "none"
3820 ''|' '|none) dflt=none ;;
3821 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3824 *) dflt="$osname" ;;
3826 rp="Operating system name?"
3830 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3836 ''|' '|none) dflt=none ;;
3837 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3838 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3840 ''|' ') dflt=none ;;
3845 *) dflt="$osvers" ;;
3847 rp="Operating system version?"
3857 : who configured the system
3858 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3861 cf_by=`(logname) 2>/dev/null`
3864 cf_by=`(whoami) 2>/dev/null`
3866 "") cf_by=unknown ;;
3871 : decide how portable to be. Allow command line overrides.
3872 case "$d_portable" in
3874 *) d_portable="$define" ;;
3877 : set up shell script to do ~ expansion
3883 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3886 if $test -f /bin/csh; then
3887 /bin/csh -f -c "glob \$1"
3892 name=\`$expr x\$1 : '..\([^/]*\)'\`
3893 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3894 if $test ! -d "\$dir"; then
3896 echo "\$me: can't locate home directory for: \$name" >&2
3901 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3917 : now set up to get a file name
3921 cat <<'EOSC' >>getfile
3937 : getfile will accept an answer from the comma-separated list
3938 : enclosed in parentheses even if it does not meet other criteria.
3939 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3940 fn=`echo $fn | sed 's/(.*)//'`
3946 loc_file=`expr $fn : '.*:\(.*\)'`
3947 fn=`expr $fn : '\(.*\):.*'`
3955 */*) fullpath=true;;
3964 *e*) exp_file=true;;
3967 *p*) nopath_ok=true;;
3972 *d*) type='Directory';;
3973 *l*) type='Locate';;
3978 Locate) what='File';;
3983 case "$d_portable" in
3991 while test "$type"; do
3996 true) rp="$rp (~name ok)";;
3999 if test -f UU/getfile.ok && \
4000 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4019 value=`UU/filexp $ans`
4022 if test "$ans" != "$value"; then
4023 echo "(That expands to $value on this system.)"
4037 /*) value="$ansexp" ;;
4038 [a-zA-Z]:/*) value="$ansexp" ;;
4043 echo "I shall only accept a full path name, as in /bin/ls." >&4
4044 echo "Use a ! shell escape if you wish to check pathnames." >&4
4047 echo "Please give a full path name, starting with slash." >&4
4050 echo "Note that using ~name is ok provided it expands well." >&4
4063 for fp in $gfpth; do
4064 if test "X$fp" = X.; then
4069 if test -f "$pf"; then
4071 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4073 echo "($value is not a plain file, but that's ok.)"
4076 if test X"$type" = X; then
4083 for fp in $gfpth; do
4084 if test "X$fp" = X.; then
4089 direxp="$fp/$ansexp"
4091 if test -d "$direxp"; then
4099 if test -d "$ansexp"; then
4100 echo "(Looking for $loc_file in directory $value.)"
4101 value="$value/$loc_file"
4102 ansexp="$ansexp/$loc_file"
4104 if test -f "$ansexp"; then
4107 case "$nopath_ok" in
4108 true) case "$value" in
4110 *) echo "Assuming $value will be in people's path."
4126 if test "$fastread" = yes; then
4131 rp="$what $value doesn't exist. Use that name anyway?"
4150 test "X$gfpthkeep" != Xy && gfpth=""
4153 : determine root of directory hierarchy where package will be installed.
4156 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4159 dflt=`echo "$prefix" | sed 's/.$//'`
4167 By default, $package will be installed in $dflt/bin, manual pages
4168 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4169 installation directories. Typically this is something like /usr/local.
4170 If you wish to have binaries under /usr/bin but other parts of the
4171 installation under /usr/local, that's ok: you will be prompted
4172 separately for each of the installation directories, the prefix being
4173 only used to set the defaults.
4177 rp='Installation prefix to use?'
4185 *) oldprefix="$prefix";;
4192 : allow them to override the AFS root
4195 *) afsroot=$afsroot ;;
4201 $define|true) afs=true ;;
4202 $undef|false) afs=false ;;
4203 *) if $test -d $afsroot; then
4211 echo "AFS may be running... I'll be extra cautious then..." >&4
4213 echo "AFS does not seem to be running..." >&4
4216 : determine installation prefix for where package is to be installed.
4220 Since you are running AFS, I need to distinguish the directory in which
4221 files will reside from the directory in which they are installed (and from
4222 which they are presumably copied to the former directory by occult means).
4225 case "$installprefix" in
4226 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4227 *) dflt="$installprefix";;
4232 In some special cases, particularly when building $package for distribution,
4233 it is convenient to distinguish the directory in which files should be
4234 installed from the directory ($prefix) in which they will
4235 eventually reside. For most users, these two directories are the same.
4238 case "$installprefix" in
4240 *) dflt=$installprefix;;
4244 rp='What installation prefix should I use for installing files?'
4246 installprefix="$ans"
4247 installprefixexp="$ansexp"
4249 : Perform the prefixexp/installprefixexp correction if necessary
4250 cat <<EOS >installprefix
4253 cat <<'EOSC' >>installprefix
4254 : Change installation prefix, if necessary.
4255 if $test X"$prefix" != X"$installprefix"; then
4256 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4258 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4261 chmod +x installprefix
4262 $eunicefix installprefix
4264 : Set variables such as privlib and privlibexp from the output of ./getfile
4265 : performing the prefixexp/installprefixexp correction if necessary.
4266 cat <<EOS >setprefixvar
4269 cat <<'EOSC' >>setprefixvar
4270 eval "${prefixvar}=\"\$ans\""
4271 eval "${prefixvar}exp=\"\$ansexp\""
4274 chmod +x setprefixvar
4275 $eunicefix setprefixvar
4277 : set up the script used to warn in case of inconsistency
4286 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4288 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4289 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4294 echo "*** WHOA THERE!!! ***" >&4
4295 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4298 rp=" Keep the $hint value?"
4301 y) td=$was; tu=$was;;
4305 : function used to set '$1' to '$val'
4306 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4308 $define$undef) . ./whoa; eval "$var=\$td";;
4309 $undef$define) . ./whoa; eval "$var=\$tu";;
4310 *) eval "$var=$val";;
4313 : get the patchlevel
4315 echo "Getting the current patchlevel..." >&4
4316 if $test -r $rsrc/patchlevel.h;then
4317 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4318 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4319 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4320 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4321 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4322 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4323 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4332 $echo "(You do not have patchlevel.h. Eek.)"
4334 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4335 version_patchlevel_string="version $patchlevel subversion $subversion"
4336 case "$perl_patchlevel" in
4338 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4339 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4343 $echo "(You have $package $version_patchlevel_string.)"
4347 : XXX Should be a Configure test for double-dots in filenames.
4348 version=`echo $revision $patchlevel $subversion | \
4349 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4350 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4351 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4354 version=`echo $revision $patchlevel $subversion | \
4355 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4356 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4357 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4360 : Special case the 5.005_xx maintenance series, which used 5.005
4361 : without any subversion label as a subdirectory in $sitelib
4362 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4363 api_versionstring='5.005'
4366 : Do we want threads support and if so, what type
4367 case "$usethreads" in
4368 $define|true|[yY]*) dflt='y';;
4369 *) # Catch case where user specified ithreads or 5005threads but
4370 # forgot -Dusethreads (A.D. 4/2002)
4371 case "$useithreads$use5005threads" in
4372 *$define*) dflt='y';;
4379 Perl can be built to offer a form of threading support on some systems
4380 To do so, Configure can be run with -Dusethreads.
4382 Note that Perl built with threading support runs slightly slower
4383 and uses slightly more memory than plain Perl.
4385 If this doesn't make any sense to you, just accept the default '$dflt'.
4387 rp='Build a threading Perl?'
4390 y|Y) val="$define" ;;
4396 if $test $patchlevel -lt 9; then
4397 case "$usethreads" in
4399 : Default to ithreads unless overridden on command line or with
4402 case "$use5005threads" in
4404 echo "5.005 threads are no longer supported"
4408 case "$useithreads" in
4409 $undef|false|[nN]*) dflt='n';;
4411 rp='Use the newer interpreter-based ithreads?'
4414 y|Y) val="$define" ;;
4419 : Now set use5005threads to the opposite value.
4420 case "$useithreads" in
4421 $define) val="$undef" ;;
4428 useithreads="$undef"
4429 use5005threads="$undef"
4433 case "$useithreads$use5005threads" in
4437 You cannot have both the ithreads and the 5.005 threads enabled
4438 at the same time. Disabling the 5.005 threads since they are
4439 much less stable than the ithreads.
4442 use5005threads="$undef"
4447 : perl-5.9.x and later
4449 if test X"$usethreads" = "X$define"; then
4450 case "$use5005threads" in
4454 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4461 use5005threads="$undef"
4462 useithreads="$usethreads"
4465 case "$d_oldpthreads" in
4466 '') : Configure tests would be welcome here. For now, assume undef.
4468 *) val="$d_oldpthreads" ;;
4474 : Look for a hint-file generated 'call-back-unit'. If the
4475 : user has specified that a threading perl is to be built,
4476 : we may need to set or change some other defaults.
4477 if $test -f usethreads.cbu; then
4478 echo "Your platform has some specific hints regarding threaded builds, using them..."
4481 case "$usethreads" in
4482 "$define"|true|[yY]*)
4484 (Your platform does not have any specific hints for threaded builds.
4485 Assuming POSIX threads, then.)
4491 : Check if multiplicity is required
4494 Perl can be built so that multiple Perl interpreters can coexist
4495 within the same Perl executable.
4498 case "$useithreads" in
4501 This multiple interpreter support is required for interpreter-based threads.
4505 *) case "$usemultiplicity" in
4506 $define|true|[yY]*) dflt='y';;
4510 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4511 rp='Build Perl for multiplicity?'
4514 y|Y) val="$define" ;;
4522 : Check if morebits is requested
4523 case "$usemorebits" in
4524 "$define"|true|[yY]*)
4525 use64bitint="$define"
4526 uselongdouble="$define"
4527 usemorebits="$define"
4529 *) usemorebits="$undef"
4533 : Determine the C compiler to be used
4539 rp="Use which C compiler?"
4543 : See whether they have no cc but they do have gcc
4545 if $test -f cc.cbu; then
4550 : make some quick guesses about what we are up against
4552 $echo $n "Hmm... $c"
4562 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4563 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4565 echo "Looks kind of like an OSF/1 system, but we'll see..."
4567 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4568 xxx=`./loc addbib blurfl $pth`
4569 if $test -f $xxx; then
4570 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4574 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4575 echo "Looks kind of like an extended USG system, but we'll see..."
4577 echo "Looks kind of like a USG system, but we'll see..."
4581 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4582 echo "Looks kind of like a BSD system, but we'll see..."
4586 echo "Looks kind of like a Version 7 system, but we'll see..."
4589 case "$eunicefix" in
4592 There is, however, a strange, musty smell in the air that reminds me of
4593 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4597 : it so happens the Eunice I know will not run shell scripts in Unix format
4601 echo "Congratulations. You aren't running Eunice."
4605 : Detect OS2. The p_ variable is set above in the Head.U unit.
4606 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4607 : semicolon as a patch separator
4612 I have the feeling something is not exactly right, however...don't tell me...
4613 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4614 (Or you may be running DOS with DJGPP.)
4619 if test -f /xenix; then
4620 echo "Actually, this looks more like a XENIX system..."
4625 echo "It's not Xenix..."
4630 if test -f /venix; then
4631 echo "Actually, this looks more like a VENIX system..."
4638 echo "Nor is it Venix..."
4641 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4642 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4645 : Check if we are using GNU gcc and what its version is
4647 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4651 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4653 printf("%s\n", __VERSION__);
4655 printf("%s\n", "1");
4661 if $cc -o try $ccflags $ldflags try.c; then
4662 gccversion=`$run ./try`
4663 case "$gccversion" in
4664 '') echo "You are not using GNU cc." ;;
4665 *) echo "You are using GNU cc $gccversion."
4671 echo "*** WHOA THERE!!! ***" >&4
4672 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4673 case "$knowitall" in
4675 echo " You'd better start hunting for one and let me know about it." >&4
4681 case "$gccversion" in
4682 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4684 case "$gccversion" in
4685 '') gccosandvers='' ;;
4686 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4687 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4689 case "$gccosandvers" in
4690 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4691 $osname$osvers) ;; # looking good
4692 $osname*) cat <<EOM >&4
4694 *** WHOA THERE!!! ***
4696 Your gcc has not been compiled for the exact release of
4697 your operating system ($gccosandvers versus $osname$osvers).
4699 In general it is a good idea to keep gcc synchronized with
4700 the operating system because otherwise serious problems
4701 may ensue when trying to compile software, like Perl.
4703 I'm trying to be optimistic here, though, and will continue.
4704 If later during the configuration and build icky compilation
4705 problems appear (headerfile conflicts being the most common
4706 manifestation), I suggest reinstalling the gcc to match
4707 your operating system release.
4711 *) gccosandvers='' ;; # failed to parse, better be silent
4719 # gcc 3.* complain about adding -Idirectories that they already know about,
4720 # so we will take those off from locincpth.
4721 case "$gccversion" in
4723 echo "main(){}">try.c
4724 for incdir in $locincpth; do
4725 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4726 grep '^c[cp]p*[01]: warning: changing search order '`
4727 if test "X$warn" != X; then
4728 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4734 # gcc 4.9 by default does some optimizations that break perl.
4735 # see ticket 121505.
4737 # The -fwrapv disables those optimizations (and probably others,) so
4738 # for gcc 4.9 (and later, since the optimizations probably won't go
4739 # away), add -fwrapv unless the user requests -fno-wrapv, which
4740 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4741 # which turns the overflows -fwrapv ignores into runtime errors.
4742 case "$gccversion" in
4743 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4745 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4746 *) ccflags="$ccflags -fwrapv" ;;
4750 : What should the include directory be ?
4751 : Use sysroot if set, so findhdr looks in the right place.
4753 $echo $n "Hmm... $c"
4754 dflt="$sysroot/usr/include"
4757 if $test -f /bin/mips && /bin/mips; then
4758 echo "Looks like a MIPS system..."
4759 $cat >usr.c <<'EOCP'
4760 #ifdef SYSTYPE_BSD43
4764 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4765 dflt='/bsd43/usr/include'
4769 mips_type='System V'
4771 $rm -f usr.c usr.out
4772 echo "and you're compiling with the $mips_type compiler and libraries."
4776 echo "Doesn't look like a MIPS system."
4786 case "$xxx_prompt" in
4789 rp='Where are the include files you want to use?'
4797 : see how we invoke the C preprocessor
4799 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4800 cat <<'EOT' >testcpp.c
4806 if test ! -f cppstdin; then
4807 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4808 # AIX cc -E doesn't show the absolute headerfile
4809 # locations but we'll cheat by using the -M flag.
4810 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
4812 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4815 echo "Keeping your $hint cppstdin wrapper."
4818 wrapper=`pwd`/cppstdin
4822 if $test "X$cppstdin" != "X" && \
4823 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4824 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4826 echo "You used to use $cppstdin $cppminus so we'll use that again."
4828 '') echo "But let's see if we can live without a wrapper..." ;;
4830 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4831 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4833 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4836 echo "(However, $cpprun $cpplast does not work, let's see...)"
4844 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4851 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4852 $cc -E <testcpp.c >testcpp.out 2>&1; \
4853 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4854 echo "Yup, it does."
4855 x_cpp="$cc $cppflags -E"
4857 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4858 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4859 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4860 echo "Yup, it does."
4861 x_cpp="$cc $cppflags -E"
4863 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4864 $cc -P <testcpp.c >testcpp.out 2>&1; \
4865 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4866 echo "Yipee, that works!"
4867 x_cpp="$cc $cppflags -P"
4869 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4870 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4871 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4872 echo "At long last!"
4873 x_cpp="$cc $cppflags -P"
4875 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4876 $cpp <testcpp.c >testcpp.out 2>&1; \
4877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 x_cpp="$cpp $cppflags"
4881 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4882 $cpp - <testcpp.c >testcpp.out 2>&1; \
4883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4884 echo "Hooray, it works! I was beginning to wonder."
4885 x_cpp="$cpp $cppflags"
4887 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4888 $wrapper <testcpp.c >testcpp.out 2>&1; \
4889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4895 rp="No dice. I can't find a C preprocessor. Name one:"
4899 $x_cpp <testcpp.c >testcpp.out 2>&1
4900 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4901 echo "OK, that will do." >&4
4903 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4918 echo "Perhaps can we force $cc -E using a wrapper..."
4919 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4920 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4926 echo "Nope, we'll have to live without it..."
4940 "$wrapper"|'cppstdin') ;;
4941 *) $rm -f $wrapper;;
4943 $rm -f testcpp.c testcpp.out
4945 : Adjust cppfilter for path component separator
4947 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4948 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4952 : Use gcc to determine libpth and incpth
4953 # If using gcc or clang, we can get better values for libpth, incpth
4954 # and usrinc directly from the compiler.
4955 # Note that ccname for clang is also gcc.
4958 $echo 'extern int foo;' > try.c
4959 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4961 if $test $# -gt 0; then
4963 incpth="`$echo $incpth|$sed 's/^ //'`"
4965 j="`$echo $i|$sed 's,/include$,/lib,'`"
4966 if $test -d $j; then
4970 libpth="`$echo $libpth|$sed 's/^ //'`"
4971 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4972 if $test -d $xxx; then
4975 *) libpth="$libpth $xxx";;
4982 '') for i in $incpth; do
4983 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4991 case "$usecrosscompile" in
4994 '') echo "Incpth not defined." >&4; croak=y ;;
4995 *) echo "Using incpth '$incpth'." >&4 ;;
4998 '') echo "Libpth not defined." >&4; croak=y ;;
4999 *) echo "Using libpth '$libpth'." >&4 ;;
5002 '') echo "Usrinc not defined." >&4; croak=y ;;
5003 *) echo "Using usrinc $usrinc." >&4 ;;
5007 if test "X$sysroot" = X; then
5008 echo "Cannot continue, aborting." >&4; exit 1
5010 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5019 : Default value for incpth is just usrinc
5021 '') incpth="$usrinc";;
5024 : Set private lib path
5027 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5032 '') dlist="$loclibpth $plibpth $glibpth";;
5033 *) dlist="$libpth";;
5036 : Now check and see which directories actually exist, avoiding duplicates
5039 if $test -d $xxx; then
5042 *) libpth="$libpth $xxx";;
5048 Some systems have incompatible or broken versions of libraries. Among
5049 the directories listed in the question below, please remove any you
5050 know not to be holding relevant libraries, and add any that are needed.
5051 Say "none" for none.
5055 if test "X$sysroot" != X; then
5057 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5070 rp="Directories to use for library searches?"
5077 : compute shared library extension
5080 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5090 On some systems, shared libraries may be available. Answer 'none' if
5091 you want to suppress searching of shared libraries for the remainder
5092 of this configuration.
5095 rp='What is the file extension used for shared libraries?'
5099 : Does target system insist that shared library basenames are unique
5102 Some dynamic loaders assume that the *basename* of shared library filenames
5103 are globally unique. We'll default this to undef as we assume your system
5104 is not this weird. Set to defined if you're on one of them.
5109 rp='Make shared library basenames unique?'
5112 y|Y) val="$define" ;;
5115 set d_libname_unique
5118 : Define several unixisms.
5119 : Hints files or command line option can be used to override them.
5120 : The convoluted testing is in case hints files set either the old
5123 '') case "$exe_ext" in
5125 *) _exe="$exe_ext" ;;
5130 '') case "$lib_ext" in
5137 '') case "$obj_ext" in
5144 '') case "$path_sep" in
5155 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5157 : Which makefile gets called first. This is used by make depend.
5158 case "$firstmakefile" in
5159 '') firstmakefile='makefile';;
5162 : Check is we will use socks
5164 $define|true|[yY]*) dflt='y';;
5169 Perl can be built to use the SOCKS proxy protocol library. To do so,
5170 Configure must be run with -Dusesocks. If you use SOCKS you also need
5171 to use the PerlIO abstraction layer, this will be implicitly selected.
5173 If this doesn't make any sense to you, just accept the default '$dflt'.
5175 rp='Build Perl for SOCKS?'
5178 y|Y) val="$define" ;;
5184 : Check for uselongdouble support
5186 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5189 case "$uselongdouble" in
5190 $define|true|[yY]*) dflt='y';;
5195 Perl can be built to take advantage of long doubles which
5196 (if available) may give more accuracy and range for floating point numbers.
5198 If this doesn't make any sense to you, just accept the default '$dflt'.
5200 rp='Try to use long doubles if available?'
5203 y|Y) val="$define" ;;
5209 case "$uselongdouble" in
5210 true|[yY]*) uselongdouble="$define" ;;
5213 : Look for a hint-file generated 'call-back-unit'. If the
5214 : user has specified that long doubles should be used,
5215 : we may need to set or change some other defaults.
5216 if $test -f uselongdouble.cbu; then
5217 echo "Your platform has some specific hints regarding long doubles, using them..."
5218 . ./uselongdouble.cbu
5220 case "$uselongdouble" in
5223 (Your platform does not have any specific hints for long doubles.)
5229 : Check if quadmath is requested
5230 case "$usequadmath" in
5231 "$define"|true|[yY]*) usequadmath="$define" ;;
5232 *) usequadmath="$undef" ;;
5235 : Fail if both uselongdouble and usequadmath are requested
5236 case "$usequadmath:$uselongdouble" in
5240 *** You requested the use of the quadmath library and use
5241 *** of long doubles.
5243 *** Please select one or the other.
5249 : Looking for optional libraries
5251 echo "Checking for optional libraries..." >&4
5256 case "$libswanted" in
5257 '') libswanted='c_s';;
5260 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5262 case "$usecbacktrace" in
5263 "$define") libswanted="$libswanted bfd" ;;
5265 case "$usequadmath" in
5266 "$define") libswanted="$libswanted quadmath" ;;
5272 for thisdir in $libpth $xlibpth; do
5273 test -d $thisdir && libspath="$libspath $thisdir"
5275 for thislib in $libswanted; do
5276 for thisdir in $libspath; do
5278 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5279 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5280 $test -f "$xxx" && eval $libscheck
5281 $test -f "$xxx" && libstyle=shared
5282 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5283 $test -f "$xxx" && eval $libscheck
5284 $test -f "$xxx" && libstyle=shared
5286 if test ! -f "$xxx"; then
5287 xxx=$thisdir/lib$thislib.$so
5288 $test -f "$xxx" && eval $libscheck
5289 $test -f "$xxx" && libstyle=shared
5291 if test ! -f "$xxx"; then
5292 xxx=$thisdir/lib$thislib$_a
5293 $test -f "$xxx" && eval $libscheck
5294 $test -f "$xxx" && libstyle=static
5296 if test ! -f "$xxx"; then
5297 xxx=$thisdir/$thislib$_a
5298 $test -f "$xxx" && eval $libscheck
5299 $test -f "$xxx" && libstyle=static
5301 if test ! -f "$xxx"; then
5302 xxx=$thisdir/lib${thislib}_s$_a
5303 $test -f "$xxx" && eval $libscheck
5304 $test -f "$xxx" && libstyle=static
5305 $test -f "$xxx" && thislib=${thislib}_s
5307 if test ! -f "$xxx"; then
5308 xxx=$thisdir/Slib$thislib$_a
5309 $test -f "$xxx" && eval $libscheck
5310 $test -f "$xxx" && libstyle=static
5312 if $test -f "$xxx"; then
5314 shared) echo "Found -l$thislib (shared)." ;;
5315 static) echo "Found -l$thislib." ;;
5316 *) echo "Found -l$thislib ($libstyle)." ;;
5320 *) dflt="$dflt -l$thislib"
5321 libsfound="$libsfound $xxx"
5323 libsfiles="$libsfiles $yyy"
5324 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5325 case " $libsdirs " in
5327 *) libsdirs="$libsdirs $yyy" ;;
5334 if $test ! -f "$xxx"; then
5335 echo "No -l$thislib."
5346 ' '|'') dflt='none';;
5351 In order to compile $package on your machine, a number of libraries
5352 are usually needed. Include any other special libraries here as well.
5353 Say "none" for none. The default list is almost always right.
5357 rp="What libraries to use?"
5364 : determine optimization, if desired, or use for debug flag also
5366 ' '|$undef) dflt='none';;
5368 *) dflt="$optimize";;
5372 By default, $package compiles with the -O flag to use the optimizer.
5373 Alternately, you might want to use the symbolic debugger, which uses
5374 the -g flag (on traditional Unix systems). Either flag can be
5375 specified here. To use neither flag, specify the word "none".
5378 rp="What optimizer/debugger flag should be used?"
5382 'none') optimize=" ";;
5385 : Check what DEBUGGING is required from the command line
5386 : -DEBUGGING or -DDEBUGGING or
5387 : -DEBUGGING=both = -g + -DDEBUGGING
5388 : -DEBUGGING=-g or -Doptimize=-g = -g
5389 : -DEBUGGING=none or -UDEBUGGING =
5390 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5393 *) DEBUGGING=$EBUGGING ;;
5396 case "$DEBUGGING" in
5400 *) optimize="$optimize -g" ;;
5404 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5412 case "$DEBUGGING" in
5413 both|$define) dflt='-DDEBUGGING'
5416 : argument order is deliberate, as the flag will start with - which set could
5417 : think is an option
5418 checkccflag='check=$1; flag=$2; callback=$3;
5420 echo "Checking if your compiler accepts $flag" 2>&1;
5421 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5422 echo "int main(void) { return 0; }" > gcctest.c;
5423 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5424 echo "Yes, it does." 2>&1;
5425 if $test -s gcctest.out ; then
5426 echo "But your platform does not like it:";
5431 echo "Leaving current flags $ccflags alone." 2>&1
5433 *) dflt="$dflt $flag";
5439 echo "Nope, it does not, but that is ok." 2>&1;
5443 : We will not override a previous value, but we might want to
5444 : augment a hint file
5446 default|recommended)
5447 case "$gccversion" in
5448 1*) dflt="$dflt -fpcc-struct-return" ;;
5450 case "$optimize:$DEBUGGING" in
5451 *-g*:old) dflt="$dflt -DDEBUGGING";;
5453 case "$gccversion" in
5454 2*) if $test -d /etc/conf/kconfig.d &&
5455 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5457 # Interactive Systems (ISC) POSIX mode.
5462 case "$gccversion" in
5465 ?*) set strict-aliasing -fno-strict-aliasing
5469 # For gcc, adding -pipe speeds up compilations for some, but apparently
5470 # some assemblers can't read from stdin. (It also slows down compilations
5471 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5472 case "$gccversion" in
5478 # on x86_64 (at least) we require an extra library (libssp) in the
5479 # link command line. This library is not named, so I infer that it is
5480 # an implementation detail that may change. Hence the safest approach
5481 # is to add the flag to the flags passed to the compiler at link time,
5482 # as that way the compiler can do the right implementation dependant
5485 amigaos) ;; # -fstack-protector builds but doesn't work
5486 *) case "$gccversion" in
5487 ?*) set stack-protector-strong -fstack-protector-strong
5490 *-fstack-protector-strong*) ;; # It got added.
5491 *) # Try the plain/older -fstack-protector.
5492 set stack-protector -fstack-protector
5503 case "$mips_type" in
5504 *BSD*|'') inclwanted="$locincpth $usrinc";;
5505 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5507 for thisincl in $inclwanted; do
5508 if $test -d $thisincl; then
5509 if $test x$thisincl != x$usrinc; then
5511 *" -I$thisincl "*);;
5512 *) dflt="$dflt -I$thisincl ";;
5518 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5520 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5528 *) dflt="$dflt -D$2";;
5532 set signal.h LANGUAGE_C; eval $inctest
5536 ccflags="$ccflags -DSOCKS"
5541 default|recommended) dflt="$ccflags $dflt" ;;
5542 *) dflt="$ccflags";;
5551 Your C compiler may want other flags. For this question you should include
5552 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5553 but you should NOT include libraries or ld flags like -lwhatever. If you
5554 want $package to honor its debug switch, you should include -DDEBUGGING here.
5555 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5557 To use no flags, specify the word "none".
5563 rp="Any additional cc flags?"
5570 : the following weeds options from ccflags that are of no interest to cpp
5572 '') cppflags="$ccflags" ;;
5573 *) set X $ccflags; shift
5574 case " $cppflags " in
5575 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5576 *) cppflags="$cppflags $ccflags" ;;
5580 case "$gccversion" in
5581 1*) cppflags="$cppflags -D__GNUC__"
5583 case "$mips_type" in
5585 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5591 echo "Let me guess what the preprocessor flags are..." >&4
5605 *) ftry="$previous $flag";;
5607 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5608 >cpp1.out 2>/dev/null && \
5609 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5610 >cpp2.out 2>/dev/null && \
5611 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5612 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5614 cppflags="$cppflags $ftry"
5624 *-*) echo "They appear to be: $cppflags";;
5626 $rm -f cpp.c cpp?.out
5630 : flags used in final linking phase
5632 '') if ./venix; then
5638 *-posix*) dflt="$dflt -posix" ;;
5641 *) dflt="$ldflags";;
5643 # See note above about -fstack-protector
5645 *-fstack-protector-strong*)
5647 *-fstack-protector-strong*) ;; # Don't add it again
5648 *) dflt="$dflt -fstack-protector-strong" ;;
5651 *-fstack-protector*)
5653 *-fstack-protector*) ;; # Don't add it again
5654 *) dflt="$dflt -fstack-protector" ;;
5659 : Try to guess additional flags to pick up local libraries.
5660 for thislibdir in $libpth; do
5661 case " $loclibpth " in
5664 *"-L$thislibdir "*) ;;
5665 *) dflt="$dflt -L$thislibdir" ;;
5677 Your C linker may need flags. For this question you should
5678 include -L/whatever and any other flags used by the C linker, but you
5679 should NOT include libraries like -lwhatever.
5681 Make sure you include the appropriate -L/path flags if your C linker
5682 does not normally search all of the directories you specified above,
5685 To use no flags, specify the word "none".
5689 rp="Any additional ld flags (NOT including libraries)?"
5695 rmlist="$rmlist pdp11"
5699 echo "Checking your choice of C compiler and flags for coherency..." >&4
5700 $cat > try.c <<'EOF'
5702 int main() { printf("Ok\n"); return(0); }
5704 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5706 $cat >try.msg <<'EOM'
5707 I've tried to compile and run the following simple program:
5710 $cat try.c >> try.msg
5712 $cat >> try.msg <<EOM
5719 and I got the following output:
5723 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5724 if $sh -c "$run ./try " >>try.msg 2>&1; then
5728 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5731 echo "The program compiled OK, but exited with status $?." >>try.msg
5732 rp="You have a problem. Shall I abort Configure"
5736 echo "I can't compile the test program." >>try.msg
5737 rp="You have a BIG problem. Shall I abort Configure"
5743 case "$knowitall" in
5745 echo "(The supplied flags or libraries might be incorrect.)"
5753 *) echo "Ok. Stopping Configure." >&4
5758 n) echo "OK, that should do.";;
5760 $rm_try gcctest gcctest.out
5762 : define a shorthand compile call
5766 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5767 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5771 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5772 : define a shorthand compile call for compilations that should be ok.
5776 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5778 : stub, used only to satisfy other units
5781 : check for lengths of integral types
5785 echo "Checking to see how big your integers are..." >&4
5794 printf("intsize=%d;\n", (int)sizeof(int));
5795 printf("longsize=%d;\n", (int)sizeof(long));
5796 printf("shortsize=%d;\n", (int)sizeof(short));
5801 if eval $compile_ok && $run ./try > /dev/null; then
5803 echo "Your integers are $intsize bytes long."
5804 echo "Your long integers are $longsize bytes long."
5805 echo "Your short integers are $shortsize bytes long."
5809 Help! I can't compile and run the intsize test program: please enlighten me!
5810 (This is probably a misconfiguration in your system or libraries, and
5811 you really ought to fix it. Still, I'll try anyway.)
5815 rp="What is the size of an integer (in bytes)?"
5819 rp="What is the size of a long integer (in bytes)?"
5823 rp="What is the size of a short integer (in bytes)?"
5831 : check for long long
5833 echo "Checking to see if you have long long..." >&4
5834 echo 'int main() { long long x = 7; return 0; }' > try.c
5836 if eval $compile; then
5838 echo "You have long long."
5841 echo "You do not have long long."
5847 : check for length of long long
5848 case "${d_longlong}${longlongsize}" in
5851 echo "Checking to see how big your long longs are..." >&4
5852 $cat >try.c <<'EOCP'
5856 printf("%d\n", (int)sizeof(long long));
5861 if eval $compile_ok; then
5862 longlongsize=`$run ./try`
5863 echo "Your long longs are $longlongsize bytes long."
5867 echo "(I can't seem to compile the test program. Guessing...)"
5868 rp="What is the size of a long long (in bytes)?"
5872 if $test "X$longsize" = "X$longlongsize"; then
5873 echo "(That isn't any different from an ordinary long.)"
5879 : determine filename position in cpp output
5881 echo "Computing filename position in cpp output for #include directives..." >&4
5883 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5888 vos) testaccess=-e ;;
5891 echo '#include <stdio.h>' > foo.c
5894 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5895 $grep '^[ ]*#.*stdio\.h' | \
5896 while read cline; do
5899 while $test \$# -gt 0; do
5900 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5905 pos=\`expr \$pos + 1\`
5919 *) pos="${fieldn}th";;
5921 echo "Your cpp writes the filename in the $pos field of the line."
5923 : locate header file
5928 for usrincdir in $incpth
5930 if test -f \$usrincdir/\$wanted; then
5931 echo "\$usrincdir/\$wanted"
5935 awkprg='{ print \$$fieldn }'
5936 echo "#include <\$wanted>" > foo\$\$.c
5937 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5938 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5939 while read cline; do
5940 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5942 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5943 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5948 # status = 0: grep returned 0 lines, case statement not executed
5949 # status = 1: headerfile found
5950 # status = 2: while loop executed, no headerfile found
5954 if test \$status -eq 1; then
5961 : define an alternate in-header-list? function
5962 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5963 cont=true; xxf="echo \"<\$1> found.\" >&4";
5964 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5965 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5967 case $# in 4) instead=instead;; *) instead="at last";; esac;
5968 while $test "$cont"; do
5970 var=$2; eval "was=\$$2";
5971 if $test "$xxx" && $test -r "$xxx";
5973 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5976 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5977 set $yyy; shift; shift; yyy=$@;
5978 case $# in 0) cont="";;
5979 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5980 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5981 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5982 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5986 do set $yyy; var=$2; eval "was=\$$2";
5987 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5988 set $yyy; shift; shift; yyy=$@;
5991 : see if inttypes.h is available
5992 : we want a real compile instead of Inhdr because some systems
5993 : have an inttypes.h which includes non-existent headers
5996 #include <inttypes.h>
5998 static int32_t foo32 = 0x12345678;
6002 if eval $compile; then
6003 echo "<inttypes.h> found." >&4
6006 echo "<inttypes.h> NOT found." >&4
6015 echo "Checking to see if you have int64_t..." >&4
6017 #include <sys/types.h>
6018 #$i_inttypes I_INTTYPES
6020 #include <inttypes.h>
6022 int main() { int64_t x = 7; }
6025 if eval $compile; then
6027 echo "You have int64_t."
6030 echo "You do not have int64_t."
6036 : Check if 64bit ints have a quad type
6038 echo "Checking which 64-bit integer type we could use..." >&4
6044 val='"unsigned int"'
6049 *) case "$longsize" in
6053 val='"unsigned long"'
6058 *) case "$d_longlong:$longlongsize" in
6063 val='"unsigned long long"'
6068 *) case "$d_int64_t" in
6087 '') echo "Alas, no 64-bit integer types in sight." >&4
6090 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6095 : Do we want 64bit support
6096 case "$uselonglong" in
6097 "$define"|true|[yY]*)
6100 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6102 use64bitint="$define"
6105 case "$use64bits" in
6106 "$define"|true|[yY]*)
6109 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6111 use64bitint="$define"
6114 case "$use64bitints" in
6115 "$define"|true|[yY]*)
6118 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6120 use64bitint="$define"
6123 case "$use64bitsint" in
6124 "$define"|true|[yY]*)
6127 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6129 use64bitint="$define"
6132 case "$uselonglongs" in
6133 "$define"|true|[yY]*)
6136 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6138 use64bitint="$define"
6141 case "$use64bitsall" in
6142 "$define"|true|[yY]*)
6145 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6147 use64bitall="$define"
6152 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6154 case "$use64bitall" in
6155 "$define"|true|[yY]*) use64bitint="$define" ;;
6161 You have natively 64-bit long integers.
6165 *) case "$use64bitint" in
6166 "$define"|true|[yY]*) dflt='y';;
6175 Perl can be built to take advantage of 64-bit integer types
6176 on some systems. To do so, Configure can be run with -Duse64bitint.
6177 Choosing this option will most probably introduce binary incompatibilities.
6179 If this doesn't make any sense to you, just accept the default '$dflt'.
6180 (The default has been chosen based on your configuration.)
6182 rp='Try to use 64-bit integers, if available?'
6185 [yY]*) val="$define" ;;
6193 case "$use64bitall" in
6194 "$define"|true|[yY]*) dflt='y' ;;
6195 *) case "$longsize" in
6203 You may also choose to try maximal 64-bitness. It means using as much
6204 64-bitness as possible on the platform. This in turn means even more
6205 binary incompatibilities. On the other hand, your platform may not
6206 have any more 64-bitness available than what you already have chosen.
6208 If this doesn't make any sense to you, just accept the default '$dflt'.
6209 (The default has been chosen based on your configuration.)
6211 rp='Try to use maximal 64-bit support, if available?'
6214 [yY]*) val="$define" ;;
6219 case "$use64bitall" in
6221 case "$use64bitint" in
6225 Since you have chosen a maximally 64-bit build, I'm also turning on
6226 the use of 64-bit integers.
6228 use64bitint="$define" ;;
6233 : Look for a hint-file generated 'call-back-unit'. If the
6234 : user has specified that a 64-bit perl is to be built,
6235 : we may need to set or change some other defaults.
6236 if $test -f use64bitint.cbu; then
6237 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6240 case "$use64bitint" in
6241 "$define"|true|[yY]*)
6242 : This test was common to all the OpenBSD forks, and seems harmless for
6245 echo "Checking if your C library has broken 64-bit functions..." >&4
6248 typedef $uquadtype myULL;
6255 {4294967303.15, 4294967303ULL},
6256 {4294967294.2, 4294967294ULL},
6257 {4294967295.7, 4294967295ULL},
6260 for (p = test; p->u; p++) {
6261 myULL x = (myULL)p->d;
6272 if eval $compile_ok; then
6273 libcquad=`$run ./try`
6274 echo "Your C library's 64-bit functions are $libcquad."
6276 echo "(I can't seem to compile the test program.)"
6277 echo "Assuming that your C library's 64-bit functions are ok."
6286 *** You have a C library with broken 64-bit functions.
6287 *** 64-bit support does not work reliably in this configuration.
6288 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6289 *** Cannot continue, aborting.
6296 4) case "$archname64" in
6297 '') archname64=64int ;;
6304 : Look for a hint-file generated 'call-back-unit'. If the
6305 : user has specified that a maximally 64-bit perl is to be built,
6306 : we may need to set or change some other defaults.
6307 if $test -f use64bitall.cbu; then
6308 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6311 case "$use64bitall" in
6312 "$define"|true|[yY]*)
6314 4) case "$archname64" in
6315 ''|64int) archname64=64all ;;
6322 case "$d_quad:$use64bitint" in
6326 *** You have chosen to use 64-bit integers,
6327 *** but none can be found.
6328 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6329 *** Cannot continue, aborting.
6336 : Check if we are using the GNU C library
6338 echo "Checking for GNU C Library..." >&4
6340 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6341 alone are insufficient to distinguish different versions, such as
6342 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6343 libc version 2.1.0. A. Dougherty, June 3, 2002.
6349 # ifdef __GLIBC_MINOR__
6350 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6351 # include <gnu/libc-version.h>
6352 printf("%s\n", gnu_get_libc_version());
6354 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6357 printf("%d\n", __GLIBC__);
6366 if eval $compile_ok && $run ./try > glibc.ver; then
6368 gnulibc_version=`$cat glibc.ver`
6369 echo "You are using the GNU C Library version $gnulibc_version"
6373 echo "You are not using the GNU C Library"
6379 : see if nm is to be used to determine whether a symbol is defined or not
6383 case "$d_gnulibc" in
6386 echo "nm probably won't work on the GNU C Library." >&4
6392 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6394 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6395 echo "'nm' won't be sufficient on this system." >&4
6401 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6402 if $test $dflt -gt 20; then
6412 true|$define) dflt=y;;
6419 I can use $nm to extract the symbols from your C libraries. This
6420 is a time consuming task which may generate huge output on the disk (up
6421 to 3 megabytes) but that should make the symbols extraction faster. The
6422 alternative is to skip the 'nm' extraction part and to compile a small
6423 test program instead to determine whether each symbol is present. If
6424 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6425 this may be the best solution.
6427 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6430 rp="Shall I use $nm to extract C symbols from the libraries?"
6433 [Nn]*) usenm=false;;
6442 : nm options which may be necessary
6444 '') if $test -f /mach_boot; then
6446 elif $test -d /usr/ccs/lib; then
6447 nm_opt='-p' # Solaris (and SunOS?)
6448 elif $test -f /dgux; then
6450 elif $test -f /lib64/rld; then
6451 nm_opt='-p' # 64-bit Irix
6457 : nm options which may be necessary for shared libraries but illegal
6458 : for archive libraries. Thank you, Linux.
6459 case "$nm_so_opt" in
6460 '') case "$myuname" in
6462 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6463 nm_so_opt='--dynamic'
6470 : Figure out where the libc is located
6473 : get list of predefined functions in a handy place
6478 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6484 *) for thislib in $libs; do
6487 : Handle C library specially below.
6490 thislib=`echo $thislib | $sed -e 's/^-l//'`
6491 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6493 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6495 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6497 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6499 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6501 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6503 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6508 libnames="$libnames $try"
6510 *) libnames="$libnames $thislib" ;;
6519 for xxx in $libpth; do
6520 $test -r $1 || set $xxx/libc.$so
6521 : The messy sed command sorts on library version numbers.
6523 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6524 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6526 s/[0-9][0-9]*/0000&/g
6527 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6530 $sort | $sed -e 's/^.* //'`
6533 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6534 $test -r $1 || set $sysroot/lib/libsys_s$_a
6540 if $test -r "$1"; then
6541 echo "Your (shared) C library seems to be in $1."
6543 elif $test -r /lib/libc && $test -r /lib/clib; then
6544 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6546 libc='/lib/clib /lib/libc'
6547 if $test -r /lib/syslib; then
6548 echo "(Your math library is in /lib/syslib.)"
6549 libc="$libc /lib/syslib"
6551 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6552 echo "Your C library seems to be in $libc, as you said before."
6553 elif $test -r $incpath/usr/lib/libc$_a; then
6554 libc=$incpath/usr/lib/libc$_a;
6555 echo "Your C library seems to be in $libc. That's fine."
6556 elif $test -r /lib/libc$_a; then
6558 echo "Your C library seems to be in $libc. You're normal."
6560 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6562 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6563 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6564 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6566 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6568 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6571 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6573 if $test -r "$tans"; then
6574 echo "Your C library seems to be in $tans, of all places."
6580 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6584 If the guess above is wrong (which it might be if you're using a strange
6585 compiler, or your machine supports multiple models), you can override it here.
6590 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6592 I can't seem to find your C library. I've looked in the following places:
6595 $sed 's/^/ /' libpath
6598 None of these seems to contain your C library. I need to get its name...
6603 rp='Where is your C library?'
6608 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6609 set X `cat libnames`
6612 case $# in 1) xxx=file; esac
6613 echo "Extracting names from the following $xxx for later perusal:" >&4
6615 $sed 's/^/ /' libnames >&4
6617 $echo $n "This may take a while...$c" >&4
6621 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6622 *) $nm $nm_opt $file 2>/dev/null;;
6627 $grep fprintf libc.tmp > libc.ptf
6628 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6629 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6631 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6635 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6639 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6643 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6647 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6651 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6655 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6656 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6672 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6676 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6680 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6684 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 $nm -p $* 2>/dev/null >libc.tmp
6690 $grep fprintf libc.tmp > libc.ptf
6691 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6692 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6698 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6700 if $ar t $libc > libc.tmp && \
6701 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6703 for thisname in $libnames $libc; do
6704 $ar t $thisname >>libc.tmp
6706 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6708 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6709 for thisname in $libnames $libc; do
6710 $ar tv $thisname >>libc.tmp
6711 emximp -o tmp.imp $thisname \
6713 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6714 < tmp.imp >>libc.tmp
6717 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6720 echo "$ar didn't seem to work right." >&4
6721 echo "Maybe this is a Cray...trying bld instead..." >&4
6723 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6726 for thisname in $libnames; do
6728 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6729 $ar t $thisname >>libc.tmp
6733 echo "That didn't work either. Giving up." >&4
6743 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6744 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6746 *) if $test -f /lib/syscalls.exp; then
6748 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6749 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6750 /lib/syscalls.exp >>libc.list
6756 $rm -f libnames libpath
6758 : Check if we are using C++
6760 echo "Checking for C++..." >&4
6761 $cat >try.c <<'EOCP'
6773 if eval $compile_ok && $run ./try; then
6775 echo "You are using a C++ compiler."
6778 echo "You are not using a C++ compiler."
6784 : is a C symbol defined?
6787 -v) tf=libc.tmp; tdc="";;
6788 -a) tf=libc.tmp; tdc="[]";;
6789 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6791 case "$d_cplusplus" in
6792 $define) extern_C="extern \"C\"" ;;
6793 *) extern_C="extern" ;;
6796 case "$reuseval-$4" in
6798 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6803 if $test "$runnm" = true; then
6804 if $contains $tlook $tf >/dev/null 2>&1; then
6806 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6807 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;
6808 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6809 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6813 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6814 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6820 $define) tval=true;;
6827 : define an is-in-libc? function
6828 inlibc='echo " "; td=$define; tu=$undef;
6829 sym=$1; var=$2; eval "was=\$$2";
6831 case "$reuseval$was" in
6841 echo "$sym() found." >&4;
6842 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6844 echo "$sym() NOT found." >&4;
6845 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6849 $define) echo "$sym() found." >&4;;
6850 *) echo "$sym() NOT found." >&4;;
6854 : check for length of double
6856 case "$doublesize" in
6858 echo "Checking to see how big your double precision numbers are..." >&4
6867 printf("%d\n", (int)sizeof(double));
6872 if eval $compile_ok; then
6873 doublesize=`$run ./try`
6874 echo "Your double is $doublesize bytes long."
6877 echo "(I can't seem to compile the test program. Guessing...)"
6878 rp="What is the size of a double precision number (in bytes)?"
6886 : check for long doubles
6888 echo "Checking to see if you have long double..." >&4
6889 echo 'int main() { long double x = 7.0; }' > try.c
6891 if eval $compile; then
6893 echo "You have long double."
6896 echo "You do not have long double."
6902 : see if ldexpl exists
6906 : check for length of long double
6907 case "${d_longdbl}${longdblsize}" in
6910 echo "Checking to see how big your long doubles are..." >&4
6911 $cat >try.c <<'EOCP'
6915 printf("%d\n", sizeof(long double));
6920 if eval $compile; then
6921 longdblsize=`$run ./try`
6922 echo "Your long doubles are $longdblsize bytes long."
6926 echo "(I can't seem to compile the test program. Guessing...)" >&4
6927 rp="What is the size of a long double (in bytes)?"
6931 if $test "X$doublesize" = "X$longdblsize"; then
6932 echo "That isn't any different from an ordinary double."
6933 echo "I'll keep your setting anyway, but you may see some"
6934 echo "harmless compilation warnings."
6940 $echo "Checking the kind of long doubles you have..." >&4
6941 case "$d_longdbl" in
6945 #define LONGDBLSIZE $longdblsize
6946 #define DOUBLESIZE $doublesize
6952 static const long double d = -0.1L;
6954 unsigned const char* b = (unsigned const char*)(&d);
6955 #if DOUBLESIZE == LONGDBLSIZE
6956 printf("0\n"); /* if it floats like double */
6959 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6960 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6961 /* IEEE 754 128-bit little-endian */
6965 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6966 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6971 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6972 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6973 * cannot be trusted. */
6974 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6975 if (b[0] == 0xCD && b[9] == 0xBF) {
6976 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6977 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6978 * Also known as "extended precision". */
6982 if (b[0] == 0xBF && b[9] == 0xCD) {
6983 /* Is there ever big-endian 80-bit, really?
6985 * The Motorola 68881 had another "extended precision" format:
6986 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6987 * for total of 96 bits of bytes. The zero bits were unused.
6988 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6989 * If it ever becomes relevant, this format should be allocated
6990 * a new doublekind code since it's quite different from the Intel x87.
6996 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6997 /* software "double double", the 106 is 53+53.
6998 * but irix thinks it is 107. */
6999 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7000 /* double double 128-bit fully little-endian,
7001 * little-endian doubles in little-endian order,
7002 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7006 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7007 /* double double 128-bit fully big-endian,
7008 * big-endian doubles in big-endian order,
7009 * e.g. PPC/Power and MIPS:
7010 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7014 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7015 /* double double 128-bit mixed endian.
7016 * little-endian doubles in big-endian order,
7018 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7022 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7023 /* double double 128-bit mixed endian,
7024 * big-endian doubles in little-endian order,
7025 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7030 /* We are largely making this up because it may well be
7031 * that the VAX format H was never made available to C,
7032 * only to Fortran. */
7033 #if LONGDBLSIZE == 16 && defined(__vax__)
7034 if (b[0] == 0xFD && b[15] == 0x99) {
7035 /* VAX format H, PDP-11 mixed endian. */
7040 printf("-1\n"); /* unknown */
7045 if eval $compile; then
7046 longdblkind=`$run ./try`
7053 case "$longdblkind" in
7054 0) echo "Your long doubles are doubles." >&4 ;;
7055 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7056 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7057 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7058 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7059 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7060 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7061 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7062 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7063 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7064 *) echo "Cannot figure out your long double." >&4 ;;
7066 d_long_double_style_ieee=$undef
7067 d_long_double_style_ieee_std=$undef
7068 d_long_double_style_ieee_extended=$undef
7069 d_long_double_style_ieee_doubledouble=$undef
7070 d_long_double_style_vax=$undef
7071 case "$longdblkind" in
7072 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7074 case "$longdblkind" in
7075 1|2) d_long_double_style_ieee_std=$define ;;
7077 case "$longdblkind" in
7078 3|4) d_long_double_style_ieee_extended=$define ;;
7080 case "$longdblkind" in
7081 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7083 case "$longdblkind" in
7084 9) d_long_double_style_vax=$define ;;
7088 : determine the architecture name
7090 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7091 tarch=`arch`"-$osname"
7092 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7093 if uname -m > tmparch 2>&1 ; then
7094 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7095 -e 's/$/'"-$osname/" tmparch`
7103 case "$myarchname" in
7106 echo "(Your architecture name used to be $myarchname.)"
7110 case "$targetarch" in
7112 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7117 *) dflt="$archname";;
7119 rp='What is your architecture name'
7123 : optionally add API version to the architecture for versioned archlibs
7124 case "$useversionedarchname" in
7125 $define|true|[yY]*) dflt='y';;
7128 rp='Add the Perl API version to your archname?'
7131 y|Y) useversionedarchname="$define" ;;
7132 *) useversionedarchname="$undef" ;;
7134 case "$useversionedarchname" in
7137 *-$api_versionstring)
7138 echo "...and architecture name already has -$api_versionstring" >&4
7141 archname="$archname-$api_versionstring"
7142 echo "...setting architecture name to $archname." >&4
7148 case "$usethreads" in
7150 echo "Threads selected." >&4
7152 *-thread*) echo "...and architecture name already has -thread." >&4
7154 *) archname="$archname-thread"
7155 echo "...setting architecture name to $archname." >&4
7160 case "$usemultiplicity" in
7162 echo "Multiplicity selected." >&4
7164 *-multi*) echo "...and architecture name already has -multi." >&4
7166 *) archname="$archname-multi"
7167 echo "...setting architecture name to $archname." >&4
7172 case "$use64bitint$use64bitall" in
7174 case "$archname64" in
7176 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7179 case "$use64bitint" in
7180 "$define") echo "64 bit integers selected." >&4 ;;
7182 case "$use64bitall" in
7183 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7186 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7188 *) archname="$archname-$archname64"
7189 echo "...setting architecture name to $archname." >&4
7195 case "$uselongdouble" in
7197 echo "Long doubles selected." >&4
7198 case "$longdblsize" in
7200 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7204 *-ld*) echo "...and architecture name already has -ld." >&4
7206 *) archname="$archname-ld"
7207 echo "...setting architecture name to $archname." >&4
7214 case "$usequadmath" in
7216 echo "quadmath selected." >&4
7218 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7220 *) archname="$archname-quadmath"
7221 echo "...setting architecture name to $archname." >&4
7226 if $test -f archname.cbu; then
7227 echo "Your platform has some specific hints for architecture name, using them..."
7231 : set the prefixit variable, to compute a suitable default value
7232 prefixit='case "$3" in
7234 case "$oldprefix" in
7235 "") eval "$1=\"\$$2\"";;
7242 ""|" ") eval "$1=\"\$$2\"";;
7248 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7250 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7251 /*-$oldprefix/*|\~*-$oldprefix/*)
7252 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7253 *) eval "$1=\"\$$2\"";;
7257 : determine installation style
7258 : For now, try to deduce it from prefix unless it is already set.
7259 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7260 case "$installstyle" in
7261 '') case "$prefix" in
7262 *perl*) dflt='lib';;
7263 *) dflt='lib/perl5' ;;
7266 *) dflt="$installstyle" ;;
7268 : Probably not worth prompting for this since we prompt for all
7269 : the directories individually, and the prompt would be too long and
7273 : determine where public executables go
7278 rp='Pathname where the public executables will reside?'
7280 if $test "X$ansexp" != "X$binexp"; then
7284 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7285 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7286 : this via initialinstalllocation
7289 case "$userelocatableinc" in
7290 $define|true|[yY]*) dflt='y' ;;
7295 Would you like to build Perl so that the installation is relocatable, so that
7296 library paths in @INC are determined relative to the path of the perl binary?
7297 This is not advised for system Perl installs, or if you need to run setid
7298 scripts or scripts under taint mode.
7300 If this doesn't make any sense to you, just accept the default '$dflt'.
7302 rp='Use relocatable @INC?'
7305 y|Y) val="$define" ;;
7308 set userelocatableinc
7311 initialinstalllocation="$binexp"
7312 : Default prefix is now "up one level from where the binaries are"
7313 case "$userelocatableinc" in
7319 installprefixexp=".../.."
7323 : determine where private library files go
7324 : Usual default is /usr/local/lib/perl5/$version.
7325 : Also allow things like /opt/perl/lib/$version, since
7326 : /opt/perl/lib/perl5... would be redundant.
7327 : The default "style" setting is made in installstyle.U
7328 case "$installstyle" in
7329 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7330 *) set dflt privlib lib/$version ;;
7335 There are some auxiliary files for $package that need to be put into a
7336 private library directory that is accessible by everyone.
7341 rp='Pathname where the private library files will reside?'
7346 : set the prefixup variable, to restore leading tilda escape
7347 prefixup='case "$prefixexp" in
7349 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7352 : determine where public architecture dependent libraries go
7355 : privlib default is /usr/local/lib/$package/$version
7356 : archlib default is /usr/local/lib/$package/$version/$archname
7357 : privlib may have an optional trailing /share.
7358 tdflt=`echo $privlib | $sed 's,/share$,,'`
7359 tdflt=$tdflt/$archname
7368 $spackage contains architecture-dependent library files. If you are
7369 sharing libraries in a heterogeneous environment, you might store
7370 these files in a separate location. Otherwise, you can just include
7371 them with the rest of the public library files.
7376 rp='Where do you want to put the public architecture-dependent libraries?'
7380 if $test X"$archlib" = X"$privlib"; then
7386 : see if setuid scripts can be secure
7389 Some kernels have a bug that prevents setuid #! scripts from being
7390 secure. Some sites have disabled setuid #! scripts because of this.
7392 First let's decide if your kernel supports secure setuid #! scripts.
7393 (If setuid #! scripts would be secure but have been disabled anyway,
7394 don't say that they are secure if asked.)
7399 if $test -d /dev/fd; then
7400 echo "#!$ls" >reflect
7401 chmod +x,u+s reflect
7402 ./reflect >flect 2>&1
7403 if $contains "/dev/fd" flect >/dev/null; then
7404 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7408 If you are not sure if they are secure, I can check but I'll need a
7409 username and password different from the one you are using right now.
7410 If you don't have such a username or don't want me to test, simply
7414 rp='Other username to test security of setuid scripts with?'
7419 case "$d_suidsafe" in
7420 '') echo "I'll assume setuid scripts are *not* secure." >&4
7423 echo "Well, the $hint value is *not* secure." >&4
7425 *) echo "Well, the $hint value *is* secure." >&4
7430 $rm -f reflect flect
7431 echo "#!$ls" >reflect
7432 chmod +x,u+s reflect
7435 echo '"su" will (probably) prompt you for '"$ans's password."
7436 su $ans -c './reflect >flect'
7437 if $contains "/dev/fd" flect >/dev/null; then
7438 echo "Okay, it looks like setuid scripts are secure." >&4
7441 echo "I don't think setuid scripts are secure." >&4
7446 rp='Does your kernel have *secure* setuid scripts?'
7449 [yY]*) val="$define";;
7454 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7455 echo "(That's for file descriptors, not floppy disks.)"
7461 $rm -f reflect flect
7463 : now see if they want to do setuid emulation
7464 if $test $patchlevel -lt 11; then
7467 case "$d_suidsafe" in
7470 echo "No need to emulate SUID scripts since they are secure here." >&4
7474 Some systems have disabled setuid scripts, especially systems where
7475 setuid scripts cannot be secure. On systems where setuid scripts have
7476 been disabled, the setuid/setgid bits on scripts are currently
7477 useless. It is possible for $package to detect those bits and emulate
7478 setuid/setgid in a secure fashion. This emulation will only work if
7479 setuid scripts have been disabled in your kernel.
7483 "$define") dflt=y ;;
7486 rp="Do you want to do setuid/setgid emulation?"
7489 [yY]*) val="$define";;
7501 SUID emulation has been removed for 5.12
7502 Please re-run Configure without -Dd_dosuid
7511 : Find perl5.005 or later.
7512 echo "Looking for a previously installed perl5.005 or later... "
7514 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7515 : Check if this perl is recent and can load a simple module
7516 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7519 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7529 '') echo "None found. That's ok.";;
7530 *) echo "Using $perl5." ;;
7533 : Set the siteprefix variables
7536 After $package is installed, you may wish to install various
7537 add-on modules and utilities. Typically, these add-ons will
7538 be installed under $prefix with the rest
7539 of this package. However, you may wish to install such add-ons
7540 elsewhere under a different prefix.
7542 If you do not wish to put everything under a single prefix, that's
7543 ok. You will be prompted for the individual locations; this siteprefix
7544 is only used to suggest the defaults.
7546 The default should be fine for most people.
7550 rp='Installation prefix to use for add-on modules and utilities?'
7551 : XXX Here might be another good place for an installstyle setting.
7552 case "$siteprefix" in
7554 *) dflt=$siteprefix ;;
7557 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7559 case "$siteprefix" in
7563 *) oldsiteprefix="$prefix";;
7568 siteprefixexp="$ansexp"
7570 : determine where site specific libraries go.
7571 : Usual default is /usr/local/lib/perl5/site_perl/$version
7572 : The default "style" setting is made in installstyle.U
7573 : XXX No longer works with Prefixit stuff.
7574 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7576 '') case "$installstyle" in
7577 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7578 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7586 The installation process will create a directory for
7587 site-specific extensions and modules. Most users find it convenient
7588 to place all site-specific files in this directory rather than in the
7589 main distribution directory.
7593 rp='Pathname for the site-specific library files?'
7597 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7599 : Determine list of previous versions to include in @INC
7600 $cat > getverlist <<EOPL
7603 \$api_versionstring = "$api_versionstring";
7604 \$version = "$version";
7605 \$stem = "$sitelib_stem";
7606 \$archname = "$archname";
7608 $cat >> getverlist <<'EOPL'
7609 # The list found is store twice for each entry: the original name, and
7610 # the binary broken down version as pack "sss", so sorting is easy and
7611 # unambiguous. This will work for all versions that have a maximum of
7612 # three digit groups, separate by '.'s or '_'s. Names are extended with
7613 # ".0.0" to ensure at least three elements for the pack.
7614 # -- H.Merijn Brand (m)'06 23-10-2006
7616 # Can't have leading @ because metaconfig interprets it as a command!
7617 ;@inc_version_list=();
7618 # XXX Redo to do opendir/readdir?
7621 ;@candidates = map {
7622 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7623 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7629 ($pversion, $aversion, $vsn5005) = map {
7630 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7631 foreach $d (@candidates) {
7632 if ($d->[1] lt $pversion) {
7633 if ($d->[1] ge $aversion) {
7634 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7636 elsif ($d->[1] ge $vsn5005) {
7637 unshift(@inc_version_list, grep { -d } $d->[0]);
7641 # Skip newer version. I.e. don't look in
7642 # 5.7.0 if we're installing 5.6.1.
7646 if (@inc_version_list) {
7647 print join(' ', @inc_version_list);
7650 # Blank space to preserve value for next Configure run.
7655 case "$inc_version_list" in
7656 '') if test -x "$perl5$exe_ext"; then
7657 dflt=`$perl5 getverlist`
7662 $undef) dflt='none' ;;
7663 *) eval dflt=\"$inc_version_list\" ;;
7666 ''|' ') dflt=none ;;
7673 In order to ease the process of upgrading, this version of perl
7674 can be configured to use modules built and installed with earlier
7675 versions of perl that were installed under $prefix. Specify here
7676 the list of earlier versions that this version of perl should check.
7677 If Configure detected no earlier versions of perl installed under
7678 $prefix, then the list will be empty. Answer 'none' to tell perl
7679 to not search earlier versions.
7681 The default should almost always be sensible, so if you're not sure,
7682 just accept the default.
7685 rp='List of earlier versions to include in @INC?'
7688 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7689 *) inc_version_list="$ans" ;;
7691 case "$inc_version_list" in
7693 inc_version_list_init='0'
7694 d_inc_version_list="$undef"
7696 *) inc_version_list_init=`echo $inc_version_list |
7697 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7698 d_inc_version_list="$define"
7703 : see if malloc/malloc.h has to be included
7704 set malloc/malloc.h i_mallocmalloc
7707 : see if this is a malloc.h system
7708 : we want a real compile instead of Inhdr because some systems have a
7709 : malloc.h that just gives a compile error saying to use stdlib.h instead
7714 #$i_mallocmalloc I_MALLOCMALLOC
7715 #ifdef I_MALLOCMALLOC
7716 # include <malloc/malloc.h>
7719 int main () { return 0; }
7722 if eval $compile; then
7723 echo "<malloc.h> found." >&4
7726 echo "<malloc.h> NOT found." >&4
7733 : check for length of pointer
7737 echo "Checking to see how big your pointers are..." >&4
7746 printf("%d\n", (int)sizeof(void *));
7751 if eval $compile_ok; then
7752 ptrsize=`$run ./try`
7753 echo "Your pointers are $ptrsize bytes long."
7756 echo "(I can't seem to compile the test program. Guessing...)" >&4
7757 rp="What is the size of a pointer (in bytes)?"
7764 case "$use64bitall" in
7765 "$define"|true|[yY]*)
7769 *** You have chosen a maximally 64-bit build,
7770 *** but your pointers are only 4 bytes wide.
7771 *** Please rerun Configure without -Duse64bitall.
7776 *** Since you have quads, you could possibly try with -Duse64bitint.
7781 *** Cannot continue, aborting.
7792 : determine whether to use malloc wrapping
7794 case "$usemallocwrap" in
7795 [yY]*|true|$define) dflt='y' ;;
7796 [nN]*|false|$undef) dflt='n' ;;
7797 *) case "$usedevel" in
7798 [yY]*|true|$define) dflt='y' ;;
7803 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7805 usemallocwrap="$ans"
7808 usemallocwrap="$define" ;;
7810 usemallocwrap="$undef" ;;
7813 : determine which malloc to compile in
7815 case "$usemymalloc" in
7816 [yY]*|true|$define) dflt='y' ;;
7817 [nN]*|false|$undef) dflt='n' ;;
7818 *) case "$ptrsize" in
7822 if test "$useithreads" = "$define"; then dflt='n'; fi
7825 rp="Do you wish to attempt to use the malloc that comes with $package?"
7831 mallocsrc='malloc.c'
7832 mallocobj="malloc$_o"
7833 d_mymalloc="$define"
7836 : Remove malloc from list of libraries to use
7837 echo "Removing unneeded -lmalloc from library list" >&4
7838 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7841 echo "libs = $libs" >&4
7853 : compute the return types of malloc and free
7855 $cat >malloc.c <<END
7859 #include <sys/types.h>
7873 case "$malloctype" in
7875 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7882 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7886 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7893 echo "Your system uses $freetype free(), it would seem." >&4
7895 : determine where site specific architecture-dependent libraries go.
7896 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7897 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7898 : sitelib may have an optional trailing /share.
7900 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7901 dflt="$dflt/$archname"
7906 set sitearch sitearch none
7910 The installation process will also create a directory for
7911 architecture-dependent site-specific extensions and modules.
7915 rp='Pathname for the site-specific architecture-dependent library files?'
7919 if $test X"$sitearch" = X"$sitelib"; then
7922 d_sitearch="$define"
7925 : Set the vendorprefix variables
7928 The installation process will also create a directory for
7929 vendor-supplied add-ons. Vendors who supply perl with their system
7930 may find it convenient to place all vendor-supplied files in this
7931 directory rather than in the main distribution directory. This will
7932 ease upgrades between binary-compatible maintenance versions of perl.
7934 Of course you may also use these directories in whatever way you see
7935 fit. For example, you might use them to access modules shared over a
7936 company-wide network.
7938 The default answer should be fine for most people.
7939 This causes further questions about vendor add-ons to be skipped
7940 and no vendor-specific directories will be configured for perl.
7943 rp='Do you want to configure vendor-specific add-on directories?'
7944 case "$usevendorprefix" in
7945 define|true|[yY]*) dflt=y ;;
7946 *) : User may have set vendorprefix directly on Configure command line.
7947 case "$vendorprefix" in
7956 rp='Installation prefix to use for vendor-supplied add-ons?'
7957 case "$vendorprefix" in
7958 '') dflt="$prefix" ;;
7959 *) dflt=$vendorprefix ;;
7962 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7964 case "$vendorprefix" in
7968 *) oldvendorprefix="$prefix";;
7972 usevendorprefix="$define"
7974 vendorprefixexp="$ansexp"
7976 *) usevendorprefix="$undef"
7982 : Set the vendorlib variables
7983 case "$vendorprefix" in
7984 '') d_vendorlib="$undef"
7988 *) d_vendorlib="$define"
7989 : determine where vendor-supplied modules go.
7990 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7991 case "$vendorlib" in
7993 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7994 case "$installstyle" in
7995 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7996 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7999 *) dflt="$vendorlib"
8003 rp='Pathname for the vendor-supplied library files?'
8006 vendorlibexp="$ansexp"
8009 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8013 : Set the vendorarch variables
8014 case "$vendorprefix" in
8015 '') d_vendorarch="$undef"
8019 *) d_vendorarch="$define"
8020 : determine where vendor-supplied architecture-dependent libraries go.
8021 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8022 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8023 : vendorlib may have an optional trailing /share.
8024 case "$vendorarch" in
8025 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8026 dflt="$dflt/$archname"
8028 *) dflt="$vendorarch" ;;
8031 rp='Pathname for vendor-supplied architecture-dependent files?'
8034 vendorarchexp="$ansexp"
8037 prefixvar=vendorarch
8039 if $test X"$vendorarch" = X"$vendorlib"; then
8040 d_vendorarch="$undef"
8042 d_vendorarch="$define"
8045 : Final catch-all directories to search
8048 Lastly, you can have perl look in other directories for extensions and
8049 modules in addition to those already specified.
8050 These directories will be searched after
8054 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8055 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8057 case "$otherlibdirs" in
8058 ''|' ') dflt='none' ;;
8059 *) dflt="$otherlibdirs" ;;
8062 Enter a colon-separated set of extra paths to include in perl's @INC
8063 search path, or enter 'none' for no extra paths.
8067 rp='Colon-separated list of additional directories for perl to search?'
8070 ' '|''|none) otherlibdirs=' ' ;;
8071 *) otherlibdirs="$ans" ;;
8073 case "$otherlibdirs" in
8077 set d_perl_otherlibdirs
8081 dflt_dtrace='/usr/sbin/dtrace'
8082 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8086 Perl can be built to support DTrace on platforms that support it.
8087 DTrace is a diagnosis and performance analysis tool from Sun.
8089 If this doesn't make any sense to you, just accept the default.
8093 case "$usedtrace" in
8099 dflt_dtrace=$usedtrace
8106 rp='Support DTrace if available?'
8109 y|Y) val="$define" ;;
8115 test "X$usedtrace" != "X$define" && break
8118 rp='Where is the dtrace executable?'
8127 if $dtrace -h -s ../perldtrace.d \
8128 -o perldtrace.tmp >/dev/null 2>&1 \
8129 && rm -f perldtrace.tmp
8132 echo "Good: your $dtrace knows about the -h flag."
8136 *** $me: Fatal Error: $dtrace doesn't support -h flag
8138 *** Your installed dtrace doesn't support the -h switch to compile a D
8139 *** program into a C header. Can't continue.
8151 *** $me: Fatal Error: $dtrace not found.
8158 echo "*** $dtrace was not found."
8164 : See if we want extra modules installed
8171 Perl can be built with extra modules or bundles of modules which
8172 will be fetched from the CPAN and installed alongside Perl.
8174 Notice that you will need access to the CPAN; either via the Internet,
8175 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8176 be asked later to configure the CPAN.pm module which will in turn do
8177 the installation of the rest of the extra modules or bundles.)
8179 Notice also that if the modules require any external software such as
8180 libraries and headers (the libz library and the zlib.h header for the
8181 Compress::Zlib module, for example) you MUST have any such software
8182 already installed, this configuration process will NOT install such
8185 If this doesn't make any sense to you, just accept the default '$dflt'.
8187 rp='Install any extra modules (y or n)?'
8193 Please list any extra modules or bundles to be installed from CPAN,
8194 with spaces between the names. The names can be in any format the
8195 'install' command of CPAN.pm will understand. (Answer 'none',
8196 without the quotes, to install no extra modules or bundles.)
8206 $rm -f ../extras.lst
8208 *) echo "(Saving the list of extras for later...)"
8209 echo "$extras" > ../extras.lst
8217 : determine where html pages for programs go
8218 set html1dir html1dir none
8222 If you wish to install html files for programs in $spackage, indicate
8223 the appropriate directory here. To skip installing html files,
8227 ''|none|$undef|' ') dflt=none ;;
8228 *) dflt=$html1dir ;;
8231 rp="Directory for the main $spackage html pages?"
8235 : Use ' ' for none so value is preserved next time through Configure
8236 $test X"$html1dir" = "X" && html1dir=' '
8238 : determine where html pages for libraries and modules go
8239 set html3dir html3dir none
8243 If you wish to install html files for modules associated with $spackage,
8244 indicate the appropriate directory here. To skip installing html files,
8247 : There is no obvious default. If they have specified html1dir, then
8248 : try to key off that, possibly changing .../html1 into .../html3.
8250 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8251 *) dflt=$html3dir ;;
8254 rp="Directory for the $spackage module html pages?"
8258 : Use ' ' for none so value is preserved next time through Configure
8259 $test X"$html3dir" = "X" && html3dir=' '
8261 : determine whether to install perl also as /usr/bin/perl
8264 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8266 Many scripts expect perl to be installed as /usr/bin/perl.
8268 If you want to, I can install the perl you are about to compile
8269 as /usr/bin/perl (in addition to $bin/perl).
8271 if test -f /usr/bin/perl; then
8274 However, please note that because you already have a /usr/bin/perl,
8275 overwriting that with a new Perl would very probably cause problems.
8276 Therefore I'm assuming you don't want to do that (unless you insist).
8279 case "$installusrbinperl" in
8280 "$define"|[yY]*) dflt='y';;
8286 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8289 case "$installusrbinperl" in
8290 "$undef"|[nN]*) dflt='n';;
8294 rp="Do you want to install perl as /usr/bin/perl?"
8297 [yY]*) val="$define";;
8303 set installusrbinperl
8306 : see if dlopen exists
8308 xxx_ccflags="$ccflags"
8310 : with g++ one needs -shared to get is-in-libc to work for dlopen
8311 case "$gccversion" in
8314 *) case "$d_cplusplus" in
8315 "$define") ccflags="$ccflags -shared" ;;
8322 ccflags="$xxx_ccflags"
8324 : see if this is a unistd.h system
8325 set unistd.h i_unistd
8328 : determine which dynamic loading, if any, to compile in
8330 dldir="ext/DynaLoader"
8343 $define) dflt='y' ;;
8345 : Does a dl_xxx.xs file exist for this operating system
8346 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8349 rp="Do you wish to use dynamic loading?"
8356 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8357 dflt="$dldir/dl_${osname}.xs"
8358 elif $test "$d_dlopen" = "$define" ; then
8359 dflt="$dldir/dl_dlopen.xs"
8364 *) dflt="$dldir/$dlsrc"
8367 echo "The following dynamic loading files are available:"
8368 : Can not go over to $dldir because getfile has path hard-coded in.
8369 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8370 rp="Source file to use for dynamic loading"
8376 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8380 Some systems may require passing special flags to $cc -c to
8381 compile modules that will be used to create a shared library.
8382 To use no flags, say "none".
8385 case "$cccdlflags" in
8386 '') case "$gccversion" in
8387 '') case "$osname" in
8389 irix*) dflt='-KPIC' ;;
8390 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8391 sunos) dflt='-pic' ;;
8395 *) case "$osname" in
8396 darwin) dflt='none' ;;
8397 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8402 *) dflt="$cccdlflags" ;;
8409 # If -Dsysroot was specified, now's the time to add it
8411 if test "X$sysroot" != X; then
8412 case "$gccversion" in
8417 dflt="$dflt --sysroot=$sysroot" ;;
8427 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8430 none) cccdlflags=' ' ;;
8431 *) cccdlflags="$ans" ;;
8436 Some systems use ld to create libraries that can be dynamically loaded,
8437 while other systems (such as those using ELF) use $cc.
8441 : Determine if this is ELF
8443 /* Test for whether ELF binaries are produced */
8455 int i = open("a.out",O_RDONLY);
8458 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8459 exit(0); /* succeed (yes, it is ELF) */
8463 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8469 '') if $test $bin_ELF = "$define"; then
8471 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8475 echo "I'll use ld to build dynamic libraries."
8483 rp="What command should be used to create dynamic libraries?"
8489 Some systems may require passing special flags to $ld to create a
8490 library that can be dynamically loaded. If your ld flags include
8491 -L/other/path options to locate libraries outside your loader's normal
8492 search path, you may need to specify those -L options here as well. To
8493 use no flags, say "none".
8496 case "$lddlflags" in
8497 '') case "$osname" in
8498 haiku) dflt='-shared' ;;
8500 case "$gccversion" in
8501 '') dflt="$dflt +vnocompatwarnings" ;;
8504 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8505 solaris) # See [perl #66604].
8506 # On Solaris 11, gcc -m64 on amd64
8507 # appears not to understand -G. gcc versions at
8508 # least as old as 3.4.3 support -shared, so just
8509 # use that with Solaris 11 and later, but keep
8510 # the old behavior for older Solaris versions.
8511 case "$gccversion" in
8513 *) case "$osvers" in
8514 2.?|2.10) dflt='-G' ;;
8515 *) dflt='-shared' ;;
8520 sunos) dflt='-assert nodefinitions' ;;
8521 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8525 *) dflt="$lddlflags" ;;
8528 : Only do this for gcc, since, for example, qcc has no concept
8530 if $test "X$sysroot" != X; then
8531 case "$gccversion" in
8533 *) dflt="$dflt --sysroot $sysroot" ;;
8537 : Try to guess additional flags to pick up local libraries.
8538 : Be careful not to append to a plain 'none'
8542 for thisflag in $ldflags; do
8547 *) dflt="$dflt $thisflag" ;;
8554 ''|' ') dflt='none' ;;
8558 *-fstack-protector-strong*)
8560 *-fstack-protector-strong*) ;; # Don't add it again
8561 *) dflt="$dflt -fstack-protector-strong" ;;
8564 *-fstack-protector*)
8566 *-fstack-protector*) ;; # Don't add it again
8567 *) dflt="$dflt -fstack-protector" ;;
8572 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8575 none) lddlflags=' ' ;;
8576 *) lddlflags="$ans" ;;
8581 Some systems may require passing special flags to $cc to indicate that
8582 the resulting executable will use dynamic linking. To use no flags,
8586 case "$ccdlflags" in
8587 '') case "$osname" in
8588 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8589 sunos) dflt='none' ;;
8593 *) dflt="$ccdlflags" ;;
8595 rp="Any special flags to pass to $cc to use dynamic linking?"
8598 none) ccdlflags=' ' ;;
8599 *) ccdlflags="$ans" ;;
8611 ld_can_script="$undef"
8612 case "$bin_ELF$usedl" in
8614 # Abuse try.h and a.out names for neat cleanup
8626 if $cc $cccdlflags $ccdlflags $ccflags \
8627 $ldflags $lddlflags -o a.out try.c \
8628 -Wl,--version-script=try.h >/dev/null 2>&1 \
8629 && $test -s a.out ; then
8630 echo "ld supports scripting" >&4
8631 ld_can_script="$define"
8633 echo "ld does not support scripting" >&4
8639 : Do we want a shared libperl?
8643 # No dynamic loading being used, so don't bother even to prompt.
8646 *) case "$useshrplib" in
8647 '') case "$osname" in
8648 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8650 also='Building a shared libperl is required for dynamic loading to work on your system.'
8664 The perl executable is normally obtained by linking perlmain.c with
8665 libperl${_a}, any static extensions (usually just DynaLoader), and
8666 any other libraries needed on this system (such as -lm, etc.). Since
8667 your system supports dynamic loading, it is probably possible to build
8668 a shared libperl.$so. If you will have more than one executable linked
8669 to libperl.$so, this will significantly reduce the size of each
8670 executable, but it may have a noticeable effect on performance. The
8671 default is probably sensible for your system.
8675 rp="Build a shared libperl.$so (y/n)"
8679 useshrplib='true' ;;
8680 *) useshrplib='false' ;;
8685 case "$useshrplib" in
8687 case "$userelocatableinc" in
8689 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8690 echo "See INSTALL for an explanation why that won't work." >&4
8696 # Figure out a good name for libperl.so. Since it gets stored in
8697 # a version-specific architecture-dependent library, the version
8698 # number isn't really that important, except for making cc/ld happy.
8700 # A name such as libperl.so.10.1
8701 majmin="libperl.$so.$patchlevel.$subversion"
8702 # A name such as libperl.so.100
8703 majonly=`echo $patchlevel $subversion |
8704 $awk '{printf "%d%02d", $1, $2}'`
8705 majonly=libperl.$so.$majonly
8706 # I'd prefer to keep the os-specific stuff here to a minimum, and
8707 # rely on figuring it out from the naming of libc.
8708 case "${osname}${osvers}" in
8709 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8712 cygwin*) # ld links now against the dll directly
8713 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8714 majonly=`echo $patchlevel $subversion |
8715 $awk '{printf "%03d%03d", $1, $2}'`
8716 majonly=cygperl5.$majonly.$so
8719 *) # Try to guess based on whether libc has major.minor.
8721 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8722 *libc.$so.[0-9]*) dflt=$majonly ;;
8723 *) dflt=libperl.$so ;;
8733 I need to select a good name for the shared libperl. If your system uses
8734 library names with major and minor numbers, then you might want something
8735 like $majmin. Alternatively, if your system uses a single version
8736 number for shared libraries, then you might want to use $majonly.
8737 Or, your system might be quite happy with a simple libperl.$so.
8739 Since the shared libperl will get installed into a version-specific
8740 architecture-dependent directory, the version number of the shared perl
8741 library probably isn't important, so the default should be o.k.
8744 rp='What name do you want to give to the shared libperl?'
8747 echo "Ok, I'll use $libperl"
8750 libperl="libperl${_a}"
8754 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8758 WARNING: Use of the shrpdir variable for the installation location of
8759 the shared $libperl is not supported. It was never documented and
8760 will not work in this version. Let me (perlbug@perl.org)
8761 know of any problems this may cause.
8767 But your current setting of $shrpdir is
8768 the default anyway, so it's harmless.
8773 Further, your current attempted setting of $shrpdir
8774 conflicts with the value of $archlibexp/CORE
8775 that installperl will use.
8782 # How will the perl executable find the installed shared $libperl?
8783 # Add $xxx to ccdlflags.
8784 # If we can't figure out a command-line option, use $shrpenv to
8785 # set env LD_RUN_PATH. The main perl makefile uses this.
8786 shrpdir=$archlibexp/CORE
8789 if "$useshrplib"; then
8792 # We'll set it in Makefile.SH...
8797 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8798 xxx="-Wl,-R$shrpdir"
8800 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8801 xxx="-Wl,-rpath,$shrpdir"
8804 # hpux doesn't like the default, either.
8805 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8808 # cygwin needs only ldlibpth
8811 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8817 # Only add $xxx if it isn't already in ccdlflags.
8818 case " $ccdlflags " in
8820 *) ccdlflags="$ccdlflags $xxx"
8823 Adding $xxx to the flags
8824 passed to $ld so that the perl executable will find the
8825 installed shared $libperl.
8833 # Fix ccdlflags in AIX for building external extensions.
8834 # (For building Perl itself bare -bE:perl.exp is needed,
8835 # Makefile.SH takes care of this.)
8837 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8839 # Respect a hint or command-line value.
8841 '') shrpenv="$tmp_shrpenv" ;;
8843 case "$ldlibpthname" in
8844 '') ldlibpthname=LD_LIBRARY_PATH ;;
8845 none) ldlibpthname='' ;;
8848 : determine where manual pages are on this system
8852 syspath='/usr/share/man/man1 /usr/man/man1'
8853 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8854 syspath="$syspath /usr/man/u_man/man1"
8855 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8856 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8857 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8858 sysman=`./loc . /usr/man/man1 $syspath`
8861 if $test -d "$sysman"; then
8862 echo "System manual is in $sysman." >&4
8864 echo "Could not find manual pages in source form." >&4
8867 : determine where manual pages go
8868 set man1dir man1dir none
8872 $spackage has manual pages available in source form.
8876 echo "However, you don't have nroff, so they're probably useless to you."
8878 '') man1dir="none";;
8881 echo "If you don't want the manual sources installed, answer 'none'."
8886 lookpath="$prefixexp/share/man/man1"
8887 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8888 lookpath="$lookpath $prefixexp/man/p_man/man1"
8889 lookpath="$lookpath $prefixexp/man/u_man/man1"
8890 lookpath="$lookpath $prefixexp/man/man.1"
8892 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8893 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8903 rp="Where do the main $spackage manual pages (source) go?"
8905 if $test "X$man1direxp" != "X$ansexp"; then
8916 : What suffix to use on installed man pages
8923 rp="What suffix should be used for the main $spackage man pages?"
8925 '') case "$man1dir" in
8939 *) dflt="$man1ext";;
8946 : see if we can have long filenames
8948 first=123456789abcdef
8950 if (echo hi >$first) 2>/dev/null; then
8951 if $test -f 123456789abcde; then
8952 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8955 echo 'You can have filenames longer than 14 characters.'>&4
8960 You can't have filenames longer than 14 chars.
8961 You can't even think about them!
8967 $rm -rf 123456789abcde*
8969 : determine where library module manual pages go
8970 set man3dir man3dir none
8974 $spackage has manual pages for many of the library modules.
8980 However, you don't have nroff, so they're probably useless to you.
8983 '') man3dir="none";;
8987 case "$d_flexfnam" in
8990 However, your system can't handle the long file names like File::Basename.3.
8993 '') man3dir="none";;
8997 echo "If you don't want the manual sources installed, answer 'none'."
8998 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9000 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9001 if $test -d "$privlib/man/man3"; then
9004 WARNING: Previous versions of perl installed man3 pages into
9005 $privlib/man/man3. This version will suggest a
9006 new default of $dflt.
9010 rp='Do you wish to preserve the old behavior?(y/n)'
9013 y*) dflt="$privlib/man/man3" ;;
9018 *) dflt="$man3dir" ;;
9025 rp="Where do the $package library man pages (source) go?"
9035 : What suffix to use on installed man pages
9041 rp="What suffix should be used for the $package library man pages?"
9043 '') case "$man3dir" in
9057 *) dflt="$man3ext";;
9064 : see if we have to deal with yellow pages, now NIS.
9065 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9071 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9079 rp='Are you getting the hosts file via yellow pages?'
9082 y*) hostcat='ypcat hosts';;
9083 *) hostcat='cat /etc/hosts';;
9089 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9092 '') test -f /etc/group && groupcat='cat /etc/group';;
9095 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9098 : now get the host name
9100 echo "Figuring out host name..." >&4
9101 case "$myhostname" in
9103 echo 'Maybe "hostname" will work...'
9104 if tans=`sh -c hostname 2>&1` ; then
9112 if $test "$cont"; then
9114 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9115 if tans=`cat /etc/systemid 2>&1` ; then
9117 phostname='cat /etc/systemid'
9118 echo "Whadyaknow. Xenix always was a bit strange..."
9121 elif $test -r /etc/systemid; then
9122 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9125 if $test "$cont"; then
9126 echo 'No, maybe "uuname -l" will work...'
9127 if tans=`sh -c 'uuname -l' 2>&1` ; then
9129 phostname='uuname -l'
9131 echo 'Strange. Maybe "uname -n" will work...'
9132 if tans=`sh -c 'uname -n' 2>&1` ; then
9134 phostname='uname -n'
9136 echo 'Oh well, maybe I can mine it out of whoami.h...'
9137 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9138 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9139 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9141 case "$myhostname" in
9142 '') echo "Does this machine have an identity crisis or something?"
9145 echo "Well, you said $myhostname before..."
9146 phostname='echo $myhostname';;
9152 case "$myhostname" in
9153 '') myhostname=noname ;;
9155 : you do not want to know about this
9160 if $test "$myhostname" ; then
9162 rp='Your host name appears to be "'$myhostname'".'" Right?"
9170 : bad guess or no guess
9171 while $test "X$myhostname" = X ; do
9173 rp="Please type the (one word) name of your host:"
9178 : translate upper to lower if necessary
9179 case "$myhostname" in
9181 echo "(Normalizing case in your host name)"
9182 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9186 case "$myhostname" in
9188 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9189 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9190 echo "(Trimming domain name from host name--host name is now $myhostname)"
9192 *) case "$mydomain" in
9195 test "X$hostcat" = "Xypcat hosts" &&
9196 ypmatch "$myhostname" hosts 2>/dev/null |\
9197 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9200 test "X$hostcat" != "X" &&
9201 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9202 /[ ]$myhostname[ . ]/p" > hosts
9205 if $test -f hosts; then
9206 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9207 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9208 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9209 hosts | $sort | $uniq | \
9210 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9211 case `$echo X$dflt` in
9212 X*\ *) echo "(Several hosts in the database matched hostname)"
9215 X.) echo "(You do not have fully-qualified names in the hosts database)"
9219 echo "(I cannot locate a hosts database anywhere)"
9224 tans=`./loc resolv.conf X /etc /usr/etc`
9225 if $test -f "$tans"; then
9226 echo "(Attempting domain name extraction from $tans)"
9227 dflt=.`$sed -n -e 's/ / /g' \
9228 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9231 .) dflt=.`$sed -n -e 's/ / /g' \
9232 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9240 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9241 dflt=.`sh -c domainname 2>/dev/null`
9244 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9248 case "$dflt$osname" in
9249 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9250 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9254 .) echo "(Lost all hope -- silly guess then)"
9260 *) dflt="$mydomain";;
9264 rp="What is your domain name?"
9274 : translate upper to lower if necessary
9277 echo "(Normalizing case in your domain name)"
9278 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9282 : a little sanity check here
9283 case "$phostname" in
9286 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9287 $myhostname$mydomain|$myhostname) ;;
9289 case "$phostname" in
9291 echo "(That doesn't agree with your whoami.h file, by the way.)"
9294 echo "(That doesn't agree with your $phostname command, by the way.)"
9302 : determine the e-mail address of the user who is running us
9305 I need to get your e-mail address in Internet format if possible, i.e.
9306 something like user@host.domain. Please answer accurately since I have
9307 no easy means to double check it. The default value provided below
9308 is most probably close to reality but may not be valid from outside
9309 your organization...
9313 while test "$cont"; do
9314 case "$MAILDOMAIN" in
9316 if $test -s /etc/mailname; then
9317 maildomain=`$cat /etc/mailname`
9319 maildomain="$myhostname$mydomain"
9322 *) maildomain="$MAILDOMAIN";;
9325 '') dflt="$cf_by@$maildomain";;
9326 *) dflt="$cf_email";;
9328 rp='What is your e-mail address?'
9334 rp='Address does not look like an Internet one. Use it anyway?'
9348 : Ask e-mail of administrator
9351 If you or somebody else will be maintaining perl at your site, please
9352 fill in the correct e-mail address here so that they may be contacted
9353 if necessary. Currently, the "perlbug" program included with perl
9354 will send mail to this address in addition to perlbug@perl.org. You may
9355 enter "none" for no administrator.
9358 case "$perladmin" in
9359 '') dflt="$cf_email";;
9360 *) dflt="$perladmin";;
9362 rp='Perl administrator e-mail address'
9366 : determine whether to use a version number suffix for installed binaries
9369 Do you want to use a version number suffix for installed binaries? This
9370 will install 'perl$version' instead of 'perl', and likewise for other
9371 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9372 to be installed side-by-side. Unless you are a developer, you probably
9373 do *not* want to do this.
9375 case "$versiononly" in
9376 "$define"|[Yy]*|true) dflt='y' ;;
9379 rp="Do you want to use a version number suffix for installed binaries?"
9382 [yY]*) val="$define";;
9388 case "$versiononly" in
9389 "$define") inc_version_list=''
9390 inc_version_list_init=0
9394 : figure out how to guarantee perl startup
9395 : XXX Note that this currently takes advantage of the bug that binexp ignores
9396 : the Configure -Dinstallprefix setting, which in turn means that under
9397 : relocatable @INC, initialinstalllocation is what binexp started as.
9398 case "$startperl" in
9400 case "$sharpbang" in
9404 I can use the #! construct to start perl on your system. This will
9405 make startup of perl scripts faster, but may cause problems if you
9406 want to share those scripts and perl is not in a standard place
9407 ($initialinstalllocation/perl) on all your platforms. The alternative
9408 is to force a shell by starting the script with a single ':' character.
9411 case "$versiononly" in
9412 "$define") dflt="$initialinstalllocation/perl$version";;
9413 *) dflt="$initialinstalllocation/perl";;
9415 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9418 none) startperl=": # use perl";;
9419 *) startperl="#!$ans"
9420 if $test 30 -lt `echo "$ans" | wc -c`; then
9423 WARNING: Some systems limit the #! command to 32 characters.
9424 If you experience difficulty running Perl scripts with #!, try
9425 installing Perl in a directory with a shorter pathname.
9431 *) startperl=": # use perl"
9436 echo "I'll use $startperl to start perl scripts."
9438 : figure best path for perl in scripts
9441 case "$versiononly" in
9442 "$define") perlpath="$initialinstalllocation/perl$version";;
9443 *) perlpath="$initialinstalllocation/perl";;
9445 case "$startperl" in
9450 I will use the "eval 'exec'" idiom to start Perl on your system.
9451 I can use the full path of your Perl binary for this purpose, but
9452 doing so may cause problems if you want to share those scripts and
9453 Perl is not always in a standard place ($initialinstalllocation/perl).
9456 dflt="$initialinstalllocation/perl"
9457 rp="What path shall I use in \"eval 'exec'\"?"
9464 case "$startperl" in
9466 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9469 : determine where public executable scripts go
9470 set scriptdir scriptdir
9472 case "$scriptdir" in
9475 : guess some guesses
9476 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9477 $test -d /usr/share/bin && dflt=/usr/share/bin
9478 $test -d /usr/local/script && dflt=/usr/local/script
9479 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9480 $test -d $prefixexp/script && dflt=$prefixexp/script
9484 *) dflt="$scriptdir"
9489 Some installations have a separate directory just for executable scripts so
9490 that they can mount it across multiple architectures but keep the scripts in
9491 one spot. You might, for example, have a subdirectory of /usr/share for this.
9492 Or you might just lump your scripts in with all your other executables.
9496 rp='Where do you keep publicly executable scripts?'
9498 if $test "X$ansexp" != "X$scriptdirexp"; then
9504 : A little fix up for an irregularly named variable.
9505 installscript="$installscriptdir"
9507 : determine where add-on public executables go
9509 '') dflt=$siteprefix/bin ;;
9513 rp='Pathname where the add-on public executables should be installed?'
9518 : determine where add-on html pages go
9519 : There is no standard location, so try to copy the previously-selected
9520 : directory structure for the core html pages.
9521 case "$sitehtml1dir" in
9522 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9523 *) dflt=$sitehtml1dir ;;
9526 ''|' ') dflt=none ;;
9529 rp='Pathname where the site-specific html pages should be installed?'
9531 prefixvar=sitehtml1dir
9534 : determine where add-on library html pages go
9535 : There is no standard location, so try to copy the previously-selected
9536 : directory structure for the core html pages.
9537 case "$sitehtml3dir" in
9538 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9539 *) dflt=$sitehtml3dir ;;
9542 ''|' ') dflt=none ;;
9545 rp='Pathname where the site-specific library html pages should be installed?'
9547 prefixvar=sitehtml3dir
9550 : determine where add-on manual pages go
9551 case "$siteman1dir" in
9552 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9553 *) dflt=$siteman1dir ;;
9556 ''|' ') dflt=none ;;
9559 rp='Pathname where the site-specific manual pages should be installed?'
9561 prefixvar=siteman1dir
9564 : determine where add-on library man pages go
9565 case "$siteman3dir" in
9566 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9567 *) dflt=$siteman3dir ;;
9570 ''|' ') dflt=none ;;
9573 rp='Pathname where the site-specific library manual pages should be installed?'
9575 prefixvar=siteman3dir
9578 : determine where add-on public executable scripts go
9579 case "$sitescript" in
9580 '') dflt=$siteprefix/script
9581 $test -d $dflt || dflt=$sitebin ;;
9582 *) dflt="$sitescript" ;;
9585 rp='Pathname where add-on public executable scripts should be installed?'
9587 prefixvar=sitescript
9590 : see if backtrace exists
9591 set backtrace d_backtrace
9594 : add flags if using c backtrace
9595 case "$usecbacktrace" in
9596 "") usecbacktrace=$undef ;;
9598 case "$d_backtrace" in
9600 case " $ccflags " in
9601 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9602 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9606 echo "This system does not support backtrace" >&4
9607 usecbacktrace=$undef
9613 : Check if faststdio is requested and available
9614 case "$usefaststdio" in
9615 $define|true|[yY]*|'')
9616 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9626 Perl can be built to use 'fast stdio', which means using the stdio
9627 library but also directly manipulating the stdio buffers to enable
9628 faster I/O. Using stdio is better for backward compatibility (especially
9629 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9630 interface has been preferred instead of stdio.
9632 If this doesn't make any sense to you, just accept the default '$dflt'.
9634 rp='Use the "fast stdio" if available?'
9637 y|Y) val="$define" ;;
9644 : define an is-a-typedef? function
9645 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9647 "") inclist="sys/types.h";;
9649 eval "varval=\$$var";
9653 for inc in $inclist; do
9654 echo "#include <$inc>" >>temp.c;
9656 echo "#ifdef $type" >> temp.c;
9657 echo "printf(\"We have $type\");" >> temp.c;
9658 echo "#endif" >> temp.c;
9659 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9660 if $contains $type temp.E >/dev/null 2>&1; then
9666 *) eval "$var=\$varval";;
9669 : define an is-a-typedef? function that prompts if the type is not available.
9670 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9672 "") inclist="sys/types.h";;
9674 eval "varval=\$$var";
9678 for inc in $inclist; do
9679 echo "#include <$inc>" >>temp.c;
9681 echo "#ifdef $type" >> temp.c;
9682 echo "printf(\"We have $type\");" >> temp.c;
9683 echo "#endif" >> temp.c;
9684 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9686 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9687 if $contains $type temp.E >/dev/null 2>&1; then
9688 echo "$type found." >&4;
9691 echo "$type NOT found." >&4;
9697 *) eval "$var=\$varval";;
9700 : see what type lseek is declared as in the kernel
9701 rp="What is the type used for lseek's offset on this system?"
9702 set off_t lseektype long stdio.h sys/types.h
9706 echo "Checking to see how big your file offsets are..." >&4
9708 #include <sys/types.h>
9712 printf("%d\n", (int)sizeof($lseektype));
9717 if eval $compile_ok; then
9718 lseeksize=`$run ./try`
9719 echo "Your file offsets are $lseeksize bytes long."
9723 echo "(I can't seem to compile the test program. Guessing...)"
9724 rp="What is the size of your file offsets (in bytes)?"
9730 : see what type file positions are declared as in the library
9731 rp="What is the type for file position used by fsetpos()?"
9732 set fpos_t fpostype long stdio.h sys/types.h
9735 : Check size for Fpos_t
9738 *_t) zzz="$fpostype" ;;
9741 echo "Checking the size of $zzz..." >&4
9743 #include <sys/types.h>
9750 printf("%d\n", (int)sizeof($fpostype));
9755 if eval $compile_ok; then
9759 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9762 echo "Your $zzz is $fpossize bytes long."
9768 echo "(I can't compile the test program. Guessing...)" >&4
9769 rp="What is the size of your file positions (in bytes)?"
9774 : Check for large file support
9775 # Backward compatibility (uselfs is deprecated).
9777 "$define"|true|[yY]*)
9780 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9782 uselargefiles="$define"
9786 case "$lseeksize:$fpossize" in
9789 You can have files larger than 2 gigabytes.
9792 *) case "$uselargefiles" in
9793 "$undef"|false|[nN]*) dflt='n' ;;
9798 Perl can be built to understand large files (files larger than 2 gigabytes)
9799 on some systems. To do so, Configure can be run with -Duselargefiles.
9801 If this doesn't make any sense to you, just accept the default '$dflt'.
9803 rp='Try to understand large files, if available?'
9806 y|Y) val="$define" ;;
9813 : Look for a hint-file generated 'call-back-unit'. If the
9814 : user has specified that a large files perl is to be built,
9815 : we may need to set or change some other defaults.
9816 if $test -f uselargefiles.cbu; then
9817 echo "Your platform has some specific hints regarding large file builds, using them..."
9818 . ./uselargefiles.cbu
9820 case "$uselargefiles" in
9822 if $test -f uselargefiles.cbu; then
9824 echo "Rechecking to see how big your file offsets are..." >&4
9826 #include <sys/types.h>
9830 printf("%d\n", (int)sizeof($lseektype));
9835 if eval $compile_ok; then
9836 lseeksize=`$run ./try`
9837 $echo "Your file offsets are now $lseeksize bytes long."
9841 echo "(I can't seem to compile the test program. Guessing...)"
9842 rp="What is the size of your file offsets (in bytes)?"
9847 *_t) zzz="$fpostype" ;;
9850 $echo $n "Rechecking the size of $zzz...$c" >&4
9852 #include <sys/types.h>
9859 printf("%d\n", (int)sizeof($fpostype));
9864 if eval $compile_ok; then
9869 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9872 echo " $fpossize bytes." >&4
9878 echo "(I can't compile the test program. Guessing...)" >&4
9879 rp="What is the size of your file positions (in bytes)?"
9888 : Check if we want perlio
9891 : Set the vendorbin variables
9892 case "$vendorprefix" in
9893 '') d_vendorbin="$undef"
9897 *) d_vendorbin="$define"
9898 : determine where vendor-supplied executables go.
9899 case "$vendorbin" in
9900 '') dflt=$vendorprefix/bin ;;
9901 *) dflt="$vendorbin" ;;
9904 rp='Pathname for the vendor-supplied executables directory?'
9907 vendorbinexp="$ansexp"
9913 : Set the vendorhtml1dir variables
9914 case "$vendorprefix" in
9915 '') vendorhtml1dir=''
9916 vendorhtml1direxp=''
9918 *) : determine where vendor-supplied html pages go.
9919 : There is no standard location, so try to copy the previously-selected
9920 : directory structure for the core html pages.
9921 : XXX Better default suggestions would be welcome.
9922 case "$vendorhtml1dir" in
9923 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9924 *) dflt=$vendorhtml1dir ;;
9927 ''|' ') dflt=none ;;
9930 rp='Pathname for the vendor-supplied html pages?'
9932 vendorhtml1dir="$ans"
9933 vendorhtml1direxp="$ansexp"
9936 : Use ' ' for none so value is preserved next time through Configure
9937 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9938 prefixvar=vendorhtml1dir
9941 : Set the vendorhtml3dir variables
9942 case "$vendorprefix" in
9943 '') vendorhtml3dir=''
9944 vendorhtml3direxp=''
9946 *) : determine where vendor-supplied module html pages go.
9947 : There is no standard location, so try to copy the previously-selected
9948 : directory structure for the core html pages.
9949 : XXX Better default suggestions would be welcome.
9950 case "$vendorhtml3dir" in
9951 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9952 *) dflt=$vendorhtml3dir ;;
9955 ''|' ') dflt=none ;;
9958 rp='Pathname for the vendor-supplied html pages?'
9960 vendorhtml3dir="$ans"
9961 vendorhtml3direxp="$ansexp"
9964 : Use ' ' for none so value is preserved next time through Configure
9965 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9966 prefixvar=vendorhtml3dir
9969 : Set the vendorman1dir variables
9970 case "$vendorprefix" in
9971 '') vendorman1dir=''
9974 *) : determine where vendor-supplied manual pages go.
9975 case "$vendorman1dir" in
9976 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9977 *) dflt=$vendorman1dir ;;
9980 ''|' ') dflt=none ;;
9983 rp='Pathname for the vendor-supplied manual section 1 pages?'
9985 vendorman1dir="$ans"
9986 vendorman1direxp="$ansexp"
9989 : Use ' ' for none so value is preserved next time through Configure
9990 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9991 prefixvar=vendorman1dir
9994 : Set the vendorman3dir variables
9995 case "$vendorprefix" in
9996 '') vendorman3dir=''
9999 *) : determine where vendor-supplied module manual pages go.
10000 case "$vendorman3dir" in
10001 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10002 *) dflt=$vendorman3dir ;;
10005 ''|' ') dflt=none ;;
10008 rp='Pathname for the vendor-supplied manual section 3 pages?'
10010 vendorman3dir="$ans"
10011 vendorman3direxp="$ansexp"
10014 : Use ' ' for none so value is preserved next time through Configure
10015 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10016 prefixvar=vendorman3dir
10019 : Set the vendorscript variables
10020 case "$vendorprefix" in
10021 '') d_vendorscript="$undef"
10025 *) d_vendorscript="$define"
10026 : determine where vendor-supplied scripts go.
10027 case "$vendorscript" in
10028 '') dflt=$vendorprefix/script
10029 $test -d $dflt || dflt=$vendorbin ;;
10030 *) dflt="$vendorscript" ;;
10034 The installation process will create a directory for
10035 vendor-supplied scripts.
10039 rp='Pathname for the vendor-supplied scripts directory?'
10041 vendorscript="$ans"
10042 vendorscriptexp="$ansexp"
10045 prefixvar=vendorscript
10048 : see if qgcvt exists
10052 : Check what kind of doubles your system has
10053 $echo "Checking the kind of doubles you have..." >&4
10055 #$i_stdlib I_STDLIB
10056 #define DOUBLESIZE $doublesize
10058 #include <stdlib.h>
10061 static const double d = -0.1;
10063 unsigned const char* b = (unsigned const char*)(&d);
10064 #if DOUBLESIZE == 4
10065 if (b[0] == 0xCD && b[3] == 0xBD) {
10066 /* IEEE 754 32-bit little-endian */
10070 if (b[0] == 0xBD && b[3] == 0xCD) {
10071 /* IEEE 754 32-bit big-endian */
10075 if (b[0] == 0xCC && b[3] == 0xCC) {
10076 /* VAX format F, 32-bit PDP-style mixed endian. */
10080 if (b[0] == 0xC0 && b[3] == 0x9A) {
10081 /* IBM single 32-bit */
10086 #if DOUBLESIZE == 8
10087 if (b[0] == 0x9A && b[7] == 0xBF) {
10088 /* IEEE 754 64-bit little-endian */
10092 if (b[0] == 0xBF && b[7] == 0x9A) {
10093 /* IEEE 754 64-bit big-endian */
10097 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10098 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10099 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10100 * 99 99 b9 bf 9a 99 99 99 */
10104 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10105 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10106 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10107 * 99 99 99 9a bf b9 99 99 */
10111 if (b[0] == 0xCC && b[7] == 0xCC) {
10112 /* VAX format D, 64-bit PDP-style mixed endian. */
10116 if (b[0] == 0xD9 && b[7] == 0x99) {
10117 /* VAX format G, 64-bit PDP-style mixed endian. */
10121 if (b[0] == 0xC0 && b[7] == 0x9A) {
10122 /* IBM double 64-bit */
10126 if (b[0] == 0xBF && b[7] == 0xCD) {
10127 /* CRAY single 64-bit */
10132 #if DOUBLESIZE == 16
10133 if (b[0] == 0x9A && b[15] == 0xBF) {
10134 /* IEEE 754 128-bit little-endian */
10138 if (b[0] == 0xBF && b[15] == 0x9A) {
10139 /* IEEE 754 128-bit big-endian */
10144 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10145 * Whether those environments can still build Perl is debatable. */
10146 printf("-1\n"); /* unknown */
10151 if eval $compile; then
10152 doublekind=`$run ./try`
10156 case "$doublekind" in
10157 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10158 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10159 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10160 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10161 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10162 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10163 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10164 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10165 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10166 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10167 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10168 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10169 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10170 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10171 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10173 d_double_style_ieee=$undef
10174 d_double_style_vax=$undef
10175 d_double_style_ibm=$undef
10176 d_double_style_cray=$undef
10177 case "$doublekind" in
10178 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10179 9|10|11) d_double_style_vax=$define ;;
10180 12|13) d_double_style_ibm=$define ;;
10181 14) d_double_style_cray=$define ;;
10183 case "$d_double_style_ieee" in
10185 d_double_has_inf=$define
10186 d_double_has_nan=$define
10187 d_double_has_negative_zero=$define
10188 d_double_has_subnormals=$define
10191 d_double_has_inf=$undef
10192 d_double_has_nan=$undef
10193 d_double_has_negative_zero=$undef
10194 d_double_has_subnormals=$undef
10199 : Check print/scan long double stuff
10202 if $test X"$d_longdbl" = X"$define"; then
10204 echo "Checking how to print long doubles..." >&4
10206 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10207 $cat >try.c <<'EOCP'
10208 #include <sys/types.h>
10211 double d = 123.456;
10212 printf("%.3f\n", d);
10216 if eval $compile; then
10220 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10221 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10222 echo "We will use %f."
10228 if $test X"$sPRIfldbl" = X; then
10229 $cat >try.c <<'EOCP'
10230 #include <sys/types.h>
10233 long double d = 123.456;
10234 printf("%.3Lf\n", d);
10238 if eval $compile; then
10242 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10243 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10244 echo "We will use %Lf."
10250 if $test X"$sPRIfldbl" = X; then
10251 $cat >try.c <<'EOCP'
10252 #include <sys/types.h>
10255 long double d = 123.456;
10256 printf("%.3llf\n", d);
10260 if eval $compile; then
10264 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10265 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10266 echo "We will use %llf."
10272 if $test X"$sPRIfldbl" = X; then
10273 $cat >try.c <<'EOCP'
10274 #include <sys/types.h>
10277 long double d = 123.456;
10278 printf("%.3lf\n", d);
10282 if eval $compile; then
10286 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10287 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10288 echo "We will use %lf."
10294 if $test X"$sPRIfldbl" = X; then
10295 echo "Cannot figure out how to print long doubles." >&4
10297 sSCNfldbl=$sPRIfldbl # expect consistency
10304 case "$sPRIfldbl" in
10305 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10306 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10307 d_SCNfldbl="$undef";
10309 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10310 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10311 d_SCNfldbl="$define";
10315 : Before committing on uselongdouble, see whether that looks sane.
10316 if $test "$uselongdouble" = "$define"; then
10319 echo "Checking if your long double math functions work right..." >&4
10324 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10327 case "$osname:$gccversion" in
10328 aix:) saveccflags="$ccflags"
10329 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10332 if eval $compile_ok; then
10336 3) echo "Your long double math functions are working correctly." >&4 ;;
10337 *) echo "Your long double math functions are broken, not using long doubles." >&4
10338 uselongdouble=$undef
10342 case "$osname:$gccversion" in
10343 aix:) ccflags="$saveccflags" ;; # restore
10347 : Check how to convert floats to strings.
10349 if test "X$d_Gconvert" = X; then
10352 echo "Checking for an efficient way to convert floats to strings."
10354 case "$uselongdouble" in
10355 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10357 case "$d_longdbl" in
10358 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10360 case "$d_PRIgldbl" in
10361 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10364 #ifdef TRY_gconvert
10365 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10366 char *myname = "gconvert";
10369 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10370 char *myname = "gcvt";
10373 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10374 char *myname = "qgcvt";
10375 #define DOUBLETYPE long double
10378 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10379 #ifdef HAS_PRIgldbl
10380 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10382 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10385 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10387 char *myname = "sprintf";
10391 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10392 #define DOUBLETYPE long double
10394 #define DOUBLETYPE double
10400 #$i_stdlib I_STDLIB
10402 #include <stdlib.h>
10404 #include <string.h>
10406 int checkit(char *expect, char *got)
10408 if (strcmp(expect, got)) {
10409 printf("%s oddity: Expected %s, got %s\n",
10410 myname, expect, got);
10420 /* This must be 1st test on (which?) platform */
10421 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10422 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10423 checkit("0.1", buf);
10425 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10426 checkit("0.01", buf);
10428 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10429 checkit("0.001", buf);
10431 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10432 checkit("0.0001", buf);
10434 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10435 if (strlen(buf) > 5)
10436 checkit("9e-005", buf); /* for Microsoft ?? */
10438 checkit("9e-05", buf);
10440 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10443 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10444 checkit("1.1", buf);
10446 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10447 checkit("1.01", buf);
10449 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10450 checkit("1.001", buf);
10452 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10453 checkit("1.0001", buf);
10455 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10456 checkit("1.00001", buf);
10458 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10459 checkit("1.000001", buf);
10461 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10464 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10465 checkit("-1", buf);
10467 /* Some Linux gcvt's give 1.e+5 here. */
10468 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10469 checkit("100000", buf);
10471 /* Some Linux gcvt's give -1.e+5 here. */
10472 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10473 checkit("-100000", buf);
10475 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10476 checkit("123.456", buf);
10478 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10479 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10480 /* 34 should be enough to scare even long double
10481 * places into using the e notation. */
10482 if (strlen(buf) > 5)
10483 checkit("1e+034", buf); /* for Microsoft */
10485 checkit("1e+34", buf);
10487 /* For Perl, if you add additional tests here, also add them to
10488 * t/base/num.t for benefit of platforms not using Configure or
10489 * overriding d_Gconvert */
10494 : first add preferred functions to our list
10496 for xxx_convert in $gconvert_preference; do
10497 case $xxx_convert in
10498 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10499 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10502 : then add any others
10503 for xxx_convert in gconvert gcvt sprintf; do
10504 case "$xxx_list" in
10506 *) xxx_list="$xxx_list $xxx_convert" ;;
10510 case "$d_longdbl$uselongdouble" in
10512 : again, add preferred functions to our list first
10514 for xxx_convert in $gconvert_ld_preference; do
10515 case $xxx_convert in
10516 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10517 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10520 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10521 for xxx_convert in qgcvt sprintf $xxx_list; do
10522 case "$xxx_ld_list" in
10523 $xxx_convert*|*" $xxx_convert"*) ;;
10524 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10527 : if sprintf cannot do long doubles, move it to the end
10528 if test "$d_PRIgldbl" != "$define"; then
10529 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10531 : if no qgcvt, remove it
10532 if test "$d_qgcvt" != "$define"; then
10533 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10536 xxx_list="$xxx_ld_list"
10540 for xxx_convert in $xxx_list; do
10541 echo "Trying $xxx_convert..."
10542 $rm -f try try$_o core
10543 set try -DTRY_$xxx_convert
10544 if eval $compile; then
10545 echo "$xxx_convert() found." >&4
10546 if $run ./try; then
10547 echo "I'll use $xxx_convert to convert floats into a string." >&4
10550 echo "...But $xxx_convert didn't work as I expected."
10554 echo "$xxx_convert NOT found." >&4
10558 if test X$xxx_convert = X; then
10559 echo "*** WHOA THERE!!! ***" >&4
10560 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10561 xxx_convert=sprintf
10564 case "$xxx_convert" in
10565 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10566 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10567 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10568 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10569 "$define$define$define")
10570 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10571 "$define$define$undef")
10572 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10573 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10581 : see if _fwalk exists
10585 : Initialize h_fcntl
10588 : Initialize h_sysfile
10591 : access call always available on UNIX
10592 set access d_access
10595 : locate the flags for 'access()'
10596 case "$d_access" in
10599 $cat >access.c <<EOCP
10600 #include <sys/types.h>
10605 #include <sys/file.h>
10608 #include <unistd.h>
10610 #$i_stdlib I_STDLIB
10612 #include <stdlib.h>
10618 : check sys/file.h first, no particular reason here
10619 if $test `./findhdr sys/file.h` && \
10620 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10622 echo "<sys/file.h> defines the *_OK access constants." >&4
10623 elif $test `./findhdr fcntl.h` && \
10624 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10626 echo "<fcntl.h> defines the *_OK access constants." >&4
10627 elif $test `./findhdr unistd.h` && \
10628 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10629 echo "<unistd.h> defines the *_OK access constants." >&4
10631 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10637 : see if accessx exists
10638 set accessx d_accessx
10641 : see if acosh exists
10645 : see if aintl exists
10649 : see if alarm exists
10653 : see if 64bit time functions exists
10655 set ctime64 d_ctime64
10658 set localtime64 d_localtime64
10661 set gmtime64 d_gmtime64
10664 set mktime64 d_mktime64
10667 set difftime64 d_difftime64
10670 set asctime64 d_asctime64
10673 : see if POSIX threads are available
10674 set pthread.h i_pthread
10677 : define a function to check prototypes
10678 $cat > protochk <<EOSH
10681 optimize="$optimize"
10685 usethreads=$usethreads
10686 i_pthread=$i_pthread
10687 pthread_h_first=$pthread_h_first
10690 $cat >> protochk <<'EOSH'
10695 while test $# -ge 2; do
10697 $define) echo "#include <$2>" >> try.c ;;
10698 literal) echo "$2" >> try.c ;;
10700 # Extra magic for the benefit of systems that need pthread.h
10701 # to be included early to correctly detect threadsafe functions.
10702 # Such functions must guarantee themselves, though, that the usethreads
10703 # and i_pthread have been defined, before calling protochk.
10704 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10705 echo "#include <pthread.h>" >> try.c
10710 cat >> try.c <<'EOCP'
10711 #define _(args) args
10713 echo "$foo" >> try.c
10714 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10715 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10721 $eunicefix protochk
10723 : Define hasproto macro for Configure internal use
10724 hasproto='varname=$1; func=$2; shift; shift;
10725 while $test $# -ge 2; do
10727 $define) echo "#include <$2>";;
10731 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10732 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10733 echo "$func() prototype found.";
10736 echo "$func() prototype NOT found.";
10743 : see if sys/types.h has to be included
10744 set sys/types.h i_systypes
10747 : see if sys/select.h has to be included
10748 set sys/select.h i_sysselct
10751 : Define hasfield macro for Configure internal use
10752 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10753 while $test $# -ge 2; do
10755 $define) echo "#include <$2>";;
10759 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10761 if eval $compile; then
10770 : see if we should include sys/time.h
10773 if test "X$timeincl" = X; then
10774 echo "Testing to see if we should include <sys/time.h>." >&4
10775 $echo $n "I'm now running the test program...$c"
10777 #include <sys/types.h>
10780 #ifdef SYSTIMEKERNEL
10783 #include <sys/time.h>
10786 #include <sys/select.h>
10788 #$i_stdlib I_STDLIB
10790 #include <stdlib.h>
10796 struct timeval bar;
10799 struct timezone tzp;
10801 if (foo.tm_sec == foo.tm_sec)
10804 if (bar.tv_sec == bar.tv_sec)
10811 for s_timezone in '-DS_TIMEZONE' ''; do
10813 for s_timeval in '-DS_TIMEVAL' ''; do
10814 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10815 for i_systime in '-DI_SYSTIME' ''; do
10818 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10819 if eval $compile; then
10820 set X $i_systime $i_systimek $sysselect $s_timeval
10824 $echo $n "Succeeded with $flags$c"
10835 *SYSTIMEKERNEL*) i_systimek="$define"
10836 timeincl=`./findhdr sys/time.h`
10837 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10838 *) i_systimek="$undef";;
10841 *I_SYSTIME*) i_systime="$define"
10842 timeincl=`./findhdr sys/time.h`" $timeincl"
10843 echo "We'll include <sys/time.h>." >&4;;
10844 *) i_systime="$undef";;
10848 : see if struct tm knows about tm_zone
10849 case "$i_systime$i_time" in
10852 echo "Checking to see if your struct tm has tm_zone field..." >&4
10853 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10861 case "$d_tm_tm_zone" in
10862 "$define") echo "Yes, it does." ;;
10863 *) echo "No, it doesn't." ;;
10865 : see if struct tm knows about tm_gmtoff
10866 case "$i_systime$i_time" in
10869 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10870 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10878 case "$d_tm_tm_gmtoff" in
10879 "$define") echo "Yes, it does." ;;
10880 *) echo "No, it doesn't." ;;
10883 : see if asctime_r exists
10884 set asctime_r d_asctime_r
10886 case "$d_asctime_r" in
10888 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10889 case "$d_asctime_r_proto:$usethreads" in
10890 ":define") d_asctime_r_proto=define
10891 set d_asctime_r_proto asctime_r $hdrs
10895 case "$d_asctime_r_proto" in
10897 case "$asctime_r_proto" in
10898 ''|0) try='char* asctime_r(const struct tm*, char*);'
10899 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10901 case "$asctime_r_proto" in
10902 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10903 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10905 case "$asctime_r_proto" in
10906 ''|0) try='int asctime_r(const struct tm*, char*);'
10907 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10909 case "$asctime_r_proto" in
10910 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10911 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10913 case "$asctime_r_proto" in
10914 ''|0) d_asctime_r=undef
10916 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10917 * ) case "$asctime_r_proto" in
10918 REENTRANT_PROTO*) ;;
10919 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10921 echo "Prototype: $try" ;;
10924 *) case "$usethreads" in
10925 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10932 *) asctime_r_proto=0
10936 : see if asinh exists
10940 : see if atanh exists
10944 : see if atolf exists
10948 : see if atoll exists
10952 : Look for GCC-style attribute format
10953 case "$d_attribute_format" in
10956 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10957 $cat >attrib.c <<'EOCP'
10959 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10961 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10962 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10963 echo "Your C compiler doesn't support __attribute__((format))."
10966 echo "Your C compiler supports __attribute__((format))."
10970 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10974 *) val="$d_attribute_format" ;;
10976 set d_attribute_format
10980 : Look for GCC-style attribute format with null format allowed
10981 case "$d_printf_format_null" in
10982 '') case "$d_attribute_format" in
10985 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10986 $cat >attrib.c <<EOCP
10988 #$i_stdlib I_STDLIB
10990 #include <stdlib.h>
10992 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10993 int null_printf (char* pat,...) { return (int)pat; }
10994 int main () { exit(null_printf(NULL)); }
10996 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10997 : run the executable in case it produces a run-time warning
10998 if $run ./attrib >>attrib.out 2>&1; then
10999 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11000 echo "Your C compiler doesn't allow __printf__ format to be null."
11003 echo "Your C compiler allows __printf__ format to be null."
11007 echo "Your C compiler executable failed with __printf__ format null."
11011 echo "Your C compiler fails with __printf__ format null."
11018 *) val="$d_printf_format_null" ;;
11020 set d_printf_format_null
11024 : Look for GCC-style attribute malloc
11025 case "$d_attribute_malloc" in
11028 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11029 $cat >attrib.c <<'EOCP'
11031 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11033 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11034 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11035 echo "Your C compiler doesn't support __attribute__((malloc))."
11038 echo "Your C compiler supports __attribute__((malloc))."
11042 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11046 *) val="$d_attribute_malloc" ;;
11048 set d_attribute_malloc
11052 : Look for GCC-style attribute nonnull
11053 case "$d_attribute_nonnull" in
11056 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11057 $cat >attrib.c <<'EOCP'
11059 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11061 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11062 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11063 echo "Your C compiler doesn't support __attribute__((nonnull))."
11066 echo "Your C compiler supports __attribute__((nonnull))."
11070 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11074 *) val="$d_attribute_nonnull" ;;
11076 set d_attribute_nonnull
11080 : Look for GCC-style attribute noreturn
11081 case "$d_attribute_noreturn" in
11084 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11085 $cat >attrib.c <<'EOCP'
11087 void fall_over_dead( void ) __attribute__((noreturn));
11089 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11090 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11091 echo "Your C compiler doesn't support __attribute__((noreturn))."
11094 echo "Your C compiler supports __attribute__((noreturn))."
11098 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11102 *) val="$d_attribute_noreturn" ;;
11104 set d_attribute_noreturn
11108 : Look for GCC-style attribute pure
11109 case "$d_attribute_pure" in
11112 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11113 $cat >attrib.c <<'EOCP'
11115 int square( int n ) __attribute__((pure));
11117 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11118 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11119 echo "Your C compiler doesn't support __attribute__((pure))."
11122 echo "Your C compiler supports __attribute__((pure))."
11126 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11130 *) val="$d_attribute_pure" ;;
11132 set d_attribute_pure
11136 : Look for GCC-style attribute unused
11137 case "$d_attribute_unused" in
11140 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11141 $cat >attrib.c <<'EOCP'
11143 int do_something( int dummy __attribute__((unused)), int n );
11145 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11146 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11147 echo "Your C compiler doesn't support __attribute__((unused))."
11150 echo "Your C compiler supports __attribute__((unused))."
11154 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11158 *) val="$d_attribute_unused" ;;
11160 set d_attribute_unused
11164 : Look for GCC-style attribute deprecated
11165 case "$d_attribute_deprecated" in
11168 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11169 $cat >attrib.c <<'EOCP'
11171 int I_am_deprecated(void) __attribute__((deprecated));
11173 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11174 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11175 echo "Your C compiler doesn't support __attribute__((deprecated))."
11178 echo "Your C compiler supports __attribute__((deprecated))."
11182 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11186 *) val="$d_attribute_deprecated" ;;
11188 set d_attribute_deprecated
11192 : Look for GCC-style attribute warn_unused_result
11193 case "$d_attribute_warn_unused_result" in
11196 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11197 $cat >attrib.c <<'EOCP'
11199 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11201 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11202 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11203 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11206 echo "Your C compiler supports __attribute__((warn_unused_result))."
11210 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11214 *) val="$d_attribute_warn_unused_result" ;;
11216 set d_attribute_warn_unused_result
11220 : see if getpgrp exists
11221 set getpgrp d_getpgrp
11224 case "$d_getpgrp" in
11227 echo "Checking to see which flavor of getpgrp is in use..."
11229 #$i_unistd I_UNISTD
11230 #include <sys/types.h>
11232 # include <unistd.h>
11234 #$i_stdlib I_STDLIB
11236 #include <stdlib.h>
11240 if (getuid() == 0) {
11241 printf("(I see you are running Configure as super-user...)\n");
11244 #ifdef TRY_BSD_PGRP
11245 if (getpgrp(1) == 0)
11254 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11255 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11257 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11258 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11261 echo "I can't seem to compile and run the test program."
11263 xxx="a USG one, i.e. you use getpgrp()."
11265 # SVR4 systems can appear rather BSD-ish.
11266 case "$i_unistd" in
11268 xxx="a BSD one, i.e. you use getpgrp(pid)."
11272 xxx="probably a USG one, i.e. you use getpgrp()."
11277 echo "Assuming your getpgrp is $xxx" >&4
11286 : see if setpgrp exists
11287 set setpgrp d_setpgrp
11290 case "$d_setpgrp" in
11293 echo "Checking to see which flavor of setpgrp is in use..."
11295 #$i_unistd I_UNISTD
11296 #include <sys/types.h>
11298 # include <unistd.h>
11300 #$i_stdlib I_STDLIB
11302 #include <stdlib.h>
11306 if (getuid() == 0) {
11307 printf("(I see you are running Configure as super-user...)\n");
11310 #ifdef TRY_BSD_PGRP
11311 if (-1 == setpgrp(1, 1))
11314 if (setpgrp() != -1)
11320 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11321 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11323 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11324 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11327 echo "(I can't seem to compile and run the test program.)"
11329 xxx="a USG one, i.e. you use setpgrp()."
11331 # SVR4 systems can appear rather BSD-ish.
11332 case "$i_unistd" in
11334 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11338 xxx="probably a USG one, i.e. you use setpgrp()."
11343 echo "Assuming your setpgrp is $xxx" >&4
11352 : Look for GCC-style __builtin_add_overflow
11353 case "$d_builtin_add_overflow" in
11356 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11357 $cat >try.c <<'EOCP'
11359 const unsigned int uint_max = ~0u;
11360 int target_int = 0;
11361 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11364 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11367 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11374 if eval $compile && $run ./try; then
11375 echo "Your C compiler supports __builtin_add_overflow."
11378 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11382 *) val="$d_builtin_add_overflow" ;;
11385 set d_builtin_add_overflow
11389 : Look for GCC-style __builtin_sub_overflow
11390 case "$d_builtin_sub_overflow" in
11393 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11394 $cat >try.c <<'EOCP'
11396 const unsigned int uint_max = ~0u;
11397 int target_int = 0;
11398 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11401 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11404 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11411 if eval $compile && $run ./try; then
11412 echo "Your C compiler supports __builtin_sub_overflow."
11415 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11419 *) val="$d_builtin_sub_overflow" ;;
11422 set d_builtin_sub_overflow
11426 : Look for GCC-style __builtin_mul_overflow
11427 case "$d_builtin_mul_overflow" in
11430 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11431 $cat >try.c <<'EOCP'
11433 const unsigned int uint_max = ~0u;
11434 int target_int = 0;
11435 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11438 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11441 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11448 if eval $compile && $run ./try; then
11449 echo "Your C compiler supports __builtin_mul_overflow."
11452 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11456 *) val="$d_builtin_mul_overflow" ;;
11459 set d_builtin_mul_overflow
11463 : Look for GCC-style __builtin_choose_expr
11464 case "$d_builtin_choose_expr" in
11467 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11468 $cat >try.c <<'EOCP'
11469 #include <assert.h>
11470 #include <stdlib.h>
11473 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11476 assert( SYRINX(1) == 2112 );
11477 assert( SYRINX(1) != 5150 );
11478 assert( SYRINX(0) == 5150 );
11479 assert( SYRINX(0) != 2112 );
11480 puts( "All good!" );
11486 if eval $compile && $run ./try; then
11487 echo "Your C compiler supports __builtin_choose_expr."
11490 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11494 *) val="$d_builtin_choose_expr" ;;
11497 set d_builtin_choose_expr
11501 : Look for GCC-style __builtin_expect
11502 case "$d_builtin_expect" in
11505 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11506 $cat >try.c <<'EOCP'
11509 if ( __builtin_expect(n, 0) ) n = 1;
11510 /* Remember shell exit code truth is 0, C truth is non-zero */
11515 if eval $compile && $run ./try; then
11516 echo "Your C compiler supports __builtin_expect."
11519 echo "Your C compiler doesn't seem to understand __builtin_expect."
11523 *) val="$d_builtin_expect" ;;
11526 set d_builtin_expect
11530 : see if the Compiler supports C99 variadic macros
11531 echo "Checking for C99 variadic macros." >&4
11534 #include <stdarg.h>
11536 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11540 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11546 if eval $compile && $run ./try 2>&1 >/dev/null; then
11547 case "`$run ./try`" in
11549 echo "You have C99 variadic macros." >&4
11550 d_c99_variadic_macros="$define"
11553 echo "You don't have functional C99 variadic macros." >&4
11554 d_c99_variadic_macros="$undef"
11558 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11559 d_c99_variadic_macros="$undef"
11563 : see if signal is declared as pointer to function returning int or void
11565 xxx=`./findhdr signal.h`
11566 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11567 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11568 echo "You have int (*signal())() instead of void." >&4
11570 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11571 echo "You have void (*signal())()." >&4
11573 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11574 echo "You have int (*signal())() instead of void." >&4
11576 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11577 echo "You have void (*signal())()." >&4
11580 case "$d_voidsig" in
11582 echo "I can't determine whether signal handler returns void or int..." >&4
11584 rp="What type does your signal handler return?"
11587 v*) val="$define";;
11591 echo "As you already told me, signal handler returns void." >&4
11594 *) echo "As you already told me, signal handler returns int." >&4
11601 case "$d_voidsig" in
11602 "$define") signal_t="void";;
11603 *) signal_t="int";;
11607 : check for ability to cast large floats to 32-bit ints.
11609 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11610 if $test "$intsize" -ge 4; then
11617 #$i_stdlib I_STDLIB
11619 #include <stdlib.h>
11621 #include <sys/types.h>
11622 #include <signal.h>
11623 $signal_t blech(int s) { exit(3); }
11630 signal(SIGFPE, blech);
11632 /* Don't let compiler optimize the test away. Store the number
11633 in a writable string for gcc to pass to sscanf under HP-UX.
11635 sprintf(str, "2147483647");
11636 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11640 /* x86 processors will probably give 0x8000 0000, which is a
11641 sign change. We don't want that. We want to mimic SPARC
11642 behavior here, which is to preserve the sign and give
11645 if (i32 != ($xxx) f)
11651 if eval $compile_ok; then
11652 $run ./try 2>/dev/null
11655 echo "(I can't seem to compile the test program--assuming it can't)"
11660 echo "Yup, it can."
11663 echo "Nope, it can't."
11670 : check for ability to cast negative floats to unsigned
11672 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11675 #$i_stdlib I_STDLIB
11677 #include <stdlib.h>
11679 #include <sys/types.h>
11680 #include <signal.h>
11681 $signal_t blech(int s) { exit(7); }
11682 $signal_t blech_in_list(int s) { exit(4); }
11683 unsigned long dummy_long(unsigned long p) { return p; }
11684 unsigned int dummy_int(unsigned int p) { return p; }
11685 unsigned short dummy_short(unsigned short p) { return p; }
11689 unsigned long along;
11691 unsigned short ashort;
11695 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11696 a direct f = -123. assignment. gcc-2.8.0 reportedly
11697 optimized the whole file away
11699 /* Store the number in a writable string for gcc to pass to
11700 sscanf under HP-UX.
11702 sprintf(str, "-123");
11703 sscanf(str, "%lf", &f); /* f = -123.; */
11705 signal(SIGFPE, blech);
11706 along = (unsigned long)f;
11707 aint = (unsigned int)f;
11708 ashort = (unsigned short)f;
11709 if (along != (unsigned long)-123)
11711 if (aint != (unsigned int)-123)
11713 if (ashort != (unsigned short)-123)
11715 sprintf(str, "1073741824.");
11716 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11719 along = (unsigned long)f;
11720 if (along != 0x80000000)
11724 along = (unsigned long)f;
11725 if (along != 0x7fffffff)
11729 along = (unsigned long)f;
11730 if (along != 0x80000001)
11734 signal(SIGFPE, blech_in_list);
11735 sprintf(str, "123.");
11736 sscanf(str, "%lf", &f); /* f = 123.; */
11737 along = dummy_long((unsigned long)f);
11738 aint = dummy_int((unsigned int)f);
11739 ashort = dummy_short((unsigned short)f);
11740 if (along != (unsigned long)123)
11742 if (aint != (unsigned int)123)
11744 if (ashort != (unsigned short)123)
11751 if eval $compile_ok; then
11752 $run ./try 2>/dev/null
11755 echo "(I can't seem to compile the test program--assuming it can't)"
11758 case "$castflags" in
11760 echo "Yup, it can."
11763 echo "Nope, it can't."
11770 : see if cbrt exists
11774 : see if chown exists
11778 : see if chroot exists
11779 set chroot d_chroot
11782 : see if chsize exists
11783 set chsize d_chsize
11786 : see if class exists
11790 : see if clearenv exists
11791 set clearenv d_clearenv
11794 : Define hasstruct macro for Configure internal use
11795 hasstruct='varname=$1; struct=$2; shift; shift;
11796 while $test $# -ge 2; do
11798 $define) echo "#include <$2>";;
11802 echo "int main () { struct $struct foo; }" >> try.c;
11804 if eval $compile; then
11813 : see whether socket exists
11817 $echo $n "Hmm... $c" >&4
11818 if set socket val -f d_socket; eval $csym; $val; then
11819 echo "Looks like you have Berkeley networking support." >&4
11821 if set setsockopt val -f; eval $csym; $val; then
11824 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11825 d_oldsock="$define"
11828 if $contains socklib libc.list >/dev/null 2>&1; then
11829 echo "Looks like you have Berkeley networking support." >&4
11831 : we will have to assume that it supports the 4.2 BSD interface
11834 echo "You don't have Berkeley networking in libc$_a..." >&4
11835 if test "X$d_socket" = "X$define"; then
11836 echo "...but you seem to believe that you have sockets." >&4
11838 for net in net socket
11840 if test -f $sysroot/usr/lib/lib$net$_a; then
11841 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11842 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11843 if $contains socket libc.list >/dev/null 2>&1; then
11848 echo "...but the Wollongong group seems to have hacked it in." >&4
11849 sockethdr="-I$sysroot/usr/netinclude"
11852 echo "Found Berkeley sockets interface in lib$net." >&4
11853 if $contains setsockopt libc.list >/dev/null 2>&1; then
11856 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11857 d_oldsock="$define"
11863 if test "X$d_socket" != "X$define"; then
11864 echo "or anywhere else I see." >&4
11872 : see if socketpair exists
11873 set socketpair d_sockpair
11878 echo "Checking the availability sa_len in the sock struct ..." >&4
11880 #include <sys/types.h>
11881 #include <sys/socket.h>
11883 struct sockaddr sa;
11884 return (sa.sa_len);
11888 set try; if eval $compile; then
11891 set d_sockaddr_sa_len; eval $setvar
11895 echo "Checking the availability struct sockaddr_in6 ..." >&4
11897 #include <sys/types.h>
11898 #include <sys/socket.h>
11899 #include <netinet/in.h>
11901 struct sockaddr_in6 sin6;
11902 return (sin6.sin6_family);
11906 set try; if eval $compile; then
11909 set d_sockaddr_in6; eval $setvar
11913 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11915 #include <sys/types.h>
11916 #include <sys/socket.h>
11917 #include <netinet/in.h>
11919 struct sockaddr_in6 sin6;
11920 return (sin6.sin6_scope_id);
11924 set try; if eval $compile; then
11927 set d_sin6_scope_id; eval $setvar
11931 echo "Checking the availability struct ip_mreq ..." >&4
11933 #include <sys/types.h>
11934 #include <sys/socket.h>
11935 #include <netinet/in.h>
11937 struct ip_mreq mreq;
11938 return (mreq.imr_multiaddr.s_addr);
11942 set try; if eval $compile; then
11945 set d_ip_mreq; eval $setvar
11949 echo "Checking the availability struct ip_mreq_source ..." >&4
11951 #include <sys/types.h>
11952 #include <sys/socket.h>
11953 #include <netinet/in.h>
11955 struct ip_mreq_source mreq;
11956 return (mreq.imr_multiaddr.s_addr);
11960 set try; if eval $compile; then
11963 set d_ip_mreq_source; eval $setvar
11967 echo "Checking the availability struct ipv6_mreq ..." >&4
11969 #include <sys/types.h>
11970 #include <sys/socket.h>
11971 #include <netinet/in.h>
11973 struct ipv6_mreq mreq;
11974 return (mreq.ipv6mr_interface);
11978 set try; if eval $compile; then
11981 set d_ipv6_mreq; eval $setvar
11985 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11987 #include <sys/types.h>
11988 #include <sys/socket.h>
11989 #include <netinet/in.h>
11991 struct ipv6_mreq_source mreq;
11992 return (mreq.imr_multiaddr.s_addr);
11996 set try; if eval $compile; then
11999 set d_ipv6_mreq_source; eval $setvar
12003 echo "Checking the availability of certain socket constants..." >&4
12004 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12005 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12007 #include <sys/types.h>
12008 #include <sys/socket.h>
12014 set try; if eval $compile; then
12017 set d_${enum}; eval $setvar
12021 : see if this is a sys/uio.h system
12022 set sys/uio.h i_sysuio
12025 : Check for cmsghdr support
12027 echo "Checking to see if your system supports struct cmsghdr..." >&4
12028 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12030 case "$d_cmsghdr_s" in
12031 "$define") echo "Yes, it does." ;;
12032 *) echo "No, it doesn't." ;;
12036 : check for const keyword
12038 echo 'Checking to see if your C compiler knows about "const"...' >&4
12039 $cat >const.c <<'EOCP'
12040 typedef struct spug { int drokk; } spug;
12044 const spug y = { 0 };
12047 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12049 echo "Yup, it does."
12052 echo "Nope, it doesn't."
12057 : see if copysign exists
12058 set copysign d_copysign
12061 : see if copysignl exists
12062 set copysignl d_copysignl
12065 : see if crypt exists
12070 $define) cryptlib='' ;;
12071 *) if set crypt val -f d_crypt; eval $csym; $val; then
12072 echo 'crypt() found.' >&4
12076 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12077 if $test -z "$cryptlib"; then
12078 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12082 if $test -z "$cryptlib"; then
12083 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12087 if $test -z "$cryptlib"; then
12088 cryptlib=`./loc libcrypt$_a "" $libpth`
12092 if $test -z "$cryptlib"; then
12093 echo 'crypt() NOT found.' >&4
12104 : see if this is a crypt.h system
12105 set crypt.h i_crypt
12108 : see if crypt_r exists
12109 set crypt_r d_crypt_r
12111 case "$d_crypt_r" in
12113 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12114 case "$d_crypt_r_proto:$usethreads" in
12115 ":define") d_crypt_r_proto=define
12116 set d_crypt_r_proto crypt_r $hdrs
12120 case "$d_crypt_r_proto" in
12122 case "$crypt_r_proto" in
12123 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12124 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12126 case "$crypt_r_proto" in
12127 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12128 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12130 case "$crypt_r_proto" in
12131 ''|0) d_crypt_r=undef
12133 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12134 * ) case "$crypt_r_proto" in
12135 REENTRANT_PROTO*) ;;
12136 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12138 echo "Prototype: $try" ;;
12141 *) case "$usethreads" in
12142 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12153 : get csh whereabouts
12155 'csh') val="$undef" ;;
12156 *) val="$define" ;;
12160 : Respect a hint or command line value for full_csh.
12161 case "$full_csh" in
12162 '') full_csh=$csh ;;
12165 : see if ctermid exists
12166 set ctermid d_ctermid
12169 : see if ctermid_r exists
12170 set ctermid_r d_ctermid_r
12172 case "$d_ctermid_r" in
12174 hdrs="$i_systypes sys/types.h define stdio.h "
12175 case "$d_ctermid_r_proto:$usethreads" in
12176 ":define") d_ctermid_r_proto=define
12177 set d_ctermid_r_proto ctermid_r $hdrs
12181 case "$d_ctermid_r_proto" in
12183 case "$ctermid_r_proto" in
12184 ''|0) try='char* ctermid_r(char*);'
12185 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12187 case "$ctermid_r_proto" in
12188 ''|0) d_ctermid_r=undef
12190 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12191 * ) case "$ctermid_r_proto" in
12192 REENTRANT_PROTO*) ;;
12193 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12195 echo "Prototype: $try" ;;
12198 *) case "$usethreads" in
12199 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12206 *) ctermid_r_proto=0
12210 : see if ctime_r exists
12211 set ctime_r d_ctime_r
12213 case "$d_ctime_r" in
12215 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12216 case "$d_ctime_r_proto:$usethreads" in
12217 ":define") d_ctime_r_proto=define
12218 set d_ctime_r_proto ctime_r $hdrs
12222 case "$d_ctime_r_proto" in
12224 case "$ctime_r_proto" in
12225 ''|0) try='char* ctime_r(const time_t*, char*);'
12226 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12228 case "$ctime_r_proto" in
12229 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12230 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12232 case "$ctime_r_proto" in
12233 ''|0) try='int ctime_r(const time_t*, char*);'
12234 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12236 case "$ctime_r_proto" in
12237 ''|0) try='int ctime_r(const time_t*, char*, int);'
12238 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12240 case "$ctime_r_proto" in
12241 ''|0) d_ctime_r=undef
12243 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12244 * ) case "$ctime_r_proto" in
12245 REENTRANT_PROTO*) ;;
12246 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12248 echo "Prototype: $try" ;;
12251 *) case "$usethreads" in
12252 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12263 : see if cuserid exists
12264 set cuserid d_cuserid
12267 : see if dbm.h is available
12268 : see if dbmclose exists
12269 set dbmclose d_dbmclose
12272 case "$d_dbmclose" in
12282 *) set rpcsvc/dbm.h i_rpcsvcdbm
12287 *) echo "We won't be including <dbm.h>"
12297 : see if prototype for dbminit is available
12299 set d_dbminitproto dbminit $i_dbm dbm.h
12302 : see if difftime exists
12303 set difftime d_difftime
12306 : see if this is a dirent system
12308 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12310 echo "<dirent.h> found." >&4
12313 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12314 echo "<sys/dir.h> found." >&4
12317 xinc=`./findhdr sys/ndir.h`
12319 echo "<dirent.h> NOT found." >&4
12324 : Look for type of directory structure.
12326 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12328 case "$direntrytype" in
12330 case "$i_dirent" in
12331 $define) guess1='struct dirent' ;;
12332 *) guess1='struct direct' ;;
12335 *) guess1="$direntrytype"
12340 'struct dirent') guess2='struct direct' ;;
12341 *) guess2='struct dirent' ;;
12344 if $contains "$guess1" try.c >/dev/null 2>&1; then
12345 direntrytype="$guess1"
12346 echo "Your directory entries are $direntrytype." >&4
12347 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12348 direntrytype="$guess2"
12349 echo "Your directory entries seem to be $direntrytype." >&4
12351 echo "I don't recognize your system's directory entries." >&4
12352 rp="What type is used for directory entries on this system?"
12355 direntrytype="$ans"
12359 : see if the directory entry stores field length
12361 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12362 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12363 echo "Good, your directory entry keeps length information in d_namlen." >&4
12366 echo "Your directory entry does not know about the d_namlen field." >&4
12373 : Look for DIR.dd_fd
12374 case "$i_dirent" in
12376 echo "Checking to see if DIR has a dd_fd member variable" >&4
12378 #$i_stdlib I_STDLIB
12380 #include <stdlib.h>
12382 #include <dirent.h>
12392 if eval $compile; then
12393 echo "Yes, it does."
12396 echo "No, it does not."
12401 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12409 : see if this is an sysdir system
12410 set sys/dir.h i_sysdir
12413 : see if this is an sysndir system
12414 set sys/ndir.h i_sysndir
12419 $cat >dirfd.c <<EOM
12421 #$i_stdlib I_STDLIB
12423 #include <stdlib.h>
12425 #$i_dirent I_DIRENT /**/
12426 #$i_sysdir I_SYS_DIR /**/
12427 #$i_sysndir I_SYS_NDIR /**/
12428 #$i_systypes I_SYS_TYPES /**/
12429 #if defined(I_SYS_TYPES)
12430 #include <sys/types.h>
12432 #if defined(I_DIRENT)
12433 #include <dirent.h>
12436 #include <sys/ndir.h>
12439 #include <sys/dir.h>
12444 DIR *dirp = opendir(".");
12445 if (dirfd(dirp) >= 0)
12453 if eval $compile; then
12457 $define) echo "dirfd() found." >&4 ;;
12458 *) echo "dirfd() NOT found." >&4 ;;
12464 : see if dladdr exists
12465 set dladdr d_dladdr
12468 : see if dlerror exists
12471 set dlerror d_dlerror
12475 : see if dlfcn is available
12476 set dlfcn.h i_dlfcn
12479 : Check what extension to use for shared libs
12484 On a few systems, the dynamically loaded modules that perl generates and uses
12485 will need a different extension than shared libs. The default will probably
12491 *) dflt="$dlext" ;;
12493 rp='What is the extension of dynamically loaded modules'
12502 : Check if dlsym need a leading underscore
12508 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12509 $cat >dyna.c <<'EOM'
12516 #$i_stdlib I_STDLIB
12518 #include <stdlib.h>
12522 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12524 #include <sys/types.h>
12529 extern int fred() ;
12538 int mode = RTLD_LAZY ;
12540 handle = dlopen("./dyna.$dlext", mode) ;
12541 if (handle == NULL) {
12546 symbol = dlsym(handle, "fred") ;
12547 if (symbol == NULL) {
12548 /* try putting a leading underscore */
12549 symbol = dlsym(handle, "_fred") ;
12550 if (symbol == NULL) {
12563 : Call the object file tmp-dyna.o in case dlext=o.
12564 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12565 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12566 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12567 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12570 1) echo "Test program failed using dlopen." >&4
12571 echo "Perhaps you should not use dynamic loading." >&4;;
12572 2) echo "Test program failed using dlsym." >&4
12573 echo "Perhaps you should not use dynamic loading." >&4;;
12574 3) echo "dlsym needs a leading underscore" >&4
12576 4) echo "dlsym doesn't need a leading underscore." >&4;;
12579 echo "I can't compile and run the test program." >&4
12580 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12585 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12590 : see if drand48_r exists
12591 set drand48_r d_drand48_r
12593 case "$d_drand48_r" in
12595 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12596 case "$d_drand48_r_proto:$usethreads" in
12597 ":define") d_drand48_r_proto=define
12598 set d_drand48_r_proto drand48_r $hdrs
12602 case "$d_drand48_r_proto" in
12604 case "$drand48_r_proto" in
12605 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12606 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12608 case "$drand48_r_proto" in
12609 ''|0) d_drand48_r=undef
12611 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12612 * ) case "$drand48_r_proto" in
12613 REENTRANT_PROTO*) ;;
12614 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12616 echo "Prototype: $try" ;;
12619 *) case "$usethreads" in
12620 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12627 *) drand48_r_proto=0
12631 : see if prototype for drand48 is available
12633 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12636 : see if dup2 exists
12640 : see if eaccess exists
12641 set eaccess d_eaccess
12644 : see if endgrent exists
12645 set endgrent d_endgrent
12648 : see if this is an grp system
12654 xxx=`./findhdr grp.h`
12655 $cppstdin $cppflags $cppminus < $xxx >$$.h
12657 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12669 set d_grpasswd; eval $setvar
12673 : see if endgrent_r exists
12674 set endgrent_r d_endgrent_r
12676 case "$d_endgrent_r" in
12678 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12679 case "$d_endgrent_r_proto:$usethreads" in
12680 ":define") d_endgrent_r_proto=define
12681 set d_endgrent_r_proto endgrent_r $hdrs
12685 case "$d_endgrent_r_proto" in
12687 case "$endgrent_r_proto" in
12688 ''|0) try='int endgrent_r(FILE**);'
12689 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12691 case "$endgrent_r_proto" in
12692 ''|0) try='void endgrent_r(FILE**);'
12693 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12695 case "$endgrent_r_proto" in
12696 ''|0) d_endgrent_r=undef
12698 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12699 * ) case "$endgrent_r_proto" in
12700 REENTRANT_PROTO*) ;;
12701 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12703 echo "Prototype: $try" ;;
12706 *) case "$usethreads" in
12707 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12714 *) endgrent_r_proto=0
12718 : see if endhostent exists
12719 set endhostent d_endhent
12722 : see if this is a netdb.h system
12723 set netdb.h i_netdb
12726 : see if endhostent_r exists
12727 set endhostent_r d_endhostent_r
12729 case "$d_endhostent_r" in
12731 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12732 case "$d_endhostent_r_proto:$usethreads" in
12733 ":define") d_endhostent_r_proto=define
12734 set d_endhostent_r_proto endhostent_r $hdrs
12738 case "$d_endhostent_r_proto" in
12740 case "$endhostent_r_proto" in
12741 ''|0) try='int endhostent_r(struct hostent_data*);'
12742 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12744 case "$endhostent_r_proto" in
12745 ''|0) try='void endhostent_r(struct hostent_data*);'
12746 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12748 case "$endhostent_r_proto" in
12749 ''|0) d_endhostent_r=undef
12750 endhostent_r_proto=0
12751 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12752 * ) case "$endhostent_r_proto" in
12753 REENTRANT_PROTO*) ;;
12754 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12756 echo "Prototype: $try" ;;
12759 *) case "$usethreads" in
12760 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12762 d_endhostent_r=undef
12763 endhostent_r_proto=0
12767 *) endhostent_r_proto=0
12771 : see if endnetent exists
12772 set endnetent d_endnent
12775 : see if endnetent_r exists
12776 set endnetent_r d_endnetent_r
12778 case "$d_endnetent_r" in
12780 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12781 case "$d_endnetent_r_proto:$usethreads" in
12782 ":define") d_endnetent_r_proto=define
12783 set d_endnetent_r_proto endnetent_r $hdrs
12787 case "$d_endnetent_r_proto" in
12789 case "$endnetent_r_proto" in
12790 ''|0) try='int endnetent_r(struct netent_data*);'
12791 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12793 case "$endnetent_r_proto" in
12794 ''|0) try='void endnetent_r(struct netent_data*);'
12795 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12797 case "$endnetent_r_proto" in
12798 ''|0) d_endnetent_r=undef
12799 endnetent_r_proto=0
12800 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12801 * ) case "$endnetent_r_proto" in
12802 REENTRANT_PROTO*) ;;
12803 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12805 echo "Prototype: $try" ;;
12808 *) case "$usethreads" in
12809 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12811 d_endnetent_r=undef
12812 endnetent_r_proto=0
12816 *) endnetent_r_proto=0
12820 : see if endprotoent exists
12821 set endprotoent d_endpent
12824 : see if endprotoent_r exists
12825 set endprotoent_r d_endprotoent_r
12827 case "$d_endprotoent_r" in
12829 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12830 case "$d_endprotoent_r_proto:$usethreads" in
12831 ":define") d_endprotoent_r_proto=define
12832 set d_endprotoent_r_proto endprotoent_r $hdrs
12836 case "$d_endprotoent_r_proto" in
12838 case "$endprotoent_r_proto" in
12839 ''|0) try='int endprotoent_r(struct protoent_data*);'
12840 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12842 case "$endprotoent_r_proto" in
12843 ''|0) try='void endprotoent_r(struct protoent_data*);'
12844 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12846 case "$endprotoent_r_proto" in
12847 ''|0) d_endprotoent_r=undef
12848 endprotoent_r_proto=0
12849 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12850 * ) case "$endprotoent_r_proto" in
12851 REENTRANT_PROTO*) ;;
12852 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12854 echo "Prototype: $try" ;;
12857 *) case "$usethreads" in
12858 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12860 d_endprotoent_r=undef
12861 endprotoent_r_proto=0
12865 *) endprotoent_r_proto=0
12869 : see if endpwent exists
12870 set endpwent d_endpwent
12873 : see if this is a pwd.h system
12879 xxx=`./findhdr pwd.h`
12880 $cppstdin $cppflags $cppminus < $xxx >$$.h
12882 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12890 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12898 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12906 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12914 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12922 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12930 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12938 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12950 set d_pwquota; eval $setvar
12951 set d_pwage; eval $setvar
12952 set d_pwchange; eval $setvar
12953 set d_pwclass; eval $setvar
12954 set d_pwexpire; eval $setvar
12955 set d_pwcomment; eval $setvar
12956 set d_pwgecos; eval $setvar
12957 set d_pwpasswd; eval $setvar
12961 : see if endpwent_r exists
12962 set endpwent_r d_endpwent_r
12964 case "$d_endpwent_r" in
12966 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12967 case "$d_endpwent_r_proto:$usethreads" in
12968 ":define") d_endpwent_r_proto=define
12969 set d_endpwent_r_proto endpwent_r $hdrs
12973 case "$d_endpwent_r_proto" in
12975 case "$endpwent_r_proto" in
12976 ''|0) try='int endpwent_r(FILE**);'
12977 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12979 case "$endpwent_r_proto" in
12980 ''|0) try='void endpwent_r(FILE**);'
12981 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12983 case "$endpwent_r_proto" in
12984 ''|0) d_endpwent_r=undef
12986 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12987 * ) case "$endpwent_r_proto" in
12988 REENTRANT_PROTO*) ;;
12989 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12991 echo "Prototype: $try" ;;
12994 *) case "$usethreads" in
12995 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13002 *) endpwent_r_proto=0
13006 : see if endservent exists
13007 set endservent d_endsent
13010 : see if endservent_r exists
13011 set endservent_r d_endservent_r
13013 case "$d_endservent_r" in
13015 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13016 case "$d_endservent_r_proto:$usethreads" in
13017 ":define") d_endservent_r_proto=define
13018 set d_endservent_r_proto endservent_r $hdrs
13022 case "$d_endservent_r_proto" in
13024 case "$endservent_r_proto" in
13025 ''|0) try='int endservent_r(struct servent_data*);'
13026 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13028 case "$endservent_r_proto" in
13029 ''|0) try='void endservent_r(struct servent_data*);'
13030 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13032 case "$endservent_r_proto" in
13033 ''|0) d_endservent_r=undef
13034 endservent_r_proto=0
13035 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13036 * ) case "$endservent_r_proto" in
13037 REENTRANT_PROTO*) ;;
13038 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13040 echo "Prototype: $try" ;;
13043 *) case "$usethreads" in
13044 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13046 d_endservent_r=undef
13047 endservent_r_proto=0
13051 *) endservent_r_proto=0
13055 : Locate the flags for 'open()'
13058 #include <sys/types.h>
13063 #include <sys/file.h>
13065 #$i_stdlib I_STDLIB
13067 #include <stdlib.h>
13078 : check sys/file.h first to get FREAD on Sun
13079 if $test `./findhdr sys/file.h` && \
13080 set try -DI_SYS_FILE && eval $compile; then
13082 echo "<sys/file.h> defines the O_* constants..." >&4
13083 if $run ./try; then
13084 echo "and you have the 3 argument form of open()." >&4
13087 echo "but not the 3 argument form of open(). Oh, well." >&4
13090 elif $test `./findhdr fcntl.h` && \
13091 set try -DI_FCNTL && eval $compile; then
13093 echo "<fcntl.h> defines the O_* constants..." >&4
13094 if $run ./try; then
13095 echo "and you have the 3 argument form of open()." >&4
13098 echo "but not the 3 argument form of open(). Oh, well." >&4
13103 echo "I can't find the O_* constant definitions! You got problems." >&4
13109 : see if this is a sys/file.h system
13114 : do we need to include sys/file.h ?
13118 if $h_sysfile; then
13120 echo "We'll be including <sys/file.h>." >&4
13123 echo "We won't be including <sys/file.h>." >&4
13133 : see if fcntl.h is there
13138 : see if we can include fcntl.h
13144 echo "We'll be including <fcntl.h>." >&4
13147 if $h_sysfile; then
13148 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13150 echo "We won't be including <fcntl.h>." >&4
13162 : see if fork exists
13166 : see if pipe exists
13170 : check for non-blocking I/O stuff
13171 case "$h_sysfile" in
13172 true) echo "#include <sys/file.h>" > head.c;;
13175 true) echo "#include <fcntl.h>" > head.c;;
13176 *) echo "#include <sys/fcntl.h>" > head.c;;
13181 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13182 case "$o_nonblock" in
13184 $cat head.c > try.c
13185 $cat >>try.c <<EOCP
13187 #$i_stdlib I_STDLIB
13189 #include <stdlib.h>
13197 printf("O_NONBLOCK\n");
13201 printf("O_NDELAY\n");
13205 printf("FNDELAY\n");
13212 if eval $compile_ok; then
13213 o_nonblock=`$run ./try`
13214 case "$o_nonblock" in
13215 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13216 *) echo "Seems like we can use $o_nonblock.";;
13219 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13222 *) echo "Using $hint value $o_nonblock.";;
13227 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13230 case "$d_fork:$d_pipe:$d_alarm" in
13231 define:define:define)
13232 $cat head.c > try.c
13233 $cat >>try.c <<EOCP
13235 #include <sys/types.h>
13236 #include <signal.h>
13238 #$i_stdlib I_STDLIB
13240 #include <stdlib.h>
13246 #define MY_O_NONBLOCK $o_nonblock
13247 #ifndef errno /* XXX need better Configure test */
13250 #$i_unistd I_UNISTD
13252 #include <unistd.h>
13254 #include <string.h>
13255 $signal_t blech(int x) { exit(3); }
13257 $cat >> try.c <<'EOCP'
13266 ret = pipe(pd); /* Down: child -> parent */
13269 ret = pipe(pu); /* Up: parent -> child */
13273 close(pd[1]); /* Parent reads from pd[0] */
13274 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13276 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13281 signal(SIGALRM, blech);
13283 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13285 sprintf(string, "%d\n", ret);
13286 ret = write(2, string, strlen(string));
13287 if (ret != strlen(string))
13291 if (errno == EAGAIN) {
13292 printf("EAGAIN\n");
13297 if (errno == EWOULDBLOCK)
13298 printf("EWOULDBLOCK\n");
13301 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13304 sleep(2); /* Give it time to close our pipe */
13306 ret = read(pd[0], buf, 1); /* Should read EOF */
13308 sprintf(string, "%d\n", ret);
13309 ret = write(4, string, strlen(string));
13310 if (ret != strlen(string))
13315 close(pd[0]); /* We write to pd[1] */
13316 close(pu[1]); /* We read from pu[0] */
13317 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13320 close(pd[1]); /* Pipe pd is now fully closed! */
13321 exit(0); /* Bye bye, thank you for playing! */
13325 if eval $compile_ok; then
13326 echo "$startsh" >mtry
13327 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13329 $run ./mtry >/dev/null 2>&1
13331 0) eagain=`$cat try.out`;;
13332 1) echo "Could not perform non-blocking setting!";;
13333 2) echo "I did a successful read() for something that was not there!";;
13334 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13335 4) echo "Could not find F_SETFL!";;
13336 *) echo "Something terribly wrong happened during testing.";;
13338 rd_nodata=`$cat try.ret`
13339 echo "A read() system call with no data present returns $rd_nodata."
13340 case "$rd_nodata" in
13343 echo "(That's peculiar, fixing that to be -1.)"
13349 echo "Forcing errno EAGAIN on read() with no data available."
13353 echo "Your read() sets errno to $eagain when no data is available."
13356 status=`$cat try.err`
13358 0) echo "And it correctly returns 0 to signal EOF.";;
13359 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13360 *) echo "However, your read() returns '$status' on EOF??";;
13363 if test "$status" = "$rd_nodata"; then
13364 echo "WARNING: you can't distinguish between EOF and no data!"
13368 echo "I can't compile the test program--assuming errno EAGAIN will do."
13372 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13381 echo "Using $hint value $eagain."
13382 echo "Your read() returns $rd_nodata when no data is present."
13383 case "$d_eofnblk" in
13384 "$define") echo "And you can see EOF because read() returns 0.";;
13385 "$undef") echo "But you can't see EOF status from read() returned value.";;
13387 echo "(Assuming you can't see EOF status from read anyway.)"
13393 $rm_try head.c mtry
13395 : see if erf exists
13399 : see if erfc exists
13403 : see if exp2 exists
13407 : see if expm1 exists
13411 : see if _ptr and _cnt from stdio act std
13414 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13415 echo "(Looks like you have stdio.h from BSD.)"
13416 case "$stdio_ptr" in
13417 '') stdio_ptr='((fp)->_p)'
13420 *) ptr_lval=$d_stdio_ptr_lval;;
13422 case "$stdio_cnt" in
13423 '') stdio_cnt='((fp)->_r)'
13426 *) cnt_lval=$d_stdio_cnt_lval;;
13428 case "$stdio_base" in
13429 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13431 case "$stdio_bufsiz" in
13432 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13434 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13435 echo "(Looks like you have stdio.h from Linux.)"
13436 case "$stdio_ptr" in
13437 '') stdio_ptr='((fp)->_IO_read_ptr)'
13440 *) ptr_lval=$d_stdio_ptr_lval;;
13442 case "$stdio_cnt" in
13443 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13446 *) cnt_lval=$d_stdio_cnt_lval;;
13448 case "$stdio_base" in
13449 '') stdio_base='((fp)->_IO_read_base)';;
13451 case "$stdio_bufsiz" in
13452 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13455 case "$stdio_ptr" in
13456 '') stdio_ptr='((fp)->_ptr)'
13459 *) ptr_lval=$d_stdio_ptr_lval;;
13461 case "$stdio_cnt" in
13462 '') stdio_cnt='((fp)->_cnt)'
13465 *) cnt_lval=$d_stdio_cnt_lval;;
13467 case "$stdio_base" in
13468 '') stdio_base='((fp)->_base)';;
13470 case "$stdio_bufsiz" in
13471 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13475 : test whether _ptr and _cnt really work
13476 echo "Checking how std your stdio is..." >&4
13479 #$i_stdlib I_STDLIB
13481 #include <stdlib.h>
13483 #define FILE_ptr(fp) $stdio_ptr
13484 #define FILE_cnt(fp) $stdio_cnt
13486 FILE *fp = fopen("try.c", "r");
13489 18 <= FILE_cnt(fp) &&
13490 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13498 if eval $compile && $to try.c; then
13499 if $run ./try; then
13500 echo "Your stdio acts pretty std."
13503 echo "Your stdio isn't very std."
13506 echo "Your stdio doesn't appear very std."
13510 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13511 # direct buffer manipulation no longer works. The Configure tests
13512 # should be changed to correctly detect this, but until then,
13513 # the following check should at least let perl compile and run.
13514 # (This quick fix should be updated before 5.8.1.)
13515 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13516 # A. Dougherty, June 3, 2002.
13517 case "$d_gnulibc" in
13519 case "$gnulibc_version" in
13523 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13532 : Can _ptr be used as an lvalue?
13533 case "$d_stdstdio$ptr_lval" in
13534 $define$define) val=$define ;;
13537 set d_stdio_ptr_lval
13540 : Can _cnt be used as an lvalue?
13541 case "$d_stdstdio$cnt_lval" in
13542 $define$define) val=$define ;;
13545 set d_stdio_cnt_lval
13549 : test whether setting _ptr sets _cnt as a side effect
13550 d_stdio_ptr_lval_sets_cnt="$undef"
13551 d_stdio_ptr_lval_nochange_cnt="$undef"
13552 case "$d_stdio_ptr_lval$d_stdstdio" in
13554 echo "Checking to see what happens if we set the stdio ptr..." >&4
13557 /* Can we scream? */
13558 /* Eat dust sed :-) */
13559 /* In the buffer space, no one can hear you scream. */
13560 #$i_stdlib I_STDLIB
13562 #include <stdlib.h>
13564 #define FILE_ptr(fp) $stdio_ptr
13565 #define FILE_cnt(fp) $stdio_cnt
13566 #include <sys/types.h>
13568 FILE *fp = fopen("try.c", "r");
13573 puts("Fail even to read");
13576 c = getc(fp); /* Read away the first # */
13578 puts("Fail even to read");
13582 18 <= FILE_cnt(fp) &&
13583 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13585 puts("Fail even to read");
13588 ptr = (char*) FILE_ptr(fp);
13589 cnt = (size_t)FILE_cnt(fp);
13591 FILE_ptr(fp) += 42;
13593 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13594 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13597 if (FILE_cnt(fp) <= 20) {
13598 printf ("Fail (<20 chars to test)");
13601 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13602 puts("Fail compare");
13605 if (cnt == FILE_cnt(fp)) {
13606 puts("Pass_unchanged");
13609 if (FILE_cnt(fp) == (cnt - 42)) {
13610 puts("Pass_changed");
13613 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13619 if eval $compile && $to try.c; then
13620 case `$run ./try` in
13622 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13623 d_stdio_ptr_lval_sets_cnt="$define" ;;
13625 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13626 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13628 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13630 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13633 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13639 : see if _base is also standard
13641 case "$d_stdstdio" in
13645 #$i_stdlib I_STDLIB
13647 #include <stdlib.h>
13649 #define FILE_base(fp) $stdio_base
13650 #define FILE_bufsiz(fp) $stdio_bufsiz
13652 FILE *fp = fopen("try.c", "r");
13655 19 <= FILE_bufsiz(fp) &&
13656 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13663 if eval $compile && $to try.c; then
13664 if $run ./try; then
13665 echo "And its _base field acts std."
13668 echo "But its _base field isn't std."
13671 echo "However, it seems to be lacking the _base field."
13679 : see if fast_stdio exists
13681 case "$d_stdstdio:$d_stdio_ptr_lval" in
13683 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13685 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13696 : see if fchdir exists
13697 set fchdir d_fchdir
13700 : see if fchmod exists
13701 set fchmod d_fchmod
13704 : check for openat, unlinkat, renameat, linkat, fchmodat
13705 set openat d_openat
13708 set unlinkat d_unlinkat
13711 set renameat d_renameat
13714 set linkat d_linkat
13717 set fchmodat d_fchmodat
13720 : see if fchown exists
13721 set fchown d_fchown
13724 : see if this is an fcntl system
13728 : See if fcntl-based locking works.
13731 #$i_stdlib I_STDLIB
13733 #include <stdlib.h>
13735 #include <unistd.h>
13737 #include <signal.h>
13738 $signal_t blech(int x) { exit(3); }
13740 #if defined(F_SETLK) && defined(F_SETLKW)
13741 struct flock flock;
13743 fd = open("try.c", O_RDONLY);
13744 flock.l_type = F_RDLCK;
13745 flock.l_whence = SEEK_SET;
13746 flock.l_start = flock.l_len = 0;
13747 signal(SIGALRM, blech);
13749 retval = fcntl(fd, F_SETLK, &flock);
13751 (retval < 0 ? exit(2) : exit(0));
13757 echo "Checking if fcntl-based file locking works... "
13761 if eval $compile_ok; then
13762 if $run ./try; then
13763 echo "Yes, it seems to work."
13766 echo "Nope, it didn't work."
13771 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13772 *** This is (almost) impossible.
13773 *** If your NFS lock daemons are not feeling well, something like
13774 *** this may happen, please investigate. Cannot continue, aborting.
13782 echo "I'm unable to compile the test program, so I'll assume not."
13787 echo "Nope, since you don't even have fcntl()."
13790 set d_fcntl_can_lock
13794 : check for fd_set items
13797 Checking to see how well your C compiler handles fd_set and friends ...
13800 #$i_stdlib I_STDLIB
13802 #include <stdlib.h>
13804 #$i_systime I_SYS_TIME
13805 #$i_sysselct I_SYS_SELECT
13806 #$d_socket HAS_SOCKET
13807 #include <sys/types.h>
13809 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13812 #include <sys/time.h>
13814 #ifdef I_SYS_SELECT
13815 #include <sys/select.h>
13824 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13832 if eval $compile; then
13833 d_fds_bits="$define"
13835 echo "Well, your system knows about the normal fd_set typedef..." >&4
13836 if $run ./try; then
13837 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13838 d_fd_macros="$define"
13841 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13843 d_fd_macros="$undef"
13847 Hmm, your compiler has some difficulty with fd_set. Checking further...
13850 if eval $compile; then
13851 d_fds_bits="$undef"
13853 echo "Well, your system has some sort of fd_set available..." >&4
13854 if $run ./try; then
13855 echo "and you have the normal fd_set macros." >&4
13856 d_fd_macros="$define"
13859 but not the normal fd_set macros! Gross! More work for me...
13861 d_fd_macros="$undef"
13864 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13866 d_fds_bits="$undef"
13867 d_fd_macros="$undef"
13872 : see if fdclose exists
13873 set fdclose d_fdclose
13876 : see if fdim exists
13880 : see if fegetround exists
13881 set fegetround d_fegetround
13884 : see if fgetpos exists
13885 set fgetpos d_fgetpos
13888 : see if finite exists
13889 set finite d_finite
13892 : see if finitel exists
13893 set finitel d_finitel
13896 : see if flock exists
13900 : see if prototype for flock is available
13902 set d_flockproto flock $i_sysfile sys/file.h
13905 : see if fma exists
13909 : see if fmax exists
13913 : see if fmin exists
13917 : see if fp_class exists
13918 set fp_class d_fp_class
13921 : check for fpclassify
13922 echo "Checking to see if you have fpclassify..." >&4
13925 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13928 if eval $compile; then
13930 echo "You have fpclassify."
13933 echo "You do not have fpclassify."
13939 : see if fp_classify exists
13940 set fp_classify d_fp_classify
13943 : see if fp_classl exists
13944 set fp_classl d_fp_classl
13947 : see if pathconf exists
13948 set pathconf d_pathconf
13951 : see if fpathconf exists
13952 set fpathconf d_fpathconf
13955 : see if fpclass exists
13956 set fpclass d_fpclass
13959 : see if fpclassl exists
13960 set fpclassl d_fpclassl
13963 : see if fpgetround exists
13964 set fpgetround d_fpgetround
13967 : check for fpos64_t
13969 echo "Checking to see if you have fpos64_t..." >&4
13972 int main() { fpos64_t x = 7; }
13975 if eval $compile; then
13977 echo "You have fpos64_t."
13980 echo "You do not have fpos64_t."
13981 case "$fpossize" in
13982 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13989 : see if this is an xlocale.h system
13990 set xlocale.h i_xlocale
13993 : see if newlocale exists
13994 set newlocale d_newlocale
13997 : see if freelocale exists
13998 set freelocale d_freelocale
14001 : see if uselocale exists
14002 set uselocale d_uselocale
14005 : see if duplocale exists
14006 set duplocale d_duplocale
14009 : see if querylocale exists
14010 set querylocale d_querylocale
14013 : see if frexpl exists
14014 set frexpl d_frexpl
14017 : see if this is a sys/param system
14018 set sys/param.h i_sysparam
14021 : see if this is a sys/mount.h system
14022 set sys/mount.h i_sysmount
14025 : Check for fs_data_s
14027 echo "Checking to see if your system supports struct fs_data..." >&4
14028 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14030 case "$d_fs_data_s" in
14031 "$define") echo "Yes, it does." ;;
14032 *) echo "No, it doesn't." ;;
14035 : see if fseeko exists
14036 set fseeko d_fseeko
14038 case "$longsize" in
14039 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14042 : see if fsetpos exists
14043 set fsetpos d_fsetpos
14046 : see if fstatfs exists
14047 set fstatfs d_fstatfs
14050 : see if statvfs exists
14051 set statvfs d_statvfs
14054 : see if fstatvfs exists
14055 set fstatvfs d_fstatvfs
14059 : see if fsync exists
14063 : see if ftello exists
14064 set ftello d_ftello
14066 case "$longsize" in
14067 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14070 : check for a working futimes
14073 echo "Checking if you have a working futimes()" >&4
14076 #include <sys/time.h>
14083 fd = open ("try.c", O_RDWR);
14084 if (-1 == fd) exit (1);
14085 rv = futimes (fd, NULL);
14086 exit (rv == -1 ? errno : 0);
14090 if eval $compile; then
14094 0) echo "Yes, you have" >&4
14095 d_futimes="$define"
14097 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14101 echo "No, it does not (probably harmless)" >&4
14105 : look for gai_strerror
14107 $cat >try.c <<'EOCP'
14108 #include <sys/types.h>
14109 #include <sys/socket.h>
14113 return (gai_strerror (0) ? 0 : 1);
14118 if eval $compile; then
14121 0) echo "A working gai_strerror() found." >&4
14123 *) echo "gai_strerror() found, but it doesn't work" >&4
14127 echo "gai_strerror() NOT found." >&4
14133 : see if ndbm.h is available
14136 : Compatibility location for RedHat 7.1
14137 set gdbm/ndbm.h i_gdbmndbm
14139 : Compatibility location for Debian 4.0
14140 set gdbm-ndbm.h i_gdbm_ndbm
14144 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14145 : see if dbm_open exists
14146 set dbm_open d_dbm_open
14148 case "$d_dbm_open" in
14151 i_gdbmndbm="$undef"
14152 i_gdbm_ndbm="$undef"
14153 echo "We won't be including <ndbm.h>"
14163 ndbm_hdr_protochk='name=$1; hdr=$2;
14164 eval "ihdr=\$""i_$name";
14166 if $test "$ihdr" = "$define"; then
14167 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14168 case "$d_cplusplus" in
14169 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14170 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14173 $define) $echo "Your <$hdr> seems to have prototypes";;
14174 *) $echo "Your <$hdr> does not seem to have prototypes";;
14177 set "d_${name}_h_uses_prototypes";
14181 eval $ndbm_hdr_protochk
14182 set gdbmndbm gdbm/ndbm.h
14183 eval $ndbm_hdr_protochk
14184 set gdbm_ndbm gdbm-ndbm.h
14185 eval $ndbm_hdr_protochk
14187 : see if getaddrinfo exists
14188 set getaddrinfo d_getaddrinfo
14191 : see if getcwd exists
14192 set getcwd d_getcwd
14195 : see if getespwnam exists
14196 set getespwnam d_getespwnam
14199 : see if getfsstat exists
14200 set getfsstat d_getfsstat
14203 : see if getgrent exists
14204 set getgrent d_getgrent
14207 : see if getgrent_r exists
14208 set getgrent_r d_getgrent_r
14210 case "$d_getgrent_r" in
14212 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14213 case "$d_getgrent_r_proto:$usethreads" in
14214 ":define") d_getgrent_r_proto=define
14215 set d_getgrent_r_proto getgrent_r $hdrs
14219 case "$d_getgrent_r_proto" in
14221 case "$getgrent_r_proto" in
14222 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14223 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14225 case "$getgrent_r_proto" in
14226 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14227 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14229 case "$getgrent_r_proto" in
14230 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14231 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14233 case "$getgrent_r_proto" in
14234 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14235 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14237 case "$getgrent_r_proto" in
14238 ''|0) try='int getgrent_r(struct group*, char*, int);'
14239 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14241 case "$getgrent_r_proto" in
14242 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14243 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14245 case "$getgrent_r_proto" in
14246 ''|0) d_getgrent_r=undef
14248 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14249 * ) case "$getgrent_r_proto" in
14250 REENTRANT_PROTO*) ;;
14251 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14253 echo "Prototype: $try" ;;
14256 *) case "$usethreads" in
14257 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14264 *) getgrent_r_proto=0
14268 : see if getgrgid_r exists
14269 set getgrgid_r d_getgrgid_r
14271 case "$d_getgrgid_r" in
14273 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14274 case "$d_getgrgid_r_proto:$usethreads" in
14275 ":define") d_getgrgid_r_proto=define
14276 set d_getgrgid_r_proto getgrgid_r $hdrs
14280 case "$d_getgrgid_r_proto" in
14282 case "$getgrgid_r_proto" in
14283 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14284 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14286 case "$getgrgid_r_proto" in
14287 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14288 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14290 case "$getgrgid_r_proto" in
14291 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14292 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14294 case "$getgrgid_r_proto" in
14295 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14296 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14298 case "$getgrgid_r_proto" in
14299 ''|0) d_getgrgid_r=undef
14301 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14302 * ) case "$getgrgid_r_proto" in
14303 REENTRANT_PROTO*) ;;
14304 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14306 echo "Prototype: $try" ;;
14309 *) case "$usethreads" in
14310 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14317 *) getgrgid_r_proto=0
14321 : see if getgrnam_r exists
14322 set getgrnam_r d_getgrnam_r
14324 case "$d_getgrnam_r" in
14326 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14327 case "$d_getgrnam_r_proto:$usethreads" in
14328 ":define") d_getgrnam_r_proto=define
14329 set d_getgrnam_r_proto getgrnam_r $hdrs
14333 case "$d_getgrnam_r_proto" in
14335 case "$getgrnam_r_proto" in
14336 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14337 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14339 case "$getgrnam_r_proto" in
14340 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14341 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14343 case "$getgrnam_r_proto" in
14344 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14345 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14347 case "$getgrnam_r_proto" in
14348 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14349 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14351 case "$getgrnam_r_proto" in
14352 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14353 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14355 case "$getgrnam_r_proto" in
14356 ''|0) d_getgrnam_r=undef
14358 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14359 * ) case "$getgrnam_r_proto" in
14360 REENTRANT_PROTO*) ;;
14361 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14363 echo "Prototype: $try" ;;
14366 *) case "$usethreads" in
14367 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14374 *) getgrnam_r_proto=0
14378 : see if gethostbyaddr exists
14379 set gethostbyaddr d_gethbyaddr
14382 : see if gethostbyname exists
14383 set gethostbyname d_gethbyname
14386 : see if gethostent exists
14387 set gethostent d_gethent
14390 : see how we will look up host name
14393 if set gethostname val -f d_gethname; eval $csym; $val; then
14394 echo 'gethostname() found.' >&4
14395 d_gethname="$define"
14398 if set uname val -f d_uname; eval $csym; $val; then
14401 uname() was found, but you're running xenix, and older versions of xenix
14402 have a broken uname(). If you don't really know whether your xenix is old
14403 enough to have a broken system call, use the default answer.
14408 "$define") dflt=n;;
14410 rp='Is your uname() broken?'
14413 n*) d_uname="$define"; call=uname;;
14416 echo 'uname() found.' >&4
14423 case "$d_gethname" in
14424 '') d_gethname="$undef";;
14427 '') d_uname="$undef";;
14429 case "$d_uname$d_gethname" in
14434 Every now and then someone has a $call() that lies about the hostname
14435 but can't be fixed for political or economic reasons. If you wish, I can
14436 pretend $call() isn't there and maybe compute hostname at run-time
14437 thanks to the '$phostname' command.
14440 rp="Shall I ignore $call() from now on?"
14443 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14446 case "$phostname" in
14447 '') aphostname='';;
14448 *) case "$aphostname" in
14450 *) set X $phostname
14454 file=`./loc $file $file $pth`
14455 aphostname=`echo $file $*`
14460 case "$d_uname$d_gethname" in
14463 case "$phostname" in
14465 echo "There will be no way for $package to get your hostname." >&4;;
14467 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14471 case "$d_phostname" in
14472 '') d_phostname="$undef";;
14475 : see if gethostbyaddr_r exists
14476 set gethostbyaddr_r d_gethostbyaddr_r
14478 case "$d_gethostbyaddr_r" in
14480 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14481 case "$d_gethostbyaddr_r_proto:$usethreads" in
14482 ":define") d_gethostbyaddr_r_proto=define
14483 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14487 case "$d_gethostbyaddr_r_proto" in
14489 case "$gethostbyaddr_r_proto" in
14490 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14491 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14493 case "$gethostbyaddr_r_proto" in
14494 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14495 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14497 case "$gethostbyaddr_r_proto" in
14498 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14499 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14501 case "$gethostbyaddr_r_proto" in
14502 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14503 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14505 case "$gethostbyaddr_r_proto" in
14506 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14507 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14509 case "$gethostbyaddr_r_proto" in
14510 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14511 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14513 case "$gethostbyaddr_r_proto" in
14514 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14515 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14517 case "$gethostbyaddr_r_proto" in
14518 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14519 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14521 case "$gethostbyaddr_r_proto" in
14522 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14523 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14525 case "$gethostbyaddr_r_proto" in
14526 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14527 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14529 case "$gethostbyaddr_r_proto" in
14530 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14531 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14533 case "$gethostbyaddr_r_proto" in
14534 ''|0) d_gethostbyaddr_r=undef
14535 gethostbyaddr_r_proto=0
14536 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14537 * ) case "$gethostbyaddr_r_proto" in
14538 REENTRANT_PROTO*) ;;
14539 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14541 echo "Prototype: $try" ;;
14544 *) case "$usethreads" in
14545 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14547 d_gethostbyaddr_r=undef
14548 gethostbyaddr_r_proto=0
14552 *) gethostbyaddr_r_proto=0
14556 : see if gethostbyname_r exists
14557 set gethostbyname_r d_gethostbyname_r
14559 case "$d_gethostbyname_r" in
14561 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14562 case "$d_gethostbyname_r_proto:$usethreads" in
14563 ":define") d_gethostbyname_r_proto=define
14564 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14568 case "$d_gethostbyname_r_proto" in
14570 case "$gethostbyname_r_proto" in
14571 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14572 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14574 case "$gethostbyname_r_proto" in
14575 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14576 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14578 case "$gethostbyname_r_proto" in
14579 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14580 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14582 case "$gethostbyname_r_proto" in
14583 ''|0) d_gethostbyname_r=undef
14584 gethostbyname_r_proto=0
14585 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14586 * ) case "$gethostbyname_r_proto" in
14587 REENTRANT_PROTO*) ;;
14588 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14590 echo "Prototype: $try" ;;
14593 *) case "$usethreads" in
14594 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14596 d_gethostbyname_r=undef
14597 gethostbyname_r_proto=0
14601 *) gethostbyname_r_proto=0
14605 : see if gethostent_r exists
14606 set gethostent_r d_gethostent_r
14608 case "$d_gethostent_r" in
14610 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14611 case "$d_gethostent_r_proto:$usethreads" in
14612 ":define") d_gethostent_r_proto=define
14613 set d_gethostent_r_proto gethostent_r $hdrs
14617 case "$d_gethostent_r_proto" in
14619 case "$gethostent_r_proto" in
14620 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14621 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14623 case "$gethostent_r_proto" in
14624 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14625 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14627 case "$gethostent_r_proto" in
14628 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14629 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14631 case "$gethostent_r_proto" in
14632 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14633 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14635 case "$gethostent_r_proto" in
14636 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14637 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14639 case "$gethostent_r_proto" in
14640 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14641 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14643 case "$gethostent_r_proto" in
14644 ''|0) d_gethostent_r=undef
14645 gethostent_r_proto=0
14646 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14647 * ) case "$gethostent_r_proto" in
14648 REENTRANT_PROTO*) ;;
14649 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14651 echo "Prototype: $try" ;;
14654 *) case "$usethreads" in
14655 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14657 d_gethostent_r=undef
14658 gethostent_r_proto=0
14662 *) gethostent_r_proto=0
14666 : see if prototypes for various gethostxxx netdb.h functions are available
14668 set d_gethostprotos gethostent $i_netdb netdb.h
14671 : see if getitimer exists
14672 set getitimer d_getitimer
14675 : see if getlogin exists
14676 set getlogin d_getlogin
14679 : see if getlogin_r exists
14680 set getlogin_r d_getlogin_r
14682 case "$d_getlogin_r" in
14684 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14685 case "$d_getlogin_r_proto:$usethreads" in
14686 ":define") d_getlogin_r_proto=define
14687 set d_getlogin_r_proto getlogin_r $hdrs
14691 case "$d_getlogin_r_proto" in
14693 case "$getlogin_r_proto" in
14694 ''|0) try='int getlogin_r(char*, size_t);'
14695 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14697 case "$getlogin_r_proto" in
14698 ''|0) try='int getlogin_r(char*, int);'
14699 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14701 case "$getlogin_r_proto" in
14702 ''|0) try='char* getlogin_r(char*, size_t);'
14703 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14705 case "$getlogin_r_proto" in
14706 ''|0) try='char* getlogin_r(char*, int);'
14707 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14709 case "$getlogin_r_proto" in
14710 ''|0) d_getlogin_r=undef
14712 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14713 * ) case "$getlogin_r_proto" in
14714 REENTRANT_PROTO*) ;;
14715 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14717 echo "Prototype: $try" ;;
14720 *) case "$usethreads" in
14721 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14728 *) getlogin_r_proto=0
14732 : see if getmnt exists
14733 set getmnt d_getmnt
14736 : see if getmntent exists
14737 set getmntent d_getmntent
14740 : see if getnameinfo exists
14741 set getnameinfo d_getnameinfo
14744 : see if getnetbyaddr exists
14745 set getnetbyaddr d_getnbyaddr
14748 : see if getnetbyname exists
14749 set getnetbyname d_getnbyname
14752 : see if getnetent exists
14753 set getnetent d_getnent
14756 : see if getnetbyaddr_r exists
14757 set getnetbyaddr_r d_getnetbyaddr_r
14759 case "$d_getnetbyaddr_r" in
14761 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14762 case "$d_getnetbyaddr_r_proto:$usethreads" in
14763 ":define") d_getnetbyaddr_r_proto=define
14764 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14768 case "$d_getnetbyaddr_r_proto" in
14770 case "$getnetbyaddr_r_proto" in
14771 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14772 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14774 case "$getnetbyaddr_r_proto" in
14775 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14776 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14778 case "$getnetbyaddr_r_proto" in
14779 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14780 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14782 case "$getnetbyaddr_r_proto" in
14783 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14784 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14786 case "$getnetbyaddr_r_proto" in
14787 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14788 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14790 case "$getnetbyaddr_r_proto" in
14791 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14792 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14794 case "$getnetbyaddr_r_proto" in
14795 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14796 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14798 case "$getnetbyaddr_r_proto" in
14799 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14800 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14802 case "$getnetbyaddr_r_proto" in
14803 ''|0) d_getnetbyaddr_r=undef
14804 getnetbyaddr_r_proto=0
14805 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14806 * ) case "$getnetbyaddr_r_proto" in
14807 REENTRANT_PROTO*) ;;
14808 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14810 echo "Prototype: $try" ;;
14813 *) case "$usethreads" in
14814 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14816 d_getnetbyaddr_r=undef
14817 getnetbyaddr_r_proto=0
14821 *) getnetbyaddr_r_proto=0
14825 : see if getnetbyname_r exists
14826 set getnetbyname_r d_getnetbyname_r
14828 case "$d_getnetbyname_r" in
14830 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14831 case "$d_getnetbyname_r_proto:$usethreads" in
14832 ":define") d_getnetbyname_r_proto=define
14833 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14837 case "$d_getnetbyname_r_proto" in
14839 case "$getnetbyname_r_proto" in
14840 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14841 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14843 case "$getnetbyname_r_proto" in
14844 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14845 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14847 case "$getnetbyname_r_proto" in
14848 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14849 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14851 case "$getnetbyname_r_proto" in
14852 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14853 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14855 case "$getnetbyname_r_proto" in
14856 ''|0) d_getnetbyname_r=undef
14857 getnetbyname_r_proto=0
14858 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14859 * ) case "$getnetbyname_r_proto" in
14860 REENTRANT_PROTO*) ;;
14861 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14863 echo "Prototype: $try" ;;
14866 *) case "$usethreads" in
14867 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14869 d_getnetbyname_r=undef
14870 getnetbyname_r_proto=0
14874 *) getnetbyname_r_proto=0
14878 : see if getnetent_r exists
14879 set getnetent_r d_getnetent_r
14881 case "$d_getnetent_r" in
14883 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14884 case "$d_getnetent_r_proto:$usethreads" in
14885 ":define") d_getnetent_r_proto=define
14886 set d_getnetent_r_proto getnetent_r $hdrs
14890 case "$d_getnetent_r_proto" in
14892 case "$getnetent_r_proto" in
14893 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14894 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14896 case "$getnetent_r_proto" in
14897 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14898 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14900 case "$getnetent_r_proto" in
14901 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14902 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14904 case "$getnetent_r_proto" in
14905 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14906 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14908 case "$getnetent_r_proto" in
14909 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14910 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14912 case "$getnetent_r_proto" in
14913 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14914 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14916 case "$getnetent_r_proto" in
14917 ''|0) d_getnetent_r=undef
14918 getnetent_r_proto=0
14919 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14920 * ) case "$getnetent_r_proto" in
14921 REENTRANT_PROTO*) ;;
14922 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14924 echo "Prototype: $try" ;;
14927 *) case "$usethreads" in
14928 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14930 d_getnetent_r=undef
14931 getnetent_r_proto=0
14935 *) getnetent_r_proto=0
14939 : see if prototypes for various getnetxxx netdb.h functions are available
14941 set d_getnetprotos getnetent $i_netdb netdb.h
14944 : see if getpagesize exists
14945 set getpagesize d_getpagsz
14948 : Optional checks for getprotobyname and getprotobynumber
14950 : see if getprotobyname exists
14951 set getprotobyname d_getpbyname
14954 : see if getprotobynumber exists
14955 set getprotobynumber d_getpbynumber
14958 : see if getprotoent exists
14959 set getprotoent d_getpent
14962 : see if getpgid exists
14963 set getpgid d_getpgid
14966 : see if getpgrp2 exists
14967 set getpgrp2 d_getpgrp2
14970 : see if getppid exists
14971 set getppid d_getppid
14974 : see if getpriority exists
14975 set getpriority d_getprior
14978 : see if getprotobyname_r exists
14979 set getprotobyname_r d_getprotobyname_r
14981 case "$d_getprotobyname_r" in
14983 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14984 case "$d_getprotobyname_r_proto:$usethreads" in
14985 ":define") d_getprotobyname_r_proto=define
14986 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14990 case "$d_getprotobyname_r_proto" in
14992 case "$getprotobyname_r_proto" in
14993 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14994 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14996 case "$getprotobyname_r_proto" in
14997 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14998 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15000 case "$getprotobyname_r_proto" in
15001 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15002 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15004 case "$getprotobyname_r_proto" in
15005 ''|0) d_getprotobyname_r=undef
15006 getprotobyname_r_proto=0
15007 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15008 * ) case "$getprotobyname_r_proto" in
15009 REENTRANT_PROTO*) ;;
15010 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15012 echo "Prototype: $try" ;;
15015 *) case "$usethreads" in
15016 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15018 d_getprotobyname_r=undef
15019 getprotobyname_r_proto=0
15023 *) getprotobyname_r_proto=0
15027 : see if getprotobynumber_r exists
15028 set getprotobynumber_r d_getprotobynumber_r
15030 case "$d_getprotobynumber_r" in
15032 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15033 case "$d_getprotobynumber_r_proto:$usethreads" in
15034 ":define") d_getprotobynumber_r_proto=define
15035 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15039 case "$d_getprotobynumber_r_proto" in
15041 case "$getprotobynumber_r_proto" in
15042 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15043 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15045 case "$getprotobynumber_r_proto" in
15046 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15047 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15049 case "$getprotobynumber_r_proto" in
15050 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15051 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15053 case "$getprotobynumber_r_proto" in
15054 ''|0) d_getprotobynumber_r=undef
15055 getprotobynumber_r_proto=0
15056 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15057 * ) case "$getprotobynumber_r_proto" in
15058 REENTRANT_PROTO*) ;;
15059 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15061 echo "Prototype: $try" ;;
15064 *) case "$usethreads" in
15065 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15067 d_getprotobynumber_r=undef
15068 getprotobynumber_r_proto=0
15072 *) getprotobynumber_r_proto=0
15076 : see if getprotoent_r exists
15077 set getprotoent_r d_getprotoent_r
15079 case "$d_getprotoent_r" in
15081 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15082 case "$d_getprotoent_r_proto:$usethreads" in
15083 ":define") d_getprotoent_r_proto=define
15084 set d_getprotoent_r_proto getprotoent_r $hdrs
15088 case "$d_getprotoent_r_proto" in
15090 case "$getprotoent_r_proto" in
15091 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15092 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15094 case "$getprotoent_r_proto" in
15095 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15096 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15098 case "$getprotoent_r_proto" in
15099 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15100 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15102 case "$getprotoent_r_proto" in
15103 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15104 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15106 case "$getprotoent_r_proto" in
15107 ''|0) d_getprotoent_r=undef
15108 getprotoent_r_proto=0
15109 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15110 * ) case "$getprotoent_r_proto" in
15111 REENTRANT_PROTO*) ;;
15112 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15114 echo "Prototype: $try" ;;
15117 *) case "$usethreads" in
15118 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15120 d_getprotoent_r=undef
15121 getprotoent_r_proto=0
15125 *) getprotoent_r_proto=0
15129 : see if prototypes for various getprotoxxx netdb.h functions are available
15131 set d_getprotoprotos getprotoent $i_netdb netdb.h
15134 : see if getprpwnam exists
15135 set getprpwnam d_getprpwnam
15138 : see if getpwent exists
15139 set getpwent d_getpwent
15142 : see if getpwent_r exists
15143 set getpwent_r d_getpwent_r
15145 case "$d_getpwent_r" in
15147 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15148 case "$d_getpwent_r_proto:$usethreads" in
15149 ":define") d_getpwent_r_proto=define
15150 set d_getpwent_r_proto getpwent_r $hdrs
15154 case "$d_getpwent_r_proto" in
15156 case "$getpwent_r_proto" in
15157 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15158 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15160 case "$getpwent_r_proto" in
15161 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15162 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15164 case "$getpwent_r_proto" in
15165 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15166 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15168 case "$getpwent_r_proto" in
15169 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15170 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15172 case "$getpwent_r_proto" in
15173 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15174 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15176 case "$getpwent_r_proto" in
15177 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15178 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15180 case "$getpwent_r_proto" in
15181 ''|0) d_getpwent_r=undef
15183 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15184 * ) case "$getpwent_r_proto" in
15185 REENTRANT_PROTO*) ;;
15186 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15188 echo "Prototype: $try" ;;
15191 *) case "$usethreads" in
15192 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15199 *) getpwent_r_proto=0
15203 : see if getpwnam_r exists
15204 set getpwnam_r d_getpwnam_r
15206 case "$d_getpwnam_r" in
15208 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15209 case "$d_getpwnam_r_proto:$usethreads" in
15210 ":define") d_getpwnam_r_proto=define
15211 set d_getpwnam_r_proto getpwnam_r $hdrs
15215 case "$d_getpwnam_r_proto" in
15217 case "$getpwnam_r_proto" in
15218 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15219 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15221 case "$getpwnam_r_proto" in
15222 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15223 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15225 case "$getpwnam_r_proto" in
15226 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15227 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15229 case "$getpwnam_r_proto" in
15230 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15231 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15233 case "$getpwnam_r_proto" in
15234 ''|0) d_getpwnam_r=undef
15236 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15237 * ) case "$getpwnam_r_proto" in
15238 REENTRANT_PROTO*) ;;
15239 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15241 echo "Prototype: $try" ;;
15244 *) case "$usethreads" in
15245 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15252 *) getpwnam_r_proto=0
15256 : see if getpwuid_r exists
15257 set getpwuid_r d_getpwuid_r
15259 case "$d_getpwuid_r" in
15261 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15262 case "$d_getpwuid_r_proto:$usethreads" in
15263 ":define") d_getpwuid_r_proto=define
15264 set d_getpwuid_r_proto getpwuid_r $hdrs
15268 case "$d_getpwuid_r_proto" in
15270 case "$getpwuid_r_proto" in
15271 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15272 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15274 case "$getpwuid_r_proto" in
15275 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15276 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15278 case "$getpwuid_r_proto" in
15279 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15280 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15282 case "$getpwuid_r_proto" in
15283 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15284 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15286 case "$getpwuid_r_proto" in
15287 ''|0) d_getpwuid_r=undef
15289 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15290 * ) case "$getpwuid_r_proto" in
15291 REENTRANT_PROTO*) ;;
15292 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15294 echo "Prototype: $try" ;;
15297 *) case "$usethreads" in
15298 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15305 *) getpwuid_r_proto=0
15309 : Optional checks for getsbyname and getsbyport
15311 : see if getservbyname exists
15312 set getservbyname d_getsbyname
15315 : see if getservbyport exists
15316 set getservbyport d_getsbyport
15319 : see if getservent exists
15320 set getservent d_getsent
15323 : see if getservbyname_r exists
15324 set getservbyname_r d_getservbyname_r
15326 case "$d_getservbyname_r" in
15328 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15329 case "$d_getservbyname_r_proto:$usethreads" in
15330 ":define") d_getservbyname_r_proto=define
15331 set d_getservbyname_r_proto getservbyname_r $hdrs
15335 case "$d_getservbyname_r_proto" in
15337 case "$getservbyname_r_proto" in
15338 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15339 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15341 case "$getservbyname_r_proto" in
15342 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15343 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15345 case "$getservbyname_r_proto" in
15346 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15347 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15349 case "$getservbyname_r_proto" in
15350 ''|0) d_getservbyname_r=undef
15351 getservbyname_r_proto=0
15352 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15353 * ) case "$getservbyname_r_proto" in
15354 REENTRANT_PROTO*) ;;
15355 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15357 echo "Prototype: $try" ;;
15360 *) case "$usethreads" in
15361 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15363 d_getservbyname_r=undef
15364 getservbyname_r_proto=0
15368 *) getservbyname_r_proto=0
15372 : see if getservbyport_r exists
15373 set getservbyport_r d_getservbyport_r
15375 case "$d_getservbyport_r" in
15377 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15378 case "$d_getservbyport_r_proto:$usethreads" in
15379 ":define") d_getservbyport_r_proto=define
15380 set d_getservbyport_r_proto getservbyport_r $hdrs
15384 case "$d_getservbyport_r_proto" in
15386 case "$getservbyport_r_proto" in
15387 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15388 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15390 case "$getservbyport_r_proto" in
15391 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15392 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15394 case "$getservbyport_r_proto" in
15395 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15396 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15398 case "$getservbyport_r_proto" in
15399 ''|0) d_getservbyport_r=undef
15400 getservbyport_r_proto=0
15401 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15402 * ) case "$getservbyport_r_proto" in
15403 REENTRANT_PROTO*) ;;
15404 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15406 echo "Prototype: $try" ;;
15409 *) case "$usethreads" in
15410 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15412 d_getservbyport_r=undef
15413 getservbyport_r_proto=0
15417 *) getservbyport_r_proto=0
15421 : see if getservent_r exists
15422 set getservent_r d_getservent_r
15424 case "$d_getservent_r" in
15426 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15427 case "$d_getservent_r_proto:$usethreads" in
15428 ":define") d_getservent_r_proto=define
15429 set d_getservent_r_proto getservent_r $hdrs
15433 case "$d_getservent_r_proto" in
15435 case "$getservent_r_proto" in
15436 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15437 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15439 case "$getservent_r_proto" in
15440 ''|0) try='int getservent_r(struct servent*, char*, int);'
15441 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15443 case "$getservent_r_proto" in
15444 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15445 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15447 case "$getservent_r_proto" in
15448 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15449 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15451 case "$getservent_r_proto" in
15452 ''|0) d_getservent_r=undef
15453 getservent_r_proto=0
15454 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15455 * ) case "$getservent_r_proto" in
15456 REENTRANT_PROTO*) ;;
15457 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15459 echo "Prototype: $try" ;;
15462 *) case "$usethreads" in
15463 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15465 d_getservent_r=undef
15466 getservent_r_proto=0
15470 *) getservent_r_proto=0
15474 : see if prototypes for various getservxxx netdb.h functions are available
15476 set d_getservprotos getservent $i_netdb netdb.h
15479 : see if getspnam exists
15480 set getspnam d_getspnam
15483 : see if this is a shadow.h system
15484 set shadow.h i_shadow
15487 : see if getspnam_r exists
15488 set getspnam_r d_getspnam_r
15490 case "$d_getspnam_r" in
15492 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15493 case "$d_getspnam_r_proto:$usethreads" in
15494 ":define") d_getspnam_r_proto=define
15495 set d_getspnam_r_proto getspnam_r $hdrs
15499 case "$d_getspnam_r_proto" in
15501 case "$getspnam_r_proto" in
15502 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15503 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15505 case "$getspnam_r_proto" in
15506 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15507 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15509 case "$getspnam_r_proto" in
15510 ''|0) d_getspnam_r=undef
15512 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15513 * ) case "$getspnam_r_proto" in
15514 REENTRANT_PROTO*) ;;
15515 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15517 echo "Prototype: $try" ;;
15520 *) case "$usethreads" in
15521 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15528 *) getspnam_r_proto=0
15532 : see if gettimeofday or ftime exists
15533 set gettimeofday d_gettimeod
15535 case "$d_gettimeod" in
15541 val="$undef"; set d_ftime; eval $setvar
15544 case "$d_gettimeod$d_ftime" in
15547 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15551 : see if gmtime_r exists
15552 set gmtime_r d_gmtime_r
15554 case "$d_gmtime_r" in
15556 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15557 case "$d_gmtime_r_proto:$usethreads" in
15558 ":define") d_gmtime_r_proto=define
15559 set d_gmtime_r_proto gmtime_r $hdrs
15563 case "$d_gmtime_r_proto" in
15565 case "$gmtime_r_proto" in
15566 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15567 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15569 case "$gmtime_r_proto" in
15570 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15571 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15573 case "$gmtime_r_proto" in
15574 ''|0) d_gmtime_r=undef
15576 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15577 * ) case "$gmtime_r_proto" in
15578 REENTRANT_PROTO*) ;;
15579 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15581 echo "Prototype: $try" ;;
15584 *) case "$usethreads" in
15585 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15592 *) gmtime_r_proto=0
15596 : see if hasmntopt exists
15597 set hasmntopt d_hasmntopt
15600 : see if this is a netinet/in.h or sys/in.h system
15601 set netinet/in.h i_niin sys/in.h i_sysin
15604 : see if arpa/inet.h has to be included
15605 set arpa/inet.h i_arpainet
15608 : see if htonl --and friends-- exists
15613 : Maybe they are macros.
15616 $cat >htonl.c <<EOM
15618 #include <sys/types.h>
15619 #$i_niin I_NETINET_IN
15621 #$i_arpainet I_ARPA_INET
15622 #ifdef I_NETINET_IN
15623 #include <netinet/in.h>
15626 #include <sys/in.h>
15629 #include <arpa/inet.h>
15632 printf("Defined as a macro.");
15635 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15636 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15638 echo "But it seems to be defined as a macro." >&4
15646 : see if hypot exists
15650 : see if ilogb exists
15654 : see if ilogbl exists
15655 set ilogbl d_ilogbl
15658 : check whether inet_aton exists
15659 set inet_aton d_inetaton
15662 : see if inet_ntop exists
15663 set inet_ntop d_inetntop
15666 : see if inet_pton exists
15667 set inet_pton d_inetpton
15672 $cat >isascii.c <<EOCP
15675 #$i_stdlib I_STDLIB
15677 #include <stdlib.h>
15688 if eval $compile; then
15689 echo "isascii() found." >&4
15692 echo "isascii() NOT found." >&4
15701 $cat >isblank.c <<'EOCP'
15712 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15713 echo "isblank() found." >&4
15716 echo "isblank() NOT found." >&4
15723 : check for isfinite
15724 echo "Checking to see if you have isfinite..." >&4
15727 int main() { return isfinite(0.0); }
15730 if eval $compile; then
15732 echo "You have isfinite."
15735 echo "You do not have isfinite."
15741 : see if isfinitel exists
15742 set isfinitel d_isfinitel
15746 echo "Checking to see if you have isinf..." >&4
15749 int main() { return isinf(0.0); }
15752 if eval $compile; then
15754 echo "You have isinf."
15757 echo "You do not have isinf."
15763 : see if isinfl exists
15764 set isinfl d_isinfl
15768 echo "Checking to see if you have isless..." >&4
15771 int main() { return isless(0.0); }
15774 if eval $compile; then
15776 echo "You have isless."
15779 echo "You do not have isless."
15786 echo "Checking to see if you have isnan..." >&4
15789 int main() { return isnan(0.0); }
15792 if eval $compile; then
15794 echo "You have isnan."
15797 echo "You do not have isnan."
15803 : see if isnanl exists
15804 set isnanl d_isnanl
15807 : check for isnormal
15808 echo "Checking to see if you have isnormal..." >&4
15811 int main() { return isnormal(0.0); }
15814 if eval $compile; then
15816 echo "You have isnormal."
15819 echo "You do not have isnormal."
15829 : see if j0l exists
15833 : see if killpg exists
15834 set killpg d_killpg
15837 : see if localeconv exists
15838 set localeconv d_locconv
15841 : see if libc has the POSIX.1-2008 currency locale rules
15842 case "$d_locconv:$d_lc_monetary_2008" in
15845 #include <locale.h>
15847 struct lconv *lc = localeconv();
15848 char int_p_cs_precedes = lc->int_p_cs_precedes;
15853 if eval $compile; then
15854 d_lc_monetary_2008="$define"
15856 d_lc_monetary_2008="$undef"
15862 : see if lchown exists
15864 $cat > try.c <<'EOCP'
15865 /* System header to define __stub macros and hopefully few prototypes,
15866 which can conflict with char lchown(); below. */
15867 #include <assert.h>
15868 /* Override any gcc2 internal prototype to avoid an error. */
15869 /* We use char because int might match the return type of a gcc2
15870 builtin and then its argument prototype would still apply. */
15873 /* The GNU C library defines this for functions which it implements
15874 to always fail with ENOSYS. Some functions are actually named
15875 something starting with __ and the normal name is an alias. */
15876 #if defined (__stub_lchown) || defined (__stub___lchown)
15884 if eval $compile; then
15885 $echo "lchown() found." >&4
15888 $echo "lchown() NOT found." >&4
15894 : See if number of significant digits in a double precision number is known
15896 $cat >ldbl_dig.c <<EOM
15897 #include <limits.h>
15900 printf("Contains LDBL_DIG");
15903 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15904 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15905 echo "LDBL_DIG found." >&4
15908 echo "LDBL_DIG NOT found." >&4
15915 : see if lgamma exists
15916 set lgamma d_lgamma
15919 : see if lgamma_r exists
15920 set lgamma_r d_lgamma_r
15923 : check to see if math.h defines _LIB_VERSION
15924 d_libm_lib_version="$undef"
15926 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15928 #include <unistd.h>
15930 int main (int argc, char *argv[])
15932 printf ("%d\n", _LIB_VERSION);
15937 if eval $compile; then
15939 echo "Yes, it does ($foo)" >&4
15940 d_libm_lib_version="$define"
15942 echo "No, it does not (probably harmless)" >&4
15946 : see if link exists
15950 : see if llrint exists
15951 set llrint d_llrint
15954 : see if llrintl exists
15955 set llrintl d_llrintl
15958 : see if llround exists
15959 set llround d_llround
15962 : see if llroundl exists
15963 set llroundl d_llroundl
15966 : see if localeconv_l exists
15967 set localeconv_l d_localeconv_l
15970 : see if localtime_r exists
15971 set localtime_r d_localtime_r
15973 case "$d_localtime_r" in
15975 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15976 case "$d_localtime_r_proto:$usethreads" in
15977 ":define") d_localtime_r_proto=define
15978 set d_localtime_r_proto localtime_r $hdrs
15982 case "$d_localtime_r_proto" in
15984 case "$localtime_r_proto" in
15985 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15986 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15988 case "$localtime_r_proto" in
15989 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15990 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15992 case "$localtime_r_proto" in
15993 ''|0) d_localtime_r=undef
15994 localtime_r_proto=0
15995 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15996 * ) case "$localtime_r_proto" in
15997 REENTRANT_PROTO*) ;;
15998 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16000 echo "Prototype: $try" ;;
16003 *) case "$usethreads" in
16004 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16006 d_localtime_r=undef
16007 localtime_r_proto=0
16011 *) localtime_r_proto=0
16015 : see if localtime_r calls tzset
16016 case "$localtime_r_proto" in
16019 /* Does our libc's localtime_r call tzset ?
16020 * return 0 if so, 1 otherwise.
16022 #$i_systypes I_SYS_TYPES
16023 #$i_unistd I_UNISTD
16025 #$i_stdlib I_STDLIB
16026 #$i_malloc I_MALLOC
16028 # include <sys/types.h>
16031 # include <unistd.h>
16037 #include <stdlib.h>
16039 #include <string.h>
16041 # include <malloc.h>
16045 time_t t = time(0L);
16046 char w_tz[]="TZ" "=GMT+5",
16047 e_tz[]="TZ" "=GMT-5",
16048 *tz_e = (char*)malloc(16),
16049 *tz_w = (char*)malloc(16);
16050 struct tm tm_e, tm_w;
16051 memset(&tm_e,'\0',sizeof(struct tm));
16052 memset(&tm_w,'\0',sizeof(struct tm));
16057 localtime_r(&t, &tm_e);
16060 localtime_r(&t, &tm_w);
16062 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16068 if eval $compile; then
16069 if $run ./try; then
16070 d_localtime_r_needs_tzset=undef;
16072 d_localtime_r_needs_tzset=define;
16075 d_localtime_r_needs_tzset=undef;
16079 d_localtime_r_needs_tzset=undef;
16084 : see if lockf exists
16088 : see if log1p exists
16092 : see if log2 exists
16096 : see if logb exists
16100 : see if lrint exists
16104 : see if lrintl exists
16105 set lrintl d_lrintl
16108 : see if lround exists
16109 set lround d_lround
16112 : see if lroundl exists
16113 set lroundl d_lroundl
16116 : see if prototype for lseek is available
16118 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16121 : see if lstat exists
16125 : see if madvise exists
16126 set madvise d_madvise
16129 : see if malloc_size exists
16130 set malloc_size d_malloc_size
16133 : see if malloc_size_good exists
16134 set malloc_good_size d_malloc_good_size
16137 : see if mblen exists
16141 : see if mbrlen exists
16142 set mbrlen d_mbrlen
16145 : see if mbrtowc exists
16146 set mbrtowc d_mbrtowc
16149 : see if mbstowcs exists
16150 set mbstowcs d_mbstowcs
16153 : see if mbtowc exists
16154 set mbtowc d_mbtowc
16157 : see if memmem exists
16158 set memmem d_memmem
16161 : see if memrchr exists
16162 set memrchr d_memrchr
16165 : see if mkdir exists
16169 : see if mkdtemp exists
16170 set mkdtemp d_mkdtemp
16173 : see if mkfifo exists
16174 set mkfifo d_mkfifo
16177 : see if mkstemp exists
16178 set mkstemp d_mkstemp
16181 : see if mkstemps exists
16182 set mkstemps d_mkstemps
16185 : see if mktime exists
16186 set mktime d_mktime
16189 : see if this is a sys/mman.h system
16190 set sys/mman.h i_sysmman
16193 : see if mmap exists
16196 : see what shmat returns
16197 : default to something harmless
16199 case "$i_sysmman$d_mmap" in
16201 $cat >mmap.c <<'END'
16202 #include <sys/mman.h>
16205 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16210 echo "and it returns ($mmaptype)." >&4
16216 : see if sqrtl exists
16220 : see if scalbnl exists
16221 set scalbnl d_scalbnl
16224 : see if truncl exists
16225 set truncl d_truncl
16228 : see if modfl exists
16232 : see if prototype for modfl is available
16234 set d_modflproto modfl define math.h
16237 if $test "$uselongdouble" = "$define"; then
16239 if $test "$d_sqrtl" != "$define"; then
16240 message="$message sqrtl"
16242 if $test "$d_modfl" != "$define"; then
16243 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16244 echo "You have both truncl and copysignl, so I can emulate modfl."
16246 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16247 echo "You have both aintl and copysignl, so I can emulate modfl."
16249 message="$message modfl"
16253 if $test "$d_frexpl" != "$define"; then
16254 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16255 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16257 message="$message frexpl"
16260 if $test "$d_ldexpl" != "$define"; then
16261 message="$message ldexpl"
16264 if $test "$message" != ""; then
16267 *** You requested the use of long doubles but you do not seem to have
16268 *** the following mathematical functions needed for long double support:
16270 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16271 *** Cannot continue, aborting.
16279 : see if mprotect exists
16280 set mprotect d_mprotect
16283 : see if msgctl exists
16284 set msgctl d_msgctl
16287 : see if msgget exists
16288 set msgget d_msgget
16291 : see if msgsnd exists
16292 set msgsnd d_msgsnd
16295 : see if msgrcv exists
16296 set msgrcv d_msgrcv
16299 : see how much of the 'msg*(2)' library is present.
16302 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16303 *"$undef"*) h_msg=false;;
16307 case "`ipcs 2>&1`" in
16308 "SVID messages"*"not configured"*)
16309 echo "Your $osname does not have the msg*(2) configured." >&4
16312 set msgctl d_msgctl
16314 set msgget d_msgget
16316 set msgsnd d_msgsnd
16318 set msgrcv d_msgrcv
16324 : we could also check for sys/ipc.h ...
16325 if $h_msg && $test `./findhdr sys/msg.h`; then
16326 echo "You have the full msg*(2) library." >&4
16329 echo "You don't have the full msg*(2) library." >&4
16335 : Check for msghdr_s
16337 echo "Checking to see if your system supports struct msghdr..." >&4
16338 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16340 case "$d_msghdr_s" in
16341 "$define") echo "Yes, it does." ;;
16342 *) echo "No, it doesn't." ;;
16346 : see if msync exists
16350 : see if munmap exists
16351 set munmap d_munmap
16354 : see if nan exists
16358 : see if nanosleep exists
16359 set nanosleep d_nanosleep
16362 : see if nearbyint exists
16363 set nearbyint d_nearbyint
16366 : see if nextafter exists
16367 set nextafter d_nextafter
16370 : see if nexttoward exists
16371 set nexttoward d_nexttoward
16374 : see if nice exists
16378 : see if this is a langinfo.h system
16379 set langinfo.h i_langinfo
16382 : see if nl_langinfo exists
16383 set nl_langinfo d_nl_langinfo
16386 : see if this is a quadmath.h system
16387 set quadmath.h i_quadmath
16390 : Check basic sizes
16392 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16394 case "$use64bitint:$d_quad:$quadtype" in
16397 uvtype="$uquadtype"
16402 uvtype="unsigned long"
16408 case "$uselongdouble:$d_longdbl" in
16410 nvtype="long double"
16411 nvsize=$longdblsize
16418 case "$usequadmath:$i_quadmath" in
16420 nvtype="__float128"
16426 *** You requested the use of the quadmath library, but you
16427 *** do not seem to have the quadmath library installed.
16428 *** Cannot continue, aborting.
16434 define:*) $cat <<EOM >&4
16436 *** You requested the use of the quadmath library, but you
16437 *** do not seem to have the required header, <quadmath.h>.
16439 case "$gccversion" in
16442 *** Your gcc looks a bit old:
16448 *** You are not running a gcc.
16453 *** For the quadmath library you need at least gcc 4.6.
16454 *** Cannot continue, aborting.
16460 $echo "(IV will be "$ivtype", $ivsize bytes)"
16461 $echo "(UV will be "$uvtype", $uvsize bytes)"
16462 $echo "(NV will be "$nvtype", $nvsize bytes)"
16465 #$i_inttypes I_INTTYPES
16467 #include <inttypes.h>
16472 int8_t i = INT8_MAX;
16473 uint8_t u = UINT8_MAX;
16474 printf("int8_t\n");
16477 int16_t i = INT16_MAX;
16478 uint16_t u = UINT16_MAX;
16479 printf("int16_t\n");
16482 int32_t i = INT32_MAX;
16483 uint32_t u = UINT32_MAX;
16484 printf("int32_t\n");
16489 i8type="signed char"
16490 u8type="unsigned char"
16495 '') case "$shortsize" in
16497 u16type="unsigned short"
16505 '') set try -DINT16
16506 if eval $compile; then
16507 case "`$run ./try`" in
16519 '') if $test $shortsize -ge 2; then
16521 u16type="unsigned short"
16529 '') case "$longsize" in
16531 u32type="unsigned long"
16535 *) case "$intsize" in
16537 u32type="unsigned int"
16547 '') set try -DINT32
16548 if eval $compile; then
16549 case "`$run ./try`" in
16561 '') if $test $intsize -ge 4; then
16563 u32type="unsigned int"
16571 '') case "$d_quad:$quadtype" in
16573 i64type="$quadtype"
16574 u64type="$uquadtype"
16582 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16585 #$i_stdlib I_STDLIB
16587 #include <stdlib.h>
16589 #include <sys/types.h>
16590 #include <signal.h>
16592 /* volatile so that the compiler has to store it out to memory */
16593 volatile int bletched = 0;
16594 $signal_t blech(int s) { bletched = 1; }
16599 int n = 8 * $uvsize;
16602 signal(SIGFPE, blech);
16605 for (i = 0; i < n; i++) {
16606 u = u << 1 | ($uvtype)1;
16608 if (($uvtype)d != u)
16612 d = ($nvtype)(u - 1);
16613 if (($uvtype)d != (u - 1))
16620 printf("%d\n", ((i == n) ? -n : i));
16626 d_nv_preserves_uv="$undef"
16627 if eval $compile; then
16628 nv_preserves_uv_bits="`$run ./try`"
16630 case "$nv_preserves_uv_bits" in
16632 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16633 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16634 d_nv_preserves_uv="$define"
16636 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16637 d_nv_preserves_uv="$undef" ;;
16638 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16639 nv_preserves_uv_bits="0" ;;
16643 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16647 typedef $nvtype NV;
16654 while(count < 256) {
16655 /* volatile so that the compiler has to store it out to memory */
16656 volatile NV up = value + 1.0;
16657 volatile NV negated = -value;
16658 volatile NV down = negated - 1.0;
16659 volatile NV got_up = up - value;
16660 int up_good = got_up == 1.0;
16661 int got_down = down - negated;
16662 int down_good = got_down == -1.0;
16664 if (down_good != up_good) {
16666 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16667 up_good, (double) got_up, down_good, (double) got_down,
16668 count, (double) value);
16675 fputs("256.0", stdout);
16678 fputs("2.0", stdout);
16684 fputs("*", stdout);
16690 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16691 count, (double) value);
16697 nv_overflows_integers_at='0'
16698 if eval $compile; then
16704 The largest integer your NVs can preserve is equal to $xxx
16706 nv_overflows_integers_at="$xxx"
16709 Cannot determine the largest integer value your NVs can hold, unexpected output
16716 Cannot determine the largest integer value your NVs can hold
16723 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16726 #$i_stdlib I_STDLIB
16728 #include <stdlib.h>
16730 #include <string.h>
16731 #include <sys/types.h>
16732 #include <signal.h>
16734 /* volatile so that the compiler has to store it out to memory */
16735 volatile int bletched = 0;
16736 $signal_t blech(int s) { bletched = 1; }
16739 int checkit($nvtype d, const char *where) {
16741 unsigned char *p = (unsigned char *)v;
16742 unsigned char *end = p + sizeof(d);
16751 p = (unsigned char *)v;
16752 printf("No - %s: 0x", where);
16754 printf ("%02X", *p++);
16759 int main(int argc, char **argv) {
16762 fail += checkit(d, "0.0");
16764 /* The compiler shouldn't be assuming that bletched is 0 */
16767 fail += checkit(d, "bleched");
16770 signal(SIGFPE, blech);
16773 /* Paranoia - the compiler should have no way of knowing that ANSI says
16774 that argv[argc] will always be NULL. Actually, if it did assume this it
16775 would be buggy, as this is C and main() can be called from elsewhere in
16777 d = argv[argc] ? 1 : 0;
16780 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16783 fail += checkit(d, "ternary");
16785 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16788 printf("No - memset doesn't give 0.0\n");
16789 /* This might just blow up: */
16790 printf("(gives %g)\n", d);
16796 printf("No - something bleched\n");
16801 printf("No - %d fail(s)\n", fail);
16810 d_nv_zero_is_allbits_zero="$undef"
16811 if eval $compile; then
16817 0.0 is represented as all bits zero in memory
16819 d_nv_zero_is_allbits_zero="$define"
16822 0.0 is not represented as all bits zero in memory
16824 d_nv_zero_is_allbits_zero="$undef"
16829 0.0 is not represented as all bits zero in memory
16831 d_nv_zero_is_allbits_zero="$undef"
16837 : check for off64_t
16839 echo "Checking to see if you have off64_t..." >&4
16841 #include <sys/types.h>
16842 #include <unistd.h>
16843 int main() { off64_t x = 7; }
16846 if eval $compile; then
16848 echo "You have off64_t."
16851 echo "You do not have off64_t."
16852 case "$lseeksize" in
16853 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16860 : how to create joinable pthreads
16861 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16863 echo "Checking what constant to use for creating joinable pthreads..." >&4
16864 $cat >try.c <<'EOCP'
16865 #include <pthread.h>
16867 int detachstate = JOINABLE;
16870 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16871 if eval $compile; then
16872 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16873 val="$undef" # Yes, undef.
16874 set d_old_pthread_create_joinable
16877 set old_pthread_create_joinable
16880 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16881 if eval $compile; then
16882 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16884 set d_old_pthread_create_joinable
16886 val=PTHREAD_CREATE_UNDETACHED
16887 set old_pthread_create_joinable
16890 set try -DJOINABLE=__UNDETACHED
16891 if eval $compile; then
16892 echo "You seem to use __UNDETACHED." >&4
16894 set d_old_pthread_create_joinable
16897 set old_pthread_create_joinable
16900 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16902 set d_old_pthread_create_joinable
16905 set old_pthread_create_joinable
16912 d_old_pthread_create_joinable="$undef"
16913 old_pthread_create_joinable=""
16916 : see if pause exists
16920 : see if poll exists
16924 : see if prctl exists
16928 : see if prctl supports PR_SET_NAME
16929 d_prctl_set_name=$undef
16934 #include <unistd.h>
16936 #include <sys/prctl.h>
16938 int main (int argc, char *argv[])
16940 return (prctl (PR_SET_NAME, "Test"));
16944 if eval $compile_ok && $run ./try; then
16945 echo "Your prctl (PR_SET_NAME, ...) works"
16946 d_prctl_set_name=$define
16952 : see if readlink exists
16953 set readlink d_readlink
16956 : Check if there is a /proc symlink to the abs path of
16957 : the executing program. We will honor hints of d_procselfexe=$undef
16958 : or procselfexe being non-empty, otherwise will try to determine both
16959 : if we have readlink.
16960 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
16961 : referenced, and AmigaOS does not have a proc filesystem anyway.
16964 if $test "X$d_procselfexe" = Xundef; then
16966 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
16968 elif $test "X$d_readlink" = Xdefine; then
16969 : NetBSD first as /proc/self is a symlink to /proc/curproc,
16970 : and it feels more tidy to avoid an extra level of symlink
16971 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16972 while test $# -gt 0; do
16975 if $issymlink $try; then
16976 $ls -l $try > reflect
16977 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16978 echo "You have $type-like $try."
16979 procselfexe='"'$try'"'
16981 : This will break out of the loop
16991 : backward compatibility for d_hvfork
16992 if test X$d_hvfork != X; then
16993 d_vfork="$d_hvfork"
16996 : see if there is a vfork
17001 d_pseudofork=$undef
17003 : Ok, but do we want to use it. vfork is reportedly unreliable in
17004 : perl on Solaris 2.x, and probably elsewhere.
17008 case "$usevfork" in
17014 Perl can only use a vfork() that doesn't suffer from strict
17015 restrictions on calling functions or modifying global data in
17016 the child. For example, glibc-2.1 contains such a vfork()
17017 that is unsuitable. If your system provides a proper fork()
17018 call, chances are that you do NOT want perl to use vfork().
17021 rp="Do you still want to use vfork()?"
17026 echo "Ok, we won't use vfork()."
17035 $define) usevfork='true';;
17036 *) usevfork='false';;
17039 : see whether the pthread_atfork exists
17041 #include <pthread.h>
17044 #ifdef PTHREAD_ATFORK
17045 pthread_atfork(NULL,NULL,NULL);
17050 : see if pthread_atfork exists
17051 set try -DPTHREAD_ATFORK
17052 if eval $compile; then
17057 case "$usethreads" in
17060 $define) echo 'pthread_atfork found.' >&4 ;;
17061 *) echo 'pthread_atfork NOT found.' >&4 ;;
17064 set d_pthread_atfork
17067 : see if pthread_attr_setscope exists
17068 set pthread_attr_setscope d_pthread_attr_setscope
17071 : see whether the various POSIXish _yields exist
17073 #include <pthread.h>
17079 #ifdef PTHREAD_YIELD
17082 #ifdef PTHREAD_YIELD_NULL
17083 pthread_yield(NULL);
17089 : see if sched_yield exists
17090 set try -DSCHED_YIELD
17091 if eval $compile; then
17093 sched_yield='sched_yield()'
17097 case "$usethreads" in
17100 $define) echo 'sched_yield() found.' >&4 ;;
17101 *) echo 'sched_yield() NOT found.' >&4 ;;
17107 : see if pthread_yield exists
17108 set try -DPTHREAD_YIELD
17109 if eval $compile; then
17111 case "$sched_yield" in
17112 '') sched_yield='pthread_yield()' ;;
17115 set try -DPTHREAD_YIELD_NULL
17116 if eval $compile; then
17118 case "$sched_yield" in
17119 '') sched_yield='pthread_yield(NULL)' ;;
17125 case "$usethreads" in
17128 $define) echo 'pthread_yield() found.' >&4 ;;
17129 *) echo 'pthread_yield() NOT found.' >&4 ;;
17133 set d_pthread_yield
17135 case "$sched_yield" in
17136 '') sched_yield=undef ;;
17140 : check for ptrdiff_t
17142 echo "Checking to see if you have ptrdiff_t..." >&4
17144 #include <stddef.h>
17145 int main() { ptrdiff_t x = 7; }
17148 if eval $compile; then
17150 echo "You have ptrdiff_t."
17153 echo "You do not have ptrdiff_t."
17159 : see if random_r exists
17160 set random_r d_random_r
17162 case "$d_random_r" in
17164 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17165 case "$d_random_r_proto:$usethreads" in
17166 ":define") d_random_r_proto=define
17167 set d_random_r_proto random_r $hdrs
17171 case "$d_random_r_proto" in
17173 case "$random_r_proto" in
17174 ''|0) try='int random_r(int*, struct random_data*);'
17175 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17177 case "$random_r_proto" in
17178 ''|0) try='int random_r(long*, struct random_data*);'
17179 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17181 case "$random_r_proto" in
17182 ''|0) try='int random_r(struct random_data*, int32_t*);'
17183 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17185 case "$random_r_proto" in
17186 ''|0) d_random_r=undef
17188 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17189 * ) case "$random_r_proto" in
17190 REENTRANT_PROTO*) ;;
17191 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17193 echo "Prototype: $try" ;;
17196 *) case "$usethreads" in
17197 define) echo "random_r has no prototype, not using it." >&4 ;;
17204 *) random_r_proto=0
17208 : see if readdir and friends exist
17209 set readdir d_readdir
17211 set seekdir d_seekdir
17213 set telldir d_telldir
17215 set rewinddir d_rewinddir
17218 : see if readdir64_r exists
17219 set readdir64_r d_readdir64_r
17221 case "$d_readdir64_r" in
17223 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17224 case "$d_readdir64_r_proto:$usethreads" in
17225 ":define") d_readdir64_r_proto=define
17226 set d_readdir64_r_proto readdir64_r $hdrs
17230 case "$d_readdir64_r_proto" in
17232 case "$readdir64_r_proto" in
17233 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17234 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17236 case "$readdir64_r_proto" in
17237 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17238 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17240 case "$readdir64_r_proto" in
17241 ''|0) d_readdir64_r=undef
17242 readdir64_r_proto=0
17243 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17244 * ) case "$readdir64_r_proto" in
17245 REENTRANT_PROTO*) ;;
17246 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17248 echo "Prototype: $try" ;;
17251 *) case "$usethreads" in
17252 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17254 d_readdir64_r=undef
17255 readdir64_r_proto=0
17259 *) readdir64_r_proto=0
17263 : see if readdir_r exists
17264 set readdir_r d_readdir_r
17266 case "$d_readdir_r" in
17268 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17269 case "$d_readdir_r_proto:$usethreads" in
17270 ":define") d_readdir_r_proto=define
17271 set d_readdir_r_proto readdir_r $hdrs
17275 case "$d_readdir_r_proto" in
17277 case "$readdir_r_proto" in
17278 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17279 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17281 case "$readdir_r_proto" in
17282 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17283 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17285 case "$readdir_r_proto" in
17286 ''|0) d_readdir_r=undef
17288 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17289 * ) case "$readdir_r_proto" in
17290 REENTRANT_PROTO*) ;;
17291 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17293 echo "Prototype: $try" ;;
17296 *) case "$usethreads" in
17297 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17304 *) readdir_r_proto=0
17308 : see if readv exists
17312 : see if recvmsg exists
17313 set recvmsg d_recvmsg
17316 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17318 if set regcomp val -f d_regcomp; eval $csym; $val; then
17319 echo 'regcomp() found.' >&4
17320 d_regcomp="$define"
17323 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17324 echo 'regcmp() found.' >&4
17328 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17329 echo 're_comp() found, assuming re_exec() also exists.' >&4
17330 d_re_comp="$define"
17335 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17342 : see if remainder exists
17343 set remainder d_remainder
17346 : see if remquo exists
17347 set remquo d_remquo
17350 : see if rename exists
17351 set rename d_rename
17354 : see if rint exists
17358 : see if rmdir exists
17362 : see if round exists
17366 : see if prototype for sbrk is available
17368 set d_sbrkproto sbrk $i_unistd unistd.h
17371 : see if scalbn exists
17372 set scalbn d_scalbn
17375 : see if select exists
17376 set select d_select
17379 : see if semctl exists
17380 set semctl d_semctl
17383 : see if semget exists
17384 set semget d_semget
17387 : see if semop exists
17391 : see how much of the 'sem*(2)' library is present.
17394 case "$d_semctl$d_semget$d_semop" in
17395 *"$undef"*) h_sem=false;;
17399 case "`ipcs 2>&1`" in
17400 "SVID messages"*"not configured"*)
17401 echo "Your $osname does not have the sem*(2) configured." >&4
17404 set semctl d_semctl
17406 set semget d_semget
17414 : we could also check for sys/ipc.h ...
17415 if $h_sem && $test `./findhdr sys/sem.h`; then
17416 echo "You have the full sem*(2) library." >&4
17419 echo "You don't have the full sem*(2) library." >&4
17425 : see whether sys/sem.h defines union semun
17427 $cat > try.c <<'END'
17428 #include <sys/types.h>
17429 #include <sys/ipc.h>
17430 #include <sys/sem.h>
17431 int main () { union semun semun; semun.buf = 0; }
17434 if eval $compile; then
17435 echo "You have union semun in <sys/sem.h>." >&4
17438 echo "You do not have union semun in <sys/sem.h>." >&4
17445 : see how to do semctl IPC_STAT
17449 $cat > tryh.h <<END
17452 # define S_IRUSR S_IREAD
17453 # define S_IWUSR S_IWRITE
17454 # define S_IXUSR S_IEXEC
17456 # define S_IRUSR 0400
17457 # define S_IWUSR 0200
17458 # define S_IXUSR 0100
17460 # define S_IRGRP (S_IRUSR>>3)
17461 # define S_IWGRP (S_IWUSR>>3)
17462 # define S_IXGRP (S_IXUSR>>3)
17463 # define S_IROTH (S_IRUSR>>6)
17464 # define S_IWOTH (S_IWUSR>>6)
17465 # define S_IXOTH (S_IXUSR>>6)
17468 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17469 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17470 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17473 : see whether semctl IPC_STAT can use union semun
17474 case "$d_semctl_semun" in
17478 #include <sys/types.h>
17479 #include <sys/ipc.h>
17480 #include <sys/sem.h>
17481 #include <sys/stat.h>
17488 #$d_union_semun HAS_UNION_SEMUN
17491 #ifndef HAS_UNION_SEMUN
17494 struct semid_ds *buf;
17495 unsigned short *array;
17501 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17502 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17504 struct semid_ds argbuf;
17507 st = semctl(sem, 0, IPC_STAT, arg);
17511 # endif /* IPC_STAT */
17512 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17514 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17515 # endif /* IPC_RMID */
17516 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17518 #endif /* IPC_PRIVATE && ... */
17519 printf("semget failed: errno = %d\n", errno);
17524 if eval $compile; then
17527 semun) val="$define" ;;
17535 case "$d_semctl_semun" in
17537 echo "You can use union semun for semctl IPC_STAT." >&4
17540 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17545 : see whether semctl IPC_STAT can use struct semid_ds pointer
17546 case "$d_semctl_semid_ds" in
17549 $cat > try.c <<'END'
17550 #include <sys/types.h>
17551 #include <sys/ipc.h>
17552 #include <sys/sem.h>
17553 #include <sys/stat.h>
17561 struct semid_ds arg;
17564 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17565 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17568 st = semctl(sem, 0, IPC_STAT, &arg);
17570 printf("semid_ds\n");
17572 # endif /* IPC_STAT */
17573 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17575 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17576 # endif /* IPC_RMID */
17577 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17579 #endif /* IPC_PRIVATE && ... */
17580 printf("semget failed: errno = %d\n", errno);
17586 if eval $compile; then
17589 semid_ds) val="$define" ;;
17593 set d_semctl_semid_ds
17597 case "$d_semctl_semid_ds" in
17599 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17601 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17607 # We do not have the full sem*(2) library, so assume we can not
17613 set d_semctl_semid_ds
17619 : see if sendmsg exists
17620 set sendmsg d_sendmsg
17623 : see if setegid exists
17624 set setegid d_setegid
17627 : see if seteuid exists
17628 set seteuid d_seteuid
17631 : see if setgrent exists
17632 set setgrent d_setgrent
17635 : see if setgrent_r exists
17636 set setgrent_r d_setgrent_r
17638 case "$d_setgrent_r" in
17640 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17641 case "$d_setgrent_r_proto:$usethreads" in
17642 ":define") d_setgrent_r_proto=define
17643 set d_setgrent_r_proto setgrent_r $hdrs
17647 case "$d_setgrent_r_proto" in
17649 case "$setgrent_r_proto" in
17650 ''|0) try='int setgrent_r(FILE**);'
17651 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17653 case "$setgrent_r_proto" in
17654 ''|0) try='void setgrent_r(FILE**);'
17655 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17657 case "$setgrent_r_proto" in
17658 ''|0) d_setgrent_r=undef
17660 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17661 * ) case "$setgrent_r_proto" in
17662 REENTRANT_PROTO*) ;;
17663 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17665 echo "Prototype: $try" ;;
17668 *) case "$usethreads" in
17669 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17676 *) setgrent_r_proto=0
17680 : see if sethostent exists
17681 set sethostent d_sethent
17684 : see if sethostent_r exists
17685 set sethostent_r d_sethostent_r
17687 case "$d_sethostent_r" in
17689 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17690 case "$d_sethostent_r_proto:$usethreads" in
17691 ":define") d_sethostent_r_proto=define
17692 set d_sethostent_r_proto sethostent_r $hdrs
17696 case "$d_sethostent_r_proto" in
17698 case "$sethostent_r_proto" in
17699 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17700 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17702 case "$sethostent_r_proto" in
17703 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17704 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17706 case "$sethostent_r_proto" in
17707 ''|0) d_sethostent_r=undef
17708 sethostent_r_proto=0
17709 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17710 * ) case "$sethostent_r_proto" in
17711 REENTRANT_PROTO*) ;;
17712 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17714 echo "Prototype: $try" ;;
17717 *) case "$usethreads" in
17718 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17720 d_sethostent_r=undef
17721 sethostent_r_proto=0
17725 *) sethostent_r_proto=0
17729 : see if setitimer exists
17730 set setitimer d_setitimer
17733 : see if setlinebuf exists
17734 set setlinebuf d_setlinebuf
17737 : see if setlocale exists
17738 set setlocale d_setlocale
17741 : see if locale.h is available
17742 set locale.h i_locale
17745 : see if setlocale_r exists
17746 set setlocale_r d_setlocale_r
17748 case "$d_setlocale_r" in
17750 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17751 case "$d_setlocale_r_proto:$usethreads" in
17752 ":define") d_setlocale_r_proto=define
17753 set d_setlocale_r_proto setlocale_r $hdrs
17757 case "$d_setlocale_r_proto" in
17759 case "$setlocale_r_proto" in
17760 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17761 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17763 case "$setlocale_r_proto" in
17764 ''|0) d_setlocale_r=undef
17765 setlocale_r_proto=0
17766 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17767 * ) case "$setlocale_r_proto" in
17768 REENTRANT_PROTO*) ;;
17769 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17771 echo "Prototype: $try" ;;
17774 *) case "$usethreads" in
17775 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17777 d_setlocale_r=undef
17778 setlocale_r_proto=0
17782 *) setlocale_r_proto=0
17786 : see if setnetent exists
17787 set setnetent d_setnent
17790 : see if setnetent_r exists
17791 set setnetent_r d_setnetent_r
17793 case "$d_setnetent_r" in
17795 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17796 case "$d_setnetent_r_proto:$usethreads" in
17797 ":define") d_setnetent_r_proto=define
17798 set d_setnetent_r_proto setnetent_r $hdrs
17802 case "$d_setnetent_r_proto" in
17804 case "$setnetent_r_proto" in
17805 ''|0) try='int setnetent_r(int, struct netent_data*);'
17806 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17808 case "$setnetent_r_proto" in
17809 ''|0) try='void setnetent_r(int, struct netent_data*);'
17810 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17812 case "$setnetent_r_proto" in
17813 ''|0) d_setnetent_r=undef
17814 setnetent_r_proto=0
17815 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17816 * ) case "$setnetent_r_proto" in
17817 REENTRANT_PROTO*) ;;
17818 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17820 echo "Prototype: $try" ;;
17823 *) case "$usethreads" in
17824 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17826 d_setnetent_r=undef
17827 setnetent_r_proto=0
17831 *) setnetent_r_proto=0
17835 : see if setprotoent exists
17836 set setprotoent d_setpent
17839 : see if setpgid exists
17840 set setpgid d_setpgid
17843 : see if setpgrp2 exists
17844 set setpgrp2 d_setpgrp2
17847 : see if setpriority exists
17848 set setpriority d_setprior
17851 : see if setproctitle exists
17852 set setproctitle d_setproctitle
17855 : see if setprotoent_r exists
17856 set setprotoent_r d_setprotoent_r
17858 case "$d_setprotoent_r" in
17860 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17861 case "$d_setprotoent_r_proto:$usethreads" in
17862 ":define") d_setprotoent_r_proto=define
17863 set d_setprotoent_r_proto setprotoent_r $hdrs
17867 case "$d_setprotoent_r_proto" in
17869 case "$setprotoent_r_proto" in
17870 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17871 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17873 case "$setprotoent_r_proto" in
17874 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17875 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17877 case "$setprotoent_r_proto" in
17878 ''|0) d_setprotoent_r=undef
17879 setprotoent_r_proto=0
17880 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17881 * ) case "$setprotoent_r_proto" in
17882 REENTRANT_PROTO*) ;;
17883 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17885 echo "Prototype: $try" ;;
17888 *) case "$usethreads" in
17889 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17891 d_setprotoent_r=undef
17892 setprotoent_r_proto=0
17896 *) setprotoent_r_proto=0
17900 : see if setpwent exists
17901 set setpwent d_setpwent
17904 : see if setpwent_r exists
17905 set setpwent_r d_setpwent_r
17907 case "$d_setpwent_r" in
17909 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17910 case "$d_setpwent_r_proto:$usethreads" in
17911 ":define") d_setpwent_r_proto=define
17912 set d_setpwent_r_proto setpwent_r $hdrs
17916 case "$d_setpwent_r_proto" in
17918 case "$setpwent_r_proto" in
17919 ''|0) try='int setpwent_r(FILE**);'
17920 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17922 case "$setpwent_r_proto" in
17923 ''|0) try='void setpwent_r(FILE**);'
17924 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17926 case "$setpwent_r_proto" in
17927 ''|0) d_setpwent_r=undef
17929 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17930 * ) case "$setpwent_r_proto" in
17931 REENTRANT_PROTO*) ;;
17932 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17934 echo "Prototype: $try" ;;
17937 *) case "$usethreads" in
17938 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17945 *) setpwent_r_proto=0
17949 : see if setregid exists
17950 set setregid d_setregid
17952 set setresgid d_setresgid
17955 : see if setreuid exists
17956 set setreuid d_setreuid
17958 set setresuid d_setresuid
17961 : see if setrgid exists
17962 set setrgid d_setrgid
17965 : see if setruid exists
17966 set setruid d_setruid
17969 : see if setservent exists
17970 set setservent d_setsent
17973 : see if setservent_r exists
17974 set setservent_r d_setservent_r
17976 case "$d_setservent_r" in
17978 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17979 case "$d_setservent_r_proto:$usethreads" in
17980 ":define") d_setservent_r_proto=define
17981 set d_setservent_r_proto setservent_r $hdrs
17985 case "$d_setservent_r_proto" in
17987 case "$setservent_r_proto" in
17988 ''|0) try='int setservent_r(int, struct servent_data*);'
17989 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17991 case "$setservent_r_proto" in
17992 ''|0) try='void setservent_r(int, struct servent_data*);'
17993 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17995 case "$setservent_r_proto" in
17996 ''|0) d_setservent_r=undef
17997 setservent_r_proto=0
17998 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17999 * ) case "$setservent_r_proto" in
18000 REENTRANT_PROTO*) ;;
18001 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18003 echo "Prototype: $try" ;;
18006 *) case "$usethreads" in
18007 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18009 d_setservent_r=undef
18010 setservent_r_proto=0
18014 *) setservent_r_proto=0
18018 : see if setsid exists
18019 set setsid d_setsid
18022 : see if setvbuf exists
18023 set setvbuf d_setvbuf
18026 : see if shmctl exists
18027 set shmctl d_shmctl
18030 : see if shmget exists
18031 set shmget d_shmget
18034 : see if shmat exists
18037 : see what shmat returns
18040 $cat >shmat.c <<'END'
18041 #include <sys/shm.h>
18044 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18049 echo "and it returns ($shmattype)." >&4
18050 : see if a prototype for shmat is available
18051 xxx=`./findhdr sys/shm.h`
18052 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18053 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18064 set d_shmatprototype
18067 : see if shmdt exists
18071 : see how much of the 'shm*(2)' library is present.
18074 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18075 *"$undef"*) h_shm=false;;
18079 case "`ipcs 2>&1`" in
18080 "SVID shared memory"*"not configured"*)
18081 echo "Your $osname does not have the shm*(2) configured." >&4
18084 set shmctl d_shmctl
18086 set shmget d_shmget
18096 : we could also check for sys/ipc.h ...
18097 if $h_shm && $test `./findhdr sys/shm.h`; then
18098 echo "You have the full shm*(2) library." >&4
18101 echo "You don't have the full shm*(2) library." >&4
18107 : see if we have sigaction
18109 if set sigaction val -f d_sigaction; eval $csym; $val; then
18110 echo 'sigaction() found.' >&4
18113 #include <sys/types.h>
18114 #include <signal.h>
18115 #$i_stdlib I_STDLIB
18117 #include <stdlib.h>
18121 struct sigaction act, oact;
18123 oact.sa_handler = 0;
18124 /* so that act and oact are used */
18125 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18129 if eval $compile_ok; then
18132 echo "But you don't seem to have a usable struct sigaction." >&4
18136 echo 'sigaction NOT found.' >&4
18139 set d_sigaction; eval $setvar
18142 : see what type pids are declared as in the kernel
18143 rp="What is the type of process ids on this system?"
18144 set pid_t pidtype int stdio.h sys/types.h
18147 : see what type uids are declared as in the kernel
18149 echo "Looking for the type for user ids returned by getuid()."
18150 set uid_t uidtype xxx stdio.h sys/types.h
18154 xxx=`./findhdr sys/user.h`
18155 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18157 unsigned) dflt="$1 $2" ;;
18161 *) dflt="$uidtype";;
18164 uid_t) echo "uid_t found." ;;
18165 *) rp="What is the type for user ids returned by getuid()?"
18171 : Define hasfield_t macro for Configure internal use
18172 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18173 while $test $# -ge 2; do
18175 $define) echo "#include <$2>";;
18179 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18181 if eval $compile; then
18190 : see what siginfo fields we have
18191 case "$d_sigaction" in
18193 echo "Checking if your siginfo_t has si_errno field...">&4
18194 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18197 echo "Checking if your siginfo_t has si_pid field...">&4
18198 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18201 echo "Checking if your siginfo_t has si_uid field...">&4
18202 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18205 echo "Checking if your siginfo_t has si_addr field...">&4
18206 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18209 echo "Checking if your siginfo_t has si_status field...">&4
18210 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18213 echo "Checking if your siginfo_t has si_band field...">&4
18214 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18217 echo "Checking if your siginfo_t has si_value field...">&4
18218 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18221 echo "Checking if your siginfo_t has si_fd field...">&4
18222 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18227 d_siginfo_si_errno="$undef"
18228 d_siginfo_si_pid="$undef"
18229 d_siginfo_si_uid="$undef"
18230 d_siginfo_si_addr="$undef"
18231 d_siginfo_si_status="$undef"
18232 d_siginfo_si_band="$undef"
18233 d_siginfo_si_value="$undef"
18234 d_siginfo_si_fd="$undef"
18238 : see if this is a sunmath.h system
18239 set sunmath.h i_sunmath
18242 : see if signbit exists
18243 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18245 #$i_sunmath I_SUNMATH
18247 #ifdef I_SUNMATH /* Solaris special math library */
18248 # include <sunmath.h>
18251 int main(int argc, char **argv)
18255 if ((signbit(x) == 0) && (signbit(y) != 0))
18263 if eval $compile; then
18264 if $run ./try; then
18268 $echo "Signbit seems to be available, but doesn't work as I expected."
18269 $echo "I won't use it." >&4
18280 : see if sigprocmask exists
18281 set sigprocmask d_sigprocmask
18284 : see if sigsetjmp exists
18286 case "$d_sigsetjmp" in
18289 #include <setjmp.h>
18290 #$i_stdlib I_STDLIB
18292 #include <stdlib.h>
18298 if (sigsetjmp(env,1))
18301 siglongjmp(env, 1);
18306 if eval $compile; then
18307 if $run ./try >/dev/null 2>&1; then
18308 echo "POSIX sigsetjmp found." >&4
18312 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18318 echo "sigsetjmp not found." >&4
18322 *) val="$d_sigsetjmp"
18323 case "$d_sigsetjmp" in
18324 $define) echo "POSIX sigsetjmp found." >&4;;
18325 $undef) echo "sigsetjmp not found." >&4;;
18333 : see if sockatmark exists
18334 set sockatmark d_sockatmark
18337 : see if prototype for sockatmark is available
18339 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18342 : see if socks5_init exists
18343 set socks5_init d_socks5_init
18346 : see if srand48_r exists
18347 set srand48_r d_srand48_r
18349 case "$d_srand48_r" in
18351 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18352 case "$d_srand48_r_proto:$usethreads" in
18353 ":define") d_srand48_r_proto=define
18354 set d_srand48_r_proto srand48_r $hdrs
18358 case "$d_srand48_r_proto" in
18360 case "$srand48_r_proto" in
18361 ''|0) try='int srand48_r(long, struct drand48_data*);'
18362 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18364 case "$srand48_r_proto" in
18365 ''|0) d_srand48_r=undef
18367 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18368 * ) case "$srand48_r_proto" in
18369 REENTRANT_PROTO*) ;;
18370 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18372 echo "Prototype: $try" ;;
18375 *) case "$usethreads" in
18376 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18383 *) srand48_r_proto=0
18387 : see if srandom_r exists
18388 set srandom_r d_srandom_r
18390 case "$d_srandom_r" in
18392 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18393 case "$d_srandom_r_proto:$usethreads" in
18394 ":define") d_srandom_r_proto=define
18395 set d_srandom_r_proto srandom_r $hdrs
18399 case "$d_srandom_r_proto" in
18401 case "$srandom_r_proto" in
18402 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18403 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18405 case "$srandom_r_proto" in
18406 ''|0) d_srandom_r=undef
18408 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18409 * ) case "$srandom_r_proto" in
18410 REENTRANT_PROTO*) ;;
18411 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18413 echo "Prototype: $try" ;;
18416 *) case "$usethreads" in
18417 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18424 *) srandom_r_proto=0
18428 : see if prototype for setresgid is available
18430 set d_sresgproto setresgid $i_unistd unistd.h
18433 : see if prototype for setresuid is available
18435 set d_sresuproto setresuid $i_unistd unistd.h
18438 : see if stat exists
18442 : see if sys/stat.h is available
18443 set sys/stat.h i_sysstat
18446 : see if stat knows about block sizes
18448 echo "Checking to see if your struct stat has st_blocks field..." >&4
18449 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18452 : see if this is a sys/vfs.h system
18453 set sys/vfs.h i_sysvfs
18456 : see if this is a sys/statfs.h system
18457 set sys/statfs.h i_sysstatfs
18460 : Check for statfs_s
18462 echo "Checking to see if your system supports struct statfs..." >&4
18463 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
18465 case "$d_statfs_s" in
18466 "$define") echo "Yes, it does." ;;
18467 *) echo "No, it doesn't." ;;
18471 : see if struct statfs knows about f_flags
18472 case "$d_statfs_s" in
18475 echo "Checking to see if your struct statfs has f_flags field..." >&4
18476 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
18480 set d_statfs_f_flags
18484 case "$d_statfs_f_flags" in
18485 "$define") echo "Yes, it does." ;;
18486 *) echo "No, it doesn't." ;;
18489 : see what flavor, if any, of static inline is supported
18491 echo "Checking to see if your system supports static inline..."
18492 $cat > try.c <<'EOCP'
18493 #include <stdlib.h>
18494 extern int f_via_a(int x);
18495 extern int f_via_b(int x);
18496 int main(int argc, char **argv)
18505 return EXIT_SUCCESS;
18508 return EXIT_FAILURE;
18512 $cat > a.c <<'EOCP'
18513 static INLINE int f(int x) {
18524 $cat > b.c <<'EOCP'
18525 extern int f(int x);
18533 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18534 case "$perl_static_inline" in
18535 '') # Check the various possibilities, and break out on success.
18536 # For gcc, prefer __inline__, which will still permit
18537 # cflags.SH to add in -ansi.
18538 case "$gccversion" in
18539 '') xxx="inline __inline__ __inline _inline";;
18540 *) xxx="__inline__ inline __inline _inline";;
18542 for inline in $xxx; do
18543 set try -DINLINE=$inline a.c
18544 if eval $compile && $run ./try; then
18545 # Now make sure there is no external linkage of static
18547 set try -DINLINE=$inline -DUSE_B a.c b.c
18548 if eval $compile && $run ./try; then
18549 $echo "Your compiler supports static $inline, " >&4
18550 $echo "but it also creates an external definition," >&4
18551 $echo "so I won't use it." >&4
18554 $echo "Your compiler supports static $inline." >&4
18556 perl_static_inline="static $inline";
18560 $echo "Your compiler does NOT support static $inline." >&4
18565 *inline*) # Some variant of inline exists.
18566 echo "Keeping your $hint value of $perl_static_inline."
18569 static) # No inline capabilities
18570 echo "Keeping your $hint value of $perl_static_inline."
18573 *) # Unrecognized previous value -- blindly trust the supplied
18574 # value and hope it makes sense. Use old value for
18575 # d_static_inline, if there is one.
18576 echo "Keeping your $hint value of $perl_static_inline."
18577 case "$d_static_inline" in
18579 *) val=$d_static_inline ;;
18583 # Fallback to plain 'static' if nothing worked.
18584 case "$perl_static_inline" in
18586 perl_static_inline="static"
18590 set d_static_inline
18592 $rm -f a.[co] b.[co]
18595 : Check stream access
18597 Checking how to access stdio streams by file descriptor number...
18599 case "$stdio_stream_array" in
18600 '') $cat >try.c <<EOCP
18603 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18607 for s in _iob __iob __sF
18609 set try -DSTDIO_STREAM_ARRAY=$s
18610 if eval $compile; then
18611 case "`$run ./try`" in
18612 yes) stdio_stream_array=$s; break ;;
18618 case "$stdio_stream_array" in
18620 I can't figure out how to access stdio streams by file descriptor number.
18622 d_stdio_stream_array="$undef"
18625 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18627 d_stdio_stream_array="$define"
18631 : see if strcoll exists
18632 set strcoll d_strcoll
18635 : see if strerror_l exists
18636 set strerror_l d_strerror_l
18639 : see if strerror_r exists
18640 set strerror_r d_strerror_r
18642 case "$d_strerror_r" in
18644 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18645 case "$d_strerror_r_proto:$usethreads" in
18646 ":define") d_strerror_r_proto=define
18647 set d_strerror_r_proto strerror_r $hdrs
18651 case "$d_strerror_r_proto" in
18653 case "$strerror_r_proto" in
18654 ''|0) try='int strerror_r(int, char*, size_t);'
18655 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18657 case "$strerror_r_proto" in
18658 ''|0) try='int strerror_r(int, char*, int);'
18659 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18661 case "$strerror_r_proto" in
18662 ''|0) try='char* strerror_r(int, char*, size_t);'
18663 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18665 case "$strerror_r_proto" in
18666 ''|0) d_strerror_r=undef
18668 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18669 * ) case "$strerror_r_proto" in
18670 REENTRANT_PROTO*) ;;
18671 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18673 echo "Prototype: $try" ;;
18676 *) case "$usethreads" in
18677 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18684 *) strerror_r_proto=0
18688 : see if strftime exists
18689 set strftime d_strftime
18692 : see if strlcat exists
18693 set strlcat d_strlcat
18696 : see if strlcpy exists
18697 set strlcpy d_strlcpy
18700 : see if strnlen exists
18701 set strnlen d_strnlen
18704 : see if strtod exists
18705 set strtod d_strtod
18708 : see if strtol exists
18709 set strtol d_strtol
18712 : see if strtold exists
18713 set strtold d_strtold
18716 : see if strtold_l exists
18717 set strtold_l d_strtold_l
18720 : see if strtoll exists
18721 set strtoll d_strtoll
18724 case "$d_longlong-$d_strtoll" in
18727 Checking whether your strtoll() works okay...
18729 $cat >try.c <<'EOCP'
18732 #define strtoll __strtoll
18735 #define strtoll _strtoll
18738 extern long long int strtoll(char *s, char **, int);
18739 static int bad = 0;
18740 int check(char *s, long long ell, int een) {
18743 gll = strtoll(s, 0, 10);
18744 if (!((gll == ell) && (errno == een)))
18748 check(" 1", 1LL, 0);
18749 check(" 0", 0LL, 0);
18750 check("-1", -1LL, 0);
18751 check("-9223372036854775808", -9223372036854775808LL, 0);
18752 check("-9223372036854775808", -9223372036854775808LL, 0);
18753 check(" 9223372036854775807", 9223372036854775807LL, 0);
18754 check("-9223372036854775808", -9223372036854775808LL, 0);
18755 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18756 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18762 if eval $compile; then
18765 ok) echo "Your strtoll() seems to be working okay." ;;
18767 Your strtoll() doesn't seem to be working okay.
18773 echo "(I can't seem to compile the test program--assuming it doesn't)"
18779 : see if strtoq exists
18780 set strtoq d_strtoq
18783 : see if strtoul exists
18784 set strtoul d_strtoul
18787 case "$d_strtoul" in
18790 Checking whether your strtoul() works okay...
18792 $cat >try.c <<'EOCP'
18795 extern unsigned long int strtoul(char *s, char **, int);
18796 static int bad = 0;
18797 void check(char *s, unsigned long eul, int een) {
18800 gul = strtoul(s, 0, 10);
18801 if (!((gul == eul) && (errno == een)))
18805 check(" 1", 1L, 0);
18806 check(" 0", 0L, 0);
18808 case "$longsize" in
18810 $cat >>try.c <<'EOCP'
18811 check("18446744073709551615", 18446744073709551615UL, 0);
18812 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18813 #if 0 /* strtoul() for /^-/ strings is undefined. */
18814 check("-1", 18446744073709551615UL, 0);
18815 check("-18446744073709551614", 2, 0);
18816 check("-18446744073709551615", 1, 0);
18817 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18818 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18823 $cat >>try.c <<'EOCP'
18824 check("4294967295", 4294967295UL, 0);
18825 check("4294967296", 4294967295UL, ERANGE);
18826 #if 0 /* strtoul() for /^-/ strings is undefined. */
18827 check("-1", 4294967295UL, 0);
18828 check("-4294967294", 2, 0);
18829 check("-4294967295", 1, 0);
18830 check("-4294967296", 4294967295UL, ERANGE);
18831 check("-4294967297", 4294967295UL, ERANGE);
18836 : Should we write these tests to be more portable by sprintf-ing
18837 : ~0 and then manipulating that char string as input for strtol?
18840 $cat >>try.c <<'EOCP'
18847 if eval $compile; then
18848 case "`$run ./try`" in
18849 ok) echo "Your strtoul() seems to be working okay." ;;
18851 Your strtoul() doesn't seem to be working okay.
18857 echo "(I can't seem to compile the test program--assuming it doesn't)"
18863 : see if strtoull exists
18864 set strtoull d_strtoull
18867 case "$d_longlong-$d_strtoull" in
18870 Checking whether your strtoull() works okay...
18872 $cat >try.c <<'EOCP'
18875 #define strtoull __strtoull
18878 extern unsigned long long int strtoull(char *s, char **, int);
18879 static int bad = 0;
18880 int check(char *s, long long eull, int een) {
18883 gull = strtoull(s, 0, 10);
18884 if (!((gull == eull) && (errno == een)))
18888 check(" 1", 1LL, 0);
18889 check(" 0", 0LL, 0);
18890 check("18446744073709551615", 18446744073709551615ULL, 0);
18891 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18892 #if 0 /* strtoull() for /^-/ strings is undefined. */
18893 check("-1", 18446744073709551615ULL, 0);
18894 check("-18446744073709551614", 2LL, 0);
18895 check("-18446744073709551615", 1LL, 0);
18896 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18897 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18904 if eval $compile; then
18905 case "`$run ./try`" in
18906 ok) echo "Your strtoull() seems to be working okay." ;;
18908 Your strtoull() doesn't seem to be working okay.
18910 d_strtoull="$undef"
18914 echo "(I can't seem to compile the test program--assuming it doesn't)"
18915 d_strtoull="$undef"
18920 : see if strtouq exists
18921 set strtouq d_strtouq
18924 case "$d_strtouq" in
18927 Checking whether your strtouq() works okay...
18929 $cat >try.c <<'EOCP'
18932 extern unsigned long long int strtouq(char *s, char **, int);
18933 static int bad = 0;
18934 void check(char *s, unsigned long long eull, int een) {
18935 unsigned long long gull;
18937 gull = strtouq(s, 0, 10);
18938 if (!((gull == eull) && (errno == een)))
18942 check(" 1", 1LL, 0);
18943 check(" 0", 0LL, 0);
18944 check("18446744073709551615", 18446744073709551615ULL, 0);
18945 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18946 #if 0 /* strtouq() for /^-/ strings is undefined. */
18947 check("-1", 18446744073709551615ULL, 0);
18948 check("-18446744073709551614", 2LL, 0);
18949 check("-18446744073709551615", 1LL, 0);
18950 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18951 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18959 if eval $compile; then
18960 case "`$run ./try`" in
18961 ok) echo "Your strtouq() seems to be working okay." ;;
18963 Your strtouq() doesn't seem to be working okay.
18969 echo "(I can't seem to compile the test program--assuming it doesn't)"
18975 : see if strxfrm exists
18976 set strxfrm d_strxfrm
18979 : see if symlink exists
18980 set symlink d_symlink
18983 : see if syscall exists
18984 set syscall d_syscall
18987 : see if prototype for syscall is available
18989 set d_syscallproto syscall $i_unistd unistd.h
18992 : see if sysconf exists
18993 set sysconf d_sysconf
18996 : see if sys_errlist[] exists
18998 if test "X$d_syserrlst" = X; then
18999 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19000 echo "You have sys_errlist[], so we could roll our own strerror."
19001 d_syserrlst="$define"
19003 echo "You don't have sys_errlist[], so strerror() is welcome."
19004 d_syserrlst="$undef"
19008 : see if system exists
19009 set system d_system
19012 : see if tcgetpgrp exists
19013 set tcgetpgrp d_tcgetpgrp
19016 : see if tcsetpgrp exists
19017 set tcsetpgrp d_tcsetpgrp
19020 : see if prototype for telldir is available
19022 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19025 : see if tgamma exists
19026 set tgamma d_tgamma
19029 : check for thread_safe_nl_langinfo_l item
19032 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19035 #$i_stdlib I_STDLIB
19037 # include <stdlib.h>
19039 #include <string.h>
19040 #$i_langinfo I_LANGINFO
19042 # include <langinfo.h>
19044 #$i_pthread I_PTHREAD
19046 # include <pthread.h>
19048 #$i_locale I_LOCALE
19050 # include <locale.h>
19054 thread_start(void * arg)
19056 nl_langinfo(RADIXCHAR);
19060 char * main_buffer;
19061 char save_main_buffer[1000];
19062 pthread_t subthread;
19063 pthread_attr_t attr;
19065 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19067 /* If too large for our generous allowance, just assume we don't have
19069 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19073 strcpy(save_main_buffer, main_buffer);
19075 if (pthread_attr_init(&attr) != 0) {
19079 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19083 if (pthread_join(subthread, NULL) != 0) {
19087 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19090 case "$usethreads" in
19093 if eval $compile; then
19094 echo "Your system has nl_langinfo_l()..." >&4
19095 if $run ./try; then
19096 echo "and it is thread-safe (just as I'd hoped)." >&4
19097 d_thread_safe_nl_langinfo_l="$define"
19098 echo "$d_thread_safe_nl_langinfo_l" >&4
19100 echo "but it isn't thread-safe, so we won't use it." >&4
19103 echo "your system does not have nl_langinfo_l()" >&4
19106 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19108 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19109 d_thread_safe_nl_langinfo_l="$undef"
19113 : see if time exists
19115 if test "X$d_time" = X -o X"$timetype" = X; then
19116 if set time val -f d_time; eval $csym; $val; then
19117 echo 'time() found.' >&4
19119 rp="What is the type returned by time() on this system?"
19120 set time_t timetype long stdio.h sys/types.h
19123 echo 'time() not found, hope that will do.' >&4
19131 : see if timegm exists
19132 set timegm d_timegm
19135 : see if this is a sys/times.h system
19136 set sys/times.h i_systimes
19139 : see if times exists
19141 if set times val -f d_times; eval $csym; $val; then
19142 echo 'times() found.' >&4
19145 case "$i_systimes" in
19146 "$define") inc='sys/times.h';;
19148 rp="What is the type returned by times() on this system?"
19149 set clock_t clocktype long stdio.h sys/types.h $inc
19152 echo 'times() NOT found, hope that will do.' >&4
19157 : see if tmpnam_r exists
19158 set tmpnam_r d_tmpnam_r
19160 case "$d_tmpnam_r" in
19162 hdrs="$i_systypes sys/types.h define stdio.h "
19163 case "$d_tmpnam_r_proto:$usethreads" in
19164 ":define") d_tmpnam_r_proto=define
19165 set d_tmpnam_r_proto tmpnam_r $hdrs
19169 case "$d_tmpnam_r_proto" in
19171 case "$tmpnam_r_proto" in
19172 ''|0) try='char* tmpnam_r(char*);'
19173 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19175 case "$tmpnam_r_proto" in
19176 ''|0) d_tmpnam_r=undef
19178 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19179 * ) case "$tmpnam_r_proto" in
19180 REENTRANT_PROTO*) ;;
19181 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19183 echo "Prototype: $try" ;;
19186 *) case "$usethreads" in
19187 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19194 *) tmpnam_r_proto=0
19198 : see if trunc exists
19202 : see if truncate exists
19203 set truncate d_truncate
19206 : see if ttyname_r exists
19207 set ttyname_r d_ttyname_r
19209 case "$d_ttyname_r" in
19211 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19212 case "$d_ttyname_r_proto:$usethreads" in
19213 ":define") d_ttyname_r_proto=define
19214 set d_ttyname_r_proto ttyname_r $hdrs
19218 case "$d_ttyname_r_proto" in
19220 case "$ttyname_r_proto" in
19221 ''|0) try='int ttyname_r(int, char*, size_t);'
19222 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19224 case "$ttyname_r_proto" in
19225 ''|0) try='int ttyname_r(int, char*, int);'
19226 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19228 case "$ttyname_r_proto" in
19229 ''|0) try='char* ttyname_r(int, char*, int);'
19230 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19232 case "$ttyname_r_proto" in
19233 ''|0) d_ttyname_r=undef
19235 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19236 * ) case "$ttyname_r_proto" in
19237 REENTRANT_PROTO*) ;;
19238 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19240 echo "Prototype: $try" ;;
19243 *) case "$usethreads" in
19244 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19251 *) ttyname_r_proto=0
19255 : see if tzname[] exists
19257 if set tzname val -a d_tzname; eval $csym; $val; then
19259 echo 'tzname[] found.' >&4
19262 echo 'tzname[] NOT found.' >&4
19267 : Check if is a multiplatform env
19269 darwin) multiarch="$define" ;;
19271 case "$multiarch" in
19272 ''|[nN]*) multiarch="$undef" ;;
19275 : check for ordering of bytes in a UV
19277 case "$multiarch" in
19280 You seem to be doing a multiarchitecture build,
19281 skipping the byteorder check.
19287 case "$byteorder" in
19290 In the following, larger digits indicate more significance. A big-endian
19291 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19292 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19293 machines may have weird orders like 3412. A Cray will report 87654321,
19294 an Alpha will report 12345678. If the test program works the default is
19296 I'm now running the test program...
19300 #$i_stdlib I_STDLIB
19302 #include <stdlib.h>
19304 #include <sys/types.h>
19305 typedef $uvtype UV;
19315 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19317 u.l = (UV)0x04030201;
19318 for (i = 0; i < $uvsize; i++)
19319 printf("%c", u.c[i]+'0');
19326 if eval $compile && $run ./try > /dev/null; then
19329 [1-4][1-4][1-4][1-4]|12345678|87654321)
19330 echo "(The test program ran ok.)"
19331 echo "byteorder=$dflt"
19334 ????|????????) echo "(The test program ran ok.)" ;;
19335 *) echo "(The test program didn't run right for some reason.)" ;;
19340 (I can't seem to compile the test program. Guessing big-endian...)
19343 case "$xxx_prompt" in
19345 rp="What is the order of bytes in $uvtype?"
19358 : Checking 32bit alignedness
19361 Checking to see whether you can access character data unalignedly...
19363 case "$d_u32align" in
19364 '') $cat >try.c <<EOCP
19366 #$i_stdlib I_STDLIB
19368 #include <stdlib.h>
19370 #define U32 $u32type
19371 #define BYTEORDER 0x$byteorder
19373 #include <signal.h>
19375 $signal_t bletch(int s) { exit(4); }
19378 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19379 volatile U8 buf[8];
19383 if (sizeof(U32) != 4) {
19384 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19391 signal(SIGBUS, bletch);
19403 for (i = 0; i < 4; i++) {
19404 up = (U32*)(buf + i);
19405 if (! ((*up == 1 << (8*i)) || /* big-endian */
19406 (*up == 1 << (8*(3-i))) /* little-endian */
19410 printf("read failed (%x)\n", *up);
19416 for (i = 0; i < 4; i++) {
19417 up = (U32*)(buf + i);
19419 if (*up != 0xBeef) {
19420 printf("write failed (%x)\n", *up);
19434 if eval $compile_ok; then
19435 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19436 $run ./try 2>&1 >/dev/null
19439 You can access character data pretty unalignedly.
19441 d_u32align="$undef"
19444 It seems that you must access character data in an aligned manner.
19446 d_u32align="$define"
19450 rp='Can you access character data at unaligned addresses?'
19454 [yY]*) d_u32align="$undef" ;;
19455 *) d_u32align="$define" ;;
19462 : see if ualarm exists
19463 set ualarm d_ualarm
19466 : see if umask exists
19470 : see if unordered exists
19471 set unordered d_unordered
19474 : see if unsetenv exists
19475 set unsetenv d_unsetenv
19478 : see if usleep exists
19479 set usleep d_usleep
19482 : see if prototype for usleep is available
19484 set d_usleepproto usleep $i_unistd unistd.h
19487 : see if ustat exists
19491 : see if closedir exists
19492 set closedir d_closedir
19495 case "$d_closedir" in
19498 echo "Checking whether closedir() returns a status..." >&4
19500 #$i_dirent I_DIRENT /**/
19501 #$i_sysdir I_SYS_DIR /**/
19502 #$i_sysndir I_SYS_NDIR /**/
19503 #$i_systypes I_SYS_TYPES /**/
19505 #if defined(I_SYS_TYPES)
19506 #include <sys/types.h>
19508 #if defined(I_DIRENT)
19509 #include <dirent.h>
19512 #include <sys/ndir.h>
19515 #include <sys/dir.h>
19519 int main() { return closedir(opendir(".")); }
19522 if eval $compile_ok; then
19523 if $run ./try > /dev/null 2>&1 ; then
19524 echo "Yes, it does."
19527 echo "No, it doesn't."
19531 echo "(I can't seem to compile the test program--assuming it doesn't)"
19539 set d_void_closedir
19543 : see if there is a wait4
19547 : see if waitpid exists
19548 set waitpid d_waitpid
19553 $cat >try.c <<'EOCP'
19559 return (wcscmp (s, s) ? 1 : 0);
19564 if eval $compile; then
19567 0) echo "A working wcscmp() found." >&4
19569 *) echo "wcscmp() found, but it doesn't work" >&4
19573 echo "wcscmp() NOT found." >&4
19579 : see if wcstombs exists
19580 set wcstombs d_wcstombs
19585 $cat >try.c <<'EOCP'
19590 wchar_t dst[4], *src = L" ";
19592 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19597 if eval $compile; then
19600 0) echo "A working wcsxfrm() found." >&4
19602 *) echo "wcsxfrm() found, but it doesn't work" >&4
19606 echo "wcsxfrm() NOT found." >&4
19612 : see if wctomb exists
19613 set wctomb d_wctomb
19616 : see if writev exists
19617 set writev d_writev
19620 : check for alignment requirements
19622 case "$alignbytes" in
19623 '') echo "Checking alignment constraints..." >&4
19632 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19637 if eval $compile_ok; then
19641 echo "(I can't seem to compile the test program...)"
19643 case "$multiarch" in
19645 : The usual safe value is 8, but Darwin with -Duselongdouble
19646 : needs 16. Hence, we will take 8 as a minimum, but allow
19647 : Configure to pick a larger value if needed.
19648 if $test "$dflt" -lt 8; then
19650 echo "Setting alignment to 8 for multiarch support.">&4
19655 *) dflt="$alignbytes"
19658 rp="Doubles must be aligned on a how-many-byte boundary?"
19663 : set the base revision
19666 : length of character in bytes. Is always 1, otherwise it is not C
19667 : This used to be a test using sizeof
19670 : Check for the number of bits in a character
19671 case "$charbits" in
19672 '') echo "Checking how long a character is (in bits)..." >&4
19679 for (c = 1, n = 0; c; c <<= 1, n++) ;
19680 printf ("%d\n", n);
19685 if eval $compile_ok; then
19689 echo "(I can't seem to compile the test program. Guessing...)"
19696 rp="What is the length of a character (in bits)?"
19700 case "$charbits" in
19703 Your system has an unsigned character size of $charbits bits, which
19704 is rather unusual (normally it is 8 bits). Perl likely will not work
19705 correctly on your system, with subtle bugs in various places.
19707 rp='Do you really want to continue?'
19711 [yY]) echo >&4 "Okay, continuing." ;;
19716 : how do we concatenate cpp tokens here?
19718 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19719 $cat >cpp_stuff.c <<'EOCP'
19720 #define RCAT(a,b)a/**/b
19721 #define ACAT(a,b)a ## b
19725 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19726 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19727 echo "Oh! Smells like ANSI's been here." >&4
19728 echo "We can catify or stringify, separately or together!"
19730 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19731 echo "Ah, yes! The good old days!" >&4
19732 echo "However, in the good old days we don't know how to stringify and"
19733 echo "catify at the same time."
19737 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19738 You're going to have to edit the values of CAT[2-5] in config.h...
19740 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19744 : see if this is a db.h system
19750 : Check db version.
19752 echo "Checking Berkeley DB version ..." >&4
19758 #include <sys/types.h>
19760 #$i_stdlib I_STDLIB
19762 #include <stdlib.h>
19765 int main(int argc, char *argv[])
19767 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19768 int Major, Minor, Patch ;
19769 unsigned long Version ;
19770 (void)db_version(&Major, &Minor, &Patch) ;
19772 printf("%d %d %d %d %d %d\n",
19773 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19774 Major, Minor, Patch);
19777 printf("You have Berkeley DB Version 2 or greater.\n");
19779 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19780 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19781 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19782 Major, Minor, Patch) ;
19784 /* check that db.h & libdb are compatible */
19785 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19786 printf("db.h and libdb are incompatible.\n") ;
19790 printf("db.h and libdb are compatible.\n") ;
19792 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19793 + DB_VERSION_PATCH ;
19795 /* needs to be >= 2.3.4 */
19796 if (Version < 2003004) {
19797 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19798 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19804 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19809 printf("You have Berkeley DB Version 1.\n");
19810 exit(0); /* DB version < 2: the coast is clear. */
19812 exit(1); /* <db.h> not Berkeley DB? */
19818 if eval $compile_ok && $run ./try; then
19819 echo 'Looks OK.' >&4
19821 db_version_major=$1
19822 db_version_minor=$2
19823 db_version_patch=$3
19825 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19829 : Remove db from list of libraries to use
19830 echo "Removing unusable -ldb from library list" >&4
19831 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19834 echo "libs = $libs" >&4
19844 : Check the return type needed for hash
19846 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19852 #include <sys/types.h>
19855 #ifndef DB_VERSION_MAJOR
19856 u_int32_t hash_cb (const void* ptr, size_t size)
19862 info.hash = hash_cb;
19866 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19867 if $contains warning try.out >>/dev/null 2>&1 ; then
19870 db_hashtype='u_int32_t'
19873 : XXX Maybe we should just give up here.
19874 db_hashtype=u_int32_t
19876 echo "Help: I can't seem to compile the db test program." >&4
19877 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19880 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19882 *) db_hashtype=u_int32_t
19887 : Check the return type needed for prefix
19889 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19895 #include <sys/types.h>
19898 #ifndef DB_VERSION_MAJOR
19899 size_t prefix_cb (const DBT *key1, const DBT *key2)
19905 info.prefix = prefix_cb;
19909 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19910 if $contains warning try.out >>/dev/null 2>&1 ; then
19911 db_prefixtype='int'
19913 db_prefixtype='size_t'
19916 db_prefixtype='size_t'
19917 : XXX Maybe we should just give up here.
19919 echo "Help: I can't seem to compile the db test program." >&4
19920 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19923 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19925 *) db_prefixtype='size_t'
19929 : Include . in @INC
19932 Historically Perl has provided a final fallback of the current working
19933 directory '.' when searching for a library. This, however, can lead to
19934 problems when a Perl program which loads optional modules is called from
19935 a shared directory. This can lead to executing unexpected code.
19939 # When changing to exclude by default:
19940 case "$default_inc_excludes_dot" in
19941 $undef|false|[nN]*) dflt="n" ;;
19944 # To turn exclude off by default:
19945 #case "$default_inc_excludes_dot" in
19946 # $define|true|[yY]*) dflt="y" ;;
19950 rp='Exclude '.' from @INC by default? '
19953 [nN]|undef) default_inc_excludes_dot="$undef" ;;
19954 *) default_inc_excludes_dot="$define" ;;
19957 : Check what kind of inf/nan your system has
19958 $echo "Checking the kind of infinities and nans you have..." >&4
19959 $echo "(The following tests may crash. That's okay.)" >&4
19961 #define DOUBLESIZE $doublesize
19962 #$d_longdbl HAS_LONG_DOUBLE
19963 #ifdef HAS_LONG_DOUBLE
19964 #define LONG_DOUBLESIZE $longdblsize
19965 #define LONG_DOUBLEKIND $longdblkind
19968 #include <string.h>
19970 /* Note that whether the sign bit is on or off
19971 * for NaN depends on the CPU/FPU, and possibly
19972 * can be affected by the build toolchain.
19974 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
19975 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
19976 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
19977 * (respectively) as opposed to the more usual
19978 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
19980 * Pre-IEEE-754 floating point format do not even have inf/nan support
19981 * at all. They might have a "max" value (DBL_MAX), which may be deadly
19982 * to even mention, causing immediate SIGFPE or equivalent: this is
19983 * the case with VAX floating point, for example.
19985 static void bytes(void *v, unsigned int n) {
19986 unsigned char *p = (unsigned char *)v;
19988 for (i = 0; i < n; i++) {
19989 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
19992 int main(int argc, char *argv[]) {
19993 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
19994 * because some compilers are 'smart' and not only warn but refuse to
19995 * compile such 'illegal' values. */
19996 double dinf = exp(1e9);
19997 double dnan = sqrt(-1.0);
19998 #ifdef HAS_LONG_DOUBLE
19999 long double ldinf = (long double)exp(1e9);
20000 long double ldnan = (long double)sqrt(-1.0);
20001 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20002 /* the 80-bit long doubles might have garbage in their excess bytes */
20003 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20004 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20007 switch (argv[1][0]) {
20008 case '1': bytes(&dinf, sizeof(dinf)); break;
20009 case '2': bytes(&dnan, sizeof(dnan)); break;
20010 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20011 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20019 if eval $compile; then
20020 doubleinfbytes=`$run ./try 1`
20021 doublenanbytes=`$run ./try 2`
20022 case "$d_longdbl" in
20024 longdblinfbytes=`$run ./try 3`
20025 longdblnanbytes=`$run ./try 4`
20029 # Defaults in case the above test program failed.
20030 case "$doublekind" in
20031 1) # IEEE 754 32-bit LE
20032 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20033 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20035 2) # IEEE 754 32-bit BE
20036 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20037 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20039 3) # IEEE 754 64-bit LE
20040 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20041 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20043 4) # IEEE 754 64-bit BE
20044 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20045 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20047 5) # IEEE 754 128-bit LE
20048 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20049 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20051 6) # IEEE 754 128-bit BE
20052 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20053 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20055 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20056 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20057 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20059 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20060 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20061 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20063 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20064 doubleinfbytes=$undef
20065 doublenanbytes=$undef
20068 doubleinfbytes=$undef
20069 doublenanbytes=$undef
20072 case "$longdblkind" in
20073 1) # IEEE 754 128-bit LE
20074 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20075 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20077 2) # IEEE 754 128-bit BE
20078 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20079 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20081 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20082 case "$longdblsize" in
20083 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20084 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20085 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20088 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20089 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20092 longdblinfbytes=$undef
20093 longdblnanbytes=$undef
20097 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20098 case "$longdblsize" in
20099 12) # 32-bit system
20100 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20101 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20103 16) # 64-bit system
20104 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20105 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20108 longdblinfbytes=$undef
20109 longdblnanbytes=$undef
20113 5) # 128-bit LE-LE "double double"
20114 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20115 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20117 6) # 128-bit BE-BE "double double"
20118 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20119 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20121 7) # 128-bit LE-BE "double double"
20122 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20123 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20125 8) # 128-bit BE-LE "double double"
20126 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20127 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20129 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20130 longdblinfbytes=$undef
20131 longdblnanbytes=$undef
20134 longdblinfbytes=$undef
20135 longdblnanbytes=$undef
20139 # In case the program crashed the values are empty, turn them undef.
20140 case "$doubleinfbytes" in
20141 '') doubleinfbytes=$undef ;;
20143 case "$doublenanbytes" in
20144 '') doublenanbytes=$undef ;;
20146 case "$longdblinfbytes" in
20147 '') longdblinfbytes=$undef ;;
20149 case "$longdblnanbytes" in
20150 '') longdblnanbytes=$undef ;;
20154 : Check the length of the double mantissa
20155 $echo "Checking how many mantissa bits your doubles have..." >&4
20157 #$i_sunmath I_SUNMATH
20160 # include <sunmath.h>
20162 #ifdef DBL_MANT_DIG
20163 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20166 int main(int argc, char *argv[]) {
20168 printf("%d\n", BITS);
20174 if eval $compile; then
20175 doublemantbits=`$run ./try`
20177 doublemantbits="$undef"
20181 : Check the length of the longdouble mantissa
20182 $echo "Checking how many mantissa bits your long doubles have..." >&4
20184 #$i_sunmath I_SUNMATH
20187 # include <sunmath.h>
20189 #$d_longdbl HAS_LONG_DOUBLE
20190 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20191 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20192 /* This format has no implicit bit. Beware, however, that for
20193 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20194 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20195 * and the top bit must have been one since 387, zero is plain invalid.
20196 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20197 # define BITS LDBL_MANT_DIG
20198 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20199 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20200 * reason e.g. Irix thinks 107. But in any case, we want only
20201 * the number of real bits, the implicit bits are of no interest. */
20202 # define BITS 2 * (DBL_MANT_DIG - 1)
20204 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20208 int main(int argc, char *argv[]) {
20210 printf("%d\n", BITS);
20216 if eval $compile; then
20217 longdblmantbits=`$run ./try`
20219 longdblmantbits="$undef"
20223 : Check the length of the NV mantissa
20224 $echo "Checking how many mantissa bits your NVs have..." >&4
20225 if test "X$usequadmath" = "X$define"; then
20226 nvmantbits=112 # 128-1-15
20228 if test "X$nvsize" = "X$doublesize"; then
20229 nvmantbits="$doublemantbits"
20231 if test "X$nvsize" = "X$longdblsize"; then
20232 nvmantbits="$longdblmantbits"
20234 nvmantbits="$undef"
20239 : How can we generate normalized random numbers ?
20241 echo "Using our internal random number implementation..." >&4
20244 *-Dmy_rand=*|*-Dmy_srand=*)
20245 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20246 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20247 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20248 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20252 randfunc=Perl_drand48
20253 drand01="Perl_drand48()"
20254 seedfunc="Perl_drand48_init"
20258 : Probe whether dtrace builds an object, as newer Illumos requires an input
20259 : object file that uses at least one of the probes defined in the .d file
20260 case "$usedtrace" in
20262 case "$dtracexnolibs" in
20263 $define|true|[yY]*)
20264 dtracexnolibs=$define
20265 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20268 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20269 dtracexnolibs=$define
20270 echo "Your dtrace accepts -xnolibs"
20271 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20272 dtracexnolibs=$undef
20273 echo "Your dtrace doesn't accept -xnolibs"
20275 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20280 dtracexnolibs=$undef
20281 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20284 case $dtracexnolibs in
20285 $define) xnolibs=-xnolibs ;;
20289 case "$dtraceobject" in
20290 $define|true|[yY]*)
20291 dtraceobject=$define
20295 #include "perldtrace.h"
20297 PERL_LOADED_FILE("dummy");
20301 dtraceobject=$undef
20302 if $cc -c -o try.o $optimize $ccflags try.c \
20303 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20304 dtraceobject=$define
20305 echo "Your dtrace builds an object file"
20308 *) dtraceobject=$undef ;;
20310 $rm_try perldtrace.o perldtrace.h
20313 : Determine if this is an EBCDIC system
20315 echo "Determining whether or not we are on an EBCDIC system..." >&4
20316 $cat >try.c <<'EOM'
20319 if ('M'==0xd4) return 0;
20326 if eval $compile_ok; then
20327 if $run ./try; then
20328 echo "You seem to speak EBCDIC." >&4
20331 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20334 echo "I'm unable to compile the test program." >&4
20335 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20341 : Check how to flush
20344 Checking how to flush all pending stdio output...
20346 # I only know how to find the first 32 possibly open files on SunOS.
20347 # See also hints/sunos_4_1.sh and util.c --AD
20349 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20351 $cat >>try.c <<EOCP
20353 #$i_stdlib I_STDLIB
20355 #include <stdlib.h>
20357 #$i_unistd I_UNISTD
20359 # include <unistd.h>
20361 #$d_sysconf HAS_SYSCONF
20362 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20363 #ifdef HAS_STDIO_STREAM_ARRAY
20364 # define STDIO_STREAM_ARRAY $stdio_stream_array
20369 p = fopen("try.out", "w");
20373 # ifdef TRY_FPRINTF
20377 #ifdef TRY_FFLUSH_NULL
20380 #ifdef TRY_FFLUSH_ALL
20382 long open_max = -1;
20383 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20384 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20386 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20387 open_max = sysconf(_SC_OPEN_MAX);
20390 open_max = FOPEN_MAX;
20393 open_max = OPEN_MAX;
20402 # ifdef HAS_STDIO_STREAM_ARRAY
20403 if (open_max > 0) {
20405 for (i = 0; i < open_max; i++)
20406 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20407 STDIO_STREAM_ARRAY[i]._file < open_max &&
20408 STDIO_STREAM_ARRAY[i]._flag)
20409 fflush(&STDIO_STREAM_ARRAY[i]);
20417 : first we have to find out how _not_ to flush
20419 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20421 set try -DTRY_FPUTC
20422 if eval $compile; then
20423 $run ./try 2>/dev/null
20426 if $test ! -s try.out -a "X$code" = X42; then
20432 set try -DTRY_FPRINTF
20433 if eval $compile; then
20434 $run ./try 2>/dev/null
20437 if $test ! -s try.out -a "X$code" = X42; then
20438 output=-DTRY_FPRINTF
20444 : check for fflush NULL behavior
20445 case "$fflushNULL" in
20446 '') set try -DTRY_FFLUSH_NULL $output
20447 if eval $compile; then
20448 $run ./try 2>/dev/null
20451 if $test -s try.out -a "X$code" = X42; then
20452 fflushNULL="`$cat try.out`"
20454 if $test "X$code" != X42; then
20456 (If this test failed, don't worry, we'll try another method shortly.)
20461 $rm -f core try.core core.try.*
20462 case "$fflushNULL" in
20464 Your fflush(NULL) works okay for output streams.
20465 Let's see if it clobbers input pipes...
20467 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20468 # bug that improperly flushes the input end of pipes. So we avoid the
20469 # autoflush on fork/system/exec support for now. :-(
20470 $cat >tryp.c <<EOCP
20473 main(int argc, char **argv)
20479 while ((i = getc(stdin)) != -1
20480 && (*bp++ = i) != '\n'
20481 && bp < &buf[1024])
20484 fprintf(stdout, "%s", buf);
20492 fflushNULL="$define"
20494 if eval $compile; then
20496 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20497 if $test "X$targethost" != X; then
20500 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20502 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20504 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20506 fflush(NULL) seems to behave okay with input streams.
20508 fflushNULL="$define"
20511 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20513 fflushNULL="$undef"
20516 $rm -f core tryp.c tryp.core core.tryp.*
20519 Your fflush(NULL) isn't working (contrary to ANSI C).
20521 fflushNULL="$undef"
20524 Cannot figure out whether your fflush(NULL) works or not.
20525 I'm assuming it doesn't (contrary to ANSI C).
20527 fflushNULL="$undef"
20531 $define|true|[yY]*)
20532 fflushNULL="$define"
20535 fflushNULL="$undef"
20538 : check explicit looping only if NULL did not work, and if the pipe
20539 : bug does not show up on an explicit flush too
20540 case "$fflushNULL" in
20542 $cat >tryp.c <<EOCP
20545 main(int argc, char **argv)
20551 while ((i = getc(stdin)) != -1
20552 && (*bp++ = i) != '\n'
20553 && bp < &buf[1024])
20556 fprintf(stdout, "%s", buf);
20565 if eval $compile; then
20567 if $test "X$targethost" != X; then
20570 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20572 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20574 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20576 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20578 : now check for fflushall behaviour
20579 case "$fflushall" in
20580 '') set try -DTRY_FFLUSH_ALL $output
20581 if eval $compile; then
20583 (Now testing the other method--but note that this also may fail.)
20585 $run ./try 2>/dev/null
20588 if $test -s try.out -a "X$code" = X42; then
20589 fflushall="`$cat try.out`"
20593 case "$fflushall" in
20595 Whew. Flushing explicitly all the stdio streams works.
20597 fflushall="$define"
20600 Sigh. Flushing explicitly all the stdio streams doesn't work.
20605 Cannot figure out whether flushing stdio streams explicitly works or not.
20606 I'm assuming it doesn't.
20612 "$define"|true|[yY]*)
20613 fflushall="$define"
20621 All is futile. Even fflush(stdin) clobbers input pipes!
20628 $rm -f core tryp.c tryp.core core.tryp.*
20630 *) fflushall="$undef"
20634 case "$fflushNULL$fflushall" in
20637 OK, I give up. I cannot figure out how to flush pending stdio output.
20638 We won't be flushing handles at all before fork/exec/popen.
20644 : Store the full pathname to the ar program for use in the C program
20645 : Respect a hint or command line value for full_ar.
20650 : Store the full pathname to the sed program for use in the C program
20653 : see what type gids are declared as in the kernel
20655 echo "Looking for the type for group ids returned by getgid()."
20656 set gid_t gidtype xxx stdio.h sys/types.h
20660 xxx=`./findhdr sys/user.h`
20661 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20663 unsigned) dflt="$1 $2" ;;
20667 *) dflt="$gidtype";;
20670 gid_t) echo "gid_t found." ;;
20671 *) rp="What is the type for group ids returned by getgid()?"
20677 : Check the size of GID
20680 *_t) zzz="$gidtype" ;;
20683 echo "Checking the size of $zzz..." >&4
20685 #include <sys/types.h>
20687 #$i_stdlib I_STDLIB
20689 #include <stdlib.h>
20692 printf("%d\n", (int)sizeof($gidtype));
20697 if eval $compile_ok; then
20701 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20704 echo "Your $zzz is $gidsize bytes long."
20709 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20713 : Check if GID is signed
20716 *_t) zzz="$gidtype" ;;
20719 echo "Checking the sign of $zzz..." >&4
20721 #include <sys/types.h>
20732 if eval $compile; then
20736 echo "(I can't execute the test program--guessing unsigned.)" >&4
20740 1) echo "Your $zzz is unsigned." ;;
20741 -1) echo "Your $zzz is signed." ;;
20747 echo "(I can't compile the test program--guessing unsigned.)" >&4
20751 : Check 64bit sizes
20754 if $test X"$quadtype" != X; then
20756 echo "Checking how to print 64-bit integers..." >&4
20758 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20759 $cat >try.c <<'EOCP'
20760 #include <sys/types.h>
20763 int q = 12345678901;
20764 printf("%ld\n", q);
20768 if eval $compile; then
20772 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20773 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20774 echo "We will use %d."
20780 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20781 $cat >try.c <<'EOCP'
20782 #include <sys/types.h>
20785 long q = 12345678901;
20786 printf("%ld\n", q);
20790 if eval $compile; then
20794 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20795 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20796 echo "We will use %ld."
20802 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20803 $cat >try.c <<'EOCP'
20804 #include <sys/types.h>
20805 #include <inttypes.h>
20808 int64_t q = 12345678901;
20809 printf("%" PRId64 "\n", q);
20813 if eval $compile; then
20817 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20818 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20819 echo "We will use the C9X style."
20825 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20827 #include <sys/types.h>
20830 $quadtype q = 12345678901;
20831 printf("%Ld\n", q);
20835 if eval $compile; then
20839 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20840 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20841 echo "We will use %Ld."
20847 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20848 $cat >try.c <<'EOCP'
20849 #include <sys/types.h>
20852 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20853 printf("%lld\n", q);
20857 if eval $compile; then
20861 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20862 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20863 echo "We will use the %lld style."
20869 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20871 #include <sys/types.h>
20874 $quadtype q = 12345678901;
20875 printf("%qd\n", q);
20879 if eval $compile; then
20883 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20884 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20885 echo "We will use %qd."
20891 if $test X"$sPRId64" = X; then
20892 echo "Cannot figure out how to print 64-bit integers." >&4
20899 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20900 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20902 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20903 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20907 : Check format strings for internal types
20909 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20911 if $test X"$ivsize" = X8; then
20912 ivdformat="$sPRId64"
20913 uvuformat="$sPRIu64"
20914 uvoformat="$sPRIo64"
20915 uvxformat="$sPRIx64"
20916 uvXUformat="$sPRIXU64"
20918 if $test X"$ivsize" = X"$longsize"; then
20925 if $test X"$ivsize" = X"$intsize"; then
20933 if $test X"$ivsize" = X"$shortsize"; then
20944 if $test X"$usequadmath" = X"$define"; then
20952 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20953 nveformat="$sPRIeldbl"
20954 nvfformat="$sPRIfldbl"
20955 nvgformat="$sPRIgldbl"
20956 nvEUformat="$sPRIEUldbl"
20957 nvFUformat="$sPRIFUldbl"
20958 nvGUformat="$sPRIGUldbl"
20969 case "$ivdformat" in
20970 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20975 : Check format string for GID
20978 $echo "Checking the format string to be used for gids..." >&4
20981 -1) if $test X"$gidsize" = X"$ivsize"; then
20982 gidformat="$ivdformat"
20984 if $test X"$gidsize" = X"$longsize"; then
20987 if $test X"$gidsize" = X"$intsize"; then
20990 if $test X"$gidsize" = X"$shortsize"; then
20997 *) if $test X"$gidsize" = X"$uvsize"; then
20998 gidformat="$uvuformat"
21000 if $test X"$gidsize" = X"$longsize"; then
21003 if $test X"$gidsize" = X"$intsize"; then
21006 if $test X"$gidsize" = X"$shortsize"; then
21015 : see if getgroups exists
21016 set getgroups d_getgrps
21019 : see if setgroups exists
21020 set setgroups d_setgrps
21023 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21025 case "$d_getgrps$d_setgrps" in
21027 case "$groupstype" in
21028 '') dflt="$gidtype" ;;
21029 *) dflt="$groupstype" ;;
21032 What type of pointer is the second argument to getgroups() and setgroups()?
21033 Usually this is the same as group ids, $gidtype, but not always.
21036 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21040 *) groupstype="$gidtype";;
21043 : check whether make sets MAKE
21045 echo "Checking if your $make program sets \$(MAKE)..." >&4
21046 case "$make_set_make" in
21048 $sed 's/^X //' > testmake.mak << 'EOF'
21050 X @echo 'maketemp="$(MAKE)"'
21052 case "`$make -f testmake.mak 2>/dev/null`" in
21053 *maketemp=*) make_set_make='#' ;;
21054 *) make_set_make="MAKE=$make" ;;
21056 $rm -f testmake.mak
21059 case "$make_set_make" in
21060 '#') echo "Yup, it does.";;
21061 *) echo "Nope, it doesn't.";;
21064 : see what type is used for mode_t
21065 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21066 set mode_t modetype int stdio.h sys/types.h
21069 : see if we need va_copy
21072 #include <stdarg.h>
21074 #include <stdlib.h>
21075 #include <signal.h>
21078 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21080 return vfprintf(f, fmt, *valp);
21084 myvfprintf(FILE *f, const char *fmt, va_list val)
21086 return ivfprintf(f, fmt, &val);
21090 myprintf(char *fmt, ...)
21093 va_start(val, fmt);
21094 return myvfprintf(stdout, fmt, val);
21098 main(int ac, char **av)
21100 signal(SIGSEGV, exit);
21102 myprintf("%s%cs all right, then\n", "that", '\'');
21107 if eval $compile && $run ./try 2>&1 >/dev/null; then
21108 case "`$run ./try`" in
21109 "that's all right, then")
21115 yes) echo "It seems that you don't need va_copy()." >&4
21116 need_va_copy="$undef"
21118 *) echo "It seems that va_copy() or similar will be needed." >&4
21119 need_va_copy="$define"
21124 : see what type is used for size_t
21125 rp="What is the type used for the length parameter for string functions?"
21126 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21129 : check for type of arguments to gethostbyaddr.
21130 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21131 case "$d_gethbyaddr" in
21135 Checking to see what type of arguments are accepted by gethostbyaddr().
21137 hdrs="$define sys/types.h
21138 $d_socket sys/socket.h
21139 $i_niin netinet/in.h
21141 $i_unistd unistd.h"
21142 : The first arg can 'char *' or 'void *'
21143 : The second arg is some of integral type
21144 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21145 for yyy in size_t long int; do
21146 case "$netdb_host_type" in
21147 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21148 if ./protochk "$try" $hdrs; then
21149 echo "Your system accepts $xxx for the first arg."
21150 echo "...and $yyy for the second arg."
21151 netdb_host_type="$xxx"
21152 netdb_hlen_type="$yyy"
21158 : In case none of those worked, prompt the user.
21159 case "$netdb_host_type" in
21160 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21163 netdb_host_type=$ans
21164 rp='What is the type for the 2nd argument to gethostbyaddr?'
21167 netdb_hlen_type=$ans
21171 *) : no gethostbyaddr, so pick harmless defaults
21172 netdb_host_type='char *'
21173 netdb_hlen_type="$sizetype"
21176 # Remove the "const" if needed. -- but then we'll have a
21178 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21181 : check for type of argument to gethostbyname.
21182 if test "X$netdb_name_type" = X ; then
21183 case "$d_gethbyname" in
21187 Checking to see what type of argument is accepted by gethostbyname().
21189 hdrs="$define sys/types.h
21190 $d_socket sys/socket.h
21191 $i_niin netinet/in.h
21193 $i_unistd unistd.h"
21194 for xxx in "const char *" "char *"; do
21195 case "$netdb_name_type" in
21196 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21197 if ./protochk "$try" $hdrs; then
21198 echo "Your system accepts $xxx."
21199 netdb_name_type="$xxx"
21204 : In case none of those worked, prompt the user.
21205 case "$netdb_name_type" in
21206 '') rp='What is the type for the 1st argument to gethostbyname?'
21209 netdb_name_type=$ans
21213 *) : no gethostbyname, so pick harmless default
21214 netdb_name_type='char *'
21219 : check for type of 1st argument to getnetbyaddr.
21220 if test "X$netdb_net_type" = X ; then
21221 case "$d_getnbyaddr" in
21225 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21227 hdrs="$define sys/types.h
21228 $d_socket sys/socket.h
21229 $i_niin netinet/in.h
21231 $i_unistd unistd.h"
21232 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21233 case "$netdb_net_type" in
21234 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21235 if ./protochk "$try" $hdrs; then
21236 echo "Your system accepts $xxx."
21237 netdb_net_type="$xxx"
21242 : In case none of those worked, prompt the user.
21243 case "$netdb_net_type" in
21244 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21247 netdb_net_type=$ans
21251 *) : no getnetbyaddr, so pick harmless default
21252 netdb_net_type='long'
21256 : locate the preferred pager for this system
21263 [a-zA-Z]:/*) dflt=$pg;;
21267 [a-zA-Z]:/*) dflt=$more;;
21271 [a-zA-Z]:/*) dflt=$less;;
21274 '') dflt=/usr/ucb/more;;
21282 rp='What pager is used on your system?'
21286 : see if ar generates random libraries by itself
21288 echo "Checking how to generate random libraries on your machine..." >&4
21289 echo 'int bar1() { return bar2(); }' > bar1.c
21290 echo 'int bar2() { return 2; }' > bar2.c
21292 #$i_stdlib I_STDLIB
21294 #include <stdlib.h>
21296 int main() { printf("%d\n", bar1()); exit(0); }
21298 $cc $ccflags -c bar1.c >/dev/null 2>&1
21299 $cc $ccflags -c bar2.c >/dev/null 2>&1
21300 $cc $ccflags -c foo.c >/dev/null 2>&1
21301 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21302 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21303 $run ./foobar >/dev/null 2>&1; then
21304 echo "$ar appears to generate random libraries itself."
21306 if [ "X$ranlib" = "X" ]; then
21309 elif $ar s bar$_a >/dev/null 2>&1 &&
21310 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21311 $run ./foobar >/dev/null 2>&1; then
21312 echo "a table of contents needs to be added with '$ar s'."
21315 elif $ar ts bar$_a >/dev/null 2>&1 &&
21316 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21317 $run ./foobar >/dev/null 2>&1; then
21318 echo "a table of contents needs to be added with '$ar ts'."
21325 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21326 $test -f $ranlib || ranlib=''
21329 if $test -n "$ranlib"; then
21330 echo "your system has '$ranlib'; we'll use that."
21333 echo "your system doesn't seem to support random libraries"
21334 echo "so we'll use lorder and tsort to order the libraries."
21341 : Check the max offset that gmtime and localtime accept
21342 echo "Checking max offsets that gmtime () accepts"
21344 case "$sGMTIME_min/$sGMTIME_max" in
21347 #include <sys/types.h>
21355 void gm_check (time_t t, int min_year, int max_year)
21358 if ( tmp == NULL ||
21359 /* Check tm_year overflow */
21360 tmp->tm_year < min_year || tmp->tm_year > max_year)
21371 gm_check (MAXLONG, 69, 0x7fffffff);
21373 if (tmp == NULL || tmp->tm_year < 0) {
21374 for (i = 63; i >= 0; i--) {
21375 time_t x = pt | ((time_t)1 << i);
21376 if (x < 0 || x < pt) continue;
21377 gm_check (x, 69, 0x7fffffff);
21380 printf ("sGMTIME_max=%ld\n", pt);
21389 gm_check (MINLONG, -1900, 70);
21392 for (i = 36; i >= 0; i--) {
21393 time_t x = pt - ((time_t)1 << i);
21394 if (x > 0) continue;
21395 gm_check (x, -1900, 70);
21398 printf ("sGMTIME_min=%ld\n", pt);
21402 int main (int argc, char *argv[])
21404 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21411 if eval $compile; then
21412 eval `$run ./try 2>/dev/null`
21414 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21420 echo "Checking max offsets that localtime () accepts"
21422 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21425 #include <sys/types.h>
21433 void local_check (time_t t, int min_year, int max_year)
21435 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21438 tmp = localtime (&t);
21439 if ( tmp == NULL ||
21440 /* Check tm_year overflow */
21441 tmp->tm_year < min_year || tmp->tm_year > max_year)
21445 } /* local_check */
21452 local_check (MAXLONG, 69, 0x7fffffff);
21454 if (tmp == NULL || tmp->tm_year < 0) {
21455 for (i = 63; i >= 0; i--) {
21456 time_t x = pt | ((time_t)1 << i);
21457 if (x < 0 || x < pt) continue;
21458 local_check (x, 69, 0x7fffffff);
21461 printf ("sLOCALTIME_max=%ld\n", pt);
21470 local_check (MINLONG, -1900, 70);
21473 for (i = 36; i >= 0; i--) {
21474 time_t x = pt - ((time_t)1 << i);
21475 if (x > 0) continue;
21476 local_check (x, -1900, 70);
21479 printf ("sLOCALTIME_min=%ld\n", pt);
21483 int main (int argc, char *argv[])
21491 if eval $compile; then
21492 eval `$run ./try 2>/dev/null`
21494 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21500 : check for type of arguments to select.
21501 case "$selecttype" in
21502 '') case "$d_select" in
21506 Checking to see what type of arguments are accepted by select().
21508 hdrs="$define sys/types.h
21509 $i_systime sys/time.h
21510 $i_sysselct sys/select.h
21511 $d_socket sys/socket.h"
21512 : The first arg can be int, unsigned, or size_t
21513 : The last arg may or may not be 'const'
21515 : void pointer has been seen but using that
21516 : breaks the selectminbits test
21517 for xxx in 'fd_set *' 'int *'; do
21518 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21519 for tmo in 'struct timeval *' 'const struct timeval *'; do
21521 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21522 if ./protochk "$try" $hdrs; then
21523 echo "Your system accepts $xxx."
21532 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21533 case "$d_fd_set" in
21534 $define) dflt="fd_set *" ;;
21543 *) : no select, so pick a harmless default
21550 : check for the select 'width'
21551 case "$selectminbits" in
21552 '') safebits=`expr $ptrsize \* 8`
21553 case "$d_select" in
21557 Checking to see on how many bits at a time your select() operates...
21560 #include <sys/types.h>
21562 #$i_systime I_SYS_TIME
21563 #$i_systimek I_SYS_TIME_KERNEL
21568 # ifdef I_SYS_TIME_KERNEL
21571 # include <sys/time.h>
21572 # ifdef I_SYS_TIME_KERNEL
21576 #$i_sysselct I_SYS_SELECT
21577 #ifdef I_SYS_SELECT
21578 #include <sys/select.h>
21580 #$d_socket HAS_SOCKET
21582 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21585 #$i_stdlib I_STDLIB
21587 #include <stdlib.h>
21590 #define S sizeof(*(b))
21592 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21593 #define NBITS (NBYTES * 8)
21595 char *s = (char *)malloc(NBYTES);
21604 fp = fopen("try.c", "r");
21610 b = ($selecttype)s;
21611 for (i = 0; i < NBITS; i++)
21615 select(fd + 1, b, 0, 0, &t);
21616 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21618 printf("%d\n", i + 1);
21623 if eval $compile_ok; then
21624 selectminbits=`$run ./try 2>/dev/null`
21625 case "$selectminbits" in
21627 Cannot figure out on how many bits at a time your select() operates.
21628 I'll play safe and guess it is $safebits bits.
21630 selectminbits=$safebits
21631 bits="$safebits bits"
21634 *) bits="$selectminbits bits" ;;
21636 echo "Your select() operates on $bits at a time." >&4
21638 rp='What is the minimum number of bits your select() operates on?'
21639 case "$byteorder" in
21640 12345678) dflt=64 ;;
21646 selectminbits="$val"
21650 *) : no select, so pick a harmless default
21651 selectminbits=$safebits
21657 : Trace out the files included by signal.h, then look for SIGxxx names.
21658 case "$sig_num_init" in
21660 if [ "X$fieldn" = X ]; then
21661 : Just make some guesses. We check them later.
21662 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21664 xxx=`echo '#include <signal.h>' |
21665 $cppstdin $cppminus $cppflags 2>/dev/null |
21666 $grep '^[ ]*#.*include' |
21667 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21668 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21671 for xx in $xxx /dev/null ; do
21672 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21674 case "$xxxfiles" in
21675 '') xxxfiles=`./findhdr signal.h` ;;
21678 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21679 print substr($2, 4, 20)
21681 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21682 print substr($3, 4, 20)
21684 : Append some common names just in case the awk scan failed.
21685 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21686 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21687 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21688 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21689 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21691 : generate a few handy files for later
21692 $cat > signal.c <<EOCP
21693 #include <sys/types.h>
21694 #include <signal.h>
21695 #$i_stdlib I_STDLIB
21697 #include <stdlib.h>
21702 /* Strange style to avoid deeply-nested #if/#else/#endif */
21705 # define NSIG (_NSIG)
21711 # define NSIG (SIGMAX+1)
21717 # define NSIG (SIG_MAX+1)
21723 # define NSIG (_SIG_MAX+1)
21729 # define NSIG (MAXSIG+1)
21735 # define NSIG (MAX_SIG+1)
21740 # ifdef SIGARRAYSIZE
21741 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21747 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21751 /* Default to some arbitrary number that's big enough to get most
21752 of the common signals.
21758 printf("NSIG %d\n", NSIG);
21764 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21766 printf "#ifdef SIG"; printf $1; printf "\n"
21767 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21768 printf $1; printf ");\n"
21772 printf "#endif /* JUST_NSIG */\n";
21773 printf "exit(0);\n}\n";
21776 $cat >signal.awk <<'EOP'
21777 BEGIN { ndups = 0 }
21778 $1 ~ /^NSIG$/ { nsig = $2 }
21779 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21780 if ($2 > maxsig) { maxsig = $2 }
21781 if (sig_name[$2]) {
21782 dup_name[ndups] = $1
21783 dup_num[ndups] = $2
21795 printf("NSIG %d\n", nsig);
21796 for (n = 1; n < nsig; n++) {
21798 printf("%s %d\n", sig_name[n], sig_num[n])
21801 printf("NUM%d %d\n", n, n)
21804 for (n = 0; n < ndups; n++) {
21805 printf("%s %d\n", dup_name[n], dup_num[n])
21809 $cat >signal_cmd <<EOS
21811 if $test -s signal.lst; then
21812 echo "Using your existing signal.lst file"
21817 $cat >>signal_cmd <<'EOS'
21820 if eval $compile_ok; then
21821 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21822 $uniq | $awk -f signal.awk >signal.lst
21824 echo "(I can't seem be able to compile the whole test program)" >&4
21825 echo "(I'll try it in little pieces.)" >&4
21826 set signal -DJUST_NSIG
21827 if eval $compile_ok; then
21828 $run ./signal$_exe > signal.nsg
21831 echo "I can't seem to figure out how many signals you have." >&4
21832 echo "Guessing 50." >&4
21833 echo 'NSIG 50' > signal.nsg
21835 : Now look at all the signal names, one at a time.
21836 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21837 $cat > signal.c <<EOCP
21838 #include <sys/types.h>
21839 #include <signal.h>
21842 printf("$xx %d\n", SIG${xx});
21847 if eval $compile; then
21848 echo "SIG${xx} found."
21849 $run ./signal$_exe >> signal.ls1
21851 echo "SIG${xx} NOT found."
21854 if $test -s signal.ls1; then
21855 $cat signal.nsg signal.ls1 |
21856 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21860 if $test -s signal.lst; then
21863 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21864 echo 'kill -l' >signal
21865 set X `csh -f <signal`
21869 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21871 echo $@ | $tr ' ' $trnl | \
21872 $awk '{ printf "%s %d\n", $1, ++s; }
21873 END { printf "NSIG %d\n", ++s }' >signal.lst
21875 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21877 chmod a+x signal_cmd
21878 $eunicefix signal_cmd
21882 : generate list of signal names
21883 case "$sig_num_init" in
21886 case "$sig_name_init" in
21888 *) case "$sig_num_init" in
21889 ''|*,*) doinit=yes ;;
21894 echo "Generating a list of signal names and numbers..." >&4
21896 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21897 sig_name=`$awk 'BEGIN { printf "ZERO " }
21898 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21899 sig_num=`$awk 'BEGIN { printf "0 " }
21900 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21901 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21902 !/^NSIG/ { printf "\"%s\", ", $1 }
21903 END { printf "0\n" }' signal.lst`
21904 sig_num_init=`$awk 'BEGIN { printf "0, " }
21905 !/^NSIG/ { printf "%d, ", $2}
21906 END { printf "0\n"}' signal.lst`
21909 echo "The following $sig_count signals are available:"
21911 echo $sig_name | $awk \
21912 'BEGIN { linelen = 0 }
21914 for (i = 1; i <= NF; i++) {
21915 name = "SIG" $i " "
21916 linelen = linelen + length(name)
21917 if (linelen > 70) {
21919 linelen = length(name)
21925 sig_size=`echo $sig_name | awk '{print NF}'`
21926 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21930 : Check size of size
21932 case "$sizetype" in
21933 *_t) zzz="$sizetype" ;;
21934 *) zzz="filesize" ;;
21936 echo "Checking the size of $zzz..." >&4
21938 #include <sys/types.h>
21940 #$i_stdlib I_STDLIB
21942 #include <stdlib.h>
21945 printf("%d\n", (int)sizeof($sizetype));
21950 if eval $compile_ok; then
21954 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21957 echo "Your $zzz size is $sizesize bytes."
21962 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21966 : check for socklen_t
21968 echo "Checking to see if you have socklen_t..." >&4
21970 #include <sys/types.h>
21971 #$d_socket HAS_SOCKET
21973 #include <sys/socket.h>
21975 int main() { socklen_t x = 16; }
21978 if eval $compile; then
21980 echo "You have socklen_t."
21983 echo "You do not have socklen_t."
21984 case "$sizetype" in
21985 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21992 : see if this is a socks.h system
21993 set socks.h i_socks
21996 : check for type of the size argument to socket calls
21997 case "$d_socket" in
22001 Checking to see what type is the last argument of accept().
22004 case "$d_socklen_t" in
22005 "$define") yyy="$yyy socklen_t"
22007 yyy="$yyy $sizetype int long unsigned"
22008 for xxx in $yyy; do
22009 case "$socksizetype" in
22010 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22011 case "$usesocks" in
22013 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22014 echo "Your system accepts '$xxx *' for the last argument of accept()."
22015 socksizetype="$xxx"
22018 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22019 echo "Your system accepts '$xxx *' for the last argument of accept()."
22020 socksizetype="$xxx"
22027 : In case none of those worked, prompt the user.
22028 case "$socksizetype" in
22029 '') rp='What is the type for socket address structure sizes?'
22036 *) : no sockets, so pick relatively harmless default
22041 : see what type is used for signed size_t
22042 set ssize_t ssizetype int stdio.h sys/types.h
22047 #$i_stdlib I_STDLIB
22049 #include <stdlib.h>
22051 #include <sys/types.h>
22052 #define Size_t $sizetype
22053 #define SSize_t $dflt
22056 if (sizeof(Size_t) == sizeof(SSize_t))
22058 else if (sizeof(Size_t) == sizeof(int))
22067 if eval $compile_ok && $run ./try > /dev/null; then
22068 ssizetype=`$run ./try`
22069 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22072 Help! I can't compile and run the ssize_t test program: please enlighten me!
22073 (This is probably a misconfiguration in your system or libraries, and
22074 you really ought to fix it. Still, I'll try anyway.)
22076 I need a type that is the same size as $sizetype, but is guaranteed to
22077 be signed. Common values are ssize_t, int and long.
22080 rp="What signed type is the same size as $sizetype?"
22086 : Check the size of st_ino
22088 $echo "Checking the size of st_ino..." >&4
22089 $cat > try.c <<EOCP
22090 #include <sys/stat.h>
22092 #$i_stdlib I_STDLIB
22094 #include <stdlib.h>
22098 printf("%d\n", (int)sizeof(st.st_ino));
22103 if eval $compile_ok; then
22107 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22109 *) st_ino_size=$val
22110 $echo "Your st_ino is $st_ino_size bytes long."
22115 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22119 : Check if st_ino is signed
22121 $echo "Checking the sign of st_ino..." >&4
22122 $cat > try.c <<EOCP
22123 #include <sys/stat.h>
22128 if (foo.st_ino < 0)
22135 if eval $compile; then
22139 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22141 *) st_ino_sign=$val
22142 case "$st_ino_sign" in
22143 1) $echo "Your st_ino is unsigned." ;;
22144 -1) $echo "Your st_ino is signed." ;;
22150 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22154 : see what type of char stdio uses.
22156 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22157 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22158 echo "Your stdio uses unsigned chars." >&4
22159 stdchar="unsigned char"
22161 echo "Your stdio uses signed chars." >&4
22166 : Check size of UID
22169 *_t) zzz="$uidtype" ;;
22172 echo "Checking the size of $zzz..." >&4
22174 #include <sys/types.h>
22176 #$i_stdlib I_STDLIB
22178 #include <stdlib.h>
22181 printf("%d\n", (int)sizeof($uidtype));
22186 if eval $compile_ok; then
22190 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22193 echo "Your $zzz is $uidsize bytes long."
22198 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22201 : Check if UID is signed
22204 *_t) zzz="$uidtype" ;;
22207 echo "Checking the sign of $zzz..." >&4
22209 #include <sys/types.h>
22220 if eval $compile; then
22224 echo "(I can't execute the test program--guessing unsigned.)" >&4
22228 1) echo "Your $zzz is unsigned." ;;
22229 -1) echo "Your $zzz is signed." ;;
22235 echo "(I can't compile the test program--guessing unsigned.)" >&4
22239 : Check format string for UID
22241 $echo "Checking the format string to be used for uids..." >&4
22244 -1) if $test X"$uidsize" = X"$ivsize"; then
22245 uidformat="$ivdformat"
22247 if $test X"$uidsize" = X"$longsize"; then
22250 if $test X"$uidsize" = X"$intsize"; then
22253 if $test X"$uidsize" = X"$shortsize"; then
22260 *) if $test X"$uidsize" = X"$uvsize"; then
22261 uidformat="$uvuformat"
22263 if $test X"$uidsize" = X"$longsize"; then
22266 if $test X"$uidsize" = X"$intsize"; then
22269 if $test X"$uidsize" = X"$shortsize"; then
22278 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22280 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22281 $cat >try.c <<'EOM'
22282 /* Intentionally a long probe as I'd like to sanity check that the exact
22283 approach is going to work, as thinking it will work, but only having it
22284 part working at runtime is worse than not having it. */
22286 #include <sys/types.h>
22287 #include <sys/sysctl.h>
22288 #include <sys/param.h>
22290 #include <string.h>
22291 #include <stdlib.h>
22292 #include <unistd.h>
22295 main(int argc, char **argv) {
22297 char *argv_leaf = strrchr(argv[0], '/');
22303 mib[1] = KERN_PROC;
22304 mib[2] = KERN_PROC_PATHNAME;
22308 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22312 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22317 if (size < strlen(argv_leaf) + 1) {
22318 fprintf(stderr, "size %lu is too short for a path\n",
22319 (unsigned long) size);
22323 if (size > MAXPATHLEN * MAXPATHLEN) {
22324 fprintf(stderr, "size %lu is too long for a path\n",
22325 (unsigned long) size);
22329 buffer = (char *)malloc(size);
22335 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22340 if (strlen(buffer) + 1 != size) {
22341 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22342 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22347 if (*buffer != '/') {
22348 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22352 if (strstr(buffer, "/./")) {
22353 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22357 if (strstr(buffer, "/../")) {
22358 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22362 buffer_leaf = strrchr(buffer, '/');
22363 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22364 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22376 if eval $compile; then
22377 if $run ./try; then
22378 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22381 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22385 echo "I'm unable to compile the test program." >&4
22386 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22390 set usekernprocpathname
22393 : Determine if we can use _NSGetExecutablePath to find executing program
22395 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22396 $cat >try.c <<'EOM'
22397 /* Intentionally a long probe as I'd like to sanity check that the exact
22398 approach is going to work, as thinking it will work, but only having it
22399 part working at runtime is worse than not having it. */
22400 #include <mach-o/dyld.h>
22402 #include <stdlib.h>
22403 #include <sys/param.h>
22404 #include <string.h>
22407 main(int argc, char **argv) {
22409 uint32_t size = sizeof(buf);
22413 char *argv_leaf = strrchr(argv[0], '/');
22417 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22421 _NSGetExecutablePath(buf, &size);
22422 if (size > MAXPATHLEN * MAXPATHLEN) {
22423 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22424 (unsigned int) size);
22428 buffer = (char *)malloc(size);
22434 result = _NSGetExecutablePath(buffer, &size);
22436 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22437 result, (unsigned int) size);
22441 tidied = realpath(buffer, NULL);
22443 perror("realpath");
22449 if (*tidied != '/') {
22450 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22454 if (strstr(tidied, "/./")) {
22455 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22459 if (strstr(tidied, "/../")) {
22460 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22464 tidied_leaf = strrchr(tidied, '/');
22465 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22466 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22478 if eval $compile; then
22479 if $run ./try; then
22480 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22483 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22486 echo "I'm unable to compile the test program." >&4
22487 echo "I'll assume no _NSGetExecutablePath here." >&4
22490 set usensgetexecutablepath
22493 : Check if site customization support was requested
22494 case "$usesitecustomize" in
22495 $define|true|[Yy]*)
22496 usesitecustomize="$define"
22499 usesitecustomize="$undef"
22503 : determine compiler compiler
22512 if $test -f "$byacc$_exe"; then
22514 comp="byacc or $comp"
22516 if $test -f "$bison$_exe"; then
22517 comp="$comp or bison -y"
22519 rp="Which compiler compiler ($comp) shall I use?"
22528 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22534 : see if this is a bfd.h system
22538 : see if this is an execinfo.h system
22539 set execinfo.h i_execinfo
22542 : see if this is a fenv.h system
22546 : see if this is a fp.h system
22550 : see if this is a fp_class.h system
22551 set fp_class.h i_fp_class
22554 : see if gdbm.h is available
22559 : see if gdbm_open exists
22560 set gdbm_open d_gdbm_open
22562 case "$d_gdbm_open" in
22565 echo "We won't be including <gdbm.h>"
22574 : see if this is a ieeefp.h system
22575 case "$i_ieeefp" in
22576 '' ) set ieeefp.h i_ieeefp
22581 : see if this is a libutil.h system
22582 set libutil.h i_libutil
22585 : see if mach cthreads are available
22586 if test "X$usethreads" = "X$define"; then
22587 set mach/cthreads.h i_machcthr
22590 i_machcthr="$undef"
22593 : see if this is a mntent.h system
22594 set mntent.h i_mntent
22597 : see if net/errno.h is available
22599 set net/errno.h val
22602 : Unfortunately, it causes problems on some systems. Arrgh.
22605 cat > try.c <<'EOM'
22608 #include <net/errno.h>
22614 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22615 echo "We'll be including <net/errno.h>." >&4
22617 echo "We won't be including <net/errno.h>." >&4
22626 : see if netinet/tcp.h is available
22627 set netinet/tcp.h i_netinettcp
22630 : see if this is a poll.h system
22634 : see if this is a prot.h system
22638 : Preprocessor symbols
22640 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22641 $cat <<'EOSH' > Cppsym.know
22642 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22643 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22644 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22645 arch_pwr ardent ARM ARM32 atarist att386 att3b
22646 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22647 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22648 byteorder byte_order
22649 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22650 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22651 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22652 ELF encore EPI EXTENSIONS
22653 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22654 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22655 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22656 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22657 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22658 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22659 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22660 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22661 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22663 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22664 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22665 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22667 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22668 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22669 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22670 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22671 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22672 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22673 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22674 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22675 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22676 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22677 ns32000 ns32016 ns32332 ns32k nsc32000
22678 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22679 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22680 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22681 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22683 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22684 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22685 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22686 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22687 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22688 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22689 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22690 SYSV4 SYSV5 sysV68 sysV88
22691 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22692 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22693 tower32_800 tower32_850 tss
22694 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22695 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22696 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22697 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22698 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22699 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22701 vax venix VMESA vms
22702 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22703 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22706 # Maybe put other stuff here too.
22707 ./tr '-' '_' <<EOSH >>Cppsym.know
22710 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22711 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22712 $cat Cppsym.know > Cppsym.c
22713 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22714 $rm -f Cppsym.a Cppsym.b Cppsym.c
22715 cat <<EOSH > Cppsym
22717 if $test \$# -gt 0; then
22718 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22719 if $test -s Cppsym.got; then
22726 $tr " " "$trnl" | ./Cppsym.try
22732 cat <<EOSH > Cppsym.try
22734 cat <<'EOCP' > try.c
22737 #define STRINGIFY(a) "a"
22739 #if cpp_stuff == 42
22740 #define StGiFy(a) #a
22741 #define STRINGIFY(a) StGiFy(a)
22743 #if $cpp_stuff != 1 && $cpp_stuff != 42
22744 # include "Bletch: How does this C preprocessor stringify macros?"
22750 cat <<'EOSH' >> Cppsym.try
22752 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22753 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22754 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22755 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22757 echo 'return 0;}' >> try.c
22759 cat <<EOSH >> Cppsym.try
22761 case "$osname-$gccversion" in
22762 irix-) ccflags="\$ccflags -woff 1178" ;;
22763 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22765 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
22767 chmod +x Cppsym.try
22768 $eunicefix Cppsym.try
22769 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22770 : Add in any Linux cpp "predefined macros":
22771 case "$osname::$gccversion" in
22772 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22774 rm -f $tHdrH'.h' $tHdrH
22776 # Filter out macro arguments, such as Linux's __INT8_C(c)
22777 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22778 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22779 if [ -s $tHdrH'_cppsym.real' ]; then
22780 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22783 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22786 : now check the C compiler for additional symbols
22787 postprocess_cc_v=''
22789 aix) postprocess_cc_v="|$tr , ' '" ;;
22796 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22799 -D*) echo "\$i" | $sed 's/^-D//';;
22800 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22805 postprocess_cc_v=''
22808 ./ccsym > ccsym1.raw
22809 if $test -s ccsym1.raw; then
22810 $sort ccsym1.raw | $uniq >ccsym.raw
22812 mv ccsym1.raw ccsym.raw
22815 $awk '/\=/ { print $0; next }
22816 { print $0"=1" }' ccsym.raw >ccsym.list
22817 $comm -13 Cppsym.true ccsym.list >ccsym.own
22818 $comm -12 Cppsym.true ccsym.list >ccsym.com
22819 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22821 if $test -z ccsym.raw; then
22822 echo "Your C compiler doesn't seem to define any symbols!" >&4
22824 echo "However, your C preprocessor defines the following symbols:"
22827 cppsymbols=`$cat Cppsym.true`
22828 cppsymbols=`echo $cppsymbols`
22829 cppccsymbols="$cppsymbols"
22831 if $test -s ccsym.com; then
22832 echo "Your C compiler and pre-processor define these symbols:"
22833 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22836 cppccsymbols=`$cat ccsym.com`
22837 cppccsymbols=`echo $cppccsymbols`
22838 $test "$silent" || sleep 1
22840 if $test -s ccsym.cpp; then
22841 $test "$also" && echo " "
22842 echo "Your C pre-processor ${also}defines the following symbols:"
22843 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22845 cppsymbols=`$cat ccsym.cpp`
22846 cppsymbols=`echo $cppsymbols`
22847 $test "$silent" || sleep 1
22849 if $test -s ccsym.own; then
22850 $test "$also" && echo " "
22851 echo "Your C compiler ${also}defines the following cpp symbols:"
22852 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22853 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22854 ccsymbols=`$cat ccsym.own`
22855 ccsymbols=`echo $ccsymbols`
22856 $test "$silent" || sleep 1
22860 : add -D_FORTIFY_SOURCE if feasible and not already there
22861 case "$gccversion" in
22862 [4567].*) case "$optimize$ccflags" in
22863 *-O*) case "$ccflags$cppsymbols" in
22864 *_FORTIFY_SOURCE=*) # Don't add it again.
22865 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22867 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22868 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22872 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22876 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
22880 : script used to emit important warnings
22883 if test \$# -gt 0; then
22888 echo "*** WARNING:" >&4
22889 sed -e 's/^/*** /' <msg >&4
22891 cat msg >>config.msg
22892 echo " " >>config.msg
22898 : see if this is a termio system
22902 if $test `./findhdr termios.h`; then
22903 set tcsetattr i_termios
22909 "$define") echo "You have POSIX termios.h... good!" >&4;;
22910 *) if ./Cppsym pyr; then
22911 case "`$run /bin/universe`" in
22912 ucb) if $test `./findhdr sgtty.h`; then
22914 echo "<sgtty.h> found." >&4
22916 echo "System is pyramid with BSD universe."
22917 ./warn "<sgtty.h> not found--you could have problems."
22919 *) if $test `./findhdr termio.h`; then
22921 echo "<termio.h> found." >&4
22923 echo "System is pyramid with USG universe."
22924 ./warn "<termio.h> not found--you could have problems."
22928 if $test `./findhdr termio.h`; then
22929 echo "<termio.h> found." >&4
22931 elif $test `./findhdr sgtty.h`; then
22932 echo "<sgtty.h> found." >&4
22935 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22938 if $test `./findhdr sgtty.h`; then
22939 echo "<sgtty.h> found." >&4
22941 elif $test `./findhdr termio.h`; then
22942 echo "<termio.h> found." >&4
22945 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22949 set i_termio; eval $setvar
22950 val=$val2; set i_sgtty; eval $setvar
22951 val=$val3; set i_termios; eval $setvar
22953 : see if stdbool is available
22954 : we want a real compile instead of Inhdr because some Solaris systems
22955 : have stdbool.h, but it can only be used if the compiler indicates it
22956 : is sufficiently c99-compliant.
22960 #include <stdbool.h>
22965 int main(int argc, char **argv)
22971 if eval $compile; then
22972 echo "<stdbool.h> found." >&4
22975 echo "<stdbool.h> NOT found." >&4
22982 : see if stdint is available
22983 set stdint.h i_stdint
22986 : see if sys/access.h is available
22987 set sys/access.h i_sysaccess
22990 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22991 set sys/filio.h i_sysfilio
22994 if $test `./findhdr sys/ioctl.h`; then
22996 echo '<sys/ioctl.h> found.' >&4
22999 if $test $i_sysfilio = "$define"; then
23000 echo '<sys/ioctl.h> NOT found.' >&4
23002 $test $i_sgtty = "$define" && xxx="sgtty.h"
23003 $test $i_termio = "$define" && xxx="termio.h"
23004 $test $i_termios = "$define" && xxx="termios.h"
23005 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23011 : see if socket ioctl defs are in sys/sockio.h
23013 xxx=`./findhdr sys/sockio.h`
23014 if $test "$xxx"; then
23015 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23017 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23020 echo "No socket ioctls found in <sys/sockio.h>." >&4
23025 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23031 : see if this is a syslog.h system
23032 set syslog.h i_syslog
23035 : see if this is a sys/mode.h system
23036 set sys/mode.h i_sysmode
23039 : see if there is a sys/poll.h file
23040 set sys/poll.h i_syspoll
23043 : see if sys/resource.h has to be included
23044 set sys/resource.h i_sysresrc
23047 : see if sys/security.h is available
23048 set sys/security.h i_syssecrt
23051 : see if this is a sys/statvfs.h system
23052 set sys/statvfs.h i_sysstatvfs
23055 : see if this is a sys/un.h system
23056 set sys/un.h i_sysun
23059 : see if this is a sys/utsname.h system
23060 set sys/utsname.h i_sysutsname
23063 : see if this is a syswait system
23064 set sys/wait.h i_syswait
23067 : see if this is a ustat.h system
23068 set ustat.h i_ustat
23071 : see if this is an utime system
23072 set utime.h i_utime
23075 : see if this is a vfork system
23078 set vfork.h i_vfork
23086 : see if wchar.h is present
23087 set wchar.h i_wchar
23092 echo "Looking for extensions..." >&4
23093 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23094 : contain old or inaccurate or duplicate values.
23095 nonxs_extensions=''
23097 : We do not use find because it might not be available.
23098 : We do not just use MANIFEST because the user may have dropped
23099 : some additional extensions into the source tree and expect them
23102 : Function to recursively find available extensions, ignoring DynaLoader
23103 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23104 : In 5.10.1 and later, extensions are stored in directories
23105 : like File-Glob instead of the older File/Glob/.
23109 DynaLoader|dynaload) ;;
23111 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23112 case "$this_ext" in
23113 Scalar/List/Utils) this_ext="List/Util" ;;
23114 PathTools) this_ext="Cwd" ;;
23116 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23117 if $contains " $this_ext " "$tdir/$$.tmp"; then
23119 echo "Duplicate directories detected for extension $xxx" >&4;
23120 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23121 case "$knowitall" in
23129 echo "Ok. Stopping Configure." >&4;
23130 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23133 echo "Ok. You will need to correct config.sh before running make." >&4;
23135 $ls -1 "$xxx" > "$tdir/$$.tmp";
23136 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23137 xs_extensions="$xs_extensions $this_ext";
23138 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23139 xs_extensions="$xs_extensions $this_ext";
23140 elif $test -d "$xxx"; then
23141 nonxs_extensions="$nonxs_extensions $this_ext";
23143 $rm -f "$tdir/$$.tmp";
23151 eval $find_extensions
23155 eval $find_extensions
23159 eval $find_extensions
23160 set X $xs_extensions
23162 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23163 set X $nonxs_extensions
23165 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23167 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23169 : Now see which are supported on this system.
23171 for xxx in $xs_extensions ; do
23175 amigaos) avail_ext="$avail_ext $xxx" ;;
23180 $define) avail_ext="$avail_ext $xxx" ;;
23183 GDBM_File|gdbm_fil)
23185 $define) avail_ext="$avail_ext $xxx" ;;
23188 I18N/Langinfo|i18n_lan)
23189 case "$i_langinfo$d_nl_langinfo" in
23190 $define$define) avail_ext="$avail_ext $xxx" ;;
23194 : XXX Do we need a useipcsysv variable here
23195 case "${d_msg}${d_sem}${d_shm}" in
23196 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23199 NDBM_File|ndbm_fil)
23202 case "$osname-$use64bitint" in
23205 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23208 *) avail_ext="$avail_ext $xxx" ;;
23213 ODBM_File|odbm_fil)
23214 case "${i_dbm}${i_rpcsvcdbm}" in
23216 case "$d_cplusplus" in
23217 define) ;; # delete as a function name will not work
23218 *) case "$osname-$use64bitint" in
23221 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23224 *) avail_ext="$avail_ext $xxx" ;;
23232 case "$useopcode" in
23233 true|define|y) avail_ext="$avail_ext $xxx" ;;
23237 case "$useposix" in
23238 true|define|y) avail_ext="$avail_ext $xxx" ;;
23242 case "$d_socket" in
23243 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23246 Sys/Syslog|sys/syslog)
23248 amigaos) ;; # not really very useful on AmigaOS
23250 : XXX syslog requires socket
23251 case "$d_socket" in
23252 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23258 case "$usethreads" in
23260 case "$use5005threads" in
23261 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23265 threads|threads/shared)
23266 # threads and threads::shared are special cases.
23267 # To stop people from asking "Perl 5.8.0 was supposed
23268 # to have this new fancy threads implementation but my
23269 # perl doesn't have it" and from people trying to
23270 # (re)install the threads module using CPAN.pm and
23271 # CPAN.pm then offering to reinstall Perl 5.8.0,
23272 # the threads.pm and threads/shared.pm will always be
23273 # there, croaking informatively ("you need to rebuild
23274 # all of Perl with threads, sorry") when threads haven't
23275 # been compiled in.
23277 avail_ext="$avail_ext $xxx"
23283 cygwin) avail_ext="$avail_ext $xxx" ;;
23286 XS/APItest|xs/apitest)
23287 # This is just for testing. Skip it unless we have dynamic loading.
23290 $define) avail_ext="$avail_ext $xxx" ;;
23293 XS/Typemap|xs/typemap)
23294 # This is just for testing. Skip it unless we have dynamic loading.
23296 $define) avail_ext="$avail_ext $xxx" ;;
23299 *) avail_ext="$avail_ext $xxx"
23308 case "$onlyextensions" in
23310 *) keepextensions=''
23311 echo "You have requested that only certain extensions be included..." >&4
23312 for i in $onlyextensions; do
23313 case " $avail_ext " in
23315 echo "Keeping extension $i."
23316 keepextensions="$keepextensions $i"
23318 *) echo "Ignoring extension $i." ;;
23321 avail_ext="$keepextensions"
23325 case "$noextensions" in
23327 *) keepextensions=''
23328 echo "You have requested that certain extensions be ignored..." >&4
23329 for i in $avail_ext; do
23330 case " $noextensions " in
23331 *" $i "*) echo "Ignoring extension $i." ;;
23332 *) echo "Keeping extension $i.";
23333 keepextensions="$keepextensions $i"
23337 avail_ext="$keepextensions"
23341 : Now see which nonxs extensions are supported on this system.
23342 : For now assume all are.
23344 for xxx in $nonxs_extensions ; do
23348 *) nonxs_ext="$nonxs_ext $xxx"
23360 A number of extensions are supplied with $package. You may choose to
23361 compile these extensions for dynamic loading (the default), compile
23362 them into the $package executable (static loading), or not include
23363 them at all. Answer "none" to include no extensions.
23364 Note that DynaLoader is always built and need not be mentioned here.
23367 case "$dynamic_ext" in
23369 : Exclude those listed in static_ext
23371 for xxx in $avail_ext; do
23372 case " $static_ext " in
23374 *) dflt="$dflt $xxx" ;;
23381 *) dflt="$dynamic_ext"
23382 # Perhaps we are reusing an old out-of-date config.sh.
23385 if test X"$dynamic_ext" != X"$avail_ext"; then
23387 NOTICE: Your previous config.sh list may be incorrect.
23388 The extensions now available to you are
23390 but the default list from your previous config.sh is
23402 rp="What extensions do you wish to load dynamically?"
23405 none) dynamic_ext=' ' ;;
23406 *) dynamic_ext="$ans" ;;
23409 case "$static_ext" in
23411 : Exclude those already listed in dynamic linking
23413 for xxx in $avail_ext; do
23414 case " $dynamic_ext " in
23416 *) dflt="$dflt $xxx" ;;
23423 *) dflt="$static_ext"
23430 rp="What extensions do you wish to load statically?"
23433 none) static_ext=' ' ;;
23434 *) static_ext="$ans" ;;
23439 A number of extensions are supplied with $package. Answer "none"
23440 to include no extensions.
23441 Note that DynaLoader is always built and need not be mentioned here.
23444 case "$static_ext" in
23445 '') dflt="$avail_ext" ;;
23446 *) dflt="$static_ext"
23447 # Perhaps we are reusing an old out-of-date config.sh.
23450 if test X"$static_ext" != X"$avail_ext"; then
23452 NOTICE: Your previous config.sh list may be incorrect.
23453 The extensions now available to you are
23455 but the default list from your previous config.sh is
23464 : Exclude those that are not xs extensions
23468 rp="What extensions do you wish to include?"
23471 none) static_ext=' ' ;;
23472 *) static_ext="$ans" ;;
23477 # Encode is a special case. If we are building Encode as a static
23478 # extension, we need to explicitly list its subextensions as well.
23479 # For other nested extensions, this is handled automatically by
23480 # the appropriate Makefile.PL.
23481 case " $static_ext " in
23482 *" Encode "*) # Add the subextensions of Encode
23484 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23485 static_ext="$static_ext Encode/$xxx"
23486 known_extensions="$known_extensions Encode/$xxx"
23492 set X $dynamic_ext $static_ext $nonxs_ext
23496 # Sanity check: We require an extension suitable for use with
23497 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23498 # should show up as failures in the test suite, but it's helpful to
23499 # catch them now.) The 'extensions' list is normally sorted
23500 # alphabetically, so we need to accept either
23501 # DB_File ... Fcntl ... IO ....
23502 # or something like
23503 # Fcntl ... NDBM_File ... IO ....
23504 case " $extensions" in
23505 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23506 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23507 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23508 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23509 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23513 : Remove libraries needed only for extensions
23514 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23515 : The exception is SunOS 4.x, which needs them.
23516 case "${osname}X${osvers}" in
23520 *) case "$usedl" in
23521 $define|true|[yY]*)
23522 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23526 *) perllibs="$libs"
23532 : Remove build directory name from cppstdin so it can be used from
23533 : either the present location or the final installed location.
23535 : Get out of the UU directory to get correct path name.
23537 case "$cppstdin" in
23539 echo "Stripping down cppstdin path name"
23545 : end of configuration questions
23547 echo "End of configuration questions."
23550 : back to where it started
23551 if test -d ../UU; then
23555 : configuration may be unconditionally patched via a 'config.arch' file
23556 if $test -f config.arch; then
23557 echo "I see a config.arch file, loading it." >&4
23561 : configuration may be patched via a 'config.over' file
23562 if $test -f config.over; then
23565 rp='I see a config.over file. Do you wish to load it?'
23568 n*) echo "OK, I'll ignore it.";;
23570 echo "Configuration override changes have been loaded."
23575 : in case they want portability, strip down executable paths
23576 case "$d_portable" in
23579 echo "Stripping down executable paths..." >&4
23580 for file in $loclist $trylist; do
23582 eval $file=`basename $temp`
23587 : create config.sh file
23589 echo "Creating config.sh..." >&4
23590 $spitshell <<EOT >config.sh
23593 # This file was produced by running the Configure script. It holds all the
23594 # definitions figured out by Configure. Should you modify one of these values,
23595 # do not forget to propagate your changes by running "Configure -der". You may
23596 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23599 # Package name : $package
23600 # Source directory : $src
23601 # Configuration time: $cf_time
23602 # Configured by : $cf_by
23603 # Target system : $myuname
23606 : Add in command line options if available
23607 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23609 $spitshell <<EOT >>config.sh
23618 Revision='$Revision'
23626 alignbytes='$alignbytes'
23627 aphostname='$aphostname'
23628 api_revision='$api_revision'
23629 api_subversion='$api_subversion'
23630 api_version='$api_version'
23631 api_versionstring='$api_versionstring'
23634 archlibexp='$archlibexp'
23635 archname64='$archname64'
23636 archname='$archname'
23637 archobjs='$archobjs'
23638 asctime_r_proto='$asctime_r_proto'
23647 byteorder='$byteorder'
23649 castflags='$castflags'
23652 cccdlflags='$cccdlflags'
23653 ccdlflags='$ccdlflags'
23655 ccflags_uselargefiles='$ccflags_uselargefiles'
23657 ccsymbols='$ccsymbols'
23658 ccversion='$ccversion'
23660 cf_email='$cf_email'
23662 charbits='$charbits'
23663 charsize='$charsize'
23667 clocktype='$clocktype'
23669 compress='$compress'
23670 contains='$contains'
23674 cpp_stuff='$cpp_stuff'
23675 cppccsymbols='$cppccsymbols'
23676 cppflags='$cppflags'
23678 cppminus='$cppminus'
23680 cppstdin='$cppstdin'
23681 cppsymbols='$cppsymbols'
23682 crypt_r_proto='$crypt_r_proto'
23683 cryptlib='$cryptlib'
23685 ctermid_r_proto='$ctermid_r_proto'
23686 ctime_r_proto='$ctime_r_proto'
23687 d_Gconvert='$d_Gconvert'
23688 d_PRIEUldbl='$d_PRIEUldbl'
23689 d_PRIFUldbl='$d_PRIFUldbl'
23690 d_PRIGUldbl='$d_PRIGUldbl'
23691 d_PRIXU64='$d_PRIXU64'
23692 d_PRId64='$d_PRId64'
23693 d_PRIeldbl='$d_PRIeldbl'
23694 d_PRIfldbl='$d_PRIfldbl'
23695 d_PRIgldbl='$d_PRIgldbl'
23696 d_PRIi64='$d_PRIi64'
23697 d_PRIo64='$d_PRIo64'
23698 d_PRIu64='$d_PRIu64'
23699 d_PRIx64='$d_PRIx64'
23700 d_SCNfldbl='$d_SCNfldbl'
23701 d__fwalk='$d__fwalk'
23702 d_access='$d_access'
23703 d_accessx='$d_accessx'
23707 d_archlib='$d_archlib'
23708 d_asctime64='$d_asctime64'
23709 d_asctime_r='$d_asctime_r'
23714 d_attribute_deprecated='$d_attribute_deprecated'
23715 d_attribute_format='$d_attribute_format'
23716 d_attribute_malloc='$d_attribute_malloc'
23717 d_attribute_nonnull='$d_attribute_nonnull'
23718 d_attribute_noreturn='$d_attribute_noreturn'
23719 d_attribute_pure='$d_attribute_pure'
23720 d_attribute_unused='$d_attribute_unused'
23721 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23722 d_backtrace='$d_backtrace'
23724 d_bsdgetpgrp='$d_bsdgetpgrp'
23725 d_bsdsetpgrp='$d_bsdsetpgrp'
23726 d_builtin_add_overflow='$d_builtin_add_overflow'
23727 d_builtin_choose_expr='$d_builtin_choose_expr'
23728 d_builtin_expect='$d_builtin_expect'
23729 d_builtin_mul_overflow='$d_builtin_mul_overflow'
23730 d_builtin_sub_overflow='$d_builtin_sub_overflow'
23731 d_c99_variadic_macros='$d_c99_variadic_macros'
23732 d_casti32='$d_casti32'
23733 d_castneg='$d_castneg'
23736 d_chroot='$d_chroot'
23737 d_chsize='$d_chsize'
23739 d_clearenv='$d_clearenv'
23740 d_closedir='$d_closedir'
23741 d_cmsghdr_s='$d_cmsghdr_s'
23743 d_copysign='$d_copysign'
23744 d_copysignl='$d_copysignl'
23745 d_cplusplus='$d_cplusplus'
23747 d_crypt_r='$d_crypt_r'
23749 d_ctermid='$d_ctermid'
23750 d_ctermid_r='$d_ctermid_r'
23751 d_ctime64='$d_ctime64'
23752 d_ctime_r='$d_ctime_r'
23753 d_cuserid='$d_cuserid'
23754 d_dbminitproto='$d_dbminitproto'
23755 d_difftime64='$d_difftime64'
23756 d_difftime='$d_difftime'
23757 d_dir_dd_fd='$d_dir_dd_fd'
23759 d_dirnamlen='$d_dirnamlen'
23760 d_dladdr='$d_dladdr'
23761 d_dlerror='$d_dlerror'
23762 d_dlopen='$d_dlopen'
23763 d_dlsymun='$d_dlsymun'
23764 d_dosuid='$d_dosuid'
23765 d_double_has_inf='$d_double_has_inf'
23766 d_double_has_nan='$d_double_has_nan'
23767 d_double_has_negative_zero='$d_double_has_negative_zero'
23768 d_double_has_subnormals='$d_double_has_subnormals'
23769 d_double_style_cray='$d_double_style_cray'
23770 d_double_style_ibm='$d_double_style_ibm'
23771 d_double_style_ieee='$d_double_style_ieee'
23772 d_double_style_vax='$d_double_style_vax'
23773 d_drand48_r='$d_drand48_r'
23774 d_drand48proto='$d_drand48proto'
23776 d_duplocale='$d_duplocale'
23777 d_eaccess='$d_eaccess'
23778 d_endgrent='$d_endgrent'
23779 d_endgrent_r='$d_endgrent_r'
23780 d_endhent='$d_endhent'
23781 d_endhostent_r='$d_endhostent_r'
23782 d_endnent='$d_endnent'
23783 d_endnetent_r='$d_endnetent_r'
23784 d_endpent='$d_endpent'
23785 d_endprotoent_r='$d_endprotoent_r'
23786 d_endpwent='$d_endpwent'
23787 d_endpwent_r='$d_endpwent_r'
23788 d_endsent='$d_endsent'
23789 d_endservent_r='$d_endservent_r'
23790 d_eofnblk='$d_eofnblk'
23793 d_eunice='$d_eunice'
23796 d_faststdio='$d_faststdio'
23797 d_fchdir='$d_fchdir'
23798 d_fchmod='$d_fchmod'
23799 d_fchmodat='$d_fchmodat'
23800 d_fchown='$d_fchown'
23802 d_fcntl_can_lock='$d_fcntl_can_lock'
23803 d_fd_macros='$d_fd_macros'
23804 d_fd_set='$d_fd_set'
23805 d_fdclose='$d_fdclose'
23807 d_fds_bits='$d_fds_bits'
23808 d_fegetround='$d_fegetround'
23809 d_fgetpos='$d_fgetpos'
23810 d_finite='$d_finite'
23811 d_finitel='$d_finitel'
23812 d_flexfnam='$d_flexfnam'
23814 d_flockproto='$d_flockproto'
23819 d_fp_class='$d_fp_class'
23820 d_fp_classify='$d_fp_classify'
23821 d_fp_classl='$d_fp_classl'
23822 d_fpathconf='$d_fpathconf'
23823 d_fpclass='$d_fpclass'
23824 d_fpclassify='$d_fpclassify'
23825 d_fpclassl='$d_fpclassl'
23826 d_fpgetround='$d_fpgetround'
23827 d_fpos64_t='$d_fpos64_t'
23828 d_freelocale='$d_freelocale'
23829 d_frexpl='$d_frexpl'
23830 d_fs_data_s='$d_fs_data_s'
23831 d_fseeko='$d_fseeko'
23832 d_fsetpos='$d_fsetpos'
23833 d_fstatfs='$d_fstatfs'
23834 d_fstatvfs='$d_fstatvfs'
23836 d_ftello='$d_ftello'
23838 d_futimes='$d_futimes'
23839 d_gai_strerror='$d_gai_strerror'
23840 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23841 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23842 d_getaddrinfo='$d_getaddrinfo'
23843 d_getcwd='$d_getcwd'
23844 d_getespwnam='$d_getespwnam'
23845 d_getfsstat='$d_getfsstat'
23846 d_getgrent='$d_getgrent'
23847 d_getgrent_r='$d_getgrent_r'
23848 d_getgrgid_r='$d_getgrgid_r'
23849 d_getgrnam_r='$d_getgrnam_r'
23850 d_getgrps='$d_getgrps'
23851 d_gethbyaddr='$d_gethbyaddr'
23852 d_gethbyname='$d_gethbyname'
23853 d_gethent='$d_gethent'
23854 d_gethname='$d_gethname'
23855 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23856 d_gethostbyname_r='$d_gethostbyname_r'
23857 d_gethostent_r='$d_gethostent_r'
23858 d_gethostprotos='$d_gethostprotos'
23859 d_getitimer='$d_getitimer'
23860 d_getlogin='$d_getlogin'
23861 d_getlogin_r='$d_getlogin_r'
23862 d_getmnt='$d_getmnt'
23863 d_getmntent='$d_getmntent'
23864 d_getnameinfo='$d_getnameinfo'
23865 d_getnbyaddr='$d_getnbyaddr'
23866 d_getnbyname='$d_getnbyname'
23867 d_getnent='$d_getnent'
23868 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23869 d_getnetbyname_r='$d_getnetbyname_r'
23870 d_getnetent_r='$d_getnetent_r'
23871 d_getnetprotos='$d_getnetprotos'
23872 d_getpagsz='$d_getpagsz'
23873 d_getpbyname='$d_getpbyname'
23874 d_getpbynumber='$d_getpbynumber'
23875 d_getpent='$d_getpent'
23876 d_getpgid='$d_getpgid'
23877 d_getpgrp2='$d_getpgrp2'
23878 d_getpgrp='$d_getpgrp'
23879 d_getppid='$d_getppid'
23880 d_getprior='$d_getprior'
23881 d_getprotobyname_r='$d_getprotobyname_r'
23882 d_getprotobynumber_r='$d_getprotobynumber_r'
23883 d_getprotoent_r='$d_getprotoent_r'
23884 d_getprotoprotos='$d_getprotoprotos'
23885 d_getprpwnam='$d_getprpwnam'
23886 d_getpwent='$d_getpwent'
23887 d_getpwent_r='$d_getpwent_r'
23888 d_getpwnam_r='$d_getpwnam_r'
23889 d_getpwuid_r='$d_getpwuid_r'
23890 d_getsbyname='$d_getsbyname'
23891 d_getsbyport='$d_getsbyport'
23892 d_getsent='$d_getsent'
23893 d_getservbyname_r='$d_getservbyname_r'
23894 d_getservbyport_r='$d_getservbyport_r'
23895 d_getservent_r='$d_getservent_r'
23896 d_getservprotos='$d_getservprotos'
23897 d_getspnam='$d_getspnam'
23898 d_getspnam_r='$d_getspnam_r'
23899 d_gettimeod='$d_gettimeod'
23900 d_gmtime64='$d_gmtime64'
23901 d_gmtime_r='$d_gmtime_r'
23902 d_gnulibc='$d_gnulibc'
23903 d_grpasswd='$d_grpasswd'
23904 d_hasmntopt='$d_hasmntopt'
23908 d_ilogbl='$d_ilogbl'
23909 d_inc_version_list='$d_inc_version_list'
23910 d_inetaton='$d_inetaton'
23911 d_inetntop='$d_inetntop'
23912 d_inetpton='$d_inetpton'
23913 d_int64_t='$d_int64_t'
23914 d_ip_mreq='$d_ip_mreq'
23915 d_ip_mreq_source='$d_ip_mreq_source'
23916 d_ipv6_mreq='$d_ipv6_mreq'
23917 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23918 d_isascii='$d_isascii'
23919 d_isblank='$d_isblank'
23920 d_isfinite='$d_isfinite'
23921 d_isfinitel='$d_isfinitel'
23923 d_isinfl='$d_isinfl'
23924 d_isless='$d_isless'
23926 d_isnanl='$d_isnanl'
23927 d_isnormal='$d_isnormal'
23930 d_killpg='$d_killpg'
23931 d_lc_monetary_2008='$d_lc_monetary_2008'
23932 d_lchown='$d_lchown'
23933 d_ldbl_dig='$d_ldbl_dig'
23934 d_ldexpl='$d_ldexpl'
23935 d_lgamma='$d_lgamma'
23936 d_lgamma_r='$d_lgamma_r'
23937 d_libm_lib_version='$d_libm_lib_version'
23938 d_libname_unique='$d_libname_unique'
23940 d_linkat='$d_linkat'
23941 d_llrint='$d_llrint'
23942 d_llrintl='$d_llrintl'
23943 d_llround='$d_llround'
23944 d_llroundl='$d_llroundl'
23945 d_localeconv_l='$d_localeconv_l'
23946 d_localtime64='$d_localtime64'
23947 d_localtime_r='$d_localtime_r'
23948 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23949 d_locconv='$d_locconv'
23954 d_long_double_style_ieee='$d_long_double_style_ieee'
23955 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
23956 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
23957 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
23958 d_long_double_style_vax='$d_long_double_style_vax'
23959 d_longdbl='$d_longdbl'
23960 d_longlong='$d_longlong'
23962 d_lrintl='$d_lrintl'
23963 d_lround='$d_lround'
23964 d_lroundl='$d_lroundl'
23965 d_lseekproto='$d_lseekproto'
23967 d_madvise='$d_madvise'
23968 d_malloc_good_size='$d_malloc_good_size'
23969 d_malloc_size='$d_malloc_size'
23971 d_mbrlen='$d_mbrlen'
23972 d_mbrtowc='$d_mbrtowc'
23973 d_mbstowcs='$d_mbstowcs'
23974 d_mbtowc='$d_mbtowc'
23975 d_memmem='$d_memmem'
23976 d_memrchr='$d_memrchr'
23978 d_mkdtemp='$d_mkdtemp'
23979 d_mkfifo='$d_mkfifo'
23980 d_mkstemp='$d_mkstemp'
23981 d_mkstemps='$d_mkstemps'
23982 d_mktime64='$d_mktime64'
23983 d_mktime='$d_mktime'
23986 d_modflproto='$d_modflproto'
23987 d_mprotect='$d_mprotect'
23989 d_msg_ctrunc='$d_msg_ctrunc'
23990 d_msg_dontroute='$d_msg_dontroute'
23991 d_msg_oob='$d_msg_oob'
23992 d_msg_peek='$d_msg_peek'
23993 d_msg_proxy='$d_msg_proxy'
23994 d_msgctl='$d_msgctl'
23995 d_msgget='$d_msgget'
23996 d_msghdr_s='$d_msghdr_s'
23997 d_msgrcv='$d_msgrcv'
23998 d_msgsnd='$d_msgsnd'
24000 d_munmap='$d_munmap'
24001 d_mymalloc='$d_mymalloc'
24003 d_nanosleep='$d_nanosleep'
24005 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24006 d_nearbyint='$d_nearbyint'
24007 d_newlocale='$d_newlocale'
24008 d_nextafter='$d_nextafter'
24009 d_nexttoward='$d_nexttoward'
24011 d_nl_langinfo='$d_nl_langinfo'
24012 d_nv_preserves_uv='$d_nv_preserves_uv'
24013 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24014 d_off64_t='$d_off64_t'
24015 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24016 d_oldpthreads='$d_oldpthreads'
24017 d_oldsock='$d_oldsock'
24019 d_openat='$d_openat'
24020 d_pathconf='$d_pathconf'
24022 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24023 d_phostname='$d_phostname'
24026 d_portable='$d_portable'
24028 d_prctl_set_name='$d_prctl_set_name'
24029 d_printf_format_null='$d_printf_format_null'
24030 d_procselfexe='$d_procselfexe'
24031 d_pseudofork='$d_pseudofork'
24032 d_pthread_atfork='$d_pthread_atfork'
24033 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24034 d_pthread_yield='$d_pthread_yield'
24035 d_ptrdiff_t='$d_ptrdiff_t'
24037 d_pwchange='$d_pwchange'
24038 d_pwclass='$d_pwclass'
24039 d_pwcomment='$d_pwcomment'
24040 d_pwexpire='$d_pwexpire'
24041 d_pwgecos='$d_pwgecos'
24042 d_pwpasswd='$d_pwpasswd'
24043 d_pwquota='$d_pwquota'
24046 d_querylocale='$d_querylocale'
24047 d_random_r='$d_random_r'
24048 d_re_comp='$d_re_comp'
24049 d_readdir64_r='$d_readdir64_r'
24050 d_readdir='$d_readdir'
24051 d_readdir_r='$d_readdir_r'
24052 d_readlink='$d_readlink'
24054 d_recvmsg='$d_recvmsg'
24055 d_regcmp='$d_regcmp'
24056 d_regcomp='$d_regcomp'
24057 d_remainder='$d_remainder'
24058 d_remquo='$d_remquo'
24059 d_rename='$d_rename'
24060 d_renameat='$d_renameat'
24061 d_rewinddir='$d_rewinddir'
24065 d_sbrkproto='$d_sbrkproto'
24066 d_scalbn='$d_scalbn'
24067 d_scalbnl='$d_scalbnl'
24068 d_sched_yield='$d_sched_yield'
24069 d_scm_rights='$d_scm_rights'
24070 d_seekdir='$d_seekdir'
24071 d_select='$d_select'
24073 d_semctl='$d_semctl'
24074 d_semctl_semid_ds='$d_semctl_semid_ds'
24075 d_semctl_semun='$d_semctl_semun'
24076 d_semget='$d_semget'
24078 d_sendmsg='$d_sendmsg'
24079 d_setegid='$d_setegid'
24080 d_seteuid='$d_seteuid'
24081 d_setgrent='$d_setgrent'
24082 d_setgrent_r='$d_setgrent_r'
24083 d_setgrps='$d_setgrps'
24084 d_sethent='$d_sethent'
24085 d_sethostent_r='$d_sethostent_r'
24086 d_setitimer='$d_setitimer'
24087 d_setlinebuf='$d_setlinebuf'
24088 d_setlocale='$d_setlocale'
24089 d_setlocale_r='$d_setlocale_r'
24090 d_setnent='$d_setnent'
24091 d_setnetent_r='$d_setnetent_r'
24092 d_setpent='$d_setpent'
24093 d_setpgid='$d_setpgid'
24094 d_setpgrp2='$d_setpgrp2'
24095 d_setpgrp='$d_setpgrp'
24096 d_setprior='$d_setprior'
24097 d_setproctitle='$d_setproctitle'
24098 d_setprotoent_r='$d_setprotoent_r'
24099 d_setpwent='$d_setpwent'
24100 d_setpwent_r='$d_setpwent_r'
24101 d_setregid='$d_setregid'
24102 d_setresgid='$d_setresgid'
24103 d_setresuid='$d_setresuid'
24104 d_setreuid='$d_setreuid'
24105 d_setrgid='$d_setrgid'
24106 d_setruid='$d_setruid'
24107 d_setsent='$d_setsent'
24108 d_setservent_r='$d_setservent_r'
24109 d_setsid='$d_setsid'
24110 d_setvbuf='$d_setvbuf'
24113 d_shmatprototype='$d_shmatprototype'
24114 d_shmctl='$d_shmctl'
24116 d_shmget='$d_shmget'
24117 d_sigaction='$d_sigaction'
24118 d_siginfo_si_addr='$d_siginfo_si_addr'
24119 d_siginfo_si_band='$d_siginfo_si_band'
24120 d_siginfo_si_errno='$d_siginfo_si_errno'
24121 d_siginfo_si_fd='$d_siginfo_si_fd'
24122 d_siginfo_si_pid='$d_siginfo_si_pid'
24123 d_siginfo_si_status='$d_siginfo_si_status'
24124 d_siginfo_si_uid='$d_siginfo_si_uid'
24125 d_siginfo_si_value='$d_siginfo_si_value'
24126 d_signbit='$d_signbit'
24127 d_sigprocmask='$d_sigprocmask'
24128 d_sigsetjmp='$d_sigsetjmp'
24129 d_sin6_scope_id='$d_sin6_scope_id'
24130 d_sitearch='$d_sitearch'
24131 d_sockaddr_in6='$d_sockaddr_in6'
24132 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24133 d_sockatmark='$d_sockatmark'
24134 d_sockatmarkproto='$d_sockatmarkproto'
24135 d_socket='$d_socket'
24136 d_socklen_t='$d_socklen_t'
24137 d_sockpair='$d_sockpair'
24138 d_socks5_init='$d_socks5_init'
24140 d_srand48_r='$d_srand48_r'
24141 d_srandom_r='$d_srandom_r'
24142 d_sresgproto='$d_sresgproto'
24143 d_sresuproto='$d_sresuproto'
24145 d_statblks='$d_statblks'
24146 d_statfs_f_flags='$d_statfs_f_flags'
24147 d_statfs_s='$d_statfs_s'
24148 d_static_inline='$d_static_inline'
24149 d_statvfs='$d_statvfs'
24150 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24151 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24152 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24153 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24154 d_stdio_stream_array='$d_stdio_stream_array'
24155 d_stdiobase='$d_stdiobase'
24156 d_stdstdio='$d_stdstdio'
24157 d_strcoll='$d_strcoll'
24158 d_strerror_l='$d_strerror_l'
24159 d_strerror_r='$d_strerror_r'
24160 d_strftime='$d_strftime'
24161 d_strlcat='$d_strlcat'
24162 d_strlcpy='$d_strlcpy'
24163 d_strnlen='$d_strnlen'
24164 d_strtod='$d_strtod'
24165 d_strtol='$d_strtol'
24166 d_strtold='$d_strtold'
24167 d_strtold_l='$d_strtold_l'
24168 d_strtoll='$d_strtoll'
24169 d_strtoq='$d_strtoq'
24170 d_strtoul='$d_strtoul'
24171 d_strtoull='$d_strtoull'
24172 d_strtouq='$d_strtouq'
24173 d_strxfrm='$d_strxfrm'
24174 d_suidsafe='$d_suidsafe'
24175 d_symlink='$d_symlink'
24176 d_syscall='$d_syscall'
24177 d_syscallproto='$d_syscallproto'
24178 d_sysconf='$d_sysconf'
24179 d_sysernlst='$d_sysernlst'
24180 d_syserrlst='$d_syserrlst'
24181 d_system='$d_system'
24182 d_tcgetpgrp='$d_tcgetpgrp'
24183 d_tcsetpgrp='$d_tcsetpgrp'
24184 d_telldir='$d_telldir'
24185 d_telldirproto='$d_telldirproto'
24186 d_tgamma='$d_tgamma'
24187 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24189 d_timegm='$d_timegm'
24191 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24192 d_tm_tm_zone='$d_tm_tm_zone'
24193 d_tmpnam_r='$d_tmpnam_r'
24195 d_truncate='$d_truncate'
24196 d_truncl='$d_truncl'
24197 d_ttyname_r='$d_ttyname_r'
24198 d_tzname='$d_tzname'
24199 d_u32align='$d_u32align'
24200 d_ualarm='$d_ualarm'
24203 d_union_semun='$d_union_semun'
24204 d_unlinkat='$d_unlinkat'
24205 d_unordered='$d_unordered'
24206 d_unsetenv='$d_unsetenv'
24207 d_uselocale='$d_uselocale'
24208 d_usleep='$d_usleep'
24209 d_usleepproto='$d_usleepproto'
24211 d_vendorarch='$d_vendorarch'
24212 d_vendorbin='$d_vendorbin'
24213 d_vendorlib='$d_vendorlib'
24214 d_vendorscript='$d_vendorscript'
24216 d_void_closedir='$d_void_closedir'
24217 d_voidsig='$d_voidsig'
24218 d_voidtty='$d_voidtty'
24220 d_waitpid='$d_waitpid'
24221 d_wcscmp='$d_wcscmp'
24222 d_wcstombs='$d_wcstombs'
24223 d_wcsxfrm='$d_wcsxfrm'
24224 d_wctomb='$d_wctomb'
24225 d_writev='$d_writev'
24228 db_hashtype='$db_hashtype'
24229 db_prefixtype='$db_prefixtype'
24230 db_version_major='$db_version_major'
24231 db_version_minor='$db_version_minor'
24232 db_version_patch='$db_version_patch'
24233 default_inc_excludes_dot='$default_inc_excludes_dot'
24234 direntrytype='$direntrytype'
24237 doubleinfbytes='$doubleinfbytes'
24238 doublekind='$doublekind'
24239 doublemantbits='$doublemantbits'
24240 doublenanbytes='$doublenanbytes'
24241 doublesize='$doublesize'
24243 drand48_r_proto='$drand48_r_proto'
24245 dtraceobject='$dtraceobject'
24246 dtracexnolibs='$dtracexnolibs'
24247 dynamic_ext='$dynamic_ext'
24253 endgrent_r_proto='$endgrent_r_proto'
24254 endhostent_r_proto='$endhostent_r_proto'
24255 endnetent_r_proto='$endnetent_r_proto'
24256 endprotoent_r_proto='$endprotoent_r_proto'
24257 endpwent_r_proto='$endpwent_r_proto'
24258 endservent_r_proto='$endservent_r_proto'
24259 eunicefix='$eunicefix'
24262 extensions='$extensions'
24263 extern_C='$extern_C'
24265 fflushNULL='$fflushNULL'
24266 fflushall='$fflushall'
24268 firstmakefile='$firstmakefile'
24270 fpossize='$fpossize'
24271 fpostype='$fpostype'
24272 freetype='$freetype'
24275 full_csh='$full_csh'
24276 full_sed='$full_sed'
24277 gccansipedantic='$gccansipedantic'
24278 gccosandvers='$gccosandvers'
24279 gccversion='$gccversion'
24280 getgrent_r_proto='$getgrent_r_proto'
24281 getgrgid_r_proto='$getgrgid_r_proto'
24282 getgrnam_r_proto='$getgrnam_r_proto'
24283 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24284 gethostbyname_r_proto='$gethostbyname_r_proto'
24285 gethostent_r_proto='$gethostent_r_proto'
24286 getlogin_r_proto='$getlogin_r_proto'
24287 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24288 getnetbyname_r_proto='$getnetbyname_r_proto'
24289 getnetent_r_proto='$getnetent_r_proto'
24290 getprotobyname_r_proto='$getprotobyname_r_proto'
24291 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24292 getprotoent_r_proto='$getprotoent_r_proto'
24293 getpwent_r_proto='$getpwent_r_proto'
24294 getpwnam_r_proto='$getpwnam_r_proto'
24295 getpwuid_r_proto='$getpwuid_r_proto'
24296 getservbyname_r_proto='$getservbyname_r_proto'
24297 getservbyport_r_proto='$getservbyport_r_proto'
24298 getservent_r_proto='$getservent_r_proto'
24299 getspnam_r_proto='$getspnam_r_proto'
24300 gidformat='$gidformat'
24306 gmtime_r_proto='$gmtime_r_proto'
24307 gnulibc_version='$gnulibc_version'
24309 groupcat='$groupcat'
24310 groupstype='$groupstype'
24313 h_sysfile='$h_sysfile'
24316 hostgenerate='$hostgenerate'
24317 hostosname='$hostosname'
24318 hostperl='$hostperl'
24319 html1dir='$html1dir'
24320 html1direxp='$html1direxp'
24321 html3dir='$html3dir'
24322 html3direxp='$html3direxp'
24331 i_arpainet='$i_arpainet'
24333 i_bsdioctl='$i_bsdioctl'
24337 i_dirent='$i_dirent'
24339 i_execinfo='$i_execinfo'
24343 i_fp_class='$i_fp_class'
24345 i_gdbm_ndbm='$i_gdbm_ndbm'
24346 i_gdbmndbm='$i_gdbmndbm'
24348 i_ieeefp='$i_ieeefp'
24349 i_inttypes='$i_inttypes'
24350 i_langinfo='$i_langinfo'
24351 i_libutil='$i_libutil'
24352 i_locale='$i_locale'
24353 i_machcthr='$i_machcthr'
24354 i_malloc='$i_malloc'
24355 i_mallocmalloc='$i_mallocmalloc'
24356 i_mntent='$i_mntent'
24359 i_neterrno='$i_neterrno'
24360 i_netinettcp='$i_netinettcp'
24364 i_pthread='$i_pthread'
24366 i_quadmath='$i_quadmath'
24367 i_rpcsvcdbm='$i_rpcsvcdbm'
24369 i_shadow='$i_shadow'
24371 i_stdbool='$i_stdbool'
24372 i_stdint='$i_stdint'
24373 i_stdlib='$i_stdlib'
24374 i_sunmath='$i_sunmath'
24375 i_sysaccess='$i_sysaccess'
24376 i_sysdir='$i_sysdir'
24377 i_sysfile='$i_sysfile'
24378 i_sysfilio='$i_sysfilio'
24380 i_sysioctl='$i_sysioctl'
24381 i_syslog='$i_syslog'
24382 i_sysmman='$i_sysmman'
24383 i_sysmode='$i_sysmode'
24384 i_sysmount='$i_sysmount'
24385 i_sysndir='$i_sysndir'
24386 i_sysparam='$i_sysparam'
24387 i_syspoll='$i_syspoll'
24388 i_sysresrc='$i_sysresrc'
24389 i_syssecrt='$i_syssecrt'
24390 i_sysselct='$i_sysselct'
24391 i_syssockio='$i_syssockio'
24392 i_sysstat='$i_sysstat'
24393 i_sysstatfs='$i_sysstatfs'
24394 i_sysstatvfs='$i_sysstatvfs'
24395 i_systime='$i_systime'
24396 i_systimek='$i_systimek'
24397 i_systimes='$i_systimes'
24398 i_systypes='$i_systypes'
24399 i_sysuio='$i_sysuio'
24401 i_sysutsname='$i_sysutsname'
24402 i_sysvfs='$i_sysvfs'
24403 i_syswait='$i_syswait'
24404 i_termio='$i_termio'
24405 i_termios='$i_termios'
24407 i_unistd='$i_unistd'
24412 i_xlocale='$i_xlocale'
24413 ignore_versioned_solibs='$ignore_versioned_solibs'
24414 inc_version_list='$inc_version_list'
24415 inc_version_list_init='$inc_version_list_init'
24419 initialinstalllocation='$initialinstalllocation'
24420 installarchlib='$installarchlib'
24421 installbin='$installbin'
24422 installhtml1dir='$installhtml1dir'
24423 installhtml3dir='$installhtml3dir'
24424 installman1dir='$installman1dir'
24425 installman3dir='$installman3dir'
24426 installprefix='$installprefix'
24427 installprefixexp='$installprefixexp'
24428 installprivlib='$installprivlib'
24429 installscript='$installscript'
24430 installsitearch='$installsitearch'
24431 installsitebin='$installsitebin'
24432 installsitehtml1dir='$installsitehtml1dir'
24433 installsitehtml3dir='$installsitehtml3dir'
24434 installsitelib='$installsitelib'
24435 installsiteman1dir='$installsiteman1dir'
24436 installsiteman3dir='$installsiteman3dir'
24437 installsitescript='$installsitescript'
24438 installstyle='$installstyle'
24439 installusrbinperl='$installusrbinperl'
24440 installvendorarch='$installvendorarch'
24441 installvendorbin='$installvendorbin'
24442 installvendorhtml1dir='$installvendorhtml1dir'
24443 installvendorhtml3dir='$installvendorhtml3dir'
24444 installvendorlib='$installvendorlib'
24445 installvendorman1dir='$installvendorman1dir'
24446 installvendorman3dir='$installvendorman3dir'
24447 installvendorscript='$installvendorscript'
24449 issymlink='$issymlink'
24450 ivdformat='$ivdformat'
24453 known_extensions='$known_extensions'
24456 ld_can_script='$ld_can_script'
24457 lddlflags='$lddlflags'
24459 ldflags_uselargefiles='$ldflags_uselargefiles'
24460 ldlibpthname='$ldlibpthname'
24467 libsdirs='$libsdirs'
24468 libsfiles='$libsfiles'
24469 libsfound='$libsfound'
24470 libspath='$libspath'
24471 libswanted='$libswanted'
24472 libswanted_uselargefiles='$libswanted_uselargefiles'
24478 localtime_r_proto='$localtime_r_proto'
24479 locincpth='$locincpth'
24480 loclibpth='$loclibpth'
24481 longdblinfbytes='$longdblinfbytes'
24482 longdblkind='$longdblkind'
24483 longdblmantbits='$longdblmantbits'
24484 longdblnanbytes='$longdblnanbytes'
24485 longdblsize='$longdblsize'
24486 longlongsize='$longlongsize'
24487 longsize='$longsize'
24491 lseeksize='$lseeksize'
24492 lseektype='$lseektype'
24496 make_set_make='$make_set_make'
24497 mallocobj='$mallocobj'
24498 mallocsrc='$mallocsrc'
24499 malloctype='$malloctype'
24501 man1direxp='$man1direxp'
24504 man3direxp='$man3direxp'
24506 mips_type='$mips_type'
24507 mistrustnm='$mistrustnm'
24509 mmaptype='$mmaptype'
24510 modetype='$modetype'
24512 multiarch='$multiarch'
24514 myarchname='$myarchname'
24515 mydomain='$mydomain'
24516 myhostname='$myhostname'
24519 need_va_copy='$need_va_copy'
24520 netdb_hlen_type='$netdb_hlen_type'
24521 netdb_host_type='$netdb_host_type'
24522 netdb_name_type='$netdb_name_type'
24523 netdb_net_type='$netdb_net_type'
24526 nm_so_opt='$nm_so_opt'
24527 nonxs_ext='$nonxs_ext'
24529 nvEUformat='$nvEUformat'
24530 nvFUformat='$nvFUformat'
24531 nvGUformat='$nvGUformat'
24532 nv_overflows_integers_at='$nv_overflows_integers_at'
24533 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24534 nveformat='$nveformat'
24535 nvfformat='$nvfformat'
24536 nvgformat='$nvgformat'
24537 nvmantbits='$nvmantbits'
24540 o_nonblock='$o_nonblock'
24542 old_pthread_create_joinable='$old_pthread_create_joinable'
24543 optimize='$optimize'
24544 orderlib='$orderlib'
24547 otherlibdirs='$otherlibdirs'
24551 patchlevel='$patchlevel'
24552 path_sep='$path_sep'
24555 perl_patchlevel='$perl_patchlevel'
24556 perl_static_inline='$perl_static_inline'
24557 perladmin='$perladmin'
24558 perllibs='$perllibs'
24559 perlpath='$perlpath'
24561 phostname='$phostname'
24567 prefixexp='$prefixexp'
24569 privlibexp='$privlibexp'
24570 procselfexe='$procselfexe'
24572 quadkind='$quadkind'
24573 quadtype='$quadtype'
24574 randbits='$randbits'
24575 randfunc='$randfunc'
24576 random_r_proto='$random_r_proto'
24577 randseedtype='$randseedtype'
24579 rd_nodata='$rd_nodata'
24580 readdir64_r_proto='$readdir64_r_proto'
24581 readdir_r_proto='$readdir_r_proto'
24582 revision='$revision'
24588 sGMTIME_max='$sGMTIME_max'
24589 sGMTIME_min='$sGMTIME_min'
24590 sLOCALTIME_max='$sLOCALTIME_max'
24591 sLOCALTIME_min='$sLOCALTIME_min'
24592 sPRIEUldbl='$sPRIEUldbl'
24593 sPRIFUldbl='$sPRIFUldbl'
24594 sPRIGUldbl='$sPRIGUldbl'
24595 sPRIXU64='$sPRIXU64'
24597 sPRIeldbl='$sPRIeldbl'
24598 sPRIfldbl='$sPRIfldbl'
24599 sPRIgldbl='$sPRIgldbl'
24604 sSCNfldbl='$sSCNfldbl'
24605 sched_yield='$sched_yield'
24606 scriptdir='$scriptdir'
24607 scriptdirexp='$scriptdirexp'
24609 seedfunc='$seedfunc'
24610 selectminbits='$selectminbits'
24611 selecttype='$selecttype'
24612 sendmail='$sendmail'
24613 setgrent_r_proto='$setgrent_r_proto'
24614 sethostent_r_proto='$sethostent_r_proto'
24615 setlocale_r_proto='$setlocale_r_proto'
24616 setnetent_r_proto='$setnetent_r_proto'
24617 setprotoent_r_proto='$setprotoent_r_proto'
24618 setpwent_r_proto='$setpwent_r_proto'
24619 setservent_r_proto='$setservent_r_proto'
24622 sharpbang='$sharpbang'
24623 shmattype='$shmattype'
24624 shortsize='$shortsize'
24627 sig_count='$sig_count'
24628 sig_name='$sig_name'
24629 sig_name_init='$sig_name_init'
24631 sig_num_init='$sig_num_init'
24632 sig_size='$sig_size'
24633 signal_t='$signal_t'
24634 sitearch='$sitearch'
24635 sitearchexp='$sitearchexp'
24637 sitebinexp='$sitebinexp'
24638 sitehtml1dir='$sitehtml1dir'
24639 sitehtml1direxp='$sitehtml1direxp'
24640 sitehtml3dir='$sitehtml3dir'
24641 sitehtml3direxp='$sitehtml3direxp'
24643 sitelib_stem='$sitelib_stem'
24644 sitelibexp='$sitelibexp'
24645 siteman1dir='$siteman1dir'
24646 siteman1direxp='$siteman1direxp'
24647 siteman3dir='$siteman3dir'
24648 siteman3direxp='$siteman3direxp'
24649 siteprefix='$siteprefix'
24650 siteprefixexp='$siteprefixexp'
24651 sitescript='$sitescript'
24652 sitescriptexp='$sitescriptexp'
24653 sizesize='$sizesize'
24654 sizetype='$sizetype'
24658 sockethdr='$sockethdr'
24659 socketlib='$socketlib'
24660 socksizetype='$socksizetype'
24662 spackage='$spackage'
24663 spitshell='$spitshell'
24664 srand48_r_proto='$srand48_r_proto'
24665 srandom_r_proto='$srandom_r_proto'
24667 ssizetype='$ssizetype'
24668 st_ino_sign='$st_ino_sign'
24669 st_ino_size='$st_ino_size'
24670 startperl='$startperl'
24672 static_ext='$static_ext'
24674 stdio_base='$stdio_base'
24675 stdio_bufsiz='$stdio_bufsiz'
24676 stdio_cnt='$stdio_cnt'
24677 stdio_filbuf='$stdio_filbuf'
24678 stdio_ptr='$stdio_ptr'
24679 stdio_stream_array='$stdio_stream_array'
24680 strerror_r_proto='$strerror_r_proto'
24682 subversion='$subversion'
24687 targetarch='$targetarch'
24688 targetdir='$targetdir'
24689 targetenv='$targetenv'
24690 targethost='$targethost'
24691 targetmkdir='$targetmkdir'
24692 targetport='$targetport'
24693 targetsh='$targetsh'
24697 timeincl='$timeincl'
24698 timetype='$timetype'
24699 tmpnam_r_proto='$tmpnam_r_proto'
24705 ttyname_r_proto='$ttyname_r_proto'
24714 uidformat='$uidformat'
24720 uquadtype='$uquadtype'
24721 use5005threads='$use5005threads'
24722 use64bitall='$use64bitall'
24723 use64bitint='$use64bitint'
24724 usecbacktrace='$usecbacktrace'
24725 usecrosscompile='$usecrosscompile'
24726 usedevel='$usedevel'
24728 usedtrace='$usedtrace'
24729 usefaststdio='$usefaststdio'
24730 useithreads='$useithreads'
24731 usekernprocpathname='$usekernprocpathname'
24732 uselargefiles='$uselargefiles'
24733 uselongdouble='$uselongdouble'
24734 usemallocwrap='$usemallocwrap'
24735 usemorebits='$usemorebits'
24736 usemultiplicity='$usemultiplicity'
24737 usemymalloc='$usemymalloc'
24739 usensgetexecutablepath='$usensgetexecutablepath'
24740 useopcode='$useopcode'
24741 useperlio='$useperlio'
24742 useposix='$useposix'
24743 usequadmath='$usequadmath'
24744 usereentrant='$usereentrant'
24745 userelocatableinc='$userelocatableinc'
24746 useshrplib='$useshrplib'
24747 usesitecustomize='$usesitecustomize'
24748 usesocks='$usesocks'
24749 usethreads='$usethreads'
24750 usevendorprefix='$usevendorprefix'
24751 useversionedarchname='$useversionedarchname'
24752 usevfork='$usevfork'
24755 uvXUformat='$uvXUformat'
24756 uvoformat='$uvoformat'
24759 uvuformat='$uvuformat'
24760 uvxformat='$uvxformat'
24761 vendorarch='$vendorarch'
24762 vendorarchexp='$vendorarchexp'
24763 vendorbin='$vendorbin'
24764 vendorbinexp='$vendorbinexp'
24765 vendorhtml1dir='$vendorhtml1dir'
24766 vendorhtml1direxp='$vendorhtml1direxp'
24767 vendorhtml3dir='$vendorhtml3dir'
24768 vendorhtml3direxp='$vendorhtml3direxp'
24769 vendorlib='$vendorlib'
24770 vendorlib_stem='$vendorlib_stem'
24771 vendorlibexp='$vendorlibexp'
24772 vendorman1dir='$vendorman1dir'
24773 vendorman1direxp='$vendorman1direxp'
24774 vendorman3dir='$vendorman3dir'
24775 vendorman3direxp='$vendorman3direxp'
24776 vendorprefix='$vendorprefix'
24777 vendorprefixexp='$vendorprefixexp'
24778 vendorscript='$vendorscript'
24779 vendorscriptexp='$vendorscriptexp'
24781 version_patchlevel_string='$version_patchlevel_string'
24782 versiononly='$versiononly'
24786 yaccflags='$yaccflags'
24791 : add special variables
24792 $test -f $src/patchlevel.h && \
24793 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24794 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24795 echo "PERL_CONFIG_SH=true" >>config.sh
24797 : propagate old symbols
24798 if $test -f UU/config.sh; then
24799 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24800 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24801 config.sh config.sh UU/oldconfig.sh |\
24802 $sort | $uniq -u >UU/oldsyms
24803 set X `$cat UU/oldsyms`
24809 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24811 echo ": Variables propagated from previous config.sh file." >>config.sh
24812 for sym in `$cat UU/oldsyms`; do
24813 echo " Propagating $hint variable "'$'"$sym..."
24814 eval 'tmp="$'"${sym}"'"'
24816 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24822 : preserve RCS keywords in files with variable substitution, grrr
24825 : Finish up by extracting the .SH files
24828 echo "Stopping at your request, leaving temporary files around."
24838 If you'd like to make any changes to the config.sh file before I begin
24839 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24842 rp="Press return or use a shell escape to edit config.sh:"
24847 *) : in case they cannot read
24848 sh 1>&4 -c "$ans";;
24853 : if this fails, just run all the .SH files by hand
24862 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24869 Now you need to generate make dependencies by running "$make depend".
24870 You might prefer to run it in background: "$make depend > makedepend.out &"
24871 It can take a while, so you might not want to run it right now.
24876 rp="Run $make depend now?"
24880 $make depend && echo "Now you must run '$make'."
24883 echo "You must run '$make depend' then '$make'."
24886 elif test -f [Mm]akefile; then
24888 echo "Now you must run a $make."
24890 echo "Configure done."
24893 if $test -f Policy.sh; then
24896 If you compile $package on a different machine or from a different object
24897 directory, copy the Policy.sh file from this object directory to the
24898 new one before you run Configure -- this will help you with most of
24899 the policy defaults.
24903 if $test -f UU/config.msg; then
24904 echo "Hmm. I also noted the following information while running:"
24906 $cat UU/config.msg >&4
24908 $rm -f kit*isdone ark*isdone