3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # (with additional metaconfig patches by perlbug@perl.org)
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
384 d_attribute_deprecated=''
385 d_attribute_format=''
386 d_attribute_malloc=''
387 d_attribute_nonnull=''
388 d_attribute_noreturn=''
390 d_attribute_unused=''
391 d_attribute_warn_unused_result=''
392 d_printf_format_null=''
396 d_builtin_choose_expr=''
399 d_c99_variadic_macros=''
449 endhostent_r_proto=''
455 endprotoent_r_proto=''
461 endservent_r_proto=''
533 gethostbyaddr_r_proto=''
535 gethostbyname_r_proto=''
537 gethostent_r_proto=''
550 getnetbyaddr_r_proto=''
552 getnetbyname_r_proto=''
566 d_getprotobyname_r=''
567 getprotobyname_r_proto=''
568 d_getprotobynumber_r=''
569 getprotobynumber_r_proto=''
571 getprotoent_r_proto=''
583 getservbyname_r_proto=''
585 getservbyport_r_proto=''
587 getservent_r_proto=''
620 d_lc_monetary_2008=''
625 d_libm_lib_version=''
632 d_localtime_r_needs_tzset=''
640 d_long_double_style_ieee=''
641 d_long_double_style_ieee_doubledouble=''
642 d_long_double_style_ieee_extended=''
643 d_long_double_style_ieee_std=''
644 d_long_double_style_vax=''
657 d_malloc_good_size=''
712 d_old_pthread_create_joinable=''
713 old_pthread_create_joinable=''
715 d_pthread_attr_setscope=''
763 sethostent_r_proto=''
780 setprotoent_r_proto=''
792 setservent_r_proto=''
805 d_siginfo_si_errno=''
808 d_siginfo_si_status=''
810 d_siginfo_si_value=''
822 d_ipv6_mreq_source=''
839 d_sprintf_returns_strlen=''
852 perl_static_inline=''
857 d_stdio_ptr_lval_nochange_cnt=''
858 d_stdio_ptr_lval_sets_cnt=''
943 default_inc_excludes_dot=''
1014 d_gdbm_ndbm_h_uses_prototypes=''
1015 d_gdbmndbm_h_uses_prototypes=''
1017 d_ndbm_h_uses_prototypes=''
1093 d_inc_version_list=''
1095 inc_version_list_init=''
1103 installusrbinperl=''
1119 ignore_versioned_solibs=''
1135 d_double_has_negative_zero=''
1136 d_double_has_subnormals=''
1137 d_double_style_cray=''
1138 d_double_style_ibm=''
1139 d_double_style_ieee=''
1140 d_double_style_vax=''
1191 d_perl_otherlibdirs=''
1199 api_versionstring=''
1205 version_patchlevel_string=''
1209 d_nv_preserves_uv=''
1210 d_nv_zero_is_allbits_zero=''
1221 nv_overflows_integers_at=''
1222 nv_preserves_uv_bits=''
1295 installsitehtml1dir=''
1298 installsitehtml3dir=''
1305 installsiteman1dir=''
1308 installsiteman3dir=''
1313 installsitescript=''
1331 d_stdio_stream_array=''
1332 stdio_stream_array=''
1350 usekernprocpathname=''
1351 ccflags_uselargefiles=''
1352 ldflags_uselargefiles=''
1353 libswanted_uselargefiles=''
1362 usensgetexecutablepath=''
1376 installvendorarch=''
1383 installvendorhtml1dir=''
1385 vendorhtml1direxp=''
1386 installvendorhtml3dir=''
1388 vendorhtml3direxp=''
1394 installvendorman1dir=''
1397 installvendorman3dir=''
1404 installvendorscript=''
1415 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1418 : We must find out about Eunice early
1420 if test -f /etc/unixtovms; then
1421 eunicefix=/etc/unixtovms
1423 if test -f /etc/unixtovms.exe; then
1424 eunicefix=/etc/unixtovms.exe
1427 : Set executable suffix now -- needed before hints available
1428 if test -f "/libs/version.library"; then
1431 elif test -f "/system/gnu_library/bin/ar.pm"; then
1434 elif test -n "$DJGPP"; then
1437 elif test -f /kern/cookiejar; then
1440 elif test -d c:/. -o -n "$is_os2" ; then
1447 : Possible local include directories to search.
1448 : Set locincpth to "" in a hint file to defeat local include searches.
1449 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1450 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1452 : no include file wanted by default
1455 : Enable -DEBUGGING and -DDEBUGGING from the command line
1459 : Trailing extension. Override this in a hint file, if needed.
1460 : Extra object files, if any, needed on this platform.
1463 : change the next line if compiling for Xenix/286 on Xenix/386
1464 xlibpth='/usr/lib/386 /lib/386'
1465 : Possible local library directories to search.
1466 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1467 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1469 : general looking path for locating libraries
1470 glibpth="/lib /usr/lib $xlibpth"
1471 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1472 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1473 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1474 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1476 : Private path used by Configure to find libraries. Its value
1477 : is prepended to libpth. This variable takes care of special
1478 : machines, like the mips. Usually, it should be empty.
1481 : default library list
1483 : some systems want to use only the non-versioned libso:s
1484 ignore_versioned_solibs=''
1488 : set useposix=false in your hint file to disable the POSIX extension.
1490 : set useopcode=false in your hint file to disable the Opcode extension.
1493 ccflags_uselargefiles=''
1494 ldflags_uselargefiles=''
1495 libswanted_uselargefiles=''
1496 : set usemultiplicity on the Configure command line to enable multiplicity.
1497 : set usesocks on the Configure command line to enable socks.
1499 : set usethreads on the Configure command line to enable threads.
1500 usereentrant='undef'
1501 : List of libraries we want.
1502 : If anyone needs extra -lxxx, put those in a hint file.
1503 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1504 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1505 : We probably want to search /usr/shlib before most other libraries.
1506 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1507 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1508 glibpth="/usr/shlib $glibpth"
1509 : Do not use vfork unless overridden by a hint file.
1512 : Find the basic shell for Bourne shell scripts
1516 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1519 if test -f "$xxx"; then
1522 : Build up a list and do a single loop so we can 'break' out.
1523 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1524 for xxx in sh bash ksh pdksh ash; do
1526 try="$try ${p}/${xxx}"
1530 if test -f "$xxx"; then
1533 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1536 elif test -f "$xxx.exe"; then
1547 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1549 Usually it's in /bin/sh. How did you even get this far?
1550 Please contact me (Perl Maintainers) at perlbug@perl.org and
1551 we'll try to straighten this all out.
1557 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1558 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1561 : see if sh knows # comments
1562 if `$sh -c '#' >/dev/null 2>&1`; then
1566 test -f $xcat$_exe || xcat=/usr/bin/cat
1567 if test ! -f $xcat$_exe; then
1568 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1569 if test -f $p/cat$_exe; then
1574 if test ! -f $xcat$_exe; then
1575 echo "Can't find cat anywhere!"
1579 echo "#!$xcat" >sharp
1582 ./sharp > today 2>/dev/null
1583 if test -s today; then
1586 echo "#! $xcat" > sharp
1589 ./sharp > today 2>/dev/null
1590 if test -s today; then
1598 echo "Your $sh doesn't grok # comments--I will strip them later on."
1601 echo "exec grep -v '^[ ]*#'" >spitshell
1603 $eunicefix spitshell
1604 spitshell=`pwd`/spitshell
1606 echo "I presume that if # doesn't work, #! won't work either!"
1611 : figure out how to guarantee sh startup
1613 '') startsh=${sharpbang}${sh} ;;
1625 : echo "Yup, it does."
1627 echo "Hmm... '$startsh' does not guarantee sh startup..."
1628 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1632 : Save command line options in file UU/cmdline.opt for later use in
1633 : generating config.sh.
1634 cat > cmdline.opt <<EOSH
1635 : Configure command line arguments.
1644 cat >>cmdline.opt <<EOSH
1645 config_arg$argn='$arg'
1647 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1650 arg_exp=`cat cmdl.opt`
1651 args_exp="$args_exp$args_sep'$arg_exp'"
1652 argn=`expr $argn + 1`
1657 : produce awk script to parse command line options
1658 cat >options.awk <<'EOF'
1660 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1662 len = length(optstr);
1663 for (i = 1; i <= len; i++) {
1664 c = substr(optstr, i, 1);
1665 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1676 if (substr(str, 1, 1) != "-") {
1677 printf("'%s'\n", str);
1681 for (i = 2; i <= len; i++) {
1682 c = substr(str, i, 1);
1684 printf("-%s\n", substr(str, i));
1690 printf("'%s'\n", substr(str, i + 1));
1703 : process the command line options
1704 set X `for arg in "$@"; do echo "X$arg"; done |
1705 sed -e s/X// | awk -f options.awk`
1710 : set up default values
1719 rm -f optdef.sh posthint.sh
1720 cat >optdef.sh <<EOS
1726 while test $# -gt 0; do
1728 -d) shift; fastread=yes;;
1729 -e) shift; alldone=cont;;
1733 if test -r "$1"; then
1736 echo "$me: cannot read config file $1." >&2
1742 -h) shift; error=true;;
1743 -r) shift; reuseval=true;;
1744 -s) shift; silent=true; realsilent=true;;
1745 -E) shift; alldone=exit;;
1746 -K) shift; knowitall=true;;
1748 -S) shift; silent=true; extractsh=true;;
1753 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1754 echo "$me: ignoring -D $1" >&2
1757 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1758 *) echo "$1='define'" >> optdef.sh;;
1765 *=) echo "$1" >> optdef.sh;;
1767 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1768 echo "$me: ignoring -U $1" >&2
1770 *) echo "$1='undef'" >> optdef.sh;;
1781 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1785 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1786 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1792 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1793 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1794 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1795 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1796 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1797 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1803 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1805 echo "$yyy=''" >> posthint.sh ;;
1810 echo "$yyy='$zzz'" >> posthint.sh ;;
1812 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1814 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1819 echo "$yyy=$zzz" >> posthint.sh ;;
1820 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1824 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1827 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1835 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1836 [-U symbol] [-U symbol=] [-A command:symbol...]
1837 -d : use defaults for all answers.
1838 -e : go on without questioning past the production of config.sh.
1839 -f : specify an alternate default configuration file.
1840 -h : print this help message and exit (with an error status).
1841 -r : reuse C symbols value if possible (skips costly nm extraction).
1842 -s : silent mode, only echoes questions and essential information.
1843 -D : define symbol to have some value:
1844 -D symbol symbol gets the value 'define'
1845 -D symbol=value symbol gets the value 'value'
1846 common used examples (see INSTALL for more info):
1847 -Duse64bitint use 64bit integers
1848 -Duse64bitall use 64bit integers and pointers
1849 -Dusethreads use thread support
1850 -Dinc_version_list=none do not include older perl trees in @INC
1851 -DEBUGGING=none DEBUGGING options
1852 -Dcc=gcc choose your compiler
1853 -Dprefix=/opt/perl5 choose your destination
1854 -E : stop at the end of questions, after having produced config.sh.
1855 -K : do not use unless you know what you are doing.
1856 -O : ignored for backward compatibility
1857 -S : perform variable substitutions on all .SH files (can mix with -f)
1858 -U : undefine symbol:
1859 -U symbol symbol gets the value 'undef'
1860 -U symbol= symbol gets completely empty
1862 -A : manipulate symbol after the platform specific hints have been applied:
1863 -A append:symbol=value append value to symbol
1864 -A symbol=value like append:, but with a separating space
1865 -A define:symbol=value define symbol to have value
1866 -A clear:symbol define symbol to be ''
1867 -A define:symbol define symbol to be 'define'
1868 -A eval:symbol=value define symbol to be eval of value
1869 -A prepend:symbol=value prepend value to symbol
1870 -A undef:symbol define symbol to be 'undef'
1871 -A undef:symbol= define symbol to be ''
1872 e.g.: -A prepend:libswanted='cl pthread '
1873 -A ccflags=-DSOME_MACRO
1874 -V : print version number and exit (with a zero status).
1881 case "$fastread$alldone" in
1884 case "$extractsh" in
1887 if test ! -t 0; then
1888 echo "Say 'sh Configure', not 'sh <Configure'"
1898 true) exec 1>/dev/null;;
1901 : run the defines and the undefines, if any, but leave the file out there...
1903 grep '\\' optdef.sh >/dev/null 2>&1
1904 if test $? = 0; then
1905 echo "Configure does not support \\ in -D arguments"
1909 : create the posthint manipulation script and leave the file out there...
1914 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1915 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1916 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1917 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1918 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1921 : Some greps do not return status, grrr.
1922 echo "grimblepritz" >grimble
1923 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1925 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1931 : the following should work in any shell
1935 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1936 cat >contains <<'EOSS'
1937 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1942 : Find the path to the source tree
1945 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1949 *) src=`cd ../$src && pwd` ;;
1962 if test -f $rsrc/Configure && \
1963 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1965 : found it, so we are ok.
1968 for src in . .. ../.. ../../.. ../../../..; do
1969 if test -f ../$src/Configure && \
1970 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1981 Sorry, I can't seem to locate the source dir for $package. Please start
1982 Configure with an explicit path -- i.e. /some/path/Configure.
1990 echo "Sources for $package found in \"$src\"." >&4
1994 : script used to extract .SH files with variable substitutions
1995 cat >extract <<'EOS'
1997 echo "Doing variable substitutions on .SH files..."
1998 if test -f MANIFEST; then
1999 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
2001 echo "(Looking for .SH files under the source directory.)"
2002 set x `(cd "$src"; find . -name "*.SH" -print)`
2006 0) set x `(cd "$src"; echo *.SH)`; shift;;
2008 if test ! -f "$src/$1"; then
2014 while test $name; do
2015 if test ! -d "$name"; then
2016 create="$name $create";
2017 name=`echo $name | sed -e "s|^[^/]*$||"`;
2018 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2023 for file in $create; do
2032 dir=`expr X$file : 'X\(.*\)/'`
2033 file=`expr X$file : 'X.*/\(.*\)'`
2034 (cd "$dir" && . ./$file)
2044 dir=`expr X$file : 'X\(.*\)/'`
2045 file=`expr X$file : 'X.*/\(.*\)'`
2046 (set x $dir; shift; eval $mkdir_p)
2047 sh <"$src/$dir/$file"
2056 if test -f "$src/config_h.SH"; then
2057 if test ! -f config.h; then
2058 : oops, they left it out of MANIFEST, probably, so do it anyway.
2059 . "$src/config_h.SH"
2064 : extract files and exit if asked to do so
2065 case "$extractsh" in
2067 case "$realsilent" in
2071 case "$config_sh" in
2072 '') config_sh='config.sh';;
2075 echo "Fetching answers from $config_sh..."
2082 echo "Extraction done."
2087 : Eunice requires " " instead of "", can you believe it
2090 echo "Beginning of configuration questions for $package."
2092 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2094 : first determine how to suppress newline on echo command
2096 echo "Checking echo to see how to suppress newlines..."
2097 (echo "hi there\c" ; echo " ") >.echotmp
2098 if $contains c .echotmp >/dev/null 2>&1 ; then
2109 echo $n "The star should be here-->$c"
2113 : Now test for existence of everything in MANIFEST
2115 if test -f "$rsrc/MANIFEST"; then
2116 echo "First let's make sure your kit is complete. Checking..." >&4
2117 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2118 (split -l 50 2>/dev/null || split -50)
2121 for filelist in x??; do
2122 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2123 >/dev/null 2>>"$tmppwd/missing")
2125 if test -s missing; then
2129 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2131 You have the option of continuing the configuration process, despite the
2132 distinct possibility that your kit is damaged, by typing 'y'es. If you
2133 do, don't blame me if something goes wrong. I advise you to type 'n'o
2134 and contact the author (perlbug@perl.org).
2137 echo $n "Continue? [n] $c" >&4
2141 echo "Continuing..." >&4
2145 echo "ABORTING..." >&4
2150 echo "Looks good..."
2153 echo "There is no MANIFEST file. I hope your kit is complete !"
2157 : Find the appropriate value for a newline for tr
2158 if test -n "$DJGPP"; then
2161 if test X"$trnl" = X; then
2162 case "`echo foo | tr '\n' x 2>/dev/null`" in
2166 if test X"$trnl" = X; then
2167 case "`echo foo | tr '\012' x 2>/dev/null`" in
2168 foox) trnl='\012' ;;
2171 if test X"$trnl" = X; then
2172 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2173 fooxy) trnl='\n\r' ;;
2176 if test X"$trnl" = X; then
2179 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2185 : compute the number of columns on the terminal for proper question formatting
2190 : set up the echo used in my read
2191 myecho="case \"\$xxxm\" in
2192 '') echo $n \"\$rp $c\" >&4;;
2194 '') echo $n \"[\$xxxm] $c\";;
2196 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2198 echo $n \"[\$xxxm] $c\" >&4
2200 echo $n \"\$rp [\$xxxm] $c\" >&4
2206 : now set up to do reads with possible shell escape and default assignment
2212 case "\$fastread" in
2213 yes) case "\$dflt" in
2216 case "\$silent-\$rp" in
2221 *) case "\$silent" in
2222 true) case "\$rp" in
2227 while expr "X\$ans" : "X!" >/dev/null; do
2231 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2239 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2248 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2253 echo "(OK, I'll run with -d after this question.)" >&4
2256 echo "*** Sorry, \$1 not supported yet." >&4
2266 echo "*** Substitution done -- please confirm."
2268 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2273 echo "*** Error -- try again."
2280 case "\$ans\$xxxm\$nostick" in
2292 : create .config dir to save info across Configure sessions
2293 test -d ../.config || mkdir ../.config
2294 cat >../.config/README <<EOF
2295 This directory created by Configure to save information that should
2296 persist across sessions for $package.
2298 You may safely delete it if you wish.
2301 : See if we are using a devel version and want that
2302 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2305 usedevel="$define" ;;
2306 *) case "$xversion" in
2309 *** WHOA THERE!!! ***
2311 This is an UNSTABLE DEVELOPMENT release.
2312 The version of this $package distribution is $xversion, that is, odd,
2313 (as opposed to even) and that signifies a development release.
2314 If you want a maintenance release, you want an even-numbered version.
2316 Do ***NOT*** install this into production use.
2317 Data corruption and crashes are possible.
2319 It is most seriously suggested that you do not continue any further
2320 unless you want to help in developing and debugging Perl.
2322 If you *still* want to build perl, you can answer 'y' now,
2323 or pass -Dusedevel to Configure.
2326 rp='Do you really want to continue?'
2330 [yY]) echo >&4 "Okay, continuing."
2331 usedevel="$define" ;;
2332 *) echo >&4 "Okay, bye."
2343 case "$versiononly" in
2344 '') versiononly="$define" ;;
2346 case "$installusrbinperl" in
2347 '') installusrbinperl="$undef" ;;
2352 : general instructions
2355 user=`(logname) 2>/dev/null`
2357 '') user=`whoami 2>&1`;;
2359 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2362 rp='Would you like to see the instructions?'
2373 This installation shell script will examine your system and ask you questions
2374 to determine how the perl5 package should be installed. If you get
2375 stuck on a question, you may use a ! shell escape to start a subshell or
2376 execute a command. Many of the questions will have default answers in square
2377 brackets; typing carriage return will give you the default.
2379 On some of the questions which ask for file or directory names you are allowed
2380 to use the ~name construct to specify the login directory belonging to "name",
2381 even if you don't have a shell which knows about that. Questions where this is
2382 allowed will be marked "(~name ok)".
2386 dflt='Type carriage return to continue'
2390 The prompter used in this script allows you to use shell variables and
2391 backticks in your answers. You may use $1, $2, etc... to refer to the words
2392 in the default answer, as if the default line was a set of arguments given to a
2393 script shell. This means you may also use $* to repeat the whole default line,
2394 so you do not have to re-type everything to add something to the default.
2396 Every time there is a substitution, you will have to confirm. If there is an
2397 error (e.g. an unmatched backtick), the default answer will remain unchanged
2398 and you will be prompted again.
2400 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2401 the questions and use the computed defaults (or the previous answers if there
2402 was already a config.sh file). Type 'Configure -h' for a list of options.
2403 You may also start interactively and then answer '& -d' at any prompt to turn
2404 on the non-interactive behaviour for the remainder of the execution.
2410 Much effort has been expended to ensure that this shell script will run on any
2411 Unix system. If despite that it blows up on yours, your best bet is to edit
2412 Configure and run it again. If you can't run Configure for some reason,
2413 you'll have to generate a config.sh file by hand. Whatever problems you
2414 have, let me (perlbug@perl.org) know how I blew it.
2416 This installation script affects things in two ways:
2418 1) it may do direct variable substitutions on some of the files included
2420 2) it builds a config.h file for inclusion in C programs. You may edit
2421 any of these files as the need arises after running this script.
2423 If you make a mistake on a question, there is no easy way to back up to it
2424 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2425 files. Configure will offer to let you do this before it runs the SH files.
2428 dflt='Type carriage return to continue'
2430 case "$firsttime" in
2431 true) echo $user >>../.config/instruct;;
2435 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2436 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2437 if test "X$sysroot" = X; then
2442 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2443 # _sysroot is used in places where we need --sysroot=foo
2444 # but using the rest of the flags could cause issues.
2445 _sysroot="--sysroot=$sysroot";
2449 ccflags="$ccflags $_sysroot"
2454 ldflags="$ldflags $_sysroot"
2459 cppflags="$cppflags $_sysroot"
2461 # lddlflags updated below in lddlflags section;
2462 # same with cccdlflags
2466 # Adjust some defaults to also use $sysroot
2467 for var in xlibpth loclibpth locincpth glibpth; do
2470 for path in $xxx; do
2471 eval $var=\"\$$var $sysroot$path\"
2477 : find out where common programs are
2479 echo "Locating common programs..." >&4
2492 if test -d \$dir/\$thing; then
2498 for thisthing in \$dir/\$thing; do
2499 : just loop through to pick last item
2501 if test -f \$thisthing; then
2504 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2507 elif test -f \$dir/\$thing.exe; then
2508 if test -n "$DJGPP"; then
2509 echo \$dir/\$thing.exe
2510 elif test "$eunicefix" != ":"; then
2511 : on Eunice apparently
2564 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2565 pth="$pth $sysroot/lib $sysroot/usr/lib"
2566 for file in $loclist; do
2570 if test -f "$xxx"; then
2573 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2574 xxx=`./loc $file $file $pth`
2577 '') xxx=`./loc $file $file $pth`;;
2578 *) xxx=`./loc $xxx $xxx $pth`;;
2580 eval $file=$xxx$_exe
2584 echo $file is in $xxx.
2587 echo $file is in $xxx.
2590 echo "I don't know where '$file' is, and my life depends on it." >&4
2591 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2597 echo "Don't worry if any of the following aren't found..."
2599 for file in $trylist; do
2603 if test -f "$xxx"; then
2606 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2607 xxx=`./loc $file $file $pth`
2610 '') xxx=`./loc $file $file $pth`;;
2611 *) xxx=`./loc $xxx $xxx $pth`;;
2613 eval $file=$xxx$_exe
2617 echo $file is in $xxx.
2620 echo $file is in $xxx.
2623 echo "I don't see $file out there, $say."
2630 echo "Substituting grep for egrep."
2637 *) if $less -R </dev/null >/dev/null 2>&1; then
2638 echo "Substituting less -R for less."
2646 echo "Substituting cp for ln."
2655 echo "I can't find make or gmake, and my life depends on it." >&4
2656 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2664 *) # We can't have osname yet.
2665 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2666 # Assume that gmake, if found, is definitely GNU make
2667 # and prefer it over the system make.
2668 echo "Substituting gmake for make."
2676 echo "Hopefully test is built into your sh."
2679 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2680 echo "Using the test built into your sh."
2688 echo "Hopefully echo is built into your sh."
2693 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2694 $echo $n "hi there$c" >foo1
2695 echo $n "hi there$c" >foo2
2696 if cmp foo1 foo2 >/dev/null 2>&1; then
2697 echo "They are compatible. In fact, they may be identical."
2704 They are not compatible! You are probably running ksh on a non-USG system.
2705 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2706 have echo built in and we may have to run some Bourne shell scripts. That
2707 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2710 $echo $n "The star should be here-->$c"
2717 # This question was auctioned at YAPC::Europe-2007 in Vienna
2718 # I never promised you could answer it. I only auctioned the question.
2720 The following message is sponsored by
2722 Dresden.pm<--The stars should be here.
2724 Dear Perl user, system administrator or package
2725 maintainer, the Perl community sends greetings to
2726 you. Do you (emblematical) greet back [Y/n]? n
2730 : Check what type of C compiler we use
2734 cat <<'EOSC' >>trygcc
2739 int main(int argc, char *argv[]) {
2743 if $cc -o try $ccflags $ldflags try.c; then
2746 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2752 # Skip this test because it gives a false match on output like:
2753 # ./trygcc: line 23: cc: command not found
2754 # case "`$cc -v -c try.c 2>&1`" in
2755 # *gcc*) trygcc=no ;;
2757 if $test X"$trygcc" = Xyes; then
2758 if gcc -o try -c try.c; then
2760 echo "You seem to have a working gcc, though." >&4
2761 # Switching compilers may undo the work of hints files.
2762 # The most common problem is -D_REENTRANT for threads.
2763 # This heuristic catches that case, but gets false positives
2764 # if -Dusethreads was not actually specified. Better to
2765 # bail out here with a useful message than fail
2766 # mysteriously later. Should we perhaps just try to
2767 # re-invoke Configure -Dcc=gcc config_args ?
2768 if $test -f usethreads.cbu; then
2771 *** However, any setting of the C compiler flags (e.g. for thread support)
2772 *** will be lost. It may be necessary for you to restart Configure and
2773 *** add -Dcc=gcc to your Configure command line.
2776 rp="Would you like to go ahead and try gcc anyway?"
2779 rp="Would you like to use it?"
2782 if $test -f myread; then
2785 if $test -f UU/myread; then
2788 echo "Cannot find myread, sorry. Aborting." >&2
2793 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2806 cat <<'EOSC' >>checkcc
2811 int main(int argc, char *argv[]) {
2815 if $cc -o try $ccflags $ldflags try.c; then
2818 if $test X"$despair" = Xyes; then
2819 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2822 You need to find a working C compiler.
2823 Either (purchase and) install the C compiler supplied by your OS vendor,
2824 or for a free C compiler try http://gcc.gnu.org/
2825 I cannot continue any further, aborting.
2834 : determine whether symbolic links are supported
2837 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2838 echo "Symbolic links are supported." >&4
2841 echo "Symbolic links are NOT supported." >&4
2846 : determine whether symbolic links are supported
2850 echo "Checking how to test for symbolic links..." >&4
2852 if $test "X$issymlink" = X; then
2854 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2855 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2857 if test $? = 0; then
2860 echo "Your builtin 'test -h' may be broken." >&4
2863 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2866 if test -f "$p/$test"; then
2875 echo "Trying external '$test -h'." >&4
2876 issymlink="$test -h"
2877 if $test ! -h sym >/dev/null 2>&1; then
2878 echo "External '$test -h' is broken, too." >&4
2886 if $test "X$issymlink" = X; then
2887 if $test -L sym 2>/dev/null; then
2888 issymlink="$test -L"
2889 echo "The builtin '$test -L' worked." >&4
2892 if $test "X$issymlink" != X; then
2893 echo "You can test for symbolic links with '$issymlink'." >&4
2895 echo "I do not know how you can test for symbolic links." >&4
2899 *) echo "No symbolic links, so not testing for their testing..." >&4
2903 : Make symlinks util
2904 case "$mksymlinks" in
2907 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2910 *) case "$lns:$issymlink" in
2911 *"ln"*" -s:"*"test -"?)
2912 echo "Creating the symbolic links..." >&4
2914 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2924 print "# dir = ", dir, "file = ", file
2925 mf[dir] = mf[dir]" "source"/"dir"/"file;
2928 if (d != ".") { print("mkdir -p "d) }
2929 print("ln -sf "mf[d]" "d);
2931 }' source="$src" > UU/mksymlinks.$$
2935 if test ! -d t/base; then
2936 echo "Failed to create the subdirectories. Aborting." >&4
2940 if test ! -f t/base/lex.t; then
2941 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2944 if test ! -f win32/win32.c; then
2945 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2950 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2958 : Check for Cross-Compilation
2959 if $test "X$targethost" = "X"; then
2962 if $test "X$targetenv" = "X"; then
2965 case "$usecrosscompile" in
2967 $echo "Cross-compiling..."
2970 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2971 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2972 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2973 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2974 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2975 # leave out ld, choosing it is more complex
2976 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2977 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2978 # We are in a weird spot. Just before us, some values
2979 # were 'saved', to be restored after the hints are
2980 # run. This means that the changes we made to ar,
2981 # nm and ranlib will get reverted.
2982 # To avoid that, we hijack the saving mechanism and
2983 # have it save our new values.
2984 for file in ar nm ranlib; do
2986 eval $file=$xxx$_exe
2991 case "$targetarch" in
2992 '') echo "Targetarch not defined." >&4; croak=y ;;
2993 *) echo "Using targetarch $targetarch." >&4 ;;
2995 case "$targethost" in
2996 '') echo "Targethost not defined." >&4; croak=n ;;
2997 *) echo "Using targethost $targethost." >&4
3002 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
3004 : compile a host miniperl and generate_uudmap, unless we got passed them
3005 if $test "X$hostperl" = X; then
3006 echo "Building host miniperl and generate_uudmap binaries" >&4
3014 $src/Configure -des -Dusedevel -Dmksymlinks
3016 case "$hostgenerate" in
3017 '') $make generate_uudmap
3018 hostgenerate=$src/host/generate_uudmap
3020 "$undef") hostgenerate=''
3023 hostperl=$src/host/miniperl
3026 hostosname=`$hostperl -le 'print $^O'`
3029 usecrosscompile="$undef"
3033 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3034 case "$targethost" in
3035 '') echo "Checking for cross-compile" >&4
3036 case "$usecrosscompile$multiarch" in
3037 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3038 if [ -f Makefile ]; then
3040 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3042 echo "Configure done."
3046 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3053 *) echo "Using targethost $targethost." >&4
3055 /*) run=$src/Cross/run
3056 targetmkdir=$src/Cross/mkdir
3058 from=$src/Cross/from
3060 *) pwd=`$test -f ../Configure & cd ..; pwd`
3062 targetmkdir=$pwd/Cross/mkdir
3064 from=$pwd/Cross/from
3067 case "$targetrun" in
3068 '') targetrun=ssh ;;
3073 case "$targetfrom" in
3074 '') targetfrom=scp ;;
3078 from=$from-$targetfrom
3079 case "$targetdir" in
3081 echo "Guessing targetdir $targetdir." >&4
3084 case "$targetuser" in
3086 echo "Guessing targetuser $targetuser." >&4
3089 case "$targetport" in
3091 echo "Guessing targetport $targetport." >&4
3094 case "$targetfrom" in
3098 case "$targetrun" in
3118 '') cwd=$targetdir ;;
3123 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3129 *) echo "Unknown targetrun '$targetrun'" >&4
3133 case "$targetmkdir" in
3135 cat >$targetmkdir <<EOF
3137 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3139 $chmod a+rx $targetmkdir
3141 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3153 $targetmkdir \`dirname \$f\`
3154 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3157 $targetmkdir $targetdir/\`dirname \$f\`
3158 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3171 $mkdir -p $targetdir/\`dirname \$f\`
3172 $cp \$f $targetdir/\$f || exit 1
3175 $targetmkdir $targetdir/\`dirname \$f\`
3176 $cp \$f $targetdir/\$f || exit 1
3183 *) echo "Unknown targetto '$targetto'" >&4
3187 case "$targetfrom" in
3194 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3199 cp) cat >$from <<EOF
3204 cp $targetdir/\$f . || exit 1
3209 *) echo "Unknown targetfrom '$targetfrom'" >&4
3213 if $test ! -f $run; then
3214 echo "Target 'run' script '$run' not found." >&4
3218 if $test ! -f $to; then
3219 echo "Target 'to' script '$to' not found." >&4
3223 if $test ! -f $from; then
3224 echo "Target 'from' script '$from' not found." >&4
3228 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3232 Using '$run' for remote execution,
3233 and '$from' and '$to'
3234 for remote file transfer.
3240 usecrosscompile="$undef"
3245 : see whether [:lower:] and [:upper:] are supported character classes
3247 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3249 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3253 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3254 # (0xd9 and 0xe2), therefore that is a nice testing point.
3255 if test "X$up" = X -o "X$low" = X; then
3256 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3262 if test "X$up" = X -o "X$low" = X; then
3263 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3269 if test "X$up" = X -o "X$low" = X; then
3270 case "`echo RS | od -x 2>/dev/null`" in
3272 echo "Hey, this might be EBCDIC." >&4
3273 if test "X$up" = X -o "X$low" = X; then
3274 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3275 rs) up='[A-IJ-RS-Z]'
3280 if test "X$up" = X -o "X$low" = X; then
3281 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3291 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3293 echo "Using $up and $low to convert case." >&4
3296 echo "I don't know how to translate letters from upper to lower case." >&4
3297 echo "Your tr is not acting any way I know of." >&4
3301 : set up the translation script tr, must be called with ./tr of course
3305 '[A-Z][a-z]') exec $tr '$up' '$low';;
3306 '[a-z][A-Z]') exec $tr '$low' '$up';;
3313 : Try to determine whether config.sh was made on this system
3314 case "$config_sh" in
3316 myuname=`$uname -a 2>/dev/null`
3317 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3318 # Downcase everything to avoid ambiguity.
3319 # Remove slashes and single quotes so we can use parts of this in
3320 # directory and file names.
3321 # Remove newlines so myuname is sane to use elsewhere.
3322 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3323 # because the A-Z/a-z are not consecutive.
3324 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3325 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3326 newmyuname="$myuname"
3328 case "$knowitall" in
3330 if test -f ../config.sh; then
3331 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3332 eval "`grep myuname= ../config.sh`"
3334 if test "X$myuname" = "X$newmyuname"; then
3342 : Get old answers from old config file if Configure was run on the
3343 : same system, otherwise use the hints.
3346 if test -f config.sh; then
3348 rp="I see a config.sh file. Shall I use it to set the defaults?"
3351 n*|N*) echo "OK, I'll ignore it."
3352 mv config.sh config.sh.old
3353 myuname="$newmyuname"
3355 *) echo "Fetching default answers from your old config.sh file..." >&4
3363 : Older versions did not always set $sh. Catch re-use of such
3373 if test ! -f config.sh; then
3376 First time through, eh? I have some defaults handy for some systems
3377 that need some extra help getting the Configure answers right:
3380 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3382 : Half the following guesses are probably wrong... If you have better
3383 : tests or hints, please send them to perlbug@perl.org
3384 : The metaconfig authors would also appreciate a copy...
3385 $test -f /irix && osname=irix
3386 $test -f /xenix && osname=sco_xenix
3387 $test -f /dynix && osname=dynix
3388 $test -f /dnix && osname=dnix
3389 $test -f /lynx.os && osname=lynxos
3390 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3391 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3392 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3393 $test -f /bin/mips && /bin/mips && osname=mips
3394 $test -d /usr/apollo/bin && osname=apollo
3395 $test -f /etc/saf/_sactab && osname=svr4
3396 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3397 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3398 $test -f /sys/utilities/MultiView && osname=amigaos
3399 if $test -d /MachTen -o -d /MachTen_Folder; then
3401 if $test -x /sbin/version; then
3402 osvers=`/sbin/version | $awk '{print $2}' |
3403 $sed -e 's/[A-Za-z]$//'`
3404 elif $test -x /usr/etc/version; then
3405 osvers=`/usr/etc/version | $awk '{print $2}' |
3406 $sed -e 's/[A-Za-z]$//'`
3412 $test -f /sys/posix.dll &&
3413 $test -f /usr/bin/what &&
3414 set X `/usr/bin/what /sys/posix.dll` &&
3415 $test "$3" = UWIN &&
3419 if $test -f $uname; then
3427 umips) osname=umips ;;
3430 [23]100) osname=mips ;;
3432 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3433 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3436 elif $test -f /etc/kconfig; then
3438 if test "$lns" = "$ln -s"; then
3440 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3442 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3449 if test -n "$DJGPP"; then
3458 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3460 # oslevel can fail with:
3461 # oslevel: Unable to acquire lock.
3462 *not\ found) osvers="$4"."$3" ;;
3463 '<3240'|'<>3240') osvers=3.2.0 ;;
3464 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3465 '=3250'|'>3250') osvers=3.2.5 ;;
3469 bitrig) osname=bitrig
3472 bsd386) osname=bsd386
3475 cygwin*) osname=cygwin
3478 *dc.osx) osname=dcosx
3484 domainos) osname=apollo
3490 dragonfly) osname=dragonfly
3493 dynixptx*) osname=dynixptx
3494 osvers=`echo "$4"|sed 's/^v//'`
3496 freebsd) osname=freebsd
3498 genix) osname=genix ;;
3502 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3515 $test -f /system/lib/libandroid.so && osname=linux-android
3519 netbsd*) osname=netbsd
3522 news-os) osvers="$3"
3524 4*) osname=newsos4 ;;
3528 nonstop-ux) osname=nonstopux ;;
3529 openbsd) osname=openbsd
3535 POSIX-BC | posix-bc ) osname=posix-bc
3538 powerux | power_ux | powermax_os | powermaxos | \
3539 powerunix | power_unix) osname=powerux
3545 solaris) osname=solaris
3547 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3554 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3558 titanos) osname=titanos
3567 ultrix) osname=ultrix
3570 osf1|mls+) case "$5" in
3573 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3576 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3579 hp*) osname=hp_osf1 ;;
3580 mips) osname=mips_osf1 ;;
3583 # UnixWare 7.1.2 is known as Open UNIX 8
3584 openunix|unixware) osname=svr5
3592 $2) case "$osname" in
3596 : svr4.x or possibly later
3606 if test -f /stand/boot ; then
3607 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3608 if test -n "$INITPROG" -a -f "$INITPROG"; then
3609 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3610 if test -n "$isesix"; then
3618 *) if test -f /etc/systemid; then
3620 set `echo $3 | $sed 's/\./ /g'` $4
3621 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3623 elif $test -f $src/hints/sco_$1_$2.sh; then
3625 elif $test -f $src/hints/sco_$1.sh; then
3630 '') : Still unknown. Probably a generic Sys V.
3639 *) case "$osname" in
3640 '') : Still unknown. Probably a generic BSD.
3648 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3649 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3650 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3653 $rm -f UU/kernel.what
3654 elif test -d c:/. -o -n "$is_os2" ; then
3661 case "$targetarch" in
3664 case "$targetarch" in
3666 # Will load qnx.sh, which should change osname to nto
3671 # Catch arm-linux-androideabi, mipsel-linux-android,
3672 # and i686-linux-android
3673 osname=linux-android
3677 # Something like arm-linux-gnueabihf is really just
3684 # XXX perhaps we should just assume
3685 # osvers to be 2, or maybe take the value
3686 # from targetarch. Using $run before the
3687 # hints are run is somewhat icky.
3688 set X `$run $uname -a 2>/dev/null`
3691 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3696 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3703 : Now look for a hint file osname_osvers, unless one has been
3704 : specified already.
3707 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3708 : Also try without trailing minor version numbers.
3709 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3710 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3711 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3712 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3715 *) case "$osvers" in
3718 *) if $test -f $src/hints/$file.sh ; then
3720 elif $test -f $src/hints/$xfile.sh ; then
3722 elif $test -f $src/hints/$xxfile.sh ; then
3724 elif $test -f $src/hints/$xxxfile.sh ; then
3726 elif $test -f $src/hints/$xxxxfile.sh ; then
3728 elif $test -f "$src/hints/${osname}.sh" ; then
3737 if $test -f Policy.sh ; then
3740 none) dflt="Policy" ;;
3741 *) dflt="Policy $dflt" ;;
3746 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3750 if $test -f Policy.sh ; then
3753 There's also a Policy hint file available, which should make the
3754 site-specific (policy) questions easier to answer.
3761 You may give one or more space-separated answers, or "none" if appropriate.
3762 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3763 previous run of Configure, you may specify it as well as or instead of
3764 OS-specific hints. If hints are provided for your OS, you should use them:
3765 although Perl can probably be built without hints on many platforms, using
3766 hints often improve performance and may enable features that Configure can't
3767 set up on its own. If there are no hints that match your OS, specify "none";
3768 DO NOT give a wrong version or a wrong OS.
3772 rp="Which of these apply, if any?"
3775 for file in $tans; do
3776 if $test X$file = XPolicy -a -f Policy.sh; then
3778 $cat Policy.sh >> UU/config.sh
3779 elif $test -f $src/hints/$file.sh; then
3780 . $src/hints/$file.sh
3781 $cat $src/hints/$file.sh >> UU/config.sh
3782 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3785 : Give one chance to correct a possible typo.
3786 echo "$file.sh does not exist"
3788 rp="hint to use instead?"
3790 for file in $ans; do
3791 if $test -f "$src/hints/$file.sh"; then
3792 . $src/hints/$file.sh
3793 $cat $src/hints/$file.sh >> UU/config.sh
3794 elif $test X$ans = X -o X$ans = Xnone ; then
3797 echo "$file.sh does not exist -- ignored."
3804 : Remember our hint file for later.
3805 if $test -f "$src/hints/$file.sh" ; then
3815 echo "Fetching default answers from $config_sh..." >&4
3819 cp $config_sh config.sh 2>/dev/null
3831 : Restore computed paths
3832 for file in $loclist $trylist; do
3833 eval $file="\$_$file"
3838 Configure uses the operating system name and version to set some defaults.
3839 The default value is probably right if the name rings a bell. Otherwise,
3840 since spelling matters for me, either accept the default or answer "none"
3847 ''|' '|none) dflt=none ;;
3848 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3851 *) dflt="$osname" ;;
3853 rp="Operating system name?"
3857 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3863 ''|' '|none) dflt=none ;;
3864 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3865 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3867 ''|' ') dflt=none ;;
3872 *) dflt="$osvers" ;;
3874 rp="Operating system version?"
3884 : who configured the system
3885 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3888 cf_by=`(logname) 2>/dev/null`
3891 cf_by=`(whoami) 2>/dev/null`
3893 "") cf_by=unknown ;;
3898 : decide how portable to be. Allow command line overrides.
3899 case "$d_portable" in
3901 *) d_portable="$define" ;;
3904 : set up shell script to do ~ expansion
3910 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3913 if $test -f /bin/csh; then
3914 /bin/csh -f -c "glob \$1"
3919 name=\`$expr x\$1 : '..\([^/]*\)'\`
3920 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3921 if $test ! -d "\$dir"; then
3923 echo "\$me: can't locate home directory for: \$name" >&2
3928 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3944 : now set up to get a file name
3948 cat <<'EOSC' >>getfile
3964 : getfile will accept an answer from the comma-separated list
3965 : enclosed in parentheses even if it does not meet other criteria.
3966 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3967 fn=`echo $fn | sed 's/(.*)//'`
3973 loc_file=`expr $fn : '.*:\(.*\)'`
3974 fn=`expr $fn : '\(.*\):.*'`
3982 */*) fullpath=true;;
3991 *e*) exp_file=true;;
3994 *p*) nopath_ok=true;;
3999 *d*) type='Directory';;
4000 *l*) type='Locate';;
4005 Locate) what='File';;
4010 case "$d_portable" in
4018 while test "$type"; do
4023 true) rp="$rp (~name ok)";;
4026 if test -f UU/getfile.ok && \
4027 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4046 value=`UU/filexp $ans`
4049 if test "$ans" != "$value"; then
4050 echo "(That expands to $value on this system.)"
4064 /*) value="$ansexp" ;;
4065 [a-zA-Z]:/*) value="$ansexp" ;;
4070 echo "I shall only accept a full path name, as in /bin/ls." >&4
4071 echo "Use a ! shell escape if you wish to check pathnames." >&4
4074 echo "Please give a full path name, starting with slash." >&4
4077 echo "Note that using ~name is ok provided it expands well." >&4
4090 for fp in $gfpth; do
4091 if test "X$fp" = X.; then
4096 if test -f "$pf"; then
4098 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4100 echo "($value is not a plain file, but that's ok.)"
4103 if test X"$type" = X; then
4110 for fp in $gfpth; do
4111 if test "X$fp" = X.; then
4116 direxp="$fp/$ansexp"
4118 if test -d "$direxp"; then
4126 if test -d "$ansexp"; then
4127 echo "(Looking for $loc_file in directory $value.)"
4128 value="$value/$loc_file"
4129 ansexp="$ansexp/$loc_file"
4131 if test -f "$ansexp"; then
4134 case "$nopath_ok" in
4135 true) case "$value" in
4137 *) echo "Assuming $value will be in people's path."
4153 if test "$fastread" = yes; then
4158 rp="$what $value doesn't exist. Use that name anyway?"
4177 test "X$gfpthkeep" != Xy && gfpth=""
4180 : determine root of directory hierarchy where package will be installed.
4183 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4186 dflt=`echo "$prefix" | sed 's/.$//'`
4194 By default, $package will be installed in $dflt/bin, manual pages
4195 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4196 installation directories. Typically this is something like /usr/local.
4197 If you wish to have binaries under /usr/bin but other parts of the
4198 installation under /usr/local, that's ok: you will be prompted
4199 separately for each of the installation directories, the prefix being
4200 only used to set the defaults.
4204 rp='Installation prefix to use?'
4212 *) oldprefix="$prefix";;
4219 : allow them to override the AFS root
4222 *) afsroot=$afsroot ;;
4228 $define|true) afs=true ;;
4229 $undef|false) afs=false ;;
4230 *) if $test -d $afsroot; then
4238 echo "AFS may be running... I'll be extra cautious then..." >&4
4240 echo "AFS does not seem to be running..." >&4
4243 : determine installation prefix for where package is to be installed.
4247 Since you are running AFS, I need to distinguish the directory in which
4248 files will reside from the directory in which they are installed (and from
4249 which they are presumably copied to the former directory by occult means).
4252 case "$installprefix" in
4253 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4254 *) dflt="$installprefix";;
4259 In some special cases, particularly when building $package for distribution,
4260 it is convenient to distinguish the directory in which files should be
4261 installed from the directory ($prefix) in which they will
4262 eventually reside. For most users, these two directories are the same.
4265 case "$installprefix" in
4267 *) dflt=$installprefix;;
4271 rp='What installation prefix should I use for installing files?'
4273 installprefix="$ans"
4274 installprefixexp="$ansexp"
4276 : Perform the prefixexp/installprefixexp correction if necessary
4277 cat <<EOS >installprefix
4280 cat <<'EOSC' >>installprefix
4281 : Change installation prefix, if necessary.
4282 if $test X"$prefix" != X"$installprefix"; then
4283 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4285 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4288 chmod +x installprefix
4289 $eunicefix installprefix
4291 : Set variables such as privlib and privlibexp from the output of ./getfile
4292 : performing the prefixexp/installprefixexp correction if necessary.
4293 cat <<EOS >setprefixvar
4296 cat <<'EOSC' >>setprefixvar
4297 eval "${prefixvar}=\"\$ans\""
4298 eval "${prefixvar}exp=\"\$ansexp\""
4301 chmod +x setprefixvar
4302 $eunicefix setprefixvar
4304 : set up the script used to warn in case of inconsistency
4313 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4315 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4316 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4321 echo "*** WHOA THERE!!! ***" >&4
4322 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4325 rp=" Keep the $hint value?"
4328 y) td=$was; tu=$was;;
4332 : function used to set '$1' to '$val'
4333 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4335 $define$undef) . ./whoa; eval "$var=\$td";;
4336 $undef$define) . ./whoa; eval "$var=\$tu";;
4337 *) eval "$var=$val";;
4340 : get the patchlevel
4342 echo "Getting the current patchlevel..." >&4
4343 if $test -r $rsrc/patchlevel.h;then
4344 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4345 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4346 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4347 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4348 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4349 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4350 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4359 $echo "(You do not have patchlevel.h. Eek.)"
4361 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4362 version_patchlevel_string="version $patchlevel subversion $subversion"
4363 case "$perl_patchlevel" in
4365 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4366 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4370 $echo "(You have $package $version_patchlevel_string.)"
4374 : XXX Should be a Configure test for double-dots in filenames.
4375 version=`echo $revision $patchlevel $subversion | \
4376 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4377 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4378 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4381 version=`echo $revision $patchlevel $subversion | \
4382 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4383 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4384 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4387 : Special case the 5.005_xx maintenance series, which used 5.005
4388 : without any subversion label as a subdirectory in $sitelib
4389 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4390 api_versionstring='5.005'
4393 : Do we want threads support and if so, what type
4394 case "$usethreads" in
4395 $define|true|[yY]*) dflt='y';;
4396 *) # Catch case where user specified ithreads or 5005threads but
4397 # forgot -Dusethreads (A.D. 4/2002)
4398 case "$useithreads$use5005threads" in
4399 *$define*) dflt='y';;
4406 Perl can be built to offer a form of threading support on some systems
4407 To do so, Configure can be run with -Dusethreads.
4409 Note that Perl built with threading support runs slightly slower
4410 and uses slightly more memory than plain Perl.
4412 If this doesn't make any sense to you, just accept the default '$dflt'.
4414 rp='Build a threading Perl?'
4417 y|Y) val="$define" ;;
4423 if $test $patchlevel -lt 9; then
4424 case "$usethreads" in
4426 : Default to ithreads unless overridden on command line or with
4429 case "$use5005threads" in
4431 echo "5.005 threads are no longer supported"
4435 case "$useithreads" in
4436 $undef|false|[nN]*) dflt='n';;
4438 rp='Use the newer interpreter-based ithreads?'
4441 y|Y) val="$define" ;;
4446 : Now set use5005threads to the opposite value.
4447 case "$useithreads" in
4448 $define) val="$undef" ;;
4455 useithreads="$undef"
4456 use5005threads="$undef"
4460 case "$useithreads$use5005threads" in
4464 You cannot have both the ithreads and the 5.005 threads enabled
4465 at the same time. Disabling the 5.005 threads since they are
4466 much less stable than the ithreads.
4469 use5005threads="$undef"
4474 : perl-5.9.x and later
4476 if test X"$usethreads" = "X$define"; then
4477 case "$use5005threads" in
4481 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4488 use5005threads="$undef"
4489 useithreads="$usethreads"
4492 case "$d_oldpthreads" in
4493 '') : Configure tests would be welcome here. For now, assume undef.
4495 *) val="$d_oldpthreads" ;;
4501 : Look for a hint-file generated 'call-back-unit'. If the
4502 : user has specified that a threading perl is to be built,
4503 : we may need to set or change some other defaults.
4504 if $test -f usethreads.cbu; then
4505 echo "Your platform has some specific hints regarding threaded builds, using them..."
4508 case "$usethreads" in
4509 "$define"|true|[yY]*)
4511 (Your platform does not have any specific hints for threaded builds.
4512 Assuming POSIX threads, then.)
4518 : Check if multiplicity is required
4521 Perl can be built so that multiple Perl interpreters can coexist
4522 within the same Perl executable.
4525 case "$useithreads" in
4528 This multiple interpreter support is required for interpreter-based threads.
4532 *) case "$usemultiplicity" in
4533 $define|true|[yY]*) dflt='y';;
4537 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4538 rp='Build Perl for multiplicity?'
4541 y|Y) val="$define" ;;
4549 : Check if morebits is requested
4550 case "$usemorebits" in
4551 "$define"|true|[yY]*)
4552 use64bitint="$define"
4553 uselongdouble="$define"
4554 usemorebits="$define"
4556 *) usemorebits="$undef"
4560 : Determine the C compiler to be used
4566 rp="Use which C compiler?"
4570 : See whether they have no cc but they do have gcc
4572 if $test -f cc.cbu; then
4577 : make some quick guesses about what we are up against
4579 $echo $n "Hmm... $c"
4589 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4590 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4592 echo "Looks kind of like an OSF/1 system, but we'll see..."
4594 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4595 xxx=`./loc addbib blurfl $pth`
4596 if $test -f $xxx; then
4597 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4601 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4602 echo "Looks kind of like an extended USG system, but we'll see..."
4604 echo "Looks kind of like a USG system, but we'll see..."
4608 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4609 echo "Looks kind of like a BSD system, but we'll see..."
4613 echo "Looks kind of like a Version 7 system, but we'll see..."
4616 case "$eunicefix" in
4619 There is, however, a strange, musty smell in the air that reminds me of
4620 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4624 : it so happens the Eunice I know will not run shell scripts in Unix format
4628 echo "Congratulations. You aren't running Eunice."
4632 : Detect OS2. The p_ variable is set above in the Head.U unit.
4633 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4634 : semicolon as a patch separator
4639 I have the feeling something is not exactly right, however...don't tell me...
4640 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4641 (Or you may be running DOS with DJGPP.)
4646 if test -f /xenix; then
4647 echo "Actually, this looks more like a XENIX system..."
4652 echo "It's not Xenix..."
4657 if test -f /venix; then
4658 echo "Actually, this looks more like a VENIX system..."
4665 echo "Nor is it Venix..."
4668 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4669 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4672 : Check if we are using GNU gcc and what its version is
4674 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4678 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4680 printf("%s\n", __VERSION__);
4682 printf("%s\n", "1");
4688 if $cc -o try $ccflags $ldflags try.c; then
4689 gccversion=`$run ./try`
4690 case "$gccversion" in
4691 '') echo "You are not using GNU cc." ;;
4692 *) echo "You are using GNU cc $gccversion."
4698 echo "*** WHOA THERE!!! ***" >&4
4699 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4700 case "$knowitall" in
4702 echo " You'd better start hunting for one and let me know about it." >&4
4708 case "$gccversion" in
4709 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4711 case "$gccversion" in
4712 '') gccosandvers='' ;;
4713 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4714 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4716 case "$gccosandvers" in
4717 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4718 $osname$osvers) ;; # looking good
4719 $osname*) cat <<EOM >&4
4721 *** WHOA THERE!!! ***
4723 Your gcc has not been compiled for the exact release of
4724 your operating system ($gccosandvers versus $osname$osvers).
4726 In general it is a good idea to keep gcc synchronized with
4727 the operating system because otherwise serious problems
4728 may ensue when trying to compile software, like Perl.
4730 I'm trying to be optimistic here, though, and will continue.
4731 If later during the configuration and build icky compilation
4732 problems appear (headerfile conflicts being the most common
4733 manifestation), I suggest reinstalling the gcc to match
4734 your operating system release.
4738 *) gccosandvers='' ;; # failed to parse, better be silent
4746 # gcc 3.* complain about adding -Idirectories that they already know about,
4747 # so we will take those off from locincpth.
4748 case "$gccversion" in
4750 echo "main(){}">try.c
4751 for incdir in $locincpth; do
4752 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4753 grep '^c[cp]p*[01]: warning: changing search order '`
4754 if test "X$warn" != X; then
4755 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4761 # gcc 4.9 by default does some optimizations that break perl.
4762 # see ticket 121505.
4764 # The -fwrapv disables those optimizations (and probably others,) so
4765 # for gcc 4.9 (and later, since the optimizations probably won't go
4766 # away), add -fwrapv unless the user requests -fno-wrapv, which
4767 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4768 # which turns the overflows -fwrapv ignores into runtime errors.
4769 case "$gccversion" in
4770 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4772 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4773 *) ccflags="$ccflags -fwrapv" ;;
4777 : What should the include directory be ?
4778 : Use sysroot if set, so findhdr looks in the right place.
4780 $echo $n "Hmm... $c"
4781 dflt="$sysroot/usr/include"
4784 if $test -f /bin/mips && /bin/mips; then
4785 echo "Looks like a MIPS system..."
4786 $cat >usr.c <<'EOCP'
4787 #ifdef SYSTYPE_BSD43
4791 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4792 dflt='/bsd43/usr/include'
4796 mips_type='System V'
4798 $rm -f usr.c usr.out
4799 echo "and you're compiling with the $mips_type compiler and libraries."
4803 echo "Doesn't look like a MIPS system."
4813 case "$xxx_prompt" in
4816 rp='Where are the include files you want to use?'
4824 : see how we invoke the C preprocessor
4826 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4827 cat <<'EOT' >testcpp.c
4833 if test ! -f cppstdin; then
4834 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4835 # AIX cc -E doesn't show the absolute headerfile
4836 # locations but we'll cheat by using the -M flag.
4837 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
4839 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4842 echo "Keeping your $hint cppstdin wrapper."
4845 wrapper=`pwd`/cppstdin
4849 if $test "X$cppstdin" != "X" && \
4850 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4851 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4853 echo "You used to use $cppstdin $cppminus so we'll use that again."
4855 '') echo "But let's see if we can live without a wrapper..." ;;
4857 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4858 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4860 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4863 echo "(However, $cpprun $cpplast does not work, let's see...)"
4871 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4878 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4879 $cc -E <testcpp.c >testcpp.out 2>&1; \
4880 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 echo "Yup, it does."
4882 x_cpp="$cc $cppflags -E"
4884 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4885 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4886 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4887 echo "Yup, it does."
4888 x_cpp="$cc $cppflags -E"
4890 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4891 $cc -P <testcpp.c >testcpp.out 2>&1; \
4892 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4893 echo "Yipee, that works!"
4894 x_cpp="$cc $cppflags -P"
4896 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4897 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4899 echo "At long last!"
4900 x_cpp="$cc $cppflags -P"
4902 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4903 $cpp <testcpp.c >testcpp.out 2>&1; \
4904 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4906 x_cpp="$cpp $cppflags"
4908 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4909 $cpp - <testcpp.c >testcpp.out 2>&1; \
4910 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4911 echo "Hooray, it works! I was beginning to wonder."
4912 x_cpp="$cpp $cppflags"
4914 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4915 $wrapper <testcpp.c >testcpp.out 2>&1; \
4916 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4922 rp="No dice. I can't find a C preprocessor. Name one:"
4926 $x_cpp <testcpp.c >testcpp.out 2>&1
4927 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4928 echo "OK, that will do." >&4
4930 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4945 echo "Perhaps can we force $cc -E using a wrapper..."
4946 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4947 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4953 echo "Nope, we'll have to live without it..."
4967 "$wrapper"|'cppstdin') ;;
4968 *) $rm -f $wrapper;;
4970 $rm -f testcpp.c testcpp.out
4972 : Adjust cppfilter for path component separator
4974 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4975 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4979 : Use gcc to determine libpth and incpth
4980 # If using gcc or clang, we can get better values for libpth, incpth
4981 # and usrinc directly from the compiler.
4982 # Note that ccname for clang is also gcc.
4985 $echo 'extern int foo;' > try.c
4986 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4988 if $test $# -gt 0; then
4990 incpth="`$echo $incpth|$sed 's/^ //'`"
4992 j="`$echo $i|$sed 's,/include$,/lib,'`"
4993 if $test -d $j; then
4997 libpth="`$echo $libpth|$sed 's/^ //'`"
4998 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4999 if $test -d $xxx; then
5002 *) libpth="$libpth $xxx";;
5009 '') for i in $incpth; do
5010 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5018 case "$usecrosscompile" in
5021 '') echo "Incpth not defined." >&4; croak=y ;;
5022 *) echo "Using incpth '$incpth'." >&4 ;;
5025 '') echo "Libpth not defined." >&4; croak=y ;;
5026 *) echo "Using libpth '$libpth'." >&4 ;;
5029 '') echo "Usrinc not defined." >&4; croak=y ;;
5030 *) echo "Using usrinc $usrinc." >&4 ;;
5034 if test "X$sysroot" = X; then
5035 echo "Cannot continue, aborting." >&4; exit 1
5037 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5046 : Default value for incpth is just usrinc
5048 '') incpth="$usrinc";;
5051 : Set private lib path
5054 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5059 '') dlist="$loclibpth $plibpth $glibpth";;
5060 *) dlist="$libpth";;
5063 : Now check and see which directories actually exist, avoiding duplicates
5066 if $test -d $xxx; then
5069 *) libpth="$libpth $xxx";;
5075 Some systems have incompatible or broken versions of libraries. Among
5076 the directories listed in the question below, please remove any you
5077 know not to be holding relevant libraries, and add any that are needed.
5078 Say "none" for none.
5082 if test "X$sysroot" != X; then
5084 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5097 rp="Directories to use for library searches?"
5104 : compute shared library extension
5107 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5117 On some systems, shared libraries may be available. Answer 'none' if
5118 you want to suppress searching of shared libraries for the remainder
5119 of this configuration.
5122 rp='What is the file extension used for shared libraries?'
5126 : Does target system insist that shared library basenames are unique
5129 Some dynamic loaders assume that the *basename* of shared library filenames
5130 are globally unique. We'll default this to undef as we assume your system
5131 is not this weird. Set to defined if you're on one of them.
5136 rp='Make shared library basenames unique?'
5139 y|Y) val="$define" ;;
5142 set d_libname_unique
5145 : Define several unixisms.
5146 : Hints files or command line option can be used to override them.
5147 : The convoluted testing is in case hints files set either the old
5150 '') case "$exe_ext" in
5152 *) _exe="$exe_ext" ;;
5157 '') case "$lib_ext" in
5164 '') case "$obj_ext" in
5171 '') case "$path_sep" in
5182 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5184 : Which makefile gets called first. This is used by make depend.
5185 case "$firstmakefile" in
5186 '') firstmakefile='makefile';;
5189 : Check is we will use socks
5191 $define|true|[yY]*) dflt='y';;
5196 Perl can be built to use the SOCKS proxy protocol library. To do so,
5197 Configure must be run with -Dusesocks. If you use SOCKS you also need
5198 to use the PerlIO abstraction layer, this will be implicitly selected.
5200 If this doesn't make any sense to you, just accept the default '$dflt'.
5202 rp='Build Perl for SOCKS?'
5205 y|Y) val="$define" ;;
5211 : Check for uselongdouble support
5213 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5216 case "$uselongdouble" in
5217 $define|true|[yY]*) dflt='y';;
5222 Perl can be built to take advantage of long doubles which
5223 (if available) may give more accuracy and range for floating point numbers.
5225 If this doesn't make any sense to you, just accept the default '$dflt'.
5227 rp='Try to use long doubles if available?'
5230 y|Y) val="$define" ;;
5236 case "$uselongdouble" in
5237 true|[yY]*) uselongdouble="$define" ;;
5240 : Look for a hint-file generated 'call-back-unit'. If the
5241 : user has specified that long doubles should be used,
5242 : we may need to set or change some other defaults.
5243 if $test -f uselongdouble.cbu; then
5244 echo "Your platform has some specific hints regarding long doubles, using them..."
5245 . ./uselongdouble.cbu
5247 case "$uselongdouble" in
5250 (Your platform does not have any specific hints for long doubles.)
5256 : Check if quadmath is requested
5257 case "$usequadmath" in
5258 "$define"|true|[yY]*) usequadmath="$define" ;;
5259 *) usequadmath="$undef" ;;
5262 : Fail if both uselongdouble and usequadmath are requested
5263 case "$usequadmath:$uselongdouble" in
5267 *** You requested the use of the quadmath library and use
5268 *** of long doubles.
5270 *** Please select one or the other.
5276 : Looking for optional libraries
5278 echo "Checking for optional libraries..." >&4
5283 case "$libswanted" in
5284 '') libswanted='c_s';;
5287 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5289 case "$usecbacktrace" in
5290 "$define") libswanted="$libswanted bfd" ;;
5292 case "$usequadmath" in
5293 "$define") libswanted="$libswanted quadmath" ;;
5299 for thisdir in $libpth $xlibpth; do
5300 test -d $thisdir && libspath="$libspath $thisdir"
5302 for thislib in $libswanted; do
5303 for thisdir in $libspath; do
5305 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5306 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5307 $test -f "$xxx" && eval $libscheck
5308 $test -f "$xxx" && libstyle=shared
5309 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5310 $test -f "$xxx" && eval $libscheck
5311 $test -f "$xxx" && libstyle=shared
5313 if test ! -f "$xxx"; then
5314 xxx=$thisdir/lib$thislib.$so
5315 $test -f "$xxx" && eval $libscheck
5316 $test -f "$xxx" && libstyle=shared
5318 if test ! -f "$xxx"; then
5319 xxx=$thisdir/lib$thislib$_a
5320 $test -f "$xxx" && eval $libscheck
5321 $test -f "$xxx" && libstyle=static
5323 if test ! -f "$xxx"; then
5324 xxx=$thisdir/$thislib$_a
5325 $test -f "$xxx" && eval $libscheck
5326 $test -f "$xxx" && libstyle=static
5328 if test ! -f "$xxx"; then
5329 xxx=$thisdir/lib${thislib}_s$_a
5330 $test -f "$xxx" && eval $libscheck
5331 $test -f "$xxx" && libstyle=static
5332 $test -f "$xxx" && thislib=${thislib}_s
5334 if test ! -f "$xxx"; then
5335 xxx=$thisdir/Slib$thislib$_a
5336 $test -f "$xxx" && eval $libscheck
5337 $test -f "$xxx" && libstyle=static
5339 if $test -f "$xxx"; then
5341 shared) echo "Found -l$thislib (shared)." ;;
5342 static) echo "Found -l$thislib." ;;
5343 *) echo "Found -l$thislib ($libstyle)." ;;
5347 *) dflt="$dflt -l$thislib"
5348 libsfound="$libsfound $xxx"
5350 libsfiles="$libsfiles $yyy"
5351 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5352 case " $libsdirs " in
5354 *) libsdirs="$libsdirs $yyy" ;;
5361 if $test ! -f "$xxx"; then
5362 echo "No -l$thislib."
5373 ' '|'') dflt='none';;
5378 In order to compile $package on your machine, a number of libraries
5379 are usually needed. Include any other special libraries here as well.
5380 Say "none" for none. The default list is almost always right.
5384 rp="What libraries to use?"
5391 : determine optimization, if desired, or use for debug flag also
5393 ' '|$undef) dflt='none';;
5395 *) dflt="$optimize";;
5399 By default, $package compiles with the -O flag to use the optimizer.
5400 Alternately, you might want to use the symbolic debugger, which uses
5401 the -g flag (on traditional Unix systems). Either flag can be
5402 specified here. To use neither flag, specify the word "none".
5405 rp="What optimizer/debugger flag should be used?"
5409 'none') optimize=" ";;
5412 : Check what DEBUGGING is required from the command line
5413 : -DEBUGGING or -DDEBUGGING or
5414 : -DEBUGGING=both = -g + -DDEBUGGING
5415 : -DEBUGGING=-g or -Doptimize=-g = -g
5416 : -DEBUGGING=none or -UDEBUGGING =
5417 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5420 *) DEBUGGING=$EBUGGING ;;
5423 case "$DEBUGGING" in
5427 *) optimize="$optimize -g" ;;
5431 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5439 case "$DEBUGGING" in
5440 both|$define) dflt='-DDEBUGGING'
5443 : argument order is deliberate, as the flag will start with - which set could
5444 : think is an option
5445 checkccflag='check=$1; flag=$2; callback=$3;
5447 echo "Checking if your compiler accepts $flag" 2>&1;
5448 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5449 echo "int main(void) { return 0; }" > gcctest.c;
5450 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5451 echo "Yes, it does." 2>&1;
5452 if $test -s gcctest.out ; then
5453 echo "But your platform does not like it:";
5458 echo "Leaving current flags $ccflags alone." 2>&1
5460 *) dflt="$dflt $flag";
5466 echo "Nope, it does not, but that is ok." 2>&1;
5470 : We will not override a previous value, but we might want to
5471 : augment a hint file
5473 default|recommended)
5474 case "$gccversion" in
5475 1*) dflt="$dflt -fpcc-struct-return" ;;
5477 case "$optimize:$DEBUGGING" in
5478 *-g*:old) dflt="$dflt -DDEBUGGING";;
5480 case "$gccversion" in
5481 2*) if $test -d /etc/conf/kconfig.d &&
5482 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5484 # Interactive Systems (ISC) POSIX mode.
5489 case "$gccversion" in
5492 ?*) set strict-aliasing -fno-strict-aliasing
5496 # For gcc, adding -pipe speeds up compilations for some, but apparently
5497 # some assemblers can't read from stdin. (It also slows down compilations
5498 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5499 case "$gccversion" in
5505 # on x86_64 (at least) we require an extra library (libssp) in the
5506 # link command line. This library is not named, so I infer that it is
5507 # an implementation detail that may change. Hence the safest approach
5508 # is to add the flag to the flags passed to the compiler at link time,
5509 # as that way the compiler can do the right implementation dependant
5512 amigaos) ;; # -fstack-protector builds but doesn't work
5513 *) case "$gccversion" in
5514 ?*) set stack-protector-strong -fstack-protector-strong
5517 *-fstack-protector-strong*) ;; # It got added.
5518 *) # Try the plain/older -fstack-protector.
5519 set stack-protector -fstack-protector
5530 case "$mips_type" in
5531 *BSD*|'') inclwanted="$locincpth $usrinc";;
5532 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5534 for thisincl in $inclwanted; do
5535 if $test -d $thisincl; then
5536 if $test x$thisincl != x$usrinc; then
5538 *" -I$thisincl "*);;
5539 *) dflt="$dflt -I$thisincl ";;
5545 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5547 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5555 *) dflt="$dflt -D$2";;
5559 set signal.h LANGUAGE_C; eval $inctest
5563 ccflags="$ccflags -DSOCKS"
5568 default|recommended) dflt="$ccflags $dflt" ;;
5569 *) dflt="$ccflags";;
5578 Your C compiler may want other flags. For this question you should include
5579 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5580 but you should NOT include libraries or ld flags like -lwhatever. If you
5581 want $package to honor its debug switch, you should include -DDEBUGGING here.
5582 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5584 To use no flags, specify the word "none".
5590 rp="Any additional cc flags?"
5597 : the following weeds options from ccflags that are of no interest to cpp
5599 '') cppflags="$ccflags" ;;
5600 *) set X $ccflags; shift
5601 case " $cppflags " in
5602 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5603 *) cppflags="$cppflags $ccflags" ;;
5607 case "$gccversion" in
5608 1*) cppflags="$cppflags -D__GNUC__"
5610 case "$mips_type" in
5612 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5618 echo "Let me guess what the preprocessor flags are..." >&4
5632 *) ftry="$previous $flag";;
5634 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5635 >cpp1.out 2>/dev/null && \
5636 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5637 >cpp2.out 2>/dev/null && \
5638 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5639 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5641 cppflags="$cppflags $ftry"
5651 *-*) echo "They appear to be: $cppflags";;
5653 $rm -f cpp.c cpp?.out
5657 : flags used in final linking phase
5659 '') if ./venix; then
5665 *-posix*) dflt="$dflt -posix" ;;
5668 *) dflt="$ldflags";;
5670 # See note above about -fstack-protector
5672 *-fstack-protector-strong*)
5674 *-fstack-protector-strong*) ;; # Don't add it again
5675 *) dflt="$dflt -fstack-protector-strong" ;;
5678 *-fstack-protector*)
5680 *-fstack-protector*) ;; # Don't add it again
5681 *) dflt="$dflt -fstack-protector" ;;
5686 : Try to guess additional flags to pick up local libraries.
5687 for thislibdir in $libpth; do
5688 case " $loclibpth " in
5691 *"-L$thislibdir "*) ;;
5692 *) dflt="$dflt -L$thislibdir" ;;
5704 Your C linker may need flags. For this question you should
5705 include -L/whatever and any other flags used by the C linker, but you
5706 should NOT include libraries like -lwhatever.
5708 Make sure you include the appropriate -L/path flags if your C linker
5709 does not normally search all of the directories you specified above,
5712 To use no flags, specify the word "none".
5716 rp="Any additional ld flags (NOT including libraries)?"
5722 rmlist="$rmlist pdp11"
5726 echo "Checking your choice of C compiler and flags for coherency..." >&4
5727 $cat > try.c <<'EOF'
5729 int main() { printf("Ok\n"); return(0); }
5731 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5733 $cat >try.msg <<'EOM'
5734 I've tried to compile and run the following simple program:
5737 $cat try.c >> try.msg
5739 $cat >> try.msg <<EOM
5746 and I got the following output:
5750 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5751 if $sh -c "$run ./try " >>try.msg 2>&1; then
5755 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5758 echo "The program compiled OK, but exited with status $?." >>try.msg
5759 rp="You have a problem. Shall I abort Configure"
5763 echo "I can't compile the test program." >>try.msg
5764 rp="You have a BIG problem. Shall I abort Configure"
5770 case "$knowitall" in
5772 echo "(The supplied flags or libraries might be incorrect.)"
5780 *) echo "Ok. Stopping Configure." >&4
5785 n) echo "OK, that should do.";;
5787 $rm_try gcctest gcctest.out
5789 : define a shorthand compile call
5793 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5794 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5798 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5799 : define a shorthand compile call for compilations that should be ok.
5803 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5805 : determine filename position in cpp output
5807 echo "Computing filename position in cpp output for #include directives..." >&4
5809 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5814 vos) testaccess=-e ;;
5817 echo '#include <stdio.h>' > foo.c
5820 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5821 $grep '^[ ]*#.*stdio\.h' | \
5822 while read cline; do
5825 while $test \$# -gt 0; do
5826 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5831 pos=\`expr \$pos + 1\`
5845 *) pos="${fieldn}th";;
5847 echo "Your cpp writes the filename in the $pos field of the line."
5849 : locate header file
5854 for usrincdir in $incpth
5856 if test -f \$usrincdir/\$wanted; then
5857 echo "\$usrincdir/\$wanted"
5861 awkprg='{ print \$$fieldn }'
5862 echo "#include <\$wanted>" > foo\$\$.c
5863 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5864 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5865 while read cline; do
5866 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5868 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5869 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5874 # status = 0: grep returned 0 lines, case statement not executed
5875 # status = 1: headerfile found
5876 # status = 2: while loop executed, no headerfile found
5880 if test \$status -eq 1; then
5887 : define an alternate in-header-list? function
5888 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5889 cont=true; xxf="echo \"<\$1> found.\" >&4";
5890 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5891 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5893 case $# in 4) instead=instead;; *) instead="at last";; esac;
5894 while $test "$cont"; do
5896 var=$2; eval "was=\$$2";
5897 if $test "$xxx" && $test -r "$xxx";
5899 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5902 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5903 set $yyy; shift; shift; yyy=$@;
5904 case $# in 0) cont="";;
5905 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5906 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5907 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5908 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5912 do set $yyy; var=$2; eval "was=\$$2";
5913 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5914 set $yyy; shift; shift; yyy=$@;
5917 : see if stdlib is available
5918 set stdlib.h i_stdlib
5921 : check for lengths of integral types
5925 echo "Checking to see how big your integers are..." >&4
5934 printf("intsize=%d;\n", (int)sizeof(int));
5935 printf("longsize=%d;\n", (int)sizeof(long));
5936 printf("shortsize=%d;\n", (int)sizeof(short));
5941 if eval $compile_ok && $run ./try > /dev/null; then
5943 echo "Your integers are $intsize bytes long."
5944 echo "Your long integers are $longsize bytes long."
5945 echo "Your short integers are $shortsize bytes long."
5949 Help! I can't compile and run the intsize test program: please enlighten me!
5950 (This is probably a misconfiguration in your system or libraries, and
5951 you really ought to fix it. Still, I'll try anyway.)
5955 rp="What is the size of an integer (in bytes)?"
5959 rp="What is the size of a long integer (in bytes)?"
5963 rp="What is the size of a short integer (in bytes)?"
5971 : check for long long
5973 echo "Checking to see if you have long long..." >&4
5974 echo 'int main() { long long x = 7; return 0; }' > try.c
5976 if eval $compile; then
5978 echo "You have long long."
5981 echo "You do not have long long."
5987 : check for length of long long
5988 case "${d_longlong}${longlongsize}" in
5991 echo "Checking to see how big your long longs are..." >&4
5992 $cat >try.c <<'EOCP'
5996 printf("%d\n", (int)sizeof(long long));
6001 if eval $compile_ok; then
6002 longlongsize=`$run ./try`
6003 echo "Your long longs are $longlongsize bytes long."
6007 echo "(I can't seem to compile the test program. Guessing...)"
6008 rp="What is the size of a long long (in bytes)?"
6012 if $test "X$longsize" = "X$longlongsize"; then
6013 echo "(That isn't any different from an ordinary long.)"
6019 : see if inttypes.h is available
6020 : we want a real compile instead of Inhdr because some systems
6021 : have an inttypes.h which includes non-existent headers
6024 #include <inttypes.h>
6026 static int32_t foo32 = 0x12345678;
6030 if eval $compile; then
6031 echo "<inttypes.h> found." >&4
6034 echo "<inttypes.h> NOT found." >&4
6043 echo "Checking to see if you have int64_t..." >&4
6045 #include <sys/types.h>
6046 #$i_inttypes I_INTTYPES
6048 #include <inttypes.h>
6050 int main() { int64_t x = 7; }
6053 if eval $compile; then
6055 echo "You have int64_t."
6058 echo "You do not have int64_t."
6064 : Check if 64bit ints have a quad type
6066 echo "Checking which 64-bit integer type we could use..." >&4
6072 val='"unsigned int"'
6077 *) case "$longsize" in
6081 val='"unsigned long"'
6086 *) case "$d_longlong:$longlongsize" in
6091 val='"unsigned long long"'
6096 *) case "$d_int64_t" in
6115 '') echo "Alas, no 64-bit integer types in sight." >&4
6118 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6123 : Do we want 64bit support
6124 case "$uselonglong" in
6125 "$define"|true|[yY]*)
6128 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6130 use64bitint="$define"
6133 case "$use64bits" in
6134 "$define"|true|[yY]*)
6137 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6139 use64bitint="$define"
6142 case "$use64bitints" in
6143 "$define"|true|[yY]*)
6146 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6148 use64bitint="$define"
6151 case "$use64bitsint" in
6152 "$define"|true|[yY]*)
6155 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6157 use64bitint="$define"
6160 case "$uselonglongs" in
6161 "$define"|true|[yY]*)
6164 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6166 use64bitint="$define"
6169 case "$use64bitsall" in
6170 "$define"|true|[yY]*)
6173 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6175 use64bitall="$define"
6180 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6182 case "$use64bitall" in
6183 "$define"|true|[yY]*) use64bitint="$define" ;;
6189 You have natively 64-bit long integers.
6193 *) case "$use64bitint" in
6194 "$define"|true|[yY]*) dflt='y';;
6203 Perl can be built to take advantage of 64-bit integer types
6204 on some systems. To do so, Configure can be run with -Duse64bitint.
6205 Choosing this option will most probably introduce binary incompatibilities.
6207 If this doesn't make any sense to you, just accept the default '$dflt'.
6208 (The default has been chosen based on your configuration.)
6210 rp='Try to use 64-bit integers, if available?'
6213 [yY]*) val="$define" ;;
6221 case "$use64bitall" in
6222 "$define"|true|[yY]*) dflt='y' ;;
6223 *) case "$longsize" in
6231 You may also choose to try maximal 64-bitness. It means using as much
6232 64-bitness as possible on the platform. This in turn means even more
6233 binary incompatibilities. On the other hand, your platform may not
6234 have any more 64-bitness available than what you already have chosen.
6236 If this doesn't make any sense to you, just accept the default '$dflt'.
6237 (The default has been chosen based on your configuration.)
6239 rp='Try to use maximal 64-bit support, if available?'
6242 [yY]*) val="$define" ;;
6247 case "$use64bitall" in
6249 case "$use64bitint" in
6253 Since you have chosen a maximally 64-bit build, I'm also turning on
6254 the use of 64-bit integers.
6256 use64bitint="$define" ;;
6261 : Look for a hint-file generated 'call-back-unit'. If the
6262 : user has specified that a 64-bit perl is to be built,
6263 : we may need to set or change some other defaults.
6264 if $test -f use64bitint.cbu; then
6265 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6268 case "$use64bitint" in
6269 "$define"|true|[yY]*)
6270 : This test was common to all the OpenBSD forks, and seems harmless for
6273 echo "Checking if your C library has broken 64-bit functions..." >&4
6276 typedef $uquadtype myULL;
6283 {4294967303.15, 4294967303ULL},
6284 {4294967294.2, 4294967294ULL},
6285 {4294967295.7, 4294967295ULL},
6288 for (p = test; p->u; p++) {
6289 myULL x = (myULL)p->d;
6300 if eval $compile_ok; then
6301 libcquad=`$run ./try`
6302 echo "Your C library's 64-bit functions are $libcquad."
6304 echo "(I can't seem to compile the test program.)"
6305 echo "Assuming that your C library's 64-bit functions are ok."
6314 *** You have a C library with broken 64-bit functions.
6315 *** 64-bit support does not work reliably in this configuration.
6316 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6317 *** Cannot continue, aborting.
6324 4) case "$archname64" in
6325 '') archname64=64int ;;
6332 : Look for a hint-file generated 'call-back-unit'. If the
6333 : user has specified that a maximally 64-bit perl is to be built,
6334 : we may need to set or change some other defaults.
6335 if $test -f use64bitall.cbu; then
6336 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6339 case "$use64bitall" in
6340 "$define"|true|[yY]*)
6342 4) case "$archname64" in
6343 ''|64int) archname64=64all ;;
6350 case "$d_quad:$use64bitint" in
6354 *** You have chosen to use 64-bit integers,
6355 *** but none can be found.
6356 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6357 *** Cannot continue, aborting.
6364 : Check if we are using the GNU C library
6366 echo "Checking for GNU C Library..." >&4
6368 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6369 alone are insufficient to distinguish different versions, such as
6370 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6371 libc version 2.1.0. A. Dougherty, June 3, 2002.
6377 # ifdef __GLIBC_MINOR__
6378 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6379 # include <gnu/libc-version.h>
6380 printf("%s\n", gnu_get_libc_version());
6382 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6385 printf("%d\n", __GLIBC__);
6394 if eval $compile_ok && $run ./try > glibc.ver; then
6396 gnulibc_version=`$cat glibc.ver`
6397 echo "You are using the GNU C Library version $gnulibc_version"
6401 echo "You are not using the GNU C Library"
6407 : see if nm is to be used to determine whether a symbol is defined or not
6411 case "$d_gnulibc" in
6414 echo "nm probably won't work on the GNU C Library." >&4
6420 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6422 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6423 echo "'nm' won't be sufficient on this system." >&4
6429 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6430 if $test $dflt -gt 20; then
6440 true|$define) dflt=y;;
6447 I can use $nm to extract the symbols from your C libraries. This
6448 is a time consuming task which may generate huge output on the disk (up
6449 to 3 megabytes) but that should make the symbols extraction faster. The
6450 alternative is to skip the 'nm' extraction part and to compile a small
6451 test program instead to determine whether each symbol is present. If
6452 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6453 this may be the best solution.
6455 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6458 rp="Shall I use $nm to extract C symbols from the libraries?"
6461 [Nn]*) usenm=false;;
6470 : nm options which may be necessary
6472 '') if $test -f /mach_boot; then
6474 elif $test -d /usr/ccs/lib; then
6475 nm_opt='-p' # Solaris (and SunOS?)
6476 elif $test -f /dgux; then
6478 elif $test -f /lib64/rld; then
6479 nm_opt='-p' # 64-bit Irix
6485 : nm options which may be necessary for shared libraries but illegal
6486 : for archive libraries. Thank you, Linux.
6487 case "$nm_so_opt" in
6488 '') case "$myuname" in
6490 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6491 nm_so_opt='--dynamic'
6498 : Figure out where the libc is located
6501 : get list of predefined functions in a handy place
6506 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6512 *) for thislib in $libs; do
6515 : Handle C library specially below.
6518 thislib=`echo $thislib | $sed -e 's/^-l//'`
6519 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6521 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6523 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6525 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6527 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6529 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6531 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6536 libnames="$libnames $try"
6538 *) libnames="$libnames $thislib" ;;
6547 for xxx in $libpth; do
6548 $test -r $1 || set $xxx/libc.$so
6549 : The messy sed command sorts on library version numbers.
6551 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6552 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6554 s/[0-9][0-9]*/0000&/g
6555 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6558 $sort | $sed -e 's/^.* //'`
6561 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6562 $test -r $1 || set $sysroot/lib/libsys_s$_a
6568 if $test -r "$1"; then
6569 echo "Your (shared) C library seems to be in $1."
6571 elif $test -r /lib/libc && $test -r /lib/clib; then
6572 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6574 libc='/lib/clib /lib/libc'
6575 if $test -r /lib/syslib; then
6576 echo "(Your math library is in /lib/syslib.)"
6577 libc="$libc /lib/syslib"
6579 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6580 echo "Your C library seems to be in $libc, as you said before."
6581 elif $test -r $incpath/usr/lib/libc$_a; then
6582 libc=$incpath/usr/lib/libc$_a;
6583 echo "Your C library seems to be in $libc. That's fine."
6584 elif $test -r /lib/libc$_a; then
6586 echo "Your C library seems to be in $libc. You're normal."
6588 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6590 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6591 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6592 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6594 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6596 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6599 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6601 if $test -r "$tans"; then
6602 echo "Your C library seems to be in $tans, of all places."
6608 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6612 If the guess above is wrong (which it might be if you're using a strange
6613 compiler, or your machine supports multiple models), you can override it here.
6618 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6620 I can't seem to find your C library. I've looked in the following places:
6623 $sed 's/^/ /' libpath
6626 None of these seems to contain your C library. I need to get its name...
6631 rp='Where is your C library?'
6636 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6637 set X `cat libnames`
6640 case $# in 1) xxx=file; esac
6641 echo "Extracting names from the following $xxx for later perusal:" >&4
6643 $sed 's/^/ /' libnames >&4
6645 $echo $n "This may take a while...$c" >&4
6649 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6650 *) $nm $nm_opt $file 2>/dev/null;;
6655 $grep fprintf libc.tmp > libc.ptf
6656 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6657 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6659 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6663 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6665 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6667 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6669 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6671 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6675 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6679 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6683 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6684 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6688 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6692 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6694 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6696 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6698 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6700 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6704 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6708 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6712 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6714 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6717 $nm -p $* 2>/dev/null >libc.tmp
6718 $grep fprintf libc.tmp > libc.ptf
6719 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6720 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6726 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6728 if $ar t $libc > libc.tmp && \
6729 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6731 for thisname in $libnames $libc; do
6732 $ar t $thisname >>libc.tmp
6734 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6736 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6737 for thisname in $libnames $libc; do
6738 $ar tv $thisname >>libc.tmp
6739 emximp -o tmp.imp $thisname \
6741 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6742 < tmp.imp >>libc.tmp
6745 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6748 echo "$ar didn't seem to work right." >&4
6749 echo "Maybe this is a Cray...trying bld instead..." >&4
6751 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6754 for thisname in $libnames; do
6756 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6757 $ar t $thisname >>libc.tmp
6761 echo "That didn't work either. Giving up." >&4
6771 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6772 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6774 *) if $test -f /lib/syscalls.exp; then
6776 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6777 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6778 /lib/syscalls.exp >>libc.list
6784 $rm -f libnames libpath
6786 : Check if we are using C++
6788 echo "Checking for C++..." >&4
6789 $cat >try.c <<'EOCP'
6801 if eval $compile_ok && $run ./try; then
6803 echo "You are using a C++ compiler."
6806 echo "You are not using a C++ compiler."
6812 : is a C symbol defined?
6815 -v) tf=libc.tmp; tdc="";;
6816 -a) tf=libc.tmp; tdc="[]";;
6817 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6819 case "$d_cplusplus" in
6820 $define) extern_C="extern \"C\"" ;;
6821 *) extern_C="extern" ;;
6824 case "$reuseval-$4" in
6826 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6831 if $test "$runnm" = true; then
6832 if $contains $tlook $tf >/dev/null 2>&1; then
6834 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6835 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6836 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6837 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6841 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;
6842 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6848 $define) tval=true;;
6855 : define an is-in-libc? function
6856 inlibc='echo " "; td=$define; tu=$undef;
6857 sym=$1; var=$2; eval "was=\$$2";
6859 case "$reuseval$was" in
6869 echo "$sym() found." >&4;
6870 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6872 echo "$sym() NOT found." >&4;
6873 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6877 $define) echo "$sym() found." >&4;;
6878 *) echo "$sym() NOT found." >&4;;
6882 : check for length of double
6884 case "$doublesize" in
6886 echo "Checking to see how big your double precision numbers are..." >&4
6895 printf("%d\n", (int)sizeof(double));
6900 if eval $compile_ok; then
6901 doublesize=`$run ./try`
6902 echo "Your double is $doublesize bytes long."
6905 echo "(I can't seem to compile the test program. Guessing...)"
6906 rp="What is the size of a double precision number (in bytes)?"
6914 : see if this is a float.h system
6918 : check for long doubles
6920 echo "Checking to see if you have long double..." >&4
6921 echo 'int main() { long double x = 7.0; }' > try.c
6923 if eval $compile; then
6925 echo "You have long double."
6928 echo "You do not have long double."
6934 : see if ldexpl exists
6938 : check for length of long double
6939 case "${d_longdbl}${longdblsize}" in
6942 echo "Checking to see how big your long doubles are..." >&4
6943 $cat >try.c <<'EOCP'
6947 printf("%d\n", sizeof(long double));
6952 if eval $compile; then
6953 longdblsize=`$run ./try`
6954 echo "Your long doubles are $longdblsize bytes long."
6958 echo "(I can't seem to compile the test program. Guessing...)" >&4
6959 rp="What is the size of a long double (in bytes)?"
6963 if $test "X$doublesize" = "X$longdblsize"; then
6964 echo "That isn't any different from an ordinary double."
6965 echo "I'll keep your setting anyway, but you may see some"
6966 echo "harmless compilation warnings."
6972 $echo "Checking the kind of long doubles you have..." >&4
6973 case "$d_longdbl" in
6978 #define LONGDBLSIZE $longdblsize
6979 #define DOUBLESIZE $doublesize
6987 static const long double d = -0.1L;
6989 unsigned const char* b = (unsigned const char*)(&d);
6990 #if DOUBLESIZE == LONGDBLSIZE
6991 printf("0\n"); /* if it floats like double */
6994 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6995 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6996 /* IEEE 754 128-bit little-endian */
7000 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
7001 /* IEEE 128-bit big-endian, e.g. solaris sparc */
7006 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
7007 * while 64-bits platforms have it in 16 bytes. The trailing bytes
7008 * cannot be trusted. */
7009 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
7010 if (b[0] == 0xCD && b[9] == 0xBF) {
7011 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
7012 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7013 * Also known as "extended precision". */
7017 if (b[0] == 0xBF && b[9] == 0xCD) {
7018 /* Is there ever big-endian 80-bit, really?
7020 * The Motorola 68881 had another "extended precision" format:
7021 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7022 * for total of 96 bits of bytes. The zero bits were unused.
7023 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7024 * If it ever becomes relevant, this format should be allocated
7025 * a new doublekind code since it's quite different from the Intel x87.
7031 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7032 /* software "double double", the 106 is 53+53.
7033 * but irix thinks it is 107. */
7034 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7035 /* double double 128-bit fully little-endian,
7036 * little-endian doubles in little-endian order,
7037 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7041 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7042 /* double double 128-bit fully big-endian,
7043 * big-endian doubles in big-endian order,
7044 * e.g. PPC/Power and MIPS:
7045 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7049 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7050 /* double double 128-bit mixed endian.
7051 * little-endian doubles in big-endian order,
7053 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7057 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7058 /* double double 128-bit mixed endian,
7059 * big-endian doubles in little-endian order,
7060 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7065 /* We are largely making this up because it may well be
7066 * that the VAX format H was never made available to C,
7067 * only to Fortran. */
7068 #if LONGDBLSIZE == 16 && defined(__vax__)
7069 if (b[0] == 0xFD && b[15] == 0x99) {
7070 /* VAX format H, PDP-11 mixed endian. */
7075 printf("-1\n"); /* unknown */
7080 if eval $compile; then
7081 longdblkind=`$run ./try`
7088 case "$longdblkind" in
7089 0) echo "Your long doubles are doubles." >&4 ;;
7090 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7091 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7092 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7093 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7094 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7095 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7096 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7097 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7098 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7099 *) echo "Cannot figure out your long double." >&4 ;;
7101 d_long_double_style_ieee=$undef
7102 d_long_double_style_ieee_std=$undef
7103 d_long_double_style_ieee_extended=$undef
7104 d_long_double_style_ieee_doubledouble=$undef
7105 d_long_double_style_vax=$undef
7106 case "$longdblkind" in
7107 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7109 case "$longdblkind" in
7110 1|2) d_long_double_style_ieee_std=$define ;;
7112 case "$longdblkind" in
7113 3|4) d_long_double_style_ieee_extended=$define ;;
7115 case "$longdblkind" in
7116 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7118 case "$longdblkind" in
7119 9) d_long_double_style_vax=$define ;;
7123 : determine the architecture name
7125 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7126 tarch=`arch`"-$osname"
7127 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7128 if uname -m > tmparch 2>&1 ; then
7129 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7130 -e 's/$/'"-$osname/" tmparch`
7138 case "$myarchname" in
7141 echo "(Your architecture name used to be $myarchname.)"
7145 case "$targetarch" in
7147 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7152 *) dflt="$archname";;
7154 rp='What is your architecture name'
7158 : optionally add API version to the architecture for versioned archlibs
7159 case "$useversionedarchname" in
7160 $define|true|[yY]*) dflt='y';;
7163 rp='Add the Perl API version to your archname?'
7166 y|Y) useversionedarchname="$define" ;;
7167 *) useversionedarchname="$undef" ;;
7169 case "$useversionedarchname" in
7172 *-$api_versionstring)
7173 echo "...and architecture name already has -$api_versionstring" >&4
7176 archname="$archname-$api_versionstring"
7177 echo "...setting architecture name to $archname." >&4
7183 case "$usethreads" in
7185 echo "Threads selected." >&4
7187 *-thread*) echo "...and architecture name already has -thread." >&4
7189 *) archname="$archname-thread"
7190 echo "...setting architecture name to $archname." >&4
7195 case "$usemultiplicity" in
7197 echo "Multiplicity selected." >&4
7199 *-multi*) echo "...and architecture name already has -multi." >&4
7201 *) archname="$archname-multi"
7202 echo "...setting architecture name to $archname." >&4
7207 case "$use64bitint$use64bitall" in
7209 case "$archname64" in
7211 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7214 case "$use64bitint" in
7215 "$define") echo "64 bit integers selected." >&4 ;;
7217 case "$use64bitall" in
7218 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7221 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7223 *) archname="$archname-$archname64"
7224 echo "...setting architecture name to $archname." >&4
7230 case "$uselongdouble" in
7232 echo "Long doubles selected." >&4
7233 case "$longdblsize" in
7235 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7239 *-ld*) echo "...and architecture name already has -ld." >&4
7241 *) archname="$archname-ld"
7242 echo "...setting architecture name to $archname." >&4
7249 case "$usequadmath" in
7251 echo "quadmath selected." >&4
7253 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7255 *) archname="$archname-quadmath"
7256 echo "...setting architecture name to $archname." >&4
7261 if $test -f archname.cbu; then
7262 echo "Your platform has some specific hints for architecture name, using them..."
7266 : set the prefixit variable, to compute a suitable default value
7267 prefixit='case "$3" in
7269 case "$oldprefix" in
7270 "") eval "$1=\"\$$2\"";;
7277 ""|" ") eval "$1=\"\$$2\"";;
7283 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7285 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7286 /*-$oldprefix/*|\~*-$oldprefix/*)
7287 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7288 *) eval "$1=\"\$$2\"";;
7292 : determine installation style
7293 : For now, try to deduce it from prefix unless it is already set.
7294 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7295 case "$installstyle" in
7296 '') case "$prefix" in
7297 *perl*) dflt='lib';;
7298 *) dflt='lib/perl5' ;;
7301 *) dflt="$installstyle" ;;
7303 : Probably not worth prompting for this since we prompt for all
7304 : the directories individually, and the prompt would be too long and
7308 : determine where public executables go
7313 rp='Pathname where the public executables will reside?'
7315 if $test "X$ansexp" != "X$binexp"; then
7319 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7320 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7321 : this via initialinstalllocation
7324 case "$userelocatableinc" in
7325 $define|true|[yY]*) dflt='y' ;;
7330 Would you like to build Perl so that the installation is relocatable, so that
7331 library paths in @INC are determined relative to the path of the perl binary?
7332 This is not advised for system Perl installs, or if you need to run setid
7333 scripts or scripts under taint mode.
7335 If this doesn't make any sense to you, just accept the default '$dflt'.
7337 rp='Use relocatable @INC?'
7340 y|Y) val="$define" ;;
7343 set userelocatableinc
7346 initialinstalllocation="$binexp"
7347 : Default prefix is now "up one level from where the binaries are"
7348 case "$userelocatableinc" in
7354 installprefixexp=".../.."
7358 : determine where private library files go
7359 : Usual default is /usr/local/lib/perl5/$version.
7360 : Also allow things like /opt/perl/lib/$version, since
7361 : /opt/perl/lib/perl5... would be redundant.
7362 : The default "style" setting is made in installstyle.U
7363 case "$installstyle" in
7364 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7365 *) set dflt privlib lib/$version ;;
7370 There are some auxiliary files for $package that need to be put into a
7371 private library directory that is accessible by everyone.
7376 rp='Pathname where the private library files will reside?'
7381 : set the prefixup variable, to restore leading tilda escape
7382 prefixup='case "$prefixexp" in
7384 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7387 : determine where public architecture dependent libraries go
7390 : privlib default is /usr/local/lib/$package/$version
7391 : archlib default is /usr/local/lib/$package/$version/$archname
7392 : privlib may have an optional trailing /share.
7393 tdflt=`echo $privlib | $sed 's,/share$,,'`
7394 tdflt=$tdflt/$archname
7403 $spackage contains architecture-dependent library files. If you are
7404 sharing libraries in a heterogeneous environment, you might store
7405 these files in a separate location. Otherwise, you can just include
7406 them with the rest of the public library files.
7411 rp='Where do you want to put the public architecture-dependent libraries?'
7415 if $test X"$archlib" = X"$privlib"; then
7421 : see if setuid scripts can be secure
7424 Some kernels have a bug that prevents setuid #! scripts from being
7425 secure. Some sites have disabled setuid #! scripts because of this.
7427 First let's decide if your kernel supports secure setuid #! scripts.
7428 (If setuid #! scripts would be secure but have been disabled anyway,
7429 don't say that they are secure if asked.)
7434 if $test -d /dev/fd; then
7435 echo "#!$ls" >reflect
7436 chmod +x,u+s reflect
7437 ./reflect >flect 2>&1
7438 if $contains "/dev/fd" flect >/dev/null; then
7439 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7443 If you are not sure if they are secure, I can check but I'll need a
7444 username and password different from the one you are using right now.
7445 If you don't have such a username or don't want me to test, simply
7449 rp='Other username to test security of setuid scripts with?'
7454 case "$d_suidsafe" in
7455 '') echo "I'll assume setuid scripts are *not* secure." >&4
7458 echo "Well, the $hint value is *not* secure." >&4
7460 *) echo "Well, the $hint value *is* secure." >&4
7465 $rm -f reflect flect
7466 echo "#!$ls" >reflect
7467 chmod +x,u+s reflect
7470 echo '"su" will (probably) prompt you for '"$ans's password."
7471 su $ans -c './reflect >flect'
7472 if $contains "/dev/fd" flect >/dev/null; then
7473 echo "Okay, it looks like setuid scripts are secure." >&4
7476 echo "I don't think setuid scripts are secure." >&4
7481 rp='Does your kernel have *secure* setuid scripts?'
7484 [yY]*) val="$define";;
7489 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7490 echo "(That's for file descriptors, not floppy disks.)"
7496 $rm -f reflect flect
7498 : now see if they want to do setuid emulation
7499 if $test $patchlevel -lt 11; then
7502 case "$d_suidsafe" in
7505 echo "No need to emulate SUID scripts since they are secure here." >&4
7509 Some systems have disabled setuid scripts, especially systems where
7510 setuid scripts cannot be secure. On systems where setuid scripts have
7511 been disabled, the setuid/setgid bits on scripts are currently
7512 useless. It is possible for $package to detect those bits and emulate
7513 setuid/setgid in a secure fashion. This emulation will only work if
7514 setuid scripts have been disabled in your kernel.
7518 "$define") dflt=y ;;
7521 rp="Do you want to do setuid/setgid emulation?"
7524 [yY]*) val="$define";;
7536 SUID emulation has been removed for 5.12
7537 Please re-run Configure without -Dd_dosuid
7546 : Find perl5.005 or later.
7547 echo "Looking for a previously installed perl5.005 or later... "
7549 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7550 : Check if this perl is recent and can load a simple module
7551 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7554 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7564 '') echo "None found. That's ok.";;
7565 *) echo "Using $perl5." ;;
7568 : Set the siteprefix variables
7571 After $package is installed, you may wish to install various
7572 add-on modules and utilities. Typically, these add-ons will
7573 be installed under $prefix with the rest
7574 of this package. However, you may wish to install such add-ons
7575 elsewhere under a different prefix.
7577 If you do not wish to put everything under a single prefix, that's
7578 ok. You will be prompted for the individual locations; this siteprefix
7579 is only used to suggest the defaults.
7581 The default should be fine for most people.
7585 rp='Installation prefix to use for add-on modules and utilities?'
7586 : XXX Here might be another good place for an installstyle setting.
7587 case "$siteprefix" in
7589 *) dflt=$siteprefix ;;
7592 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7594 case "$siteprefix" in
7598 *) oldsiteprefix="$prefix";;
7603 siteprefixexp="$ansexp"
7605 : determine where site specific libraries go.
7606 : Usual default is /usr/local/lib/perl5/site_perl/$version
7607 : The default "style" setting is made in installstyle.U
7608 : XXX No longer works with Prefixit stuff.
7609 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7611 '') case "$installstyle" in
7612 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7613 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7621 The installation process will create a directory for
7622 site-specific extensions and modules. Most users find it convenient
7623 to place all site-specific files in this directory rather than in the
7624 main distribution directory.
7628 rp='Pathname for the site-specific library files?'
7632 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7634 : Determine list of previous versions to include in @INC
7635 $cat > getverlist <<EOPL
7638 \$api_versionstring = "$api_versionstring";
7639 \$version = "$version";
7640 \$stem = "$sitelib_stem";
7641 \$archname = "$archname";
7643 $cat >> getverlist <<'EOPL'
7644 # The list found is store twice for each entry: the original name, and
7645 # the binary broken down version as pack "sss", so sorting is easy and
7646 # unambiguous. This will work for all versions that have a maximum of
7647 # three digit groups, separate by '.'s or '_'s. Names are extended with
7648 # ".0.0" to ensure at least three elements for the pack.
7649 # -- H.Merijn Brand (m)'06 23-10-2006
7651 # Can't have leading @ because metaconfig interprets it as a command!
7652 ;@inc_version_list=();
7653 # XXX Redo to do opendir/readdir?
7656 ;@candidates = map {
7657 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7658 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7664 ($pversion, $aversion, $vsn5005) = map {
7665 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7666 foreach $d (@candidates) {
7667 if ($d->[1] lt $pversion) {
7668 if ($d->[1] ge $aversion) {
7669 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7671 elsif ($d->[1] ge $vsn5005) {
7672 unshift(@inc_version_list, grep { -d } $d->[0]);
7676 # Skip newer version. I.e. don't look in
7677 # 5.7.0 if we're installing 5.6.1.
7681 if (@inc_version_list) {
7682 print join(' ', @inc_version_list);
7685 # Blank space to preserve value for next Configure run.
7690 case "$inc_version_list" in
7691 '') if test -x "$perl5$exe_ext"; then
7692 dflt=`$perl5 getverlist`
7697 $undef) dflt='none' ;;
7698 *) eval dflt=\"$inc_version_list\" ;;
7701 ''|' ') dflt=none ;;
7708 In order to ease the process of upgrading, this version of perl
7709 can be configured to use modules built and installed with earlier
7710 versions of perl that were installed under $prefix. Specify here
7711 the list of earlier versions that this version of perl should check.
7712 If Configure detected no earlier versions of perl installed under
7713 $prefix, then the list will be empty. Answer 'none' to tell perl
7714 to not search earlier versions.
7716 The default should almost always be sensible, so if you're not sure,
7717 just accept the default.
7720 rp='List of earlier versions to include in @INC?'
7723 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7724 *) inc_version_list="$ans" ;;
7726 case "$inc_version_list" in
7728 inc_version_list_init='0'
7729 d_inc_version_list="$undef"
7731 *) inc_version_list_init=`echo $inc_version_list |
7732 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7733 d_inc_version_list="$define"
7738 : see if malloc/malloc.h has to be included
7739 set malloc/malloc.h i_mallocmalloc
7742 : see if this is a malloc.h system
7743 : we want a real compile instead of Inhdr because some systems have a
7744 : malloc.h that just gives a compile error saying to use stdlib.h instead
7749 #$i_mallocmalloc I_MALLOCMALLOC
7750 #ifdef I_MALLOCMALLOC
7751 # include <malloc/malloc.h>
7754 int main () { return 0; }
7757 if eval $compile; then
7758 echo "<malloc.h> found." >&4
7761 echo "<malloc.h> NOT found." >&4
7768 : check for length of pointer
7772 echo "Checking to see how big your pointers are..." >&4
7781 printf("%d\n", (int)sizeof(void *));
7786 if eval $compile_ok; then
7787 ptrsize=`$run ./try`
7788 echo "Your pointers are $ptrsize bytes long."
7791 echo "(I can't seem to compile the test program. Guessing...)" >&4
7792 rp="What is the size of a pointer (in bytes)?"
7799 case "$use64bitall" in
7800 "$define"|true|[yY]*)
7804 *** You have chosen a maximally 64-bit build,
7805 *** but your pointers are only 4 bytes wide.
7806 *** Please rerun Configure without -Duse64bitall.
7811 *** Since you have quads, you could possibly try with -Duse64bitint.
7816 *** Cannot continue, aborting.
7827 : determine whether to use malloc wrapping
7829 case "$usemallocwrap" in
7830 [yY]*|true|$define) dflt='y' ;;
7831 [nN]*|false|$undef) dflt='n' ;;
7832 *) case "$usedevel" in
7833 [yY]*|true|$define) dflt='y' ;;
7838 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7840 usemallocwrap="$ans"
7843 usemallocwrap="$define" ;;
7845 usemallocwrap="$undef" ;;
7848 : determine which malloc to compile in
7850 case "$usemymalloc" in
7851 [yY]*|true|$define) dflt='y' ;;
7852 [nN]*|false|$undef) dflt='n' ;;
7853 *) case "$ptrsize" in
7857 if test "$useithreads" = "$define"; then dflt='n'; fi
7860 rp="Do you wish to attempt to use the malloc that comes with $package?"
7866 mallocsrc='malloc.c'
7867 mallocobj="malloc$_o"
7868 d_mymalloc="$define"
7871 : Remove malloc from list of libraries to use
7872 echo "Removing unneeded -lmalloc from library list" >&4
7873 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7876 echo "libs = $libs" >&4
7888 : compute the return types of malloc and free
7890 $cat >malloc.c <<END
7894 #include <sys/types.h>
7908 case "$malloctype" in
7910 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7917 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7921 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7928 echo "Your system uses $freetype free(), it would seem." >&4
7930 : determine where site specific architecture-dependent libraries go.
7931 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7932 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7933 : sitelib may have an optional trailing /share.
7935 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7936 dflt="$dflt/$archname"
7941 set sitearch sitearch none
7945 The installation process will also create a directory for
7946 architecture-dependent site-specific extensions and modules.
7950 rp='Pathname for the site-specific architecture-dependent library files?'
7954 if $test X"$sitearch" = X"$sitelib"; then
7957 d_sitearch="$define"
7960 : Set the vendorprefix variables
7963 The installation process will also create a directory for
7964 vendor-supplied add-ons. Vendors who supply perl with their system
7965 may find it convenient to place all vendor-supplied files in this
7966 directory rather than in the main distribution directory. This will
7967 ease upgrades between binary-compatible maintenance versions of perl.
7969 Of course you may also use these directories in whatever way you see
7970 fit. For example, you might use them to access modules shared over a
7971 company-wide network.
7973 The default answer should be fine for most people.
7974 This causes further questions about vendor add-ons to be skipped
7975 and no vendor-specific directories will be configured for perl.
7978 rp='Do you want to configure vendor-specific add-on directories?'
7979 case "$usevendorprefix" in
7980 define|true|[yY]*) dflt=y ;;
7981 *) : User may have set vendorprefix directly on Configure command line.
7982 case "$vendorprefix" in
7991 rp='Installation prefix to use for vendor-supplied add-ons?'
7992 case "$vendorprefix" in
7993 '') dflt="$prefix" ;;
7994 *) dflt=$vendorprefix ;;
7997 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7999 case "$vendorprefix" in
8003 *) oldvendorprefix="$prefix";;
8007 usevendorprefix="$define"
8009 vendorprefixexp="$ansexp"
8011 *) usevendorprefix="$undef"
8017 : Set the vendorlib variables
8018 case "$vendorprefix" in
8019 '') d_vendorlib="$undef"
8023 *) d_vendorlib="$define"
8024 : determine where vendor-supplied modules go.
8025 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8026 case "$vendorlib" in
8028 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8029 case "$installstyle" in
8030 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8031 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8034 *) dflt="$vendorlib"
8038 rp='Pathname for the vendor-supplied library files?'
8041 vendorlibexp="$ansexp"
8044 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8048 : Set the vendorarch variables
8049 case "$vendorprefix" in
8050 '') d_vendorarch="$undef"
8054 *) d_vendorarch="$define"
8055 : determine where vendor-supplied architecture-dependent libraries go.
8056 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8057 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8058 : vendorlib may have an optional trailing /share.
8059 case "$vendorarch" in
8060 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8061 dflt="$dflt/$archname"
8063 *) dflt="$vendorarch" ;;
8066 rp='Pathname for vendor-supplied architecture-dependent files?'
8069 vendorarchexp="$ansexp"
8072 prefixvar=vendorarch
8074 if $test X"$vendorarch" = X"$vendorlib"; then
8075 d_vendorarch="$undef"
8077 d_vendorarch="$define"
8080 : Final catch-all directories to search
8083 Lastly, you can have perl look in other directories for extensions and
8084 modules in addition to those already specified.
8085 These directories will be searched after
8089 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8090 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8092 case "$otherlibdirs" in
8093 ''|' ') dflt='none' ;;
8094 *) dflt="$otherlibdirs" ;;
8097 Enter a colon-separated set of extra paths to include in perl's @INC
8098 search path, or enter 'none' for no extra paths.
8102 rp='Colon-separated list of additional directories for perl to search?'
8105 ' '|''|none) otherlibdirs=' ' ;;
8106 *) otherlibdirs="$ans" ;;
8108 case "$otherlibdirs" in
8112 set d_perl_otherlibdirs
8115 : Cruising for prototypes
8117 echo "Checking out function prototypes..." >&4
8118 $cat >prototype.c <<EOCP
8123 int main(int argc, char *argv[]) {
8126 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8127 echo "Your C compiler appears to support function prototypes."
8130 echo "Your C compiler doesn't seem to understand function prototypes."
8137 : Check if ansi2knr is required
8138 case "$prototype" in
8140 *) ansi2knr='ansi2knr'
8145 This version of $package can only be compiled by a compiler that
8146 understands function prototypes. Unfortunately, your C compiler
8148 doesn't seem to understand them. Sorry about that.
8150 If GNU cc is available for your system, perhaps you could try that instead.
8152 Eventually, we hope to support building Perl with pre-ANSI compilers.
8153 If you would like to help in that effort, please contact <perlbug@perl.org>.
8155 Aborting Configure now.
8162 dflt_dtrace='/usr/sbin/dtrace'
8163 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8167 Perl can be built to support DTrace on platforms that support it.
8168 DTrace is a diagnosis and performance analysis tool from Sun.
8170 If this doesn't make any sense to you, just accept the default.
8174 case "$usedtrace" in
8180 dflt_dtrace=$usedtrace
8187 rp='Support DTrace if available?'
8190 y|Y) val="$define" ;;
8196 test "X$usedtrace" != "X$define" && break
8199 rp='Where is the dtrace executable?'
8208 if $dtrace -h -s ../perldtrace.d \
8209 -o perldtrace.tmp >/dev/null 2>&1 \
8210 && rm -f perldtrace.tmp
8213 echo "Good: your $dtrace knows about the -h flag."
8217 *** $me: Fatal Error: $dtrace doesn't support -h flag
8219 *** Your installed dtrace doesn't support the -h switch to compile a D
8220 *** program into a C header. Can't continue.
8232 *** $me: Fatal Error: $dtrace not found.
8239 echo "*** $dtrace was not found."
8245 : See if we want extra modules installed
8252 Perl can be built with extra modules or bundles of modules which
8253 will be fetched from the CPAN and installed alongside Perl.
8255 Notice that you will need access to the CPAN; either via the Internet,
8256 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8257 be asked later to configure the CPAN.pm module which will in turn do
8258 the installation of the rest of the extra modules or bundles.)
8260 Notice also that if the modules require any external software such as
8261 libraries and headers (the libz library and the zlib.h header for the
8262 Compress::Zlib module, for example) you MUST have any such software
8263 already installed, this configuration process will NOT install such
8266 If this doesn't make any sense to you, just accept the default '$dflt'.
8268 rp='Install any extra modules (y or n)?'
8274 Please list any extra modules or bundles to be installed from CPAN,
8275 with spaces between the names. The names can be in any format the
8276 'install' command of CPAN.pm will understand. (Answer 'none',
8277 without the quotes, to install no extra modules or bundles.)
8287 $rm -f ../extras.lst
8289 *) echo "(Saving the list of extras for later...)"
8290 echo "$extras" > ../extras.lst
8298 : determine where html pages for programs go
8299 set html1dir html1dir none
8303 If you wish to install html files for programs in $spackage, indicate
8304 the appropriate directory here. To skip installing html files,
8308 ''|none|$undef|' ') dflt=none ;;
8309 *) dflt=$html1dir ;;
8312 rp="Directory for the main $spackage html pages?"
8316 : Use ' ' for none so value is preserved next time through Configure
8317 $test X"$html1dir" = "X" && html1dir=' '
8319 : determine where html pages for libraries and modules go
8320 set html3dir html3dir none
8324 If you wish to install html files for modules associated with $spackage,
8325 indicate the appropriate directory here. To skip installing html files,
8328 : There is no obvious default. If they have specified html1dir, then
8329 : try to key off that, possibly changing .../html1 into .../html3.
8331 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8332 *) dflt=$html3dir ;;
8335 rp="Directory for the $spackage module html pages?"
8339 : Use ' ' for none so value is preserved next time through Configure
8340 $test X"$html3dir" = "X" && html3dir=' '
8342 : determine whether to install perl also as /usr/bin/perl
8345 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8347 Many scripts expect perl to be installed as /usr/bin/perl.
8349 If you want to, I can install the perl you are about to compile
8350 as /usr/bin/perl (in addition to $bin/perl).
8352 if test -f /usr/bin/perl; then
8355 However, please note that because you already have a /usr/bin/perl,
8356 overwriting that with a new Perl would very probably cause problems.
8357 Therefore I'm assuming you don't want to do that (unless you insist).
8360 case "$installusrbinperl" in
8361 "$define"|[yY]*) dflt='y';;
8367 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8370 case "$installusrbinperl" in
8371 "$undef"|[nN]*) dflt='n';;
8375 rp="Do you want to install perl as /usr/bin/perl?"
8378 [yY]*) val="$define";;
8384 set installusrbinperl
8387 : see if dlopen exists
8389 xxx_ccflags="$ccflags"
8391 : with g++ one needs -shared to get is-in-libc to work for dlopen
8392 case "$gccversion" in
8395 *) case "$d_cplusplus" in
8396 "$define") ccflags="$ccflags -shared" ;;
8403 ccflags="$xxx_ccflags"
8405 : see if this is a unistd.h system
8406 set unistd.h i_unistd
8409 : determine which dynamic loading, if any, to compile in
8411 dldir="ext/DynaLoader"
8424 $define) dflt='y' ;;
8426 : Does a dl_xxx.xs file exist for this operating system
8427 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8430 rp="Do you wish to use dynamic loading?"
8437 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8438 dflt="$dldir/dl_${osname}.xs"
8439 elif $test "$d_dlopen" = "$define" ; then
8440 dflt="$dldir/dl_dlopen.xs"
8445 *) dflt="$dldir/$dlsrc"
8448 echo "The following dynamic loading files are available:"
8449 : Can not go over to $dldir because getfile has path hard-coded in.
8450 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8451 rp="Source file to use for dynamic loading"
8457 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8461 Some systems may require passing special flags to $cc -c to
8462 compile modules that will be used to create a shared library.
8463 To use no flags, say "none".
8466 case "$cccdlflags" in
8467 '') case "$gccversion" in
8468 '') case "$osname" in
8470 irix*) dflt='-KPIC' ;;
8471 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8472 sunos) dflt='-pic' ;;
8476 *) case "$osname" in
8477 darwin) dflt='none' ;;
8478 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8483 *) dflt="$cccdlflags" ;;
8490 # If -Dsysroot was specified, now's the time to add it
8492 if test "X$sysroot" != X; then
8493 case "$gccversion" in
8498 dflt="$dflt --sysroot=$sysroot" ;;
8508 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8511 none) cccdlflags=' ' ;;
8512 *) cccdlflags="$ans" ;;
8517 Some systems use ld to create libraries that can be dynamically loaded,
8518 while other systems (such as those using ELF) use $cc.
8522 : Determine if this is ELF
8524 /* Test for whether ELF binaries are produced */
8536 int i = open("a.out",O_RDONLY);
8539 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8540 exit(0); /* succeed (yes, it is ELF) */
8544 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8550 '') if $test $bin_ELF = "$define"; then
8552 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8556 echo "I'll use ld to build dynamic libraries."
8564 rp="What command should be used to create dynamic libraries?"
8570 Some systems may require passing special flags to $ld to create a
8571 library that can be dynamically loaded. If your ld flags include
8572 -L/other/path options to locate libraries outside your loader's normal
8573 search path, you may need to specify those -L options here as well. To
8574 use no flags, say "none".
8577 case "$lddlflags" in
8578 '') case "$osname" in
8579 haiku) dflt='-shared' ;;
8581 case "$gccversion" in
8582 '') dflt="$dflt +vnocompatwarnings" ;;
8585 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8586 solaris) # See [perl #66604].
8587 # On Solaris 11, gcc -m64 on amd64
8588 # appears not to understand -G. gcc versions at
8589 # least as old as 3.4.3 support -shared, so just
8590 # use that with Solaris 11 and later, but keep
8591 # the old behavior for older Solaris versions.
8592 case "$gccversion" in
8594 *) case "$osvers" in
8595 2.?|2.10) dflt='-G' ;;
8596 *) dflt='-shared' ;;
8601 sunos) dflt='-assert nodefinitions' ;;
8602 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8606 *) dflt="$lddlflags" ;;
8609 : Only do this for gcc, since, for example, qcc has no concept
8611 if $test "X$sysroot" != X; then
8612 case "$gccversion" in
8614 *) dflt="$dflt --sysroot $sysroot" ;;
8618 : Try to guess additional flags to pick up local libraries.
8619 : Be careful not to append to a plain 'none'
8623 for thisflag in $ldflags; do
8628 *) dflt="$dflt $thisflag" ;;
8635 ''|' ') dflt='none' ;;
8639 *-fstack-protector-strong*)
8641 *-fstack-protector-strong*) ;; # Don't add it again
8642 *) dflt="$dflt -fstack-protector-strong" ;;
8645 *-fstack-protector*)
8647 *-fstack-protector*) ;; # Don't add it again
8648 *) dflt="$dflt -fstack-protector" ;;
8653 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8656 none) lddlflags=' ' ;;
8657 *) lddlflags="$ans" ;;
8662 Some systems may require passing special flags to $cc to indicate that
8663 the resulting executable will use dynamic linking. To use no flags,
8667 case "$ccdlflags" in
8668 '') case "$osname" in
8669 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8670 sunos) dflt='none' ;;
8674 *) dflt="$ccdlflags" ;;
8676 rp="Any special flags to pass to $cc to use dynamic linking?"
8679 none) ccdlflags=' ' ;;
8680 *) ccdlflags="$ans" ;;
8692 ld_can_script="$undef"
8693 case "$bin_ELF$usedl" in
8695 # Abuse try.h and a.out names for neat cleanup
8707 if $cc $cccdlflags $ccdlflags $ccflags \
8708 $ldflags $lddlflags -o a.out try.c \
8709 -Wl,--version-script=try.h >/dev/null 2>&1 \
8710 && $test -s a.out ; then
8711 echo "ld supports scripting" >&4
8712 ld_can_script="$define"
8714 echo "ld does not support scripting" >&4
8720 : Do we want a shared libperl?
8724 # No dynamic loading being used, so don't bother even to prompt.
8727 *) case "$useshrplib" in
8728 '') case "$osname" in
8729 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8731 also='Building a shared libperl is required for dynamic loading to work on your system.'
8745 The perl executable is normally obtained by linking perlmain.c with
8746 libperl${_a}, any static extensions (usually just DynaLoader), and
8747 any other libraries needed on this system (such as -lm, etc.). Since
8748 your system supports dynamic loading, it is probably possible to build
8749 a shared libperl.$so. If you will have more than one executable linked
8750 to libperl.$so, this will significantly reduce the size of each
8751 executable, but it may have a noticeable effect on performance. The
8752 default is probably sensible for your system.
8756 rp="Build a shared libperl.$so (y/n)"
8760 useshrplib='true' ;;
8761 *) useshrplib='false' ;;
8766 case "$useshrplib" in
8768 case "$userelocatableinc" in
8770 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8771 echo "See INSTALL for an explanation why that won't work." >&4
8777 # Figure out a good name for libperl.so. Since it gets stored in
8778 # a version-specific architecture-dependent library, the version
8779 # number isn't really that important, except for making cc/ld happy.
8781 # A name such as libperl.so.10.1
8782 majmin="libperl.$so.$patchlevel.$subversion"
8783 # A name such as libperl.so.100
8784 majonly=`echo $patchlevel $subversion |
8785 $awk '{printf "%d%02d", $1, $2}'`
8786 majonly=libperl.$so.$majonly
8787 # I'd prefer to keep the os-specific stuff here to a minimum, and
8788 # rely on figuring it out from the naming of libc.
8789 case "${osname}${osvers}" in
8790 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8793 cygwin*) # ld links now against the dll directly
8794 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8795 majonly=`echo $patchlevel $subversion |
8796 $awk '{printf "%03d%03d", $1, $2}'`
8797 majonly=cygperl5.$majonly.$so
8800 *) # Try to guess based on whether libc has major.minor.
8802 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8803 *libc.$so.[0-9]*) dflt=$majonly ;;
8804 *) dflt=libperl.$so ;;
8814 I need to select a good name for the shared libperl. If your system uses
8815 library names with major and minor numbers, then you might want something
8816 like $majmin. Alternatively, if your system uses a single version
8817 number for shared libraries, then you might want to use $majonly.
8818 Or, your system might be quite happy with a simple libperl.$so.
8820 Since the shared libperl will get installed into a version-specific
8821 architecture-dependent directory, the version number of the shared perl
8822 library probably isn't important, so the default should be o.k.
8825 rp='What name do you want to give to the shared libperl?'
8828 echo "Ok, I'll use $libperl"
8831 libperl="libperl${_a}"
8835 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8839 WARNING: Use of the shrpdir variable for the installation location of
8840 the shared $libperl is not supported. It was never documented and
8841 will not work in this version. Let me (perlbug@perl.org)
8842 know of any problems this may cause.
8848 But your current setting of $shrpdir is
8849 the default anyway, so it's harmless.
8854 Further, your current attempted setting of $shrpdir
8855 conflicts with the value of $archlibexp/CORE
8856 that installperl will use.
8863 # How will the perl executable find the installed shared $libperl?
8864 # Add $xxx to ccdlflags.
8865 # If we can't figure out a command-line option, use $shrpenv to
8866 # set env LD_RUN_PATH. The main perl makefile uses this.
8867 shrpdir=$archlibexp/CORE
8870 if "$useshrplib"; then
8873 # We'll set it in Makefile.SH...
8878 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8879 xxx="-Wl,-R$shrpdir"
8881 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8882 xxx="-Wl,-rpath,$shrpdir"
8885 # hpux doesn't like the default, either.
8886 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8889 # cygwin needs only ldlibpth
8892 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8898 # Only add $xxx if it isn't already in ccdlflags.
8899 case " $ccdlflags " in
8901 *) ccdlflags="$ccdlflags $xxx"
8904 Adding $xxx to the flags
8905 passed to $ld so that the perl executable will find the
8906 installed shared $libperl.
8914 # Fix ccdlflags in AIX for building external extensions.
8915 # (For building Perl itself bare -bE:perl.exp is needed,
8916 # Makefile.SH takes care of this.)
8918 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8920 # Respect a hint or command-line value.
8922 '') shrpenv="$tmp_shrpenv" ;;
8924 case "$ldlibpthname" in
8925 '') ldlibpthname=LD_LIBRARY_PATH ;;
8926 none) ldlibpthname='' ;;
8929 : determine where manual pages are on this system
8933 syspath='/usr/share/man/man1 /usr/man/man1'
8934 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8935 syspath="$syspath /usr/man/u_man/man1"
8936 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8937 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8938 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8939 sysman=`./loc . /usr/man/man1 $syspath`
8942 if $test -d "$sysman"; then
8943 echo "System manual is in $sysman." >&4
8945 echo "Could not find manual pages in source form." >&4
8948 : determine where manual pages go
8949 set man1dir man1dir none
8953 $spackage has manual pages available in source form.
8957 echo "However, you don't have nroff, so they're probably useless to you."
8959 '') man1dir="none";;
8962 echo "If you don't want the manual sources installed, answer 'none'."
8967 lookpath="$prefixexp/share/man/man1"
8968 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8969 lookpath="$lookpath $prefixexp/man/p_man/man1"
8970 lookpath="$lookpath $prefixexp/man/u_man/man1"
8971 lookpath="$lookpath $prefixexp/man/man.1"
8973 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8974 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8984 rp="Where do the main $spackage manual pages (source) go?"
8986 if $test "X$man1direxp" != "X$ansexp"; then
8997 : What suffix to use on installed man pages
9004 rp="What suffix should be used for the main $spackage man pages?"
9006 '') case "$man1dir" in
9020 *) dflt="$man1ext";;
9027 : see if we can have long filenames
9029 first=123456789abcdef
9031 if (echo hi >$first) 2>/dev/null; then
9032 if $test -f 123456789abcde; then
9033 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
9036 echo 'You can have filenames longer than 14 characters.'>&4
9041 You can't have filenames longer than 14 chars.
9042 You can't even think about them!
9048 $rm -rf 123456789abcde*
9050 : determine where library module manual pages go
9051 set man3dir man3dir none
9055 $spackage has manual pages for many of the library modules.
9061 However, you don't have nroff, so they're probably useless to you.
9064 '') man3dir="none";;
9068 case "$d_flexfnam" in
9071 However, your system can't handle the long file names like File::Basename.3.
9074 '') man3dir="none";;
9078 echo "If you don't want the manual sources installed, answer 'none'."
9079 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9081 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9082 if $test -d "$privlib/man/man3"; then
9085 WARNING: Previous versions of perl installed man3 pages into
9086 $privlib/man/man3. This version will suggest a
9087 new default of $dflt.
9091 rp='Do you wish to preserve the old behavior?(y/n)'
9094 y*) dflt="$privlib/man/man3" ;;
9099 *) dflt="$man3dir" ;;
9106 rp="Where do the $package library man pages (source) go?"
9116 : What suffix to use on installed man pages
9122 rp="What suffix should be used for the $package library man pages?"
9124 '') case "$man3dir" in
9138 *) dflt="$man3ext";;
9145 : see if we have to deal with yellow pages, now NIS.
9146 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9152 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9160 rp='Are you getting the hosts file via yellow pages?'
9163 y*) hostcat='ypcat hosts';;
9164 *) hostcat='cat /etc/hosts';;
9170 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9173 '') test -f /etc/group && groupcat='cat /etc/group';;
9176 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9179 : now get the host name
9181 echo "Figuring out host name..." >&4
9182 case "$myhostname" in
9184 echo 'Maybe "hostname" will work...'
9185 if tans=`sh -c hostname 2>&1` ; then
9193 if $test "$cont"; then
9195 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9196 if tans=`cat /etc/systemid 2>&1` ; then
9198 phostname='cat /etc/systemid'
9199 echo "Whadyaknow. Xenix always was a bit strange..."
9202 elif $test -r /etc/systemid; then
9203 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9206 if $test "$cont"; then
9207 echo 'No, maybe "uuname -l" will work...'
9208 if tans=`sh -c 'uuname -l' 2>&1` ; then
9210 phostname='uuname -l'
9212 echo 'Strange. Maybe "uname -n" will work...'
9213 if tans=`sh -c 'uname -n' 2>&1` ; then
9215 phostname='uname -n'
9217 echo 'Oh well, maybe I can mine it out of whoami.h...'
9218 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9219 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9220 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9222 case "$myhostname" in
9223 '') echo "Does this machine have an identity crisis or something?"
9226 echo "Well, you said $myhostname before..."
9227 phostname='echo $myhostname';;
9233 case "$myhostname" in
9234 '') myhostname=noname ;;
9236 : you do not want to know about this
9241 if $test "$myhostname" ; then
9243 rp='Your host name appears to be "'$myhostname'".'" Right?"
9251 : bad guess or no guess
9252 while $test "X$myhostname" = X ; do
9254 rp="Please type the (one word) name of your host:"
9259 : translate upper to lower if necessary
9260 case "$myhostname" in
9262 echo "(Normalizing case in your host name)"
9263 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9267 case "$myhostname" in
9269 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9270 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9271 echo "(Trimming domain name from host name--host name is now $myhostname)"
9273 *) case "$mydomain" in
9276 test "X$hostcat" = "Xypcat hosts" &&
9277 ypmatch "$myhostname" hosts 2>/dev/null |\
9278 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9281 test "X$hostcat" != "X" &&
9282 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9283 /[ ]$myhostname[ . ]/p" > hosts
9286 if $test -f hosts; then
9287 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9288 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9289 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9290 hosts | $sort | $uniq | \
9291 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9292 case `$echo X$dflt` in
9293 X*\ *) echo "(Several hosts in the database matched hostname)"
9296 X.) echo "(You do not have fully-qualified names in the hosts database)"
9300 echo "(I cannot locate a hosts database anywhere)"
9305 tans=`./loc resolv.conf X /etc /usr/etc`
9306 if $test -f "$tans"; then
9307 echo "(Attempting domain name extraction from $tans)"
9308 dflt=.`$sed -n -e 's/ / /g' \
9309 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9312 .) dflt=.`$sed -n -e 's/ / /g' \
9313 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9321 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9322 dflt=.`sh -c domainname 2>/dev/null`
9325 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9329 case "$dflt$osname" in
9330 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9331 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9335 .) echo "(Lost all hope -- silly guess then)"
9341 *) dflt="$mydomain";;
9345 rp="What is your domain name?"
9355 : translate upper to lower if necessary
9358 echo "(Normalizing case in your domain name)"
9359 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9363 : a little sanity check here
9364 case "$phostname" in
9367 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9368 $myhostname$mydomain|$myhostname) ;;
9370 case "$phostname" in
9372 echo "(That doesn't agree with your whoami.h file, by the way.)"
9375 echo "(That doesn't agree with your $phostname command, by the way.)"
9383 : determine the e-mail address of the user who is running us
9386 I need to get your e-mail address in Internet format if possible, i.e.
9387 something like user@host.domain. Please answer accurately since I have
9388 no easy means to double check it. The default value provided below
9389 is most probably close to reality but may not be valid from outside
9390 your organization...
9394 while test "$cont"; do
9395 case "$MAILDOMAIN" in
9397 if $test -s /etc/mailname; then
9398 maildomain=`$cat /etc/mailname`
9400 maildomain="$myhostname$mydomain"
9403 *) maildomain="$MAILDOMAIN";;
9406 '') dflt="$cf_by@$maildomain";;
9407 *) dflt="$cf_email";;
9409 rp='What is your e-mail address?'
9415 rp='Address does not look like an Internet one. Use it anyway?'
9429 : Ask e-mail of administrator
9432 If you or somebody else will be maintaining perl at your site, please
9433 fill in the correct e-mail address here so that they may be contacted
9434 if necessary. Currently, the "perlbug" program included with perl
9435 will send mail to this address in addition to perlbug@perl.org. You may
9436 enter "none" for no administrator.
9439 case "$perladmin" in
9440 '') dflt="$cf_email";;
9441 *) dflt="$perladmin";;
9443 rp='Perl administrator e-mail address'
9447 : determine whether to use a version number suffix for installed binaries
9450 Do you want to use a version number suffix for installed binaries? This
9451 will install 'perl$version' instead of 'perl', and likewise for other
9452 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9453 to be installed side-by-side. Unless you are a developer, you probably
9454 do *not* want to do this.
9456 case "$versiononly" in
9457 "$define"|[Yy]*|true) dflt='y' ;;
9460 rp="Do you want to use a version number suffix for installed binaries?"
9463 [yY]*) val="$define";;
9469 case "$versiononly" in
9470 "$define") inc_version_list=''
9471 inc_version_list_init=0
9475 : figure out how to guarantee perl startup
9476 : XXX Note that this currently takes advantage of the bug that binexp ignores
9477 : the Configure -Dinstallprefix setting, which in turn means that under
9478 : relocatable @INC, initialinstalllocation is what binexp started as.
9479 case "$startperl" in
9481 case "$sharpbang" in
9485 I can use the #! construct to start perl on your system. This will
9486 make startup of perl scripts faster, but may cause problems if you
9487 want to share those scripts and perl is not in a standard place
9488 ($initialinstalllocation/perl) on all your platforms. The alternative
9489 is to force a shell by starting the script with a single ':' character.
9492 case "$versiononly" in
9493 "$define") dflt="$initialinstalllocation/perl$version";;
9494 *) dflt="$initialinstalllocation/perl";;
9496 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9499 none) startperl=": # use perl";;
9500 *) startperl="#!$ans"
9501 if $test 30 -lt `echo "$ans" | wc -c`; then
9504 WARNING: Some systems limit the #! command to 32 characters.
9505 If you experience difficulty running Perl scripts with #!, try
9506 installing Perl in a directory with a shorter pathname.
9512 *) startperl=": # use perl"
9517 echo "I'll use $startperl to start perl scripts."
9519 : figure best path for perl in scripts
9522 case "$versiononly" in
9523 "$define") perlpath="$initialinstalllocation/perl$version";;
9524 *) perlpath="$initialinstalllocation/perl";;
9526 case "$startperl" in
9531 I will use the "eval 'exec'" idiom to start Perl on your system.
9532 I can use the full path of your Perl binary for this purpose, but
9533 doing so may cause problems if you want to share those scripts and
9534 Perl is not always in a standard place ($initialinstalllocation/perl).
9537 dflt="$initialinstalllocation/perl"
9538 rp="What path shall I use in \"eval 'exec'\"?"
9545 case "$startperl" in
9547 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9550 : determine where public executable scripts go
9551 set scriptdir scriptdir
9553 case "$scriptdir" in
9556 : guess some guesses
9557 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9558 $test -d /usr/share/bin && dflt=/usr/share/bin
9559 $test -d /usr/local/script && dflt=/usr/local/script
9560 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9561 $test -d $prefixexp/script && dflt=$prefixexp/script
9565 *) dflt="$scriptdir"
9570 Some installations have a separate directory just for executable scripts so
9571 that they can mount it across multiple architectures but keep the scripts in
9572 one spot. You might, for example, have a subdirectory of /usr/share for this.
9573 Or you might just lump your scripts in with all your other executables.
9577 rp='Where do you keep publicly executable scripts?'
9579 if $test "X$ansexp" != "X$scriptdirexp"; then
9585 : A little fix up for an irregularly named variable.
9586 installscript="$installscriptdir"
9588 : determine where add-on public executables go
9590 '') dflt=$siteprefix/bin ;;
9594 rp='Pathname where the add-on public executables should be installed?'
9599 : determine where add-on html pages go
9600 : There is no standard location, so try to copy the previously-selected
9601 : directory structure for the core html pages.
9602 case "$sitehtml1dir" in
9603 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9604 *) dflt=$sitehtml1dir ;;
9607 ''|' ') dflt=none ;;
9610 rp='Pathname where the site-specific html pages should be installed?'
9612 prefixvar=sitehtml1dir
9615 : determine where add-on library html pages go
9616 : There is no standard location, so try to copy the previously-selected
9617 : directory structure for the core html pages.
9618 case "$sitehtml3dir" in
9619 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9620 *) dflt=$sitehtml3dir ;;
9623 ''|' ') dflt=none ;;
9626 rp='Pathname where the site-specific library html pages should be installed?'
9628 prefixvar=sitehtml3dir
9631 : determine where add-on manual pages go
9632 case "$siteman1dir" in
9633 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9634 *) dflt=$siteman1dir ;;
9637 ''|' ') dflt=none ;;
9640 rp='Pathname where the site-specific manual pages should be installed?'
9642 prefixvar=siteman1dir
9645 : determine where add-on library man pages go
9646 case "$siteman3dir" in
9647 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9648 *) dflt=$siteman3dir ;;
9651 ''|' ') dflt=none ;;
9654 rp='Pathname where the site-specific library manual pages should be installed?'
9656 prefixvar=siteman3dir
9659 : determine where add-on public executable scripts go
9660 case "$sitescript" in
9661 '') dflt=$siteprefix/script
9662 $test -d $dflt || dflt=$sitebin ;;
9663 *) dflt="$sitescript" ;;
9666 rp='Pathname where add-on public executable scripts should be installed?'
9668 prefixvar=sitescript
9671 : see if backtrace exists
9672 set backtrace d_backtrace
9675 : add flags if using c backtrace
9676 case "$usecbacktrace" in
9677 "") usecbacktrace=$undef ;;
9679 case "$d_backtrace" in
9681 case " $ccflags " in
9682 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9683 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9687 echo "This system does not support backtrace" >&4
9688 usecbacktrace=$undef
9694 : Check if faststdio is requested and available
9695 case "$usefaststdio" in
9696 $define|true|[yY]*|'')
9697 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9707 Perl can be built to use 'fast stdio', which means using the stdio
9708 library but also directly manipulating the stdio buffers to enable
9709 faster I/O. Using stdio is better for backward compatibility (especially
9710 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9711 interface has been preferred instead of stdio.
9713 If this doesn't make any sense to you, just accept the default '$dflt'.
9715 rp='Use the "fast stdio" if available?'
9718 y|Y) val="$define" ;;
9725 : define an is-a-typedef? function
9726 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9728 "") inclist="sys/types.h";;
9730 eval "varval=\$$var";
9734 for inc in $inclist; do
9735 echo "#include <$inc>" >>temp.c;
9737 echo "#ifdef $type" >> temp.c;
9738 echo "printf(\"We have $type\");" >> temp.c;
9739 echo "#endif" >> temp.c;
9740 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9741 if $contains $type temp.E >/dev/null 2>&1; then
9747 *) eval "$var=\$varval";;
9750 : define an is-a-typedef? function that prompts if the type is not available.
9751 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9753 "") inclist="sys/types.h";;
9755 eval "varval=\$$var";
9759 for inc in $inclist; do
9760 echo "#include <$inc>" >>temp.c;
9762 echo "#ifdef $type" >> temp.c;
9763 echo "printf(\"We have $type\");" >> temp.c;
9764 echo "#endif" >> temp.c;
9765 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9767 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9768 if $contains $type temp.E >/dev/null 2>&1; then
9769 echo "$type found." >&4;
9772 echo "$type NOT found." >&4;
9778 *) eval "$var=\$varval";;
9781 : see what type lseek is declared as in the kernel
9782 rp="What is the type used for lseek's offset on this system?"
9783 set off_t lseektype long stdio.h sys/types.h
9787 echo "Checking to see how big your file offsets are..." >&4
9789 #include <sys/types.h>
9793 printf("%d\n", (int)sizeof($lseektype));
9798 if eval $compile_ok; then
9799 lseeksize=`$run ./try`
9800 echo "Your file offsets are $lseeksize bytes long."
9804 echo "(I can't seem to compile the test program. Guessing...)"
9805 rp="What is the size of your file offsets (in bytes)?"
9811 : see what type file positions are declared as in the library
9812 rp="What is the type for file position used by fsetpos()?"
9813 set fpos_t fpostype long stdio.h sys/types.h
9816 : Check size for Fpos_t
9819 *_t) zzz="$fpostype" ;;
9822 echo "Checking the size of $zzz..." >&4
9824 #include <sys/types.h>
9831 printf("%d\n", (int)sizeof($fpostype));
9836 if eval $compile_ok; then
9840 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9843 echo "Your $zzz is $fpossize bytes long."
9849 echo "(I can't compile the test program. Guessing...)" >&4
9850 rp="What is the size of your file positions (in bytes)?"
9855 : Check for large file support
9856 # Backward compatibility (uselfs is deprecated).
9858 "$define"|true|[yY]*)
9861 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9863 uselargefiles="$define"
9867 case "$lseeksize:$fpossize" in
9870 You can have files larger than 2 gigabytes.
9873 *) case "$uselargefiles" in
9874 "$undef"|false|[nN]*) dflt='n' ;;
9879 Perl can be built to understand large files (files larger than 2 gigabytes)
9880 on some systems. To do so, Configure can be run with -Duselargefiles.
9882 If this doesn't make any sense to you, just accept the default '$dflt'.
9884 rp='Try to understand large files, if available?'
9887 y|Y) val="$define" ;;
9894 : Look for a hint-file generated 'call-back-unit'. If the
9895 : user has specified that a large files perl is to be built,
9896 : we may need to set or change some other defaults.
9897 if $test -f uselargefiles.cbu; then
9898 echo "Your platform has some specific hints regarding large file builds, using them..."
9899 . ./uselargefiles.cbu
9901 case "$uselargefiles" in
9903 if $test -f uselargefiles.cbu; then
9905 echo "Rechecking to see how big your file offsets are..." >&4
9907 #include <sys/types.h>
9911 printf("%d\n", (int)sizeof($lseektype));
9916 if eval $compile_ok; then
9917 lseeksize=`$run ./try`
9918 $echo "Your file offsets are now $lseeksize bytes long."
9922 echo "(I can't seem to compile the test program. Guessing...)"
9923 rp="What is the size of your file offsets (in bytes)?"
9928 *_t) zzz="$fpostype" ;;
9931 $echo $n "Rechecking the size of $zzz...$c" >&4
9933 #include <sys/types.h>
9940 printf("%d\n", (int)sizeof($fpostype));
9945 if eval $compile_ok; then
9950 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9953 echo " $fpossize bytes." >&4
9959 echo "(I can't compile the test program. Guessing...)" >&4
9960 rp="What is the size of your file positions (in bytes)?"
9969 : Check if we want perlio
9972 : Set the vendorbin variables
9973 case "$vendorprefix" in
9974 '') d_vendorbin="$undef"
9978 *) d_vendorbin="$define"
9979 : determine where vendor-supplied executables go.
9980 case "$vendorbin" in
9981 '') dflt=$vendorprefix/bin ;;
9982 *) dflt="$vendorbin" ;;
9985 rp='Pathname for the vendor-supplied executables directory?'
9988 vendorbinexp="$ansexp"
9994 : Set the vendorhtml1dir variables
9995 case "$vendorprefix" in
9996 '') vendorhtml1dir=''
9997 vendorhtml1direxp=''
9999 *) : determine where vendor-supplied html pages go.
10000 : There is no standard location, so try to copy the previously-selected
10001 : directory structure for the core html pages.
10002 : XXX Better default suggestions would be welcome.
10003 case "$vendorhtml1dir" in
10004 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10005 *) dflt=$vendorhtml1dir ;;
10008 ''|' ') dflt=none ;;
10011 rp='Pathname for the vendor-supplied html pages?'
10013 vendorhtml1dir="$ans"
10014 vendorhtml1direxp="$ansexp"
10017 : Use ' ' for none so value is preserved next time through Configure
10018 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
10019 prefixvar=vendorhtml1dir
10022 : Set the vendorhtml3dir variables
10023 case "$vendorprefix" in
10024 '') vendorhtml3dir=''
10025 vendorhtml3direxp=''
10027 *) : determine where vendor-supplied module html pages go.
10028 : There is no standard location, so try to copy the previously-selected
10029 : directory structure for the core html pages.
10030 : XXX Better default suggestions would be welcome.
10031 case "$vendorhtml3dir" in
10032 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10033 *) dflt=$vendorhtml3dir ;;
10036 ''|' ') dflt=none ;;
10039 rp='Pathname for the vendor-supplied html pages?'
10041 vendorhtml3dir="$ans"
10042 vendorhtml3direxp="$ansexp"
10045 : Use ' ' for none so value is preserved next time through Configure
10046 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10047 prefixvar=vendorhtml3dir
10050 : Set the vendorman1dir variables
10051 case "$vendorprefix" in
10052 '') vendorman1dir=''
10053 vendorman1direxp=''
10055 *) : determine where vendor-supplied manual pages go.
10056 case "$vendorman1dir" in
10057 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10058 *) dflt=$vendorman1dir ;;
10061 ''|' ') dflt=none ;;
10064 rp='Pathname for the vendor-supplied manual section 1 pages?'
10066 vendorman1dir="$ans"
10067 vendorman1direxp="$ansexp"
10070 : Use ' ' for none so value is preserved next time through Configure
10071 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10072 prefixvar=vendorman1dir
10075 : Set the vendorman3dir variables
10076 case "$vendorprefix" in
10077 '') vendorman3dir=''
10078 vendorman3direxp=''
10080 *) : determine where vendor-supplied module manual pages go.
10081 case "$vendorman3dir" in
10082 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10083 *) dflt=$vendorman3dir ;;
10086 ''|' ') dflt=none ;;
10089 rp='Pathname for the vendor-supplied manual section 3 pages?'
10091 vendorman3dir="$ans"
10092 vendorman3direxp="$ansexp"
10095 : Use ' ' for none so value is preserved next time through Configure
10096 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10097 prefixvar=vendorman3dir
10100 : Set the vendorscript variables
10101 case "$vendorprefix" in
10102 '') d_vendorscript="$undef"
10106 *) d_vendorscript="$define"
10107 : determine where vendor-supplied scripts go.
10108 case "$vendorscript" in
10109 '') dflt=$vendorprefix/script
10110 $test -d $dflt || dflt=$vendorbin ;;
10111 *) dflt="$vendorscript" ;;
10115 The installation process will create a directory for
10116 vendor-supplied scripts.
10120 rp='Pathname for the vendor-supplied scripts directory?'
10122 vendorscript="$ans"
10123 vendorscriptexp="$ansexp"
10126 prefixvar=vendorscript
10129 : script used to emit important warnings
10132 if test \$# -gt 0; then
10137 echo "*** WARNING:" >&4
10138 sed -e 's/^/*** /' <msg >&4
10140 cat msg >>config.msg
10141 echo " " >>config.msg
10147 : see which of string.h or strings.h is needed
10149 strings=`./findhdr string.h`
10150 if $test "$strings" && $test -r "$strings"; then
10151 echo "Using <string.h> instead of <strings.h>." >&4
10155 strings=`./findhdr strings.h`
10156 if $test "$strings" && $test -r "$strings"; then
10157 echo "Using <strings.h> instead of <string.h>." >&4
10159 ./warn "No string header found -- You'll surely have problems."
10164 case "$i_string" in
10165 "$undef") strings=`./findhdr strings.h`;;
10166 *) strings=`./findhdr string.h`;;
10169 : see if qgcvt exists
10173 : Check what kind of doubles your system has
10174 $echo "Checking the kind of doubles you have..." >&4
10176 #$i_stdlib I_STDLIB
10177 #define DOUBLESIZE $doublesize
10179 #include <stdlib.h>
10182 static const double d = -0.1;
10184 unsigned const char* b = (unsigned const char*)(&d);
10185 #if DOUBLESIZE == 4
10186 if (b[0] == 0xCD && b[3] == 0xBD) {
10187 /* IEEE 754 32-bit little-endian */
10191 if (b[0] == 0xBD && b[3] == 0xCD) {
10192 /* IEEE 754 32-bit big-endian */
10196 if (b[0] == 0xCC && b[3] == 0xCC) {
10197 /* VAX format F, 32-bit PDP-style mixed endian. */
10201 if (b[0] == 0xC0 && b[3] == 0x9A) {
10202 /* IBM single 32-bit */
10207 #if DOUBLESIZE == 8
10208 if (b[0] == 0x9A && b[7] == 0xBF) {
10209 /* IEEE 754 64-bit little-endian */
10213 if (b[0] == 0xBF && b[7] == 0x9A) {
10214 /* IEEE 754 64-bit big-endian */
10218 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10219 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10220 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10221 * 99 99 b9 bf 9a 99 99 99 */
10225 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10226 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10227 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10228 * 99 99 99 9a bf b9 99 99 */
10232 if (b[0] == 0xCC && b[7] == 0xCC) {
10233 /* VAX format D, 64-bit PDP-style mixed endian. */
10237 if (b[0] == 0xD9 && b[7] == 0x99) {
10238 /* VAX format G, 64-bit PDP-style mixed endian. */
10242 if (b[0] == 0xC0 && b[7] == 0x9A) {
10243 /* IBM double 64-bit */
10247 if (b[0] == 0xBF && b[7] == 0xCD) {
10248 /* CRAY single 64-bit */
10253 #if DOUBLESIZE == 16
10254 if (b[0] == 0x9A && b[15] == 0xBF) {
10255 /* IEEE 754 128-bit little-endian */
10259 if (b[0] == 0xBF && b[15] == 0x9A) {
10260 /* IEEE 754 128-bit big-endian */
10265 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10266 * Whether those environments can still build Perl is debatable. */
10267 printf("-1\n"); /* unknown */
10272 if eval $compile; then
10273 doublekind=`$run ./try`
10277 case "$doublekind" in
10278 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10279 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10280 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10281 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10282 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10283 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10284 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10285 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10286 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10287 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10288 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10289 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10290 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10291 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10292 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10294 d_double_style_ieee=$undef
10295 d_double_style_vax=$undef
10296 d_double_style_ibm=$undef
10297 d_double_style_cray=$undef
10298 case "$doublekind" in
10299 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10300 9|10|11) d_double_style_vax=$define ;;
10301 12|13) d_double_style_ibm=$define ;;
10302 14) d_double_style_cray=$define ;;
10304 case "$d_double_style_ieee" in
10306 d_double_has_inf=$define
10307 d_double_has_nan=$define
10308 d_double_has_negative_zero=$define
10309 d_double_has_subnormals=$define
10312 d_double_has_inf=$undef
10313 d_double_has_nan=$undef
10314 d_double_has_negative_zero=$undef
10315 d_double_has_subnormals=$undef
10320 : Check print/scan long double stuff
10323 if $test X"$d_longdbl" = X"$define"; then
10325 echo "Checking how to print long doubles..." >&4
10327 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10328 $cat >try.c <<'EOCP'
10329 #include <sys/types.h>
10332 double d = 123.456;
10333 printf("%.3f\n", d);
10337 if eval $compile; then
10341 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10342 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10343 echo "We will use %f."
10349 if $test X"$sPRIfldbl" = X; then
10350 $cat >try.c <<'EOCP'
10351 #include <sys/types.h>
10354 long double d = 123.456;
10355 printf("%.3Lf\n", d);
10359 if eval $compile; then
10363 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10364 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10365 echo "We will use %Lf."
10371 if $test X"$sPRIfldbl" = X; then
10372 $cat >try.c <<'EOCP'
10373 #include <sys/types.h>
10376 long double d = 123.456;
10377 printf("%.3llf\n", d);
10381 if eval $compile; then
10385 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10386 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10387 echo "We will use %llf."
10393 if $test X"$sPRIfldbl" = X; then
10394 $cat >try.c <<'EOCP'
10395 #include <sys/types.h>
10398 long double d = 123.456;
10399 printf("%.3lf\n", d);
10403 if eval $compile; then
10407 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10408 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10409 echo "We will use %lf."
10415 if $test X"$sPRIfldbl" = X; then
10416 echo "Cannot figure out how to print long doubles." >&4
10418 sSCNfldbl=$sPRIfldbl # expect consistency
10425 case "$sPRIfldbl" in
10426 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10427 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10428 d_SCNfldbl="$undef";
10430 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10431 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10432 d_SCNfldbl="$define";
10436 : Before committing on uselongdouble, see whether that looks sane.
10437 if $test "$uselongdouble" = "$define"; then
10440 echo "Checking if your long double math functions work right..." >&4
10445 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10448 case "$osname:$gccversion" in
10449 aix:) saveccflags="$ccflags"
10450 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10453 if eval $compile_ok; then
10457 3) echo "Your long double math functions are working correctly." >&4 ;;
10458 *) echo "Your long double math functions are broken, not using long doubles." >&4
10459 uselongdouble=$undef
10463 case "$osname:$gccversion" in
10464 aix:) ccflags="$saveccflags" ;; # restore
10468 : Check how to convert floats to strings.
10470 if test "X$d_Gconvert" = X; then
10473 echo "Checking for an efficient way to convert floats to strings."
10475 case "$uselongdouble" in
10476 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10478 case "$d_longdbl" in
10479 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10481 case "$d_PRIgldbl" in
10482 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10485 #ifdef TRY_gconvert
10486 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10487 char *myname = "gconvert";
10490 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10491 char *myname = "gcvt";
10494 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10495 char *myname = "qgcvt";
10496 #define DOUBLETYPE long double
10499 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10500 #ifdef HAS_PRIgldbl
10501 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10503 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10506 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10508 char *myname = "sprintf";
10512 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10513 #define DOUBLETYPE long double
10515 #define DOUBLETYPE double
10521 #$i_stdlib I_STDLIB
10523 #include <stdlib.h>
10525 #$i_string I_STRING
10527 # include <string.h>
10529 # include <strings.h>
10532 int checkit(char *expect, char *got)
10534 if (strcmp(expect, got)) {
10535 printf("%s oddity: Expected %s, got %s\n",
10536 myname, expect, got);
10546 /* This must be 1st test on (which?) platform */
10547 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10548 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10549 checkit("0.1", buf);
10551 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10552 checkit("0.01", buf);
10554 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10555 checkit("0.001", buf);
10557 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10558 checkit("0.0001", buf);
10560 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10561 if (strlen(buf) > 5)
10562 checkit("9e-005", buf); /* for Microsoft ?? */
10564 checkit("9e-05", buf);
10566 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10569 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10570 checkit("1.1", buf);
10572 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10573 checkit("1.01", buf);
10575 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10576 checkit("1.001", buf);
10578 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10579 checkit("1.0001", buf);
10581 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10582 checkit("1.00001", buf);
10584 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10585 checkit("1.000001", buf);
10587 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10590 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10591 checkit("-1", buf);
10593 /* Some Linux gcvt's give 1.e+5 here. */
10594 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10595 checkit("100000", buf);
10597 /* Some Linux gcvt's give -1.e+5 here. */
10598 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10599 checkit("-100000", buf);
10601 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10602 checkit("123.456", buf);
10604 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10605 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10606 /* 34 should be enough to scare even long double
10607 * places into using the e notation. */
10608 if (strlen(buf) > 5)
10609 checkit("1e+034", buf); /* for Microsoft */
10611 checkit("1e+34", buf);
10613 /* For Perl, if you add additional tests here, also add them to
10614 * t/base/num.t for benefit of platforms not using Configure or
10615 * overriding d_Gconvert */
10620 : first add preferred functions to our list
10622 for xxx_convert in $gconvert_preference; do
10623 case $xxx_convert in
10624 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10625 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10628 : then add any others
10629 for xxx_convert in gconvert gcvt sprintf; do
10630 case "$xxx_list" in
10632 *) xxx_list="$xxx_list $xxx_convert" ;;
10636 case "$d_longdbl$uselongdouble" in
10638 : again, add preferred functions to our list first
10640 for xxx_convert in $gconvert_ld_preference; do
10641 case $xxx_convert in
10642 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10643 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10646 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10647 for xxx_convert in qgcvt sprintf $xxx_list; do
10648 case "$xxx_ld_list" in
10649 $xxx_convert*|*" $xxx_convert"*) ;;
10650 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10653 : if sprintf cannot do long doubles, move it to the end
10654 if test "$d_PRIgldbl" != "$define"; then
10655 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10657 : if no qgcvt, remove it
10658 if test "$d_qgcvt" != "$define"; then
10659 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10662 xxx_list="$xxx_ld_list"
10666 for xxx_convert in $xxx_list; do
10667 echo "Trying $xxx_convert..."
10668 $rm -f try try$_o core
10669 set try -DTRY_$xxx_convert
10670 if eval $compile; then
10671 echo "$xxx_convert() found." >&4
10672 if $run ./try; then
10673 echo "I'll use $xxx_convert to convert floats into a string." >&4
10676 echo "...But $xxx_convert didn't work as I expected."
10680 echo "$xxx_convert NOT found." >&4
10684 if test X$xxx_convert = X; then
10685 echo "*** WHOA THERE!!! ***" >&4
10686 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10687 xxx_convert=sprintf
10690 case "$xxx_convert" in
10691 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10692 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10693 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10694 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10695 "$define$define$define")
10696 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10697 "$define$define$undef")
10698 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10699 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10707 : see if _fwalk exists
10711 : Initialize h_fcntl
10714 : Initialize h_sysfile
10717 : access call always available on UNIX
10718 set access d_access
10721 : locate the flags for 'access()'
10722 case "$d_access" in
10725 $cat >access.c <<EOCP
10726 #include <sys/types.h>
10731 #include <sys/file.h>
10734 #include <unistd.h>
10736 #$i_stdlib I_STDLIB
10738 #include <stdlib.h>
10744 : check sys/file.h first, no particular reason here
10745 if $test `./findhdr sys/file.h` && \
10746 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10748 echo "<sys/file.h> defines the *_OK access constants." >&4
10749 elif $test `./findhdr fcntl.h` && \
10750 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10752 echo "<fcntl.h> defines the *_OK access constants." >&4
10753 elif $test `./findhdr unistd.h` && \
10754 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10755 echo "<unistd.h> defines the *_OK access constants." >&4
10757 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10763 : see if accessx exists
10764 set accessx d_accessx
10767 : see if acosh exists
10771 : see if aintl exists
10775 : see if alarm exists
10779 : see if 64bit time functions exists
10781 set ctime64 d_ctime64
10784 set localtime64 d_localtime64
10787 set gmtime64 d_gmtime64
10790 set mktime64 d_mktime64
10793 set difftime64 d_difftime64
10796 set asctime64 d_asctime64
10799 : see if POSIX threads are available
10800 set pthread.h i_pthread
10803 : define a function to check prototypes
10804 $cat > protochk <<EOSH
10807 optimize="$optimize"
10809 prototype="$prototype"
10812 usethreads=$usethreads
10813 i_pthread=$i_pthread
10814 pthread_h_first=$pthread_h_first
10817 $cat >> protochk <<'EOSH'
10822 while test $# -ge 2; do
10824 $define) echo "#include <$2>" >> try.c ;;
10825 literal) echo "$2" >> try.c ;;
10827 # Extra magic for the benefit of systems that need pthread.h
10828 # to be included early to correctly detect threadsafe functions.
10829 # Such functions must guarantee themselves, though, that the usethreads
10830 # and i_pthread have been defined, before calling protochk.
10831 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10832 echo "#include <pthread.h>" >> try.c
10837 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10838 cat >> try.c <<'EOCP'
10839 #ifdef CAN_PROTOTYPE
10840 #define _(args) args
10845 echo "$foo" >> try.c
10846 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10847 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10853 $eunicefix protochk
10855 : Define hasproto macro for Configure internal use
10856 hasproto='varname=$1; func=$2; shift; shift;
10857 while $test $# -ge 2; do
10859 $define) echo "#include <$2>";;
10863 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10864 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10865 echo "$func() prototype found.";
10868 echo "$func() prototype NOT found.";
10875 : see if sys/types.h has to be included
10876 set sys/types.h i_systypes
10879 : see if sys/select.h has to be included
10880 set sys/select.h i_sysselct
10883 : Define hasfield macro for Configure internal use
10884 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10885 while $test $# -ge 2; do
10887 $define) echo "#include <$2>";;
10891 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10893 if eval $compile; then
10902 : see if we should include time.h, sys/time.h, or both
10904 if test "X$timeincl" = X; then
10905 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10906 $echo $n "I'm now running the test program...$c"
10908 #include <sys/types.h>
10913 #ifdef SYSTIMEKERNEL
10916 #include <sys/time.h>
10919 #include <sys/select.h>
10921 #$i_stdlib I_STDLIB
10923 #include <stdlib.h>
10929 struct timeval bar;
10932 struct timezone tzp;
10934 if (foo.tm_sec == foo.tm_sec)
10937 if (bar.tv_sec == bar.tv_sec)
10944 for s_timezone in '-DS_TIMEZONE' ''; do
10946 for s_timeval in '-DS_TIMEVAL' ''; do
10947 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10948 for i_time in '' '-DI_TIME'; do
10949 for i_systime in '-DI_SYSTIME' ''; do
10952 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10953 if eval $compile; then
10954 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10958 $echo $n "Succeeded with $flags$c"
10970 *SYSTIMEKERNEL*) i_systimek="$define"
10971 timeincl=`./findhdr sys/time.h`
10972 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10973 *) i_systimek="$undef";;
10976 *I_TIME*) i_time="$define"
10977 timeincl=`./findhdr time.h`" $timeincl"
10978 echo "We'll include <time.h>." >&4;;
10979 *) i_time="$undef";;
10982 *I_SYSTIME*) i_systime="$define"
10983 timeincl=`./findhdr sys/time.h`" $timeincl"
10984 echo "We'll include <sys/time.h>." >&4;;
10985 *) i_systime="$undef";;
10989 : see if struct tm knows about tm_zone
10990 case "$i_systime$i_time" in
10993 echo "Checking to see if your struct tm has tm_zone field..." >&4
10994 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
11002 case "$d_tm_tm_zone" in
11003 "$define") echo "Yes, it does." ;;
11004 *) echo "No, it doesn't." ;;
11006 : see if struct tm knows about tm_gmtoff
11007 case "$i_systime$i_time" in
11010 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
11011 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
11019 case "$d_tm_tm_gmtoff" in
11020 "$define") echo "Yes, it does." ;;
11021 *) echo "No, it doesn't." ;;
11024 : see if asctime_r exists
11025 set asctime_r d_asctime_r
11027 case "$d_asctime_r" in
11029 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11030 case "$d_asctime_r_proto:$usethreads" in
11031 ":define") d_asctime_r_proto=define
11032 set d_asctime_r_proto asctime_r $hdrs
11036 case "$d_asctime_r_proto" in
11038 case "$asctime_r_proto" in
11039 ''|0) try='char* asctime_r(const struct tm*, char*);'
11040 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
11042 case "$asctime_r_proto" in
11043 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
11044 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
11046 case "$asctime_r_proto" in
11047 ''|0) try='int asctime_r(const struct tm*, char*);'
11048 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
11050 case "$asctime_r_proto" in
11051 ''|0) try='int asctime_r(const struct tm*, char*, int);'
11052 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
11054 case "$asctime_r_proto" in
11055 ''|0) d_asctime_r=undef
11057 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
11058 * ) case "$asctime_r_proto" in
11059 REENTRANT_PROTO*) ;;
11060 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
11062 echo "Prototype: $try" ;;
11065 *) case "$usethreads" in
11066 define) echo "asctime_r has no prototype, not using it." >&4 ;;
11073 *) asctime_r_proto=0
11077 : see if asinh exists
11081 : see if atanh exists
11085 : see if atolf exists
11089 : see if atoll exists
11093 : Look for GCC-style attribute format
11094 case "$d_attribute_format" in
11097 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11098 $cat >attrib.c <<'EOCP'
11100 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11102 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11103 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11104 echo "Your C compiler doesn't support __attribute__((format))."
11107 echo "Your C compiler supports __attribute__((format))."
11111 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11115 *) val="$d_attribute_format" ;;
11117 set d_attribute_format
11121 : Look for GCC-style attribute format with null format allowed
11122 case "$d_printf_format_null" in
11123 '') case "$d_attribute_format" in
11126 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11127 $cat >attrib.c <<EOCP
11129 #$i_stdlib I_STDLIB
11131 #include <stdlib.h>
11133 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11134 int null_printf (char* pat,...) { return (int)pat; }
11135 int main () { exit(null_printf(NULL)); }
11137 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11138 : run the executable in case it produces a run-time warning
11139 if $run ./attrib >>attrib.out 2>&1; then
11140 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11141 echo "Your C compiler doesn't allow __printf__ format to be null."
11144 echo "Your C compiler allows __printf__ format to be null."
11148 echo "Your C compiler executable failed with __printf__ format null."
11152 echo "Your C compiler fails with __printf__ format null."
11159 *) val="$d_printf_format_null" ;;
11161 set d_printf_format_null
11165 : Look for GCC-style attribute malloc
11166 case "$d_attribute_malloc" in
11169 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11170 $cat >attrib.c <<'EOCP'
11172 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11174 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11175 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11176 echo "Your C compiler doesn't support __attribute__((malloc))."
11179 echo "Your C compiler supports __attribute__((malloc))."
11183 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11187 *) val="$d_attribute_malloc" ;;
11189 set d_attribute_malloc
11193 : Look for GCC-style attribute nonnull
11194 case "$d_attribute_nonnull" in
11197 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11198 $cat >attrib.c <<'EOCP'
11200 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11202 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11203 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11204 echo "Your C compiler doesn't support __attribute__((nonnull))."
11207 echo "Your C compiler supports __attribute__((nonnull))."
11211 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11215 *) val="$d_attribute_nonnull" ;;
11217 set d_attribute_nonnull
11221 : Look for GCC-style attribute noreturn
11222 case "$d_attribute_noreturn" in
11225 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11226 $cat >attrib.c <<'EOCP'
11228 void fall_over_dead( void ) __attribute__((noreturn));
11230 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11231 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11232 echo "Your C compiler doesn't support __attribute__((noreturn))."
11235 echo "Your C compiler supports __attribute__((noreturn))."
11239 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11243 *) val="$d_attribute_noreturn" ;;
11245 set d_attribute_noreturn
11249 : Look for GCC-style attribute pure
11250 case "$d_attribute_pure" in
11253 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11254 $cat >attrib.c <<'EOCP'
11256 int square( int n ) __attribute__((pure));
11258 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11259 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11260 echo "Your C compiler doesn't support __attribute__((pure))."
11263 echo "Your C compiler supports __attribute__((pure))."
11267 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11271 *) val="$d_attribute_pure" ;;
11273 set d_attribute_pure
11277 : Look for GCC-style attribute unused
11278 case "$d_attribute_unused" in
11281 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11282 $cat >attrib.c <<'EOCP'
11284 int do_something( int dummy __attribute__((unused)), int n );
11286 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11287 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11288 echo "Your C compiler doesn't support __attribute__((unused))."
11291 echo "Your C compiler supports __attribute__((unused))."
11295 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11299 *) val="$d_attribute_unused" ;;
11301 set d_attribute_unused
11305 : Look for GCC-style attribute deprecated
11306 case "$d_attribute_deprecated" in
11309 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11310 $cat >attrib.c <<'EOCP'
11312 int I_am_deprecated(void) __attribute__((deprecated));
11314 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11315 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11316 echo "Your C compiler doesn't support __attribute__((deprecated))."
11319 echo "Your C compiler supports __attribute__((deprecated))."
11323 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11327 *) val="$d_attribute_deprecated" ;;
11329 set d_attribute_deprecated
11333 : Look for GCC-style attribute warn_unused_result
11334 case "$d_attribute_warn_unused_result" in
11337 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11338 $cat >attrib.c <<'EOCP'
11340 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11342 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11343 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11344 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11347 echo "Your C compiler supports __attribute__((warn_unused_result))."
11351 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11355 *) val="$d_attribute_warn_unused_result" ;;
11357 set d_attribute_warn_unused_result
11361 : see if bcmp exists
11365 : see if bcopy exists
11369 : see if getpgrp exists
11370 set getpgrp d_getpgrp
11373 case "$d_getpgrp" in
11376 echo "Checking to see which flavor of getpgrp is in use..."
11378 #$i_unistd I_UNISTD
11379 #include <sys/types.h>
11381 # include <unistd.h>
11383 #$i_stdlib I_STDLIB
11385 #include <stdlib.h>
11389 if (getuid() == 0) {
11390 printf("(I see you are running Configure as super-user...)\n");
11393 #ifdef TRY_BSD_PGRP
11394 if (getpgrp(1) == 0)
11403 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11404 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11406 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11407 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11410 echo "I can't seem to compile and run the test program."
11412 xxx="a USG one, i.e. you use getpgrp()."
11414 # SVR4 systems can appear rather BSD-ish.
11415 case "$i_unistd" in
11417 xxx="a BSD one, i.e. you use getpgrp(pid)."
11421 xxx="probably a USG one, i.e. you use getpgrp()."
11426 echo "Assuming your getpgrp is $xxx" >&4
11435 : see if setpgrp exists
11436 set setpgrp d_setpgrp
11439 case "$d_setpgrp" in
11442 echo "Checking to see which flavor of setpgrp is in use..."
11444 #$i_unistd I_UNISTD
11445 #include <sys/types.h>
11447 # include <unistd.h>
11449 #$i_stdlib I_STDLIB
11451 #include <stdlib.h>
11455 if (getuid() == 0) {
11456 printf("(I see you are running Configure as super-user...)\n");
11459 #ifdef TRY_BSD_PGRP
11460 if (-1 == setpgrp(1, 1))
11463 if (setpgrp() != -1)
11469 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11470 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11472 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11473 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11476 echo "(I can't seem to compile and run the test program.)"
11478 xxx="a USG one, i.e. you use setpgrp()."
11480 # SVR4 systems can appear rather BSD-ish.
11481 case "$i_unistd" in
11483 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11487 xxx="probably a USG one, i.e. you use setpgrp()."
11492 echo "Assuming your setpgrp is $xxx" >&4
11501 : Look for GCC-style __builtin_choose_expr
11502 case "$d_builtin_choose_expr" in
11505 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11506 $cat >try.c <<'EOCP'
11507 #include <assert.h>
11508 #include <stdlib.h>
11511 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11514 assert( SYRINX(1) == 2112 );
11515 assert( SYRINX(1) != 5150 );
11516 assert( SYRINX(0) == 5150 );
11517 assert( SYRINX(0) != 2112 );
11518 puts( "All good!" );
11524 if eval $compile && $run ./try; then
11525 echo "Your C compiler supports __builtin_choose_expr."
11528 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11532 *) val="$d_builtin_choose_expr" ;;
11535 set d_builtin_choose_expr
11539 : Look for GCC-style __builtin_expect
11540 case "$d_builtin_expect" in
11543 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11544 $cat >try.c <<'EOCP'
11547 if ( __builtin_expect(n, 0) ) n = 1;
11548 /* Remember shell exit code truth is 0, C truth is non-zero */
11553 if eval $compile && $run ./try; then
11554 echo "Your C compiler supports __builtin_expect."
11557 echo "Your C compiler doesn't seem to understand __builtin_expect."
11561 *) val="$d_builtin_expect" ;;
11564 set d_builtin_expect
11568 : see if bzero exists
11572 : see if stdarg is available
11574 if $test `./findhdr stdarg.h`; then
11575 echo "<stdarg.h> found." >&4
11578 echo "<stdarg.h> NOT found." >&4
11582 : see if varargs is available
11584 if $test `./findhdr varargs.h`; then
11585 echo "<varargs.h> found." >&4
11587 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11590 : set up the varargs testing programs
11591 $cat > varargs.c <<EOP
11593 #include <stdarg.h>
11596 #include <varargs.h>
11600 int f(char *p, ...)
11614 p = va_arg(ap, char *);
11620 $cat > varargs <<EOP
11622 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11631 : now check which varargs header should be included
11637 if `./varargs I_STDARG`; then
11639 elif `./varargs I_VARARGS`; then
11644 if `./varargs I_VARARGS`; then
11652 echo "*** WHOA THERE!!! ***" >&4
11653 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11654 case "$knowitall" in
11656 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11660 echo "I could not find the definition for va_dcl... You have problems..." >&4
11661 val="$undef"; set i_stdarg; eval $setvar
11662 val="$undef"; set i_varargs; eval $setvar
11667 case "$i_varhdr" in
11669 val="$define"; set i_stdarg; eval $setvar
11670 val="$undef"; set i_varargs; eval $setvar
11673 val="$undef"; set i_stdarg; eval $setvar
11674 val="$define"; set i_varargs; eval $setvar
11677 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11681 : see if the Compiler supports C99 variadic macros
11682 case "$i_stdarg$i_stdlib" in
11684 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11687 #include <stdarg.h>
11689 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11693 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11699 if eval $compile && $run ./try 2>&1 >/dev/null; then
11700 case "`$run ./try`" in
11702 echo "You have C99 variadic macros." >&4
11703 d_c99_variadic_macros="$define"
11706 echo "You don't have functional C99 variadic macros." >&4
11707 d_c99_variadic_macros="$undef"
11711 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11712 d_c99_variadic_macros="$undef"
11717 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11718 d_c99_variadic_macros="$undef"
11722 : see if signal is declared as pointer to function returning int or void
11724 xxx=`./findhdr signal.h`
11725 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11726 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11727 echo "You have int (*signal())() instead of void." >&4
11729 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11730 echo "You have void (*signal())()." >&4
11732 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11733 echo "You have int (*signal())() instead of void." >&4
11735 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11736 echo "You have void (*signal())()." >&4
11739 case "$d_voidsig" in
11741 echo "I can't determine whether signal handler returns void or int..." >&4
11743 rp="What type does your signal handler return?"
11746 v*) val="$define";;
11750 echo "As you already told me, signal handler returns void." >&4
11753 *) echo "As you already told me, signal handler returns int." >&4
11760 case "$d_voidsig" in
11761 "$define") signal_t="void";;
11762 *) signal_t="int";;
11766 : check for ability to cast large floats to 32-bit ints.
11768 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11769 if $test "$intsize" -ge 4; then
11776 #$i_stdlib I_STDLIB
11778 #include <stdlib.h>
11780 #include <sys/types.h>
11781 #include <signal.h>
11782 $signal_t blech(int s) { exit(3); }
11789 signal(SIGFPE, blech);
11791 /* Don't let compiler optimize the test away. Store the number
11792 in a writable string for gcc to pass to sscanf under HP-UX.
11794 sprintf(str, "2147483647");
11795 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11799 /* x86 processors will probably give 0x8000 0000, which is a
11800 sign change. We don't want that. We want to mimic SPARC
11801 behavior here, which is to preserve the sign and give
11804 if (i32 != ($xxx) f)
11810 if eval $compile_ok; then
11811 $run ./try 2>/dev/null
11814 echo "(I can't seem to compile the test program--assuming it can't)"
11819 echo "Yup, it can."
11822 echo "Nope, it can't."
11829 : check for ability to cast negative floats to unsigned
11831 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11834 #$i_stdlib I_STDLIB
11836 #include <stdlib.h>
11838 #include <sys/types.h>
11839 #include <signal.h>
11840 $signal_t blech(int s) { exit(7); }
11841 $signal_t blech_in_list(int s) { exit(4); }
11842 unsigned long dummy_long(unsigned long p) { return p; }
11843 unsigned int dummy_int(unsigned int p) { return p; }
11844 unsigned short dummy_short(unsigned short p) { return p; }
11848 unsigned long along;
11850 unsigned short ashort;
11854 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11855 a direct f = -123. assignment. gcc-2.8.0 reportedly
11856 optimized the whole file away
11858 /* Store the number in a writable string for gcc to pass to
11859 sscanf under HP-UX.
11861 sprintf(str, "-123");
11862 sscanf(str, "%lf", &f); /* f = -123.; */
11864 signal(SIGFPE, blech);
11865 along = (unsigned long)f;
11866 aint = (unsigned int)f;
11867 ashort = (unsigned short)f;
11868 if (along != (unsigned long)-123)
11870 if (aint != (unsigned int)-123)
11872 if (ashort != (unsigned short)-123)
11874 sprintf(str, "1073741824.");
11875 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11878 along = (unsigned long)f;
11879 if (along != 0x80000000)
11883 along = (unsigned long)f;
11884 if (along != 0x7fffffff)
11888 along = (unsigned long)f;
11889 if (along != 0x80000001)
11893 signal(SIGFPE, blech_in_list);
11894 sprintf(str, "123.");
11895 sscanf(str, "%lf", &f); /* f = 123.; */
11896 along = dummy_long((unsigned long)f);
11897 aint = dummy_int((unsigned int)f);
11898 ashort = dummy_short((unsigned short)f);
11899 if (along != (unsigned long)123)
11901 if (aint != (unsigned int)123)
11903 if (ashort != (unsigned short)123)
11910 if eval $compile_ok; then
11911 $run ./try 2>/dev/null
11914 echo "(I can't seem to compile the test program--assuming it can't)"
11917 case "$castflags" in
11919 echo "Yup, it can."
11922 echo "Nope, it can't."
11929 : see if cbrt exists
11933 : see if vprintf exists
11935 if set vprintf val -f d_vprintf; eval $csym; $val; then
11936 echo 'vprintf() found.' >&4
11939 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11940 #$i_varargs I_VARARGS
11942 #$i_stdlib I_STDLIB
11943 #$i_unistd I_UNISTD
11946 # include <stdarg.h>
11947 #else /* I_VARARGS */
11948 # include <varargs.h>
11952 # include <unistd.h>
11956 # include <stdlib.h>
11959 #include <stdio.h> /* vsprintf prototype */
11962 void xxx(int n, ...)
11967 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11969 int main() { xxx(1, "foo"); }
11971 #else /* I_VARARGS */
11979 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11981 int main() { xxx("foo"); }
11987 if eval $compile_ok; then
11988 if $run ./try; then
11989 echo "Your vsprintf() returns (int)." >&4
11992 echo "Your vsprintf() returns (char*)." >&4
11996 echo 'I am unable to compile the vsprintf() test program.' >&4
11997 # We shouldn't get here. If we do, assume the standard signature,
11998 # not the old BSD one.
11999 echo 'Guessing that vsprintf() returns (int).' >&4
12003 echo 'vprintf() NOT found.' >&4
12014 : see if chown exists
12018 : see if chroot exists
12019 set chroot d_chroot
12022 : see if chsize exists
12023 set chsize d_chsize
12026 : see if class exists
12030 : see if clearenv exists
12031 set clearenv d_clearenv
12034 : Define hasstruct macro for Configure internal use
12035 hasstruct='varname=$1; struct=$2; shift; shift;
12036 while $test $# -ge 2; do
12038 $define) echo "#include <$2>";;
12042 echo "int main () { struct $struct foo; }" >> try.c;
12044 if eval $compile; then
12053 : see whether socket exists
12057 $echo $n "Hmm... $c" >&4
12058 if set socket val -f d_socket; eval $csym; $val; then
12059 echo "Looks like you have Berkeley networking support." >&4
12061 if set setsockopt val -f; eval $csym; $val; then
12064 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
12065 d_oldsock="$define"
12068 if $contains socklib libc.list >/dev/null 2>&1; then
12069 echo "Looks like you have Berkeley networking support." >&4
12071 : we will have to assume that it supports the 4.2 BSD interface
12074 echo "You don't have Berkeley networking in libc$_a..." >&4
12075 if test "X$d_socket" = "X$define"; then
12076 echo "...but you seem to believe that you have sockets." >&4
12078 for net in net socket
12080 if test -f $sysroot/usr/lib/lib$net$_a; then
12081 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
12082 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12083 if $contains socket libc.list >/dev/null 2>&1; then
12088 echo "...but the Wollongong group seems to have hacked it in." >&4
12089 sockethdr="-I$sysroot/usr/netinclude"
12092 echo "Found Berkeley sockets interface in lib$net." >&4
12093 if $contains setsockopt libc.list >/dev/null 2>&1; then
12096 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12097 d_oldsock="$define"
12103 if test "X$d_socket" != "X$define"; then
12104 echo "or anywhere else I see." >&4
12112 : see if socketpair exists
12113 set socketpair d_sockpair
12118 echo "Checking the availability sa_len in the sock struct ..." >&4
12120 #include <sys/types.h>
12121 #include <sys/socket.h>
12123 struct sockaddr sa;
12124 return (sa.sa_len);
12128 set try; if eval $compile; then
12131 set d_sockaddr_sa_len; eval $setvar
12135 echo "Checking the availability struct sockaddr_in6 ..." >&4
12137 #include <sys/types.h>
12138 #include <sys/socket.h>
12139 #include <netinet/in.h>
12141 struct sockaddr_in6 sin6;
12142 return (sin6.sin6_family);
12146 set try; if eval $compile; then
12149 set d_sockaddr_in6; eval $setvar
12153 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12155 #include <sys/types.h>
12156 #include <sys/socket.h>
12157 #include <netinet/in.h>
12159 struct sockaddr_in6 sin6;
12160 return (sin6.sin6_scope_id);
12164 set try; if eval $compile; then
12167 set d_sin6_scope_id; eval $setvar
12171 echo "Checking the availability struct ip_mreq ..." >&4
12173 #include <sys/types.h>
12174 #include <sys/socket.h>
12175 #include <netinet/in.h>
12177 struct ip_mreq mreq;
12178 return (mreq.imr_multiaddr.s_addr);
12182 set try; if eval $compile; then
12185 set d_ip_mreq; eval $setvar
12189 echo "Checking the availability struct ip_mreq_source ..." >&4
12191 #include <sys/types.h>
12192 #include <sys/socket.h>
12193 #include <netinet/in.h>
12195 struct ip_mreq_source mreq;
12196 return (mreq.imr_multiaddr.s_addr);
12200 set try; if eval $compile; then
12203 set d_ip_mreq_source; eval $setvar
12207 echo "Checking the availability struct ipv6_mreq ..." >&4
12209 #include <sys/types.h>
12210 #include <sys/socket.h>
12211 #include <netinet/in.h>
12213 struct ipv6_mreq mreq;
12214 return (mreq.ipv6mr_interface);
12218 set try; if eval $compile; then
12221 set d_ipv6_mreq; eval $setvar
12225 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12227 #include <sys/types.h>
12228 #include <sys/socket.h>
12229 #include <netinet/in.h>
12231 struct ipv6_mreq_source mreq;
12232 return (mreq.imr_multiaddr.s_addr);
12236 set try; if eval $compile; then
12239 set d_ipv6_mreq_source; eval $setvar
12243 echo "Checking the availability of certain socket constants..." >&4
12244 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12245 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12247 #include <sys/types.h>
12248 #include <sys/socket.h>
12254 set try; if eval $compile; then
12257 set d_${enum}; eval $setvar
12261 : see if this is a sys/uio.h system
12262 set sys/uio.h i_sysuio
12265 : Check for cmsghdr support
12267 echo "Checking to see if your system supports struct cmsghdr..." >&4
12268 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12270 case "$d_cmsghdr_s" in
12271 "$define") echo "Yes, it does." ;;
12272 *) echo "No, it doesn't." ;;
12276 : check for const keyword
12278 echo 'Checking to see if your C compiler knows about "const"...' >&4
12279 $cat >const.c <<'EOCP'
12280 typedef struct spug { int drokk; } spug;
12284 const spug y = { 0 };
12287 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12289 echo "Yup, it does."
12292 echo "Nope, it doesn't."
12297 : see if copysign exists
12298 set copysign d_copysign
12301 : see if copysignl exists
12302 set copysignl d_copysignl
12305 : see if crypt exists
12310 $define) cryptlib='' ;;
12311 *) if set crypt val -f d_crypt; eval $csym; $val; then
12312 echo 'crypt() found.' >&4
12316 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12317 if $test -z "$cryptlib"; then
12318 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12322 if $test -z "$cryptlib"; then
12323 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12327 if $test -z "$cryptlib"; then
12328 cryptlib=`./loc libcrypt$_a "" $libpth`
12332 if $test -z "$cryptlib"; then
12333 echo 'crypt() NOT found.' >&4
12344 : see if this is a crypt.h system
12345 set crypt.h i_crypt
12348 : see if crypt_r exists
12349 set crypt_r d_crypt_r
12351 case "$d_crypt_r" in
12353 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12354 case "$d_crypt_r_proto:$usethreads" in
12355 ":define") d_crypt_r_proto=define
12356 set d_crypt_r_proto crypt_r $hdrs
12360 case "$d_crypt_r_proto" in
12362 case "$crypt_r_proto" in
12363 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12364 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12366 case "$crypt_r_proto" in
12367 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12368 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12370 case "$crypt_r_proto" in
12371 ''|0) d_crypt_r=undef
12373 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12374 * ) case "$crypt_r_proto" in
12375 REENTRANT_PROTO*) ;;
12376 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12378 echo "Prototype: $try" ;;
12381 *) case "$usethreads" in
12382 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12393 : get csh whereabouts
12395 'csh') val="$undef" ;;
12396 *) val="$define" ;;
12400 : Respect a hint or command line value for full_csh.
12401 case "$full_csh" in
12402 '') full_csh=$csh ;;
12405 : see if ctermid exists
12406 set ctermid d_ctermid
12409 : see if ctermid_r exists
12410 set ctermid_r d_ctermid_r
12412 case "$d_ctermid_r" in
12414 hdrs="$i_systypes sys/types.h define stdio.h "
12415 case "$d_ctermid_r_proto:$usethreads" in
12416 ":define") d_ctermid_r_proto=define
12417 set d_ctermid_r_proto ctermid_r $hdrs
12421 case "$d_ctermid_r_proto" in
12423 case "$ctermid_r_proto" in
12424 ''|0) try='char* ctermid_r(char*);'
12425 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12427 case "$ctermid_r_proto" in
12428 ''|0) d_ctermid_r=undef
12430 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12431 * ) case "$ctermid_r_proto" in
12432 REENTRANT_PROTO*) ;;
12433 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12435 echo "Prototype: $try" ;;
12438 *) case "$usethreads" in
12439 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12446 *) ctermid_r_proto=0
12450 : see if ctime_r exists
12451 set ctime_r d_ctime_r
12453 case "$d_ctime_r" in
12455 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12456 case "$d_ctime_r_proto:$usethreads" in
12457 ":define") d_ctime_r_proto=define
12458 set d_ctime_r_proto ctime_r $hdrs
12462 case "$d_ctime_r_proto" in
12464 case "$ctime_r_proto" in
12465 ''|0) try='char* ctime_r(const time_t*, char*);'
12466 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12468 case "$ctime_r_proto" in
12469 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12470 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12472 case "$ctime_r_proto" in
12473 ''|0) try='int ctime_r(const time_t*, char*);'
12474 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12476 case "$ctime_r_proto" in
12477 ''|0) try='int ctime_r(const time_t*, char*, int);'
12478 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12480 case "$ctime_r_proto" in
12481 ''|0) d_ctime_r=undef
12483 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12484 * ) case "$ctime_r_proto" in
12485 REENTRANT_PROTO*) ;;
12486 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12488 echo "Prototype: $try" ;;
12491 *) case "$usethreads" in
12492 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12503 : see if cuserid exists
12504 set cuserid d_cuserid
12507 : see if this is a limits.h system
12508 set limits.h i_limits
12511 : See if number of significant digits in a double precision number is known
12513 $cat >dbl_dig.c <<EOM
12514 #$i_limits I_LIMITS
12517 #include <limits.h>
12523 printf("Contains DBL_DIG");
12526 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12527 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12528 echo "DBL_DIG found." >&4
12531 echo "DBL_DIG NOT found." >&4
12538 : see if dbm.h is available
12539 : see if dbmclose exists
12540 set dbmclose d_dbmclose
12543 case "$d_dbmclose" in
12553 *) set rpcsvc/dbm.h i_rpcsvcdbm
12558 *) echo "We won't be including <dbm.h>"
12568 : see if prototype for dbminit is available
12570 set d_dbminitproto dbminit $i_dbm dbm.h
12573 : see if difftime exists
12574 set difftime d_difftime
12577 : see if this is a dirent system
12579 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12581 echo "<dirent.h> found." >&4
12584 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12585 echo "<sys/dir.h> found." >&4
12588 xinc=`./findhdr sys/ndir.h`
12590 echo "<dirent.h> NOT found." >&4
12595 : Look for type of directory structure.
12597 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12599 case "$direntrytype" in
12601 case "$i_dirent" in
12602 $define) guess1='struct dirent' ;;
12603 *) guess1='struct direct' ;;
12606 *) guess1="$direntrytype"
12611 'struct dirent') guess2='struct direct' ;;
12612 *) guess2='struct dirent' ;;
12615 if $contains "$guess1" try.c >/dev/null 2>&1; then
12616 direntrytype="$guess1"
12617 echo "Your directory entries are $direntrytype." >&4
12618 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12619 direntrytype="$guess2"
12620 echo "Your directory entries seem to be $direntrytype." >&4
12622 echo "I don't recognize your system's directory entries." >&4
12623 rp="What type is used for directory entries on this system?"
12626 direntrytype="$ans"
12630 : see if the directory entry stores field length
12632 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12633 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12634 echo "Good, your directory entry keeps length information in d_namlen." >&4
12637 echo "Your directory entry does not know about the d_namlen field." >&4
12644 : Look for DIR.dd_fd
12645 case "$i_dirent" in
12647 echo "Checking to see if DIR has a dd_fd member variable" >&4
12649 #$i_stdlib I_STDLIB
12651 #include <stdlib.h>
12653 #include <dirent.h>
12663 if eval $compile; then
12664 echo "Yes, it does."
12667 echo "No, it does not."
12672 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12680 : see if this is an sysdir system
12681 set sys/dir.h i_sysdir
12684 : see if this is an sysndir system
12685 set sys/ndir.h i_sysndir
12690 $cat >dirfd.c <<EOM
12692 #$i_stdlib I_STDLIB
12694 #include <stdlib.h>
12696 #$i_dirent I_DIRENT /**/
12697 #$i_sysdir I_SYS_DIR /**/
12698 #$i_sysndir I_SYS_NDIR /**/
12699 #$i_systypes I_SYS_TYPES /**/
12700 #if defined(I_SYS_TYPES)
12701 #include <sys/types.h>
12703 #if defined(I_DIRENT)
12704 #include <dirent.h>
12707 #include <sys/ndir.h>
12711 #include <ndir.h> /* may be wrong in the future */
12713 #include <sys/dir.h>
12719 DIR *dirp = opendir(".");
12720 if (dirfd(dirp) >= 0)
12728 if eval $compile; then
12732 $define) echo "dirfd() found." >&4 ;;
12733 *) echo "dirfd() NOT found." >&4 ;;
12739 : see if dladdr exists
12740 set dladdr d_dladdr
12743 : see if dlerror exists
12746 set dlerror d_dlerror
12750 : see if dlfcn is available
12751 set dlfcn.h i_dlfcn
12754 : Check what extension to use for shared libs
12759 On a few systems, the dynamically loaded modules that perl generates and uses
12760 will need a different extension than shared libs. The default will probably
12766 *) dflt="$dlext" ;;
12768 rp='What is the extension of dynamically loaded modules'
12777 : Check if dlsym need a leading underscore
12783 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12784 $cat >dyna.c <<'EOM'
12791 #$i_stdlib I_STDLIB
12793 #include <stdlib.h>
12797 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12799 #include <sys/types.h>
12804 extern int fred() ;
12813 int mode = RTLD_LAZY ;
12815 handle = dlopen("./dyna.$dlext", mode) ;
12816 if (handle == NULL) {
12821 symbol = dlsym(handle, "fred") ;
12822 if (symbol == NULL) {
12823 /* try putting a leading underscore */
12824 symbol = dlsym(handle, "_fred") ;
12825 if (symbol == NULL) {
12838 : Call the object file tmp-dyna.o in case dlext=o.
12839 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12840 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12841 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12842 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12845 1) echo "Test program failed using dlopen." >&4
12846 echo "Perhaps you should not use dynamic loading." >&4;;
12847 2) echo "Test program failed using dlsym." >&4
12848 echo "Perhaps you should not use dynamic loading." >&4;;
12849 3) echo "dlsym needs a leading underscore" >&4
12851 4) echo "dlsym doesn't need a leading underscore." >&4;;
12854 echo "I can't compile and run the test program." >&4
12855 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12860 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12865 : see if drand48_r exists
12866 set drand48_r d_drand48_r
12868 case "$d_drand48_r" in
12870 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12871 case "$d_drand48_r_proto:$usethreads" in
12872 ":define") d_drand48_r_proto=define
12873 set d_drand48_r_proto drand48_r $hdrs
12877 case "$d_drand48_r_proto" in
12879 case "$drand48_r_proto" in
12880 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12881 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12883 case "$drand48_r_proto" in
12884 ''|0) d_drand48_r=undef
12886 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12887 * ) case "$drand48_r_proto" in
12888 REENTRANT_PROTO*) ;;
12889 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12891 echo "Prototype: $try" ;;
12894 *) case "$usethreads" in
12895 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12902 *) drand48_r_proto=0
12906 : see if prototype for drand48 is available
12908 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12911 : see if dup2 exists
12915 : see if eaccess exists
12916 set eaccess d_eaccess
12919 : see if endgrent exists
12920 set endgrent d_endgrent
12923 : see if this is an grp system
12929 xxx=`./findhdr grp.h`
12930 $cppstdin $cppflags $cppminus < $xxx >$$.h
12932 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12944 set d_grpasswd; eval $setvar
12948 : see if endgrent_r exists
12949 set endgrent_r d_endgrent_r
12951 case "$d_endgrent_r" in
12953 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12954 case "$d_endgrent_r_proto:$usethreads" in
12955 ":define") d_endgrent_r_proto=define
12956 set d_endgrent_r_proto endgrent_r $hdrs
12960 case "$d_endgrent_r_proto" in
12962 case "$endgrent_r_proto" in
12963 ''|0) try='int endgrent_r(FILE**);'
12964 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12966 case "$endgrent_r_proto" in
12967 ''|0) try='void endgrent_r(FILE**);'
12968 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12970 case "$endgrent_r_proto" in
12971 ''|0) d_endgrent_r=undef
12973 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12974 * ) case "$endgrent_r_proto" in
12975 REENTRANT_PROTO*) ;;
12976 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12978 echo "Prototype: $try" ;;
12981 *) case "$usethreads" in
12982 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12989 *) endgrent_r_proto=0
12993 : see if endhostent exists
12994 set endhostent d_endhent
12997 : see if this is a netdb.h system
12998 set netdb.h i_netdb
13001 : see if endhostent_r exists
13002 set endhostent_r d_endhostent_r
13004 case "$d_endhostent_r" in
13006 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13007 case "$d_endhostent_r_proto:$usethreads" in
13008 ":define") d_endhostent_r_proto=define
13009 set d_endhostent_r_proto endhostent_r $hdrs
13013 case "$d_endhostent_r_proto" in
13015 case "$endhostent_r_proto" in
13016 ''|0) try='int endhostent_r(struct hostent_data*);'
13017 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
13019 case "$endhostent_r_proto" in
13020 ''|0) try='void endhostent_r(struct hostent_data*);'
13021 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
13023 case "$endhostent_r_proto" in
13024 ''|0) d_endhostent_r=undef
13025 endhostent_r_proto=0
13026 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
13027 * ) case "$endhostent_r_proto" in
13028 REENTRANT_PROTO*) ;;
13029 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
13031 echo "Prototype: $try" ;;
13034 *) case "$usethreads" in
13035 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
13037 d_endhostent_r=undef
13038 endhostent_r_proto=0
13042 *) endhostent_r_proto=0
13046 : see if endnetent exists
13047 set endnetent d_endnent
13050 : see if endnetent_r exists
13051 set endnetent_r d_endnetent_r
13053 case "$d_endnetent_r" in
13055 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13056 case "$d_endnetent_r_proto:$usethreads" in
13057 ":define") d_endnetent_r_proto=define
13058 set d_endnetent_r_proto endnetent_r $hdrs
13062 case "$d_endnetent_r_proto" in
13064 case "$endnetent_r_proto" in
13065 ''|0) try='int endnetent_r(struct netent_data*);'
13066 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
13068 case "$endnetent_r_proto" in
13069 ''|0) try='void endnetent_r(struct netent_data*);'
13070 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
13072 case "$endnetent_r_proto" in
13073 ''|0) d_endnetent_r=undef
13074 endnetent_r_proto=0
13075 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
13076 * ) case "$endnetent_r_proto" in
13077 REENTRANT_PROTO*) ;;
13078 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13080 echo "Prototype: $try" ;;
13083 *) case "$usethreads" in
13084 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13086 d_endnetent_r=undef
13087 endnetent_r_proto=0
13091 *) endnetent_r_proto=0
13095 : see if endprotoent exists
13096 set endprotoent d_endpent
13099 : see if endprotoent_r exists
13100 set endprotoent_r d_endprotoent_r
13102 case "$d_endprotoent_r" in
13104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13105 case "$d_endprotoent_r_proto:$usethreads" in
13106 ":define") d_endprotoent_r_proto=define
13107 set d_endprotoent_r_proto endprotoent_r $hdrs
13111 case "$d_endprotoent_r_proto" in
13113 case "$endprotoent_r_proto" in
13114 ''|0) try='int endprotoent_r(struct protoent_data*);'
13115 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13117 case "$endprotoent_r_proto" in
13118 ''|0) try='void endprotoent_r(struct protoent_data*);'
13119 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13121 case "$endprotoent_r_proto" in
13122 ''|0) d_endprotoent_r=undef
13123 endprotoent_r_proto=0
13124 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13125 * ) case "$endprotoent_r_proto" in
13126 REENTRANT_PROTO*) ;;
13127 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13129 echo "Prototype: $try" ;;
13132 *) case "$usethreads" in
13133 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13135 d_endprotoent_r=undef
13136 endprotoent_r_proto=0
13140 *) endprotoent_r_proto=0
13144 : see if endpwent exists
13145 set endpwent d_endpwent
13148 : see if this is a pwd.h system
13154 xxx=`./findhdr pwd.h`
13155 $cppstdin $cppflags $cppminus < $xxx >$$.h
13157 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13165 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13173 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13181 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13189 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13197 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13205 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13213 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13225 set d_pwquota; eval $setvar
13226 set d_pwage; eval $setvar
13227 set d_pwchange; eval $setvar
13228 set d_pwclass; eval $setvar
13229 set d_pwexpire; eval $setvar
13230 set d_pwcomment; eval $setvar
13231 set d_pwgecos; eval $setvar
13232 set d_pwpasswd; eval $setvar
13236 : see if endpwent_r exists
13237 set endpwent_r d_endpwent_r
13239 case "$d_endpwent_r" in
13241 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13242 case "$d_endpwent_r_proto:$usethreads" in
13243 ":define") d_endpwent_r_proto=define
13244 set d_endpwent_r_proto endpwent_r $hdrs
13248 case "$d_endpwent_r_proto" in
13250 case "$endpwent_r_proto" in
13251 ''|0) try='int endpwent_r(FILE**);'
13252 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13254 case "$endpwent_r_proto" in
13255 ''|0) try='void endpwent_r(FILE**);'
13256 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13258 case "$endpwent_r_proto" in
13259 ''|0) d_endpwent_r=undef
13261 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13262 * ) case "$endpwent_r_proto" in
13263 REENTRANT_PROTO*) ;;
13264 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13266 echo "Prototype: $try" ;;
13269 *) case "$usethreads" in
13270 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13277 *) endpwent_r_proto=0
13281 : see if endservent exists
13282 set endservent d_endsent
13285 : see if endservent_r exists
13286 set endservent_r d_endservent_r
13288 case "$d_endservent_r" in
13290 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13291 case "$d_endservent_r_proto:$usethreads" in
13292 ":define") d_endservent_r_proto=define
13293 set d_endservent_r_proto endservent_r $hdrs
13297 case "$d_endservent_r_proto" in
13299 case "$endservent_r_proto" in
13300 ''|0) try='int endservent_r(struct servent_data*);'
13301 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13303 case "$endservent_r_proto" in
13304 ''|0) try='void endservent_r(struct servent_data*);'
13305 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13307 case "$endservent_r_proto" in
13308 ''|0) d_endservent_r=undef
13309 endservent_r_proto=0
13310 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13311 * ) case "$endservent_r_proto" in
13312 REENTRANT_PROTO*) ;;
13313 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13315 echo "Prototype: $try" ;;
13318 *) case "$usethreads" in
13319 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13321 d_endservent_r=undef
13322 endservent_r_proto=0
13326 *) endservent_r_proto=0
13330 : Locate the flags for 'open()'
13333 #include <sys/types.h>
13338 #include <sys/file.h>
13340 #$i_stdlib I_STDLIB
13342 #include <stdlib.h>
13353 : check sys/file.h first to get FREAD on Sun
13354 if $test `./findhdr sys/file.h` && \
13355 set try -DI_SYS_FILE && eval $compile; then
13357 echo "<sys/file.h> defines the O_* constants..." >&4
13358 if $run ./try; then
13359 echo "and you have the 3 argument form of open()." >&4
13362 echo "but not the 3 argument form of open(). Oh, well." >&4
13365 elif $test `./findhdr fcntl.h` && \
13366 set try -DI_FCNTL && eval $compile; then
13368 echo "<fcntl.h> defines the O_* constants..." >&4
13369 if $run ./try; then
13370 echo "and you have the 3 argument form of open()." >&4
13373 echo "but not the 3 argument form of open(). Oh, well." >&4
13378 echo "I can't find the O_* constant definitions! You got problems." >&4
13384 : see if this is a sys/file.h system
13389 : do we need to include sys/file.h ?
13393 if $h_sysfile; then
13395 echo "We'll be including <sys/file.h>." >&4
13398 echo "We won't be including <sys/file.h>." >&4
13408 : see if fcntl.h is there
13413 : see if we can include fcntl.h
13419 echo "We'll be including <fcntl.h>." >&4
13422 if $h_sysfile; then
13423 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13425 echo "We won't be including <fcntl.h>." >&4
13437 : see if fork exists
13441 : see if pipe exists
13445 : check for non-blocking I/O stuff
13446 case "$h_sysfile" in
13447 true) echo "#include <sys/file.h>" > head.c;;
13450 true) echo "#include <fcntl.h>" > head.c;;
13451 *) echo "#include <sys/fcntl.h>" > head.c;;
13456 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13457 case "$o_nonblock" in
13459 $cat head.c > try.c
13460 $cat >>try.c <<EOCP
13462 #$i_stdlib I_STDLIB
13464 #include <stdlib.h>
13472 printf("O_NONBLOCK\n");
13476 printf("O_NDELAY\n");
13480 printf("FNDELAY\n");
13487 if eval $compile_ok; then
13488 o_nonblock=`$run ./try`
13489 case "$o_nonblock" in
13490 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13491 *) echo "Seems like we can use $o_nonblock.";;
13494 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13497 *) echo "Using $hint value $o_nonblock.";;
13502 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13505 case "$d_fork:$d_pipe:$d_alarm" in
13506 define:define:define)
13507 $cat head.c > try.c
13508 $cat >>try.c <<EOCP
13510 #include <sys/types.h>
13511 #include <signal.h>
13513 #$i_stdlib I_STDLIB
13515 #include <stdlib.h>
13521 #define MY_O_NONBLOCK $o_nonblock
13522 #ifndef errno /* XXX need better Configure test */
13525 #$i_unistd I_UNISTD
13527 #include <unistd.h>
13529 #$i_string I_STRING
13531 #include <string.h>
13533 #include <strings.h>
13535 $signal_t blech(int x) { exit(3); }
13537 $cat >> try.c <<'EOCP'
13546 ret = pipe(pd); /* Down: child -> parent */
13549 ret = pipe(pu); /* Up: parent -> child */
13553 close(pd[1]); /* Parent reads from pd[0] */
13554 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13556 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13561 signal(SIGALRM, blech);
13563 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13565 sprintf(string, "%d\n", ret);
13566 ret = write(2, string, strlen(string));
13567 if (ret != strlen(string))
13571 if (errno == EAGAIN) {
13572 printf("EAGAIN\n");
13577 if (errno == EWOULDBLOCK)
13578 printf("EWOULDBLOCK\n");
13581 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13584 sleep(2); /* Give it time to close our pipe */
13586 ret = read(pd[0], buf, 1); /* Should read EOF */
13588 sprintf(string, "%d\n", ret);
13589 ret = write(4, string, strlen(string));
13590 if (ret != strlen(string))
13595 close(pd[0]); /* We write to pd[1] */
13596 close(pu[1]); /* We read from pu[0] */
13597 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13600 close(pd[1]); /* Pipe pd is now fully closed! */
13601 exit(0); /* Bye bye, thank you for playing! */
13605 if eval $compile_ok; then
13606 echo "$startsh" >mtry
13607 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13609 $run ./mtry >/dev/null 2>&1
13611 0) eagain=`$cat try.out`;;
13612 1) echo "Could not perform non-blocking setting!";;
13613 2) echo "I did a successful read() for something that was not there!";;
13614 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13615 4) echo "Could not find F_SETFL!";;
13616 *) echo "Something terribly wrong happened during testing.";;
13618 rd_nodata=`$cat try.ret`
13619 echo "A read() system call with no data present returns $rd_nodata."
13620 case "$rd_nodata" in
13623 echo "(That's peculiar, fixing that to be -1.)"
13629 echo "Forcing errno EAGAIN on read() with no data available."
13633 echo "Your read() sets errno to $eagain when no data is available."
13636 status=`$cat try.err`
13638 0) echo "And it correctly returns 0 to signal EOF.";;
13639 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13640 *) echo "However, your read() returns '$status' on EOF??";;
13643 if test "$status" = "$rd_nodata"; then
13644 echo "WARNING: you can't distinguish between EOF and no data!"
13648 echo "I can't compile the test program--assuming errno EAGAIN will do."
13652 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13661 echo "Using $hint value $eagain."
13662 echo "Your read() returns $rd_nodata when no data is present."
13663 case "$d_eofnblk" in
13664 "$define") echo "And you can see EOF because read() returns 0.";;
13665 "$undef") echo "But you can't see EOF status from read() returned value.";;
13667 echo "(Assuming you can't see EOF status from read anyway.)"
13673 $rm_try head.c mtry
13675 : see if erf exists
13679 : see if erfc exists
13683 : see if exp2 exists
13687 : see if expm1 exists
13691 : see if _ptr and _cnt from stdio act std
13694 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13695 echo "(Looks like you have stdio.h from BSD.)"
13696 case "$stdio_ptr" in
13697 '') stdio_ptr='((fp)->_p)'
13700 *) ptr_lval=$d_stdio_ptr_lval;;
13702 case "$stdio_cnt" in
13703 '') stdio_cnt='((fp)->_r)'
13706 *) cnt_lval=$d_stdio_cnt_lval;;
13708 case "$stdio_base" in
13709 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13711 case "$stdio_bufsiz" in
13712 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13714 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13715 echo "(Looks like you have stdio.h from Linux.)"
13716 case "$stdio_ptr" in
13717 '') stdio_ptr='((fp)->_IO_read_ptr)'
13720 *) ptr_lval=$d_stdio_ptr_lval;;
13722 case "$stdio_cnt" in
13723 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13726 *) cnt_lval=$d_stdio_cnt_lval;;
13728 case "$stdio_base" in
13729 '') stdio_base='((fp)->_IO_read_base)';;
13731 case "$stdio_bufsiz" in
13732 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13735 case "$stdio_ptr" in
13736 '') stdio_ptr='((fp)->_ptr)'
13739 *) ptr_lval=$d_stdio_ptr_lval;;
13741 case "$stdio_cnt" in
13742 '') stdio_cnt='((fp)->_cnt)'
13745 *) cnt_lval=$d_stdio_cnt_lval;;
13747 case "$stdio_base" in
13748 '') stdio_base='((fp)->_base)';;
13750 case "$stdio_bufsiz" in
13751 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13755 : test whether _ptr and _cnt really work
13756 echo "Checking how std your stdio is..." >&4
13759 #$i_stdlib I_STDLIB
13761 #include <stdlib.h>
13763 #define FILE_ptr(fp) $stdio_ptr
13764 #define FILE_cnt(fp) $stdio_cnt
13766 FILE *fp = fopen("try.c", "r");
13769 18 <= FILE_cnt(fp) &&
13770 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13778 if eval $compile && $to try.c; then
13779 if $run ./try; then
13780 echo "Your stdio acts pretty std."
13783 echo "Your stdio isn't very std."
13786 echo "Your stdio doesn't appear very std."
13790 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13791 # direct buffer manipulation no longer works. The Configure tests
13792 # should be changed to correctly detect this, but until then,
13793 # the following check should at least let perl compile and run.
13794 # (This quick fix should be updated before 5.8.1.)
13795 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13796 # A. Dougherty, June 3, 2002.
13797 case "$d_gnulibc" in
13799 case "$gnulibc_version" in
13803 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13812 : Can _ptr be used as an lvalue?
13813 case "$d_stdstdio$ptr_lval" in
13814 $define$define) val=$define ;;
13817 set d_stdio_ptr_lval
13820 : Can _cnt be used as an lvalue?
13821 case "$d_stdstdio$cnt_lval" in
13822 $define$define) val=$define ;;
13825 set d_stdio_cnt_lval
13829 : test whether setting _ptr sets _cnt as a side effect
13830 d_stdio_ptr_lval_sets_cnt="$undef"
13831 d_stdio_ptr_lval_nochange_cnt="$undef"
13832 case "$d_stdio_ptr_lval$d_stdstdio" in
13834 echo "Checking to see what happens if we set the stdio ptr..." >&4
13837 /* Can we scream? */
13838 /* Eat dust sed :-) */
13839 /* In the buffer space, no one can hear you scream. */
13840 #$i_stdlib I_STDLIB
13842 #include <stdlib.h>
13844 #define FILE_ptr(fp) $stdio_ptr
13845 #define FILE_cnt(fp) $stdio_cnt
13846 #include <sys/types.h>
13848 FILE *fp = fopen("try.c", "r");
13853 puts("Fail even to read");
13856 c = getc(fp); /* Read away the first # */
13858 puts("Fail even to read");
13862 18 <= FILE_cnt(fp) &&
13863 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13865 puts("Fail even to read");
13868 ptr = (char*) FILE_ptr(fp);
13869 cnt = (size_t)FILE_cnt(fp);
13871 FILE_ptr(fp) += 42;
13873 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13874 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13877 if (FILE_cnt(fp) <= 20) {
13878 printf ("Fail (<20 chars to test)");
13881 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13882 puts("Fail compare");
13885 if (cnt == FILE_cnt(fp)) {
13886 puts("Pass_unchanged");
13889 if (FILE_cnt(fp) == (cnt - 42)) {
13890 puts("Pass_changed");
13893 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13899 if eval $compile && $to try.c; then
13900 case `$run ./try` in
13902 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13903 d_stdio_ptr_lval_sets_cnt="$define" ;;
13905 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13906 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13908 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13910 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13913 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13919 : see if _base is also standard
13921 case "$d_stdstdio" in
13925 #$i_stdlib I_STDLIB
13927 #include <stdlib.h>
13929 #define FILE_base(fp) $stdio_base
13930 #define FILE_bufsiz(fp) $stdio_bufsiz
13932 FILE *fp = fopen("try.c", "r");
13935 19 <= FILE_bufsiz(fp) &&
13936 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13943 if eval $compile && $to try.c; then
13944 if $run ./try; then
13945 echo "And its _base field acts std."
13948 echo "But its _base field isn't std."
13951 echo "However, it seems to be lacking the _base field."
13959 : see if fast_stdio exists
13961 case "$d_stdstdio:$d_stdio_ptr_lval" in
13963 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13965 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13976 : see if fchdir exists
13977 set fchdir d_fchdir
13980 : see if fchmod exists
13981 set fchmod d_fchmod
13984 : check for openat, unlinkat, renameat, linkat, fchmodat
13985 set openat d_openat
13988 set unlinkat d_unlinkat
13991 set renameat d_renameat
13994 set linkat d_linkat
13997 set fchmodat d_fchmodat
14000 : see if fchown exists
14001 set fchown d_fchown
14004 : see if this is an fcntl system
14008 : See if fcntl-based locking works.
14011 #$i_stdlib I_STDLIB
14013 #include <stdlib.h>
14015 #include <unistd.h>
14017 #include <signal.h>
14018 $signal_t blech(int x) { exit(3); }
14020 #if defined(F_SETLK) && defined(F_SETLKW)
14021 struct flock flock;
14023 fd = open("try.c", O_RDONLY);
14024 flock.l_type = F_RDLCK;
14025 flock.l_whence = SEEK_SET;
14026 flock.l_start = flock.l_len = 0;
14027 signal(SIGALRM, blech);
14029 retval = fcntl(fd, F_SETLK, &flock);
14031 (retval < 0 ? exit(2) : exit(0));
14037 echo "Checking if fcntl-based file locking works... "
14041 if eval $compile_ok; then
14042 if $run ./try; then
14043 echo "Yes, it seems to work."
14046 echo "Nope, it didn't work."
14051 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
14052 *** This is (almost) impossible.
14053 *** If your NFS lock daemons are not feeling well, something like
14054 *** this may happen, please investigate. Cannot continue, aborting.
14062 echo "I'm unable to compile the test program, so I'll assume not."
14067 echo "Nope, since you don't even have fcntl()."
14070 set d_fcntl_can_lock
14074 : check for fd_set items
14077 Checking to see how well your C compiler handles fd_set and friends ...
14080 #$i_stdlib I_STDLIB
14082 #include <stdlib.h>
14084 #$i_systime I_SYS_TIME
14085 #$i_sysselct I_SYS_SELECT
14086 #$d_socket HAS_SOCKET
14087 #include <sys/types.h>
14089 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14092 #include <sys/time.h>
14094 #ifdef I_SYS_SELECT
14095 #include <sys/select.h>
14104 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14112 if eval $compile; then
14113 d_fds_bits="$define"
14115 echo "Well, your system knows about the normal fd_set typedef..." >&4
14116 if $run ./try; then
14117 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14118 d_fd_macros="$define"
14121 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14123 d_fd_macros="$undef"
14127 Hmm, your compiler has some difficulty with fd_set. Checking further...
14130 if eval $compile; then
14131 d_fds_bits="$undef"
14133 echo "Well, your system has some sort of fd_set available..." >&4
14134 if $run ./try; then
14135 echo "and you have the normal fd_set macros." >&4
14136 d_fd_macros="$define"
14139 but not the normal fd_set macros! Gross! More work for me...
14141 d_fd_macros="$undef"
14144 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14146 d_fds_bits="$undef"
14147 d_fd_macros="$undef"
14152 : see if fdclose exists
14153 set fdclose d_fdclose
14156 : see if fdim exists
14160 : see if fegetround exists
14161 set fegetround d_fegetround
14164 : see if fgetpos exists
14165 set fgetpos d_fgetpos
14168 : see if finite exists
14169 set finite d_finite
14172 : see if finitel exists
14173 set finitel d_finitel
14176 : see if flock exists
14180 : see if prototype for flock is available
14182 set d_flockproto flock $i_sysfile sys/file.h
14185 : see if fma exists
14189 : see if fmax exists
14193 : see if fmin exists
14197 : see if fp_class exists
14198 set fp_class d_fp_class
14201 : see if this is a math.h system
14205 : check for fpclassify
14206 echo "Checking to see if you have fpclassify..." >&4
14212 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14215 if eval $compile; then
14217 echo "You have fpclassify."
14220 echo "You do not have fpclassify."
14226 : see if fp_classify exists
14227 set fp_classify d_fp_classify
14230 : see if fp_classl exists
14231 set fp_classl d_fp_classl
14234 : see if pathconf exists
14235 set pathconf d_pathconf
14238 : see if fpathconf exists
14239 set fpathconf d_fpathconf
14242 : see if fpclass exists
14243 set fpclass d_fpclass
14246 : see if fpclassl exists
14247 set fpclassl d_fpclassl
14250 : see if fpgetround exists
14251 set fpgetround d_fpgetround
14254 : check for fpos64_t
14256 echo "Checking to see if you have fpos64_t..." >&4
14259 int main() { fpos64_t x = 7; }
14262 if eval $compile; then
14264 echo "You have fpos64_t."
14267 echo "You do not have fpos64_t."
14268 case "$fpossize" in
14269 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14276 : see if this is an xlocale.h system
14277 set xlocale.h i_xlocale
14280 : see if newlocale exists
14281 set newlocale d_newlocale
14284 : see if freelocale exists
14285 set freelocale d_freelocale
14288 : see if uselocale exists
14289 set uselocale d_uselocale
14292 : see if duplocale exists
14293 set duplocale d_duplocale
14296 : see if querylocale exists
14297 set querylocale d_querylocale
14300 : see if frexpl exists
14301 set frexpl d_frexpl
14304 : see if this is a sys/param system
14305 set sys/param.h i_sysparam
14308 : see if this is a sys/mount.h system
14309 set sys/mount.h i_sysmount
14312 : Check for fs_data_s
14314 echo "Checking to see if your system supports struct fs_data..." >&4
14315 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14317 case "$d_fs_data_s" in
14318 "$define") echo "Yes, it does." ;;
14319 *) echo "No, it doesn't." ;;
14322 : see if fseeko exists
14323 set fseeko d_fseeko
14325 case "$longsize" in
14326 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14329 : see if fsetpos exists
14330 set fsetpos d_fsetpos
14333 : see if fstatfs exists
14334 set fstatfs d_fstatfs
14337 : see if statvfs exists
14338 set statvfs d_statvfs
14341 : see if fstatvfs exists
14342 set fstatvfs d_fstatvfs
14346 : see if fsync exists
14350 : see if ftello exists
14351 set ftello d_ftello
14353 case "$longsize" in
14354 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14357 : check for a working futimes
14360 echo "Checking if you have a working futimes()" >&4
14363 #include <sys/time.h>
14370 fd = open ("try.c", O_RDWR);
14371 if (-1 == fd) exit (1);
14372 rv = futimes (fd, NULL);
14373 exit (rv == -1 ? errno : 0);
14377 if eval $compile; then
14381 0) echo "Yes, you have" >&4
14382 d_futimes="$define"
14384 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14388 echo "No, it does not (probably harmless)" >&4
14392 : look for gai_strerror
14394 $cat >try.c <<'EOCP'
14395 #include <sys/types.h>
14396 #include <sys/socket.h>
14400 return (gai_strerror (0) ? 0 : 1);
14405 if eval $compile; then
14408 0) echo "A working gai_strerror() found." >&4
14410 *) echo "gai_strerror() found, but it doesn't work" >&4
14414 echo "gai_strerror() NOT found." >&4
14420 : see if ndbm.h is available
14423 : Compatibility location for RedHat 7.1
14424 set gdbm/ndbm.h i_gdbmndbm
14426 : Compatibility location for Debian 4.0
14427 set gdbm-ndbm.h i_gdbm_ndbm
14431 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14432 : see if dbm_open exists
14433 set dbm_open d_dbm_open
14435 case "$d_dbm_open" in
14438 i_gdbmndbm="$undef"
14439 i_gdbm_ndbm="$undef"
14440 echo "We won't be including <ndbm.h>"
14450 ndbm_hdr_protochk='name=$1; hdr=$2;
14451 eval "ihdr=\$""i_$name";
14453 if $test "$ihdr" = "$define"; then
14454 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14455 case "$d_cplusplus" in
14456 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14457 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14460 $define) $echo "Your <$hdr> seems to have prototypes";;
14461 *) $echo "Your <$hdr> does not seem to have prototypes";;
14464 set "d_${name}_h_uses_prototypes";
14468 eval $ndbm_hdr_protochk
14469 set gdbmndbm gdbm/ndbm.h
14470 eval $ndbm_hdr_protochk
14471 set gdbm_ndbm gdbm-ndbm.h
14472 eval $ndbm_hdr_protochk
14474 : see if getaddrinfo exists
14475 set getaddrinfo d_getaddrinfo
14478 : see if getcwd exists
14479 set getcwd d_getcwd
14482 : see if getespwnam exists
14483 set getespwnam d_getespwnam
14486 : see if getfsstat exists
14487 set getfsstat d_getfsstat
14490 : see if getgrent exists
14491 set getgrent d_getgrent
14494 : see if getgrent_r exists
14495 set getgrent_r d_getgrent_r
14497 case "$d_getgrent_r" in
14499 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14500 case "$d_getgrent_r_proto:$usethreads" in
14501 ":define") d_getgrent_r_proto=define
14502 set d_getgrent_r_proto getgrent_r $hdrs
14506 case "$d_getgrent_r_proto" in
14508 case "$getgrent_r_proto" in
14509 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14510 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14512 case "$getgrent_r_proto" in
14513 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14514 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14516 case "$getgrent_r_proto" in
14517 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14518 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14520 case "$getgrent_r_proto" in
14521 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14522 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14524 case "$getgrent_r_proto" in
14525 ''|0) try='int getgrent_r(struct group*, char*, int);'
14526 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14528 case "$getgrent_r_proto" in
14529 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14530 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14532 case "$getgrent_r_proto" in
14533 ''|0) d_getgrent_r=undef
14535 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14536 * ) case "$getgrent_r_proto" in
14537 REENTRANT_PROTO*) ;;
14538 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14540 echo "Prototype: $try" ;;
14543 *) case "$usethreads" in
14544 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14551 *) getgrent_r_proto=0
14555 : see if getgrgid_r exists
14556 set getgrgid_r d_getgrgid_r
14558 case "$d_getgrgid_r" in
14560 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14561 case "$d_getgrgid_r_proto:$usethreads" in
14562 ":define") d_getgrgid_r_proto=define
14563 set d_getgrgid_r_proto getgrgid_r $hdrs
14567 case "$d_getgrgid_r_proto" in
14569 case "$getgrgid_r_proto" in
14570 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14571 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14573 case "$getgrgid_r_proto" in
14574 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14575 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14577 case "$getgrgid_r_proto" in
14578 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14579 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14581 case "$getgrgid_r_proto" in
14582 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14583 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14585 case "$getgrgid_r_proto" in
14586 ''|0) d_getgrgid_r=undef
14588 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14589 * ) case "$getgrgid_r_proto" in
14590 REENTRANT_PROTO*) ;;
14591 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14593 echo "Prototype: $try" ;;
14596 *) case "$usethreads" in
14597 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14604 *) getgrgid_r_proto=0
14608 : see if getgrnam_r exists
14609 set getgrnam_r d_getgrnam_r
14611 case "$d_getgrnam_r" in
14613 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14614 case "$d_getgrnam_r_proto:$usethreads" in
14615 ":define") d_getgrnam_r_proto=define
14616 set d_getgrnam_r_proto getgrnam_r $hdrs
14620 case "$d_getgrnam_r_proto" in
14622 case "$getgrnam_r_proto" in
14623 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14624 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14626 case "$getgrnam_r_proto" in
14627 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14628 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14630 case "$getgrnam_r_proto" in
14631 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14632 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14634 case "$getgrnam_r_proto" in
14635 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14636 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14638 case "$getgrnam_r_proto" in
14639 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14640 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14642 case "$getgrnam_r_proto" in
14643 ''|0) d_getgrnam_r=undef
14645 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14646 * ) case "$getgrnam_r_proto" in
14647 REENTRANT_PROTO*) ;;
14648 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14650 echo "Prototype: $try" ;;
14653 *) case "$usethreads" in
14654 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14661 *) getgrnam_r_proto=0
14665 : see if gethostbyaddr exists
14666 set gethostbyaddr d_gethbyaddr
14669 : see if gethostbyname exists
14670 set gethostbyname d_gethbyname
14673 : see if gethostent exists
14674 set gethostent d_gethent
14677 : see how we will look up host name
14680 if set gethostname val -f d_gethname; eval $csym; $val; then
14681 echo 'gethostname() found.' >&4
14682 d_gethname="$define"
14685 if set uname val -f d_uname; eval $csym; $val; then
14688 uname() was found, but you're running xenix, and older versions of xenix
14689 have a broken uname(). If you don't really know whether your xenix is old
14690 enough to have a broken system call, use the default answer.
14695 "$define") dflt=n;;
14697 rp='Is your uname() broken?'
14700 n*) d_uname="$define"; call=uname;;
14703 echo 'uname() found.' >&4
14710 case "$d_gethname" in
14711 '') d_gethname="$undef";;
14714 '') d_uname="$undef";;
14716 case "$d_uname$d_gethname" in
14721 Every now and then someone has a $call() that lies about the hostname
14722 but can't be fixed for political or economic reasons. If you wish, I can
14723 pretend $call() isn't there and maybe compute hostname at run-time
14724 thanks to the '$phostname' command.
14727 rp="Shall I ignore $call() from now on?"
14730 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14733 case "$phostname" in
14734 '') aphostname='';;
14735 *) case "$aphostname" in
14737 *) set X $phostname
14741 file=`./loc $file $file $pth`
14742 aphostname=`echo $file $*`
14747 case "$d_uname$d_gethname" in
14750 case "$phostname" in
14752 echo "There will be no way for $package to get your hostname." >&4;;
14754 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14758 case "$d_phostname" in
14759 '') d_phostname="$undef";;
14762 : see if gethostbyaddr_r exists
14763 set gethostbyaddr_r d_gethostbyaddr_r
14765 case "$d_gethostbyaddr_r" in
14767 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14768 case "$d_gethostbyaddr_r_proto:$usethreads" in
14769 ":define") d_gethostbyaddr_r_proto=define
14770 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14774 case "$d_gethostbyaddr_r_proto" in
14776 case "$gethostbyaddr_r_proto" in
14777 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14778 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14780 case "$gethostbyaddr_r_proto" in
14781 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14782 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14784 case "$gethostbyaddr_r_proto" in
14785 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14786 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14788 case "$gethostbyaddr_r_proto" in
14789 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14790 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14792 case "$gethostbyaddr_r_proto" in
14793 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14794 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14796 case "$gethostbyaddr_r_proto" in
14797 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14798 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14800 case "$gethostbyaddr_r_proto" in
14801 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14802 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14804 case "$gethostbyaddr_r_proto" in
14805 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14806 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14808 case "$gethostbyaddr_r_proto" in
14809 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14810 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14812 case "$gethostbyaddr_r_proto" in
14813 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14814 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14816 case "$gethostbyaddr_r_proto" in
14817 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14818 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14820 case "$gethostbyaddr_r_proto" in
14821 ''|0) d_gethostbyaddr_r=undef
14822 gethostbyaddr_r_proto=0
14823 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14824 * ) case "$gethostbyaddr_r_proto" in
14825 REENTRANT_PROTO*) ;;
14826 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14828 echo "Prototype: $try" ;;
14831 *) case "$usethreads" in
14832 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14834 d_gethostbyaddr_r=undef
14835 gethostbyaddr_r_proto=0
14839 *) gethostbyaddr_r_proto=0
14843 : see if gethostbyname_r exists
14844 set gethostbyname_r d_gethostbyname_r
14846 case "$d_gethostbyname_r" in
14848 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14849 case "$d_gethostbyname_r_proto:$usethreads" in
14850 ":define") d_gethostbyname_r_proto=define
14851 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14855 case "$d_gethostbyname_r_proto" in
14857 case "$gethostbyname_r_proto" in
14858 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14859 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14861 case "$gethostbyname_r_proto" in
14862 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14863 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14865 case "$gethostbyname_r_proto" in
14866 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14867 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14869 case "$gethostbyname_r_proto" in
14870 ''|0) d_gethostbyname_r=undef
14871 gethostbyname_r_proto=0
14872 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14873 * ) case "$gethostbyname_r_proto" in
14874 REENTRANT_PROTO*) ;;
14875 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14877 echo "Prototype: $try" ;;
14880 *) case "$usethreads" in
14881 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14883 d_gethostbyname_r=undef
14884 gethostbyname_r_proto=0
14888 *) gethostbyname_r_proto=0
14892 : see if gethostent_r exists
14893 set gethostent_r d_gethostent_r
14895 case "$d_gethostent_r" in
14897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14898 case "$d_gethostent_r_proto:$usethreads" in
14899 ":define") d_gethostent_r_proto=define
14900 set d_gethostent_r_proto gethostent_r $hdrs
14904 case "$d_gethostent_r_proto" in
14906 case "$gethostent_r_proto" in
14907 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14908 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14910 case "$gethostent_r_proto" in
14911 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14912 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14914 case "$gethostent_r_proto" in
14915 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14916 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14918 case "$gethostent_r_proto" in
14919 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14920 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14922 case "$gethostent_r_proto" in
14923 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14924 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14926 case "$gethostent_r_proto" in
14927 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14928 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14930 case "$gethostent_r_proto" in
14931 ''|0) d_gethostent_r=undef
14932 gethostent_r_proto=0
14933 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14934 * ) case "$gethostent_r_proto" in
14935 REENTRANT_PROTO*) ;;
14936 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14938 echo "Prototype: $try" ;;
14941 *) case "$usethreads" in
14942 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14944 d_gethostent_r=undef
14945 gethostent_r_proto=0
14949 *) gethostent_r_proto=0
14953 : see if prototypes for various gethostxxx netdb.h functions are available
14955 set d_gethostprotos gethostent $i_netdb netdb.h
14958 : see if getitimer exists
14959 set getitimer d_getitimer
14962 : see if getlogin exists
14963 set getlogin d_getlogin
14966 : see if getlogin_r exists
14967 set getlogin_r d_getlogin_r
14969 case "$d_getlogin_r" in
14971 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14972 case "$d_getlogin_r_proto:$usethreads" in
14973 ":define") d_getlogin_r_proto=define
14974 set d_getlogin_r_proto getlogin_r $hdrs
14978 case "$d_getlogin_r_proto" in
14980 case "$getlogin_r_proto" in
14981 ''|0) try='int getlogin_r(char*, size_t);'
14982 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14984 case "$getlogin_r_proto" in
14985 ''|0) try='int getlogin_r(char*, int);'
14986 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14988 case "$getlogin_r_proto" in
14989 ''|0) try='char* getlogin_r(char*, size_t);'
14990 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14992 case "$getlogin_r_proto" in
14993 ''|0) try='char* getlogin_r(char*, int);'
14994 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14996 case "$getlogin_r_proto" in
14997 ''|0) d_getlogin_r=undef
14999 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
15000 * ) case "$getlogin_r_proto" in
15001 REENTRANT_PROTO*) ;;
15002 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
15004 echo "Prototype: $try" ;;
15007 *) case "$usethreads" in
15008 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
15015 *) getlogin_r_proto=0
15019 : see if getmnt exists
15020 set getmnt d_getmnt
15023 : see if getmntent exists
15024 set getmntent d_getmntent
15027 : see if getnameinfo exists
15028 set getnameinfo d_getnameinfo
15031 : see if getnetbyaddr exists
15032 set getnetbyaddr d_getnbyaddr
15035 : see if getnetbyname exists
15036 set getnetbyname d_getnbyname
15039 : see if getnetent exists
15040 set getnetent d_getnent
15043 : see if getnetbyaddr_r exists
15044 set getnetbyaddr_r d_getnetbyaddr_r
15046 case "$d_getnetbyaddr_r" in
15048 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15049 case "$d_getnetbyaddr_r_proto:$usethreads" in
15050 ":define") d_getnetbyaddr_r_proto=define
15051 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
15055 case "$d_getnetbyaddr_r_proto" in
15057 case "$getnetbyaddr_r_proto" in
15058 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
15059 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
15061 case "$getnetbyaddr_r_proto" in
15062 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
15063 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
15065 case "$getnetbyaddr_r_proto" in
15066 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
15067 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
15069 case "$getnetbyaddr_r_proto" in
15070 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
15071 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
15073 case "$getnetbyaddr_r_proto" in
15074 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
15075 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15077 case "$getnetbyaddr_r_proto" in
15078 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15079 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15081 case "$getnetbyaddr_r_proto" in
15082 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15083 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15085 case "$getnetbyaddr_r_proto" in
15086 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15087 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15089 case "$getnetbyaddr_r_proto" in
15090 ''|0) d_getnetbyaddr_r=undef
15091 getnetbyaddr_r_proto=0
15092 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15093 * ) case "$getnetbyaddr_r_proto" in
15094 REENTRANT_PROTO*) ;;
15095 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15097 echo "Prototype: $try" ;;
15100 *) case "$usethreads" in
15101 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15103 d_getnetbyaddr_r=undef
15104 getnetbyaddr_r_proto=0
15108 *) getnetbyaddr_r_proto=0
15112 : see if getnetbyname_r exists
15113 set getnetbyname_r d_getnetbyname_r
15115 case "$d_getnetbyname_r" in
15117 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15118 case "$d_getnetbyname_r_proto:$usethreads" in
15119 ":define") d_getnetbyname_r_proto=define
15120 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15124 case "$d_getnetbyname_r_proto" in
15126 case "$getnetbyname_r_proto" in
15127 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15128 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15130 case "$getnetbyname_r_proto" in
15131 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15132 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15134 case "$getnetbyname_r_proto" in
15135 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15136 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15138 case "$getnetbyname_r_proto" in
15139 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15140 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15142 case "$getnetbyname_r_proto" in
15143 ''|0) d_getnetbyname_r=undef
15144 getnetbyname_r_proto=0
15145 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15146 * ) case "$getnetbyname_r_proto" in
15147 REENTRANT_PROTO*) ;;
15148 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15150 echo "Prototype: $try" ;;
15153 *) case "$usethreads" in
15154 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15156 d_getnetbyname_r=undef
15157 getnetbyname_r_proto=0
15161 *) getnetbyname_r_proto=0
15165 : see if getnetent_r exists
15166 set getnetent_r d_getnetent_r
15168 case "$d_getnetent_r" in
15170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15171 case "$d_getnetent_r_proto:$usethreads" in
15172 ":define") d_getnetent_r_proto=define
15173 set d_getnetent_r_proto getnetent_r $hdrs
15177 case "$d_getnetent_r_proto" in
15179 case "$getnetent_r_proto" in
15180 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15181 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15183 case "$getnetent_r_proto" in
15184 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15185 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15187 case "$getnetent_r_proto" in
15188 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15189 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15191 case "$getnetent_r_proto" in
15192 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15193 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15195 case "$getnetent_r_proto" in
15196 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15197 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15199 case "$getnetent_r_proto" in
15200 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15201 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15203 case "$getnetent_r_proto" in
15204 ''|0) d_getnetent_r=undef
15205 getnetent_r_proto=0
15206 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15207 * ) case "$getnetent_r_proto" in
15208 REENTRANT_PROTO*) ;;
15209 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15211 echo "Prototype: $try" ;;
15214 *) case "$usethreads" in
15215 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15217 d_getnetent_r=undef
15218 getnetent_r_proto=0
15222 *) getnetent_r_proto=0
15226 : see if prototypes for various getnetxxx netdb.h functions are available
15228 set d_getnetprotos getnetent $i_netdb netdb.h
15231 : see if getpagesize exists
15232 set getpagesize d_getpagsz
15235 : Optional checks for getprotobyname and getprotobynumber
15237 : see if getprotobyname exists
15238 set getprotobyname d_getpbyname
15241 : see if getprotobynumber exists
15242 set getprotobynumber d_getpbynumber
15245 : see if getprotoent exists
15246 set getprotoent d_getpent
15249 : see if getpgid exists
15250 set getpgid d_getpgid
15253 : see if getpgrp2 exists
15254 set getpgrp2 d_getpgrp2
15257 : see if getppid exists
15258 set getppid d_getppid
15261 : see if getpriority exists
15262 set getpriority d_getprior
15265 : see if getprotobyname_r exists
15266 set getprotobyname_r d_getprotobyname_r
15268 case "$d_getprotobyname_r" in
15270 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15271 case "$d_getprotobyname_r_proto:$usethreads" in
15272 ":define") d_getprotobyname_r_proto=define
15273 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15277 case "$d_getprotobyname_r_proto" in
15279 case "$getprotobyname_r_proto" in
15280 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15281 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15283 case "$getprotobyname_r_proto" in
15284 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15285 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15287 case "$getprotobyname_r_proto" in
15288 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15289 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15291 case "$getprotobyname_r_proto" in
15292 ''|0) d_getprotobyname_r=undef
15293 getprotobyname_r_proto=0
15294 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15295 * ) case "$getprotobyname_r_proto" in
15296 REENTRANT_PROTO*) ;;
15297 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15299 echo "Prototype: $try" ;;
15302 *) case "$usethreads" in
15303 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15305 d_getprotobyname_r=undef
15306 getprotobyname_r_proto=0
15310 *) getprotobyname_r_proto=0
15314 : see if getprotobynumber_r exists
15315 set getprotobynumber_r d_getprotobynumber_r
15317 case "$d_getprotobynumber_r" in
15319 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15320 case "$d_getprotobynumber_r_proto:$usethreads" in
15321 ":define") d_getprotobynumber_r_proto=define
15322 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15326 case "$d_getprotobynumber_r_proto" in
15328 case "$getprotobynumber_r_proto" in
15329 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15330 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15332 case "$getprotobynumber_r_proto" in
15333 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15334 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15336 case "$getprotobynumber_r_proto" in
15337 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15338 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15340 case "$getprotobynumber_r_proto" in
15341 ''|0) d_getprotobynumber_r=undef
15342 getprotobynumber_r_proto=0
15343 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15344 * ) case "$getprotobynumber_r_proto" in
15345 REENTRANT_PROTO*) ;;
15346 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15348 echo "Prototype: $try" ;;
15351 *) case "$usethreads" in
15352 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15354 d_getprotobynumber_r=undef
15355 getprotobynumber_r_proto=0
15359 *) getprotobynumber_r_proto=0
15363 : see if getprotoent_r exists
15364 set getprotoent_r d_getprotoent_r
15366 case "$d_getprotoent_r" in
15368 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15369 case "$d_getprotoent_r_proto:$usethreads" in
15370 ":define") d_getprotoent_r_proto=define
15371 set d_getprotoent_r_proto getprotoent_r $hdrs
15375 case "$d_getprotoent_r_proto" in
15377 case "$getprotoent_r_proto" in
15378 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15379 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15381 case "$getprotoent_r_proto" in
15382 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15383 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15385 case "$getprotoent_r_proto" in
15386 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15387 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15389 case "$getprotoent_r_proto" in
15390 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15391 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15393 case "$getprotoent_r_proto" in
15394 ''|0) d_getprotoent_r=undef
15395 getprotoent_r_proto=0
15396 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15397 * ) case "$getprotoent_r_proto" in
15398 REENTRANT_PROTO*) ;;
15399 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15401 echo "Prototype: $try" ;;
15404 *) case "$usethreads" in
15405 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15407 d_getprotoent_r=undef
15408 getprotoent_r_proto=0
15412 *) getprotoent_r_proto=0
15416 : see if prototypes for various getprotoxxx netdb.h functions are available
15418 set d_getprotoprotos getprotoent $i_netdb netdb.h
15421 : see if getprpwnam exists
15422 set getprpwnam d_getprpwnam
15425 : see if getpwent exists
15426 set getpwent d_getpwent
15429 : see if getpwent_r exists
15430 set getpwent_r d_getpwent_r
15432 case "$d_getpwent_r" in
15434 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15435 case "$d_getpwent_r_proto:$usethreads" in
15436 ":define") d_getpwent_r_proto=define
15437 set d_getpwent_r_proto getpwent_r $hdrs
15441 case "$d_getpwent_r_proto" in
15443 case "$getpwent_r_proto" in
15444 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15445 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15447 case "$getpwent_r_proto" in
15448 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15449 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15451 case "$getpwent_r_proto" in
15452 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15453 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15455 case "$getpwent_r_proto" in
15456 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15457 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15459 case "$getpwent_r_proto" in
15460 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15461 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15463 case "$getpwent_r_proto" in
15464 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15465 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15467 case "$getpwent_r_proto" in
15468 ''|0) d_getpwent_r=undef
15470 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15471 * ) case "$getpwent_r_proto" in
15472 REENTRANT_PROTO*) ;;
15473 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15475 echo "Prototype: $try" ;;
15478 *) case "$usethreads" in
15479 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15486 *) getpwent_r_proto=0
15490 : see if getpwnam_r exists
15491 set getpwnam_r d_getpwnam_r
15493 case "$d_getpwnam_r" in
15495 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15496 case "$d_getpwnam_r_proto:$usethreads" in
15497 ":define") d_getpwnam_r_proto=define
15498 set d_getpwnam_r_proto getpwnam_r $hdrs
15502 case "$d_getpwnam_r_proto" in
15504 case "$getpwnam_r_proto" in
15505 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15506 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15508 case "$getpwnam_r_proto" in
15509 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15510 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15512 case "$getpwnam_r_proto" in
15513 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15514 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15516 case "$getpwnam_r_proto" in
15517 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15518 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15520 case "$getpwnam_r_proto" in
15521 ''|0) d_getpwnam_r=undef
15523 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15524 * ) case "$getpwnam_r_proto" in
15525 REENTRANT_PROTO*) ;;
15526 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15528 echo "Prototype: $try" ;;
15531 *) case "$usethreads" in
15532 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15539 *) getpwnam_r_proto=0
15543 : see if getpwuid_r exists
15544 set getpwuid_r d_getpwuid_r
15546 case "$d_getpwuid_r" in
15548 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15549 case "$d_getpwuid_r_proto:$usethreads" in
15550 ":define") d_getpwuid_r_proto=define
15551 set d_getpwuid_r_proto getpwuid_r $hdrs
15555 case "$d_getpwuid_r_proto" in
15557 case "$getpwuid_r_proto" in
15558 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15559 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15561 case "$getpwuid_r_proto" in
15562 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15563 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15565 case "$getpwuid_r_proto" in
15566 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15567 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15569 case "$getpwuid_r_proto" in
15570 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15571 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15573 case "$getpwuid_r_proto" in
15574 ''|0) d_getpwuid_r=undef
15576 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15577 * ) case "$getpwuid_r_proto" in
15578 REENTRANT_PROTO*) ;;
15579 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15581 echo "Prototype: $try" ;;
15584 *) case "$usethreads" in
15585 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15592 *) getpwuid_r_proto=0
15596 : Optional checks for getsbyname and getsbyport
15598 : see if getservbyname exists
15599 set getservbyname d_getsbyname
15602 : see if getservbyport exists
15603 set getservbyport d_getsbyport
15606 : see if getservent exists
15607 set getservent d_getsent
15610 : see if getservbyname_r exists
15611 set getservbyname_r d_getservbyname_r
15613 case "$d_getservbyname_r" in
15615 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15616 case "$d_getservbyname_r_proto:$usethreads" in
15617 ":define") d_getservbyname_r_proto=define
15618 set d_getservbyname_r_proto getservbyname_r $hdrs
15622 case "$d_getservbyname_r_proto" in
15624 case "$getservbyname_r_proto" in
15625 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15626 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15628 case "$getservbyname_r_proto" in
15629 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15630 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15632 case "$getservbyname_r_proto" in
15633 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15634 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15636 case "$getservbyname_r_proto" in
15637 ''|0) d_getservbyname_r=undef
15638 getservbyname_r_proto=0
15639 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15640 * ) case "$getservbyname_r_proto" in
15641 REENTRANT_PROTO*) ;;
15642 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15644 echo "Prototype: $try" ;;
15647 *) case "$usethreads" in
15648 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15650 d_getservbyname_r=undef
15651 getservbyname_r_proto=0
15655 *) getservbyname_r_proto=0
15659 : see if getservbyport_r exists
15660 set getservbyport_r d_getservbyport_r
15662 case "$d_getservbyport_r" in
15664 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15665 case "$d_getservbyport_r_proto:$usethreads" in
15666 ":define") d_getservbyport_r_proto=define
15667 set d_getservbyport_r_proto getservbyport_r $hdrs
15671 case "$d_getservbyport_r_proto" in
15673 case "$getservbyport_r_proto" in
15674 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15675 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15677 case "$getservbyport_r_proto" in
15678 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15679 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15681 case "$getservbyport_r_proto" in
15682 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15683 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15685 case "$getservbyport_r_proto" in
15686 ''|0) d_getservbyport_r=undef
15687 getservbyport_r_proto=0
15688 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15689 * ) case "$getservbyport_r_proto" in
15690 REENTRANT_PROTO*) ;;
15691 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15693 echo "Prototype: $try" ;;
15696 *) case "$usethreads" in
15697 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15699 d_getservbyport_r=undef
15700 getservbyport_r_proto=0
15704 *) getservbyport_r_proto=0
15708 : see if getservent_r exists
15709 set getservent_r d_getservent_r
15711 case "$d_getservent_r" in
15713 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15714 case "$d_getservent_r_proto:$usethreads" in
15715 ":define") d_getservent_r_proto=define
15716 set d_getservent_r_proto getservent_r $hdrs
15720 case "$d_getservent_r_proto" in
15722 case "$getservent_r_proto" in
15723 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15724 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15726 case "$getservent_r_proto" in
15727 ''|0) try='int getservent_r(struct servent*, char*, int);'
15728 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15730 case "$getservent_r_proto" in
15731 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15732 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15734 case "$getservent_r_proto" in
15735 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15736 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15738 case "$getservent_r_proto" in
15739 ''|0) d_getservent_r=undef
15740 getservent_r_proto=0
15741 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15742 * ) case "$getservent_r_proto" in
15743 REENTRANT_PROTO*) ;;
15744 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15746 echo "Prototype: $try" ;;
15749 *) case "$usethreads" in
15750 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15752 d_getservent_r=undef
15753 getservent_r_proto=0
15757 *) getservent_r_proto=0
15761 : see if prototypes for various getservxxx netdb.h functions are available
15763 set d_getservprotos getservent $i_netdb netdb.h
15766 : see if getspnam exists
15767 set getspnam d_getspnam
15770 : see if this is a shadow.h system
15771 set shadow.h i_shadow
15774 : see if getspnam_r exists
15775 set getspnam_r d_getspnam_r
15777 case "$d_getspnam_r" in
15779 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15780 case "$d_getspnam_r_proto:$usethreads" in
15781 ":define") d_getspnam_r_proto=define
15782 set d_getspnam_r_proto getspnam_r $hdrs
15786 case "$d_getspnam_r_proto" in
15788 case "$getspnam_r_proto" in
15789 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15790 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15792 case "$getspnam_r_proto" in
15793 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15794 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15796 case "$getspnam_r_proto" in
15797 ''|0) d_getspnam_r=undef
15799 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15800 * ) case "$getspnam_r_proto" in
15801 REENTRANT_PROTO*) ;;
15802 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15804 echo "Prototype: $try" ;;
15807 *) case "$usethreads" in
15808 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15815 *) getspnam_r_proto=0
15819 : see if gettimeofday or ftime exists
15820 set gettimeofday d_gettimeod
15822 case "$d_gettimeod" in
15828 val="$undef"; set d_ftime; eval $setvar
15831 case "$d_gettimeod$d_ftime" in
15834 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15838 : see if gmtime_r exists
15839 set gmtime_r d_gmtime_r
15841 case "$d_gmtime_r" in
15843 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15844 case "$d_gmtime_r_proto:$usethreads" in
15845 ":define") d_gmtime_r_proto=define
15846 set d_gmtime_r_proto gmtime_r $hdrs
15850 case "$d_gmtime_r_proto" in
15852 case "$gmtime_r_proto" in
15853 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15854 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15856 case "$gmtime_r_proto" in
15857 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15858 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15860 case "$gmtime_r_proto" in
15861 ''|0) d_gmtime_r=undef
15863 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15864 * ) case "$gmtime_r_proto" in
15865 REENTRANT_PROTO*) ;;
15866 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15868 echo "Prototype: $try" ;;
15871 *) case "$usethreads" in
15872 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15879 *) gmtime_r_proto=0
15883 : see if hasmntopt exists
15884 set hasmntopt d_hasmntopt
15887 : see if this is a netinet/in.h or sys/in.h system
15888 set netinet/in.h i_niin sys/in.h i_sysin
15891 : see if arpa/inet.h has to be included
15892 set arpa/inet.h i_arpainet
15895 : see if htonl --and friends-- exists
15900 : Maybe they are macros.
15903 $cat >htonl.c <<EOM
15905 #include <sys/types.h>
15906 #$i_niin I_NETINET_IN
15908 #$i_arpainet I_ARPA_INET
15909 #ifdef I_NETINET_IN
15910 #include <netinet/in.h>
15913 #include <sys/in.h>
15916 #include <arpa/inet.h>
15919 printf("Defined as a macro.");
15922 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15923 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15925 echo "But it seems to be defined as a macro." >&4
15933 : see if hypot exists
15937 : see if ilogb exists
15941 : see if ilogbl exists
15942 set ilogbl d_ilogbl
15947 if set index val -f; eval $csym; $val; then
15948 if set strchr val -f d_strchr; eval $csym; $val; then
15949 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15952 echo "strchr() found." >&4
15956 echo "index() found." >&4
15961 echo "index() found." >&4
15964 if set strchr val -f d_strchr; eval $csym; $val; then
15967 echo "strchr() found." >&4
15969 echo "No index() or strchr() found!" >&4
15974 set d_strchr; eval $setvar
15976 set d_index; eval $setvar
15978 : check whether inet_aton exists
15979 set inet_aton d_inetaton
15982 : see if inet_ntop exists
15983 set inet_ntop d_inetntop
15986 : see if inet_pton exists
15987 set inet_pton d_inetpton
15992 $cat >isascii.c <<EOCP
15995 #$i_stdlib I_STDLIB
15997 #include <stdlib.h>
16008 if eval $compile; then
16009 echo "isascii() found." >&4
16012 echo "isascii() NOT found." >&4
16021 $cat >isblank.c <<'EOCP'
16032 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
16033 echo "isblank() found." >&4
16036 echo "isblank() NOT found." >&4
16043 : check for isfinite
16044 echo "Checking to see if you have isfinite..." >&4
16050 int main() { return isfinite(0.0); }
16053 if eval $compile; then
16055 echo "You have isfinite."
16058 echo "You do not have isfinite."
16064 : see if isfinitel exists
16065 set isfinitel d_isfinitel
16069 echo "Checking to see if you have isinf..." >&4
16075 int main() { return isinf(0.0); }
16078 if eval $compile; then
16080 echo "You have isinf."
16083 echo "You do not have isinf."
16089 : see if isinfl exists
16090 set isinfl d_isinfl
16094 echo "Checking to see if you have isless..." >&4
16100 int main() { return isless(0.0); }
16103 if eval $compile; then
16105 echo "You have isless."
16108 echo "You do not have isless."
16115 echo "Checking to see if you have isnan..." >&4
16121 int main() { return isnan(0.0); }
16124 if eval $compile; then
16126 echo "You have isnan."
16129 echo "You do not have isnan."
16135 : see if isnanl exists
16136 set isnanl d_isnanl
16139 : check for isnormal
16140 echo "Checking to see if you have isnormal..." >&4
16146 int main() { return isnormal(0.0); }
16149 if eval $compile; then
16151 echo "You have isnormal."
16154 echo "You do not have isnormal."
16164 : see if j0l exists
16168 : see if killpg exists
16169 set killpg d_killpg
16172 : see if localeconv exists
16173 set localeconv d_locconv
16176 : see if libc has the POSIX.1-2008 currency locale rules
16177 case "$d_locconv:$d_lc_monetary_2008" in
16180 #include <locale.h>
16182 struct lconv *lc = localeconv();
16183 char int_p_cs_precedes = lc->int_p_cs_precedes;
16188 if eval $compile; then
16189 d_lc_monetary_2008="$define"
16191 d_lc_monetary_2008="$undef"
16197 : see if lchown exists
16199 $cat > try.c <<'EOCP'
16200 /* System header to define __stub macros and hopefully few prototypes,
16201 which can conflict with char lchown(); below. */
16202 #include <assert.h>
16203 /* Override any gcc2 internal prototype to avoid an error. */
16204 /* We use char because int might match the return type of a gcc2
16205 builtin and then its argument prototype would still apply. */
16208 /* The GNU C library defines this for functions which it implements
16209 to always fail with ENOSYS. Some functions are actually named
16210 something starting with __ and the normal name is an alias. */
16211 #if defined (__stub_lchown) || defined (__stub___lchown)
16219 if eval $compile; then
16220 $echo "lchown() found." >&4
16223 $echo "lchown() NOT found." >&4
16229 : See if number of significant digits in a double precision number is known
16231 $cat >ldbl_dig.c <<EOM
16232 #$i_limits I_LIMITS
16235 #include <limits.h>
16241 printf("Contains LDBL_DIG");
16244 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16245 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16246 echo "LDBL_DIG found." >&4
16249 echo "LDBL_DIG NOT found." >&4
16256 : see if lgamma exists
16257 set lgamma d_lgamma
16260 : see if lgamma_r exists
16261 set lgamma_r d_lgamma_r
16264 : check to see if math.h defines _LIB_VERSION
16265 d_libm_lib_version="$undef"
16269 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16271 #include <unistd.h>
16273 int main (int argc, char *argv[])
16275 printf ("%d\n", _LIB_VERSION);
16280 if eval $compile; then
16282 echo "Yes, it does ($foo)" >&4
16283 d_libm_lib_version="$define"
16285 echo "No, it does not (probably harmless)" >&4
16292 : see if link exists
16296 : see if llrint exists
16297 set llrint d_llrint
16300 : see if llrintl exists
16301 set llrintl d_llrintl
16304 : see if llround exists
16305 set llround d_llround
16308 : see if llroundl exists
16309 set llroundl d_llroundl
16312 : see if localtime_r exists
16313 set localtime_r d_localtime_r
16315 case "$d_localtime_r" in
16317 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16318 case "$d_localtime_r_proto:$usethreads" in
16319 ":define") d_localtime_r_proto=define
16320 set d_localtime_r_proto localtime_r $hdrs
16324 case "$d_localtime_r_proto" in
16326 case "$localtime_r_proto" in
16327 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16328 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16330 case "$localtime_r_proto" in
16331 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16332 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16334 case "$localtime_r_proto" in
16335 ''|0) d_localtime_r=undef
16336 localtime_r_proto=0
16337 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16338 * ) case "$localtime_r_proto" in
16339 REENTRANT_PROTO*) ;;
16340 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16342 echo "Prototype: $try" ;;
16345 *) case "$usethreads" in
16346 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16348 d_localtime_r=undef
16349 localtime_r_proto=0
16353 *) localtime_r_proto=0
16357 : see if localtime_r calls tzset
16358 case "$localtime_r_proto" in
16361 /* Does our libc's localtime_r call tzset ?
16362 * return 0 if so, 1 otherwise.
16364 #$i_systypes I_SYS_TYPES
16365 #$i_unistd I_UNISTD
16367 #$i_stdlib I_STDLIB
16368 #$i_string I_STRING
16369 #$i_malloc I_MALLOC
16371 # include <sys/types.h>
16374 # include <unistd.h>
16380 #include <stdlib.h>
16383 # include <string.h>
16385 # include <strings.h>
16388 # include <malloc.h>
16392 time_t t = time(0L);
16393 char w_tz[]="TZ" "=GMT+5",
16394 e_tz[]="TZ" "=GMT-5",
16395 *tz_e = (char*)malloc(16),
16396 *tz_w = (char*)malloc(16);
16397 struct tm tm_e, tm_w;
16398 memset(&tm_e,'\0',sizeof(struct tm));
16399 memset(&tm_w,'\0',sizeof(struct tm));
16404 localtime_r(&t, &tm_e);
16407 localtime_r(&t, &tm_w);
16409 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16415 if eval $compile; then
16416 if $run ./try; then
16417 d_localtime_r_needs_tzset=undef;
16419 d_localtime_r_needs_tzset=define;
16422 d_localtime_r_needs_tzset=undef;
16426 d_localtime_r_needs_tzset=undef;
16431 : see if lockf exists
16435 : see if log1p exists
16439 : see if log2 exists
16443 : see if logb exists
16447 : see if lrint exists
16451 : see if lrintl exists
16452 set lrintl d_lrintl
16455 : see if lround exists
16456 set lround d_lround
16459 : see if lroundl exists
16460 set lroundl d_lroundl
16463 : see if prototype for lseek is available
16465 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16468 : see if lstat exists
16472 : see if madvise exists
16473 set madvise d_madvise
16476 : see if malloc_size exists
16477 set malloc_size d_malloc_size
16480 : see if malloc_size_good exists
16481 set malloc_good_size d_malloc_good_size
16484 : see if mblen exists
16488 : see if mbstowcs exists
16489 set mbstowcs d_mbstowcs
16492 : see if mbtowc exists
16493 set mbtowc d_mbtowc
16496 : see if memchr exists
16497 set memchr d_memchr
16500 : see if memcmp exists
16501 set memcmp d_memcmp
16504 : see if memcpy exists
16505 set memcpy d_memcpy
16508 : see if memmem exists
16509 set memmem d_memmem
16512 : see if memmove exists
16513 set memmove d_memmove
16516 : see if memrchr exists
16517 set memrchr d_memrchr
16520 : see if memset exists
16521 set memset d_memset
16524 : see if mkdir exists
16528 : see if mkdtemp exists
16529 set mkdtemp d_mkdtemp
16532 : see if mkfifo exists
16533 set mkfifo d_mkfifo
16536 : see if mkstemp exists
16537 set mkstemp d_mkstemp
16540 : see if mkstemps exists
16541 set mkstemps d_mkstemps
16544 : see if mktime exists
16545 set mktime d_mktime
16548 : see if this is a sys/mman.h system
16549 set sys/mman.h i_sysmman
16552 : see if mmap exists
16555 : see what shmat returns
16556 : default to something harmless
16558 case "$i_sysmman$d_mmap" in
16560 $cat >mmap.c <<'END'
16561 #include <sys/mman.h>
16564 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16569 echo "and it returns ($mmaptype)." >&4
16575 : see if sqrtl exists
16579 : see if scalbnl exists
16580 set scalbnl d_scalbnl
16583 : see if truncl exists
16584 set truncl d_truncl
16587 : see if modfl exists
16591 : see if prototype for modfl is available
16593 set d_modflproto modfl $i_math math.h
16596 if $test "$uselongdouble" = "$define"; then
16598 if $test "$d_sqrtl" != "$define"; then
16599 message="$message sqrtl"
16601 if $test "$d_modfl" != "$define"; then
16602 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16603 echo "You have both truncl and copysignl, so I can emulate modfl."
16605 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16606 echo "You have both aintl and copysignl, so I can emulate modfl."
16608 message="$message modfl"
16612 if $test "$d_frexpl" != "$define"; then
16613 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16614 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16616 message="$message frexpl"
16619 if $test "$d_ldexpl" != "$define"; then
16620 message="$message ldexpl"
16623 if $test "$message" != ""; then
16626 *** You requested the use of long doubles but you do not seem to have
16627 *** the following mathematical functions needed for long double support:
16629 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16630 *** Cannot continue, aborting.
16638 : see if mprotect exists
16639 set mprotect d_mprotect
16642 : see if msgctl exists
16643 set msgctl d_msgctl
16646 : see if msgget exists
16647 set msgget d_msgget
16650 : see if msgsnd exists
16651 set msgsnd d_msgsnd
16654 : see if msgrcv exists
16655 set msgrcv d_msgrcv
16658 : see how much of the 'msg*(2)' library is present.
16661 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16662 *"$undef"*) h_msg=false;;
16666 case "`ipcs 2>&1`" in
16667 "SVID messages"*"not configured"*)
16668 echo "Your $osname does not have the msg*(2) configured." >&4
16671 set msgctl d_msgctl
16673 set msgget d_msgget
16675 set msgsnd d_msgsnd
16677 set msgrcv d_msgrcv
16683 : we could also check for sys/ipc.h ...
16684 if $h_msg && $test `./findhdr sys/msg.h`; then
16685 echo "You have the full msg*(2) library." >&4
16688 echo "You don't have the full msg*(2) library." >&4
16694 : Check for msghdr_s
16696 echo "Checking to see if your system supports struct msghdr..." >&4
16697 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16699 case "$d_msghdr_s" in
16700 "$define") echo "Yes, it does." ;;
16701 *) echo "No, it doesn't." ;;
16705 : see if msync exists
16709 : see if munmap exists
16710 set munmap d_munmap
16713 : see if nan exists
16717 : see if nearbyint exists
16718 set nearbyint d_nearbyint
16721 : see if nextafter exists
16722 set nextafter d_nextafter
16725 : see if nexttoward exists
16726 set nexttoward d_nexttoward
16729 : see if nice exists
16733 : see if this is a langinfo.h system
16734 set langinfo.h i_langinfo
16737 : see if nl_langinfo exists
16738 set nl_langinfo d_nl_langinfo
16741 : see if this is a quadmath.h system
16742 set quadmath.h i_quadmath
16745 : check for volatile keyword
16747 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16748 $cat >try.c <<'EOCP'
16751 typedef struct _goo_struct goo_struct;
16752 goo_struct * volatile goo = ((goo_struct *)0);
16753 struct _goo_struct {
16758 typedef unsigned short foo_t;
16759 char *volatile foo;
16761 volatile foo_t blech;
16765 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16767 echo "Yup, it does."
16770 echo "Nope, it doesn't."
16776 : Check basic sizes
16778 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16780 case "$use64bitint:$d_quad:$quadtype" in
16783 uvtype="$uquadtype"
16788 uvtype="unsigned long"
16794 case "$uselongdouble:$d_longdbl" in
16796 nvtype="long double"
16797 nvsize=$longdblsize
16804 case "$usequadmath:$i_quadmath" in
16806 nvtype="__float128"
16812 *** You requested the use of the quadmath library, but you
16813 *** do not seem to have the quadmath library installed.
16814 *** Cannot continue, aborting.
16820 define:*) $cat <<EOM >&4
16822 *** You requested the use of the quadmath library, but you
16823 *** do not seem to have the required header, <quadmath.h>.
16825 case "$gccversion" in
16828 *** Your gcc looks a bit old:
16834 *** You are not running a gcc.
16839 *** For the quadmath library you need at least gcc 4.6.
16840 *** Cannot continue, aborting.
16846 $echo "(IV will be "$ivtype", $ivsize bytes)"
16847 $echo "(UV will be "$uvtype", $uvsize bytes)"
16848 $echo "(NV will be "$nvtype", $nvsize bytes)"
16851 #$i_inttypes I_INTTYPES
16853 #include <inttypes.h>
16858 int8_t i = INT8_MAX;
16859 uint8_t u = UINT8_MAX;
16860 printf("int8_t\n");
16863 int16_t i = INT16_MAX;
16864 uint16_t u = UINT16_MAX;
16865 printf("int16_t\n");
16868 int32_t i = INT32_MAX;
16869 uint32_t u = UINT32_MAX;
16870 printf("int32_t\n");
16875 i8type="signed char"
16876 u8type="unsigned char"
16881 '') case "$shortsize" in
16883 u16type="unsigned short"
16891 '') set try -DINT16
16892 if eval $compile; then
16893 case "`$run ./try`" in
16905 '') if $test $shortsize -ge 2; then
16907 u16type="unsigned short"
16915 '') case "$longsize" in
16917 u32type="unsigned long"
16921 *) case "$intsize" in
16923 u32type="unsigned int"
16933 '') set try -DINT32
16934 if eval $compile; then
16935 case "`$run ./try`" in
16947 '') if $test $intsize -ge 4; then
16949 u32type="unsigned int"
16957 '') case "$d_quad:$quadtype" in
16959 i64type="$quadtype"
16960 u64type="$uquadtype"
16968 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16969 : volatile so that the compiler has to store it out to memory.
16970 if test X"$d_volatile" = X"$define"; then
16975 #$i_stdlib I_STDLIB
16977 #include <stdlib.h>
16979 #include <sys/types.h>
16980 #include <signal.h>
16982 $volatile int bletched = 0;
16983 $signal_t blech(int s) { bletched = 1; }
16988 int n = 8 * $uvsize;
16991 signal(SIGFPE, blech);
16994 for (i = 0; i < n; i++) {
16995 u = u << 1 | ($uvtype)1;
16997 if (($uvtype)d != u)
17001 d = ($nvtype)(u - 1);
17002 if (($uvtype)d != (u - 1))
17009 printf("%d\n", ((i == n) ? -n : i));
17015 d_nv_preserves_uv="$undef"
17016 if eval $compile; then
17017 nv_preserves_uv_bits="`$run ./try`"
17019 case "$nv_preserves_uv_bits" in
17021 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
17022 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
17023 d_nv_preserves_uv="$define"
17025 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
17026 d_nv_preserves_uv="$undef" ;;
17027 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
17028 nv_preserves_uv_bits="0" ;;
17032 $echo "Checking to find the largest integer value your NVs can hold..." >&4
17033 : volatile so that the compiler has to store it out to memory.
17034 if test X"$d_volatile" = X"$define"; then
17040 typedef $nvtype NV;
17047 while(count < 256) {
17048 $volatile NV up = value + 1.0;
17049 $volatile NV negated = -value;
17050 $volatile NV down = negated - 1.0;
17051 $volatile NV got_up = up - value;
17052 int up_good = got_up == 1.0;
17053 int got_down = down - negated;
17054 int down_good = got_down == -1.0;
17056 if (down_good != up_good) {
17058 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
17059 up_good, (double) got_up, down_good, (double) got_down,
17060 count, (double) value);
17067 fputs("256.0", stdout);
17070 fputs("2.0", stdout);
17076 fputs("*", stdout);
17082 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17083 count, (double) value);
17089 nv_overflows_integers_at='0'
17090 if eval $compile; then
17096 The largest integer your NVs can preserve is equal to $xxx
17098 nv_overflows_integers_at="$xxx"
17101 Cannot determine the largest integer value your NVs can hold, unexpected output
17108 Cannot determine the largest integer value your NVs can hold
17115 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17116 : volatile so that the compiler has to store it out to memory.
17117 if test X"$d_volatile" = X"$define"; then
17122 #$i_stdlib I_STDLIB
17124 #include <stdlib.h>
17126 #$i_string I_STRING
17128 # include <string.h>
17130 # include <strings.h>
17132 #include <sys/types.h>
17133 #include <signal.h>
17135 $volatile int bletched = 0;
17136 $signal_t blech(int s) { bletched = 1; }
17139 int checkit($nvtype d, const char *where) {
17141 unsigned char *p = (unsigned char *)v;
17142 unsigned char *end = p + sizeof(d);
17151 p = (unsigned char *)v;
17152 printf("No - %s: 0x", where);
17154 printf ("%02X", *p++);
17159 int main(int argc, char **argv) {
17162 fail += checkit(d, "0.0");
17164 /* The compiler shouldn't be assuming that bletched is 0 */
17167 fail += checkit(d, "bleched");
17170 signal(SIGFPE, blech);
17173 /* Paranoia - the compiler should have no way of knowing that ANSI says
17174 that argv[argc] will always be NULL. Actually, if it did assume this it
17175 would be buggy, as this is C and main() can be called from elsewhere in
17177 d = argv[argc] ? 1 : 0;
17180 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17183 fail += checkit(d, "ternary");
17185 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17188 printf("No - memset doesn't give 0.0\n");
17189 /* This might just blow up: */
17190 printf("(gives %g)\n", d);
17196 printf("No - something bleched\n");
17201 printf("No - %d fail(s)\n", fail);
17210 d_nv_zero_is_allbits_zero="$undef"
17211 if eval $compile; then
17217 0.0 is represented as all bits zero in memory
17219 d_nv_zero_is_allbits_zero="$define"
17222 0.0 is not represented as all bits zero in memory
17224 d_nv_zero_is_allbits_zero="$undef"
17229 0.0 is not represented as all bits zero in memory
17231 d_nv_zero_is_allbits_zero="$undef"
17237 : check for off64_t
17239 echo "Checking to see if you have off64_t..." >&4
17241 #include <sys/types.h>
17242 #include <unistd.h>
17243 int main() { off64_t x = 7; }
17246 if eval $compile; then
17248 echo "You have off64_t."
17251 echo "You do not have off64_t."
17252 case "$lseeksize" in
17253 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17260 : how to create joinable pthreads
17261 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17263 echo "Checking what constant to use for creating joinable pthreads..." >&4
17264 $cat >try.c <<'EOCP'
17265 #include <pthread.h>
17267 int detachstate = JOINABLE;
17270 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17271 if eval $compile; then
17272 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17273 val="$undef" # Yes, undef.
17274 set d_old_pthread_create_joinable
17277 set old_pthread_create_joinable
17280 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17281 if eval $compile; then
17282 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17284 set d_old_pthread_create_joinable
17286 val=PTHREAD_CREATE_UNDETACHED
17287 set old_pthread_create_joinable
17290 set try -DJOINABLE=__UNDETACHED
17291 if eval $compile; then
17292 echo "You seem to use __UNDETACHED." >&4
17294 set d_old_pthread_create_joinable
17297 set old_pthread_create_joinable
17300 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17302 set d_old_pthread_create_joinable
17305 set old_pthread_create_joinable
17312 d_old_pthread_create_joinable="$undef"
17313 old_pthread_create_joinable=""
17316 : see if pause exists
17320 : see if poll exists
17324 : see if prctl exists
17328 : see if prctl supports PR_SET_NAME
17329 d_prctl_set_name=$undef
17334 #include <unistd.h>
17336 #include <sys/prctl.h>
17338 int main (int argc, char *argv[])
17340 return (prctl (PR_SET_NAME, "Test"));
17344 if eval $compile_ok && $run ./try; then
17345 echo "Your prctl (PR_SET_NAME, ...) works"
17346 d_prctl_set_name=$define
17352 : see if readlink exists
17353 set readlink d_readlink
17356 : Check if there is a /proc symlink to the abs path of
17357 : the executing program. We will honor hints of d_procselfexe=$undef
17358 : or procselfexe being non-empty, otherwise will try to determine both
17359 : if we have readlink.
17360 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17361 : referenced, and AmigaOS does not have a proc filesystem anyway.
17364 if $test "X$d_procselfexe" = Xundef; then
17366 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17368 elif $test "X$d_readlink" = Xdefine; then
17369 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17370 : and it feels more tidy to avoid an extra level of symlink
17371 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17372 while test $# -gt 0; do
17375 if $issymlink $try; then
17376 $ls -l $try > reflect
17377 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17378 echo "You have $type-like $try."
17379 procselfexe='"'$try'"'
17381 : This will break out of the loop
17391 : backward compatibility for d_hvfork
17392 if test X$d_hvfork != X; then
17393 d_vfork="$d_hvfork"
17396 : see if there is a vfork
17401 d_pseudofork=$undef
17403 : Ok, but do we want to use it. vfork is reportedly unreliable in
17404 : perl on Solaris 2.x, and probably elsewhere.
17408 case "$usevfork" in
17414 Perl can only use a vfork() that doesn't suffer from strict
17415 restrictions on calling functions or modifying global data in
17416 the child. For example, glibc-2.1 contains such a vfork()
17417 that is unsuitable. If your system provides a proper fork()
17418 call, chances are that you do NOT want perl to use vfork().
17421 rp="Do you still want to use vfork()?"
17426 echo "Ok, we won't use vfork()."
17435 $define) usevfork='true';;
17436 *) usevfork='false';;
17439 : see whether the pthread_atfork exists
17441 #include <pthread.h>
17444 #ifdef PTHREAD_ATFORK
17445 pthread_atfork(NULL,NULL,NULL);
17450 : see if pthread_atfork exists
17451 set try -DPTHREAD_ATFORK
17452 if eval $compile; then
17457 case "$usethreads" in
17460 $define) echo 'pthread_atfork found.' >&4 ;;
17461 *) echo 'pthread_atfork NOT found.' >&4 ;;
17464 set d_pthread_atfork
17467 : see if pthread_attr_setscope exists
17468 set pthread_attr_setscope d_pthread_attr_setscope
17471 : see whether the various POSIXish _yields exist
17473 #include <pthread.h>
17479 #ifdef PTHREAD_YIELD
17482 #ifdef PTHREAD_YIELD_NULL
17483 pthread_yield(NULL);
17489 : see if sched_yield exists
17490 set try -DSCHED_YIELD
17491 if eval $compile; then
17493 sched_yield='sched_yield()'
17497 case "$usethreads" in
17500 $define) echo 'sched_yield() found.' >&4 ;;
17501 *) echo 'sched_yield() NOT found.' >&4 ;;
17507 : see if pthread_yield exists
17508 set try -DPTHREAD_YIELD
17509 if eval $compile; then
17511 case "$sched_yield" in
17512 '') sched_yield='pthread_yield()' ;;
17515 set try -DPTHREAD_YIELD_NULL
17516 if eval $compile; then
17518 case "$sched_yield" in
17519 '') sched_yield='pthread_yield(NULL)' ;;
17525 case "$usethreads" in
17528 $define) echo 'pthread_yield() found.' >&4 ;;
17529 *) echo 'pthread_yield() NOT found.' >&4 ;;
17533 set d_pthread_yield
17535 case "$sched_yield" in
17536 '') sched_yield=undef ;;
17540 : check for ptrdiff_t
17542 echo "Checking to see if you have ptrdiff_t..." >&4
17544 #include <stddef.h>
17545 int main() { ptrdiff_t x = 7; }
17548 if eval $compile; then
17550 echo "You have ptrdiff_t."
17553 echo "You do not have ptrdiff_t."
17559 : see if random_r exists
17560 set random_r d_random_r
17562 case "$d_random_r" in
17564 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17565 case "$d_random_r_proto:$usethreads" in
17566 ":define") d_random_r_proto=define
17567 set d_random_r_proto random_r $hdrs
17571 case "$d_random_r_proto" in
17573 case "$random_r_proto" in
17574 ''|0) try='int random_r(int*, struct random_data*);'
17575 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17577 case "$random_r_proto" in
17578 ''|0) try='int random_r(long*, struct random_data*);'
17579 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17581 case "$random_r_proto" in
17582 ''|0) try='int random_r(struct random_data*, int32_t*);'
17583 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17585 case "$random_r_proto" in
17586 ''|0) d_random_r=undef
17588 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17589 * ) case "$random_r_proto" in
17590 REENTRANT_PROTO*) ;;
17591 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17593 echo "Prototype: $try" ;;
17596 *) case "$usethreads" in
17597 define) echo "random_r has no prototype, not using it." >&4 ;;
17604 *) random_r_proto=0
17608 : see if readdir and friends exist
17609 set readdir d_readdir
17611 set seekdir d_seekdir
17613 set telldir d_telldir
17615 set rewinddir d_rewinddir
17618 : see if readdir64_r exists
17619 set readdir64_r d_readdir64_r
17621 case "$d_readdir64_r" in
17623 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17624 case "$d_readdir64_r_proto:$usethreads" in
17625 ":define") d_readdir64_r_proto=define
17626 set d_readdir64_r_proto readdir64_r $hdrs
17630 case "$d_readdir64_r_proto" in
17632 case "$readdir64_r_proto" in
17633 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17634 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17636 case "$readdir64_r_proto" in
17637 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17638 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17640 case "$readdir64_r_proto" in
17641 ''|0) d_readdir64_r=undef
17642 readdir64_r_proto=0
17643 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17644 * ) case "$readdir64_r_proto" in
17645 REENTRANT_PROTO*) ;;
17646 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17648 echo "Prototype: $try" ;;
17651 *) case "$usethreads" in
17652 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17654 d_readdir64_r=undef
17655 readdir64_r_proto=0
17659 *) readdir64_r_proto=0
17663 : see if readdir_r exists
17664 set readdir_r d_readdir_r
17666 case "$d_readdir_r" in
17668 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17669 case "$d_readdir_r_proto:$usethreads" in
17670 ":define") d_readdir_r_proto=define
17671 set d_readdir_r_proto readdir_r $hdrs
17675 case "$d_readdir_r_proto" in
17677 case "$readdir_r_proto" in
17678 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17679 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17681 case "$readdir_r_proto" in
17682 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17683 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17685 case "$readdir_r_proto" in
17686 ''|0) d_readdir_r=undef
17688 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17689 * ) case "$readdir_r_proto" in
17690 REENTRANT_PROTO*) ;;
17691 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17693 echo "Prototype: $try" ;;
17696 *) case "$usethreads" in
17697 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17704 *) readdir_r_proto=0
17708 : see if readv exists
17712 : see if recvmsg exists
17713 set recvmsg d_recvmsg
17716 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17718 if set regcomp val -f d_regcomp; eval $csym; $val; then
17719 echo 'regcomp() found.' >&4
17720 d_regcomp="$define"
17723 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17724 echo 'regcmp() found.' >&4
17728 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17729 echo 're_comp() found, assuming re_exec() also exists.' >&4
17730 d_re_comp="$define"
17735 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17742 : see if remainder exists
17743 set remainder d_remainder
17746 : see if remquo exists
17747 set remquo d_remquo
17750 : see if rename exists
17751 set rename d_rename
17754 : see if rint exists
17758 : see if rmdir exists
17762 : see if round exists
17766 : see if memory.h is available.
17771 : See if it conflicts with string.h
17777 $cppstdin $cppflags $cppminus < $strings > mem.h
17778 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17780 echo "We won't be including <memory.h>."
17790 : can bcopy handle overlapping blocks?
17793 case "$d_memmove" in
17794 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17795 *) case "$d_bcopy" in
17797 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17799 #$i_memory I_MEMORY
17800 #$i_stdlib I_STDLIB
17801 #$i_string I_STRING
17802 #$i_unistd I_UNISTD
17804 $cat >>try.c <<'EOCP'
17807 # include <memory.h>
17810 # include <stdlib.h>
17813 # include <string.h>
17815 # include <strings.h>
17818 # include <unistd.h> /* Needed for NetBSD */
17822 char buf[128], abc[128];
17828 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17829 try to store the string in read-only memory. */
17830 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17832 for (align = 7; align >= 0; align--) {
17833 for (len = 36; len; len--) {
17835 bcopy(abc, b, len);
17836 for (off = 1; off <= len; off++) {
17837 bcopy(b, b+off, len);
17838 bcopy(b+off, b, len);
17839 if (bcmp(b, abc, len))
17848 if eval $compile_ok; then
17849 if $run ./try 2>/dev/null; then
17850 echo "Yes, it can."
17853 echo "It can't, sorry."
17856 echo "(I can't compile the test program, so we'll assume not...)"
17866 : can memcpy handle overlapping blocks?
17869 case "$d_memmove" in
17870 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17871 *) case "$d_memcpy" in
17873 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17875 #$i_memory I_MEMORY
17876 #$i_stdlib I_STDLIB
17877 #$i_string I_STRING
17878 #$i_unistd I_UNISTD
17880 $cat >>try.c <<'EOCP'
17883 # include <memory.h>
17886 # include <stdlib.h>
17889 # include <string.h>
17891 # include <strings.h>
17894 # include <unistd.h> /* Needed for NetBSD */
17898 char buf[128], abc[128];
17904 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17905 try to store the string in read-only memory. */
17906 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17908 for (align = 7; align >= 0; align--) {
17909 for (len = 36; len; len--) {
17911 memcpy(b, abc, len);
17912 for (off = 1; off <= len; off++) {
17913 memcpy(b+off, b, len);
17914 memcpy(b, b+off, len);
17915 if (memcmp(b, abc, len))
17924 if eval $compile_ok; then
17925 if $run ./try 2>/dev/null; then
17926 echo "Yes, it can."
17929 echo "It can't, sorry."
17932 echo "(I can't compile the test program, so we'll assume not...)"
17942 : can memcmp be trusted to compare relative magnitude?
17944 case "$d_memcmp" in
17947 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17949 #$i_memory I_MEMORY
17950 #$i_stdlib I_STDLIB
17951 #$i_string I_STRING
17952 #$i_unistd I_UNISTD
17954 $cat >>try.c <<'EOCP'
17957 # include <memory.h>
17960 # include <stdlib.h>
17963 # include <string.h>
17965 # include <strings.h>
17968 # include <unistd.h> /* Needed for NetBSD */
17974 if ((a < b) && memcmp(&a, &b, 1) < 0)
17980 if eval $compile_ok; then
17981 if $run ./try 2>/dev/null; then
17982 echo "Yes, it can."
17985 echo "No, it can't (it uses signed chars)."
17988 echo "(I can't compile the test program, so we'll assume not...)"
17996 : see if prototype for sbrk is available
17998 set d_sbrkproto sbrk $i_unistd unistd.h
18001 : see if scalbn exists
18002 set scalbn d_scalbn
18005 : see if select exists
18006 set select d_select
18009 : see if semctl exists
18010 set semctl d_semctl
18013 : see if semget exists
18014 set semget d_semget
18017 : see if semop exists
18021 : see how much of the 'sem*(2)' library is present.
18024 case "$d_semctl$d_semget$d_semop" in
18025 *"$undef"*) h_sem=false;;
18029 case "`ipcs 2>&1`" in
18030 "SVID messages"*"not configured"*)
18031 echo "Your $osname does not have the sem*(2) configured." >&4
18034 set semctl d_semctl
18036 set semget d_semget
18044 : we could also check for sys/ipc.h ...
18045 if $h_sem && $test `./findhdr sys/sem.h`; then
18046 echo "You have the full sem*(2) library." >&4
18049 echo "You don't have the full sem*(2) library." >&4
18055 : see whether sys/sem.h defines union semun
18057 $cat > try.c <<'END'
18058 #include <sys/types.h>
18059 #include <sys/ipc.h>
18060 #include <sys/sem.h>
18061 int main () { union semun semun; semun.buf = 0; }
18064 if eval $compile; then
18065 echo "You have union semun in <sys/sem.h>." >&4
18068 echo "You do not have union semun in <sys/sem.h>." >&4
18075 : see how to do semctl IPC_STAT
18079 $cat > tryh.h <<END
18082 # define S_IRUSR S_IREAD
18083 # define S_IWUSR S_IWRITE
18084 # define S_IXUSR S_IEXEC
18086 # define S_IRUSR 0400
18087 # define S_IWUSR 0200
18088 # define S_IXUSR 0100
18090 # define S_IRGRP (S_IRUSR>>3)
18091 # define S_IWGRP (S_IWUSR>>3)
18092 # define S_IXGRP (S_IXUSR>>3)
18093 # define S_IROTH (S_IRUSR>>6)
18094 # define S_IWOTH (S_IWUSR>>6)
18095 # define S_IXOTH (S_IXUSR>>6)
18098 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
18099 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18100 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18103 : see whether semctl IPC_STAT can use union semun
18104 case "$d_semctl_semun" in
18108 #include <sys/types.h>
18109 #include <sys/ipc.h>
18110 #include <sys/sem.h>
18111 #include <sys/stat.h>
18118 #$d_union_semun HAS_UNION_SEMUN
18121 #ifndef HAS_UNION_SEMUN
18124 struct semid_ds *buf;
18125 unsigned short *array;
18131 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18132 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18134 struct semid_ds argbuf;
18137 st = semctl(sem, 0, IPC_STAT, arg);
18141 # endif /* IPC_STAT */
18142 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18144 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18145 # endif /* IPC_RMID */
18146 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18148 #endif /* IPC_PRIVATE && ... */
18149 printf("semget failed: errno = %d\n", errno);
18154 if eval $compile; then
18157 semun) val="$define" ;;
18165 case "$d_semctl_semun" in
18167 echo "You can use union semun for semctl IPC_STAT." >&4
18170 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18175 : see whether semctl IPC_STAT can use struct semid_ds pointer
18176 case "$d_semctl_semid_ds" in
18179 $cat > try.c <<'END'
18180 #include <sys/types.h>
18181 #include <sys/ipc.h>
18182 #include <sys/sem.h>
18183 #include <sys/stat.h>
18191 struct semid_ds arg;
18194 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18195 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18198 st = semctl(sem, 0, IPC_STAT, &arg);
18200 printf("semid_ds\n");
18202 # endif /* IPC_STAT */
18203 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18205 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18206 # endif /* IPC_RMID */
18207 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18209 #endif /* IPC_PRIVATE && ... */
18210 printf("semget failed: errno = %d\n", errno);
18216 if eval $compile; then
18219 semid_ds) val="$define" ;;
18223 set d_semctl_semid_ds
18227 case "$d_semctl_semid_ds" in
18229 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18231 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18237 # We do not have the full sem*(2) library, so assume we can not
18243 set d_semctl_semid_ds
18249 : see if sendmsg exists
18250 set sendmsg d_sendmsg
18253 : see if setegid exists
18254 set setegid d_setegid
18257 : see if seteuid exists
18258 set seteuid d_seteuid
18261 : see if setgrent exists
18262 set setgrent d_setgrent
18265 : see if setgrent_r exists
18266 set setgrent_r d_setgrent_r
18268 case "$d_setgrent_r" in
18270 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18271 case "$d_setgrent_r_proto:$usethreads" in
18272 ":define") d_setgrent_r_proto=define
18273 set d_setgrent_r_proto setgrent_r $hdrs
18277 case "$d_setgrent_r_proto" in
18279 case "$setgrent_r_proto" in
18280 ''|0) try='int setgrent_r(FILE**);'
18281 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18283 case "$setgrent_r_proto" in
18284 ''|0) try='void setgrent_r(FILE**);'
18285 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18287 case "$setgrent_r_proto" in
18288 ''|0) d_setgrent_r=undef
18290 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18291 * ) case "$setgrent_r_proto" in
18292 REENTRANT_PROTO*) ;;
18293 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18295 echo "Prototype: $try" ;;
18298 *) case "$usethreads" in
18299 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18306 *) setgrent_r_proto=0
18310 : see if sethostent exists
18311 set sethostent d_sethent
18314 : see if sethostent_r exists
18315 set sethostent_r d_sethostent_r
18317 case "$d_sethostent_r" in
18319 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18320 case "$d_sethostent_r_proto:$usethreads" in
18321 ":define") d_sethostent_r_proto=define
18322 set d_sethostent_r_proto sethostent_r $hdrs
18326 case "$d_sethostent_r_proto" in
18328 case "$sethostent_r_proto" in
18329 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18330 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18332 case "$sethostent_r_proto" in
18333 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18334 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18336 case "$sethostent_r_proto" in
18337 ''|0) d_sethostent_r=undef
18338 sethostent_r_proto=0
18339 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18340 * ) case "$sethostent_r_proto" in
18341 REENTRANT_PROTO*) ;;
18342 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18344 echo "Prototype: $try" ;;
18347 *) case "$usethreads" in
18348 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18350 d_sethostent_r=undef
18351 sethostent_r_proto=0
18355 *) sethostent_r_proto=0
18359 : see if setitimer exists
18360 set setitimer d_setitimer
18363 : see if setlinebuf exists
18364 set setlinebuf d_setlinebuf
18367 : see if setlocale exists
18368 set setlocale d_setlocale
18371 : see if locale.h is available
18372 set locale.h i_locale
18375 : see if setlocale_r exists
18376 set setlocale_r d_setlocale_r
18378 case "$d_setlocale_r" in
18380 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18381 case "$d_setlocale_r_proto:$usethreads" in
18382 ":define") d_setlocale_r_proto=define
18383 set d_setlocale_r_proto setlocale_r $hdrs
18387 case "$d_setlocale_r_proto" in
18389 case "$setlocale_r_proto" in
18390 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18391 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18393 case "$setlocale_r_proto" in
18394 ''|0) d_setlocale_r=undef
18395 setlocale_r_proto=0
18396 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18397 * ) case "$setlocale_r_proto" in
18398 REENTRANT_PROTO*) ;;
18399 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18401 echo "Prototype: $try" ;;
18404 *) case "$usethreads" in
18405 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18407 d_setlocale_r=undef
18408 setlocale_r_proto=0
18412 *) setlocale_r_proto=0
18416 : see if setnetent exists
18417 set setnetent d_setnent
18420 : see if setnetent_r exists
18421 set setnetent_r d_setnetent_r
18423 case "$d_setnetent_r" in
18425 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18426 case "$d_setnetent_r_proto:$usethreads" in
18427 ":define") d_setnetent_r_proto=define
18428 set d_setnetent_r_proto setnetent_r $hdrs
18432 case "$d_setnetent_r_proto" in
18434 case "$setnetent_r_proto" in
18435 ''|0) try='int setnetent_r(int, struct netent_data*);'
18436 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18438 case "$setnetent_r_proto" in
18439 ''|0) try='void setnetent_r(int, struct netent_data*);'
18440 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18442 case "$setnetent_r_proto" in
18443 ''|0) d_setnetent_r=undef
18444 setnetent_r_proto=0
18445 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18446 * ) case "$setnetent_r_proto" in
18447 REENTRANT_PROTO*) ;;
18448 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18450 echo "Prototype: $try" ;;
18453 *) case "$usethreads" in
18454 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18456 d_setnetent_r=undef
18457 setnetent_r_proto=0
18461 *) setnetent_r_proto=0
18465 : see if setprotoent exists
18466 set setprotoent d_setpent
18469 : see if setpgid exists
18470 set setpgid d_setpgid
18473 : see if setpgrp2 exists
18474 set setpgrp2 d_setpgrp2
18477 : see if setpriority exists
18478 set setpriority d_setprior
18481 : see if setproctitle exists
18482 set setproctitle d_setproctitle
18485 : see if setprotoent_r exists
18486 set setprotoent_r d_setprotoent_r
18488 case "$d_setprotoent_r" in
18490 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18491 case "$d_setprotoent_r_proto:$usethreads" in
18492 ":define") d_setprotoent_r_proto=define
18493 set d_setprotoent_r_proto setprotoent_r $hdrs
18497 case "$d_setprotoent_r_proto" in
18499 case "$setprotoent_r_proto" in
18500 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18501 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18503 case "$setprotoent_r_proto" in
18504 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18505 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18507 case "$setprotoent_r_proto" in
18508 ''|0) d_setprotoent_r=undef
18509 setprotoent_r_proto=0
18510 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18511 * ) case "$setprotoent_r_proto" in
18512 REENTRANT_PROTO*) ;;
18513 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18515 echo "Prototype: $try" ;;
18518 *) case "$usethreads" in
18519 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18521 d_setprotoent_r=undef
18522 setprotoent_r_proto=0
18526 *) setprotoent_r_proto=0
18530 : see if setpwent exists
18531 set setpwent d_setpwent
18534 : see if setpwent_r exists
18535 set setpwent_r d_setpwent_r
18537 case "$d_setpwent_r" in
18539 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18540 case "$d_setpwent_r_proto:$usethreads" in
18541 ":define") d_setpwent_r_proto=define
18542 set d_setpwent_r_proto setpwent_r $hdrs
18546 case "$d_setpwent_r_proto" in
18548 case "$setpwent_r_proto" in
18549 ''|0) try='int setpwent_r(FILE**);'
18550 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18552 case "$setpwent_r_proto" in
18553 ''|0) try='void setpwent_r(FILE**);'
18554 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18556 case "$setpwent_r_proto" in
18557 ''|0) d_setpwent_r=undef
18559 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18560 * ) case "$setpwent_r_proto" in
18561 REENTRANT_PROTO*) ;;
18562 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18564 echo "Prototype: $try" ;;
18567 *) case "$usethreads" in
18568 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18575 *) setpwent_r_proto=0
18579 : see if setregid exists
18580 set setregid d_setregid
18582 set setresgid d_setresgid
18585 : see if setreuid exists
18586 set setreuid d_setreuid
18588 set setresuid d_setresuid
18591 : see if setrgid exists
18592 set setrgid d_setrgid
18595 : see if setruid exists
18596 set setruid d_setruid
18599 : see if setservent exists
18600 set setservent d_setsent
18603 : see if setservent_r exists
18604 set setservent_r d_setservent_r
18606 case "$d_setservent_r" in
18608 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18609 case "$d_setservent_r_proto:$usethreads" in
18610 ":define") d_setservent_r_proto=define
18611 set d_setservent_r_proto setservent_r $hdrs
18615 case "$d_setservent_r_proto" in
18617 case "$setservent_r_proto" in
18618 ''|0) try='int setservent_r(int, struct servent_data*);'
18619 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18621 case "$setservent_r_proto" in
18622 ''|0) try='void setservent_r(int, struct servent_data*);'
18623 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18625 case "$setservent_r_proto" in
18626 ''|0) d_setservent_r=undef
18627 setservent_r_proto=0
18628 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18629 * ) case "$setservent_r_proto" in
18630 REENTRANT_PROTO*) ;;
18631 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18633 echo "Prototype: $try" ;;
18636 *) case "$usethreads" in
18637 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18639 d_setservent_r=undef
18640 setservent_r_proto=0
18644 *) setservent_r_proto=0
18648 : see if setsid exists
18649 set setsid d_setsid
18652 : see if setvbuf exists
18653 set setvbuf d_setvbuf
18656 : see if shmctl exists
18657 set shmctl d_shmctl
18660 : see if shmget exists
18661 set shmget d_shmget
18664 : see if shmat exists
18667 : see what shmat returns
18670 $cat >shmat.c <<'END'
18671 #include <sys/shm.h>
18674 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18679 echo "and it returns ($shmattype)." >&4
18680 : see if a prototype for shmat is available
18681 xxx=`./findhdr sys/shm.h`
18682 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18683 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18694 set d_shmatprototype
18697 : see if shmdt exists
18701 : see how much of the 'shm*(2)' library is present.
18704 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18705 *"$undef"*) h_shm=false;;
18709 case "`ipcs 2>&1`" in
18710 "SVID shared memory"*"not configured"*)
18711 echo "Your $osname does not have the shm*(2) configured." >&4
18714 set shmctl d_shmctl
18716 set shmget d_shmget
18726 : we could also check for sys/ipc.h ...
18727 if $h_shm && $test `./findhdr sys/shm.h`; then
18728 echo "You have the full shm*(2) library." >&4
18731 echo "You don't have the full shm*(2) library." >&4
18737 : see if we have sigaction
18739 if set sigaction val -f d_sigaction; eval $csym; $val; then
18740 echo 'sigaction() found.' >&4
18743 #include <sys/types.h>
18744 #include <signal.h>
18745 #$i_stdlib I_STDLIB
18747 #include <stdlib.h>
18751 struct sigaction act, oact;
18753 oact.sa_handler = 0;
18754 /* so that act and oact are used */
18755 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18759 if eval $compile_ok; then
18762 echo "But you don't seem to have a usable struct sigaction." >&4
18766 echo 'sigaction NOT found.' >&4
18769 set d_sigaction; eval $setvar
18772 : see what type pids are declared as in the kernel
18773 rp="What is the type of process ids on this system?"
18774 set pid_t pidtype int stdio.h sys/types.h
18777 : see what type uids are declared as in the kernel
18779 echo "Looking for the type for user ids returned by getuid()."
18780 set uid_t uidtype xxx stdio.h sys/types.h
18784 xxx=`./findhdr sys/user.h`
18785 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18787 unsigned) dflt="$1 $2" ;;
18791 *) dflt="$uidtype";;
18794 uid_t) echo "uid_t found." ;;
18795 *) rp="What is the type for user ids returned by getuid()?"
18801 : Define hasfield_t macro for Configure internal use
18802 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18803 while $test $# -ge 2; do
18805 $define) echo "#include <$2>";;
18809 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18811 if eval $compile; then
18820 : see what siginfo fields we have
18821 case "$d_sigaction" in
18823 echo "Checking if your siginfo_t has si_errno field...">&4
18824 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18827 echo "Checking if your siginfo_t has si_pid field...">&4
18828 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18831 echo "Checking if your siginfo_t has si_uid field...">&4
18832 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18835 echo "Checking if your siginfo_t has si_addr field...">&4
18836 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18839 echo "Checking if your siginfo_t has si_status field...">&4
18840 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18843 echo "Checking if your siginfo_t has si_band field...">&4
18844 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18847 echo "Checking if your siginfo_t has si_value field...">&4
18848 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18851 echo "Checking if your siginfo_t has si_fd field...">&4
18852 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18857 d_siginfo_si_errno="$undef"
18858 d_siginfo_si_pid="$undef"
18859 d_siginfo_si_uid="$undef"
18860 d_siginfo_si_addr="$undef"
18861 d_siginfo_si_status="$undef"
18862 d_siginfo_si_band="$undef"
18863 d_siginfo_si_value="$undef"
18864 d_siginfo_si_fd="$undef"
18868 : see if this is a sunmath.h system
18869 set sunmath.h i_sunmath
18872 : see if signbit exists
18873 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18876 #$i_sunmath I_SUNMATH
18880 #ifdef I_SUNMATH /* Solaris special math library */
18881 # include <sunmath.h>
18884 int main(int argc, char **argv)
18888 if ((signbit(x) == 0) && (signbit(y) != 0))
18896 if eval $compile; then
18897 if $run ./try; then
18901 $echo "Signbit seems to be available, but doesn't work as I expected."
18902 $echo "I won't use it." >&4
18913 : see if sigprocmask exists
18914 set sigprocmask d_sigprocmask
18917 : see if sigsetjmp exists
18919 case "$d_sigsetjmp" in
18922 #include <setjmp.h>
18923 #$i_stdlib I_STDLIB
18925 #include <stdlib.h>
18931 if (sigsetjmp(env,1))
18934 siglongjmp(env, 1);
18939 if eval $compile; then
18940 if $run ./try >/dev/null 2>&1; then
18941 echo "POSIX sigsetjmp found." >&4
18945 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18951 echo "sigsetjmp not found." >&4
18955 *) val="$d_sigsetjmp"
18956 case "$d_sigsetjmp" in
18957 $define) echo "POSIX sigsetjmp found." >&4;;
18958 $undef) echo "sigsetjmp not found." >&4;;
18966 : see if snprintf exists
18967 set snprintf d_snprintf
18970 : see if vsnprintf exists
18971 set vsnprintf d_vsnprintf
18974 case "$d_snprintf-$d_vsnprintf" in
18977 Checking whether your snprintf() and vsnprintf() work okay...
18979 $cat >try.c <<'EOCP'
18980 /* v?snprintf testing logic courtesy of Russ Allbery.
18981 * According to C99:
18982 * - if the buffer is too short it still must be \0-terminated
18983 * - if the buffer is too short the potentially required length
18984 * must be returned and not -1
18985 * - if the buffer is NULL the potentially required length
18986 * must be returned and not -1 or core dump
18989 #include <stdarg.h>
18993 int test (char *format, ...)
18998 va_start (args, format);
18999 count = vsnprintf (buf, sizeof buf, format, args);
19006 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
19007 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
19011 if eval $compile; then
19014 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
19016 Your snprintf() and snprintf() don't seem to be working okay.
19018 d_snprintf="$undef"
19019 d_vsnprintf="$undef"
19023 echo "(I can't seem to compile the test program--assuming they don't)"
19024 d_snprintf="$undef"
19025 d_vsnprintf="$undef"
19031 : see if sockatmark exists
19032 set sockatmark d_sockatmark
19035 : see if prototype for sockatmark is available
19037 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
19040 : see if socks5_init exists
19041 set socks5_init d_socks5_init
19044 : see if sprintf returns the length of the string in the buffer as per ANSI
19045 $echo "Checking whether sprintf returns the length of the string..." >&4
19048 #$i_stdlib I_STDLIB
19050 #include <stdlib.h>
19052 #$i_string I_STRING
19054 # include <string.h>
19056 # include <strings.h>
19065 int check (size_t expect, int test) {
19066 size_t got = strlen(buffer);
19070 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
19075 int main(int argc, char **argv) {
19078 check(sprintf(buffer, ""), ++test);
19079 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
19080 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
19087 if eval $compile; then
19091 sprintf returns the length of the string (as ANSI says it should)
19093 d_sprintf_returns_strlen="$define"
19096 sprintf does not return the length of the string (how old is this system?)
19098 d_sprintf_returns_strlen="$undef"
19102 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
19103 d_sprintf_returns_strlen="$undef"
19107 : see if srand48_r exists
19108 set srand48_r d_srand48_r
19110 case "$d_srand48_r" in
19112 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19113 case "$d_srand48_r_proto:$usethreads" in
19114 ":define") d_srand48_r_proto=define
19115 set d_srand48_r_proto srand48_r $hdrs
19119 case "$d_srand48_r_proto" in
19121 case "$srand48_r_proto" in
19122 ''|0) try='int srand48_r(long, struct drand48_data*);'
19123 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19125 case "$srand48_r_proto" in
19126 ''|0) d_srand48_r=undef
19128 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19129 * ) case "$srand48_r_proto" in
19130 REENTRANT_PROTO*) ;;
19131 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19133 echo "Prototype: $try" ;;
19136 *) case "$usethreads" in
19137 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19144 *) srand48_r_proto=0
19148 : see if srandom_r exists
19149 set srandom_r d_srandom_r
19151 case "$d_srandom_r" in
19153 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19154 case "$d_srandom_r_proto:$usethreads" in
19155 ":define") d_srandom_r_proto=define
19156 set d_srandom_r_proto srandom_r $hdrs
19160 case "$d_srandom_r_proto" in
19162 case "$srandom_r_proto" in
19163 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19164 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19166 case "$srandom_r_proto" in
19167 ''|0) d_srandom_r=undef
19169 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19170 * ) case "$srandom_r_proto" in
19171 REENTRANT_PROTO*) ;;
19172 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19174 echo "Prototype: $try" ;;
19177 *) case "$usethreads" in
19178 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19185 *) srandom_r_proto=0
19189 : see if prototype for setresgid is available
19191 set d_sresgproto setresgid $i_unistd unistd.h
19194 : see if prototype for setresuid is available
19196 set d_sresuproto setresuid $i_unistd unistd.h
19199 : see if stat exists
19203 : see if sys/stat.h is available
19204 set sys/stat.h i_sysstat
19207 : see if stat knows about block sizes
19209 echo "Checking to see if your struct stat has st_blocks field..." >&4
19210 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19213 : see if this is a sys/vfs.h system
19214 set sys/vfs.h i_sysvfs
19217 : see if this is a sys/statfs.h system
19218 set sys/statfs.h i_sysstatfs
19221 : Check for statfs_s
19223 echo "Checking to see if your system supports struct statfs..." >&4
19224 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
19226 case "$d_statfs_s" in
19227 "$define") echo "Yes, it does." ;;
19228 *) echo "No, it doesn't." ;;
19232 : see if struct statfs knows about f_flags
19233 case "$d_statfs_s" in
19236 echo "Checking to see if your struct statfs has f_flags field..." >&4
19237 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
19241 set d_statfs_f_flags
19245 case "$d_statfs_f_flags" in
19246 "$define") echo "Yes, it does." ;;
19247 *) echo "No, it doesn't." ;;
19250 : see what flavor, if any, of static inline is supported
19252 echo "Checking to see if your system supports static inline..."
19253 $cat > try.c <<'EOCP'
19254 #include <stdlib.h>
19255 extern int f_via_a(int x);
19256 extern int f_via_b(int x);
19257 int main(int argc, char **argv)
19266 return EXIT_SUCCESS;
19269 return EXIT_FAILURE;
19273 $cat > a.c <<'EOCP'
19274 static INLINE int f(int x) {
19285 $cat > b.c <<'EOCP'
19286 extern int f(int x);
19294 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19295 case "$perl_static_inline" in
19296 '') # Check the various possibilities, and break out on success.
19297 # For gcc, prefer __inline__, which will still permit
19298 # cflags.SH to add in -ansi.
19299 case "$gccversion" in
19300 '') xxx="inline __inline__ __inline _inline";;
19301 *) xxx="__inline__ inline __inline _inline";;
19303 for inline in $xxx; do
19304 set try -DINLINE=$inline a.c
19305 if eval $compile && $run ./try; then
19306 # Now make sure there is no external linkage of static
19308 set try -DINLINE=$inline -DUSE_B a.c b.c
19309 if eval $compile && $run ./try; then
19310 $echo "Your compiler supports static $inline, " >&4
19311 $echo "but it also creates an external definition," >&4
19312 $echo "so I won't use it." >&4
19315 $echo "Your compiler supports static $inline." >&4
19317 perl_static_inline="static $inline";
19321 $echo "Your compiler does NOT support static $inline." >&4
19326 *inline*) # Some variant of inline exists.
19327 echo "Keeping your $hint value of $perl_static_inline."
19330 static) # No inline capabilities
19331 echo "Keeping your $hint value of $perl_static_inline."
19334 *) # Unrecognized previous value -- blindly trust the supplied
19335 # value and hope it makes sense. Use old value for
19336 # d_static_inline, if there is one.
19337 echo "Keeping your $hint value of $perl_static_inline."
19338 case "$d_static_inline" in
19340 *) val=$d_static_inline ;;
19344 # Fallback to plain 'static' if nothing worked.
19345 case "$perl_static_inline" in
19347 perl_static_inline="static"
19351 set d_static_inline
19353 $rm -f a.[co] b.[co]
19356 : Check stream access
19358 Checking how to access stdio streams by file descriptor number...
19360 case "$stdio_stream_array" in
19361 '') $cat >try.c <<EOCP
19364 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19368 for s in _iob __iob __sF
19370 set try -DSTDIO_STREAM_ARRAY=$s
19371 if eval $compile; then
19372 case "`$run ./try`" in
19373 yes) stdio_stream_array=$s; break ;;
19379 case "$stdio_stream_array" in
19381 I can't figure out how to access stdio streams by file descriptor number.
19383 d_stdio_stream_array="$undef"
19386 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19388 d_stdio_stream_array="$define"
19392 : see if strcoll exists
19393 set strcoll d_strcoll
19396 : check for structure copying
19398 echo "Checking to see if your C compiler can copy structs..." >&4
19399 $cat >try.c <<'EOCP'
19409 if $cc -c try.c >/dev/null 2>&1 ; then
19411 echo "Yup, it can."
19414 echo "Nope, it can't."
19420 : see if strerror and/or sys_errlist[] exist
19422 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19423 if set strerror val -f d_strerror; eval $csym; $val; then
19424 echo 'strerror() found.' >&4
19425 d_strerror="$define"
19426 d_strerrm='strerror(e)'
19427 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19428 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19429 d_syserrlst="$define"
19431 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19432 d_syserrlst="$undef"
19434 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19435 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19436 echo 'strerror() found in string header.' >&4
19437 d_strerror="$define"
19438 d_strerrm='strerror(e)'
19439 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19440 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19441 d_syserrlst="$define"
19443 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19444 d_syserrlst="$undef"
19446 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19447 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19448 d_strerror="$undef"
19449 d_syserrlst="$define"
19450 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19452 echo 'strerror() and sys_errlist[] NOT found.' >&4
19453 d_strerror="$undef"
19454 d_syserrlst="$undef"
19455 d_strerrm='"unknown"'
19459 : see if strerror_l exists
19460 set strerror_l d_strerror_l
19463 : see if strerror_r exists
19464 set strerror_r d_strerror_r
19466 case "$d_strerror_r" in
19468 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19469 case "$d_strerror_r_proto:$usethreads" in
19470 ":define") d_strerror_r_proto=define
19471 set d_strerror_r_proto strerror_r $hdrs
19475 case "$d_strerror_r_proto" in
19477 case "$strerror_r_proto" in
19478 ''|0) try='int strerror_r(int, char*, size_t);'
19479 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19481 case "$strerror_r_proto" in
19482 ''|0) try='int strerror_r(int, char*, int);'
19483 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19485 case "$strerror_r_proto" in
19486 ''|0) try='char* strerror_r(int, char*, size_t);'
19487 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19489 case "$strerror_r_proto" in
19490 ''|0) d_strerror_r=undef
19492 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19493 * ) case "$strerror_r_proto" in
19494 REENTRANT_PROTO*) ;;
19495 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19497 echo "Prototype: $try" ;;
19500 *) case "$usethreads" in
19501 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19508 *) strerror_r_proto=0
19512 : see if strftime exists
19513 set strftime d_strftime
19516 : see if strlcat exists
19517 set strlcat d_strlcat
19520 : see if strlcpy exists
19521 set strlcpy d_strlcpy
19524 : see if strtod exists
19525 set strtod d_strtod
19528 : see if strtol exists
19529 set strtol d_strtol
19532 : see if strtold exists
19533 set strtold d_strtold
19536 : see if strtoll exists
19537 set strtoll d_strtoll
19540 case "$d_longlong-$d_strtoll" in
19543 Checking whether your strtoll() works okay...
19545 $cat >try.c <<'EOCP'
19548 #define strtoll __strtoll
19551 #define strtoll _strtoll
19554 extern long long int strtoll(char *s, char **, int);
19555 static int bad = 0;
19556 int check(char *s, long long ell, int een) {
19559 gll = strtoll(s, 0, 10);
19560 if (!((gll == ell) && (errno == een)))
19564 check(" 1", 1LL, 0);
19565 check(" 0", 0LL, 0);
19566 check("-1", -1LL, 0);
19567 check("-9223372036854775808", -9223372036854775808LL, 0);
19568 check("-9223372036854775808", -9223372036854775808LL, 0);
19569 check(" 9223372036854775807", 9223372036854775807LL, 0);
19570 check("-9223372036854775808", -9223372036854775808LL, 0);
19571 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19572 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19578 if eval $compile; then
19581 ok) echo "Your strtoll() seems to be working okay." ;;
19583 Your strtoll() doesn't seem to be working okay.
19589 echo "(I can't seem to compile the test program--assuming it doesn't)"
19595 : see if strtoq exists
19596 set strtoq d_strtoq
19599 : see if strtoul exists
19600 set strtoul d_strtoul
19603 case "$d_strtoul" in
19606 Checking whether your strtoul() works okay...
19608 $cat >try.c <<'EOCP'
19611 extern unsigned long int strtoul(char *s, char **, int);
19612 static int bad = 0;
19613 void check(char *s, unsigned long eul, int een) {
19616 gul = strtoul(s, 0, 10);
19617 if (!((gul == eul) && (errno == een)))
19621 check(" 1", 1L, 0);
19622 check(" 0", 0L, 0);
19624 case "$longsize" in
19626 $cat >>try.c <<'EOCP'
19627 check("18446744073709551615", 18446744073709551615UL, 0);
19628 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19629 #if 0 /* strtoul() for /^-/ strings is undefined. */
19630 check("-1", 18446744073709551615UL, 0);
19631 check("-18446744073709551614", 2, 0);
19632 check("-18446744073709551615", 1, 0);
19633 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19634 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19639 $cat >>try.c <<'EOCP'
19640 check("4294967295", 4294967295UL, 0);
19641 check("4294967296", 4294967295UL, ERANGE);
19642 #if 0 /* strtoul() for /^-/ strings is undefined. */
19643 check("-1", 4294967295UL, 0);
19644 check("-4294967294", 2, 0);
19645 check("-4294967295", 1, 0);
19646 check("-4294967296", 4294967295UL, ERANGE);
19647 check("-4294967297", 4294967295UL, ERANGE);
19652 : Should we write these tests to be more portable by sprintf-ing
19653 : ~0 and then manipulating that char string as input for strtol?
19656 $cat >>try.c <<'EOCP'
19663 if eval $compile; then
19664 case "`$run ./try`" in
19665 ok) echo "Your strtoul() seems to be working okay." ;;
19667 Your strtoul() doesn't seem to be working okay.
19673 echo "(I can't seem to compile the test program--assuming it doesn't)"
19679 : see if strtoull exists
19680 set strtoull d_strtoull
19683 case "$d_longlong-$d_strtoull" in
19686 Checking whether your strtoull() works okay...
19688 $cat >try.c <<'EOCP'
19691 #define strtoull __strtoull
19694 extern unsigned long long int strtoull(char *s, char **, int);
19695 static int bad = 0;
19696 int check(char *s, long long eull, int een) {
19699 gull = strtoull(s, 0, 10);
19700 if (!((gull == eull) && (errno == een)))
19704 check(" 1", 1LL, 0);
19705 check(" 0", 0LL, 0);
19706 check("18446744073709551615", 18446744073709551615ULL, 0);
19707 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19708 #if 0 /* strtoull() for /^-/ strings is undefined. */
19709 check("-1", 18446744073709551615ULL, 0);
19710 check("-18446744073709551614", 2LL, 0);
19711 check("-18446744073709551615", 1LL, 0);
19712 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19713 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19720 if eval $compile; then
19721 case "`$run ./try`" in
19722 ok) echo "Your strtoull() seems to be working okay." ;;
19724 Your strtoull() doesn't seem to be working okay.
19726 d_strtoull="$undef"
19730 echo "(I can't seem to compile the test program--assuming it doesn't)"
19731 d_strtoull="$undef"
19736 : see if strtouq exists
19737 set strtouq d_strtouq
19740 case "$d_strtouq" in
19743 Checking whether your strtouq() works okay...
19745 $cat >try.c <<'EOCP'
19748 extern unsigned long long int strtouq(char *s, char **, int);
19749 static int bad = 0;
19750 void check(char *s, unsigned long long eull, int een) {
19751 unsigned long long gull;
19753 gull = strtouq(s, 0, 10);
19754 if (!((gull == eull) && (errno == een)))
19758 check(" 1", 1LL, 0);
19759 check(" 0", 0LL, 0);
19760 check("18446744073709551615", 18446744073709551615ULL, 0);
19761 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19762 #if 0 /* strtouq() for /^-/ strings is undefined. */
19763 check("-1", 18446744073709551615ULL, 0);
19764 check("-18446744073709551614", 2LL, 0);
19765 check("-18446744073709551615", 1LL, 0);
19766 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19767 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19775 if eval $compile; then
19776 case "`$run ./try`" in
19777 ok) echo "Your strtouq() seems to be working okay." ;;
19779 Your strtouq() doesn't seem to be working okay.
19785 echo "(I can't seem to compile the test program--assuming it doesn't)"
19791 : see if strxfrm exists
19792 set strxfrm d_strxfrm
19795 : see if symlink exists
19796 set symlink d_symlink
19799 : see if syscall exists
19800 set syscall d_syscall
19803 : see if prototype for syscall is available
19805 set d_syscallproto syscall $i_unistd unistd.h
19808 : see if sysconf exists
19809 set sysconf d_sysconf
19812 : see if system exists
19813 set system d_system
19816 : see if tcgetpgrp exists
19817 set tcgetpgrp d_tcgetpgrp
19820 : see if tcsetpgrp exists
19821 set tcsetpgrp d_tcsetpgrp
19824 : see if prototype for telldir is available
19826 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19829 : see if tgamma exists
19830 set tgamma d_tgamma
19833 : see if time exists
19835 if test "X$d_time" = X -o X"$timetype" = X; then
19836 if set time val -f d_time; eval $csym; $val; then
19837 echo 'time() found.' >&4
19839 rp="What is the type returned by time() on this system?"
19840 set time_t timetype long stdio.h sys/types.h
19843 echo 'time() not found, hope that will do.' >&4
19851 : see if timegm exists
19852 set timegm d_timegm
19855 : see if this is a sys/times.h system
19856 set sys/times.h i_systimes
19859 : see if times exists
19861 if set times val -f d_times; eval $csym; $val; then
19862 echo 'times() found.' >&4
19865 case "$i_systimes" in
19866 "$define") inc='sys/times.h';;
19868 rp="What is the type returned by times() on this system?"
19869 set clock_t clocktype long stdio.h sys/types.h $inc
19872 echo 'times() NOT found, hope that will do.' >&4
19877 : see if tmpnam_r exists
19878 set tmpnam_r d_tmpnam_r
19880 case "$d_tmpnam_r" in
19882 hdrs="$i_systypes sys/types.h define stdio.h "
19883 case "$d_tmpnam_r_proto:$usethreads" in
19884 ":define") d_tmpnam_r_proto=define
19885 set d_tmpnam_r_proto tmpnam_r $hdrs
19889 case "$d_tmpnam_r_proto" in
19891 case "$tmpnam_r_proto" in
19892 ''|0) try='char* tmpnam_r(char*);'
19893 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19895 case "$tmpnam_r_proto" in
19896 ''|0) d_tmpnam_r=undef
19898 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19899 * ) case "$tmpnam_r_proto" in
19900 REENTRANT_PROTO*) ;;
19901 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19903 echo "Prototype: $try" ;;
19906 *) case "$usethreads" in
19907 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19914 *) tmpnam_r_proto=0
19918 : see if trunc exists
19922 : see if truncate exists
19923 set truncate d_truncate
19926 : see if ttyname_r exists
19927 set ttyname_r d_ttyname_r
19929 case "$d_ttyname_r" in
19931 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19932 case "$d_ttyname_r_proto:$usethreads" in
19933 ":define") d_ttyname_r_proto=define
19934 set d_ttyname_r_proto ttyname_r $hdrs
19938 case "$d_ttyname_r_proto" in
19940 case "$ttyname_r_proto" in
19941 ''|0) try='int ttyname_r(int, char*, size_t);'
19942 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19944 case "$ttyname_r_proto" in
19945 ''|0) try='int ttyname_r(int, char*, int);'
19946 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19948 case "$ttyname_r_proto" in
19949 ''|0) try='char* ttyname_r(int, char*, int);'
19950 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19952 case "$ttyname_r_proto" in
19953 ''|0) d_ttyname_r=undef
19955 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19956 * ) case "$ttyname_r_proto" in
19957 REENTRANT_PROTO*) ;;
19958 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19960 echo "Prototype: $try" ;;
19963 *) case "$usethreads" in
19964 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19971 *) ttyname_r_proto=0
19975 : see if tzname[] exists
19977 if set tzname val -a d_tzname; eval $csym; $val; then
19979 echo 'tzname[] found.' >&4
19982 echo 'tzname[] NOT found.' >&4
19987 : Check if is a multiplatform env
19989 darwin) multiarch="$define" ;;
19991 case "$multiarch" in
19992 ''|[nN]*) multiarch="$undef" ;;
19995 : check for ordering of bytes in a UV
19997 case "$multiarch" in
20000 You seem to be doing a multiarchitecture build,
20001 skipping the byteorder check.
20007 case "$byteorder" in
20010 In the following, larger digits indicate more significance. A big-endian
20011 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
20012 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
20013 machines may have weird orders like 3412. A Cray will report 87654321,
20014 an Alpha will report 12345678. If the test program works the default is
20016 I'm now running the test program...
20020 #$i_stdlib I_STDLIB
20022 #include <stdlib.h>
20024 #include <sys/types.h>
20025 typedef $uvtype UV;
20035 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
20037 u.l = (UV)0x04030201;
20038 for (i = 0; i < $uvsize; i++)
20039 printf("%c", u.c[i]+'0');
20046 if eval $compile && $run ./try > /dev/null; then
20049 [1-4][1-4][1-4][1-4]|12345678|87654321)
20050 echo "(The test program ran ok.)"
20051 echo "byteorder=$dflt"
20054 ????|????????) echo "(The test program ran ok.)" ;;
20055 *) echo "(The test program didn't run right for some reason.)" ;;
20060 (I can't seem to compile the test program. Guessing big-endian...)
20063 case "$xxx_prompt" in
20065 rp="What is the order of bytes in $uvtype?"
20078 : Checking 32bit alignedness
20081 Checking to see whether you can access character data unalignedly...
20083 case "$d_u32align" in
20084 '') $cat >try.c <<EOCP
20086 #$i_stdlib I_STDLIB
20088 #include <stdlib.h>
20090 #define U32 $u32type
20091 #define BYTEORDER 0x$byteorder
20093 #include <signal.h>
20095 $signal_t bletch(int s) { exit(4); }
20098 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20099 volatile U8 buf[8];
20103 if (sizeof(U32) != 4) {
20104 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20111 signal(SIGBUS, bletch);
20123 for (i = 0; i < 4; i++) {
20124 up = (U32*)(buf + i);
20125 if (! ((*up == 1 << (8*i)) || /* big-endian */
20126 (*up == 1 << (8*(3-i))) /* little-endian */
20130 printf("read failed (%x)\n", *up);
20136 for (i = 0; i < 4; i++) {
20137 up = (U32*)(buf + i);
20139 if (*up != 0xBeef) {
20140 printf("write failed (%x)\n", *up);
20154 if eval $compile_ok; then
20155 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20156 $run ./try 2>&1 >/dev/null
20159 You can access character data pretty unalignedly.
20161 d_u32align="$undef"
20164 It seems that you must access character data in an aligned manner.
20166 d_u32align="$define"
20170 rp='Can you access character data at unaligned addresses?'
20174 [yY]*) d_u32align="$undef" ;;
20175 *) d_u32align="$define" ;;
20182 : see if ualarm exists
20183 set ualarm d_ualarm
20186 : see if umask exists
20190 : see if unordered exists
20191 set unordered d_unordered
20194 : see if unsetenv exists
20195 set unsetenv d_unsetenv
20198 : see if usleep exists
20199 set usleep d_usleep
20202 : see if prototype for usleep is available
20204 set d_usleepproto usleep $i_unistd unistd.h
20207 : see if ustat exists
20211 : see if closedir exists
20212 set closedir d_closedir
20215 case "$d_closedir" in
20218 echo "Checking whether closedir() returns a status..." >&4
20220 #$i_dirent I_DIRENT /**/
20221 #$i_sysdir I_SYS_DIR /**/
20222 #$i_sysndir I_SYS_NDIR /**/
20223 #$i_systypes I_SYS_TYPES /**/
20225 #if defined(I_SYS_TYPES)
20226 #include <sys/types.h>
20228 #if defined(I_DIRENT)
20229 #include <dirent.h>
20232 #include <sys/ndir.h>
20236 #include <ndir.h> /* may be wrong in the future */
20238 #include <sys/dir.h>
20243 int main() { return closedir(opendir(".")); }
20246 if eval $compile_ok; then
20247 if $run ./try > /dev/null 2>&1 ; then
20248 echo "Yes, it does."
20251 echo "No, it doesn't."
20255 echo "(I can't seem to compile the test program--assuming it doesn't)"
20263 set d_void_closedir
20267 : see if there is a wait4
20271 : see if waitpid exists
20272 set waitpid d_waitpid
20277 $cat >try.c <<'EOCP'
20283 return (wcscmp (s, s) ? 1 : 0);
20288 if eval $compile; then
20291 0) echo "A working wcscmp() found." >&4
20293 *) echo "wcscmp() found, but it doesn't work" >&4
20297 echo "wcscmp() NOT found." >&4
20303 : see if wcstombs exists
20304 set wcstombs d_wcstombs
20309 $cat >try.c <<'EOCP'
20314 wchar_t dst[4], *src = L" ";
20316 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20321 if eval $compile; then
20324 0) echo "A working wcsxfrm() found." >&4
20326 *) echo "wcsxfrm() found, but it doesn't work" >&4
20330 echo "wcsxfrm() NOT found." >&4
20336 : see if wctomb exists
20337 set wctomb d_wctomb
20340 : see if writev exists
20341 set writev d_writev
20344 : check for alignment requirements
20346 case "$alignbytes" in
20347 '') echo "Checking alignment constraints..." >&4
20356 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20361 if eval $compile_ok; then
20365 echo "(I can't seem to compile the test program...)"
20367 case "$multiarch" in
20369 : The usual safe value is 8, but Darwin with -Duselongdouble
20370 : needs 16. Hence, we will take 8 as a minimum, but allow
20371 : Configure to pick a larger value if needed.
20372 if $test "$dflt" -lt 8; then
20374 echo "Setting alignment to 8 for multiarch support.">&4
20379 *) dflt="$alignbytes"
20382 rp="Doubles must be aligned on a how-many-byte boundary?"
20387 : set the base revision
20390 : length of character in bytes. Is always 1, otherwise it is not C
20391 : This used to be a test using sizeof
20394 : Check for the number of bits in a character
20395 case "$charbits" in
20396 '') echo "Checking how long a character is (in bits)..." >&4
20403 for (c = 1, n = 0; c; c <<= 1, n++) ;
20404 printf ("%d\n", n);
20409 if eval $compile_ok; then
20413 echo "(I can't seem to compile the test program. Guessing...)"
20420 rp="What is the length of a character (in bits)?"
20424 case "$charbits" in
20427 Your system has an unsigned character size of $charbits bits, which
20428 is rather unusual (normally it is 8 bits). Perl likely will not work
20429 correctly on your system, with subtle bugs in various places.
20431 rp='Do you really want to continue?'
20435 [yY]) echo >&4 "Okay, continuing." ;;
20440 : how do we concatenate cpp tokens here?
20442 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20443 $cat >cpp_stuff.c <<'EOCP'
20444 #define RCAT(a,b)a/**/b
20445 #define ACAT(a,b)a ## b
20449 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20450 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20451 echo "Oh! Smells like ANSI's been here." >&4
20452 echo "We can catify or stringify, separately or together!"
20454 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20455 echo "Ah, yes! The good old days!" >&4
20456 echo "However, in the good old days we don't know how to stringify and"
20457 echo "catify at the same time."
20461 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20462 You're going to have to edit the values of CAT[2-5] in config.h...
20464 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20468 : see if this is a db.h system
20474 : Check db version.
20476 echo "Checking Berkeley DB version ..." >&4
20482 #include <sys/types.h>
20484 #$i_stdlib I_STDLIB
20486 #include <stdlib.h>
20489 int main(int argc, char *argv[])
20491 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20492 int Major, Minor, Patch ;
20493 unsigned long Version ;
20494 (void)db_version(&Major, &Minor, &Patch) ;
20496 printf("%d %d %d %d %d %d\n",
20497 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20498 Major, Minor, Patch);
20501 printf("You have Berkeley DB Version 2 or greater.\n");
20503 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20504 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20505 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20506 Major, Minor, Patch) ;
20508 /* check that db.h & libdb are compatible */
20509 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20510 printf("db.h and libdb are incompatible.\n") ;
20514 printf("db.h and libdb are compatible.\n") ;
20516 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20517 + DB_VERSION_PATCH ;
20519 /* needs to be >= 2.3.4 */
20520 if (Version < 2003004) {
20521 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20522 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20528 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20533 printf("You have Berkeley DB Version 1.\n");
20534 exit(0); /* DB version < 2: the coast is clear. */
20536 exit(1); /* <db.h> not Berkeley DB? */
20542 if eval $compile_ok && $run ./try; then
20543 echo 'Looks OK.' >&4
20545 db_version_major=$1
20546 db_version_minor=$2
20547 db_version_patch=$3
20549 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20553 : Remove db from list of libraries to use
20554 echo "Removing unusable -ldb from library list" >&4
20555 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20558 echo "libs = $libs" >&4
20568 : Check the return type needed for hash
20570 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20576 #include <sys/types.h>
20579 #ifndef DB_VERSION_MAJOR
20580 u_int32_t hash_cb (const void* ptr, size_t size)
20586 info.hash = hash_cb;
20590 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20591 if $contains warning try.out >>/dev/null 2>&1 ; then
20594 db_hashtype='u_int32_t'
20597 : XXX Maybe we should just give up here.
20598 db_hashtype=u_int32_t
20600 echo "Help: I can't seem to compile the db test program." >&4
20601 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20604 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20606 *) db_hashtype=u_int32_t
20611 : Check the return type needed for prefix
20613 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20619 #include <sys/types.h>
20622 #ifndef DB_VERSION_MAJOR
20623 size_t prefix_cb (const DBT *key1, const DBT *key2)
20629 info.prefix = prefix_cb;
20633 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20634 if $contains warning try.out >>/dev/null 2>&1 ; then
20635 db_prefixtype='int'
20637 db_prefixtype='size_t'
20640 db_prefixtype='size_t'
20641 : XXX Maybe we should just give up here.
20643 echo "Help: I can't seem to compile the db test program." >&4
20644 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20647 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20649 *) db_prefixtype='size_t'
20653 : Include . in @INC
20656 Historically Perl has provided a final fallback of the current working
20657 directory '.' when searching for a library. This, however, can lead to
20658 problems when a Perl program which loads optional modules is called from
20659 a shared directory. This can lead to executing unexpected code.
20663 # When changing to exclude by default:
20664 case "$default_inc_excludes_dot" in
20665 $undef|false|[nN]*) dflt="n" ;;
20668 # To turn exclude off by default:
20669 #case "$default_inc_excludes_dot" in
20670 # $define|true|[yY]*) dflt="y" ;;
20674 rp='Exclude '.' from @INC by default? '
20677 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20678 *) default_inc_excludes_dot="$define" ;;
20681 : Check what kind of inf/nan your system has
20682 $echo "Checking the kind of infinities and nans you have..." >&4
20683 $echo "(The following tests may crash. That's okay.)" >&4
20685 #define DOUBLESIZE $doublesize
20686 #$d_longdbl HAS_LONG_DOUBLE
20687 #ifdef HAS_LONG_DOUBLE
20688 #define LONG_DOUBLESIZE $longdblsize
20689 #define LONG_DOUBLEKIND $longdblkind
20692 #$i_string I_STRING
20697 # include <string.h>
20700 /* Note that whether the sign bit is on or off
20701 * for NaN depends on the CPU/FPU, and possibly
20702 * can be affected by the build toolchain.
20704 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20705 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20706 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20707 * (respectively) as opposed to the more usual
20708 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20710 * Pre-IEEE-754 floating point format do not even have inf/nan support
20711 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20712 * to even mention, causing immediate SIGFPE or equivalent: this is
20713 * the case with VAX floating point, for example.
20715 static void bytes(void *v, unsigned int n) {
20716 unsigned char *p = (unsigned char *)v;
20718 for (i = 0; i < n; i++) {
20719 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20722 int main(int argc, char *argv[]) {
20723 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20724 * because some compilers are 'smart' and not only warn but refuse to
20725 * compile such 'illegal' values. */
20726 double dinf = exp(1e9);
20727 double dnan = sqrt(-1.0);
20728 #ifdef HAS_LONG_DOUBLE
20729 long double ldinf = (long double)exp(1e9);
20730 long double ldnan = (long double)sqrt(-1.0);
20731 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20732 /* the 80-bit long doubles might have garbage in their excess bytes */
20733 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20734 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20737 switch (argv[1][0]) {
20738 case '1': bytes(&dinf, sizeof(dinf)); break;
20739 case '2': bytes(&dnan, sizeof(dnan)); break;
20740 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20741 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20749 if eval $compile; then
20750 doubleinfbytes=`$run ./try 1`
20751 doublenanbytes=`$run ./try 2`
20752 case "$d_longdbl" in
20754 longdblinfbytes=`$run ./try 3`
20755 longdblnanbytes=`$run ./try 4`
20759 # Defaults in case the above test program failed.
20760 case "$doublekind" in
20761 1) # IEEE 754 32-bit LE
20762 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20763 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20765 2) # IEEE 754 32-bit BE
20766 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20767 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20769 3) # IEEE 754 64-bit LE
20770 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20771 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20773 4) # IEEE 754 64-bit BE
20774 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20775 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20777 5) # IEEE 754 128-bit LE
20778 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20779 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20781 6) # IEEE 754 128-bit BE
20782 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20783 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20785 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20786 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20787 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20789 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20790 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20791 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20793 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20794 doubleinfbytes=$undef
20795 doublenanbytes=$undef
20798 doubleinfbytes=$undef
20799 doublenanbytes=$undef
20802 case "$longdblkind" in
20803 1) # IEEE 754 128-bit LE
20804 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20805 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20807 2) # IEEE 754 128-bit BE
20808 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20809 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20811 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20812 case "$longdblsize" in
20813 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20814 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20815 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20818 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20819 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20822 longdblinfbytes=$undef
20823 longdblnanbytes=$undef
20827 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20828 case "$longdblsize" in
20829 12) # 32-bit system
20830 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20831 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20833 16) # 64-bit system
20834 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20835 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20838 longdblinfbytes=$undef
20839 longdblnanbytes=$undef
20843 5) # 128-bit LE-LE "double double"
20844 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20845 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20847 6) # 128-bit BE-BE "double double"
20848 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20849 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20851 7) # 128-bit LE-BE "double double"
20852 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20853 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20855 8) # 128-bit BE-LE "double double"
20856 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20857 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20859 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20860 longdblinfbytes=$undef
20861 longdblnanbytes=$undef
20864 longdblinfbytes=$undef
20865 longdblnanbytes=$undef
20869 # In case the program crashed the values are empty, turn them undef.
20870 case "$doubleinfbytes" in
20871 '') doubleinfbytes=$undef ;;
20873 case "$doublenanbytes" in
20874 '') doublenanbytes=$undef ;;
20876 case "$longdblinfbytes" in
20877 '') longdblinfbytes=$undef ;;
20879 case "$longdblnanbytes" in
20880 '') longdblnanbytes=$undef ;;
20884 : Check the length of the double mantissa
20885 $echo "Checking how many mantissa bits your doubles have..." >&4
20888 #$i_sunmath I_SUNMATH
20890 # include <float.h>
20893 # include <sunmath.h>
20895 #ifdef DBL_MANT_DIG
20896 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20899 int main(int argc, char *argv[]) {
20901 printf("%d\n", BITS);
20907 if eval $compile; then
20908 doublemantbits=`$run ./try`
20910 doublemantbits="$undef"
20914 : Check the length of the longdouble mantissa
20915 $echo "Checking how many mantissa bits your long doubles have..." >&4
20918 #$i_sunmath I_SUNMATH
20920 # include <float.h>
20923 # include <sunmath.h>
20925 #$d_longdbl HAS_LONG_DOUBLE
20926 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20927 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20928 /* This format has no implicit bit. Beware, however, that for
20929 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20930 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20931 * and the top bit must have been one since 387, zero is plain invalid.
20932 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20933 # define BITS LDBL_MANT_DIG
20934 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20935 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20936 * reason e.g. Irix thinks 107. But in any case, we want only
20937 * the number of real bits, the implicit bits are of no interest. */
20938 # define BITS 2 * (DBL_MANT_DIG - 1)
20940 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20944 int main(int argc, char *argv[]) {
20946 printf("%d\n", BITS);
20952 if eval $compile; then
20953 longdblmantbits=`$run ./try`
20955 longdblmantbits="$undef"
20959 : Check the length of the NV mantissa
20960 $echo "Checking how many mantissa bits your NVs have..." >&4
20961 if test "X$usequadmath" = "X$define"; then
20962 nvmantbits=112 # 128-1-15
20964 if test "X$nvsize" = "X$doublesize"; then
20965 nvmantbits="$doublemantbits"
20967 if test "X$nvsize" = "X$longdblsize"; then
20968 nvmantbits="$longdblmantbits"
20970 nvmantbits="$undef"
20975 : How can we generate normalized random numbers ?
20977 echo "Using our internal random number implementation..." >&4
20980 *-Dmy_rand=*|*-Dmy_srand=*)
20981 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20982 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20983 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20984 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20988 randfunc=Perl_drand48
20989 drand01="Perl_drand48()"
20990 seedfunc="Perl_drand48_init"
20994 : Probe whether dtrace builds an object, as newer Illumos requires an input
20995 : object file that uses at least one of the probes defined in the .d file
20996 case "$usedtrace" in
20998 case "$dtracexnolibs" in
20999 $define|true|[yY]*)
21000 dtracexnolibs=$define
21001 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
21004 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21005 dtracexnolibs=$define
21006 echo "Your dtrace accepts -xnolibs"
21007 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21008 dtracexnolibs=$undef
21009 echo "Your dtrace doesn't accept -xnolibs"
21011 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
21016 dtracexnolibs=$undef
21017 $dtrace -h -s ../perldtrace.d -o perldtrace.h
21020 case $dtracexnolibs in
21021 $define) xnolibs=-xnolibs ;;
21025 case "$dtraceobject" in
21026 $define|true|[yY]*)
21027 dtraceobject=$define
21031 #include "perldtrace.h"
21033 PERL_LOADED_FILE("dummy");
21037 dtraceobject=$undef
21038 if $cc -c -o try.o $optimize $ccflags try.c \
21039 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
21040 dtraceobject=$define
21041 echo "Your dtrace builds an object file"
21044 *) dtraceobject=$undef ;;
21046 $rm_try perldtrace.o perldtrace.h
21049 : Determine if this is an EBCDIC system
21051 echo "Determining whether or not we are on an EBCDIC system..." >&4
21052 $cat >try.c <<'EOM'
21055 if ('M'==0xd4) return 0;
21062 if eval $compile_ok; then
21063 if $run ./try; then
21064 echo "You seem to speak EBCDIC." >&4
21067 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21070 echo "I'm unable to compile the test program." >&4
21071 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21077 : Check how to flush
21080 Checking how to flush all pending stdio output...
21082 # I only know how to find the first 32 possibly open files on SunOS.
21083 # See also hints/sunos_4_1.sh and util.c --AD
21085 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21087 $cat >>try.c <<EOCP
21089 #$i_stdlib I_STDLIB
21091 #include <stdlib.h>
21093 #$i_unistd I_UNISTD
21095 # include <unistd.h>
21097 #$d_sysconf HAS_SYSCONF
21098 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21099 #ifdef HAS_STDIO_STREAM_ARRAY
21100 # define STDIO_STREAM_ARRAY $stdio_stream_array
21105 p = fopen("try.out", "w");
21109 # ifdef TRY_FPRINTF
21113 #ifdef TRY_FFLUSH_NULL
21116 #ifdef TRY_FFLUSH_ALL
21118 long open_max = -1;
21119 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21120 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21122 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21123 open_max = sysconf(_SC_OPEN_MAX);
21126 open_max = FOPEN_MAX;
21129 open_max = OPEN_MAX;
21138 # ifdef HAS_STDIO_STREAM_ARRAY
21139 if (open_max > 0) {
21141 for (i = 0; i < open_max; i++)
21142 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21143 STDIO_STREAM_ARRAY[i]._file < open_max &&
21144 STDIO_STREAM_ARRAY[i]._flag)
21145 fflush(&STDIO_STREAM_ARRAY[i]);
21153 : first we have to find out how _not_ to flush
21155 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21157 set try -DTRY_FPUTC
21158 if eval $compile; then
21159 $run ./try 2>/dev/null
21162 if $test ! -s try.out -a "X$code" = X42; then
21168 set try -DTRY_FPRINTF
21169 if eval $compile; then
21170 $run ./try 2>/dev/null
21173 if $test ! -s try.out -a "X$code" = X42; then
21174 output=-DTRY_FPRINTF
21180 : check for fflush NULL behavior
21181 case "$fflushNULL" in
21182 '') set try -DTRY_FFLUSH_NULL $output
21183 if eval $compile; then
21184 $run ./try 2>/dev/null
21187 if $test -s try.out -a "X$code" = X42; then
21188 fflushNULL="`$cat try.out`"
21190 if $test "X$code" != X42; then
21192 (If this test failed, don't worry, we'll try another method shortly.)
21197 $rm -f core try.core core.try.*
21198 case "$fflushNULL" in
21200 Your fflush(NULL) works okay for output streams.
21201 Let's see if it clobbers input pipes...
21203 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21204 # bug that improperly flushes the input end of pipes. So we avoid the
21205 # autoflush on fork/system/exec support for now. :-(
21206 $cat >tryp.c <<EOCP
21209 main(int argc, char **argv)
21215 while ((i = getc(stdin)) != -1
21216 && (*bp++ = i) != '\n'
21217 && bp < &buf[1024])
21220 fprintf(stdout, "%s", buf);
21228 fflushNULL="$define"
21230 if eval $compile; then
21232 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21233 if $test "X$targethost" != X; then
21236 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21238 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21240 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21242 fflush(NULL) seems to behave okay with input streams.
21244 fflushNULL="$define"
21247 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21249 fflushNULL="$undef"
21252 $rm -f core tryp.c tryp.core core.tryp.*
21255 Your fflush(NULL) isn't working (contrary to ANSI C).
21257 fflushNULL="$undef"
21260 Cannot figure out whether your fflush(NULL) works or not.
21261 I'm assuming it doesn't (contrary to ANSI C).
21263 fflushNULL="$undef"
21267 $define|true|[yY]*)
21268 fflushNULL="$define"
21271 fflushNULL="$undef"
21274 : check explicit looping only if NULL did not work, and if the pipe
21275 : bug does not show up on an explicit flush too
21276 case "$fflushNULL" in
21278 $cat >tryp.c <<EOCP
21281 main(int argc, char **argv)
21287 while ((i = getc(stdin)) != -1
21288 && (*bp++ = i) != '\n'
21289 && bp < &buf[1024])
21292 fprintf(stdout, "%s", buf);
21301 if eval $compile; then
21303 if $test "X$targethost" != X; then
21306 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21308 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21310 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21312 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21314 : now check for fflushall behaviour
21315 case "$fflushall" in
21316 '') set try -DTRY_FFLUSH_ALL $output
21317 if eval $compile; then
21319 (Now testing the other method--but note that this also may fail.)
21321 $run ./try 2>/dev/null
21324 if $test -s try.out -a "X$code" = X42; then
21325 fflushall="`$cat try.out`"
21329 case "$fflushall" in
21331 Whew. Flushing explicitly all the stdio streams works.
21333 fflushall="$define"
21336 Sigh. Flushing explicitly all the stdio streams doesn't work.
21341 Cannot figure out whether flushing stdio streams explicitly works or not.
21342 I'm assuming it doesn't.
21348 "$define"|true|[yY]*)
21349 fflushall="$define"
21357 All is futile. Even fflush(stdin) clobbers input pipes!
21364 $rm -f core tryp.c tryp.core core.tryp.*
21366 *) fflushall="$undef"
21370 case "$fflushNULL$fflushall" in
21373 OK, I give up. I cannot figure out how to flush pending stdio output.
21374 We won't be flushing handles at all before fork/exec/popen.
21380 : Store the full pathname to the ar program for use in the C program
21381 : Respect a hint or command line value for full_ar.
21386 : Store the full pathname to the sed program for use in the C program
21389 : see what type gids are declared as in the kernel
21391 echo "Looking for the type for group ids returned by getgid()."
21392 set gid_t gidtype xxx stdio.h sys/types.h
21396 xxx=`./findhdr sys/user.h`
21397 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21399 unsigned) dflt="$1 $2" ;;
21403 *) dflt="$gidtype";;
21406 gid_t) echo "gid_t found." ;;
21407 *) rp="What is the type for group ids returned by getgid()?"
21413 : Check the size of GID
21416 *_t) zzz="$gidtype" ;;
21419 echo "Checking the size of $zzz..." >&4
21421 #include <sys/types.h>
21423 #$i_stdlib I_STDLIB
21425 #include <stdlib.h>
21428 printf("%d\n", (int)sizeof($gidtype));
21433 if eval $compile_ok; then
21437 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21440 echo "Your $zzz is $gidsize bytes long."
21445 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21449 : Check if GID is signed
21452 *_t) zzz="$gidtype" ;;
21455 echo "Checking the sign of $zzz..." >&4
21457 #include <sys/types.h>
21468 if eval $compile; then
21472 echo "(I can't execute the test program--guessing unsigned.)" >&4
21476 1) echo "Your $zzz is unsigned." ;;
21477 -1) echo "Your $zzz is signed." ;;
21483 echo "(I can't compile the test program--guessing unsigned.)" >&4
21487 : Check 64bit sizes
21490 if $test X"$quadtype" != X; then
21492 echo "Checking how to print 64-bit integers..." >&4
21494 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21495 $cat >try.c <<'EOCP'
21496 #include <sys/types.h>
21499 int q = 12345678901;
21500 printf("%ld\n", q);
21504 if eval $compile; then
21508 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21509 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21510 echo "We will use %d."
21516 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21517 $cat >try.c <<'EOCP'
21518 #include <sys/types.h>
21521 long q = 12345678901;
21522 printf("%ld\n", q);
21526 if eval $compile; then
21530 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21531 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21532 echo "We will use %ld."
21538 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21539 $cat >try.c <<'EOCP'
21540 #include <sys/types.h>
21541 #include <inttypes.h>
21544 int64_t q = 12345678901;
21545 printf("%" PRId64 "\n", q);
21549 if eval $compile; then
21553 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21554 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21555 echo "We will use the C9X style."
21561 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21563 #include <sys/types.h>
21566 $quadtype q = 12345678901;
21567 printf("%Ld\n", q);
21571 if eval $compile; then
21575 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21576 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21577 echo "We will use %Ld."
21583 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21584 $cat >try.c <<'EOCP'
21585 #include <sys/types.h>
21588 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21589 printf("%lld\n", q);
21593 if eval $compile; then
21597 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21598 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21599 echo "We will use the %lld style."
21605 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21607 #include <sys/types.h>
21610 $quadtype q = 12345678901;
21611 printf("%qd\n", q);
21615 if eval $compile; then
21619 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21620 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21621 echo "We will use %qd."
21627 if $test X"$sPRId64" = X; then
21628 echo "Cannot figure out how to print 64-bit integers." >&4
21635 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21636 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21638 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21639 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21643 : Check format strings for internal types
21645 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21647 if $test X"$ivsize" = X8; then
21648 ivdformat="$sPRId64"
21649 uvuformat="$sPRIu64"
21650 uvoformat="$sPRIo64"
21651 uvxformat="$sPRIx64"
21652 uvXUformat="$sPRIXU64"
21654 if $test X"$ivsize" = X"$longsize"; then
21661 if $test X"$ivsize" = X"$intsize"; then
21669 if $test X"$ivsize" = X"$shortsize"; then
21680 if $test X"$usequadmath" = X"$define"; then
21688 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21689 nveformat="$sPRIeldbl"
21690 nvfformat="$sPRIfldbl"
21691 nvgformat="$sPRIgldbl"
21692 nvEUformat="$sPRIEUldbl"
21693 nvFUformat="$sPRIFUldbl"
21694 nvGUformat="$sPRIGUldbl"
21705 case "$ivdformat" in
21706 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21711 : Check format string for GID
21714 $echo "Checking the format string to be used for gids..." >&4
21717 -1) if $test X"$gidsize" = X"$ivsize"; then
21718 gidformat="$ivdformat"
21720 if $test X"$gidsize" = X"$longsize"; then
21723 if $test X"$gidsize" = X"$intsize"; then
21726 if $test X"$gidsize" = X"$shortsize"; then
21733 *) if $test X"$gidsize" = X"$uvsize"; then
21734 gidformat="$uvuformat"
21736 if $test X"$gidsize" = X"$longsize"; then
21739 if $test X"$gidsize" = X"$intsize"; then
21742 if $test X"$gidsize" = X"$shortsize"; then
21751 : see if getgroups exists
21752 set getgroups d_getgrps
21755 : see if setgroups exists
21756 set setgroups d_setgrps
21759 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21761 case "$d_getgrps$d_setgrps" in
21763 case "$groupstype" in
21764 '') dflt="$gidtype" ;;
21765 *) dflt="$groupstype" ;;
21768 What type of pointer is the second argument to getgroups() and setgroups()?
21769 Usually this is the same as group ids, $gidtype, but not always.
21772 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21776 *) groupstype="$gidtype";;
21779 : check whether make sets MAKE
21781 echo "Checking if your $make program sets \$(MAKE)..." >&4
21782 case "$make_set_make" in
21784 $sed 's/^X //' > testmake.mak << 'EOF'
21786 X @echo 'maketemp="$(MAKE)"'
21788 case "`$make -f testmake.mak 2>/dev/null`" in
21789 *maketemp=*) make_set_make='#' ;;
21790 *) make_set_make="MAKE=$make" ;;
21792 $rm -f testmake.mak
21795 case "$make_set_make" in
21796 '#') echo "Yup, it does.";;
21797 *) echo "Nope, it doesn't.";;
21800 : see what type is used for mode_t
21801 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21802 set mode_t modetype int stdio.h sys/types.h
21805 : see if we need va_copy
21807 case "$i_stdarg" in
21810 #include <stdarg.h>
21812 #$i_stdlib I_STDLIB
21814 #include <stdlib.h>
21816 #include <signal.h>
21819 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21821 return vfprintf(f, fmt, *valp);
21825 myvfprintf(FILE *f, const char *fmt, va_list val)
21827 return ivfprintf(f, fmt, &val);
21831 myprintf(char *fmt, ...)
21834 va_start(val, fmt);
21835 return myvfprintf(stdout, fmt, val);
21839 main(int ac, char **av)
21841 signal(SIGSEGV, exit);
21843 myprintf("%s%cs all right, then\n", "that", '\'');
21848 if eval $compile && $run ./try 2>&1 >/dev/null; then
21849 case "`$run ./try`" in
21850 "that's all right, then")
21856 yes) echo "It seems that you don't need va_copy()." >&4
21857 need_va_copy="$undef"
21859 *) echo "It seems that va_copy() or similar will be needed." >&4
21860 need_va_copy="$define"
21865 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21866 need_va_copy="$undef"
21870 : see what type is used for size_t
21871 rp="What is the type used for the length parameter for string functions?"
21872 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21875 : check for type of arguments to gethostbyaddr.
21876 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21877 case "$d_gethbyaddr" in
21881 Checking to see what type of arguments are accepted by gethostbyaddr().
21883 hdrs="$define sys/types.h
21884 $d_socket sys/socket.h
21885 $i_niin netinet/in.h
21887 $i_unistd unistd.h"
21888 : The first arg can 'char *' or 'void *'
21889 : The second arg is some of integral type
21890 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21891 for yyy in size_t long int; do
21892 case "$netdb_host_type" in
21893 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21894 if ./protochk "$try" $hdrs; then
21895 echo "Your system accepts $xxx for the first arg."
21896 echo "...and $yyy for the second arg."
21897 netdb_host_type="$xxx"
21898 netdb_hlen_type="$yyy"
21904 : In case none of those worked, prompt the user.
21905 case "$netdb_host_type" in
21906 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21909 netdb_host_type=$ans
21910 rp='What is the type for the 2nd argument to gethostbyaddr?'
21913 netdb_hlen_type=$ans
21917 *) : no gethostbyaddr, so pick harmless defaults
21918 netdb_host_type='char *'
21919 netdb_hlen_type="$sizetype"
21922 # Remove the "const" if needed. -- but then we'll have a
21924 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21927 : check for type of argument to gethostbyname.
21928 if test "X$netdb_name_type" = X ; then
21929 case "$d_gethbyname" in
21933 Checking to see what type of argument is accepted by gethostbyname().
21935 hdrs="$define sys/types.h
21936 $d_socket sys/socket.h
21937 $i_niin netinet/in.h
21939 $i_unistd unistd.h"
21940 for xxx in "const char *" "char *"; do
21941 case "$netdb_name_type" in
21942 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21943 if ./protochk "$try" $hdrs; then
21944 echo "Your system accepts $xxx."
21945 netdb_name_type="$xxx"
21950 : In case none of those worked, prompt the user.
21951 case "$netdb_name_type" in
21952 '') rp='What is the type for the 1st argument to gethostbyname?'
21955 netdb_name_type=$ans
21959 *) : no gethostbyname, so pick harmless default
21960 netdb_name_type='char *'
21965 : check for type of 1st argument to getnetbyaddr.
21966 if test "X$netdb_net_type" = X ; then
21967 case "$d_getnbyaddr" in
21971 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21973 hdrs="$define sys/types.h
21974 $d_socket sys/socket.h
21975 $i_niin netinet/in.h
21977 $i_unistd unistd.h"
21978 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21979 case "$netdb_net_type" in
21980 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21981 if ./protochk "$try" $hdrs; then
21982 echo "Your system accepts $xxx."
21983 netdb_net_type="$xxx"
21988 : In case none of those worked, prompt the user.
21989 case "$netdb_net_type" in
21990 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21993 netdb_net_type=$ans
21997 *) : no getnetbyaddr, so pick harmless default
21998 netdb_net_type='long'
22002 : locate the preferred pager for this system
22009 [a-zA-Z]:/*) dflt=$pg;;
22013 [a-zA-Z]:/*) dflt=$more;;
22017 [a-zA-Z]:/*) dflt=$less;;
22020 '') dflt=/usr/ucb/more;;
22028 rp='What pager is used on your system?'
22032 : see if ar generates random libraries by itself
22034 echo "Checking how to generate random libraries on your machine..." >&4
22035 echo 'int bar1() { return bar2(); }' > bar1.c
22036 echo 'int bar2() { return 2; }' > bar2.c
22038 #$i_stdlib I_STDLIB
22040 #include <stdlib.h>
22042 int main() { printf("%d\n", bar1()); exit(0); }
22044 $cc $ccflags -c bar1.c >/dev/null 2>&1
22045 $cc $ccflags -c bar2.c >/dev/null 2>&1
22046 $cc $ccflags -c foo.c >/dev/null 2>&1
22047 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
22048 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22049 $run ./foobar >/dev/null 2>&1; then
22050 echo "$ar appears to generate random libraries itself."
22052 if [ "X$ranlib" = "X" ]; then
22055 elif $ar s bar$_a >/dev/null 2>&1 &&
22056 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22057 $run ./foobar >/dev/null 2>&1; then
22058 echo "a table of contents needs to be added with '$ar s'."
22061 elif $ar ts bar$_a >/dev/null 2>&1 &&
22062 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22063 $run ./foobar >/dev/null 2>&1; then
22064 echo "a table of contents needs to be added with '$ar ts'."
22071 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22072 $test -f $ranlib || ranlib=''
22075 if $test -n "$ranlib"; then
22076 echo "your system has '$ranlib'; we'll use that."
22079 echo "your system doesn't seem to support random libraries"
22080 echo "so we'll use lorder and tsort to order the libraries."
22087 : see if this is a values.h system
22088 set values.h i_values
22091 : Check the max offset that gmtime and localtime accept
22092 echo "Checking max offsets that gmtime () accepts"
22095 define) yyy="#include <values.h>" ;;
22099 case "$sGMTIME_min/$sGMTIME_max" in
22102 #include <sys/types.h>
22111 void gm_check (time_t t, int min_year, int max_year)
22114 if ( tmp == NULL ||
22115 /* Check tm_year overflow */
22116 tmp->tm_year < min_year || tmp->tm_year > max_year)
22127 gm_check (MAXLONG, 69, 0x7fffffff);
22129 if (tmp == NULL || tmp->tm_year < 0) {
22130 for (i = 63; i >= 0; i--) {
22131 time_t x = pt | ((time_t)1 << i);
22132 if (x < 0 || x < pt) continue;
22133 gm_check (x, 69, 0x7fffffff);
22136 printf ("sGMTIME_max=%ld\n", pt);
22145 gm_check (MINLONG, -1900, 70);
22148 for (i = 36; i >= 0; i--) {
22149 time_t x = pt - ((time_t)1 << i);
22150 if (x > 0) continue;
22151 gm_check (x, -1900, 70);
22154 printf ("sGMTIME_min=%ld\n", pt);
22158 int main (int argc, char *argv[])
22160 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22167 if eval $compile; then
22168 eval `$run ./try 2>/dev/null`
22170 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22176 echo "Checking max offsets that localtime () accepts"
22178 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22181 #include <sys/types.h>
22190 void local_check (time_t t, int min_year, int max_year)
22192 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22195 tmp = localtime (&t);
22196 if ( tmp == NULL ||
22197 /* Check tm_year overflow */
22198 tmp->tm_year < min_year || tmp->tm_year > max_year)
22202 } /* local_check */
22209 local_check (MAXLONG, 69, 0x7fffffff);
22211 if (tmp == NULL || tmp->tm_year < 0) {
22212 for (i = 63; i >= 0; i--) {
22213 time_t x = pt | ((time_t)1 << i);
22214 if (x < 0 || x < pt) continue;
22215 local_check (x, 69, 0x7fffffff);
22218 printf ("sLOCALTIME_max=%ld\n", pt);
22227 local_check (MINLONG, -1900, 70);
22230 for (i = 36; i >= 0; i--) {
22231 time_t x = pt - ((time_t)1 << i);
22232 if (x > 0) continue;
22233 local_check (x, -1900, 70);
22236 printf ("sLOCALTIME_min=%ld\n", pt);
22240 int main (int argc, char *argv[])
22248 if eval $compile; then
22249 eval `$run ./try 2>/dev/null`
22251 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22257 : check for type of arguments to select.
22258 case "$selecttype" in
22259 '') case "$d_select" in
22263 Checking to see what type of arguments are accepted by select().
22265 hdrs="$define sys/types.h
22266 $i_systime sys/time.h
22267 $i_sysselct sys/select.h
22268 $d_socket sys/socket.h"
22269 : The first arg can be int, unsigned, or size_t
22270 : The last arg may or may not be 'const'
22272 : void pointer has been seen but using that
22273 : breaks the selectminbits test
22274 for xxx in 'fd_set *' 'int *'; do
22275 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22276 for tmo in 'struct timeval *' 'const struct timeval *'; do
22278 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22279 if ./protochk "$try" $hdrs; then
22280 echo "Your system accepts $xxx."
22289 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22290 case "$d_fd_set" in
22291 $define) dflt="fd_set *" ;;
22300 *) : no select, so pick a harmless default
22307 : check for the select 'width'
22308 case "$selectminbits" in
22309 '') safebits=`expr $ptrsize \* 8`
22310 case "$d_select" in
22314 Checking to see on how many bits at a time your select() operates...
22317 #include <sys/types.h>
22319 #$i_systime I_SYS_TIME
22320 #$i_systimek I_SYS_TIME_KERNEL
22325 # ifdef I_SYS_TIME_KERNEL
22328 # include <sys/time.h>
22329 # ifdef I_SYS_TIME_KERNEL
22333 #$i_sysselct I_SYS_SELECT
22334 #ifdef I_SYS_SELECT
22335 #include <sys/select.h>
22337 #$d_socket HAS_SOCKET
22339 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22342 #$i_stdlib I_STDLIB
22344 #include <stdlib.h>
22347 #define S sizeof(*(b))
22349 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22350 #define NBITS (NBYTES * 8)
22352 char *s = (char *)malloc(NBYTES);
22361 fp = fopen("try.c", "r");
22367 b = ($selecttype)s;
22368 for (i = 0; i < NBITS; i++)
22372 select(fd + 1, b, 0, 0, &t);
22373 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22375 printf("%d\n", i + 1);
22380 if eval $compile_ok; then
22381 selectminbits=`$run ./try 2>/dev/null`
22382 case "$selectminbits" in
22384 Cannot figure out on how many bits at a time your select() operates.
22385 I'll play safe and guess it is $safebits bits.
22387 selectminbits=$safebits
22388 bits="$safebits bits"
22391 *) bits="$selectminbits bits" ;;
22393 echo "Your select() operates on $bits at a time." >&4
22395 rp='What is the minimum number of bits your select() operates on?'
22396 case "$byteorder" in
22397 12345678) dflt=64 ;;
22403 selectminbits="$val"
22407 *) : no select, so pick a harmless default
22408 selectminbits=$safebits
22414 : Trace out the files included by signal.h, then look for SIGxxx names.
22415 case "$sig_num_init" in
22417 if [ "X$fieldn" = X ]; then
22418 : Just make some guesses. We check them later.
22419 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22421 xxx=`echo '#include <signal.h>' |
22422 $cppstdin $cppminus $cppflags 2>/dev/null |
22423 $grep '^[ ]*#.*include' |
22424 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22425 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22428 for xx in $xxx /dev/null ; do
22429 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22431 case "$xxxfiles" in
22432 '') xxxfiles=`./findhdr signal.h` ;;
22435 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22436 print substr($2, 4, 20)
22438 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22439 print substr($3, 4, 20)
22441 : Append some common names just in case the awk scan failed.
22442 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22443 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22444 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22445 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22446 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22448 : generate a few handy files for later
22449 $cat > signal.c <<EOCP
22450 #include <sys/types.h>
22451 #include <signal.h>
22452 #$i_stdlib I_STDLIB
22454 #include <stdlib.h>
22459 /* Strange style to avoid deeply-nested #if/#else/#endif */
22462 # define NSIG (_NSIG)
22468 # define NSIG (SIGMAX+1)
22474 # define NSIG (SIG_MAX+1)
22480 # define NSIG (_SIG_MAX+1)
22486 # define NSIG (MAXSIG+1)
22492 # define NSIG (MAX_SIG+1)
22497 # ifdef SIGARRAYSIZE
22498 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22504 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22508 /* Default to some arbitrary number that's big enough to get most
22509 of the common signals.
22515 printf("NSIG %d\n", NSIG);
22521 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22523 printf "#ifdef SIG"; printf $1; printf "\n"
22524 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22525 printf $1; printf ");\n"
22529 printf "#endif /* JUST_NSIG */\n";
22530 printf "exit(0);\n}\n";
22533 $cat >signal.awk <<'EOP'
22534 BEGIN { ndups = 0 }
22535 $1 ~ /^NSIG$/ { nsig = $2 }
22536 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22537 if ($2 > maxsig) { maxsig = $2 }
22538 if (sig_name[$2]) {
22539 dup_name[ndups] = $1
22540 dup_num[ndups] = $2
22552 printf("NSIG %d\n", nsig);
22553 for (n = 1; n < nsig; n++) {
22555 printf("%s %d\n", sig_name[n], sig_num[n])
22558 printf("NUM%d %d\n", n, n)
22561 for (n = 0; n < ndups; n++) {
22562 printf("%s %d\n", dup_name[n], dup_num[n])
22566 $cat >signal_cmd <<EOS
22568 if $test -s signal.lst; then
22569 echo "Using your existing signal.lst file"
22574 $cat >>signal_cmd <<'EOS'
22577 if eval $compile_ok; then
22578 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22579 $uniq | $awk -f signal.awk >signal.lst
22581 echo "(I can't seem be able to compile the whole test program)" >&4
22582 echo "(I'll try it in little pieces.)" >&4
22583 set signal -DJUST_NSIG
22584 if eval $compile_ok; then
22585 $run ./signal$_exe > signal.nsg
22588 echo "I can't seem to figure out how many signals you have." >&4
22589 echo "Guessing 50." >&4
22590 echo 'NSIG 50' > signal.nsg
22592 : Now look at all the signal names, one at a time.
22593 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22594 $cat > signal.c <<EOCP
22595 #include <sys/types.h>
22596 #include <signal.h>
22599 printf("$xx %d\n", SIG${xx});
22604 if eval $compile; then
22605 echo "SIG${xx} found."
22606 $run ./signal$_exe >> signal.ls1
22608 echo "SIG${xx} NOT found."
22611 if $test -s signal.ls1; then
22612 $cat signal.nsg signal.ls1 |
22613 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22617 if $test -s signal.lst; then
22620 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22621 echo 'kill -l' >signal
22622 set X `csh -f <signal`
22626 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22628 echo $@ | $tr ' ' $trnl | \
22629 $awk '{ printf "%s %d\n", $1, ++s; }
22630 END { printf "NSIG %d\n", ++s }' >signal.lst
22632 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22634 chmod a+x signal_cmd
22635 $eunicefix signal_cmd
22639 : generate list of signal names
22640 case "$sig_num_init" in
22643 case "$sig_name_init" in
22645 *) case "$sig_num_init" in
22646 ''|*,*) doinit=yes ;;
22651 echo "Generating a list of signal names and numbers..." >&4
22653 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22654 sig_name=`$awk 'BEGIN { printf "ZERO " }
22655 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22656 sig_num=`$awk 'BEGIN { printf "0 " }
22657 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22658 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22659 !/^NSIG/ { printf "\"%s\", ", $1 }
22660 END { printf "0\n" }' signal.lst`
22661 sig_num_init=`$awk 'BEGIN { printf "0, " }
22662 !/^NSIG/ { printf "%d, ", $2}
22663 END { printf "0\n"}' signal.lst`
22666 echo "The following $sig_count signals are available:"
22668 echo $sig_name | $awk \
22669 'BEGIN { linelen = 0 }
22671 for (i = 1; i <= NF; i++) {
22672 name = "SIG" $i " "
22673 linelen = linelen + length(name)
22674 if (linelen > 70) {
22676 linelen = length(name)
22682 sig_size=`echo $sig_name | awk '{print NF}'`
22683 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22687 : Check size of size
22689 case "$sizetype" in
22690 *_t) zzz="$sizetype" ;;
22691 *) zzz="filesize" ;;
22693 echo "Checking the size of $zzz..." >&4
22695 #include <sys/types.h>
22697 #$i_stdlib I_STDLIB
22699 #include <stdlib.h>
22702 printf("%d\n", (int)sizeof($sizetype));
22707 if eval $compile_ok; then
22711 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22714 echo "Your $zzz size is $sizesize bytes."
22719 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22723 : check for socklen_t
22725 echo "Checking to see if you have socklen_t..." >&4
22727 #include <sys/types.h>
22728 #$d_socket HAS_SOCKET
22730 #include <sys/socket.h>
22732 int main() { socklen_t x = 16; }
22735 if eval $compile; then
22737 echo "You have socklen_t."
22740 echo "You do not have socklen_t."
22741 case "$sizetype" in
22742 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22749 : see if this is a socks.h system
22750 set socks.h i_socks
22753 : check for type of the size argument to socket calls
22754 case "$d_socket" in
22758 Checking to see what type is the last argument of accept().
22761 case "$d_socklen_t" in
22762 "$define") yyy="$yyy socklen_t"
22764 yyy="$yyy $sizetype int long unsigned"
22765 for xxx in $yyy; do
22766 case "$socksizetype" in
22767 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22768 case "$usesocks" in
22770 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22771 echo "Your system accepts '$xxx *' for the last argument of accept()."
22772 socksizetype="$xxx"
22775 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22776 echo "Your system accepts '$xxx *' for the last argument of accept()."
22777 socksizetype="$xxx"
22784 : In case none of those worked, prompt the user.
22785 case "$socksizetype" in
22786 '') rp='What is the type for socket address structure sizes?'
22793 *) : no sockets, so pick relatively harmless default
22798 : see what type is used for signed size_t
22799 set ssize_t ssizetype int stdio.h sys/types.h
22804 #$i_stdlib I_STDLIB
22806 #include <stdlib.h>
22808 #include <sys/types.h>
22809 #define Size_t $sizetype
22810 #define SSize_t $dflt
22813 if (sizeof(Size_t) == sizeof(SSize_t))
22815 else if (sizeof(Size_t) == sizeof(int))
22824 if eval $compile_ok && $run ./try > /dev/null; then
22825 ssizetype=`$run ./try`
22826 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22829 Help! I can't compile and run the ssize_t test program: please enlighten me!
22830 (This is probably a misconfiguration in your system or libraries, and
22831 you really ought to fix it. Still, I'll try anyway.)
22833 I need a type that is the same size as $sizetype, but is guaranteed to
22834 be signed. Common values are ssize_t, int and long.
22837 rp="What signed type is the same size as $sizetype?"
22843 : Check the size of st_ino
22845 $echo "Checking the size of st_ino..." >&4
22846 $cat > try.c <<EOCP
22847 #include <sys/stat.h>
22849 #$i_stdlib I_STDLIB
22851 #include <stdlib.h>
22855 printf("%d\n", (int)sizeof(st.st_ino));
22860 if eval $compile_ok; then
22864 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22866 *) st_ino_size=$val
22867 $echo "Your st_ino is $st_ino_size bytes long."
22872 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22876 : Check if st_ino is signed
22878 $echo "Checking the sign of st_ino..." >&4
22879 $cat > try.c <<EOCP
22880 #include <sys/stat.h>
22885 if (foo.st_ino < 0)
22892 if eval $compile; then
22896 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22898 *) st_ino_sign=$val
22899 case "$st_ino_sign" in
22900 1) $echo "Your st_ino is unsigned." ;;
22901 -1) $echo "Your st_ino is signed." ;;
22907 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22911 : see what type of char stdio uses.
22913 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22914 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22915 echo "Your stdio uses unsigned chars." >&4
22916 stdchar="unsigned char"
22918 echo "Your stdio uses signed chars." >&4
22923 : Check size of UID
22926 *_t) zzz="$uidtype" ;;
22929 echo "Checking the size of $zzz..." >&4
22931 #include <sys/types.h>
22933 #$i_stdlib I_STDLIB
22935 #include <stdlib.h>
22938 printf("%d\n", (int)sizeof($uidtype));
22943 if eval $compile_ok; then
22947 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22950 echo "Your $zzz is $uidsize bytes long."
22955 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22958 : Check if UID is signed
22961 *_t) zzz="$uidtype" ;;
22964 echo "Checking the sign of $zzz..." >&4
22966 #include <sys/types.h>
22977 if eval $compile; then
22981 echo "(I can't execute the test program--guessing unsigned.)" >&4
22985 1) echo "Your $zzz is unsigned." ;;
22986 -1) echo "Your $zzz is signed." ;;
22992 echo "(I can't compile the test program--guessing unsigned.)" >&4
22996 : Check format string for UID
22998 $echo "Checking the format string to be used for uids..." >&4
23001 -1) if $test X"$uidsize" = X"$ivsize"; then
23002 uidformat="$ivdformat"
23004 if $test X"$uidsize" = X"$longsize"; then
23007 if $test X"$uidsize" = X"$intsize"; then
23010 if $test X"$uidsize" = X"$shortsize"; then
23017 *) if $test X"$uidsize" = X"$uvsize"; then
23018 uidformat="$uvuformat"
23020 if $test X"$uidsize" = X"$longsize"; then
23023 if $test X"$uidsize" = X"$intsize"; then
23026 if $test X"$uidsize" = X"$shortsize"; then
23035 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
23037 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
23038 $cat >try.c <<'EOM'
23039 /* Intentionally a long probe as I'd like to sanity check that the exact
23040 approach is going to work, as thinking it will work, but only having it
23041 part working at runtime is worse than not having it. */
23043 #include <sys/types.h>
23044 #include <sys/sysctl.h>
23045 #include <sys/param.h>
23047 #include <string.h>
23048 #include <stdlib.h>
23049 #include <unistd.h>
23052 main(int argc, char **argv) {
23054 char *argv_leaf = strrchr(argv[0], '/');
23060 mib[1] = KERN_PROC;
23061 mib[2] = KERN_PROC_PATHNAME;
23065 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23069 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23074 if (size < strlen(argv_leaf) + 1) {
23075 fprintf(stderr, "size %lu is too short for a path\n",
23076 (unsigned long) size);
23080 if (size > MAXPATHLEN * MAXPATHLEN) {
23081 fprintf(stderr, "size %lu is too long for a path\n",
23082 (unsigned long) size);
23086 buffer = (char *)malloc(size);
23092 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23097 if (strlen(buffer) + 1 != size) {
23098 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23099 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23104 if (*buffer != '/') {
23105 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23109 if (strstr(buffer, "/./")) {
23110 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23114 if (strstr(buffer, "/../")) {
23115 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23119 buffer_leaf = strrchr(buffer, '/');
23120 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23121 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23133 if eval $compile; then
23134 if $run ./try; then
23135 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23138 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23142 echo "I'm unable to compile the test program." >&4
23143 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23147 set usekernprocpathname
23150 : Determine if we can use _NSGetExecutablePath to find executing program
23152 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23153 $cat >try.c <<'EOM'
23154 /* Intentionally a long probe as I'd like to sanity check that the exact
23155 approach is going to work, as thinking it will work, but only having it
23156 part working at runtime is worse than not having it. */
23157 #include <mach-o/dyld.h>
23159 #include <stdlib.h>
23160 #include <sys/param.h>
23161 #include <string.h>
23164 main(int argc, char **argv) {
23166 uint32_t size = sizeof(buf);
23170 char *argv_leaf = strrchr(argv[0], '/');
23174 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23178 _NSGetExecutablePath(buf, &size);
23179 if (size > MAXPATHLEN * MAXPATHLEN) {
23180 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23181 (unsigned int) size);
23185 buffer = (char *)malloc(size);
23191 result = _NSGetExecutablePath(buffer, &size);
23193 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23194 result, (unsigned int) size);
23198 tidied = realpath(buffer, NULL);
23200 perror("realpath");
23206 if (*tidied != '/') {
23207 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23211 if (strstr(tidied, "/./")) {
23212 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23216 if (strstr(tidied, "/../")) {
23217 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23221 tidied_leaf = strrchr(tidied, '/');
23222 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23223 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23235 if eval $compile; then
23236 if $run ./try; then
23237 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23240 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23243 echo "I'm unable to compile the test program." >&4
23244 echo "I'll assume no _NSGetExecutablePath here." >&4
23247 set usensgetexecutablepath
23250 : Check if site customization support was requested
23251 case "$usesitecustomize" in
23252 $define|true|[Yy]*)
23253 usesitecustomize="$define"
23256 usesitecustomize="$undef"
23260 : see if prototypes support variable argument declarations
23262 case "$prototype$i_stdarg" in
23264 echo "It appears we'll be able to prototype varargs functions." >&4
23268 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23275 : determine compiler compiler
23284 if $test -f "$byacc$_exe"; then
23286 comp="byacc or $comp"
23288 if $test -f "$bison$_exe"; then
23289 comp="$comp or bison -y"
23291 rp="Which compiler compiler ($comp) shall I use?"
23300 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23306 : see if this is a assert.h system
23307 set assert.h i_assert
23310 : see if this is a bfd.h system
23314 : see if this is an execinfo.h system
23315 set execinfo.h i_execinfo
23318 : see if this is a fenv.h system
23322 : see if this is a fp.h system
23326 : see if this is a fp_class.h system
23327 set fp_class.h i_fp_class
23330 : see if gdbm.h is available
23335 : see if gdbm_open exists
23336 set gdbm_open d_gdbm_open
23338 case "$d_gdbm_open" in
23341 echo "We won't be including <gdbm.h>"
23350 : see if this is a ieeefp.h system
23351 case "$i_ieeefp" in
23352 '' ) set ieeefp.h i_ieeefp
23357 : see if this is a libutil.h system
23358 set libutil.h i_libutil
23361 : see if mach cthreads are available
23362 if test "X$usethreads" = "X$define"; then
23363 set mach/cthreads.h i_machcthr
23366 i_machcthr="$undef"
23369 : see if this is a mntent.h system
23370 set mntent.h i_mntent
23373 : see if net/errno.h is available
23375 set net/errno.h val
23378 : Unfortunately, it causes problems on some systems. Arrgh.
23381 cat > try.c <<'EOM'
23384 #include <net/errno.h>
23390 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23391 echo "We'll be including <net/errno.h>." >&4
23393 echo "We won't be including <net/errno.h>." >&4
23402 : see if netinet/tcp.h is available
23403 set netinet/tcp.h i_netinettcp
23406 : see if this is a poll.h system
23410 : see if this is a prot.h system
23414 : Preprocessor symbols
23416 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23417 $cat <<'EOSH' > Cppsym.know
23418 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23419 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23420 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23421 arch_pwr ardent ARM ARM32 atarist att386 att3b
23422 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23423 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23424 byteorder byte_order
23425 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23426 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23427 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23428 ELF encore EPI EXTENSIONS
23429 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23430 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23431 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23432 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23433 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23434 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23435 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23436 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23437 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23439 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23440 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23441 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23443 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23444 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23445 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23446 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23447 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23448 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23449 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23450 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23451 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23452 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23453 ns32000 ns32016 ns32332 ns32k nsc32000
23454 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23455 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23456 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23457 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23459 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23460 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23461 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23462 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23463 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23464 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23465 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23466 SYSV4 SYSV5 sysV68 sysV88
23467 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23468 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23469 tower32_800 tower32_850 tss
23470 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23471 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23472 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23473 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23474 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23475 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23477 vax venix VMESA vms
23478 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23479 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23482 # Maybe put other stuff here too.
23483 ./tr '-' '_' <<EOSH >>Cppsym.know
23486 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23487 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23488 $cat Cppsym.know > Cppsym.c
23489 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23490 $rm -f Cppsym.a Cppsym.b Cppsym.c
23491 cat <<EOSH > Cppsym
23493 if $test \$# -gt 0; then
23494 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23495 if $test -s Cppsym.got; then
23502 $tr " " "$trnl" | ./Cppsym.try
23508 cat <<EOSH > Cppsym.try
23510 cat <<'EOCP' > try.c
23513 #define STRINGIFY(a) "a"
23515 #if cpp_stuff == 42
23516 #define StGiFy(a) #a
23517 #define STRINGIFY(a) StGiFy(a)
23519 #if $cpp_stuff != 1 && $cpp_stuff != 42
23520 # include "Bletch: How does this C preprocessor stringify macros?"
23526 cat <<'EOSH' >> Cppsym.try
23528 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23529 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23530 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23531 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23533 echo 'return 0;}' >> try.c
23535 cat <<EOSH >> Cppsym.try
23537 case "$osname-$gccversion" in
23538 irix-) ccflags="\$ccflags -woff 1178" ;;
23539 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23541 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23543 chmod +x Cppsym.try
23544 $eunicefix Cppsym.try
23545 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23546 : Add in any Linux cpp "predefined macros":
23547 case "$osname::$gccversion" in
23548 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23550 rm -f $tHdrH'.h' $tHdrH
23552 # Filter out macro arguments, such as Linux's __INT8_C(c)
23553 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23554 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23555 if [ -s $tHdrH'_cppsym.real' ]; then
23556 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23559 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23562 : now check the C compiler for additional symbols
23563 postprocess_cc_v=''
23565 aix) postprocess_cc_v="|$tr , ' '" ;;
23572 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23575 -D*) echo "\$i" | $sed 's/^-D//';;
23576 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23581 postprocess_cc_v=''
23584 ./ccsym > ccsym1.raw
23585 if $test -s ccsym1.raw; then
23586 $sort ccsym1.raw | $uniq >ccsym.raw
23588 mv ccsym1.raw ccsym.raw
23591 $awk '/\=/ { print $0; next }
23592 { print $0"=1" }' ccsym.raw >ccsym.list
23593 $comm -13 Cppsym.true ccsym.list >ccsym.own
23594 $comm -12 Cppsym.true ccsym.list >ccsym.com
23595 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23597 if $test -z ccsym.raw; then
23598 echo "Your C compiler doesn't seem to define any symbols!" >&4
23600 echo "However, your C preprocessor defines the following symbols:"
23603 cppsymbols=`$cat Cppsym.true`
23604 cppsymbols=`echo $cppsymbols`
23605 cppccsymbols="$cppsymbols"
23607 if $test -s ccsym.com; then
23608 echo "Your C compiler and pre-processor define these symbols:"
23609 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23612 cppccsymbols=`$cat ccsym.com`
23613 cppccsymbols=`echo $cppccsymbols`
23614 $test "$silent" || sleep 1
23616 if $test -s ccsym.cpp; then
23617 $test "$also" && echo " "
23618 echo "Your C pre-processor ${also}defines the following symbols:"
23619 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23621 cppsymbols=`$cat ccsym.cpp`
23622 cppsymbols=`echo $cppsymbols`
23623 $test "$silent" || sleep 1
23625 if $test -s ccsym.own; then
23626 $test "$also" && echo " "
23627 echo "Your C compiler ${also}defines the following cpp symbols:"
23628 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23629 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23630 ccsymbols=`$cat ccsym.own`
23631 ccsymbols=`echo $ccsymbols`
23632 $test "$silent" || sleep 1
23636 : add -D_FORTIFY_SOURCE if feasible and not already there
23637 case "$gccversion" in
23638 [4567].*) case "$optimize$ccflags" in
23639 *-O*) case "$ccflags$cppsymbols" in
23640 *_FORTIFY_SOURCE=*) # Don't add it again.
23641 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23643 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23644 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23648 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23652 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23656 : see if this is a termio system
23660 if $test `./findhdr termios.h`; then
23661 set tcsetattr i_termios
23667 "$define") echo "You have POSIX termios.h... good!" >&4;;
23668 *) if ./Cppsym pyr; then
23669 case "`$run /bin/universe`" in
23670 ucb) if $test `./findhdr sgtty.h`; then
23672 echo "<sgtty.h> found." >&4
23674 echo "System is pyramid with BSD universe."
23675 ./warn "<sgtty.h> not found--you could have problems."
23677 *) if $test `./findhdr termio.h`; then
23679 echo "<termio.h> found." >&4
23681 echo "System is pyramid with USG universe."
23682 ./warn "<termio.h> not found--you could have problems."
23686 if $test `./findhdr termio.h`; then
23687 echo "<termio.h> found." >&4
23689 elif $test `./findhdr sgtty.h`; then
23690 echo "<sgtty.h> found." >&4
23693 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23696 if $test `./findhdr sgtty.h`; then
23697 echo "<sgtty.h> found." >&4
23699 elif $test `./findhdr termio.h`; then
23700 echo "<termio.h> found." >&4
23703 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23707 set i_termio; eval $setvar
23708 val=$val2; set i_sgtty; eval $setvar
23709 val=$val3; set i_termios; eval $setvar
23711 : see if stdbool is available
23712 : we want a real compile instead of Inhdr because some Solaris systems
23713 : have stdbool.h, but it can only be used if the compiler indicates it
23714 : is sufficiently c99-compliant.
23718 #include <stdbool.h>
23723 int main(int argc, char **argv)
23729 if eval $compile; then
23730 echo "<stdbool.h> found." >&4
23733 echo "<stdbool.h> NOT found." >&4
23740 : see if stddef is available
23741 set stddef.h i_stddef
23744 : see if stdint is available
23745 set stdint.h i_stdint
23748 : see if sys/access.h is available
23749 set sys/access.h i_sysaccess
23752 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23753 set sys/filio.h i_sysfilio
23756 if $test `./findhdr sys/ioctl.h`; then
23758 echo '<sys/ioctl.h> found.' >&4
23761 if $test $i_sysfilio = "$define"; then
23762 echo '<sys/ioctl.h> NOT found.' >&4
23764 $test $i_sgtty = "$define" && xxx="sgtty.h"
23765 $test $i_termio = "$define" && xxx="termio.h"
23766 $test $i_termios = "$define" && xxx="termios.h"
23767 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23773 : see if socket ioctl defs are in sys/sockio.h
23775 xxx=`./findhdr sys/sockio.h`
23776 if $test "$xxx"; then
23777 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23779 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23782 echo "No socket ioctls found in <sys/sockio.h>." >&4
23787 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23793 : see if this is a syslog.h system
23794 set syslog.h i_syslog
23797 : see if this is a sys/mode.h system
23798 set sys/mode.h i_sysmode
23801 : see if there is a sys/poll.h file
23802 set sys/poll.h i_syspoll
23805 : see if sys/resource.h has to be included
23806 set sys/resource.h i_sysresrc
23809 : see if sys/security.h is available
23810 set sys/security.h i_syssecrt
23813 : see if this is a sys/statvfs.h system
23814 set sys/statvfs.h i_sysstatvfs
23817 : see if this is a sys/un.h system
23818 set sys/un.h i_sysun
23821 : see if this is a sys/utsname.h system
23822 set sys/utsname.h i_sysutsname
23825 : see if this is a syswait system
23826 set sys/wait.h i_syswait
23829 : see if this is a ustat.h system
23830 set ustat.h i_ustat
23833 : see if this is an utime system
23834 set utime.h i_utime
23837 : see if this is a vfork system
23840 set vfork.h i_vfork
23850 echo "Looking for extensions..." >&4
23851 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23852 : contain old or inaccurate or duplicate values.
23853 nonxs_extensions=''
23855 : We do not use find because it might not be available.
23856 : We do not just use MANIFEST because the user may have dropped
23857 : some additional extensions into the source tree and expect them
23860 : Function to recursively find available extensions, ignoring DynaLoader
23861 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23862 : In 5.10.1 and later, extensions are stored in directories
23863 : like File-Glob instead of the older File/Glob/.
23867 DynaLoader|dynaload) ;;
23869 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23870 case "$this_ext" in
23871 Scalar/List/Utils) this_ext="List/Util" ;;
23872 PathTools) this_ext="Cwd" ;;
23874 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23875 if $contains " $this_ext " "$tdir/$$.tmp"; then
23877 echo "Duplicate directories detected for extension $xxx" >&4;
23878 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23879 case "$knowitall" in
23887 echo "Ok. Stopping Configure." >&4;
23888 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23891 echo "Ok. You will need to correct config.sh before running make." >&4;
23893 $ls -1 "$xxx" > "$tdir/$$.tmp";
23894 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23895 xs_extensions="$xs_extensions $this_ext";
23896 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23897 xs_extensions="$xs_extensions $this_ext";
23898 elif $test -d "$xxx"; then
23899 nonxs_extensions="$nonxs_extensions $this_ext";
23901 $rm -f "$tdir/$$.tmp";
23909 eval $find_extensions
23913 eval $find_extensions
23917 eval $find_extensions
23918 set X $xs_extensions
23920 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23921 set X $nonxs_extensions
23923 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23925 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23927 : Now see which are supported on this system.
23929 for xxx in $xs_extensions ; do
23933 amigaos) avail_ext="$avail_ext $xxx" ;;
23938 $define) avail_ext="$avail_ext $xxx" ;;
23941 GDBM_File|gdbm_fil)
23943 $define) avail_ext="$avail_ext $xxx" ;;
23946 I18N/Langinfo|i18n_lan)
23947 case "$i_langinfo$d_nl_langinfo" in
23948 $define$define) avail_ext="$avail_ext $xxx" ;;
23952 : XXX Do we need a useipcsysv variable here
23953 case "${d_msg}${d_sem}${d_shm}" in
23954 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23957 NDBM_File|ndbm_fil)
23960 case "$osname-$use64bitint" in
23963 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23966 *) avail_ext="$avail_ext $xxx" ;;
23971 ODBM_File|odbm_fil)
23972 case "${i_dbm}${i_rpcsvcdbm}" in
23974 case "$d_cplusplus" in
23975 define) ;; # delete as a function name will not work
23976 *) case "$osname-$use64bitint" in
23979 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23982 *) avail_ext="$avail_ext $xxx" ;;
23990 case "$useopcode" in
23991 true|define|y) avail_ext="$avail_ext $xxx" ;;
23995 case "$useposix" in
23996 true|define|y) avail_ext="$avail_ext $xxx" ;;
24000 case "$d_socket" in
24001 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24004 Sys/Syslog|sys/syslog)
24006 amigaos) ;; # not really very useful on AmigaOS
24008 : XXX syslog requires socket
24009 case "$d_socket" in
24010 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24016 case "$usethreads" in
24018 case "$use5005threads" in
24019 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
24023 threads|threads/shared)
24024 # threads and threads::shared are special cases.
24025 # To stop people from asking "Perl 5.8.0 was supposed
24026 # to have this new fancy threads implementation but my
24027 # perl doesn't have it" and from people trying to
24028 # (re)install the threads module using CPAN.pm and
24029 # CPAN.pm then offering to reinstall Perl 5.8.0,
24030 # the threads.pm and threads/shared.pm will always be
24031 # there, croaking informatively ("you need to rebuild
24032 # all of Perl with threads, sorry") when threads haven't
24033 # been compiled in.
24035 avail_ext="$avail_ext $xxx"
24041 cygwin) avail_ext="$avail_ext $xxx" ;;
24044 XS/APItest|xs/apitest)
24045 # This is just for testing. Skip it unless we have dynamic loading.
24048 $define) avail_ext="$avail_ext $xxx" ;;
24051 XS/Typemap|xs/typemap)
24052 # This is just for testing. Skip it unless we have dynamic loading.
24054 $define) avail_ext="$avail_ext $xxx" ;;
24057 *) avail_ext="$avail_ext $xxx"
24066 case "$onlyextensions" in
24068 *) keepextensions=''
24069 echo "You have requested that only certain extensions be included..." >&4
24070 for i in $onlyextensions; do
24071 case " $avail_ext " in
24073 echo "Keeping extension $i."
24074 keepextensions="$keepextensions $i"
24076 *) echo "Ignoring extension $i." ;;
24079 avail_ext="$keepextensions"
24083 case "$noextensions" in
24085 *) keepextensions=''
24086 echo "You have requested that certain extensions be ignored..." >&4
24087 for i in $avail_ext; do
24088 case " $noextensions " in
24089 *" $i "*) echo "Ignoring extension $i." ;;
24090 *) echo "Keeping extension $i.";
24091 keepextensions="$keepextensions $i"
24095 avail_ext="$keepextensions"
24099 : Now see which nonxs extensions are supported on this system.
24100 : For now assume all are.
24102 for xxx in $nonxs_extensions ; do
24106 *) nonxs_ext="$nonxs_ext $xxx"
24118 A number of extensions are supplied with $package. You may choose to
24119 compile these extensions for dynamic loading (the default), compile
24120 them into the $package executable (static loading), or not include
24121 them at all. Answer "none" to include no extensions.
24122 Note that DynaLoader is always built and need not be mentioned here.
24125 case "$dynamic_ext" in
24127 : Exclude those listed in static_ext
24129 for xxx in $avail_ext; do
24130 case " $static_ext " in
24132 *) dflt="$dflt $xxx" ;;
24139 *) dflt="$dynamic_ext"
24140 # Perhaps we are reusing an old out-of-date config.sh.
24143 if test X"$dynamic_ext" != X"$avail_ext"; then
24145 NOTICE: Your previous config.sh list may be incorrect.
24146 The extensions now available to you are
24148 but the default list from your previous config.sh is
24160 rp="What extensions do you wish to load dynamically?"
24163 none) dynamic_ext=' ' ;;
24164 *) dynamic_ext="$ans" ;;
24167 case "$static_ext" in
24169 : Exclude those already listed in dynamic linking
24171 for xxx in $avail_ext; do
24172 case " $dynamic_ext " in
24174 *) dflt="$dflt $xxx" ;;
24181 *) dflt="$static_ext"
24188 rp="What extensions do you wish to load statically?"
24191 none) static_ext=' ' ;;
24192 *) static_ext="$ans" ;;
24197 A number of extensions are supplied with $package. Answer "none"
24198 to include no extensions.
24199 Note that DynaLoader is always built and need not be mentioned here.
24202 case "$static_ext" in
24203 '') dflt="$avail_ext" ;;
24204 *) dflt="$static_ext"
24205 # Perhaps we are reusing an old out-of-date config.sh.
24208 if test X"$static_ext" != X"$avail_ext"; then
24210 NOTICE: Your previous config.sh list may be incorrect.
24211 The extensions now available to you are
24213 but the default list from your previous config.sh is
24222 : Exclude those that are not xs extensions
24226 rp="What extensions do you wish to include?"
24229 none) static_ext=' ' ;;
24230 *) static_ext="$ans" ;;
24235 # Encode is a special case. If we are building Encode as a static
24236 # extension, we need to explicitly list its subextensions as well.
24237 # For other nested extensions, this is handled automatically by
24238 # the appropriate Makefile.PL.
24239 case " $static_ext " in
24240 *" Encode "*) # Add the subextensions of Encode
24242 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24243 static_ext="$static_ext Encode/$xxx"
24244 known_extensions="$known_extensions Encode/$xxx"
24250 set X $dynamic_ext $static_ext $nonxs_ext
24254 # Sanity check: We require an extension suitable for use with
24255 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24256 # should show up as failures in the test suite, but it's helpful to
24257 # catch them now.) The 'extensions' list is normally sorted
24258 # alphabetically, so we need to accept either
24259 # DB_File ... Fcntl ... IO ....
24260 # or something like
24261 # Fcntl ... NDBM_File ... IO ....
24262 case " $extensions" in
24263 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24264 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24265 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24266 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24267 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24271 : Remove libraries needed only for extensions
24272 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24273 : The exception is SunOS 4.x, which needs them.
24274 case "${osname}X${osvers}" in
24278 *) case "$usedl" in
24279 $define|true|[yY]*)
24280 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24284 *) perllibs="$libs"
24290 : Remove build directory name from cppstdin so it can be used from
24291 : either the present location or the final installed location.
24293 : Get out of the UU directory to get correct path name.
24295 case "$cppstdin" in
24297 echo "Stripping down cppstdin path name"
24303 : end of configuration questions
24305 echo "End of configuration questions."
24308 : back to where it started
24309 if test -d ../UU; then
24313 : configuration may be unconditionally patched via a 'config.arch' file
24314 if $test -f config.arch; then
24315 echo "I see a config.arch file, loading it." >&4
24319 : configuration may be patched via a 'config.over' file
24320 if $test -f config.over; then
24323 rp='I see a config.over file. Do you wish to load it?'
24326 n*) echo "OK, I'll ignore it.";;
24328 echo "Configuration override changes have been loaded."
24333 : in case they want portability, strip down executable paths
24334 case "$d_portable" in
24337 echo "Stripping down executable paths..." >&4
24338 for file in $loclist $trylist; do
24340 eval $file=`basename $temp`
24345 : create config.sh file
24347 echo "Creating config.sh..." >&4
24348 $spitshell <<EOT >config.sh
24351 # This file was produced by running the Configure script. It holds all the
24352 # definitions figured out by Configure. Should you modify one of these values,
24353 # do not forget to propagate your changes by running "Configure -der". You may
24354 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24357 # Package name : $package
24358 # Source directory : $src
24359 # Configuration time: $cf_time
24360 # Configured by : $cf_by
24361 # Target system : $myuname
24364 : Add in command line options if available
24365 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24367 $spitshell <<EOT >>config.sh
24376 Revision='$Revision'
24384 alignbytes='$alignbytes'
24385 ansi2knr='$ansi2knr'
24386 aphostname='$aphostname'
24387 api_revision='$api_revision'
24388 api_subversion='$api_subversion'
24389 api_version='$api_version'
24390 api_versionstring='$api_versionstring'
24393 archlibexp='$archlibexp'
24394 archname64='$archname64'
24395 archname='$archname'
24396 archobjs='$archobjs'
24397 asctime_r_proto='$asctime_r_proto'
24406 byteorder='$byteorder'
24408 castflags='$castflags'
24411 cccdlflags='$cccdlflags'
24412 ccdlflags='$ccdlflags'
24414 ccflags_uselargefiles='$ccflags_uselargefiles'
24416 ccsymbols='$ccsymbols'
24417 ccversion='$ccversion'
24419 cf_email='$cf_email'
24421 charbits='$charbits'
24422 charsize='$charsize'
24426 clocktype='$clocktype'
24428 compress='$compress'
24429 contains='$contains'
24433 cpp_stuff='$cpp_stuff'
24434 cppccsymbols='$cppccsymbols'
24435 cppflags='$cppflags'
24437 cppminus='$cppminus'
24439 cppstdin='$cppstdin'
24440 cppsymbols='$cppsymbols'
24441 crypt_r_proto='$crypt_r_proto'
24442 cryptlib='$cryptlib'
24444 ctermid_r_proto='$ctermid_r_proto'
24445 ctime_r_proto='$ctime_r_proto'
24446 d_Gconvert='$d_Gconvert'
24447 d_PRIEUldbl='$d_PRIEUldbl'
24448 d_PRIFUldbl='$d_PRIFUldbl'
24449 d_PRIGUldbl='$d_PRIGUldbl'
24450 d_PRIXU64='$d_PRIXU64'
24451 d_PRId64='$d_PRId64'
24452 d_PRIeldbl='$d_PRIeldbl'
24453 d_PRIfldbl='$d_PRIfldbl'
24454 d_PRIgldbl='$d_PRIgldbl'
24455 d_PRIi64='$d_PRIi64'
24456 d_PRIo64='$d_PRIo64'
24457 d_PRIu64='$d_PRIu64'
24458 d_PRIx64='$d_PRIx64'
24459 d_SCNfldbl='$d_SCNfldbl'
24460 d__fwalk='$d__fwalk'
24461 d_access='$d_access'
24462 d_accessx='$d_accessx'
24466 d_archlib='$d_archlib'
24467 d_asctime64='$d_asctime64'
24468 d_asctime_r='$d_asctime_r'
24473 d_attribute_deprecated='$d_attribute_deprecated'
24474 d_attribute_format='$d_attribute_format'
24475 d_attribute_malloc='$d_attribute_malloc'
24476 d_attribute_nonnull='$d_attribute_nonnull'
24477 d_attribute_noreturn='$d_attribute_noreturn'
24478 d_attribute_pure='$d_attribute_pure'
24479 d_attribute_unused='$d_attribute_unused'
24480 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24481 d_backtrace='$d_backtrace'
24485 d_bsdgetpgrp='$d_bsdgetpgrp'
24486 d_bsdsetpgrp='$d_bsdsetpgrp'
24487 d_builtin_choose_expr='$d_builtin_choose_expr'
24488 d_builtin_expect='$d_builtin_expect'
24490 d_c99_variadic_macros='$d_c99_variadic_macros'
24491 d_casti32='$d_casti32'
24492 d_castneg='$d_castneg'
24494 d_charvspr='$d_charvspr'
24496 d_chroot='$d_chroot'
24497 d_chsize='$d_chsize'
24499 d_clearenv='$d_clearenv'
24500 d_closedir='$d_closedir'
24501 d_cmsghdr_s='$d_cmsghdr_s'
24503 d_copysign='$d_copysign'
24504 d_copysignl='$d_copysignl'
24505 d_cplusplus='$d_cplusplus'
24507 d_crypt_r='$d_crypt_r'
24509 d_ctermid='$d_ctermid'
24510 d_ctermid_r='$d_ctermid_r'
24511 d_ctime64='$d_ctime64'
24512 d_ctime_r='$d_ctime_r'
24513 d_cuserid='$d_cuserid'
24514 d_dbl_dig='$d_dbl_dig'
24515 d_dbminitproto='$d_dbminitproto'
24516 d_difftime64='$d_difftime64'
24517 d_difftime='$d_difftime'
24518 d_dir_dd_fd='$d_dir_dd_fd'
24520 d_dirnamlen='$d_dirnamlen'
24521 d_dladdr='$d_dladdr'
24522 d_dlerror='$d_dlerror'
24523 d_dlopen='$d_dlopen'
24524 d_dlsymun='$d_dlsymun'
24525 d_dosuid='$d_dosuid'
24526 d_double_has_inf='$d_double_has_inf'
24527 d_double_has_nan='$d_double_has_nan'
24528 d_double_has_negative_zero='$d_double_has_negative_zero'
24529 d_double_has_subnormals='$d_double_has_subnormals'
24530 d_double_style_cray='$d_double_style_cray'
24531 d_double_style_ibm='$d_double_style_ibm'
24532 d_double_style_ieee='$d_double_style_ieee'
24533 d_double_style_vax='$d_double_style_vax'
24534 d_drand48_r='$d_drand48_r'
24535 d_drand48proto='$d_drand48proto'
24537 d_duplocale='$d_duplocale'
24538 d_eaccess='$d_eaccess'
24539 d_endgrent='$d_endgrent'
24540 d_endgrent_r='$d_endgrent_r'
24541 d_endhent='$d_endhent'
24542 d_endhostent_r='$d_endhostent_r'
24543 d_endnent='$d_endnent'
24544 d_endnetent_r='$d_endnetent_r'
24545 d_endpent='$d_endpent'
24546 d_endprotoent_r='$d_endprotoent_r'
24547 d_endpwent='$d_endpwent'
24548 d_endpwent_r='$d_endpwent_r'
24549 d_endsent='$d_endsent'
24550 d_endservent_r='$d_endservent_r'
24551 d_eofnblk='$d_eofnblk'
24554 d_eunice='$d_eunice'
24557 d_faststdio='$d_faststdio'
24558 d_fchdir='$d_fchdir'
24559 d_fchmod='$d_fchmod'
24560 d_fchmodat='$d_fchmodat'
24561 d_fchown='$d_fchown'
24563 d_fcntl_can_lock='$d_fcntl_can_lock'
24564 d_fd_macros='$d_fd_macros'
24565 d_fd_set='$d_fd_set'
24566 d_fdclose='$d_fdclose'
24568 d_fds_bits='$d_fds_bits'
24569 d_fegetround='$d_fegetround'
24570 d_fgetpos='$d_fgetpos'
24571 d_finite='$d_finite'
24572 d_finitel='$d_finitel'
24573 d_flexfnam='$d_flexfnam'
24575 d_flockproto='$d_flockproto'
24580 d_fp_class='$d_fp_class'
24581 d_fp_classify='$d_fp_classify'
24582 d_fp_classl='$d_fp_classl'
24583 d_fpathconf='$d_fpathconf'
24584 d_fpclass='$d_fpclass'
24585 d_fpclassify='$d_fpclassify'
24586 d_fpclassl='$d_fpclassl'
24587 d_fpgetround='$d_fpgetround'
24588 d_fpos64_t='$d_fpos64_t'
24589 d_freelocale='$d_freelocale'
24590 d_frexpl='$d_frexpl'
24591 d_fs_data_s='$d_fs_data_s'
24592 d_fseeko='$d_fseeko'
24593 d_fsetpos='$d_fsetpos'
24594 d_fstatfs='$d_fstatfs'
24595 d_fstatvfs='$d_fstatvfs'
24597 d_ftello='$d_ftello'
24599 d_futimes='$d_futimes'
24600 d_gai_strerror='$d_gai_strerror'
24601 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24602 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24603 d_getaddrinfo='$d_getaddrinfo'
24604 d_getcwd='$d_getcwd'
24605 d_getespwnam='$d_getespwnam'
24606 d_getfsstat='$d_getfsstat'
24607 d_getgrent='$d_getgrent'
24608 d_getgrent_r='$d_getgrent_r'
24609 d_getgrgid_r='$d_getgrgid_r'
24610 d_getgrnam_r='$d_getgrnam_r'
24611 d_getgrps='$d_getgrps'
24612 d_gethbyaddr='$d_gethbyaddr'
24613 d_gethbyname='$d_gethbyname'
24614 d_gethent='$d_gethent'
24615 d_gethname='$d_gethname'
24616 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24617 d_gethostbyname_r='$d_gethostbyname_r'
24618 d_gethostent_r='$d_gethostent_r'
24619 d_gethostprotos='$d_gethostprotos'
24620 d_getitimer='$d_getitimer'
24621 d_getlogin='$d_getlogin'
24622 d_getlogin_r='$d_getlogin_r'
24623 d_getmnt='$d_getmnt'
24624 d_getmntent='$d_getmntent'
24625 d_getnameinfo='$d_getnameinfo'
24626 d_getnbyaddr='$d_getnbyaddr'
24627 d_getnbyname='$d_getnbyname'
24628 d_getnent='$d_getnent'
24629 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24630 d_getnetbyname_r='$d_getnetbyname_r'
24631 d_getnetent_r='$d_getnetent_r'
24632 d_getnetprotos='$d_getnetprotos'
24633 d_getpagsz='$d_getpagsz'
24634 d_getpbyname='$d_getpbyname'
24635 d_getpbynumber='$d_getpbynumber'
24636 d_getpent='$d_getpent'
24637 d_getpgid='$d_getpgid'
24638 d_getpgrp2='$d_getpgrp2'
24639 d_getpgrp='$d_getpgrp'
24640 d_getppid='$d_getppid'
24641 d_getprior='$d_getprior'
24642 d_getprotobyname_r='$d_getprotobyname_r'
24643 d_getprotobynumber_r='$d_getprotobynumber_r'
24644 d_getprotoent_r='$d_getprotoent_r'
24645 d_getprotoprotos='$d_getprotoprotos'
24646 d_getprpwnam='$d_getprpwnam'
24647 d_getpwent='$d_getpwent'
24648 d_getpwent_r='$d_getpwent_r'
24649 d_getpwnam_r='$d_getpwnam_r'
24650 d_getpwuid_r='$d_getpwuid_r'
24651 d_getsbyname='$d_getsbyname'
24652 d_getsbyport='$d_getsbyport'
24653 d_getsent='$d_getsent'
24654 d_getservbyname_r='$d_getservbyname_r'
24655 d_getservbyport_r='$d_getservbyport_r'
24656 d_getservent_r='$d_getservent_r'
24657 d_getservprotos='$d_getservprotos'
24658 d_getspnam='$d_getspnam'
24659 d_getspnam_r='$d_getspnam_r'
24660 d_gettimeod='$d_gettimeod'
24661 d_gmtime64='$d_gmtime64'
24662 d_gmtime_r='$d_gmtime_r'
24663 d_gnulibc='$d_gnulibc'
24664 d_grpasswd='$d_grpasswd'
24665 d_hasmntopt='$d_hasmntopt'
24669 d_ilogbl='$d_ilogbl'
24670 d_inc_version_list='$d_inc_version_list'
24672 d_inetaton='$d_inetaton'
24673 d_inetntop='$d_inetntop'
24674 d_inetpton='$d_inetpton'
24675 d_int64_t='$d_int64_t'
24676 d_ip_mreq='$d_ip_mreq'
24677 d_ip_mreq_source='$d_ip_mreq_source'
24678 d_ipv6_mreq='$d_ipv6_mreq'
24679 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24680 d_isascii='$d_isascii'
24681 d_isblank='$d_isblank'
24682 d_isfinite='$d_isfinite'
24683 d_isfinitel='$d_isfinitel'
24685 d_isinfl='$d_isinfl'
24686 d_isless='$d_isless'
24688 d_isnanl='$d_isnanl'
24689 d_isnormal='$d_isnormal'
24692 d_killpg='$d_killpg'
24693 d_lc_monetary_2008='$d_lc_monetary_2008'
24694 d_lchown='$d_lchown'
24695 d_ldbl_dig='$d_ldbl_dig'
24696 d_ldexpl='$d_ldexpl'
24697 d_lgamma='$d_lgamma'
24698 d_lgamma_r='$d_lgamma_r'
24699 d_libm_lib_version='$d_libm_lib_version'
24700 d_libname_unique='$d_libname_unique'
24702 d_linkat='$d_linkat'
24703 d_llrint='$d_llrint'
24704 d_llrintl='$d_llrintl'
24705 d_llround='$d_llround'
24706 d_llroundl='$d_llroundl'
24707 d_localtime64='$d_localtime64'
24708 d_localtime_r='$d_localtime_r'
24709 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24710 d_locconv='$d_locconv'
24715 d_long_double_style_ieee='$d_long_double_style_ieee'
24716 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24717 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24718 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24719 d_long_double_style_vax='$d_long_double_style_vax'
24720 d_longdbl='$d_longdbl'
24721 d_longlong='$d_longlong'
24723 d_lrintl='$d_lrintl'
24724 d_lround='$d_lround'
24725 d_lroundl='$d_lroundl'
24726 d_lseekproto='$d_lseekproto'
24728 d_madvise='$d_madvise'
24729 d_malloc_good_size='$d_malloc_good_size'
24730 d_malloc_size='$d_malloc_size'
24732 d_mbstowcs='$d_mbstowcs'
24733 d_mbtowc='$d_mbtowc'
24734 d_memchr='$d_memchr'
24735 d_memcmp='$d_memcmp'
24736 d_memcpy='$d_memcpy'
24737 d_memmem='$d_memmem'
24738 d_memmove='$d_memmove'
24739 d_memrchr='$d_memrchr'
24740 d_memset='$d_memset'
24742 d_mkdtemp='$d_mkdtemp'
24743 d_mkfifo='$d_mkfifo'
24744 d_mkstemp='$d_mkstemp'
24745 d_mkstemps='$d_mkstemps'
24746 d_mktime64='$d_mktime64'
24747 d_mktime='$d_mktime'
24750 d_modflproto='$d_modflproto'
24751 d_mprotect='$d_mprotect'
24753 d_msg_ctrunc='$d_msg_ctrunc'
24754 d_msg_dontroute='$d_msg_dontroute'
24755 d_msg_oob='$d_msg_oob'
24756 d_msg_peek='$d_msg_peek'
24757 d_msg_proxy='$d_msg_proxy'
24758 d_msgctl='$d_msgctl'
24759 d_msgget='$d_msgget'
24760 d_msghdr_s='$d_msghdr_s'
24761 d_msgrcv='$d_msgrcv'
24762 d_msgsnd='$d_msgsnd'
24764 d_munmap='$d_munmap'
24765 d_mymalloc='$d_mymalloc'
24768 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24769 d_nearbyint='$d_nearbyint'
24770 d_newlocale='$d_newlocale'
24771 d_nextafter='$d_nextafter'
24772 d_nexttoward='$d_nexttoward'
24774 d_nl_langinfo='$d_nl_langinfo'
24775 d_nv_preserves_uv='$d_nv_preserves_uv'
24776 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24777 d_off64_t='$d_off64_t'
24778 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24779 d_oldpthreads='$d_oldpthreads'
24780 d_oldsock='$d_oldsock'
24782 d_openat='$d_openat'
24783 d_pathconf='$d_pathconf'
24785 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24786 d_phostname='$d_phostname'
24789 d_portable='$d_portable'
24791 d_prctl_set_name='$d_prctl_set_name'
24792 d_printf_format_null='$d_printf_format_null'
24793 d_procselfexe='$d_procselfexe'
24794 d_pseudofork='$d_pseudofork'
24795 d_pthread_atfork='$d_pthread_atfork'
24796 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24797 d_pthread_yield='$d_pthread_yield'
24798 d_ptrdiff_t='$d_ptrdiff_t'
24800 d_pwchange='$d_pwchange'
24801 d_pwclass='$d_pwclass'
24802 d_pwcomment='$d_pwcomment'
24803 d_pwexpire='$d_pwexpire'
24804 d_pwgecos='$d_pwgecos'
24805 d_pwpasswd='$d_pwpasswd'
24806 d_pwquota='$d_pwquota'
24809 d_querylocale='$d_querylocale'
24810 d_random_r='$d_random_r'
24811 d_re_comp='$d_re_comp'
24812 d_readdir64_r='$d_readdir64_r'
24813 d_readdir='$d_readdir'
24814 d_readdir_r='$d_readdir_r'
24815 d_readlink='$d_readlink'
24817 d_recvmsg='$d_recvmsg'
24818 d_regcmp='$d_regcmp'
24819 d_regcomp='$d_regcomp'
24820 d_remainder='$d_remainder'
24821 d_remquo='$d_remquo'
24822 d_rename='$d_rename'
24823 d_renameat='$d_renameat'
24824 d_rewinddir='$d_rewinddir'
24828 d_safebcpy='$d_safebcpy'
24829 d_safemcpy='$d_safemcpy'
24830 d_sanemcmp='$d_sanemcmp'
24831 d_sbrkproto='$d_sbrkproto'
24832 d_scalbn='$d_scalbn'
24833 d_scalbnl='$d_scalbnl'
24834 d_sched_yield='$d_sched_yield'
24835 d_scm_rights='$d_scm_rights'
24836 d_seekdir='$d_seekdir'
24837 d_select='$d_select'
24839 d_semctl='$d_semctl'
24840 d_semctl_semid_ds='$d_semctl_semid_ds'
24841 d_semctl_semun='$d_semctl_semun'
24842 d_semget='$d_semget'
24844 d_sendmsg='$d_sendmsg'
24845 d_setegid='$d_setegid'
24846 d_seteuid='$d_seteuid'
24847 d_setgrent='$d_setgrent'
24848 d_setgrent_r='$d_setgrent_r'
24849 d_setgrps='$d_setgrps'
24850 d_sethent='$d_sethent'
24851 d_sethostent_r='$d_sethostent_r'
24852 d_setitimer='$d_setitimer'
24853 d_setlinebuf='$d_setlinebuf'
24854 d_setlocale='$d_setlocale'
24855 d_setlocale_r='$d_setlocale_r'
24856 d_setnent='$d_setnent'
24857 d_setnetent_r='$d_setnetent_r'
24858 d_setpent='$d_setpent'
24859 d_setpgid='$d_setpgid'
24860 d_setpgrp2='$d_setpgrp2'
24861 d_setpgrp='$d_setpgrp'
24862 d_setprior='$d_setprior'
24863 d_setproctitle='$d_setproctitle'
24864 d_setprotoent_r='$d_setprotoent_r'
24865 d_setpwent='$d_setpwent'
24866 d_setpwent_r='$d_setpwent_r'
24867 d_setregid='$d_setregid'
24868 d_setresgid='$d_setresgid'
24869 d_setresuid='$d_setresuid'
24870 d_setreuid='$d_setreuid'
24871 d_setrgid='$d_setrgid'
24872 d_setruid='$d_setruid'
24873 d_setsent='$d_setsent'
24874 d_setservent_r='$d_setservent_r'
24875 d_setsid='$d_setsid'
24876 d_setvbuf='$d_setvbuf'
24879 d_shmatprototype='$d_shmatprototype'
24880 d_shmctl='$d_shmctl'
24882 d_shmget='$d_shmget'
24883 d_sigaction='$d_sigaction'
24884 d_siginfo_si_addr='$d_siginfo_si_addr'
24885 d_siginfo_si_band='$d_siginfo_si_band'
24886 d_siginfo_si_errno='$d_siginfo_si_errno'
24887 d_siginfo_si_fd='$d_siginfo_si_fd'
24888 d_siginfo_si_pid='$d_siginfo_si_pid'
24889 d_siginfo_si_status='$d_siginfo_si_status'
24890 d_siginfo_si_uid='$d_siginfo_si_uid'
24891 d_siginfo_si_value='$d_siginfo_si_value'
24892 d_signbit='$d_signbit'
24893 d_sigprocmask='$d_sigprocmask'
24894 d_sigsetjmp='$d_sigsetjmp'
24895 d_sin6_scope_id='$d_sin6_scope_id'
24896 d_sitearch='$d_sitearch'
24897 d_snprintf='$d_snprintf'
24898 d_sockaddr_in6='$d_sockaddr_in6'
24899 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24900 d_sockatmark='$d_sockatmark'
24901 d_sockatmarkproto='$d_sockatmarkproto'
24902 d_socket='$d_socket'
24903 d_socklen_t='$d_socklen_t'
24904 d_sockpair='$d_sockpair'
24905 d_socks5_init='$d_socks5_init'
24906 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24908 d_srand48_r='$d_srand48_r'
24909 d_srandom_r='$d_srandom_r'
24910 d_sresgproto='$d_sresgproto'
24911 d_sresuproto='$d_sresuproto'
24913 d_statblks='$d_statblks'
24914 d_statfs_f_flags='$d_statfs_f_flags'
24915 d_statfs_s='$d_statfs_s'
24916 d_static_inline='$d_static_inline'
24917 d_statvfs='$d_statvfs'
24918 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24919 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24920 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24921 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24922 d_stdio_stream_array='$d_stdio_stream_array'
24923 d_stdiobase='$d_stdiobase'
24924 d_stdstdio='$d_stdstdio'
24925 d_strchr='$d_strchr'
24926 d_strcoll='$d_strcoll'
24927 d_strctcpy='$d_strctcpy'
24928 d_strerrm='$d_strerrm'
24929 d_strerror='$d_strerror'
24930 d_strerror_l='$d_strerror_l'
24931 d_strerror_r='$d_strerror_r'
24932 d_strftime='$d_strftime'
24933 d_strlcat='$d_strlcat'
24934 d_strlcpy='$d_strlcpy'
24935 d_strtod='$d_strtod'
24936 d_strtol='$d_strtol'
24937 d_strtold='$d_strtold'
24938 d_strtoll='$d_strtoll'
24939 d_strtoq='$d_strtoq'
24940 d_strtoul='$d_strtoul'
24941 d_strtoull='$d_strtoull'
24942 d_strtouq='$d_strtouq'
24943 d_strxfrm='$d_strxfrm'
24944 d_suidsafe='$d_suidsafe'
24945 d_symlink='$d_symlink'
24946 d_syscall='$d_syscall'
24947 d_syscallproto='$d_syscallproto'
24948 d_sysconf='$d_sysconf'
24949 d_sysernlst='$d_sysernlst'
24950 d_syserrlst='$d_syserrlst'
24951 d_system='$d_system'
24952 d_tcgetpgrp='$d_tcgetpgrp'
24953 d_tcsetpgrp='$d_tcsetpgrp'
24954 d_telldir='$d_telldir'
24955 d_telldirproto='$d_telldirproto'
24956 d_tgamma='$d_tgamma'
24958 d_timegm='$d_timegm'
24960 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24961 d_tm_tm_zone='$d_tm_tm_zone'
24962 d_tmpnam_r='$d_tmpnam_r'
24964 d_truncate='$d_truncate'
24965 d_truncl='$d_truncl'
24966 d_ttyname_r='$d_ttyname_r'
24967 d_tzname='$d_tzname'
24968 d_u32align='$d_u32align'
24969 d_ualarm='$d_ualarm'
24972 d_union_semun='$d_union_semun'
24973 d_unlinkat='$d_unlinkat'
24974 d_unordered='$d_unordered'
24975 d_unsetenv='$d_unsetenv'
24976 d_uselocale='$d_uselocale'
24977 d_usleep='$d_usleep'
24978 d_usleepproto='$d_usleepproto'
24980 d_vendorarch='$d_vendorarch'
24981 d_vendorbin='$d_vendorbin'
24982 d_vendorlib='$d_vendorlib'
24983 d_vendorscript='$d_vendorscript'
24985 d_void_closedir='$d_void_closedir'
24986 d_voidsig='$d_voidsig'
24987 d_voidtty='$d_voidtty'
24988 d_volatile='$d_volatile'
24989 d_vprintf='$d_vprintf'
24990 d_vsnprintf='$d_vsnprintf'
24992 d_waitpid='$d_waitpid'
24993 d_wcscmp='$d_wcscmp'
24994 d_wcstombs='$d_wcstombs'
24995 d_wcsxfrm='$d_wcsxfrm'
24996 d_wctomb='$d_wctomb'
24997 d_writev='$d_writev'
25000 db_hashtype='$db_hashtype'
25001 db_prefixtype='$db_prefixtype'
25002 db_version_major='$db_version_major'
25003 db_version_minor='$db_version_minor'
25004 db_version_patch='$db_version_patch'
25005 default_inc_excludes_dot='$default_inc_excludes_dot'
25006 direntrytype='$direntrytype'
25009 doubleinfbytes='$doubleinfbytes'
25010 doublekind='$doublekind'
25011 doublemantbits='$doublemantbits'
25012 doublenanbytes='$doublenanbytes'
25013 doublesize='$doublesize'
25015 drand48_r_proto='$drand48_r_proto'
25017 dtraceobject='$dtraceobject'
25018 dtracexnolibs='$dtracexnolibs'
25019 dynamic_ext='$dynamic_ext'
25025 endgrent_r_proto='$endgrent_r_proto'
25026 endhostent_r_proto='$endhostent_r_proto'
25027 endnetent_r_proto='$endnetent_r_proto'
25028 endprotoent_r_proto='$endprotoent_r_proto'
25029 endpwent_r_proto='$endpwent_r_proto'
25030 endservent_r_proto='$endservent_r_proto'
25031 eunicefix='$eunicefix'
25034 extensions='$extensions'
25035 extern_C='$extern_C'
25037 fflushNULL='$fflushNULL'
25038 fflushall='$fflushall'
25040 firstmakefile='$firstmakefile'
25042 fpossize='$fpossize'
25043 fpostype='$fpostype'
25044 freetype='$freetype'
25047 full_csh='$full_csh'
25048 full_sed='$full_sed'
25049 gccansipedantic='$gccansipedantic'
25050 gccosandvers='$gccosandvers'
25051 gccversion='$gccversion'
25052 getgrent_r_proto='$getgrent_r_proto'
25053 getgrgid_r_proto='$getgrgid_r_proto'
25054 getgrnam_r_proto='$getgrnam_r_proto'
25055 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
25056 gethostbyname_r_proto='$gethostbyname_r_proto'
25057 gethostent_r_proto='$gethostent_r_proto'
25058 getlogin_r_proto='$getlogin_r_proto'
25059 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
25060 getnetbyname_r_proto='$getnetbyname_r_proto'
25061 getnetent_r_proto='$getnetent_r_proto'
25062 getprotobyname_r_proto='$getprotobyname_r_proto'
25063 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25064 getprotoent_r_proto='$getprotoent_r_proto'
25065 getpwent_r_proto='$getpwent_r_proto'
25066 getpwnam_r_proto='$getpwnam_r_proto'
25067 getpwuid_r_proto='$getpwuid_r_proto'
25068 getservbyname_r_proto='$getservbyname_r_proto'
25069 getservbyport_r_proto='$getservbyport_r_proto'
25070 getservent_r_proto='$getservent_r_proto'
25071 getspnam_r_proto='$getspnam_r_proto'
25072 gidformat='$gidformat'
25078 gmtime_r_proto='$gmtime_r_proto'
25079 gnulibc_version='$gnulibc_version'
25081 groupcat='$groupcat'
25082 groupstype='$groupstype'
25085 h_sysfile='$h_sysfile'
25088 hostgenerate='$hostgenerate'
25089 hostosname='$hostosname'
25090 hostperl='$hostperl'
25091 html1dir='$html1dir'
25092 html1direxp='$html1direxp'
25093 html3dir='$html3dir'
25094 html3direxp='$html3direxp'
25103 i_arpainet='$i_arpainet'
25104 i_assert='$i_assert'
25106 i_bsdioctl='$i_bsdioctl'
25110 i_dirent='$i_dirent'
25112 i_execinfo='$i_execinfo'
25117 i_fp_class='$i_fp_class'
25119 i_gdbm_ndbm='$i_gdbm_ndbm'
25120 i_gdbmndbm='$i_gdbmndbm'
25122 i_ieeefp='$i_ieeefp'
25123 i_inttypes='$i_inttypes'
25124 i_langinfo='$i_langinfo'
25125 i_libutil='$i_libutil'
25126 i_limits='$i_limits'
25127 i_locale='$i_locale'
25128 i_machcthr='$i_machcthr'
25129 i_malloc='$i_malloc'
25130 i_mallocmalloc='$i_mallocmalloc'
25132 i_memory='$i_memory'
25133 i_mntent='$i_mntent'
25136 i_neterrno='$i_neterrno'
25137 i_netinettcp='$i_netinettcp'
25141 i_pthread='$i_pthread'
25143 i_quadmath='$i_quadmath'
25144 i_rpcsvcdbm='$i_rpcsvcdbm'
25146 i_shadow='$i_shadow'
25148 i_stdarg='$i_stdarg'
25149 i_stdbool='$i_stdbool'
25150 i_stddef='$i_stddef'
25151 i_stdint='$i_stdint'
25152 i_stdlib='$i_stdlib'
25153 i_string='$i_string'
25154 i_sunmath='$i_sunmath'
25155 i_sysaccess='$i_sysaccess'
25156 i_sysdir='$i_sysdir'
25157 i_sysfile='$i_sysfile'
25158 i_sysfilio='$i_sysfilio'
25160 i_sysioctl='$i_sysioctl'
25161 i_syslog='$i_syslog'
25162 i_sysmman='$i_sysmman'
25163 i_sysmode='$i_sysmode'
25164 i_sysmount='$i_sysmount'
25165 i_sysndir='$i_sysndir'
25166 i_sysparam='$i_sysparam'
25167 i_syspoll='$i_syspoll'
25168 i_sysresrc='$i_sysresrc'
25169 i_syssecrt='$i_syssecrt'
25170 i_sysselct='$i_sysselct'
25171 i_syssockio='$i_syssockio'
25172 i_sysstat='$i_sysstat'
25173 i_sysstatfs='$i_sysstatfs'
25174 i_sysstatvfs='$i_sysstatvfs'
25175 i_systime='$i_systime'
25176 i_systimek='$i_systimek'
25177 i_systimes='$i_systimes'
25178 i_systypes='$i_systypes'
25179 i_sysuio='$i_sysuio'
25181 i_sysutsname='$i_sysutsname'
25182 i_sysvfs='$i_sysvfs'
25183 i_syswait='$i_syswait'
25184 i_termio='$i_termio'
25185 i_termios='$i_termios'
25187 i_unistd='$i_unistd'
25190 i_values='$i_values'
25191 i_varargs='$i_varargs'
25192 i_varhdr='$i_varhdr'
25194 i_xlocale='$i_xlocale'
25195 ignore_versioned_solibs='$ignore_versioned_solibs'
25196 inc_version_list='$inc_version_list'
25197 inc_version_list_init='$inc_version_list_init'
25201 initialinstalllocation='$initialinstalllocation'
25202 installarchlib='$installarchlib'
25203 installbin='$installbin'
25204 installhtml1dir='$installhtml1dir'
25205 installhtml3dir='$installhtml3dir'
25206 installman1dir='$installman1dir'
25207 installman3dir='$installman3dir'
25208 installprefix='$installprefix'
25209 installprefixexp='$installprefixexp'
25210 installprivlib='$installprivlib'
25211 installscript='$installscript'
25212 installsitearch='$installsitearch'
25213 installsitebin='$installsitebin'
25214 installsitehtml1dir='$installsitehtml1dir'
25215 installsitehtml3dir='$installsitehtml3dir'
25216 installsitelib='$installsitelib'
25217 installsiteman1dir='$installsiteman1dir'
25218 installsiteman3dir='$installsiteman3dir'
25219 installsitescript='$installsitescript'
25220 installstyle='$installstyle'
25221 installusrbinperl='$installusrbinperl'
25222 installvendorarch='$installvendorarch'
25223 installvendorbin='$installvendorbin'
25224 installvendorhtml1dir='$installvendorhtml1dir'
25225 installvendorhtml3dir='$installvendorhtml3dir'
25226 installvendorlib='$installvendorlib'
25227 installvendorman1dir='$installvendorman1dir'
25228 installvendorman3dir='$installvendorman3dir'
25229 installvendorscript='$installvendorscript'
25231 issymlink='$issymlink'
25232 ivdformat='$ivdformat'
25235 known_extensions='$known_extensions'
25238 ld_can_script='$ld_can_script'
25239 lddlflags='$lddlflags'
25241 ldflags_uselargefiles='$ldflags_uselargefiles'
25242 ldlibpthname='$ldlibpthname'
25249 libsdirs='$libsdirs'
25250 libsfiles='$libsfiles'
25251 libsfound='$libsfound'
25252 libspath='$libspath'
25253 libswanted='$libswanted'
25254 libswanted_uselargefiles='$libswanted_uselargefiles'
25260 localtime_r_proto='$localtime_r_proto'
25261 locincpth='$locincpth'
25262 loclibpth='$loclibpth'
25263 longdblinfbytes='$longdblinfbytes'
25264 longdblkind='$longdblkind'
25265 longdblmantbits='$longdblmantbits'
25266 longdblnanbytes='$longdblnanbytes'
25267 longdblsize='$longdblsize'
25268 longlongsize='$longlongsize'
25269 longsize='$longsize'
25273 lseeksize='$lseeksize'
25274 lseektype='$lseektype'
25278 make_set_make='$make_set_make'
25279 mallocobj='$mallocobj'
25280 mallocsrc='$mallocsrc'
25281 malloctype='$malloctype'
25283 man1direxp='$man1direxp'
25286 man3direxp='$man3direxp'
25288 mips_type='$mips_type'
25289 mistrustnm='$mistrustnm'
25291 mmaptype='$mmaptype'
25292 modetype='$modetype'
25294 multiarch='$multiarch'
25296 myarchname='$myarchname'
25297 mydomain='$mydomain'
25298 myhostname='$myhostname'
25301 need_va_copy='$need_va_copy'
25302 netdb_hlen_type='$netdb_hlen_type'
25303 netdb_host_type='$netdb_host_type'
25304 netdb_name_type='$netdb_name_type'
25305 netdb_net_type='$netdb_net_type'
25308 nm_so_opt='$nm_so_opt'
25309 nonxs_ext='$nonxs_ext'
25311 nvEUformat='$nvEUformat'
25312 nvFUformat='$nvFUformat'
25313 nvGUformat='$nvGUformat'
25314 nv_overflows_integers_at='$nv_overflows_integers_at'
25315 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25316 nveformat='$nveformat'
25317 nvfformat='$nvfformat'
25318 nvgformat='$nvgformat'
25319 nvmantbits='$nvmantbits'
25322 o_nonblock='$o_nonblock'
25324 old_pthread_create_joinable='$old_pthread_create_joinable'
25325 optimize='$optimize'
25326 orderlib='$orderlib'
25329 otherlibdirs='$otherlibdirs'
25333 patchlevel='$patchlevel'
25334 path_sep='$path_sep'
25337 perl_patchlevel='$perl_patchlevel'
25338 perl_static_inline='$perl_static_inline'
25339 perladmin='$perladmin'
25340 perllibs='$perllibs'
25341 perlpath='$perlpath'
25343 phostname='$phostname'
25349 prefixexp='$prefixexp'
25351 privlibexp='$privlibexp'
25352 procselfexe='$procselfexe'
25353 prototype='$prototype'
25355 quadkind='$quadkind'
25356 quadtype='$quadtype'
25357 randbits='$randbits'
25358 randfunc='$randfunc'
25359 random_r_proto='$random_r_proto'
25360 randseedtype='$randseedtype'
25362 rd_nodata='$rd_nodata'
25363 readdir64_r_proto='$readdir64_r_proto'
25364 readdir_r_proto='$readdir_r_proto'
25365 revision='$revision'
25371 sGMTIME_max='$sGMTIME_max'
25372 sGMTIME_min='$sGMTIME_min'
25373 sLOCALTIME_max='$sLOCALTIME_max'
25374 sLOCALTIME_min='$sLOCALTIME_min'
25375 sPRIEUldbl='$sPRIEUldbl'
25376 sPRIFUldbl='$sPRIFUldbl'
25377 sPRIGUldbl='$sPRIGUldbl'
25378 sPRIXU64='$sPRIXU64'
25380 sPRIeldbl='$sPRIeldbl'
25381 sPRIfldbl='$sPRIfldbl'
25382 sPRIgldbl='$sPRIgldbl'
25387 sSCNfldbl='$sSCNfldbl'
25388 sched_yield='$sched_yield'
25389 scriptdir='$scriptdir'
25390 scriptdirexp='$scriptdirexp'
25392 seedfunc='$seedfunc'
25393 selectminbits='$selectminbits'
25394 selecttype='$selecttype'
25395 sendmail='$sendmail'
25396 setgrent_r_proto='$setgrent_r_proto'
25397 sethostent_r_proto='$sethostent_r_proto'
25398 setlocale_r_proto='$setlocale_r_proto'
25399 setnetent_r_proto='$setnetent_r_proto'
25400 setprotoent_r_proto='$setprotoent_r_proto'
25401 setpwent_r_proto='$setpwent_r_proto'
25402 setservent_r_proto='$setservent_r_proto'
25405 sharpbang='$sharpbang'
25406 shmattype='$shmattype'
25407 shortsize='$shortsize'
25410 sig_count='$sig_count'
25411 sig_name='$sig_name'
25412 sig_name_init='$sig_name_init'
25414 sig_num_init='$sig_num_init'
25415 sig_size='$sig_size'
25416 signal_t='$signal_t'
25417 sitearch='$sitearch'
25418 sitearchexp='$sitearchexp'
25420 sitebinexp='$sitebinexp'
25421 sitehtml1dir='$sitehtml1dir'
25422 sitehtml1direxp='$sitehtml1direxp'
25423 sitehtml3dir='$sitehtml3dir'
25424 sitehtml3direxp='$sitehtml3direxp'
25426 sitelib_stem='$sitelib_stem'
25427 sitelibexp='$sitelibexp'
25428 siteman1dir='$siteman1dir'
25429 siteman1direxp='$siteman1direxp'
25430 siteman3dir='$siteman3dir'
25431 siteman3direxp='$siteman3direxp'
25432 siteprefix='$siteprefix'
25433 siteprefixexp='$siteprefixexp'
25434 sitescript='$sitescript'
25435 sitescriptexp='$sitescriptexp'
25436 sizesize='$sizesize'
25437 sizetype='$sizetype'
25441 sockethdr='$sockethdr'
25442 socketlib='$socketlib'
25443 socksizetype='$socksizetype'
25445 spackage='$spackage'
25446 spitshell='$spitshell'
25447 srand48_r_proto='$srand48_r_proto'
25448 srandom_r_proto='$srandom_r_proto'
25450 ssizetype='$ssizetype'
25451 st_ino_sign='$st_ino_sign'
25452 st_ino_size='$st_ino_size'
25453 startperl='$startperl'
25455 static_ext='$static_ext'
25457 stdio_base='$stdio_base'
25458 stdio_bufsiz='$stdio_bufsiz'
25459 stdio_cnt='$stdio_cnt'
25460 stdio_filbuf='$stdio_filbuf'
25461 stdio_ptr='$stdio_ptr'
25462 stdio_stream_array='$stdio_stream_array'
25463 strerror_r_proto='$strerror_r_proto'
25466 subversion='$subversion'
25471 targetarch='$targetarch'
25472 targetdir='$targetdir'
25473 targetenv='$targetenv'
25474 targethost='$targethost'
25475 targetmkdir='$targetmkdir'
25476 targetport='$targetport'
25477 targetsh='$targetsh'
25481 timeincl='$timeincl'
25482 timetype='$timetype'
25483 tmpnam_r_proto='$tmpnam_r_proto'
25489 ttyname_r_proto='$ttyname_r_proto'
25498 uidformat='$uidformat'
25504 uquadtype='$uquadtype'
25505 use5005threads='$use5005threads'
25506 use64bitall='$use64bitall'
25507 use64bitint='$use64bitint'
25508 usecbacktrace='$usecbacktrace'
25509 usecrosscompile='$usecrosscompile'
25510 usedevel='$usedevel'
25512 usedtrace='$usedtrace'
25513 usefaststdio='$usefaststdio'
25514 useithreads='$useithreads'
25515 usekernprocpathname='$usekernprocpathname'
25516 uselargefiles='$uselargefiles'
25517 uselongdouble='$uselongdouble'
25518 usemallocwrap='$usemallocwrap'
25519 usemorebits='$usemorebits'
25520 usemultiplicity='$usemultiplicity'
25521 usemymalloc='$usemymalloc'
25523 usensgetexecutablepath='$usensgetexecutablepath'
25524 useopcode='$useopcode'
25525 useperlio='$useperlio'
25526 useposix='$useposix'
25527 usequadmath='$usequadmath'
25528 usereentrant='$usereentrant'
25529 userelocatableinc='$userelocatableinc'
25530 useshrplib='$useshrplib'
25531 usesitecustomize='$usesitecustomize'
25532 usesocks='$usesocks'
25533 usethreads='$usethreads'
25534 usevendorprefix='$usevendorprefix'
25535 useversionedarchname='$useversionedarchname'
25536 usevfork='$usevfork'
25539 uvXUformat='$uvXUformat'
25540 uvoformat='$uvoformat'
25543 uvuformat='$uvuformat'
25544 uvxformat='$uvxformat'
25546 vendorarch='$vendorarch'
25547 vendorarchexp='$vendorarchexp'
25548 vendorbin='$vendorbin'
25549 vendorbinexp='$vendorbinexp'
25550 vendorhtml1dir='$vendorhtml1dir'
25551 vendorhtml1direxp='$vendorhtml1direxp'
25552 vendorhtml3dir='$vendorhtml3dir'
25553 vendorhtml3direxp='$vendorhtml3direxp'
25554 vendorlib='$vendorlib'
25555 vendorlib_stem='$vendorlib_stem'
25556 vendorlibexp='$vendorlibexp'
25557 vendorman1dir='$vendorman1dir'
25558 vendorman1direxp='$vendorman1direxp'
25559 vendorman3dir='$vendorman3dir'
25560 vendorman3direxp='$vendorman3direxp'
25561 vendorprefix='$vendorprefix'
25562 vendorprefixexp='$vendorprefixexp'
25563 vendorscript='$vendorscript'
25564 vendorscriptexp='$vendorscriptexp'
25566 version_patchlevel_string='$version_patchlevel_string'
25567 versiononly='$versiononly'
25571 yaccflags='$yaccflags'
25576 : add special variables
25577 $test -f $src/patchlevel.h && \
25578 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25579 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25580 echo "PERL_CONFIG_SH=true" >>config.sh
25582 : propagate old symbols
25583 if $test -f UU/config.sh; then
25584 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25585 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25586 config.sh config.sh UU/oldconfig.sh |\
25587 $sort | $uniq -u >UU/oldsyms
25588 set X `$cat UU/oldsyms`
25594 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25596 echo ": Variables propagated from previous config.sh file." >>config.sh
25597 for sym in `$cat UU/oldsyms`; do
25598 echo " Propagating $hint variable "'$'"$sym..."
25599 eval 'tmp="$'"${sym}"'"'
25601 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25607 : preserve RCS keywords in files with variable substitution, grrr
25610 : Finish up by extracting the .SH files
25613 echo "Stopping at your request, leaving temporary files around."
25623 If you'd like to make any changes to the config.sh file before I begin
25624 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25627 rp="Press return or use a shell escape to edit config.sh:"
25632 *) : in case they cannot read
25633 sh 1>&4 -c "$ans";;
25638 : if this fails, just run all the .SH files by hand
25647 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25654 Now you need to generate make dependencies by running "$make depend".
25655 You might prefer to run it in background: "$make depend > makedepend.out &"
25656 It can take a while, so you might not want to run it right now.
25661 rp="Run $make depend now?"
25665 $make depend && echo "Now you must run '$make'."
25668 echo "You must run '$make depend' then '$make'."
25671 elif test -f [Mm]akefile; then
25673 echo "Now you must run a $make."
25675 echo "Configure done."
25678 if $test -f Policy.sh; then
25681 If you compile $package on a different machine or from a different object
25682 directory, copy the Policy.sh file from this object directory to the
25683 new one before you run Configure -- this will help you with most of
25684 the policy defaults.
25688 if $test -f UU/config.msg; then
25689 echo "Hmm. I also noted the following information while running:"
25691 $cat UU/config.msg >&4
25693 $rm -f kit*isdone ark*isdone