3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # (with additional metaconfig patches by perlbug@perl.org)
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
345 useversionedarchname=''
351 initialinstalllocation=''
383 d_attribute_deprecated=''
384 d_attribute_format=''
385 d_attribute_malloc=''
386 d_attribute_nonnull=''
387 d_attribute_noreturn=''
389 d_attribute_unused=''
390 d_attribute_warn_unused_result=''
391 d_printf_format_null=''
393 d_builtin_choose_expr=''
395 d_builtin_add_overflow=''
396 d_builtin_mul_overflow=''
397 d_builtin_sub_overflow=''
398 d_c99_variadic_macros=''
447 endhostent_r_proto=''
453 endprotoent_r_proto=''
459 endservent_r_proto=''
531 gethostbyaddr_r_proto=''
533 gethostbyname_r_proto=''
535 gethostent_r_proto=''
548 getnetbyaddr_r_proto=''
550 getnetbyname_r_proto=''
564 d_getprotobyname_r=''
565 getprotobyname_r_proto=''
566 d_getprotobynumber_r=''
567 getprotobynumber_r_proto=''
569 getprotoent_r_proto=''
581 getservbyname_r_proto=''
583 getservbyport_r_proto=''
585 getservent_r_proto=''
618 d_lc_monetary_2008=''
623 d_libm_lib_version=''
631 d_localtime_r_needs_tzset=''
639 d_long_double_style_ieee=''
640 d_long_double_style_ieee_doubledouble=''
641 d_long_double_style_ieee_extended=''
642 d_long_double_style_ieee_std=''
643 d_long_double_style_vax=''
656 d_malloc_good_size=''
697 d_thread_safe_nl_langinfo_l=''
710 d_old_pthread_create_joinable=''
711 old_pthread_create_joinable=''
713 d_pthread_attr_setscope=''
758 sethostent_r_proto=''
775 setprotoent_r_proto=''
787 setservent_r_proto=''
800 d_siginfo_si_errno=''
803 d_siginfo_si_status=''
805 d_siginfo_si_value=''
817 d_ipv6_mreq_source=''
846 perl_static_inline=''
851 d_stdio_ptr_lval_nochange_cnt=''
852 d_stdio_ptr_lval_sets_cnt=''
931 default_inc_excludes_dot=''
997 d_gdbm_ndbm_h_uses_prototypes=''
998 d_gdbmndbm_h_uses_prototypes=''
1000 d_ndbm_h_uses_prototypes=''
1070 d_inc_version_list=''
1072 inc_version_list_init=''
1080 installusrbinperl=''
1096 ignore_versioned_solibs=''
1112 d_double_has_negative_zero=''
1113 d_double_has_subnormals=''
1114 d_double_style_cray=''
1115 d_double_style_ibm=''
1116 d_double_style_ieee=''
1117 d_double_style_vax=''
1168 d_perl_otherlibdirs=''
1176 api_versionstring=''
1182 version_patchlevel_string=''
1186 d_nv_preserves_uv=''
1187 d_nv_zero_is_allbits_zero=''
1198 nv_overflows_integers_at=''
1199 nv_preserves_uv_bits=''
1271 installsitehtml1dir=''
1274 installsitehtml3dir=''
1281 installsiteman1dir=''
1284 installsiteman3dir=''
1289 installsitescript=''
1307 d_stdio_stream_array=''
1308 stdio_stream_array=''
1326 usekernprocpathname=''
1327 ccflags_uselargefiles=''
1328 ldflags_uselargefiles=''
1329 libswanted_uselargefiles=''
1338 usensgetexecutablepath=''
1351 installvendorarch=''
1358 installvendorhtml1dir=''
1360 vendorhtml1direxp=''
1361 installvendorhtml3dir=''
1363 vendorhtml3direxp=''
1369 installvendorman1dir=''
1372 installvendorman3dir=''
1379 installvendorscript=''
1390 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1393 : We must find out about Eunice early
1395 if test -f /etc/unixtovms; then
1396 eunicefix=/etc/unixtovms
1398 if test -f /etc/unixtovms.exe; then
1399 eunicefix=/etc/unixtovms.exe
1402 : Set executable suffix now -- needed before hints available
1403 if test -f "/libs/version.library"; then
1406 elif test -f "/system/gnu_library/bin/ar.pm"; then
1409 elif test -n "$DJGPP"; then
1412 elif test -f /kern/cookiejar; then
1415 elif test -d c:/. -o -n "$is_os2" ; then
1422 : Possible local include directories to search.
1423 : Set locincpth to "" in a hint file to defeat local include searches.
1424 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1425 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1427 : no include file wanted by default
1430 : Enable -DEBUGGING and -DDEBUGGING from the command line
1434 : Trailing extension. Override this in a hint file, if needed.
1435 : Extra object files, if any, needed on this platform.
1438 : change the next line if compiling for Xenix/286 on Xenix/386
1439 xlibpth='/usr/lib/386 /lib/386'
1440 : Possible local library directories to search.
1441 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1442 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1444 : general looking path for locating libraries
1445 glibpth="/lib /usr/lib $xlibpth"
1446 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1447 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1448 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1449 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1451 : Private path used by Configure to find libraries. Its value
1452 : is prepended to libpth. This variable takes care of special
1453 : machines, like the mips. Usually, it should be empty.
1456 : default library list
1458 : some systems want to use only the non-versioned libso:s
1459 ignore_versioned_solibs=''
1463 : set useposix=false in your hint file to disable the POSIX extension.
1465 : set useopcode=false in your hint file to disable the Opcode extension.
1468 ccflags_uselargefiles=''
1469 ldflags_uselargefiles=''
1470 libswanted_uselargefiles=''
1471 : set usemultiplicity on the Configure command line to enable multiplicity.
1472 : set usesocks on the Configure command line to enable socks.
1474 : set usethreads on the Configure command line to enable threads.
1475 usereentrant='undef'
1476 : List of libraries we want.
1477 : If anyone needs extra -lxxx, put those in a hint file.
1478 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1479 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1480 : We probably want to search /usr/shlib before most other libraries.
1481 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1482 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1483 glibpth="/usr/shlib $glibpth"
1484 : Do not use vfork unless overridden by a hint file.
1487 : Find the basic shell for Bourne shell scripts
1491 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1494 if test -f "$xxx"; then
1497 : Build up a list and do a single loop so we can 'break' out.
1498 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1499 for xxx in sh bash ksh pdksh ash; do
1501 try="$try ${p}/${xxx}"
1505 if test -f "$xxx"; then
1508 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1511 elif test -f "$xxx.exe"; then
1522 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1524 Usually it's in /bin/sh. How did you even get this far?
1525 Please contact me (Perl Maintainers) at perlbug@perl.org and
1526 we'll try to straighten this all out.
1532 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1533 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1536 : see if sh knows # comments
1537 if `$sh -c '#' >/dev/null 2>&1`; then
1541 test -f $xcat$_exe || xcat=/usr/bin/cat
1542 if test ! -f $xcat$_exe; then
1543 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1544 if test -f $p/cat$_exe; then
1549 if test ! -f $xcat$_exe; then
1550 echo "Can't find cat anywhere!"
1554 echo "#!$xcat" >sharp
1557 ./sharp > today 2>/dev/null
1558 if test -s today; then
1561 echo "#! $xcat" > sharp
1564 ./sharp > today 2>/dev/null
1565 if test -s today; then
1573 echo "Your $sh doesn't grok # comments--I will strip them later on."
1576 echo "exec grep -v '^[ ]*#'" >spitshell
1578 $eunicefix spitshell
1579 spitshell=`pwd`/spitshell
1581 echo "I presume that if # doesn't work, #! won't work either!"
1586 : figure out how to guarantee sh startup
1588 '') startsh=${sharpbang}${sh} ;;
1600 : echo "Yup, it does."
1602 echo "Hmm... '$startsh' does not guarantee sh startup..."
1603 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1607 : Save command line options in file UU/cmdline.opt for later use in
1608 : generating config.sh.
1609 cat > cmdline.opt <<EOSH
1610 : Configure command line arguments.
1619 cat >>cmdline.opt <<EOSH
1620 config_arg$argn='$arg'
1622 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1625 arg_exp=`cat cmdl.opt`
1626 args_exp="$args_exp$args_sep'$arg_exp'"
1627 argn=`expr $argn + 1`
1632 : produce awk script to parse command line options
1633 cat >options.awk <<'EOF'
1635 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1637 len = length(optstr);
1638 for (i = 1; i <= len; i++) {
1639 c = substr(optstr, i, 1);
1640 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1651 if (substr(str, 1, 1) != "-") {
1652 printf("'%s'\n", str);
1656 for (i = 2; i <= len; i++) {
1657 c = substr(str, i, 1);
1659 printf("-%s\n", substr(str, i));
1665 printf("'%s'\n", substr(str, i + 1));
1678 : process the command line options
1679 set X `for arg in "$@"; do echo "X$arg"; done |
1680 sed -e s/X// | awk -f options.awk`
1685 : set up default values
1694 rm -f optdef.sh posthint.sh
1695 cat >optdef.sh <<EOS
1701 while test $# -gt 0; do
1703 -d) shift; fastread=yes;;
1704 -e) shift; alldone=cont;;
1708 if test -r "$1"; then
1711 echo "$me: cannot read config file $1." >&2
1717 -h) shift; error=true;;
1718 -r) shift; reuseval=true;;
1719 -s) shift; silent=true; realsilent=true;;
1720 -E) shift; alldone=exit;;
1721 -K) shift; knowitall=true;;
1723 -S) shift; silent=true; extractsh=true;;
1728 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1729 echo "$me: ignoring -D $1" >&2
1732 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1733 *) echo "$1='define'" >> optdef.sh;;
1740 *=) echo "$1" >> optdef.sh;;
1742 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1743 echo "$me: ignoring -U $1" >&2
1745 *) echo "$1='undef'" >> optdef.sh;;
1756 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1760 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1761 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1767 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1768 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1769 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1770 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1771 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1772 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1778 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1780 echo "$yyy=''" >> posthint.sh ;;
1785 echo "$yyy='$zzz'" >> posthint.sh ;;
1787 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1789 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1794 echo "$yyy=$zzz" >> posthint.sh ;;
1795 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1799 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1802 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1810 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1811 [-U symbol] [-U symbol=] [-A command:symbol...]
1812 -d : use defaults for all answers.
1813 -e : go on without questioning past the production of config.sh.
1814 -f : specify an alternate default configuration file.
1815 -h : print this help message and exit (with an error status).
1816 -r : reuse C symbols value if possible (skips costly nm extraction).
1817 -s : silent mode, only echoes questions and essential information.
1818 -D : define symbol to have some value:
1819 -D symbol symbol gets the value 'define'
1820 -D symbol=value symbol gets the value 'value'
1821 common used examples (see INSTALL for more info):
1822 -Duse64bitint use 64bit integers
1823 -Duse64bitall use 64bit integers and pointers
1824 -Dusethreads use thread support
1825 -Dinc_version_list=none do not include older perl trees in @INC
1826 -DEBUGGING=none DEBUGGING options
1827 -Dcc=gcc choose your compiler
1828 -Dprefix=/opt/perl5 choose your destination
1829 -E : stop at the end of questions, after having produced config.sh.
1830 -K : do not use unless you know what you are doing.
1831 -O : ignored for backward compatibility
1832 -S : perform variable substitutions on all .SH files (can mix with -f)
1833 -U : undefine symbol:
1834 -U symbol symbol gets the value 'undef'
1835 -U symbol= symbol gets completely empty
1837 -A : manipulate symbol after the platform specific hints have been applied:
1838 -A append:symbol=value append value to symbol
1839 -A symbol=value like append:, but with a separating space
1840 -A define:symbol=value define symbol to have value
1841 -A clear:symbol define symbol to be ''
1842 -A define:symbol define symbol to be 'define'
1843 -A eval:symbol=value define symbol to be eval of value
1844 -A prepend:symbol=value prepend value to symbol
1845 -A undef:symbol define symbol to be 'undef'
1846 -A undef:symbol= define symbol to be ''
1847 e.g.: -A prepend:libswanted='cl pthread '
1848 -A ccflags=-DSOME_MACRO
1849 -V : print version number and exit (with a zero status).
1856 case "$fastread$alldone" in
1859 case "$extractsh" in
1862 if test ! -t 0; then
1863 echo "Say 'sh Configure', not 'sh <Configure'"
1873 true) exec 1>/dev/null;;
1876 : run the defines and the undefines, if any, but leave the file out there...
1878 grep '\\' optdef.sh >/dev/null 2>&1
1879 if test $? = 0; then
1880 echo "Configure does not support \\ in -D arguments"
1884 : create the posthint manipulation script and leave the file out there...
1889 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1890 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1891 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1892 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1893 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1896 : Some greps do not return status, grrr.
1897 echo "grimblepritz" >grimble
1898 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1900 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1906 : the following should work in any shell
1910 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1911 cat >contains <<'EOSS'
1912 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1917 : Find the path to the source tree
1920 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1924 *) src=`cd ../$src && pwd` ;;
1937 if test -f $rsrc/Configure && \
1938 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1940 : found it, so we are ok.
1943 for src in . .. ../.. ../../.. ../../../..; do
1944 if test -f ../$src/Configure && \
1945 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1956 Sorry, I can't seem to locate the source dir for $package. Please start
1957 Configure with an explicit path -- i.e. /some/path/Configure.
1965 echo "Sources for $package found in \"$src\"." >&4
1969 : script used to extract .SH files with variable substitutions
1970 cat >extract <<'EOS'
1972 echo "Doing variable substitutions on .SH files..."
1973 if test -f MANIFEST; then
1974 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1976 echo "(Looking for .SH files under the source directory.)"
1977 set x `(cd "$src"; find . -name "*.SH" -print)`
1981 0) set x `(cd "$src"; echo *.SH)`; shift;;
1983 if test ! -f "$src/$1"; then
1989 while test $name; do
1990 if test ! -d "$name"; then
1991 create="$name $create";
1992 name=`echo $name | sed -e "s|^[^/]*$||"`;
1993 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1998 for file in $create; do
2007 dir=`expr X$file : 'X\(.*\)/'`
2008 file=`expr X$file : 'X.*/\(.*\)'`
2009 (cd "$dir" && . ./$file)
2019 dir=`expr X$file : 'X\(.*\)/'`
2020 file=`expr X$file : 'X.*/\(.*\)'`
2021 (set x $dir; shift; eval $mkdir_p)
2022 sh <"$src/$dir/$file"
2031 if test -f "$src/config_h.SH"; then
2032 if test ! -f config.h; then
2033 : oops, they left it out of MANIFEST, probably, so do it anyway.
2034 . "$src/config_h.SH"
2039 : extract files and exit if asked to do so
2040 case "$extractsh" in
2042 case "$realsilent" in
2046 case "$config_sh" in
2047 '') config_sh='config.sh';;
2050 echo "Fetching answers from $config_sh..."
2057 echo "Extraction done."
2062 : Eunice requires " " instead of "", can you believe it
2065 echo "Beginning of configuration questions for $package."
2067 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2069 : first determine how to suppress newline on echo command
2071 echo "Checking echo to see how to suppress newlines..."
2072 (echo "hi there\c" ; echo " ") >.echotmp
2073 if $contains c .echotmp >/dev/null 2>&1 ; then
2084 echo $n "The star should be here-->$c"
2088 : Now test for existence of everything in MANIFEST
2090 if test -f "$rsrc/MANIFEST"; then
2091 echo "First let's make sure your kit is complete. Checking..." >&4
2092 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2093 (split -l 50 2>/dev/null || split -50)
2096 for filelist in x??; do
2097 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2098 >/dev/null 2>>"$tmppwd/missing")
2100 if test -s missing; then
2104 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2106 You have the option of continuing the configuration process, despite the
2107 distinct possibility that your kit is damaged, by typing 'y'es. If you
2108 do, don't blame me if something goes wrong. I advise you to type 'n'o
2109 and contact the author (perlbug@perl.org).
2112 echo $n "Continue? [n] $c" >&4
2116 echo "Continuing..." >&4
2120 echo "ABORTING..." >&4
2125 echo "Looks good..."
2128 echo "There is no MANIFEST file. I hope your kit is complete !"
2132 : Find the appropriate value for a newline for tr
2133 if test -n "$DJGPP"; then
2136 if test X"$trnl" = X; then
2137 case "`echo foo | tr '\n' x 2>/dev/null`" in
2141 if test X"$trnl" = X; then
2142 case "`echo foo | tr '\012' x 2>/dev/null`" in
2143 foox) trnl='\012' ;;
2146 if test X"$trnl" = X; then
2147 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2148 fooxy) trnl='\n\r' ;;
2151 if test X"$trnl" = X; then
2154 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2160 : compute the number of columns on the terminal for proper question formatting
2165 : set up the echo used in my read
2166 myecho="case \"\$xxxm\" in
2167 '') echo $n \"\$rp $c\" >&4;;
2169 '') echo $n \"[\$xxxm] $c\";;
2171 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2173 echo $n \"[\$xxxm] $c\" >&4
2175 echo $n \"\$rp [\$xxxm] $c\" >&4
2181 : now set up to do reads with possible shell escape and default assignment
2187 case "\$fastread" in
2188 yes) case "\$dflt" in
2191 case "\$silent-\$rp" in
2196 *) case "\$silent" in
2197 true) case "\$rp" in
2202 while expr "X\$ans" : "X!" >/dev/null; do
2206 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2214 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2223 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2228 echo "(OK, I'll run with -d after this question.)" >&4
2231 echo "*** Sorry, \$1 not supported yet." >&4
2241 echo "*** Substitution done -- please confirm."
2243 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2248 echo "*** Error -- try again."
2255 case "\$ans\$xxxm\$nostick" in
2267 : create .config dir to save info across Configure sessions
2268 test -d ../.config || mkdir ../.config
2269 cat >../.config/README <<EOF
2270 This directory created by Configure to save information that should
2271 persist across sessions for $package.
2273 You may safely delete it if you wish.
2276 : See if we are using a devel version and want that
2277 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2280 usedevel="$define" ;;
2281 *) case "$xversion" in
2284 *** WHOA THERE!!! ***
2286 This is an UNSTABLE DEVELOPMENT release.
2287 The version of this $package distribution is $xversion, that is, odd,
2288 (as opposed to even) and that signifies a development release.
2289 If you want a maintenance release, you want an even-numbered version.
2291 Do ***NOT*** install this into production use.
2292 Data corruption and crashes are possible.
2294 It is most seriously suggested that you do not continue any further
2295 unless you want to help in developing and debugging Perl.
2297 If you *still* want to build perl, you can answer 'y' now,
2298 or pass -Dusedevel to Configure.
2301 rp='Do you really want to continue?'
2305 [yY]) echo >&4 "Okay, continuing."
2306 usedevel="$define" ;;
2307 *) echo >&4 "Okay, bye."
2318 case "$versiononly" in
2319 '') versiononly="$define" ;;
2321 case "$installusrbinperl" in
2322 '') installusrbinperl="$undef" ;;
2327 : general instructions
2330 user=`(logname) 2>/dev/null`
2332 '') user=`whoami 2>&1`;;
2334 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2337 rp='Would you like to see the instructions?'
2348 This installation shell script will examine your system and ask you questions
2349 to determine how the perl5 package should be installed. If you get
2350 stuck on a question, you may use a ! shell escape to start a subshell or
2351 execute a command. Many of the questions will have default answers in square
2352 brackets; typing carriage return will give you the default.
2354 On some of the questions which ask for file or directory names you are allowed
2355 to use the ~name construct to specify the login directory belonging to "name",
2356 even if you don't have a shell which knows about that. Questions where this is
2357 allowed will be marked "(~name ok)".
2361 dflt='Type carriage return to continue'
2365 The prompter used in this script allows you to use shell variables and
2366 backticks in your answers. You may use $1, $2, etc... to refer to the words
2367 in the default answer, as if the default line was a set of arguments given to a
2368 script shell. This means you may also use $* to repeat the whole default line,
2369 so you do not have to re-type everything to add something to the default.
2371 Every time there is a substitution, you will have to confirm. If there is an
2372 error (e.g. an unmatched backtick), the default answer will remain unchanged
2373 and you will be prompted again.
2375 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2376 the questions and use the computed defaults (or the previous answers if there
2377 was already a config.sh file). Type 'Configure -h' for a list of options.
2378 You may also start interactively and then answer '& -d' at any prompt to turn
2379 on the non-interactive behaviour for the remainder of the execution.
2385 Much effort has been expended to ensure that this shell script will run on any
2386 Unix system. If despite that it blows up on yours, your best bet is to edit
2387 Configure and run it again. If you can't run Configure for some reason,
2388 you'll have to generate a config.sh file by hand. Whatever problems you
2389 have, let me (perlbug@perl.org) know how I blew it.
2391 This installation script affects things in two ways:
2393 1) it may do direct variable substitutions on some of the files included
2395 2) it builds a config.h file for inclusion in C programs. You may edit
2396 any of these files as the need arises after running this script.
2398 If you make a mistake on a question, there is no easy way to back up to it
2399 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2400 files. Configure will offer to let you do this before it runs the SH files.
2403 dflt='Type carriage return to continue'
2405 case "$firsttime" in
2406 true) echo $user >>../.config/instruct;;
2410 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2411 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2412 if test "X$sysroot" = X; then
2417 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2418 # _sysroot is used in places where we need --sysroot=foo
2419 # but using the rest of the flags could cause issues.
2420 _sysroot="--sysroot=$sysroot";
2424 ccflags="$ccflags $_sysroot"
2429 ldflags="$ldflags $_sysroot"
2434 cppflags="$cppflags $_sysroot"
2436 # lddlflags updated below in lddlflags section;
2437 # same with cccdlflags
2441 # Adjust some defaults to also use $sysroot
2442 for var in xlibpth loclibpth locincpth glibpth; do
2445 for path in $xxx; do
2446 eval $var=\"\$$var $sysroot$path\"
2452 : find out where common programs are
2454 echo "Locating common programs..." >&4
2467 if test -d \$dir/\$thing; then
2473 for thisthing in \$dir/\$thing; do
2474 : just loop through to pick last item
2476 if test -f \$thisthing; then
2479 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2482 elif test -f \$dir/\$thing.exe; then
2483 if test -n "$DJGPP"; then
2484 echo \$dir/\$thing.exe
2485 elif test "$eunicefix" != ":"; then
2486 : on Eunice apparently
2539 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2540 pth="$pth $sysroot/lib $sysroot/usr/lib"
2541 for file in $loclist; do
2545 if test -f "$xxx"; then
2548 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2549 xxx=`./loc $file $file $pth`
2552 '') xxx=`./loc $file $file $pth`;;
2553 *) xxx=`./loc $xxx $xxx $pth`;;
2555 eval $file=$xxx$_exe
2559 echo $file is in $xxx.
2562 echo $file is in $xxx.
2565 echo "I don't know where '$file' is, and my life depends on it." >&4
2566 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2572 echo "Don't worry if any of the following aren't found..."
2574 for file in $trylist; do
2578 if test -f "$xxx"; then
2581 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2582 xxx=`./loc $file $file $pth`
2585 '') xxx=`./loc $file $file $pth`;;
2586 *) xxx=`./loc $xxx $xxx $pth`;;
2588 eval $file=$xxx$_exe
2592 echo $file is in $xxx.
2595 echo $file is in $xxx.
2598 echo "I don't see $file out there, $say."
2605 echo "Substituting grep for egrep."
2612 *) if $less -R </dev/null >/dev/null 2>&1; then
2613 echo "Substituting less -R for less."
2621 echo "Substituting cp for ln."
2630 echo "I can't find make or gmake, and my life depends on it." >&4
2631 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2639 *) # We can't have osname yet.
2640 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2641 # Assume that gmake, if found, is definitely GNU make
2642 # and prefer it over the system make.
2643 echo "Substituting gmake for make."
2651 echo "Hopefully test is built into your sh."
2654 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2655 echo "Using the test built into your sh."
2663 echo "Hopefully echo is built into your sh."
2668 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2669 $echo $n "hi there$c" >foo1
2670 echo $n "hi there$c" >foo2
2671 if cmp foo1 foo2 >/dev/null 2>&1; then
2672 echo "They are compatible. In fact, they may be identical."
2679 They are not compatible! You are probably running ksh on a non-USG system.
2680 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2681 have echo built in and we may have to run some Bourne shell scripts. That
2682 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2685 $echo $n "The star should be here-->$c"
2692 # This question was auctioned at YAPC::Europe-2007 in Vienna
2693 # I never promised you could answer it. I only auctioned the question.
2695 The following message is sponsored by
2697 Dresden.pm<--The stars should be here.
2699 Dear Perl user, system administrator or package
2700 maintainer, the Perl community sends greetings to
2701 you. Do you (emblematical) greet back [Y/n]? n
2705 : Check what type of C compiler we use
2709 cat <<'EOSC' >>trygcc
2714 int main(int argc, char *argv[]) {
2718 if $cc -o try $ccflags $ldflags try.c; then
2721 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2727 # Skip this test because it gives a false match on output like:
2728 # ./trygcc: line 23: cc: command not found
2729 # case "`$cc -v -c try.c 2>&1`" in
2730 # *gcc*) trygcc=no ;;
2732 if $test X"$trygcc" = Xyes; then
2733 if gcc -o try -c try.c; then
2735 echo "You seem to have a working gcc, though." >&4
2736 # Switching compilers may undo the work of hints files.
2737 # The most common problem is -D_REENTRANT for threads.
2738 # This heuristic catches that case, but gets false positives
2739 # if -Dusethreads was not actually specified. Better to
2740 # bail out here with a useful message than fail
2741 # mysteriously later. Should we perhaps just try to
2742 # re-invoke Configure -Dcc=gcc config_args ?
2743 if $test -f usethreads.cbu; then
2746 *** However, any setting of the C compiler flags (e.g. for thread support)
2747 *** will be lost. It may be necessary for you to restart Configure and
2748 *** add -Dcc=gcc to your Configure command line.
2751 rp="Would you like to go ahead and try gcc anyway?"
2754 rp="Would you like to use it?"
2757 if $test -f myread; then
2760 if $test -f UU/myread; then
2763 echo "Cannot find myread, sorry. Aborting." >&2
2768 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2781 cat <<'EOSC' >>checkcc
2786 int main(int argc, char *argv[]) {
2790 if $cc -o try $ccflags $ldflags try.c; then
2793 if $test X"$despair" = Xyes; then
2794 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2797 You need to find a working C compiler.
2798 Either (purchase and) install the C compiler supplied by your OS vendor,
2799 or for a free C compiler try http://gcc.gnu.org/
2800 I cannot continue any further, aborting.
2809 : determine whether symbolic links are supported
2812 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2813 echo "Symbolic links are supported." >&4
2816 echo "Symbolic links are NOT supported." >&4
2821 : determine whether symbolic links are supported
2825 echo "Checking how to test for symbolic links..." >&4
2827 if $test "X$issymlink" = X; then
2829 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2830 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2832 if test $? = 0; then
2835 echo "Your builtin 'test -h' may be broken." >&4
2838 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2841 if test -f "$p/$test"; then
2850 echo "Trying external '$test -h'." >&4
2851 issymlink="$test -h"
2852 if $test ! -h sym >/dev/null 2>&1; then
2853 echo "External '$test -h' is broken, too." >&4
2861 if $test "X$issymlink" = X; then
2862 if $test -L sym 2>/dev/null; then
2863 issymlink="$test -L"
2864 echo "The builtin '$test -L' worked." >&4
2867 if $test "X$issymlink" != X; then
2868 echo "You can test for symbolic links with '$issymlink'." >&4
2870 echo "I do not know how you can test for symbolic links." >&4
2874 *) echo "No symbolic links, so not testing for their testing..." >&4
2878 : Make symlinks util
2879 case "$mksymlinks" in
2882 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2885 *) case "$lns:$issymlink" in
2886 *"ln"*" -s:"*"test -"?)
2887 echo "Creating the symbolic links..." >&4
2889 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2899 print "# dir = ", dir, "file = ", file
2900 mf[dir] = mf[dir]" "source"/"dir"/"file;
2903 if (d != ".") { print("mkdir -p "d) }
2904 print("ln -sf "mf[d]" "d);
2906 }' source="$src" > UU/mksymlinks.$$
2910 if test ! -d t/base; then
2911 echo "Failed to create the subdirectories. Aborting." >&4
2915 if test ! -f t/base/lex.t; then
2916 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2919 if test ! -f win32/win32.c; then
2920 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2925 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2933 : Check for Cross-Compilation
2934 if $test "X$targethost" = "X"; then
2937 if $test "X$targetenv" = "X"; then
2940 case "$usecrosscompile" in
2942 $echo "Cross-compiling..."
2945 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2946 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2947 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2948 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2949 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2950 # leave out ld, choosing it is more complex
2951 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2952 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2953 # We are in a weird spot. Just before us, some values
2954 # were 'saved', to be restored after the hints are
2955 # run. This means that the changes we made to ar,
2956 # nm and ranlib will get reverted.
2957 # To avoid that, we hijack the saving mechanism and
2958 # have it save our new values.
2959 for file in ar nm ranlib; do
2961 eval $file=$xxx$_exe
2966 case "$targetarch" in
2967 '') echo "Targetarch not defined." >&4; croak=y ;;
2968 *) echo "Using targetarch $targetarch." >&4 ;;
2970 case "$targethost" in
2971 '') echo "Targethost not defined." >&4; croak=n ;;
2972 *) echo "Using targethost $targethost." >&4
2977 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2979 : compile a host miniperl and generate_uudmap, unless we got passed them
2980 if $test "X$hostperl" = X; then
2981 echo "Building host miniperl and generate_uudmap binaries" >&4
2989 $src/Configure -des -Dusedevel -Dmksymlinks
2991 case "$hostgenerate" in
2992 '') $make generate_uudmap
2993 hostgenerate=$src/host/generate_uudmap
2995 "$undef") hostgenerate=''
2998 hostperl=$src/host/miniperl
3001 hostosname=`$hostperl -le 'print $^O'`
3004 usecrosscompile="$undef"
3008 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3009 case "$targethost" in
3010 '') echo "Checking for cross-compile" >&4
3011 case "$usecrosscompile$multiarch" in
3012 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3013 if [ -f Makefile ]; then
3015 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3017 echo "Configure done."
3021 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3028 *) echo "Using targethost $targethost." >&4
3030 /*) run=$src/Cross/run
3031 targetmkdir=$src/Cross/mkdir
3033 from=$src/Cross/from
3035 *) pwd=`$test -f ../Configure & cd ..; pwd`
3037 targetmkdir=$pwd/Cross/mkdir
3039 from=$pwd/Cross/from
3042 case "$targetrun" in
3043 '') targetrun=ssh ;;
3048 case "$targetfrom" in
3049 '') targetfrom=scp ;;
3053 from=$from-$targetfrom
3054 case "$targetdir" in
3056 echo "Guessing targetdir $targetdir." >&4
3059 case "$targetuser" in
3061 echo "Guessing targetuser $targetuser." >&4
3064 case "$targetport" in
3066 echo "Guessing targetport $targetport." >&4
3069 case "$targetfrom" in
3073 case "$targetrun" in
3093 '') cwd=$targetdir ;;
3098 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3104 *) echo "Unknown targetrun '$targetrun'" >&4
3108 case "$targetmkdir" in
3110 cat >$targetmkdir <<EOF
3112 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3114 $chmod a+rx $targetmkdir
3116 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3128 $targetmkdir \`dirname \$f\`
3129 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3132 $targetmkdir $targetdir/\`dirname \$f\`
3133 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3146 $mkdir -p $targetdir/\`dirname \$f\`
3147 $cp \$f $targetdir/\$f || exit 1
3150 $targetmkdir $targetdir/\`dirname \$f\`
3151 $cp \$f $targetdir/\$f || exit 1
3158 *) echo "Unknown targetto '$targetto'" >&4
3162 case "$targetfrom" in
3169 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3174 cp) cat >$from <<EOF
3179 cp $targetdir/\$f . || exit 1
3184 *) echo "Unknown targetfrom '$targetfrom'" >&4
3188 if $test ! -f $run; then
3189 echo "Target 'run' script '$run' not found." >&4
3193 if $test ! -f $to; then
3194 echo "Target 'to' script '$to' not found." >&4
3198 if $test ! -f $from; then
3199 echo "Target 'from' script '$from' not found." >&4
3203 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3207 Using '$run' for remote execution,
3208 and '$from' and '$to'
3209 for remote file transfer.
3215 usecrosscompile="$undef"
3220 : see whether [:lower:] and [:upper:] are supported character classes
3222 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3224 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3228 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3229 # (0xd9 and 0xe2), therefore that is a nice testing point.
3230 if test "X$up" = X -o "X$low" = X; then
3231 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3237 if test "X$up" = X -o "X$low" = X; then
3238 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3244 if test "X$up" = X -o "X$low" = X; then
3245 case "`echo RS | od -x 2>/dev/null`" in
3247 echo "Hey, this might be EBCDIC." >&4
3248 if test "X$up" = X -o "X$low" = X; then
3249 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3250 rs) up='[A-IJ-RS-Z]'
3255 if test "X$up" = X -o "X$low" = X; then
3256 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3266 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3268 echo "Using $up and $low to convert case." >&4
3271 echo "I don't know how to translate letters from upper to lower case." >&4
3272 echo "Your tr is not acting any way I know of." >&4
3276 : set up the translation script tr, must be called with ./tr of course
3280 '[A-Z][a-z]') exec $tr '$up' '$low';;
3281 '[a-z][A-Z]') exec $tr '$low' '$up';;
3288 : Try to determine whether config.sh was made on this system
3289 case "$config_sh" in
3291 myuname=`$uname -a 2>/dev/null`
3292 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3293 # Downcase everything to avoid ambiguity.
3294 # Remove slashes and single quotes so we can use parts of this in
3295 # directory and file names.
3296 # Remove newlines so myuname is sane to use elsewhere.
3297 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3298 # because the A-Z/a-z are not consecutive.
3299 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3300 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3301 newmyuname="$myuname"
3303 case "$knowitall" in
3305 if test -f ../config.sh; then
3306 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3307 eval "`grep myuname= ../config.sh`"
3309 if test "X$myuname" = "X$newmyuname"; then
3317 : Get old answers from old config file if Configure was run on the
3318 : same system, otherwise use the hints.
3321 if test -f config.sh; then
3323 rp="I see a config.sh file. Shall I use it to set the defaults?"
3326 n*|N*) echo "OK, I'll ignore it."
3327 mv config.sh config.sh.old
3328 myuname="$newmyuname"
3330 *) echo "Fetching default answers from your old config.sh file..." >&4
3338 : Older versions did not always set $sh. Catch re-use of such
3348 if test ! -f config.sh; then
3351 First time through, eh? I have some defaults handy for some systems
3352 that need some extra help getting the Configure answers right:
3355 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3357 : Half the following guesses are probably wrong... If you have better
3358 : tests or hints, please send them to perlbug@perl.org
3359 : The metaconfig authors would also appreciate a copy...
3360 $test -f /irix && osname=irix
3361 $test -f /xenix && osname=sco_xenix
3362 $test -f /dynix && osname=dynix
3363 $test -f /dnix && osname=dnix
3364 $test -f /lynx.os && osname=lynxos
3365 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3366 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3367 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3368 $test -f /bin/mips && /bin/mips && osname=mips
3369 $test -d /usr/apollo/bin && osname=apollo
3370 $test -f /etc/saf/_sactab && osname=svr4
3371 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3372 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3373 $test -f /sys/utilities/MultiView && osname=amigaos
3374 if $test -d /MachTen -o -d /MachTen_Folder; then
3376 if $test -x /sbin/version; then
3377 osvers=`/sbin/version | $awk '{print $2}' |
3378 $sed -e 's/[A-Za-z]$//'`
3379 elif $test -x /usr/etc/version; then
3380 osvers=`/usr/etc/version | $awk '{print $2}' |
3381 $sed -e 's/[A-Za-z]$//'`
3387 $test -f /sys/posix.dll &&
3388 $test -f /usr/bin/what &&
3389 set X `/usr/bin/what /sys/posix.dll` &&
3390 $test "$3" = UWIN &&
3394 if $test -f $uname; then
3402 umips) osname=umips ;;
3405 [23]100) osname=mips ;;
3407 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3408 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3411 elif $test -f /etc/kconfig; then
3413 if test "$lns" = "$ln -s"; then
3415 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3417 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3424 if test -n "$DJGPP"; then
3433 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3435 # oslevel can fail with:
3436 # oslevel: Unable to acquire lock.
3437 *not\ found) osvers="$4"."$3" ;;
3438 '<3240'|'<>3240') osvers=3.2.0 ;;
3439 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3440 '=3250'|'>3250') osvers=3.2.5 ;;
3444 bitrig) osname=bitrig
3447 bsd386) osname=bsd386
3450 cygwin*) osname=cygwin
3453 *dc.osx) osname=dcosx
3459 domainos) osname=apollo
3465 dragonfly) osname=dragonfly
3468 dynixptx*) osname=dynixptx
3469 osvers=`echo "$4"|sed 's/^v//'`
3471 freebsd) osname=freebsd
3473 genix) osname=genix ;;
3477 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3490 $test -f /system/lib/libandroid.so && osname=linux-android
3494 netbsd*) osname=netbsd
3497 news-os) osvers="$3"
3499 4*) osname=newsos4 ;;
3503 nonstop-ux) osname=nonstopux ;;
3504 openbsd) osname=openbsd
3510 POSIX-BC | posix-bc ) osname=posix-bc
3513 powerux | power_ux | powermax_os | powermaxos | \
3514 powerunix | power_unix) osname=powerux
3520 solaris) osname=solaris
3522 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3529 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3533 titanos) osname=titanos
3542 ultrix) osname=ultrix
3545 osf1|mls+) case "$5" in
3548 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3551 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3554 hp*) osname=hp_osf1 ;;
3555 mips) osname=mips_osf1 ;;
3558 # UnixWare 7.1.2 is known as Open UNIX 8
3559 openunix|unixware) osname=svr5
3567 $2) case "$osname" in
3571 : svr4.x or possibly later
3581 if test -f /stand/boot ; then
3582 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3583 if test -n "$INITPROG" -a -f "$INITPROG"; then
3584 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3585 if test -n "$isesix"; then
3593 *) if test -f /etc/systemid; then
3595 set `echo $3 | $sed 's/\./ /g'` $4
3596 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3598 elif $test -f $src/hints/sco_$1_$2.sh; then
3600 elif $test -f $src/hints/sco_$1.sh; then
3605 '') : Still unknown. Probably a generic Sys V.
3614 *) case "$osname" in
3615 '') : Still unknown. Probably a generic BSD.
3623 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3624 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3625 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3628 $rm -f UU/kernel.what
3629 elif test -d c:/. -o -n "$is_os2" ; then
3636 case "$targetarch" in
3639 case "$targetarch" in
3641 # Will load qnx.sh, which should change osname to nto
3646 # Catch arm-linux-androideabi, mipsel-linux-android,
3647 # and i686-linux-android
3648 osname=linux-android
3652 # Something like arm-linux-gnueabihf is really just
3659 # XXX perhaps we should just assume
3660 # osvers to be 2, or maybe take the value
3661 # from targetarch. Using $run before the
3662 # hints are run is somewhat icky.
3663 set X `$run $uname -a 2>/dev/null`
3666 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3671 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3678 : Now look for a hint file osname_osvers, unless one has been
3679 : specified already.
3682 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3683 : Also try without trailing minor version numbers.
3684 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3685 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3686 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3687 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3690 *) case "$osvers" in
3693 *) if $test -f $src/hints/$file.sh ; then
3695 elif $test -f $src/hints/$xfile.sh ; then
3697 elif $test -f $src/hints/$xxfile.sh ; then
3699 elif $test -f $src/hints/$xxxfile.sh ; then
3701 elif $test -f $src/hints/$xxxxfile.sh ; then
3703 elif $test -f "$src/hints/${osname}.sh" ; then
3712 if $test -f Policy.sh ; then
3715 none) dflt="Policy" ;;
3716 *) dflt="Policy $dflt" ;;
3721 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3725 if $test -f Policy.sh ; then
3728 There's also a Policy hint file available, which should make the
3729 site-specific (policy) questions easier to answer.
3736 You may give one or more space-separated answers, or "none" if appropriate.
3737 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3738 previous run of Configure, you may specify it as well as or instead of
3739 OS-specific hints. If hints are provided for your OS, you should use them:
3740 although Perl can probably be built without hints on many platforms, using
3741 hints often improve performance and may enable features that Configure can't
3742 set up on its own. If there are no hints that match your OS, specify "none";
3743 DO NOT give a wrong version or a wrong OS.
3747 rp="Which of these apply, if any?"
3750 for file in $tans; do
3751 if $test X$file = XPolicy -a -f Policy.sh; then
3753 $cat Policy.sh >> UU/config.sh
3754 elif $test -f $src/hints/$file.sh; then
3755 . $src/hints/$file.sh
3756 $cat $src/hints/$file.sh >> UU/config.sh
3757 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3760 : Give one chance to correct a possible typo.
3761 echo "$file.sh does not exist"
3763 rp="hint to use instead?"
3765 for file in $ans; do
3766 if $test -f "$src/hints/$file.sh"; then
3767 . $src/hints/$file.sh
3768 $cat $src/hints/$file.sh >> UU/config.sh
3769 elif $test X$ans = X -o X$ans = Xnone ; then
3772 echo "$file.sh does not exist -- ignored."
3779 : Remember our hint file for later.
3780 if $test -f "$src/hints/$file.sh" ; then
3790 echo "Fetching default answers from $config_sh..." >&4
3794 cp $config_sh config.sh 2>/dev/null
3806 : Restore computed paths
3807 for file in $loclist $trylist; do
3808 eval $file="\$_$file"
3813 Configure uses the operating system name and version to set some defaults.
3814 The default value is probably right if the name rings a bell. Otherwise,
3815 since spelling matters for me, either accept the default or answer "none"
3822 ''|' '|none) dflt=none ;;
3823 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3826 *) dflt="$osname" ;;
3828 rp="Operating system name?"
3832 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3838 ''|' '|none) dflt=none ;;
3839 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3840 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3842 ''|' ') dflt=none ;;
3847 *) dflt="$osvers" ;;
3849 rp="Operating system version?"
3859 : who configured the system
3860 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3863 cf_by=`(logname) 2>/dev/null`
3866 cf_by=`(whoami) 2>/dev/null`
3868 "") cf_by=unknown ;;
3873 : decide how portable to be. Allow command line overrides.
3874 case "$d_portable" in
3876 *) d_portable="$define" ;;
3879 : set up shell script to do ~ expansion
3885 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3888 if $test -f /bin/csh; then
3889 /bin/csh -f -c "glob \$1"
3894 name=\`$expr x\$1 : '..\([^/]*\)'\`
3895 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3896 if $test ! -d "\$dir"; then
3898 echo "\$me: can't locate home directory for: \$name" >&2
3903 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3919 : now set up to get a file name
3923 cat <<'EOSC' >>getfile
3939 : getfile will accept an answer from the comma-separated list
3940 : enclosed in parentheses even if it does not meet other criteria.
3941 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3942 fn=`echo $fn | sed 's/(.*)//'`
3948 loc_file=`expr $fn : '.*:\(.*\)'`
3949 fn=`expr $fn : '\(.*\):.*'`
3957 */*) fullpath=true;;
3966 *e*) exp_file=true;;
3969 *p*) nopath_ok=true;;
3974 *d*) type='Directory';;
3975 *l*) type='Locate';;
3980 Locate) what='File';;
3985 case "$d_portable" in
3993 while test "$type"; do
3998 true) rp="$rp (~name ok)";;
4001 if test -f UU/getfile.ok && \
4002 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4021 value=`UU/filexp $ans`
4024 if test "$ans" != "$value"; then
4025 echo "(That expands to $value on this system.)"
4039 /*) value="$ansexp" ;;
4040 [a-zA-Z]:/*) value="$ansexp" ;;
4045 echo "I shall only accept a full path name, as in /bin/ls." >&4
4046 echo "Use a ! shell escape if you wish to check pathnames." >&4
4049 echo "Please give a full path name, starting with slash." >&4
4052 echo "Note that using ~name is ok provided it expands well." >&4
4065 for fp in $gfpth; do
4066 if test "X$fp" = X.; then
4071 if test -f "$pf"; then
4073 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4075 echo "($value is not a plain file, but that's ok.)"
4078 if test X"$type" = X; then
4085 for fp in $gfpth; do
4086 if test "X$fp" = X.; then
4091 direxp="$fp/$ansexp"
4093 if test -d "$direxp"; then
4101 if test -d "$ansexp"; then
4102 echo "(Looking for $loc_file in directory $value.)"
4103 value="$value/$loc_file"
4104 ansexp="$ansexp/$loc_file"
4106 if test -f "$ansexp"; then
4109 case "$nopath_ok" in
4110 true) case "$value" in
4112 *) echo "Assuming $value will be in people's path."
4128 if test "$fastread" = yes; then
4133 rp="$what $value doesn't exist. Use that name anyway?"
4152 test "X$gfpthkeep" != Xy && gfpth=""
4155 : determine root of directory hierarchy where package will be installed.
4158 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4161 dflt=`echo "$prefix" | sed 's/.$//'`
4169 By default, $package will be installed in $dflt/bin, manual pages
4170 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4171 installation directories. Typically this is something like /usr/local.
4172 If you wish to have binaries under /usr/bin but other parts of the
4173 installation under /usr/local, that's ok: you will be prompted
4174 separately for each of the installation directories, the prefix being
4175 only used to set the defaults.
4179 rp='Installation prefix to use?'
4187 *) oldprefix="$prefix";;
4194 : allow them to override the AFS root
4197 *) afsroot=$afsroot ;;
4203 $define|true) afs=true ;;
4204 $undef|false) afs=false ;;
4205 *) if $test -d $afsroot; then
4213 echo "AFS may be running... I'll be extra cautious then..." >&4
4215 echo "AFS does not seem to be running..." >&4
4218 : determine installation prefix for where package is to be installed.
4222 Since you are running AFS, I need to distinguish the directory in which
4223 files will reside from the directory in which they are installed (and from
4224 which they are presumably copied to the former directory by occult means).
4227 case "$installprefix" in
4228 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4229 *) dflt="$installprefix";;
4234 In some special cases, particularly when building $package for distribution,
4235 it is convenient to distinguish the directory in which files should be
4236 installed from the directory ($prefix) in which they will
4237 eventually reside. For most users, these two directories are the same.
4240 case "$installprefix" in
4242 *) dflt=$installprefix;;
4246 rp='What installation prefix should I use for installing files?'
4248 installprefix="$ans"
4249 installprefixexp="$ansexp"
4251 : Perform the prefixexp/installprefixexp correction if necessary
4252 cat <<EOS >installprefix
4255 cat <<'EOSC' >>installprefix
4256 : Change installation prefix, if necessary.
4257 if $test X"$prefix" != X"$installprefix"; then
4258 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4260 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4263 chmod +x installprefix
4264 $eunicefix installprefix
4266 : Set variables such as privlib and privlibexp from the output of ./getfile
4267 : performing the prefixexp/installprefixexp correction if necessary.
4268 cat <<EOS >setprefixvar
4271 cat <<'EOSC' >>setprefixvar
4272 eval "${prefixvar}=\"\$ans\""
4273 eval "${prefixvar}exp=\"\$ansexp\""
4276 chmod +x setprefixvar
4277 $eunicefix setprefixvar
4279 : set up the script used to warn in case of inconsistency
4288 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4290 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4291 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4296 echo "*** WHOA THERE!!! ***" >&4
4297 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4300 rp=" Keep the $hint value?"
4303 y) td=$was; tu=$was;;
4307 : function used to set '$1' to '$val'
4308 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4310 $define$undef) . ./whoa; eval "$var=\$td";;
4311 $undef$define) . ./whoa; eval "$var=\$tu";;
4312 *) eval "$var=$val";;
4315 : get the patchlevel
4317 echo "Getting the current patchlevel..." >&4
4318 if $test -r $rsrc/patchlevel.h;then
4319 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4320 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4321 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4322 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4323 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4324 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4325 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4334 $echo "(You do not have patchlevel.h. Eek.)"
4336 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4337 version_patchlevel_string="version $patchlevel subversion $subversion"
4338 case "$perl_patchlevel" in
4340 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4341 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4345 $echo "(You have $package $version_patchlevel_string.)"
4349 : XXX Should be a Configure test for double-dots in filenames.
4350 version=`echo $revision $patchlevel $subversion | \
4351 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4352 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4353 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4356 version=`echo $revision $patchlevel $subversion | \
4357 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4358 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4359 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4362 : Special case the 5.005_xx maintenance series, which used 5.005
4363 : without any subversion label as a subdirectory in $sitelib
4364 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4365 api_versionstring='5.005'
4368 : Do we want threads support and if so, what type
4369 case "$usethreads" in
4370 $define|true|[yY]*) dflt='y';;
4371 *) # Catch case where user specified ithreads or 5005threads but
4372 # forgot -Dusethreads (A.D. 4/2002)
4373 case "$useithreads$use5005threads" in
4374 *$define*) dflt='y';;
4381 Perl can be built to offer a form of threading support on some systems
4382 To do so, Configure can be run with -Dusethreads.
4384 Note that Perl built with threading support runs slightly slower
4385 and uses slightly more memory than plain Perl.
4387 If this doesn't make any sense to you, just accept the default '$dflt'.
4389 rp='Build a threading Perl?'
4392 y|Y) val="$define" ;;
4398 if $test $patchlevel -lt 9; then
4399 case "$usethreads" in
4401 : Default to ithreads unless overridden on command line or with
4404 case "$use5005threads" in
4406 echo "5.005 threads are no longer supported"
4410 case "$useithreads" in
4411 $undef|false|[nN]*) dflt='n';;
4413 rp='Use the newer interpreter-based ithreads?'
4416 y|Y) val="$define" ;;
4421 : Now set use5005threads to the opposite value.
4422 case "$useithreads" in
4423 $define) val="$undef" ;;
4430 useithreads="$undef"
4431 use5005threads="$undef"
4435 case "$useithreads$use5005threads" in
4439 You cannot have both the ithreads and the 5.005 threads enabled
4440 at the same time. Disabling the 5.005 threads since they are
4441 much less stable than the ithreads.
4444 use5005threads="$undef"
4449 : perl-5.9.x and later
4451 if test X"$usethreads" = "X$define"; then
4452 case "$use5005threads" in
4456 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4463 use5005threads="$undef"
4464 useithreads="$usethreads"
4467 case "$d_oldpthreads" in
4468 '') : Configure tests would be welcome here. For now, assume undef.
4470 *) val="$d_oldpthreads" ;;
4476 : Look for a hint-file generated 'call-back-unit'. If the
4477 : user has specified that a threading perl is to be built,
4478 : we may need to set or change some other defaults.
4479 if $test -f usethreads.cbu; then
4480 echo "Your platform has some specific hints regarding threaded builds, using them..."
4483 case "$usethreads" in
4484 "$define"|true|[yY]*)
4486 (Your platform does not have any specific hints for threaded builds.
4487 Assuming POSIX threads, then.)
4493 : Check if multiplicity is required
4496 Perl can be built so that multiple Perl interpreters can coexist
4497 within the same Perl executable.
4500 case "$useithreads" in
4503 This multiple interpreter support is required for interpreter-based threads.
4507 *) case "$usemultiplicity" in
4508 $define|true|[yY]*) dflt='y';;
4512 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4513 rp='Build Perl for multiplicity?'
4516 y|Y) val="$define" ;;
4524 : Check if morebits is requested
4525 case "$usemorebits" in
4526 "$define"|true|[yY]*)
4527 use64bitint="$define"
4528 uselongdouble="$define"
4529 usemorebits="$define"
4531 *) usemorebits="$undef"
4535 : Determine the C compiler to be used
4541 rp="Use which C compiler?"
4545 : See whether they have no cc but they do have gcc
4547 if $test -f cc.cbu; then
4552 : make some quick guesses about what we are up against
4554 $echo $n "Hmm... $c"
4564 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4565 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4567 echo "Looks kind of like an OSF/1 system, but we'll see..."
4569 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4570 xxx=`./loc addbib blurfl $pth`
4571 if $test -f $xxx; then
4572 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4576 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4577 echo "Looks kind of like an extended USG system, but we'll see..."
4579 echo "Looks kind of like a USG system, but we'll see..."
4583 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4584 echo "Looks kind of like a BSD system, but we'll see..."
4588 echo "Looks kind of like a Version 7 system, but we'll see..."
4591 case "$eunicefix" in
4594 There is, however, a strange, musty smell in the air that reminds me of
4595 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4599 : it so happens the Eunice I know will not run shell scripts in Unix format
4603 echo "Congratulations. You aren't running Eunice."
4607 : Detect OS2. The p_ variable is set above in the Head.U unit.
4608 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4609 : semicolon as a patch separator
4614 I have the feeling something is not exactly right, however...don't tell me...
4615 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4616 (Or you may be running DOS with DJGPP.)
4621 if test -f /xenix; then
4622 echo "Actually, this looks more like a XENIX system..."
4627 echo "It's not Xenix..."
4632 if test -f /venix; then
4633 echo "Actually, this looks more like a VENIX system..."
4640 echo "Nor is it Venix..."
4643 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4644 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4647 : Check if we are using GNU gcc and what its version is
4649 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4653 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4655 printf("%s\n", __VERSION__);
4657 printf("%s\n", "1");
4663 if $cc -o try $ccflags $ldflags try.c; then
4664 gccversion=`$run ./try`
4665 case "$gccversion" in
4666 '') echo "You are not using GNU cc." ;;
4667 *) echo "You are using GNU cc $gccversion."
4673 echo "*** WHOA THERE!!! ***" >&4
4674 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4675 case "$knowitall" in
4677 echo " You'd better start hunting for one and let me know about it." >&4
4683 case "$gccversion" in
4684 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4686 case "$gccversion" in
4687 '') gccosandvers='' ;;
4688 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4689 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4691 case "$gccosandvers" in
4692 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4693 $osname$osvers) ;; # looking good
4694 $osname*) cat <<EOM >&4
4696 *** WHOA THERE!!! ***
4698 Your gcc has not been compiled for the exact release of
4699 your operating system ($gccosandvers versus $osname$osvers).
4701 In general it is a good idea to keep gcc synchronized with
4702 the operating system because otherwise serious problems
4703 may ensue when trying to compile software, like Perl.
4705 I'm trying to be optimistic here, though, and will continue.
4706 If later during the configuration and build icky compilation
4707 problems appear (headerfile conflicts being the most common
4708 manifestation), I suggest reinstalling the gcc to match
4709 your operating system release.
4713 *) gccosandvers='' ;; # failed to parse, better be silent
4721 # gcc 3.* complain about adding -Idirectories that they already know about,
4722 # so we will take those off from locincpth.
4723 case "$gccversion" in
4725 echo "main(){}">try.c
4726 for incdir in $locincpth; do
4727 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4728 grep '^c[cp]p*[01]: warning: changing search order '`
4729 if test "X$warn" != X; then
4730 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4736 # gcc 4.9 by default does some optimizations that break perl.
4737 # see ticket 121505.
4739 # The -fwrapv disables those optimizations (and probably others,) so
4740 # for gcc 4.9 (and later, since the optimizations probably won't go
4741 # away), add -fwrapv unless the user requests -fno-wrapv, which
4742 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4743 # which turns the overflows -fwrapv ignores into runtime errors.
4744 case "$gccversion" in
4745 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4747 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4748 *) ccflags="$ccflags -fwrapv" ;;
4752 : What should the include directory be ?
4753 : Use sysroot if set, so findhdr looks in the right place.
4755 $echo $n "Hmm... $c"
4756 dflt="$sysroot/usr/include"
4759 if $test -f /bin/mips && /bin/mips; then
4760 echo "Looks like a MIPS system..."
4761 $cat >usr.c <<'EOCP'
4762 #ifdef SYSTYPE_BSD43
4766 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4767 dflt='/bsd43/usr/include'
4771 mips_type='System V'
4773 $rm -f usr.c usr.out
4774 echo "and you're compiling with the $mips_type compiler and libraries."
4778 echo "Doesn't look like a MIPS system."
4788 case "$xxx_prompt" in
4791 rp='Where are the include files you want to use?'
4799 : see how we invoke the C preprocessor
4801 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4802 cat <<'EOT' >testcpp.c
4808 if test ! -f cppstdin; then
4809 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4810 # AIX cc -E doesn't show the absolute headerfile
4811 # locations but we'll cheat by using the -M flag.
4812 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
4814 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4817 echo "Keeping your $hint cppstdin wrapper."
4820 wrapper=`pwd`/cppstdin
4824 if $test "X$cppstdin" != "X" && \
4825 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4826 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4828 echo "You used to use $cppstdin $cppminus so we'll use that again."
4830 '') echo "But let's see if we can live without a wrapper..." ;;
4832 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4835 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4838 echo "(However, $cpprun $cpplast does not work, let's see...)"
4846 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4853 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4854 $cc -E <testcpp.c >testcpp.out 2>&1; \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4856 echo "Yup, it does."
4857 x_cpp="$cc $cppflags -E"
4859 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4860 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4862 echo "Yup, it does."
4863 x_cpp="$cc $cppflags -E"
4865 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4866 $cc -P <testcpp.c >testcpp.out 2>&1; \
4867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4868 echo "Yipee, that works!"
4869 x_cpp="$cc $cppflags -P"
4871 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4872 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4874 echo "At long last!"
4875 x_cpp="$cc $cppflags -P"
4877 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4878 $cpp <testcpp.c >testcpp.out 2>&1; \
4879 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 x_cpp="$cpp $cppflags"
4883 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4884 $cpp - <testcpp.c >testcpp.out 2>&1; \
4885 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4886 echo "Hooray, it works! I was beginning to wonder."
4887 x_cpp="$cpp $cppflags"
4889 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4890 $wrapper <testcpp.c >testcpp.out 2>&1; \
4891 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4897 rp="No dice. I can't find a C preprocessor. Name one:"
4901 $x_cpp <testcpp.c >testcpp.out 2>&1
4902 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4903 echo "OK, that will do." >&4
4905 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4920 echo "Perhaps can we force $cc -E using a wrapper..."
4921 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4922 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4928 echo "Nope, we'll have to live without it..."
4942 "$wrapper"|'cppstdin') ;;
4943 *) $rm -f $wrapper;;
4945 $rm -f testcpp.c testcpp.out
4947 : Adjust cppfilter for path component separator
4949 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4950 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4954 : Use gcc to determine libpth and incpth
4955 # If using gcc or clang, we can get better values for libpth, incpth
4956 # and usrinc directly from the compiler.
4957 # Note that ccname for clang is also gcc.
4960 $echo 'extern int foo;' > try.c
4961 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4963 if $test $# -gt 0; then
4965 incpth="`$echo $incpth|$sed 's/^ //'`"
4967 j="`$echo $i|$sed 's,/include$,/lib,'`"
4968 if $test -d $j; then
4972 libpth="`$echo $libpth|$sed 's/^ //'`"
4973 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4974 if $test -d $xxx; then
4977 *) libpth="$libpth $xxx";;
4984 '') for i in $incpth; do
4985 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4993 case "$usecrosscompile" in
4996 '') echo "Incpth not defined." >&4; croak=y ;;
4997 *) echo "Using incpth '$incpth'." >&4 ;;
5000 '') echo "Libpth not defined." >&4; croak=y ;;
5001 *) echo "Using libpth '$libpth'." >&4 ;;
5004 '') echo "Usrinc not defined." >&4; croak=y ;;
5005 *) echo "Using usrinc $usrinc." >&4 ;;
5009 if test "X$sysroot" = X; then
5010 echo "Cannot continue, aborting." >&4; exit 1
5012 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5021 : Default value for incpth is just usrinc
5023 '') incpth="$usrinc";;
5026 : Set private lib path
5029 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5034 '') dlist="$loclibpth $plibpth $glibpth";;
5035 *) dlist="$libpth";;
5038 : Now check and see which directories actually exist, avoiding duplicates
5041 if $test -d $xxx; then
5044 *) libpth="$libpth $xxx";;
5050 Some systems have incompatible or broken versions of libraries. Among
5051 the directories listed in the question below, please remove any you
5052 know not to be holding relevant libraries, and add any that are needed.
5053 Say "none" for none.
5057 if test "X$sysroot" != X; then
5059 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5072 rp="Directories to use for library searches?"
5079 : compute shared library extension
5082 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5092 On some systems, shared libraries may be available. Answer 'none' if
5093 you want to suppress searching of shared libraries for the remainder
5094 of this configuration.
5097 rp='What is the file extension used for shared libraries?'
5101 : Does target system insist that shared library basenames are unique
5104 Some dynamic loaders assume that the *basename* of shared library filenames
5105 are globally unique. We'll default this to undef as we assume your system
5106 is not this weird. Set to defined if you're on one of them.
5111 rp='Make shared library basenames unique?'
5114 y|Y) val="$define" ;;
5117 set d_libname_unique
5120 : Define several unixisms.
5121 : Hints files or command line option can be used to override them.
5122 : The convoluted testing is in case hints files set either the old
5125 '') case "$exe_ext" in
5127 *) _exe="$exe_ext" ;;
5132 '') case "$lib_ext" in
5139 '') case "$obj_ext" in
5146 '') case "$path_sep" in
5157 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5159 : Which makefile gets called first. This is used by make depend.
5160 case "$firstmakefile" in
5161 '') firstmakefile='makefile';;
5164 : Check is we will use socks
5166 $define|true|[yY]*) dflt='y';;
5171 Perl can be built to use the SOCKS proxy protocol library. To do so,
5172 Configure must be run with -Dusesocks. If you use SOCKS you also need
5173 to use the PerlIO abstraction layer, this will be implicitly selected.
5175 If this doesn't make any sense to you, just accept the default '$dflt'.
5177 rp='Build Perl for SOCKS?'
5180 y|Y) val="$define" ;;
5186 : Check for uselongdouble support
5188 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5191 case "$uselongdouble" in
5192 $define|true|[yY]*) dflt='y';;
5197 Perl can be built to take advantage of long doubles which
5198 (if available) may give more accuracy and range for floating point numbers.
5200 If this doesn't make any sense to you, just accept the default '$dflt'.
5202 rp='Try to use long doubles if available?'
5205 y|Y) val="$define" ;;
5211 case "$uselongdouble" in
5212 true|[yY]*) uselongdouble="$define" ;;
5215 : Look for a hint-file generated 'call-back-unit'. If the
5216 : user has specified that long doubles should be used,
5217 : we may need to set or change some other defaults.
5218 if $test -f uselongdouble.cbu; then
5219 echo "Your platform has some specific hints regarding long doubles, using them..."
5220 . ./uselongdouble.cbu
5222 case "$uselongdouble" in
5225 (Your platform does not have any specific hints for long doubles.)
5231 : Check if quadmath is requested
5232 case "$usequadmath" in
5233 "$define"|true|[yY]*) usequadmath="$define" ;;
5234 *) usequadmath="$undef" ;;
5237 : Fail if both uselongdouble and usequadmath are requested
5238 case "$usequadmath:$uselongdouble" in
5242 *** You requested the use of the quadmath library and use
5243 *** of long doubles.
5245 *** Please select one or the other.
5251 : Looking for optional libraries
5253 echo "Checking for optional libraries..." >&4
5258 case "$libswanted" in
5259 '') libswanted='c_s';;
5262 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5264 case "$usecbacktrace" in
5265 "$define") libswanted="$libswanted bfd" ;;
5267 case "$usequadmath" in
5268 "$define") libswanted="$libswanted quadmath" ;;
5274 for thisdir in $libpth $xlibpth; do
5275 test -d $thisdir && libspath="$libspath $thisdir"
5277 for thislib in $libswanted; do
5278 for thisdir in $libspath; do
5280 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5281 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5282 $test -f "$xxx" && eval $libscheck
5283 $test -f "$xxx" && libstyle=shared
5284 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5285 $test -f "$xxx" && eval $libscheck
5286 $test -f "$xxx" && libstyle=shared
5288 if test ! -f "$xxx"; then
5289 xxx=$thisdir/lib$thislib.$so
5290 $test -f "$xxx" && eval $libscheck
5291 $test -f "$xxx" && libstyle=shared
5293 if test ! -f "$xxx"; then
5294 xxx=$thisdir/lib$thislib$_a
5295 $test -f "$xxx" && eval $libscheck
5296 $test -f "$xxx" && libstyle=static
5298 if test ! -f "$xxx"; then
5299 xxx=$thisdir/$thislib$_a
5300 $test -f "$xxx" && eval $libscheck
5301 $test -f "$xxx" && libstyle=static
5303 if test ! -f "$xxx"; then
5304 xxx=$thisdir/lib${thislib}_s$_a
5305 $test -f "$xxx" && eval $libscheck
5306 $test -f "$xxx" && libstyle=static
5307 $test -f "$xxx" && thislib=${thislib}_s
5309 if test ! -f "$xxx"; then
5310 xxx=$thisdir/Slib$thislib$_a
5311 $test -f "$xxx" && eval $libscheck
5312 $test -f "$xxx" && libstyle=static
5314 if $test -f "$xxx"; then
5316 shared) echo "Found -l$thislib (shared)." ;;
5317 static) echo "Found -l$thislib." ;;
5318 *) echo "Found -l$thislib ($libstyle)." ;;
5322 *) dflt="$dflt -l$thislib"
5323 libsfound="$libsfound $xxx"
5325 libsfiles="$libsfiles $yyy"
5326 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5327 case " $libsdirs " in
5329 *) libsdirs="$libsdirs $yyy" ;;
5336 if $test ! -f "$xxx"; then
5337 echo "No -l$thislib."
5348 ' '|'') dflt='none';;
5353 In order to compile $package on your machine, a number of libraries
5354 are usually needed. Include any other special libraries here as well.
5355 Say "none" for none. The default list is almost always right.
5359 rp="What libraries to use?"
5366 : determine optimization, if desired, or use for debug flag also
5368 ' '|$undef) dflt='none';;
5370 *) dflt="$optimize";;
5374 By default, $package compiles with the -O flag to use the optimizer.
5375 Alternately, you might want to use the symbolic debugger, which uses
5376 the -g flag (on traditional Unix systems). Either flag can be
5377 specified here. To use neither flag, specify the word "none".
5380 rp="What optimizer/debugger flag should be used?"
5384 'none') optimize=" ";;
5387 : Check what DEBUGGING is required from the command line
5388 : -DEBUGGING or -DDEBUGGING or
5389 : -DEBUGGING=both = -g + -DDEBUGGING
5390 : -DEBUGGING=-g or -Doptimize=-g = -g
5391 : -DEBUGGING=none or -UDEBUGGING =
5392 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5395 *) DEBUGGING=$EBUGGING ;;
5398 case "$DEBUGGING" in
5402 *) optimize="$optimize -g" ;;
5406 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5414 case "$DEBUGGING" in
5415 both|$define) dflt='-DDEBUGGING'
5418 : argument order is deliberate, as the flag will start with - which set could
5419 : think is an option
5420 checkccflag='check=$1; flag=$2; callback=$3;
5422 echo "Checking if your compiler accepts $flag" 2>&1;
5423 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5424 echo "int main(void) { return 0; }" > gcctest.c;
5425 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5426 echo "Yes, it does." 2>&1;
5427 if $test -s gcctest.out ; then
5428 echo "But your platform does not like it:";
5433 echo "Leaving current flags $ccflags alone." 2>&1
5435 *) dflt="$dflt $flag";
5441 echo "Nope, it does not, but that is ok." 2>&1;
5445 : We will not override a previous value, but we might want to
5446 : augment a hint file
5448 default|recommended)
5449 case "$gccversion" in
5450 1*) dflt="$dflt -fpcc-struct-return" ;;
5452 case "$optimize:$DEBUGGING" in
5453 *-g*:old) dflt="$dflt -DDEBUGGING";;
5455 case "$gccversion" in
5456 2*) if $test -d /etc/conf/kconfig.d &&
5457 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5459 # Interactive Systems (ISC) POSIX mode.
5464 case "$gccversion" in
5467 ?*) set strict-aliasing -fno-strict-aliasing
5471 # For gcc, adding -pipe speeds up compilations for some, but apparently
5472 # some assemblers can't read from stdin. (It also slows down compilations
5473 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5474 case "$gccversion" in
5480 # on x86_64 (at least) we require an extra library (libssp) in the
5481 # link command line. This library is not named, so I infer that it is
5482 # an implementation detail that may change. Hence the safest approach
5483 # is to add the flag to the flags passed to the compiler at link time,
5484 # as that way the compiler can do the right implementation dependant
5487 amigaos) ;; # -fstack-protector builds but doesn't work
5488 *) case "$gccversion" in
5489 ?*) set stack-protector-strong -fstack-protector-strong
5492 *-fstack-protector-strong*) ;; # It got added.
5493 *) # Try the plain/older -fstack-protector.
5494 set stack-protector -fstack-protector
5505 case "$mips_type" in
5506 *BSD*|'') inclwanted="$locincpth $usrinc";;
5507 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5509 for thisincl in $inclwanted; do
5510 if $test -d $thisincl; then
5511 if $test x$thisincl != x$usrinc; then
5513 *" -I$thisincl "*);;
5514 *) dflt="$dflt -I$thisincl ";;
5520 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5522 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5530 *) dflt="$dflt -D$2";;
5534 set signal.h LANGUAGE_C; eval $inctest
5538 ccflags="$ccflags -DSOCKS"
5543 default|recommended) dflt="$ccflags $dflt" ;;
5544 *) dflt="$ccflags";;
5553 Your C compiler may want other flags. For this question you should include
5554 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5555 but you should NOT include libraries or ld flags like -lwhatever. If you
5556 want $package to honor its debug switch, you should include -DDEBUGGING here.
5557 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5559 To use no flags, specify the word "none".
5565 rp="Any additional cc flags?"
5572 : the following weeds options from ccflags that are of no interest to cpp
5574 '') cppflags="$ccflags" ;;
5575 *) set X $ccflags; shift
5576 case " $cppflags " in
5577 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5578 *) cppflags="$cppflags $ccflags" ;;
5582 case "$gccversion" in
5583 1*) cppflags="$cppflags -D__GNUC__"
5585 case "$mips_type" in
5587 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5593 echo "Let me guess what the preprocessor flags are..." >&4
5607 *) ftry="$previous $flag";;
5609 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5610 >cpp1.out 2>/dev/null && \
5611 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5612 >cpp2.out 2>/dev/null && \
5613 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5614 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5616 cppflags="$cppflags $ftry"
5626 *-*) echo "They appear to be: $cppflags";;
5628 $rm -f cpp.c cpp?.out
5632 : flags used in final linking phase
5634 '') if ./venix; then
5640 *-posix*) dflt="$dflt -posix" ;;
5643 *) dflt="$ldflags";;
5645 # See note above about -fstack-protector
5647 *-fstack-protector-strong*)
5649 *-fstack-protector-strong*) ;; # Don't add it again
5650 *) dflt="$dflt -fstack-protector-strong" ;;
5653 *-fstack-protector*)
5655 *-fstack-protector*) ;; # Don't add it again
5656 *) dflt="$dflt -fstack-protector" ;;
5661 : Try to guess additional flags to pick up local libraries.
5662 for thislibdir in $libpth; do
5663 case " $loclibpth " in
5666 *"-L$thislibdir "*) ;;
5667 *) dflt="$dflt -L$thislibdir" ;;
5679 Your C linker may need flags. For this question you should
5680 include -L/whatever and any other flags used by the C linker, but you
5681 should NOT include libraries like -lwhatever.
5683 Make sure you include the appropriate -L/path flags if your C linker
5684 does not normally search all of the directories you specified above,
5687 To use no flags, specify the word "none".
5691 rp="Any additional ld flags (NOT including libraries)?"
5697 rmlist="$rmlist pdp11"
5701 echo "Checking your choice of C compiler and flags for coherency..." >&4
5702 $cat > try.c <<'EOF'
5704 int main() { printf("Ok\n"); return(0); }
5706 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5708 $cat >try.msg <<'EOM'
5709 I've tried to compile and run the following simple program:
5712 $cat try.c >> try.msg
5714 $cat >> try.msg <<EOM
5721 and I got the following output:
5725 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5726 if $sh -c "$run ./try " >>try.msg 2>&1; then
5730 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5733 echo "The program compiled OK, but exited with status $?." >>try.msg
5734 rp="You have a problem. Shall I abort Configure"
5738 echo "I can't compile the test program." >>try.msg
5739 rp="You have a BIG problem. Shall I abort Configure"
5745 case "$knowitall" in
5747 echo "(The supplied flags or libraries might be incorrect.)"
5755 *) echo "Ok. Stopping Configure." >&4
5760 n) echo "OK, that should do.";;
5762 $rm_try gcctest gcctest.out
5764 : define a shorthand compile call
5768 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5769 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5773 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5774 : define a shorthand compile call for compilations that should be ok.
5778 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5780 : stub, used only to satisfy other units
5783 : check for lengths of integral types
5787 echo "Checking to see how big your integers are..." >&4
5796 printf("intsize=%d;\n", (int)sizeof(int));
5797 printf("longsize=%d;\n", (int)sizeof(long));
5798 printf("shortsize=%d;\n", (int)sizeof(short));
5803 if eval $compile_ok && $run ./try > /dev/null; then
5805 echo "Your integers are $intsize bytes long."
5806 echo "Your long integers are $longsize bytes long."
5807 echo "Your short integers are $shortsize bytes long."
5811 Help! I can't compile and run the intsize test program: please enlighten me!
5812 (This is probably a misconfiguration in your system or libraries, and
5813 you really ought to fix it. Still, I'll try anyway.)
5817 rp="What is the size of an integer (in bytes)?"
5821 rp="What is the size of a long integer (in bytes)?"
5825 rp="What is the size of a short integer (in bytes)?"
5833 : check for long long
5835 echo "Checking to see if you have long long..." >&4
5836 echo 'int main() { long long x = 7; return 0; }' > try.c
5838 if eval $compile; then
5840 echo "You have long long."
5843 echo "You do not have long long."
5849 : check for length of long long
5850 case "${d_longlong}${longlongsize}" in
5853 echo "Checking to see how big your long longs are..." >&4
5854 $cat >try.c <<'EOCP'
5858 printf("%d\n", (int)sizeof(long long));
5863 if eval $compile_ok; then
5864 longlongsize=`$run ./try`
5865 echo "Your long longs are $longlongsize bytes long."
5869 echo "(I can't seem to compile the test program. Guessing...)"
5870 rp="What is the size of a long long (in bytes)?"
5874 if $test "X$longsize" = "X$longlongsize"; then
5875 echo "(That isn't any different from an ordinary long.)"
5881 : determine filename position in cpp output
5883 echo "Computing filename position in cpp output for #include directives..." >&4
5885 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5890 vos) testaccess=-e ;;
5893 echo '#include <stdio.h>' > foo.c
5896 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5897 $grep '^[ ]*#.*stdio\.h' | \
5898 while read cline; do
5901 while $test \$# -gt 0; do
5902 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5907 pos=\`expr \$pos + 1\`
5921 *) pos="${fieldn}th";;
5923 echo "Your cpp writes the filename in the $pos field of the line."
5925 : locate header file
5930 for usrincdir in $incpth
5932 if test -f \$usrincdir/\$wanted; then
5933 echo "\$usrincdir/\$wanted"
5937 awkprg='{ print \$$fieldn }'
5938 echo "#include <\$wanted>" > foo\$\$.c
5939 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5940 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5941 while read cline; do
5942 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5944 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5945 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5950 # status = 0: grep returned 0 lines, case statement not executed
5951 # status = 1: headerfile found
5952 # status = 2: while loop executed, no headerfile found
5956 if test \$status -eq 1; then
5963 : define an alternate in-header-list? function
5964 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5965 cont=true; xxf="echo \"<\$1> found.\" >&4";
5966 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5967 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5969 case $# in 4) instead=instead;; *) instead="at last";; esac;
5970 while $test "$cont"; do
5972 var=$2; eval "was=\$$2";
5973 if $test "$xxx" && $test -r "$xxx";
5975 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5978 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5979 set $yyy; shift; shift; yyy=$@;
5980 case $# in 0) cont="";;
5981 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5982 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5983 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5984 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5988 do set $yyy; var=$2; eval "was=\$$2";
5989 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5990 set $yyy; shift; shift; yyy=$@;
5993 : see if inttypes.h is available
5994 : we want a real compile instead of Inhdr because some systems
5995 : have an inttypes.h which includes non-existent headers
5998 #include <inttypes.h>
6000 static int32_t foo32 = 0x12345678;
6004 if eval $compile; then
6005 echo "<inttypes.h> found." >&4
6008 echo "<inttypes.h> NOT found." >&4
6017 echo "Checking to see if you have int64_t..." >&4
6019 #include <sys/types.h>
6020 #$i_inttypes I_INTTYPES
6022 #include <inttypes.h>
6024 int main() { int64_t x = 7; }
6027 if eval $compile; then
6029 echo "You have int64_t."
6032 echo "You do not have int64_t."
6038 : Check if 64bit ints have a quad type
6040 echo "Checking which 64-bit integer type we could use..." >&4
6046 val='"unsigned int"'
6051 *) case "$longsize" in
6055 val='"unsigned long"'
6060 *) case "$d_longlong:$longlongsize" in
6065 val='"unsigned long long"'
6070 *) case "$d_int64_t" in
6089 '') echo "Alas, no 64-bit integer types in sight." >&4
6092 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6097 : Do we want 64bit support
6098 case "$uselonglong" in
6099 "$define"|true|[yY]*)
6102 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6104 use64bitint="$define"
6107 case "$use64bits" in
6108 "$define"|true|[yY]*)
6111 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6113 use64bitint="$define"
6116 case "$use64bitints" in
6117 "$define"|true|[yY]*)
6120 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6122 use64bitint="$define"
6125 case "$use64bitsint" in
6126 "$define"|true|[yY]*)
6129 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6131 use64bitint="$define"
6134 case "$uselonglongs" in
6135 "$define"|true|[yY]*)
6138 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6140 use64bitint="$define"
6143 case "$use64bitsall" in
6144 "$define"|true|[yY]*)
6147 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6149 use64bitall="$define"
6154 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6156 case "$use64bitall" in
6157 "$define"|true|[yY]*) use64bitint="$define" ;;
6163 You have natively 64-bit long integers.
6167 *) case "$use64bitint" in
6168 "$define"|true|[yY]*) dflt='y';;
6177 Perl can be built to take advantage of 64-bit integer types
6178 on some systems. To do so, Configure can be run with -Duse64bitint.
6179 Choosing this option will most probably introduce binary incompatibilities.
6181 If this doesn't make any sense to you, just accept the default '$dflt'.
6182 (The default has been chosen based on your configuration.)
6184 rp='Try to use 64-bit integers, if available?'
6187 [yY]*) val="$define" ;;
6195 case "$use64bitall" in
6196 "$define"|true|[yY]*) dflt='y' ;;
6197 *) case "$longsize" in
6205 You may also choose to try maximal 64-bitness. It means using as much
6206 64-bitness as possible on the platform. This in turn means even more
6207 binary incompatibilities. On the other hand, your platform may not
6208 have any more 64-bitness available than what you already have chosen.
6210 If this doesn't make any sense to you, just accept the default '$dflt'.
6211 (The default has been chosen based on your configuration.)
6213 rp='Try to use maximal 64-bit support, if available?'
6216 [yY]*) val="$define" ;;
6221 case "$use64bitall" in
6223 case "$use64bitint" in
6227 Since you have chosen a maximally 64-bit build, I'm also turning on
6228 the use of 64-bit integers.
6230 use64bitint="$define" ;;
6235 : Look for a hint-file generated 'call-back-unit'. If the
6236 : user has specified that a 64-bit perl is to be built,
6237 : we may need to set or change some other defaults.
6238 if $test -f use64bitint.cbu; then
6239 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6242 case "$use64bitint" in
6243 "$define"|true|[yY]*)
6244 : This test was common to all the OpenBSD forks, and seems harmless for
6247 echo "Checking if your C library has broken 64-bit functions..." >&4
6250 typedef $uquadtype myULL;
6257 {4294967303.15, 4294967303ULL},
6258 {4294967294.2, 4294967294ULL},
6259 {4294967295.7, 4294967295ULL},
6262 for (p = test; p->u; p++) {
6263 myULL x = (myULL)p->d;
6274 if eval $compile_ok; then
6275 libcquad=`$run ./try`
6276 echo "Your C library's 64-bit functions are $libcquad."
6278 echo "(I can't seem to compile the test program.)"
6279 echo "Assuming that your C library's 64-bit functions are ok."
6288 *** You have a C library with broken 64-bit functions.
6289 *** 64-bit support does not work reliably in this configuration.
6290 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6291 *** Cannot continue, aborting.
6298 4) case "$archname64" in
6299 '') archname64=64int ;;
6306 : Look for a hint-file generated 'call-back-unit'. If the
6307 : user has specified that a maximally 64-bit perl is to be built,
6308 : we may need to set or change some other defaults.
6309 if $test -f use64bitall.cbu; then
6310 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6313 case "$use64bitall" in
6314 "$define"|true|[yY]*)
6316 4) case "$archname64" in
6317 ''|64int) archname64=64all ;;
6324 case "$d_quad:$use64bitint" in
6328 *** You have chosen to use 64-bit integers,
6329 *** but none can be found.
6330 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6331 *** Cannot continue, aborting.
6338 : Check if we are using the GNU C library
6340 echo "Checking for GNU C Library..." >&4
6342 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6343 alone are insufficient to distinguish different versions, such as
6344 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6345 libc version 2.1.0. A. Dougherty, June 3, 2002.
6351 # ifdef __GLIBC_MINOR__
6352 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6353 # include <gnu/libc-version.h>
6354 printf("%s\n", gnu_get_libc_version());
6356 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6359 printf("%d\n", __GLIBC__);
6368 if eval $compile_ok && $run ./try > glibc.ver; then
6370 gnulibc_version=`$cat glibc.ver`
6371 echo "You are using the GNU C Library version $gnulibc_version"
6375 echo "You are not using the GNU C Library"
6381 : see if nm is to be used to determine whether a symbol is defined or not
6385 case "$d_gnulibc" in
6388 echo "nm probably won't work on the GNU C Library." >&4
6394 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6396 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6397 echo "'nm' won't be sufficient on this system." >&4
6403 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6404 if $test $dflt -gt 20; then
6414 true|$define) dflt=y;;
6421 I can use $nm to extract the symbols from your C libraries. This
6422 is a time consuming task which may generate huge output on the disk (up
6423 to 3 megabytes) but that should make the symbols extraction faster. The
6424 alternative is to skip the 'nm' extraction part and to compile a small
6425 test program instead to determine whether each symbol is present. If
6426 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6427 this may be the best solution.
6429 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6432 rp="Shall I use $nm to extract C symbols from the libraries?"
6435 [Nn]*) usenm=false;;
6444 : nm options which may be necessary
6446 '') if $test -f /mach_boot; then
6448 elif $test -d /usr/ccs/lib; then
6449 nm_opt='-p' # Solaris (and SunOS?)
6450 elif $test -f /dgux; then
6452 elif $test -f /lib64/rld; then
6453 nm_opt='-p' # 64-bit Irix
6459 : nm options which may be necessary for shared libraries but illegal
6460 : for archive libraries. Thank you, Linux.
6461 case "$nm_so_opt" in
6462 '') case "$myuname" in
6464 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6465 nm_so_opt='--dynamic'
6472 : Figure out where the libc is located
6475 : get list of predefined functions in a handy place
6480 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6486 *) for thislib in $libs; do
6489 : Handle C library specially below.
6492 thislib=`echo $thislib | $sed -e 's/^-l//'`
6493 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6495 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6497 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6499 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6501 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6503 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6505 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6510 libnames="$libnames $try"
6512 *) libnames="$libnames $thislib" ;;
6521 for xxx in $libpth; do
6522 $test -r $1 || set $xxx/libc.$so
6523 : The messy sed command sorts on library version numbers.
6525 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6526 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6528 s/[0-9][0-9]*/0000&/g
6529 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6532 $sort | $sed -e 's/^.* //'`
6535 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6536 $test -r $1 || set $sysroot/lib/libsys_s$_a
6542 if $test -r "$1"; then
6543 echo "Your (shared) C library seems to be in $1."
6545 elif $test -r /lib/libc && $test -r /lib/clib; then
6546 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6548 libc='/lib/clib /lib/libc'
6549 if $test -r /lib/syslib; then
6550 echo "(Your math library is in /lib/syslib.)"
6551 libc="$libc /lib/syslib"
6553 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6554 echo "Your C library seems to be in $libc, as you said before."
6555 elif $test -r $incpath/usr/lib/libc$_a; then
6556 libc=$incpath/usr/lib/libc$_a;
6557 echo "Your C library seems to be in $libc. That's fine."
6558 elif $test -r /lib/libc$_a; then
6560 echo "Your C library seems to be in $libc. You're normal."
6562 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6564 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6565 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6566 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6568 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6570 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6573 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6575 if $test -r "$tans"; then
6576 echo "Your C library seems to be in $tans, of all places."
6582 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6586 If the guess above is wrong (which it might be if you're using a strange
6587 compiler, or your machine supports multiple models), you can override it here.
6592 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6594 I can't seem to find your C library. I've looked in the following places:
6597 $sed 's/^/ /' libpath
6600 None of these seems to contain your C library. I need to get its name...
6605 rp='Where is your C library?'
6610 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6611 set X `cat libnames`
6614 case $# in 1) xxx=file; esac
6615 echo "Extracting names from the following $xxx for later perusal:" >&4
6617 $sed 's/^/ /' libnames >&4
6619 $echo $n "This may take a while...$c" >&4
6623 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6624 *) $nm $nm_opt $file 2>/dev/null;;
6629 $grep fprintf libc.tmp > libc.ptf
6630 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6631 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6633 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6637 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6641 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6645 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6649 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6653 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6658 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6662 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6666 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6670 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6674 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6678 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6682 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6691 $nm -p $* 2>/dev/null >libc.tmp
6692 $grep fprintf libc.tmp > libc.ptf
6693 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6694 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6700 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6702 if $ar t $libc > libc.tmp && \
6703 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6705 for thisname in $libnames $libc; do
6706 $ar t $thisname >>libc.tmp
6708 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6710 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6711 for thisname in $libnames $libc; do
6712 $ar tv $thisname >>libc.tmp
6713 emximp -o tmp.imp $thisname \
6715 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6716 < tmp.imp >>libc.tmp
6719 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6722 echo "$ar didn't seem to work right." >&4
6723 echo "Maybe this is a Cray...trying bld instead..." >&4
6725 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6728 for thisname in $libnames; do
6730 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6731 $ar t $thisname >>libc.tmp
6735 echo "That didn't work either. Giving up." >&4
6745 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6746 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6748 *) if $test -f /lib/syscalls.exp; then
6750 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6751 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6752 /lib/syscalls.exp >>libc.list
6758 $rm -f libnames libpath
6760 : Check if we are using C++
6762 echo "Checking for C++..." >&4
6763 $cat >try.c <<'EOCP'
6775 if eval $compile_ok && $run ./try; then
6777 echo "You are using a C++ compiler."
6780 echo "You are not using a C++ compiler."
6786 : is a C symbol defined?
6789 -v) tf=libc.tmp; tdc="";;
6790 -a) tf=libc.tmp; tdc="[]";;
6791 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6793 case "$d_cplusplus" in
6794 $define) extern_C="extern \"C\"" ;;
6795 *) extern_C="extern" ;;
6798 case "$reuseval-$4" in
6800 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6805 if $test "$runnm" = true; then
6806 if $contains $tlook $tf >/dev/null 2>&1; then
6808 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6809 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;
6810 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6811 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6815 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;
6816 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6822 $define) tval=true;;
6829 : define an is-in-libc? function
6830 inlibc='echo " "; td=$define; tu=$undef;
6831 sym=$1; var=$2; eval "was=\$$2";
6833 case "$reuseval$was" in
6843 echo "$sym() found." >&4;
6844 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6846 echo "$sym() NOT found." >&4;
6847 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6851 $define) echo "$sym() found." >&4;;
6852 *) echo "$sym() NOT found." >&4;;
6856 : check for length of double
6858 case "$doublesize" in
6860 echo "Checking to see how big your double precision numbers are..." >&4
6869 printf("%d\n", (int)sizeof(double));
6874 if eval $compile_ok; then
6875 doublesize=`$run ./try`
6876 echo "Your double is $doublesize bytes long."
6879 echo "(I can't seem to compile the test program. Guessing...)"
6880 rp="What is the size of a double precision number (in bytes)?"
6888 : check for long doubles
6890 echo "Checking to see if you have long double..." >&4
6891 echo 'int main() { long double x = 7.0; }' > try.c
6893 if eval $compile; then
6895 echo "You have long double."
6898 echo "You do not have long double."
6904 : see if ldexpl exists
6908 : check for length of long double
6909 case "${d_longdbl}${longdblsize}" in
6912 echo "Checking to see how big your long doubles are..." >&4
6913 $cat >try.c <<'EOCP'
6917 printf("%d\n", sizeof(long double));
6922 if eval $compile; then
6923 longdblsize=`$run ./try`
6924 echo "Your long doubles are $longdblsize bytes long."
6928 echo "(I can't seem to compile the test program. Guessing...)" >&4
6929 rp="What is the size of a long double (in bytes)?"
6933 if $test "X$doublesize" = "X$longdblsize"; then
6934 echo "That isn't any different from an ordinary double."
6935 echo "I'll keep your setting anyway, but you may see some"
6936 echo "harmless compilation warnings."
6942 $echo "Checking the kind of long doubles you have..." >&4
6943 case "$d_longdbl" in
6947 #define LONGDBLSIZE $longdblsize
6948 #define DOUBLESIZE $doublesize
6954 static const long double d = -0.1L;
6956 unsigned const char* b = (unsigned const char*)(&d);
6957 #if DOUBLESIZE == LONGDBLSIZE
6958 printf("0\n"); /* if it floats like double */
6961 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6962 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6963 /* IEEE 754 128-bit little-endian */
6967 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6968 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6973 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6974 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6975 * cannot be trusted. */
6976 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6977 if (b[0] == 0xCD && b[9] == 0xBF) {
6978 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6979 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6980 * Also known as "extended precision". */
6984 if (b[0] == 0xBF && b[9] == 0xCD) {
6985 /* Is there ever big-endian 80-bit, really?
6987 * The Motorola 68881 had another "extended precision" format:
6988 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6989 * for total of 96 bits of bytes. The zero bits were unused.
6990 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6991 * If it ever becomes relevant, this format should be allocated
6992 * a new doublekind code since it's quite different from the Intel x87.
6998 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6999 /* software "double double", the 106 is 53+53.
7000 * but irix thinks it is 107. */
7001 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7002 /* double double 128-bit fully little-endian,
7003 * little-endian doubles in little-endian order,
7004 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7008 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7009 /* double double 128-bit fully big-endian,
7010 * big-endian doubles in big-endian order,
7011 * e.g. PPC/Power and MIPS:
7012 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7016 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7017 /* double double 128-bit mixed endian.
7018 * little-endian doubles in big-endian order,
7020 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7024 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7025 /* double double 128-bit mixed endian,
7026 * big-endian doubles in little-endian order,
7027 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7032 /* We are largely making this up because it may well be
7033 * that the VAX format H was never made available to C,
7034 * only to Fortran. */
7035 #if LONGDBLSIZE == 16 && defined(__vax__)
7036 if (b[0] == 0xFD && b[15] == 0x99) {
7037 /* VAX format H, PDP-11 mixed endian. */
7042 printf("-1\n"); /* unknown */
7047 if eval $compile; then
7048 longdblkind=`$run ./try`
7055 case "$longdblkind" in
7056 0) echo "Your long doubles are doubles." >&4 ;;
7057 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7058 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7059 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7060 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7061 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7062 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7063 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7064 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7065 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7066 *) echo "Cannot figure out your long double." >&4 ;;
7068 d_long_double_style_ieee=$undef
7069 d_long_double_style_ieee_std=$undef
7070 d_long_double_style_ieee_extended=$undef
7071 d_long_double_style_ieee_doubledouble=$undef
7072 d_long_double_style_vax=$undef
7073 case "$longdblkind" in
7074 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7076 case "$longdblkind" in
7077 1|2) d_long_double_style_ieee_std=$define ;;
7079 case "$longdblkind" in
7080 3|4) d_long_double_style_ieee_extended=$define ;;
7082 case "$longdblkind" in
7083 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7085 case "$longdblkind" in
7086 9) d_long_double_style_vax=$define ;;
7090 : determine the architecture name
7092 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7093 tarch=`arch`"-$osname"
7094 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7095 if uname -m > tmparch 2>&1 ; then
7096 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7097 -e 's/$/'"-$osname/" tmparch`
7105 case "$myarchname" in
7108 echo "(Your architecture name used to be $myarchname.)"
7112 case "$targetarch" in
7114 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7119 *) dflt="$archname";;
7121 rp='What is your architecture name'
7125 : optionally add API version to the architecture for versioned archlibs
7126 case "$useversionedarchname" in
7127 $define|true|[yY]*) dflt='y';;
7130 rp='Add the Perl API version to your archname?'
7133 y|Y) useversionedarchname="$define" ;;
7134 *) useversionedarchname="$undef" ;;
7136 case "$useversionedarchname" in
7139 *-$api_versionstring)
7140 echo "...and architecture name already has -$api_versionstring" >&4
7143 archname="$archname-$api_versionstring"
7144 echo "...setting architecture name to $archname." >&4
7150 case "$usethreads" in
7152 echo "Threads selected." >&4
7154 *-thread*) echo "...and architecture name already has -thread." >&4
7156 *) archname="$archname-thread"
7157 echo "...setting architecture name to $archname." >&4
7162 case "$usemultiplicity" in
7164 echo "Multiplicity selected." >&4
7166 *-multi*) echo "...and architecture name already has -multi." >&4
7168 *) archname="$archname-multi"
7169 echo "...setting architecture name to $archname." >&4
7174 case "$use64bitint$use64bitall" in
7176 case "$archname64" in
7178 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7181 case "$use64bitint" in
7182 "$define") echo "64 bit integers selected." >&4 ;;
7184 case "$use64bitall" in
7185 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7188 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7190 *) archname="$archname-$archname64"
7191 echo "...setting architecture name to $archname." >&4
7197 case "$uselongdouble" in
7199 echo "Long doubles selected." >&4
7200 case "$longdblsize" in
7202 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7206 *-ld*) echo "...and architecture name already has -ld." >&4
7208 *) archname="$archname-ld"
7209 echo "...setting architecture name to $archname." >&4
7216 case "$usequadmath" in
7218 echo "quadmath selected." >&4
7220 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7222 *) archname="$archname-quadmath"
7223 echo "...setting architecture name to $archname." >&4
7228 if $test -f archname.cbu; then
7229 echo "Your platform has some specific hints for architecture name, using them..."
7233 : set the prefixit variable, to compute a suitable default value
7234 prefixit='case "$3" in
7236 case "$oldprefix" in
7237 "") eval "$1=\"\$$2\"";;
7244 ""|" ") eval "$1=\"\$$2\"";;
7250 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7252 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7253 /*-$oldprefix/*|\~*-$oldprefix/*)
7254 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7255 *) eval "$1=\"\$$2\"";;
7259 : determine installation style
7260 : For now, try to deduce it from prefix unless it is already set.
7261 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7262 case "$installstyle" in
7263 '') case "$prefix" in
7264 *perl*) dflt='lib';;
7265 *) dflt='lib/perl5' ;;
7268 *) dflt="$installstyle" ;;
7270 : Probably not worth prompting for this since we prompt for all
7271 : the directories individually, and the prompt would be too long and
7275 : determine where public executables go
7280 rp='Pathname where the public executables will reside?'
7282 if $test "X$ansexp" != "X$binexp"; then
7286 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7287 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7288 : this via initialinstalllocation
7291 case "$userelocatableinc" in
7292 $define|true|[yY]*) dflt='y' ;;
7297 Would you like to build Perl so that the installation is relocatable, so that
7298 library paths in @INC are determined relative to the path of the perl binary?
7299 This is not advised for system Perl installs, or if you need to run setid
7300 scripts or scripts under taint mode.
7302 If this doesn't make any sense to you, just accept the default '$dflt'.
7304 rp='Use relocatable @INC?'
7307 y|Y) val="$define" ;;
7310 set userelocatableinc
7313 initialinstalllocation="$binexp"
7314 : Default prefix is now "up one level from where the binaries are"
7315 case "$userelocatableinc" in
7321 installprefixexp=".../.."
7325 : determine where private library files go
7326 : Usual default is /usr/local/lib/perl5/$version.
7327 : Also allow things like /opt/perl/lib/$version, since
7328 : /opt/perl/lib/perl5... would be redundant.
7329 : The default "style" setting is made in installstyle.U
7330 case "$installstyle" in
7331 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7332 *) set dflt privlib lib/$version ;;
7337 There are some auxiliary files for $package that need to be put into a
7338 private library directory that is accessible by everyone.
7343 rp='Pathname where the private library files will reside?'
7348 : set the prefixup variable, to restore leading tilda escape
7349 prefixup='case "$prefixexp" in
7351 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7354 : determine where public architecture dependent libraries go
7357 : privlib default is /usr/local/lib/$package/$version
7358 : archlib default is /usr/local/lib/$package/$version/$archname
7359 : privlib may have an optional trailing /share.
7360 tdflt=`echo $privlib | $sed 's,/share$,,'`
7361 tdflt=$tdflt/$archname
7370 $spackage contains architecture-dependent library files. If you are
7371 sharing libraries in a heterogeneous environment, you might store
7372 these files in a separate location. Otherwise, you can just include
7373 them with the rest of the public library files.
7378 rp='Where do you want to put the public architecture-dependent libraries?'
7382 if $test X"$archlib" = X"$privlib"; then
7388 : see if setuid scripts can be secure
7391 Some kernels have a bug that prevents setuid #! scripts from being
7392 secure. Some sites have disabled setuid #! scripts because of this.
7394 First let's decide if your kernel supports secure setuid #! scripts.
7395 (If setuid #! scripts would be secure but have been disabled anyway,
7396 don't say that they are secure if asked.)
7401 if $test -d /dev/fd; then
7402 echo "#!$ls" >reflect
7403 chmod +x,u+s reflect
7404 ./reflect >flect 2>&1
7405 if $contains "/dev/fd" flect >/dev/null; then
7406 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7410 If you are not sure if they are secure, I can check but I'll need a
7411 username and password different from the one you are using right now.
7412 If you don't have such a username or don't want me to test, simply
7416 rp='Other username to test security of setuid scripts with?'
7421 case "$d_suidsafe" in
7422 '') echo "I'll assume setuid scripts are *not* secure." >&4
7425 echo "Well, the $hint value is *not* secure." >&4
7427 *) echo "Well, the $hint value *is* secure." >&4
7432 $rm -f reflect flect
7433 echo "#!$ls" >reflect
7434 chmod +x,u+s reflect
7437 echo '"su" will (probably) prompt you for '"$ans's password."
7438 su $ans -c './reflect >flect'
7439 if $contains "/dev/fd" flect >/dev/null; then
7440 echo "Okay, it looks like setuid scripts are secure." >&4
7443 echo "I don't think setuid scripts are secure." >&4
7448 rp='Does your kernel have *secure* setuid scripts?'
7451 [yY]*) val="$define";;
7456 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7457 echo "(That's for file descriptors, not floppy disks.)"
7463 $rm -f reflect flect
7465 : now see if they want to do setuid emulation
7466 if $test $patchlevel -lt 11; then
7469 case "$d_suidsafe" in
7472 echo "No need to emulate SUID scripts since they are secure here." >&4
7476 Some systems have disabled setuid scripts, especially systems where
7477 setuid scripts cannot be secure. On systems where setuid scripts have
7478 been disabled, the setuid/setgid bits on scripts are currently
7479 useless. It is possible for $package to detect those bits and emulate
7480 setuid/setgid in a secure fashion. This emulation will only work if
7481 setuid scripts have been disabled in your kernel.
7485 "$define") dflt=y ;;
7488 rp="Do you want to do setuid/setgid emulation?"
7491 [yY]*) val="$define";;
7503 SUID emulation has been removed for 5.12
7504 Please re-run Configure without -Dd_dosuid
7513 : Find perl5.005 or later.
7514 echo "Looking for a previously installed perl5.005 or later... "
7516 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7517 : Check if this perl is recent and can load a simple module
7518 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7521 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7531 '') echo "None found. That's ok.";;
7532 *) echo "Using $perl5." ;;
7535 : Set the siteprefix variables
7538 After $package is installed, you may wish to install various
7539 add-on modules and utilities. Typically, these add-ons will
7540 be installed under $prefix with the rest
7541 of this package. However, you may wish to install such add-ons
7542 elsewhere under a different prefix.
7544 If you do not wish to put everything under a single prefix, that's
7545 ok. You will be prompted for the individual locations; this siteprefix
7546 is only used to suggest the defaults.
7548 The default should be fine for most people.
7552 rp='Installation prefix to use for add-on modules and utilities?'
7553 : XXX Here might be another good place for an installstyle setting.
7554 case "$siteprefix" in
7556 *) dflt=$siteprefix ;;
7559 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7561 case "$siteprefix" in
7565 *) oldsiteprefix="$prefix";;
7570 siteprefixexp="$ansexp"
7572 : determine where site specific libraries go.
7573 : Usual default is /usr/local/lib/perl5/site_perl/$version
7574 : The default "style" setting is made in installstyle.U
7575 : XXX No longer works with Prefixit stuff.
7576 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7578 '') case "$installstyle" in
7579 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7580 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7588 The installation process will create a directory for
7589 site-specific extensions and modules. Most users find it convenient
7590 to place all site-specific files in this directory rather than in the
7591 main distribution directory.
7595 rp='Pathname for the site-specific library files?'
7599 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7601 : Determine list of previous versions to include in @INC
7602 $cat > getverlist <<EOPL
7605 \$api_versionstring = "$api_versionstring";
7606 \$version = "$version";
7607 \$stem = "$sitelib_stem";
7608 \$archname = "$archname";
7610 $cat >> getverlist <<'EOPL'
7611 # The list found is store twice for each entry: the original name, and
7612 # the binary broken down version as pack "sss", so sorting is easy and
7613 # unambiguous. This will work for all versions that have a maximum of
7614 # three digit groups, separate by '.'s or '_'s. Names are extended with
7615 # ".0.0" to ensure at least three elements for the pack.
7616 # -- H.Merijn Brand (m)'06 23-10-2006
7618 # Can't have leading @ because metaconfig interprets it as a command!
7619 ;@inc_version_list=();
7620 # XXX Redo to do opendir/readdir?
7623 ;@candidates = map {
7624 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7625 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7631 ($pversion, $aversion, $vsn5005) = map {
7632 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7633 foreach $d (@candidates) {
7634 if ($d->[1] lt $pversion) {
7635 if ($d->[1] ge $aversion) {
7636 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7638 elsif ($d->[1] ge $vsn5005) {
7639 unshift(@inc_version_list, grep { -d } $d->[0]);
7643 # Skip newer version. I.e. don't look in
7644 # 5.7.0 if we're installing 5.6.1.
7648 if (@inc_version_list) {
7649 print join(' ', @inc_version_list);
7652 # Blank space to preserve value for next Configure run.
7657 case "$inc_version_list" in
7658 '') if test -x "$perl5$exe_ext"; then
7659 dflt=`$perl5 getverlist`
7664 $undef) dflt='none' ;;
7665 *) eval dflt=\"$inc_version_list\" ;;
7668 ''|' ') dflt=none ;;
7675 In order to ease the process of upgrading, this version of perl
7676 can be configured to use modules built and installed with earlier
7677 versions of perl that were installed under $prefix. Specify here
7678 the list of earlier versions that this version of perl should check.
7679 If Configure detected no earlier versions of perl installed under
7680 $prefix, then the list will be empty. Answer 'none' to tell perl
7681 to not search earlier versions.
7683 The default should almost always be sensible, so if you're not sure,
7684 just accept the default.
7687 rp='List of earlier versions to include in @INC?'
7690 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7691 *) inc_version_list="$ans" ;;
7693 case "$inc_version_list" in
7695 inc_version_list_init='0'
7696 d_inc_version_list="$undef"
7698 *) inc_version_list_init=`echo $inc_version_list |
7699 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7700 d_inc_version_list="$define"
7705 : see if malloc/malloc.h has to be included
7706 set malloc/malloc.h i_mallocmalloc
7709 : see if this is a malloc.h system
7710 : we want a real compile instead of Inhdr because some systems have a
7711 : malloc.h that just gives a compile error saying to use stdlib.h instead
7716 #$i_mallocmalloc I_MALLOCMALLOC
7717 #ifdef I_MALLOCMALLOC
7718 # include <malloc/malloc.h>
7721 int main () { return 0; }
7724 if eval $compile; then
7725 echo "<malloc.h> found." >&4
7728 echo "<malloc.h> NOT found." >&4
7735 : check for length of pointer
7739 echo "Checking to see how big your pointers are..." >&4
7748 printf("%d\n", (int)sizeof(void *));
7753 if eval $compile_ok; then
7754 ptrsize=`$run ./try`
7755 echo "Your pointers are $ptrsize bytes long."
7758 echo "(I can't seem to compile the test program. Guessing...)" >&4
7759 rp="What is the size of a pointer (in bytes)?"
7766 case "$use64bitall" in
7767 "$define"|true|[yY]*)
7771 *** You have chosen a maximally 64-bit build,
7772 *** but your pointers are only 4 bytes wide.
7773 *** Please rerun Configure without -Duse64bitall.
7778 *** Since you have quads, you could possibly try with -Duse64bitint.
7783 *** Cannot continue, aborting.
7794 : determine whether to use malloc wrapping
7796 case "$usemallocwrap" in
7797 [yY]*|true|$define) dflt='y' ;;
7798 [nN]*|false|$undef) dflt='n' ;;
7799 *) case "$usedevel" in
7800 [yY]*|true|$define) dflt='y' ;;
7805 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7807 usemallocwrap="$ans"
7810 usemallocwrap="$define" ;;
7812 usemallocwrap="$undef" ;;
7815 : determine which malloc to compile in
7817 case "$usemymalloc" in
7818 [yY]*|true|$define) dflt='y' ;;
7819 [nN]*|false|$undef) dflt='n' ;;
7820 *) case "$ptrsize" in
7824 if test "$useithreads" = "$define"; then dflt='n'; fi
7827 rp="Do you wish to attempt to use the malloc that comes with $package?"
7833 mallocsrc='malloc.c'
7834 mallocobj="malloc$_o"
7835 d_mymalloc="$define"
7838 : Remove malloc from list of libraries to use
7839 echo "Removing unneeded -lmalloc from library list" >&4
7840 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7843 echo "libs = $libs" >&4
7855 : compute the return types of malloc and free
7857 $cat >malloc.c <<END
7861 #include <sys/types.h>
7875 case "$malloctype" in
7877 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7884 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7888 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7895 echo "Your system uses $freetype free(), it would seem." >&4
7897 : determine where site specific architecture-dependent libraries go.
7898 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7899 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7900 : sitelib may have an optional trailing /share.
7902 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7903 dflt="$dflt/$archname"
7908 set sitearch sitearch none
7912 The installation process will also create a directory for
7913 architecture-dependent site-specific extensions and modules.
7917 rp='Pathname for the site-specific architecture-dependent library files?'
7921 if $test X"$sitearch" = X"$sitelib"; then
7924 d_sitearch="$define"
7927 : Set the vendorprefix variables
7930 The installation process will also create a directory for
7931 vendor-supplied add-ons. Vendors who supply perl with their system
7932 may find it convenient to place all vendor-supplied files in this
7933 directory rather than in the main distribution directory. This will
7934 ease upgrades between binary-compatible maintenance versions of perl.
7936 Of course you may also use these directories in whatever way you see
7937 fit. For example, you might use them to access modules shared over a
7938 company-wide network.
7940 The default answer should be fine for most people.
7941 This causes further questions about vendor add-ons to be skipped
7942 and no vendor-specific directories will be configured for perl.
7945 rp='Do you want to configure vendor-specific add-on directories?'
7946 case "$usevendorprefix" in
7947 define|true|[yY]*) dflt=y ;;
7948 *) : User may have set vendorprefix directly on Configure command line.
7949 case "$vendorprefix" in
7958 rp='Installation prefix to use for vendor-supplied add-ons?'
7959 case "$vendorprefix" in
7960 '') dflt="$prefix" ;;
7961 *) dflt=$vendorprefix ;;
7964 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7966 case "$vendorprefix" in
7970 *) oldvendorprefix="$prefix";;
7974 usevendorprefix="$define"
7976 vendorprefixexp="$ansexp"
7978 *) usevendorprefix="$undef"
7984 : Set the vendorlib variables
7985 case "$vendorprefix" in
7986 '') d_vendorlib="$undef"
7990 *) d_vendorlib="$define"
7991 : determine where vendor-supplied modules go.
7992 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7993 case "$vendorlib" in
7995 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7996 case "$installstyle" in
7997 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7998 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8001 *) dflt="$vendorlib"
8005 rp='Pathname for the vendor-supplied library files?'
8008 vendorlibexp="$ansexp"
8011 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8015 : Set the vendorarch variables
8016 case "$vendorprefix" in
8017 '') d_vendorarch="$undef"
8021 *) d_vendorarch="$define"
8022 : determine where vendor-supplied architecture-dependent libraries go.
8023 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8024 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8025 : vendorlib may have an optional trailing /share.
8026 case "$vendorarch" in
8027 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8028 dflt="$dflt/$archname"
8030 *) dflt="$vendorarch" ;;
8033 rp='Pathname for vendor-supplied architecture-dependent files?'
8036 vendorarchexp="$ansexp"
8039 prefixvar=vendorarch
8041 if $test X"$vendorarch" = X"$vendorlib"; then
8042 d_vendorarch="$undef"
8044 d_vendorarch="$define"
8047 : Final catch-all directories to search
8050 Lastly, you can have perl look in other directories for extensions and
8051 modules in addition to those already specified.
8052 These directories will be searched after
8056 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8057 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8059 case "$otherlibdirs" in
8060 ''|' ') dflt='none' ;;
8061 *) dflt="$otherlibdirs" ;;
8064 Enter a colon-separated set of extra paths to include in perl's @INC
8065 search path, or enter 'none' for no extra paths.
8069 rp='Colon-separated list of additional directories for perl to search?'
8072 ' '|''|none) otherlibdirs=' ' ;;
8073 *) otherlibdirs="$ans" ;;
8075 case "$otherlibdirs" in
8079 set d_perl_otherlibdirs
8083 dflt_dtrace='/usr/sbin/dtrace'
8084 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8088 Perl can be built to support DTrace on platforms that support it.
8089 DTrace is a diagnosis and performance analysis tool from Sun.
8091 If this doesn't make any sense to you, just accept the default.
8095 case "$usedtrace" in
8101 dflt_dtrace=$usedtrace
8108 rp='Support DTrace if available?'
8111 y|Y) val="$define" ;;
8117 test "X$usedtrace" != "X$define" && break
8120 rp='Where is the dtrace executable?'
8129 if $dtrace -h -s ../perldtrace.d \
8130 -o perldtrace.tmp >/dev/null 2>&1 \
8131 && rm -f perldtrace.tmp
8134 echo "Good: your $dtrace knows about the -h flag."
8138 *** $me: Fatal Error: $dtrace doesn't support -h flag
8140 *** Your installed dtrace doesn't support the -h switch to compile a D
8141 *** program into a C header. Can't continue.
8153 *** $me: Fatal Error: $dtrace not found.
8160 echo "*** $dtrace was not found."
8166 : See if we want extra modules installed
8173 Perl can be built with extra modules or bundles of modules which
8174 will be fetched from the CPAN and installed alongside Perl.
8176 Notice that you will need access to the CPAN; either via the Internet,
8177 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8178 be asked later to configure the CPAN.pm module which will in turn do
8179 the installation of the rest of the extra modules or bundles.)
8181 Notice also that if the modules require any external software such as
8182 libraries and headers (the libz library and the zlib.h header for the
8183 Compress::Zlib module, for example) you MUST have any such software
8184 already installed, this configuration process will NOT install such
8187 If this doesn't make any sense to you, just accept the default '$dflt'.
8189 rp='Install any extra modules (y or n)?'
8195 Please list any extra modules or bundles to be installed from CPAN,
8196 with spaces between the names. The names can be in any format the
8197 'install' command of CPAN.pm will understand. (Answer 'none',
8198 without the quotes, to install no extra modules or bundles.)
8208 $rm -f ../extras.lst
8210 *) echo "(Saving the list of extras for later...)"
8211 echo "$extras" > ../extras.lst
8219 : determine where html pages for programs go
8220 set html1dir html1dir none
8224 If you wish to install html files for programs in $spackage, indicate
8225 the appropriate directory here. To skip installing html files,
8229 ''|none|$undef|' ') dflt=none ;;
8230 *) dflt=$html1dir ;;
8233 rp="Directory for the main $spackage html pages?"
8237 : Use ' ' for none so value is preserved next time through Configure
8238 $test X"$html1dir" = "X" && html1dir=' '
8240 : determine where html pages for libraries and modules go
8241 set html3dir html3dir none
8245 If you wish to install html files for modules associated with $spackage,
8246 indicate the appropriate directory here. To skip installing html files,
8249 : There is no obvious default. If they have specified html1dir, then
8250 : try to key off that, possibly changing .../html1 into .../html3.
8252 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8253 *) dflt=$html3dir ;;
8256 rp="Directory for the $spackage module html pages?"
8260 : Use ' ' for none so value is preserved next time through Configure
8261 $test X"$html3dir" = "X" && html3dir=' '
8263 : determine whether to install perl also as /usr/bin/perl
8266 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8268 Many scripts expect perl to be installed as /usr/bin/perl.
8270 If you want to, I can install the perl you are about to compile
8271 as /usr/bin/perl (in addition to $bin/perl).
8273 if test -f /usr/bin/perl; then
8276 However, please note that because you already have a /usr/bin/perl,
8277 overwriting that with a new Perl would very probably cause problems.
8278 Therefore I'm assuming you don't want to do that (unless you insist).
8281 case "$installusrbinperl" in
8282 "$define"|[yY]*) dflt='y';;
8288 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8291 case "$installusrbinperl" in
8292 "$undef"|[nN]*) dflt='n';;
8296 rp="Do you want to install perl as /usr/bin/perl?"
8299 [yY]*) val="$define";;
8305 set installusrbinperl
8308 : see if dlopen exists
8310 xxx_ccflags="$ccflags"
8312 : with g++ one needs -shared to get is-in-libc to work for dlopen
8313 case "$gccversion" in
8316 *) case "$d_cplusplus" in
8317 "$define") ccflags="$ccflags -shared" ;;
8324 ccflags="$xxx_ccflags"
8326 : see if this is a unistd.h system
8327 set unistd.h i_unistd
8330 : determine which dynamic loading, if any, to compile in
8332 dldir="ext/DynaLoader"
8345 $define) dflt='y' ;;
8347 : Does a dl_xxx.xs file exist for this operating system
8348 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8351 rp="Do you wish to use dynamic loading?"
8358 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8359 dflt="$dldir/dl_${osname}.xs"
8360 elif $test "$d_dlopen" = "$define" ; then
8361 dflt="$dldir/dl_dlopen.xs"
8366 *) dflt="$dldir/$dlsrc"
8369 echo "The following dynamic loading files are available:"
8370 : Can not go over to $dldir because getfile has path hard-coded in.
8371 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8372 rp="Source file to use for dynamic loading"
8378 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8382 Some systems may require passing special flags to $cc -c to
8383 compile modules that will be used to create a shared library.
8384 To use no flags, say "none".
8387 case "$cccdlflags" in
8388 '') case "$gccversion" in
8389 '') case "$osname" in
8391 irix*) dflt='-KPIC' ;;
8392 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8393 sunos) dflt='-pic' ;;
8397 *) case "$osname" in
8398 darwin) dflt='none' ;;
8399 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8404 *) dflt="$cccdlflags" ;;
8411 # If -Dsysroot was specified, now's the time to add it
8413 if test "X$sysroot" != X; then
8414 case "$gccversion" in
8419 dflt="$dflt --sysroot=$sysroot" ;;
8429 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8432 none) cccdlflags=' ' ;;
8433 *) cccdlflags="$ans" ;;
8438 Some systems use ld to create libraries that can be dynamically loaded,
8439 while other systems (such as those using ELF) use $cc.
8443 : Determine if this is ELF
8445 /* Test for whether ELF binaries are produced */
8457 int i = open("a.out",O_RDONLY);
8460 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8461 exit(0); /* succeed (yes, it is ELF) */
8465 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8471 '') if $test $bin_ELF = "$define"; then
8473 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8477 echo "I'll use ld to build dynamic libraries."
8485 rp="What command should be used to create dynamic libraries?"
8491 Some systems may require passing special flags to $ld to create a
8492 library that can be dynamically loaded. If your ld flags include
8493 -L/other/path options to locate libraries outside your loader's normal
8494 search path, you may need to specify those -L options here as well. To
8495 use no flags, say "none".
8498 case "$lddlflags" in
8499 '') case "$osname" in
8500 haiku) dflt='-shared' ;;
8502 case "$gccversion" in
8503 '') dflt="$dflt +vnocompatwarnings" ;;
8506 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8507 solaris) # See [perl #66604].
8508 # On Solaris 11, gcc -m64 on amd64
8509 # appears not to understand -G. gcc versions at
8510 # least as old as 3.4.3 support -shared, so just
8511 # use that with Solaris 11 and later, but keep
8512 # the old behavior for older Solaris versions.
8513 case "$gccversion" in
8515 *) case "$osvers" in
8516 2.?|2.10) dflt='-G' ;;
8517 *) dflt='-shared' ;;
8522 sunos) dflt='-assert nodefinitions' ;;
8523 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8527 *) dflt="$lddlflags" ;;
8530 : Only do this for gcc, since, for example, qcc has no concept
8532 if $test "X$sysroot" != X; then
8533 case "$gccversion" in
8535 *) dflt="$dflt --sysroot $sysroot" ;;
8539 : Try to guess additional flags to pick up local libraries.
8540 : Be careful not to append to a plain 'none'
8544 for thisflag in $ldflags; do
8549 *) dflt="$dflt $thisflag" ;;
8556 ''|' ') dflt='none' ;;
8560 *-fstack-protector-strong*)
8562 *-fstack-protector-strong*) ;; # Don't add it again
8563 *) dflt="$dflt -fstack-protector-strong" ;;
8566 *-fstack-protector*)
8568 *-fstack-protector*) ;; # Don't add it again
8569 *) dflt="$dflt -fstack-protector" ;;
8574 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8577 none) lddlflags=' ' ;;
8578 *) lddlflags="$ans" ;;
8583 Some systems may require passing special flags to $cc to indicate that
8584 the resulting executable will use dynamic linking. To use no flags,
8588 case "$ccdlflags" in
8589 '') case "$osname" in
8590 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8591 sunos) dflt='none' ;;
8595 *) dflt="$ccdlflags" ;;
8597 rp="Any special flags to pass to $cc to use dynamic linking?"
8600 none) ccdlflags=' ' ;;
8601 *) ccdlflags="$ans" ;;
8613 ld_can_script="$undef"
8614 case "$bin_ELF$usedl" in
8616 # Abuse try.h and a.out names for neat cleanup
8628 if $cc $cccdlflags $ccdlflags $ccflags \
8629 $ldflags $lddlflags -o a.out try.c \
8630 -Wl,--version-script=try.h >/dev/null 2>&1 \
8631 && $test -s a.out ; then
8632 echo "ld supports scripting" >&4
8633 ld_can_script="$define"
8635 echo "ld does not support scripting" >&4
8641 : Do we want a shared libperl?
8645 # No dynamic loading being used, so don't bother even to prompt.
8648 *) case "$useshrplib" in
8649 '') case "$osname" in
8650 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8652 also='Building a shared libperl is required for dynamic loading to work on your system.'
8666 The perl executable is normally obtained by linking perlmain.c with
8667 libperl${_a}, any static extensions (usually just DynaLoader), and
8668 any other libraries needed on this system (such as -lm, etc.). Since
8669 your system supports dynamic loading, it is probably possible to build
8670 a shared libperl.$so. If you will have more than one executable linked
8671 to libperl.$so, this will significantly reduce the size of each
8672 executable, but it may have a noticeable effect on performance. The
8673 default is probably sensible for your system.
8677 rp="Build a shared libperl.$so (y/n)"
8681 useshrplib='true' ;;
8682 *) useshrplib='false' ;;
8687 case "$useshrplib" in
8689 case "$userelocatableinc" in
8691 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8692 echo "See INSTALL for an explanation why that won't work." >&4
8698 # Figure out a good name for libperl.so. Since it gets stored in
8699 # a version-specific architecture-dependent library, the version
8700 # number isn't really that important, except for making cc/ld happy.
8702 # A name such as libperl.so.10.1
8703 majmin="libperl.$so.$patchlevel.$subversion"
8704 # A name such as libperl.so.100
8705 majonly=`echo $patchlevel $subversion |
8706 $awk '{printf "%d%02d", $1, $2}'`
8707 majonly=libperl.$so.$majonly
8708 # I'd prefer to keep the os-specific stuff here to a minimum, and
8709 # rely on figuring it out from the naming of libc.
8710 case "${osname}${osvers}" in
8711 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8714 cygwin*) # ld links now against the dll directly
8715 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8716 majonly=`echo $patchlevel $subversion |
8717 $awk '{printf "%03d%03d", $1, $2}'`
8718 majonly=cygperl5.$majonly.$so
8721 *) # Try to guess based on whether libc has major.minor.
8723 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8724 *libc.$so.[0-9]*) dflt=$majonly ;;
8725 *) dflt=libperl.$so ;;
8735 I need to select a good name for the shared libperl. If your system uses
8736 library names with major and minor numbers, then you might want something
8737 like $majmin. Alternatively, if your system uses a single version
8738 number for shared libraries, then you might want to use $majonly.
8739 Or, your system might be quite happy with a simple libperl.$so.
8741 Since the shared libperl will get installed into a version-specific
8742 architecture-dependent directory, the version number of the shared perl
8743 library probably isn't important, so the default should be o.k.
8746 rp='What name do you want to give to the shared libperl?'
8749 echo "Ok, I'll use $libperl"
8752 libperl="libperl${_a}"
8756 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8760 WARNING: Use of the shrpdir variable for the installation location of
8761 the shared $libperl is not supported. It was never documented and
8762 will not work in this version. Let me (perlbug@perl.org)
8763 know of any problems this may cause.
8769 But your current setting of $shrpdir is
8770 the default anyway, so it's harmless.
8775 Further, your current attempted setting of $shrpdir
8776 conflicts with the value of $archlibexp/CORE
8777 that installperl will use.
8784 # How will the perl executable find the installed shared $libperl?
8785 # Add $xxx to ccdlflags.
8786 # If we can't figure out a command-line option, use $shrpenv to
8787 # set env LD_RUN_PATH. The main perl makefile uses this.
8788 shrpdir=$archlibexp/CORE
8791 if "$useshrplib"; then
8794 # We'll set it in Makefile.SH...
8799 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8800 xxx="-Wl,-R$shrpdir"
8802 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8803 xxx="-Wl,-rpath,$shrpdir"
8806 # hpux doesn't like the default, either.
8807 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8810 # cygwin needs only ldlibpth
8813 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8819 # Only add $xxx if it isn't already in ccdlflags.
8820 case " $ccdlflags " in
8822 *) ccdlflags="$ccdlflags $xxx"
8825 Adding $xxx to the flags
8826 passed to $ld so that the perl executable will find the
8827 installed shared $libperl.
8835 # Fix ccdlflags in AIX for building external extensions.
8836 # (For building Perl itself bare -bE:perl.exp is needed,
8837 # Makefile.SH takes care of this.)
8839 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8841 # Respect a hint or command-line value.
8843 '') shrpenv="$tmp_shrpenv" ;;
8845 case "$ldlibpthname" in
8846 '') ldlibpthname=LD_LIBRARY_PATH ;;
8847 none) ldlibpthname='' ;;
8850 : determine where manual pages are on this system
8854 syspath='/usr/share/man/man1 /usr/man/man1'
8855 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8856 syspath="$syspath /usr/man/u_man/man1"
8857 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8858 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8859 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8860 sysman=`./loc . /usr/man/man1 $syspath`
8863 if $test -d "$sysman"; then
8864 echo "System manual is in $sysman." >&4
8866 echo "Could not find manual pages in source form." >&4
8869 : determine where manual pages go
8870 set man1dir man1dir none
8874 $spackage has manual pages available in source form.
8878 echo "However, you don't have nroff, so they're probably useless to you."
8880 '') man1dir="none";;
8883 echo "If you don't want the manual sources installed, answer 'none'."
8888 lookpath="$prefixexp/share/man/man1"
8889 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8890 lookpath="$lookpath $prefixexp/man/p_man/man1"
8891 lookpath="$lookpath $prefixexp/man/u_man/man1"
8892 lookpath="$lookpath $prefixexp/man/man.1"
8894 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8895 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8905 rp="Where do the main $spackage manual pages (source) go?"
8907 if $test "X$man1direxp" != "X$ansexp"; then
8918 : What suffix to use on installed man pages
8925 rp="What suffix should be used for the main $spackage man pages?"
8927 '') case "$man1dir" in
8941 *) dflt="$man1ext";;
8948 : see if we can have long filenames
8950 first=123456789abcdef
8952 if (echo hi >$first) 2>/dev/null; then
8953 if $test -f 123456789abcde; then
8954 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8957 echo 'You can have filenames longer than 14 characters.'>&4
8962 You can't have filenames longer than 14 chars.
8963 You can't even think about them!
8969 $rm -rf 123456789abcde*
8971 : determine where library module manual pages go
8972 set man3dir man3dir none
8976 $spackage has manual pages for many of the library modules.
8982 However, you don't have nroff, so they're probably useless to you.
8985 '') man3dir="none";;
8989 case "$d_flexfnam" in
8992 However, your system can't handle the long file names like File::Basename.3.
8995 '') man3dir="none";;
8999 echo "If you don't want the manual sources installed, answer 'none'."
9000 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9002 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9003 if $test -d "$privlib/man/man3"; then
9006 WARNING: Previous versions of perl installed man3 pages into
9007 $privlib/man/man3. This version will suggest a
9008 new default of $dflt.
9012 rp='Do you wish to preserve the old behavior?(y/n)'
9015 y*) dflt="$privlib/man/man3" ;;
9020 *) dflt="$man3dir" ;;
9027 rp="Where do the $package library man pages (source) go?"
9037 : What suffix to use on installed man pages
9043 rp="What suffix should be used for the $package library man pages?"
9045 '') case "$man3dir" in
9059 *) dflt="$man3ext";;
9066 : see if we have to deal with yellow pages, now NIS.
9067 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9073 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9081 rp='Are you getting the hosts file via yellow pages?'
9084 y*) hostcat='ypcat hosts';;
9085 *) hostcat='cat /etc/hosts';;
9091 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9094 '') test -f /etc/group && groupcat='cat /etc/group';;
9097 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9100 : now get the host name
9102 echo "Figuring out host name..." >&4
9103 case "$myhostname" in
9105 echo 'Maybe "hostname" will work...'
9106 if tans=`sh -c hostname 2>&1` ; then
9114 if $test "$cont"; then
9116 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9117 if tans=`cat /etc/systemid 2>&1` ; then
9119 phostname='cat /etc/systemid'
9120 echo "Whadyaknow. Xenix always was a bit strange..."
9123 elif $test -r /etc/systemid; then
9124 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9127 if $test "$cont"; then
9128 echo 'No, maybe "uuname -l" will work...'
9129 if tans=`sh -c 'uuname -l' 2>&1` ; then
9131 phostname='uuname -l'
9133 echo 'Strange. Maybe "uname -n" will work...'
9134 if tans=`sh -c 'uname -n' 2>&1` ; then
9136 phostname='uname -n'
9138 echo 'Oh well, maybe I can mine it out of whoami.h...'
9139 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9140 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9141 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9143 case "$myhostname" in
9144 '') echo "Does this machine have an identity crisis or something?"
9147 echo "Well, you said $myhostname before..."
9148 phostname='echo $myhostname';;
9154 case "$myhostname" in
9155 '') myhostname=noname ;;
9157 : you do not want to know about this
9162 if $test "$myhostname" ; then
9164 rp='Your host name appears to be "'$myhostname'".'" Right?"
9172 : bad guess or no guess
9173 while $test "X$myhostname" = X ; do
9175 rp="Please type the (one word) name of your host:"
9180 : translate upper to lower if necessary
9181 case "$myhostname" in
9183 echo "(Normalizing case in your host name)"
9184 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9188 case "$myhostname" in
9190 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9191 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9192 echo "(Trimming domain name from host name--host name is now $myhostname)"
9194 *) case "$mydomain" in
9197 test "X$hostcat" = "Xypcat hosts" &&
9198 ypmatch "$myhostname" hosts 2>/dev/null |\
9199 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9202 test "X$hostcat" != "X" &&
9203 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9204 /[ ]$myhostname[ . ]/p" > hosts
9207 if $test -f hosts; then
9208 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9209 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9210 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9211 hosts | $sort | $uniq | \
9212 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9213 case `$echo X$dflt` in
9214 X*\ *) echo "(Several hosts in the database matched hostname)"
9217 X.) echo "(You do not have fully-qualified names in the hosts database)"
9221 echo "(I cannot locate a hosts database anywhere)"
9226 tans=`./loc resolv.conf X /etc /usr/etc`
9227 if $test -f "$tans"; then
9228 echo "(Attempting domain name extraction from $tans)"
9229 dflt=.`$sed -n -e 's/ / /g' \
9230 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9233 .) dflt=.`$sed -n -e 's/ / /g' \
9234 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9242 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9243 dflt=.`sh -c domainname 2>/dev/null`
9246 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9250 case "$dflt$osname" in
9251 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9252 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9256 .) echo "(Lost all hope -- silly guess then)"
9262 *) dflt="$mydomain";;
9266 rp="What is your domain name?"
9276 : translate upper to lower if necessary
9279 echo "(Normalizing case in your domain name)"
9280 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9284 : a little sanity check here
9285 case "$phostname" in
9288 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9289 $myhostname$mydomain|$myhostname) ;;
9291 case "$phostname" in
9293 echo "(That doesn't agree with your whoami.h file, by the way.)"
9296 echo "(That doesn't agree with your $phostname command, by the way.)"
9304 : determine the e-mail address of the user who is running us
9307 I need to get your e-mail address in Internet format if possible, i.e.
9308 something like user@host.domain. Please answer accurately since I have
9309 no easy means to double check it. The default value provided below
9310 is most probably close to reality but may not be valid from outside
9311 your organization...
9315 while test "$cont"; do
9316 case "$MAILDOMAIN" in
9318 if $test -s /etc/mailname; then
9319 maildomain=`$cat /etc/mailname`
9321 maildomain="$myhostname$mydomain"
9324 *) maildomain="$MAILDOMAIN";;
9327 '') dflt="$cf_by@$maildomain";;
9328 *) dflt="$cf_email";;
9330 rp='What is your e-mail address?'
9336 rp='Address does not look like an Internet one. Use it anyway?'
9350 : Ask e-mail of administrator
9353 If you or somebody else will be maintaining perl at your site, please
9354 fill in the correct e-mail address here so that they may be contacted
9355 if necessary. Currently, the "perlbug" program included with perl
9356 will send mail to this address in addition to perlbug@perl.org. You may
9357 enter "none" for no administrator.
9360 case "$perladmin" in
9361 '') dflt="$cf_email";;
9362 *) dflt="$perladmin";;
9364 rp='Perl administrator e-mail address'
9368 : determine whether to use a version number suffix for installed binaries
9371 Do you want to use a version number suffix for installed binaries? This
9372 will install 'perl$version' instead of 'perl', and likewise for other
9373 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9374 to be installed side-by-side. Unless you are a developer, you probably
9375 do *not* want to do this.
9377 case "$versiononly" in
9378 "$define"|[Yy]*|true) dflt='y' ;;
9381 rp="Do you want to use a version number suffix for installed binaries?"
9384 [yY]*) val="$define";;
9390 case "$versiononly" in
9391 "$define") inc_version_list=''
9392 inc_version_list_init=0
9396 : figure out how to guarantee perl startup
9397 : XXX Note that this currently takes advantage of the bug that binexp ignores
9398 : the Configure -Dinstallprefix setting, which in turn means that under
9399 : relocatable @INC, initialinstalllocation is what binexp started as.
9400 case "$startperl" in
9402 case "$sharpbang" in
9406 I can use the #! construct to start perl on your system. This will
9407 make startup of perl scripts faster, but may cause problems if you
9408 want to share those scripts and perl is not in a standard place
9409 ($initialinstalllocation/perl) on all your platforms. The alternative
9410 is to force a shell by starting the script with a single ':' character.
9413 case "$versiononly" in
9414 "$define") dflt="$initialinstalllocation/perl$version";;
9415 *) dflt="$initialinstalllocation/perl";;
9417 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9420 none) startperl=": # use perl";;
9421 *) startperl="#!$ans"
9422 if $test 30 -lt `echo "$ans" | wc -c`; then
9425 WARNING: Some systems limit the #! command to 32 characters.
9426 If you experience difficulty running Perl scripts with #!, try
9427 installing Perl in a directory with a shorter pathname.
9433 *) startperl=": # use perl"
9438 echo "I'll use $startperl to start perl scripts."
9440 : figure best path for perl in scripts
9443 case "$versiononly" in
9444 "$define") perlpath="$initialinstalllocation/perl$version";;
9445 *) perlpath="$initialinstalllocation/perl";;
9447 case "$startperl" in
9452 I will use the "eval 'exec'" idiom to start Perl on your system.
9453 I can use the full path of your Perl binary for this purpose, but
9454 doing so may cause problems if you want to share those scripts and
9455 Perl is not always in a standard place ($initialinstalllocation/perl).
9458 dflt="$initialinstalllocation/perl"
9459 rp="What path shall I use in \"eval 'exec'\"?"
9466 case "$startperl" in
9468 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9471 : determine where public executable scripts go
9472 set scriptdir scriptdir
9474 case "$scriptdir" in
9477 : guess some guesses
9478 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9479 $test -d /usr/share/bin && dflt=/usr/share/bin
9480 $test -d /usr/local/script && dflt=/usr/local/script
9481 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9482 $test -d $prefixexp/script && dflt=$prefixexp/script
9486 *) dflt="$scriptdir"
9491 Some installations have a separate directory just for executable scripts so
9492 that they can mount it across multiple architectures but keep the scripts in
9493 one spot. You might, for example, have a subdirectory of /usr/share for this.
9494 Or you might just lump your scripts in with all your other executables.
9498 rp='Where do you keep publicly executable scripts?'
9500 if $test "X$ansexp" != "X$scriptdirexp"; then
9506 : A little fix up for an irregularly named variable.
9507 installscript="$installscriptdir"
9509 : determine where add-on public executables go
9511 '') dflt=$siteprefix/bin ;;
9515 rp='Pathname where the add-on public executables should be installed?'
9520 : determine where add-on html pages go
9521 : There is no standard location, so try to copy the previously-selected
9522 : directory structure for the core html pages.
9523 case "$sitehtml1dir" in
9524 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9525 *) dflt=$sitehtml1dir ;;
9528 ''|' ') dflt=none ;;
9531 rp='Pathname where the site-specific html pages should be installed?'
9533 prefixvar=sitehtml1dir
9536 : determine where add-on library html pages go
9537 : There is no standard location, so try to copy the previously-selected
9538 : directory structure for the core html pages.
9539 case "$sitehtml3dir" in
9540 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9541 *) dflt=$sitehtml3dir ;;
9544 ''|' ') dflt=none ;;
9547 rp='Pathname where the site-specific library html pages should be installed?'
9549 prefixvar=sitehtml3dir
9552 : determine where add-on manual pages go
9553 case "$siteman1dir" in
9554 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9555 *) dflt=$siteman1dir ;;
9558 ''|' ') dflt=none ;;
9561 rp='Pathname where the site-specific manual pages should be installed?'
9563 prefixvar=siteman1dir
9566 : determine where add-on library man pages go
9567 case "$siteman3dir" in
9568 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9569 *) dflt=$siteman3dir ;;
9572 ''|' ') dflt=none ;;
9575 rp='Pathname where the site-specific library manual pages should be installed?'
9577 prefixvar=siteman3dir
9580 : determine where add-on public executable scripts go
9581 case "$sitescript" in
9582 '') dflt=$siteprefix/script
9583 $test -d $dflt || dflt=$sitebin ;;
9584 *) dflt="$sitescript" ;;
9587 rp='Pathname where add-on public executable scripts should be installed?'
9589 prefixvar=sitescript
9592 : see if backtrace exists
9593 set backtrace d_backtrace
9596 : add flags if using c backtrace
9597 case "$usecbacktrace" in
9598 "") usecbacktrace=$undef ;;
9600 case "$d_backtrace" in
9602 case " $ccflags " in
9603 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9604 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9608 echo "This system does not support backtrace" >&4
9609 usecbacktrace=$undef
9615 : Check if faststdio is requested and available
9616 case "$usefaststdio" in
9617 $define|true|[yY]*|'')
9618 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9628 Perl can be built to use 'fast stdio', which means using the stdio
9629 library but also directly manipulating the stdio buffers to enable
9630 faster I/O. Using stdio is better for backward compatibility (especially
9631 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9632 interface has been preferred instead of stdio.
9634 If this doesn't make any sense to you, just accept the default '$dflt'.
9636 rp='Use the "fast stdio" if available?'
9639 y|Y) val="$define" ;;
9646 : define an is-a-typedef? function
9647 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9649 "") inclist="sys/types.h";;
9651 eval "varval=\$$var";
9655 for inc in $inclist; do
9656 echo "#include <$inc>" >>temp.c;
9658 echo "#ifdef $type" >> temp.c;
9659 echo "printf(\"We have $type\");" >> temp.c;
9660 echo "#endif" >> temp.c;
9661 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9662 if $contains $type temp.E >/dev/null 2>&1; then
9668 *) eval "$var=\$varval";;
9671 : define an is-a-typedef? function that prompts if the type is not available.
9672 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9674 "") inclist="sys/types.h";;
9676 eval "varval=\$$var";
9680 for inc in $inclist; do
9681 echo "#include <$inc>" >>temp.c;
9683 echo "#ifdef $type" >> temp.c;
9684 echo "printf(\"We have $type\");" >> temp.c;
9685 echo "#endif" >> temp.c;
9686 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9688 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9689 if $contains $type temp.E >/dev/null 2>&1; then
9690 echo "$type found." >&4;
9693 echo "$type NOT found." >&4;
9699 *) eval "$var=\$varval";;
9702 : see what type lseek is declared as in the kernel
9703 rp="What is the type used for lseek's offset on this system?"
9704 set off_t lseektype long stdio.h sys/types.h
9708 echo "Checking to see how big your file offsets are..." >&4
9710 #include <sys/types.h>
9714 printf("%d\n", (int)sizeof($lseektype));
9719 if eval $compile_ok; then
9720 lseeksize=`$run ./try`
9721 echo "Your file offsets are $lseeksize bytes long."
9725 echo "(I can't seem to compile the test program. Guessing...)"
9726 rp="What is the size of your file offsets (in bytes)?"
9732 : see what type file positions are declared as in the library
9733 rp="What is the type for file position used by fsetpos()?"
9734 set fpos_t fpostype long stdio.h sys/types.h
9737 : Check size for Fpos_t
9740 *_t) zzz="$fpostype" ;;
9743 echo "Checking the size of $zzz..." >&4
9745 #include <sys/types.h>
9752 printf("%d\n", (int)sizeof($fpostype));
9757 if eval $compile_ok; then
9761 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9764 echo "Your $zzz is $fpossize bytes long."
9770 echo "(I can't compile the test program. Guessing...)" >&4
9771 rp="What is the size of your file positions (in bytes)?"
9776 : Check for large file support
9777 # Backward compatibility (uselfs is deprecated).
9779 "$define"|true|[yY]*)
9782 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9784 uselargefiles="$define"
9788 case "$lseeksize:$fpossize" in
9791 You can have files larger than 2 gigabytes.
9794 *) case "$uselargefiles" in
9795 "$undef"|false|[nN]*) dflt='n' ;;
9800 Perl can be built to understand large files (files larger than 2 gigabytes)
9801 on some systems. To do so, Configure can be run with -Duselargefiles.
9803 If this doesn't make any sense to you, just accept the default '$dflt'.
9805 rp='Try to understand large files, if available?'
9808 y|Y) val="$define" ;;
9815 : Look for a hint-file generated 'call-back-unit'. If the
9816 : user has specified that a large files perl is to be built,
9817 : we may need to set or change some other defaults.
9818 if $test -f uselargefiles.cbu; then
9819 echo "Your platform has some specific hints regarding large file builds, using them..."
9820 . ./uselargefiles.cbu
9822 case "$uselargefiles" in
9824 if $test -f uselargefiles.cbu; then
9826 echo "Rechecking to see how big your file offsets are..." >&4
9828 #include <sys/types.h>
9832 printf("%d\n", (int)sizeof($lseektype));
9837 if eval $compile_ok; then
9838 lseeksize=`$run ./try`
9839 $echo "Your file offsets are now $lseeksize bytes long."
9843 echo "(I can't seem to compile the test program. Guessing...)"
9844 rp="What is the size of your file offsets (in bytes)?"
9849 *_t) zzz="$fpostype" ;;
9852 $echo $n "Rechecking the size of $zzz...$c" >&4
9854 #include <sys/types.h>
9861 printf("%d\n", (int)sizeof($fpostype));
9866 if eval $compile_ok; then
9871 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9874 echo " $fpossize bytes." >&4
9880 echo "(I can't compile the test program. Guessing...)" >&4
9881 rp="What is the size of your file positions (in bytes)?"
9890 : Check if we want perlio
9893 : Set the vendorbin variables
9894 case "$vendorprefix" in
9895 '') d_vendorbin="$undef"
9899 *) d_vendorbin="$define"
9900 : determine where vendor-supplied executables go.
9901 case "$vendorbin" in
9902 '') dflt=$vendorprefix/bin ;;
9903 *) dflt="$vendorbin" ;;
9906 rp='Pathname for the vendor-supplied executables directory?'
9909 vendorbinexp="$ansexp"
9915 : Set the vendorhtml1dir variables
9916 case "$vendorprefix" in
9917 '') vendorhtml1dir=''
9918 vendorhtml1direxp=''
9920 *) : determine where vendor-supplied html pages go.
9921 : There is no standard location, so try to copy the previously-selected
9922 : directory structure for the core html pages.
9923 : XXX Better default suggestions would be welcome.
9924 case "$vendorhtml1dir" in
9925 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9926 *) dflt=$vendorhtml1dir ;;
9929 ''|' ') dflt=none ;;
9932 rp='Pathname for the vendor-supplied html pages?'
9934 vendorhtml1dir="$ans"
9935 vendorhtml1direxp="$ansexp"
9938 : Use ' ' for none so value is preserved next time through Configure
9939 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9940 prefixvar=vendorhtml1dir
9943 : Set the vendorhtml3dir variables
9944 case "$vendorprefix" in
9945 '') vendorhtml3dir=''
9946 vendorhtml3direxp=''
9948 *) : determine where vendor-supplied module html pages go.
9949 : There is no standard location, so try to copy the previously-selected
9950 : directory structure for the core html pages.
9951 : XXX Better default suggestions would be welcome.
9952 case "$vendorhtml3dir" in
9953 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9954 *) dflt=$vendorhtml3dir ;;
9957 ''|' ') dflt=none ;;
9960 rp='Pathname for the vendor-supplied html pages?'
9962 vendorhtml3dir="$ans"
9963 vendorhtml3direxp="$ansexp"
9966 : Use ' ' for none so value is preserved next time through Configure
9967 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9968 prefixvar=vendorhtml3dir
9971 : Set the vendorman1dir variables
9972 case "$vendorprefix" in
9973 '') vendorman1dir=''
9976 *) : determine where vendor-supplied manual pages go.
9977 case "$vendorman1dir" in
9978 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9979 *) dflt=$vendorman1dir ;;
9982 ''|' ') dflt=none ;;
9985 rp='Pathname for the vendor-supplied manual section 1 pages?'
9987 vendorman1dir="$ans"
9988 vendorman1direxp="$ansexp"
9991 : Use ' ' for none so value is preserved next time through Configure
9992 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9993 prefixvar=vendorman1dir
9996 : Set the vendorman3dir variables
9997 case "$vendorprefix" in
9998 '') vendorman3dir=''
10001 *) : determine where vendor-supplied module manual pages go.
10002 case "$vendorman3dir" in
10003 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10004 *) dflt=$vendorman3dir ;;
10007 ''|' ') dflt=none ;;
10010 rp='Pathname for the vendor-supplied manual section 3 pages?'
10012 vendorman3dir="$ans"
10013 vendorman3direxp="$ansexp"
10016 : Use ' ' for none so value is preserved next time through Configure
10017 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10018 prefixvar=vendorman3dir
10021 : Set the vendorscript variables
10022 case "$vendorprefix" in
10023 '') d_vendorscript="$undef"
10027 *) d_vendorscript="$define"
10028 : determine where vendor-supplied scripts go.
10029 case "$vendorscript" in
10030 '') dflt=$vendorprefix/script
10031 $test -d $dflt || dflt=$vendorbin ;;
10032 *) dflt="$vendorscript" ;;
10036 The installation process will create a directory for
10037 vendor-supplied scripts.
10041 rp='Pathname for the vendor-supplied scripts directory?'
10043 vendorscript="$ans"
10044 vendorscriptexp="$ansexp"
10047 prefixvar=vendorscript
10050 : see if qgcvt exists
10054 : Check what kind of doubles your system has
10055 $echo "Checking the kind of doubles you have..." >&4
10057 #$i_stdlib I_STDLIB
10058 #define DOUBLESIZE $doublesize
10060 #include <stdlib.h>
10063 static const double d = -0.1;
10065 unsigned const char* b = (unsigned const char*)(&d);
10066 #if DOUBLESIZE == 4
10067 if (b[0] == 0xCD && b[3] == 0xBD) {
10068 /* IEEE 754 32-bit little-endian */
10072 if (b[0] == 0xBD && b[3] == 0xCD) {
10073 /* IEEE 754 32-bit big-endian */
10077 if (b[0] == 0xCC && b[3] == 0xCC) {
10078 /* VAX format F, 32-bit PDP-style mixed endian. */
10082 if (b[0] == 0xC0 && b[3] == 0x9A) {
10083 /* IBM single 32-bit */
10088 #if DOUBLESIZE == 8
10089 if (b[0] == 0x9A && b[7] == 0xBF) {
10090 /* IEEE 754 64-bit little-endian */
10094 if (b[0] == 0xBF && b[7] == 0x9A) {
10095 /* IEEE 754 64-bit big-endian */
10099 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10100 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10101 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10102 * 99 99 b9 bf 9a 99 99 99 */
10106 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10107 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10108 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10109 * 99 99 99 9a bf b9 99 99 */
10113 if (b[0] == 0xCC && b[7] == 0xCC) {
10114 /* VAX format D, 64-bit PDP-style mixed endian. */
10118 if (b[0] == 0xD9 && b[7] == 0x99) {
10119 /* VAX format G, 64-bit PDP-style mixed endian. */
10123 if (b[0] == 0xC0 && b[7] == 0x9A) {
10124 /* IBM double 64-bit */
10128 if (b[0] == 0xBF && b[7] == 0xCD) {
10129 /* CRAY single 64-bit */
10134 #if DOUBLESIZE == 16
10135 if (b[0] == 0x9A && b[15] == 0xBF) {
10136 /* IEEE 754 128-bit little-endian */
10140 if (b[0] == 0xBF && b[15] == 0x9A) {
10141 /* IEEE 754 128-bit big-endian */
10146 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10147 * Whether those environments can still build Perl is debatable. */
10148 printf("-1\n"); /* unknown */
10153 if eval $compile; then
10154 doublekind=`$run ./try`
10158 case "$doublekind" in
10159 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10160 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10161 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10162 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10163 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10164 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10165 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10166 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10167 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10168 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10169 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10170 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10171 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10172 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10173 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10175 d_double_style_ieee=$undef
10176 d_double_style_vax=$undef
10177 d_double_style_ibm=$undef
10178 d_double_style_cray=$undef
10179 case "$doublekind" in
10180 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10181 9|10|11) d_double_style_vax=$define ;;
10182 12|13) d_double_style_ibm=$define ;;
10183 14) d_double_style_cray=$define ;;
10185 case "$d_double_style_ieee" in
10187 d_double_has_inf=$define
10188 d_double_has_nan=$define
10189 d_double_has_negative_zero=$define
10190 d_double_has_subnormals=$define
10193 d_double_has_inf=$undef
10194 d_double_has_nan=$undef
10195 d_double_has_negative_zero=$undef
10196 d_double_has_subnormals=$undef
10201 : Check print/scan long double stuff
10204 if $test X"$d_longdbl" = X"$define"; then
10206 echo "Checking how to print long doubles..." >&4
10208 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10209 $cat >try.c <<'EOCP'
10210 #include <sys/types.h>
10213 double d = 123.456;
10214 printf("%.3f\n", d);
10218 if eval $compile; then
10222 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10223 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10224 echo "We will use %f."
10230 if $test X"$sPRIfldbl" = X; then
10231 $cat >try.c <<'EOCP'
10232 #include <sys/types.h>
10235 long double d = 123.456;
10236 printf("%.3Lf\n", d);
10240 if eval $compile; then
10244 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10245 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10246 echo "We will use %Lf."
10252 if $test X"$sPRIfldbl" = X; then
10253 $cat >try.c <<'EOCP'
10254 #include <sys/types.h>
10257 long double d = 123.456;
10258 printf("%.3llf\n", d);
10262 if eval $compile; then
10266 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10267 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10268 echo "We will use %llf."
10274 if $test X"$sPRIfldbl" = X; then
10275 $cat >try.c <<'EOCP'
10276 #include <sys/types.h>
10279 long double d = 123.456;
10280 printf("%.3lf\n", d);
10284 if eval $compile; then
10288 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10289 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10290 echo "We will use %lf."
10296 if $test X"$sPRIfldbl" = X; then
10297 echo "Cannot figure out how to print long doubles." >&4
10299 sSCNfldbl=$sPRIfldbl # expect consistency
10306 case "$sPRIfldbl" in
10307 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10308 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10309 d_SCNfldbl="$undef";
10311 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10312 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10313 d_SCNfldbl="$define";
10317 : Before committing on uselongdouble, see whether that looks sane.
10318 if $test "$uselongdouble" = "$define"; then
10321 echo "Checking if your long double math functions work right..." >&4
10326 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10329 case "$osname:$gccversion" in
10330 aix:) saveccflags="$ccflags"
10331 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10334 if eval $compile_ok; then
10338 3) echo "Your long double math functions are working correctly." >&4 ;;
10339 *) echo "Your long double math functions are broken, not using long doubles." >&4
10340 uselongdouble=$undef
10344 case "$osname:$gccversion" in
10345 aix:) ccflags="$saveccflags" ;; # restore
10349 : Check how to convert floats to strings.
10351 if test "X$d_Gconvert" = X; then
10354 echo "Checking for an efficient way to convert floats to strings."
10356 case "$uselongdouble" in
10357 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10359 case "$d_longdbl" in
10360 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10362 case "$d_PRIgldbl" in
10363 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10366 #ifdef TRY_gconvert
10367 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10368 char *myname = "gconvert";
10371 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10372 char *myname = "gcvt";
10375 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10376 char *myname = "qgcvt";
10377 #define DOUBLETYPE long double
10380 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10381 #ifdef HAS_PRIgldbl
10382 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10384 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10387 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10389 char *myname = "sprintf";
10393 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10394 #define DOUBLETYPE long double
10396 #define DOUBLETYPE double
10402 #$i_stdlib I_STDLIB
10404 #include <stdlib.h>
10406 #include <string.h>
10408 int checkit(char *expect, char *got)
10410 if (strcmp(expect, got)) {
10411 printf("%s oddity: Expected %s, got %s\n",
10412 myname, expect, got);
10422 /* This must be 1st test on (which?) platform */
10423 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10424 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10425 checkit("0.1", buf);
10427 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10428 checkit("0.01", buf);
10430 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10431 checkit("0.001", buf);
10433 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10434 checkit("0.0001", buf);
10436 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10437 if (strlen(buf) > 5)
10438 checkit("9e-005", buf); /* for Microsoft ?? */
10440 checkit("9e-05", buf);
10442 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10445 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10446 checkit("1.1", buf);
10448 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10449 checkit("1.01", buf);
10451 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10452 checkit("1.001", buf);
10454 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10455 checkit("1.0001", buf);
10457 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10458 checkit("1.00001", buf);
10460 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10461 checkit("1.000001", buf);
10463 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10466 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10467 checkit("-1", buf);
10469 /* Some Linux gcvt's give 1.e+5 here. */
10470 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10471 checkit("100000", buf);
10473 /* Some Linux gcvt's give -1.e+5 here. */
10474 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10475 checkit("-100000", buf);
10477 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10478 checkit("123.456", buf);
10480 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10481 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10482 /* 34 should be enough to scare even long double
10483 * places into using the e notation. */
10484 if (strlen(buf) > 5)
10485 checkit("1e+034", buf); /* for Microsoft */
10487 checkit("1e+34", buf);
10489 /* For Perl, if you add additional tests here, also add them to
10490 * t/base/num.t for benefit of platforms not using Configure or
10491 * overriding d_Gconvert */
10496 : first add preferred functions to our list
10498 for xxx_convert in $gconvert_preference; do
10499 case $xxx_convert in
10500 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10501 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10504 : then add any others
10505 for xxx_convert in gconvert gcvt sprintf; do
10506 case "$xxx_list" in
10508 *) xxx_list="$xxx_list $xxx_convert" ;;
10512 case "$d_longdbl$uselongdouble" in
10514 : again, add preferred functions to our list first
10516 for xxx_convert in $gconvert_ld_preference; do
10517 case $xxx_convert in
10518 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10519 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10522 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10523 for xxx_convert in qgcvt sprintf $xxx_list; do
10524 case "$xxx_ld_list" in
10525 $xxx_convert*|*" $xxx_convert"*) ;;
10526 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10529 : if sprintf cannot do long doubles, move it to the end
10530 if test "$d_PRIgldbl" != "$define"; then
10531 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10533 : if no qgcvt, remove it
10534 if test "$d_qgcvt" != "$define"; then
10535 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10538 xxx_list="$xxx_ld_list"
10542 for xxx_convert in $xxx_list; do
10543 echo "Trying $xxx_convert..."
10544 $rm -f try try$_o core
10545 set try -DTRY_$xxx_convert
10546 if eval $compile; then
10547 echo "$xxx_convert() found." >&4
10548 if $run ./try; then
10549 echo "I'll use $xxx_convert to convert floats into a string." >&4
10552 echo "...But $xxx_convert didn't work as I expected."
10556 echo "$xxx_convert NOT found." >&4
10560 if test X$xxx_convert = X; then
10561 echo "*** WHOA THERE!!! ***" >&4
10562 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10563 xxx_convert=sprintf
10566 case "$xxx_convert" in
10567 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10568 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10569 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10570 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10571 "$define$define$define")
10572 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10573 "$define$define$undef")
10574 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10575 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10583 : see if _fwalk exists
10587 : Initialize h_fcntl
10590 : Initialize h_sysfile
10593 : access call always available on UNIX
10594 set access d_access
10597 : locate the flags for 'access()'
10598 case "$d_access" in
10601 $cat >access.c <<EOCP
10602 #include <sys/types.h>
10607 #include <sys/file.h>
10610 #include <unistd.h>
10612 #$i_stdlib I_STDLIB
10614 #include <stdlib.h>
10620 : check sys/file.h first, no particular reason here
10621 if $test `./findhdr sys/file.h` && \
10622 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10624 echo "<sys/file.h> defines the *_OK access constants." >&4
10625 elif $test `./findhdr fcntl.h` && \
10626 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10628 echo "<fcntl.h> defines the *_OK access constants." >&4
10629 elif $test `./findhdr unistd.h` && \
10630 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10631 echo "<unistd.h> defines the *_OK access constants." >&4
10633 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10639 : see if accessx exists
10640 set accessx d_accessx
10643 : see if acosh exists
10647 : see if aintl exists
10651 : see if alarm exists
10655 : see if 64bit time functions exists
10657 set ctime64 d_ctime64
10660 set localtime64 d_localtime64
10663 set gmtime64 d_gmtime64
10666 set mktime64 d_mktime64
10669 set difftime64 d_difftime64
10672 set asctime64 d_asctime64
10675 : see if POSIX threads are available
10676 set pthread.h i_pthread
10679 : define a function to check prototypes
10680 $cat > protochk <<EOSH
10683 optimize="$optimize"
10687 usethreads=$usethreads
10688 i_pthread=$i_pthread
10689 pthread_h_first=$pthread_h_first
10692 $cat >> protochk <<'EOSH'
10697 while test $# -ge 2; do
10699 $define) echo "#include <$2>" >> try.c ;;
10700 literal) echo "$2" >> try.c ;;
10702 # Extra magic for the benefit of systems that need pthread.h
10703 # to be included early to correctly detect threadsafe functions.
10704 # Such functions must guarantee themselves, though, that the usethreads
10705 # and i_pthread have been defined, before calling protochk.
10706 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10707 echo "#include <pthread.h>" >> try.c
10712 cat >> try.c <<'EOCP'
10713 #define _(args) args
10715 echo "$foo" >> try.c
10716 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10717 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10723 $eunicefix protochk
10725 : Define hasproto macro for Configure internal use
10726 hasproto='varname=$1; func=$2; shift; shift;
10727 while $test $# -ge 2; do
10729 $define) echo "#include <$2>";;
10733 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10734 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10735 echo "$func() prototype found.";
10738 echo "$func() prototype NOT found.";
10745 : see if sys/types.h has to be included
10746 set sys/types.h i_systypes
10749 : see if sys/select.h has to be included
10750 set sys/select.h i_sysselct
10753 : Define hasfield macro for Configure internal use
10754 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10755 while $test $# -ge 2; do
10757 $define) echo "#include <$2>";;
10761 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10763 if eval $compile; then
10772 : see if we should include sys/time.h
10775 if test "X$timeincl" = X; then
10776 echo "Testing to see if we should include <sys/time.h>." >&4
10777 $echo $n "I'm now running the test program...$c"
10779 #include <sys/types.h>
10782 #ifdef SYSTIMEKERNEL
10785 #include <sys/time.h>
10788 #include <sys/select.h>
10790 #$i_stdlib I_STDLIB
10792 #include <stdlib.h>
10798 struct timeval bar;
10801 struct timezone tzp;
10803 if (foo.tm_sec == foo.tm_sec)
10806 if (bar.tv_sec == bar.tv_sec)
10813 for s_timezone in '-DS_TIMEZONE' ''; do
10815 for s_timeval in '-DS_TIMEVAL' ''; do
10816 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10817 for i_systime in '-DI_SYSTIME' ''; do
10820 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10821 if eval $compile; then
10822 set X $i_systime $i_systimek $sysselect $s_timeval
10826 $echo $n "Succeeded with $flags$c"
10837 *SYSTIMEKERNEL*) i_systimek="$define"
10838 timeincl=`./findhdr sys/time.h`
10839 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10840 *) i_systimek="$undef";;
10843 *I_SYSTIME*) i_systime="$define"
10844 timeincl=`./findhdr sys/time.h`" $timeincl"
10845 echo "We'll include <sys/time.h>." >&4;;
10846 *) i_systime="$undef";;
10850 : see if struct tm knows about tm_zone
10851 case "$i_systime$i_time" in
10854 echo "Checking to see if your struct tm has tm_zone field..." >&4
10855 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10863 case "$d_tm_tm_zone" in
10864 "$define") echo "Yes, it does." ;;
10865 *) echo "No, it doesn't." ;;
10867 : see if struct tm knows about tm_gmtoff
10868 case "$i_systime$i_time" in
10871 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10872 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10880 case "$d_tm_tm_gmtoff" in
10881 "$define") echo "Yes, it does." ;;
10882 *) echo "No, it doesn't." ;;
10885 : see if asctime_r exists
10886 set asctime_r d_asctime_r
10888 case "$d_asctime_r" in
10890 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10891 case "$d_asctime_r_proto:$usethreads" in
10892 ":define") d_asctime_r_proto=define
10893 set d_asctime_r_proto asctime_r $hdrs
10897 case "$d_asctime_r_proto" in
10899 case "$asctime_r_proto" in
10900 ''|0) try='char* asctime_r(const struct tm*, char*);'
10901 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10903 case "$asctime_r_proto" in
10904 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10905 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10907 case "$asctime_r_proto" in
10908 ''|0) try='int asctime_r(const struct tm*, char*);'
10909 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10911 case "$asctime_r_proto" in
10912 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10913 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10915 case "$asctime_r_proto" in
10916 ''|0) d_asctime_r=undef
10918 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10919 * ) case "$asctime_r_proto" in
10920 REENTRANT_PROTO*) ;;
10921 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10923 echo "Prototype: $try" ;;
10926 *) case "$usethreads" in
10927 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10934 *) asctime_r_proto=0
10938 : see if asinh exists
10942 : see if atanh exists
10946 : see if atolf exists
10950 : see if atoll exists
10954 : Look for GCC-style attribute format
10955 case "$d_attribute_format" in
10958 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10959 $cat >attrib.c <<'EOCP'
10961 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10963 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10964 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10965 echo "Your C compiler doesn't support __attribute__((format))."
10968 echo "Your C compiler supports __attribute__((format))."
10972 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10976 *) val="$d_attribute_format" ;;
10978 set d_attribute_format
10982 : Look for GCC-style attribute format with null format allowed
10983 case "$d_printf_format_null" in
10984 '') case "$d_attribute_format" in
10987 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10988 $cat >attrib.c <<EOCP
10990 #$i_stdlib I_STDLIB
10992 #include <stdlib.h>
10994 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10995 int null_printf (char* pat,...) { return (int)pat; }
10996 int main () { exit(null_printf(NULL)); }
10998 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10999 : run the executable in case it produces a run-time warning
11000 if $run ./attrib >>attrib.out 2>&1; then
11001 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11002 echo "Your C compiler doesn't allow __printf__ format to be null."
11005 echo "Your C compiler allows __printf__ format to be null."
11009 echo "Your C compiler executable failed with __printf__ format null."
11013 echo "Your C compiler fails with __printf__ format null."
11020 *) val="$d_printf_format_null" ;;
11022 set d_printf_format_null
11026 : Look for GCC-style attribute malloc
11027 case "$d_attribute_malloc" in
11030 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11031 $cat >attrib.c <<'EOCP'
11033 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11035 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11036 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11037 echo "Your C compiler doesn't support __attribute__((malloc))."
11040 echo "Your C compiler supports __attribute__((malloc))."
11044 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11048 *) val="$d_attribute_malloc" ;;
11050 set d_attribute_malloc
11054 : Look for GCC-style attribute nonnull
11055 case "$d_attribute_nonnull" in
11058 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11059 $cat >attrib.c <<'EOCP'
11061 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11063 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11064 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11065 echo "Your C compiler doesn't support __attribute__((nonnull))."
11068 echo "Your C compiler supports __attribute__((nonnull))."
11072 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11076 *) val="$d_attribute_nonnull" ;;
11078 set d_attribute_nonnull
11082 : Look for GCC-style attribute noreturn
11083 case "$d_attribute_noreturn" in
11086 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11087 $cat >attrib.c <<'EOCP'
11089 void fall_over_dead( void ) __attribute__((noreturn));
11091 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11092 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11093 echo "Your C compiler doesn't support __attribute__((noreturn))."
11096 echo "Your C compiler supports __attribute__((noreturn))."
11100 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11104 *) val="$d_attribute_noreturn" ;;
11106 set d_attribute_noreturn
11110 : Look for GCC-style attribute pure
11111 case "$d_attribute_pure" in
11114 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11115 $cat >attrib.c <<'EOCP'
11117 int square( int n ) __attribute__((pure));
11119 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11120 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11121 echo "Your C compiler doesn't support __attribute__((pure))."
11124 echo "Your C compiler supports __attribute__((pure))."
11128 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11132 *) val="$d_attribute_pure" ;;
11134 set d_attribute_pure
11138 : Look for GCC-style attribute unused
11139 case "$d_attribute_unused" in
11142 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11143 $cat >attrib.c <<'EOCP'
11145 int do_something( int dummy __attribute__((unused)), int n );
11147 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11148 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11149 echo "Your C compiler doesn't support __attribute__((unused))."
11152 echo "Your C compiler supports __attribute__((unused))."
11156 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11160 *) val="$d_attribute_unused" ;;
11162 set d_attribute_unused
11166 : Look for GCC-style attribute deprecated
11167 case "$d_attribute_deprecated" in
11170 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11171 $cat >attrib.c <<'EOCP'
11173 int I_am_deprecated(void) __attribute__((deprecated));
11175 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11176 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11177 echo "Your C compiler doesn't support __attribute__((deprecated))."
11180 echo "Your C compiler supports __attribute__((deprecated))."
11184 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11188 *) val="$d_attribute_deprecated" ;;
11190 set d_attribute_deprecated
11194 : Look for GCC-style attribute warn_unused_result
11195 case "$d_attribute_warn_unused_result" in
11198 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11199 $cat >attrib.c <<'EOCP'
11201 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11203 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11204 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11205 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11208 echo "Your C compiler supports __attribute__((warn_unused_result))."
11212 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11216 *) val="$d_attribute_warn_unused_result" ;;
11218 set d_attribute_warn_unused_result
11222 : see if getpgrp exists
11223 set getpgrp d_getpgrp
11226 case "$d_getpgrp" in
11229 echo "Checking to see which flavor of getpgrp is in use..."
11231 #$i_unistd I_UNISTD
11232 #include <sys/types.h>
11234 # include <unistd.h>
11236 #$i_stdlib I_STDLIB
11238 #include <stdlib.h>
11242 if (getuid() == 0) {
11243 printf("(I see you are running Configure as super-user...)\n");
11246 #ifdef TRY_BSD_PGRP
11247 if (getpgrp(1) == 0)
11256 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11257 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11259 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11260 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11263 echo "I can't seem to compile and run the test program."
11265 xxx="a USG one, i.e. you use getpgrp()."
11267 # SVR4 systems can appear rather BSD-ish.
11268 case "$i_unistd" in
11270 xxx="a BSD one, i.e. you use getpgrp(pid)."
11274 xxx="probably a USG one, i.e. you use getpgrp()."
11279 echo "Assuming your getpgrp is $xxx" >&4
11288 : see if setpgrp exists
11289 set setpgrp d_setpgrp
11292 case "$d_setpgrp" in
11295 echo "Checking to see which flavor of setpgrp is in use..."
11297 #$i_unistd I_UNISTD
11298 #include <sys/types.h>
11300 # include <unistd.h>
11302 #$i_stdlib I_STDLIB
11304 #include <stdlib.h>
11308 if (getuid() == 0) {
11309 printf("(I see you are running Configure as super-user...)\n");
11312 #ifdef TRY_BSD_PGRP
11313 if (-1 == setpgrp(1, 1))
11316 if (setpgrp() != -1)
11322 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11323 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11325 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11326 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11329 echo "(I can't seem to compile and run the test program.)"
11331 xxx="a USG one, i.e. you use setpgrp()."
11333 # SVR4 systems can appear rather BSD-ish.
11334 case "$i_unistd" in
11336 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11340 xxx="probably a USG one, i.e. you use setpgrp()."
11345 echo "Assuming your setpgrp is $xxx" >&4
11354 : Look for GCC-style __builtin_add_overflow
11355 case "$d_builtin_add_overflow" in
11358 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11359 $cat >try.c <<'EOCP'
11361 const unsigned int uint_max = ~0u;
11362 int target_int = 0;
11363 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11366 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11369 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11376 if eval $compile && $run ./try; then
11377 echo "Your C compiler supports __builtin_add_overflow."
11380 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11384 *) val="$d_builtin_add_overflow" ;;
11387 set d_builtin_add_overflow
11391 : Look for GCC-style __builtin_sub_overflow
11392 case "$d_builtin_sub_overflow" in
11395 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11396 $cat >try.c <<'EOCP'
11398 const unsigned int uint_max = ~0u;
11399 int target_int = 0;
11400 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11403 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11406 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11413 if eval $compile && $run ./try; then
11414 echo "Your C compiler supports __builtin_sub_overflow."
11417 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11421 *) val="$d_builtin_sub_overflow" ;;
11424 set d_builtin_sub_overflow
11428 : Look for GCC-style __builtin_mul_overflow
11429 case "$d_builtin_mul_overflow" in
11432 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11433 $cat >try.c <<'EOCP'
11435 const unsigned int uint_max = ~0u;
11436 int target_int = 0;
11437 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11440 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11443 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11450 if eval $compile && $run ./try; then
11451 echo "Your C compiler supports __builtin_mul_overflow."
11454 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11458 *) val="$d_builtin_mul_overflow" ;;
11461 set d_builtin_mul_overflow
11465 : Look for GCC-style __builtin_choose_expr
11466 case "$d_builtin_choose_expr" in
11469 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11470 $cat >try.c <<'EOCP'
11471 #include <assert.h>
11472 #include <stdlib.h>
11475 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11478 assert( SYRINX(1) == 2112 );
11479 assert( SYRINX(1) != 5150 );
11480 assert( SYRINX(0) == 5150 );
11481 assert( SYRINX(0) != 2112 );
11482 puts( "All good!" );
11488 if eval $compile && $run ./try; then
11489 echo "Your C compiler supports __builtin_choose_expr."
11492 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11496 *) val="$d_builtin_choose_expr" ;;
11499 set d_builtin_choose_expr
11503 : Look for GCC-style __builtin_expect
11504 case "$d_builtin_expect" in
11507 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11508 $cat >try.c <<'EOCP'
11511 if ( __builtin_expect(n, 0) ) n = 1;
11512 /* Remember shell exit code truth is 0, C truth is non-zero */
11517 if eval $compile && $run ./try; then
11518 echo "Your C compiler supports __builtin_expect."
11521 echo "Your C compiler doesn't seem to understand __builtin_expect."
11525 *) val="$d_builtin_expect" ;;
11528 set d_builtin_expect
11532 : see if the Compiler supports C99 variadic macros
11533 echo "Checking for C99 variadic macros." >&4
11536 #include <stdarg.h>
11538 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11542 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11548 if eval $compile && $run ./try 2>&1 >/dev/null; then
11549 case "`$run ./try`" in
11551 echo "You have C99 variadic macros." >&4
11552 d_c99_variadic_macros="$define"
11555 echo "You don't have functional C99 variadic macros." >&4
11556 d_c99_variadic_macros="$undef"
11560 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11561 d_c99_variadic_macros="$undef"
11565 : see if signal is declared as pointer to function returning int or void
11567 xxx=`./findhdr signal.h`
11568 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11569 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11570 echo "You have int (*signal())() instead of void." >&4
11572 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11573 echo "You have void (*signal())()." >&4
11575 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11576 echo "You have int (*signal())() instead of void." >&4
11578 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11579 echo "You have void (*signal())()." >&4
11582 case "$d_voidsig" in
11584 echo "I can't determine whether signal handler returns void or int..." >&4
11586 rp="What type does your signal handler return?"
11589 v*) val="$define";;
11593 echo "As you already told me, signal handler returns void." >&4
11596 *) echo "As you already told me, signal handler returns int." >&4
11603 case "$d_voidsig" in
11604 "$define") signal_t="void";;
11605 *) signal_t="int";;
11609 : check for ability to cast large floats to 32-bit ints.
11611 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11612 if $test "$intsize" -ge 4; then
11619 #$i_stdlib I_STDLIB
11621 #include <stdlib.h>
11623 #include <sys/types.h>
11624 #include <signal.h>
11625 $signal_t blech(int s) { exit(3); }
11632 signal(SIGFPE, blech);
11634 /* Don't let compiler optimize the test away. Store the number
11635 in a writable string for gcc to pass to sscanf under HP-UX.
11637 sprintf(str, "2147483647");
11638 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11642 /* x86 processors will probably give 0x8000 0000, which is a
11643 sign change. We don't want that. We want to mimic SPARC
11644 behavior here, which is to preserve the sign and give
11647 if (i32 != ($xxx) f)
11653 if eval $compile_ok; then
11654 $run ./try 2>/dev/null
11657 echo "(I can't seem to compile the test program--assuming it can't)"
11662 echo "Yup, it can."
11665 echo "Nope, it can't."
11672 : check for ability to cast negative floats to unsigned
11674 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11677 #$i_stdlib I_STDLIB
11679 #include <stdlib.h>
11681 #include <sys/types.h>
11682 #include <signal.h>
11683 $signal_t blech(int s) { exit(7); }
11684 $signal_t blech_in_list(int s) { exit(4); }
11685 unsigned long dummy_long(unsigned long p) { return p; }
11686 unsigned int dummy_int(unsigned int p) { return p; }
11687 unsigned short dummy_short(unsigned short p) { return p; }
11691 unsigned long along;
11693 unsigned short ashort;
11697 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11698 a direct f = -123. assignment. gcc-2.8.0 reportedly
11699 optimized the whole file away
11701 /* Store the number in a writable string for gcc to pass to
11702 sscanf under HP-UX.
11704 sprintf(str, "-123");
11705 sscanf(str, "%lf", &f); /* f = -123.; */
11707 signal(SIGFPE, blech);
11708 along = (unsigned long)f;
11709 aint = (unsigned int)f;
11710 ashort = (unsigned short)f;
11711 if (along != (unsigned long)-123)
11713 if (aint != (unsigned int)-123)
11715 if (ashort != (unsigned short)-123)
11717 sprintf(str, "1073741824.");
11718 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11721 along = (unsigned long)f;
11722 if (along != 0x80000000)
11726 along = (unsigned long)f;
11727 if (along != 0x7fffffff)
11731 along = (unsigned long)f;
11732 if (along != 0x80000001)
11736 signal(SIGFPE, blech_in_list);
11737 sprintf(str, "123.");
11738 sscanf(str, "%lf", &f); /* f = 123.; */
11739 along = dummy_long((unsigned long)f);
11740 aint = dummy_int((unsigned int)f);
11741 ashort = dummy_short((unsigned short)f);
11742 if (along != (unsigned long)123)
11744 if (aint != (unsigned int)123)
11746 if (ashort != (unsigned short)123)
11753 if eval $compile_ok; then
11754 $run ./try 2>/dev/null
11757 echo "(I can't seem to compile the test program--assuming it can't)"
11760 case "$castflags" in
11762 echo "Yup, it can."
11765 echo "Nope, it can't."
11772 : see if cbrt exists
11776 : see if chown exists
11780 : see if chroot exists
11781 set chroot d_chroot
11784 : see if chsize exists
11785 set chsize d_chsize
11788 : see if class exists
11792 : see if clearenv exists
11793 set clearenv d_clearenv
11796 : Define hasstruct macro for Configure internal use
11797 hasstruct='varname=$1; struct=$2; shift; shift;
11798 while $test $# -ge 2; do
11800 $define) echo "#include <$2>";;
11804 echo "int main () { struct $struct foo; }" >> try.c;
11806 if eval $compile; then
11815 : see whether socket exists
11819 $echo $n "Hmm... $c" >&4
11820 if set socket val -f d_socket; eval $csym; $val; then
11821 echo "Looks like you have Berkeley networking support." >&4
11823 if set setsockopt val -f; eval $csym; $val; then
11826 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11827 d_oldsock="$define"
11830 if $contains socklib libc.list >/dev/null 2>&1; then
11831 echo "Looks like you have Berkeley networking support." >&4
11833 : we will have to assume that it supports the 4.2 BSD interface
11836 echo "You don't have Berkeley networking in libc$_a..." >&4
11837 if test "X$d_socket" = "X$define"; then
11838 echo "...but you seem to believe that you have sockets." >&4
11840 for net in net socket
11842 if test -f $sysroot/usr/lib/lib$net$_a; then
11843 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11844 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11845 if $contains socket libc.list >/dev/null 2>&1; then
11850 echo "...but the Wollongong group seems to have hacked it in." >&4
11851 sockethdr="-I$sysroot/usr/netinclude"
11854 echo "Found Berkeley sockets interface in lib$net." >&4
11855 if $contains setsockopt libc.list >/dev/null 2>&1; then
11858 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11859 d_oldsock="$define"
11865 if test "X$d_socket" != "X$define"; then
11866 echo "or anywhere else I see." >&4
11874 : see if socketpair exists
11875 set socketpair d_sockpair
11880 echo "Checking the availability sa_len in the sock struct ..." >&4
11882 #include <sys/types.h>
11883 #include <sys/socket.h>
11885 struct sockaddr sa;
11886 return (sa.sa_len);
11890 set try; if eval $compile; then
11893 set d_sockaddr_sa_len; eval $setvar
11897 echo "Checking the availability struct sockaddr_in6 ..." >&4
11899 #include <sys/types.h>
11900 #include <sys/socket.h>
11901 #include <netinet/in.h>
11903 struct sockaddr_in6 sin6;
11904 return (sin6.sin6_family);
11908 set try; if eval $compile; then
11911 set d_sockaddr_in6; eval $setvar
11915 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11917 #include <sys/types.h>
11918 #include <sys/socket.h>
11919 #include <netinet/in.h>
11921 struct sockaddr_in6 sin6;
11922 return (sin6.sin6_scope_id);
11926 set try; if eval $compile; then
11929 set d_sin6_scope_id; eval $setvar
11933 echo "Checking the availability struct ip_mreq ..." >&4
11935 #include <sys/types.h>
11936 #include <sys/socket.h>
11937 #include <netinet/in.h>
11939 struct ip_mreq mreq;
11940 return (mreq.imr_multiaddr.s_addr);
11944 set try; if eval $compile; then
11947 set d_ip_mreq; eval $setvar
11951 echo "Checking the availability struct ip_mreq_source ..." >&4
11953 #include <sys/types.h>
11954 #include <sys/socket.h>
11955 #include <netinet/in.h>
11957 struct ip_mreq_source mreq;
11958 return (mreq.imr_multiaddr.s_addr);
11962 set try; if eval $compile; then
11965 set d_ip_mreq_source; eval $setvar
11969 echo "Checking the availability struct ipv6_mreq ..." >&4
11971 #include <sys/types.h>
11972 #include <sys/socket.h>
11973 #include <netinet/in.h>
11975 struct ipv6_mreq mreq;
11976 return (mreq.ipv6mr_interface);
11980 set try; if eval $compile; then
11983 set d_ipv6_mreq; eval $setvar
11987 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11989 #include <sys/types.h>
11990 #include <sys/socket.h>
11991 #include <netinet/in.h>
11993 struct ipv6_mreq_source mreq;
11994 return (mreq.imr_multiaddr.s_addr);
11998 set try; if eval $compile; then
12001 set d_ipv6_mreq_source; eval $setvar
12005 echo "Checking the availability of certain socket constants..." >&4
12006 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12007 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12009 #include <sys/types.h>
12010 #include <sys/socket.h>
12016 set try; if eval $compile; then
12019 set d_${enum}; eval $setvar
12023 : see if this is a sys/uio.h system
12024 set sys/uio.h i_sysuio
12027 : Check for cmsghdr support
12029 echo "Checking to see if your system supports struct cmsghdr..." >&4
12030 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12032 case "$d_cmsghdr_s" in
12033 "$define") echo "Yes, it does." ;;
12034 *) echo "No, it doesn't." ;;
12038 : check for const keyword
12040 echo 'Checking to see if your C compiler knows about "const"...' >&4
12041 $cat >const.c <<'EOCP'
12042 typedef struct spug { int drokk; } spug;
12046 const spug y = { 0 };
12049 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12051 echo "Yup, it does."
12054 echo "Nope, it doesn't."
12059 : see if copysign exists
12060 set copysign d_copysign
12063 : see if copysignl exists
12064 set copysignl d_copysignl
12067 : see if crypt exists
12072 $define) cryptlib='' ;;
12073 *) if set crypt val -f d_crypt; eval $csym; $val; then
12074 echo 'crypt() found.' >&4
12078 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12079 if $test -z "$cryptlib"; then
12080 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12084 if $test -z "$cryptlib"; then
12085 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12089 if $test -z "$cryptlib"; then
12090 cryptlib=`./loc libcrypt$_a "" $libpth`
12094 if $test -z "$cryptlib"; then
12095 echo 'crypt() NOT found.' >&4
12106 : see if this is a crypt.h system
12107 set crypt.h i_crypt
12110 : see if crypt_r exists
12111 set crypt_r d_crypt_r
12113 case "$d_crypt_r" in
12115 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12116 case "$d_crypt_r_proto:$usethreads" in
12117 ":define") d_crypt_r_proto=define
12118 set d_crypt_r_proto crypt_r $hdrs
12122 case "$d_crypt_r_proto" in
12124 case "$crypt_r_proto" in
12125 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12126 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12128 case "$crypt_r_proto" in
12129 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12130 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12132 case "$crypt_r_proto" in
12133 ''|0) d_crypt_r=undef
12135 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12136 * ) case "$crypt_r_proto" in
12137 REENTRANT_PROTO*) ;;
12138 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12140 echo "Prototype: $try" ;;
12143 *) case "$usethreads" in
12144 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12155 : get csh whereabouts
12157 'csh') val="$undef" ;;
12158 *) val="$define" ;;
12162 : Respect a hint or command line value for full_csh.
12163 case "$full_csh" in
12164 '') full_csh=$csh ;;
12167 : see if ctermid exists
12168 set ctermid d_ctermid
12171 : see if ctermid_r exists
12172 set ctermid_r d_ctermid_r
12174 case "$d_ctermid_r" in
12176 hdrs="$i_systypes sys/types.h define stdio.h "
12177 case "$d_ctermid_r_proto:$usethreads" in
12178 ":define") d_ctermid_r_proto=define
12179 set d_ctermid_r_proto ctermid_r $hdrs
12183 case "$d_ctermid_r_proto" in
12185 case "$ctermid_r_proto" in
12186 ''|0) try='char* ctermid_r(char*);'
12187 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12189 case "$ctermid_r_proto" in
12190 ''|0) d_ctermid_r=undef
12192 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12193 * ) case "$ctermid_r_proto" in
12194 REENTRANT_PROTO*) ;;
12195 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12197 echo "Prototype: $try" ;;
12200 *) case "$usethreads" in
12201 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12208 *) ctermid_r_proto=0
12212 : see if ctime_r exists
12213 set ctime_r d_ctime_r
12215 case "$d_ctime_r" in
12217 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12218 case "$d_ctime_r_proto:$usethreads" in
12219 ":define") d_ctime_r_proto=define
12220 set d_ctime_r_proto ctime_r $hdrs
12224 case "$d_ctime_r_proto" in
12226 case "$ctime_r_proto" in
12227 ''|0) try='char* ctime_r(const time_t*, char*);'
12228 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12230 case "$ctime_r_proto" in
12231 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12232 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12234 case "$ctime_r_proto" in
12235 ''|0) try='int ctime_r(const time_t*, char*);'
12236 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12238 case "$ctime_r_proto" in
12239 ''|0) try='int ctime_r(const time_t*, char*, int);'
12240 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12242 case "$ctime_r_proto" in
12243 ''|0) d_ctime_r=undef
12245 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12246 * ) case "$ctime_r_proto" in
12247 REENTRANT_PROTO*) ;;
12248 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12250 echo "Prototype: $try" ;;
12253 *) case "$usethreads" in
12254 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12265 : see if cuserid exists
12266 set cuserid d_cuserid
12269 : see if dbm.h is available
12270 : see if dbmclose exists
12271 set dbmclose d_dbmclose
12274 case "$d_dbmclose" in
12284 *) set rpcsvc/dbm.h i_rpcsvcdbm
12289 *) echo "We won't be including <dbm.h>"
12299 : see if prototype for dbminit is available
12301 set d_dbminitproto dbminit $i_dbm dbm.h
12304 : see if difftime exists
12305 set difftime d_difftime
12308 : see if this is a dirent system
12310 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12312 echo "<dirent.h> found." >&4
12315 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12316 echo "<sys/dir.h> found." >&4
12319 xinc=`./findhdr sys/ndir.h`
12321 echo "<dirent.h> NOT found." >&4
12326 : Look for type of directory structure.
12328 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12330 case "$direntrytype" in
12332 case "$i_dirent" in
12333 $define) guess1='struct dirent' ;;
12334 *) guess1='struct direct' ;;
12337 *) guess1="$direntrytype"
12342 'struct dirent') guess2='struct direct' ;;
12343 *) guess2='struct dirent' ;;
12346 if $contains "$guess1" try.c >/dev/null 2>&1; then
12347 direntrytype="$guess1"
12348 echo "Your directory entries are $direntrytype." >&4
12349 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12350 direntrytype="$guess2"
12351 echo "Your directory entries seem to be $direntrytype." >&4
12353 echo "I don't recognize your system's directory entries." >&4
12354 rp="What type is used for directory entries on this system?"
12357 direntrytype="$ans"
12361 : see if the directory entry stores field length
12363 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12364 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12365 echo "Good, your directory entry keeps length information in d_namlen." >&4
12368 echo "Your directory entry does not know about the d_namlen field." >&4
12375 : Look for DIR.dd_fd
12376 case "$i_dirent" in
12378 echo "Checking to see if DIR has a dd_fd member variable" >&4
12380 #$i_stdlib I_STDLIB
12382 #include <stdlib.h>
12384 #include <dirent.h>
12394 if eval $compile; then
12395 echo "Yes, it does."
12398 echo "No, it does not."
12403 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12411 : see if this is an sysdir system
12412 set sys/dir.h i_sysdir
12415 : see if this is an sysndir system
12416 set sys/ndir.h i_sysndir
12421 $cat >dirfd.c <<EOM
12423 #$i_stdlib I_STDLIB
12425 #include <stdlib.h>
12427 #$i_dirent I_DIRENT /**/
12428 #$i_sysdir I_SYS_DIR /**/
12429 #$i_sysndir I_SYS_NDIR /**/
12430 #$i_systypes I_SYS_TYPES /**/
12431 #if defined(I_SYS_TYPES)
12432 #include <sys/types.h>
12434 #if defined(I_DIRENT)
12435 #include <dirent.h>
12438 #include <sys/ndir.h>
12441 #include <sys/dir.h>
12446 DIR *dirp = opendir(".");
12447 if (dirfd(dirp) >= 0)
12455 if eval $compile; then
12459 $define) echo "dirfd() found." >&4 ;;
12460 *) echo "dirfd() NOT found." >&4 ;;
12466 : see if dladdr exists
12467 set dladdr d_dladdr
12470 : see if dlerror exists
12473 set dlerror d_dlerror
12477 : see if dlfcn is available
12478 set dlfcn.h i_dlfcn
12481 : Check what extension to use for shared libs
12486 On a few systems, the dynamically loaded modules that perl generates and uses
12487 will need a different extension than shared libs. The default will probably
12493 *) dflt="$dlext" ;;
12495 rp='What is the extension of dynamically loaded modules'
12504 : Check if dlsym need a leading underscore
12510 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12511 $cat >dyna.c <<'EOM'
12518 #$i_stdlib I_STDLIB
12520 #include <stdlib.h>
12524 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12526 #include <sys/types.h>
12531 extern int fred() ;
12540 int mode = RTLD_LAZY ;
12542 handle = dlopen("./dyna.$dlext", mode) ;
12543 if (handle == NULL) {
12548 symbol = dlsym(handle, "fred") ;
12549 if (symbol == NULL) {
12550 /* try putting a leading underscore */
12551 symbol = dlsym(handle, "_fred") ;
12552 if (symbol == NULL) {
12565 : Call the object file tmp-dyna.o in case dlext=o.
12566 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12567 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12568 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12569 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12572 1) echo "Test program failed using dlopen." >&4
12573 echo "Perhaps you should not use dynamic loading." >&4;;
12574 2) echo "Test program failed using dlsym." >&4
12575 echo "Perhaps you should not use dynamic loading." >&4;;
12576 3) echo "dlsym needs a leading underscore" >&4
12578 4) echo "dlsym doesn't need a leading underscore." >&4;;
12581 echo "I can't compile and run the test program." >&4
12582 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12587 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12592 : see if drand48_r exists
12593 set drand48_r d_drand48_r
12595 case "$d_drand48_r" in
12597 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12598 case "$d_drand48_r_proto:$usethreads" in
12599 ":define") d_drand48_r_proto=define
12600 set d_drand48_r_proto drand48_r $hdrs
12604 case "$d_drand48_r_proto" in
12606 case "$drand48_r_proto" in
12607 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12608 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12610 case "$drand48_r_proto" in
12611 ''|0) d_drand48_r=undef
12613 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12614 * ) case "$drand48_r_proto" in
12615 REENTRANT_PROTO*) ;;
12616 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12618 echo "Prototype: $try" ;;
12621 *) case "$usethreads" in
12622 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12629 *) drand48_r_proto=0
12633 : see if prototype for drand48 is available
12635 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12638 : see if dup2 exists
12642 : see if eaccess exists
12643 set eaccess d_eaccess
12646 : see if endgrent exists
12647 set endgrent d_endgrent
12650 : see if this is an grp system
12656 xxx=`./findhdr grp.h`
12657 $cppstdin $cppflags $cppminus < $xxx >$$.h
12659 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12671 set d_grpasswd; eval $setvar
12675 : see if endgrent_r exists
12676 set endgrent_r d_endgrent_r
12678 case "$d_endgrent_r" in
12680 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12681 case "$d_endgrent_r_proto:$usethreads" in
12682 ":define") d_endgrent_r_proto=define
12683 set d_endgrent_r_proto endgrent_r $hdrs
12687 case "$d_endgrent_r_proto" in
12689 case "$endgrent_r_proto" in
12690 ''|0) try='int endgrent_r(FILE**);'
12691 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12693 case "$endgrent_r_proto" in
12694 ''|0) try='void endgrent_r(FILE**);'
12695 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12697 case "$endgrent_r_proto" in
12698 ''|0) d_endgrent_r=undef
12700 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12701 * ) case "$endgrent_r_proto" in
12702 REENTRANT_PROTO*) ;;
12703 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12705 echo "Prototype: $try" ;;
12708 *) case "$usethreads" in
12709 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12716 *) endgrent_r_proto=0
12720 : see if endhostent exists
12721 set endhostent d_endhent
12724 : see if this is a netdb.h system
12725 set netdb.h i_netdb
12728 : see if endhostent_r exists
12729 set endhostent_r d_endhostent_r
12731 case "$d_endhostent_r" in
12733 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12734 case "$d_endhostent_r_proto:$usethreads" in
12735 ":define") d_endhostent_r_proto=define
12736 set d_endhostent_r_proto endhostent_r $hdrs
12740 case "$d_endhostent_r_proto" in
12742 case "$endhostent_r_proto" in
12743 ''|0) try='int endhostent_r(struct hostent_data*);'
12744 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12746 case "$endhostent_r_proto" in
12747 ''|0) try='void endhostent_r(struct hostent_data*);'
12748 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12750 case "$endhostent_r_proto" in
12751 ''|0) d_endhostent_r=undef
12752 endhostent_r_proto=0
12753 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12754 * ) case "$endhostent_r_proto" in
12755 REENTRANT_PROTO*) ;;
12756 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12758 echo "Prototype: $try" ;;
12761 *) case "$usethreads" in
12762 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12764 d_endhostent_r=undef
12765 endhostent_r_proto=0
12769 *) endhostent_r_proto=0
12773 : see if endnetent exists
12774 set endnetent d_endnent
12777 : see if endnetent_r exists
12778 set endnetent_r d_endnetent_r
12780 case "$d_endnetent_r" in
12782 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12783 case "$d_endnetent_r_proto:$usethreads" in
12784 ":define") d_endnetent_r_proto=define
12785 set d_endnetent_r_proto endnetent_r $hdrs
12789 case "$d_endnetent_r_proto" in
12791 case "$endnetent_r_proto" in
12792 ''|0) try='int endnetent_r(struct netent_data*);'
12793 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12795 case "$endnetent_r_proto" in
12796 ''|0) try='void endnetent_r(struct netent_data*);'
12797 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12799 case "$endnetent_r_proto" in
12800 ''|0) d_endnetent_r=undef
12801 endnetent_r_proto=0
12802 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12803 * ) case "$endnetent_r_proto" in
12804 REENTRANT_PROTO*) ;;
12805 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12807 echo "Prototype: $try" ;;
12810 *) case "$usethreads" in
12811 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12813 d_endnetent_r=undef
12814 endnetent_r_proto=0
12818 *) endnetent_r_proto=0
12822 : see if endprotoent exists
12823 set endprotoent d_endpent
12826 : see if endprotoent_r exists
12827 set endprotoent_r d_endprotoent_r
12829 case "$d_endprotoent_r" in
12831 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12832 case "$d_endprotoent_r_proto:$usethreads" in
12833 ":define") d_endprotoent_r_proto=define
12834 set d_endprotoent_r_proto endprotoent_r $hdrs
12838 case "$d_endprotoent_r_proto" in
12840 case "$endprotoent_r_proto" in
12841 ''|0) try='int endprotoent_r(struct protoent_data*);'
12842 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12844 case "$endprotoent_r_proto" in
12845 ''|0) try='void endprotoent_r(struct protoent_data*);'
12846 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12848 case "$endprotoent_r_proto" in
12849 ''|0) d_endprotoent_r=undef
12850 endprotoent_r_proto=0
12851 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12852 * ) case "$endprotoent_r_proto" in
12853 REENTRANT_PROTO*) ;;
12854 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12856 echo "Prototype: $try" ;;
12859 *) case "$usethreads" in
12860 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12862 d_endprotoent_r=undef
12863 endprotoent_r_proto=0
12867 *) endprotoent_r_proto=0
12871 : see if endpwent exists
12872 set endpwent d_endpwent
12875 : see if this is a pwd.h system
12881 xxx=`./findhdr pwd.h`
12882 $cppstdin $cppflags $cppminus < $xxx >$$.h
12884 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12892 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12900 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12908 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12916 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12924 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12932 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12940 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12952 set d_pwquota; eval $setvar
12953 set d_pwage; eval $setvar
12954 set d_pwchange; eval $setvar
12955 set d_pwclass; eval $setvar
12956 set d_pwexpire; eval $setvar
12957 set d_pwcomment; eval $setvar
12958 set d_pwgecos; eval $setvar
12959 set d_pwpasswd; eval $setvar
12963 : see if endpwent_r exists
12964 set endpwent_r d_endpwent_r
12966 case "$d_endpwent_r" in
12968 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12969 case "$d_endpwent_r_proto:$usethreads" in
12970 ":define") d_endpwent_r_proto=define
12971 set d_endpwent_r_proto endpwent_r $hdrs
12975 case "$d_endpwent_r_proto" in
12977 case "$endpwent_r_proto" in
12978 ''|0) try='int endpwent_r(FILE**);'
12979 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12981 case "$endpwent_r_proto" in
12982 ''|0) try='void endpwent_r(FILE**);'
12983 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12985 case "$endpwent_r_proto" in
12986 ''|0) d_endpwent_r=undef
12988 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12989 * ) case "$endpwent_r_proto" in
12990 REENTRANT_PROTO*) ;;
12991 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12993 echo "Prototype: $try" ;;
12996 *) case "$usethreads" in
12997 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13004 *) endpwent_r_proto=0
13008 : see if endservent exists
13009 set endservent d_endsent
13012 : see if endservent_r exists
13013 set endservent_r d_endservent_r
13015 case "$d_endservent_r" in
13017 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13018 case "$d_endservent_r_proto:$usethreads" in
13019 ":define") d_endservent_r_proto=define
13020 set d_endservent_r_proto endservent_r $hdrs
13024 case "$d_endservent_r_proto" in
13026 case "$endservent_r_proto" in
13027 ''|0) try='int endservent_r(struct servent_data*);'
13028 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13030 case "$endservent_r_proto" in
13031 ''|0) try='void endservent_r(struct servent_data*);'
13032 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13034 case "$endservent_r_proto" in
13035 ''|0) d_endservent_r=undef
13036 endservent_r_proto=0
13037 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13038 * ) case "$endservent_r_proto" in
13039 REENTRANT_PROTO*) ;;
13040 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13042 echo "Prototype: $try" ;;
13045 *) case "$usethreads" in
13046 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13048 d_endservent_r=undef
13049 endservent_r_proto=0
13053 *) endservent_r_proto=0
13057 : Locate the flags for 'open()'
13060 #include <sys/types.h>
13065 #include <sys/file.h>
13067 #$i_stdlib I_STDLIB
13069 #include <stdlib.h>
13080 : check sys/file.h first to get FREAD on Sun
13081 if $test `./findhdr sys/file.h` && \
13082 set try -DI_SYS_FILE && eval $compile; then
13084 echo "<sys/file.h> defines the O_* constants..." >&4
13085 if $run ./try; then
13086 echo "and you have the 3 argument form of open()." >&4
13089 echo "but not the 3 argument form of open(). Oh, well." >&4
13092 elif $test `./findhdr fcntl.h` && \
13093 set try -DI_FCNTL && eval $compile; then
13095 echo "<fcntl.h> defines the O_* constants..." >&4
13096 if $run ./try; then
13097 echo "and you have the 3 argument form of open()." >&4
13100 echo "but not the 3 argument form of open(). Oh, well." >&4
13105 echo "I can't find the O_* constant definitions! You got problems." >&4
13111 : see if this is a sys/file.h system
13116 : do we need to include sys/file.h ?
13120 if $h_sysfile; then
13122 echo "We'll be including <sys/file.h>." >&4
13125 echo "We won't be including <sys/file.h>." >&4
13135 : see if fcntl.h is there
13140 : see if we can include fcntl.h
13146 echo "We'll be including <fcntl.h>." >&4
13149 if $h_sysfile; then
13150 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13152 echo "We won't be including <fcntl.h>." >&4
13164 : see if fork exists
13168 : see if pipe exists
13172 : check for non-blocking I/O stuff
13173 case "$h_sysfile" in
13174 true) echo "#include <sys/file.h>" > head.c;;
13177 true) echo "#include <fcntl.h>" > head.c;;
13178 *) echo "#include <sys/fcntl.h>" > head.c;;
13183 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13184 case "$o_nonblock" in
13186 $cat head.c > try.c
13187 $cat >>try.c <<EOCP
13189 #$i_stdlib I_STDLIB
13191 #include <stdlib.h>
13199 printf("O_NONBLOCK\n");
13203 printf("O_NDELAY\n");
13207 printf("FNDELAY\n");
13214 if eval $compile_ok; then
13215 o_nonblock=`$run ./try`
13216 case "$o_nonblock" in
13217 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13218 *) echo "Seems like we can use $o_nonblock.";;
13221 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13224 *) echo "Using $hint value $o_nonblock.";;
13229 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13232 case "$d_fork:$d_pipe:$d_alarm" in
13233 define:define:define)
13234 $cat head.c > try.c
13235 $cat >>try.c <<EOCP
13237 #include <sys/types.h>
13238 #include <signal.h>
13240 #$i_stdlib I_STDLIB
13242 #include <stdlib.h>
13248 #define MY_O_NONBLOCK $o_nonblock
13249 #ifndef errno /* XXX need better Configure test */
13252 #$i_unistd I_UNISTD
13254 #include <unistd.h>
13256 #include <string.h>
13257 $signal_t blech(int x) { exit(3); }
13259 $cat >> try.c <<'EOCP'
13268 ret = pipe(pd); /* Down: child -> parent */
13271 ret = pipe(pu); /* Up: parent -> child */
13275 close(pd[1]); /* Parent reads from pd[0] */
13276 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13278 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13283 signal(SIGALRM, blech);
13285 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13287 sprintf(string, "%d\n", ret);
13288 ret = write(2, string, strlen(string));
13289 if (ret != strlen(string))
13293 if (errno == EAGAIN) {
13294 printf("EAGAIN\n");
13299 if (errno == EWOULDBLOCK)
13300 printf("EWOULDBLOCK\n");
13303 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13306 sleep(2); /* Give it time to close our pipe */
13308 ret = read(pd[0], buf, 1); /* Should read EOF */
13310 sprintf(string, "%d\n", ret);
13311 ret = write(4, string, strlen(string));
13312 if (ret != strlen(string))
13317 close(pd[0]); /* We write to pd[1] */
13318 close(pu[1]); /* We read from pu[0] */
13319 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13322 close(pd[1]); /* Pipe pd is now fully closed! */
13323 exit(0); /* Bye bye, thank you for playing! */
13327 if eval $compile_ok; then
13328 echo "$startsh" >mtry
13329 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13331 $run ./mtry >/dev/null 2>&1
13333 0) eagain=`$cat try.out`;;
13334 1) echo "Could not perform non-blocking setting!";;
13335 2) echo "I did a successful read() for something that was not there!";;
13336 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13337 4) echo "Could not find F_SETFL!";;
13338 *) echo "Something terribly wrong happened during testing.";;
13340 rd_nodata=`$cat try.ret`
13341 echo "A read() system call with no data present returns $rd_nodata."
13342 case "$rd_nodata" in
13345 echo "(That's peculiar, fixing that to be -1.)"
13351 echo "Forcing errno EAGAIN on read() with no data available."
13355 echo "Your read() sets errno to $eagain when no data is available."
13358 status=`$cat try.err`
13360 0) echo "And it correctly returns 0 to signal EOF.";;
13361 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13362 *) echo "However, your read() returns '$status' on EOF??";;
13365 if test "$status" = "$rd_nodata"; then
13366 echo "WARNING: you can't distinguish between EOF and no data!"
13370 echo "I can't compile the test program--assuming errno EAGAIN will do."
13374 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13383 echo "Using $hint value $eagain."
13384 echo "Your read() returns $rd_nodata when no data is present."
13385 case "$d_eofnblk" in
13386 "$define") echo "And you can see EOF because read() returns 0.";;
13387 "$undef") echo "But you can't see EOF status from read() returned value.";;
13389 echo "(Assuming you can't see EOF status from read anyway.)"
13395 $rm_try head.c mtry
13397 : see if erf exists
13401 : see if erfc exists
13405 : see if exp2 exists
13409 : see if expm1 exists
13413 : see if _ptr and _cnt from stdio act std
13416 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13417 echo "(Looks like you have stdio.h from BSD.)"
13418 case "$stdio_ptr" in
13419 '') stdio_ptr='((fp)->_p)'
13422 *) ptr_lval=$d_stdio_ptr_lval;;
13424 case "$stdio_cnt" in
13425 '') stdio_cnt='((fp)->_r)'
13428 *) cnt_lval=$d_stdio_cnt_lval;;
13430 case "$stdio_base" in
13431 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13433 case "$stdio_bufsiz" in
13434 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13436 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13437 echo "(Looks like you have stdio.h from Linux.)"
13438 case "$stdio_ptr" in
13439 '') stdio_ptr='((fp)->_IO_read_ptr)'
13442 *) ptr_lval=$d_stdio_ptr_lval;;
13444 case "$stdio_cnt" in
13445 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13448 *) cnt_lval=$d_stdio_cnt_lval;;
13450 case "$stdio_base" in
13451 '') stdio_base='((fp)->_IO_read_base)';;
13453 case "$stdio_bufsiz" in
13454 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13457 case "$stdio_ptr" in
13458 '') stdio_ptr='((fp)->_ptr)'
13461 *) ptr_lval=$d_stdio_ptr_lval;;
13463 case "$stdio_cnt" in
13464 '') stdio_cnt='((fp)->_cnt)'
13467 *) cnt_lval=$d_stdio_cnt_lval;;
13469 case "$stdio_base" in
13470 '') stdio_base='((fp)->_base)';;
13472 case "$stdio_bufsiz" in
13473 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13477 : test whether _ptr and _cnt really work
13478 echo "Checking how std your stdio is..." >&4
13481 #$i_stdlib I_STDLIB
13483 #include <stdlib.h>
13485 #define FILE_ptr(fp) $stdio_ptr
13486 #define FILE_cnt(fp) $stdio_cnt
13488 FILE *fp = fopen("try.c", "r");
13491 18 <= FILE_cnt(fp) &&
13492 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13500 if eval $compile && $to try.c; then
13501 if $run ./try; then
13502 echo "Your stdio acts pretty std."
13505 echo "Your stdio isn't very std."
13508 echo "Your stdio doesn't appear very std."
13512 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13513 # direct buffer manipulation no longer works. The Configure tests
13514 # should be changed to correctly detect this, but until then,
13515 # the following check should at least let perl compile and run.
13516 # (This quick fix should be updated before 5.8.1.)
13517 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13518 # A. Dougherty, June 3, 2002.
13519 case "$d_gnulibc" in
13521 case "$gnulibc_version" in
13525 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13534 : Can _ptr be used as an lvalue?
13535 case "$d_stdstdio$ptr_lval" in
13536 $define$define) val=$define ;;
13539 set d_stdio_ptr_lval
13542 : Can _cnt be used as an lvalue?
13543 case "$d_stdstdio$cnt_lval" in
13544 $define$define) val=$define ;;
13547 set d_stdio_cnt_lval
13551 : test whether setting _ptr sets _cnt as a side effect
13552 d_stdio_ptr_lval_sets_cnt="$undef"
13553 d_stdio_ptr_lval_nochange_cnt="$undef"
13554 case "$d_stdio_ptr_lval$d_stdstdio" in
13556 echo "Checking to see what happens if we set the stdio ptr..." >&4
13559 /* Can we scream? */
13560 /* Eat dust sed :-) */
13561 /* In the buffer space, no one can hear you scream. */
13562 #$i_stdlib I_STDLIB
13564 #include <stdlib.h>
13566 #define FILE_ptr(fp) $stdio_ptr
13567 #define FILE_cnt(fp) $stdio_cnt
13568 #include <sys/types.h>
13570 FILE *fp = fopen("try.c", "r");
13575 puts("Fail even to read");
13578 c = getc(fp); /* Read away the first # */
13580 puts("Fail even to read");
13584 18 <= FILE_cnt(fp) &&
13585 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13587 puts("Fail even to read");
13590 ptr = (char*) FILE_ptr(fp);
13591 cnt = (size_t)FILE_cnt(fp);
13593 FILE_ptr(fp) += 42;
13595 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13596 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13599 if (FILE_cnt(fp) <= 20) {
13600 printf ("Fail (<20 chars to test)");
13603 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13604 puts("Fail compare");
13607 if (cnt == FILE_cnt(fp)) {
13608 puts("Pass_unchanged");
13611 if (FILE_cnt(fp) == (cnt - 42)) {
13612 puts("Pass_changed");
13615 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13621 if eval $compile && $to try.c; then
13622 case `$run ./try` in
13624 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13625 d_stdio_ptr_lval_sets_cnt="$define" ;;
13627 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13628 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13630 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13632 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13635 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13641 : see if _base is also standard
13643 case "$d_stdstdio" in
13647 #$i_stdlib I_STDLIB
13649 #include <stdlib.h>
13651 #define FILE_base(fp) $stdio_base
13652 #define FILE_bufsiz(fp) $stdio_bufsiz
13654 FILE *fp = fopen("try.c", "r");
13657 19 <= FILE_bufsiz(fp) &&
13658 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13665 if eval $compile && $to try.c; then
13666 if $run ./try; then
13667 echo "And its _base field acts std."
13670 echo "But its _base field isn't std."
13673 echo "However, it seems to be lacking the _base field."
13681 : see if fast_stdio exists
13683 case "$d_stdstdio:$d_stdio_ptr_lval" in
13685 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13687 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13698 : see if fchdir exists
13699 set fchdir d_fchdir
13702 : see if fchmod exists
13703 set fchmod d_fchmod
13706 : check for openat, unlinkat, renameat, linkat, fchmodat
13707 set openat d_openat
13710 set unlinkat d_unlinkat
13713 set renameat d_renameat
13716 set linkat d_linkat
13719 set fchmodat d_fchmodat
13722 : see if fchown exists
13723 set fchown d_fchown
13726 : see if this is an fcntl system
13730 : See if fcntl-based locking works.
13733 #$i_stdlib I_STDLIB
13735 #include <stdlib.h>
13737 #include <unistd.h>
13739 #include <signal.h>
13740 $signal_t blech(int x) { exit(3); }
13742 #if defined(F_SETLK) && defined(F_SETLKW)
13743 struct flock flock;
13745 fd = open("try.c", O_RDONLY);
13746 flock.l_type = F_RDLCK;
13747 flock.l_whence = SEEK_SET;
13748 flock.l_start = flock.l_len = 0;
13749 signal(SIGALRM, blech);
13751 retval = fcntl(fd, F_SETLK, &flock);
13753 (retval < 0 ? exit(2) : exit(0));
13759 echo "Checking if fcntl-based file locking works... "
13763 if eval $compile_ok; then
13764 if $run ./try; then
13765 echo "Yes, it seems to work."
13768 echo "Nope, it didn't work."
13773 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13774 *** This is (almost) impossible.
13775 *** If your NFS lock daemons are not feeling well, something like
13776 *** this may happen, please investigate. Cannot continue, aborting.
13784 echo "I'm unable to compile the test program, so I'll assume not."
13789 echo "Nope, since you don't even have fcntl()."
13792 set d_fcntl_can_lock
13796 : check for fd_set items
13799 Checking to see how well your C compiler handles fd_set and friends ...
13802 #$i_stdlib I_STDLIB
13804 #include <stdlib.h>
13806 #$i_systime I_SYS_TIME
13807 #$i_sysselct I_SYS_SELECT
13808 #$d_socket HAS_SOCKET
13809 #include <sys/types.h>
13811 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13814 #include <sys/time.h>
13816 #ifdef I_SYS_SELECT
13817 #include <sys/select.h>
13826 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13834 if eval $compile; then
13835 d_fds_bits="$define"
13837 echo "Well, your system knows about the normal fd_set typedef..." >&4
13838 if $run ./try; then
13839 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13840 d_fd_macros="$define"
13843 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13845 d_fd_macros="$undef"
13849 Hmm, your compiler has some difficulty with fd_set. Checking further...
13852 if eval $compile; then
13853 d_fds_bits="$undef"
13855 echo "Well, your system has some sort of fd_set available..." >&4
13856 if $run ./try; then
13857 echo "and you have the normal fd_set macros." >&4
13858 d_fd_macros="$define"
13861 but not the normal fd_set macros! Gross! More work for me...
13863 d_fd_macros="$undef"
13866 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13868 d_fds_bits="$undef"
13869 d_fd_macros="$undef"
13874 : see if fdclose exists
13875 set fdclose d_fdclose
13878 : see if fdim exists
13882 : see if fegetround exists
13883 set fegetround d_fegetround
13886 : see if fgetpos exists
13887 set fgetpos d_fgetpos
13890 : see if finite exists
13891 set finite d_finite
13894 : see if finitel exists
13895 set finitel d_finitel
13898 : see if flock exists
13902 : see if prototype for flock is available
13904 set d_flockproto flock $i_sysfile sys/file.h
13907 : see if fma exists
13911 : see if fmax exists
13915 : see if fmin exists
13919 : see if fp_class exists
13920 set fp_class d_fp_class
13923 : check for fpclassify
13924 echo "Checking to see if you have fpclassify..." >&4
13927 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13930 if eval $compile; then
13932 echo "You have fpclassify."
13935 echo "You do not have fpclassify."
13941 : see if fp_classify exists
13942 set fp_classify d_fp_classify
13945 : see if fp_classl exists
13946 set fp_classl d_fp_classl
13949 : see if pathconf exists
13950 set pathconf d_pathconf
13953 : see if fpathconf exists
13954 set fpathconf d_fpathconf
13957 : see if fpclass exists
13958 set fpclass d_fpclass
13961 : see if fpclassl exists
13962 set fpclassl d_fpclassl
13965 : see if fpgetround exists
13966 set fpgetround d_fpgetround
13969 : check for fpos64_t
13971 echo "Checking to see if you have fpos64_t..." >&4
13974 int main() { fpos64_t x = 7; }
13977 if eval $compile; then
13979 echo "You have fpos64_t."
13982 echo "You do not have fpos64_t."
13983 case "$fpossize" in
13984 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13991 : see if this is an xlocale.h system
13992 set xlocale.h i_xlocale
13995 : see if newlocale exists
13996 set newlocale d_newlocale
13999 : see if freelocale exists
14000 set freelocale d_freelocale
14003 : see if uselocale exists
14004 set uselocale d_uselocale
14007 : see if duplocale exists
14008 set duplocale d_duplocale
14011 : see if querylocale exists
14012 set querylocale d_querylocale
14015 : see if frexpl exists
14016 set frexpl d_frexpl
14019 : see if this is a sys/param system
14020 set sys/param.h i_sysparam
14023 : see if this is a sys/mount.h system
14024 set sys/mount.h i_sysmount
14027 : Check for fs_data_s
14029 echo "Checking to see if your system supports struct fs_data..." >&4
14030 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14032 case "$d_fs_data_s" in
14033 "$define") echo "Yes, it does." ;;
14034 *) echo "No, it doesn't." ;;
14037 : see if fseeko exists
14038 set fseeko d_fseeko
14040 case "$longsize" in
14041 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14044 : see if fsetpos exists
14045 set fsetpos d_fsetpos
14048 : see if fstatfs exists
14049 set fstatfs d_fstatfs
14052 : see if statvfs exists
14053 set statvfs d_statvfs
14056 : see if fstatvfs exists
14057 set fstatvfs d_fstatvfs
14061 : see if fsync exists
14065 : see if ftello exists
14066 set ftello d_ftello
14068 case "$longsize" in
14069 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14072 : check for a working futimes
14075 echo "Checking if you have a working futimes()" >&4
14078 #include <sys/time.h>
14085 fd = open ("try.c", O_RDWR);
14086 if (-1 == fd) exit (1);
14087 rv = futimes (fd, NULL);
14088 exit (rv == -1 ? errno : 0);
14092 if eval $compile; then
14096 0) echo "Yes, you have" >&4
14097 d_futimes="$define"
14099 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14103 echo "No, it does not (probably harmless)" >&4
14107 : look for gai_strerror
14109 $cat >try.c <<'EOCP'
14110 #include <sys/types.h>
14111 #include <sys/socket.h>
14115 return (gai_strerror (0) ? 0 : 1);
14120 if eval $compile; then
14123 0) echo "A working gai_strerror() found." >&4
14125 *) echo "gai_strerror() found, but it doesn't work" >&4
14129 echo "gai_strerror() NOT found." >&4
14135 : see if ndbm.h is available
14138 : Compatibility location for RedHat 7.1
14139 set gdbm/ndbm.h i_gdbmndbm
14141 : Compatibility location for Debian 4.0
14142 set gdbm-ndbm.h i_gdbm_ndbm
14146 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14147 : see if dbm_open exists
14148 set dbm_open d_dbm_open
14150 case "$d_dbm_open" in
14153 i_gdbmndbm="$undef"
14154 i_gdbm_ndbm="$undef"
14155 echo "We won't be including <ndbm.h>"
14165 ndbm_hdr_protochk='name=$1; hdr=$2;
14166 eval "ihdr=\$""i_$name";
14168 if $test "$ihdr" = "$define"; then
14169 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14170 case "$d_cplusplus" in
14171 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14172 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14175 $define) $echo "Your <$hdr> seems to have prototypes";;
14176 *) $echo "Your <$hdr> does not seem to have prototypes";;
14179 set "d_${name}_h_uses_prototypes";
14183 eval $ndbm_hdr_protochk
14184 set gdbmndbm gdbm/ndbm.h
14185 eval $ndbm_hdr_protochk
14186 set gdbm_ndbm gdbm-ndbm.h
14187 eval $ndbm_hdr_protochk
14189 : see if getaddrinfo exists
14190 set getaddrinfo d_getaddrinfo
14193 : see if getcwd exists
14194 set getcwd d_getcwd
14197 : see if getespwnam exists
14198 set getespwnam d_getespwnam
14201 : see if getfsstat exists
14202 set getfsstat d_getfsstat
14205 : see if getgrent exists
14206 set getgrent d_getgrent
14209 : see if getgrent_r exists
14210 set getgrent_r d_getgrent_r
14212 case "$d_getgrent_r" in
14214 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14215 case "$d_getgrent_r_proto:$usethreads" in
14216 ":define") d_getgrent_r_proto=define
14217 set d_getgrent_r_proto getgrent_r $hdrs
14221 case "$d_getgrent_r_proto" in
14223 case "$getgrent_r_proto" in
14224 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14225 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14227 case "$getgrent_r_proto" in
14228 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14229 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14231 case "$getgrent_r_proto" in
14232 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14233 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14235 case "$getgrent_r_proto" in
14236 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14237 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14239 case "$getgrent_r_proto" in
14240 ''|0) try='int getgrent_r(struct group*, char*, int);'
14241 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14243 case "$getgrent_r_proto" in
14244 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14245 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14247 case "$getgrent_r_proto" in
14248 ''|0) d_getgrent_r=undef
14250 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14251 * ) case "$getgrent_r_proto" in
14252 REENTRANT_PROTO*) ;;
14253 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14255 echo "Prototype: $try" ;;
14258 *) case "$usethreads" in
14259 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14266 *) getgrent_r_proto=0
14270 : see if getgrgid_r exists
14271 set getgrgid_r d_getgrgid_r
14273 case "$d_getgrgid_r" in
14275 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14276 case "$d_getgrgid_r_proto:$usethreads" in
14277 ":define") d_getgrgid_r_proto=define
14278 set d_getgrgid_r_proto getgrgid_r $hdrs
14282 case "$d_getgrgid_r_proto" in
14284 case "$getgrgid_r_proto" in
14285 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14286 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14288 case "$getgrgid_r_proto" in
14289 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14290 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14292 case "$getgrgid_r_proto" in
14293 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14294 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14296 case "$getgrgid_r_proto" in
14297 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14298 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14300 case "$getgrgid_r_proto" in
14301 ''|0) d_getgrgid_r=undef
14303 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14304 * ) case "$getgrgid_r_proto" in
14305 REENTRANT_PROTO*) ;;
14306 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14308 echo "Prototype: $try" ;;
14311 *) case "$usethreads" in
14312 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14319 *) getgrgid_r_proto=0
14323 : see if getgrnam_r exists
14324 set getgrnam_r d_getgrnam_r
14326 case "$d_getgrnam_r" in
14328 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14329 case "$d_getgrnam_r_proto:$usethreads" in
14330 ":define") d_getgrnam_r_proto=define
14331 set d_getgrnam_r_proto getgrnam_r $hdrs
14335 case "$d_getgrnam_r_proto" in
14337 case "$getgrnam_r_proto" in
14338 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14339 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14341 case "$getgrnam_r_proto" in
14342 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14343 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14345 case "$getgrnam_r_proto" in
14346 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14347 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14349 case "$getgrnam_r_proto" in
14350 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14351 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14353 case "$getgrnam_r_proto" in
14354 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14355 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14357 case "$getgrnam_r_proto" in
14358 ''|0) d_getgrnam_r=undef
14360 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14361 * ) case "$getgrnam_r_proto" in
14362 REENTRANT_PROTO*) ;;
14363 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14365 echo "Prototype: $try" ;;
14368 *) case "$usethreads" in
14369 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14376 *) getgrnam_r_proto=0
14380 : see if gethostbyaddr exists
14381 set gethostbyaddr d_gethbyaddr
14384 : see if gethostbyname exists
14385 set gethostbyname d_gethbyname
14388 : see if gethostent exists
14389 set gethostent d_gethent
14392 : see how we will look up host name
14395 if set gethostname val -f d_gethname; eval $csym; $val; then
14396 echo 'gethostname() found.' >&4
14397 d_gethname="$define"
14400 if set uname val -f d_uname; eval $csym; $val; then
14403 uname() was found, but you're running xenix, and older versions of xenix
14404 have a broken uname(). If you don't really know whether your xenix is old
14405 enough to have a broken system call, use the default answer.
14410 "$define") dflt=n;;
14412 rp='Is your uname() broken?'
14415 n*) d_uname="$define"; call=uname;;
14418 echo 'uname() found.' >&4
14425 case "$d_gethname" in
14426 '') d_gethname="$undef";;
14429 '') d_uname="$undef";;
14431 case "$d_uname$d_gethname" in
14436 Every now and then someone has a $call() that lies about the hostname
14437 but can't be fixed for political or economic reasons. If you wish, I can
14438 pretend $call() isn't there and maybe compute hostname at run-time
14439 thanks to the '$phostname' command.
14442 rp="Shall I ignore $call() from now on?"
14445 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14448 case "$phostname" in
14449 '') aphostname='';;
14450 *) case "$aphostname" in
14452 *) set X $phostname
14456 file=`./loc $file $file $pth`
14457 aphostname=`echo $file $*`
14462 case "$d_uname$d_gethname" in
14465 case "$phostname" in
14467 echo "There will be no way for $package to get your hostname." >&4;;
14469 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14473 case "$d_phostname" in
14474 '') d_phostname="$undef";;
14477 : see if gethostbyaddr_r exists
14478 set gethostbyaddr_r d_gethostbyaddr_r
14480 case "$d_gethostbyaddr_r" in
14482 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14483 case "$d_gethostbyaddr_r_proto:$usethreads" in
14484 ":define") d_gethostbyaddr_r_proto=define
14485 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14489 case "$d_gethostbyaddr_r_proto" in
14491 case "$gethostbyaddr_r_proto" in
14492 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14493 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14495 case "$gethostbyaddr_r_proto" in
14496 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14497 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14499 case "$gethostbyaddr_r_proto" in
14500 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14501 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14503 case "$gethostbyaddr_r_proto" in
14504 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14505 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14507 case "$gethostbyaddr_r_proto" in
14508 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14509 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14511 case "$gethostbyaddr_r_proto" in
14512 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14513 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14515 case "$gethostbyaddr_r_proto" in
14516 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14517 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14519 case "$gethostbyaddr_r_proto" in
14520 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14521 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14523 case "$gethostbyaddr_r_proto" in
14524 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14525 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14527 case "$gethostbyaddr_r_proto" in
14528 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14529 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14531 case "$gethostbyaddr_r_proto" in
14532 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14533 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14535 case "$gethostbyaddr_r_proto" in
14536 ''|0) d_gethostbyaddr_r=undef
14537 gethostbyaddr_r_proto=0
14538 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14539 * ) case "$gethostbyaddr_r_proto" in
14540 REENTRANT_PROTO*) ;;
14541 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14543 echo "Prototype: $try" ;;
14546 *) case "$usethreads" in
14547 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14549 d_gethostbyaddr_r=undef
14550 gethostbyaddr_r_proto=0
14554 *) gethostbyaddr_r_proto=0
14558 : see if gethostbyname_r exists
14559 set gethostbyname_r d_gethostbyname_r
14561 case "$d_gethostbyname_r" in
14563 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14564 case "$d_gethostbyname_r_proto:$usethreads" in
14565 ":define") d_gethostbyname_r_proto=define
14566 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14570 case "$d_gethostbyname_r_proto" in
14572 case "$gethostbyname_r_proto" in
14573 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14574 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14576 case "$gethostbyname_r_proto" in
14577 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14578 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14580 case "$gethostbyname_r_proto" in
14581 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14582 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14584 case "$gethostbyname_r_proto" in
14585 ''|0) d_gethostbyname_r=undef
14586 gethostbyname_r_proto=0
14587 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14588 * ) case "$gethostbyname_r_proto" in
14589 REENTRANT_PROTO*) ;;
14590 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14592 echo "Prototype: $try" ;;
14595 *) case "$usethreads" in
14596 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14598 d_gethostbyname_r=undef
14599 gethostbyname_r_proto=0
14603 *) gethostbyname_r_proto=0
14607 : see if gethostent_r exists
14608 set gethostent_r d_gethostent_r
14610 case "$d_gethostent_r" in
14612 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14613 case "$d_gethostent_r_proto:$usethreads" in
14614 ":define") d_gethostent_r_proto=define
14615 set d_gethostent_r_proto gethostent_r $hdrs
14619 case "$d_gethostent_r_proto" in
14621 case "$gethostent_r_proto" in
14622 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14623 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14625 case "$gethostent_r_proto" in
14626 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14627 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14629 case "$gethostent_r_proto" in
14630 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14631 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14633 case "$gethostent_r_proto" in
14634 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14635 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14637 case "$gethostent_r_proto" in
14638 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14639 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14641 case "$gethostent_r_proto" in
14642 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14643 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14645 case "$gethostent_r_proto" in
14646 ''|0) d_gethostent_r=undef
14647 gethostent_r_proto=0
14648 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14649 * ) case "$gethostent_r_proto" in
14650 REENTRANT_PROTO*) ;;
14651 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14653 echo "Prototype: $try" ;;
14656 *) case "$usethreads" in
14657 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14659 d_gethostent_r=undef
14660 gethostent_r_proto=0
14664 *) gethostent_r_proto=0
14668 : see if prototypes for various gethostxxx netdb.h functions are available
14670 set d_gethostprotos gethostent $i_netdb netdb.h
14673 : see if getitimer exists
14674 set getitimer d_getitimer
14677 : see if getlogin exists
14678 set getlogin d_getlogin
14681 : see if getlogin_r exists
14682 set getlogin_r d_getlogin_r
14684 case "$d_getlogin_r" in
14686 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14687 case "$d_getlogin_r_proto:$usethreads" in
14688 ":define") d_getlogin_r_proto=define
14689 set d_getlogin_r_proto getlogin_r $hdrs
14693 case "$d_getlogin_r_proto" in
14695 case "$getlogin_r_proto" in
14696 ''|0) try='int getlogin_r(char*, size_t);'
14697 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14699 case "$getlogin_r_proto" in
14700 ''|0) try='int getlogin_r(char*, int);'
14701 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14703 case "$getlogin_r_proto" in
14704 ''|0) try='char* getlogin_r(char*, size_t);'
14705 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14707 case "$getlogin_r_proto" in
14708 ''|0) try='char* getlogin_r(char*, int);'
14709 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14711 case "$getlogin_r_proto" in
14712 ''|0) d_getlogin_r=undef
14714 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14715 * ) case "$getlogin_r_proto" in
14716 REENTRANT_PROTO*) ;;
14717 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14719 echo "Prototype: $try" ;;
14722 *) case "$usethreads" in
14723 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14730 *) getlogin_r_proto=0
14734 : see if getmnt exists
14735 set getmnt d_getmnt
14738 : see if getmntent exists
14739 set getmntent d_getmntent
14742 : see if getnameinfo exists
14743 set getnameinfo d_getnameinfo
14746 : see if getnetbyaddr exists
14747 set getnetbyaddr d_getnbyaddr
14750 : see if getnetbyname exists
14751 set getnetbyname d_getnbyname
14754 : see if getnetent exists
14755 set getnetent d_getnent
14758 : see if getnetbyaddr_r exists
14759 set getnetbyaddr_r d_getnetbyaddr_r
14761 case "$d_getnetbyaddr_r" in
14763 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14764 case "$d_getnetbyaddr_r_proto:$usethreads" in
14765 ":define") d_getnetbyaddr_r_proto=define
14766 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14770 case "$d_getnetbyaddr_r_proto" in
14772 case "$getnetbyaddr_r_proto" in
14773 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14774 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14776 case "$getnetbyaddr_r_proto" in
14777 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14778 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14780 case "$getnetbyaddr_r_proto" in
14781 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14782 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14784 case "$getnetbyaddr_r_proto" in
14785 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14786 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14788 case "$getnetbyaddr_r_proto" in
14789 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14790 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14792 case "$getnetbyaddr_r_proto" in
14793 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14794 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14796 case "$getnetbyaddr_r_proto" in
14797 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14798 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14800 case "$getnetbyaddr_r_proto" in
14801 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14802 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14804 case "$getnetbyaddr_r_proto" in
14805 ''|0) d_getnetbyaddr_r=undef
14806 getnetbyaddr_r_proto=0
14807 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14808 * ) case "$getnetbyaddr_r_proto" in
14809 REENTRANT_PROTO*) ;;
14810 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14812 echo "Prototype: $try" ;;
14815 *) case "$usethreads" in
14816 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14818 d_getnetbyaddr_r=undef
14819 getnetbyaddr_r_proto=0
14823 *) getnetbyaddr_r_proto=0
14827 : see if getnetbyname_r exists
14828 set getnetbyname_r d_getnetbyname_r
14830 case "$d_getnetbyname_r" in
14832 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14833 case "$d_getnetbyname_r_proto:$usethreads" in
14834 ":define") d_getnetbyname_r_proto=define
14835 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14839 case "$d_getnetbyname_r_proto" in
14841 case "$getnetbyname_r_proto" in
14842 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14843 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14845 case "$getnetbyname_r_proto" in
14846 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14847 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14849 case "$getnetbyname_r_proto" in
14850 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14851 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14853 case "$getnetbyname_r_proto" in
14854 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14855 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14857 case "$getnetbyname_r_proto" in
14858 ''|0) d_getnetbyname_r=undef
14859 getnetbyname_r_proto=0
14860 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14861 * ) case "$getnetbyname_r_proto" in
14862 REENTRANT_PROTO*) ;;
14863 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14865 echo "Prototype: $try" ;;
14868 *) case "$usethreads" in
14869 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14871 d_getnetbyname_r=undef
14872 getnetbyname_r_proto=0
14876 *) getnetbyname_r_proto=0
14880 : see if getnetent_r exists
14881 set getnetent_r d_getnetent_r
14883 case "$d_getnetent_r" in
14885 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14886 case "$d_getnetent_r_proto:$usethreads" in
14887 ":define") d_getnetent_r_proto=define
14888 set d_getnetent_r_proto getnetent_r $hdrs
14892 case "$d_getnetent_r_proto" in
14894 case "$getnetent_r_proto" in
14895 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14896 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14898 case "$getnetent_r_proto" in
14899 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14900 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14902 case "$getnetent_r_proto" in
14903 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14904 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14906 case "$getnetent_r_proto" in
14907 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14908 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14910 case "$getnetent_r_proto" in
14911 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14912 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14914 case "$getnetent_r_proto" in
14915 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14916 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14918 case "$getnetent_r_proto" in
14919 ''|0) d_getnetent_r=undef
14920 getnetent_r_proto=0
14921 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14922 * ) case "$getnetent_r_proto" in
14923 REENTRANT_PROTO*) ;;
14924 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14926 echo "Prototype: $try" ;;
14929 *) case "$usethreads" in
14930 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14932 d_getnetent_r=undef
14933 getnetent_r_proto=0
14937 *) getnetent_r_proto=0
14941 : see if prototypes for various getnetxxx netdb.h functions are available
14943 set d_getnetprotos getnetent $i_netdb netdb.h
14946 : see if getpagesize exists
14947 set getpagesize d_getpagsz
14950 : Optional checks for getprotobyname and getprotobynumber
14952 : see if getprotobyname exists
14953 set getprotobyname d_getpbyname
14956 : see if getprotobynumber exists
14957 set getprotobynumber d_getpbynumber
14960 : see if getprotoent exists
14961 set getprotoent d_getpent
14964 : see if getpgid exists
14965 set getpgid d_getpgid
14968 : see if getpgrp2 exists
14969 set getpgrp2 d_getpgrp2
14972 : see if getppid exists
14973 set getppid d_getppid
14976 : see if getpriority exists
14977 set getpriority d_getprior
14980 : see if getprotobyname_r exists
14981 set getprotobyname_r d_getprotobyname_r
14983 case "$d_getprotobyname_r" in
14985 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14986 case "$d_getprotobyname_r_proto:$usethreads" in
14987 ":define") d_getprotobyname_r_proto=define
14988 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14992 case "$d_getprotobyname_r_proto" in
14994 case "$getprotobyname_r_proto" in
14995 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14996 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14998 case "$getprotobyname_r_proto" in
14999 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15000 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15002 case "$getprotobyname_r_proto" in
15003 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15004 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15006 case "$getprotobyname_r_proto" in
15007 ''|0) d_getprotobyname_r=undef
15008 getprotobyname_r_proto=0
15009 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15010 * ) case "$getprotobyname_r_proto" in
15011 REENTRANT_PROTO*) ;;
15012 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15014 echo "Prototype: $try" ;;
15017 *) case "$usethreads" in
15018 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15020 d_getprotobyname_r=undef
15021 getprotobyname_r_proto=0
15025 *) getprotobyname_r_proto=0
15029 : see if getprotobynumber_r exists
15030 set getprotobynumber_r d_getprotobynumber_r
15032 case "$d_getprotobynumber_r" in
15034 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15035 case "$d_getprotobynumber_r_proto:$usethreads" in
15036 ":define") d_getprotobynumber_r_proto=define
15037 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15041 case "$d_getprotobynumber_r_proto" in
15043 case "$getprotobynumber_r_proto" in
15044 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15045 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15047 case "$getprotobynumber_r_proto" in
15048 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15049 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15051 case "$getprotobynumber_r_proto" in
15052 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15053 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15055 case "$getprotobynumber_r_proto" in
15056 ''|0) d_getprotobynumber_r=undef
15057 getprotobynumber_r_proto=0
15058 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15059 * ) case "$getprotobynumber_r_proto" in
15060 REENTRANT_PROTO*) ;;
15061 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15063 echo "Prototype: $try" ;;
15066 *) case "$usethreads" in
15067 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15069 d_getprotobynumber_r=undef
15070 getprotobynumber_r_proto=0
15074 *) getprotobynumber_r_proto=0
15078 : see if getprotoent_r exists
15079 set getprotoent_r d_getprotoent_r
15081 case "$d_getprotoent_r" in
15083 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15084 case "$d_getprotoent_r_proto:$usethreads" in
15085 ":define") d_getprotoent_r_proto=define
15086 set d_getprotoent_r_proto getprotoent_r $hdrs
15090 case "$d_getprotoent_r_proto" in
15092 case "$getprotoent_r_proto" in
15093 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15094 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15096 case "$getprotoent_r_proto" in
15097 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15098 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15100 case "$getprotoent_r_proto" in
15101 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15102 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15104 case "$getprotoent_r_proto" in
15105 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15106 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15108 case "$getprotoent_r_proto" in
15109 ''|0) d_getprotoent_r=undef
15110 getprotoent_r_proto=0
15111 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15112 * ) case "$getprotoent_r_proto" in
15113 REENTRANT_PROTO*) ;;
15114 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15116 echo "Prototype: $try" ;;
15119 *) case "$usethreads" in
15120 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15122 d_getprotoent_r=undef
15123 getprotoent_r_proto=0
15127 *) getprotoent_r_proto=0
15131 : see if prototypes for various getprotoxxx netdb.h functions are available
15133 set d_getprotoprotos getprotoent $i_netdb netdb.h
15136 : see if getprpwnam exists
15137 set getprpwnam d_getprpwnam
15140 : see if getpwent exists
15141 set getpwent d_getpwent
15144 : see if getpwent_r exists
15145 set getpwent_r d_getpwent_r
15147 case "$d_getpwent_r" in
15149 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15150 case "$d_getpwent_r_proto:$usethreads" in
15151 ":define") d_getpwent_r_proto=define
15152 set d_getpwent_r_proto getpwent_r $hdrs
15156 case "$d_getpwent_r_proto" in
15158 case "$getpwent_r_proto" in
15159 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15160 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15162 case "$getpwent_r_proto" in
15163 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15164 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15166 case "$getpwent_r_proto" in
15167 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15168 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15170 case "$getpwent_r_proto" in
15171 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15172 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15174 case "$getpwent_r_proto" in
15175 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15176 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15178 case "$getpwent_r_proto" in
15179 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15180 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15182 case "$getpwent_r_proto" in
15183 ''|0) d_getpwent_r=undef
15185 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15186 * ) case "$getpwent_r_proto" in
15187 REENTRANT_PROTO*) ;;
15188 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15190 echo "Prototype: $try" ;;
15193 *) case "$usethreads" in
15194 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15201 *) getpwent_r_proto=0
15205 : see if getpwnam_r exists
15206 set getpwnam_r d_getpwnam_r
15208 case "$d_getpwnam_r" in
15210 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15211 case "$d_getpwnam_r_proto:$usethreads" in
15212 ":define") d_getpwnam_r_proto=define
15213 set d_getpwnam_r_proto getpwnam_r $hdrs
15217 case "$d_getpwnam_r_proto" in
15219 case "$getpwnam_r_proto" in
15220 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15221 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15223 case "$getpwnam_r_proto" in
15224 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15225 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15227 case "$getpwnam_r_proto" in
15228 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15229 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15231 case "$getpwnam_r_proto" in
15232 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15233 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15235 case "$getpwnam_r_proto" in
15236 ''|0) d_getpwnam_r=undef
15238 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15239 * ) case "$getpwnam_r_proto" in
15240 REENTRANT_PROTO*) ;;
15241 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15243 echo "Prototype: $try" ;;
15246 *) case "$usethreads" in
15247 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15254 *) getpwnam_r_proto=0
15258 : see if getpwuid_r exists
15259 set getpwuid_r d_getpwuid_r
15261 case "$d_getpwuid_r" in
15263 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15264 case "$d_getpwuid_r_proto:$usethreads" in
15265 ":define") d_getpwuid_r_proto=define
15266 set d_getpwuid_r_proto getpwuid_r $hdrs
15270 case "$d_getpwuid_r_proto" in
15272 case "$getpwuid_r_proto" in
15273 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15274 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15276 case "$getpwuid_r_proto" in
15277 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15278 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15280 case "$getpwuid_r_proto" in
15281 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15282 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15284 case "$getpwuid_r_proto" in
15285 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15286 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15288 case "$getpwuid_r_proto" in
15289 ''|0) d_getpwuid_r=undef
15291 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15292 * ) case "$getpwuid_r_proto" in
15293 REENTRANT_PROTO*) ;;
15294 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15296 echo "Prototype: $try" ;;
15299 *) case "$usethreads" in
15300 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15307 *) getpwuid_r_proto=0
15311 : Optional checks for getsbyname and getsbyport
15313 : see if getservbyname exists
15314 set getservbyname d_getsbyname
15317 : see if getservbyport exists
15318 set getservbyport d_getsbyport
15321 : see if getservent exists
15322 set getservent d_getsent
15325 : see if getservbyname_r exists
15326 set getservbyname_r d_getservbyname_r
15328 case "$d_getservbyname_r" in
15330 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15331 case "$d_getservbyname_r_proto:$usethreads" in
15332 ":define") d_getservbyname_r_proto=define
15333 set d_getservbyname_r_proto getservbyname_r $hdrs
15337 case "$d_getservbyname_r_proto" in
15339 case "$getservbyname_r_proto" in
15340 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15341 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15343 case "$getservbyname_r_proto" in
15344 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15345 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15347 case "$getservbyname_r_proto" in
15348 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15349 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15351 case "$getservbyname_r_proto" in
15352 ''|0) d_getservbyname_r=undef
15353 getservbyname_r_proto=0
15354 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15355 * ) case "$getservbyname_r_proto" in
15356 REENTRANT_PROTO*) ;;
15357 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15359 echo "Prototype: $try" ;;
15362 *) case "$usethreads" in
15363 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15365 d_getservbyname_r=undef
15366 getservbyname_r_proto=0
15370 *) getservbyname_r_proto=0
15374 : see if getservbyport_r exists
15375 set getservbyport_r d_getservbyport_r
15377 case "$d_getservbyport_r" in
15379 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15380 case "$d_getservbyport_r_proto:$usethreads" in
15381 ":define") d_getservbyport_r_proto=define
15382 set d_getservbyport_r_proto getservbyport_r $hdrs
15386 case "$d_getservbyport_r_proto" in
15388 case "$getservbyport_r_proto" in
15389 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15390 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15392 case "$getservbyport_r_proto" in
15393 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15394 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15396 case "$getservbyport_r_proto" in
15397 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15398 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15400 case "$getservbyport_r_proto" in
15401 ''|0) d_getservbyport_r=undef
15402 getservbyport_r_proto=0
15403 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15404 * ) case "$getservbyport_r_proto" in
15405 REENTRANT_PROTO*) ;;
15406 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15408 echo "Prototype: $try" ;;
15411 *) case "$usethreads" in
15412 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15414 d_getservbyport_r=undef
15415 getservbyport_r_proto=0
15419 *) getservbyport_r_proto=0
15423 : see if getservent_r exists
15424 set getservent_r d_getservent_r
15426 case "$d_getservent_r" in
15428 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15429 case "$d_getservent_r_proto:$usethreads" in
15430 ":define") d_getservent_r_proto=define
15431 set d_getservent_r_proto getservent_r $hdrs
15435 case "$d_getservent_r_proto" in
15437 case "$getservent_r_proto" in
15438 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15439 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15441 case "$getservent_r_proto" in
15442 ''|0) try='int getservent_r(struct servent*, char*, int);'
15443 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15445 case "$getservent_r_proto" in
15446 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15447 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15449 case "$getservent_r_proto" in
15450 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15451 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15453 case "$getservent_r_proto" in
15454 ''|0) d_getservent_r=undef
15455 getservent_r_proto=0
15456 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15457 * ) case "$getservent_r_proto" in
15458 REENTRANT_PROTO*) ;;
15459 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15461 echo "Prototype: $try" ;;
15464 *) case "$usethreads" in
15465 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15467 d_getservent_r=undef
15468 getservent_r_proto=0
15472 *) getservent_r_proto=0
15476 : see if prototypes for various getservxxx netdb.h functions are available
15478 set d_getservprotos getservent $i_netdb netdb.h
15481 : see if getspnam exists
15482 set getspnam d_getspnam
15485 : see if this is a shadow.h system
15486 set shadow.h i_shadow
15489 : see if getspnam_r exists
15490 set getspnam_r d_getspnam_r
15492 case "$d_getspnam_r" in
15494 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15495 case "$d_getspnam_r_proto:$usethreads" in
15496 ":define") d_getspnam_r_proto=define
15497 set d_getspnam_r_proto getspnam_r $hdrs
15501 case "$d_getspnam_r_proto" in
15503 case "$getspnam_r_proto" in
15504 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15505 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15507 case "$getspnam_r_proto" in
15508 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15509 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15511 case "$getspnam_r_proto" in
15512 ''|0) d_getspnam_r=undef
15514 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15515 * ) case "$getspnam_r_proto" in
15516 REENTRANT_PROTO*) ;;
15517 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15519 echo "Prototype: $try" ;;
15522 *) case "$usethreads" in
15523 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15530 *) getspnam_r_proto=0
15534 : see if gettimeofday or ftime exists
15535 set gettimeofday d_gettimeod
15537 case "$d_gettimeod" in
15543 val="$undef"; set d_ftime; eval $setvar
15546 case "$d_gettimeod$d_ftime" in
15549 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15553 : see if gmtime_r exists
15554 set gmtime_r d_gmtime_r
15556 case "$d_gmtime_r" in
15558 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15559 case "$d_gmtime_r_proto:$usethreads" in
15560 ":define") d_gmtime_r_proto=define
15561 set d_gmtime_r_proto gmtime_r $hdrs
15565 case "$d_gmtime_r_proto" in
15567 case "$gmtime_r_proto" in
15568 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15569 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15571 case "$gmtime_r_proto" in
15572 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15573 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15575 case "$gmtime_r_proto" in
15576 ''|0) d_gmtime_r=undef
15578 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15579 * ) case "$gmtime_r_proto" in
15580 REENTRANT_PROTO*) ;;
15581 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15583 echo "Prototype: $try" ;;
15586 *) case "$usethreads" in
15587 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15594 *) gmtime_r_proto=0
15598 : see if hasmntopt exists
15599 set hasmntopt d_hasmntopt
15602 : see if this is a netinet/in.h or sys/in.h system
15603 set netinet/in.h i_niin sys/in.h i_sysin
15606 : see if arpa/inet.h has to be included
15607 set arpa/inet.h i_arpainet
15610 : see if htonl --and friends-- exists
15615 : Maybe they are macros.
15618 $cat >htonl.c <<EOM
15620 #include <sys/types.h>
15621 #$i_niin I_NETINET_IN
15623 #$i_arpainet I_ARPA_INET
15624 #ifdef I_NETINET_IN
15625 #include <netinet/in.h>
15628 #include <sys/in.h>
15631 #include <arpa/inet.h>
15634 printf("Defined as a macro.");
15637 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15638 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15640 echo "But it seems to be defined as a macro." >&4
15648 : see if hypot exists
15652 : see if ilogb exists
15656 : see if ilogbl exists
15657 set ilogbl d_ilogbl
15660 : check whether inet_aton exists
15661 set inet_aton d_inetaton
15664 : see if inet_ntop exists
15665 set inet_ntop d_inetntop
15668 : see if inet_pton exists
15669 set inet_pton d_inetpton
15674 $cat >isascii.c <<EOCP
15677 #$i_stdlib I_STDLIB
15679 #include <stdlib.h>
15690 if eval $compile; then
15691 echo "isascii() found." >&4
15694 echo "isascii() NOT found." >&4
15703 $cat >isblank.c <<'EOCP'
15714 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15715 echo "isblank() found." >&4
15718 echo "isblank() NOT found." >&4
15725 : check for isfinite
15726 echo "Checking to see if you have isfinite..." >&4
15729 int main() { return isfinite(0.0); }
15732 if eval $compile; then
15734 echo "You have isfinite."
15737 echo "You do not have isfinite."
15743 : see if isfinitel exists
15744 set isfinitel d_isfinitel
15748 echo "Checking to see if you have isinf..." >&4
15751 int main() { return isinf(0.0); }
15754 if eval $compile; then
15756 echo "You have isinf."
15759 echo "You do not have isinf."
15765 : see if isinfl exists
15766 set isinfl d_isinfl
15770 echo "Checking to see if you have isless..." >&4
15773 int main() { return isless(0.0); }
15776 if eval $compile; then
15778 echo "You have isless."
15781 echo "You do not have isless."
15788 echo "Checking to see if you have isnan..." >&4
15791 int main() { return isnan(0.0); }
15794 if eval $compile; then
15796 echo "You have isnan."
15799 echo "You do not have isnan."
15805 : see if isnanl exists
15806 set isnanl d_isnanl
15809 : check for isnormal
15810 echo "Checking to see if you have isnormal..." >&4
15813 int main() { return isnormal(0.0); }
15816 if eval $compile; then
15818 echo "You have isnormal."
15821 echo "You do not have isnormal."
15831 : see if j0l exists
15835 : see if killpg exists
15836 set killpg d_killpg
15839 : see if localeconv exists
15840 set localeconv d_locconv
15843 : see if libc has the POSIX.1-2008 currency locale rules
15844 case "$d_locconv:$d_lc_monetary_2008" in
15847 #include <locale.h>
15849 struct lconv *lc = localeconv();
15850 char int_p_cs_precedes = lc->int_p_cs_precedes;
15855 if eval $compile; then
15856 d_lc_monetary_2008="$define"
15858 d_lc_monetary_2008="$undef"
15864 : see if lchown exists
15866 $cat > try.c <<'EOCP'
15867 /* System header to define __stub macros and hopefully few prototypes,
15868 which can conflict with char lchown(); below. */
15869 #include <assert.h>
15870 /* Override any gcc2 internal prototype to avoid an error. */
15871 /* We use char because int might match the return type of a gcc2
15872 builtin and then its argument prototype would still apply. */
15875 /* The GNU C library defines this for functions which it implements
15876 to always fail with ENOSYS. Some functions are actually named
15877 something starting with __ and the normal name is an alias. */
15878 #if defined (__stub_lchown) || defined (__stub___lchown)
15886 if eval $compile; then
15887 $echo "lchown() found." >&4
15890 $echo "lchown() NOT found." >&4
15896 : See if number of significant digits in a double precision number is known
15898 $cat >ldbl_dig.c <<EOM
15899 #include <limits.h>
15902 printf("Contains LDBL_DIG");
15905 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15906 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15907 echo "LDBL_DIG found." >&4
15910 echo "LDBL_DIG NOT found." >&4
15917 : see if lgamma exists
15918 set lgamma d_lgamma
15921 : see if lgamma_r exists
15922 set lgamma_r d_lgamma_r
15925 : check to see if math.h defines _LIB_VERSION
15926 d_libm_lib_version="$undef"
15928 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15930 #include <unistd.h>
15932 int main (int argc, char *argv[])
15934 printf ("%d\n", _LIB_VERSION);
15939 if eval $compile; then
15941 echo "Yes, it does ($foo)" >&4
15942 d_libm_lib_version="$define"
15944 echo "No, it does not (probably harmless)" >&4
15948 : see if link exists
15952 : see if llrint exists
15953 set llrint d_llrint
15956 : see if llrintl exists
15957 set llrintl d_llrintl
15960 : see if llround exists
15961 set llround d_llround
15964 : see if llroundl exists
15965 set llroundl d_llroundl
15968 : see if localeconv_l exists
15969 set localeconv_l d_localeconv_l
15972 : see if localtime_r exists
15973 set localtime_r d_localtime_r
15975 case "$d_localtime_r" in
15977 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15978 case "$d_localtime_r_proto:$usethreads" in
15979 ":define") d_localtime_r_proto=define
15980 set d_localtime_r_proto localtime_r $hdrs
15984 case "$d_localtime_r_proto" in
15986 case "$localtime_r_proto" in
15987 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15988 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15990 case "$localtime_r_proto" in
15991 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15992 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15994 case "$localtime_r_proto" in
15995 ''|0) d_localtime_r=undef
15996 localtime_r_proto=0
15997 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15998 * ) case "$localtime_r_proto" in
15999 REENTRANT_PROTO*) ;;
16000 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16002 echo "Prototype: $try" ;;
16005 *) case "$usethreads" in
16006 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16008 d_localtime_r=undef
16009 localtime_r_proto=0
16013 *) localtime_r_proto=0
16017 : see if localtime_r calls tzset
16018 case "$localtime_r_proto" in
16021 /* Does our libc's localtime_r call tzset ?
16022 * return 0 if so, 1 otherwise.
16024 #$i_systypes I_SYS_TYPES
16025 #$i_unistd I_UNISTD
16027 #$i_stdlib I_STDLIB
16028 #$i_malloc I_MALLOC
16030 # include <sys/types.h>
16033 # include <unistd.h>
16039 #include <stdlib.h>
16041 #include <string.h>
16043 # include <malloc.h>
16047 time_t t = time(0L);
16048 char w_tz[]="TZ" "=GMT+5",
16049 e_tz[]="TZ" "=GMT-5",
16050 *tz_e = (char*)malloc(16),
16051 *tz_w = (char*)malloc(16);
16052 struct tm tm_e, tm_w;
16053 memset(&tm_e,'\0',sizeof(struct tm));
16054 memset(&tm_w,'\0',sizeof(struct tm));
16059 localtime_r(&t, &tm_e);
16062 localtime_r(&t, &tm_w);
16064 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16070 if eval $compile; then
16071 if $run ./try; then
16072 d_localtime_r_needs_tzset=undef;
16074 d_localtime_r_needs_tzset=define;
16077 d_localtime_r_needs_tzset=undef;
16081 d_localtime_r_needs_tzset=undef;
16086 : see if lockf exists
16090 : see if log1p exists
16094 : see if log2 exists
16098 : see if logb exists
16102 : see if lrint exists
16106 : see if lrintl exists
16107 set lrintl d_lrintl
16110 : see if lround exists
16111 set lround d_lround
16114 : see if lroundl exists
16115 set lroundl d_lroundl
16118 : see if prototype for lseek is available
16120 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16123 : see if lstat exists
16127 : see if madvise exists
16128 set madvise d_madvise
16131 : see if malloc_size exists
16132 set malloc_size d_malloc_size
16135 : see if malloc_size_good exists
16136 set malloc_good_size d_malloc_good_size
16139 : see if mblen exists
16143 : see if mbrlen exists
16144 set mbrlen d_mbrlen
16147 : see if mbrtowc exists
16148 set mbrtowc d_mbrtowc
16151 : see if mbstowcs exists
16152 set mbstowcs d_mbstowcs
16155 : see if mbtowc exists
16156 set mbtowc d_mbtowc
16159 : see if memmem exists
16160 set memmem d_memmem
16163 : see if memrchr exists
16164 set memrchr d_memrchr
16167 : see if mkdir exists
16171 : see if mkdtemp exists
16172 set mkdtemp d_mkdtemp
16175 : see if mkfifo exists
16176 set mkfifo d_mkfifo
16179 : see if mkstemp exists
16180 set mkstemp d_mkstemp
16183 : see if mkstemps exists
16184 set mkstemps d_mkstemps
16187 : see if mktime exists
16188 set mktime d_mktime
16191 : see if sys/mman.h has to be included
16192 set sys/mman.h i_sysmman
16195 : see if mmap exists
16198 : see what shmat returns
16199 : default to something harmless
16201 case "$i_sysmman$d_mmap" in
16203 $cat >mmap.c <<'END'
16204 #include <sys/mman.h>
16207 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16212 echo "and it returns ($mmaptype)." >&4
16218 : see if sqrtl exists
16222 : see if scalbnl exists
16223 set scalbnl d_scalbnl
16226 : see if truncl exists
16227 set truncl d_truncl
16230 : see if modfl exists
16234 : see if prototype for modfl is available
16236 set d_modflproto modfl define math.h
16239 if $test "$uselongdouble" = "$define"; then
16241 if $test "$d_sqrtl" != "$define"; then
16242 message="$message sqrtl"
16244 if $test "$d_modfl" != "$define"; then
16245 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16246 echo "You have both truncl and copysignl, so I can emulate modfl."
16248 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16249 echo "You have both aintl and copysignl, so I can emulate modfl."
16251 message="$message modfl"
16255 if $test "$d_frexpl" != "$define"; then
16256 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16257 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16259 message="$message frexpl"
16262 if $test "$d_ldexpl" != "$define"; then
16263 message="$message ldexpl"
16266 if $test "$message" != ""; then
16269 *** You requested the use of long doubles but you do not seem to have
16270 *** the following mathematical functions needed for long double support:
16272 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16273 *** Cannot continue, aborting.
16281 : see if mprotect exists
16282 set mprotect d_mprotect
16285 : see if msgctl exists
16286 set msgctl d_msgctl
16289 : see if msgget exists
16290 set msgget d_msgget
16293 : see if msgsnd exists
16294 set msgsnd d_msgsnd
16297 : see if msgrcv exists
16298 set msgrcv d_msgrcv
16301 : see how much of the 'msg*(2)' library is present.
16304 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16305 *"$undef"*) h_msg=false;;
16309 case "`ipcs 2>&1`" in
16310 "SVID messages"*"not configured"*)
16311 echo "Your $osname does not have the msg*(2) configured." >&4
16314 set msgctl d_msgctl
16316 set msgget d_msgget
16318 set msgsnd d_msgsnd
16320 set msgrcv d_msgrcv
16326 : we could also check for sys/ipc.h ...
16327 if $h_msg && $test `./findhdr sys/msg.h`; then
16328 echo "You have the full msg*(2) library." >&4
16331 echo "You don't have the full msg*(2) library." >&4
16337 : Check for msghdr_s
16339 echo "Checking to see if your system supports struct msghdr..." >&4
16340 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16342 case "$d_msghdr_s" in
16343 "$define") echo "Yes, it does." ;;
16344 *) echo "No, it doesn't." ;;
16348 : see if msync exists
16352 : see if munmap exists
16353 set munmap d_munmap
16356 : see if nan exists
16360 : see if nanosleep exists
16361 set nanosleep d_nanosleep
16364 : see if nearbyint exists
16365 set nearbyint d_nearbyint
16368 : see if nextafter exists
16369 set nextafter d_nextafter
16372 : see if nexttoward exists
16373 set nexttoward d_nexttoward
16376 : see if nice exists
16380 : see if this is a langinfo.h system
16381 set langinfo.h i_langinfo
16384 : see if nl_langinfo exists
16385 set nl_langinfo d_nl_langinfo
16388 : see if this is a quadmath.h system
16389 set quadmath.h i_quadmath
16392 : Check basic sizes
16394 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16396 case "$use64bitint:$d_quad:$quadtype" in
16399 uvtype="$uquadtype"
16404 uvtype="unsigned long"
16410 case "$uselongdouble:$d_longdbl" in
16412 nvtype="long double"
16413 nvsize=$longdblsize
16420 case "$usequadmath:$i_quadmath" in
16422 nvtype="__float128"
16428 *** You requested the use of the quadmath library, but you
16429 *** do not seem to have the quadmath library installed.
16430 *** Cannot continue, aborting.
16436 define:*) $cat <<EOM >&4
16438 *** You requested the use of the quadmath library, but you
16439 *** do not seem to have the required header, <quadmath.h>.
16441 case "$gccversion" in
16444 *** Your gcc looks a bit old:
16450 *** You are not running a gcc.
16455 *** For the quadmath library you need at least gcc 4.6.
16456 *** Cannot continue, aborting.
16462 $echo "(IV will be "$ivtype", $ivsize bytes)"
16463 $echo "(UV will be "$uvtype", $uvsize bytes)"
16464 $echo "(NV will be "$nvtype", $nvsize bytes)"
16467 #$i_inttypes I_INTTYPES
16469 #include <inttypes.h>
16474 int8_t i = INT8_MAX;
16475 uint8_t u = UINT8_MAX;
16476 printf("int8_t\n");
16479 int16_t i = INT16_MAX;
16480 uint16_t u = UINT16_MAX;
16481 printf("int16_t\n");
16484 int32_t i = INT32_MAX;
16485 uint32_t u = UINT32_MAX;
16486 printf("int32_t\n");
16491 i8type="signed char"
16492 u8type="unsigned char"
16497 '') case "$shortsize" in
16499 u16type="unsigned short"
16507 '') set try -DINT16
16508 if eval $compile; then
16509 case "`$run ./try`" in
16521 '') if $test $shortsize -ge 2; then
16523 u16type="unsigned short"
16531 '') case "$longsize" in
16533 u32type="unsigned long"
16537 *) case "$intsize" in
16539 u32type="unsigned int"
16549 '') set try -DINT32
16550 if eval $compile; then
16551 case "`$run ./try`" in
16563 '') if $test $intsize -ge 4; then
16565 u32type="unsigned int"
16573 '') case "$d_quad:$quadtype" in
16575 i64type="$quadtype"
16576 u64type="$uquadtype"
16584 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16587 #$i_stdlib I_STDLIB
16589 #include <stdlib.h>
16591 #include <sys/types.h>
16592 #include <signal.h>
16594 /* volatile so that the compiler has to store it out to memory */
16595 volatile int bletched = 0;
16596 $signal_t blech(int s) { bletched = 1; }
16601 int n = 8 * $uvsize;
16604 signal(SIGFPE, blech);
16607 for (i = 0; i < n; i++) {
16608 u = u << 1 | ($uvtype)1;
16610 if (($uvtype)d != u)
16614 d = ($nvtype)(u - 1);
16615 if (($uvtype)d != (u - 1))
16622 printf("%d\n", ((i == n) ? -n : i));
16628 d_nv_preserves_uv="$undef"
16629 if eval $compile; then
16630 nv_preserves_uv_bits="`$run ./try`"
16632 case "$nv_preserves_uv_bits" in
16634 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16635 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16636 d_nv_preserves_uv="$define"
16638 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16639 d_nv_preserves_uv="$undef" ;;
16640 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16641 nv_preserves_uv_bits="0" ;;
16645 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16649 typedef $nvtype NV;
16656 while(count < 256) {
16657 /* volatile so that the compiler has to store it out to memory */
16658 volatile NV up = value + 1.0;
16659 volatile NV negated = -value;
16660 volatile NV down = negated - 1.0;
16661 volatile NV got_up = up - value;
16662 int up_good = got_up == 1.0;
16663 int got_down = down - negated;
16664 int down_good = got_down == -1.0;
16666 if (down_good != up_good) {
16668 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16669 up_good, (double) got_up, down_good, (double) got_down,
16670 count, (double) value);
16677 fputs("256.0", stdout);
16680 fputs("2.0", stdout);
16686 fputs("*", stdout);
16692 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16693 count, (double) value);
16699 nv_overflows_integers_at='0'
16700 if eval $compile; then
16706 The largest integer your NVs can preserve is equal to $xxx
16708 nv_overflows_integers_at="$xxx"
16711 Cannot determine the largest integer value your NVs can hold, unexpected output
16718 Cannot determine the largest integer value your NVs can hold
16725 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16728 #$i_stdlib I_STDLIB
16730 #include <stdlib.h>
16732 #include <string.h>
16733 #include <sys/types.h>
16734 #include <signal.h>
16736 /* volatile so that the compiler has to store it out to memory */
16737 volatile int bletched = 0;
16738 $signal_t blech(int s) { bletched = 1; }
16741 int checkit($nvtype d, const char *where) {
16743 unsigned char *p = (unsigned char *)v;
16744 unsigned char *end = p + sizeof(d);
16753 p = (unsigned char *)v;
16754 printf("No - %s: 0x", where);
16756 printf ("%02X", *p++);
16761 int main(int argc, char **argv) {
16764 fail += checkit(d, "0.0");
16766 /* The compiler shouldn't be assuming that bletched is 0 */
16769 fail += checkit(d, "bleched");
16772 signal(SIGFPE, blech);
16775 /* Paranoia - the compiler should have no way of knowing that ANSI says
16776 that argv[argc] will always be NULL. Actually, if it did assume this it
16777 would be buggy, as this is C and main() can be called from elsewhere in
16779 d = argv[argc] ? 1 : 0;
16782 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16785 fail += checkit(d, "ternary");
16787 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16790 printf("No - memset doesn't give 0.0\n");
16791 /* This might just blow up: */
16792 printf("(gives %g)\n", d);
16798 printf("No - something bleched\n");
16803 printf("No - %d fail(s)\n", fail);
16812 d_nv_zero_is_allbits_zero="$undef"
16813 if eval $compile; then
16819 0.0 is represented as all bits zero in memory
16821 d_nv_zero_is_allbits_zero="$define"
16824 0.0 is not represented as all bits zero in memory
16826 d_nv_zero_is_allbits_zero="$undef"
16831 0.0 is not represented as all bits zero in memory
16833 d_nv_zero_is_allbits_zero="$undef"
16839 : check for off64_t
16841 echo "Checking to see if you have off64_t..." >&4
16843 #include <sys/types.h>
16844 #include <unistd.h>
16845 int main() { off64_t x = 7; }
16848 if eval $compile; then
16850 echo "You have off64_t."
16853 echo "You do not have off64_t."
16854 case "$lseeksize" in
16855 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16862 : how to create joinable pthreads
16863 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16865 echo "Checking what constant to use for creating joinable pthreads..." >&4
16866 $cat >try.c <<'EOCP'
16867 #include <pthread.h>
16869 int detachstate = JOINABLE;
16872 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16873 if eval $compile; then
16874 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16875 val="$undef" # Yes, undef.
16876 set d_old_pthread_create_joinable
16879 set old_pthread_create_joinable
16882 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16883 if eval $compile; then
16884 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16886 set d_old_pthread_create_joinable
16888 val=PTHREAD_CREATE_UNDETACHED
16889 set old_pthread_create_joinable
16892 set try -DJOINABLE=__UNDETACHED
16893 if eval $compile; then
16894 echo "You seem to use __UNDETACHED." >&4
16896 set d_old_pthread_create_joinable
16899 set old_pthread_create_joinable
16902 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16904 set d_old_pthread_create_joinable
16907 set old_pthread_create_joinable
16914 d_old_pthread_create_joinable="$undef"
16915 old_pthread_create_joinable=""
16918 : see if pause exists
16922 : see if poll exists
16926 : see if prctl exists
16930 : see if prctl supports PR_SET_NAME
16931 d_prctl_set_name=$undef
16936 #include <unistd.h>
16938 #include <sys/prctl.h>
16940 int main (int argc, char *argv[])
16942 return (prctl (PR_SET_NAME, "Test"));
16946 if eval $compile_ok && $run ./try; then
16947 echo "Your prctl (PR_SET_NAME, ...) works"
16948 d_prctl_set_name=$define
16954 : see if readlink exists
16955 set readlink d_readlink
16958 : Check if there is a /proc symlink to the abs path of
16959 : the executing program. We will honor hints of d_procselfexe=$undef
16960 : or procselfexe being non-empty, otherwise will try to determine both
16961 : if we have readlink.
16962 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
16963 : referenced, and AmigaOS does not have a proc filesystem anyway.
16966 if $test "X$d_procselfexe" = Xundef; then
16968 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
16970 elif $test "X$d_readlink" = Xdefine; then
16971 : NetBSD first as /proc/self is a symlink to /proc/curproc,
16972 : and it feels more tidy to avoid an extra level of symlink
16973 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16974 while test $# -gt 0; do
16977 if $issymlink $try; then
16978 $ls -l $try > reflect
16979 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16980 echo "You have $type-like $try."
16981 procselfexe='"'$try'"'
16983 : This will break out of the loop
16993 : backward compatibility for d_hvfork
16994 if test X$d_hvfork != X; then
16995 d_vfork="$d_hvfork"
16998 : see if there is a vfork
17003 d_pseudofork=$undef
17005 : Ok, but do we want to use it. vfork is reportedly unreliable in
17006 : perl on Solaris 2.x, and probably elsewhere.
17010 case "$usevfork" in
17016 Perl can only use a vfork() that doesn't suffer from strict
17017 restrictions on calling functions or modifying global data in
17018 the child. For example, glibc-2.1 contains such a vfork()
17019 that is unsuitable. If your system provides a proper fork()
17020 call, chances are that you do NOT want perl to use vfork().
17023 rp="Do you still want to use vfork()?"
17028 echo "Ok, we won't use vfork()."
17037 $define) usevfork='true';;
17038 *) usevfork='false';;
17041 : see whether the pthread_atfork exists
17043 #include <pthread.h>
17046 #ifdef PTHREAD_ATFORK
17047 pthread_atfork(NULL,NULL,NULL);
17052 : see if pthread_atfork exists
17053 set try -DPTHREAD_ATFORK
17054 if eval $compile; then
17059 case "$usethreads" in
17062 $define) echo 'pthread_atfork found.' >&4 ;;
17063 *) echo 'pthread_atfork NOT found.' >&4 ;;
17066 set d_pthread_atfork
17069 : see if pthread_attr_setscope exists
17070 set pthread_attr_setscope d_pthread_attr_setscope
17073 : see whether the various POSIXish _yields exist
17075 #include <pthread.h>
17081 #ifdef PTHREAD_YIELD
17084 #ifdef PTHREAD_YIELD_NULL
17085 pthread_yield(NULL);
17091 : see if sched_yield exists
17092 set try -DSCHED_YIELD
17093 if eval $compile; then
17095 sched_yield='sched_yield()'
17099 case "$usethreads" in
17102 $define) echo 'sched_yield() found.' >&4 ;;
17103 *) echo 'sched_yield() NOT found.' >&4 ;;
17109 : see if pthread_yield exists
17110 set try -DPTHREAD_YIELD
17111 if eval $compile; then
17113 case "$sched_yield" in
17114 '') sched_yield='pthread_yield()' ;;
17117 set try -DPTHREAD_YIELD_NULL
17118 if eval $compile; then
17120 case "$sched_yield" in
17121 '') sched_yield='pthread_yield(NULL)' ;;
17127 case "$usethreads" in
17130 $define) echo 'pthread_yield() found.' >&4 ;;
17131 *) echo 'pthread_yield() NOT found.' >&4 ;;
17135 set d_pthread_yield
17137 case "$sched_yield" in
17138 '') sched_yield=undef ;;
17142 : check for ptrdiff_t
17144 echo "Checking to see if you have ptrdiff_t..." >&4
17146 #include <stddef.h>
17147 int main() { ptrdiff_t x = 7; }
17150 if eval $compile; then
17152 echo "You have ptrdiff_t."
17155 echo "You do not have ptrdiff_t."
17161 : see if random_r exists
17162 set random_r d_random_r
17164 case "$d_random_r" in
17166 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17167 case "$d_random_r_proto:$usethreads" in
17168 ":define") d_random_r_proto=define
17169 set d_random_r_proto random_r $hdrs
17173 case "$d_random_r_proto" in
17175 case "$random_r_proto" in
17176 ''|0) try='int random_r(int*, struct random_data*);'
17177 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17179 case "$random_r_proto" in
17180 ''|0) try='int random_r(long*, struct random_data*);'
17181 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17183 case "$random_r_proto" in
17184 ''|0) try='int random_r(struct random_data*, int32_t*);'
17185 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17187 case "$random_r_proto" in
17188 ''|0) d_random_r=undef
17190 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17191 * ) case "$random_r_proto" in
17192 REENTRANT_PROTO*) ;;
17193 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17195 echo "Prototype: $try" ;;
17198 *) case "$usethreads" in
17199 define) echo "random_r has no prototype, not using it." >&4 ;;
17206 *) random_r_proto=0
17210 : see if readdir and friends exist
17211 set readdir d_readdir
17213 set seekdir d_seekdir
17215 set telldir d_telldir
17217 set rewinddir d_rewinddir
17220 : see if readdir64_r exists
17221 set readdir64_r d_readdir64_r
17223 case "$d_readdir64_r" in
17225 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17226 case "$d_readdir64_r_proto:$usethreads" in
17227 ":define") d_readdir64_r_proto=define
17228 set d_readdir64_r_proto readdir64_r $hdrs
17232 case "$d_readdir64_r_proto" in
17234 case "$readdir64_r_proto" in
17235 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17236 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17238 case "$readdir64_r_proto" in
17239 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17240 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17242 case "$readdir64_r_proto" in
17243 ''|0) d_readdir64_r=undef
17244 readdir64_r_proto=0
17245 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17246 * ) case "$readdir64_r_proto" in
17247 REENTRANT_PROTO*) ;;
17248 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17250 echo "Prototype: $try" ;;
17253 *) case "$usethreads" in
17254 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17256 d_readdir64_r=undef
17257 readdir64_r_proto=0
17261 *) readdir64_r_proto=0
17265 : see if readdir_r exists
17266 set readdir_r d_readdir_r
17268 case "$d_readdir_r" in
17270 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17271 case "$d_readdir_r_proto:$usethreads" in
17272 ":define") d_readdir_r_proto=define
17273 set d_readdir_r_proto readdir_r $hdrs
17277 case "$d_readdir_r_proto" in
17279 case "$readdir_r_proto" in
17280 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17281 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17283 case "$readdir_r_proto" in
17284 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17285 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17287 case "$readdir_r_proto" in
17288 ''|0) d_readdir_r=undef
17290 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17291 * ) case "$readdir_r_proto" in
17292 REENTRANT_PROTO*) ;;
17293 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17295 echo "Prototype: $try" ;;
17298 *) case "$usethreads" in
17299 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17306 *) readdir_r_proto=0
17310 : see if readv exists
17314 : see if recvmsg exists
17315 set recvmsg d_recvmsg
17318 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17320 if set regcomp val -f d_regcomp; eval $csym; $val; then
17321 echo 'regcomp() found.' >&4
17322 d_regcomp="$define"
17325 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17326 echo 'regcmp() found.' >&4
17330 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17331 echo 're_comp() found, assuming re_exec() also exists.' >&4
17332 d_re_comp="$define"
17337 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17344 : see if remainder exists
17345 set remainder d_remainder
17348 : see if remquo exists
17349 set remquo d_remquo
17352 : see if rename exists
17353 set rename d_rename
17356 : see if rint exists
17360 : see if rmdir exists
17364 : see if round exists
17368 : see if prototype for sbrk is available
17370 set d_sbrkproto sbrk $i_unistd unistd.h
17373 : see if scalbn exists
17374 set scalbn d_scalbn
17377 : see if select exists
17378 set select d_select
17381 : see if semctl exists
17382 set semctl d_semctl
17385 : see if semget exists
17386 set semget d_semget
17389 : see if semop exists
17393 : see how much of the 'sem*(2)' library is present.
17396 case "$d_semctl$d_semget$d_semop" in
17397 *"$undef"*) h_sem=false;;
17401 case "`ipcs 2>&1`" in
17402 "SVID messages"*"not configured"*)
17403 echo "Your $osname does not have the sem*(2) configured." >&4
17406 set semctl d_semctl
17408 set semget d_semget
17416 : we could also check for sys/ipc.h ...
17417 if $h_sem && $test `./findhdr sys/sem.h`; then
17418 echo "You have the full sem*(2) library." >&4
17421 echo "You don't have the full sem*(2) library." >&4
17427 : see whether sys/sem.h defines union semun
17429 $cat > try.c <<'END'
17430 #include <sys/types.h>
17431 #include <sys/ipc.h>
17432 #include <sys/sem.h>
17433 int main () { union semun semun; semun.buf = 0; }
17436 if eval $compile; then
17437 echo "You have union semun in <sys/sem.h>." >&4
17440 echo "You do not have union semun in <sys/sem.h>." >&4
17447 : see how to do semctl IPC_STAT
17451 $cat > tryh.h <<END
17454 # define S_IRUSR S_IREAD
17455 # define S_IWUSR S_IWRITE
17456 # define S_IXUSR S_IEXEC
17458 # define S_IRUSR 0400
17459 # define S_IWUSR 0200
17460 # define S_IXUSR 0100
17462 # define S_IRGRP (S_IRUSR>>3)
17463 # define S_IWGRP (S_IWUSR>>3)
17464 # define S_IXGRP (S_IXUSR>>3)
17465 # define S_IROTH (S_IRUSR>>6)
17466 # define S_IWOTH (S_IWUSR>>6)
17467 # define S_IXOTH (S_IXUSR>>6)
17470 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17471 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17472 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17475 : see whether semctl IPC_STAT can use union semun
17476 case "$d_semctl_semun" in
17480 #include <sys/types.h>
17481 #include <sys/ipc.h>
17482 #include <sys/sem.h>
17483 #include <sys/stat.h>
17490 #$d_union_semun HAS_UNION_SEMUN
17493 #ifndef HAS_UNION_SEMUN
17496 struct semid_ds *buf;
17497 unsigned short *array;
17503 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17504 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17506 struct semid_ds argbuf;
17509 st = semctl(sem, 0, IPC_STAT, arg);
17513 # endif /* IPC_STAT */
17514 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17516 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17517 # endif /* IPC_RMID */
17518 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17520 #endif /* IPC_PRIVATE && ... */
17521 printf("semget failed: errno = %d\n", errno);
17526 if eval $compile; then
17529 semun) val="$define" ;;
17537 case "$d_semctl_semun" in
17539 echo "You can use union semun for semctl IPC_STAT." >&4
17542 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17547 : see whether semctl IPC_STAT can use struct semid_ds pointer
17548 case "$d_semctl_semid_ds" in
17551 $cat > try.c <<'END'
17552 #include <sys/types.h>
17553 #include <sys/ipc.h>
17554 #include <sys/sem.h>
17555 #include <sys/stat.h>
17563 struct semid_ds arg;
17566 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17567 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17570 st = semctl(sem, 0, IPC_STAT, &arg);
17572 printf("semid_ds\n");
17574 # endif /* IPC_STAT */
17575 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17577 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17578 # endif /* IPC_RMID */
17579 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17581 #endif /* IPC_PRIVATE && ... */
17582 printf("semget failed: errno = %d\n", errno);
17588 if eval $compile; then
17591 semid_ds) val="$define" ;;
17595 set d_semctl_semid_ds
17599 case "$d_semctl_semid_ds" in
17601 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17603 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17609 # We do not have the full sem*(2) library, so assume we can not
17615 set d_semctl_semid_ds
17621 : see if sendmsg exists
17622 set sendmsg d_sendmsg
17625 : see if setegid exists
17626 set setegid d_setegid
17629 : see if seteuid exists
17630 set seteuid d_seteuid
17633 : see if setgrent exists
17634 set setgrent d_setgrent
17637 : see if setgrent_r exists
17638 set setgrent_r d_setgrent_r
17640 case "$d_setgrent_r" in
17642 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17643 case "$d_setgrent_r_proto:$usethreads" in
17644 ":define") d_setgrent_r_proto=define
17645 set d_setgrent_r_proto setgrent_r $hdrs
17649 case "$d_setgrent_r_proto" in
17651 case "$setgrent_r_proto" in
17652 ''|0) try='int setgrent_r(FILE**);'
17653 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17655 case "$setgrent_r_proto" in
17656 ''|0) try='void setgrent_r(FILE**);'
17657 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17659 case "$setgrent_r_proto" in
17660 ''|0) d_setgrent_r=undef
17662 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17663 * ) case "$setgrent_r_proto" in
17664 REENTRANT_PROTO*) ;;
17665 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17667 echo "Prototype: $try" ;;
17670 *) case "$usethreads" in
17671 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17678 *) setgrent_r_proto=0
17682 : see if sethostent exists
17683 set sethostent d_sethent
17686 : see if sethostent_r exists
17687 set sethostent_r d_sethostent_r
17689 case "$d_sethostent_r" in
17691 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17692 case "$d_sethostent_r_proto:$usethreads" in
17693 ":define") d_sethostent_r_proto=define
17694 set d_sethostent_r_proto sethostent_r $hdrs
17698 case "$d_sethostent_r_proto" in
17700 case "$sethostent_r_proto" in
17701 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17702 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17704 case "$sethostent_r_proto" in
17705 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17706 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17708 case "$sethostent_r_proto" in
17709 ''|0) d_sethostent_r=undef
17710 sethostent_r_proto=0
17711 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17712 * ) case "$sethostent_r_proto" in
17713 REENTRANT_PROTO*) ;;
17714 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17716 echo "Prototype: $try" ;;
17719 *) case "$usethreads" in
17720 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17722 d_sethostent_r=undef
17723 sethostent_r_proto=0
17727 *) sethostent_r_proto=0
17731 : see if setitimer exists
17732 set setitimer d_setitimer
17735 : see if setlinebuf exists
17736 set setlinebuf d_setlinebuf
17739 : see if setlocale exists
17740 set setlocale d_setlocale
17743 : see if locale.h is available
17744 set locale.h i_locale
17747 : see if setlocale_r exists
17748 set setlocale_r d_setlocale_r
17750 case "$d_setlocale_r" in
17752 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17753 case "$d_setlocale_r_proto:$usethreads" in
17754 ":define") d_setlocale_r_proto=define
17755 set d_setlocale_r_proto setlocale_r $hdrs
17759 case "$d_setlocale_r_proto" in
17761 case "$setlocale_r_proto" in
17762 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17763 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17765 case "$setlocale_r_proto" in
17766 ''|0) d_setlocale_r=undef
17767 setlocale_r_proto=0
17768 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17769 * ) case "$setlocale_r_proto" in
17770 REENTRANT_PROTO*) ;;
17771 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17773 echo "Prototype: $try" ;;
17776 *) case "$usethreads" in
17777 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17779 d_setlocale_r=undef
17780 setlocale_r_proto=0
17784 *) setlocale_r_proto=0
17788 : see if setnetent exists
17789 set setnetent d_setnent
17792 : see if setnetent_r exists
17793 set setnetent_r d_setnetent_r
17795 case "$d_setnetent_r" in
17797 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17798 case "$d_setnetent_r_proto:$usethreads" in
17799 ":define") d_setnetent_r_proto=define
17800 set d_setnetent_r_proto setnetent_r $hdrs
17804 case "$d_setnetent_r_proto" in
17806 case "$setnetent_r_proto" in
17807 ''|0) try='int setnetent_r(int, struct netent_data*);'
17808 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17810 case "$setnetent_r_proto" in
17811 ''|0) try='void setnetent_r(int, struct netent_data*);'
17812 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17814 case "$setnetent_r_proto" in
17815 ''|0) d_setnetent_r=undef
17816 setnetent_r_proto=0
17817 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17818 * ) case "$setnetent_r_proto" in
17819 REENTRANT_PROTO*) ;;
17820 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17822 echo "Prototype: $try" ;;
17825 *) case "$usethreads" in
17826 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17828 d_setnetent_r=undef
17829 setnetent_r_proto=0
17833 *) setnetent_r_proto=0
17837 : see if setprotoent exists
17838 set setprotoent d_setpent
17841 : see if setpgid exists
17842 set setpgid d_setpgid
17845 : see if setpgrp2 exists
17846 set setpgrp2 d_setpgrp2
17849 : see if setpriority exists
17850 set setpriority d_setprior
17853 : see if setproctitle exists
17854 set setproctitle d_setproctitle
17857 : see if setprotoent_r exists
17858 set setprotoent_r d_setprotoent_r
17860 case "$d_setprotoent_r" in
17862 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17863 case "$d_setprotoent_r_proto:$usethreads" in
17864 ":define") d_setprotoent_r_proto=define
17865 set d_setprotoent_r_proto setprotoent_r $hdrs
17869 case "$d_setprotoent_r_proto" in
17871 case "$setprotoent_r_proto" in
17872 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17873 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17875 case "$setprotoent_r_proto" in
17876 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17877 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17879 case "$setprotoent_r_proto" in
17880 ''|0) d_setprotoent_r=undef
17881 setprotoent_r_proto=0
17882 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17883 * ) case "$setprotoent_r_proto" in
17884 REENTRANT_PROTO*) ;;
17885 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17887 echo "Prototype: $try" ;;
17890 *) case "$usethreads" in
17891 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17893 d_setprotoent_r=undef
17894 setprotoent_r_proto=0
17898 *) setprotoent_r_proto=0
17902 : see if setpwent exists
17903 set setpwent d_setpwent
17906 : see if setpwent_r exists
17907 set setpwent_r d_setpwent_r
17909 case "$d_setpwent_r" in
17911 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17912 case "$d_setpwent_r_proto:$usethreads" in
17913 ":define") d_setpwent_r_proto=define
17914 set d_setpwent_r_proto setpwent_r $hdrs
17918 case "$d_setpwent_r_proto" in
17920 case "$setpwent_r_proto" in
17921 ''|0) try='int setpwent_r(FILE**);'
17922 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17924 case "$setpwent_r_proto" in
17925 ''|0) try='void setpwent_r(FILE**);'
17926 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17928 case "$setpwent_r_proto" in
17929 ''|0) d_setpwent_r=undef
17931 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17932 * ) case "$setpwent_r_proto" in
17933 REENTRANT_PROTO*) ;;
17934 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17936 echo "Prototype: $try" ;;
17939 *) case "$usethreads" in
17940 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17947 *) setpwent_r_proto=0
17951 : see if setregid exists
17952 set setregid d_setregid
17954 set setresgid d_setresgid
17957 : see if setreuid exists
17958 set setreuid d_setreuid
17960 set setresuid d_setresuid
17963 : see if setrgid exists
17964 set setrgid d_setrgid
17967 : see if setruid exists
17968 set setruid d_setruid
17971 : see if setservent exists
17972 set setservent d_setsent
17975 : see if setservent_r exists
17976 set setservent_r d_setservent_r
17978 case "$d_setservent_r" in
17980 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17981 case "$d_setservent_r_proto:$usethreads" in
17982 ":define") d_setservent_r_proto=define
17983 set d_setservent_r_proto setservent_r $hdrs
17987 case "$d_setservent_r_proto" in
17989 case "$setservent_r_proto" in
17990 ''|0) try='int setservent_r(int, struct servent_data*);'
17991 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17993 case "$setservent_r_proto" in
17994 ''|0) try='void setservent_r(int, struct servent_data*);'
17995 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17997 case "$setservent_r_proto" in
17998 ''|0) d_setservent_r=undef
17999 setservent_r_proto=0
18000 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18001 * ) case "$setservent_r_proto" in
18002 REENTRANT_PROTO*) ;;
18003 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18005 echo "Prototype: $try" ;;
18008 *) case "$usethreads" in
18009 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18011 d_setservent_r=undef
18012 setservent_r_proto=0
18016 *) setservent_r_proto=0
18020 : see if setsid exists
18021 set setsid d_setsid
18024 : see if setvbuf exists
18025 set setvbuf d_setvbuf
18028 : see if shmctl exists
18029 set shmctl d_shmctl
18032 : see if shmget exists
18033 set shmget d_shmget
18036 : see if shmat exists
18039 : see what shmat returns
18042 $cat >shmat.c <<'END'
18043 #include <sys/shm.h>
18046 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18051 echo "and it returns ($shmattype)." >&4
18052 : see if a prototype for shmat is available
18053 xxx=`./findhdr sys/shm.h`
18054 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18055 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18066 set d_shmatprototype
18069 : see if shmdt exists
18073 : see how much of the 'shm*(2)' library is present.
18076 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18077 *"$undef"*) h_shm=false;;
18081 case "`ipcs 2>&1`" in
18082 "SVID shared memory"*"not configured"*)
18083 echo "Your $osname does not have the shm*(2) configured." >&4
18086 set shmctl d_shmctl
18088 set shmget d_shmget
18098 : we could also check for sys/ipc.h ...
18099 if $h_shm && $test `./findhdr sys/shm.h`; then
18100 echo "You have the full shm*(2) library." >&4
18103 echo "You don't have the full shm*(2) library." >&4
18109 : see if we have sigaction
18111 if set sigaction val -f d_sigaction; eval $csym; $val; then
18112 echo 'sigaction() found.' >&4
18115 #include <sys/types.h>
18116 #include <signal.h>
18117 #$i_stdlib I_STDLIB
18119 #include <stdlib.h>
18123 struct sigaction act, oact;
18125 oact.sa_handler = 0;
18126 /* so that act and oact are used */
18127 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18131 if eval $compile_ok; then
18134 echo "But you don't seem to have a usable struct sigaction." >&4
18138 echo 'sigaction NOT found.' >&4
18141 set d_sigaction; eval $setvar
18144 : see what type pids are declared as in the kernel
18145 rp="What is the type of process ids on this system?"
18146 set pid_t pidtype int stdio.h sys/types.h
18149 : see what type uids are declared as in the kernel
18151 echo "Looking for the type for user ids returned by getuid()."
18152 set uid_t uidtype xxx stdio.h sys/types.h
18156 xxx=`./findhdr sys/user.h`
18157 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18159 unsigned) dflt="$1 $2" ;;
18163 *) dflt="$uidtype";;
18166 uid_t) echo "uid_t found." ;;
18167 *) rp="What is the type for user ids returned by getuid()?"
18173 : Define hasfield_t macro for Configure internal use
18174 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18175 while $test $# -ge 2; do
18177 $define) echo "#include <$2>";;
18181 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18183 if eval $compile; then
18192 : see what siginfo fields we have
18193 case "$d_sigaction" in
18195 echo "Checking if your siginfo_t has si_errno field...">&4
18196 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18199 echo "Checking if your siginfo_t has si_pid field...">&4
18200 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18203 echo "Checking if your siginfo_t has si_uid field...">&4
18204 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18207 echo "Checking if your siginfo_t has si_addr field...">&4
18208 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18211 echo "Checking if your siginfo_t has si_status field...">&4
18212 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18215 echo "Checking if your siginfo_t has si_band field...">&4
18216 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18219 echo "Checking if your siginfo_t has si_value field...">&4
18220 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18223 echo "Checking if your siginfo_t has si_fd field...">&4
18224 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18229 d_siginfo_si_errno="$undef"
18230 d_siginfo_si_pid="$undef"
18231 d_siginfo_si_uid="$undef"
18232 d_siginfo_si_addr="$undef"
18233 d_siginfo_si_status="$undef"
18234 d_siginfo_si_band="$undef"
18235 d_siginfo_si_value="$undef"
18236 d_siginfo_si_fd="$undef"
18240 : see if this is a sunmath.h system
18241 set sunmath.h i_sunmath
18244 : see if signbit exists
18245 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18247 #$i_sunmath I_SUNMATH
18249 #ifdef I_SUNMATH /* Solaris special math library */
18250 # include <sunmath.h>
18253 int main(int argc, char **argv)
18257 if ((signbit(x) == 0) && (signbit(y) != 0))
18265 if eval $compile; then
18266 if $run ./try; then
18270 $echo "Signbit seems to be available, but doesn't work as I expected."
18271 $echo "I won't use it." >&4
18282 : see if sigprocmask exists
18283 set sigprocmask d_sigprocmask
18286 : see if sigsetjmp exists
18288 case "$d_sigsetjmp" in
18291 #include <setjmp.h>
18292 #$i_stdlib I_STDLIB
18294 #include <stdlib.h>
18300 if (sigsetjmp(env,1))
18303 siglongjmp(env, 1);
18308 if eval $compile; then
18309 if $run ./try >/dev/null 2>&1; then
18310 echo "POSIX sigsetjmp found." >&4
18314 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18320 echo "sigsetjmp not found." >&4
18324 *) val="$d_sigsetjmp"
18325 case "$d_sigsetjmp" in
18326 $define) echo "POSIX sigsetjmp found." >&4;;
18327 $undef) echo "sigsetjmp not found." >&4;;
18335 : see if snprintf exists
18336 set snprintf d_snprintf
18339 : see if vsnprintf exists
18340 set vsnprintf d_vsnprintf
18343 case "$d_snprintf-$d_vsnprintf" in
18346 Checking whether your snprintf() and vsnprintf() work okay...
18348 $cat >try.c <<'EOCP'
18349 /* v?snprintf testing logic courtesy of Russ Allbery.
18350 * According to C99:
18351 * - if the buffer is too short it still must be \0-terminated
18352 * - if the buffer is too short the potentially required length
18353 * must be returned and not -1
18354 * - if the buffer is NULL the potentially required length
18355 * must be returned and not -1 or core dump
18358 #include <stdarg.h>
18362 int test (char *format, ...)
18367 va_start (args, format);
18368 count = vsnprintf (buf, sizeof buf, format, args);
18375 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18376 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18380 if eval $compile; then
18383 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18385 Your snprintf() and snprintf() don't seem to be working okay.
18387 d_snprintf="$undef"
18388 d_vsnprintf="$undef"
18392 echo "(I can't seem to compile the test program--assuming they don't)"
18393 d_snprintf="$undef"
18394 d_vsnprintf="$undef"
18400 : see if sockatmark exists
18401 set sockatmark d_sockatmark
18404 : see if prototype for sockatmark is available
18406 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18409 : see if socks5_init exists
18410 set socks5_init d_socks5_init
18413 : see if srand48_r exists
18414 set srand48_r d_srand48_r
18416 case "$d_srand48_r" in
18418 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18419 case "$d_srand48_r_proto:$usethreads" in
18420 ":define") d_srand48_r_proto=define
18421 set d_srand48_r_proto srand48_r $hdrs
18425 case "$d_srand48_r_proto" in
18427 case "$srand48_r_proto" in
18428 ''|0) try='int srand48_r(long, struct drand48_data*);'
18429 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18431 case "$srand48_r_proto" in
18432 ''|0) d_srand48_r=undef
18434 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18435 * ) case "$srand48_r_proto" in
18436 REENTRANT_PROTO*) ;;
18437 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18439 echo "Prototype: $try" ;;
18442 *) case "$usethreads" in
18443 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18450 *) srand48_r_proto=0
18454 : see if srandom_r exists
18455 set srandom_r d_srandom_r
18457 case "$d_srandom_r" in
18459 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18460 case "$d_srandom_r_proto:$usethreads" in
18461 ":define") d_srandom_r_proto=define
18462 set d_srandom_r_proto srandom_r $hdrs
18466 case "$d_srandom_r_proto" in
18468 case "$srandom_r_proto" in
18469 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18470 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18472 case "$srandom_r_proto" in
18473 ''|0) d_srandom_r=undef
18475 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18476 * ) case "$srandom_r_proto" in
18477 REENTRANT_PROTO*) ;;
18478 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18480 echo "Prototype: $try" ;;
18483 *) case "$usethreads" in
18484 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18491 *) srandom_r_proto=0
18495 : see if prototype for setresgid is available
18497 set d_sresgproto setresgid $i_unistd unistd.h
18500 : see if prototype for setresuid is available
18502 set d_sresuproto setresuid $i_unistd unistd.h
18505 : see if stat exists
18509 : see if sys/stat.h is available
18510 set sys/stat.h i_sysstat
18513 : see if stat knows about block sizes
18515 echo "Checking to see if your struct stat has st_blocks field..." >&4
18516 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18519 : see if this is a sys/vfs.h system
18520 set sys/vfs.h i_sysvfs
18523 : see if this is a sys/statfs.h system
18524 set sys/statfs.h i_sysstatfs
18527 : Check for statfs_s
18529 echo "Checking to see if your system supports struct statfs..." >&4
18530 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
18532 case "$d_statfs_s" in
18533 "$define") echo "Yes, it does." ;;
18534 *) echo "No, it doesn't." ;;
18538 : see if struct statfs knows about f_flags
18539 case "$d_statfs_s" in
18542 echo "Checking to see if your struct statfs has f_flags field..." >&4
18543 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
18547 set d_statfs_f_flags
18551 case "$d_statfs_f_flags" in
18552 "$define") echo "Yes, it does." ;;
18553 *) echo "No, it doesn't." ;;
18556 : see what flavor, if any, of static inline is supported
18558 echo "Checking to see if your system supports static inline..."
18559 $cat > try.c <<'EOCP'
18560 #include <stdlib.h>
18561 extern int f_via_a(int x);
18562 extern int f_via_b(int x);
18563 int main(int argc, char **argv)
18572 return EXIT_SUCCESS;
18575 return EXIT_FAILURE;
18579 $cat > a.c <<'EOCP'
18580 static INLINE int f(int x) {
18591 $cat > b.c <<'EOCP'
18592 extern int f(int x);
18600 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18601 case "$perl_static_inline" in
18602 '') # Check the various possibilities, and break out on success.
18603 # For gcc, prefer __inline__, which will still permit
18604 # cflags.SH to add in -ansi.
18605 case "$gccversion" in
18606 '') xxx="inline __inline__ __inline _inline";;
18607 *) xxx="__inline__ inline __inline _inline";;
18609 for inline in $xxx; do
18610 set try -DINLINE=$inline a.c
18611 if eval $compile && $run ./try; then
18612 # Now make sure there is no external linkage of static
18614 set try -DINLINE=$inline -DUSE_B a.c b.c
18615 if eval $compile && $run ./try; then
18616 $echo "Your compiler supports static $inline, " >&4
18617 $echo "but it also creates an external definition," >&4
18618 $echo "so I won't use it." >&4
18621 $echo "Your compiler supports static $inline." >&4
18623 perl_static_inline="static $inline";
18627 $echo "Your compiler does NOT support static $inline." >&4
18632 *inline*) # Some variant of inline exists.
18633 echo "Keeping your $hint value of $perl_static_inline."
18636 static) # No inline capabilities
18637 echo "Keeping your $hint value of $perl_static_inline."
18640 *) # Unrecognized previous value -- blindly trust the supplied
18641 # value and hope it makes sense. Use old value for
18642 # d_static_inline, if there is one.
18643 echo "Keeping your $hint value of $perl_static_inline."
18644 case "$d_static_inline" in
18646 *) val=$d_static_inline ;;
18650 # Fallback to plain 'static' if nothing worked.
18651 case "$perl_static_inline" in
18653 perl_static_inline="static"
18657 set d_static_inline
18659 $rm -f a.[co] b.[co]
18662 : Check stream access
18664 Checking how to access stdio streams by file descriptor number...
18666 case "$stdio_stream_array" in
18667 '') $cat >try.c <<EOCP
18670 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18674 for s in _iob __iob __sF
18676 set try -DSTDIO_STREAM_ARRAY=$s
18677 if eval $compile; then
18678 case "`$run ./try`" in
18679 yes) stdio_stream_array=$s; break ;;
18685 case "$stdio_stream_array" in
18687 I can't figure out how to access stdio streams by file descriptor number.
18689 d_stdio_stream_array="$undef"
18692 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18694 d_stdio_stream_array="$define"
18698 : see if strcoll exists
18699 set strcoll d_strcoll
18702 : see if strerror_l exists
18703 set strerror_l d_strerror_l
18706 : see if strerror_r exists
18707 set strerror_r d_strerror_r
18709 case "$d_strerror_r" in
18711 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18712 case "$d_strerror_r_proto:$usethreads" in
18713 ":define") d_strerror_r_proto=define
18714 set d_strerror_r_proto strerror_r $hdrs
18718 case "$d_strerror_r_proto" in
18720 case "$strerror_r_proto" in
18721 ''|0) try='int strerror_r(int, char*, size_t);'
18722 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18724 case "$strerror_r_proto" in
18725 ''|0) try='int strerror_r(int, char*, int);'
18726 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18728 case "$strerror_r_proto" in
18729 ''|0) try='char* strerror_r(int, char*, size_t);'
18730 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18732 case "$strerror_r_proto" in
18733 ''|0) d_strerror_r=undef
18735 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18736 * ) case "$strerror_r_proto" in
18737 REENTRANT_PROTO*) ;;
18738 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18740 echo "Prototype: $try" ;;
18743 *) case "$usethreads" in
18744 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18751 *) strerror_r_proto=0
18755 : see if strftime exists
18756 set strftime d_strftime
18759 : see if strlcat exists
18760 set strlcat d_strlcat
18763 : see if strlcpy exists
18764 set strlcpy d_strlcpy
18767 : see if strnlen exists
18768 set strnlen d_strnlen
18771 : see if strtod exists
18772 set strtod d_strtod
18775 : see if strtol exists
18776 set strtol d_strtol
18779 : see if strtold exists
18780 set strtold d_strtold
18783 : see if strtold_l exists
18784 set strtold_l d_strtold_l
18787 : see if strtoll exists
18788 set strtoll d_strtoll
18791 case "$d_longlong-$d_strtoll" in
18794 Checking whether your strtoll() works okay...
18796 $cat >try.c <<'EOCP'
18799 #define strtoll __strtoll
18802 #define strtoll _strtoll
18805 extern long long int strtoll(char *s, char **, int);
18806 static int bad = 0;
18807 int check(char *s, long long ell, int een) {
18810 gll = strtoll(s, 0, 10);
18811 if (!((gll == ell) && (errno == een)))
18815 check(" 1", 1LL, 0);
18816 check(" 0", 0LL, 0);
18817 check("-1", -1LL, 0);
18818 check("-9223372036854775808", -9223372036854775808LL, 0);
18819 check("-9223372036854775808", -9223372036854775808LL, 0);
18820 check(" 9223372036854775807", 9223372036854775807LL, 0);
18821 check("-9223372036854775808", -9223372036854775808LL, 0);
18822 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18823 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18829 if eval $compile; then
18832 ok) echo "Your strtoll() seems to be working okay." ;;
18834 Your strtoll() doesn't seem to be working okay.
18840 echo "(I can't seem to compile the test program--assuming it doesn't)"
18846 : see if strtoq exists
18847 set strtoq d_strtoq
18850 : see if strtoul exists
18851 set strtoul d_strtoul
18854 case "$d_strtoul" in
18857 Checking whether your strtoul() works okay...
18859 $cat >try.c <<'EOCP'
18862 extern unsigned long int strtoul(char *s, char **, int);
18863 static int bad = 0;
18864 void check(char *s, unsigned long eul, int een) {
18867 gul = strtoul(s, 0, 10);
18868 if (!((gul == eul) && (errno == een)))
18872 check(" 1", 1L, 0);
18873 check(" 0", 0L, 0);
18875 case "$longsize" in
18877 $cat >>try.c <<'EOCP'
18878 check("18446744073709551615", 18446744073709551615UL, 0);
18879 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18880 #if 0 /* strtoul() for /^-/ strings is undefined. */
18881 check("-1", 18446744073709551615UL, 0);
18882 check("-18446744073709551614", 2, 0);
18883 check("-18446744073709551615", 1, 0);
18884 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18885 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18890 $cat >>try.c <<'EOCP'
18891 check("4294967295", 4294967295UL, 0);
18892 check("4294967296", 4294967295UL, ERANGE);
18893 #if 0 /* strtoul() for /^-/ strings is undefined. */
18894 check("-1", 4294967295UL, 0);
18895 check("-4294967294", 2, 0);
18896 check("-4294967295", 1, 0);
18897 check("-4294967296", 4294967295UL, ERANGE);
18898 check("-4294967297", 4294967295UL, ERANGE);
18903 : Should we write these tests to be more portable by sprintf-ing
18904 : ~0 and then manipulating that char string as input for strtol?
18907 $cat >>try.c <<'EOCP'
18914 if eval $compile; then
18915 case "`$run ./try`" in
18916 ok) echo "Your strtoul() seems to be working okay." ;;
18918 Your strtoul() doesn't seem to be working okay.
18924 echo "(I can't seem to compile the test program--assuming it doesn't)"
18930 : see if strtoull exists
18931 set strtoull d_strtoull
18934 case "$d_longlong-$d_strtoull" in
18937 Checking whether your strtoull() works okay...
18939 $cat >try.c <<'EOCP'
18942 #define strtoull __strtoull
18945 extern unsigned long long int strtoull(char *s, char **, int);
18946 static int bad = 0;
18947 int check(char *s, long long eull, int een) {
18950 gull = strtoull(s, 0, 10);
18951 if (!((gull == eull) && (errno == een)))
18955 check(" 1", 1LL, 0);
18956 check(" 0", 0LL, 0);
18957 check("18446744073709551615", 18446744073709551615ULL, 0);
18958 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18959 #if 0 /* strtoull() for /^-/ strings is undefined. */
18960 check("-1", 18446744073709551615ULL, 0);
18961 check("-18446744073709551614", 2LL, 0);
18962 check("-18446744073709551615", 1LL, 0);
18963 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18964 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18971 if eval $compile; then
18972 case "`$run ./try`" in
18973 ok) echo "Your strtoull() seems to be working okay." ;;
18975 Your strtoull() doesn't seem to be working okay.
18977 d_strtoull="$undef"
18981 echo "(I can't seem to compile the test program--assuming it doesn't)"
18982 d_strtoull="$undef"
18987 : see if strtouq exists
18988 set strtouq d_strtouq
18991 case "$d_strtouq" in
18994 Checking whether your strtouq() works okay...
18996 $cat >try.c <<'EOCP'
18999 extern unsigned long long int strtouq(char *s, char **, int);
19000 static int bad = 0;
19001 void check(char *s, unsigned long long eull, int een) {
19002 unsigned long long gull;
19004 gull = strtouq(s, 0, 10);
19005 if (!((gull == eull) && (errno == een)))
19009 check(" 1", 1LL, 0);
19010 check(" 0", 0LL, 0);
19011 check("18446744073709551615", 18446744073709551615ULL, 0);
19012 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19013 #if 0 /* strtouq() for /^-/ strings is undefined. */
19014 check("-1", 18446744073709551615ULL, 0);
19015 check("-18446744073709551614", 2LL, 0);
19016 check("-18446744073709551615", 1LL, 0);
19017 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19018 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19026 if eval $compile; then
19027 case "`$run ./try`" in
19028 ok) echo "Your strtouq() seems to be working okay." ;;
19030 Your strtouq() doesn't seem to be working okay.
19036 echo "(I can't seem to compile the test program--assuming it doesn't)"
19042 : see if strxfrm exists
19043 set strxfrm d_strxfrm
19046 : see if symlink exists
19047 set symlink d_symlink
19050 : see if syscall exists
19051 set syscall d_syscall
19054 : see if prototype for syscall is available
19056 set d_syscallproto syscall $i_unistd unistd.h
19059 : see if sysconf exists
19060 set sysconf d_sysconf
19063 : see if sys_errlist[] exists
19065 if test "X$d_syserrlst" = X; then
19066 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19067 echo "You have sys_errlist[], so we could roll our own strerror."
19068 d_syserrlst="$define"
19070 echo "You don't have sys_errlist[], so strerror() is welcome."
19071 d_syserrlst="$undef"
19075 : see if system exists
19076 set system d_system
19079 : see if tcgetpgrp exists
19080 set tcgetpgrp d_tcgetpgrp
19083 : see if tcsetpgrp exists
19084 set tcsetpgrp d_tcsetpgrp
19087 : see if prototype for telldir is available
19089 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19092 : see if tgamma exists
19093 set tgamma d_tgamma
19096 : check for thread_safe_nl_langinfo_l item
19099 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19102 #$i_stdlib I_STDLIB
19104 # include <stdlib.h>
19106 #include <string.h>
19107 #$i_langinfo I_LANGINFO
19109 # include <langinfo.h>
19111 #$i_pthread I_PTHREAD
19113 # include <pthread.h>
19115 #$i_locale I_LOCALE
19117 # include <locale.h>
19121 thread_start(void * arg)
19123 nl_langinfo(RADIXCHAR);
19127 char * main_buffer;
19128 char save_main_buffer[1000];
19129 pthread_t subthread;
19130 pthread_attr_t attr;
19132 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19134 /* If too large for our generous allowance, just assume we don't have
19136 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19140 strcpy(save_main_buffer, main_buffer);
19142 if (pthread_attr_init(&attr) != 0) {
19146 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19150 if (pthread_join(subthread, NULL) != 0) {
19154 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19157 case "$usethreads" in
19160 if eval $compile; then
19161 echo "Your system has nl_langinfo_l()..." >&4
19162 if $run ./try; then
19163 echo "and it is thread-safe (just as I'd hoped)." >&4
19164 d_thread_safe_nl_langinfo_l="$define"
19165 echo "$d_thread_safe_nl_langinfo_l" >&4
19167 echo "but it isn't thread-safe, so we won't use it." >&4
19170 echo "your system does not have nl_langinfo_l()" >&4
19173 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19175 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19176 d_thread_safe_nl_langinfo_l="$undef"
19180 : see if time exists
19182 if test "X$d_time" = X -o X"$timetype" = X; then
19183 if set time val -f d_time; eval $csym; $val; then
19184 echo 'time() found.' >&4
19186 rp="What is the type returned by time() on this system?"
19187 set time_t timetype long stdio.h sys/types.h
19190 echo 'time() not found, hope that will do.' >&4
19198 : see if timegm exists
19199 set timegm d_timegm
19202 : see if this is a sys/times.h system
19203 set sys/times.h i_systimes
19206 : see if times exists
19208 if set times val -f d_times; eval $csym; $val; then
19209 echo 'times() found.' >&4
19212 case "$i_systimes" in
19213 "$define") inc='sys/times.h';;
19215 rp="What is the type returned by times() on this system?"
19216 set clock_t clocktype long stdio.h sys/types.h $inc
19219 echo 'times() NOT found, hope that will do.' >&4
19224 : see if tmpnam_r exists
19225 set tmpnam_r d_tmpnam_r
19227 case "$d_tmpnam_r" in
19229 hdrs="$i_systypes sys/types.h define stdio.h "
19230 case "$d_tmpnam_r_proto:$usethreads" in
19231 ":define") d_tmpnam_r_proto=define
19232 set d_tmpnam_r_proto tmpnam_r $hdrs
19236 case "$d_tmpnam_r_proto" in
19238 case "$tmpnam_r_proto" in
19239 ''|0) try='char* tmpnam_r(char*);'
19240 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19242 case "$tmpnam_r_proto" in
19243 ''|0) d_tmpnam_r=undef
19245 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19246 * ) case "$tmpnam_r_proto" in
19247 REENTRANT_PROTO*) ;;
19248 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19250 echo "Prototype: $try" ;;
19253 *) case "$usethreads" in
19254 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19261 *) tmpnam_r_proto=0
19265 : see if trunc exists
19269 : see if truncate exists
19270 set truncate d_truncate
19273 : see if ttyname_r exists
19274 set ttyname_r d_ttyname_r
19276 case "$d_ttyname_r" in
19278 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19279 case "$d_ttyname_r_proto:$usethreads" in
19280 ":define") d_ttyname_r_proto=define
19281 set d_ttyname_r_proto ttyname_r $hdrs
19285 case "$d_ttyname_r_proto" in
19287 case "$ttyname_r_proto" in
19288 ''|0) try='int ttyname_r(int, char*, size_t);'
19289 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19291 case "$ttyname_r_proto" in
19292 ''|0) try='int ttyname_r(int, char*, int);'
19293 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19295 case "$ttyname_r_proto" in
19296 ''|0) try='char* ttyname_r(int, char*, int);'
19297 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19299 case "$ttyname_r_proto" in
19300 ''|0) d_ttyname_r=undef
19302 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19303 * ) case "$ttyname_r_proto" in
19304 REENTRANT_PROTO*) ;;
19305 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19307 echo "Prototype: $try" ;;
19310 *) case "$usethreads" in
19311 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19318 *) ttyname_r_proto=0
19322 : see if tzname[] exists
19324 if set tzname val -a d_tzname; eval $csym; $val; then
19326 echo 'tzname[] found.' >&4
19329 echo 'tzname[] NOT found.' >&4
19334 : Check if is a multiplatform env
19336 darwin) multiarch="$define" ;;
19338 case "$multiarch" in
19339 ''|[nN]*) multiarch="$undef" ;;
19342 : check for ordering of bytes in a UV
19344 case "$multiarch" in
19347 You seem to be doing a multiarchitecture build,
19348 skipping the byteorder check.
19354 case "$byteorder" in
19357 In the following, larger digits indicate more significance. A big-endian
19358 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19359 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19360 machines may have weird orders like 3412. A Cray will report 87654321,
19361 an Alpha will report 12345678. If the test program works the default is
19363 I'm now running the test program...
19367 #$i_stdlib I_STDLIB
19369 #include <stdlib.h>
19371 #include <sys/types.h>
19372 typedef $uvtype UV;
19382 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19384 u.l = (UV)0x04030201;
19385 for (i = 0; i < $uvsize; i++)
19386 printf("%c", u.c[i]+'0');
19393 if eval $compile && $run ./try > /dev/null; then
19396 [1-4][1-4][1-4][1-4]|12345678|87654321)
19397 echo "(The test program ran ok.)"
19398 echo "byteorder=$dflt"
19401 ????|????????) echo "(The test program ran ok.)" ;;
19402 *) echo "(The test program didn't run right for some reason.)" ;;
19407 (I can't seem to compile the test program. Guessing big-endian...)
19410 case "$xxx_prompt" in
19412 rp="What is the order of bytes in $uvtype?"
19425 : Checking 32bit alignedness
19428 Checking to see whether you can access character data unalignedly...
19430 case "$d_u32align" in
19431 '') $cat >try.c <<EOCP
19433 #$i_stdlib I_STDLIB
19435 #include <stdlib.h>
19437 #define U32 $u32type
19438 #define BYTEORDER 0x$byteorder
19440 #include <signal.h>
19442 $signal_t bletch(int s) { exit(4); }
19445 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19446 volatile U8 buf[8];
19450 if (sizeof(U32) != 4) {
19451 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19458 signal(SIGBUS, bletch);
19470 for (i = 0; i < 4; i++) {
19471 up = (U32*)(buf + i);
19472 if (! ((*up == 1 << (8*i)) || /* big-endian */
19473 (*up == 1 << (8*(3-i))) /* little-endian */
19477 printf("read failed (%x)\n", *up);
19483 for (i = 0; i < 4; i++) {
19484 up = (U32*)(buf + i);
19486 if (*up != 0xBeef) {
19487 printf("write failed (%x)\n", *up);
19501 if eval $compile_ok; then
19502 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19503 $run ./try 2>&1 >/dev/null
19506 You can access character data pretty unalignedly.
19508 d_u32align="$undef"
19511 It seems that you must access character data in an aligned manner.
19513 d_u32align="$define"
19517 rp='Can you access character data at unaligned addresses?'
19521 [yY]*) d_u32align="$undef" ;;
19522 *) d_u32align="$define" ;;
19529 : see if ualarm exists
19530 set ualarm d_ualarm
19533 : see if umask exists
19537 : see if unordered exists
19538 set unordered d_unordered
19541 : see if unsetenv exists
19542 set unsetenv d_unsetenv
19545 : see if usleep exists
19546 set usleep d_usleep
19549 : see if prototype for usleep is available
19551 set d_usleepproto usleep $i_unistd unistd.h
19554 : see if ustat exists
19558 : see if closedir exists
19559 set closedir d_closedir
19562 case "$d_closedir" in
19565 echo "Checking whether closedir() returns a status..." >&4
19567 #$i_dirent I_DIRENT /**/
19568 #$i_sysdir I_SYS_DIR /**/
19569 #$i_sysndir I_SYS_NDIR /**/
19570 #$i_systypes I_SYS_TYPES /**/
19572 #if defined(I_SYS_TYPES)
19573 #include <sys/types.h>
19575 #if defined(I_DIRENT)
19576 #include <dirent.h>
19579 #include <sys/ndir.h>
19582 #include <sys/dir.h>
19586 int main() { return closedir(opendir(".")); }
19589 if eval $compile_ok; then
19590 if $run ./try > /dev/null 2>&1 ; then
19591 echo "Yes, it does."
19594 echo "No, it doesn't."
19598 echo "(I can't seem to compile the test program--assuming it doesn't)"
19606 set d_void_closedir
19610 : see if there is a wait4
19614 : see if waitpid exists
19615 set waitpid d_waitpid
19620 $cat >try.c <<'EOCP'
19626 return (wcscmp (s, s) ? 1 : 0);
19631 if eval $compile; then
19634 0) echo "A working wcscmp() found." >&4
19636 *) echo "wcscmp() found, but it doesn't work" >&4
19640 echo "wcscmp() NOT found." >&4
19646 : see if wcstombs exists
19647 set wcstombs d_wcstombs
19652 $cat >try.c <<'EOCP'
19657 wchar_t dst[4], *src = L" ";
19659 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19664 if eval $compile; then
19667 0) echo "A working wcsxfrm() found." >&4
19669 *) echo "wcsxfrm() found, but it doesn't work" >&4
19673 echo "wcsxfrm() NOT found." >&4
19679 : see if wctomb exists
19680 set wctomb d_wctomb
19683 : see if writev exists
19684 set writev d_writev
19687 : check for alignment requirements
19689 case "$alignbytes" in
19690 '') echo "Checking alignment constraints..." >&4
19699 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19704 if eval $compile_ok; then
19708 echo "(I can't seem to compile the test program...)"
19710 case "$multiarch" in
19712 : The usual safe value is 8, but Darwin with -Duselongdouble
19713 : needs 16. Hence, we will take 8 as a minimum, but allow
19714 : Configure to pick a larger value if needed.
19715 if $test "$dflt" -lt 8; then
19717 echo "Setting alignment to 8 for multiarch support.">&4
19722 *) dflt="$alignbytes"
19725 rp="Doubles must be aligned on a how-many-byte boundary?"
19730 : set the base revision
19733 : length of character in bytes. Is always 1, otherwise it is not C
19734 : This used to be a test using sizeof
19737 : Check for the number of bits in a character
19738 case "$charbits" in
19739 '') echo "Checking how long a character is (in bits)..." >&4
19746 for (c = 1, n = 0; c; c <<= 1, n++) ;
19747 printf ("%d\n", n);
19752 if eval $compile_ok; then
19756 echo "(I can't seem to compile the test program. Guessing...)"
19763 rp="What is the length of a character (in bits)?"
19767 case "$charbits" in
19770 Your system has an unsigned character size of $charbits bits, which
19771 is rather unusual (normally it is 8 bits). Perl likely will not work
19772 correctly on your system, with subtle bugs in various places.
19774 rp='Do you really want to continue?'
19778 [yY]) echo >&4 "Okay, continuing." ;;
19783 : how do we concatenate cpp tokens here?
19785 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19786 $cat >cpp_stuff.c <<'EOCP'
19787 #define RCAT(a,b)a/**/b
19788 #define ACAT(a,b)a ## b
19792 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19793 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19794 echo "Oh! Smells like ANSI's been here." >&4
19795 echo "We can catify or stringify, separately or together!"
19797 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19798 echo "Ah, yes! The good old days!" >&4
19799 echo "However, in the good old days we don't know how to stringify and"
19800 echo "catify at the same time."
19804 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19805 You're going to have to edit the values of CAT[2-5] in config.h...
19807 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19811 : see if this is a db.h system
19817 : Check db version.
19819 echo "Checking Berkeley DB version ..." >&4
19825 #include <sys/types.h>
19827 #$i_stdlib I_STDLIB
19829 #include <stdlib.h>
19832 int main(int argc, char *argv[])
19834 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19835 int Major, Minor, Patch ;
19836 unsigned long Version ;
19837 (void)db_version(&Major, &Minor, &Patch) ;
19839 printf("%d %d %d %d %d %d\n",
19840 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19841 Major, Minor, Patch);
19844 printf("You have Berkeley DB Version 2 or greater.\n");
19846 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19847 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19848 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19849 Major, Minor, Patch) ;
19851 /* check that db.h & libdb are compatible */
19852 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19853 printf("db.h and libdb are incompatible.\n") ;
19857 printf("db.h and libdb are compatible.\n") ;
19859 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19860 + DB_VERSION_PATCH ;
19862 /* needs to be >= 2.3.4 */
19863 if (Version < 2003004) {
19864 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19865 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19871 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19876 printf("You have Berkeley DB Version 1.\n");
19877 exit(0); /* DB version < 2: the coast is clear. */
19879 exit(1); /* <db.h> not Berkeley DB? */
19885 if eval $compile_ok && $run ./try; then
19886 echo 'Looks OK.' >&4
19888 db_version_major=$1
19889 db_version_minor=$2
19890 db_version_patch=$3
19892 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19896 : Remove db from list of libraries to use
19897 echo "Removing unusable -ldb from library list" >&4
19898 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19901 echo "libs = $libs" >&4
19911 : Check the return type needed for hash
19913 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19919 #include <sys/types.h>
19922 #ifndef DB_VERSION_MAJOR
19923 u_int32_t hash_cb (const void* ptr, size_t size)
19929 info.hash = hash_cb;
19933 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19934 if $contains warning try.out >>/dev/null 2>&1 ; then
19937 db_hashtype='u_int32_t'
19940 : XXX Maybe we should just give up here.
19941 db_hashtype=u_int32_t
19943 echo "Help: I can't seem to compile the db test program." >&4
19944 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19947 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19949 *) db_hashtype=u_int32_t
19954 : Check the return type needed for prefix
19956 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19962 #include <sys/types.h>
19965 #ifndef DB_VERSION_MAJOR
19966 size_t prefix_cb (const DBT *key1, const DBT *key2)
19972 info.prefix = prefix_cb;
19976 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19977 if $contains warning try.out >>/dev/null 2>&1 ; then
19978 db_prefixtype='int'
19980 db_prefixtype='size_t'
19983 db_prefixtype='size_t'
19984 : XXX Maybe we should just give up here.
19986 echo "Help: I can't seem to compile the db test program." >&4
19987 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19990 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19992 *) db_prefixtype='size_t'
19996 : Include . in @INC
19999 Historically Perl has provided a final fallback of the current working
20000 directory '.' when searching for a library. This, however, can lead to
20001 problems when a Perl program which loads optional modules is called from
20002 a shared directory. This can lead to executing unexpected code.
20006 # When changing to exclude by default:
20007 case "$default_inc_excludes_dot" in
20008 $undef|false|[nN]*) dflt="n" ;;
20011 # To turn exclude off by default:
20012 #case "$default_inc_excludes_dot" in
20013 # $define|true|[yY]*) dflt="y" ;;
20017 rp='Exclude '.' from @INC by default? '
20020 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20021 *) default_inc_excludes_dot="$define" ;;
20024 : Check what kind of inf/nan your system has
20025 $echo "Checking the kind of infinities and nans you have..." >&4
20026 $echo "(The following tests may crash. That's okay.)" >&4
20028 #define DOUBLESIZE $doublesize
20029 #$d_longdbl HAS_LONG_DOUBLE
20030 #ifdef HAS_LONG_DOUBLE
20031 #define LONG_DOUBLESIZE $longdblsize
20032 #define LONG_DOUBLEKIND $longdblkind
20035 #include <string.h>
20037 /* Note that whether the sign bit is on or off
20038 * for NaN depends on the CPU/FPU, and possibly
20039 * can be affected by the build toolchain.
20041 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20042 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20043 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20044 * (respectively) as opposed to the more usual
20045 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20047 * Pre-IEEE-754 floating point format do not even have inf/nan support
20048 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20049 * to even mention, causing immediate SIGFPE or equivalent: this is
20050 * the case with VAX floating point, for example.
20052 static void bytes(void *v, unsigned int n) {
20053 unsigned char *p = (unsigned char *)v;
20055 for (i = 0; i < n; i++) {
20056 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20059 int main(int argc, char *argv[]) {
20060 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20061 * because some compilers are 'smart' and not only warn but refuse to
20062 * compile such 'illegal' values. */
20063 double dinf = exp(1e9);
20064 double dnan = sqrt(-1.0);
20065 #ifdef HAS_LONG_DOUBLE
20066 long double ldinf = (long double)exp(1e9);
20067 long double ldnan = (long double)sqrt(-1.0);
20068 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20069 /* the 80-bit long doubles might have garbage in their excess bytes */
20070 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20071 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20074 switch (argv[1][0]) {
20075 case '1': bytes(&dinf, sizeof(dinf)); break;
20076 case '2': bytes(&dnan, sizeof(dnan)); break;
20077 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20078 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20086 if eval $compile; then
20087 doubleinfbytes=`$run ./try 1`
20088 doublenanbytes=`$run ./try 2`
20089 case "$d_longdbl" in
20091 longdblinfbytes=`$run ./try 3`
20092 longdblnanbytes=`$run ./try 4`
20096 # Defaults in case the above test program failed.
20097 case "$doublekind" in
20098 1) # IEEE 754 32-bit LE
20099 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20100 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20102 2) # IEEE 754 32-bit BE
20103 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20104 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20106 3) # IEEE 754 64-bit LE
20107 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20108 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20110 4) # IEEE 754 64-bit BE
20111 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20112 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20114 5) # IEEE 754 128-bit LE
20115 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20116 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20118 6) # IEEE 754 128-bit BE
20119 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20120 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20122 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20123 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20124 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20126 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20127 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20128 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20130 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20131 doubleinfbytes=$undef
20132 doublenanbytes=$undef
20135 doubleinfbytes=$undef
20136 doublenanbytes=$undef
20139 case "$longdblkind" in
20140 1) # IEEE 754 128-bit LE
20141 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20142 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20144 2) # IEEE 754 128-bit BE
20145 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20146 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20148 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20149 case "$longdblsize" in
20150 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20151 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20152 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20155 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20156 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20159 longdblinfbytes=$undef
20160 longdblnanbytes=$undef
20164 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20165 case "$longdblsize" in
20166 12) # 32-bit system
20167 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20168 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20170 16) # 64-bit system
20171 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20172 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20175 longdblinfbytes=$undef
20176 longdblnanbytes=$undef
20180 5) # 128-bit LE-LE "double double"
20181 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20182 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20184 6) # 128-bit BE-BE "double double"
20185 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20186 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20188 7) # 128-bit LE-BE "double double"
20189 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20190 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20192 8) # 128-bit BE-LE "double double"
20193 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20194 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20196 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20197 longdblinfbytes=$undef
20198 longdblnanbytes=$undef
20201 longdblinfbytes=$undef
20202 longdblnanbytes=$undef
20206 # In case the program crashed the values are empty, turn them undef.
20207 case "$doubleinfbytes" in
20208 '') doubleinfbytes=$undef ;;
20210 case "$doublenanbytes" in
20211 '') doublenanbytes=$undef ;;
20213 case "$longdblinfbytes" in
20214 '') longdblinfbytes=$undef ;;
20216 case "$longdblnanbytes" in
20217 '') longdblnanbytes=$undef ;;
20221 : Check the length of the double mantissa
20222 $echo "Checking how many mantissa bits your doubles have..." >&4
20224 #$i_sunmath I_SUNMATH
20227 # include <sunmath.h>
20229 #ifdef DBL_MANT_DIG
20230 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20233 int main(int argc, char *argv[]) {
20235 printf("%d\n", BITS);
20241 if eval $compile; then
20242 doublemantbits=`$run ./try`
20244 doublemantbits="$undef"
20248 : Check the length of the longdouble mantissa
20249 $echo "Checking how many mantissa bits your long doubles have..." >&4
20251 #$i_sunmath I_SUNMATH
20254 # include <sunmath.h>
20256 #$d_longdbl HAS_LONG_DOUBLE
20257 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20258 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20259 /* This format has no implicit bit. Beware, however, that for
20260 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20261 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20262 * and the top bit must have been one since 387, zero is plain invalid.
20263 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20264 # define BITS LDBL_MANT_DIG
20265 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20266 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20267 * reason e.g. Irix thinks 107. But in any case, we want only
20268 * the number of real bits, the implicit bits are of no interest. */
20269 # define BITS 2 * (DBL_MANT_DIG - 1)
20271 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20275 int main(int argc, char *argv[]) {
20277 printf("%d\n", BITS);
20283 if eval $compile; then
20284 longdblmantbits=`$run ./try`
20286 longdblmantbits="$undef"
20290 : Check the length of the NV mantissa
20291 $echo "Checking how many mantissa bits your NVs have..." >&4
20292 if test "X$usequadmath" = "X$define"; then
20293 nvmantbits=112 # 128-1-15
20295 if test "X$nvsize" = "X$doublesize"; then
20296 nvmantbits="$doublemantbits"
20298 if test "X$nvsize" = "X$longdblsize"; then
20299 nvmantbits="$longdblmantbits"
20301 nvmantbits="$undef"
20306 : How can we generate normalized random numbers ?
20308 echo "Using our internal random number implementation..." >&4
20311 *-Dmy_rand=*|*-Dmy_srand=*)
20312 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20313 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20314 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20315 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20319 randfunc=Perl_drand48
20320 drand01="Perl_drand48()"
20321 seedfunc="Perl_drand48_init"
20325 : Probe whether dtrace builds an object, as newer Illumos requires an input
20326 : object file that uses at least one of the probes defined in the .d file
20327 case "$usedtrace" in
20329 case "$dtracexnolibs" in
20330 $define|true|[yY]*)
20331 dtracexnolibs=$define
20332 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20335 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20336 dtracexnolibs=$define
20337 echo "Your dtrace accepts -xnolibs"
20338 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20339 dtracexnolibs=$undef
20340 echo "Your dtrace doesn't accept -xnolibs"
20342 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20347 dtracexnolibs=$undef
20348 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20351 case $dtracexnolibs in
20352 $define) xnolibs=-xnolibs ;;
20356 case "$dtraceobject" in
20357 $define|true|[yY]*)
20358 dtraceobject=$define
20362 #include "perldtrace.h"
20364 PERL_LOADED_FILE("dummy");
20368 dtraceobject=$undef
20369 if $cc -c -o try.o $optimize $ccflags try.c \
20370 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20371 dtraceobject=$define
20372 echo "Your dtrace builds an object file"
20375 *) dtraceobject=$undef ;;
20377 $rm_try perldtrace.o perldtrace.h
20380 : Determine if this is an EBCDIC system
20382 echo "Determining whether or not we are on an EBCDIC system..." >&4
20383 $cat >try.c <<'EOM'
20386 if ('M'==0xd4) return 0;
20393 if eval $compile_ok; then
20394 if $run ./try; then
20395 echo "You seem to speak EBCDIC." >&4
20398 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20401 echo "I'm unable to compile the test program." >&4
20402 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20408 : Check how to flush
20411 Checking how to flush all pending stdio output...
20413 # I only know how to find the first 32 possibly open files on SunOS.
20414 # See also hints/sunos_4_1.sh and util.c --AD
20416 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20418 $cat >>try.c <<EOCP
20420 #$i_stdlib I_STDLIB
20422 #include <stdlib.h>
20424 #$i_unistd I_UNISTD
20426 # include <unistd.h>
20428 #$d_sysconf HAS_SYSCONF
20429 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20430 #ifdef HAS_STDIO_STREAM_ARRAY
20431 # define STDIO_STREAM_ARRAY $stdio_stream_array
20436 p = fopen("try.out", "w");
20440 # ifdef TRY_FPRINTF
20444 #ifdef TRY_FFLUSH_NULL
20447 #ifdef TRY_FFLUSH_ALL
20449 long open_max = -1;
20450 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20451 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20453 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20454 open_max = sysconf(_SC_OPEN_MAX);
20457 open_max = FOPEN_MAX;
20460 open_max = OPEN_MAX;
20469 # ifdef HAS_STDIO_STREAM_ARRAY
20470 if (open_max > 0) {
20472 for (i = 0; i < open_max; i++)
20473 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20474 STDIO_STREAM_ARRAY[i]._file < open_max &&
20475 STDIO_STREAM_ARRAY[i]._flag)
20476 fflush(&STDIO_STREAM_ARRAY[i]);
20484 : first we have to find out how _not_ to flush
20486 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20488 set try -DTRY_FPUTC
20489 if eval $compile; then
20490 $run ./try 2>/dev/null
20493 if $test ! -s try.out -a "X$code" = X42; then
20499 set try -DTRY_FPRINTF
20500 if eval $compile; then
20501 $run ./try 2>/dev/null
20504 if $test ! -s try.out -a "X$code" = X42; then
20505 output=-DTRY_FPRINTF
20511 : check for fflush NULL behavior
20512 case "$fflushNULL" in
20513 '') set try -DTRY_FFLUSH_NULL $output
20514 if eval $compile; then
20515 $run ./try 2>/dev/null
20518 if $test -s try.out -a "X$code" = X42; then
20519 fflushNULL="`$cat try.out`"
20521 if $test "X$code" != X42; then
20523 (If this test failed, don't worry, we'll try another method shortly.)
20528 $rm -f core try.core core.try.*
20529 case "$fflushNULL" in
20531 Your fflush(NULL) works okay for output streams.
20532 Let's see if it clobbers input pipes...
20534 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20535 # bug that improperly flushes the input end of pipes. So we avoid the
20536 # autoflush on fork/system/exec support for now. :-(
20537 $cat >tryp.c <<EOCP
20540 main(int argc, char **argv)
20546 while ((i = getc(stdin)) != -1
20547 && (*bp++ = i) != '\n'
20548 && bp < &buf[1024])
20551 fprintf(stdout, "%s", buf);
20559 fflushNULL="$define"
20561 if eval $compile; then
20563 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20564 if $test "X$targethost" != X; then
20567 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20569 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20571 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20573 fflush(NULL) seems to behave okay with input streams.
20575 fflushNULL="$define"
20578 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20580 fflushNULL="$undef"
20583 $rm -f core tryp.c tryp.core core.tryp.*
20586 Your fflush(NULL) isn't working (contrary to ANSI C).
20588 fflushNULL="$undef"
20591 Cannot figure out whether your fflush(NULL) works or not.
20592 I'm assuming it doesn't (contrary to ANSI C).
20594 fflushNULL="$undef"
20598 $define|true|[yY]*)
20599 fflushNULL="$define"
20602 fflushNULL="$undef"
20605 : check explicit looping only if NULL did not work, and if the pipe
20606 : bug does not show up on an explicit flush too
20607 case "$fflushNULL" in
20609 $cat >tryp.c <<EOCP
20612 main(int argc, char **argv)
20618 while ((i = getc(stdin)) != -1
20619 && (*bp++ = i) != '\n'
20620 && bp < &buf[1024])
20623 fprintf(stdout, "%s", buf);
20632 if eval $compile; then
20634 if $test "X$targethost" != X; then
20637 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20639 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20641 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20643 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20645 : now check for fflushall behaviour
20646 case "$fflushall" in
20647 '') set try -DTRY_FFLUSH_ALL $output
20648 if eval $compile; then
20650 (Now testing the other method--but note that this also may fail.)
20652 $run ./try 2>/dev/null
20655 if $test -s try.out -a "X$code" = X42; then
20656 fflushall="`$cat try.out`"
20660 case "$fflushall" in
20662 Whew. Flushing explicitly all the stdio streams works.
20664 fflushall="$define"
20667 Sigh. Flushing explicitly all the stdio streams doesn't work.
20672 Cannot figure out whether flushing stdio streams explicitly works or not.
20673 I'm assuming it doesn't.
20679 "$define"|true|[yY]*)
20680 fflushall="$define"
20688 All is futile. Even fflush(stdin) clobbers input pipes!
20695 $rm -f core tryp.c tryp.core core.tryp.*
20697 *) fflushall="$undef"
20701 case "$fflushNULL$fflushall" in
20704 OK, I give up. I cannot figure out how to flush pending stdio output.
20705 We won't be flushing handles at all before fork/exec/popen.
20711 : Store the full pathname to the ar program for use in the C program
20712 : Respect a hint or command line value for full_ar.
20717 : Store the full pathname to the sed program for use in the C program
20720 : see what type gids are declared as in the kernel
20722 echo "Looking for the type for group ids returned by getgid()."
20723 set gid_t gidtype xxx stdio.h sys/types.h
20727 xxx=`./findhdr sys/user.h`
20728 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20730 unsigned) dflt="$1 $2" ;;
20734 *) dflt="$gidtype";;
20737 gid_t) echo "gid_t found." ;;
20738 *) rp="What is the type for group ids returned by getgid()?"
20744 : Check the size of GID
20747 *_t) zzz="$gidtype" ;;
20750 echo "Checking the size of $zzz..." >&4
20752 #include <sys/types.h>
20754 #$i_stdlib I_STDLIB
20756 #include <stdlib.h>
20759 printf("%d\n", (int)sizeof($gidtype));
20764 if eval $compile_ok; then
20768 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20771 echo "Your $zzz is $gidsize bytes long."
20776 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20780 : Check if GID is signed
20783 *_t) zzz="$gidtype" ;;
20786 echo "Checking the sign of $zzz..." >&4
20788 #include <sys/types.h>
20799 if eval $compile; then
20803 echo "(I can't execute the test program--guessing unsigned.)" >&4
20807 1) echo "Your $zzz is unsigned." ;;
20808 -1) echo "Your $zzz is signed." ;;
20814 echo "(I can't compile the test program--guessing unsigned.)" >&4
20818 : Check 64bit sizes
20821 if $test X"$quadtype" != X; then
20823 echo "Checking how to print 64-bit integers..." >&4
20825 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20826 $cat >try.c <<'EOCP'
20827 #include <sys/types.h>
20830 int q = 12345678901;
20831 printf("%ld\n", q);
20835 if eval $compile; then
20839 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20840 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20841 echo "We will use %d."
20847 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20848 $cat >try.c <<'EOCP'
20849 #include <sys/types.h>
20852 long q = 12345678901;
20853 printf("%ld\n", q);
20857 if eval $compile; then
20861 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20862 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20863 echo "We will use %ld."
20869 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20870 $cat >try.c <<'EOCP'
20871 #include <sys/types.h>
20872 #include <inttypes.h>
20875 int64_t q = 12345678901;
20876 printf("%" PRId64 "\n", q);
20880 if eval $compile; then
20884 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20885 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20886 echo "We will use the C9X style."
20892 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20894 #include <sys/types.h>
20897 $quadtype q = 12345678901;
20898 printf("%Ld\n", q);
20902 if eval $compile; then
20906 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20907 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20908 echo "We will use %Ld."
20914 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20915 $cat >try.c <<'EOCP'
20916 #include <sys/types.h>
20919 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20920 printf("%lld\n", q);
20924 if eval $compile; then
20928 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20929 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20930 echo "We will use the %lld style."
20936 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20938 #include <sys/types.h>
20941 $quadtype q = 12345678901;
20942 printf("%qd\n", q);
20946 if eval $compile; then
20950 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20951 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20952 echo "We will use %qd."
20958 if $test X"$sPRId64" = X; then
20959 echo "Cannot figure out how to print 64-bit integers." >&4
20966 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20967 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20969 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20970 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20974 : Check format strings for internal types
20976 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20978 if $test X"$ivsize" = X8; then
20979 ivdformat="$sPRId64"
20980 uvuformat="$sPRIu64"
20981 uvoformat="$sPRIo64"
20982 uvxformat="$sPRIx64"
20983 uvXUformat="$sPRIXU64"
20985 if $test X"$ivsize" = X"$longsize"; then
20992 if $test X"$ivsize" = X"$intsize"; then
21000 if $test X"$ivsize" = X"$shortsize"; then
21011 if $test X"$usequadmath" = X"$define"; then
21019 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21020 nveformat="$sPRIeldbl"
21021 nvfformat="$sPRIfldbl"
21022 nvgformat="$sPRIgldbl"
21023 nvEUformat="$sPRIEUldbl"
21024 nvFUformat="$sPRIFUldbl"
21025 nvGUformat="$sPRIGUldbl"
21036 case "$ivdformat" in
21037 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21042 : Check format string for GID
21045 $echo "Checking the format string to be used for gids..." >&4
21048 -1) if $test X"$gidsize" = X"$ivsize"; then
21049 gidformat="$ivdformat"
21051 if $test X"$gidsize" = X"$longsize"; then
21054 if $test X"$gidsize" = X"$intsize"; then
21057 if $test X"$gidsize" = X"$shortsize"; then
21064 *) if $test X"$gidsize" = X"$uvsize"; then
21065 gidformat="$uvuformat"
21067 if $test X"$gidsize" = X"$longsize"; then
21070 if $test X"$gidsize" = X"$intsize"; then
21073 if $test X"$gidsize" = X"$shortsize"; then
21082 : see if getgroups exists
21083 set getgroups d_getgrps
21086 : see if setgroups exists
21087 set setgroups d_setgrps
21090 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21092 case "$d_getgrps$d_setgrps" in
21094 case "$groupstype" in
21095 '') dflt="$gidtype" ;;
21096 *) dflt="$groupstype" ;;
21099 What type of pointer is the second argument to getgroups() and setgroups()?
21100 Usually this is the same as group ids, $gidtype, but not always.
21103 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21107 *) groupstype="$gidtype";;
21110 : check whether make sets MAKE
21112 echo "Checking if your $make program sets \$(MAKE)..." >&4
21113 case "$make_set_make" in
21115 $sed 's/^X //' > testmake.mak << 'EOF'
21117 X @echo 'maketemp="$(MAKE)"'
21119 case "`$make -f testmake.mak 2>/dev/null`" in
21120 *maketemp=*) make_set_make='#' ;;
21121 *) make_set_make="MAKE=$make" ;;
21123 $rm -f testmake.mak
21126 case "$make_set_make" in
21127 '#') echo "Yup, it does.";;
21128 *) echo "Nope, it doesn't.";;
21131 : see what type is used for mode_t
21132 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21133 set mode_t modetype int stdio.h sys/types.h
21136 : see if we need va_copy
21139 #include <stdarg.h>
21141 #include <stdlib.h>
21142 #include <signal.h>
21145 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21147 return vfprintf(f, fmt, *valp);
21151 myvfprintf(FILE *f, const char *fmt, va_list val)
21153 return ivfprintf(f, fmt, &val);
21157 myprintf(char *fmt, ...)
21160 va_start(val, fmt);
21161 return myvfprintf(stdout, fmt, val);
21165 main(int ac, char **av)
21167 signal(SIGSEGV, exit);
21169 myprintf("%s%cs all right, then\n", "that", '\'');
21174 if eval $compile && $run ./try 2>&1 >/dev/null; then
21175 case "`$run ./try`" in
21176 "that's all right, then")
21182 yes) echo "It seems that you don't need va_copy()." >&4
21183 need_va_copy="$undef"
21185 *) echo "It seems that va_copy() or similar will be needed." >&4
21186 need_va_copy="$define"
21191 : see what type is used for size_t
21192 rp="What is the type used for the length parameter for string functions?"
21193 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21196 : check for type of arguments to gethostbyaddr.
21197 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21198 case "$d_gethbyaddr" in
21202 Checking to see what type of arguments are accepted by gethostbyaddr().
21204 hdrs="$define sys/types.h
21205 $d_socket sys/socket.h
21206 $i_niin netinet/in.h
21208 $i_unistd unistd.h"
21209 : The first arg can 'char *' or 'void *'
21210 : The second arg is some of integral type
21211 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21212 for yyy in size_t long int; do
21213 case "$netdb_host_type" in
21214 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21215 if ./protochk "$try" $hdrs; then
21216 echo "Your system accepts $xxx for the first arg."
21217 echo "...and $yyy for the second arg."
21218 netdb_host_type="$xxx"
21219 netdb_hlen_type="$yyy"
21225 : In case none of those worked, prompt the user.
21226 case "$netdb_host_type" in
21227 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21230 netdb_host_type=$ans
21231 rp='What is the type for the 2nd argument to gethostbyaddr?'
21234 netdb_hlen_type=$ans
21238 *) : no gethostbyaddr, so pick harmless defaults
21239 netdb_host_type='char *'
21240 netdb_hlen_type="$sizetype"
21243 # Remove the "const" if needed. -- but then we'll have a
21245 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21248 : check for type of argument to gethostbyname.
21249 if test "X$netdb_name_type" = X ; then
21250 case "$d_gethbyname" in
21254 Checking to see what type of argument is accepted by gethostbyname().
21256 hdrs="$define sys/types.h
21257 $d_socket sys/socket.h
21258 $i_niin netinet/in.h
21260 $i_unistd unistd.h"
21261 for xxx in "const char *" "char *"; do
21262 case "$netdb_name_type" in
21263 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21264 if ./protochk "$try" $hdrs; then
21265 echo "Your system accepts $xxx."
21266 netdb_name_type="$xxx"
21271 : In case none of those worked, prompt the user.
21272 case "$netdb_name_type" in
21273 '') rp='What is the type for the 1st argument to gethostbyname?'
21276 netdb_name_type=$ans
21280 *) : no gethostbyname, so pick harmless default
21281 netdb_name_type='char *'
21286 : check for type of 1st argument to getnetbyaddr.
21287 if test "X$netdb_net_type" = X ; then
21288 case "$d_getnbyaddr" in
21292 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21294 hdrs="$define sys/types.h
21295 $d_socket sys/socket.h
21296 $i_niin netinet/in.h
21298 $i_unistd unistd.h"
21299 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21300 case "$netdb_net_type" in
21301 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21302 if ./protochk "$try" $hdrs; then
21303 echo "Your system accepts $xxx."
21304 netdb_net_type="$xxx"
21309 : In case none of those worked, prompt the user.
21310 case "$netdb_net_type" in
21311 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21314 netdb_net_type=$ans
21318 *) : no getnetbyaddr, so pick harmless default
21319 netdb_net_type='long'
21323 : locate the preferred pager for this system
21330 [a-zA-Z]:/*) dflt=$pg;;
21334 [a-zA-Z]:/*) dflt=$more;;
21338 [a-zA-Z]:/*) dflt=$less;;
21341 '') dflt=/usr/ucb/more;;
21349 rp='What pager is used on your system?'
21353 : see if ar generates random libraries by itself
21355 echo "Checking how to generate random libraries on your machine..." >&4
21356 echo 'int bar1() { return bar2(); }' > bar1.c
21357 echo 'int bar2() { return 2; }' > bar2.c
21359 #$i_stdlib I_STDLIB
21361 #include <stdlib.h>
21363 int main() { printf("%d\n", bar1()); exit(0); }
21365 $cc $ccflags -c bar1.c >/dev/null 2>&1
21366 $cc $ccflags -c bar2.c >/dev/null 2>&1
21367 $cc $ccflags -c foo.c >/dev/null 2>&1
21368 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21369 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21370 $run ./foobar >/dev/null 2>&1; then
21371 echo "$ar appears to generate random libraries itself."
21373 if [ "X$ranlib" = "X" ]; then
21376 elif $ar s bar$_a >/dev/null 2>&1 &&
21377 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21378 $run ./foobar >/dev/null 2>&1; then
21379 echo "a table of contents needs to be added with '$ar s'."
21382 elif $ar ts bar$_a >/dev/null 2>&1 &&
21383 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21384 $run ./foobar >/dev/null 2>&1; then
21385 echo "a table of contents needs to be added with '$ar ts'."
21392 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21393 $test -f $ranlib || ranlib=''
21396 if $test -n "$ranlib"; then
21397 echo "your system has '$ranlib'; we'll use that."
21400 echo "your system doesn't seem to support random libraries"
21401 echo "so we'll use lorder and tsort to order the libraries."
21408 : Check the max offset that gmtime and localtime accept
21409 echo "Checking max offsets that gmtime () accepts"
21411 case "$sGMTIME_min/$sGMTIME_max" in
21414 #include <sys/types.h>
21422 void gm_check (time_t t, int min_year, int max_year)
21425 if ( tmp == NULL ||
21426 /* Check tm_year overflow */
21427 tmp->tm_year < min_year || tmp->tm_year > max_year)
21438 gm_check (MAXLONG, 69, 0x7fffffff);
21440 if (tmp == NULL || tmp->tm_year < 0) {
21441 for (i = 63; i >= 0; i--) {
21442 time_t x = pt | ((time_t)1 << i);
21443 if (x < 0 || x < pt) continue;
21444 gm_check (x, 69, 0x7fffffff);
21447 printf ("sGMTIME_max=%ld\n", pt);
21456 gm_check (MINLONG, -1900, 70);
21459 for (i = 36; i >= 0; i--) {
21460 time_t x = pt - ((time_t)1 << i);
21461 if (x > 0) continue;
21462 gm_check (x, -1900, 70);
21465 printf ("sGMTIME_min=%ld\n", pt);
21469 int main (int argc, char *argv[])
21471 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21478 if eval $compile; then
21479 eval `$run ./try 2>/dev/null`
21481 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21487 echo "Checking max offsets that localtime () accepts"
21489 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21492 #include <sys/types.h>
21500 void local_check (time_t t, int min_year, int max_year)
21502 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21505 tmp = localtime (&t);
21506 if ( tmp == NULL ||
21507 /* Check tm_year overflow */
21508 tmp->tm_year < min_year || tmp->tm_year > max_year)
21512 } /* local_check */
21519 local_check (MAXLONG, 69, 0x7fffffff);
21521 if (tmp == NULL || tmp->tm_year < 0) {
21522 for (i = 63; i >= 0; i--) {
21523 time_t x = pt | ((time_t)1 << i);
21524 if (x < 0 || x < pt) continue;
21525 local_check (x, 69, 0x7fffffff);
21528 printf ("sLOCALTIME_max=%ld\n", pt);
21537 local_check (MINLONG, -1900, 70);
21540 for (i = 36; i >= 0; i--) {
21541 time_t x = pt - ((time_t)1 << i);
21542 if (x > 0) continue;
21543 local_check (x, -1900, 70);
21546 printf ("sLOCALTIME_min=%ld\n", pt);
21550 int main (int argc, char *argv[])
21558 if eval $compile; then
21559 eval `$run ./try 2>/dev/null`
21561 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21567 : check for type of arguments to select.
21568 case "$selecttype" in
21569 '') case "$d_select" in
21573 Checking to see what type of arguments are accepted by select().
21575 hdrs="$define sys/types.h
21576 $i_systime sys/time.h
21577 $i_sysselct sys/select.h
21578 $d_socket sys/socket.h"
21579 : The first arg can be int, unsigned, or size_t
21580 : The last arg may or may not be 'const'
21582 : void pointer has been seen but using that
21583 : breaks the selectminbits test
21584 for xxx in 'fd_set *' 'int *'; do
21585 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21586 for tmo in 'struct timeval *' 'const struct timeval *'; do
21588 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21589 if ./protochk "$try" $hdrs; then
21590 echo "Your system accepts $xxx."
21599 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21600 case "$d_fd_set" in
21601 $define) dflt="fd_set *" ;;
21610 *) : no select, so pick a harmless default
21617 : check for the select 'width'
21618 case "$selectminbits" in
21619 '') safebits=`expr $ptrsize \* 8`
21620 case "$d_select" in
21624 Checking to see on how many bits at a time your select() operates...
21627 #include <sys/types.h>
21629 #$i_systime I_SYS_TIME
21630 #$i_systimek I_SYS_TIME_KERNEL
21635 # ifdef I_SYS_TIME_KERNEL
21638 # include <sys/time.h>
21639 # ifdef I_SYS_TIME_KERNEL
21643 #$i_sysselct I_SYS_SELECT
21644 #ifdef I_SYS_SELECT
21645 #include <sys/select.h>
21647 #$d_socket HAS_SOCKET
21649 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21652 #$i_stdlib I_STDLIB
21654 #include <stdlib.h>
21657 #define S sizeof(*(b))
21659 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21660 #define NBITS (NBYTES * 8)
21662 char *s = (char *)malloc(NBYTES);
21671 fp = fopen("try.c", "r");
21677 b = ($selecttype)s;
21678 for (i = 0; i < NBITS; i++)
21682 select(fd + 1, b, 0, 0, &t);
21683 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21685 printf("%d\n", i + 1);
21690 if eval $compile_ok; then
21691 selectminbits=`$run ./try 2>/dev/null`
21692 case "$selectminbits" in
21694 Cannot figure out on how many bits at a time your select() operates.
21695 I'll play safe and guess it is $safebits bits.
21697 selectminbits=$safebits
21698 bits="$safebits bits"
21701 *) bits="$selectminbits bits" ;;
21703 echo "Your select() operates on $bits at a time." >&4
21705 rp='What is the minimum number of bits your select() operates on?'
21706 case "$byteorder" in
21707 12345678) dflt=64 ;;
21713 selectminbits="$val"
21717 *) : no select, so pick a harmless default
21718 selectminbits=$safebits
21724 : Trace out the files included by signal.h, then look for SIGxxx names.
21725 case "$sig_num_init" in
21727 if [ "X$fieldn" = X ]; then
21728 : Just make some guesses. We check them later.
21729 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21731 xxx=`echo '#include <signal.h>' |
21732 $cppstdin $cppminus $cppflags 2>/dev/null |
21733 $grep '^[ ]*#.*include' |
21734 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21735 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21738 for xx in $xxx /dev/null ; do
21739 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21741 case "$xxxfiles" in
21742 '') xxxfiles=`./findhdr signal.h` ;;
21745 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21746 print substr($2, 4, 20)
21748 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21749 print substr($3, 4, 20)
21751 : Append some common names just in case the awk scan failed.
21752 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21753 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21754 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21755 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21756 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21758 : generate a few handy files for later
21759 $cat > signal.c <<EOCP
21760 #include <sys/types.h>
21761 #include <signal.h>
21762 #$i_stdlib I_STDLIB
21764 #include <stdlib.h>
21769 /* Strange style to avoid deeply-nested #if/#else/#endif */
21772 # define NSIG (_NSIG)
21778 # define NSIG (SIGMAX+1)
21784 # define NSIG (SIG_MAX+1)
21790 # define NSIG (_SIG_MAX+1)
21796 # define NSIG (MAXSIG+1)
21802 # define NSIG (MAX_SIG+1)
21807 # ifdef SIGARRAYSIZE
21808 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21814 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21818 /* Default to some arbitrary number that's big enough to get most
21819 of the common signals.
21825 printf("NSIG %d\n", NSIG);
21831 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21833 printf "#ifdef SIG"; printf $1; printf "\n"
21834 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21835 printf $1; printf ");\n"
21839 printf "#endif /* JUST_NSIG */\n";
21840 printf "exit(0);\n}\n";
21843 $cat >signal.awk <<'EOP'
21844 BEGIN { ndups = 0 }
21845 $1 ~ /^NSIG$/ { nsig = $2 }
21846 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21847 if ($2 > maxsig) { maxsig = $2 }
21848 if (sig_name[$2]) {
21849 dup_name[ndups] = $1
21850 dup_num[ndups] = $2
21862 printf("NSIG %d\n", nsig);
21863 for (n = 1; n < nsig; n++) {
21865 printf("%s %d\n", sig_name[n], sig_num[n])
21868 printf("NUM%d %d\n", n, n)
21871 for (n = 0; n < ndups; n++) {
21872 printf("%s %d\n", dup_name[n], dup_num[n])
21876 $cat >signal_cmd <<EOS
21878 if $test -s signal.lst; then
21879 echo "Using your existing signal.lst file"
21884 $cat >>signal_cmd <<'EOS'
21887 if eval $compile_ok; then
21888 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21889 $uniq | $awk -f signal.awk >signal.lst
21891 echo "(I can't seem be able to compile the whole test program)" >&4
21892 echo "(I'll try it in little pieces.)" >&4
21893 set signal -DJUST_NSIG
21894 if eval $compile_ok; then
21895 $run ./signal$_exe > signal.nsg
21898 echo "I can't seem to figure out how many signals you have." >&4
21899 echo "Guessing 50." >&4
21900 echo 'NSIG 50' > signal.nsg
21902 : Now look at all the signal names, one at a time.
21903 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21904 $cat > signal.c <<EOCP
21905 #include <sys/types.h>
21906 #include <signal.h>
21909 printf("$xx %d\n", SIG${xx});
21914 if eval $compile; then
21915 echo "SIG${xx} found."
21916 $run ./signal$_exe >> signal.ls1
21918 echo "SIG${xx} NOT found."
21921 if $test -s signal.ls1; then
21922 $cat signal.nsg signal.ls1 |
21923 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21927 if $test -s signal.lst; then
21930 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21931 echo 'kill -l' >signal
21932 set X `csh -f <signal`
21936 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21938 echo $@ | $tr ' ' $trnl | \
21939 $awk '{ printf "%s %d\n", $1, ++s; }
21940 END { printf "NSIG %d\n", ++s }' >signal.lst
21942 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21944 chmod a+x signal_cmd
21945 $eunicefix signal_cmd
21949 : generate list of signal names
21950 case "$sig_num_init" in
21953 case "$sig_name_init" in
21955 *) case "$sig_num_init" in
21956 ''|*,*) doinit=yes ;;
21961 echo "Generating a list of signal names and numbers..." >&4
21963 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21964 sig_name=`$awk 'BEGIN { printf "ZERO " }
21965 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21966 sig_num=`$awk 'BEGIN { printf "0 " }
21967 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21968 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21969 !/^NSIG/ { printf "\"%s\", ", $1 }
21970 END { printf "0\n" }' signal.lst`
21971 sig_num_init=`$awk 'BEGIN { printf "0, " }
21972 !/^NSIG/ { printf "%d, ", $2}
21973 END { printf "0\n"}' signal.lst`
21976 echo "The following $sig_count signals are available:"
21978 echo $sig_name | $awk \
21979 'BEGIN { linelen = 0 }
21981 for (i = 1; i <= NF; i++) {
21982 name = "SIG" $i " "
21983 linelen = linelen + length(name)
21984 if (linelen > 70) {
21986 linelen = length(name)
21992 sig_size=`echo $sig_name | awk '{print NF}'`
21993 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21997 : Check size of size
21999 case "$sizetype" in
22000 *_t) zzz="$sizetype" ;;
22001 *) zzz="filesize" ;;
22003 echo "Checking the size of $zzz..." >&4
22005 #include <sys/types.h>
22007 #$i_stdlib I_STDLIB
22009 #include <stdlib.h>
22012 printf("%d\n", (int)sizeof($sizetype));
22017 if eval $compile_ok; then
22021 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22024 echo "Your $zzz size is $sizesize bytes."
22029 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22033 : check for socklen_t
22035 echo "Checking to see if you have socklen_t..." >&4
22037 #include <sys/types.h>
22038 #$d_socket HAS_SOCKET
22040 #include <sys/socket.h>
22042 int main() { socklen_t x = 16; }
22045 if eval $compile; then
22047 echo "You have socklen_t."
22050 echo "You do not have socklen_t."
22051 case "$sizetype" in
22052 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22059 : see if this is a socks.h system
22060 set socks.h i_socks
22063 : check for type of the size argument to socket calls
22064 case "$d_socket" in
22068 Checking to see what type is the last argument of accept().
22071 case "$d_socklen_t" in
22072 "$define") yyy="$yyy socklen_t"
22074 yyy="$yyy $sizetype int long unsigned"
22075 for xxx in $yyy; do
22076 case "$socksizetype" in
22077 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22078 case "$usesocks" in
22080 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22081 echo "Your system accepts '$xxx *' for the last argument of accept()."
22082 socksizetype="$xxx"
22085 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22086 echo "Your system accepts '$xxx *' for the last argument of accept()."
22087 socksizetype="$xxx"
22094 : In case none of those worked, prompt the user.
22095 case "$socksizetype" in
22096 '') rp='What is the type for socket address structure sizes?'
22103 *) : no sockets, so pick relatively harmless default
22108 : see what type is used for signed size_t
22109 set ssize_t ssizetype int stdio.h sys/types.h
22114 #$i_stdlib I_STDLIB
22116 #include <stdlib.h>
22118 #include <sys/types.h>
22119 #define Size_t $sizetype
22120 #define SSize_t $dflt
22123 if (sizeof(Size_t) == sizeof(SSize_t))
22125 else if (sizeof(Size_t) == sizeof(int))
22134 if eval $compile_ok && $run ./try > /dev/null; then
22135 ssizetype=`$run ./try`
22136 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22139 Help! I can't compile and run the ssize_t test program: please enlighten me!
22140 (This is probably a misconfiguration in your system or libraries, and
22141 you really ought to fix it. Still, I'll try anyway.)
22143 I need a type that is the same size as $sizetype, but is guaranteed to
22144 be signed. Common values are ssize_t, int and long.
22147 rp="What signed type is the same size as $sizetype?"
22153 : Check the size of st_ino
22155 $echo "Checking the size of st_ino..." >&4
22156 $cat > try.c <<EOCP
22157 #include <sys/stat.h>
22159 #$i_stdlib I_STDLIB
22161 #include <stdlib.h>
22165 printf("%d\n", (int)sizeof(st.st_ino));
22170 if eval $compile_ok; then
22174 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22176 *) st_ino_size=$val
22177 $echo "Your st_ino is $st_ino_size bytes long."
22182 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22186 : Check if st_ino is signed
22188 $echo "Checking the sign of st_ino..." >&4
22189 $cat > try.c <<EOCP
22190 #include <sys/stat.h>
22195 if (foo.st_ino < 0)
22202 if eval $compile; then
22206 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22208 *) st_ino_sign=$val
22209 case "$st_ino_sign" in
22210 1) $echo "Your st_ino is unsigned." ;;
22211 -1) $echo "Your st_ino is signed." ;;
22217 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22221 : see what type of char stdio uses.
22223 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22224 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22225 echo "Your stdio uses unsigned chars." >&4
22226 stdchar="unsigned char"
22228 echo "Your stdio uses signed chars." >&4
22233 : Check size of UID
22236 *_t) zzz="$uidtype" ;;
22239 echo "Checking the size of $zzz..." >&4
22241 #include <sys/types.h>
22243 #$i_stdlib I_STDLIB
22245 #include <stdlib.h>
22248 printf("%d\n", (int)sizeof($uidtype));
22253 if eval $compile_ok; then
22257 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22260 echo "Your $zzz is $uidsize bytes long."
22265 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22268 : Check if UID is signed
22271 *_t) zzz="$uidtype" ;;
22274 echo "Checking the sign of $zzz..." >&4
22276 #include <sys/types.h>
22287 if eval $compile; then
22291 echo "(I can't execute the test program--guessing unsigned.)" >&4
22295 1) echo "Your $zzz is unsigned." ;;
22296 -1) echo "Your $zzz is signed." ;;
22302 echo "(I can't compile the test program--guessing unsigned.)" >&4
22306 : Check format string for UID
22308 $echo "Checking the format string to be used for uids..." >&4
22311 -1) if $test X"$uidsize" = X"$ivsize"; then
22312 uidformat="$ivdformat"
22314 if $test X"$uidsize" = X"$longsize"; then
22317 if $test X"$uidsize" = X"$intsize"; then
22320 if $test X"$uidsize" = X"$shortsize"; then
22327 *) if $test X"$uidsize" = X"$uvsize"; then
22328 uidformat="$uvuformat"
22330 if $test X"$uidsize" = X"$longsize"; then
22333 if $test X"$uidsize" = X"$intsize"; then
22336 if $test X"$uidsize" = X"$shortsize"; then
22345 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22347 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22348 $cat >try.c <<'EOM'
22349 /* Intentionally a long probe as I'd like to sanity check that the exact
22350 approach is going to work, as thinking it will work, but only having it
22351 part working at runtime is worse than not having it. */
22353 #include <sys/types.h>
22354 #include <sys/sysctl.h>
22355 #include <sys/param.h>
22357 #include <string.h>
22358 #include <stdlib.h>
22359 #include <unistd.h>
22362 main(int argc, char **argv) {
22364 char *argv_leaf = strrchr(argv[0], '/');
22370 mib[1] = KERN_PROC;
22371 mib[2] = KERN_PROC_PATHNAME;
22375 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22379 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22384 if (size < strlen(argv_leaf) + 1) {
22385 fprintf(stderr, "size %lu is too short for a path\n",
22386 (unsigned long) size);
22390 if (size > MAXPATHLEN * MAXPATHLEN) {
22391 fprintf(stderr, "size %lu is too long for a path\n",
22392 (unsigned long) size);
22396 buffer = (char *)malloc(size);
22402 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22407 if (strlen(buffer) + 1 != size) {
22408 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22409 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22414 if (*buffer != '/') {
22415 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22419 if (strstr(buffer, "/./")) {
22420 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22424 if (strstr(buffer, "/../")) {
22425 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22429 buffer_leaf = strrchr(buffer, '/');
22430 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22431 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22443 if eval $compile; then
22444 if $run ./try; then
22445 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22448 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22452 echo "I'm unable to compile the test program." >&4
22453 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22457 set usekernprocpathname
22460 : Determine if we can use _NSGetExecutablePath to find executing program
22462 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22463 $cat >try.c <<'EOM'
22464 /* Intentionally a long probe as I'd like to sanity check that the exact
22465 approach is going to work, as thinking it will work, but only having it
22466 part working at runtime is worse than not having it. */
22467 #include <mach-o/dyld.h>
22469 #include <stdlib.h>
22470 #include <sys/param.h>
22471 #include <string.h>
22474 main(int argc, char **argv) {
22476 uint32_t size = sizeof(buf);
22480 char *argv_leaf = strrchr(argv[0], '/');
22484 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22488 _NSGetExecutablePath(buf, &size);
22489 if (size > MAXPATHLEN * MAXPATHLEN) {
22490 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22491 (unsigned int) size);
22495 buffer = (char *)malloc(size);
22501 result = _NSGetExecutablePath(buffer, &size);
22503 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22504 result, (unsigned int) size);
22508 tidied = realpath(buffer, NULL);
22510 perror("realpath");
22516 if (*tidied != '/') {
22517 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22521 if (strstr(tidied, "/./")) {
22522 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22526 if (strstr(tidied, "/../")) {
22527 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22531 tidied_leaf = strrchr(tidied, '/');
22532 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22533 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22545 if eval $compile; then
22546 if $run ./try; then
22547 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22550 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22553 echo "I'm unable to compile the test program." >&4
22554 echo "I'll assume no _NSGetExecutablePath here." >&4
22557 set usensgetexecutablepath
22560 : Check if site customization support was requested
22561 case "$usesitecustomize" in
22562 $define|true|[Yy]*)
22563 usesitecustomize="$define"
22566 usesitecustomize="$undef"
22570 : determine compiler compiler
22579 if $test -f "$byacc$_exe"; then
22581 comp="byacc or $comp"
22583 if $test -f "$bison$_exe"; then
22584 comp="$comp or bison -y"
22586 rp="Which compiler compiler ($comp) shall I use?"
22595 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22601 : see if this is a bfd.h system
22605 : see if this is an execinfo.h system
22606 set execinfo.h i_execinfo
22609 : see if this is a fenv.h system
22613 : see if this is a fp.h system
22617 : see if this is a fp_class.h system
22618 set fp_class.h i_fp_class
22621 : see if gdbm.h is available
22626 : see if gdbm_open exists
22627 set gdbm_open d_gdbm_open
22629 case "$d_gdbm_open" in
22632 echo "We won't be including <gdbm.h>"
22641 : see if this is a ieeefp.h system
22642 case "$i_ieeefp" in
22643 '' ) set ieeefp.h i_ieeefp
22648 : see if this is a libutil.h system
22649 set libutil.h i_libutil
22652 : see if mach cthreads are available
22653 if test "X$usethreads" = "X$define"; then
22654 set mach/cthreads.h i_machcthr
22657 i_machcthr="$undef"
22660 : see if this is a mntent.h system
22661 set mntent.h i_mntent
22664 : see if net/errno.h is available
22666 set net/errno.h val
22669 : Unfortunately, it causes problems on some systems. Arrgh.
22672 cat > try.c <<'EOM'
22675 #include <net/errno.h>
22681 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22682 echo "We'll be including <net/errno.h>." >&4
22684 echo "We won't be including <net/errno.h>." >&4
22693 : see if netinet/tcp.h is available
22694 set netinet/tcp.h i_netinettcp
22697 : see if this is a poll.h system
22701 : see if this is a prot.h system
22705 : Preprocessor symbols
22707 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22708 $cat <<'EOSH' > Cppsym.know
22709 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22710 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22711 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22712 arch_pwr ardent ARM ARM32 atarist att386 att3b
22713 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22714 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22715 byteorder byte_order
22716 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22717 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22718 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22719 ELF encore EPI EXTENSIONS
22720 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22721 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22722 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22723 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22724 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22725 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22726 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22727 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22728 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22730 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22731 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22732 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22734 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22735 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22736 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22737 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22738 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22739 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22740 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22741 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22742 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22743 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22744 ns32000 ns32016 ns32332 ns32k nsc32000
22745 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22746 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22747 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22748 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22750 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22751 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22752 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22753 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22754 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22755 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22756 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22757 SYSV4 SYSV5 sysV68 sysV88
22758 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22759 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22760 tower32_800 tower32_850 tss
22761 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22762 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22763 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22764 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22765 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22766 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22768 vax venix VMESA vms
22769 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22770 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22773 # Maybe put other stuff here too.
22774 ./tr '-' '_' <<EOSH >>Cppsym.know
22777 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22778 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22779 $cat Cppsym.know > Cppsym.c
22780 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22781 $rm -f Cppsym.a Cppsym.b Cppsym.c
22782 cat <<EOSH > Cppsym
22784 if $test \$# -gt 0; then
22785 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22786 if $test -s Cppsym.got; then
22793 $tr " " "$trnl" | ./Cppsym.try
22799 cat <<EOSH > Cppsym.try
22801 cat <<'EOCP' > try.c
22804 #define STRINGIFY(a) "a"
22806 #if cpp_stuff == 42
22807 #define StGiFy(a) #a
22808 #define STRINGIFY(a) StGiFy(a)
22810 #if $cpp_stuff != 1 && $cpp_stuff != 42
22811 # include "Bletch: How does this C preprocessor stringify macros?"
22817 cat <<'EOSH' >> Cppsym.try
22819 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22820 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22821 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22822 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22824 echo 'return 0;}' >> try.c
22826 cat <<EOSH >> Cppsym.try
22828 case "$osname-$gccversion" in
22829 irix-) ccflags="\$ccflags -woff 1178" ;;
22830 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22832 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
22834 chmod +x Cppsym.try
22835 $eunicefix Cppsym.try
22836 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22837 : Add in any Linux cpp "predefined macros":
22838 case "$osname::$gccversion" in
22839 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22841 rm -f $tHdrH'.h' $tHdrH
22843 # Filter out macro arguments, such as Linux's __INT8_C(c)
22844 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22845 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22846 if [ -s $tHdrH'_cppsym.real' ]; then
22847 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22850 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22853 : now check the C compiler for additional symbols
22854 postprocess_cc_v=''
22856 aix) postprocess_cc_v="|$tr , ' '" ;;
22863 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22866 -D*) echo "\$i" | $sed 's/^-D//';;
22867 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22872 postprocess_cc_v=''
22875 ./ccsym > ccsym1.raw
22876 if $test -s ccsym1.raw; then
22877 $sort ccsym1.raw | $uniq >ccsym.raw
22879 mv ccsym1.raw ccsym.raw
22882 $awk '/\=/ { print $0; next }
22883 { print $0"=1" }' ccsym.raw >ccsym.list
22884 $comm -13 Cppsym.true ccsym.list >ccsym.own
22885 $comm -12 Cppsym.true ccsym.list >ccsym.com
22886 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22888 if $test -z ccsym.raw; then
22889 echo "Your C compiler doesn't seem to define any symbols!" >&4
22891 echo "However, your C preprocessor defines the following symbols:"
22894 cppsymbols=`$cat Cppsym.true`
22895 cppsymbols=`echo $cppsymbols`
22896 cppccsymbols="$cppsymbols"
22898 if $test -s ccsym.com; then
22899 echo "Your C compiler and pre-processor define these symbols:"
22900 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22903 cppccsymbols=`$cat ccsym.com`
22904 cppccsymbols=`echo $cppccsymbols`
22905 $test "$silent" || sleep 1
22907 if $test -s ccsym.cpp; then
22908 $test "$also" && echo " "
22909 echo "Your C pre-processor ${also}defines the following symbols:"
22910 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22912 cppsymbols=`$cat ccsym.cpp`
22913 cppsymbols=`echo $cppsymbols`
22914 $test "$silent" || sleep 1
22916 if $test -s ccsym.own; then
22917 $test "$also" && echo " "
22918 echo "Your C compiler ${also}defines the following cpp symbols:"
22919 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22920 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22921 ccsymbols=`$cat ccsym.own`
22922 ccsymbols=`echo $ccsymbols`
22923 $test "$silent" || sleep 1
22927 : add -D_FORTIFY_SOURCE if feasible and not already there
22928 case "$gccversion" in
22929 [4567].*) case "$optimize$ccflags" in
22930 *-O*) case "$ccflags$cppsymbols" in
22931 *_FORTIFY_SOURCE=*) # Don't add it again.
22932 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22934 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22935 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22939 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22943 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
22947 : script used to emit important warnings
22950 if test \$# -gt 0; then
22955 echo "*** WARNING:" >&4
22956 sed -e 's/^/*** /' <msg >&4
22958 cat msg >>config.msg
22959 echo " " >>config.msg
22965 : see if this is a termio system
22969 if $test `./findhdr termios.h`; then
22970 set tcsetattr i_termios
22976 "$define") echo "You have POSIX termios.h... good!" >&4;;
22977 *) if ./Cppsym pyr; then
22978 case "`$run /bin/universe`" in
22979 ucb) if $test `./findhdr sgtty.h`; then
22981 echo "<sgtty.h> found." >&4
22983 echo "System is pyramid with BSD universe."
22984 ./warn "<sgtty.h> not found--you could have problems."
22986 *) if $test `./findhdr termio.h`; then
22988 echo "<termio.h> found." >&4
22990 echo "System is pyramid with USG universe."
22991 ./warn "<termio.h> not found--you could have problems."
22995 if $test `./findhdr termio.h`; then
22996 echo "<termio.h> found." >&4
22998 elif $test `./findhdr sgtty.h`; then
22999 echo "<sgtty.h> found." >&4
23002 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23005 if $test `./findhdr sgtty.h`; then
23006 echo "<sgtty.h> found." >&4
23008 elif $test `./findhdr termio.h`; then
23009 echo "<termio.h> found." >&4
23012 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23016 set i_termio; eval $setvar
23017 val=$val2; set i_sgtty; eval $setvar
23018 val=$val3; set i_termios; eval $setvar
23020 : see if stdbool is available
23021 : we want a real compile instead of Inhdr because some Solaris systems
23022 : have stdbool.h, but it can only be used if the compiler indicates it
23023 : is sufficiently c99-compliant.
23027 #include <stdbool.h>
23032 int main(int argc, char **argv)
23038 if eval $compile; then
23039 echo "<stdbool.h> found." >&4
23042 echo "<stdbool.h> NOT found." >&4
23049 : see if stdint is available
23050 set stdint.h i_stdint
23053 : see if sys/access.h is available
23054 set sys/access.h i_sysaccess
23057 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23058 set sys/filio.h i_sysfilio
23061 if $test `./findhdr sys/ioctl.h`; then
23063 echo '<sys/ioctl.h> found.' >&4
23066 if $test $i_sysfilio = "$define"; then
23067 echo '<sys/ioctl.h> NOT found.' >&4
23069 $test $i_sgtty = "$define" && xxx="sgtty.h"
23070 $test $i_termio = "$define" && xxx="termio.h"
23071 $test $i_termios = "$define" && xxx="termios.h"
23072 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23078 : see if socket ioctl defs are in sys/sockio.h
23080 xxx=`./findhdr sys/sockio.h`
23081 if $test "$xxx"; then
23082 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23084 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23087 echo "No socket ioctls found in <sys/sockio.h>." >&4
23092 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23098 : see if this is a syslog.h system
23099 set syslog.h i_syslog
23102 : see if this is a sys/mode.h system
23103 set sys/mode.h i_sysmode
23106 : see if there is a sys/poll.h file
23107 set sys/poll.h i_syspoll
23110 : see if sys/resource.h has to be included
23111 set sys/resource.h i_sysresrc
23114 : see if sys/security.h is available
23115 set sys/security.h i_syssecrt
23118 : see if this is a sys/statvfs.h system
23119 set sys/statvfs.h i_sysstatvfs
23122 : see if this is a sys/un.h system
23123 set sys/un.h i_sysun
23126 : see if this is a sys/utsname.h system
23127 set sys/utsname.h i_sysutsname
23130 : see if this is a syswait system
23131 set sys/wait.h i_syswait
23134 : see if this is a ustat.h system
23135 set ustat.h i_ustat
23138 : see if this is an utime system
23139 set utime.h i_utime
23142 : see if this is a vfork system
23145 set vfork.h i_vfork
23153 : see if wchar.h is present
23154 set wchar.h i_wchar
23159 echo "Looking for extensions..." >&4
23160 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23161 : contain old or inaccurate or duplicate values.
23162 nonxs_extensions=''
23164 : We do not use find because it might not be available.
23165 : We do not just use MANIFEST because the user may have dropped
23166 : some additional extensions into the source tree and expect them
23169 : Function to recursively find available extensions, ignoring DynaLoader
23170 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23171 : In 5.10.1 and later, extensions are stored in directories
23172 : like File-Glob instead of the older File/Glob/.
23176 DynaLoader|dynaload) ;;
23178 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23179 case "$this_ext" in
23180 Scalar/List/Utils) this_ext="List/Util" ;;
23181 PathTools) this_ext="Cwd" ;;
23183 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23184 if $contains " $this_ext " "$tdir/$$.tmp"; then
23186 echo "Duplicate directories detected for extension $xxx" >&4;
23187 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23188 case "$knowitall" in
23196 echo "Ok. Stopping Configure." >&4;
23197 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23200 echo "Ok. You will need to correct config.sh before running make." >&4;
23202 $ls -1 "$xxx" > "$tdir/$$.tmp";
23203 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23204 xs_extensions="$xs_extensions $this_ext";
23205 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23206 xs_extensions="$xs_extensions $this_ext";
23207 elif $test -d "$xxx"; then
23208 nonxs_extensions="$nonxs_extensions $this_ext";
23210 $rm -f "$tdir/$$.tmp";
23218 eval $find_extensions
23222 eval $find_extensions
23226 eval $find_extensions
23227 set X $xs_extensions
23229 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23230 set X $nonxs_extensions
23232 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23234 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23236 : Now see which are supported on this system.
23238 for xxx in $xs_extensions ; do
23242 amigaos) avail_ext="$avail_ext $xxx" ;;
23247 $define) avail_ext="$avail_ext $xxx" ;;
23250 GDBM_File|gdbm_fil)
23252 $define) avail_ext="$avail_ext $xxx" ;;
23255 I18N/Langinfo|i18n_lan)
23256 case "$i_langinfo$d_nl_langinfo" in
23257 $define$define) avail_ext="$avail_ext $xxx" ;;
23261 : XXX Do we need a useipcsysv variable here
23262 case "${d_msg}${d_sem}${d_shm}" in
23263 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23266 NDBM_File|ndbm_fil)
23269 case "$osname-$use64bitint" in
23272 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23275 *) avail_ext="$avail_ext $xxx" ;;
23280 ODBM_File|odbm_fil)
23281 case "${i_dbm}${i_rpcsvcdbm}" in
23283 case "$d_cplusplus" in
23284 define) ;; # delete as a function name will not work
23285 *) case "$osname-$use64bitint" in
23288 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23291 *) avail_ext="$avail_ext $xxx" ;;
23299 case "$useopcode" in
23300 true|define|y) avail_ext="$avail_ext $xxx" ;;
23304 case "$useposix" in
23305 true|define|y) avail_ext="$avail_ext $xxx" ;;
23309 case "$d_socket" in
23310 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23313 Sys/Syslog|sys/syslog)
23315 amigaos) ;; # not really very useful on AmigaOS
23317 : XXX syslog requires socket
23318 case "$d_socket" in
23319 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23325 case "$usethreads" in
23327 case "$use5005threads" in
23328 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23332 threads|threads/shared)
23333 # threads and threads::shared are special cases.
23334 # To stop people from asking "Perl 5.8.0 was supposed
23335 # to have this new fancy threads implementation but my
23336 # perl doesn't have it" and from people trying to
23337 # (re)install the threads module using CPAN.pm and
23338 # CPAN.pm then offering to reinstall Perl 5.8.0,
23339 # the threads.pm and threads/shared.pm will always be
23340 # there, croaking informatively ("you need to rebuild
23341 # all of Perl with threads, sorry") when threads haven't
23342 # been compiled in.
23344 avail_ext="$avail_ext $xxx"
23350 cygwin) avail_ext="$avail_ext $xxx" ;;
23353 XS/APItest|xs/apitest)
23354 # This is just for testing. Skip it unless we have dynamic loading.
23357 $define) avail_ext="$avail_ext $xxx" ;;
23360 XS/Typemap|xs/typemap)
23361 # This is just for testing. Skip it unless we have dynamic loading.
23363 $define) avail_ext="$avail_ext $xxx" ;;
23366 *) avail_ext="$avail_ext $xxx"
23375 case "$onlyextensions" in
23377 *) keepextensions=''
23378 echo "You have requested that only certain extensions be included..." >&4
23379 for i in $onlyextensions; do
23380 case " $avail_ext " in
23382 echo "Keeping extension $i."
23383 keepextensions="$keepextensions $i"
23385 *) echo "Ignoring extension $i." ;;
23388 avail_ext="$keepextensions"
23392 case "$noextensions" in
23394 *) keepextensions=''
23395 echo "You have requested that certain extensions be ignored..." >&4
23396 for i in $avail_ext; do
23397 case " $noextensions " in
23398 *" $i "*) echo "Ignoring extension $i." ;;
23399 *) echo "Keeping extension $i.";
23400 keepextensions="$keepextensions $i"
23404 avail_ext="$keepextensions"
23408 : Now see which nonxs extensions are supported on this system.
23409 : For now assume all are.
23411 for xxx in $nonxs_extensions ; do
23415 *) nonxs_ext="$nonxs_ext $xxx"
23427 A number of extensions are supplied with $package. You may choose to
23428 compile these extensions for dynamic loading (the default), compile
23429 them into the $package executable (static loading), or not include
23430 them at all. Answer "none" to include no extensions.
23431 Note that DynaLoader is always built and need not be mentioned here.
23434 case "$dynamic_ext" in
23436 : Exclude those listed in static_ext
23438 for xxx in $avail_ext; do
23439 case " $static_ext " in
23441 *) dflt="$dflt $xxx" ;;
23448 *) dflt="$dynamic_ext"
23449 # Perhaps we are reusing an old out-of-date config.sh.
23452 if test X"$dynamic_ext" != X"$avail_ext"; then
23454 NOTICE: Your previous config.sh list may be incorrect.
23455 The extensions now available to you are
23457 but the default list from your previous config.sh is
23469 rp="What extensions do you wish to load dynamically?"
23472 none) dynamic_ext=' ' ;;
23473 *) dynamic_ext="$ans" ;;
23476 case "$static_ext" in
23478 : Exclude those already listed in dynamic linking
23480 for xxx in $avail_ext; do
23481 case " $dynamic_ext " in
23483 *) dflt="$dflt $xxx" ;;
23490 *) dflt="$static_ext"
23497 rp="What extensions do you wish to load statically?"
23500 none) static_ext=' ' ;;
23501 *) static_ext="$ans" ;;
23506 A number of extensions are supplied with $package. Answer "none"
23507 to include no extensions.
23508 Note that DynaLoader is always built and need not be mentioned here.
23511 case "$static_ext" in
23512 '') dflt="$avail_ext" ;;
23513 *) dflt="$static_ext"
23514 # Perhaps we are reusing an old out-of-date config.sh.
23517 if test X"$static_ext" != X"$avail_ext"; then
23519 NOTICE: Your previous config.sh list may be incorrect.
23520 The extensions now available to you are
23522 but the default list from your previous config.sh is
23531 : Exclude those that are not xs extensions
23535 rp="What extensions do you wish to include?"
23538 none) static_ext=' ' ;;
23539 *) static_ext="$ans" ;;
23544 # Encode is a special case. If we are building Encode as a static
23545 # extension, we need to explicitly list its subextensions as well.
23546 # For other nested extensions, this is handled automatically by
23547 # the appropriate Makefile.PL.
23548 case " $static_ext " in
23549 *" Encode "*) # Add the subextensions of Encode
23551 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23552 static_ext="$static_ext Encode/$xxx"
23553 known_extensions="$known_extensions Encode/$xxx"
23559 set X $dynamic_ext $static_ext $nonxs_ext
23563 # Sanity check: We require an extension suitable for use with
23564 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23565 # should show up as failures in the test suite, but it's helpful to
23566 # catch them now.) The 'extensions' list is normally sorted
23567 # alphabetically, so we need to accept either
23568 # DB_File ... Fcntl ... IO ....
23569 # or something like
23570 # Fcntl ... NDBM_File ... IO ....
23571 case " $extensions" in
23572 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23573 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23574 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23575 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23576 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23580 : Remove libraries needed only for extensions
23581 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23582 : The exception is SunOS 4.x, which needs them.
23583 case "${osname}X${osvers}" in
23587 *) case "$usedl" in
23588 $define|true|[yY]*)
23589 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23593 *) perllibs="$libs"
23599 : Remove build directory name from cppstdin so it can be used from
23600 : either the present location or the final installed location.
23602 : Get out of the UU directory to get correct path name.
23604 case "$cppstdin" in
23606 echo "Stripping down cppstdin path name"
23612 : end of configuration questions
23614 echo "End of configuration questions."
23617 : back to where it started
23618 if test -d ../UU; then
23622 : configuration may be unconditionally patched via a 'config.arch' file
23623 if $test -f config.arch; then
23624 echo "I see a config.arch file, loading it." >&4
23628 : configuration may be patched via a 'config.over' file
23629 if $test -f config.over; then
23632 rp='I see a config.over file. Do you wish to load it?'
23635 n*) echo "OK, I'll ignore it.";;
23637 echo "Configuration override changes have been loaded."
23642 : in case they want portability, strip down executable paths
23643 case "$d_portable" in
23646 echo "Stripping down executable paths..." >&4
23647 for file in $loclist $trylist; do
23649 eval $file=`basename $temp`
23654 : create config.sh file
23656 echo "Creating config.sh..." >&4
23657 $spitshell <<EOT >config.sh
23660 # This file was produced by running the Configure script. It holds all the
23661 # definitions figured out by Configure. Should you modify one of these values,
23662 # do not forget to propagate your changes by running "Configure -der". You may
23663 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23666 # Package name : $package
23667 # Source directory : $src
23668 # Configuration time: $cf_time
23669 # Configured by : $cf_by
23670 # Target system : $myuname
23673 : Add in command line options if available
23674 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23676 $spitshell <<EOT >>config.sh
23685 Revision='$Revision'
23693 alignbytes='$alignbytes'
23694 aphostname='$aphostname'
23695 api_revision='$api_revision'
23696 api_subversion='$api_subversion'
23697 api_version='$api_version'
23698 api_versionstring='$api_versionstring'
23701 archlibexp='$archlibexp'
23702 archname64='$archname64'
23703 archname='$archname'
23704 archobjs='$archobjs'
23705 asctime_r_proto='$asctime_r_proto'
23714 byteorder='$byteorder'
23716 castflags='$castflags'
23719 cccdlflags='$cccdlflags'
23720 ccdlflags='$ccdlflags'
23722 ccflags_uselargefiles='$ccflags_uselargefiles'
23724 ccsymbols='$ccsymbols'
23725 ccversion='$ccversion'
23727 cf_email='$cf_email'
23729 charbits='$charbits'
23730 charsize='$charsize'
23734 clocktype='$clocktype'
23736 compress='$compress'
23737 contains='$contains'
23741 cpp_stuff='$cpp_stuff'
23742 cppccsymbols='$cppccsymbols'
23743 cppflags='$cppflags'
23745 cppminus='$cppminus'
23747 cppstdin='$cppstdin'
23748 cppsymbols='$cppsymbols'
23749 crypt_r_proto='$crypt_r_proto'
23750 cryptlib='$cryptlib'
23752 ctermid_r_proto='$ctermid_r_proto'
23753 ctime_r_proto='$ctime_r_proto'
23754 d_Gconvert='$d_Gconvert'
23755 d_PRIEUldbl='$d_PRIEUldbl'
23756 d_PRIFUldbl='$d_PRIFUldbl'
23757 d_PRIGUldbl='$d_PRIGUldbl'
23758 d_PRIXU64='$d_PRIXU64'
23759 d_PRId64='$d_PRId64'
23760 d_PRIeldbl='$d_PRIeldbl'
23761 d_PRIfldbl='$d_PRIfldbl'
23762 d_PRIgldbl='$d_PRIgldbl'
23763 d_PRIi64='$d_PRIi64'
23764 d_PRIo64='$d_PRIo64'
23765 d_PRIu64='$d_PRIu64'
23766 d_PRIx64='$d_PRIx64'
23767 d_SCNfldbl='$d_SCNfldbl'
23768 d__fwalk='$d__fwalk'
23769 d_access='$d_access'
23770 d_accessx='$d_accessx'
23774 d_archlib='$d_archlib'
23775 d_asctime64='$d_asctime64'
23776 d_asctime_r='$d_asctime_r'
23781 d_attribute_deprecated='$d_attribute_deprecated'
23782 d_attribute_format='$d_attribute_format'
23783 d_attribute_malloc='$d_attribute_malloc'
23784 d_attribute_nonnull='$d_attribute_nonnull'
23785 d_attribute_noreturn='$d_attribute_noreturn'
23786 d_attribute_pure='$d_attribute_pure'
23787 d_attribute_unused='$d_attribute_unused'
23788 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23789 d_backtrace='$d_backtrace'
23791 d_bsdgetpgrp='$d_bsdgetpgrp'
23792 d_bsdsetpgrp='$d_bsdsetpgrp'
23793 d_builtin_add_overflow='$d_builtin_add_overflow'
23794 d_builtin_choose_expr='$d_builtin_choose_expr'
23795 d_builtin_expect='$d_builtin_expect'
23796 d_builtin_mul_overflow='$d_builtin_mul_overflow'
23797 d_builtin_sub_overflow='$d_builtin_sub_overflow'
23798 d_c99_variadic_macros='$d_c99_variadic_macros'
23799 d_casti32='$d_casti32'
23800 d_castneg='$d_castneg'
23803 d_chroot='$d_chroot'
23804 d_chsize='$d_chsize'
23806 d_clearenv='$d_clearenv'
23807 d_closedir='$d_closedir'
23808 d_cmsghdr_s='$d_cmsghdr_s'
23810 d_copysign='$d_copysign'
23811 d_copysignl='$d_copysignl'
23812 d_cplusplus='$d_cplusplus'
23814 d_crypt_r='$d_crypt_r'
23816 d_ctermid='$d_ctermid'
23817 d_ctermid_r='$d_ctermid_r'
23818 d_ctime64='$d_ctime64'
23819 d_ctime_r='$d_ctime_r'
23820 d_cuserid='$d_cuserid'
23821 d_dbminitproto='$d_dbminitproto'
23822 d_difftime64='$d_difftime64'
23823 d_difftime='$d_difftime'
23824 d_dir_dd_fd='$d_dir_dd_fd'
23826 d_dirnamlen='$d_dirnamlen'
23827 d_dladdr='$d_dladdr'
23828 d_dlerror='$d_dlerror'
23829 d_dlopen='$d_dlopen'
23830 d_dlsymun='$d_dlsymun'
23831 d_dosuid='$d_dosuid'
23832 d_double_has_inf='$d_double_has_inf'
23833 d_double_has_nan='$d_double_has_nan'
23834 d_double_has_negative_zero='$d_double_has_negative_zero'
23835 d_double_has_subnormals='$d_double_has_subnormals'
23836 d_double_style_cray='$d_double_style_cray'
23837 d_double_style_ibm='$d_double_style_ibm'
23838 d_double_style_ieee='$d_double_style_ieee'
23839 d_double_style_vax='$d_double_style_vax'
23840 d_drand48_r='$d_drand48_r'
23841 d_drand48proto='$d_drand48proto'
23843 d_duplocale='$d_duplocale'
23844 d_eaccess='$d_eaccess'
23845 d_endgrent='$d_endgrent'
23846 d_endgrent_r='$d_endgrent_r'
23847 d_endhent='$d_endhent'
23848 d_endhostent_r='$d_endhostent_r'
23849 d_endnent='$d_endnent'
23850 d_endnetent_r='$d_endnetent_r'
23851 d_endpent='$d_endpent'
23852 d_endprotoent_r='$d_endprotoent_r'
23853 d_endpwent='$d_endpwent'
23854 d_endpwent_r='$d_endpwent_r'
23855 d_endsent='$d_endsent'
23856 d_endservent_r='$d_endservent_r'
23857 d_eofnblk='$d_eofnblk'
23860 d_eunice='$d_eunice'
23863 d_faststdio='$d_faststdio'
23864 d_fchdir='$d_fchdir'
23865 d_fchmod='$d_fchmod'
23866 d_fchmodat='$d_fchmodat'
23867 d_fchown='$d_fchown'
23869 d_fcntl_can_lock='$d_fcntl_can_lock'
23870 d_fd_macros='$d_fd_macros'
23871 d_fd_set='$d_fd_set'
23872 d_fdclose='$d_fdclose'
23874 d_fds_bits='$d_fds_bits'
23875 d_fegetround='$d_fegetround'
23876 d_fgetpos='$d_fgetpos'
23877 d_finite='$d_finite'
23878 d_finitel='$d_finitel'
23879 d_flexfnam='$d_flexfnam'
23881 d_flockproto='$d_flockproto'
23886 d_fp_class='$d_fp_class'
23887 d_fp_classify='$d_fp_classify'
23888 d_fp_classl='$d_fp_classl'
23889 d_fpathconf='$d_fpathconf'
23890 d_fpclass='$d_fpclass'
23891 d_fpclassify='$d_fpclassify'
23892 d_fpclassl='$d_fpclassl'
23893 d_fpgetround='$d_fpgetround'
23894 d_fpos64_t='$d_fpos64_t'
23895 d_freelocale='$d_freelocale'
23896 d_frexpl='$d_frexpl'
23897 d_fs_data_s='$d_fs_data_s'
23898 d_fseeko='$d_fseeko'
23899 d_fsetpos='$d_fsetpos'
23900 d_fstatfs='$d_fstatfs'
23901 d_fstatvfs='$d_fstatvfs'
23903 d_ftello='$d_ftello'
23905 d_futimes='$d_futimes'
23906 d_gai_strerror='$d_gai_strerror'
23907 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23908 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23909 d_getaddrinfo='$d_getaddrinfo'
23910 d_getcwd='$d_getcwd'
23911 d_getespwnam='$d_getespwnam'
23912 d_getfsstat='$d_getfsstat'
23913 d_getgrent='$d_getgrent'
23914 d_getgrent_r='$d_getgrent_r'
23915 d_getgrgid_r='$d_getgrgid_r'
23916 d_getgrnam_r='$d_getgrnam_r'
23917 d_getgrps='$d_getgrps'
23918 d_gethbyaddr='$d_gethbyaddr'
23919 d_gethbyname='$d_gethbyname'
23920 d_gethent='$d_gethent'
23921 d_gethname='$d_gethname'
23922 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23923 d_gethostbyname_r='$d_gethostbyname_r'
23924 d_gethostent_r='$d_gethostent_r'
23925 d_gethostprotos='$d_gethostprotos'
23926 d_getitimer='$d_getitimer'
23927 d_getlogin='$d_getlogin'
23928 d_getlogin_r='$d_getlogin_r'
23929 d_getmnt='$d_getmnt'
23930 d_getmntent='$d_getmntent'
23931 d_getnameinfo='$d_getnameinfo'
23932 d_getnbyaddr='$d_getnbyaddr'
23933 d_getnbyname='$d_getnbyname'
23934 d_getnent='$d_getnent'
23935 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23936 d_getnetbyname_r='$d_getnetbyname_r'
23937 d_getnetent_r='$d_getnetent_r'
23938 d_getnetprotos='$d_getnetprotos'
23939 d_getpagsz='$d_getpagsz'
23940 d_getpbyname='$d_getpbyname'
23941 d_getpbynumber='$d_getpbynumber'
23942 d_getpent='$d_getpent'
23943 d_getpgid='$d_getpgid'
23944 d_getpgrp2='$d_getpgrp2'
23945 d_getpgrp='$d_getpgrp'
23946 d_getppid='$d_getppid'
23947 d_getprior='$d_getprior'
23948 d_getprotobyname_r='$d_getprotobyname_r'
23949 d_getprotobynumber_r='$d_getprotobynumber_r'
23950 d_getprotoent_r='$d_getprotoent_r'
23951 d_getprotoprotos='$d_getprotoprotos'
23952 d_getprpwnam='$d_getprpwnam'
23953 d_getpwent='$d_getpwent'
23954 d_getpwent_r='$d_getpwent_r'
23955 d_getpwnam_r='$d_getpwnam_r'
23956 d_getpwuid_r='$d_getpwuid_r'
23957 d_getsbyname='$d_getsbyname'
23958 d_getsbyport='$d_getsbyport'
23959 d_getsent='$d_getsent'
23960 d_getservbyname_r='$d_getservbyname_r'
23961 d_getservbyport_r='$d_getservbyport_r'
23962 d_getservent_r='$d_getservent_r'
23963 d_getservprotos='$d_getservprotos'
23964 d_getspnam='$d_getspnam'
23965 d_getspnam_r='$d_getspnam_r'
23966 d_gettimeod='$d_gettimeod'
23967 d_gmtime64='$d_gmtime64'
23968 d_gmtime_r='$d_gmtime_r'
23969 d_gnulibc='$d_gnulibc'
23970 d_grpasswd='$d_grpasswd'
23971 d_hasmntopt='$d_hasmntopt'
23975 d_ilogbl='$d_ilogbl'
23976 d_inc_version_list='$d_inc_version_list'
23977 d_inetaton='$d_inetaton'
23978 d_inetntop='$d_inetntop'
23979 d_inetpton='$d_inetpton'
23980 d_int64_t='$d_int64_t'
23981 d_ip_mreq='$d_ip_mreq'
23982 d_ip_mreq_source='$d_ip_mreq_source'
23983 d_ipv6_mreq='$d_ipv6_mreq'
23984 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23985 d_isascii='$d_isascii'
23986 d_isblank='$d_isblank'
23987 d_isfinite='$d_isfinite'
23988 d_isfinitel='$d_isfinitel'
23990 d_isinfl='$d_isinfl'
23991 d_isless='$d_isless'
23993 d_isnanl='$d_isnanl'
23994 d_isnormal='$d_isnormal'
23997 d_killpg='$d_killpg'
23998 d_lc_monetary_2008='$d_lc_monetary_2008'
23999 d_lchown='$d_lchown'
24000 d_ldbl_dig='$d_ldbl_dig'
24001 d_ldexpl='$d_ldexpl'
24002 d_lgamma='$d_lgamma'
24003 d_lgamma_r='$d_lgamma_r'
24004 d_libm_lib_version='$d_libm_lib_version'
24005 d_libname_unique='$d_libname_unique'
24007 d_linkat='$d_linkat'
24008 d_llrint='$d_llrint'
24009 d_llrintl='$d_llrintl'
24010 d_llround='$d_llround'
24011 d_llroundl='$d_llroundl'
24012 d_localeconv_l='$d_localeconv_l'
24013 d_localtime64='$d_localtime64'
24014 d_localtime_r='$d_localtime_r'
24015 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24016 d_locconv='$d_locconv'
24021 d_long_double_style_ieee='$d_long_double_style_ieee'
24022 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24023 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24024 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24025 d_long_double_style_vax='$d_long_double_style_vax'
24026 d_longdbl='$d_longdbl'
24027 d_longlong='$d_longlong'
24029 d_lrintl='$d_lrintl'
24030 d_lround='$d_lround'
24031 d_lroundl='$d_lroundl'
24032 d_lseekproto='$d_lseekproto'
24034 d_madvise='$d_madvise'
24035 d_malloc_good_size='$d_malloc_good_size'
24036 d_malloc_size='$d_malloc_size'
24038 d_mbrlen='$d_mbrlen'
24039 d_mbrtowc='$d_mbrtowc'
24040 d_mbstowcs='$d_mbstowcs'
24041 d_mbtowc='$d_mbtowc'
24042 d_memmem='$d_memmem'
24043 d_memrchr='$d_memrchr'
24045 d_mkdtemp='$d_mkdtemp'
24046 d_mkfifo='$d_mkfifo'
24047 d_mkstemp='$d_mkstemp'
24048 d_mkstemps='$d_mkstemps'
24049 d_mktime64='$d_mktime64'
24050 d_mktime='$d_mktime'
24053 d_modflproto='$d_modflproto'
24054 d_mprotect='$d_mprotect'
24056 d_msg_ctrunc='$d_msg_ctrunc'
24057 d_msg_dontroute='$d_msg_dontroute'
24058 d_msg_oob='$d_msg_oob'
24059 d_msg_peek='$d_msg_peek'
24060 d_msg_proxy='$d_msg_proxy'
24061 d_msgctl='$d_msgctl'
24062 d_msgget='$d_msgget'
24063 d_msghdr_s='$d_msghdr_s'
24064 d_msgrcv='$d_msgrcv'
24065 d_msgsnd='$d_msgsnd'
24067 d_munmap='$d_munmap'
24068 d_mymalloc='$d_mymalloc'
24070 d_nanosleep='$d_nanosleep'
24072 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24073 d_nearbyint='$d_nearbyint'
24074 d_newlocale='$d_newlocale'
24075 d_nextafter='$d_nextafter'
24076 d_nexttoward='$d_nexttoward'
24078 d_nl_langinfo='$d_nl_langinfo'
24079 d_nv_preserves_uv='$d_nv_preserves_uv'
24080 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24081 d_off64_t='$d_off64_t'
24082 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24083 d_oldpthreads='$d_oldpthreads'
24084 d_oldsock='$d_oldsock'
24086 d_openat='$d_openat'
24087 d_pathconf='$d_pathconf'
24089 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24090 d_phostname='$d_phostname'
24093 d_portable='$d_portable'
24095 d_prctl_set_name='$d_prctl_set_name'
24096 d_printf_format_null='$d_printf_format_null'
24097 d_procselfexe='$d_procselfexe'
24098 d_pseudofork='$d_pseudofork'
24099 d_pthread_atfork='$d_pthread_atfork'
24100 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24101 d_pthread_yield='$d_pthread_yield'
24102 d_ptrdiff_t='$d_ptrdiff_t'
24104 d_pwchange='$d_pwchange'
24105 d_pwclass='$d_pwclass'
24106 d_pwcomment='$d_pwcomment'
24107 d_pwexpire='$d_pwexpire'
24108 d_pwgecos='$d_pwgecos'
24109 d_pwpasswd='$d_pwpasswd'
24110 d_pwquota='$d_pwquota'
24113 d_querylocale='$d_querylocale'
24114 d_random_r='$d_random_r'
24115 d_re_comp='$d_re_comp'
24116 d_readdir64_r='$d_readdir64_r'
24117 d_readdir='$d_readdir'
24118 d_readdir_r='$d_readdir_r'
24119 d_readlink='$d_readlink'
24121 d_recvmsg='$d_recvmsg'
24122 d_regcmp='$d_regcmp'
24123 d_regcomp='$d_regcomp'
24124 d_remainder='$d_remainder'
24125 d_remquo='$d_remquo'
24126 d_rename='$d_rename'
24127 d_renameat='$d_renameat'
24128 d_rewinddir='$d_rewinddir'
24132 d_sbrkproto='$d_sbrkproto'
24133 d_scalbn='$d_scalbn'
24134 d_scalbnl='$d_scalbnl'
24135 d_sched_yield='$d_sched_yield'
24136 d_scm_rights='$d_scm_rights'
24137 d_seekdir='$d_seekdir'
24138 d_select='$d_select'
24140 d_semctl='$d_semctl'
24141 d_semctl_semid_ds='$d_semctl_semid_ds'
24142 d_semctl_semun='$d_semctl_semun'
24143 d_semget='$d_semget'
24145 d_sendmsg='$d_sendmsg'
24146 d_setegid='$d_setegid'
24147 d_seteuid='$d_seteuid'
24148 d_setgrent='$d_setgrent'
24149 d_setgrent_r='$d_setgrent_r'
24150 d_setgrps='$d_setgrps'
24151 d_sethent='$d_sethent'
24152 d_sethostent_r='$d_sethostent_r'
24153 d_setitimer='$d_setitimer'
24154 d_setlinebuf='$d_setlinebuf'
24155 d_setlocale='$d_setlocale'
24156 d_setlocale_r='$d_setlocale_r'
24157 d_setnent='$d_setnent'
24158 d_setnetent_r='$d_setnetent_r'
24159 d_setpent='$d_setpent'
24160 d_setpgid='$d_setpgid'
24161 d_setpgrp2='$d_setpgrp2'
24162 d_setpgrp='$d_setpgrp'
24163 d_setprior='$d_setprior'
24164 d_setproctitle='$d_setproctitle'
24165 d_setprotoent_r='$d_setprotoent_r'
24166 d_setpwent='$d_setpwent'
24167 d_setpwent_r='$d_setpwent_r'
24168 d_setregid='$d_setregid'
24169 d_setresgid='$d_setresgid'
24170 d_setresuid='$d_setresuid'
24171 d_setreuid='$d_setreuid'
24172 d_setrgid='$d_setrgid'
24173 d_setruid='$d_setruid'
24174 d_setsent='$d_setsent'
24175 d_setservent_r='$d_setservent_r'
24176 d_setsid='$d_setsid'
24177 d_setvbuf='$d_setvbuf'
24180 d_shmatprototype='$d_shmatprototype'
24181 d_shmctl='$d_shmctl'
24183 d_shmget='$d_shmget'
24184 d_sigaction='$d_sigaction'
24185 d_siginfo_si_addr='$d_siginfo_si_addr'
24186 d_siginfo_si_band='$d_siginfo_si_band'
24187 d_siginfo_si_errno='$d_siginfo_si_errno'
24188 d_siginfo_si_fd='$d_siginfo_si_fd'
24189 d_siginfo_si_pid='$d_siginfo_si_pid'
24190 d_siginfo_si_status='$d_siginfo_si_status'
24191 d_siginfo_si_uid='$d_siginfo_si_uid'
24192 d_siginfo_si_value='$d_siginfo_si_value'
24193 d_signbit='$d_signbit'
24194 d_sigprocmask='$d_sigprocmask'
24195 d_sigsetjmp='$d_sigsetjmp'
24196 d_sin6_scope_id='$d_sin6_scope_id'
24197 d_sitearch='$d_sitearch'
24198 d_snprintf='$d_snprintf'
24199 d_sockaddr_in6='$d_sockaddr_in6'
24200 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24201 d_sockatmark='$d_sockatmark'
24202 d_sockatmarkproto='$d_sockatmarkproto'
24203 d_socket='$d_socket'
24204 d_socklen_t='$d_socklen_t'
24205 d_sockpair='$d_sockpair'
24206 d_socks5_init='$d_socks5_init'
24208 d_srand48_r='$d_srand48_r'
24209 d_srandom_r='$d_srandom_r'
24210 d_sresgproto='$d_sresgproto'
24211 d_sresuproto='$d_sresuproto'
24213 d_statblks='$d_statblks'
24214 d_statfs_f_flags='$d_statfs_f_flags'
24215 d_statfs_s='$d_statfs_s'
24216 d_static_inline='$d_static_inline'
24217 d_statvfs='$d_statvfs'
24218 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24219 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24220 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24221 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24222 d_stdio_stream_array='$d_stdio_stream_array'
24223 d_stdiobase='$d_stdiobase'
24224 d_stdstdio='$d_stdstdio'
24225 d_strcoll='$d_strcoll'
24226 d_strerror_l='$d_strerror_l'
24227 d_strerror_r='$d_strerror_r'
24228 d_strftime='$d_strftime'
24229 d_strlcat='$d_strlcat'
24230 d_strlcpy='$d_strlcpy'
24231 d_strnlen='$d_strnlen'
24232 d_strtod='$d_strtod'
24233 d_strtol='$d_strtol'
24234 d_strtold='$d_strtold'
24235 d_strtold_l='$d_strtold_l'
24236 d_strtoll='$d_strtoll'
24237 d_strtoq='$d_strtoq'
24238 d_strtoul='$d_strtoul'
24239 d_strtoull='$d_strtoull'
24240 d_strtouq='$d_strtouq'
24241 d_strxfrm='$d_strxfrm'
24242 d_suidsafe='$d_suidsafe'
24243 d_symlink='$d_symlink'
24244 d_syscall='$d_syscall'
24245 d_syscallproto='$d_syscallproto'
24246 d_sysconf='$d_sysconf'
24247 d_sysernlst='$d_sysernlst'
24248 d_syserrlst='$d_syserrlst'
24249 d_system='$d_system'
24250 d_tcgetpgrp='$d_tcgetpgrp'
24251 d_tcsetpgrp='$d_tcsetpgrp'
24252 d_telldir='$d_telldir'
24253 d_telldirproto='$d_telldirproto'
24254 d_tgamma='$d_tgamma'
24255 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24257 d_timegm='$d_timegm'
24259 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24260 d_tm_tm_zone='$d_tm_tm_zone'
24261 d_tmpnam_r='$d_tmpnam_r'
24263 d_truncate='$d_truncate'
24264 d_truncl='$d_truncl'
24265 d_ttyname_r='$d_ttyname_r'
24266 d_tzname='$d_tzname'
24267 d_u32align='$d_u32align'
24268 d_ualarm='$d_ualarm'
24271 d_union_semun='$d_union_semun'
24272 d_unlinkat='$d_unlinkat'
24273 d_unordered='$d_unordered'
24274 d_unsetenv='$d_unsetenv'
24275 d_uselocale='$d_uselocale'
24276 d_usleep='$d_usleep'
24277 d_usleepproto='$d_usleepproto'
24279 d_vendorarch='$d_vendorarch'
24280 d_vendorbin='$d_vendorbin'
24281 d_vendorlib='$d_vendorlib'
24282 d_vendorscript='$d_vendorscript'
24284 d_void_closedir='$d_void_closedir'
24285 d_voidsig='$d_voidsig'
24286 d_voidtty='$d_voidtty'
24287 d_vsnprintf='$d_vsnprintf'
24289 d_waitpid='$d_waitpid'
24290 d_wcscmp='$d_wcscmp'
24291 d_wcstombs='$d_wcstombs'
24292 d_wcsxfrm='$d_wcsxfrm'
24293 d_wctomb='$d_wctomb'
24294 d_writev='$d_writev'
24297 db_hashtype='$db_hashtype'
24298 db_prefixtype='$db_prefixtype'
24299 db_version_major='$db_version_major'
24300 db_version_minor='$db_version_minor'
24301 db_version_patch='$db_version_patch'
24302 default_inc_excludes_dot='$default_inc_excludes_dot'
24303 direntrytype='$direntrytype'
24306 doubleinfbytes='$doubleinfbytes'
24307 doublekind='$doublekind'
24308 doublemantbits='$doublemantbits'
24309 doublenanbytes='$doublenanbytes'
24310 doublesize='$doublesize'
24312 drand48_r_proto='$drand48_r_proto'
24314 dtraceobject='$dtraceobject'
24315 dtracexnolibs='$dtracexnolibs'
24316 dynamic_ext='$dynamic_ext'
24322 endgrent_r_proto='$endgrent_r_proto'
24323 endhostent_r_proto='$endhostent_r_proto'
24324 endnetent_r_proto='$endnetent_r_proto'
24325 endprotoent_r_proto='$endprotoent_r_proto'
24326 endpwent_r_proto='$endpwent_r_proto'
24327 endservent_r_proto='$endservent_r_proto'
24328 eunicefix='$eunicefix'
24331 extensions='$extensions'
24332 extern_C='$extern_C'
24334 fflushNULL='$fflushNULL'
24335 fflushall='$fflushall'
24337 firstmakefile='$firstmakefile'
24339 fpossize='$fpossize'
24340 fpostype='$fpostype'
24341 freetype='$freetype'
24344 full_csh='$full_csh'
24345 full_sed='$full_sed'
24346 gccansipedantic='$gccansipedantic'
24347 gccosandvers='$gccosandvers'
24348 gccversion='$gccversion'
24349 getgrent_r_proto='$getgrent_r_proto'
24350 getgrgid_r_proto='$getgrgid_r_proto'
24351 getgrnam_r_proto='$getgrnam_r_proto'
24352 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24353 gethostbyname_r_proto='$gethostbyname_r_proto'
24354 gethostent_r_proto='$gethostent_r_proto'
24355 getlogin_r_proto='$getlogin_r_proto'
24356 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24357 getnetbyname_r_proto='$getnetbyname_r_proto'
24358 getnetent_r_proto='$getnetent_r_proto'
24359 getprotobyname_r_proto='$getprotobyname_r_proto'
24360 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24361 getprotoent_r_proto='$getprotoent_r_proto'
24362 getpwent_r_proto='$getpwent_r_proto'
24363 getpwnam_r_proto='$getpwnam_r_proto'
24364 getpwuid_r_proto='$getpwuid_r_proto'
24365 getservbyname_r_proto='$getservbyname_r_proto'
24366 getservbyport_r_proto='$getservbyport_r_proto'
24367 getservent_r_proto='$getservent_r_proto'
24368 getspnam_r_proto='$getspnam_r_proto'
24369 gidformat='$gidformat'
24375 gmtime_r_proto='$gmtime_r_proto'
24376 gnulibc_version='$gnulibc_version'
24378 groupcat='$groupcat'
24379 groupstype='$groupstype'
24382 h_sysfile='$h_sysfile'
24385 hostgenerate='$hostgenerate'
24386 hostosname='$hostosname'
24387 hostperl='$hostperl'
24388 html1dir='$html1dir'
24389 html1direxp='$html1direxp'
24390 html3dir='$html3dir'
24391 html3direxp='$html3direxp'
24400 i_arpainet='$i_arpainet'
24402 i_bsdioctl='$i_bsdioctl'
24406 i_dirent='$i_dirent'
24408 i_execinfo='$i_execinfo'
24412 i_fp_class='$i_fp_class'
24414 i_gdbm_ndbm='$i_gdbm_ndbm'
24415 i_gdbmndbm='$i_gdbmndbm'
24417 i_ieeefp='$i_ieeefp'
24418 i_inttypes='$i_inttypes'
24419 i_langinfo='$i_langinfo'
24420 i_libutil='$i_libutil'
24421 i_locale='$i_locale'
24422 i_machcthr='$i_machcthr'
24423 i_malloc='$i_malloc'
24424 i_mallocmalloc='$i_mallocmalloc'
24425 i_mntent='$i_mntent'
24428 i_neterrno='$i_neterrno'
24429 i_netinettcp='$i_netinettcp'
24433 i_pthread='$i_pthread'
24435 i_quadmath='$i_quadmath'
24436 i_rpcsvcdbm='$i_rpcsvcdbm'
24438 i_shadow='$i_shadow'
24440 i_stdbool='$i_stdbool'
24441 i_stdint='$i_stdint'
24442 i_stdlib='$i_stdlib'
24443 i_sunmath='$i_sunmath'
24444 i_sysaccess='$i_sysaccess'
24445 i_sysdir='$i_sysdir'
24446 i_sysfile='$i_sysfile'
24447 i_sysfilio='$i_sysfilio'
24449 i_sysioctl='$i_sysioctl'
24450 i_syslog='$i_syslog'
24451 i_sysmman='$i_sysmman'
24452 i_sysmode='$i_sysmode'
24453 i_sysmount='$i_sysmount'
24454 i_sysndir='$i_sysndir'
24455 i_sysparam='$i_sysparam'
24456 i_syspoll='$i_syspoll'
24457 i_sysresrc='$i_sysresrc'
24458 i_syssecrt='$i_syssecrt'
24459 i_sysselct='$i_sysselct'
24460 i_syssockio='$i_syssockio'
24461 i_sysstat='$i_sysstat'
24462 i_sysstatfs='$i_sysstatfs'
24463 i_sysstatvfs='$i_sysstatvfs'
24464 i_systime='$i_systime'
24465 i_systimek='$i_systimek'
24466 i_systimes='$i_systimes'
24467 i_systypes='$i_systypes'
24468 i_sysuio='$i_sysuio'
24470 i_sysutsname='$i_sysutsname'
24471 i_sysvfs='$i_sysvfs'
24472 i_syswait='$i_syswait'
24473 i_termio='$i_termio'
24474 i_termios='$i_termios'
24476 i_unistd='$i_unistd'
24481 i_xlocale='$i_xlocale'
24482 ignore_versioned_solibs='$ignore_versioned_solibs'
24483 inc_version_list='$inc_version_list'
24484 inc_version_list_init='$inc_version_list_init'
24488 initialinstalllocation='$initialinstalllocation'
24489 installarchlib='$installarchlib'
24490 installbin='$installbin'
24491 installhtml1dir='$installhtml1dir'
24492 installhtml3dir='$installhtml3dir'
24493 installman1dir='$installman1dir'
24494 installman3dir='$installman3dir'
24495 installprefix='$installprefix'
24496 installprefixexp='$installprefixexp'
24497 installprivlib='$installprivlib'
24498 installscript='$installscript'
24499 installsitearch='$installsitearch'
24500 installsitebin='$installsitebin'
24501 installsitehtml1dir='$installsitehtml1dir'
24502 installsitehtml3dir='$installsitehtml3dir'
24503 installsitelib='$installsitelib'
24504 installsiteman1dir='$installsiteman1dir'
24505 installsiteman3dir='$installsiteman3dir'
24506 installsitescript='$installsitescript'
24507 installstyle='$installstyle'
24508 installusrbinperl='$installusrbinperl'
24509 installvendorarch='$installvendorarch'
24510 installvendorbin='$installvendorbin'
24511 installvendorhtml1dir='$installvendorhtml1dir'
24512 installvendorhtml3dir='$installvendorhtml3dir'
24513 installvendorlib='$installvendorlib'
24514 installvendorman1dir='$installvendorman1dir'
24515 installvendorman3dir='$installvendorman3dir'
24516 installvendorscript='$installvendorscript'
24518 issymlink='$issymlink'
24519 ivdformat='$ivdformat'
24522 known_extensions='$known_extensions'
24525 ld_can_script='$ld_can_script'
24526 lddlflags='$lddlflags'
24528 ldflags_uselargefiles='$ldflags_uselargefiles'
24529 ldlibpthname='$ldlibpthname'
24536 libsdirs='$libsdirs'
24537 libsfiles='$libsfiles'
24538 libsfound='$libsfound'
24539 libspath='$libspath'
24540 libswanted='$libswanted'
24541 libswanted_uselargefiles='$libswanted_uselargefiles'
24547 localtime_r_proto='$localtime_r_proto'
24548 locincpth='$locincpth'
24549 loclibpth='$loclibpth'
24550 longdblinfbytes='$longdblinfbytes'
24551 longdblkind='$longdblkind'
24552 longdblmantbits='$longdblmantbits'
24553 longdblnanbytes='$longdblnanbytes'
24554 longdblsize='$longdblsize'
24555 longlongsize='$longlongsize'
24556 longsize='$longsize'
24560 lseeksize='$lseeksize'
24561 lseektype='$lseektype'
24565 make_set_make='$make_set_make'
24566 mallocobj='$mallocobj'
24567 mallocsrc='$mallocsrc'
24568 malloctype='$malloctype'
24570 man1direxp='$man1direxp'
24573 man3direxp='$man3direxp'
24575 mips_type='$mips_type'
24576 mistrustnm='$mistrustnm'
24578 mmaptype='$mmaptype'
24579 modetype='$modetype'
24581 multiarch='$multiarch'
24583 myarchname='$myarchname'
24584 mydomain='$mydomain'
24585 myhostname='$myhostname'
24588 need_va_copy='$need_va_copy'
24589 netdb_hlen_type='$netdb_hlen_type'
24590 netdb_host_type='$netdb_host_type'
24591 netdb_name_type='$netdb_name_type'
24592 netdb_net_type='$netdb_net_type'
24595 nm_so_opt='$nm_so_opt'
24596 nonxs_ext='$nonxs_ext'
24598 nvEUformat='$nvEUformat'
24599 nvFUformat='$nvFUformat'
24600 nvGUformat='$nvGUformat'
24601 nv_overflows_integers_at='$nv_overflows_integers_at'
24602 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24603 nveformat='$nveformat'
24604 nvfformat='$nvfformat'
24605 nvgformat='$nvgformat'
24606 nvmantbits='$nvmantbits'
24609 o_nonblock='$o_nonblock'
24611 old_pthread_create_joinable='$old_pthread_create_joinable'
24612 optimize='$optimize'
24613 orderlib='$orderlib'
24616 otherlibdirs='$otherlibdirs'
24620 patchlevel='$patchlevel'
24621 path_sep='$path_sep'
24624 perl_patchlevel='$perl_patchlevel'
24625 perl_static_inline='$perl_static_inline'
24626 perladmin='$perladmin'
24627 perllibs='$perllibs'
24628 perlpath='$perlpath'
24630 phostname='$phostname'
24636 prefixexp='$prefixexp'
24638 privlibexp='$privlibexp'
24639 procselfexe='$procselfexe'
24641 quadkind='$quadkind'
24642 quadtype='$quadtype'
24643 randbits='$randbits'
24644 randfunc='$randfunc'
24645 random_r_proto='$random_r_proto'
24646 randseedtype='$randseedtype'
24648 rd_nodata='$rd_nodata'
24649 readdir64_r_proto='$readdir64_r_proto'
24650 readdir_r_proto='$readdir_r_proto'
24651 revision='$revision'
24657 sGMTIME_max='$sGMTIME_max'
24658 sGMTIME_min='$sGMTIME_min'
24659 sLOCALTIME_max='$sLOCALTIME_max'
24660 sLOCALTIME_min='$sLOCALTIME_min'
24661 sPRIEUldbl='$sPRIEUldbl'
24662 sPRIFUldbl='$sPRIFUldbl'
24663 sPRIGUldbl='$sPRIGUldbl'
24664 sPRIXU64='$sPRIXU64'
24666 sPRIeldbl='$sPRIeldbl'
24667 sPRIfldbl='$sPRIfldbl'
24668 sPRIgldbl='$sPRIgldbl'
24673 sSCNfldbl='$sSCNfldbl'
24674 sched_yield='$sched_yield'
24675 scriptdir='$scriptdir'
24676 scriptdirexp='$scriptdirexp'
24678 seedfunc='$seedfunc'
24679 selectminbits='$selectminbits'
24680 selecttype='$selecttype'
24681 sendmail='$sendmail'
24682 setgrent_r_proto='$setgrent_r_proto'
24683 sethostent_r_proto='$sethostent_r_proto'
24684 setlocale_r_proto='$setlocale_r_proto'
24685 setnetent_r_proto='$setnetent_r_proto'
24686 setprotoent_r_proto='$setprotoent_r_proto'
24687 setpwent_r_proto='$setpwent_r_proto'
24688 setservent_r_proto='$setservent_r_proto'
24691 sharpbang='$sharpbang'
24692 shmattype='$shmattype'
24693 shortsize='$shortsize'
24696 sig_count='$sig_count'
24697 sig_name='$sig_name'
24698 sig_name_init='$sig_name_init'
24700 sig_num_init='$sig_num_init'
24701 sig_size='$sig_size'
24702 signal_t='$signal_t'
24703 sitearch='$sitearch'
24704 sitearchexp='$sitearchexp'
24706 sitebinexp='$sitebinexp'
24707 sitehtml1dir='$sitehtml1dir'
24708 sitehtml1direxp='$sitehtml1direxp'
24709 sitehtml3dir='$sitehtml3dir'
24710 sitehtml3direxp='$sitehtml3direxp'
24712 sitelib_stem='$sitelib_stem'
24713 sitelibexp='$sitelibexp'
24714 siteman1dir='$siteman1dir'
24715 siteman1direxp='$siteman1direxp'
24716 siteman3dir='$siteman3dir'
24717 siteman3direxp='$siteman3direxp'
24718 siteprefix='$siteprefix'
24719 siteprefixexp='$siteprefixexp'
24720 sitescript='$sitescript'
24721 sitescriptexp='$sitescriptexp'
24722 sizesize='$sizesize'
24723 sizetype='$sizetype'
24727 sockethdr='$sockethdr'
24728 socketlib='$socketlib'
24729 socksizetype='$socksizetype'
24731 spackage='$spackage'
24732 spitshell='$spitshell'
24733 srand48_r_proto='$srand48_r_proto'
24734 srandom_r_proto='$srandom_r_proto'
24736 ssizetype='$ssizetype'
24737 st_ino_sign='$st_ino_sign'
24738 st_ino_size='$st_ino_size'
24739 startperl='$startperl'
24741 static_ext='$static_ext'
24743 stdio_base='$stdio_base'
24744 stdio_bufsiz='$stdio_bufsiz'
24745 stdio_cnt='$stdio_cnt'
24746 stdio_filbuf='$stdio_filbuf'
24747 stdio_ptr='$stdio_ptr'
24748 stdio_stream_array='$stdio_stream_array'
24749 strerror_r_proto='$strerror_r_proto'
24751 subversion='$subversion'
24756 targetarch='$targetarch'
24757 targetdir='$targetdir'
24758 targetenv='$targetenv'
24759 targethost='$targethost'
24760 targetmkdir='$targetmkdir'
24761 targetport='$targetport'
24762 targetsh='$targetsh'
24766 timeincl='$timeincl'
24767 timetype='$timetype'
24768 tmpnam_r_proto='$tmpnam_r_proto'
24774 ttyname_r_proto='$ttyname_r_proto'
24783 uidformat='$uidformat'
24789 uquadtype='$uquadtype'
24790 use5005threads='$use5005threads'
24791 use64bitall='$use64bitall'
24792 use64bitint='$use64bitint'
24793 usecbacktrace='$usecbacktrace'
24794 usecrosscompile='$usecrosscompile'
24795 usedevel='$usedevel'
24797 usedtrace='$usedtrace'
24798 usefaststdio='$usefaststdio'
24799 useithreads='$useithreads'
24800 usekernprocpathname='$usekernprocpathname'
24801 uselargefiles='$uselargefiles'
24802 uselongdouble='$uselongdouble'
24803 usemallocwrap='$usemallocwrap'
24804 usemorebits='$usemorebits'
24805 usemultiplicity='$usemultiplicity'
24806 usemymalloc='$usemymalloc'
24808 usensgetexecutablepath='$usensgetexecutablepath'
24809 useopcode='$useopcode'
24810 useperlio='$useperlio'
24811 useposix='$useposix'
24812 usequadmath='$usequadmath'
24813 usereentrant='$usereentrant'
24814 userelocatableinc='$userelocatableinc'
24815 useshrplib='$useshrplib'
24816 usesitecustomize='$usesitecustomize'
24817 usesocks='$usesocks'
24818 usethreads='$usethreads'
24819 usevendorprefix='$usevendorprefix'
24820 useversionedarchname='$useversionedarchname'
24821 usevfork='$usevfork'
24824 uvXUformat='$uvXUformat'
24825 uvoformat='$uvoformat'
24828 uvuformat='$uvuformat'
24829 uvxformat='$uvxformat'
24830 vendorarch='$vendorarch'
24831 vendorarchexp='$vendorarchexp'
24832 vendorbin='$vendorbin'
24833 vendorbinexp='$vendorbinexp'
24834 vendorhtml1dir='$vendorhtml1dir'
24835 vendorhtml1direxp='$vendorhtml1direxp'
24836 vendorhtml3dir='$vendorhtml3dir'
24837 vendorhtml3direxp='$vendorhtml3direxp'
24838 vendorlib='$vendorlib'
24839 vendorlib_stem='$vendorlib_stem'
24840 vendorlibexp='$vendorlibexp'
24841 vendorman1dir='$vendorman1dir'
24842 vendorman1direxp='$vendorman1direxp'
24843 vendorman3dir='$vendorman3dir'
24844 vendorman3direxp='$vendorman3direxp'
24845 vendorprefix='$vendorprefix'
24846 vendorprefixexp='$vendorprefixexp'
24847 vendorscript='$vendorscript'
24848 vendorscriptexp='$vendorscriptexp'
24850 version_patchlevel_string='$version_patchlevel_string'
24851 versiononly='$versiononly'
24855 yaccflags='$yaccflags'
24860 : add special variables
24861 $test -f $src/patchlevel.h && \
24862 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24863 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24864 echo "PERL_CONFIG_SH=true" >>config.sh
24866 : propagate old symbols
24867 if $test -f UU/config.sh; then
24868 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24869 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24870 config.sh config.sh UU/oldconfig.sh |\
24871 $sort | $uniq -u >UU/oldsyms
24872 set X `$cat UU/oldsyms`
24878 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24880 echo ": Variables propagated from previous config.sh file." >>config.sh
24881 for sym in `$cat UU/oldsyms`; do
24882 echo " Propagating $hint variable "'$'"$sym..."
24883 eval 'tmp="$'"${sym}"'"'
24885 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24891 : preserve RCS keywords in files with variable substitution, grrr
24894 : Finish up by extracting the .SH files
24897 echo "Stopping at your request, leaving temporary files around."
24907 If you'd like to make any changes to the config.sh file before I begin
24908 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24911 rp="Press return or use a shell escape to edit config.sh:"
24916 *) : in case they cannot read
24917 sh 1>&4 -c "$ans";;
24922 : if this fails, just run all the .SH files by hand
24931 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24938 Now you need to generate make dependencies by running "$make depend".
24939 You might prefer to run it in background: "$make depend > makedepend.out &"
24940 It can take a while, so you might not want to run it right now.
24945 rp="Run $make depend now?"
24949 $make depend && echo "Now you must run '$make'."
24952 echo "You must run '$make depend' then '$make'."
24955 elif test -f [Mm]akefile; then
24957 echo "Now you must run a $make."
24959 echo "Configure done."
24962 if $test -f Policy.sh; then
24965 If you compile $package on a different machine or from a different object
24966 directory, copy the Policy.sh file from this object directory to the
24967 new one before you run Configure -- this will help you with most of
24968 the policy defaults.
24972 if $test -f UU/config.msg; then
24973 echo "Hmm. I also noted the following information while running:"
24975 $cat UU/config.msg >&4
24977 $rm -f kit*isdone ark*isdone