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 may wish to get metaconfig. Perl uses a modified version of this
17 # tool, available in the "dist" folder in the checkout of the git repo
18 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
19 # The original dist package (including metaconfig) is available via SVN:
20 # $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
22 # Though this script was generated by metaconfig from metaunits, it is
23 # OK to send patches against Configure itself. It's up to the Configure
24 # pumpkin to backport the patch to the metaunits if it is accepted.
25 # For more information on patching Configure, see pod/perlhack.pod
27 # The metaunits are also available from the public git repository:
28 # http://perl5.git.perl.org/metaconfig.git/ or
29 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
31 # See Porting/pumpkin.pod for more information on metaconfig.
33 # Generated using [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test -f /sys/utilities/MultiView ; then
73 # AmigaOS, test -c for /dev/null is not useful
75 elif test ! -c /dev/null ; then
78 *** I'm sorry, but /dev/null appears to be a file rather than a device.
79 *** Please consult your operating sytem's notes for making a device
81 *** Cannot continue, aborting.
87 : compute my invocation name
91 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
96 : Proper separator for the PATH environment variable
98 : On OS/2 this directory should exist if this is not floppy only system ":-]"
99 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
100 if test -n "$OS2_SHELL"; then
102 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
103 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
105 elif test -n "$DJGPP"; then
106 case "X${MACHTYPE:-nonesuchmach}" in
113 : Proper PATH setting
114 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
115 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
116 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
117 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
118 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
119 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
120 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
121 paths="$paths /sbin /usr/sbin /usr/libexec"
122 paths="$paths /system/gnu_library/bin"
126 case "$p_$PATH$p_" in
128 *) test -d $p && PATH=$PATH$p_$p ;;
135 : shall we be using ksh?
141 if (PATH=.; alias -x) >/dev/null 2>&1; then
144 if test -f /hp-ux -a -f /bin/ksh; then
145 needksh='to avoid sh bug in "here document" expansion'
147 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
148 if test X`/usr/bin/uname -v` = X4; then
149 avoidksh="to avoid AIX 4's /bin/sh"
153 if test -f /osf_boot -a -f /usr/sbin/setld; then
154 if test X`/usr/bin/uname -s` = XOSF1; then
155 avoidksh="to avoid Digital UNIX' ksh"
160 case "$inksh/$needksh" in
167 case "$inksh/$avoidksh" in
173 case "$inksh/$needksh-$avoidksh-" in
176 (I see you are using the Korn shell. Some ksh's blow up on $me,
177 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
184 echo "(Feeding myself to $newsh $reason.)"
186 Configure|*/Configure) exec $newsh $0 "$@";;
187 *) exec $newsh Configure "$@";;
191 test -x "${newsh}" || unset newsh
193 : if needed, set CDPATH to a harmless value that is not chatty
194 : avoid bash 2.02 problems with empty CDPATH.
198 *bash*) CDPATH='.' ;;
204 : Configure runs within the UU subdirectory
205 test -d UU || mkdir UU
349 useversionedarchname=''
355 initialinstalllocation=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_warn_unused_result=''
395 d_printf_format_null=''
399 d_builtin_choose_expr=''
402 d_c99_variadic_macros=''
452 endhostent_r_proto=''
458 endprotoent_r_proto=''
464 endservent_r_proto=''
529 gethostbyaddr_r_proto=''
531 gethostbyname_r_proto=''
533 gethostent_r_proto=''
546 getnetbyaddr_r_proto=''
548 getnetbyname_r_proto=''
562 d_getprotobyname_r=''
563 getprotobyname_r_proto=''
564 d_getprotobynumber_r=''
565 getprotobynumber_r_proto=''
567 getprotoent_r_proto=''
579 getservbyname_r_proto=''
581 getservbyport_r_proto=''
583 getservent_r_proto=''
616 d_lc_monetary_2008=''
621 d_libm_lib_version=''
628 d_localtime_r_needs_tzset=''
648 d_malloc_good_size=''
696 d_old_pthread_create_joinable=''
697 old_pthread_create_joinable=''
699 d_pthread_attr_setscope=''
747 sethostent_r_proto=''
764 setprotoent_r_proto=''
776 setservent_r_proto=''
798 d_ipv6_mreq_source=''
815 d_sprintf_returns_strlen=''
828 perl_static_inline=''
833 d_stdio_ptr_lval_nochange_cnt=''
834 d_stdio_ptr_lval_sets_cnt=''
986 d_gdbm_ndbm_h_uses_prototypes=''
987 d_gdbmndbm_h_uses_prototypes=''
989 d_ndbm_h_uses_prototypes=''
1065 d_inc_version_list=''
1067 inc_version_list_init=''
1075 installusrbinperl=''
1091 ignore_versioned_solibs=''
1155 d_perl_otherlibdirs=''
1163 api_versionstring=''
1169 version_patchlevel_string=''
1173 d_nv_preserves_uv=''
1174 d_nv_zero_is_allbits_zero=''
1185 nv_overflows_integers_at=''
1186 nv_preserves_uv_bits=''
1259 installsitehtml1dir=''
1262 installsitehtml3dir=''
1269 installsiteman1dir=''
1272 installsiteman3dir=''
1277 installsitescript=''
1295 d_stdio_stream_array=''
1296 stdio_stream_array=''
1314 usekernprocpathname=''
1315 ccflags_uselargefiles=''
1316 ldflags_uselargefiles=''
1317 libswanted_uselargefiles=''
1326 usensgetexecutablepath=''
1340 installvendorarch=''
1347 installvendorhtml1dir=''
1349 vendorhtml1direxp=''
1350 installvendorhtml3dir=''
1352 vendorhtml3direxp=''
1358 installvendorman1dir=''
1361 installvendorman3dir=''
1368 installvendorscript=''
1379 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1382 : We must find out about Eunice early
1384 if test -f /etc/unixtovms; then
1385 eunicefix=/etc/unixtovms
1387 if test -f /etc/unixtovms.exe; then
1388 eunicefix=/etc/unixtovms.exe
1391 : Set executable suffix now -- needed before hints available
1392 if test -f "/libs/version.library"; then
1395 elif test -f "/system/gnu_library/bin/ar.pm"; then
1398 elif test -n "$DJGPP"; then
1401 elif test -f /kern/cookiejar; then
1404 elif test -d c:/. -o -n "$is_os2" ; then
1411 : Trailing extension. Override this in a hint file, if needed.
1412 : Extra object files, if any, needed on this platform.
1415 : Possible local include directories to search.
1416 : Set locincpth to "" in a hint file to defeat local include searches.
1417 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1418 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1420 : no include file wanted by default
1423 : Enable -DEBUGGING and -DDEBUGGING from the command line
1428 : change the next line if compiling for Xenix/286 on Xenix/386
1429 xlibpth='/usr/lib/386 /lib/386'
1430 : Possible local library directories to search.
1431 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1432 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1434 : general looking path for locating libraries
1435 glibpth="/lib /usr/lib $xlibpth"
1436 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1437 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1438 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1439 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1441 : Private path used by Configure to find libraries. Its value
1442 : is prepended to libpth. This variable takes care of special
1443 : machines, like the mips. Usually, it should be empty.
1446 : default library list
1448 : some systems want to use only the non-versioned libso:s
1449 ignore_versioned_solibs=''
1450 : set usethreads on the Configure command line to enable threads.
1451 usereentrant='undef'
1455 : set useposix=false in your hint file to disable the POSIX extension.
1457 : set useopcode=false in your hint file to disable the Opcode extension.
1460 ccflags_uselargefiles=''
1461 ldflags_uselargefiles=''
1462 libswanted_uselargefiles=''
1463 : set usemultiplicity on the Configure command line to enable multiplicity.
1464 : set usesocks on the Configure command line to enable socks.
1465 : List of libraries we want.
1466 : If anyone needs extra -lxxx, put those in a hint file.
1467 libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
1468 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1469 : We probably want to search /usr/shlib before most other libraries.
1470 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1471 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1472 glibpth="/usr/shlib $glibpth"
1473 : Do not use vfork unless overridden by a hint file.
1476 : Find the basic shell for Bourne shell scripts
1480 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1483 if test -f "$xxx"; then
1486 : Build up a list and do a single loop so we can 'break' out.
1487 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1488 for xxx in sh bash ksh pdksh ash; do
1490 try="$try ${p}/${xxx}"
1494 if test -f "$xxx"; then
1497 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1500 elif test -f "$xxx.exe"; then
1511 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1513 Usually it's in /bin/sh. How did you even get this far?
1514 Please contact me (Perl Maintainers) at perlbug@perl.org and
1515 we'll try to straighten this all out.
1521 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1522 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1525 : see if sh knows # comments
1526 if `$sh -c '#' >/dev/null 2>&1`; then
1530 test -f $xcat$_exe || xcat=/usr/bin/cat
1531 if test ! -f $xcat$_exe; then
1532 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1533 if test -f $p/cat$_exe; then
1538 if test ! -f $xcat$_exe; then
1539 echo "Can't find cat anywhere!"
1543 echo "#!$xcat" >sharp
1546 ./sharp > today 2>/dev/null
1547 if test -s today; then
1550 echo "#! $xcat" > sharp
1553 ./sharp > today 2>/dev/null
1554 if test -s today; then
1562 echo "Your $sh doesn't grok # comments--I will strip them later on."
1565 echo "exec grep -v '^[ ]*#'" >spitshell
1567 $eunicefix spitshell
1568 spitshell=`pwd`/spitshell
1570 echo "I presume that if # doesn't work, #! won't work either!"
1575 : figure out how to guarantee sh startup
1577 '') startsh=${sharpbang}${sh} ;;
1589 : echo "Yup, it does."
1591 echo "Hmm... '$startsh' does not guarantee sh startup..."
1592 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1596 : Save command line options in file UU/cmdline.opt for later use in
1597 : generating config.sh.
1598 cat > cmdline.opt <<EOSH
1599 : Configure command line arguments.
1608 cat >>cmdline.opt <<EOSH
1609 config_arg$argn='$arg'
1611 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1614 arg_exp=`cat cmdl.opt`
1615 args_exp="$args_exp$args_sep'$arg_exp'"
1616 argn=`expr $argn + 1`
1621 : produce awk script to parse command line options
1622 cat >options.awk <<'EOF'
1624 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1626 len = length(optstr);
1627 for (i = 1; i <= len; i++) {
1628 c = substr(optstr, i, 1);
1629 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1640 if (substr(str, 1, 1) != "-") {
1641 printf("'%s'\n", str);
1645 for (i = 2; i <= len; i++) {
1646 c = substr(str, i, 1);
1648 printf("-%s\n", substr(str, i));
1654 printf("'%s'\n", substr(str, i + 1));
1667 : process the command line options
1668 set X `for arg in "$@"; do echo "X$arg"; done |
1669 sed -e s/X// | awk -f options.awk`
1674 : set up default values
1683 rm -f optdef.sh posthint.sh
1684 cat >optdef.sh <<EOS
1690 while test $# -gt 0; do
1692 -d) shift; fastread=yes;;
1693 -e) shift; alldone=cont;;
1697 if test -r "$1"; then
1700 echo "$me: cannot read config file $1." >&2
1706 -h) shift; error=true;;
1707 -r) shift; reuseval=true;;
1708 -s) shift; silent=true; realsilent=true;;
1709 -E) shift; alldone=exit;;
1710 -K) shift; knowitall=true;;
1712 -S) shift; silent=true; extractsh=true;;
1717 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1718 echo "$me: ignoring -D $1" >&2
1721 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1722 *) echo "$1='define'" >> optdef.sh;;
1729 *=) echo "$1" >> optdef.sh;;
1731 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1732 echo "$me: ignoring -U $1" >&2
1734 *) echo "$1='undef'" >> optdef.sh;;
1745 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1749 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1750 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1756 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1757 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1758 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1759 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1760 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1761 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1767 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1769 echo "$yyy=''" >> posthint.sh ;;
1774 echo "$yyy='$zzz'" >> posthint.sh ;;
1776 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1778 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1783 echo "$yyy=$zzz" >> posthint.sh ;;
1784 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1788 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1791 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1799 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1800 [-U symbol] [-U symbol=] [-A command:symbol...]
1801 -d : use defaults for all answers.
1802 -e : go on without questioning past the production of config.sh.
1803 -f : specify an alternate default configuration file.
1804 -h : print this help message and exit (with an error status).
1805 -r : reuse C symbols value if possible (skips costly nm extraction).
1806 -s : silent mode, only echoes questions and essential information.
1807 -D : define symbol to have some value:
1808 -D symbol symbol gets the value 'define'
1809 -D symbol=value symbol gets the value 'value'
1810 common used examples (see INSTALL for more info):
1811 -Duse64bitint use 64bit integers
1812 -Duse64bitall use 64bit integers and pointers
1813 -Dusethreads use thread support
1814 -Dinc_version_list=none do not include older perl trees in @INC
1815 -DEBUGGING=none DEBUGGING options
1816 -Dcc=gcc choose your compiler
1817 -Dprefix=/opt/perl5 choose your destination
1818 -E : stop at the end of questions, after having produced config.sh.
1819 -K : do not use unless you know what you are doing.
1820 -O : ignored for backward compatibility
1821 -S : perform variable substitutions on all .SH files (can mix with -f)
1822 -U : undefine symbol:
1823 -U symbol symbol gets the value 'undef'
1824 -U symbol= symbol gets completely empty
1826 -A : manipulate symbol after the platform specific hints have been applied:
1827 -A append:symbol=value append value to symbol
1828 -A symbol=value like append:, but with a separating space
1829 -A define:symbol=value define symbol to have value
1830 -A clear:symbol define symbol to be ''
1831 -A define:symbol define symbol to be 'define'
1832 -A eval:symbol=value define symbol to be eval of value
1833 -A prepend:symbol=value prepend value to symbol
1834 -A undef:symbol define symbol to be 'undef'
1835 -A undef:symbol= define symbol to be ''
1836 e.g.: -A prepend:libswanted='cl pthread '
1837 -A ccflags=-DSOME_MACRO
1838 -V : print version number and exit (with a zero status).
1845 case "$fastread$alldone" in
1848 case "$extractsh" in
1851 if test ! -t 0; then
1852 echo "Say 'sh Configure', not 'sh <Configure'"
1862 true) exec 1>/dev/null;;
1865 : run the defines and the undefines, if any, but leave the file out there...
1867 grep -q '\\' optdef.sh
1868 if test $? = 0; then
1869 echo "Configure does not support \\ in -D arguments"
1873 : create the posthint manipulation script and leave the file out there...
1878 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1879 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1880 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1881 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1882 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1885 : Some greps do not return status, grrr.
1886 echo "grimblepritz" >grimble
1887 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1889 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1895 : the following should work in any shell
1899 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1900 cat >contains <<'EOSS'
1901 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1906 : Find the path to the source tree
1909 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1913 *) src=`cd ../$src && pwd` ;;
1926 if test -f $rsrc/Configure && \
1927 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1929 : found it, so we are ok.
1932 for src in . .. ../.. ../../.. ../../../..; do
1933 if test -f ../$src/Configure && \
1934 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1945 Sorry, I can't seem to locate the source dir for $package. Please start
1946 Configure with an explicit path -- i.e. /some/path/Configure.
1954 echo "Sources for $package found in \"$src\"." >&4
1958 : script used to extract .SH files with variable substitutions
1959 cat >extract <<'EOS'
1961 echo "Doing variable substitutions on .SH files..."
1962 if test -f MANIFEST; then
1963 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1965 echo "(Looking for .SH files under the source directory.)"
1966 set x `(cd "$src"; find . -name "*.SH" -print)`
1970 0) set x `(cd "$src"; echo *.SH)`; shift;;
1972 if test ! -f "$src/$1"; then
1978 while test $name; do
1979 if test ! -d "$name"; then
1980 create="$name $create";
1981 name=`echo $name | sed -e "s|^[^/]*$||"`;
1982 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1987 for file in $create; do
1996 dir=`expr X$file : 'X\(.*\)/'`
1997 file=`expr X$file : 'X.*/\(.*\)'`
1998 (cd "$dir" && . ./$file)
2008 dir=`expr X$file : 'X\(.*\)/'`
2009 file=`expr X$file : 'X.*/\(.*\)'`
2010 (set x $dir; shift; eval $mkdir_p)
2011 sh <"$src/$dir/$file"
2020 if test -f "$src/config_h.SH"; then
2021 if test ! -f config.h; then
2022 : oops, they left it out of MANIFEST, probably, so do it anyway.
2023 . "$src/config_h.SH"
2028 : extract files and exit if asked to do so
2029 case "$extractsh" in
2031 case "$realsilent" in
2035 case "$config_sh" in
2036 '') config_sh='config.sh';;
2039 echo "Fetching answers from $config_sh..."
2046 echo "Extraction done."
2051 : Eunice requires " " instead of "", can you believe it
2054 echo "Beginning of configuration questions for $package."
2056 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2058 : first determine how to suppress newline on echo command
2060 echo "Checking echo to see how to suppress newlines..."
2061 (echo "hi there\c" ; echo " ") >.echotmp
2062 if $contains c .echotmp >/dev/null 2>&1 ; then
2073 echo $n "The star should be here-->$c"
2077 : Now test for existence of everything in MANIFEST
2079 if test -f "$rsrc/MANIFEST"; then
2080 echo "First let's make sure your kit is complete. Checking..." >&4
2081 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2082 (split -l 50 2>/dev/null || split -50)
2085 for filelist in x??; do
2086 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2087 >/dev/null 2>>"$tmppwd/missing")
2089 if test -s missing; then
2093 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2095 You have the option of continuing the configuration process, despite the
2096 distinct possibility that your kit is damaged, by typing 'y'es. If you
2097 do, don't blame me if something goes wrong. I advise you to type 'n'o
2098 and contact the author (perlbug@perl.org).
2101 echo $n "Continue? [n] $c" >&4
2105 echo "Continuing..." >&4
2109 echo "ABORTING..." >&4
2114 echo "Looks good..."
2117 echo "There is no MANIFEST file. I hope your kit is complete !"
2121 : Find the appropriate value for a newline for tr
2123 if test -n "$DJGPP"; then
2126 if test X"$trnl" = X; then
2127 case "`echo foo|tr '\n' x 2>/dev/null`" in
2131 if test X"$trnl" = X; then
2132 case "`echo foo|tr '\012' x 2>/dev/null`" in
2133 foox) trnl='\012' ;;
2136 if test X"$trnl" = X; then
2137 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2138 fooxy) trnl='\n\r' ;;
2141 if test X"$trnl" = X; then
2144 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2150 : compute the number of columns on the terminal for proper question formatting
2155 : set up the echo used in my read
2156 myecho="case \"\$xxxm\" in
2157 '') echo $n \"\$rp $c\" >&4;;
2159 '') echo $n \"[\$xxxm] $c\";;
2161 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2163 echo $n \"[\$xxxm] $c\" >&4
2165 echo $n \"\$rp [\$xxxm] $c\" >&4
2171 : now set up to do reads with possible shell escape and default assignment
2177 case "\$fastread" in
2178 yes) case "\$dflt" in
2181 case "\$silent-\$rp" in
2186 *) case "\$silent" in
2187 true) case "\$rp" in
2192 while expr "X\$ans" : "X!" >/dev/null; do
2196 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2204 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2213 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2218 echo "(OK, I'll run with -d after this question.)" >&4
2221 echo "*** Sorry, \$1 not supported yet." >&4
2231 echo "*** Substitution done -- please confirm."
2233 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2238 echo "*** Error -- try again."
2245 case "\$ans\$xxxm\$nostick" in
2257 : create .config dir to save info across Configure sessions
2258 test -d ../.config || mkdir ../.config
2259 cat >../.config/README <<EOF
2260 This directory created by Configure to save information that should
2261 persist across sessions for $package.
2263 You may safely delete it if you wish.
2266 : See if we are using a devel version and want that
2267 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2270 usedevel="$define" ;;
2271 *) case "$xversion" in
2274 *** WHOA THERE!!! ***
2276 This is an UNSTABLE DEVELOPMENT release.
2277 The version of this $package distribution is $xversion, that is, odd,
2278 (as opposed to even) and that signifies a development release.
2279 If you want a maintenance release, you want an even-numbered version.
2281 Do ***NOT*** install this into production use.
2282 Data corruption and crashes are possible.
2284 It is most seriously suggested that you do not continue any further
2285 unless you want to help in developing and debugging Perl.
2287 If you *still* want to build perl, you can answer 'y' now,
2288 or pass -Dusedevel to Configure.
2291 rp='Do you really want to continue?'
2295 [yY]) echo >&4 "Okay, continuing."
2296 usedevel="$define" ;;
2297 *) echo >&4 "Okay, bye."
2308 case "$versiononly" in
2309 '') versiononly="$define" ;;
2311 case "$installusrbinperl" in
2312 '') installusrbinperl="$undef" ;;
2317 : general instructions
2320 user=`(logname) 2>/dev/null`
2322 '') user=`whoami 2>&1`;;
2324 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2327 rp='Would you like to see the instructions?'
2338 This installation shell script will examine your system and ask you questions
2339 to determine how the perl5 package should be installed. If you get
2340 stuck on a question, you may use a ! shell escape to start a subshell or
2341 execute a command. Many of the questions will have default answers in square
2342 brackets; typing carriage return will give you the default.
2344 On some of the questions which ask for file or directory names you are allowed
2345 to use the ~name construct to specify the login directory belonging to "name",
2346 even if you don't have a shell which knows about that. Questions where this is
2347 allowed will be marked "(~name ok)".
2351 dflt='Type carriage return to continue'
2355 The prompter used in this script allows you to use shell variables and
2356 backticks in your answers. You may use $1, $2, etc... to refer to the words
2357 in the default answer, as if the default line was a set of arguments given to a
2358 script shell. This means you may also use $* to repeat the whole default line,
2359 so you do not have to re-type everything to add something to the default.
2361 Every time there is a substitution, you will have to confirm. If there is an
2362 error (e.g. an unmatched backtick), the default answer will remain unchanged
2363 and you will be prompted again.
2365 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2366 the questions and use the computed defaults (or the previous answers if there
2367 was already a config.sh file). Type 'Configure -h' for a list of options.
2368 You may also start interactively and then answer '& -d' at any prompt to turn
2369 on the non-interactive behaviour for the remainder of the execution.
2375 Much effort has been expended to ensure that this shell script will run on any
2376 Unix system. If despite that it blows up on yours, your best bet is to edit
2377 Configure and run it again. If you can't run Configure for some reason,
2378 you'll have to generate a config.sh file by hand. Whatever problems you
2379 have, let me (perlbug@perl.org) know how I blew it.
2381 This installation script affects things in two ways:
2383 1) it may do direct variable substitutions on some of the files included
2385 2) it builds a config.h file for inclusion in C programs. You may edit
2386 any of these files as the need arises after running this script.
2388 If you make a mistake on a question, there is no easy way to back up to it
2389 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2390 files. Configure will offer to let you do this before it runs the SH files.
2393 dflt='Type carriage return to continue'
2395 case "$firsttime" in
2396 true) echo $user >>../.config/instruct;;
2400 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2401 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2402 if test "X$sysroot" = X; then
2407 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2408 # _sysroot is used in places where we need --sysroot=foo
2409 # but using the rest of the flags could cause issues.
2410 _sysroot="--sysroot=$sysroot";
2414 ccflags="$ccflags $_sysroot"
2419 ldflags="$ldflags $_sysroot"
2424 cppflags="$cppflags $_sysroot"
2426 # lddlflags updated below in lddlflags section;
2427 # same with cccdlflags
2431 # Adjust some defaults to also use $sysroot
2432 for var in xlibpth loclibpth locincpth glibpth; do
2435 for path in $xxx; do
2436 eval $var=\"\$$var $sysroot$path\"
2442 : find out where common programs are
2444 echo "Locating common programs..." >&4
2457 if test -d \$dir/\$thing; then
2463 for thisthing in \$dir/\$thing; do
2464 : just loop through to pick last item
2466 if test -f \$thisthing; then
2469 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2472 elif test -f \$dir/\$thing.exe; then
2473 if test -n "$DJGPP"; then
2474 echo \$dir/\$thing.exe
2475 elif test "$eunicefix" != ":"; then
2476 : on Eunice apparently
2529 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2530 pth="$pth $sysroot/lib $sysroot/usr/lib"
2531 for file in $loclist; do
2535 if test -f "$xxx"; then
2538 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2539 xxx=`./loc $file $file $pth`
2542 '') xxx=`./loc $file $file $pth`;;
2543 *) xxx=`./loc $xxx $xxx $pth`;;
2545 eval $file=$xxx$_exe
2549 echo $file is in $xxx.
2552 echo $file is in $xxx.
2555 echo "I don't know where '$file' is, and my life depends on it." >&4
2556 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2562 echo "Don't worry if any of the following aren't found..."
2564 for file in $trylist; do
2568 if test -f "$xxx"; then
2571 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2572 xxx=`./loc $file $file $pth`
2575 '') xxx=`./loc $file $file $pth`;;
2576 *) xxx=`./loc $xxx $xxx $pth`;;
2578 eval $file=$xxx$_exe
2582 echo $file is in $xxx.
2585 echo $file is in $xxx.
2588 echo "I don't see $file out there, $say."
2595 echo "Substituting grep for egrep."
2602 *) if $less -R </dev/null >/dev/null 2>&1; then
2603 echo "Substituting less -R for less."
2611 echo "Substituting cp for ln."
2620 echo "I can't find make or gmake, and my life depends on it." >&4
2621 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2629 *) # We can't have osname yet.
2630 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2631 # Assume that gmake, if found, is definitely GNU make
2632 # and prefer it over the system make.
2633 echo "Substituting gmake for make."
2641 echo "Hopefully test is built into your sh."
2644 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2645 echo "Using the test built into your sh."
2653 echo "Hopefully echo is built into your sh."
2658 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2659 $echo $n "hi there$c" >foo1
2660 echo $n "hi there$c" >foo2
2661 if cmp foo1 foo2 >/dev/null 2>&1; then
2662 echo "They are compatible. In fact, they may be identical."
2669 They are not compatible! You are probably running ksh on a non-USG system.
2670 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2671 have echo built in and we may have to run some Bourne shell scripts. That
2672 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2675 $echo $n "The star should be here-->$c"
2682 # This question was auctioned at YAPC::Europe-2007 in Vienna
2683 # I never promised you could answer it. I only auctioned the question.
2685 The following message is sponsored by
2687 Dresden.pm<--The stars should be here.
2689 Dear Perl user, system administrator or package
2690 maintainer, the Perl community sends greetings to
2691 you. Do you (emblematical) greet back [Y/n]? n
2695 : Check what type of C compiler we use
2699 cat <<'EOSC' >>trygcc
2704 int main(int argc, char *argv[]) {
2708 if $cc -o try $ccflags $ldflags try.c; then
2711 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2717 # Skip this test because it gives a false match on output like:
2718 # ./trygcc: line 23: cc: command not found
2719 # case "`$cc -v -c try.c 2>&1`" in
2720 # *gcc*) trygcc=no ;;
2722 if $test X"$trygcc" = Xyes; then
2723 if gcc -o try -c try.c; then
2725 echo "You seem to have a working gcc, though." >&4
2726 # Switching compilers may undo the work of hints files.
2727 # The most common problem is -D_REENTRANT for threads.
2728 # This heuristic catches that case, but gets false positives
2729 # if -Dusethreads was not actually specified. Better to
2730 # bail out here with a useful message than fail
2731 # mysteriously later. Should we perhaps just try to
2732 # re-invoke Configure -Dcc=gcc config_args ?
2733 if $test -f usethreads.cbu; then
2736 *** However, any setting of the C compiler flags (e.g. for thread support)
2737 *** will be lost. It may be necessary for you to restart Configure and
2738 *** add -Dcc=gcc to your Configure command line.
2741 rp="Would you like to go ahead and try gcc anyway?"
2744 rp="Would you like to use it?"
2747 if $test -f myread; then
2750 if $test -f UU/myread; then
2753 echo "Cannot find myread, sorry. Aborting." >&2
2758 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2771 cat <<'EOSC' >>checkcc
2776 int main(int argc, char *argv[]) {
2780 if $cc -o try $ccflags $ldflags try.c; then
2783 if $test X"$despair" = Xyes; then
2784 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2787 You need to find a working C compiler.
2788 Either (purchase and) install the C compiler supplied by your OS vendor,
2789 or for a free C compiler try http://gcc.gnu.org/
2790 I cannot continue any further, aborting.
2799 : determine whether symbolic links are supported
2802 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2803 echo "Symbolic links are supported." >&4
2806 echo "Symbolic links are NOT supported." >&4
2811 : determine whether symbolic links are supported
2815 echo "Checking how to test for symbolic links..." >&4
2817 if $test "X$issymlink" = X; then
2819 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2820 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2822 if test $? = 0; then
2825 echo "Your builtin 'test -h' may be broken." >&4
2828 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2831 if test -f "$p/$test"; then
2840 echo "Trying external '$test -h'." >&4
2841 issymlink="$test -h"
2842 if $test ! -h sym >/dev/null 2>&1; then
2843 echo "External '$test -h' is broken, too." >&4
2851 if $test "X$issymlink" = X; then
2852 if $test -L sym 2>/dev/null; then
2853 issymlink="$test -L"
2854 echo "The builtin '$test -L' worked." >&4
2857 if $test "X$issymlink" != X; then
2858 echo "You can test for symbolic links with '$issymlink'." >&4
2860 echo "I do not know how you can test for symbolic links." >&4
2864 *) echo "No symbolic links, so not testing for their testing..." >&4
2869 : Make symlinks util
2870 case "$mksymlinks" in
2873 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2876 *) case "$lns:$issymlink" in
2877 *"ln"*" -s:"*"test -"?)
2878 echo "Creating the symbolic links..." >&4
2880 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2890 print "# dir = ", dir, "file = ", file
2891 mf[dir] = mf[dir]" "source"/"dir"/"file;
2894 if (d != ".") { print("mkdir -p "d) }
2895 print("ln -sf "mf[d]" "d);
2897 }' source="$src" > UU/mksymlinks.$$
2901 if test ! -d t/base; then
2902 echo "Failed to create the subdirectories. Aborting." >&4
2906 if test ! -f t/base/lex.t; then
2907 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2910 if test ! -f win32/win32.c; then
2911 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2916 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2924 : Check for Cross-Compilation
2925 if $test "X$targethost" = "X"; then
2928 if $test "X$targetenv" = "X"; then
2931 case "$usecrosscompile" in
2933 $echo "Cross-compiling..."
2936 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2937 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2938 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2939 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2940 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2941 # leave out ld, choosing it is more complex
2942 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2943 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2944 # We are in a weird spot. Just before us, some values
2945 # were 'saved', to be restored after the hints are
2946 # run. This means that the changes we made to ar,
2947 # nm and ranlib will get reverted.
2948 # To avoid that, we hijack the saving mechanism and
2949 # have it save our new values.
2950 for file in ar nm ranlib; do
2952 eval $file=$xxx$_exe
2957 case "$targetarch" in
2958 '') echo "Targetarch not defined." >&4; croak=y ;;
2959 *) echo "Using targetarch $targetarch." >&4 ;;
2961 case "$targethost" in
2962 '') echo "Targethost not defined." >&4; croak=y ;;
2963 *) echo "Using targethost $targethost." >&4
2968 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2970 : compile a host miniperl and generate_uudmap, unless we got passed them
2971 if $test "X$hostperl" = X; then
2972 echo "Building host miniperl and generate_uudmap binaries" >&4
2980 $src/Configure -des -Dusedevel -Dmksymlinks
2982 case "$hostgenerate" in
2983 '') $make generate_uudmap
2984 hostgenerate=$src/host/generate_uudmap
2986 "$undef") hostgenerate=''
2989 hostperl=$src/host/miniperl
2992 hostosname=`$hostperl -le 'print $^O'`
2995 usecrosscompile="$undef"
2999 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3000 case "$targethost" in
3001 '') echo "Checking for cross-compile" >&4
3002 case "$usecrosscompile$multiarch" in
3003 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3004 if [ -f Makefile ]; then
3006 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3008 echo "Configure done."
3012 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3019 *) echo "Using targethost $targethost." >&4
3021 /*) run=$src/Cross/run
3022 targetmkdir=$src/Cross/mkdir
3024 from=$src/Cross/from
3026 *) pwd=`$test -f ../Configure & cd ..; pwd`
3028 targetmkdir=$pwd/Cross/mkdir
3030 from=$pwd/Cross/from
3033 case "$targetrun" in
3034 '') targetrun=ssh ;;
3039 case "$targetfrom" in
3040 '') targetfrom=scp ;;
3044 from=$from-$targetfrom
3045 case "$targetdir" in
3047 echo "Guessing targetdir $targetdir." >&4
3050 case "$targetuser" in
3052 echo "Guessing targetuser $targetuser." >&4
3055 case "$targetport" in
3057 echo "Guessing targetport $targetport." >&4
3060 case "$targetfrom" in
3064 case "$targetrun" in
3084 '') cwd=$targetdir ;;
3089 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3095 *) echo "Unknown targetrun '$targetrun'" >&4
3099 case "$targetmkdir" in
3101 cat >$targetmkdir <<EOF
3103 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3105 $chmod a+rx $targetmkdir
3107 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3119 $targetmkdir \`dirname \$f\`
3120 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3123 $targetmkdir $targetdir/\`dirname \$f\`
3124 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3137 $mkdir -p $targetdir/\`dirname \$f\`
3138 $cp \$f $targetdir/\$f || exit 1
3141 $targetmkdir $targetdir/\`dirname \$f\`
3142 $cp \$f $targetdir/\$f || exit 1
3149 *) echo "Unknown targetto '$targetto'" >&4
3153 case "$targetfrom" in
3160 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3165 cp) cat >$from <<EOF
3170 cp $targetdir/\$f . || exit 1
3175 *) echo "Unknown targetfrom '$targetfrom'" >&4
3179 if $test ! -f $run; then
3180 echo "Target 'run' script '$run' not found." >&4
3184 if $test ! -f $to; then
3185 echo "Target 'to' script '$to' not found." >&4
3189 if $test ! -f $from; then
3190 echo "Target 'from' script '$from' not found." >&4
3194 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3198 Using '$run' for remote execution,
3199 and '$from' and '$to'
3200 for remote file transfer.
3206 usecrosscompile="$undef"
3211 : see whether [:lower:] and [:upper:] are supported character classes
3213 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3215 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3219 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3220 # (0xd9 and 0xe2), therefore that is a nice testing point.
3221 if test "X$up" = X -o "X$low" = X; then
3222 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3228 if test "X$up" = X -o "X$low" = X; then
3229 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3235 if test "X$up" = X -o "X$low" = X; then
3236 case "`echo RS | od -x 2>/dev/null`" in
3238 echo "Hey, this might be EBCDIC." >&4
3239 if test "X$up" = X -o "X$low" = X; then
3240 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3241 rs) up='[A-IJ-RS-Z]'
3246 if test "X$up" = X -o "X$low" = X; then
3247 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3257 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3259 echo "Using $up and $low to convert case." >&4
3262 echo "I don't know how to translate letters from upper to lower case." >&4
3263 echo "Your tr is not acting any way I know of." >&4
3267 : set up the translation script tr, must be called with ./tr of course
3271 '[A-Z][a-z]') exec $tr '$up' '$low';;
3272 '[a-z][A-Z]') exec $tr '$low' '$up';;
3279 : Try to determine whether config.sh was made on this system
3280 case "$config_sh" in
3282 myuname=`$uname -a 2>/dev/null`
3283 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3284 # Downcase everything to avoid ambiguity.
3285 # Remove slashes and single quotes so we can use parts of this in
3286 # directory and file names.
3287 # Remove newlines so myuname is sane to use elsewhere.
3288 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3289 # because the A-Z/a-z are not consecutive.
3290 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3291 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3292 newmyuname="$myuname"
3294 case "$knowitall" in
3296 if test -f ../config.sh; then
3297 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3298 eval "`grep myuname= ../config.sh`"
3300 if test "X$myuname" = "X$newmyuname"; then
3308 : Get old answers from old config file if Configure was run on the
3309 : same system, otherwise use the hints.
3312 if test -f config.sh; then
3314 rp="I see a config.sh file. Shall I use it to set the defaults?"
3317 n*|N*) echo "OK, I'll ignore it."
3318 mv config.sh config.sh.old
3319 myuname="$newmyuname"
3321 *) echo "Fetching default answers from your old config.sh file..." >&4
3329 : Older versions did not always set $sh. Catch re-use of such
3339 if test ! -f config.sh; then
3342 First time through, eh? I have some defaults handy for some systems
3343 that need some extra help getting the Configure answers right:
3346 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3348 : Half the following guesses are probably wrong... If you have better
3349 : tests or hints, please send them to perlbug@perl.org
3350 : The metaconfig authors would also appreciate a copy...
3351 $test -f /irix && osname=irix
3352 $test -f /xenix && osname=sco_xenix
3353 $test -f /dynix && osname=dynix
3354 $test -f /dnix && osname=dnix
3355 $test -f /lynx.os && osname=lynxos
3356 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3357 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3358 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3359 $test -f /bin/mips && /bin/mips && osname=mips
3360 $test -d /usr/apollo/bin && osname=apollo
3361 $test -f /etc/saf/_sactab && osname=svr4
3362 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3363 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3364 $test -f /sys/utilities/MultiView && osname=amigaos
3365 if $test -d /MachTen -o -d /MachTen_Folder; then
3367 if $test -x /sbin/version; then
3368 osvers=`/sbin/version | $awk '{print $2}' |
3369 $sed -e 's/[A-Za-z]$//'`
3370 elif $test -x /usr/etc/version; then
3371 osvers=`/usr/etc/version | $awk '{print $2}' |
3372 $sed -e 's/[A-Za-z]$//'`
3378 $test -f /sys/posix.dll &&
3379 $test -f /usr/bin/what &&
3380 set X `/usr/bin/what /sys/posix.dll` &&
3381 $test "$3" = UWIN &&
3385 if $test -f $uname; then
3393 umips) osname=umips ;;
3396 [23]100) osname=mips ;;
3398 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3399 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3402 elif $test -f /etc/kconfig; then
3404 if test "$lns" = "$ln -s"; then
3406 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3408 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3415 if test -n "$DJGPP"; then
3424 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3426 # oslevel can fail with:
3427 # oslevel: Unable to acquire lock.
3428 *not\ found) osvers="$4"."$3" ;;
3429 '<3240'|'<>3240') osvers=3.2.0 ;;
3430 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3431 '=3250'|'>3250') osvers=3.2.5 ;;
3435 bitrig) osname=bitrig
3438 bsd386) osname=bsd386
3441 cygwin*) osname=cygwin
3444 *dc.osx) osname=dcosx
3450 domainos) osname=apollo
3456 dragonfly) osname=dragonfly
3459 dynixptx*) osname=dynixptx
3460 osvers=`echo "$4"|sed 's/^v//'`
3462 freebsd) osname=freebsd
3464 genix) osname=genix ;;
3468 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3481 $test -f /system/lib/libandroid.so && osname=linux-android
3485 netbsd*) osname=netbsd
3488 news-os) osvers="$3"
3490 4*) osname=newsos4 ;;
3494 nonstop-ux) osname=nonstopux ;;
3495 openbsd) osname=openbsd
3501 POSIX-BC | posix-bc ) osname=posix-bc
3504 powerux | power_ux | powermax_os | powermaxos | \
3505 powerunix | power_unix) osname=powerux
3511 solaris) osname=solaris
3513 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3520 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3524 titanos) osname=titanos
3533 ultrix) osname=ultrix
3536 osf1|mls+) case "$5" in
3539 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3542 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3545 hp*) osname=hp_osf1 ;;
3546 mips) osname=mips_osf1 ;;
3549 # UnixWare 7.1.2 is known as Open UNIX 8
3550 openunix|unixware) osname=svr5
3558 $2) case "$osname" in
3562 : svr4.x or possibly later
3572 if test -f /stand/boot ; then
3573 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3574 if test -n "$INITPROG" -a -f "$INITPROG"; then
3575 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3576 if test -n "$isesix"; then
3584 *) if test -f /etc/systemid; then
3586 set `echo $3 | $sed 's/\./ /g'` $4
3587 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3589 elif $test -f $src/hints/sco_$1_$2.sh; then
3591 elif $test -f $src/hints/sco_$1.sh; then
3596 '') : Still unknown. Probably a generic Sys V.
3605 *) case "$osname" in
3606 '') : Still unknown. Probably a generic BSD.
3614 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3615 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3616 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3619 $rm -f UU/kernel.what
3620 elif test -d c:/. -o -n "$is_os2" ; then
3627 case "$targetarch" in
3630 case "$targetarch" in
3632 # Will load qnx.sh, which should change osname to nto
3637 # Catch arm-linux-androideabi, mipsel-linux-android,
3638 # and i686-linux-android
3639 osname=linux-android
3643 # Something like arm-linux-gnueabihf is really just
3650 # XXX perhaps we should just assume
3651 # osvers to be 2, or maybe take the value
3652 # from targetarch. Using $run before the
3653 # hints are run is somewhat icky.
3654 set X `$run $uname -a 2>/dev/null`
3657 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3662 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3669 : Now look for a hint file osname_osvers, unless one has been
3670 : specified already.
3673 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3674 : Also try without trailing minor version numbers.
3675 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3676 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3677 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3678 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3681 *) case "$osvers" in
3684 *) if $test -f $src/hints/$file.sh ; then
3686 elif $test -f $src/hints/$xfile.sh ; then
3688 elif $test -f $src/hints/$xxfile.sh ; then
3690 elif $test -f $src/hints/$xxxfile.sh ; then
3692 elif $test -f $src/hints/$xxxxfile.sh ; then
3694 elif $test -f "$src/hints/${osname}.sh" ; then
3703 if $test -f Policy.sh ; then
3706 none) dflt="Policy" ;;
3707 *) dflt="Policy $dflt" ;;
3712 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3716 if $test -f Policy.sh ; then
3719 There's also a Policy hint file available, which should make the
3720 site-specific (policy) questions easier to answer.
3727 You may give one or more space-separated answers, or "none" if appropriate.
3728 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3729 previous run of Configure, you may specify it as well as or instead of
3730 OS-specific hints. If hints are provided for your OS, you should use them:
3731 although Perl can probably be built without hints on many platforms, using
3732 hints often improve performance and may enable features that Configure can't
3733 set up on its own. If there are no hints that match your OS, specify "none";
3734 DO NOT give a wrong version or a wrong OS.
3738 rp="Which of these apply, if any?"
3741 for file in $tans; do
3742 if $test X$file = XPolicy -a -f Policy.sh; then
3744 $cat Policy.sh >> UU/config.sh
3745 elif $test -f $src/hints/$file.sh; then
3746 . $src/hints/$file.sh
3747 $cat $src/hints/$file.sh >> UU/config.sh
3748 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3751 : Give one chance to correct a possible typo.
3752 echo "$file.sh does not exist"
3754 rp="hint to use instead?"
3756 for file in $ans; do
3757 if $test -f "$src/hints/$file.sh"; then
3758 . $src/hints/$file.sh
3759 $cat $src/hints/$file.sh >> UU/config.sh
3760 elif $test X$ans = X -o X$ans = Xnone ; then
3763 echo "$file.sh does not exist -- ignored."
3770 : Remember our hint file for later.
3771 if $test -f "$src/hints/$file.sh" ; then
3781 echo "Fetching default answers from $config_sh..." >&4
3785 cp $config_sh config.sh 2>/dev/null
3797 : Restore computed paths
3798 for file in $loclist $trylist; do
3799 eval $file="\$_$file"
3804 Configure uses the operating system name and version to set some defaults.
3805 The default value is probably right if the name rings a bell. Otherwise,
3806 since spelling matters for me, either accept the default or answer "none"
3813 ''|' '|none) dflt=none ;;
3814 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3817 *) dflt="$osname" ;;
3819 rp="Operating system name?"
3823 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3829 ''|' '|none) dflt=none ;;
3830 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3831 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3833 ''|' ') dflt=none ;;
3838 *) dflt="$osvers" ;;
3840 rp="Operating system version?"
3850 : who configured the system
3851 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3854 cf_by=`(logname) 2>/dev/null`
3857 cf_by=`(whoami) 2>/dev/null`
3859 "") cf_by=unknown ;;
3864 : decide how portable to be. Allow command line overrides.
3865 case "$d_portable" in
3867 *) d_portable="$define" ;;
3870 : set up shell script to do ~ expansion
3876 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3879 if $test -f /bin/csh; then
3880 /bin/csh -f -c "glob \$1"
3885 name=\`$expr x\$1 : '..\([^/]*\)'\`
3886 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3887 if $test ! -d "\$dir"; then
3889 echo "\$me: can't locate home directory for: \$name" >&2
3894 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3910 : now set up to get a file name
3914 cat <<'EOSC' >>getfile
3930 : getfile will accept an answer from the comma-separated list
3931 : enclosed in parentheses even if it does not meet other criteria.
3932 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3933 fn=`echo $fn | sed 's/(.*)//'`
3939 loc_file=`expr $fn : '.*:\(.*\)'`
3940 fn=`expr $fn : '\(.*\):.*'`
3948 */*) fullpath=true;;
3957 *e*) exp_file=true;;
3960 *p*) nopath_ok=true;;
3965 *d*) type='Directory';;
3966 *l*) type='Locate';;
3971 Locate) what='File';;
3976 case "$d_portable" in
3984 while test "$type"; do
3989 true) rp="$rp (~name ok)";;
3992 if test -f UU/getfile.ok && \
3993 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4012 value=`UU/filexp $ans`
4015 if test "$ans" != "$value"; then
4016 echo "(That expands to $value on this system.)"
4030 /*) value="$ansexp" ;;
4031 [a-zA-Z]:/*) value="$ansexp" ;;
4036 echo "I shall only accept a full path name, as in /bin/ls." >&4
4037 echo "Use a ! shell escape if you wish to check pathnames." >&4
4040 echo "Please give a full path name, starting with slash." >&4
4043 echo "Note that using ~name is ok provided it expands well." >&4
4056 for fp in $gfpth; do
4057 if test "X$fp" = X.; then
4062 if test -f "$pf"; then
4064 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4066 echo "($value is not a plain file, but that's ok.)"
4069 if test X"$type" = X; then
4076 for fp in $gfpth; do
4077 if test "X$fp" = X.; then
4082 direxp="$fp/$ansexp"
4084 if test -d "$direxp"; then
4092 if test -d "$ansexp"; then
4093 echo "(Looking for $loc_file in directory $value.)"
4094 value="$value/$loc_file"
4095 ansexp="$ansexp/$loc_file"
4097 if test -f "$ansexp"; then
4100 case "$nopath_ok" in
4101 true) case "$value" in
4103 *) echo "Assuming $value will be in people's path."
4119 if test "$fastread" = yes; then
4124 rp="$what $value doesn't exist. Use that name anyway?"
4143 test "X$gfpthkeep" != Xy && gfpth=""
4146 : determine root of directory hierarchy where package will be installed.
4149 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4152 dflt=`echo "$prefix" | sed 's/.$//'`
4160 By default, $package will be installed in $dflt/bin, manual pages
4161 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4162 installation directories. Typically this is something like /usr/local.
4163 If you wish to have binaries under /usr/bin but other parts of the
4164 installation under /usr/local, that's ok: you will be prompted
4165 separately for each of the installation directories, the prefix being
4166 only used to set the defaults.
4170 rp='Installation prefix to use?'
4178 *) oldprefix="$prefix";;
4185 : allow them to override the AFS root
4188 *) afsroot=$afsroot ;;
4194 $define|true) afs=true ;;
4195 $undef|false) afs=false ;;
4196 *) if $test -d $afsroot; then
4204 echo "AFS may be running... I'll be extra cautious then..." >&4
4206 echo "AFS does not seem to be running..." >&4
4209 : determine installation prefix for where package is to be installed.
4213 Since you are running AFS, I need to distinguish the directory in which
4214 files will reside from the directory in which they are installed (and from
4215 which they are presumably copied to the former directory by occult means).
4218 case "$installprefix" in
4219 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4220 *) dflt="$installprefix";;
4225 In some special cases, particularly when building $package for distribution,
4226 it is convenient to distinguish the directory in which files should be
4227 installed from the directory ($prefix) in which they will
4228 eventually reside. For most users, these two directories are the same.
4231 case "$installprefix" in
4233 *) dflt=$installprefix;;
4237 rp='What installation prefix should I use for installing files?'
4239 installprefix="$ans"
4240 installprefixexp="$ansexp"
4242 : Perform the prefixexp/installprefixexp correction if necessary
4243 cat <<EOS >installprefix
4246 cat <<'EOSC' >>installprefix
4247 : Change installation prefix, if necessary.
4248 if $test X"$prefix" != X"$installprefix"; then
4249 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4251 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4254 chmod +x installprefix
4255 $eunicefix installprefix
4257 : Set variables such as privlib and privlibexp from the output of ./getfile
4258 : performing the prefixexp/installprefixexp correction if necessary.
4259 cat <<EOS >setprefixvar
4262 cat <<'EOSC' >>setprefixvar
4263 eval "${prefixvar}=\"\$ans\""
4264 eval "${prefixvar}exp=\"\$ansexp\""
4267 chmod +x setprefixvar
4268 $eunicefix setprefixvar
4270 : set up the script used to warn in case of inconsistency
4279 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4281 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4282 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4287 echo "*** WHOA THERE!!! ***" >&4
4288 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4291 rp=" Keep the $hint value?"
4294 y) td=$was; tu=$was;;
4298 : function used to set '$1' to '$val'
4299 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4301 $define$undef) . ./whoa; eval "$var=\$td";;
4302 $undef$define) . ./whoa; eval "$var=\$tu";;
4303 *) eval "$var=$val";;
4306 : get the patchlevel
4308 echo "Getting the current patchlevel..." >&4
4309 if $test -r $rsrc/patchlevel.h;then
4310 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4311 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4312 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4313 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4314 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4315 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4316 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4325 $echo "(You do not have patchlevel.h. Eek.)"
4327 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4328 version_patchlevel_string="version $patchlevel subversion $subversion"
4329 case "$perl_patchlevel" in
4331 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4332 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4336 $echo "(You have $package $version_patchlevel_string.)"
4340 : XXX Should be a Configure test for double-dots in filenames.
4341 version=`echo $revision $patchlevel $subversion | \
4342 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4343 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4344 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4347 version=`echo $revision $patchlevel $subversion | \
4348 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4349 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4350 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4353 : Special case the 5.005_xx maintenance series, which used 5.005
4354 : without any subversion label as a subdirectory in $sitelib
4355 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4356 api_versionstring='5.005'
4359 : Do we want threads support and if so, what type
4360 case "$usethreads" in
4361 $define|true|[yY]*) dflt='y';;
4362 *) # Catch case where user specified ithreads or 5005threads but
4363 # forgot -Dusethreads (A.D. 4/2002)
4364 case "$useithreads$use5005threads" in
4365 *$define*) dflt='y';;
4372 Perl can be built to offer a form of threading support on some systems
4373 To do so, Configure can be run with -Dusethreads.
4375 Note that Perl built with threading support runs slightly slower
4376 and uses slightly more memory than plain Perl.
4378 If this doesn't make any sense to you, just accept the default '$dflt'.
4380 rp='Build a threading Perl?'
4383 y|Y) val="$define" ;;
4389 if $test $patchlevel -lt 9; then
4390 case "$usethreads" in
4392 : Default to ithreads unless overridden on command line or with
4395 case "$use5005threads" in
4397 echo "5.005 threads are no longer supported"
4401 case "$useithreads" in
4402 $undef|false|[nN]*) dflt='n';;
4404 rp='Use the newer interpreter-based ithreads?'
4407 y|Y) val="$define" ;;
4412 : Now set use5005threads to the opposite value.
4413 case "$useithreads" in
4414 $define) val="$undef" ;;
4421 useithreads="$undef"
4422 use5005threads="$undef"
4426 case "$useithreads$use5005threads" in
4430 You cannot have both the ithreads and the 5.005 threads enabled
4431 at the same time. Disabling the 5.005 threads since they are
4432 much less stable than the ithreads.
4435 use5005threads="$undef"
4440 : perl-5.9.x and later
4442 if test X"$usethreads" = "X$define"; then
4443 case "$use5005threads" in
4447 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4454 use5005threads="$undef"
4455 useithreads="$usethreads"
4458 case "$d_oldpthreads" in
4459 '') : Configure tests would be welcome here. For now, assume undef.
4461 *) val="$d_oldpthreads" ;;
4467 : Look for a hint-file generated 'call-back-unit'. If the
4468 : user has specified that a threading perl is to be built,
4469 : we may need to set or change some other defaults.
4470 if $test -f usethreads.cbu; then
4471 echo "Your platform has some specific hints regarding threaded builds, using them..."
4474 case "$usethreads" in
4475 "$define"|true|[yY]*)
4477 (Your platform does not have any specific hints for threaded builds.
4478 Assuming POSIX threads, then.)
4484 : Check if multiplicity is required
4487 Perl can be built so that multiple Perl interpreters can coexist
4488 within the same Perl executable.
4491 case "$useithreads" in
4494 This multiple interpreter support is required for interpreter-based threads.
4498 *) case "$usemultiplicity" in
4499 $define|true|[yY]*) dflt='y';;
4503 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4504 rp='Build Perl for multiplicity?'
4507 y|Y) val="$define" ;;
4515 : Check if morebits is requested
4516 case "$usemorebits" in
4517 "$define"|true|[yY]*)
4518 use64bitint="$define"
4519 uselongdouble="$define"
4520 usemorebits="$define"
4522 *) usemorebits="$undef"
4526 : Determine the C compiler to be used
4532 rp="Use which C compiler?"
4536 : See whether they have no cc but they do have gcc
4538 if $test -f cc.cbu; then
4543 : make some quick guesses about what we are up against
4545 $echo $n "Hmm... $c"
4555 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4556 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4558 echo "Looks kind of like an OSF/1 system, but we'll see..."
4560 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4561 xxx=`./loc addbib blurfl $pth`
4562 if $test -f $xxx; then
4563 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4567 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4568 echo "Looks kind of like an extended USG system, but we'll see..."
4570 echo "Looks kind of like a USG system, but we'll see..."
4574 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4575 echo "Looks kind of like a BSD system, but we'll see..."
4579 echo "Looks kind of like a Version 7 system, but we'll see..."
4582 case "$eunicefix" in
4585 There is, however, a strange, musty smell in the air that reminds me of
4586 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4590 : it so happens the Eunice I know will not run shell scripts in Unix format
4594 echo "Congratulations. You aren't running Eunice."
4598 : Detect OS2. The p_ variable is set above in the Head.U unit.
4599 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4600 : semicolon as a patch separator
4605 I have the feeling something is not exactly right, however...don't tell me...
4606 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4607 (Or you may be running DOS with DJGPP.)
4612 if test -f /xenix; then
4613 echo "Actually, this looks more like a XENIX system..."
4618 echo "It's not Xenix..."
4623 if test -f /venix; then
4624 echo "Actually, this looks more like a VENIX system..."
4631 echo "Nor is it Venix..."
4634 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4635 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4638 : Check if we are using GNU gcc and what its version is
4640 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4644 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4646 printf("%s\n", __VERSION__);
4648 printf("%s\n", "1");
4654 if $cc -o try $ccflags $ldflags try.c; then
4655 gccversion=`$run ./try`
4656 case "$gccversion" in
4657 '') echo "You are not using GNU cc." ;;
4658 *) echo "You are using GNU cc $gccversion."
4664 echo "*** WHOA THERE!!! ***" >&4
4665 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4666 case "$knowitall" in
4668 echo " You'd better start hunting for one and let me know about it." >&4
4674 case "$gccversion" in
4675 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4677 case "$gccversion" in
4678 '') gccosandvers='' ;;
4679 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4680 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4682 case "$gccosandvers" in
4683 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4684 $osname$osvers) ;; # looking good
4685 $osname*) cat <<EOM >&4
4687 *** WHOA THERE!!! ***
4689 Your gcc has not been compiled for the exact release of
4690 your operating system ($gccosandvers versus $osname$osvers).
4692 In general it is a good idea to keep gcc synchronized with
4693 the operating system because otherwise serious problems
4694 may ensue when trying to compile software, like Perl.
4696 I'm trying to be optimistic here, though, and will continue.
4697 If later during the configuration and build icky compilation
4698 problems appear (headerfile conflicts being the most common
4699 manifestation), I suggest reinstalling the gcc to match
4700 your operating system release.
4704 *) gccosandvers='' ;; # failed to parse, better be silent
4712 # gcc 3.* complain about adding -Idirectories that they already know about,
4713 # so we will take those off from locincpth.
4714 case "$gccversion" in
4716 echo "main(){}">try.c
4717 for incdir in $locincpth; do
4718 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4719 grep '^c[cp]p*[01]: warning: changing search order '`
4720 if test "X$warn" != X; then
4721 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4727 # gcc 4.9 by default does some optimizations that break perl.
4728 # see ticket 121505.
4730 # The -fwrapv disables those optimizations (and probably others,) so
4731 # for gcc 4.9 (and later, since the optimizations probably won't go
4732 # away), add -fwrapv unless the user requests -fno-wrapv, which
4733 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4734 # which turns the overflows -fwrapv ignores into runtime errors.
4735 case "$gccversion" in
4736 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4738 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4739 *) ccflags="$ccflags -fwrapv" ;;
4743 : What should the include directory be ?
4744 : Use sysroot if set, so findhdr looks in the right place.
4746 $echo $n "Hmm... $c"
4747 dflt="$sysroot/usr/include"
4750 if $test -f /bin/mips && /bin/mips; then
4751 echo "Looks like a MIPS system..."
4752 $cat >usr.c <<'EOCP'
4753 #ifdef SYSTYPE_BSD43
4757 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4758 dflt='/bsd43/usr/include'
4762 mips_type='System V'
4764 $rm -f usr.c usr.out
4765 echo "and you're compiling with the $mips_type compiler and libraries."
4769 echo "Doesn't look like a MIPS system."
4779 case "$xxx_prompt" in
4782 rp='Where are the include files you want to use?'
4790 : see how we invoke the C preprocessor
4792 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4793 cat <<'EOT' >testcpp.c
4799 if test ! -f cppstdin; then
4800 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4801 # AIX cc -E doesn't show the absolute headerfile
4802 # locations but we'll cheat by using the -M flag.
4803 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
4805 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4808 echo "Keeping your $hint cppstdin wrapper."
4811 wrapper=`pwd`/cppstdin
4815 if $test "X$cppstdin" != "X" && \
4816 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4817 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4819 echo "You used to use $cppstdin $cppminus so we'll use that again."
4821 '') echo "But let's see if we can live without a wrapper..." ;;
4823 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4824 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4826 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4829 echo "(However, $cpprun $cpplast does not work, let's see...)"
4837 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4844 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4845 $cc -E <testcpp.c >testcpp.out 2>&1; \
4846 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4847 echo "Yup, it does."
4848 x_cpp="$cc $cppflags -E"
4850 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4851 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4852 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4853 echo "Yup, it does."
4854 x_cpp="$cc $cppflags -E"
4856 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4857 $cc -P <testcpp.c >testcpp.out 2>&1; \
4858 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4859 echo "Yipee, that works!"
4860 x_cpp="$cc $cppflags -P"
4862 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4863 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4864 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4865 echo "At long last!"
4866 x_cpp="$cc $cppflags -P"
4868 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4869 $cpp <testcpp.c >testcpp.out 2>&1; \
4870 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4872 x_cpp="$cpp $cppflags"
4874 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4875 $cpp - <testcpp.c >testcpp.out 2>&1; \
4876 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4877 echo "Hooray, it works! I was beginning to wonder."
4878 x_cpp="$cpp $cppflags"
4880 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4881 $wrapper <testcpp.c >testcpp.out 2>&1; \
4882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4888 rp="No dice. I can't find a C preprocessor. Name one:"
4892 $x_cpp <testcpp.c >testcpp.out 2>&1
4893 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4894 echo "OK, that will do." >&4
4896 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4911 echo "Perhaps can we force $cc -E using a wrapper..."
4912 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4913 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4919 echo "Nope, we'll have to live without it..."
4933 "$wrapper"|'cppstdin') ;;
4934 *) $rm -f $wrapper;;
4936 $rm -f testcpp.c testcpp.out
4938 : Adjust cppfilter for path component separator
4940 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4941 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4945 : Use gcc to determine libpth and incpth
4946 # If using gcc or clang, we can get better values for libpth, incpth
4947 # and usrinc directly from the compiler.
4948 # Note that ccname for clang is also gcc.
4951 $echo 'extern int foo;' > try.c
4952 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4954 if $test $# -gt 0; then
4956 incpth="`$echo $incpth|$sed 's/^ //'`"
4958 j="`$echo $i|$sed 's,/include$,/lib,'`"
4959 if $test -d $j; then
4963 libpth="`$echo $libpth|$sed 's/^ //'`"
4964 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4965 if $test -d $xxx; then
4968 *) libpth="$libpth $xxx";;
4975 '') for i in $incpth; do
4976 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4984 case "$usecrosscompile" in
4987 '') echo "Incpth not defined." >&4; croak=y ;;
4988 *) echo "Using incpth '$incpth'." >&4 ;;
4991 '') echo "Libpth not defined." >&4; croak=y ;;
4992 *) echo "Using libpth '$libpth'." >&4 ;;
4995 '') echo "Usrinc not defined." >&4; croak=y ;;
4996 *) echo "Using usrinc $usrinc." >&4 ;;
5000 if test "X$sysroot" = X; then
5001 echo "Cannot continue, aborting." >&4; exit 1
5003 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5012 : Default value for incpth is just usrinc
5014 '') incpth="$usrinc";;
5017 : Set private lib path
5020 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5025 '') dlist="$loclibpth $plibpth $glibpth";;
5026 *) dlist="$libpth";;
5029 : Now check and see which directories actually exist, avoiding duplicates
5032 if $test -d $xxx; then
5035 *) libpth="$libpth $xxx";;
5041 Some systems have incompatible or broken versions of libraries. Among
5042 the directories listed in the question below, please remove any you
5043 know not to be holding relevant libraries, and add any that are needed.
5044 Say "none" for none.
5048 if test "X$sysroot" != X; then
5050 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5063 rp="Directories to use for library searches?"
5070 : compute shared library extension
5073 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5083 On some systems, shared libraries may be available. Answer 'none' if
5084 you want to suppress searching of shared libraries for the remainder
5085 of this configuration.
5088 rp='What is the file extension used for shared libraries?'
5092 : Does target system insist that shared library basenames are unique
5095 Some dynamic loaders assume that the *basename* of shared library filenames
5096 are globally unique. We'll default this to undef as we assume your system
5097 is not this weird. Set to defined if you're on one of them.
5102 rp='Make shared library basenames unique?'
5105 y|Y) val="$define" ;;
5108 set d_libname_unique
5111 : Define several unixisms.
5112 : Hints files or command line option can be used to override them.
5113 : The convoluted testing is in case hints files set either the old
5116 '') case "$exe_ext" in
5118 *) _exe="$exe_ext" ;;
5123 '') case "$lib_ext" in
5130 '') case "$obj_ext" in
5137 '') case "$path_sep" in
5148 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5150 : Which makefile gets called first. This is used by make depend.
5151 case "$firstmakefile" in
5152 '') firstmakefile='makefile';;
5155 : Check is we will use socks
5157 $define|true|[yY]*) dflt='y';;
5162 Perl can be built to use the SOCKS proxy protocol library. To do so,
5163 Configure must be run with -Dusesocks. If you use SOCKS you also need
5164 to use the PerlIO abstraction layer, this will be implicitly selected.
5166 If this doesn't make any sense to you, just accept the default '$dflt'.
5168 rp='Build Perl for SOCKS?'
5171 y|Y) val="$define" ;;
5177 : Check for uselongdouble support
5179 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5182 case "$uselongdouble" in
5183 $define|true|[yY]*) dflt='y';;
5188 Perl can be built to take advantage of long doubles which
5189 (if available) may give more accuracy and range for floating point numbers.
5191 If this doesn't make any sense to you, just accept the default '$dflt'.
5193 rp='Try to use long doubles if available?'
5196 y|Y) val="$define" ;;
5202 case "$uselongdouble" in
5203 true|[yY]*) uselongdouble="$define" ;;
5206 : Look for a hint-file generated 'call-back-unit'. If the
5207 : user has specified that long doubles should be used,
5208 : we may need to set or change some other defaults.
5209 if $test -f uselongdouble.cbu; then
5210 echo "Your platform has some specific hints regarding long doubles, using them..."
5211 . ./uselongdouble.cbu
5213 case "$uselongdouble" in
5216 (Your platform does not have any specific hints for long doubles.)
5222 : Check if quadmath is requested
5223 case "$usequadmath" in
5224 "$define"|true|[yY]*) usequadmath="$define" ;;
5225 *) usequadmath="$undef" ;;
5228 : Looking for optional libraries
5230 echo "Checking for optional libraries..." >&4
5235 case "$libswanted" in
5236 '') libswanted='c_s';;
5239 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5241 case "$usecbacktrace" in
5242 "$define") libswanted="$libswanted bfd" ;;
5244 case "$usequadmath" in
5245 "$define") libswanted="$libswanted quadmath" ;;
5251 for thisdir in $libpth $xlibpth; do
5252 test -d $thisdir && libspath="$libspath $thisdir"
5254 for thislib in $libswanted; do
5255 for thisdir in $libspath; do
5257 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5258 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5259 $test -f "$xxx" && eval $libscheck
5260 $test -f "$xxx" && libstyle=shared
5261 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5262 $test -f "$xxx" && eval $libscheck
5263 $test -f "$xxx" && libstyle=shared
5265 if test ! -f "$xxx"; then
5266 xxx=$thisdir/lib$thislib.$so
5267 $test -f "$xxx" && eval $libscheck
5268 $test -f "$xxx" && libstyle=shared
5270 if test ! -f "$xxx"; then
5271 xxx=$thisdir/lib$thislib$_a
5272 $test -f "$xxx" && eval $libscheck
5273 $test -f "$xxx" && libstyle=static
5275 if test ! -f "$xxx"; then
5276 xxx=$thisdir/$thislib$_a
5277 $test -f "$xxx" && eval $libscheck
5278 $test -f "$xxx" && libstyle=static
5280 if test ! -f "$xxx"; then
5281 xxx=$thisdir/lib${thislib}_s$_a
5282 $test -f "$xxx" && eval $libscheck
5283 $test -f "$xxx" && libstyle=static
5284 $test -f "$xxx" && thislib=${thislib}_s
5286 if test ! -f "$xxx"; then
5287 xxx=$thisdir/Slib$thislib$_a
5288 $test -f "$xxx" && eval $libscheck
5289 $test -f "$xxx" && libstyle=static
5291 if $test -f "$xxx"; then
5293 shared) echo "Found -l$thislib (shared)." ;;
5294 static) echo "Found -l$thislib." ;;
5295 *) echo "Found -l$thislib ($libstyle)." ;;
5299 *) dflt="$dflt -l$thislib"
5300 libsfound="$libsfound $xxx"
5302 libsfiles="$libsfiles $yyy"
5303 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5304 case " $libsdirs " in
5306 *) libsdirs="$libsdirs $yyy" ;;
5313 if $test ! -f "$xxx"; then
5314 echo "No -l$thislib."
5325 ' '|'') dflt='none';;
5330 In order to compile $package on your machine, a number of libraries
5331 are usually needed. Include any other special libraries here as well.
5332 Say "none" for none. The default list is almost always right.
5336 rp="What libraries to use?"
5343 : determine optimization, if desired, or use for debug flag also
5345 ' '|$undef) dflt='none';;
5347 *) dflt="$optimize";;
5351 By default, $package compiles with the -O flag to use the optimizer.
5352 Alternately, you might want to use the symbolic debugger, which uses
5353 the -g flag (on traditional Unix systems). Either flag can be
5354 specified here. To use neither flag, specify the word "none".
5357 rp="What optimizer/debugger flag should be used?"
5361 'none') optimize=" ";;
5364 : Check what DEBUGGING is required from the command line
5365 : -DEBUGGING or -DDEBUGGING or
5366 : -DEBUGGING=both = -g + -DDEBUGGING
5367 : -DEBUGGING=-g or -Doptimize=-g = -g
5368 : -DEBUGGING=none or -UDEBUGGING =
5369 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5372 *) DEBUGGING=$EBUGGING ;;
5375 case "$DEBUGGING" in
5379 *) optimize="$optimize -g" ;;
5383 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5391 case "$DEBUGGING" in
5392 both|$define) dflt='-DDEBUGGING'
5395 : argument order is deliberate, as the flag will start with - which set could
5396 : think is an option
5397 checkccflag='check=$1; flag=$2; callback=$3;
5399 echo "Checking if your compiler accepts $flag" 2>&1;
5400 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5401 echo "int main(void) { return 0; }" > gcctest.c;
5402 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5403 echo "Yes, it does." 2>&1;
5404 if $test -s gcctest.out ; then
5405 echo "But your platform does not like it:";
5410 echo "Leaving current flags $ccflags alone." 2>&1
5412 *) dflt="$dflt $flag";
5418 echo "Nope, it does not, but that is ok." 2>&1;
5422 : We will not override a previous value, but we might want to
5423 : augment a hint file
5425 default|recommended)
5426 case "$gccversion" in
5427 1*) dflt="$dflt -fpcc-struct-return" ;;
5429 case "$optimize:$DEBUGGING" in
5430 *-g*:old) dflt="$dflt -DDEBUGGING";;
5432 case "$gccversion" in
5433 2*) if $test -d /etc/conf/kconfig.d &&
5434 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5436 # Interactive Systems (ISC) POSIX mode.
5441 case "$gccversion" in
5444 ?*) set strict-aliasing -fno-strict-aliasing
5448 # For gcc, adding -pipe speeds up compilations for some, but apparently
5449 # some assemblers can't read from stdin. (It also slows down compilations
5450 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5451 case "$gccversion" in
5457 # on x86_64 (at least) we require an extra library (libssp) in the
5458 # link command line. This library is not named, so I infer that it is
5459 # an implementation detail that may change. Hence the safest approach
5460 # is to add the flag to the flags passed to the compiler at link time,
5461 # as that way the compiler can do the right implementation dependant
5464 amigaos) ;; # -fstack-protector builds but doesn't work
5465 *) case "$gccversion" in
5466 ?*) set stack-protector-strong -fstack-protector-strong
5469 *-fstack-protector-strong*) ;; # It got added.
5470 *) # Try the plain/older -fstack-protector.
5471 set stack-protector -fstack-protector
5482 case "$mips_type" in
5483 *BSD*|'') inclwanted="$locincpth $usrinc";;
5484 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5486 for thisincl in $inclwanted; do
5487 if $test -d $thisincl; then
5488 if $test x$thisincl != x$usrinc; then
5490 *" -I$thisincl "*);;
5491 *) dflt="$dflt -I$thisincl ";;
5497 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5499 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5507 *) dflt="$dflt -D$2";;
5511 set signal.h LANGUAGE_C; eval $inctest
5515 ccflags="$ccflags -DSOCKS"
5520 default|recommended) dflt="$ccflags $dflt" ;;
5521 *) dflt="$ccflags";;
5530 Your C compiler may want other flags. For this question you should include
5531 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5532 but you should NOT include libraries or ld flags like -lwhatever. If you
5533 want $package to honor its debug switch, you should include -DDEBUGGING here.
5534 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5536 To use no flags, specify the word "none".
5542 rp="Any additional cc flags?"
5549 : the following weeds options from ccflags that are of no interest to cpp
5551 '') cppflags="$ccflags" ;;
5552 *) set X $ccflags; shift
5553 case " $cppflags " in
5554 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5555 *) cppflags="$cppflags $ccflags" ;;
5559 case "$gccversion" in
5560 1*) cppflags="$cppflags -D__GNUC__"
5562 case "$mips_type" in
5564 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5570 echo "Let me guess what the preprocessor flags are..." >&4
5584 *) ftry="$previous $flag";;
5586 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5587 >cpp1.out 2>/dev/null && \
5588 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5589 >cpp2.out 2>/dev/null && \
5590 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5591 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5593 cppflags="$cppflags $ftry"
5603 *-*) echo "They appear to be: $cppflags";;
5605 $rm -f cpp.c cpp?.out
5609 : flags used in final linking phase
5611 '') if ./venix; then
5617 *-posix*) dflt="$dflt -posix" ;;
5620 *) dflt="$ldflags";;
5622 # See note above about -fstack-protector
5624 *-fstack-protector-strong*)
5626 *-fstack-protector-strong*) ;; # Don't add it again
5627 *) dflt="$dflt -fstack-protector-strong" ;;
5630 *-fstack-protector*)
5632 *-fstack-protector*) ;; # Don't add it again
5633 *) dflt="$dflt -fstack-protector" ;;
5638 : Try to guess additional flags to pick up local libraries.
5639 for thislibdir in $libpth; do
5640 case " $loclibpth " in
5643 *"-L$thislibdir "*) ;;
5644 *) dflt="$dflt -L$thislibdir" ;;
5656 Your C linker may need flags. For this question you should
5657 include -L/whatever and any other flags used by the C linker, but you
5658 should NOT include libraries like -lwhatever.
5660 Make sure you include the appropriate -L/path flags if your C linker
5661 does not normally search all of the directories you specified above,
5664 To use no flags, specify the word "none".
5668 rp="Any additional ld flags (NOT including libraries)?"
5674 rmlist="$rmlist pdp11"
5678 echo "Checking your choice of C compiler and flags for coherency..." >&4
5679 $cat > try.c <<'EOF'
5681 int main() { printf("Ok\n"); return(0); }
5683 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5685 $cat >try.msg <<'EOM'
5686 I've tried to compile and run the following simple program:
5689 $cat try.c >> try.msg
5691 $cat >> try.msg <<EOM
5698 and I got the following output:
5702 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5703 if $sh -c "$run ./try " >>try.msg 2>&1; then
5707 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5710 echo "The program compiled OK, but exited with status $?." >>try.msg
5711 rp="You have a problem. Shall I abort Configure"
5715 echo "I can't compile the test program." >>try.msg
5716 rp="You have a BIG problem. Shall I abort Configure"
5722 case "$knowitall" in
5724 echo "(The supplied flags or libraries might be incorrect.)"
5732 *) echo "Ok. Stopping Configure." >&4
5737 n) echo "OK, that should do.";;
5739 $rm_try gcctest gcctest.out
5741 : define a shorthand compile call
5745 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5746 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5750 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5751 : define a shorthand compile call for compilations that should be ok.
5755 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5757 : determine filename position in cpp output
5759 echo "Computing filename position in cpp output for #include directives..." >&4
5761 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5766 vos) testaccess=-e ;;
5769 echo '#include <stdio.h>' > foo.c
5772 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5773 $grep '^[ ]*#.*stdio\.h' | \
5774 while read cline; do
5777 while $test \$# -gt 0; do
5778 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5783 pos=\`expr \$pos + 1\`
5797 *) pos="${fieldn}th";;
5799 echo "Your cpp writes the filename in the $pos field of the line."
5801 : locate header file
5806 for usrincdir in $incpth
5808 if test -f \$usrincdir/\$wanted; then
5809 echo "\$usrincdir/\$wanted"
5813 awkprg='{ print \$$fieldn }'
5814 echo "#include <\$wanted>" > foo\$\$.c
5815 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5816 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5817 while read cline; do
5818 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5820 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5821 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5826 # status = 0: grep returned 0 lines, case statement not executed
5827 # status = 1: headerfile found
5828 # status = 2: while loop executed, no headerfile found
5832 if test \$status -eq 1; then
5839 : define an alternate in-header-list? function
5840 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5841 cont=true; xxf="echo \"<\$1> found.\" >&4";
5842 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5843 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5845 case $# in 4) instead=instead;; *) instead="at last";; esac;
5846 while $test "$cont"; do
5848 var=$2; eval "was=\$$2";
5849 if $test "$xxx" && $test -r "$xxx";
5851 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5854 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5855 set $yyy; shift; shift; yyy=$@;
5856 case $# in 0) cont="";;
5857 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5858 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5859 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5860 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5864 do set $yyy; var=$2; eval "was=\$$2";
5865 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5866 set $yyy; shift; shift; yyy=$@;
5869 : see if stdlib is available
5870 set stdlib.h i_stdlib
5873 : check for lengths of integral types
5877 echo "Checking to see how big your integers are..." >&4
5886 printf("intsize=%d;\n", (int)sizeof(int));
5887 printf("longsize=%d;\n", (int)sizeof(long));
5888 printf("shortsize=%d;\n", (int)sizeof(short));
5893 if eval $compile_ok && $run ./try > /dev/null; then
5895 echo "Your integers are $intsize bytes long."
5896 echo "Your long integers are $longsize bytes long."
5897 echo "Your short integers are $shortsize bytes long."
5901 Help! I can't compile and run the intsize test program: please enlighten me!
5902 (This is probably a misconfiguration in your system or libraries, and
5903 you really ought to fix it. Still, I'll try anyway.)
5907 rp="What is the size of an integer (in bytes)?"
5911 rp="What is the size of a long integer (in bytes)?"
5915 rp="What is the size of a short integer (in bytes)?"
5923 : check for long long
5925 echo "Checking to see if you have long long..." >&4
5926 echo 'int main() { long long x = 7; return 0; }' > try.c
5928 if eval $compile; then
5930 echo "You have long long."
5933 echo "You do not have long long."
5939 : check for length of long long
5940 case "${d_longlong}${longlongsize}" in
5943 echo "Checking to see how big your long longs are..." >&4
5944 $cat >try.c <<'EOCP'
5948 printf("%d\n", (int)sizeof(long long));
5953 if eval $compile_ok; then
5954 longlongsize=`$run ./try`
5955 echo "Your long longs are $longlongsize bytes long."
5959 echo "(I can't seem to compile the test program. Guessing...)"
5960 rp="What is the size of a long long (in bytes)?"
5964 if $test "X$longsize" = "X$longlongsize"; then
5965 echo "(That isn't any different from an ordinary long.)"
5971 : see if inttypes.h is available
5972 : we want a real compile instead of Inhdr because some systems
5973 : have an inttypes.h which includes non-existent headers
5976 #include <inttypes.h>
5978 static int32_t foo32 = 0x12345678;
5982 if eval $compile; then
5983 echo "<inttypes.h> found." >&4
5986 echo "<inttypes.h> NOT found." >&4
5995 echo "Checking to see if you have int64_t..." >&4
5997 #include <sys/types.h>
5998 #$i_inttypes I_INTTYPES
6000 #include <inttypes.h>
6002 int main() { int64_t x = 7; }
6005 if eval $compile; then
6007 echo "You have int64_t."
6010 echo "You do not have int64_t."
6016 : Check if 64bit ints have a quad type
6018 echo "Checking which 64-bit integer type we could use..." >&4
6024 val='"unsigned int"'
6029 *) case "$longsize" in
6033 val='"unsigned long"'
6038 *) case "$d_longlong:$longlongsize" in
6043 val='"unsigned long long"'
6048 *) case "$d_int64_t" in
6067 '') echo "Alas, no 64-bit integer types in sight." >&4
6070 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6075 : Do we want 64bit support
6076 case "$uselonglong" in
6077 "$define"|true|[yY]*)
6080 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6082 use64bitint="$define"
6085 case "$use64bits" in
6086 "$define"|true|[yY]*)
6089 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6091 use64bitint="$define"
6094 case "$use64bitints" in
6095 "$define"|true|[yY]*)
6098 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6100 use64bitint="$define"
6103 case "$use64bitsint" in
6104 "$define"|true|[yY]*)
6107 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6109 use64bitint="$define"
6112 case "$uselonglongs" in
6113 "$define"|true|[yY]*)
6116 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6118 use64bitint="$define"
6121 case "$use64bitsall" in
6122 "$define"|true|[yY]*)
6125 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6127 use64bitall="$define"
6132 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6134 case "$use64bitall" in
6135 "$define"|true|[yY]*) use64bitint="$define" ;;
6141 You have natively 64-bit long integers.
6145 *) case "$use64bitint" in
6146 "$define"|true|[yY]*) dflt='y';;
6155 Perl can be built to take advantage of 64-bit integer types
6156 on some systems. To do so, Configure can be run with -Duse64bitint.
6157 Choosing this option will most probably introduce binary incompatibilities.
6159 If this doesn't make any sense to you, just accept the default '$dflt'.
6160 (The default has been chosen based on your configuration.)
6162 rp='Try to use 64-bit integers, if available?'
6165 [yY]*) val="$define" ;;
6173 case "$use64bitall" in
6174 "$define"|true|[yY]*) dflt='y' ;;
6175 *) case "$longsize" in
6183 You may also choose to try maximal 64-bitness. It means using as much
6184 64-bitness as possible on the platform. This in turn means even more
6185 binary incompatibilities. On the other hand, your platform may not
6186 have any more 64-bitness available than what you already have chosen.
6188 If this doesn't make any sense to you, just accept the default '$dflt'.
6189 (The default has been chosen based on your configuration.)
6191 rp='Try to use maximal 64-bit support, if available?'
6194 [yY]*) val="$define" ;;
6199 case "$use64bitall" in
6201 case "$use64bitint" in
6205 Since you have chosen a maximally 64-bit build, I'm also turning on
6206 the use of 64-bit integers.
6208 use64bitint="$define" ;;
6213 : Look for a hint-file generated 'call-back-unit'. If the
6214 : user has specified that a 64-bit perl is to be built,
6215 : we may need to set or change some other defaults.
6216 if $test -f use64bitint.cbu; then
6217 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6220 case "$use64bitint" in
6221 "$define"|true|[yY]*)
6222 : This test was common to all the OpenBSD forks, and seems harmless for
6225 echo "Checking if your C library has broken 64-bit functions..." >&4
6228 typedef $uquadtype myULL;
6235 {4294967303.15, 4294967303ULL},
6236 {4294967294.2, 4294967294ULL},
6237 {4294967295.7, 4294967295ULL},
6240 for (p = test; p->u; p++) {
6241 myULL x = (myULL)p->d;
6252 if eval $compile_ok; then
6253 libcquad=`$run ./try`
6254 echo "Your C library's 64-bit functions are $libcquad."
6256 echo "(I can't seem to compile the test program.)"
6257 echo "Assuming that your C library's 64-bit functions are ok."
6266 *** You have a C library with broken 64-bit functions.
6267 *** 64-bit support does not work reliably in this configuration.
6268 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6269 *** Cannot continue, aborting.
6276 4) case "$archname64" in
6277 '') archname64=64int ;;
6284 : Look for a hint-file generated 'call-back-unit'. If the
6285 : user has specified that a maximally 64-bit perl is to be built,
6286 : we may need to set or change some other defaults.
6287 if $test -f use64bitall.cbu; then
6288 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6291 case "$use64bitall" in
6292 "$define"|true|[yY]*)
6294 4) case "$archname64" in
6295 ''|64int) archname64=64all ;;
6302 case "$d_quad:$use64bitint" in
6306 *** You have chosen to use 64-bit integers,
6307 *** but none can be found.
6308 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6309 *** Cannot continue, aborting.
6316 : Check if we are using the GNU C library
6318 echo "Checking for GNU C Library..." >&4
6320 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6321 alone are insufficient to distinguish different versions, such as
6322 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6323 libc version 2.1.0. A. Dougherty, June 3, 2002.
6329 # ifdef __GLIBC_MINOR__
6330 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6331 # include <gnu/libc-version.h>
6332 printf("%s\n", gnu_get_libc_version());
6334 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6337 printf("%d\n", __GLIBC__);
6346 if eval $compile_ok && $run ./try > glibc.ver; then
6348 gnulibc_version=`$cat glibc.ver`
6349 echo "You are using the GNU C Library version $gnulibc_version"
6353 echo "You are not using the GNU C Library"
6359 : see if nm is to be used to determine whether a symbol is defined or not
6363 case "$d_gnulibc" in
6366 echo "nm probably won't work on the GNU C Library." >&4
6372 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6374 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6375 echo "'nm' won't be sufficient on this system." >&4
6381 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6382 if $test $dflt -gt 20; then
6392 true|$define) dflt=y;;
6399 I can use $nm to extract the symbols from your C libraries. This
6400 is a time consuming task which may generate huge output on the disk (up
6401 to 3 megabytes) but that should make the symbols extraction faster. The
6402 alternative is to skip the 'nm' extraction part and to compile a small
6403 test program instead to determine whether each symbol is present. If
6404 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6405 this may be the best solution.
6407 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6410 rp="Shall I use $nm to extract C symbols from the libraries?"
6413 [Nn]*) usenm=false;;
6422 : nm options which may be necessary
6424 '') if $test -f /mach_boot; then
6426 elif $test -d /usr/ccs/lib; then
6427 nm_opt='-p' # Solaris (and SunOS?)
6428 elif $test -f /dgux; then
6430 elif $test -f /lib64/rld; then
6431 nm_opt='-p' # 64-bit Irix
6437 : nm options which may be necessary for shared libraries but illegal
6438 : for archive libraries. Thank you, Linux.
6439 case "$nm_so_opt" in
6440 '') case "$myuname" in
6442 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6443 nm_so_opt='--dynamic'
6450 : Figure out where the libc is located
6453 : get list of predefined functions in a handy place
6458 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6464 *) for thislib in $libs; do
6467 : Handle C library specially below.
6470 thislib=`echo $thislib | $sed -e 's/^-l//'`
6471 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6473 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6475 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6477 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6479 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6481 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6483 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6488 libnames="$libnames $try"
6490 *) libnames="$libnames $thislib" ;;
6499 for xxx in $libpth; do
6500 $test -r $1 || set $xxx/libc.$so
6501 : The messy sed command sorts on library version numbers.
6503 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6504 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6506 s/[0-9][0-9]*/0000&/g
6507 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6510 $sort | $sed -e 's/^.* //'`
6513 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6514 $test -r $1 || set $sysroot/lib/libsys_s$_a
6520 if $test -r "$1"; then
6521 echo "Your (shared) C library seems to be in $1."
6523 elif $test -r /lib/libc && $test -r /lib/clib; then
6524 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6526 libc='/lib/clib /lib/libc'
6527 if $test -r /lib/syslib; then
6528 echo "(Your math library is in /lib/syslib.)"
6529 libc="$libc /lib/syslib"
6531 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6532 echo "Your C library seems to be in $libc, as you said before."
6533 elif $test -r $incpath/usr/lib/libc$_a; then
6534 libc=$incpath/usr/lib/libc$_a;
6535 echo "Your C library seems to be in $libc. That's fine."
6536 elif $test -r /lib/libc$_a; then
6538 echo "Your C library seems to be in $libc. You're normal."
6540 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6542 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6543 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6544 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6546 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6548 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6551 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6553 if $test -r "$tans"; then
6554 echo "Your C library seems to be in $tans, of all places."
6560 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6564 If the guess above is wrong (which it might be if you're using a strange
6565 compiler, or your machine supports multiple models), you can override it here.
6570 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6572 I can't seem to find your C library. I've looked in the following places:
6575 $sed 's/^/ /' libpath
6578 None of these seems to contain your C library. I need to get its name...
6583 rp='Where is your C library?'
6588 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6589 set X `cat libnames`
6592 case $# in 1) xxx=file; esac
6593 echo "Extracting names from the following $xxx for later perusal:" >&4
6595 $sed 's/^/ /' libnames >&4
6597 $echo $n "This may take a while...$c" >&4
6601 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6602 *) $nm $nm_opt $file 2>/dev/null;;
6607 $grep fprintf libc.tmp > libc.ptf
6608 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6609 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6611 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6615 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6619 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6623 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6627 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6631 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6635 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6636 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6640 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 $nm -p $* 2>/dev/null >libc.tmp
6670 $grep fprintf libc.tmp > libc.ptf
6671 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6672 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6678 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6680 if $ar t $libc > libc.tmp && \
6681 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6683 for thisname in $libnames $libc; do
6684 $ar t $thisname >>libc.tmp
6686 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6688 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6689 for thisname in $libnames $libc; do
6690 $ar tv $thisname >>libc.tmp
6691 emximp -o tmp.imp $thisname \
6693 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6694 < tmp.imp >>libc.tmp
6697 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6700 echo "$ar didn't seem to work right." >&4
6701 echo "Maybe this is a Cray...trying bld instead..." >&4
6703 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6706 for thisname in $libnames; do
6708 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6709 $ar t $thisname >>libc.tmp
6713 echo "That didn't work either. Giving up." >&4
6723 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6724 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6726 *) if $test -f /lib/syscalls.exp; then
6728 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6729 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6730 /lib/syscalls.exp >>libc.list
6736 $rm -f libnames libpath
6738 : Check if we are using C++
6740 echo "Checking for C++..." >&4
6741 $cat >try.c <<'EOCP'
6753 if eval $compile_ok && $run ./try; then
6755 echo "You are using a C++ compiler."
6758 echo "You are not using a C++ compiler."
6764 : is a C symbol defined?
6767 -v) tf=libc.tmp; tdc="";;
6768 -a) tf=libc.tmp; tdc="[]";;
6769 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6771 case "$d_cplusplus" in
6772 $define) extern_C="extern \"C\"" ;;
6773 *) extern_C="extern" ;;
6776 case "$reuseval-$4" in
6778 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6783 if $test "$runnm" = true; then
6784 if $contains $tlook $tf >/dev/null 2>&1; then
6786 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6787 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6788 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6789 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6793 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6794 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6800 $define) tval=true;;
6807 : define an is-in-libc? function
6808 inlibc='echo " "; td=$define; tu=$undef;
6809 sym=$1; var=$2; eval "was=\$$2";
6811 case "$reuseval$was" in
6821 echo "$sym() found." >&4;
6822 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6824 echo "$sym() NOT found." >&4;
6825 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6829 $define) echo "$sym() found." >&4;;
6830 *) echo "$sym() NOT found." >&4;;
6834 : check for length of double
6836 case "$doublesize" in
6838 echo "Checking to see how big your double precision numbers are..." >&4
6847 printf("%d\n", (int)sizeof(double));
6852 if eval $compile_ok; then
6853 doublesize=`$run ./try`
6854 echo "Your double is $doublesize bytes long."
6857 echo "(I can't seem to compile the test program. Guessing...)"
6858 rp="What is the size of a double precision number (in bytes)?"
6866 : see if this is a float.h system
6870 : check for long doubles
6872 echo "Checking to see if you have long double..." >&4
6873 echo 'int main() { long double x = 7.0; }' > try.c
6875 if eval $compile; then
6877 echo "You have long double."
6880 echo "You do not have long double."
6886 : see if ldexpl exists
6890 : check for length of long double
6891 case "${d_longdbl}${longdblsize}" in
6894 echo "Checking to see how big your long doubles are..." >&4
6895 $cat >try.c <<'EOCP'
6899 printf("%d\n", sizeof(long double));
6904 if eval $compile; then
6905 longdblsize=`$run ./try`
6906 echo "Your long doubles are $longdblsize bytes long."
6910 echo "(I can't seem to compile the test program. Guessing...)" >&4
6911 rp="What is the size of a long double (in bytes)?"
6915 if $test "X$doublesize" = "X$longdblsize"; then
6916 echo "That isn't any different from an ordinary double."
6917 echo "I'll keep your setting anyway, but you may see some"
6918 echo "harmless compilation warnings."
6924 $echo "Checking the kind of long doubles you have..." >&4
6925 case "$d_longdbl" in
6930 #define LONGDBLSIZE $longdblsize
6931 #define DOUBLESIZE $doublesize
6939 static const long double d = -0.1L;
6941 unsigned const char* b = (unsigned const char*)(&d);
6942 #if DOUBLESIZE == LONGDBLSIZE
6943 printf("0\n"); /* if it floats like double */
6946 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6947 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6948 /* IEEE 754 128-bit little-endian */
6952 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6953 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6958 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6959 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6960 * cannot be trusted. */
6961 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6962 if (b[0] == 0xCD && b[9] == 0xBF) {
6963 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6964 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6965 * Also known as "extended precision". */
6969 if (b[0] == 0xBF && b[9] == 0xCD) {
6970 /* is there ever big-endian 80-bit, really? */
6975 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6976 /* software "double double", the 106 is 53+53.
6977 * but irix thinks it is 107. */
6978 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6979 /* double double 128-bit fully little-endian,
6980 * little-endian doubles in little-endian order,
6981 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6985 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6986 /* double double 128-bit fully big-endian,
6987 * big-endian doubles in big-endian order,
6988 * e.g. PPC/Power and MIPS:
6989 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6993 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
6994 /* double double 128-bit mixed endian.
6995 * little-endian doubles in big-endian order,
6997 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7001 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7002 /* double double 128-bit mixed endian,
7003 * big-endian doubles in little-endian order,
7004 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7009 printf("-1\n"); /* unknown */
7014 if eval $compile; then
7015 longdblkind=`$run ./try`
7022 case "$longdblkind" in
7023 0) echo "Your long doubles are doubles." >&4 ;;
7024 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7025 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7026 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7027 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7028 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7029 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7030 7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7031 8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7032 *) echo "Cannot figure out your long double." >&4 ;;
7036 : determine the architecture name
7038 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7039 tarch=`arch`"-$osname"
7040 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7041 if uname -m > tmparch 2>&1 ; then
7042 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7043 -e 's/$/'"-$osname/" tmparch`
7051 case "$myarchname" in
7054 echo "(Your architecture name used to be $myarchname.)"
7058 case "$targetarch" in
7060 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7065 *) dflt="$archname";;
7067 rp='What is your architecture name'
7071 : optionally add API version to the architecture for versioned archlibs
7072 case "$useversionedarchname" in
7073 $define|true|[yY]*) dflt='y';;
7076 rp='Add the Perl API version to your archname?'
7079 y|Y) useversionedarchname="$define" ;;
7080 *) useversionedarchname="$undef" ;;
7082 case "$useversionedarchname" in
7085 *-$api_versionstring)
7086 echo "...and architecture name already has -$api_versionstring" >&4
7089 archname="$archname-$api_versionstring"
7090 echo "...setting architecture name to $archname." >&4
7096 case "$usethreads" in
7098 echo "Threads selected." >&4
7100 *-thread*) echo "...and architecture name already has -thread." >&4
7102 *) archname="$archname-thread"
7103 echo "...setting architecture name to $archname." >&4
7108 case "$usemultiplicity" in
7110 echo "Multiplicity selected." >&4
7112 *-multi*) echo "...and architecture name already has -multi." >&4
7114 *) archname="$archname-multi"
7115 echo "...setting architecture name to $archname." >&4
7120 case "$use64bitint$use64bitall" in
7122 case "$archname64" in
7124 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7127 case "$use64bitint" in
7128 "$define") echo "64 bit integers selected." >&4 ;;
7130 case "$use64bitall" in
7131 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7134 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7136 *) archname="$archname-$archname64"
7137 echo "...setting architecture name to $archname." >&4
7143 case "$uselongdouble" in
7145 echo "Long doubles selected." >&4
7146 case "$longdblsize" in
7148 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7152 *-ld*) echo "...and architecture name already has -ld." >&4
7154 *) archname="$archname-ld"
7155 echo "...setting architecture name to $archname." >&4
7162 case "$usequadmath" in
7164 echo "quadmath selected." >&4
7166 *-ld*) echo "...and architecture name already has -quadmath." >&4
7168 *) archname="$archname-quadmath"
7169 echo "...setting architecture name to $archname." >&4
7174 if $test -f archname.cbu; then
7175 echo "Your platform has some specific hints for architecture name, using them..."
7179 : set the prefixit variable, to compute a suitable default value
7180 prefixit='case "$3" in
7182 case "$oldprefix" in
7183 "") eval "$1=\"\$$2\"";;
7190 ""|" ") eval "$1=\"\$$2\"";;
7196 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7198 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7199 /*-$oldprefix/*|\~*-$oldprefix/*)
7200 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7201 *) eval "$1=\"\$$2\"";;
7205 : determine installation style
7206 : For now, try to deduce it from prefix unless it is already set.
7207 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7208 case "$installstyle" in
7209 '') case "$prefix" in
7210 *perl*) dflt='lib';;
7211 *) dflt='lib/perl5' ;;
7214 *) dflt="$installstyle" ;;
7216 : Probably not worth prompting for this since we prompt for all
7217 : the directories individually, and the prompt would be too long and
7221 : determine where public executables go
7226 rp='Pathname where the public executables will reside?'
7228 if $test "X$ansexp" != "X$binexp"; then
7232 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7233 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7234 : this via initialinstalllocation
7237 case "$userelocatableinc" in
7238 $define|true|[yY]*) dflt='y' ;;
7243 Would you like to build Perl so that the installation is relocatable, so that
7244 library paths in @INC are determined relative to the path of the perl binary?
7245 This is not advised for system Perl installs, or if you need to run setid
7246 scripts or scripts under taint mode.
7248 If this doesn't make any sense to you, just accept the default '$dflt'.
7250 rp='Use relocatable @INC?'
7253 y|Y) val="$define" ;;
7256 set userelocatableinc
7259 initialinstalllocation="$binexp"
7260 : Default prefix is now "up one level from where the binaries are"
7261 case "$userelocatableinc" in
7267 installprefixexp=".../.."
7271 : determine where private library files go
7272 : Usual default is /usr/local/lib/perl5/$version.
7273 : Also allow things like /opt/perl/lib/$version, since
7274 : /opt/perl/lib/perl5... would be redundant.
7275 : The default "style" setting is made in installstyle.U
7276 case "$installstyle" in
7277 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7278 *) set dflt privlib lib/$version ;;
7283 There are some auxiliary files for $package that need to be put into a
7284 private library directory that is accessible by everyone.
7289 rp='Pathname where the private library files will reside?'
7294 : set the prefixup variable, to restore leading tilda escape
7295 prefixup='case "$prefixexp" in
7297 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7300 : determine where public architecture dependent libraries go
7303 : privlib default is /usr/local/lib/$package/$version
7304 : archlib default is /usr/local/lib/$package/$version/$archname
7305 : privlib may have an optional trailing /share.
7306 tdflt=`echo $privlib | $sed 's,/share$,,'`
7307 tdflt=$tdflt/$archname
7316 $spackage contains architecture-dependent library files. If you are
7317 sharing libraries in a heterogeneous environment, you might store
7318 these files in a separate location. Otherwise, you can just include
7319 them with the rest of the public library files.
7324 rp='Where do you want to put the public architecture-dependent libraries?'
7328 if $test X"$archlib" = X"$privlib"; then
7334 : see if setuid scripts can be secure
7337 Some kernels have a bug that prevents setuid #! scripts from being
7338 secure. Some sites have disabled setuid #! scripts because of this.
7340 First let's decide if your kernel supports secure setuid #! scripts.
7341 (If setuid #! scripts would be secure but have been disabled anyway,
7342 don't say that they are secure if asked.)
7347 if $test -d /dev/fd; then
7348 echo "#!$ls" >reflect
7349 chmod +x,u+s reflect
7350 ./reflect >flect 2>&1
7351 if $contains "/dev/fd" flect >/dev/null; then
7352 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7356 If you are not sure if they are secure, I can check but I'll need a
7357 username and password different from the one you are using right now.
7358 If you don't have such a username or don't want me to test, simply
7362 rp='Other username to test security of setuid scripts with?'
7367 case "$d_suidsafe" in
7368 '') echo "I'll assume setuid scripts are *not* secure." >&4
7371 echo "Well, the $hint value is *not* secure." >&4
7373 *) echo "Well, the $hint value *is* secure." >&4
7378 $rm -f reflect flect
7379 echo "#!$ls" >reflect
7380 chmod +x,u+s reflect
7383 echo '"su" will (probably) prompt you for '"$ans's password."
7384 su $ans -c './reflect >flect'
7385 if $contains "/dev/fd" flect >/dev/null; then
7386 echo "Okay, it looks like setuid scripts are secure." >&4
7389 echo "I don't think setuid scripts are secure." >&4
7394 rp='Does your kernel have *secure* setuid scripts?'
7397 [yY]*) val="$define";;
7402 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7403 echo "(That's for file descriptors, not floppy disks.)"
7409 $rm -f reflect flect
7411 : now see if they want to do setuid emulation
7412 if $test $patchlevel -lt 11; then
7415 case "$d_suidsafe" in
7418 echo "No need to emulate SUID scripts since they are secure here." >&4
7422 Some systems have disabled setuid scripts, especially systems where
7423 setuid scripts cannot be secure. On systems where setuid scripts have
7424 been disabled, the setuid/setgid bits on scripts are currently
7425 useless. It is possible for $package to detect those bits and emulate
7426 setuid/setgid in a secure fashion. This emulation will only work if
7427 setuid scripts have been disabled in your kernel.
7431 "$define") dflt=y ;;
7434 rp="Do you want to do setuid/setgid emulation?"
7437 [yY]*) val="$define";;
7449 SUID emulation has been removed for 5.12
7450 Please re-run Configure without -Dd_dosuid
7459 : Find perl5.005 or later.
7460 echo "Looking for a previously installed perl5.005 or later... "
7462 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7463 : Check if this perl is recent and can load a simple module
7464 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7467 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7477 '') echo "None found. That's ok.";;
7478 *) echo "Using $perl5." ;;
7481 : Set the siteprefix variables
7484 After $package is installed, you may wish to install various
7485 add-on modules and utilities. Typically, these add-ons will
7486 be installed under $prefix with the rest
7487 of this package. However, you may wish to install such add-ons
7488 elsewhere under a different prefix.
7490 If you do not wish to put everything under a single prefix, that's
7491 ok. You will be prompted for the individual locations; this siteprefix
7492 is only used to suggest the defaults.
7494 The default should be fine for most people.
7498 rp='Installation prefix to use for add-on modules and utilities?'
7499 : XXX Here might be another good place for an installstyle setting.
7500 case "$siteprefix" in
7502 *) dflt=$siteprefix ;;
7505 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7507 case "$siteprefix" in
7511 *) oldsiteprefix="$prefix";;
7516 siteprefixexp="$ansexp"
7518 : determine where site specific libraries go.
7519 : Usual default is /usr/local/lib/perl5/site_perl/$version
7520 : The default "style" setting is made in installstyle.U
7521 : XXX No longer works with Prefixit stuff.
7522 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7524 '') case "$installstyle" in
7525 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7526 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7534 The installation process will create a directory for
7535 site-specific extensions and modules. Most users find it convenient
7536 to place all site-specific files in this directory rather than in the
7537 main distribution directory.
7541 rp='Pathname for the site-specific library files?'
7545 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7547 : Determine list of previous versions to include in @INC
7548 $cat > getverlist <<EOPL
7551 \$api_versionstring = "$api_versionstring";
7552 \$version = "$version";
7553 \$stem = "$sitelib_stem";
7554 \$archname = "$archname";
7556 $cat >> getverlist <<'EOPL'
7557 # The list found is store twice for each entry: the original name, and
7558 # the binary broken down version as pack "sss", so sorting is easy and
7559 # unambiguous. This will work for all versions that have a maximum of
7560 # three digit groups, separate by '.'s or '_'s. Names are extended with
7561 # ".0.0" to ensure at least three elements for the pack.
7562 # -- H.Merijn Brand (m)'06 23-10-2006
7564 # Can't have leading @ because metaconfig interprets it as a command!
7565 ;@inc_version_list=();
7566 # XXX Redo to do opendir/readdir?
7569 ;@candidates = map {
7570 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7571 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7577 ($pversion, $aversion, $vsn5005) = map {
7578 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7579 foreach $d (@candidates) {
7580 if ($d->[1] lt $pversion) {
7581 if ($d->[1] ge $aversion) {
7582 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7584 elsif ($d->[1] ge $vsn5005) {
7585 unshift(@inc_version_list, grep { -d } $d->[0]);
7589 # Skip newer version. I.e. don't look in
7590 # 5.7.0 if we're installing 5.6.1.
7594 if (@inc_version_list) {
7595 print join(' ', @inc_version_list);
7598 # Blank space to preserve value for next Configure run.
7603 case "$inc_version_list" in
7604 '') if test -x "$perl5$exe_ext"; then
7605 dflt=`$perl5 getverlist`
7610 $undef) dflt='none' ;;
7611 *) eval dflt=\"$inc_version_list\" ;;
7614 ''|' ') dflt=none ;;
7621 In order to ease the process of upgrading, this version of perl
7622 can be configured to use modules built and installed with earlier
7623 versions of perl that were installed under $prefix. Specify here
7624 the list of earlier versions that this version of perl should check.
7625 If Configure detected no earlier versions of perl installed under
7626 $prefix, then the list will be empty. Answer 'none' to tell perl
7627 to not search earlier versions.
7629 The default should almost always be sensible, so if you're not sure,
7630 just accept the default.
7633 rp='List of earlier versions to include in @INC?'
7636 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7637 *) inc_version_list="$ans" ;;
7639 case "$inc_version_list" in
7641 inc_version_list_init='0'
7642 d_inc_version_list="$undef"
7644 *) inc_version_list_init=`echo $inc_version_list |
7645 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7646 d_inc_version_list="$define"
7651 : see if malloc/malloc.h has to be included
7652 set malloc/malloc.h i_mallocmalloc
7655 : see if this is a malloc.h system
7656 : we want a real compile instead of Inhdr because some systems have a
7657 : malloc.h that just gives a compile error saying to use stdlib.h instead
7662 #$i_mallocmalloc I_MALLOCMALLOC
7663 #ifdef I_MALLOCMALLOC
7664 # include <malloc/malloc.h>
7667 int main () { return 0; }
7670 if eval $compile; then
7671 echo "<malloc.h> found." >&4
7674 echo "<malloc.h> NOT found." >&4
7681 : check for length of pointer
7685 echo "Checking to see how big your pointers are..." >&4
7694 printf("%d\n", (int)sizeof(void *));
7699 if eval $compile_ok; then
7700 ptrsize=`$run ./try`
7701 echo "Your pointers are $ptrsize bytes long."
7704 echo "(I can't seem to compile the test program. Guessing...)" >&4
7705 rp="What is the size of a pointer (in bytes)?"
7712 case "$use64bitall" in
7713 "$define"|true|[yY]*)
7717 *** You have chosen a maximally 64-bit build,
7718 *** but your pointers are only 4 bytes wide.
7719 *** Please rerun Configure without -Duse64bitall.
7724 *** Since you have quads, you could possibly try with -Duse64bitint.
7729 *** Cannot continue, aborting.
7740 : determine whether to use malloc wrapping
7742 case "$usemallocwrap" in
7743 [yY]*|true|$define) dflt='y' ;;
7744 [nN]*|false|$undef) dflt='n' ;;
7745 *) case "$usedevel" in
7746 [yY]*|true|$define) dflt='y' ;;
7751 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7753 usemallocwrap="$ans"
7756 usemallocwrap="$define" ;;
7758 usemallocwrap="$undef" ;;
7761 : determine which malloc to compile in
7763 case "$usemymalloc" in
7764 [yY]*|true|$define) dflt='y' ;;
7765 [nN]*|false|$undef) dflt='n' ;;
7766 *) case "$ptrsize" in
7770 if test "$useithreads" = "$define"; then dflt='n'; fi
7773 rp="Do you wish to attempt to use the malloc that comes with $package?"
7779 mallocsrc='malloc.c'
7780 mallocobj="malloc$_o"
7781 d_mymalloc="$define"
7784 : Remove malloc from list of libraries to use
7785 echo "Removing unneeded -lmalloc from library list" >&4
7786 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7789 echo "libs = $libs" >&4
7801 : compute the return types of malloc and free
7803 $cat >malloc.c <<END
7807 #include <sys/types.h>
7821 case "$malloctype" in
7823 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7830 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7834 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7841 echo "Your system uses $freetype free(), it would seem." >&4
7843 : determine where site specific architecture-dependent libraries go.
7844 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7845 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7846 : sitelib may have an optional trailing /share.
7848 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7849 dflt="$dflt/$archname"
7854 set sitearch sitearch none
7858 The installation process will also create a directory for
7859 architecture-dependent site-specific extensions and modules.
7863 rp='Pathname for the site-specific architecture-dependent library files?'
7867 if $test X"$sitearch" = X"$sitelib"; then
7870 d_sitearch="$define"
7873 : Set the vendorprefix variables
7876 The installation process will also create a directory for
7877 vendor-supplied add-ons. Vendors who supply perl with their system
7878 may find it convenient to place all vendor-supplied files in this
7879 directory rather than in the main distribution directory. This will
7880 ease upgrades between binary-compatible maintenance versions of perl.
7882 Of course you may also use these directories in whatever way you see
7883 fit. For example, you might use them to access modules shared over a
7884 company-wide network.
7886 The default answer should be fine for most people.
7887 This causes further questions about vendor add-ons to be skipped
7888 and no vendor-specific directories will be configured for perl.
7891 rp='Do you want to configure vendor-specific add-on directories?'
7892 case "$usevendorprefix" in
7893 define|true|[yY]*) dflt=y ;;
7894 *) : User may have set vendorprefix directly on Configure command line.
7895 case "$vendorprefix" in
7904 rp='Installation prefix to use for vendor-supplied add-ons?'
7905 case "$vendorprefix" in
7906 '') dflt="$prefix" ;;
7907 *) dflt=$vendorprefix ;;
7910 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7912 case "$vendorprefix" in
7916 *) oldvendorprefix="$prefix";;
7920 usevendorprefix="$define"
7922 vendorprefixexp="$ansexp"
7924 *) usevendorprefix="$undef"
7930 : Set the vendorlib variables
7931 case "$vendorprefix" in
7932 '') d_vendorlib="$undef"
7936 *) d_vendorlib="$define"
7937 : determine where vendor-supplied modules go.
7938 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7939 case "$vendorlib" in
7941 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7942 case "$installstyle" in
7943 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7944 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7947 *) dflt="$vendorlib"
7951 rp='Pathname for the vendor-supplied library files?'
7954 vendorlibexp="$ansexp"
7957 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7961 : Set the vendorarch variables
7962 case "$vendorprefix" in
7963 '') d_vendorarch="$undef"
7967 *) d_vendorarch="$define"
7968 : determine where vendor-supplied architecture-dependent libraries go.
7969 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7970 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7971 : vendorlib may have an optional trailing /share.
7972 case "$vendorarch" in
7973 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7974 dflt="$dflt/$archname"
7976 *) dflt="$vendorarch" ;;
7979 rp='Pathname for vendor-supplied architecture-dependent files?'
7982 vendorarchexp="$ansexp"
7985 prefixvar=vendorarch
7987 if $test X"$vendorarch" = X"$vendorlib"; then
7988 d_vendorarch="$undef"
7990 d_vendorarch="$define"
7993 : Final catch-all directories to search
7996 Lastly, you can have perl look in other directories for extensions and
7997 modules in addition to those already specified.
7998 These directories will be searched after
8002 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8003 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8005 case "$otherlibdirs" in
8006 ''|' ') dflt='none' ;;
8007 *) dflt="$otherlibdirs" ;;
8010 Enter a colon-separated set of extra paths to include in perl's @INC
8011 search path, or enter 'none' for no extra paths.
8015 rp='Colon-separated list of additional directories for perl to search?'
8018 ' '|''|none) otherlibdirs=' ' ;;
8019 *) otherlibdirs="$ans" ;;
8021 case "$otherlibdirs" in
8025 set d_perl_otherlibdirs
8028 : Cruising for prototypes
8030 echo "Checking out function prototypes..." >&4
8031 $cat >prototype.c <<EOCP
8036 int main(int argc, char *argv[]) {
8039 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8040 echo "Your C compiler appears to support function prototypes."
8043 echo "Your C compiler doesn't seem to understand function prototypes."
8050 : Check if ansi2knr is required
8051 case "$prototype" in
8053 *) ansi2knr='ansi2knr'
8058 This version of $package can only be compiled by a compiler that
8059 understands function prototypes. Unfortunately, your C compiler
8061 doesn't seem to understand them. Sorry about that.
8063 If GNU cc is available for your system, perhaps you could try that instead.
8065 Eventually, we hope to support building Perl with pre-ANSI compilers.
8066 If you would like to help in that effort, please contact <perlbug@perl.org>.
8068 Aborting Configure now.
8075 dflt_dtrace='/usr/sbin/dtrace'
8076 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8080 Perl can be built to support DTrace on platforms that support it.
8081 DTrace is a diagnosis and performance analysis tool from Sun.
8083 If this doesn't make any sense to you, just accept the default.
8087 case "$usedtrace" in
8093 dflt_dtrace=$usedtrace
8100 rp='Support DTrace if available?'
8103 y|Y) val="$define" ;;
8109 test "X$usedtrace" != "X$define" && break
8112 rp='Where is the dtrace executable?'
8121 if $dtrace -h -s ../perldtrace.d \
8122 -o perldtrace.tmp >/dev/null 2>&1 \
8123 && rm -f perldtrace.tmp
8126 echo "Good: your $dtrace knows about the -h flag."
8130 *** $me: Fatal Error: $dtrace doesn't support -h flag
8132 *** Your installed dtrace doesn't support the -h switch to compile a D
8133 *** program into a C header. Can't continue.
8145 *** $me: Fatal Error: $dtrace not found.
8152 echo "*** $dtrace was not found."
8158 : See if we want extra modules installed
8165 Perl can be built with extra modules or bundles of modules which
8166 will be fetched from the CPAN and installed alongside Perl.
8168 Notice that you will need access to the CPAN; either via the Internet,
8169 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8170 be asked later to configure the CPAN.pm module which will in turn do
8171 the installation of the rest of the extra modules or bundles.)
8173 Notice also that if the modules require any external software such as
8174 libraries and headers (the libz library and the zlib.h header for the
8175 Compress::Zlib module, for example) you MUST have any such software
8176 already installed, this configuration process will NOT install such
8179 If this doesn't make any sense to you, just accept the default '$dflt'.
8181 rp='Install any extra modules (y or n)?'
8187 Please list any extra modules or bundles to be installed from CPAN,
8188 with spaces between the names. The names can be in any format the
8189 'install' command of CPAN.pm will understand. (Answer 'none',
8190 without the quotes, to install no extra modules or bundles.)
8200 $rm -f ../extras.lst
8202 *) echo "(Saving the list of extras for later...)"
8203 echo "$extras" > ../extras.lst
8211 : determine where html pages for programs go
8212 set html1dir html1dir none
8216 If you wish to install html files for programs in $spackage, indicate
8217 the appropriate directory here. To skip installing html files,
8221 ''|none|$undef|' ') dflt=none ;;
8222 *) dflt=$html1dir ;;
8225 rp="Directory for the main $spackage html pages?"
8229 : Use ' ' for none so value is preserved next time through Configure
8230 $test X"$html1dir" = "X" && html1dir=' '
8232 : determine where html pages for libraries and modules go
8233 set html3dir html3dir none
8237 If you wish to install html files for modules associated with $spackage,
8238 indicate the appropriate directory here. To skip installing html files,
8241 : There is no obvious default. If they have specified html1dir, then
8242 : try to key off that, possibly changing .../html1 into .../html3.
8244 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8245 *) dflt=$html3dir ;;
8248 rp="Directory for the $spackage module html pages?"
8252 : Use ' ' for none so value is preserved next time through Configure
8253 $test X"$html3dir" = "X" && html3dir=' '
8255 : determine whether to install perl also as /usr/bin/perl
8258 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8260 Many scripts expect perl to be installed as /usr/bin/perl.
8262 If you want to, I can install the perl you are about to compile
8263 as /usr/bin/perl (in addition to $bin/perl).
8265 if test -f /usr/bin/perl; then
8268 However, please note that because you already have a /usr/bin/perl,
8269 overwriting that with a new Perl would very probably cause problems.
8270 Therefore I'm assuming you don't want to do that (unless you insist).
8273 case "$installusrbinperl" in
8274 "$define"|[yY]*) dflt='y';;
8280 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8283 case "$installusrbinperl" in
8284 "$undef"|[nN]*) dflt='n';;
8288 rp="Do you want to install perl as /usr/bin/perl?"
8291 [yY]*) val="$define";;
8297 set installusrbinperl
8300 : see if dlopen exists
8302 xxx_ccflags="$ccflags"
8304 : with g++ one needs -shared to get is-in-libc to work for dlopen
8305 case "$gccversion" in
8308 *) case "$d_cplusplus" in
8309 "$define") ccflags="$ccflags -shared" ;;
8316 ccflags="$xxx_ccflags"
8318 : see if this is a unistd.h system
8319 set unistd.h i_unistd
8322 : determine which dynamic loading, if any, to compile in
8324 dldir="ext/DynaLoader"
8337 $define) dflt='y' ;;
8339 : Does a dl_xxx.xs file exist for this operating system
8340 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8343 rp="Do you wish to use dynamic loading?"
8350 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8351 dflt="$dldir/dl_${osname}.xs"
8352 elif $test "$d_dlopen" = "$define" ; then
8353 dflt="$dldir/dl_dlopen.xs"
8358 *) dflt="$dldir/$dlsrc"
8361 echo "The following dynamic loading files are available:"
8362 : Can not go over to $dldir because getfile has path hard-coded in.
8363 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8364 rp="Source file to use for dynamic loading"
8370 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8374 Some systems may require passing special flags to $cc -c to
8375 compile modules that will be used to create a shared library.
8376 To use no flags, say "none".
8379 case "$cccdlflags" in
8380 '') case "$gccversion" in
8381 '') case "$osname" in
8383 irix*) dflt='-KPIC' ;;
8384 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8385 sunos) dflt='-pic' ;;
8389 *) case "$osname" in
8390 darwin) dflt='none' ;;
8391 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8396 *) dflt="$cccdlflags" ;;
8403 # If -Dsysroot was specified, now's the time to add it
8405 if test "X$sysroot" != X; then
8406 case "$gccversion" in
8411 dflt="$dflt --sysroot=$sysroot" ;;
8421 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8424 none) cccdlflags=' ' ;;
8425 *) cccdlflags="$ans" ;;
8430 Some systems use ld to create libraries that can be dynamically loaded,
8431 while other systems (such as those using ELF) use $cc.
8435 : Determine if this is ELF
8437 /* Test for whether ELF binaries are produced */
8449 int i = open("a.out",O_RDONLY);
8452 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8453 exit(0); /* succeed (yes, it is ELF) */
8457 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8463 '') if $test $bin_ELF = "$define"; then
8465 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8469 echo "I'll use ld to build dynamic libraries."
8477 rp="What command should be used to create dynamic libraries?"
8483 Some systems may require passing special flags to $ld to create a
8484 library that can be dynamically loaded. If your ld flags include
8485 -L/other/path options to locate libraries outside your loader's normal
8486 search path, you may need to specify those -L options here as well. To
8487 use no flags, say "none".
8490 case "$lddlflags" in
8491 '') case "$osname" in
8492 haiku) dflt='-shared' ;;
8494 case "$gccversion" in
8495 '') dflt="$dflt +vnocompatwarnings" ;;
8498 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8499 solaris) # See [perl #66604].
8500 # On Solaris 11, gcc -m64 on amd64
8501 # appears not to understand -G. gcc versions at
8502 # least as old as 3.4.3 support -shared, so just
8503 # use that with Solaris 11 and later, but keep
8504 # the old behavior for older Solaris versions.
8505 case "$gccversion" in
8507 *) case "$osvers" in
8508 2.?|2.10) dflt='-G' ;;
8509 *) dflt='-shared' ;;
8514 sunos) dflt='-assert nodefinitions' ;;
8515 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8519 *) dflt="$lddlflags" ;;
8522 : Only do this for gcc, since, for example, qcc has no concept
8524 if $test "X$sysroot" != X; then
8525 case "$gccversion" in
8527 *) dflt="$dflt --sysroot $sysroot" ;;
8531 : Try to guess additional flags to pick up local libraries.
8532 : Be careful not to append to a plain 'none'
8536 for thisflag in $ldflags; do
8541 *) dflt="$dflt $thisflag" ;;
8548 ''|' ') dflt='none' ;;
8552 *-fstack-protector-strong*)
8554 *-fstack-protector-strong*) ;; # Don't add it again
8555 *) dflt="$dflt -fstack-protector-strong" ;;
8558 *-fstack-protector*)
8560 *-fstack-protector*) ;; # Don't add it again
8561 *) dflt="$dflt -fstack-protector" ;;
8566 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8569 none) lddlflags=' ' ;;
8570 *) lddlflags="$ans" ;;
8575 Some systems may require passing special flags to $cc to indicate that
8576 the resulting executable will use dynamic linking. To use no flags,
8580 case "$ccdlflags" in
8581 '') case "$osname" in
8582 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8583 sunos) dflt='none' ;;
8587 *) dflt="$ccdlflags" ;;
8589 rp="Any special flags to pass to $cc to use dynamic linking?"
8592 none) ccdlflags=' ' ;;
8593 *) ccdlflags="$ans" ;;
8605 ld_can_script="$undef"
8606 case "$bin_ELF$usedl" in
8608 # Abuse try.h and a.out names for neat cleanup
8620 if $cc $cccdlflags $ccdlflags $ccflags \
8621 $ldflags $lddlflags -o a.out try.c \
8622 -Wl,--version-script=try.h >/dev/null 2>&1 \
8623 && $test -s a.out ; then
8624 echo "ld supports scripting" >&4
8625 ld_can_script="$define"
8627 echo "ld does not support scripting" >&4
8633 : Do we want a shared libperl?
8637 # No dynamic loading being used, so don't bother even to prompt.
8640 *) case "$useshrplib" in
8641 '') case "$osname" in
8642 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8644 also='Building a shared libperl is required for dynamic loading to work on your system.'
8658 The perl executable is normally obtained by linking perlmain.c with
8659 libperl${_a}, any static extensions (usually just DynaLoader), and
8660 any other libraries needed on this system (such as -lm, etc.). Since
8661 your system supports dynamic loading, it is probably possible to build
8662 a shared libperl.$so. If you will have more than one executable linked
8663 to libperl.$so, this will significantly reduce the size of each
8664 executable, but it may have a noticeable effect on performance. The
8665 default is probably sensible for your system.
8669 rp="Build a shared libperl.$so (y/n)"
8673 useshrplib='true' ;;
8674 *) useshrplib='false' ;;
8679 case "$useshrplib" in
8681 case "$userelocatableinc" in
8683 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8684 echo "See INSTALL for an explanation why that won't work." >&4
8690 # Figure out a good name for libperl.so. Since it gets stored in
8691 # a version-specific architecture-dependent library, the version
8692 # number isn't really that important, except for making cc/ld happy.
8694 # A name such as libperl.so.10.1
8695 majmin="libperl.$so.$patchlevel.$subversion"
8696 # A name such as libperl.so.100
8697 majonly=`echo $patchlevel $subversion |
8698 $awk '{printf "%d%02d", $1, $2}'`
8699 majonly=libperl.$so.$majonly
8700 # I'd prefer to keep the os-specific stuff here to a minimum, and
8701 # rely on figuring it out from the naming of libc.
8702 case "${osname}${osvers}" in
8703 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8706 cygwin*) # ld links now against the dll directly
8707 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8708 majonly=`echo $patchlevel $subversion |
8709 $awk '{printf "%03d%03d", $1, $2}'`
8710 majonly=cygperl5.$majonly.$so
8713 *) # Try to guess based on whether libc has major.minor.
8715 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8716 *libc.$so.[0-9]*) dflt=$majonly ;;
8717 *) dflt=libperl.$so ;;
8727 I need to select a good name for the shared libperl. If your system uses
8728 library names with major and minor numbers, then you might want something
8729 like $majmin. Alternatively, if your system uses a single version
8730 number for shared libraries, then you might want to use $majonly.
8731 Or, your system might be quite happy with a simple libperl.$so.
8733 Since the shared libperl will get installed into a version-specific
8734 architecture-dependent directory, the version number of the shared perl
8735 library probably isn't important, so the default should be o.k.
8738 rp='What name do you want to give to the shared libperl?'
8741 echo "Ok, I'll use $libperl"
8744 libperl="libperl${_a}"
8748 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8752 WARNING: Use of the shrpdir variable for the installation location of
8753 the shared $libperl is not supported. It was never documented and
8754 will not work in this version. Let me (perlbug@perl.org)
8755 know of any problems this may cause.
8761 But your current setting of $shrpdir is
8762 the default anyway, so it's harmless.
8767 Further, your current attempted setting of $shrpdir
8768 conflicts with the value of $archlibexp/CORE
8769 that installperl will use.
8776 # How will the perl executable find the installed shared $libperl?
8777 # Add $xxx to ccdlflags.
8778 # If we can't figure out a command-line option, use $shrpenv to
8779 # set env LD_RUN_PATH. The main perl makefile uses this.
8780 shrpdir=$archlibexp/CORE
8783 if "$useshrplib"; then
8786 # We'll set it in Makefile.SH...
8791 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8792 xxx="-Wl,-R$shrpdir"
8794 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8795 xxx="-Wl,-rpath,$shrpdir"
8798 # hpux doesn't like the default, either.
8799 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8802 # cygwin needs only ldlibpth
8805 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8811 # Only add $xxx if it isn't already in ccdlflags.
8812 case " $ccdlflags " in
8814 *) ccdlflags="$ccdlflags $xxx"
8817 Adding $xxx to the flags
8818 passed to $ld so that the perl executable will find the
8819 installed shared $libperl.
8827 # Fix ccdlflags in AIX for building external extensions.
8828 # (For building Perl itself bare -bE:perl.exp is needed,
8829 # Makefile.SH takes care of this.)
8831 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8833 # Respect a hint or command-line value.
8835 '') shrpenv="$tmp_shrpenv" ;;
8837 case "$ldlibpthname" in
8838 '') ldlibpthname=LD_LIBRARY_PATH ;;
8839 none) ldlibpthname='' ;;
8842 : determine where manual pages are on this system
8846 syspath='/usr/share/man/man1 /usr/man/man1'
8847 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8848 syspath="$syspath /usr/man/u_man/man1"
8849 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8850 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8851 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8852 sysman=`./loc . /usr/man/man1 $syspath`
8855 if $test -d "$sysman"; then
8856 echo "System manual is in $sysman." >&4
8858 echo "Could not find manual pages in source form." >&4
8861 : determine where manual pages go
8862 set man1dir man1dir none
8866 $spackage has manual pages available in source form.
8870 echo "However, you don't have nroff, so they're probably useless to you."
8872 '') man1dir="none";;
8875 echo "If you don't want the manual sources installed, answer 'none'."
8880 lookpath="$prefixexp/share/man/man1"
8881 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8882 lookpath="$lookpath $prefixexp/man/p_man/man1"
8883 lookpath="$lookpath $prefixexp/man/u_man/man1"
8884 lookpath="$lookpath $prefixexp/man/man.1"
8886 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8887 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8897 rp="Where do the main $spackage manual pages (source) go?"
8899 if $test "X$man1direxp" != "X$ansexp"; then
8910 : What suffix to use on installed man pages
8917 rp="What suffix should be used for the main $spackage man pages?"
8919 '') case "$man1dir" in
8933 *) dflt="$man1ext";;
8940 : see if we can have long filenames
8942 first=123456789abcdef
8944 if (echo hi >$first) 2>/dev/null; then
8945 if $test -f 123456789abcde; then
8946 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8949 echo 'You can have filenames longer than 14 characters.'>&4
8954 You can't have filenames longer than 14 chars.
8955 You can't even think about them!
8961 $rm -rf 123456789abcde*
8963 : determine where library module manual pages go
8964 set man3dir man3dir none
8968 $spackage has manual pages for many of the library modules.
8974 However, you don't have nroff, so they're probably useless to you.
8977 '') man3dir="none";;
8981 case "$d_flexfnam" in
8984 However, your system can't handle the long file names like File::Basename.3.
8987 '') man3dir="none";;
8991 echo "If you don't want the manual sources installed, answer 'none'."
8992 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8994 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8995 if $test -d "$privlib/man/man3"; then
8998 WARNING: Previous versions of perl installed man3 pages into
8999 $privlib/man/man3. This version will suggest a
9000 new default of $dflt.
9004 rp='Do you wish to preserve the old behavior?(y/n)'
9007 y*) dflt="$privlib/man/man3" ;;
9012 *) dflt="$man3dir" ;;
9019 rp="Where do the $package library man pages (source) go?"
9029 : What suffix to use on installed man pages
9035 rp="What suffix should be used for the $package library man pages?"
9037 '') case "$man3dir" in
9051 *) dflt="$man3ext";;
9058 : see if we have to deal with yellow pages, now NIS.
9059 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9065 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9073 rp='Are you getting the hosts file via yellow pages?'
9076 y*) hostcat='ypcat hosts';;
9077 *) hostcat='cat /etc/hosts';;
9083 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9086 '') test -f /etc/group && groupcat='cat /etc/group';;
9089 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9092 : now get the host name
9094 echo "Figuring out host name..." >&4
9095 case "$myhostname" in
9097 echo 'Maybe "hostname" will work...'
9098 if tans=`sh -c hostname 2>&1` ; then
9106 if $test "$cont"; then
9108 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9109 if tans=`cat /etc/systemid 2>&1` ; then
9111 phostname='cat /etc/systemid'
9112 echo "Whadyaknow. Xenix always was a bit strange..."
9115 elif $test -r /etc/systemid; then
9116 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9119 if $test "$cont"; then
9120 echo 'No, maybe "uuname -l" will work...'
9121 if tans=`sh -c 'uuname -l' 2>&1` ; then
9123 phostname='uuname -l'
9125 echo 'Strange. Maybe "uname -n" will work...'
9126 if tans=`sh -c 'uname -n' 2>&1` ; then
9128 phostname='uname -n'
9130 echo 'Oh well, maybe I can mine it out of whoami.h...'
9131 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9132 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9133 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9135 case "$myhostname" in
9136 '') echo "Does this machine have an identity crisis or something?"
9139 echo "Well, you said $myhostname before..."
9140 phostname='echo $myhostname';;
9146 case "$myhostname" in
9147 '') myhostname=noname ;;
9149 : you do not want to know about this
9154 if $test "$myhostname" ; then
9156 rp='Your host name appears to be "'$myhostname'".'" Right?"
9164 : bad guess or no guess
9165 while $test "X$myhostname" = X ; do
9167 rp="Please type the (one word) name of your host:"
9172 : translate upper to lower if necessary
9173 case "$myhostname" in
9175 echo "(Normalizing case in your host name)"
9176 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9180 case "$myhostname" in
9182 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9183 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9184 echo "(Trimming domain name from host name--host name is now $myhostname)"
9186 *) case "$mydomain" in
9189 test "X$hostcat" = "Xypcat hosts" &&
9190 ypmatch "$myhostname" hosts 2>/dev/null |\
9191 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9194 test "X$hostcat" != "X" &&
9195 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9196 /[ ]$myhostname[ . ]/p" > hosts
9199 if $test -f hosts; then
9200 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9201 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9202 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9203 hosts | $sort | $uniq | \
9204 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9205 case `$echo X$dflt` in
9206 X*\ *) echo "(Several hosts in the database matched hostname)"
9209 X.) echo "(You do not have fully-qualified names in the hosts database)"
9213 echo "(I cannot locate a hosts database anywhere)"
9218 tans=`./loc resolv.conf X /etc /usr/etc`
9219 if $test -f "$tans"; then
9220 echo "(Attempting domain name extraction from $tans)"
9221 dflt=.`$sed -n -e 's/ / /g' \
9222 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9225 .) dflt=.`$sed -n -e 's/ / /g' \
9226 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9234 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9235 dflt=.`sh -c domainname 2>/dev/null`
9238 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9242 case "$dflt$osname" in
9243 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9244 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9248 .) echo "(Lost all hope -- silly guess then)"
9254 *) dflt="$mydomain";;
9258 rp="What is your domain name?"
9268 : translate upper to lower if necessary
9271 echo "(Normalizing case in your domain name)"
9272 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9276 : a little sanity check here
9277 case "$phostname" in
9280 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9281 $myhostname$mydomain|$myhostname) ;;
9283 case "$phostname" in
9285 echo "(That doesn't agree with your whoami.h file, by the way.)"
9288 echo "(That doesn't agree with your $phostname command, by the way.)"
9296 : determine the e-mail address of the user who is running us
9299 I need to get your e-mail address in Internet format if possible, i.e.
9300 something like user@host.domain. Please answer accurately since I have
9301 no easy means to double check it. The default value provided below
9302 is most probably close to reality but may not be valid from outside
9303 your organization...
9307 while test "$cont"; do
9308 case "$MAILDOMAIN" in
9310 if $test -s /etc/mailname; then
9311 maildomain=`$cat /etc/mailname`
9313 maildomain="$myhostname$mydomain"
9316 *) maildomain="$MAILDOMAIN";;
9319 '') dflt="$cf_by@$maildomain";;
9320 *) dflt="$cf_email";;
9322 rp='What is your e-mail address?'
9328 rp='Address does not look like an Internet one. Use it anyway?'
9342 : Ask e-mail of administrator
9345 If you or somebody else will be maintaining perl at your site, please
9346 fill in the correct e-mail address here so that they may be contacted
9347 if necessary. Currently, the "perlbug" program included with perl
9348 will send mail to this address in addition to perlbug@perl.org. You may
9349 enter "none" for no administrator.
9352 case "$perladmin" in
9353 '') dflt="$cf_email";;
9354 *) dflt="$perladmin";;
9356 rp='Perl administrator e-mail address'
9360 : determine whether to only install version-specific parts.
9363 Do you want to install only the version-specific parts of the perl
9364 distribution? Usually you do *not* want to do this.
9366 case "$versiononly" in
9367 "$define"|[Yy]*|true) dflt='y' ;;
9370 rp="Do you want to install only the version-specific parts of perl?"
9373 [yY]*) val="$define";;
9379 case "$versiononly" in
9380 "$define") inc_version_list=''
9381 inc_version_list_init=0
9385 : figure out how to guarantee perl startup
9386 : XXX Note that this currently takes advantage of the bug that binexp ignores
9387 : the Configure -Dinstallprefix setting, which in turn means that under
9388 : relocatable @INC, initialinstalllocation is what binexp started as.
9389 case "$startperl" in
9391 case "$sharpbang" in
9395 I can use the #! construct to start perl on your system. This will
9396 make startup of perl scripts faster, but may cause problems if you
9397 want to share those scripts and perl is not in a standard place
9398 ($initialinstalllocation/perl) on all your platforms. The alternative
9399 is to force a shell by starting the script with a single ':' character.
9402 case "$versiononly" in
9403 "$define") dflt="$initialinstalllocation/perl$version";;
9404 *) dflt="$initialinstalllocation/perl";;
9406 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9409 none) startperl=": # use perl";;
9410 *) startperl="#!$ans"
9411 if $test 30 -lt `echo "$ans" | wc -c`; then
9414 WARNING: Some systems limit the #! command to 32 characters.
9415 If you experience difficulty running Perl scripts with #!, try
9416 installing Perl in a directory with a shorter pathname.
9422 *) startperl=": # use perl"
9427 echo "I'll use $startperl to start perl scripts."
9429 : figure best path for perl in scripts
9432 case "$versiononly" in
9433 "$define") perlpath="$initialinstalllocation/perl$version";;
9434 *) perlpath="$initialinstalllocation/perl";;
9436 case "$startperl" in
9441 I will use the "eval 'exec'" idiom to start Perl on your system.
9442 I can use the full path of your Perl binary for this purpose, but
9443 doing so may cause problems if you want to share those scripts and
9444 Perl is not always in a standard place ($initialinstalllocation/perl).
9447 dflt="$initialinstalllocation/perl"
9448 rp="What path shall I use in \"eval 'exec'\"?"
9455 case "$startperl" in
9457 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9460 : determine where public executable scripts go
9461 set scriptdir scriptdir
9463 case "$scriptdir" in
9466 : guess some guesses
9467 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9468 $test -d /usr/share/bin && dflt=/usr/share/bin
9469 $test -d /usr/local/script && dflt=/usr/local/script
9470 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9471 $test -d $prefixexp/script && dflt=$prefixexp/script
9475 *) dflt="$scriptdir"
9480 Some installations have a separate directory just for executable scripts so
9481 that they can mount it across multiple architectures but keep the scripts in
9482 one spot. You might, for example, have a subdirectory of /usr/share for this.
9483 Or you might just lump your scripts in with all your other executables.
9487 rp='Where do you keep publicly executable scripts?'
9489 if $test "X$ansexp" != "X$scriptdirexp"; then
9495 : A little fix up for an irregularly named variable.
9496 installscript="$installscriptdir"
9498 : determine where add-on public executables go
9500 '') dflt=$siteprefix/bin ;;
9504 rp='Pathname where the add-on public executables should be installed?'
9509 : determine where add-on html pages go
9510 : There is no standard location, so try to copy the previously-selected
9511 : directory structure for the core html pages.
9512 case "$sitehtml1dir" in
9513 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9514 *) dflt=$sitehtml1dir ;;
9517 ''|' ') dflt=none ;;
9520 rp='Pathname where the site-specific html pages should be installed?'
9522 prefixvar=sitehtml1dir
9525 : determine where add-on library html pages go
9526 : There is no standard location, so try to copy the previously-selected
9527 : directory structure for the core html pages.
9528 case "$sitehtml3dir" in
9529 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9530 *) dflt=$sitehtml3dir ;;
9533 ''|' ') dflt=none ;;
9536 rp='Pathname where the site-specific library html pages should be installed?'
9538 prefixvar=sitehtml3dir
9541 : determine where add-on manual pages go
9542 case "$siteman1dir" in
9543 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9544 *) dflt=$siteman1dir ;;
9547 ''|' ') dflt=none ;;
9550 rp='Pathname where the site-specific manual pages should be installed?'
9552 prefixvar=siteman1dir
9555 : determine where add-on library man pages go
9556 case "$siteman3dir" in
9557 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9558 *) dflt=$siteman3dir ;;
9561 ''|' ') dflt=none ;;
9564 rp='Pathname where the site-specific library manual pages should be installed?'
9566 prefixvar=siteman3dir
9569 : determine where add-on public executable scripts go
9570 case "$sitescript" in
9571 '') dflt=$siteprefix/script
9572 $test -d $dflt || dflt=$sitebin ;;
9573 *) dflt="$sitescript" ;;
9576 rp='Pathname where add-on public executable scripts should be installed?'
9578 prefixvar=sitescript
9581 : see if backtrace exists
9582 set backtrace d_backtrace
9585 : add flags if using c backtrace
9586 case "$usecbacktrace" in
9587 "") usecbacktrace=$undef ;;
9589 case "$d_backtrace" in
9591 case " $ccflags " in
9592 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9593 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9597 echo "This system does not support backtrace" >&4
9598 usecbacktrace=$undef
9604 : Check if faststdio is requested and available
9605 case "$usefaststdio" in
9606 $define|true|[yY]*|'')
9607 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9617 Perl can be built to use 'fast stdio', which means using the stdio
9618 library but also directly manipulating the stdio buffers to enable
9619 faster I/O. Using stdio is better for backward compatibility (especially
9620 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9621 interface has been preferred instead of stdio.
9623 If this doesn't make any sense to you, just accept the default '$dflt'.
9625 rp='Use the "fast stdio" if available?'
9628 y|Y) val="$define" ;;
9635 : define an is-a-typedef? function
9636 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9638 "") inclist="sys/types.h";;
9640 eval "varval=\$$var";
9644 for inc in $inclist; do
9645 echo "#include <$inc>" >>temp.c;
9647 echo "#ifdef $type" >> temp.c;
9648 echo "printf(\"We have $type\");" >> temp.c;
9649 echo "#endif" >> temp.c;
9650 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9651 if $contains $type temp.E >/dev/null 2>&1; then
9657 *) eval "$var=\$varval";;
9660 : define an is-a-typedef? function that prompts if the type is not available.
9661 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9663 "") inclist="sys/types.h";;
9665 eval "varval=\$$var";
9669 for inc in $inclist; do
9670 echo "#include <$inc>" >>temp.c;
9672 echo "#ifdef $type" >> temp.c;
9673 echo "printf(\"We have $type\");" >> temp.c;
9674 echo "#endif" >> temp.c;
9675 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9677 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9678 if $contains $type temp.E >/dev/null 2>&1; then
9679 echo "$type found." >&4;
9682 echo "$type NOT found." >&4;
9688 *) eval "$var=\$varval";;
9691 : see what type lseek is declared as in the kernel
9692 rp="What is the type used for lseek's offset on this system?"
9693 set off_t lseektype long stdio.h sys/types.h
9697 echo "Checking to see how big your file offsets are..." >&4
9699 #include <sys/types.h>
9703 printf("%d\n", (int)sizeof($lseektype));
9708 if eval $compile_ok; then
9709 lseeksize=`$run ./try`
9710 echo "Your file offsets are $lseeksize bytes long."
9714 echo "(I can't seem to compile the test program. Guessing...)"
9715 rp="What is the size of your file offsets (in bytes)?"
9721 : see what type file positions are declared as in the library
9722 rp="What is the type for file position used by fsetpos()?"
9723 set fpos_t fpostype long stdio.h sys/types.h
9726 : Check size for Fpos_t
9729 *_t) zzz="$fpostype" ;;
9732 echo "Checking the size of $zzz..." >&4
9734 #include <sys/types.h>
9741 printf("%d\n", (int)sizeof($fpostype));
9746 if eval $compile_ok; then
9750 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9753 echo "Your $zzz is $fpossize bytes long."
9759 echo "(I can't compile the test program. Guessing...)" >&4
9760 rp="What is the size of your file positions (in bytes)?"
9765 : Check for large file support
9766 # Backward compatibility (uselfs is deprecated).
9768 "$define"|true|[yY]*)
9771 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9773 uselargefiles="$define"
9777 case "$lseeksize:$fpossize" in
9780 You can have files larger than 2 gigabytes.
9783 *) case "$uselargefiles" in
9784 "$undef"|false|[nN]*) dflt='n' ;;
9789 Perl can be built to understand large files (files larger than 2 gigabytes)
9790 on some systems. To do so, Configure can be run with -Duselargefiles.
9792 If this doesn't make any sense to you, just accept the default '$dflt'.
9794 rp='Try to understand large files, if available?'
9797 y|Y) val="$define" ;;
9804 : Look for a hint-file generated 'call-back-unit'. If the
9805 : user has specified that a large files perl is to be built,
9806 : we may need to set or change some other defaults.
9807 if $test -f uselargefiles.cbu; then
9808 echo "Your platform has some specific hints regarding large file builds, using them..."
9809 . ./uselargefiles.cbu
9811 case "$uselargefiles" in
9813 if $test -f uselargefiles.cbu; then
9815 echo "Rechecking to see how big your file offsets are..." >&4
9817 #include <sys/types.h>
9821 printf("%d\n", (int)sizeof($lseektype));
9826 if eval $compile_ok; then
9827 lseeksize=`$run ./try`
9828 $echo "Your file offsets are now $lseeksize bytes long."
9832 echo "(I can't seem to compile the test program. Guessing...)"
9833 rp="What is the size of your file offsets (in bytes)?"
9838 *_t) zzz="$fpostype" ;;
9841 $echo $n "Rechecking the size of $zzz...$c" >&4
9843 #include <sys/types.h>
9850 printf("%d\n", (int)sizeof($fpostype));
9855 if eval $compile_ok; then
9860 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9863 echo " $fpossize bytes." >&4
9869 echo "(I can't compile the test program. Guessing...)" >&4
9870 rp="What is the size of your file positions (in bytes)?"
9879 : Check if we want perlio
9882 : Set the vendorbin variables
9883 case "$vendorprefix" in
9884 '') d_vendorbin="$undef"
9888 *) d_vendorbin="$define"
9889 : determine where vendor-supplied executables go.
9890 case "$vendorbin" in
9891 '') dflt=$vendorprefix/bin ;;
9892 *) dflt="$vendorbin" ;;
9895 rp='Pathname for the vendor-supplied executables directory?'
9898 vendorbinexp="$ansexp"
9904 : Set the vendorhtml1dir variables
9905 case "$vendorprefix" in
9906 '') vendorhtml1dir=''
9907 vendorhtml1direxp=''
9909 *) : determine where vendor-supplied html pages go.
9910 : There is no standard location, so try to copy the previously-selected
9911 : directory structure for the core html pages.
9912 : XXX Better default suggestions would be welcome.
9913 case "$vendorhtml1dir" in
9914 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9915 *) dflt=$vendorhtml1dir ;;
9918 ''|' ') dflt=none ;;
9921 rp='Pathname for the vendor-supplied html pages?'
9923 vendorhtml1dir="$ans"
9924 vendorhtml1direxp="$ansexp"
9927 : Use ' ' for none so value is preserved next time through Configure
9928 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9929 prefixvar=vendorhtml1dir
9932 : Set the vendorhtml3dir variables
9933 case "$vendorprefix" in
9934 '') vendorhtml3dir=''
9935 vendorhtml3direxp=''
9937 *) : determine where vendor-supplied module html pages go.
9938 : There is no standard location, so try to copy the previously-selected
9939 : directory structure for the core html pages.
9940 : XXX Better default suggestions would be welcome.
9941 case "$vendorhtml3dir" in
9942 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9943 *) dflt=$vendorhtml3dir ;;
9946 ''|' ') dflt=none ;;
9949 rp='Pathname for the vendor-supplied html pages?'
9951 vendorhtml3dir="$ans"
9952 vendorhtml3direxp="$ansexp"
9955 : Use ' ' for none so value is preserved next time through Configure
9956 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9957 prefixvar=vendorhtml3dir
9960 : Set the vendorman1dir variables
9961 case "$vendorprefix" in
9962 '') vendorman1dir=''
9965 *) : determine where vendor-supplied manual pages go.
9966 case "$vendorman1dir" in
9967 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9968 *) dflt=$vendorman1dir ;;
9971 ''|' ') dflt=none ;;
9974 rp='Pathname for the vendor-supplied manual section 1 pages?'
9976 vendorman1dir="$ans"
9977 vendorman1direxp="$ansexp"
9980 : Use ' ' for none so value is preserved next time through Configure
9981 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9982 prefixvar=vendorman1dir
9985 : Set the vendorman3dir variables
9986 case "$vendorprefix" in
9987 '') vendorman3dir=''
9990 *) : determine where vendor-supplied module manual pages go.
9991 case "$vendorman3dir" in
9992 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9993 *) dflt=$vendorman3dir ;;
9996 ''|' ') dflt=none ;;
9999 rp='Pathname for the vendor-supplied manual section 3 pages?'
10001 vendorman3dir="$ans"
10002 vendorman3direxp="$ansexp"
10005 : Use ' ' for none so value is preserved next time through Configure
10006 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10007 prefixvar=vendorman3dir
10010 : Set the vendorscript variables
10011 case "$vendorprefix" in
10012 '') d_vendorscript="$undef"
10016 *) d_vendorscript="$define"
10017 : determine where vendor-supplied scripts go.
10018 case "$vendorscript" in
10019 '') dflt=$vendorprefix/script
10020 $test -d $dflt || dflt=$vendorbin ;;
10021 *) dflt="$vendorscript" ;;
10025 The installation process will create a directory for
10026 vendor-supplied scripts.
10030 rp='Pathname for the vendor-supplied scripts directory?'
10032 vendorscript="$ans"
10033 vendorscriptexp="$ansexp"
10036 prefixvar=vendorscript
10039 : script used to emit important warnings
10042 if test \$# -gt 0; then
10047 echo "*** WARNING:" >&4
10048 sed -e 's/^/*** /' <msg >&4
10050 cat msg >>config.msg
10051 echo " " >>config.msg
10057 : see which of string.h or strings.h is needed
10059 strings=`./findhdr string.h`
10060 if $test "$strings" && $test -r "$strings"; then
10061 echo "Using <string.h> instead of <strings.h>." >&4
10065 strings=`./findhdr strings.h`
10066 if $test "$strings" && $test -r "$strings"; then
10067 echo "Using <strings.h> instead of <string.h>." >&4
10069 ./warn "No string header found -- You'll surely have problems."
10074 case "$i_string" in
10075 "$undef") strings=`./findhdr strings.h`;;
10076 *) strings=`./findhdr string.h`;;
10079 : see if qgcvt exists
10083 : Check what kind of doubles your system has
10084 $echo "Checking the kind of doubles you have..." >&4
10086 #$i_stdlib I_STDLIB
10087 #define DOUBLESIZE $doublesize
10089 #include <stdlib.h>
10092 static const double d = -0.1;
10094 unsigned const char* b = (unsigned const char*)(&d);
10095 #if DOUBLESIZE == 4
10096 if (b[0] == 0xCD && b[3] == 0xBD) {
10097 /* IEEE 754 32-bit little-endian */
10101 if (b[0] == 0xBD && b[3] == 0xCD) {
10102 /* IEEE 754 32-bit big-endian */
10107 #if DOUBLESIZE == 8
10108 if (b[0] == 0x9A && b[7] == 0xBF) {
10109 /* IEEE 754 64-bit little-endian */
10113 if (b[0] == 0xBF && b[7] == 0x9A) {
10114 /* IEEE 754 64-bit big-endian */
10118 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10119 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10120 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10121 * 99 99 b9 bf 9a 99 99 99 */
10125 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10126 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10127 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10128 * 99 99 99 9a bf b9 99 99 */
10133 #if DOUBLESIZE == 16
10134 if (b[0] == 0x9A && b[15] == 0xBF) {
10135 /* IEEE 754 128-bit little-endian */
10139 if (b[0] == 0xBF && b[15] == 0x9A) {
10140 /* IEEE 754 128-bit big-endian */
10145 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10146 * Whether those environments can still build Perl is debatable. */
10147 printf("-1\n"); /* unknown */
10152 if eval $compile; then
10153 doublekind=`$run ./try`
10157 case "$doublekind" in
10158 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10159 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10160 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10161 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10162 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10163 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10164 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10165 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10166 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10170 : Check print/scan long double stuff
10173 if $test X"$d_longdbl" = X"$define"; then
10175 echo "Checking how to print long doubles..." >&4
10177 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10178 $cat >try.c <<'EOCP'
10179 #include <sys/types.h>
10182 double d = 123.456;
10183 printf("%.3f\n", d);
10187 if eval $compile; then
10191 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10192 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10193 echo "We will use %f."
10199 if $test X"$sPRIfldbl" = X; then
10200 $cat >try.c <<'EOCP'
10201 #include <sys/types.h>
10204 long double d = 123.456;
10205 printf("%.3Lf\n", d);
10209 if eval $compile; then
10213 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10214 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10215 echo "We will use %Lf."
10221 if $test X"$sPRIfldbl" = X; then
10222 $cat >try.c <<'EOCP'
10223 #include <sys/types.h>
10226 long double d = 123.456;
10227 printf("%.3llf\n", d);
10231 if eval $compile; then
10235 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10236 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10237 echo "We will use %llf."
10243 if $test X"$sPRIfldbl" = X; then
10244 $cat >try.c <<'EOCP'
10245 #include <sys/types.h>
10248 long double d = 123.456;
10249 printf("%.3lf\n", d);
10253 if eval $compile; then
10257 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10258 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10259 echo "We will use %lf."
10265 if $test X"$sPRIfldbl" = X; then
10266 echo "Cannot figure out how to print long doubles." >&4
10268 sSCNfldbl=$sPRIfldbl # expect consistency
10275 case "$sPRIfldbl" in
10276 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10277 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10278 d_SCNfldbl="$undef";
10280 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10281 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10282 d_SCNfldbl="$define";
10286 : Before committing on uselongdouble, see whether that looks sane.
10287 if $test "$uselongdouble" = "$define"; then
10290 echo "Checking if your long double math functions work right..." >&4
10295 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10298 case "$osname:$gccversion" in
10299 aix:) saveccflags="$ccflags"
10300 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10303 if eval $compile_ok; then
10307 3) echo "Your long double math functions are working correctly." >&4 ;;
10308 *) echo "Your long double math functions are broken, not using long doubles." >&4
10309 uselongdouble=$undef
10313 case "$osname:$gccversion" in
10314 aix:) ccflags="$saveccflags" ;; # restore
10318 : Check how to convert floats to strings.
10320 if test "X$d_Gconvert" = X; then
10323 echo "Checking for an efficient way to convert floats to strings."
10325 case "$uselongdouble" in
10326 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10328 case "$d_longdbl" in
10329 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10331 case "$d_PRIgldbl" in
10332 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10335 #ifdef TRY_gconvert
10336 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10337 char *myname = "gconvert";
10340 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10341 char *myname = "gcvt";
10344 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10345 char *myname = "qgcvt";
10346 #define DOUBLETYPE long double
10349 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10350 #ifdef HAS_PRIgldbl
10351 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10353 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10356 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10358 char *myname = "sprintf";
10362 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10363 #define DOUBLETYPE long double
10365 #define DOUBLETYPE double
10371 #$i_stdlib I_STDLIB
10373 #include <stdlib.h>
10375 #$i_string I_STRING
10377 # include <string.h>
10379 # include <strings.h>
10382 int checkit(char *expect, char *got)
10384 if (strcmp(expect, got)) {
10385 printf("%s oddity: Expected %s, got %s\n",
10386 myname, expect, got);
10396 /* This must be 1st test on (which?) platform */
10397 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10398 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10399 checkit("0.1", buf);
10401 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10402 checkit("0.01", buf);
10404 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10405 checkit("0.001", buf);
10407 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10408 checkit("0.0001", buf);
10410 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10411 if (strlen(buf) > 5)
10412 checkit("9e-005", buf); /* for Microsoft ?? */
10414 checkit("9e-05", buf);
10416 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10419 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10420 checkit("1.1", buf);
10422 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10423 checkit("1.01", buf);
10425 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10426 checkit("1.001", buf);
10428 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10429 checkit("1.0001", buf);
10431 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10432 checkit("1.00001", buf);
10434 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10435 checkit("1.000001", buf);
10437 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10440 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10441 checkit("-1", buf);
10443 /* Some Linux gcvt's give 1.e+5 here. */
10444 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10445 checkit("100000", buf);
10447 /* Some Linux gcvt's give -1.e+5 here. */
10448 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10449 checkit("-100000", buf);
10451 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10452 checkit("123.456", buf);
10454 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10455 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10456 /* 34 should be enough to scare even long double
10457 * places into using the e notation. */
10458 if (strlen(buf) > 5)
10459 checkit("1e+034", buf); /* for Microsoft */
10461 checkit("1e+34", buf);
10463 /* For Perl, if you add additional tests here, also add them to
10464 * t/base/num.t for benefit of platforms not using Configure or
10465 * overriding d_Gconvert */
10470 : first add preferred functions to our list
10472 for xxx_convert in $gconvert_preference; do
10473 case $xxx_convert in
10474 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10475 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10478 : then add any others
10479 for xxx_convert in gconvert gcvt sprintf; do
10480 case "$xxx_list" in
10482 *) xxx_list="$xxx_list $xxx_convert" ;;
10486 case "$d_longdbl$uselongdouble" in
10488 : again, add preferred functions to our list first
10490 for xxx_convert in $gconvert_ld_preference; do
10491 case $xxx_convert in
10492 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10493 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10496 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10497 for xxx_convert in qgcvt sprintf $xxx_list; do
10498 case "$xxx_ld_list" in
10499 $xxx_convert*|*" $xxx_convert"*) ;;
10500 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10503 : if sprintf cannot do long doubles, move it to the end
10504 if test "$d_PRIgldbl" != "$define"; then
10505 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10507 : if no qgcvt, remove it
10508 if test "$d_qgcvt" != "$define"; then
10509 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10512 xxx_list="$xxx_ld_list"
10516 for xxx_convert in $xxx_list; do
10517 echo "Trying $xxx_convert..."
10518 $rm -f try try$_o core
10519 set try -DTRY_$xxx_convert
10520 if eval $compile; then
10521 echo "$xxx_convert() found." >&4
10522 if $run ./try; then
10523 echo "I'll use $xxx_convert to convert floats into a string." >&4
10526 echo "...But $xxx_convert didn't work as I expected."
10530 echo "$xxx_convert NOT found." >&4
10534 if test X$xxx_convert = X; then
10535 echo "*** WHOA THERE!!! ***" >&4
10536 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10537 xxx_convert=sprintf
10540 case "$xxx_convert" in
10541 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10542 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10543 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10544 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10545 "$define$define$define")
10546 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10547 "$define$define$undef")
10548 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10549 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10557 : see if _fwalk exists
10561 : Initialize h_fcntl
10564 : Initialize h_sysfile
10567 : access call always available on UNIX
10568 set access d_access
10571 : locate the flags for 'access()'
10572 case "$d_access" in
10575 $cat >access.c <<EOCP
10576 #include <sys/types.h>
10581 #include <sys/file.h>
10584 #include <unistd.h>
10586 #$i_stdlib I_STDLIB
10588 #include <stdlib.h>
10594 : check sys/file.h first, no particular reason here
10595 if $test `./findhdr sys/file.h` && \
10596 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10598 echo "<sys/file.h> defines the *_OK access constants." >&4
10599 elif $test `./findhdr fcntl.h` && \
10600 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10602 echo "<fcntl.h> defines the *_OK access constants." >&4
10603 elif $test `./findhdr unistd.h` && \
10604 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10605 echo "<unistd.h> defines the *_OK access constants." >&4
10607 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10613 : see if accessx exists
10614 set accessx d_accessx
10617 : see if acosh exists
10621 : see if aintl exists
10625 : see if alarm exists
10629 : see if 64bit time functions exists
10631 set ctime64 d_ctime64
10634 set localtime64 d_localtime64
10637 set gmtime64 d_gmtime64
10640 set mktime64 d_mktime64
10643 set difftime64 d_difftime64
10646 set asctime64 d_asctime64
10649 : see if POSIX threads are available
10650 set pthread.h i_pthread
10653 : define a function to check prototypes
10654 $cat > protochk <<EOSH
10657 optimize="$optimize"
10659 prototype="$prototype"
10662 usethreads=$usethreads
10663 i_pthread=$i_pthread
10664 pthread_h_first=$pthread_h_first
10667 $cat >> protochk <<'EOSH'
10672 while test $# -ge 2; do
10674 $define) echo "#include <$2>" >> try.c ;;
10675 literal) echo "$2" >> try.c ;;
10677 # Extra magic for the benefit of systems that need pthread.h
10678 # to be included early to correctly detect threadsafe functions.
10679 # Such functions must guarantee themselves, though, that the usethreads
10680 # and i_pthread have been defined, before calling protochk.
10681 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10682 echo "#include <pthread.h>" >> try.c
10687 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10688 cat >> try.c <<'EOCP'
10689 #ifdef CAN_PROTOTYPE
10690 #define _(args) args
10695 echo "$foo" >> try.c
10696 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10697 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10703 $eunicefix protochk
10705 : Define hasproto macro for Configure internal use
10706 hasproto='varname=$1; func=$2; shift; shift;
10707 while $test $# -ge 2; do
10709 $define) echo "#include <$2>";;
10713 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10714 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10715 echo "$func() prototype found.";
10718 echo "$func() prototype NOT found.";
10725 : see if sys/types.h has to be included
10726 set sys/types.h i_systypes
10729 : see if sys/select.h has to be included
10730 set sys/select.h i_sysselct
10733 : Define hasfield macro for Configure internal use
10734 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10735 while $test $# -ge 2; do
10737 $define) echo "#include <$2>";;
10741 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10743 if eval $compile; then
10752 : see if we should include time.h, sys/time.h, or both
10754 if test "X$timeincl" = X; then
10755 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10756 $echo $n "I'm now running the test program...$c"
10758 #include <sys/types.h>
10763 #ifdef SYSTIMEKERNEL
10766 #include <sys/time.h>
10769 #include <sys/select.h>
10771 #$i_stdlib I_STDLIB
10773 #include <stdlib.h>
10779 struct timeval bar;
10782 struct timezone tzp;
10784 if (foo.tm_sec == foo.tm_sec)
10787 if (bar.tv_sec == bar.tv_sec)
10794 for s_timezone in '-DS_TIMEZONE' ''; do
10796 for s_timeval in '-DS_TIMEVAL' ''; do
10797 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10798 for i_time in '' '-DI_TIME'; do
10799 for i_systime in '-DI_SYSTIME' ''; do
10802 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10803 if eval $compile; then
10804 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10808 $echo $n "Succeeded with $flags$c"
10820 *SYSTIMEKERNEL*) i_systimek="$define"
10821 timeincl=`./findhdr sys/time.h`
10822 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10823 *) i_systimek="$undef";;
10826 *I_TIME*) i_time="$define"
10827 timeincl=`./findhdr time.h`" $timeincl"
10828 echo "We'll include <time.h>." >&4;;
10829 *) i_time="$undef";;
10832 *I_SYSTIME*) i_systime="$define"
10833 timeincl=`./findhdr sys/time.h`" $timeincl"
10834 echo "We'll include <sys/time.h>." >&4;;
10835 *) i_systime="$undef";;
10839 : see if struct tm knows about tm_zone
10840 case "$i_systime$i_time" in
10843 echo "Checking to see if your struct tm has tm_zone field..." >&4
10844 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10852 case "$d_tm_tm_zone" in
10853 "$define") echo "Yes, it does." ;;
10854 *) echo "No, it doesn't." ;;
10856 : see if struct tm knows about tm_gmtoff
10857 case "$i_systime$i_time" in
10860 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10861 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10869 case "$d_tm_tm_gmtoff" in
10870 "$define") echo "Yes, it does." ;;
10871 *) echo "No, it doesn't." ;;
10874 : see if asctime_r exists
10875 set asctime_r d_asctime_r
10877 case "$d_asctime_r" in
10879 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10880 case "$d_asctime_r_proto:$usethreads" in
10881 ":define") d_asctime_r_proto=define
10882 set d_asctime_r_proto asctime_r $hdrs
10886 case "$d_asctime_r_proto" in
10888 case "$asctime_r_proto" in
10889 ''|0) try='char* asctime_r(const struct tm*, char*);'
10890 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10892 case "$asctime_r_proto" in
10893 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10894 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10896 case "$asctime_r_proto" in
10897 ''|0) try='int asctime_r(const struct tm*, char*);'
10898 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10900 case "$asctime_r_proto" in
10901 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10902 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10904 case "$asctime_r_proto" in
10905 ''|0) d_asctime_r=undef
10907 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10908 * ) case "$asctime_r_proto" in
10909 REENTRANT_PROTO*) ;;
10910 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10912 echo "Prototype: $try" ;;
10915 *) case "$usethreads" in
10916 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10923 *) asctime_r_proto=0
10927 : see if asinh exists
10931 : see if atanh exists
10935 : see if atolf exists
10939 : see if atoll exists
10943 : Look for GCC-style attribute format
10944 case "$d_attribute_format" in
10947 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10948 $cat >attrib.c <<'EOCP'
10950 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10952 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10953 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10954 echo "Your C compiler doesn't support __attribute__((format))."
10957 echo "Your C compiler supports __attribute__((format))."
10961 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10965 *) val="$d_attribute_format" ;;
10967 set d_attribute_format
10971 : Look for GCC-style attribute format with null format allowed
10972 case "$d_printf_format_null" in
10973 '') case "$d_attribute_format" in
10976 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10977 $cat >attrib.c <<EOCP
10979 #$i_stdlib I_STDLIB
10981 #include <stdlib.h>
10983 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10984 int null_printf (char* pat,...) { return (int)pat; }
10985 int main () { exit(null_printf(NULL)); }
10987 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10988 : run the executable in case it produces a run-time warning
10989 if $run ./attrib >>attrib.out 2>&1; then
10990 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10991 echo "Your C compiler doesn't allow __printf__ format to be null."
10994 echo "Your C compiler allows __printf__ format to be null."
10998 echo "Your C compiler executable failed with __printf__ format null."
11002 echo "Your C compiler fails with __printf__ format null."
11009 *) val="$d_printf_format_null" ;;
11011 set d_printf_format_null
11015 : Look for GCC-style attribute malloc
11016 case "$d_attribute_malloc" in
11019 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11020 $cat >attrib.c <<'EOCP'
11022 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11024 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11025 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11026 echo "Your C compiler doesn't support __attribute__((malloc))."
11029 echo "Your C compiler supports __attribute__((malloc))."
11033 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11037 *) val="$d_attribute_malloc" ;;
11039 set d_attribute_malloc
11043 : Look for GCC-style attribute nonnull
11044 case "$d_attribute_nonnull" in
11047 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11048 $cat >attrib.c <<'EOCP'
11050 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11052 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11053 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11054 echo "Your C compiler doesn't support __attribute__((nonnull))."
11057 echo "Your C compiler supports __attribute__((nonnull))."
11061 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11065 *) val="$d_attribute_nonnull" ;;
11067 set d_attribute_nonnull
11071 : Look for GCC-style attribute noreturn
11072 case "$d_attribute_noreturn" in
11075 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11076 $cat >attrib.c <<'EOCP'
11078 void fall_over_dead( void ) __attribute__((noreturn));
11080 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11081 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11082 echo "Your C compiler doesn't support __attribute__((noreturn))."
11085 echo "Your C compiler supports __attribute__((noreturn))."
11089 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11093 *) val="$d_attribute_noreturn" ;;
11095 set d_attribute_noreturn
11099 : Look for GCC-style attribute pure
11100 case "$d_attribute_pure" in
11103 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11104 $cat >attrib.c <<'EOCP'
11106 int square( int n ) __attribute__((pure));
11108 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11109 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11110 echo "Your C compiler doesn't support __attribute__((pure))."
11113 echo "Your C compiler supports __attribute__((pure))."
11117 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11121 *) val="$d_attribute_pure" ;;
11123 set d_attribute_pure
11127 : Look for GCC-style attribute unused
11128 case "$d_attribute_unused" in
11131 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11132 $cat >attrib.c <<'EOCP'
11134 int do_something( int dummy __attribute__((unused)), int n );
11136 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11137 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11138 echo "Your C compiler doesn't support __attribute__((unused))."
11141 echo "Your C compiler supports __attribute__((unused))."
11145 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11149 *) val="$d_attribute_unused" ;;
11151 set d_attribute_unused
11155 : Look for GCC-style attribute deprecated
11156 case "$d_attribute_deprecated" in
11159 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11160 $cat >attrib.c <<'EOCP'
11162 int I_am_deprecated(void) __attribute__((deprecated));
11164 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11165 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11166 echo "Your C compiler doesn't support __attribute__((deprecated))."
11169 echo "Your C compiler supports __attribute__((deprecated))."
11173 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11177 *) val="$d_attribute_deprecated" ;;
11179 set d_attribute_deprecated
11183 : Look for GCC-style attribute warn_unused_result
11184 case "$d_attribute_warn_unused_result" in
11187 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11188 $cat >attrib.c <<'EOCP'
11190 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11192 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11193 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11194 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11197 echo "Your C compiler supports __attribute__((warn_unused_result))."
11201 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11205 *) val="$d_attribute_warn_unused_result" ;;
11207 set d_attribute_warn_unused_result
11211 : see if bcmp exists
11215 : see if bcopy exists
11219 : see if getpgrp exists
11220 set getpgrp d_getpgrp
11223 case "$d_getpgrp" in
11226 echo "Checking to see which flavor of getpgrp is in use..."
11228 #$i_unistd I_UNISTD
11229 #include <sys/types.h>
11231 # include <unistd.h>
11233 #$i_stdlib I_STDLIB
11235 #include <stdlib.h>
11239 if (getuid() == 0) {
11240 printf("(I see you are running Configure as super-user...)\n");
11243 #ifdef TRY_BSD_PGRP
11244 if (getpgrp(1) == 0)
11253 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11254 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11256 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11257 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11260 echo "I can't seem to compile and run the test program."
11262 xxx="a USG one, i.e. you use getpgrp()."
11264 # SVR4 systems can appear rather BSD-ish.
11265 case "$i_unistd" in
11267 xxx="a BSD one, i.e. you use getpgrp(pid)."
11271 xxx="probably a USG one, i.e. you use getpgrp()."
11276 echo "Assuming your getpgrp is $xxx" >&4
11285 : see if setpgrp exists
11286 set setpgrp d_setpgrp
11289 case "$d_setpgrp" in
11292 echo "Checking to see which flavor of setpgrp is in use..."
11294 #$i_unistd I_UNISTD
11295 #include <sys/types.h>
11297 # include <unistd.h>
11299 #$i_stdlib I_STDLIB
11301 #include <stdlib.h>
11305 if (getuid() == 0) {
11306 printf("(I see you are running Configure as super-user...)\n");
11309 #ifdef TRY_BSD_PGRP
11310 if (-1 == setpgrp(1, 1))
11313 if (setpgrp() != -1)
11319 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11320 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11322 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11323 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11326 echo "(I can't seem to compile and run the test program.)"
11328 xxx="a USG one, i.e. you use setpgrp()."
11330 # SVR4 systems can appear rather BSD-ish.
11331 case "$i_unistd" in
11333 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11337 xxx="probably a USG one, i.e. you use setpgrp()."
11342 echo "Assuming your setpgrp is $xxx" >&4
11351 : Look for GCC-style __builtin_choose_expr
11352 case "$d_builtin_choose_expr" in
11355 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11356 $cat >try.c <<'EOCP'
11357 #include <assert.h>
11358 #include <stdlib.h>
11361 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11364 assert( SYRINX(1) == 2112 );
11365 assert( SYRINX(1) != 5150 );
11366 assert( SYRINX(0) == 5150 );
11367 assert( SYRINX(0) != 2112 );
11368 puts( "All good!" );
11374 if eval $compile && $run ./try; then
11375 echo "Your C compiler supports __builtin_choose_expr."
11378 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11382 *) val="$d_builtin_choose_expr" ;;
11385 set d_builtin_choose_expr
11389 : Look for GCC-style __builtin_expect
11390 case "$d_builtin_expect" in
11393 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11394 $cat >try.c <<'EOCP'
11397 if ( __builtin_expect(n, 0) ) n = 1;
11398 /* Remember shell exit code truth is 0, C truth is non-zero */
11403 if eval $compile && $run ./try; then
11404 echo "Your C compiler supports __builtin_expect."
11407 echo "Your C compiler doesn't seem to understand __builtin_expect."
11411 *) val="$d_builtin_expect" ;;
11414 set d_builtin_expect
11418 : see if bzero exists
11422 : see if stdarg is available
11424 if $test `./findhdr stdarg.h`; then
11425 echo "<stdarg.h> found." >&4
11428 echo "<stdarg.h> NOT found." >&4
11432 : see if varargs is available
11434 if $test `./findhdr varargs.h`; then
11435 echo "<varargs.h> found." >&4
11437 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11440 : set up the varargs testing programs
11441 $cat > varargs.c <<EOP
11443 #include <stdarg.h>
11446 #include <varargs.h>
11450 int f(char *p, ...)
11464 p = va_arg(ap, char *);
11470 $cat > varargs <<EOP
11472 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11481 : now check which varargs header should be included
11487 if `./varargs I_STDARG`; then
11489 elif `./varargs I_VARARGS`; then
11494 if `./varargs I_VARARGS`; then
11502 echo "*** WHOA THERE!!! ***" >&4
11503 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11504 case "$knowitall" in
11506 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11510 echo "I could not find the definition for va_dcl... You have problems..." >&4
11511 val="$undef"; set i_stdarg; eval $setvar
11512 val="$undef"; set i_varargs; eval $setvar
11517 case "$i_varhdr" in
11519 val="$define"; set i_stdarg; eval $setvar
11520 val="$undef"; set i_varargs; eval $setvar
11523 val="$undef"; set i_stdarg; eval $setvar
11524 val="$define"; set i_varargs; eval $setvar
11527 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11531 : see if the Compiler supports C99 variadic macros
11532 case "$i_stdarg$i_stdlib" in
11534 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11537 #include <stdarg.h>
11539 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11543 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11549 if eval $compile && $run ./try 2>&1 >/dev/null; then
11550 case "`$run ./try`" in
11552 echo "You have C99 variadic macros." >&4
11553 d_c99_variadic_macros="$define"
11556 echo "You don't have functional C99 variadic macros." >&4
11557 d_c99_variadic_macros="$undef"
11561 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11562 d_c99_variadic_macros="$undef"
11567 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11568 d_c99_variadic_macros="$undef"
11572 : see if signal is declared as pointer to function returning int or void
11574 xxx=`./findhdr signal.h`
11575 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11576 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11577 echo "You have int (*signal())() instead of void." >&4
11579 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11580 echo "You have void (*signal())()." >&4
11582 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11583 echo "You have int (*signal())() instead of void." >&4
11585 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11586 echo "You have void (*signal())()." >&4
11589 case "$d_voidsig" in
11591 echo "I can't determine whether signal handler returns void or int..." >&4
11593 rp="What type does your signal handler return?"
11596 v*) val="$define";;
11600 echo "As you already told me, signal handler returns void." >&4
11603 *) echo "As you already told me, signal handler returns int." >&4
11610 case "$d_voidsig" in
11611 "$define") signal_t="void";;
11612 *) signal_t="int";;
11616 : check for ability to cast large floats to 32-bit ints.
11618 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11619 if $test "$intsize" -ge 4; then
11626 #$i_stdlib I_STDLIB
11628 #include <stdlib.h>
11630 #include <sys/types.h>
11631 #include <signal.h>
11632 $signal_t blech(int s) { exit(3); }
11639 signal(SIGFPE, blech);
11641 /* Don't let compiler optimize the test away. Store the number
11642 in a writable string for gcc to pass to sscanf under HP-UX.
11644 sprintf(str, "2147483647");
11645 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11649 /* x86 processors will probably give 0x8000 0000, which is a
11650 sign change. We don't want that. We want to mimic SPARC
11651 behavior here, which is to preserve the sign and give
11654 if (i32 != ($xxx) f)
11660 if eval $compile_ok; then
11661 $run ./try 2>/dev/null
11664 echo "(I can't seem to compile the test program--assuming it can't)"
11669 echo "Yup, it can."
11672 echo "Nope, it can't."
11679 : check for ability to cast negative floats to unsigned
11681 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11684 #$i_stdlib I_STDLIB
11686 #include <stdlib.h>
11688 #include <sys/types.h>
11689 #include <signal.h>
11690 $signal_t blech(int s) { exit(7); }
11691 $signal_t blech_in_list(int s) { exit(4); }
11692 unsigned long dummy_long(unsigned long p) { return p; }
11693 unsigned int dummy_int(unsigned int p) { return p; }
11694 unsigned short dummy_short(unsigned short p) { return p; }
11698 unsigned long along;
11700 unsigned short ashort;
11704 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11705 a direct f = -123. assignment. gcc-2.8.0 reportedly
11706 optimized the whole file away
11708 /* Store the number in a writable string for gcc to pass to
11709 sscanf under HP-UX.
11711 sprintf(str, "-123");
11712 sscanf(str, "%lf", &f); /* f = -123.; */
11714 signal(SIGFPE, blech);
11715 along = (unsigned long)f;
11716 aint = (unsigned int)f;
11717 ashort = (unsigned short)f;
11718 if (along != (unsigned long)-123)
11720 if (aint != (unsigned int)-123)
11722 if (ashort != (unsigned short)-123)
11724 sprintf(str, "1073741824.");
11725 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11728 along = (unsigned long)f;
11729 if (along != 0x80000000)
11733 along = (unsigned long)f;
11734 if (along != 0x7fffffff)
11738 along = (unsigned long)f;
11739 if (along != 0x80000001)
11743 signal(SIGFPE, blech_in_list);
11744 sprintf(str, "123.");
11745 sscanf(str, "%lf", &f); /* f = 123.; */
11746 along = dummy_long((unsigned long)f);
11747 aint = dummy_int((unsigned int)f);
11748 ashort = dummy_short((unsigned short)f);
11749 if (along != (unsigned long)123)
11751 if (aint != (unsigned int)123)
11753 if (ashort != (unsigned short)123)
11760 if eval $compile_ok; then
11761 $run ./try 2>/dev/null
11764 echo "(I can't seem to compile the test program--assuming it can't)"
11767 case "$castflags" in
11769 echo "Yup, it can."
11772 echo "Nope, it can't."
11779 : see if cbrt exists
11783 : see if vprintf exists
11785 if set vprintf val -f d_vprintf; eval $csym; $val; then
11786 echo 'vprintf() found.' >&4
11789 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11790 #$i_varargs I_VARARGS
11792 #$i_stdlib I_STDLIB
11793 #$i_unistd I_UNISTD
11796 # include <stdarg.h>
11797 #else /* I_VARARGS */
11798 # include <varargs.h>
11802 # include <unistd.h>
11806 # include <stdlib.h>
11809 #include <stdio.h> /* vsprintf prototype */
11812 void xxx(int n, ...)
11817 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11819 int main() { xxx(1, "foo"); }
11821 #else /* I_VARARGS */
11829 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11831 int main() { xxx("foo"); }
11837 if eval $compile_ok; then
11838 if $run ./try; then
11839 echo "Your vsprintf() returns (int)." >&4
11842 echo "Your vsprintf() returns (char*)." >&4
11846 echo 'I am unable to compile the vsprintf() test program.' >&4
11847 # We shouldn't get here. If we do, assume the standard signature,
11848 # not the old BSD one.
11849 echo 'Guessing that vsprintf() returns (int).' >&4
11853 echo 'vprintf() NOT found.' >&4
11864 : see if chown exists
11868 : see if chroot exists
11869 set chroot d_chroot
11872 : see if chsize exists
11873 set chsize d_chsize
11876 : see if class exists
11880 : see if clearenv exists
11881 set clearenv d_clearenv
11884 : Define hasstruct macro for Configure internal use
11885 hasstruct='varname=$1; struct=$2; shift; shift;
11886 while $test $# -ge 2; do
11888 $define) echo "#include <$2>";;
11892 echo "int main () { struct $struct foo; }" >> try.c;
11894 if eval $compile; then
11903 : see whether socket exists
11907 $echo $n "Hmm... $c" >&4
11908 if set socket val -f d_socket; eval $csym; $val; then
11909 echo "Looks like you have Berkeley networking support." >&4
11911 if set setsockopt val -f; eval $csym; $val; then
11914 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11915 d_oldsock="$define"
11918 if $contains socklib libc.list >/dev/null 2>&1; then
11919 echo "Looks like you have Berkeley networking support." >&4
11921 : we will have to assume that it supports the 4.2 BSD interface
11924 echo "You don't have Berkeley networking in libc$_a..." >&4
11925 if test "X$d_socket" = "X$define"; then
11926 echo "...but you seem to believe that you have sockets." >&4
11928 for net in net socket
11930 if test -f $sysroot/usr/lib/lib$net$_a; then
11931 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11932 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11933 if $contains socket libc.list >/dev/null 2>&1; then
11938 echo "...but the Wollongong group seems to have hacked it in." >&4
11939 sockethdr="-I$sysroot/usr/netinclude"
11942 echo "Found Berkeley sockets interface in lib$net." >&4
11943 if $contains setsockopt libc.list >/dev/null 2>&1; then
11946 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11947 d_oldsock="$define"
11953 if test "X$d_socket" != "X$define"; then
11954 echo "or anywhere else I see." >&4
11962 : see if socketpair exists
11963 set socketpair d_sockpair
11968 echo "Checking the availability sa_len in the sock struct ..." >&4
11970 #include <sys/types.h>
11971 #include <sys/socket.h>
11973 struct sockaddr sa;
11974 return (sa.sa_len);
11978 set try; if eval $compile; then
11981 set d_sockaddr_sa_len; eval $setvar
11985 echo "Checking the availability struct sockaddr_in6 ..." >&4
11987 #include <sys/types.h>
11988 #include <sys/socket.h>
11989 #include <netinet/in.h>
11991 struct sockaddr_in6 sin6;
11992 return (sin6.sin6_family);
11996 set try; if eval $compile; then
11999 set d_sockaddr_in6; eval $setvar
12003 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12005 #include <sys/types.h>
12006 #include <sys/socket.h>
12007 #include <netinet/in.h>
12009 struct sockaddr_in6 sin6;
12010 return (sin6.sin6_scope_id);
12014 set try; if eval $compile; then
12017 set d_sin6_scope_id; eval $setvar
12021 echo "Checking the availability struct ip_mreq ..." >&4
12023 #include <sys/types.h>
12024 #include <sys/socket.h>
12025 #include <netinet/in.h>
12027 struct ip_mreq mreq;
12028 return (mreq.imr_multiaddr.s_addr);
12032 set try; if eval $compile; then
12035 set d_ip_mreq; eval $setvar
12039 echo "Checking the availability struct ip_mreq_source ..." >&4
12041 #include <sys/types.h>
12042 #include <sys/socket.h>
12043 #include <netinet/in.h>
12045 struct ip_mreq_source mreq;
12046 return (mreq.imr_multiaddr.s_addr);
12050 set try; if eval $compile; then
12053 set d_ip_mreq_source; eval $setvar
12057 echo "Checking the availability struct ipv6_mreq ..." >&4
12059 #include <sys/types.h>
12060 #include <sys/socket.h>
12061 #include <netinet/in.h>
12063 struct ipv6_mreq mreq;
12064 return (mreq.ipv6mr_interface);
12068 set try; if eval $compile; then
12071 set d_ipv6_mreq; eval $setvar
12075 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12077 #include <sys/types.h>
12078 #include <sys/socket.h>
12079 #include <netinet/in.h>
12081 struct ipv6_mreq_source mreq;
12082 return (mreq.imr_multiaddr.s_addr);
12086 set try; if eval $compile; then
12089 set d_ipv6_mreq_source; eval $setvar
12093 echo "Checking the availability of certain socket constants..." >&4
12094 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12095 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12097 #include <sys/types.h>
12098 #include <sys/socket.h>
12104 set try; if eval $compile; then
12107 set d_${enum}; eval $setvar
12111 : see if this is a sys/uio.h system
12112 set sys/uio.h i_sysuio
12115 : Check for cmsghdr support
12117 echo "Checking to see if your system supports struct cmsghdr..." >&4
12118 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12120 case "$d_cmsghdr_s" in
12121 "$define") echo "Yes, it does." ;;
12122 *) echo "No, it doesn't." ;;
12126 : check for const keyword
12128 echo 'Checking to see if your C compiler knows about "const"...' >&4
12129 $cat >const.c <<'EOCP'
12130 typedef struct spug { int drokk; } spug;
12134 const spug y = { 0 };
12137 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12139 echo "Yup, it does."
12142 echo "Nope, it doesn't."
12147 : see if copysign exists
12148 set copysign d_copysign
12151 : see if copysignl exists
12152 set copysignl d_copysignl
12155 : see if crypt exists
12160 $define) cryptlib='' ;;
12161 *) if set crypt val -f d_crypt; eval $csym; $val; then
12162 echo 'crypt() found.' >&4
12166 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12167 if $test -z "$cryptlib"; then
12168 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12172 if $test -z "$cryptlib"; then
12173 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12177 if $test -z "$cryptlib"; then
12178 cryptlib=`./loc libcrypt$_a "" $libpth`
12182 if $test -z "$cryptlib"; then
12183 echo 'crypt() NOT found.' >&4
12194 : see if this is a crypt.h system
12195 set crypt.h i_crypt
12198 : see if crypt_r exists
12199 set crypt_r d_crypt_r
12201 case "$d_crypt_r" in
12203 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12204 case "$d_crypt_r_proto:$usethreads" in
12205 ":define") d_crypt_r_proto=define
12206 set d_crypt_r_proto crypt_r $hdrs
12210 case "$d_crypt_r_proto" in
12212 case "$crypt_r_proto" in
12213 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12214 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12216 case "$crypt_r_proto" in
12217 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12218 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12220 case "$crypt_r_proto" in
12221 ''|0) d_crypt_r=undef
12223 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12224 * ) case "$crypt_r_proto" in
12225 REENTRANT_PROTO*) ;;
12226 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12228 echo "Prototype: $try" ;;
12231 *) case "$usethreads" in
12232 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12243 : get csh whereabouts
12245 'csh') val="$undef" ;;
12246 *) val="$define" ;;
12250 : Respect a hint or command line value for full_csh.
12251 case "$full_csh" in
12252 '') full_csh=$csh ;;
12255 : see if ctermid exists
12256 set ctermid d_ctermid
12259 : see if ctermid_r exists
12260 set ctermid_r d_ctermid_r
12262 case "$d_ctermid_r" in
12264 hdrs="$i_systypes sys/types.h define stdio.h "
12265 case "$d_ctermid_r_proto:$usethreads" in
12266 ":define") d_ctermid_r_proto=define
12267 set d_ctermid_r_proto ctermid_r $hdrs
12271 case "$d_ctermid_r_proto" in
12273 case "$ctermid_r_proto" in
12274 ''|0) try='char* ctermid_r(char*);'
12275 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12277 case "$ctermid_r_proto" in
12278 ''|0) d_ctermid_r=undef
12280 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12281 * ) case "$ctermid_r_proto" in
12282 REENTRANT_PROTO*) ;;
12283 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12285 echo "Prototype: $try" ;;
12288 *) case "$usethreads" in
12289 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12296 *) ctermid_r_proto=0
12300 : see if ctime_r exists
12301 set ctime_r d_ctime_r
12303 case "$d_ctime_r" in
12305 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12306 case "$d_ctime_r_proto:$usethreads" in
12307 ":define") d_ctime_r_proto=define
12308 set d_ctime_r_proto ctime_r $hdrs
12312 case "$d_ctime_r_proto" in
12314 case "$ctime_r_proto" in
12315 ''|0) try='char* ctime_r(const time_t*, char*);'
12316 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12318 case "$ctime_r_proto" in
12319 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12320 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12322 case "$ctime_r_proto" in
12323 ''|0) try='int ctime_r(const time_t*, char*);'
12324 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12326 case "$ctime_r_proto" in
12327 ''|0) try='int ctime_r(const time_t*, char*, int);'
12328 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12330 case "$ctime_r_proto" in
12331 ''|0) d_ctime_r=undef
12333 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12334 * ) case "$ctime_r_proto" in
12335 REENTRANT_PROTO*) ;;
12336 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12338 echo "Prototype: $try" ;;
12341 *) case "$usethreads" in
12342 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12353 : see if cuserid exists
12354 set cuserid d_cuserid
12357 : see if this is a limits.h system
12358 set limits.h i_limits
12361 : See if number of significant digits in a double precision number is known
12363 $cat >dbl_dig.c <<EOM
12364 #$i_limits I_LIMITS
12367 #include <limits.h>
12373 printf("Contains DBL_DIG");
12376 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12377 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12378 echo "DBL_DIG found." >&4
12381 echo "DBL_DIG NOT found." >&4
12388 : see if dbm.h is available
12389 : see if dbmclose exists
12390 set dbmclose d_dbmclose
12393 case "$d_dbmclose" in
12403 *) set rpcsvc/dbm.h i_rpcsvcdbm
12408 *) echo "We won't be including <dbm.h>"
12418 : see if prototype for dbminit is available
12420 set d_dbminitproto dbminit $i_dbm dbm.h
12423 : see if difftime exists
12424 set difftime d_difftime
12427 : see if this is a dirent system
12429 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12431 echo "<dirent.h> found." >&4
12434 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12435 echo "<sys/dir.h> found." >&4
12438 xinc=`./findhdr sys/ndir.h`
12440 echo "<dirent.h> NOT found." >&4
12445 : Look for type of directory structure.
12447 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12449 case "$direntrytype" in
12451 case "$i_dirent" in
12452 $define) guess1='struct dirent' ;;
12453 *) guess1='struct direct' ;;
12456 *) guess1="$direntrytype"
12461 'struct dirent') guess2='struct direct' ;;
12462 *) guess2='struct dirent' ;;
12465 if $contains "$guess1" try.c >/dev/null 2>&1; then
12466 direntrytype="$guess1"
12467 echo "Your directory entries are $direntrytype." >&4
12468 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12469 direntrytype="$guess2"
12470 echo "Your directory entries seem to be $direntrytype." >&4
12472 echo "I don't recognize your system's directory entries." >&4
12473 rp="What type is used for directory entries on this system?"
12476 direntrytype="$ans"
12480 : see if the directory entry stores field length
12482 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12483 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12484 echo "Good, your directory entry keeps length information in d_namlen." >&4
12487 echo "Your directory entry does not know about the d_namlen field." >&4
12494 : Look for DIR.dd_fd
12495 case "$i_dirent" in
12497 echo "Checking to see if DIR has a dd_fd member variable" >&4
12499 #$i_stdlib I_STDLIB
12501 #include <stdlib.h>
12503 #include <dirent.h>
12513 if eval $compile; then
12514 echo "Yes, it does."
12517 echo "No, it does not."
12522 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12530 : see if this is an sysdir system
12531 set sys/dir.h i_sysdir
12534 : see if this is an sysndir system
12535 set sys/ndir.h i_sysndir
12540 $cat >dirfd.c <<EOM
12542 #$i_stdlib I_STDLIB
12544 #include <stdlib.h>
12546 #$i_dirent I_DIRENT /**/
12547 #$i_sysdir I_SYS_DIR /**/
12548 #$i_sysndir I_SYS_NDIR /**/
12549 #$i_systypes I_SYS_TYPES /**/
12550 #if defined(I_SYS_TYPES)
12551 #include <sys/types.h>
12553 #if defined(I_DIRENT)
12554 #include <dirent.h>
12557 #include <sys/ndir.h>
12561 #include <ndir.h> /* may be wrong in the future */
12563 #include <sys/dir.h>
12569 DIR *dirp = opendir(".");
12570 if (dirfd(dirp) >= 0)
12578 if eval $compile; then
12582 $define) echo "dirfd() found." >&4 ;;
12583 *) echo "dirfd() NOT found." >&4 ;;
12589 : see if dladdr exists
12590 set dladdr d_dladdr
12593 : see if dlerror exists
12596 set dlerror d_dlerror
12600 : see if dlfcn is available
12601 set dlfcn.h i_dlfcn
12604 : Check what extension to use for shared libs
12609 On a few systems, the dynamically loaded modules that perl generates and uses
12610 will need a different extension than shared libs. The default will probably
12616 *) dflt="$dlext" ;;
12618 rp='What is the extension of dynamically loaded modules'
12627 : Check if dlsym need a leading underscore
12633 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12634 $cat >dyna.c <<'EOM'
12641 #$i_stdlib I_STDLIB
12643 #include <stdlib.h>
12647 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12649 #include <sys/types.h>
12654 extern int fred() ;
12663 int mode = RTLD_LAZY ;
12665 handle = dlopen("./dyna.$dlext", mode) ;
12666 if (handle == NULL) {
12671 symbol = dlsym(handle, "fred") ;
12672 if (symbol == NULL) {
12673 /* try putting a leading underscore */
12674 symbol = dlsym(handle, "_fred") ;
12675 if (symbol == NULL) {
12688 : Call the object file tmp-dyna.o in case dlext=o.
12689 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12690 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12691 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12692 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12695 1) echo "Test program failed using dlopen." >&4
12696 echo "Perhaps you should not use dynamic loading." >&4;;
12697 2) echo "Test program failed using dlsym." >&4
12698 echo "Perhaps you should not use dynamic loading." >&4;;
12699 3) echo "dlsym needs a leading underscore" >&4
12701 4) echo "dlsym doesn't need a leading underscore." >&4;;
12704 echo "I can't compile and run the test program." >&4
12705 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12710 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12715 : see if drand48_r exists
12716 set drand48_r d_drand48_r
12718 case "$d_drand48_r" in
12720 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12721 case "$d_drand48_r_proto:$usethreads" in
12722 ":define") d_drand48_r_proto=define
12723 set d_drand48_r_proto drand48_r $hdrs
12727 case "$d_drand48_r_proto" in
12729 case "$drand48_r_proto" in
12730 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12731 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12733 case "$drand48_r_proto" in
12734 ''|0) d_drand48_r=undef
12736 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12737 * ) case "$drand48_r_proto" in
12738 REENTRANT_PROTO*) ;;
12739 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12741 echo "Prototype: $try" ;;
12744 *) case "$usethreads" in
12745 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12752 *) drand48_r_proto=0
12756 : see if prototype for drand48 is available
12758 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12761 : see if dup2 exists
12765 : see if eaccess exists
12766 set eaccess d_eaccess
12769 : see if endgrent exists
12770 set endgrent d_endgrent
12773 : see if this is an grp system
12779 xxx=`./findhdr grp.h`
12780 $cppstdin $cppflags $cppminus < $xxx >$$.h
12782 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12794 set d_grpasswd; eval $setvar
12798 : see if endgrent_r exists
12799 set endgrent_r d_endgrent_r
12801 case "$d_endgrent_r" in
12803 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12804 case "$d_endgrent_r_proto:$usethreads" in
12805 ":define") d_endgrent_r_proto=define
12806 set d_endgrent_r_proto endgrent_r $hdrs
12810 case "$d_endgrent_r_proto" in
12812 case "$endgrent_r_proto" in
12813 ''|0) try='int endgrent_r(FILE**);'
12814 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12816 case "$endgrent_r_proto" in
12817 ''|0) try='void endgrent_r(FILE**);'
12818 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12820 case "$endgrent_r_proto" in
12821 ''|0) d_endgrent_r=undef
12823 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12824 * ) case "$endgrent_r_proto" in
12825 REENTRANT_PROTO*) ;;
12826 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12828 echo "Prototype: $try" ;;
12831 *) case "$usethreads" in
12832 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12839 *) endgrent_r_proto=0
12843 : see if endhostent exists
12844 set endhostent d_endhent
12847 : see if this is a netdb.h system
12848 set netdb.h i_netdb
12851 : see if endhostent_r exists
12852 set endhostent_r d_endhostent_r
12854 case "$d_endhostent_r" in
12856 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12857 case "$d_endhostent_r_proto:$usethreads" in
12858 ":define") d_endhostent_r_proto=define
12859 set d_endhostent_r_proto endhostent_r $hdrs
12863 case "$d_endhostent_r_proto" in
12865 case "$endhostent_r_proto" in
12866 ''|0) try='int endhostent_r(struct hostent_data*);'
12867 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12869 case "$endhostent_r_proto" in
12870 ''|0) try='void endhostent_r(struct hostent_data*);'
12871 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12873 case "$endhostent_r_proto" in
12874 ''|0) d_endhostent_r=undef
12875 endhostent_r_proto=0
12876 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12877 * ) case "$endhostent_r_proto" in
12878 REENTRANT_PROTO*) ;;
12879 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12881 echo "Prototype: $try" ;;
12884 *) case "$usethreads" in
12885 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12887 d_endhostent_r=undef
12888 endhostent_r_proto=0
12892 *) endhostent_r_proto=0
12896 : see if endnetent exists
12897 set endnetent d_endnent
12900 : see if endnetent_r exists
12901 set endnetent_r d_endnetent_r
12903 case "$d_endnetent_r" in
12905 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12906 case "$d_endnetent_r_proto:$usethreads" in
12907 ":define") d_endnetent_r_proto=define
12908 set d_endnetent_r_proto endnetent_r $hdrs
12912 case "$d_endnetent_r_proto" in
12914 case "$endnetent_r_proto" in
12915 ''|0) try='int endnetent_r(struct netent_data*);'
12916 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12918 case "$endnetent_r_proto" in
12919 ''|0) try='void endnetent_r(struct netent_data*);'
12920 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12922 case "$endnetent_r_proto" in
12923 ''|0) d_endnetent_r=undef
12924 endnetent_r_proto=0
12925 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12926 * ) case "$endnetent_r_proto" in
12927 REENTRANT_PROTO*) ;;
12928 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12930 echo "Prototype: $try" ;;
12933 *) case "$usethreads" in
12934 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12936 d_endnetent_r=undef
12937 endnetent_r_proto=0
12941 *) endnetent_r_proto=0
12945 : see if endprotoent exists
12946 set endprotoent d_endpent
12949 : see if endprotoent_r exists
12950 set endprotoent_r d_endprotoent_r
12952 case "$d_endprotoent_r" in
12954 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12955 case "$d_endprotoent_r_proto:$usethreads" in
12956 ":define") d_endprotoent_r_proto=define
12957 set d_endprotoent_r_proto endprotoent_r $hdrs
12961 case "$d_endprotoent_r_proto" in
12963 case "$endprotoent_r_proto" in
12964 ''|0) try='int endprotoent_r(struct protoent_data*);'
12965 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12967 case "$endprotoent_r_proto" in
12968 ''|0) try='void endprotoent_r(struct protoent_data*);'
12969 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12971 case "$endprotoent_r_proto" in
12972 ''|0) d_endprotoent_r=undef
12973 endprotoent_r_proto=0
12974 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12975 * ) case "$endprotoent_r_proto" in
12976 REENTRANT_PROTO*) ;;
12977 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12979 echo "Prototype: $try" ;;
12982 *) case "$usethreads" in
12983 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12985 d_endprotoent_r=undef
12986 endprotoent_r_proto=0
12990 *) endprotoent_r_proto=0
12994 : see if endpwent exists
12995 set endpwent d_endpwent
12998 : see if this is a pwd.h system
13004 xxx=`./findhdr pwd.h`
13005 $cppstdin $cppflags $cppminus < $xxx >$$.h
13007 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13015 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13023 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13031 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13039 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13047 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13055 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13063 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13075 set d_pwquota; eval $setvar
13076 set d_pwage; eval $setvar
13077 set d_pwchange; eval $setvar
13078 set d_pwclass; eval $setvar
13079 set d_pwexpire; eval $setvar
13080 set d_pwcomment; eval $setvar
13081 set d_pwgecos; eval $setvar
13082 set d_pwpasswd; eval $setvar
13086 : see if endpwent_r exists
13087 set endpwent_r d_endpwent_r
13089 case "$d_endpwent_r" in
13091 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13092 case "$d_endpwent_r_proto:$usethreads" in
13093 ":define") d_endpwent_r_proto=define
13094 set d_endpwent_r_proto endpwent_r $hdrs
13098 case "$d_endpwent_r_proto" in
13100 case "$endpwent_r_proto" in
13101 ''|0) try='int endpwent_r(FILE**);'
13102 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13104 case "$endpwent_r_proto" in
13105 ''|0) try='void endpwent_r(FILE**);'
13106 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13108 case "$endpwent_r_proto" in
13109 ''|0) d_endpwent_r=undef
13111 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13112 * ) case "$endpwent_r_proto" in
13113 REENTRANT_PROTO*) ;;
13114 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13116 echo "Prototype: $try" ;;
13119 *) case "$usethreads" in
13120 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13127 *) endpwent_r_proto=0
13131 : see if endservent exists
13132 set endservent d_endsent
13135 : see if endservent_r exists
13136 set endservent_r d_endservent_r
13138 case "$d_endservent_r" in
13140 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13141 case "$d_endservent_r_proto:$usethreads" in
13142 ":define") d_endservent_r_proto=define
13143 set d_endservent_r_proto endservent_r $hdrs
13147 case "$d_endservent_r_proto" in
13149 case "$endservent_r_proto" in
13150 ''|0) try='int endservent_r(struct servent_data*);'
13151 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13153 case "$endservent_r_proto" in
13154 ''|0) try='void endservent_r(struct servent_data*);'
13155 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13157 case "$endservent_r_proto" in
13158 ''|0) d_endservent_r=undef
13159 endservent_r_proto=0
13160 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13161 * ) case "$endservent_r_proto" in
13162 REENTRANT_PROTO*) ;;
13163 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13165 echo "Prototype: $try" ;;
13168 *) case "$usethreads" in
13169 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13171 d_endservent_r=undef
13172 endservent_r_proto=0
13176 *) endservent_r_proto=0
13180 : Locate the flags for 'open()'
13183 #include <sys/types.h>
13188 #include <sys/file.h>
13190 #$i_stdlib I_STDLIB
13192 #include <stdlib.h>
13203 : check sys/file.h first to get FREAD on Sun
13204 if $test `./findhdr sys/file.h` && \
13205 set try -DI_SYS_FILE && eval $compile; then
13207 echo "<sys/file.h> defines the O_* constants..." >&4
13208 if $run ./try; then
13209 echo "and you have the 3 argument form of open()." >&4
13212 echo "but not the 3 argument form of open(). Oh, well." >&4
13215 elif $test `./findhdr fcntl.h` && \
13216 set try -DI_FCNTL && eval $compile; then
13218 echo "<fcntl.h> defines the O_* constants..." >&4
13219 if $run ./try; then
13220 echo "and you have the 3 argument form of open()." >&4
13223 echo "but not the 3 argument form of open(). Oh, well." >&4
13228 echo "I can't find the O_* constant definitions! You got problems." >&4
13234 : see if this is a sys/file.h system
13239 : do we need to include sys/file.h ?
13243 if $h_sysfile; then
13245 echo "We'll be including <sys/file.h>." >&4
13248 echo "We won't be including <sys/file.h>." >&4
13258 : see if fcntl.h is there
13263 : see if we can include fcntl.h
13269 echo "We'll be including <fcntl.h>." >&4
13272 if $h_sysfile; then
13273 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13275 echo "We won't be including <fcntl.h>." >&4
13287 : see if fork exists
13291 : see if pipe exists
13295 : check for non-blocking I/O stuff
13296 case "$h_sysfile" in
13297 true) echo "#include <sys/file.h>" > head.c;;
13300 true) echo "#include <fcntl.h>" > head.c;;
13301 *) echo "#include <sys/fcntl.h>" > head.c;;
13306 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13307 case "$o_nonblock" in
13309 $cat head.c > try.c
13310 $cat >>try.c <<EOCP
13312 #$i_stdlib I_STDLIB
13314 #include <stdlib.h>
13322 printf("O_NONBLOCK\n");
13326 printf("O_NDELAY\n");
13330 printf("FNDELAY\n");
13337 if eval $compile_ok; then
13338 o_nonblock=`$run ./try`
13339 case "$o_nonblock" in
13340 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13341 *) echo "Seems like we can use $o_nonblock.";;
13344 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13347 *) echo "Using $hint value $o_nonblock.";;
13352 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13355 case "$d_fork:$d_pipe:$d_alarm" in
13356 define:define:define)
13357 $cat head.c > try.c
13358 $cat >>try.c <<EOCP
13360 #include <sys/types.h>
13361 #include <signal.h>
13363 #$i_stdlib I_STDLIB
13365 #include <stdlib.h>
13371 #define MY_O_NONBLOCK $o_nonblock
13372 #ifndef errno /* XXX need better Configure test */
13375 #$i_unistd I_UNISTD
13377 #include <unistd.h>
13379 #$i_string I_STRING
13381 #include <string.h>
13383 #include <strings.h>
13385 $signal_t blech(int x) { exit(3); }
13387 $cat >> try.c <<'EOCP'
13396 ret = pipe(pd); /* Down: child -> parent */
13399 ret = pipe(pu); /* Up: parent -> child */
13403 close(pd[1]); /* Parent reads from pd[0] */
13404 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13406 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13411 signal(SIGALRM, blech);
13413 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13415 sprintf(string, "%d\n", ret);
13416 ret = write(2, string, strlen(string));
13417 if (ret != strlen(string))
13421 if (errno == EAGAIN) {
13422 printf("EAGAIN\n");
13427 if (errno == EWOULDBLOCK)
13428 printf("EWOULDBLOCK\n");
13431 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13434 sleep(2); /* Give it time to close our pipe */
13436 ret = read(pd[0], buf, 1); /* Should read EOF */
13438 sprintf(string, "%d\n", ret);
13439 ret = write(4, string, strlen(string));
13440 if (ret != strlen(string))
13445 close(pd[0]); /* We write to pd[1] */
13446 close(pu[1]); /* We read from pu[0] */
13447 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13450 close(pd[1]); /* Pipe pd is now fully closed! */
13451 exit(0); /* Bye bye, thank you for playing! */
13455 if eval $compile_ok; then
13456 echo "$startsh" >mtry
13457 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13459 $run ./mtry >/dev/null 2>&1
13461 0) eagain=`$cat try.out`;;
13462 1) echo "Could not perform non-blocking setting!";;
13463 2) echo "I did a successful read() for something that was not there!";;
13464 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13465 4) echo "Could not find F_SETFL!";;
13466 *) echo "Something terribly wrong happened during testing.";;
13468 rd_nodata=`$cat try.ret`
13469 echo "A read() system call with no data present returns $rd_nodata."
13470 case "$rd_nodata" in
13473 echo "(That's peculiar, fixing that to be -1.)"
13479 echo "Forcing errno EAGAIN on read() with no data available."
13483 echo "Your read() sets errno to $eagain when no data is available."
13486 status=`$cat try.err`
13488 0) echo "And it correctly returns 0 to signal EOF.";;
13489 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13490 *) echo "However, your read() returns '$status' on EOF??";;
13493 if test "$status" = "$rd_nodata"; then
13494 echo "WARNING: you can't distinguish between EOF and no data!"
13498 echo "I can't compile the test program--assuming errno EAGAIN will do."
13502 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13511 echo "Using $hint value $eagain."
13512 echo "Your read() returns $rd_nodata when no data is present."
13513 case "$d_eofnblk" in
13514 "$define") echo "And you can see EOF because read() returns 0.";;
13515 "$undef") echo "But you can't see EOF status from read() returned value.";;
13517 echo "(Assuming you can't see EOF status from read anyway.)"
13523 $rm_try head.c mtry
13525 : see if erf exists
13529 : see if erfc exists
13533 : see if exp2 exists
13537 : see if expm1 exists
13541 : see if _ptr and _cnt from stdio act std
13544 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13545 echo "(Looks like you have stdio.h from BSD.)"
13546 case "$stdio_ptr" in
13547 '') stdio_ptr='((fp)->_p)'
13550 *) ptr_lval=$d_stdio_ptr_lval;;
13552 case "$stdio_cnt" in
13553 '') stdio_cnt='((fp)->_r)'
13556 *) cnt_lval=$d_stdio_cnt_lval;;
13558 case "$stdio_base" in
13559 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13561 case "$stdio_bufsiz" in
13562 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13564 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13565 echo "(Looks like you have stdio.h from Linux.)"
13566 case "$stdio_ptr" in
13567 '') stdio_ptr='((fp)->_IO_read_ptr)'
13570 *) ptr_lval=$d_stdio_ptr_lval;;
13572 case "$stdio_cnt" in
13573 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13576 *) cnt_lval=$d_stdio_cnt_lval;;
13578 case "$stdio_base" in
13579 '') stdio_base='((fp)->_IO_read_base)';;
13581 case "$stdio_bufsiz" in
13582 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13585 case "$stdio_ptr" in
13586 '') stdio_ptr='((fp)->_ptr)'
13589 *) ptr_lval=$d_stdio_ptr_lval;;
13591 case "$stdio_cnt" in
13592 '') stdio_cnt='((fp)->_cnt)'
13595 *) cnt_lval=$d_stdio_cnt_lval;;
13597 case "$stdio_base" in
13598 '') stdio_base='((fp)->_base)';;
13600 case "$stdio_bufsiz" in
13601 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13605 : test whether _ptr and _cnt really work
13606 echo "Checking how std your stdio is..." >&4
13609 #$i_stdlib I_STDLIB
13611 #include <stdlib.h>
13613 #define FILE_ptr(fp) $stdio_ptr
13614 #define FILE_cnt(fp) $stdio_cnt
13616 FILE *fp = fopen("try.c", "r");
13619 18 <= FILE_cnt(fp) &&
13620 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13628 if eval $compile && $to try.c; then
13629 if $run ./try; then
13630 echo "Your stdio acts pretty std."
13633 echo "Your stdio isn't very std."
13636 echo "Your stdio doesn't appear very std."
13640 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13641 # direct buffer manipulation no longer works. The Configure tests
13642 # should be changed to correctly detect this, but until then,
13643 # the following check should at least let perl compile and run.
13644 # (This quick fix should be updated before 5.8.1.)
13645 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13646 # A. Dougherty, June 3, 2002.
13647 case "$d_gnulibc" in
13649 case "$gnulibc_version" in
13653 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13662 : Can _ptr be used as an lvalue?
13663 case "$d_stdstdio$ptr_lval" in
13664 $define$define) val=$define ;;
13667 set d_stdio_ptr_lval
13670 : Can _cnt be used as an lvalue?
13671 case "$d_stdstdio$cnt_lval" in
13672 $define$define) val=$define ;;
13675 set d_stdio_cnt_lval
13679 : test whether setting _ptr sets _cnt as a side effect
13680 d_stdio_ptr_lval_sets_cnt="$undef"
13681 d_stdio_ptr_lval_nochange_cnt="$undef"
13682 case "$d_stdio_ptr_lval$d_stdstdio" in
13684 echo "Checking to see what happens if we set the stdio ptr..." >&4
13687 /* Can we scream? */
13688 /* Eat dust sed :-) */
13689 /* In the buffer space, no one can hear you scream. */
13690 #$i_stdlib I_STDLIB
13692 #include <stdlib.h>
13694 #define FILE_ptr(fp) $stdio_ptr
13695 #define FILE_cnt(fp) $stdio_cnt
13696 #include <sys/types.h>
13698 FILE *fp = fopen("try.c", "r");
13703 puts("Fail even to read");
13706 c = getc(fp); /* Read away the first # */
13708 puts("Fail even to read");
13712 18 <= FILE_cnt(fp) &&
13713 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13715 puts("Fail even to read");
13718 ptr = (char*) FILE_ptr(fp);
13719 cnt = (size_t)FILE_cnt(fp);
13721 FILE_ptr(fp) += 42;
13723 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13724 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13727 if (FILE_cnt(fp) <= 20) {
13728 printf ("Fail (<20 chars to test)");
13731 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13732 puts("Fail compare");
13735 if (cnt == FILE_cnt(fp)) {
13736 puts("Pass_unchanged");
13739 if (FILE_cnt(fp) == (cnt - 42)) {
13740 puts("Pass_changed");
13743 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13749 if eval $compile && $to try.c; then
13750 case `$run ./try` in
13752 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13753 d_stdio_ptr_lval_sets_cnt="$define" ;;
13755 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13756 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13758 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13760 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13763 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13769 : see if _base is also standard
13771 case "$d_stdstdio" in
13775 #$i_stdlib I_STDLIB
13777 #include <stdlib.h>
13779 #define FILE_base(fp) $stdio_base
13780 #define FILE_bufsiz(fp) $stdio_bufsiz
13782 FILE *fp = fopen("try.c", "r");
13785 19 <= FILE_bufsiz(fp) &&
13786 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13793 if eval $compile && $to try.c; then
13794 if $run ./try; then
13795 echo "And its _base field acts std."
13798 echo "But its _base field isn't std."
13801 echo "However, it seems to be lacking the _base field."
13809 : see if fast_stdio exists
13811 case "$d_stdstdio:$d_stdio_ptr_lval" in
13813 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13815 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13826 : see if fchdir exists
13827 set fchdir d_fchdir
13830 : see if fchmod exists
13831 set fchmod d_fchmod
13834 : see if fchown exists
13835 set fchown d_fchown
13838 : see if this is an fcntl system
13842 : See if fcntl-based locking works.
13845 #$i_stdlib I_STDLIB
13847 #include <stdlib.h>
13849 #include <unistd.h>
13851 #include <signal.h>
13852 $signal_t blech(int x) { exit(3); }
13854 #if defined(F_SETLK) && defined(F_SETLKW)
13855 struct flock flock;
13857 fd = open("try.c", O_RDONLY);
13858 flock.l_type = F_RDLCK;
13859 flock.l_whence = SEEK_SET;
13860 flock.l_start = flock.l_len = 0;
13861 signal(SIGALRM, blech);
13863 retval = fcntl(fd, F_SETLK, &flock);
13865 (retval < 0 ? exit(2) : exit(0));
13871 echo "Checking if fcntl-based file locking works... "
13875 if eval $compile_ok; then
13876 if $run ./try; then
13877 echo "Yes, it seems to work."
13880 echo "Nope, it didn't work."
13885 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13886 *** This is (almost) impossible.
13887 *** If your NFS lock daemons are not feeling well, something like
13888 *** this may happen, please investigate. Cannot continue, aborting.
13896 echo "I'm unable to compile the test program, so I'll assume not."
13901 echo "Nope, since you don't even have fcntl()."
13904 set d_fcntl_can_lock
13908 : check for fd_set items
13911 Checking to see how well your C compiler handles fd_set and friends ...
13914 #$i_stdlib I_STDLIB
13916 #include <stdlib.h>
13918 #$i_systime I_SYS_TIME
13919 #$i_sysselct I_SYS_SELECT
13920 #$d_socket HAS_SOCKET
13921 #include <sys/types.h>
13923 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13926 #include <sys/time.h>
13928 #ifdef I_SYS_SELECT
13929 #include <sys/select.h>
13938 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13946 if eval $compile; then
13947 d_fds_bits="$define"
13949 echo "Well, your system knows about the normal fd_set typedef..." >&4
13950 if $run ./try; then
13951 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13952 d_fd_macros="$define"
13955 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13957 d_fd_macros="$undef"
13961 Hmm, your compiler has some difficulty with fd_set. Checking further...
13964 if eval $compile; then
13965 d_fds_bits="$undef"
13967 echo "Well, your system has some sort of fd_set available..." >&4
13968 if $run ./try; then
13969 echo "and you have the normal fd_set macros." >&4
13970 d_fd_macros="$define"
13973 but not the normal fd_set macros! Gross! More work for me...
13975 d_fd_macros="$undef"
13978 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13980 d_fds_bits="$undef"
13981 d_fd_macros="$undef"
13986 : see if fdim exists
13990 : see if fegetround exists
13991 set fegetround d_fegetround
13994 : see if fgetpos exists
13995 set fgetpos d_fgetpos
13998 : see if finite exists
13999 set finite d_finite
14002 : see if finitel exists
14003 set finitel d_finitel
14006 : see if flock exists
14010 : see if prototype for flock is available
14012 set d_flockproto flock $i_sysfile sys/file.h
14015 : see if fma exists
14019 : see if fmax exists
14023 : see if fmin exists
14027 : see if fp_class exists
14028 set fp_class d_fp_class
14031 : see if this is a math.h system
14035 : check for fpclassify
14036 echo "Checking to see if you have fpclassify..." >&4
14042 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14045 if eval $compile; then
14047 echo "You have fpclassify."
14050 echo "You do not have fpclassify."
14056 : see if fp_classify exists
14057 set fp_classify d_fp_classify
14060 : see if fp_classl exists
14061 set fp_classl d_fp_classl
14064 : see if pathconf exists
14065 set pathconf d_pathconf
14068 : see if fpathconf exists
14069 set fpathconf d_fpathconf
14072 : see if fpclass exists
14073 set fpclass d_fpclass
14076 : see if fpclassl exists
14077 set fpclassl d_fpclassl
14080 : see if fpgetround exists
14081 set fpgetround d_fpgetround
14084 : check for fpos64_t
14086 echo "Checking to see if you have fpos64_t..." >&4
14089 int main() { fpos64_t x = 7; }
14092 if eval $compile; then
14094 echo "You have fpos64_t."
14097 echo "You do not have fpos64_t."
14098 case "$fpossize" in
14099 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14106 : see if frexpl exists
14107 set frexpl d_frexpl
14110 : see if this is a sys/param system
14111 set sys/param.h i_sysparam
14114 : see if this is a sys/mount.h system
14115 set sys/mount.h i_sysmount
14118 : Check for fs_data_s
14120 echo "Checking to see if your system supports struct fs_data..." >&4
14121 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14123 case "$d_fs_data_s" in
14124 "$define") echo "Yes, it does." ;;
14125 *) echo "No, it doesn't." ;;
14128 : see if fseeko exists
14129 set fseeko d_fseeko
14131 case "$longsize" in
14132 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14135 : see if fsetpos exists
14136 set fsetpos d_fsetpos
14139 : see if fstatfs exists
14140 set fstatfs d_fstatfs
14143 : see if statvfs exists
14144 set statvfs d_statvfs
14147 : see if fstatvfs exists
14148 set fstatvfs d_fstatvfs
14152 : see if fsync exists
14156 : see if ftello exists
14157 set ftello d_ftello
14159 case "$longsize" in
14160 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14163 : check for a working futimes
14166 echo "Checking if you have a working futimes()" >&4
14169 #include <sys/time.h>
14176 fd = open ("try.c", O_RDWR);
14177 if (-1 == fd) exit (1);
14178 rv = futimes (fd, NULL);
14179 exit (rv == -1 ? errno : 0);
14183 if eval $compile; then
14187 0) echo "Yes, you have" >&4
14188 d_futimes="$define"
14190 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14194 echo "No, it does not (probably harmless)" >&4
14198 : see if ndbm.h is available
14201 : Compatibility location for RedHat 7.1
14202 set gdbm/ndbm.h i_gdbmndbm
14204 : Compatibility location for Debian 4.0
14205 set gdbm-ndbm.h i_gdbm_ndbm
14209 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14210 : see if dbm_open exists
14211 set dbm_open d_dbm_open
14213 case "$d_dbm_open" in
14216 i_gdbmndbm="$undef"
14217 i_gdbm_ndbm="$undef"
14218 echo "We won't be including <ndbm.h>"
14228 ndbm_hdr_protochk='name=$1; hdr=$2;
14229 eval "ihdr=\$""i_$name";
14231 if $test "$ihdr" = "$define"; then
14232 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14233 case "$d_cplusplus" in
14234 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14235 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14238 $define) $echo "Your <$hdr> seems to have prototypes";;
14239 *) $echo "Your <$hdr> does not seem to have prototypes";;
14242 set "d_${name}_h_uses_prototypes";
14246 eval $ndbm_hdr_protochk
14247 set gdbmndbm gdbm/ndbm.h
14248 eval $ndbm_hdr_protochk
14249 set gdbm_ndbm gdbm-ndbm.h
14250 eval $ndbm_hdr_protochk
14252 : see if getaddrinfo exists
14253 set getaddrinfo d_getaddrinfo
14256 : see if getcwd exists
14257 set getcwd d_getcwd
14260 : see if getespwnam exists
14261 set getespwnam d_getespwnam
14264 : see if getfsstat exists
14265 set getfsstat d_getfsstat
14268 : see if getgrent exists
14269 set getgrent d_getgrent
14272 : see if getgrent_r exists
14273 set getgrent_r d_getgrent_r
14275 case "$d_getgrent_r" in
14277 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14278 case "$d_getgrent_r_proto:$usethreads" in
14279 ":define") d_getgrent_r_proto=define
14280 set d_getgrent_r_proto getgrent_r $hdrs
14284 case "$d_getgrent_r_proto" in
14286 case "$getgrent_r_proto" in
14287 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14288 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14290 case "$getgrent_r_proto" in
14291 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14292 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14294 case "$getgrent_r_proto" in
14295 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14296 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14298 case "$getgrent_r_proto" in
14299 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14300 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14302 case "$getgrent_r_proto" in
14303 ''|0) try='int getgrent_r(struct group*, char*, int);'
14304 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14306 case "$getgrent_r_proto" in
14307 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14308 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14310 case "$getgrent_r_proto" in
14311 ''|0) d_getgrent_r=undef
14313 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14314 * ) case "$getgrent_r_proto" in
14315 REENTRANT_PROTO*) ;;
14316 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14318 echo "Prototype: $try" ;;
14321 *) case "$usethreads" in
14322 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14329 *) getgrent_r_proto=0
14333 : see if getgrgid_r exists
14334 set getgrgid_r d_getgrgid_r
14336 case "$d_getgrgid_r" in
14338 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14339 case "$d_getgrgid_r_proto:$usethreads" in
14340 ":define") d_getgrgid_r_proto=define
14341 set d_getgrgid_r_proto getgrgid_r $hdrs
14345 case "$d_getgrgid_r_proto" in
14347 case "$getgrgid_r_proto" in
14348 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14349 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14351 case "$getgrgid_r_proto" in
14352 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14353 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14355 case "$getgrgid_r_proto" in
14356 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14357 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14359 case "$getgrgid_r_proto" in
14360 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14361 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14363 case "$getgrgid_r_proto" in
14364 ''|0) d_getgrgid_r=undef
14366 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14367 * ) case "$getgrgid_r_proto" in
14368 REENTRANT_PROTO*) ;;
14369 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14371 echo "Prototype: $try" ;;
14374 *) case "$usethreads" in
14375 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14382 *) getgrgid_r_proto=0
14386 : see if getgrnam_r exists
14387 set getgrnam_r d_getgrnam_r
14389 case "$d_getgrnam_r" in
14391 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14392 case "$d_getgrnam_r_proto:$usethreads" in
14393 ":define") d_getgrnam_r_proto=define
14394 set d_getgrnam_r_proto getgrnam_r $hdrs
14398 case "$d_getgrnam_r_proto" in
14400 case "$getgrnam_r_proto" in
14401 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14402 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14404 case "$getgrnam_r_proto" in
14405 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14406 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14408 case "$getgrnam_r_proto" in
14409 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14410 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14412 case "$getgrnam_r_proto" in
14413 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14414 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14416 case "$getgrnam_r_proto" in
14417 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14418 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14420 case "$getgrnam_r_proto" in
14421 ''|0) d_getgrnam_r=undef
14423 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14424 * ) case "$getgrnam_r_proto" in
14425 REENTRANT_PROTO*) ;;
14426 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14428 echo "Prototype: $try" ;;
14431 *) case "$usethreads" in
14432 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14439 *) getgrnam_r_proto=0
14443 : see if gethostbyaddr exists
14444 set gethostbyaddr d_gethbyaddr
14447 : see if gethostbyname exists
14448 set gethostbyname d_gethbyname
14451 : see if gethostent exists
14452 set gethostent d_gethent
14455 : see how we will look up host name
14458 if set gethostname val -f d_gethname; eval $csym; $val; then
14459 echo 'gethostname() found.' >&4
14460 d_gethname="$define"
14463 if set uname val -f d_uname; eval $csym; $val; then
14466 uname() was found, but you're running xenix, and older versions of xenix
14467 have a broken uname(). If you don't really know whether your xenix is old
14468 enough to have a broken system call, use the default answer.
14473 "$define") dflt=n;;
14475 rp='Is your uname() broken?'
14478 n*) d_uname="$define"; call=uname;;
14481 echo 'uname() found.' >&4
14488 case "$d_gethname" in
14489 '') d_gethname="$undef";;
14492 '') d_uname="$undef";;
14494 case "$d_uname$d_gethname" in
14499 Every now and then someone has a $call() that lies about the hostname
14500 but can't be fixed for political or economic reasons. If you wish, I can
14501 pretend $call() isn't there and maybe compute hostname at run-time
14502 thanks to the '$phostname' command.
14505 rp="Shall I ignore $call() from now on?"
14508 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14511 case "$phostname" in
14512 '') aphostname='';;
14513 *) case "$aphostname" in
14515 *) set X $phostname
14519 file=`./loc $file $file $pth`
14520 aphostname=`echo $file $*`
14525 case "$d_uname$d_gethname" in
14528 case "$phostname" in
14530 echo "There will be no way for $package to get your hostname." >&4;;
14532 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14536 case "$d_phostname" in
14537 '') d_phostname="$undef";;
14540 : see if gethostbyaddr_r exists
14541 set gethostbyaddr_r d_gethostbyaddr_r
14543 case "$d_gethostbyaddr_r" in
14545 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14546 case "$d_gethostbyaddr_r_proto:$usethreads" in
14547 ":define") d_gethostbyaddr_r_proto=define
14548 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14552 case "$d_gethostbyaddr_r_proto" in
14554 case "$gethostbyaddr_r_proto" in
14555 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14556 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14558 case "$gethostbyaddr_r_proto" in
14559 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14560 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14562 case "$gethostbyaddr_r_proto" in
14563 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14564 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14566 case "$gethostbyaddr_r_proto" in
14567 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14568 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14570 case "$gethostbyaddr_r_proto" in
14571 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14572 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14574 case "$gethostbyaddr_r_proto" in
14575 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14576 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14578 case "$gethostbyaddr_r_proto" in
14579 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14580 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14582 case "$gethostbyaddr_r_proto" in
14583 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14584 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14586 case "$gethostbyaddr_r_proto" in
14587 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14588 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14590 case "$gethostbyaddr_r_proto" in
14591 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14592 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14594 case "$gethostbyaddr_r_proto" in
14595 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14596 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14598 case "$gethostbyaddr_r_proto" in
14599 ''|0) d_gethostbyaddr_r=undef
14600 gethostbyaddr_r_proto=0
14601 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14602 * ) case "$gethostbyaddr_r_proto" in
14603 REENTRANT_PROTO*) ;;
14604 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14606 echo "Prototype: $try" ;;
14609 *) case "$usethreads" in
14610 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14612 d_gethostbyaddr_r=undef
14613 gethostbyaddr_r_proto=0
14617 *) gethostbyaddr_r_proto=0
14621 : see if gethostbyname_r exists
14622 set gethostbyname_r d_gethostbyname_r
14624 case "$d_gethostbyname_r" in
14626 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14627 case "$d_gethostbyname_r_proto:$usethreads" in
14628 ":define") d_gethostbyname_r_proto=define
14629 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14633 case "$d_gethostbyname_r_proto" in
14635 case "$gethostbyname_r_proto" in
14636 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14637 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14639 case "$gethostbyname_r_proto" in
14640 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14641 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14643 case "$gethostbyname_r_proto" in
14644 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14645 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14647 case "$gethostbyname_r_proto" in
14648 ''|0) d_gethostbyname_r=undef
14649 gethostbyname_r_proto=0
14650 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14651 * ) case "$gethostbyname_r_proto" in
14652 REENTRANT_PROTO*) ;;
14653 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14655 echo "Prototype: $try" ;;
14658 *) case "$usethreads" in
14659 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14661 d_gethostbyname_r=undef
14662 gethostbyname_r_proto=0
14666 *) gethostbyname_r_proto=0
14670 : see if gethostent_r exists
14671 set gethostent_r d_gethostent_r
14673 case "$d_gethostent_r" in
14675 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14676 case "$d_gethostent_r_proto:$usethreads" in
14677 ":define") d_gethostent_r_proto=define
14678 set d_gethostent_r_proto gethostent_r $hdrs
14682 case "$d_gethostent_r_proto" in
14684 case "$gethostent_r_proto" in
14685 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14686 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14688 case "$gethostent_r_proto" in
14689 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14690 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14692 case "$gethostent_r_proto" in
14693 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14694 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14696 case "$gethostent_r_proto" in
14697 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14698 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14700 case "$gethostent_r_proto" in
14701 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14702 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14704 case "$gethostent_r_proto" in
14705 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14706 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14708 case "$gethostent_r_proto" in
14709 ''|0) d_gethostent_r=undef
14710 gethostent_r_proto=0
14711 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14712 * ) case "$gethostent_r_proto" in
14713 REENTRANT_PROTO*) ;;
14714 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14716 echo "Prototype: $try" ;;
14719 *) case "$usethreads" in
14720 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14722 d_gethostent_r=undef
14723 gethostent_r_proto=0
14727 *) gethostent_r_proto=0
14731 : see if prototypes for various gethostxxx netdb.h functions are available
14733 set d_gethostprotos gethostent $i_netdb netdb.h
14736 : see if getitimer exists
14737 set getitimer d_getitimer
14740 : see if getlogin exists
14741 set getlogin d_getlogin
14744 : see if getlogin_r exists
14745 set getlogin_r d_getlogin_r
14747 case "$d_getlogin_r" in
14749 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14750 case "$d_getlogin_r_proto:$usethreads" in
14751 ":define") d_getlogin_r_proto=define
14752 set d_getlogin_r_proto getlogin_r $hdrs
14756 case "$d_getlogin_r_proto" in
14758 case "$getlogin_r_proto" in
14759 ''|0) try='int getlogin_r(char*, size_t);'
14760 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14762 case "$getlogin_r_proto" in
14763 ''|0) try='int getlogin_r(char*, int);'
14764 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14766 case "$getlogin_r_proto" in
14767 ''|0) try='char* getlogin_r(char*, size_t);'
14768 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14770 case "$getlogin_r_proto" in
14771 ''|0) try='char* getlogin_r(char*, int);'
14772 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14774 case "$getlogin_r_proto" in
14775 ''|0) d_getlogin_r=undef
14777 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14778 * ) case "$getlogin_r_proto" in
14779 REENTRANT_PROTO*) ;;
14780 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14782 echo "Prototype: $try" ;;
14785 *) case "$usethreads" in
14786 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14793 *) getlogin_r_proto=0
14797 : see if getmnt exists
14798 set getmnt d_getmnt
14801 : see if getmntent exists
14802 set getmntent d_getmntent
14805 : see if getnameinfo exists
14806 set getnameinfo d_getnameinfo
14809 : see if getnetbyaddr exists
14810 set getnetbyaddr d_getnbyaddr
14813 : see if getnetbyname exists
14814 set getnetbyname d_getnbyname
14817 : see if getnetent exists
14818 set getnetent d_getnent
14821 : see if getnetbyaddr_r exists
14822 set getnetbyaddr_r d_getnetbyaddr_r
14824 case "$d_getnetbyaddr_r" in
14826 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14827 case "$d_getnetbyaddr_r_proto:$usethreads" in
14828 ":define") d_getnetbyaddr_r_proto=define
14829 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14833 case "$d_getnetbyaddr_r_proto" in
14835 case "$getnetbyaddr_r_proto" in
14836 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14837 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14839 case "$getnetbyaddr_r_proto" in
14840 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14841 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14843 case "$getnetbyaddr_r_proto" in
14844 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14845 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14847 case "$getnetbyaddr_r_proto" in
14848 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14849 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14851 case "$getnetbyaddr_r_proto" in
14852 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14853 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14855 case "$getnetbyaddr_r_proto" in
14856 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14857 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14859 case "$getnetbyaddr_r_proto" in
14860 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14861 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14863 case "$getnetbyaddr_r_proto" in
14864 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14865 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14867 case "$getnetbyaddr_r_proto" in
14868 ''|0) d_getnetbyaddr_r=undef
14869 getnetbyaddr_r_proto=0
14870 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14871 * ) case "$getnetbyaddr_r_proto" in
14872 REENTRANT_PROTO*) ;;
14873 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14875 echo "Prototype: $try" ;;
14878 *) case "$usethreads" in
14879 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14881 d_getnetbyaddr_r=undef
14882 getnetbyaddr_r_proto=0
14886 *) getnetbyaddr_r_proto=0
14890 : see if getnetbyname_r exists
14891 set getnetbyname_r d_getnetbyname_r
14893 case "$d_getnetbyname_r" in
14895 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14896 case "$d_getnetbyname_r_proto:$usethreads" in
14897 ":define") d_getnetbyname_r_proto=define
14898 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14902 case "$d_getnetbyname_r_proto" in
14904 case "$getnetbyname_r_proto" in
14905 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14906 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14908 case "$getnetbyname_r_proto" in
14909 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14910 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14912 case "$getnetbyname_r_proto" in
14913 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14914 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14916 case "$getnetbyname_r_proto" in
14917 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14918 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14920 case "$getnetbyname_r_proto" in
14921 ''|0) d_getnetbyname_r=undef
14922 getnetbyname_r_proto=0
14923 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14924 * ) case "$getnetbyname_r_proto" in
14925 REENTRANT_PROTO*) ;;
14926 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14928 echo "Prototype: $try" ;;
14931 *) case "$usethreads" in
14932 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14934 d_getnetbyname_r=undef
14935 getnetbyname_r_proto=0
14939 *) getnetbyname_r_proto=0
14943 : see if getnetent_r exists
14944 set getnetent_r d_getnetent_r
14946 case "$d_getnetent_r" in
14948 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14949 case "$d_getnetent_r_proto:$usethreads" in
14950 ":define") d_getnetent_r_proto=define
14951 set d_getnetent_r_proto getnetent_r $hdrs
14955 case "$d_getnetent_r_proto" in
14957 case "$getnetent_r_proto" in
14958 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14959 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14961 case "$getnetent_r_proto" in
14962 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14963 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14965 case "$getnetent_r_proto" in
14966 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14967 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14969 case "$getnetent_r_proto" in
14970 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14971 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14973 case "$getnetent_r_proto" in
14974 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14975 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14977 case "$getnetent_r_proto" in
14978 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14979 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14981 case "$getnetent_r_proto" in
14982 ''|0) d_getnetent_r=undef
14983 getnetent_r_proto=0
14984 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14985 * ) case "$getnetent_r_proto" in
14986 REENTRANT_PROTO*) ;;
14987 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14989 echo "Prototype: $try" ;;
14992 *) case "$usethreads" in
14993 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14995 d_getnetent_r=undef
14996 getnetent_r_proto=0
15000 *) getnetent_r_proto=0
15004 : see if prototypes for various getnetxxx netdb.h functions are available
15006 set d_getnetprotos getnetent $i_netdb netdb.h
15009 : see if getpagesize exists
15010 set getpagesize d_getpagsz
15013 : Optional checks for getprotobyname and getprotobynumber
15015 : see if getprotobyname exists
15016 set getprotobyname d_getpbyname
15019 : see if getprotobynumber exists
15020 set getprotobynumber d_getpbynumber
15023 : see if getprotoent exists
15024 set getprotoent d_getpent
15027 : see if getpgid exists
15028 set getpgid d_getpgid
15031 : see if getpgrp2 exists
15032 set getpgrp2 d_getpgrp2
15035 : see if getppid exists
15036 set getppid d_getppid
15039 : see if getpriority exists
15040 set getpriority d_getprior
15043 : see if getprotobyname_r exists
15044 set getprotobyname_r d_getprotobyname_r
15046 case "$d_getprotobyname_r" in
15048 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15049 case "$d_getprotobyname_r_proto:$usethreads" in
15050 ":define") d_getprotobyname_r_proto=define
15051 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15055 case "$d_getprotobyname_r_proto" in
15057 case "$getprotobyname_r_proto" in
15058 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15059 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15061 case "$getprotobyname_r_proto" in
15062 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15063 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15065 case "$getprotobyname_r_proto" in
15066 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15067 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15069 case "$getprotobyname_r_proto" in
15070 ''|0) d_getprotobyname_r=undef
15071 getprotobyname_r_proto=0
15072 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15073 * ) case "$getprotobyname_r_proto" in
15074 REENTRANT_PROTO*) ;;
15075 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15077 echo "Prototype: $try" ;;
15080 *) case "$usethreads" in
15081 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15083 d_getprotobyname_r=undef
15084 getprotobyname_r_proto=0
15088 *) getprotobyname_r_proto=0
15092 : see if getprotobynumber_r exists
15093 set getprotobynumber_r d_getprotobynumber_r
15095 case "$d_getprotobynumber_r" in
15097 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15098 case "$d_getprotobynumber_r_proto:$usethreads" in
15099 ":define") d_getprotobynumber_r_proto=define
15100 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15104 case "$d_getprotobynumber_r_proto" in
15106 case "$getprotobynumber_r_proto" in
15107 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15108 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15110 case "$getprotobynumber_r_proto" in
15111 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15112 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15114 case "$getprotobynumber_r_proto" in
15115 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15116 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15118 case "$getprotobynumber_r_proto" in
15119 ''|0) d_getprotobynumber_r=undef
15120 getprotobynumber_r_proto=0
15121 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15122 * ) case "$getprotobynumber_r_proto" in
15123 REENTRANT_PROTO*) ;;
15124 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15126 echo "Prototype: $try" ;;
15129 *) case "$usethreads" in
15130 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15132 d_getprotobynumber_r=undef
15133 getprotobynumber_r_proto=0
15137 *) getprotobynumber_r_proto=0
15141 : see if getprotoent_r exists
15142 set getprotoent_r d_getprotoent_r
15144 case "$d_getprotoent_r" in
15146 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15147 case "$d_getprotoent_r_proto:$usethreads" in
15148 ":define") d_getprotoent_r_proto=define
15149 set d_getprotoent_r_proto getprotoent_r $hdrs
15153 case "$d_getprotoent_r_proto" in
15155 case "$getprotoent_r_proto" in
15156 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15157 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15159 case "$getprotoent_r_proto" in
15160 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15161 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15163 case "$getprotoent_r_proto" in
15164 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15165 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15167 case "$getprotoent_r_proto" in
15168 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15169 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15171 case "$getprotoent_r_proto" in
15172 ''|0) d_getprotoent_r=undef
15173 getprotoent_r_proto=0
15174 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15175 * ) case "$getprotoent_r_proto" in
15176 REENTRANT_PROTO*) ;;
15177 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15179 echo "Prototype: $try" ;;
15182 *) case "$usethreads" in
15183 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15185 d_getprotoent_r=undef
15186 getprotoent_r_proto=0
15190 *) getprotoent_r_proto=0
15194 : see if prototypes for various getprotoxxx netdb.h functions are available
15196 set d_getprotoprotos getprotoent $i_netdb netdb.h
15199 : see if getprpwnam exists
15200 set getprpwnam d_getprpwnam
15203 : see if getpwent exists
15204 set getpwent d_getpwent
15207 : see if getpwent_r exists
15208 set getpwent_r d_getpwent_r
15210 case "$d_getpwent_r" in
15212 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15213 case "$d_getpwent_r_proto:$usethreads" in
15214 ":define") d_getpwent_r_proto=define
15215 set d_getpwent_r_proto getpwent_r $hdrs
15219 case "$d_getpwent_r_proto" in
15221 case "$getpwent_r_proto" in
15222 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15223 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15225 case "$getpwent_r_proto" in
15226 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15227 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15229 case "$getpwent_r_proto" in
15230 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15231 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15233 case "$getpwent_r_proto" in
15234 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15235 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15237 case "$getpwent_r_proto" in
15238 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15239 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15241 case "$getpwent_r_proto" in
15242 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15243 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15245 case "$getpwent_r_proto" in
15246 ''|0) d_getpwent_r=undef
15248 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15249 * ) case "$getpwent_r_proto" in
15250 REENTRANT_PROTO*) ;;
15251 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15253 echo "Prototype: $try" ;;
15256 *) case "$usethreads" in
15257 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15264 *) getpwent_r_proto=0
15268 : see if getpwnam_r exists
15269 set getpwnam_r d_getpwnam_r
15271 case "$d_getpwnam_r" in
15273 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15274 case "$d_getpwnam_r_proto:$usethreads" in
15275 ":define") d_getpwnam_r_proto=define
15276 set d_getpwnam_r_proto getpwnam_r $hdrs
15280 case "$d_getpwnam_r_proto" in
15282 case "$getpwnam_r_proto" in
15283 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15284 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15286 case "$getpwnam_r_proto" in
15287 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15288 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15290 case "$getpwnam_r_proto" in
15291 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15292 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15294 case "$getpwnam_r_proto" in
15295 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15296 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15298 case "$getpwnam_r_proto" in
15299 ''|0) d_getpwnam_r=undef
15301 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15302 * ) case "$getpwnam_r_proto" in
15303 REENTRANT_PROTO*) ;;
15304 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15306 echo "Prototype: $try" ;;
15309 *) case "$usethreads" in
15310 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15317 *) getpwnam_r_proto=0
15321 : see if getpwuid_r exists
15322 set getpwuid_r d_getpwuid_r
15324 case "$d_getpwuid_r" in
15326 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15327 case "$d_getpwuid_r_proto:$usethreads" in
15328 ":define") d_getpwuid_r_proto=define
15329 set d_getpwuid_r_proto getpwuid_r $hdrs
15333 case "$d_getpwuid_r_proto" in
15335 case "$getpwuid_r_proto" in
15336 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15337 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15339 case "$getpwuid_r_proto" in
15340 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15341 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15343 case "$getpwuid_r_proto" in
15344 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15345 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15347 case "$getpwuid_r_proto" in
15348 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15349 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15351 case "$getpwuid_r_proto" in
15352 ''|0) d_getpwuid_r=undef
15354 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15355 * ) case "$getpwuid_r_proto" in
15356 REENTRANT_PROTO*) ;;
15357 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15359 echo "Prototype: $try" ;;
15362 *) case "$usethreads" in
15363 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15370 *) getpwuid_r_proto=0
15374 : Optional checks for getsbyname and getsbyport
15376 : see if getservbyname exists
15377 set getservbyname d_getsbyname
15380 : see if getservbyport exists
15381 set getservbyport d_getsbyport
15384 : see if getservent exists
15385 set getservent d_getsent
15388 : see if getservbyname_r exists
15389 set getservbyname_r d_getservbyname_r
15391 case "$d_getservbyname_r" in
15393 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15394 case "$d_getservbyname_r_proto:$usethreads" in
15395 ":define") d_getservbyname_r_proto=define
15396 set d_getservbyname_r_proto getservbyname_r $hdrs
15400 case "$d_getservbyname_r_proto" in
15402 case "$getservbyname_r_proto" in
15403 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15404 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15406 case "$getservbyname_r_proto" in
15407 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15408 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15410 case "$getservbyname_r_proto" in
15411 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15412 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15414 case "$getservbyname_r_proto" in
15415 ''|0) d_getservbyname_r=undef
15416 getservbyname_r_proto=0
15417 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15418 * ) case "$getservbyname_r_proto" in
15419 REENTRANT_PROTO*) ;;
15420 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15422 echo "Prototype: $try" ;;
15425 *) case "$usethreads" in
15426 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15428 d_getservbyname_r=undef
15429 getservbyname_r_proto=0
15433 *) getservbyname_r_proto=0
15437 : see if getservbyport_r exists
15438 set getservbyport_r d_getservbyport_r
15440 case "$d_getservbyport_r" in
15442 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15443 case "$d_getservbyport_r_proto:$usethreads" in
15444 ":define") d_getservbyport_r_proto=define
15445 set d_getservbyport_r_proto getservbyport_r $hdrs
15449 case "$d_getservbyport_r_proto" in
15451 case "$getservbyport_r_proto" in
15452 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15453 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15455 case "$getservbyport_r_proto" in
15456 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15457 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15459 case "$getservbyport_r_proto" in
15460 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15461 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15463 case "$getservbyport_r_proto" in
15464 ''|0) d_getservbyport_r=undef
15465 getservbyport_r_proto=0
15466 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15467 * ) case "$getservbyport_r_proto" in
15468 REENTRANT_PROTO*) ;;
15469 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15471 echo "Prototype: $try" ;;
15474 *) case "$usethreads" in
15475 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15477 d_getservbyport_r=undef
15478 getservbyport_r_proto=0
15482 *) getservbyport_r_proto=0
15486 : see if getservent_r exists
15487 set getservent_r d_getservent_r
15489 case "$d_getservent_r" in
15491 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15492 case "$d_getservent_r_proto:$usethreads" in
15493 ":define") d_getservent_r_proto=define
15494 set d_getservent_r_proto getservent_r $hdrs
15498 case "$d_getservent_r_proto" in
15500 case "$getservent_r_proto" in
15501 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15502 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15504 case "$getservent_r_proto" in
15505 ''|0) try='int getservent_r(struct servent*, char*, int);'
15506 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15508 case "$getservent_r_proto" in
15509 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15510 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15512 case "$getservent_r_proto" in
15513 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15514 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15516 case "$getservent_r_proto" in
15517 ''|0) d_getservent_r=undef
15518 getservent_r_proto=0
15519 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15520 * ) case "$getservent_r_proto" in
15521 REENTRANT_PROTO*) ;;
15522 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15524 echo "Prototype: $try" ;;
15527 *) case "$usethreads" in
15528 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15530 d_getservent_r=undef
15531 getservent_r_proto=0
15535 *) getservent_r_proto=0
15539 : see if prototypes for various getservxxx netdb.h functions are available
15541 set d_getservprotos getservent $i_netdb netdb.h
15544 : see if getspnam exists
15545 set getspnam d_getspnam
15548 : see if this is a shadow.h system
15549 set shadow.h i_shadow
15552 : see if getspnam_r exists
15553 set getspnam_r d_getspnam_r
15555 case "$d_getspnam_r" in
15557 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15558 case "$d_getspnam_r_proto:$usethreads" in
15559 ":define") d_getspnam_r_proto=define
15560 set d_getspnam_r_proto getspnam_r $hdrs
15564 case "$d_getspnam_r_proto" in
15566 case "$getspnam_r_proto" in
15567 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15568 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15570 case "$getspnam_r_proto" in
15571 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15572 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15574 case "$getspnam_r_proto" in
15575 ''|0) d_getspnam_r=undef
15577 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15578 * ) case "$getspnam_r_proto" in
15579 REENTRANT_PROTO*) ;;
15580 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15582 echo "Prototype: $try" ;;
15585 *) case "$usethreads" in
15586 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15593 *) getspnam_r_proto=0
15597 : see if gettimeofday or ftime exists
15598 set gettimeofday d_gettimeod
15600 case "$d_gettimeod" in
15606 val="$undef"; set d_ftime; eval $setvar
15609 case "$d_gettimeod$d_ftime" in
15612 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15616 : see if gmtime_r exists
15617 set gmtime_r d_gmtime_r
15619 case "$d_gmtime_r" in
15621 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15622 case "$d_gmtime_r_proto:$usethreads" in
15623 ":define") d_gmtime_r_proto=define
15624 set d_gmtime_r_proto gmtime_r $hdrs
15628 case "$d_gmtime_r_proto" in
15630 case "$gmtime_r_proto" in
15631 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15632 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15634 case "$gmtime_r_proto" in
15635 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15636 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15638 case "$gmtime_r_proto" in
15639 ''|0) d_gmtime_r=undef
15641 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15642 * ) case "$gmtime_r_proto" in
15643 REENTRANT_PROTO*) ;;
15644 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15646 echo "Prototype: $try" ;;
15649 *) case "$usethreads" in
15650 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15657 *) gmtime_r_proto=0
15661 : see if hasmntopt exists
15662 set hasmntopt d_hasmntopt
15665 : see if this is a netinet/in.h or sys/in.h system
15666 set netinet/in.h i_niin sys/in.h i_sysin
15669 : see if arpa/inet.h has to be included
15670 set arpa/inet.h i_arpainet
15673 : see if htonl --and friends-- exists
15678 : Maybe they are macros.
15681 $cat >htonl.c <<EOM
15683 #include <sys/types.h>
15684 #$i_niin I_NETINET_IN
15686 #$i_arpainet I_ARPA_INET
15687 #ifdef I_NETINET_IN
15688 #include <netinet/in.h>
15691 #include <sys/in.h>
15694 #include <arpa/inet.h>
15697 printf("Defined as a macro.");
15700 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15701 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15703 echo "But it seems to be defined as a macro." >&4
15711 : see if hypot exists
15715 : see if ilogb exists
15719 : see if ilogbl exists
15720 set ilogbl d_ilogbl
15725 if set index val -f; eval $csym; $val; then
15726 if set strchr val -f d_strchr; eval $csym; $val; then
15727 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15730 echo "strchr() found." >&4
15734 echo "index() found." >&4
15739 echo "index() found." >&4
15742 if set strchr val -f d_strchr; eval $csym; $val; then
15745 echo "strchr() found." >&4
15747 echo "No index() or strchr() found!" >&4
15752 set d_strchr; eval $setvar
15754 set d_index; eval $setvar
15756 : check whether inet_aton exists
15757 set inet_aton d_inetaton
15760 : see if inet_ntop exists
15761 set inet_ntop d_inetntop
15764 : see if inet_pton exists
15765 set inet_pton d_inetpton
15770 $cat >isascii.c <<EOCP
15773 #$i_stdlib I_STDLIB
15775 #include <stdlib.h>
15786 if eval $compile; then
15787 echo "isascii() found." >&4
15790 echo "isascii() NOT found." >&4
15799 $cat >isblank.c <<'EOCP'
15810 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15811 echo "isblank() found." >&4
15814 echo "isblank() NOT found." >&4
15821 : check for isfinite
15822 echo "Checking to see if you have isfinite..." >&4
15828 int main() { return isfinite(0.0); }
15831 if eval $compile; then
15833 echo "You have isfinite."
15836 echo "You do not have isfinite."
15842 : see if isfinitel exists
15843 set isfinitel d_isfinitel
15847 echo "Checking to see if you have isinf..." >&4
15853 int main() { return isinf(0.0); }
15856 if eval $compile; then
15858 echo "You have isinf."
15861 echo "You do not have isinf."
15867 : see if isinfl exists
15868 set isinfl d_isinfl
15872 echo "Checking to see if you have isless..." >&4
15878 int main() { return isless(0.0); }
15881 if eval $compile; then
15883 echo "You have isless."
15886 echo "You do not have isless."
15893 echo "Checking to see if you have isnan..." >&4
15899 int main() { return isnan(0.0); }
15902 if eval $compile; then
15904 echo "You have isnan."
15907 echo "You do not have isnan."
15913 : see if isnanl exists
15914 set isnanl d_isnanl
15917 : check for isnormal
15918 echo "Checking to see if you have isnormal..." >&4
15924 int main() { return isnormal(0.0); }
15927 if eval $compile; then
15929 echo "You have isnormal."
15932 echo "You do not have isnormal."
15942 : see if j0l exists
15946 : see if killpg exists
15947 set killpg d_killpg
15950 : see if localeconv exists
15951 set localeconv d_locconv
15954 : see if libc has the POSIX.1-2008 currency locale rules
15955 case "$d_locconv:$d_lc_monetary_2008" in
15958 #include <locale.h>
15960 struct lconv *lc = localeconv();
15961 char int_p_cs_precedes = lc->int_p_cs_precedes;
15966 if eval $compile; then
15967 d_lc_monetary_2008="$define"
15969 d_lc_monetary_2008="$undef"
15975 : see if lchown exists
15977 $cat > try.c <<'EOCP'
15978 /* System header to define __stub macros and hopefully few prototypes,
15979 which can conflict with char lchown(); below. */
15980 #include <assert.h>
15981 /* Override any gcc2 internal prototype to avoid an error. */
15982 /* We use char because int might match the return type of a gcc2
15983 builtin and then its argument prototype would still apply. */
15986 /* The GNU C library defines this for functions which it implements
15987 to always fail with ENOSYS. Some functions are actually named
15988 something starting with __ and the normal name is an alias. */
15989 #if defined (__stub_lchown) || defined (__stub___lchown)
15997 if eval $compile; then
15998 $echo "lchown() found." >&4
16001 $echo "lchown() NOT found." >&4
16007 : See if number of significant digits in a double precision number is known
16009 $cat >ldbl_dig.c <<EOM
16010 #$i_limits I_LIMITS
16013 #include <limits.h>
16019 printf("Contains LDBL_DIG");
16022 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16023 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16024 echo "LDBL_DIG found." >&4
16027 echo "LDBL_DIG NOT found." >&4
16034 : see if lgamma exists
16035 set lgamma d_lgamma
16038 : see if lgamma_r exists
16039 set lgamma_r d_lgamma_r
16042 : check to see if math.h defines _LIB_VERSION
16043 d_libm_lib_version="$undef"
16047 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16049 #include <unistd.h>
16051 int main (int argc, char *argv[])
16053 printf ("%d\n", _LIB_VERSION);
16058 if eval $compile; then
16060 echo "Yes, it does ($foo)" >&4
16061 d_libm_lib_version="$define"
16063 echo "No, it does not (probably harmless)" >&4
16070 : see if link exists
16074 : see if llrint exists
16075 set llrint d_llrint
16078 : see if llrintl exists
16079 set llrintl d_llrintl
16082 : see if llround exists
16083 set llround d_llround
16086 : see if llroundl exists
16087 set llroundl d_llroundl
16090 : see if localtime_r exists
16091 set localtime_r d_localtime_r
16093 case "$d_localtime_r" in
16095 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16096 case "$d_localtime_r_proto:$usethreads" in
16097 ":define") d_localtime_r_proto=define
16098 set d_localtime_r_proto localtime_r $hdrs
16102 case "$d_localtime_r_proto" in
16104 case "$localtime_r_proto" in
16105 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16106 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16108 case "$localtime_r_proto" in
16109 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16110 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16112 case "$localtime_r_proto" in
16113 ''|0) d_localtime_r=undef
16114 localtime_r_proto=0
16115 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16116 * ) case "$localtime_r_proto" in
16117 REENTRANT_PROTO*) ;;
16118 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16120 echo "Prototype: $try" ;;
16123 *) case "$usethreads" in
16124 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16126 d_localtime_r=undef
16127 localtime_r_proto=0
16131 *) localtime_r_proto=0
16135 : see if localtime_r calls tzset
16136 case "$localtime_r_proto" in
16139 /* Does our libc's localtime_r call tzset ?
16140 * return 0 if so, 1 otherwise.
16142 #$i_systypes I_SYS_TYPES
16143 #$i_unistd I_UNISTD
16145 #$i_stdlib I_STDLIB
16146 #$i_string I_STRING
16147 #$i_malloc I_MALLOC
16149 # include <sys/types.h>
16152 # include <unistd.h>
16158 #include <stdlib.h>
16161 # include <string.h>
16163 # include <strings.h>
16166 # include <malloc.h>
16170 time_t t = time(0L);
16171 char w_tz[]="TZ" "=GMT+5",
16172 e_tz[]="TZ" "=GMT-5",
16173 *tz_e = (char*)malloc(16),
16174 *tz_w = (char*)malloc(16);
16175 struct tm tm_e, tm_w;
16176 memset(&tm_e,'\0',sizeof(struct tm));
16177 memset(&tm_w,'\0',sizeof(struct tm));
16182 localtime_r(&t, &tm_e);
16185 localtime_r(&t, &tm_w);
16187 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16193 if eval $compile; then
16194 if $run ./try; then
16195 d_localtime_r_needs_tzset=undef;
16197 d_localtime_r_needs_tzset=define;
16200 d_localtime_r_needs_tzset=undef;
16204 d_localtime_r_needs_tzset=undef;
16209 : see if lockf exists
16213 : see if log1p exists
16217 : see if log2 exists
16221 : see if logb exists
16225 : see if lrint exists
16229 : see if lrintl exists
16230 set lrintl d_lrintl
16233 : see if lround exists
16234 set lround d_lround
16237 : see if lroundl exists
16238 set lroundl d_lroundl
16241 : see if prototype for lseek is available
16243 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16246 : see if lstat exists
16250 : see if madvise exists
16251 set madvise d_madvise
16254 : see if malloc_size exists
16255 set malloc_size d_malloc_size
16258 : see if malloc_size_good exists
16259 set malloc_good_size d_malloc_good_size
16262 : see if mblen exists
16266 : see if mbstowcs exists
16267 set mbstowcs d_mbstowcs
16270 : see if mbtowc exists
16271 set mbtowc d_mbtowc
16274 : see if memchr exists
16275 set memchr d_memchr
16278 : see if memcmp exists
16279 set memcmp d_memcmp
16282 : see if memcpy exists
16283 set memcpy d_memcpy
16286 : see if memmove exists
16287 set memmove d_memmove
16290 : see if memset exists
16291 set memset d_memset
16294 : see if mkdir exists
16298 : see if mkdtemp exists
16299 set mkdtemp d_mkdtemp
16302 : see if mkfifo exists
16303 set mkfifo d_mkfifo
16306 : see if mkstemp exists
16307 set mkstemp d_mkstemp
16310 : see if mkstemps exists
16311 set mkstemps d_mkstemps
16314 : see if mktime exists
16315 set mktime d_mktime
16318 : see if this is a sys/mman.h system
16319 set sys/mman.h i_sysmman
16322 : see if mmap exists
16325 : see what shmat returns
16326 : default to something harmless
16328 case "$i_sysmman$d_mmap" in
16330 $cat >mmap.c <<'END'
16331 #include <sys/mman.h>
16334 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16339 echo "and it returns ($mmaptype)." >&4
16345 : see if sqrtl exists
16349 : see if scalbnl exists
16350 set scalbnl d_scalbnl
16353 : see if truncl exists
16354 set truncl d_truncl
16357 : see if modfl exists
16361 : see if prototype for modfl is available
16363 set d_modflproto modfl $i_math math.h
16366 d_modfl_pow32_bug="$undef"
16368 case "$d_longdbl$d_modfl" in
16371 Checking to see whether your modfl() is okay for large values...
16377 if $test "X$d_modflproto" != "X$define"; then
16378 $cat >>try.c <<EOCP
16379 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16380 long double modfl (long double, long double *);
16383 $cat >>try.c <<EOCP
16385 long double nv = 4294967303.15;
16391 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16395 case "$osname:$gccversion" in
16396 aix:) saveccflags="$ccflags"
16397 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16400 if eval $compile; then
16403 *" 4294967303.150000 1.150000 4294967302.000000")
16404 echo >&4 "Your modfl() is broken for large values."
16405 d_modfl_pow32_bug="$define"
16407 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16411 *" 4294967303.150000 0.150000 4294967303.000000")
16412 echo >&4 "Your modfl() seems okay for large values."
16414 *) echo >&4 "I don't understand your modfl() at all."
16420 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16423 case "$osname:$gccversion" in
16424 aix:) ccflags="$saveccflags" ;; # restore
16429 if $test "$uselongdouble" = "$define"; then
16431 if $test "$d_sqrtl" != "$define"; then
16432 message="$message sqrtl"
16434 if $test "$d_modfl" != "$define"; then
16435 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16436 echo "You have both truncl and copysignl, so I can emulate modfl."
16438 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16439 echo "You have both aintl and copysignl, so I can emulate modfl."
16441 message="$message modfl"
16445 if $test "$d_frexpl" != "$define"; then
16446 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16447 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16449 message="$message frexpl"
16452 if $test "$d_ldexpl" != "$define"; then
16453 message="$message ldexpl"
16456 if $test "$message" != ""; then
16459 *** You requested the use of long doubles but you do not seem to have
16460 *** the following mathematical functions needed for long double support:
16462 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16463 *** Cannot continue, aborting.
16471 : see if mprotect exists
16472 set mprotect d_mprotect
16475 : see if msgctl exists
16476 set msgctl d_msgctl
16479 : see if msgget exists
16480 set msgget d_msgget
16483 : see if msgsnd exists
16484 set msgsnd d_msgsnd
16487 : see if msgrcv exists
16488 set msgrcv d_msgrcv
16491 : see how much of the 'msg*(2)' library is present.
16494 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16495 *"$undef"*) h_msg=false;;
16499 case "`ipcs 2>&1`" in
16500 "SVID messages"*"not configured"*)
16501 echo "Your $osname does not have the msg*(2) configured." >&4
16504 set msgctl d_msgctl
16506 set msgget d_msgget
16508 set msgsnd d_msgsnd
16510 set msgrcv d_msgrcv
16516 : we could also check for sys/ipc.h ...
16517 if $h_msg && $test `./findhdr sys/msg.h`; then
16518 echo "You have the full msg*(2) library." >&4
16521 echo "You don't have the full msg*(2) library." >&4
16527 : Check for msghdr_s
16529 echo "Checking to see if your system supports struct msghdr..." >&4
16530 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16532 case "$d_msghdr_s" in
16533 "$define") echo "Yes, it does." ;;
16534 *) echo "No, it doesn't." ;;
16538 : see if msync exists
16542 : see if munmap exists
16543 set munmap d_munmap
16546 : see if nan exists
16550 : see if nearbyint exists
16551 set nearbyint d_nearbyint
16554 : see if nextafter exists
16555 set nextafter d_nextafter
16558 : see if nexttoward exists
16559 set nexttoward d_nexttoward
16562 : see if nice exists
16566 : see if this is a langinfo.h system
16567 set langinfo.h i_langinfo
16570 : see if nl_langinfo exists
16571 set nl_langinfo d_nl_langinfo
16574 : see if this is a quadmath.h system
16575 set quadmath.h i_quadmath
16578 : check for volatile keyword
16580 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16581 $cat >try.c <<'EOCP'
16584 typedef struct _goo_struct goo_struct;
16585 goo_struct * volatile goo = ((goo_struct *)0);
16586 struct _goo_struct {
16591 typedef unsigned short foo_t;
16592 char *volatile foo;
16594 volatile foo_t blech;
16598 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16600 echo "Yup, it does."
16603 echo "Nope, it doesn't."
16609 : Check basic sizes
16611 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16613 case "$use64bitint:$d_quad:$quadtype" in
16616 uvtype="$uquadtype"
16621 uvtype="unsigned long"
16627 case "$uselongdouble:$d_longdbl" in
16629 nvtype="long double"
16630 nvsize=$longdblsize
16637 case "$usequadmath:$i_quadmath" in
16639 nvtype="__float128"
16645 *** You requested the use of the quadmath library, but you
16646 *** do not seem to have the quadmath library installed.
16647 *** Cannot continue, aborting.
16653 define:*) $cat <<EOM >&4
16655 *** You requested the use of the quadmath library, but you
16656 *** do not seem to have the required header, <quadmath.h>.
16658 case "$gccversion" in
16661 *** Your gcc looks a bit old:
16667 *** You are not running a gcc.
16672 *** For the quadmath library you need at least gcc 4.6.
16673 *** Cannot continue, aborting.
16679 $echo "(IV will be "$ivtype", $ivsize bytes)"
16680 $echo "(UV will be "$uvtype", $uvsize bytes)"
16681 $echo "(NV will be "$nvtype", $nvsize bytes)"
16684 #$i_inttypes I_INTTYPES
16686 #include <inttypes.h>
16691 int8_t i = INT8_MAX;
16692 uint8_t u = UINT8_MAX;
16693 printf("int8_t\n");
16696 int16_t i = INT16_MAX;
16697 uint16_t u = UINT16_MAX;
16698 printf("int16_t\n");
16701 int32_t i = INT32_MAX;
16702 uint32_t u = UINT32_MAX;
16703 printf("int32_t\n");
16708 i8type="signed char"
16709 u8type="unsigned char"
16714 '') case "$shortsize" in
16716 u16type="unsigned short"
16724 '') set try -DINT16
16725 if eval $compile; then
16726 case "`$run ./try`" in
16738 '') if $test $shortsize -ge 2; then
16740 u16type="unsigned short"
16748 '') case "$longsize" in
16750 u32type="unsigned long"
16754 *) case "$intsize" in
16756 u32type="unsigned int"
16766 '') set try -DINT32
16767 if eval $compile; then
16768 case "`$run ./try`" in
16780 '') if $test $intsize -ge 4; then
16782 u32type="unsigned int"
16790 '') case "$d_quad:$quadtype" in
16792 i64type="$quadtype"
16793 u64type="$uquadtype"
16801 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16802 : volatile so that the compiler has to store it out to memory.
16803 if test X"$d_volatile" = X"$define"; then
16808 #$i_stdlib I_STDLIB
16810 #include <stdlib.h>
16812 #include <sys/types.h>
16813 #include <signal.h>
16815 $volatile int bletched = 0;
16816 $signal_t blech(int s) { bletched = 1; }
16821 int n = 8 * $uvsize;
16824 signal(SIGFPE, blech);
16827 for (i = 0; i < n; i++) {
16828 u = u << 1 | ($uvtype)1;
16830 if (($uvtype)d != u)
16834 d = ($nvtype)(u - 1);
16835 if (($uvtype)d != (u - 1))
16842 printf("%d\n", ((i == n) ? -n : i));
16848 d_nv_preserves_uv="$undef"
16849 if eval $compile; then
16850 nv_preserves_uv_bits="`$run ./try`"
16852 case "$nv_preserves_uv_bits" in
16854 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16855 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16856 d_nv_preserves_uv="$define"
16858 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16859 d_nv_preserves_uv="$undef" ;;
16860 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16861 nv_preserves_uv_bits="0" ;;
16865 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16866 : volatile so that the compiler has to store it out to memory.
16867 if test X"$d_volatile" = X"$define"; then
16873 typedef $nvtype NV;
16880 while(count < 256) {
16881 $volatile NV up = value + 1.0;
16882 $volatile NV negated = -value;
16883 $volatile NV down = negated - 1.0;
16884 $volatile NV got_up = up - value;
16885 int up_good = got_up == 1.0;
16886 int got_down = down - negated;
16887 int down_good = got_down == -1.0;
16889 if (down_good != up_good) {
16891 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16892 up_good, (double) got_up, down_good, (double) got_down,
16893 count, (double) value);
16900 fputs("256.0", stdout);
16903 fputs("2.0", stdout);
16909 fputs("*", stdout);
16915 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16916 count, (double) value);
16922 nv_overflows_integers_at='0'
16923 if eval $compile; then
16929 The largest integer your NVs can preserve is equal to $xxx
16931 nv_overflows_integers_at="$xxx"
16934 Cannot determine the largest integer value your NVs can hold, unexpected output
16941 Cannot determine the largest integer value your NVs can hold
16948 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16949 : volatile so that the compiler has to store it out to memory.
16950 if test X"$d_volatile" = X"$define"; then
16955 #$i_stdlib I_STDLIB
16957 #include <stdlib.h>
16959 #$i_string I_STRING
16961 # include <string.h>
16963 # include <strings.h>
16965 #include <sys/types.h>
16966 #include <signal.h>
16968 $volatile int bletched = 0;
16969 $signal_t blech(int s) { bletched = 1; }
16972 int checkit($nvtype d, char *where) {
16973 unsigned char *p = (char *)&d;
16974 unsigned char *end = p + sizeof(d);
16984 printf("No - %s: 0x", where);
16986 printf ("%02X", *p++);
16991 int main(int argc, char **argv) {
16994 fail += checkit(d, "0.0");
16996 /* The compiler shouldn't be assuming that bletched is 0 */
16999 fail += checkit(d, "bleched");
17002 signal(SIGFPE, blech);
17005 /* Paranoia - the compiler should have no way of knowing that ANSI says
17006 that argv[argc] will always be NULL. Actually, if it did assume this it
17007 would be buggy, as this is C and main() can be called from elsewhere in
17009 d = argv[argc] ? 1 : 0;
17012 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17015 fail += checkit(d, "ternary");
17017 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17020 printf("No - memset doesn't give 0.0\n");
17021 /* This might just blow up: */
17022 printf("(gives %g)\n", d);
17028 printf("No - something bleched\n");
17033 printf("No - %d fail(s)\n", fail);
17042 d_nv_zero_is_allbits_zero="$undef"
17043 if eval $compile; then
17049 0.0 is represented as all bits zero in memory
17051 d_nv_zero_is_allbits_zero="$define"
17054 0.0 is not represented as all bits zero in memory
17056 d_nv_zero_is_allbits_zero="$undef"
17061 0.0 is not represented as all bits zero in memory
17063 d_nv_zero_is_allbits_zero="$undef"
17069 : check for off64_t
17071 echo "Checking to see if you have off64_t..." >&4
17073 #include <sys/types.h>
17074 #include <unistd.h>
17075 int main() { off64_t x = 7; }
17078 if eval $compile; then
17080 echo "You have off64_t."
17083 echo "You do not have off64_t."
17084 case "$lseeksize" in
17085 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17092 : how to create joinable pthreads
17093 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17095 echo "Checking what constant to use for creating joinable pthreads..." >&4
17096 $cat >try.c <<'EOCP'
17097 #include <pthread.h>
17099 int detachstate = JOINABLE;
17102 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17103 if eval $compile; then
17104 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17105 val="$undef" # Yes, undef.
17106 set d_old_pthread_create_joinable
17109 set old_pthread_create_joinable
17112 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17113 if eval $compile; then
17114 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17116 set d_old_pthread_create_joinable
17118 val=PTHREAD_CREATE_UNDETACHED
17119 set old_pthread_create_joinable
17122 set try -DJOINABLE=__UNDETACHED
17123 if eval $compile; then
17124 echo "You seem to use __UNDETACHED." >&4
17126 set d_old_pthread_create_joinable
17129 set old_pthread_create_joinable
17132 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17134 set d_old_pthread_create_joinable
17137 set old_pthread_create_joinable
17144 d_old_pthread_create_joinable="$undef"
17145 old_pthread_create_joinable=""
17148 : see if pause exists
17152 : see if poll exists
17156 : see if prctl exists
17160 : see if prctl supports PR_SET_NAME
17161 d_prctl_set_name=$undef
17166 #include <unistd.h>
17168 #include <sys/prctl.h>
17170 int main (int argc, char *argv[])
17172 return (prctl (PR_SET_NAME, "Test"));
17176 if eval $compile_ok && $run ./try; then
17177 echo "Your prctl (PR_SET_NAME, ...) works"
17178 d_prctl_set_name=$define
17184 : see if readlink exists
17185 set readlink d_readlink
17188 : Check if there is a /proc symlink to the abs path of
17189 : the executing program. We will honor hints of d_procselfexe=$undef
17190 : or procselfexe being non-empty, otherwise will try to determine both
17191 : if we have readlink.
17192 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17193 : referenced, and AmigaOS does not have a proc filesystem anyway.
17196 if $test "X$d_procselfexe" = Xundef; then
17198 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17200 elif $test "X$d_readlink" = Xdefine; then
17201 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17202 : and it feels more tidy to avoid an extra level of symlink
17203 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17204 while test $# -gt 0; do
17207 if $issymlink $try; then
17208 $ls -l $try > reflect
17209 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17210 echo "You have $type-like $try."
17211 procselfexe='"'$try'"'
17213 : This will break out of the loop
17223 : backward compatibility for d_hvfork
17224 if test X$d_hvfork != X; then
17225 d_vfork="$d_hvfork"
17228 : see if there is a vfork
17233 d_pseudofork=$undef
17235 : Ok, but do we want to use it. vfork is reportedly unreliable in
17236 : perl on Solaris 2.x, and probably elsewhere.
17240 case "$usevfork" in
17246 Perl can only use a vfork() that doesn't suffer from strict
17247 restrictions on calling functions or modifying global data in
17248 the child. For example, glibc-2.1 contains such a vfork()
17249 that is unsuitable. If your system provides a proper fork()
17250 call, chances are that you do NOT want perl to use vfork().
17253 rp="Do you still want to use vfork()?"
17258 echo "Ok, we won't use vfork()."
17267 $define) usevfork='true';;
17268 *) usevfork='false';;
17271 : see whether the pthread_atfork exists
17273 #include <pthread.h>
17276 #ifdef PTHREAD_ATFORK
17277 pthread_atfork(NULL,NULL,NULL);
17282 : see if pthread_atfork exists
17283 set try -DPTHREAD_ATFORK
17284 if eval $compile; then
17289 case "$usethreads" in
17292 $define) echo 'pthread_atfork found.' >&4 ;;
17293 *) echo 'pthread_atfork NOT found.' >&4 ;;
17296 set d_pthread_atfork
17299 : see if pthread_attr_setscope exists
17300 set pthread_attr_setscope d_pthread_attr_setscope
17303 : see whether the various POSIXish _yields exist
17305 #include <pthread.h>
17311 #ifdef PTHREAD_YIELD
17314 #ifdef PTHREAD_YIELD_NULL
17315 pthread_yield(NULL);
17321 : see if sched_yield exists
17322 set try -DSCHED_YIELD
17323 if eval $compile; then
17325 sched_yield='sched_yield()'
17329 case "$usethreads" in
17332 $define) echo 'sched_yield() found.' >&4 ;;
17333 *) echo 'sched_yield() NOT found.' >&4 ;;
17339 : see if pthread_yield exists
17340 set try -DPTHREAD_YIELD
17341 if eval $compile; then
17343 case "$sched_yield" in
17344 '') sched_yield='pthread_yield()' ;;
17347 set try -DPTHREAD_YIELD_NULL
17348 if eval $compile; then
17350 case "$sched_yield" in
17351 '') sched_yield='pthread_yield(NULL)' ;;
17357 case "$usethreads" in
17360 $define) echo 'pthread_yield() found.' >&4 ;;
17361 *) echo 'pthread_yield() NOT found.' >&4 ;;
17365 set d_pthread_yield
17367 case "$sched_yield" in
17368 '') sched_yield=undef ;;
17372 : check for ptrdiff_t
17374 echo "Checking to see if you have ptrdiff_t..." >&4
17376 #include <stddef.h>
17377 int main() { ptrdiff_t x = 7; }
17380 if eval $compile; then
17382 echo "You have ptrdiff_t."
17385 echo "You do not have ptrdiff_t."
17391 : see if random_r exists
17392 set random_r d_random_r
17394 case "$d_random_r" in
17396 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17397 case "$d_random_r_proto:$usethreads" in
17398 ":define") d_random_r_proto=define
17399 set d_random_r_proto random_r $hdrs
17403 case "$d_random_r_proto" in
17405 case "$random_r_proto" in
17406 ''|0) try='int random_r(int*, struct random_data*);'
17407 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17409 case "$random_r_proto" in
17410 ''|0) try='int random_r(long*, struct random_data*);'
17411 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17413 case "$random_r_proto" in
17414 ''|0) try='int random_r(struct random_data*, int32_t*);'
17415 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17417 case "$random_r_proto" in
17418 ''|0) d_random_r=undef
17420 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17421 * ) case "$random_r_proto" in
17422 REENTRANT_PROTO*) ;;
17423 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17425 echo "Prototype: $try" ;;
17428 *) case "$usethreads" in
17429 define) echo "random_r has no prototype, not using it." >&4 ;;
17436 *) random_r_proto=0
17440 : see if readdir and friends exist
17441 set readdir d_readdir
17443 set seekdir d_seekdir
17445 set telldir d_telldir
17447 set rewinddir d_rewinddir
17450 : see if readdir64_r exists
17451 set readdir64_r d_readdir64_r
17453 case "$d_readdir64_r" in
17455 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17456 case "$d_readdir64_r_proto:$usethreads" in
17457 ":define") d_readdir64_r_proto=define
17458 set d_readdir64_r_proto readdir64_r $hdrs
17462 case "$d_readdir64_r_proto" in
17464 case "$readdir64_r_proto" in
17465 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17466 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17468 case "$readdir64_r_proto" in
17469 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17470 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17472 case "$readdir64_r_proto" in
17473 ''|0) d_readdir64_r=undef
17474 readdir64_r_proto=0
17475 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17476 * ) case "$readdir64_r_proto" in
17477 REENTRANT_PROTO*) ;;
17478 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17480 echo "Prototype: $try" ;;
17483 *) case "$usethreads" in
17484 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17486 d_readdir64_r=undef
17487 readdir64_r_proto=0
17491 *) readdir64_r_proto=0
17495 : see if readdir_r exists
17496 set readdir_r d_readdir_r
17498 case "$d_readdir_r" in
17500 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17501 case "$d_readdir_r_proto:$usethreads" in
17502 ":define") d_readdir_r_proto=define
17503 set d_readdir_r_proto readdir_r $hdrs
17507 case "$d_readdir_r_proto" in
17509 case "$readdir_r_proto" in
17510 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17511 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17513 case "$readdir_r_proto" in
17514 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17515 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17517 case "$readdir_r_proto" in
17518 ''|0) d_readdir_r=undef
17520 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17521 * ) case "$readdir_r_proto" in
17522 REENTRANT_PROTO*) ;;
17523 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17525 echo "Prototype: $try" ;;
17528 *) case "$usethreads" in
17529 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17536 *) readdir_r_proto=0
17540 : see if readv exists
17544 : see if recvmsg exists
17545 set recvmsg d_recvmsg
17548 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17550 if set regcomp val -f d_regcomp; eval $csym; $val; then
17551 echo 'regcomp() found.' >&4
17552 d_regcomp="$define"
17555 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17556 echo 'regcmp() found.' >&4
17560 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17561 echo 're_comp() found, assuming re_exec() also exists.' >&4
17562 d_re_comp="$define"
17567 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17574 : see if remainder exists
17575 set remainder d_remainder
17578 : see if remquo exists
17579 set remquo d_remquo
17582 : see if rename exists
17583 set rename d_rename
17586 : see if rint exists
17590 : see if rmdir exists
17594 : see if round exists
17598 : see if memory.h is available.
17603 : See if it conflicts with string.h
17609 $cppstdin $cppflags $cppminus < $strings > mem.h
17610 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17612 echo "We won't be including <memory.h>."
17622 : can bcopy handle overlapping blocks?
17625 case "$d_memmove" in
17626 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17627 *) case "$d_bcopy" in
17629 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17631 #$i_memory I_MEMORY
17632 #$i_stdlib I_STDLIB
17633 #$i_string I_STRING
17634 #$i_unistd I_UNISTD
17636 $cat >>try.c <<'EOCP'
17639 # include <memory.h>
17642 # include <stdlib.h>
17645 # include <string.h>
17647 # include <strings.h>
17650 # include <unistd.h> /* Needed for NetBSD */
17654 char buf[128], abc[128];
17660 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17661 try to store the string in read-only memory. */
17662 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17664 for (align = 7; align >= 0; align--) {
17665 for (len = 36; len; len--) {
17667 bcopy(abc, b, len);
17668 for (off = 1; off <= len; off++) {
17669 bcopy(b, b+off, len);
17670 bcopy(b+off, b, len);
17671 if (bcmp(b, abc, len))
17680 if eval $compile_ok; then
17681 if $run ./try 2>/dev/null; then
17682 echo "Yes, it can."
17685 echo "It can't, sorry."
17688 echo "(I can't compile the test program, so we'll assume not...)"
17698 : can memcpy handle overlapping blocks?
17701 case "$d_memmove" in
17702 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17703 *) case "$d_memcpy" in
17705 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17707 #$i_memory I_MEMORY
17708 #$i_stdlib I_STDLIB
17709 #$i_string I_STRING
17710 #$i_unistd I_UNISTD
17712 $cat >>try.c <<'EOCP'
17715 # include <memory.h>
17718 # include <stdlib.h>
17721 # include <string.h>
17723 # include <strings.h>
17726 # include <unistd.h> /* Needed for NetBSD */
17730 char buf[128], abc[128];
17736 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17737 try to store the string in read-only memory. */
17738 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17740 for (align = 7; align >= 0; align--) {
17741 for (len = 36; len; len--) {
17743 memcpy(b, abc, len);
17744 for (off = 1; off <= len; off++) {
17745 memcpy(b+off, b, len);
17746 memcpy(b, b+off, len);
17747 if (memcmp(b, abc, len))
17756 if eval $compile_ok; then
17757 if $run ./try 2>/dev/null; then
17758 echo "Yes, it can."
17761 echo "It can't, sorry."
17764 echo "(I can't compile the test program, so we'll assume not...)"
17774 : can memcmp be trusted to compare relative magnitude?
17776 case "$d_memcmp" in
17779 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17781 #$i_memory I_MEMORY
17782 #$i_stdlib I_STDLIB
17783 #$i_string I_STRING
17784 #$i_unistd I_UNISTD
17786 $cat >>try.c <<'EOCP'
17789 # include <memory.h>
17792 # include <stdlib.h>
17795 # include <string.h>
17797 # include <strings.h>
17800 # include <unistd.h> /* Needed for NetBSD */
17806 if ((a < b) && memcmp(&a, &b, 1) < 0)
17812 if eval $compile_ok; then
17813 if $run ./try 2>/dev/null; then
17814 echo "Yes, it can."
17817 echo "No, it can't (it uses signed chars)."
17820 echo "(I can't compile the test program, so we'll assume not...)"
17828 : see if prototype for sbrk is available
17830 set d_sbrkproto sbrk $i_unistd unistd.h
17833 : see if scalbn exists
17834 set scalbn d_scalbn
17837 : see if select exists
17838 set select d_select
17841 : see if semctl exists
17842 set semctl d_semctl
17845 : see if semget exists
17846 set semget d_semget
17849 : see if semop exists
17853 : see how much of the 'sem*(2)' library is present.
17856 case "$d_semctl$d_semget$d_semop" in
17857 *"$undef"*) h_sem=false;;
17861 case "`ipcs 2>&1`" in
17862 "SVID messages"*"not configured"*)
17863 echo "Your $osname does not have the sem*(2) configured." >&4
17866 set semctl d_semctl
17868 set semget d_semget
17876 : we could also check for sys/ipc.h ...
17877 if $h_sem && $test `./findhdr sys/sem.h`; then
17878 echo "You have the full sem*(2) library." >&4
17881 echo "You don't have the full sem*(2) library." >&4
17887 : see whether sys/sem.h defines union semun
17889 $cat > try.c <<'END'
17890 #include <sys/types.h>
17891 #include <sys/ipc.h>
17892 #include <sys/sem.h>
17893 int main () { union semun semun; semun.buf = 0; }
17896 if eval $compile; then
17897 echo "You have union semun in <sys/sem.h>." >&4
17900 echo "You do not have union semun in <sys/sem.h>." >&4
17907 : see how to do semctl IPC_STAT
17911 $cat > tryh.h <<END
17914 # define S_IRUSR S_IREAD
17915 # define S_IWUSR S_IWRITE
17916 # define S_IXUSR S_IEXEC
17918 # define S_IRUSR 0400
17919 # define S_IWUSR 0200
17920 # define S_IXUSR 0100
17922 # define S_IRGRP (S_IRUSR>>3)
17923 # define S_IWGRP (S_IWUSR>>3)
17924 # define S_IXGRP (S_IXUSR>>3)
17925 # define S_IROTH (S_IRUSR>>6)
17926 # define S_IWOTH (S_IWUSR>>6)
17927 # define S_IXOTH (S_IXUSR>>6)
17930 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17931 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17932 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17935 : see whether semctl IPC_STAT can use union semun
17936 case "$d_semctl_semun" in
17940 #include <sys/types.h>
17941 #include <sys/ipc.h>
17942 #include <sys/sem.h>
17943 #include <sys/stat.h>
17950 #$d_union_semun HAS_UNION_SEMUN
17953 #ifndef HAS_UNION_SEMUN
17956 struct semid_ds *buf;
17957 unsigned short *array;
17963 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17964 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17966 struct semid_ds argbuf;
17969 st = semctl(sem, 0, IPC_STAT, arg);
17973 # endif /* IPC_STAT */
17974 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17976 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17977 # endif /* IPC_RMID */
17978 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17980 #endif /* IPC_PRIVATE && ... */
17981 printf("semget failed: errno = %d\n", errno);
17986 if eval $compile; then
17989 semun) val="$define" ;;
17997 case "$d_semctl_semun" in
17999 echo "You can use union semun for semctl IPC_STAT." >&4
18002 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18007 : see whether semctl IPC_STAT can use struct semid_ds pointer
18008 case "$d_semctl_semid_ds" in
18011 $cat > try.c <<'END'
18012 #include <sys/types.h>
18013 #include <sys/ipc.h>
18014 #include <sys/sem.h>
18015 #include <sys/stat.h>
18023 struct semid_ds arg;
18026 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18027 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18030 st = semctl(sem, 0, IPC_STAT, &arg);
18032 printf("semid_ds\n");
18034 # endif /* IPC_STAT */
18035 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18037 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18038 # endif /* IPC_RMID */
18039 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18041 #endif /* IPC_PRIVATE && ... */
18042 printf("semget failed: errno = %d\n", errno);
18048 if eval $compile; then
18051 semid_ds) val="$define" ;;
18055 set d_semctl_semid_ds
18059 case "$d_semctl_semid_ds" in
18061 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18063 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18069 # We do not have the full sem*(2) library, so assume we can not
18075 set d_semctl_semid_ds
18081 : see if sendmsg exists
18082 set sendmsg d_sendmsg
18085 : see if setegid exists
18086 set setegid d_setegid
18089 : see if seteuid exists
18090 set seteuid d_seteuid
18093 : see if setgrent exists
18094 set setgrent d_setgrent
18097 : see if setgrent_r exists
18098 set setgrent_r d_setgrent_r
18100 case "$d_setgrent_r" in
18102 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18103 case "$d_setgrent_r_proto:$usethreads" in
18104 ":define") d_setgrent_r_proto=define
18105 set d_setgrent_r_proto setgrent_r $hdrs
18109 case "$d_setgrent_r_proto" in
18111 case "$setgrent_r_proto" in
18112 ''|0) try='int setgrent_r(FILE**);'
18113 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18115 case "$setgrent_r_proto" in
18116 ''|0) try='void setgrent_r(FILE**);'
18117 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18119 case "$setgrent_r_proto" in
18120 ''|0) d_setgrent_r=undef
18122 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18123 * ) case "$setgrent_r_proto" in
18124 REENTRANT_PROTO*) ;;
18125 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18127 echo "Prototype: $try" ;;
18130 *) case "$usethreads" in
18131 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18138 *) setgrent_r_proto=0
18142 : see if sethostent exists
18143 set sethostent d_sethent
18146 : see if sethostent_r exists
18147 set sethostent_r d_sethostent_r
18149 case "$d_sethostent_r" in
18151 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18152 case "$d_sethostent_r_proto:$usethreads" in
18153 ":define") d_sethostent_r_proto=define
18154 set d_sethostent_r_proto sethostent_r $hdrs
18158 case "$d_sethostent_r_proto" in
18160 case "$sethostent_r_proto" in
18161 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18162 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18164 case "$sethostent_r_proto" in
18165 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18166 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18168 case "$sethostent_r_proto" in
18169 ''|0) d_sethostent_r=undef
18170 sethostent_r_proto=0
18171 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18172 * ) case "$sethostent_r_proto" in
18173 REENTRANT_PROTO*) ;;
18174 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18176 echo "Prototype: $try" ;;
18179 *) case "$usethreads" in
18180 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18182 d_sethostent_r=undef
18183 sethostent_r_proto=0
18187 *) sethostent_r_proto=0
18191 : see if setitimer exists
18192 set setitimer d_setitimer
18195 : see if setlinebuf exists
18196 set setlinebuf d_setlinebuf
18199 : see if setlocale exists
18200 set setlocale d_setlocale
18203 : see if locale.h is available
18204 set locale.h i_locale
18207 : see if setlocale_r exists
18208 set setlocale_r d_setlocale_r
18210 case "$d_setlocale_r" in
18212 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18213 case "$d_setlocale_r_proto:$usethreads" in
18214 ":define") d_setlocale_r_proto=define
18215 set d_setlocale_r_proto setlocale_r $hdrs
18219 case "$d_setlocale_r_proto" in
18221 case "$setlocale_r_proto" in
18222 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18223 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18225 case "$setlocale_r_proto" in
18226 ''|0) d_setlocale_r=undef
18227 setlocale_r_proto=0
18228 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18229 * ) case "$setlocale_r_proto" in
18230 REENTRANT_PROTO*) ;;
18231 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18233 echo "Prototype: $try" ;;
18236 *) case "$usethreads" in
18237 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18239 d_setlocale_r=undef
18240 setlocale_r_proto=0
18244 *) setlocale_r_proto=0
18248 : see if setnetent exists
18249 set setnetent d_setnent
18252 : see if setnetent_r exists
18253 set setnetent_r d_setnetent_r
18255 case "$d_setnetent_r" in
18257 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18258 case "$d_setnetent_r_proto:$usethreads" in
18259 ":define") d_setnetent_r_proto=define
18260 set d_setnetent_r_proto setnetent_r $hdrs
18264 case "$d_setnetent_r_proto" in
18266 case "$setnetent_r_proto" in
18267 ''|0) try='int setnetent_r(int, struct netent_data*);'
18268 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18270 case "$setnetent_r_proto" in
18271 ''|0) try='void setnetent_r(int, struct netent_data*);'
18272 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18274 case "$setnetent_r_proto" in
18275 ''|0) d_setnetent_r=undef
18276 setnetent_r_proto=0
18277 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18278 * ) case "$setnetent_r_proto" in
18279 REENTRANT_PROTO*) ;;
18280 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18282 echo "Prototype: $try" ;;
18285 *) case "$usethreads" in
18286 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18288 d_setnetent_r=undef
18289 setnetent_r_proto=0
18293 *) setnetent_r_proto=0
18297 : see if setprotoent exists
18298 set setprotoent d_setpent
18301 : see if setpgid exists
18302 set setpgid d_setpgid
18305 : see if setpgrp2 exists
18306 set setpgrp2 d_setpgrp2
18309 : see if setpriority exists
18310 set setpriority d_setprior
18313 : see if setproctitle exists
18314 set setproctitle d_setproctitle
18317 : see if setprotoent_r exists
18318 set setprotoent_r d_setprotoent_r
18320 case "$d_setprotoent_r" in
18322 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18323 case "$d_setprotoent_r_proto:$usethreads" in
18324 ":define") d_setprotoent_r_proto=define
18325 set d_setprotoent_r_proto setprotoent_r $hdrs
18329 case "$d_setprotoent_r_proto" in
18331 case "$setprotoent_r_proto" in
18332 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18333 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18335 case "$setprotoent_r_proto" in
18336 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18337 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18339 case "$setprotoent_r_proto" in
18340 ''|0) d_setprotoent_r=undef
18341 setprotoent_r_proto=0
18342 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18343 * ) case "$setprotoent_r_proto" in
18344 REENTRANT_PROTO*) ;;
18345 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18347 echo "Prototype: $try" ;;
18350 *) case "$usethreads" in
18351 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18353 d_setprotoent_r=undef
18354 setprotoent_r_proto=0
18358 *) setprotoent_r_proto=0
18362 : see if setpwent exists
18363 set setpwent d_setpwent
18366 : see if setpwent_r exists
18367 set setpwent_r d_setpwent_r
18369 case "$d_setpwent_r" in
18371 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18372 case "$d_setpwent_r_proto:$usethreads" in
18373 ":define") d_setpwent_r_proto=define
18374 set d_setpwent_r_proto setpwent_r $hdrs
18378 case "$d_setpwent_r_proto" in
18380 case "$setpwent_r_proto" in
18381 ''|0) try='int setpwent_r(FILE**);'
18382 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18384 case "$setpwent_r_proto" in
18385 ''|0) try='void setpwent_r(FILE**);'
18386 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18388 case "$setpwent_r_proto" in
18389 ''|0) d_setpwent_r=undef
18391 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18392 * ) case "$setpwent_r_proto" in
18393 REENTRANT_PROTO*) ;;
18394 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18396 echo "Prototype: $try" ;;
18399 *) case "$usethreads" in
18400 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18407 *) setpwent_r_proto=0
18411 : see if setregid exists
18412 set setregid d_setregid
18414 set setresgid d_setresgid
18417 : see if setreuid exists
18418 set setreuid d_setreuid
18420 set setresuid d_setresuid
18423 : see if setrgid exists
18424 set setrgid d_setrgid
18427 : see if setruid exists
18428 set setruid d_setruid
18431 : see if setservent exists
18432 set setservent d_setsent
18435 : see if setservent_r exists
18436 set setservent_r d_setservent_r
18438 case "$d_setservent_r" in
18440 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18441 case "$d_setservent_r_proto:$usethreads" in
18442 ":define") d_setservent_r_proto=define
18443 set d_setservent_r_proto setservent_r $hdrs
18447 case "$d_setservent_r_proto" in
18449 case "$setservent_r_proto" in
18450 ''|0) try='int setservent_r(int, struct servent_data*);'
18451 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18453 case "$setservent_r_proto" in
18454 ''|0) try='void setservent_r(int, struct servent_data*);'
18455 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18457 case "$setservent_r_proto" in
18458 ''|0) d_setservent_r=undef
18459 setservent_r_proto=0
18460 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18461 * ) case "$setservent_r_proto" in
18462 REENTRANT_PROTO*) ;;
18463 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18465 echo "Prototype: $try" ;;
18468 *) case "$usethreads" in
18469 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18471 d_setservent_r=undef
18472 setservent_r_proto=0
18476 *) setservent_r_proto=0
18480 : see if setsid exists
18481 set setsid d_setsid
18484 : see if setvbuf exists
18485 set setvbuf d_setvbuf
18488 : see if shmctl exists
18489 set shmctl d_shmctl
18492 : see if shmget exists
18493 set shmget d_shmget
18496 : see if shmat exists
18499 : see what shmat returns
18502 $cat >shmat.c <<'END'
18503 #include <sys/shm.h>
18506 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18511 echo "and it returns ($shmattype)." >&4
18512 : see if a prototype for shmat is available
18513 xxx=`./findhdr sys/shm.h`
18514 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18515 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18526 set d_shmatprototype
18529 : see if shmdt exists
18533 : see how much of the 'shm*(2)' library is present.
18536 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18537 *"$undef"*) h_shm=false;;
18541 case "`ipcs 2>&1`" in
18542 "SVID shared memory"*"not configured"*)
18543 echo "Your $osname does not have the shm*(2) configured." >&4
18546 set shmctl d_shmctl
18548 set shmget d_shmget
18558 : we could also check for sys/ipc.h ...
18559 if $h_shm && $test `./findhdr sys/shm.h`; then
18560 echo "You have the full shm*(2) library." >&4
18563 echo "You don't have the full shm*(2) library." >&4
18569 : see if we have sigaction
18571 if set sigaction val -f d_sigaction; eval $csym; $val; then
18572 echo 'sigaction() found.' >&4
18575 #include <sys/types.h>
18576 #include <signal.h>
18577 #$i_stdlib I_STDLIB
18579 #include <stdlib.h>
18583 struct sigaction act, oact;
18585 oact.sa_handler = 0;
18586 /* so that act and oact are used */
18587 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18591 if eval $compile_ok; then
18594 echo "But you don't seem to have a usable struct sigaction." >&4
18598 echo 'sigaction NOT found.' >&4
18601 set d_sigaction; eval $setvar
18604 : see if this is a sunmath.h system
18605 set sunmath.h i_sunmath
18608 : see if signbit exists
18609 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18612 #$i_sunmath I_SUNMATH
18616 #ifdef I_SUNMATH /* Solaris special math library */
18617 # include <sunmath.h>
18620 int main(int argc, char **argv)
18624 if ((signbit(x) == 0) && (signbit(y) != 0))
18632 if eval $compile; then
18633 if $run ./try; then
18637 $echo "Signbit seems to be available, but doesn't work as I expected."
18638 $echo "I won't use it." >&4
18649 : see if sigprocmask exists
18650 set sigprocmask d_sigprocmask
18653 : see if sigsetjmp exists
18655 case "$d_sigsetjmp" in
18658 #include <setjmp.h>
18659 #$i_stdlib I_STDLIB
18661 #include <stdlib.h>
18667 if (sigsetjmp(env,1))
18670 siglongjmp(env, 1);
18675 if eval $compile; then
18676 if $run ./try >/dev/null 2>&1; then
18677 echo "POSIX sigsetjmp found." >&4
18681 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18687 echo "sigsetjmp not found." >&4
18691 *) val="$d_sigsetjmp"
18692 case "$d_sigsetjmp" in
18693 $define) echo "POSIX sigsetjmp found." >&4;;
18694 $undef) echo "sigsetjmp not found." >&4;;
18702 : see if snprintf exists
18703 set snprintf d_snprintf
18706 : see if vsnprintf exists
18707 set vsnprintf d_vsnprintf
18710 case "$d_snprintf-$d_vsnprintf" in
18713 Checking whether your snprintf() and vsnprintf() work okay...
18715 $cat >try.c <<'EOCP'
18716 /* v?snprintf testing logic courtesy of Russ Allbery.
18717 * According to C99:
18718 * - if the buffer is too short it still must be \0-terminated
18719 * - if the buffer is too short the potentially required length
18720 * must be returned and not -1
18721 * - if the buffer is NULL the potentially required length
18722 * must be returned and not -1 or core dump
18725 #include <stdarg.h>
18729 int test (char *format, ...)
18734 va_start (args, format);
18735 count = vsnprintf (buf, sizeof buf, format, args);
18742 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18743 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18747 if eval $compile; then
18750 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18752 Your snprintf() and snprintf() don't seem to be working okay.
18754 d_snprintf="$undef"
18755 d_vsnprintf="$undef"
18759 echo "(I can't seem to compile the test program--assuming they don't)"
18760 d_snprintf="$undef"
18761 d_vsnprintf="$undef"
18767 : see if sockatmark exists
18768 set sockatmark d_sockatmark
18771 : see if prototype for sockatmark is available
18773 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18776 : see if socks5_init exists
18777 set socks5_init d_socks5_init
18780 : see if sprintf returns the length of the string in the buffer as per ANSI
18781 $echo "Checking whether sprintf returns the length of the string..." >&4
18784 #$i_stdlib I_STDLIB
18786 #include <stdlib.h>
18788 #$i_string I_STRING
18790 # include <string.h>
18792 # include <strings.h>
18801 int check (size_t expect, int test) {
18802 size_t got = strlen(buffer);
18806 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18811 int main(int argc, char **argv) {
18814 check(sprintf(buffer, ""), ++test);
18815 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18816 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18823 if eval $compile; then
18827 sprintf returns the length of the string (as ANSI says it should)
18829 d_sprintf_returns_strlen="$define"
18832 sprintf does not return the length of the string (how old is this system?)
18834 d_sprintf_returns_strlen="$undef"
18838 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18839 d_sprintf_returns_strlen="$undef"
18843 : see if srand48_r exists
18844 set srand48_r d_srand48_r
18846 case "$d_srand48_r" in
18848 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18849 case "$d_srand48_r_proto:$usethreads" in
18850 ":define") d_srand48_r_proto=define
18851 set d_srand48_r_proto srand48_r $hdrs
18855 case "$d_srand48_r_proto" in
18857 case "$srand48_r_proto" in
18858 ''|0) try='int srand48_r(long, struct drand48_data*);'
18859 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18861 case "$srand48_r_proto" in
18862 ''|0) d_srand48_r=undef
18864 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18865 * ) case "$srand48_r_proto" in
18866 REENTRANT_PROTO*) ;;
18867 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18869 echo "Prototype: $try" ;;
18872 *) case "$usethreads" in
18873 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18880 *) srand48_r_proto=0
18884 : see if srandom_r exists
18885 set srandom_r d_srandom_r
18887 case "$d_srandom_r" in
18889 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18890 case "$d_srandom_r_proto:$usethreads" in
18891 ":define") d_srandom_r_proto=define
18892 set d_srandom_r_proto srandom_r $hdrs
18896 case "$d_srandom_r_proto" in
18898 case "$srandom_r_proto" in
18899 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18900 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18902 case "$srandom_r_proto" in
18903 ''|0) d_srandom_r=undef
18905 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18906 * ) case "$srandom_r_proto" in
18907 REENTRANT_PROTO*) ;;
18908 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18910 echo "Prototype: $try" ;;
18913 *) case "$usethreads" in
18914 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18921 *) srandom_r_proto=0
18925 : see if prototype for setresgid is available
18927 set d_sresgproto setresgid $i_unistd unistd.h
18930 : see if prototype for setresuid is available
18932 set d_sresuproto setresuid $i_unistd unistd.h
18935 : see if stat exists
18939 : see if sys/stat.h is available
18940 set sys/stat.h i_sysstat
18943 : see if stat knows about block sizes
18945 echo "Checking to see if your struct stat has st_blocks field..." >&4
18946 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18949 : see if this is a sys/vfs.h system
18950 set sys/vfs.h i_sysvfs
18953 : see if this is a sys/statfs.h system
18954 set sys/statfs.h i_sysstatfs
18957 : Check for statfs_s
18959 echo "Checking to see if your system supports struct statfs..." >&4
18960 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
18962 case "$d_statfs_s" in
18963 "$define") echo "Yes, it does." ;;
18964 *) echo "No, it doesn't." ;;
18968 : see if struct statfs knows about f_flags
18969 case "$d_statfs_s" in
18972 echo "Checking to see if your struct statfs has f_flags field..." >&4
18973 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
18977 set d_statfs_f_flags
18981 case "$d_statfs_f_flags" in
18982 "$define") echo "Yes, it does." ;;
18983 *) echo "No, it doesn't." ;;
18986 : see what flavor, if any, of static inline is supported
18988 echo "Checking to see if your system supports static inline..."
18989 $cat > try.c <<'EOCP'
18990 #include <stdlib.h>
18991 extern int f_via_a(int x);
18992 extern int f_via_b(int x);
18993 int main(int argc, char **argv)
19002 return EXIT_SUCCESS;
19005 return EXIT_FAILURE;
19009 $cat > a.c <<'EOCP'
19010 static INLINE int f(int x) {
19021 $cat > b.c <<'EOCP'
19022 extern int f(int x);
19030 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19031 case "$perl_static_inline" in
19032 '') # Check the various possibilities, and break out on success.
19033 # For gcc, prefer __inline__, which will still permit
19034 # cflags.SH to add in -ansi.
19035 case "$gccversion" in
19036 '') xxx="inline __inline__ __inline _inline";;
19037 *) xxx="__inline__ inline __inline _inline";;
19039 for inline in $xxx; do
19040 set try -DINLINE=$inline a.c
19041 if eval $compile && $run ./try; then
19042 # Now make sure there is no external linkage of static
19044 set try -DINLINE=$inline -DUSE_B a.c b.c
19045 if eval $compile && $run ./try; then
19046 $echo "Your compiler supports static $inline, " >&4
19047 $echo "but it also creates an external definition," >&4
19048 $echo "so I won't use it." >&4
19051 $echo "Your compiler supports static $inline." >&4
19053 perl_static_inline="static $inline";
19057 $echo "Your compiler does NOT support static $inline." >&4
19062 *inline*) # Some variant of inline exists.
19063 echo "Keeping your $hint value of $perl_static_inline."
19066 static) # No inline capabilities
19067 echo "Keeping your $hint value of $perl_static_inline."
19070 *) # Unrecognized previous value -- blindly trust the supplied
19071 # value and hope it makes sense. Use old value for
19072 # d_static_inline, if there is one.
19073 echo "Keeping your $hint value of $perl_static_inline."
19074 case "$d_static_inline" in
19076 *) val=$d_static_inline ;;
19080 # Fallback to plain 'static' if nothing worked.
19081 case "$perl_static_inline" in
19083 perl_static_inline="static"
19087 set d_static_inline
19089 $rm -f a.[co] b.[co]
19092 : Check stream access
19094 Checking how to access stdio streams by file descriptor number...
19096 case "$stdio_stream_array" in
19097 '') $cat >try.c <<EOCP
19100 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19104 for s in _iob __iob __sF
19106 set try -DSTDIO_STREAM_ARRAY=$s
19107 if eval $compile; then
19108 case "`$run ./try`" in
19109 yes) stdio_stream_array=$s; break ;;
19115 case "$stdio_stream_array" in
19117 I can't figure out how to access stdio streams by file descriptor number.
19119 d_stdio_stream_array="$undef"
19122 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19124 d_stdio_stream_array="$define"
19128 : see if strcoll exists
19129 set strcoll d_strcoll
19132 : check for structure copying
19134 echo "Checking to see if your C compiler can copy structs..." >&4
19135 $cat >try.c <<'EOCP'
19145 if $cc -c try.c >/dev/null 2>&1 ; then
19147 echo "Yup, it can."
19150 echo "Nope, it can't."
19156 : see if strerror and/or sys_errlist[] exist
19158 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19159 if set strerror val -f d_strerror; eval $csym; $val; then
19160 echo 'strerror() found.' >&4
19161 d_strerror="$define"
19162 d_strerrm='strerror(e)'
19163 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19164 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19165 d_syserrlst="$define"
19167 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19168 d_syserrlst="$undef"
19170 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19171 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19172 echo 'strerror() found in string header.' >&4
19173 d_strerror="$define"
19174 d_strerrm='strerror(e)'
19175 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19176 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19177 d_syserrlst="$define"
19179 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19180 d_syserrlst="$undef"
19182 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19183 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19184 d_strerror="$undef"
19185 d_syserrlst="$define"
19186 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19188 echo 'strerror() and sys_errlist[] NOT found.' >&4
19189 d_strerror="$undef"
19190 d_syserrlst="$undef"
19191 d_strerrm='"unknown"'
19195 : see if strerror_r exists
19196 set strerror_r d_strerror_r
19198 case "$d_strerror_r" in
19200 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19201 case "$d_strerror_r_proto:$usethreads" in
19202 ":define") d_strerror_r_proto=define
19203 set d_strerror_r_proto strerror_r $hdrs
19207 case "$d_strerror_r_proto" in
19209 case "$strerror_r_proto" in
19210 ''|0) try='int strerror_r(int, char*, size_t);'
19211 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19213 case "$strerror_r_proto" in
19214 ''|0) try='int strerror_r(int, char*, int);'
19215 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19217 case "$strerror_r_proto" in
19218 ''|0) try='char* strerror_r(int, char*, size_t);'
19219 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19221 case "$strerror_r_proto" in
19222 ''|0) d_strerror_r=undef
19224 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19225 * ) case "$strerror_r_proto" in
19226 REENTRANT_PROTO*) ;;
19227 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19229 echo "Prototype: $try" ;;
19232 *) case "$usethreads" in
19233 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19240 *) strerror_r_proto=0
19244 : see if strftime exists
19245 set strftime d_strftime
19248 : see if strlcat exists
19249 set strlcat d_strlcat
19252 : see if strlcpy exists
19253 set strlcpy d_strlcpy
19256 : see if strtod exists
19257 set strtod d_strtod
19260 : see if strtol exists
19261 set strtol d_strtol
19264 : see if strtold exists
19265 set strtold d_strtold
19268 : see if strtoll exists
19269 set strtoll d_strtoll
19272 case "$d_longlong-$d_strtoll" in
19275 Checking whether your strtoll() works okay...
19277 $cat >try.c <<'EOCP'
19280 #define strtoll __strtoll
19283 #define strtoll _strtoll
19286 extern long long int strtoll(char *s, char **, int);
19287 static int bad = 0;
19288 int check(char *s, long long ell, int een) {
19291 gll = strtoll(s, 0, 10);
19292 if (!((gll == ell) && (errno == een)))
19296 check(" 1", 1LL, 0);
19297 check(" 0", 0LL, 0);
19298 check("-1", -1LL, 0);
19299 check("-9223372036854775808", -9223372036854775808LL, 0);
19300 check("-9223372036854775808", -9223372036854775808LL, 0);
19301 check(" 9223372036854775807", 9223372036854775807LL, 0);
19302 check("-9223372036854775808", -9223372036854775808LL, 0);
19303 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19304 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19310 if eval $compile; then
19313 ok) echo "Your strtoll() seems to be working okay." ;;
19315 Your strtoll() doesn't seem to be working okay.
19321 echo "(I can't seem to compile the test program--assuming it doesn't)"
19327 : see if strtoq exists
19328 set strtoq d_strtoq
19331 : see if strtoul exists
19332 set strtoul d_strtoul
19335 case "$d_strtoul" in
19338 Checking whether your strtoul() works okay...
19340 $cat >try.c <<'EOCP'
19343 extern unsigned long int strtoul(char *s, char **, int);
19344 static int bad = 0;
19345 void check(char *s, unsigned long eul, int een) {
19348 gul = strtoul(s, 0, 10);
19349 if (!((gul == eul) && (errno == een)))
19353 check(" 1", 1L, 0);
19354 check(" 0", 0L, 0);
19356 case "$longsize" in
19358 $cat >>try.c <<'EOCP'
19359 check("18446744073709551615", 18446744073709551615UL, 0);
19360 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19361 #if 0 /* strtoul() for /^-/ strings is undefined. */
19362 check("-1", 18446744073709551615UL, 0);
19363 check("-18446744073709551614", 2, 0);
19364 check("-18446744073709551615", 1, 0);
19365 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19366 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19371 $cat >>try.c <<'EOCP'
19372 check("4294967295", 4294967295UL, 0);
19373 check("4294967296", 4294967295UL, ERANGE);
19374 #if 0 /* strtoul() for /^-/ strings is undefined. */
19375 check("-1", 4294967295UL, 0);
19376 check("-4294967294", 2, 0);
19377 check("-4294967295", 1, 0);
19378 check("-4294967296", 4294967295UL, ERANGE);
19379 check("-4294967297", 4294967295UL, ERANGE);
19384 : Should we write these tests to be more portable by sprintf-ing
19385 : ~0 and then manipulating that char string as input for strtol?
19388 $cat >>try.c <<'EOCP'
19395 if eval $compile; then
19396 case "`$run ./try`" in
19397 ok) echo "Your strtoul() seems to be working okay." ;;
19399 Your strtoul() doesn't seem to be working okay.
19405 echo "(I can't seem to compile the test program--assuming it doesn't)"
19411 : see if strtoull exists
19412 set strtoull d_strtoull
19415 case "$d_longlong-$d_strtoull" in
19418 Checking whether your strtoull() works okay...
19420 $cat >try.c <<'EOCP'
19423 #define strtoull __strtoull
19426 extern unsigned long long int strtoull(char *s, char **, int);
19427 static int bad = 0;
19428 int check(char *s, long long eull, int een) {
19431 gull = strtoull(s, 0, 10);
19432 if (!((gull == eull) && (errno == een)))
19436 check(" 1", 1LL, 0);
19437 check(" 0", 0LL, 0);
19438 check("18446744073709551615", 18446744073709551615ULL, 0);
19439 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19440 #if 0 /* strtoull() for /^-/ strings is undefined. */
19441 check("-1", 18446744073709551615ULL, 0);
19442 check("-18446744073709551614", 2LL, 0);
19443 check("-18446744073709551615", 1LL, 0);
19444 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19445 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19452 if eval $compile; then
19453 case "`$run ./try`" in
19454 ok) echo "Your strtoull() seems to be working okay." ;;
19456 Your strtoull() doesn't seem to be working okay.
19458 d_strtoull="$undef"
19462 echo "(I can't seem to compile the test program--assuming it doesn't)"
19463 d_strtoull="$undef"
19468 : see if strtouq exists
19469 set strtouq d_strtouq
19472 case "$d_strtouq" in
19475 Checking whether your strtouq() works okay...
19477 $cat >try.c <<'EOCP'
19480 extern unsigned long long int strtouq(char *s, char **, int);
19481 static int bad = 0;
19482 void check(char *s, unsigned long long eull, int een) {
19483 unsigned long long gull;
19485 gull = strtouq(s, 0, 10);
19486 if (!((gull == eull) && (errno == een)))
19490 check(" 1", 1LL, 0);
19491 check(" 0", 0LL, 0);
19492 check("18446744073709551615", 18446744073709551615ULL, 0);
19493 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19494 #if 0 /* strtouq() for /^-/ strings is undefined. */
19495 check("-1", 18446744073709551615ULL, 0);
19496 check("-18446744073709551614", 2LL, 0);
19497 check("-18446744073709551615", 1LL, 0);
19498 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19499 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19507 if eval $compile; then
19508 case "`$run ./try`" in
19509 ok) echo "Your strtouq() seems to be working okay." ;;
19511 Your strtouq() doesn't seem to be working okay.
19517 echo "(I can't seem to compile the test program--assuming it doesn't)"
19523 : see if strxfrm exists
19524 set strxfrm d_strxfrm
19527 : see if symlink exists
19528 set symlink d_symlink
19531 : see if syscall exists
19532 set syscall d_syscall
19535 : see if prototype for syscall is available
19537 set d_syscallproto syscall $i_unistd unistd.h
19540 : see if sysconf exists
19541 set sysconf d_sysconf
19544 : see if system exists
19545 set system d_system
19548 : see if tcgetpgrp exists
19549 set tcgetpgrp d_tcgetpgrp
19552 : see if tcsetpgrp exists
19553 set tcsetpgrp d_tcsetpgrp
19556 : see if prototype for telldir is available
19558 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19561 : see if tgamma exists
19562 set tgamma d_tgamma
19565 : see if time exists
19567 if test "X$d_time" = X -o X"$timetype" = X; then
19568 if set time val -f d_time; eval $csym; $val; then
19569 echo 'time() found.' >&4
19571 rp="What is the type returned by time() on this system?"
19572 set time_t timetype long stdio.h sys/types.h
19575 echo 'time() not found, hope that will do.' >&4
19583 : see if timegm exists
19584 set timegm d_timegm
19587 : see if this is a sys/times.h system
19588 set sys/times.h i_systimes
19591 : see if times exists
19593 if set times val -f d_times; eval $csym; $val; then
19594 echo 'times() found.' >&4
19597 case "$i_systimes" in
19598 "$define") inc='sys/times.h';;
19600 rp="What is the type returned by times() on this system?"
19601 set clock_t clocktype long stdio.h sys/types.h $inc
19604 echo 'times() NOT found, hope that will do.' >&4
19609 : see if tmpnam_r exists
19610 set tmpnam_r d_tmpnam_r
19612 case "$d_tmpnam_r" in
19614 hdrs="$i_systypes sys/types.h define stdio.h "
19615 case "$d_tmpnam_r_proto:$usethreads" in
19616 ":define") d_tmpnam_r_proto=define
19617 set d_tmpnam_r_proto tmpnam_r $hdrs
19621 case "$d_tmpnam_r_proto" in
19623 case "$tmpnam_r_proto" in
19624 ''|0) try='char* tmpnam_r(char*);'
19625 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19627 case "$tmpnam_r_proto" in
19628 ''|0) d_tmpnam_r=undef
19630 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19631 * ) case "$tmpnam_r_proto" in
19632 REENTRANT_PROTO*) ;;
19633 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19635 echo "Prototype: $try" ;;
19638 *) case "$usethreads" in
19639 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19646 *) tmpnam_r_proto=0
19650 : see if trunc exists
19654 : see if truncate exists
19655 set truncate d_truncate
19658 : see if ttyname_r exists
19659 set ttyname_r d_ttyname_r
19661 case "$d_ttyname_r" in
19663 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19664 case "$d_ttyname_r_proto:$usethreads" in
19665 ":define") d_ttyname_r_proto=define
19666 set d_ttyname_r_proto ttyname_r $hdrs
19670 case "$d_ttyname_r_proto" in
19672 case "$ttyname_r_proto" in
19673 ''|0) try='int ttyname_r(int, char*, size_t);'
19674 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19676 case "$ttyname_r_proto" in
19677 ''|0) try='int ttyname_r(int, char*, int);'
19678 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19680 case "$ttyname_r_proto" in
19681 ''|0) try='char* ttyname_r(int, char*, int);'
19682 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19684 case "$ttyname_r_proto" in
19685 ''|0) d_ttyname_r=undef
19687 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19688 * ) case "$ttyname_r_proto" in
19689 REENTRANT_PROTO*) ;;
19690 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19692 echo "Prototype: $try" ;;
19695 *) case "$usethreads" in
19696 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19703 *) ttyname_r_proto=0
19707 : see if tzname[] exists
19709 if set tzname val -a d_tzname; eval $csym; $val; then
19711 echo 'tzname[] found.' >&4
19714 echo 'tzname[] NOT found.' >&4
19719 : Check if is a multiplatform env
19721 darwin) multiarch="$define" ;;
19723 case "$multiarch" in
19724 ''|[nN]*) multiarch="$undef" ;;
19727 : check for ordering of bytes in a UV
19729 case "$multiarch" in
19732 You seem to be doing a multiarchitecture build,
19733 skipping the byteorder check.
19739 case "$byteorder" in
19742 In the following, larger digits indicate more significance. A big-endian
19743 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19744 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19745 machines may have weird orders like 3412. A Cray will report 87654321,
19746 an Alpha will report 12345678. If the test program works the default is
19748 I'm now running the test program...
19752 #$i_stdlib I_STDLIB
19754 #include <stdlib.h>
19756 #include <sys/types.h>
19757 typedef $uvtype UV;
19767 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19769 u.l = (UV)0x04030201;
19770 for (i = 0; i < $uvsize; i++)
19771 printf("%c", u.c[i]+'0');
19778 if eval $compile && $run ./try > /dev/null; then
19781 [1-4][1-4][1-4][1-4]|12345678|87654321)
19782 echo "(The test program ran ok.)"
19783 echo "byteorder=$dflt"
19786 ????|????????) echo "(The test program ran ok.)" ;;
19787 *) echo "(The test program didn't run right for some reason.)" ;;
19792 (I can't seem to compile the test program. Guessing big-endian...)
19795 case "$xxx_prompt" in
19797 rp="What is the order of bytes in $uvtype?"
19810 : Checking 32bit alignedness
19813 Checking to see whether you can access character data unalignedly...
19815 case "$d_u32align" in
19816 '') $cat >try.c <<EOCP
19818 #$i_stdlib I_STDLIB
19820 #include <stdlib.h>
19822 #define U32 $u32type
19823 #define BYTEORDER 0x$byteorder
19825 #include <signal.h>
19827 $signal_t bletch(int s) { exit(4); }
19830 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19831 volatile U8 buf[8];
19835 if (sizeof(U32) != 4) {
19836 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19843 signal(SIGBUS, bletch);
19855 for (i = 0; i < 4; i++) {
19856 up = (U32*)(buf + i);
19857 if (! ((*up == 1 << (8*i)) || /* big-endian */
19858 (*up == 1 << (8*(3-i))) /* little-endian */
19862 printf("read failed (%x)\n", *up);
19868 for (i = 0; i < 4; i++) {
19869 up = (U32*)(buf + i);
19871 if (*up != 0xBeef) {
19872 printf("write failed (%x)\n", *up);
19886 if eval $compile_ok; then
19887 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19888 $run ./try 2>&1 >/dev/null
19891 You can access character data pretty unalignedly.
19893 d_u32align="$undef"
19896 It seems that you must access character data in an aligned manner.
19898 d_u32align="$define"
19902 rp='Can you access character data at unaligned addresses?'
19906 [yY]*) d_u32align="$undef" ;;
19907 *) d_u32align="$define" ;;
19914 : see if ualarm exists
19915 set ualarm d_ualarm
19918 : see if umask exists
19922 : see if unordered exists
19923 set unordered d_unordered
19926 : see if unsetenv exists
19927 set unsetenv d_unsetenv
19930 : see if usleep exists
19931 set usleep d_usleep
19934 : see if prototype for usleep is available
19936 set d_usleepproto usleep $i_unistd unistd.h
19939 : see if ustat exists
19943 : see if closedir exists
19944 set closedir d_closedir
19947 case "$d_closedir" in
19950 echo "Checking whether closedir() returns a status..." >&4
19952 #$i_dirent I_DIRENT /**/
19953 #$i_sysdir I_SYS_DIR /**/
19954 #$i_sysndir I_SYS_NDIR /**/
19955 #$i_systypes I_SYS_TYPES /**/
19957 #if defined(I_SYS_TYPES)
19958 #include <sys/types.h>
19960 #if defined(I_DIRENT)
19961 #include <dirent.h>
19964 #include <sys/ndir.h>
19968 #include <ndir.h> /* may be wrong in the future */
19970 #include <sys/dir.h>
19975 int main() { return closedir(opendir(".")); }
19978 if eval $compile_ok; then
19979 if $run ./try > /dev/null 2>&1 ; then
19980 echo "Yes, it does."
19983 echo "No, it doesn't."
19987 echo "(I can't seem to compile the test program--assuming it doesn't)"
19995 set d_void_closedir
19999 : see if there is a wait4
20003 : see if waitpid exists
20004 set waitpid d_waitpid
20009 $cat >try.c <<'EOCP'
20015 return (wcscmp (s, s) ? 1 : 0);
20020 if eval $compile; then
20023 0) echo "A working wcscmp() found." >&4
20025 *) echo "wcscmp() found, but it doesn't work" >&4
20029 echo "wcscmp() NOT found." >&4
20035 : see if wcstombs exists
20036 set wcstombs d_wcstombs
20041 $cat >try.c <<'EOCP'
20046 wchar_t dst[4], *src = L" ";
20048 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20053 if eval $compile; then
20056 0) echo "A working wcsxfrm() found." >&4
20058 *) echo "wcsxfrm() found, but it doesn't work" >&4
20062 echo "wcsxfrm() NOT found." >&4
20068 : see if wctomb exists
20069 set wctomb d_wctomb
20072 : see if writev exists
20073 set writev d_writev
20076 : check for alignment requirements
20078 case "$alignbytes" in
20079 '') echo "Checking alignment constraints..." >&4
20080 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20081 $cat >try.c <<'EOCP'
20082 typedef long double NV;
20085 $cat >try.c <<'EOCP'
20089 $cat >>try.c <<'EOCP'
20097 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20102 if eval $compile_ok; then
20106 echo "(I can't seem to compile the test program...)"
20108 case "$multiarch" in
20110 : The usual safe value is 8, but Darwin with -Duselongdouble
20111 : needs 16. Hence, we will take 8 as a minimum, but allow
20112 : Configure to pick a larger value if needed.
20113 if $test "$dflt" -lt 8; then
20115 echo "Setting alignment to 8 for multiarch support.">&4
20120 *) dflt="$alignbytes"
20123 rp="Doubles must be aligned on a how-many-byte boundary?"
20128 : set the base revision
20131 : length of character in bytes. Is always 1, otherwise it is not C
20132 : This used to be a test using sizeof
20135 : Check for the number of bits in a character
20136 case "$charbits" in
20137 '') echo "Checking how long a character is (in bits)..." >&4
20144 for (c = 1, n = 0; c; c <<= 1, n++) ;
20145 printf ("%d\n", n);
20150 if eval $compile_ok; then
20154 echo "(I can't seem to compile the test program. Guessing...)"
20161 rp="What is the length of a character (in bits)?"
20165 case "$charbits" in
20168 Your system has an unsigned character size of $charbits bits, which
20169 is rather unusual (normally it is 8 bits). Perl likely will not work
20170 correctly on your system, with subtle bugs in various places.
20172 rp='Do you really want to continue?'
20176 [yY]) echo >&4 "Okay, continuing." ;;
20181 : how do we concatenate cpp tokens here?
20183 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20184 $cat >cpp_stuff.c <<'EOCP'
20185 #define RCAT(a,b)a/**/b
20186 #define ACAT(a,b)a ## b
20190 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20191 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20192 echo "Oh! Smells like ANSI's been here." >&4
20193 echo "We can catify or stringify, separately or together!"
20195 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20196 echo "Ah, yes! The good old days!" >&4
20197 echo "However, in the good old days we don't know how to stringify and"
20198 echo "catify at the same time."
20202 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20203 You're going to have to edit the values of CAT[2-5] in config.h...
20205 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20209 : see if this is a db.h system
20215 : Check db version.
20217 echo "Checking Berkeley DB version ..." >&4
20223 #include <sys/types.h>
20225 #$i_stdlib I_STDLIB
20227 #include <stdlib.h>
20230 int main(int argc, char *argv[])
20232 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20233 int Major, Minor, Patch ;
20234 unsigned long Version ;
20235 (void)db_version(&Major, &Minor, &Patch) ;
20237 printf("%d %d %d %d %d %d\n",
20238 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20239 Major, Minor, Patch);
20242 printf("You have Berkeley DB Version 2 or greater.\n");
20244 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20245 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20246 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20247 Major, Minor, Patch) ;
20249 /* check that db.h & libdb are compatible */
20250 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20251 printf("db.h and libdb are incompatible.\n") ;
20255 printf("db.h and libdb are compatible.\n") ;
20257 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20258 + DB_VERSION_PATCH ;
20260 /* needs to be >= 2.3.4 */
20261 if (Version < 2003004) {
20262 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20263 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20269 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20274 printf("You have Berkeley DB Version 1.\n");
20275 exit(0); /* DB version < 2: the coast is clear. */
20277 exit(1); /* <db.h> not Berkeley DB? */
20283 if eval $compile_ok && $run ./try; then
20284 echo 'Looks OK.' >&4
20286 db_version_major=$1
20287 db_version_minor=$2
20288 db_version_patch=$3
20290 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20294 : Remove db from list of libraries to use
20295 echo "Removing unusable -ldb from library list" >&4
20296 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20299 echo "libs = $libs" >&4
20309 : Check the return type needed for hash
20311 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20317 #include <sys/types.h>
20320 #ifndef DB_VERSION_MAJOR
20321 u_int32_t hash_cb (const void* ptr, size_t size)
20327 info.hash = hash_cb;
20331 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20332 if $contains warning try.out >>/dev/null 2>&1 ; then
20335 db_hashtype='u_int32_t'
20338 : XXX Maybe we should just give up here.
20339 db_hashtype=u_int32_t
20341 echo "Help: I can't seem to compile the db test program." >&4
20342 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20345 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20347 *) db_hashtype=u_int32_t
20352 : Check the return type needed for prefix
20354 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20360 #include <sys/types.h>
20363 #ifndef DB_VERSION_MAJOR
20364 size_t prefix_cb (const DBT *key1, const DBT *key2)
20370 info.prefix = prefix_cb;
20374 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20375 if $contains warning try.out >>/dev/null 2>&1 ; then
20376 db_prefixtype='int'
20378 db_prefixtype='size_t'
20381 db_prefixtype='size_t'
20382 : XXX Maybe we should just give up here.
20384 echo "Help: I can't seem to compile the db test program." >&4
20385 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20388 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20390 *) db_prefixtype='size_t'
20394 : Check what kind of inf/nan your system has
20395 $echo "Checking the kind of infinities and nans you have..." >&4
20397 #define DOUBLESIZE $doublesize
20398 #$d_longdbl HAS_LONG_DOUBLE
20399 #ifdef HAS_LONG_DOUBLE
20400 #define LONGDBLSIZE $longdblsize
20401 #define LONGDBLKIND $longdblkind
20408 /* Note that whether the sign bit is on or off
20409 * for NaN depends on the CPU/FPU, and possibly
20410 * can be affected by the build toolchain.
20412 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20413 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20414 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20415 * (respectively) as opposed to the more usual
20416 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20418 static void bytes(unsigned char *p, unsigned int n) {
20420 for (i = 0; i < n; i++) {
20421 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20424 int main(int argc, char *argv[]) {
20425 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20426 * because some compilers are 'smart' and not only warn but refuse to
20427 * compile such 'illegal' values. */
20428 double dinf = exp(1e9);
20429 double dnan = sqrt(-1.0);
20430 #ifdef HAS_LONG_DOUBLE
20431 long double ldinf = (long double)exp(1e9);
20432 long double ldnan = (long double)sqrt(-1.0);
20435 switch (argv[1][0]) {
20436 case '1': bytes(&dinf, sizeof(dinf)); break;
20437 case '2': bytes(&dnan, sizeof(dnan)); break;
20438 #ifdef HAS_LONG_DOUBLE
20439 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20440 /* the 80-bit long doubles might have garbage in their excess bytes */
20441 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20443 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20444 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20452 if eval $compile; then
20453 doubleinfbytes=`$run ./try 1`
20454 doublenanbytes=`$run ./try 2`
20455 case "$d_longdbl" in
20457 longdblinfbytes=`$run ./try 3`
20458 longdblnanbytes=`$run ./try 4`
20462 # Defaults in case the above test program failed.
20463 case "$doublekind" in
20464 1) # IEEE 754 32-bit LE
20465 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20466 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20468 2) # IEEE 754 32-bit BE
20469 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20470 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20472 3) # IEEE 754 64-bit LE
20473 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20474 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20476 4) # IEEE 754 64-bit BE
20477 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20478 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20480 5) # IEEE 754 128-bit LE
20481 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20482 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20484 6) # IEEE 754 128-bit BE
20485 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20486 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20488 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20489 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20490 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20492 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20493 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20494 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20497 doubleinfbytes=$undef
20498 doublenanbytes=$undef
20501 case "$longdblkind" in
20502 1) # IEEE 754 128-bit LE
20503 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20504 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20506 2) # IEEE 754 128-bit BE
20507 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20508 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20510 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20511 case "$longdblsize" in
20512 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20513 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20514 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20517 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20518 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20521 longdblinfbytes=$undef
20522 longdblnanbytes=$undef
20526 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20527 case "$longdblsize" in
20528 12) # 32-bit system
20529 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20530 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20532 16) # 64-bit system
20533 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20534 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20537 longdblinfbytes=$undef
20538 longdblnanbytes=$undef
20542 5) # 128-bit LE "double double"
20543 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20544 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20546 6) # 128-bit BE "double double"
20547 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20548 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20551 longdblinfbytes=$undef
20552 longdblnanbytes=$undef
20558 : Check the length of the double mantissa
20559 $echo "Checking how many mantissa bits your doubles have..." >&4
20562 #$i_sunmath I_SUNMATH
20564 # include <float.h>
20567 # include <sunmath.h>
20569 #ifdef DBL_MANT_DIG
20570 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20573 int main(int argc, char *argv[]) {
20575 printf("%d\n", BITS);
20581 if eval $compile; then
20582 doublemantbits=`$run ./try`
20584 doublemantbits="$undef"
20588 : Check the length of the longdouble mantissa
20589 $echo "Checking how many mantissa bits your long doubles have..." >&4
20592 #$i_sunmath I_SUNMATH
20594 # include <float.h>
20597 # include <sunmath.h>
20599 #$d_longdbl HAS_LONG_DOUBLE
20600 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20601 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20602 /* This format has no implicit bit. Beware, however, that for
20603 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20604 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20605 * and the top bit must have been one since 387, zero is plain invalid.
20606 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20607 # define BITS LDBL_MANT_DIG
20608 # elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
20609 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20610 * reason e.g. Irix thinks 107. But in any case, we want only
20611 * the number of real bits, the implicit bits are of no interest. */
20612 # define BITS 2 * (DBL_MANT_DIG - 1)
20614 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20618 int main(int argc, char *argv[]) {
20620 printf("%d\n", BITS);
20626 if eval $compile; then
20627 longdblmantbits=`$run ./try`
20629 longdblmantbits="$undef"
20633 : Check the length of the NV mantissa
20634 $echo "Checking how many mantissa bits your NVs have..." >&4
20635 if test "X$usequadmath" = "X$define"; then
20636 nvmantbits=112 # 128-1-15
20638 if test "X$nvsize" = "X$doublesize"; then
20639 nvmantbits="$doublemantbits"
20641 if test "X$nvsize" = "X$longdblsize"; then
20642 nvmantbits="$longdblmantbits"
20644 nvmantbits="$undef"
20649 : How can we generate normalized random numbers ?
20651 echo "Using our internal random number implementation..." >&4
20654 *-Dmy_rand=*|*-Dmy_srand=*)
20655 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20656 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20657 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20658 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20662 randfunc=Perl_drand48
20663 drand01="Perl_drand48()"
20664 seedfunc="Perl_drand48_init"
20668 : Determine if this is an EBCDIC system
20670 echo "Determining whether or not we are on an EBCDIC system..." >&4
20671 $cat >try.c <<'EOM'
20674 if ('M'==0xd4) return 0;
20681 if eval $compile_ok; then
20682 if $run ./try; then
20683 echo "You seem to speak EBCDIC." >&4
20686 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20689 echo "I'm unable to compile the test program." >&4
20690 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20696 : Check how to flush
20699 Checking how to flush all pending stdio output...
20701 # I only know how to find the first 32 possibly open files on SunOS.
20702 # See also hints/sunos_4_1.sh and util.c --AD
20704 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20706 $cat >>try.c <<EOCP
20708 #$i_stdlib I_STDLIB
20710 #include <stdlib.h>
20712 #$i_unistd I_UNISTD
20714 # include <unistd.h>
20716 #$d_sysconf HAS_SYSCONF
20717 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20718 #ifdef HAS_STDIO_STREAM_ARRAY
20719 # define STDIO_STREAM_ARRAY $stdio_stream_array
20724 p = fopen("try.out", "w");
20728 # ifdef TRY_FPRINTF
20732 #ifdef TRY_FFLUSH_NULL
20735 #ifdef TRY_FFLUSH_ALL
20737 long open_max = -1;
20738 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20739 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20741 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20742 open_max = sysconf(_SC_OPEN_MAX);
20745 open_max = FOPEN_MAX;
20748 open_max = OPEN_MAX;
20757 # ifdef HAS_STDIO_STREAM_ARRAY
20758 if (open_max > 0) {
20760 for (i = 0; i < open_max; i++)
20761 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20762 STDIO_STREAM_ARRAY[i]._file < open_max &&
20763 STDIO_STREAM_ARRAY[i]._flag)
20764 fflush(&STDIO_STREAM_ARRAY[i]);
20772 : first we have to find out how _not_ to flush
20774 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20776 set try -DTRY_FPUTC
20777 if eval $compile; then
20778 $run ./try 2>/dev/null
20781 if $test ! -s try.out -a "X$code" = X42; then
20787 set try -DTRY_FPRINTF
20788 if eval $compile; then
20789 $run ./try 2>/dev/null
20792 if $test ! -s try.out -a "X$code" = X42; then
20793 output=-DTRY_FPRINTF
20799 : check for fflush NULL behavior
20800 case "$fflushNULL" in
20801 '') set try -DTRY_FFLUSH_NULL $output
20802 if eval $compile; then
20803 $run ./try 2>/dev/null
20806 if $test -s try.out -a "X$code" = X42; then
20807 fflushNULL="`$cat try.out`"
20809 if $test "X$code" != X42; then
20811 (If this test failed, don't worry, we'll try another method shortly.)
20816 $rm -f core try.core core.try.*
20817 case "$fflushNULL" in
20819 Your fflush(NULL) works okay for output streams.
20820 Let's see if it clobbers input pipes...
20822 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20823 # bug that improperly flushes the input end of pipes. So we avoid the
20824 # autoflush on fork/system/exec support for now. :-(
20825 $cat >tryp.c <<EOCP
20828 main(int argc, char **argv)
20834 while ((i = getc(stdin)) != -1
20835 && (*bp++ = i) != '\n'
20836 && bp < &buf[1024])
20839 fprintf(stdout, "%s", buf);
20847 fflushNULL="$define"
20849 if eval $compile; then
20851 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20852 if $test "X$targethost" != X; then
20855 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20857 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20859 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20861 fflush(NULL) seems to behave okay with input streams.
20863 fflushNULL="$define"
20866 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20868 fflushNULL="$undef"
20871 $rm -f core tryp.c tryp.core core.tryp.*
20874 Your fflush(NULL) isn't working (contrary to ANSI C).
20876 fflushNULL="$undef"
20879 Cannot figure out whether your fflush(NULL) works or not.
20880 I'm assuming it doesn't (contrary to ANSI C).
20882 fflushNULL="$undef"
20886 $define|true|[yY]*)
20887 fflushNULL="$define"
20890 fflushNULL="$undef"
20893 : check explicit looping only if NULL did not work, and if the pipe
20894 : bug does not show up on an explicit flush too
20895 case "$fflushNULL" in
20897 $cat >tryp.c <<EOCP
20900 main(int argc, char **argv)
20906 while ((i = getc(stdin)) != -1
20907 && (*bp++ = i) != '\n'
20908 && bp < &buf[1024])
20911 fprintf(stdout, "%s", buf);
20920 if eval $compile; then
20922 if $test "X$targethost" != X; then
20925 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20927 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20929 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20931 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20933 : now check for fflushall behaviour
20934 case "$fflushall" in
20935 '') set try -DTRY_FFLUSH_ALL $output
20936 if eval $compile; then
20938 (Now testing the other method--but note that this also may fail.)
20940 $run ./try 2>/dev/null
20943 if $test -s try.out -a "X$code" = X42; then
20944 fflushall="`$cat try.out`"
20948 case "$fflushall" in
20950 Whew. Flushing explicitly all the stdio streams works.
20952 fflushall="$define"
20955 Sigh. Flushing explicitly all the stdio streams doesn't work.
20960 Cannot figure out whether flushing stdio streams explicitly works or not.
20961 I'm assuming it doesn't.
20967 "$define"|true|[yY]*)
20968 fflushall="$define"
20976 All is futile. Even fflush(stdin) clobbers input pipes!
20983 $rm -f core tryp.c tryp.core core.tryp.*
20985 *) fflushall="$undef"
20989 case "$fflushNULL$fflushall" in
20992 OK, I give up. I cannot figure out how to flush pending stdio output.
20993 We won't be flushing handles at all before fork/exec/popen.
20999 : Store the full pathname to the ar program for use in the C program
21000 : Respect a hint or command line value for full_ar.
21005 : Store the full pathname to the sed program for use in the C program
21008 : see what type gids are declared as in the kernel
21010 echo "Looking for the type for group ids returned by getgid()."
21011 set gid_t gidtype xxx stdio.h sys/types.h
21015 xxx=`./findhdr sys/user.h`
21016 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21018 unsigned) dflt="$1 $2" ;;
21022 *) dflt="$gidtype";;
21025 gid_t) echo "gid_t found." ;;
21026 *) rp="What is the type for group ids returned by getgid()?"
21032 : Check the size of GID
21035 *_t) zzz="$gidtype" ;;
21038 echo "Checking the size of $zzz..." >&4
21040 #include <sys/types.h>
21042 #$i_stdlib I_STDLIB
21044 #include <stdlib.h>
21047 printf("%d\n", (int)sizeof($gidtype));
21052 if eval $compile_ok; then
21056 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21059 echo "Your $zzz is $gidsize bytes long."
21064 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21068 : Check if GID is signed
21071 *_t) zzz="$gidtype" ;;
21074 echo "Checking the sign of $zzz..." >&4
21076 #include <sys/types.h>
21087 if eval $compile; then
21091 echo "(I can't execute the test program--guessing unsigned.)" >&4
21095 1) echo "Your $zzz is unsigned." ;;
21096 -1) echo "Your $zzz is signed." ;;
21102 echo "(I can't compile the test program--guessing unsigned.)" >&4
21106 : Check 64bit sizes
21109 if $test X"$quadtype" != X; then
21111 echo "Checking how to print 64-bit integers..." >&4
21113 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21114 $cat >try.c <<'EOCP'
21115 #include <sys/types.h>
21118 int q = 12345678901;
21119 printf("%ld\n", q);
21123 if eval $compile; then
21127 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21128 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21129 echo "We will use %d."
21135 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21136 $cat >try.c <<'EOCP'
21137 #include <sys/types.h>
21140 long q = 12345678901;
21141 printf("%ld\n", q);
21145 if eval $compile; then
21149 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21150 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21151 echo "We will use %ld."
21157 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21158 $cat >try.c <<'EOCP'
21159 #include <sys/types.h>
21160 #include <inttypes.h>
21163 int64_t q = 12345678901;
21164 printf("%" PRId64 "\n", q);
21168 if eval $compile; then
21172 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21173 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21174 echo "We will use the C9X style."
21180 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21182 #include <sys/types.h>
21185 $quadtype q = 12345678901;
21186 printf("%Ld\n", q);
21190 if eval $compile; then
21194 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21195 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21196 echo "We will use %Ld."
21202 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21203 $cat >try.c <<'EOCP'
21204 #include <sys/types.h>
21207 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21208 printf("%lld\n", q);
21212 if eval $compile; then
21216 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21217 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21218 echo "We will use the %lld style."
21224 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21226 #include <sys/types.h>
21229 $quadtype q = 12345678901;
21230 printf("%qd\n", q);
21234 if eval $compile; then
21238 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21239 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21240 echo "We will use %qd."
21246 if $test X"$sPRId64" = X; then
21247 echo "Cannot figure out how to print 64-bit integers." >&4
21254 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21255 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21257 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21258 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21262 : Check format strings for internal types
21264 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21266 if $test X"$ivsize" = X8; then
21267 ivdformat="$sPRId64"
21268 uvuformat="$sPRIu64"
21269 uvoformat="$sPRIo64"
21270 uvxformat="$sPRIx64"
21271 uvXUformat="$sPRIXU64"
21273 if $test X"$ivsize" = X"$longsize"; then
21280 if $test X"$ivsize" = X"$intsize"; then
21288 if $test X"$ivsize" = X"$shortsize"; then
21299 if $test X"$usequadmath" = X"$define"; then
21307 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21308 nveformat="$sPRIeldbl"
21309 nvfformat="$sPRIfldbl"
21310 nvgformat="$sPRIgldbl"
21311 nvEUformat="$sPRIEUldbl"
21312 nvFUformat="$sPRIFUldbl"
21313 nvGUformat="$sPRIGUldbl"
21324 case "$ivdformat" in
21325 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21330 : Check format string for GID
21333 $echo "Checking the format string to be used for gids..." >&4
21336 -1) if $test X"$gidsize" = X"$ivsize"; then
21337 gidformat="$ivdformat"
21339 if $test X"$gidsize" = X"$longsize"; then
21342 if $test X"$gidsize" = X"$intsize"; then
21345 if $test X"$gidsize" = X"$shortsize"; then
21352 *) if $test X"$gidsize" = X"$uvsize"; then
21353 gidformat="$uvuformat"
21355 if $test X"$gidsize" = X"$longsize"; then
21358 if $test X"$gidsize" = X"$intsize"; then
21361 if $test X"$gidsize" = X"$shortsize"; then
21370 : see if getgroups exists
21371 set getgroups d_getgrps
21374 : see if setgroups exists
21375 set setgroups d_setgrps
21378 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21380 case "$d_getgrps$d_setgrps" in
21382 case "$groupstype" in
21383 '') dflt="$gidtype" ;;
21384 *) dflt="$groupstype" ;;
21387 What type of pointer is the second argument to getgroups() and setgroups()?
21388 Usually this is the same as group ids, $gidtype, but not always.
21391 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21395 *) groupstype="$gidtype";;
21398 : check whether make sets MAKE
21400 echo "Checking if your $make program sets \$(MAKE)..." >&4
21401 case "$make_set_make" in
21403 $sed 's/^X //' > testmake.mak << 'EOF'
21405 X @echo 'maketemp="$(MAKE)"'
21407 case "`$make -f testmake.mak 2>/dev/null`" in
21408 *maketemp=*) make_set_make='#' ;;
21409 *) make_set_make="MAKE=$make" ;;
21411 $rm -f testmake.mak
21414 case "$make_set_make" in
21415 '#') echo "Yup, it does.";;
21416 *) echo "Nope, it doesn't.";;
21419 : see what type is used for mode_t
21420 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21421 set mode_t modetype int stdio.h sys/types.h
21424 : see if we need va_copy
21426 case "$i_stdarg" in
21429 #include <stdarg.h>
21431 #$i_stdlib I_STDLIB
21433 #include <stdlib.h>
21435 #include <signal.h>
21438 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21440 return vfprintf(f, fmt, *valp);
21444 myvfprintf(FILE *f, const char *fmt, va_list val)
21446 return ivfprintf(f, fmt, &val);
21450 myprintf(char *fmt, ...)
21453 va_start(val, fmt);
21454 return myvfprintf(stdout, fmt, val);
21458 main(int ac, char **av)
21460 signal(SIGSEGV, exit);
21462 myprintf("%s%cs all right, then\n", "that", '\'');
21467 if eval $compile && $run ./try 2>&1 >/dev/null; then
21468 case "`$run ./try`" in
21469 "that's all right, then")
21475 yes) echo "It seems that you don't need va_copy()." >&4
21476 need_va_copy="$undef"
21478 *) echo "It seems that va_copy() or similar will be needed." >&4
21479 need_va_copy="$define"
21484 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21485 need_va_copy="$undef"
21489 : see what type is used for size_t
21490 rp="What is the type used for the length parameter for string functions?"
21491 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21494 : check for type of arguments to gethostbyaddr.
21495 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21496 case "$d_gethbyaddr" in
21500 Checking to see what type of arguments are accepted by gethostbyaddr().
21502 hdrs="$define sys/types.h
21503 $d_socket sys/socket.h
21504 $i_niin netinet/in.h
21506 $i_unistd unistd.h"
21507 : The first arg can 'char *' or 'void *'
21508 : The second arg is some of integral type
21509 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21510 for yyy in size_t long int; do
21511 case "$netdb_host_type" in
21512 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21513 if ./protochk "$try" $hdrs; then
21514 echo "Your system accepts $xxx for the first arg."
21515 echo "...and $yyy for the second arg."
21516 netdb_host_type="$xxx"
21517 netdb_hlen_type="$yyy"
21523 : In case none of those worked, prompt the user.
21524 case "$netdb_host_type" in
21525 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21528 netdb_host_type=$ans
21529 rp='What is the type for the 2nd argument to gethostbyaddr?'
21532 netdb_hlen_type=$ans
21536 *) : no gethostbyaddr, so pick harmless defaults
21537 netdb_host_type='char *'
21538 netdb_hlen_type="$sizetype"
21541 # Remove the "const" if needed. -- but then we'll have a
21543 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21546 : check for type of argument to gethostbyname.
21547 if test "X$netdb_name_type" = X ; then
21548 case "$d_gethbyname" in
21552 Checking to see what type of argument is accepted by gethostbyname().
21554 hdrs="$define sys/types.h
21555 $d_socket sys/socket.h
21556 $i_niin netinet/in.h
21558 $i_unistd unistd.h"
21559 for xxx in "const char *" "char *"; do
21560 case "$netdb_name_type" in
21561 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21562 if ./protochk "$try" $hdrs; then
21563 echo "Your system accepts $xxx."
21564 netdb_name_type="$xxx"
21569 : In case none of those worked, prompt the user.
21570 case "$netdb_name_type" in
21571 '') rp='What is the type for the 1st argument to gethostbyname?'
21574 netdb_name_type=$ans
21578 *) : no gethostbyname, so pick harmless default
21579 netdb_name_type='char *'
21584 : check for type of 1st argument to getnetbyaddr.
21585 if test "X$netdb_net_type" = X ; then
21586 case "$d_getnbyaddr" in
21590 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21592 hdrs="$define sys/types.h
21593 $d_socket sys/socket.h
21594 $i_niin netinet/in.h
21596 $i_unistd unistd.h"
21597 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21598 case "$netdb_net_type" in
21599 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21600 if ./protochk "$try" $hdrs; then
21601 echo "Your system accepts $xxx."
21602 netdb_net_type="$xxx"
21607 : In case none of those worked, prompt the user.
21608 case "$netdb_net_type" in
21609 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21612 netdb_net_type=$ans
21616 *) : no getnetbyaddr, so pick harmless default
21617 netdb_net_type='long'
21621 : locate the preferred pager for this system
21628 [a-zA-Z]:/*) dflt=$pg;;
21632 [a-zA-Z]:/*) dflt=$more;;
21636 [a-zA-Z]:/*) dflt=$less;;
21639 '') dflt=/usr/ucb/more;;
21647 rp='What pager is used on your system?'
21651 : see what type pids are declared as in the kernel
21652 rp="What is the type of process ids on this system?"
21653 set pid_t pidtype int stdio.h sys/types.h
21656 : see if ar generates random libraries by itself
21658 echo "Checking how to generate random libraries on your machine..." >&4
21659 echo 'int bar1() { return bar2(); }' > bar1.c
21660 echo 'int bar2() { return 2; }' > bar2.c
21662 #$i_stdlib I_STDLIB
21664 #include <stdlib.h>
21666 int main() { printf("%d\n", bar1()); exit(0); }
21668 $cc $ccflags -c bar1.c >/dev/null 2>&1
21669 $cc $ccflags -c bar2.c >/dev/null 2>&1
21670 $cc $ccflags -c foo.c >/dev/null 2>&1
21671 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21672 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21673 $run ./foobar >/dev/null 2>&1; then
21674 echo "$ar appears to generate random libraries itself."
21676 if [ "X$ranlib" = "X" ]; then
21679 elif $ar s bar$_a >/dev/null 2>&1 &&
21680 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21681 $run ./foobar >/dev/null 2>&1; then
21682 echo "a table of contents needs to be added with '$ar s'."
21685 elif $ar ts bar$_a >/dev/null 2>&1 &&
21686 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21687 $run ./foobar >/dev/null 2>&1; then
21688 echo "a table of contents needs to be added with '$ar ts'."
21695 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21696 $test -f $ranlib || ranlib=''
21699 if $test -n "$ranlib"; then
21700 echo "your system has '$ranlib'; we'll use that."
21703 echo "your system doesn't seem to support random libraries"
21704 echo "so we'll use lorder and tsort to order the libraries."
21711 : see if this is a values.h system
21712 set values.h i_values
21715 : Check the max offset that gmtime and localtime accept
21716 echo "Checking max offsets that gmtime () accepts"
21719 define) yyy="#include <values.h>" ;;
21723 case "$sGMTIME_min/$sGMTIME_max" in
21726 #include <sys/types.h>
21735 void gm_check (time_t t, int min_year, int max_year)
21738 if ( tmp == NULL ||
21739 /* Check tm_year overflow */
21740 tmp->tm_year < min_year || tmp->tm_year > max_year)
21751 gm_check (MAXLONG, 69, 0x7fffffff);
21753 if (tmp == NULL || tmp->tm_year < 0) {
21754 for (i = 63; i >= 0; i--) {
21755 time_t x = pt | ((time_t)1 << i);
21756 if (x < 0 || x < pt) continue;
21757 gm_check (x, 69, 0x7fffffff);
21760 printf ("sGMTIME_max=%ld\n", pt);
21769 gm_check (MINLONG, -1900, 70);
21772 for (i = 36; i >= 0; i--) {
21773 time_t x = pt - ((time_t)1 << i);
21774 if (x > 0) continue;
21775 gm_check (x, -1900, 70);
21778 printf ("sGMTIME_min=%ld\n", pt);
21782 int main (int argc, char *argv[])
21784 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21791 if eval $compile; then
21792 eval `$run ./try 2>/dev/null`
21794 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21800 echo "Checking max offsets that localtime () accepts"
21802 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21805 #include <sys/types.h>
21814 void local_check (time_t t, int min_year, int max_year)
21816 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21819 tmp = localtime (&t);
21820 if ( tmp == NULL ||
21821 /* Check tm_year overflow */
21822 tmp->tm_year < min_year || tmp->tm_year > max_year)
21826 } /* local_check */
21833 local_check (MAXLONG, 69, 0x7fffffff);
21835 if (tmp == NULL || tmp->tm_year < 0) {
21836 for (i = 63; i >= 0; i--) {
21837 time_t x = pt | ((time_t)1 << i);
21838 if (x < 0 || x < pt) continue;
21839 local_check (x, 69, 0x7fffffff);
21842 printf ("sLOCALTIME_max=%ld\n", pt);
21851 local_check (MINLONG, -1900, 70);
21854 for (i = 36; i >= 0; i--) {
21855 time_t x = pt - ((time_t)1 << i);
21856 if (x > 0) continue;
21857 local_check (x, -1900, 70);
21860 printf ("sLOCALTIME_min=%ld\n", pt);
21864 int main (int argc, char *argv[])
21872 if eval $compile; then
21873 eval `$run ./try 2>/dev/null`
21875 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21881 : check for type of arguments to select.
21882 case "$selecttype" in
21883 '') case "$d_select" in
21887 Checking to see what type of arguments are accepted by select().
21889 hdrs="$define sys/types.h
21890 $i_systime sys/time.h
21891 $i_sysselct sys/select.h
21892 $d_socket sys/socket.h"
21893 : The first arg can be int, unsigned, or size_t
21894 : The last arg may or may not be 'const'
21896 : void pointer has been seen but using that
21897 : breaks the selectminbits test
21898 for xxx in 'fd_set *' 'int *'; do
21899 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21900 for tmo in 'struct timeval *' 'const struct timeval *'; do
21902 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21903 if ./protochk "$try" $hdrs; then
21904 echo "Your system accepts $xxx."
21913 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21914 case "$d_fd_set" in
21915 $define) dflt="fd_set *" ;;
21924 *) : no select, so pick a harmless default
21931 : check for the select 'width'
21932 case "$selectminbits" in
21933 '') safebits=`expr $ptrsize \* 8`
21934 case "$d_select" in
21938 Checking to see on how many bits at a time your select() operates...
21941 #include <sys/types.h>
21943 #$i_systime I_SYS_TIME
21944 #$i_systimek I_SYS_TIME_KERNEL
21949 # ifdef I_SYS_TIME_KERNEL
21952 # include <sys/time.h>
21953 # ifdef I_SYS_TIME_KERNEL
21957 #$i_sysselct I_SYS_SELECT
21958 #ifdef I_SYS_SELECT
21959 #include <sys/select.h>
21961 #$d_socket HAS_SOCKET
21963 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21966 #$i_stdlib I_STDLIB
21968 #include <stdlib.h>
21971 #define S sizeof(*(b))
21973 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21974 #define NBITS (NBYTES * 8)
21976 char *s = (char *)malloc(NBYTES);
21985 fp = fopen("try.c", "r");
21991 b = ($selecttype)s;
21992 for (i = 0; i < NBITS; i++)
21996 select(fd + 1, b, 0, 0, &t);
21997 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21999 printf("%d\n", i + 1);
22004 if eval $compile_ok; then
22005 selectminbits=`$run ./try 2>/dev/null`
22006 case "$selectminbits" in
22008 Cannot figure out on how many bits at a time your select() operates.
22009 I'll play safe and guess it is $safebits bits.
22011 selectminbits=$safebits
22012 bits="$safebits bits"
22015 *) bits="$selectminbits bits" ;;
22017 echo "Your select() operates on $bits at a time." >&4
22019 rp='What is the minimum number of bits your select() operates on?'
22020 case "$byteorder" in
22021 12345678) dflt=64 ;;
22027 selectminbits="$val"
22031 *) : no select, so pick a harmless default
22032 selectminbits=$safebits
22038 : Trace out the files included by signal.h, then look for SIGxxx names.
22039 case "$sig_num_init" in
22041 if [ "X$fieldn" = X ]; then
22042 : Just make some guesses. We check them later.
22043 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22045 xxx=`echo '#include <signal.h>' |
22046 $cppstdin $cppminus $cppflags 2>/dev/null |
22047 $grep '^[ ]*#.*include' |
22048 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22049 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22052 for xx in $xxx /dev/null ; do
22053 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22055 case "$xxxfiles" in
22056 '') xxxfiles=`./findhdr signal.h` ;;
22059 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22060 print substr($2, 4, 20)
22062 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22063 print substr($3, 4, 20)
22065 : Append some common names just in case the awk scan failed.
22066 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22067 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22068 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22069 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22070 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22072 : generate a few handy files for later
22073 $cat > signal.c <<EOCP
22074 #include <sys/types.h>
22075 #include <signal.h>
22076 #$i_stdlib I_STDLIB
22078 #include <stdlib.h>
22083 /* Strange style to avoid deeply-nested #if/#else/#endif */
22086 # define NSIG (_NSIG)
22092 # define NSIG (SIGMAX+1)
22098 # define NSIG (SIG_MAX+1)
22104 # define NSIG (_SIG_MAX+1)
22110 # define NSIG (MAXSIG+1)
22116 # define NSIG (MAX_SIG+1)
22121 # ifdef SIGARRAYSIZE
22122 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22128 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22132 /* Default to some arbitrary number that's big enough to get most
22133 of the common signals.
22139 printf("NSIG %d\n", NSIG);
22145 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22147 printf "#ifdef SIG"; printf $1; printf "\n"
22148 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22149 printf $1; printf ");\n"
22153 printf "#endif /* JUST_NSIG */\n";
22154 printf "exit(0);\n}\n";
22157 $cat >signal.awk <<'EOP'
22158 BEGIN { ndups = 0 }
22159 $1 ~ /^NSIG$/ { nsig = $2 }
22160 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22161 if ($2 > maxsig) { maxsig = $2 }
22162 if (sig_name[$2]) {
22163 dup_name[ndups] = $1
22164 dup_num[ndups] = $2
22176 printf("NSIG %d\n", nsig);
22177 for (n = 1; n < nsig; n++) {
22179 printf("%s %d\n", sig_name[n], sig_num[n])
22182 printf("NUM%d %d\n", n, n)
22185 for (n = 0; n < ndups; n++) {
22186 printf("%s %d\n", dup_name[n], dup_num[n])
22190 $cat >signal_cmd <<EOS
22192 if $test -s signal.lst; then
22193 echo "Using your existing signal.lst file"
22198 $cat >>signal_cmd <<'EOS'
22201 if eval $compile_ok; then
22202 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22203 $uniq | $awk -f signal.awk >signal.lst
22205 echo "(I can't seem be able to compile the whole test program)" >&4
22206 echo "(I'll try it in little pieces.)" >&4
22207 set signal -DJUST_NSIG
22208 if eval $compile_ok; then
22209 $run ./signal$_exe > signal.nsg
22212 echo "I can't seem to figure out how many signals you have." >&4
22213 echo "Guessing 50." >&4
22214 echo 'NSIG 50' > signal.nsg
22216 : Now look at all the signal names, one at a time.
22217 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22218 $cat > signal.c <<EOCP
22219 #include <sys/types.h>
22220 #include <signal.h>
22223 printf("$xx %d\n", SIG${xx});
22228 if eval $compile; then
22229 echo "SIG${xx} found."
22230 $run ./signal$_exe >> signal.ls1
22232 echo "SIG${xx} NOT found."
22235 if $test -s signal.ls1; then
22236 $cat signal.nsg signal.ls1 |
22237 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22241 if $test -s signal.lst; then
22244 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22245 echo 'kill -l' >signal
22246 set X `csh -f <signal`
22250 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22252 echo $@ | $tr ' ' $trnl | \
22253 $awk '{ printf "%s %d\n", $1, ++s; }
22254 END { printf "NSIG %d\n", ++s }' >signal.lst
22256 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22258 chmod a+x signal_cmd
22259 $eunicefix signal_cmd
22261 : generate list of signal names
22263 case "$sig_name_init" in
22265 *) case "$sig_num_init" in
22266 ''|*,*) doinit=yes ;;
22271 echo "Generating a list of signal names and numbers..." >&4
22273 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22274 sig_name=`$awk 'BEGIN { printf "ZERO " }
22275 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22276 sig_num=`$awk 'BEGIN { printf "0 " }
22277 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22278 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22279 !/^NSIG/ { printf "\"%s\", ", $1 }
22280 END { printf "0\n" }' signal.lst`
22281 sig_num_init=`$awk 'BEGIN { printf "0, " }
22282 !/^NSIG/ { printf "%d, ", $2}
22283 END { printf "0\n"}' signal.lst`
22286 echo "The following $sig_count signals are available:"
22288 echo $sig_name | $awk \
22289 'BEGIN { linelen = 0 }
22291 for (i = 1; i <= NF; i++) {
22292 name = "SIG" $i " "
22293 linelen = linelen + length(name)
22294 if (linelen > 70) {
22296 linelen = length(name)
22302 sig_size=`echo $sig_name | awk '{print NF}'`
22303 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22307 : Check size of size
22309 case "$sizetype" in
22310 *_t) zzz="$sizetype" ;;
22311 *) zzz="filesize" ;;
22313 echo "Checking the size of $zzz..." >&4
22315 #include <sys/types.h>
22317 #$i_stdlib I_STDLIB
22319 #include <stdlib.h>
22322 printf("%d\n", (int)sizeof($sizetype));
22327 if eval $compile_ok; then
22331 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22334 echo "Your $zzz size is $sizesize bytes."
22339 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22343 : check for socklen_t
22345 echo "Checking to see if you have socklen_t..." >&4
22347 #include <sys/types.h>
22348 #$d_socket HAS_SOCKET
22350 #include <sys/socket.h>
22352 int main() { socklen_t x = 16; }
22355 if eval $compile; then
22357 echo "You have socklen_t."
22360 echo "You do not have socklen_t."
22361 case "$sizetype" in
22362 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22369 : see if this is a socks.h system
22370 set socks.h i_socks
22373 : check for type of the size argument to socket calls
22374 case "$d_socket" in
22378 Checking to see what type is the last argument of accept().
22381 case "$d_socklen_t" in
22382 "$define") yyy="$yyy socklen_t"
22384 yyy="$yyy $sizetype int long unsigned"
22385 for xxx in $yyy; do
22386 case "$socksizetype" in
22387 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22388 case "$usesocks" in
22390 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22391 echo "Your system accepts '$xxx *' for the last argument of accept()."
22392 socksizetype="$xxx"
22395 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22396 echo "Your system accepts '$xxx *' for the last argument of accept()."
22397 socksizetype="$xxx"
22404 : In case none of those worked, prompt the user.
22405 case "$socksizetype" in
22406 '') rp='What is the type for socket address structure sizes?'
22413 *) : no sockets, so pick relatively harmless default
22418 : see what type is used for signed size_t
22419 set ssize_t ssizetype int stdio.h sys/types.h
22424 #$i_stdlib I_STDLIB
22426 #include <stdlib.h>
22428 #include <sys/types.h>
22429 #define Size_t $sizetype
22430 #define SSize_t $dflt
22433 if (sizeof(Size_t) == sizeof(SSize_t))
22435 else if (sizeof(Size_t) == sizeof(int))
22444 if eval $compile_ok && $run ./try > /dev/null; then
22445 ssizetype=`$run ./try`
22446 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22449 Help! I can't compile and run the ssize_t test program: please enlighten me!
22450 (This is probably a misconfiguration in your system or libraries, and
22451 you really ought to fix it. Still, I'll try anyway.)
22453 I need a type that is the same size as $sizetype, but is guaranteed to
22454 be signed. Common values are ssize_t, int and long.
22457 rp="What signed type is the same size as $sizetype?"
22463 : Check the size of st_ino
22465 $echo "Checking the size of st_ino..." >&4
22466 $cat > try.c <<EOCP
22467 #include <sys/stat.h>
22469 #$i_stdlib I_STDLIB
22471 #include <stdlib.h>
22475 printf("%d\n", (int)sizeof(st.st_ino));
22480 if eval $compile_ok; then
22484 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22486 *) st_ino_size=$val
22487 $echo "Your st_ino is $st_ino_size bytes long."
22492 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22496 : Check if st_ino is signed
22498 $echo "Checking the sign of st_ino..." >&4
22499 $cat > try.c <<EOCP
22500 #include <sys/stat.h>
22505 if (foo.st_ino < 0)
22512 if eval $compile; then
22516 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22518 *) st_ino_sign=$val
22519 case "$st_ino_sign" in
22520 1) $echo "Your st_ino is unsigned." ;;
22521 -1) $echo "Your st_ino is signed." ;;
22527 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22531 : see what type of char stdio uses.
22533 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22534 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22535 echo "Your stdio uses unsigned chars." >&4
22536 stdchar="unsigned char"
22538 echo "Your stdio uses signed chars." >&4
22543 : see what type uids are declared as in the kernel
22545 echo "Looking for the type for user ids returned by getuid()."
22546 set uid_t uidtype xxx stdio.h sys/types.h
22550 xxx=`./findhdr sys/user.h`
22551 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22553 unsigned) dflt="$1 $2" ;;
22557 *) dflt="$uidtype";;
22560 uid_t) echo "uid_t found." ;;
22561 *) rp="What is the type for user ids returned by getuid()?"
22567 : Check size of UID
22570 *_t) zzz="$uidtype" ;;
22573 echo "Checking the size of $zzz..." >&4
22575 #include <sys/types.h>
22577 #$i_stdlib I_STDLIB
22579 #include <stdlib.h>
22582 printf("%d\n", (int)sizeof($uidtype));
22587 if eval $compile_ok; then
22591 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22594 echo "Your $zzz is $uidsize bytes long."
22599 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22602 : Check if UID is signed
22605 *_t) zzz="$uidtype" ;;
22608 echo "Checking the sign of $zzz..." >&4
22610 #include <sys/types.h>
22621 if eval $compile; then
22625 echo "(I can't execute the test program--guessing unsigned.)" >&4
22629 1) echo "Your $zzz is unsigned." ;;
22630 -1) echo "Your $zzz is signed." ;;
22636 echo "(I can't compile the test program--guessing unsigned.)" >&4
22640 : Check format string for UID
22642 $echo "Checking the format string to be used for uids..." >&4
22645 -1) if $test X"$uidsize" = X"$ivsize"; then
22646 uidformat="$ivdformat"
22648 if $test X"$uidsize" = X"$longsize"; then
22651 if $test X"$uidsize" = X"$intsize"; then
22654 if $test X"$uidsize" = X"$shortsize"; then
22661 *) if $test X"$uidsize" = X"$uvsize"; then
22662 uidformat="$uvuformat"
22664 if $test X"$uidsize" = X"$longsize"; then
22667 if $test X"$uidsize" = X"$intsize"; then
22670 if $test X"$uidsize" = X"$shortsize"; then
22679 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22681 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22682 $cat >try.c <<'EOM'
22683 /* Intentionally a long probe as I'd like to sanity check that the exact
22684 approach is going to work, as thinking it will work, but only having it
22685 part working at runtime is worse than not having it. */
22687 #include <sys/types.h>
22688 #include <sys/sysctl.h>
22689 #include <sys/param.h>
22691 #include <string.h>
22692 #include <stdlib.h>
22693 #include <unistd.h>
22696 main(int argc, char **argv) {
22698 char *argv_leaf = strrchr(argv[0], '/');
22704 mib[1] = KERN_PROC;
22705 mib[2] = KERN_PROC_PATHNAME;
22709 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22713 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22718 if (size < strlen(argv_leaf) + 1) {
22719 fprintf(stderr, "size %lu is too short for a path\n",
22720 (unsigned long) size);
22724 if (size > MAXPATHLEN * MAXPATHLEN) {
22725 fprintf(stderr, "size %lu is too long for a path\n",
22726 (unsigned long) size);
22730 buffer = malloc(size);
22736 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22741 if (strlen(buffer) + 1 != size) {
22742 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22743 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22748 if (*buffer != '/') {
22749 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22753 if (strstr(buffer, "/./")) {
22754 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22758 if (strstr(buffer, "/../")) {
22759 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22763 buffer_leaf = strrchr(buffer, '/');
22764 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22765 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22777 if eval $compile; then
22778 if $run ./try; then
22779 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22782 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22786 echo "I'm unable to compile the test program." >&4
22787 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22791 set usekernprocpathname
22794 : Determine if we can use _NSGetExecutablePath to find executing program
22796 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22797 $cat >try.c <<'EOM'
22798 /* Intentionally a long probe as I'd like to sanity check that the exact
22799 approach is going to work, as thinking it will work, but only having it
22800 part working at runtime is worse than not having it. */
22801 #include <mach-o/dyld.h>
22803 #include <stdlib.h>
22804 #include <sys/param.h>
22805 #include <string.h>
22808 main(int argc, char **argv) {
22810 uint32_t size = sizeof(buf);
22814 char *argv_leaf = strrchr(argv[0], '/');
22818 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22822 _NSGetExecutablePath(buf, &size);
22823 if (size > MAXPATHLEN * MAXPATHLEN) {
22824 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22825 (unsigned int) size);
22829 buffer = malloc(size);
22835 result = _NSGetExecutablePath(buffer, &size);
22837 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22838 result, (unsigned int) size);
22842 tidied = realpath(buffer, NULL);
22844 perror("realpath");
22850 if (*tidied != '/') {
22851 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22855 if (strstr(tidied, "/./")) {
22856 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22860 if (strstr(tidied, "/../")) {
22861 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22865 tidied_leaf = strrchr(tidied, '/');
22866 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22867 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22879 if eval $compile; then
22880 if $run ./try; then
22881 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22884 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22887 echo "I'm unable to compile the test program." >&4
22888 echo "I'll assume no _NSGetExecutablePath here." >&4
22891 set usensgetexecutablepath
22894 : Check if site customization support was requested
22895 case "$usesitecustomize" in
22896 $define|true|[Yy]*)
22897 usesitecustomize="$define"
22900 usesitecustomize="$undef"
22904 : see if prototypes support variable argument declarations
22906 case "$prototype$i_stdarg" in
22908 echo "It appears we'll be able to prototype varargs functions." >&4
22912 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22919 : determine compiler compiler
22928 if $test -f "$byacc$_exe"; then
22930 comp="byacc or $comp"
22932 if $test -f "$bison$_exe"; then
22933 comp="$comp or bison -y"
22935 rp="Which compiler compiler ($comp) shall I use?"
22944 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22950 : see if this is a assert.h system
22951 set assert.h i_assert
22954 : see if this is a bfd.h system
22958 : see if this is an execinfo.h system
22959 set execinfo.h i_execinfo
22962 : see if this is a fenv.h system
22966 : see if this is a fp.h system
22970 : see if this is a fp_class.h system
22971 set fp_class.h i_fp_class
22974 : see if gdbm.h is available
22979 : see if gdbm_open exists
22980 set gdbm_open d_gdbm_open
22982 case "$d_gdbm_open" in
22985 echo "We won't be including <gdbm.h>"
22994 : see if this is a ieeefp.h system
22995 case "$i_ieeefp" in
22996 '' ) set ieeefp.h i_ieeefp
23001 : see if this is a libutil.h system
23002 set libutil.h i_libutil
23005 : see if mach cthreads are available
23006 if test "X$usethreads" = "X$define"; then
23007 set mach/cthreads.h i_machcthr
23010 i_machcthr="$undef"
23013 : see if this is a mntent.h system
23014 set mntent.h i_mntent
23017 : see if net/errno.h is available
23019 set net/errno.h val
23022 : Unfortunately, it causes problems on some systems. Arrgh.
23025 cat > try.c <<'EOM'
23028 #include <net/errno.h>
23034 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23035 echo "We'll be including <net/errno.h>." >&4
23037 echo "We won't be including <net/errno.h>." >&4
23046 : see if netinet/tcp.h is available
23047 set netinet/tcp.h i_netinettcp
23050 : see if this is a poll.h system
23054 : see if this is a prot.h system
23058 : Preprocessor symbols
23060 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23061 $cat <<'EOSH' > Cppsym.know
23062 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23063 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23064 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23065 arch_pwr ardent ARM ARM32 atarist att386 att3b
23066 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23067 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23068 byteorder byte_order
23069 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23070 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23071 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23072 ELF encore EPI EXTENSIONS
23073 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23074 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23075 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23076 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23077 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23078 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23079 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23080 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23081 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23083 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23084 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23085 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23087 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23088 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23089 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23090 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23091 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23092 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23093 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23094 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23095 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23096 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23097 ns32000 ns32016 ns32332 ns32k nsc32000
23098 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23099 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23100 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23101 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23103 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23104 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23105 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23106 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23107 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23108 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23109 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23110 SYSV4 SYSV5 sysV68 sysV88
23111 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23112 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23113 tower32_800 tower32_850 tss
23114 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23115 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23116 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23117 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23118 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23119 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23121 vax venix VMESA vms
23122 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23123 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23126 # Maybe put other stuff here too.
23127 ./tr '-' '_' <<EOSH >>Cppsym.know
23130 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23131 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23132 $cat Cppsym.know > Cppsym.c
23133 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23134 $rm -f Cppsym.a Cppsym.b Cppsym.c
23135 cat <<EOSH > Cppsym
23137 if $test \$# -gt 0; then
23138 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23139 if $test -s Cppsym.got; then
23146 $tr " " "$trnl" | ./Cppsym.try
23152 cat <<EOSH > Cppsym.try
23154 cat <<'EOCP' > try.c
23157 #define STRINGIFY(a) "a"
23159 #if cpp_stuff == 42
23160 #define StGiFy(a) #a
23161 #define STRINGIFY(a) StGiFy(a)
23163 #if $cpp_stuff != 1 && $cpp_stuff != 42
23164 # include "Bletch: How does this C preprocessor stringify macros?"
23170 cat <<'EOSH' >> Cppsym.try
23172 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23173 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23174 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23175 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23177 echo 'return 0;}' >> try.c
23179 cat <<EOSH >> Cppsym.try
23181 case "$osname-$gccversion" in
23182 irix-) ccflags="\$ccflags -woff 1178" ;;
23183 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23185 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
23187 chmod +x Cppsym.try
23188 $eunicefix Cppsym.try
23189 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23190 : Add in any Linux cpp "predefined macros":
23191 case "$osname::$gccversion" in
23192 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23194 rm -f $tHdrH'.h' $tHdrH
23196 # Filter out macro arguments, such as Linux's __INT8_C(c)
23197 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23198 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23199 if [ -s $tHdrH'_cppsym.real' ]; then
23200 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23203 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23206 : now check the C compiler for additional symbols
23207 postprocess_cc_v=''
23209 aix) postprocess_cc_v="|$tr , ' '" ;;
23216 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23219 -D*) echo "\$i" | $sed 's/^-D//';;
23220 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23225 postprocess_cc_v=''
23228 ./ccsym > ccsym1.raw
23229 if $test -s ccsym1.raw; then
23230 $sort ccsym1.raw | $uniq >ccsym.raw
23232 mv ccsym1.raw ccsym.raw
23235 $awk '/\=/ { print $0; next }
23236 { print $0"=1" }' ccsym.raw >ccsym.list
23237 $comm -13 Cppsym.true ccsym.list >ccsym.own
23238 $comm -12 Cppsym.true ccsym.list >ccsym.com
23239 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23241 if $test -z ccsym.raw; then
23242 echo "Your C compiler doesn't seem to define any symbols!" >&4
23244 echo "However, your C preprocessor defines the following symbols:"
23247 cppsymbols=`$cat Cppsym.true`
23248 cppsymbols=`echo $cppsymbols`
23249 cppccsymbols="$cppsymbols"
23251 if $test -s ccsym.com; then
23252 echo "Your C compiler and pre-processor define these symbols:"
23253 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23256 cppccsymbols=`$cat ccsym.com`
23257 cppccsymbols=`echo $cppccsymbols`
23258 $test "$silent" || sleep 1
23260 if $test -s ccsym.cpp; then
23261 $test "$also" && echo " "
23262 echo "Your C pre-processor ${also}defines the following symbols:"
23263 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23265 cppsymbols=`$cat ccsym.cpp`
23266 cppsymbols=`echo $cppsymbols`
23267 $test "$silent" || sleep 1
23269 if $test -s ccsym.own; then
23270 $test "$also" && echo " "
23271 echo "Your C compiler ${also}defines the following cpp symbols:"
23272 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23273 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23274 ccsymbols=`$cat ccsym.own`
23275 ccsymbols=`echo $ccsymbols`
23276 $test "$silent" || sleep 1
23280 : add -D_FORTIFY_SOURCE if feasible and not already there
23281 case "$gccversion" in
23282 [45].*) case "$optimize$ccflags" in
23283 *-O*) case "$ccflags$cppsymbols" in
23284 *_FORTIFY_SOURCE=*) # Don't add it again.
23285 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23287 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23288 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23292 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23296 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23300 : see if this is a termio system
23304 if $test `./findhdr termios.h`; then
23305 set tcsetattr i_termios
23311 "$define") echo "You have POSIX termios.h... good!" >&4;;
23312 *) if ./Cppsym pyr; then
23313 case "`$run /bin/universe`" in
23314 ucb) if $test `./findhdr sgtty.h`; then
23316 echo "<sgtty.h> found." >&4
23318 echo "System is pyramid with BSD universe."
23319 ./warn "<sgtty.h> not found--you could have problems."
23321 *) if $test `./findhdr termio.h`; then
23323 echo "<termio.h> found." >&4
23325 echo "System is pyramid with USG universe."
23326 ./warn "<termio.h> not found--you could have problems."
23330 if $test `./findhdr termio.h`; then
23331 echo "<termio.h> found." >&4
23333 elif $test `./findhdr sgtty.h`; then
23334 echo "<sgtty.h> found." >&4
23337 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23340 if $test `./findhdr sgtty.h`; then
23341 echo "<sgtty.h> found." >&4
23343 elif $test `./findhdr termio.h`; then
23344 echo "<termio.h> found." >&4
23347 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23351 set i_termio; eval $setvar
23352 val=$val2; set i_sgtty; eval $setvar
23353 val=$val3; set i_termios; eval $setvar
23355 : see if stdbool is available
23356 : we want a real compile instead of Inhdr because some Solaris systems
23357 : have stdbool.h, but it can only be used if the compiler indicates it
23358 : is sufficiently c99-compliant.
23362 #include <stdbool.h>
23367 int main(int argc, char **argv)
23373 if eval $compile; then
23374 echo "<stdbool.h> found." >&4
23377 echo "<stdbool.h> NOT found." >&4
23384 : see if stddef is available
23385 set stddef.h i_stddef
23388 : see if stdint is available
23389 set stdint.h i_stdint
23392 : see if sys/access.h is available
23393 set sys/access.h i_sysaccess
23396 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23397 set sys/filio.h i_sysfilio
23400 if $test `./findhdr sys/ioctl.h`; then
23402 echo '<sys/ioctl.h> found.' >&4
23405 if $test $i_sysfilio = "$define"; then
23406 echo '<sys/ioctl.h> NOT found.' >&4
23408 $test $i_sgtty = "$define" && xxx="sgtty.h"
23409 $test $i_termio = "$define" && xxx="termio.h"
23410 $test $i_termios = "$define" && xxx="termios.h"
23411 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23417 : see if socket ioctl defs are in sys/sockio.h
23419 xxx=`./findhdr sys/sockio.h`
23420 if $test "$xxx"; then
23421 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23423 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23426 echo "No socket ioctls found in <sys/sockio.h>." >&4
23431 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23437 : see if this is a syslog.h system
23438 set syslog.h i_syslog
23441 : see if this is a sys/mode.h system
23442 set sys/mode.h i_sysmode
23445 : see if there is a sys/poll.h file
23446 set sys/poll.h i_syspoll
23449 : see if sys/resource.h has to be included
23450 set sys/resource.h i_sysresrc
23453 : see if sys/security.h is available
23454 set sys/security.h i_syssecrt
23457 : see if this is a sys/statvfs.h system
23458 set sys/statvfs.h i_sysstatvfs
23461 : see if this is a sys/un.h system
23462 set sys/un.h i_sysun
23465 : see if this is a sys/utsname.h system
23466 set sys/utsname.h i_sysutsname
23469 : see if this is a syswait system
23470 set sys/wait.h i_syswait
23473 : see if this is a ustat.h system
23474 set ustat.h i_ustat
23477 : see if this is an utime system
23478 set utime.h i_utime
23481 : see if this is a vfork system
23484 set vfork.h i_vfork
23494 echo "Looking for extensions..." >&4
23495 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23496 : contain old or inaccurate or duplicate values.
23497 nonxs_extensions=''
23499 : We do not use find because it might not be available.
23500 : We do not just use MANIFEST because the user may have dropped
23501 : some additional extensions into the source tree and expect them
23504 : Function to recursively find available extensions, ignoring DynaLoader
23505 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23506 : In 5.10.1 and later, extensions are stored in directories
23507 : like File-Glob instead of the older File/Glob/.
23511 DynaLoader|dynaload) ;;
23513 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23514 case "$this_ext" in
23515 Scalar/List/Utils) this_ext="List/Util" ;;
23516 PathTools) this_ext="Cwd" ;;
23518 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23519 if $contains " $this_ext " "$tdir/$$.tmp"; then
23521 echo "Duplicate directories detected for extension $xxx" >&4;
23522 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23523 case "$knowitall" in
23531 echo "Ok. Stopping Configure." >&4;
23532 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23535 echo "Ok. You will need to correct config.sh before running make." >&4;
23537 $ls -1 "$xxx" > "$tdir/$$.tmp";
23538 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23539 xs_extensions="$xs_extensions $this_ext";
23540 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23541 xs_extensions="$xs_extensions $this_ext";
23542 elif $test -d "$xxx"; then
23543 nonxs_extensions="$nonxs_extensions $this_ext";
23545 $rm -f "$tdir/$$.tmp";
23553 eval $find_extensions
23557 eval $find_extensions
23561 eval $find_extensions
23562 set X $xs_extensions
23564 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23565 set X $nonxs_extensions
23567 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23569 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23571 : Now see which are supported on this system.
23573 for xxx in $xs_extensions ; do
23577 amigaos) avail_ext="$avail_ext $xxx" ;;
23582 $define) avail_ext="$avail_ext $xxx" ;;
23585 GDBM_File|gdbm_fil)
23587 $define) avail_ext="$avail_ext $xxx" ;;
23590 I18N/Langinfo|i18n_lan)
23591 case "$i_langinfo$d_nl_langinfo" in
23592 $define$define) avail_ext="$avail_ext $xxx" ;;
23596 : XXX Do we need a useipcsysv variable here
23597 case "${d_msg}${d_sem}${d_shm}" in
23598 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23601 NDBM_File|ndbm_fil)
23604 case "$osname-$use64bitint" in
23607 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23610 *) avail_ext="$avail_ext $xxx" ;;
23615 ODBM_File|odbm_fil)
23616 case "${i_dbm}${i_rpcsvcdbm}" in
23618 case "$d_cplusplus" in
23619 define) ;; # delete as a function name will not work
23620 *) case "$osname-$use64bitint" in
23623 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23626 *) avail_ext="$avail_ext $xxx" ;;
23634 case "$useopcode" in
23635 true|define|y) avail_ext="$avail_ext $xxx" ;;
23639 case "$useposix" in
23640 true|define|y) avail_ext="$avail_ext $xxx" ;;
23644 case "$d_socket" in
23645 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23648 Sys/Syslog|sys/syslog)
23650 amigaos) ;; # not really very useful on AmigaOS
23652 : XXX syslog requires socket
23653 case "$d_socket" in
23654 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23660 case "$usethreads" in
23662 case "$use5005threads" in
23663 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23667 threads|threads/shared)
23668 # threads and threads::shared are special cases.
23669 # To stop people from asking "Perl 5.8.0 was supposed
23670 # to have this new fancy threads implementation but my
23671 # perl doesn't have it" and from people trying to
23672 # (re)install the threads module using CPAN.pm and
23673 # CPAN.pm then offering to reinstall Perl 5.8.0,
23674 # the threads.pm and threads/shared.pm will always be
23675 # there, croaking informatively ("you need to rebuild
23676 # all of Perl with threads, sorry") when threads haven't
23677 # been compiled in.
23679 avail_ext="$avail_ext $xxx"
23685 cygwin) avail_ext="$avail_ext $xxx" ;;
23688 XS/APItest|xs/apitest)
23689 # This is just for testing. Skip it unless we have dynamic loading.
23692 $define) avail_ext="$avail_ext $xxx" ;;
23695 XS/Typemap|xs/typemap)
23696 # This is just for testing. Skip it unless we have dynamic loading.
23698 $define) avail_ext="$avail_ext $xxx" ;;
23701 *) avail_ext="$avail_ext $xxx"
23710 case "$onlyextensions" in
23712 *) keepextensions=''
23713 echo "You have requested that only certain extensions be included..." >&4
23714 for i in $onlyextensions; do
23715 case " $avail_ext " in
23717 echo "Keeping extension $i."
23718 keepextensions="$keepextensions $i"
23720 *) echo "Ignoring extension $i." ;;
23723 avail_ext="$keepextensions"
23727 case "$noextensions" in
23729 *) keepextensions=''
23730 echo "You have requested that certain extensions be ignored..." >&4
23731 for i in $avail_ext; do
23732 case " $noextensions " in
23733 *" $i "*) echo "Ignoring extension $i." ;;
23734 *) echo "Keeping extension $i.";
23735 keepextensions="$keepextensions $i"
23739 avail_ext="$keepextensions"
23743 : Now see which nonxs extensions are supported on this system.
23744 : For now assume all are.
23746 for xxx in $nonxs_extensions ; do
23750 *) nonxs_ext="$nonxs_ext $xxx"
23762 A number of extensions are supplied with $package. You may choose to
23763 compile these extensions for dynamic loading (the default), compile
23764 them into the $package executable (static loading), or not include
23765 them at all. Answer "none" to include no extensions.
23766 Note that DynaLoader is always built and need not be mentioned here.
23769 case "$dynamic_ext" in
23771 : Exclude those listed in static_ext
23773 for xxx in $avail_ext; do
23774 case " $static_ext " in
23776 *) dflt="$dflt $xxx" ;;
23783 *) dflt="$dynamic_ext"
23784 # Perhaps we are reusing an old out-of-date config.sh.
23787 if test X"$dynamic_ext" != X"$avail_ext"; then
23789 NOTICE: Your previous config.sh list may be incorrect.
23790 The extensions now available to you are
23792 but the default list from your previous config.sh is
23804 rp="What extensions do you wish to load dynamically?"
23807 none) dynamic_ext=' ' ;;
23808 *) dynamic_ext="$ans" ;;
23811 case "$static_ext" in
23813 : Exclude those already listed in dynamic linking
23815 for xxx in $avail_ext; do
23816 case " $dynamic_ext " in
23818 *) dflt="$dflt $xxx" ;;
23825 *) dflt="$static_ext"
23832 rp="What extensions do you wish to load statically?"
23835 none) static_ext=' ' ;;
23836 *) static_ext="$ans" ;;
23841 A number of extensions are supplied with $package. Answer "none"
23842 to include no extensions.
23843 Note that DynaLoader is always built and need not be mentioned here.
23846 case "$static_ext" in
23847 '') dflt="$avail_ext" ;;
23848 *) dflt="$static_ext"
23849 # Perhaps we are reusing an old out-of-date config.sh.
23852 if test X"$static_ext" != X"$avail_ext"; then
23854 NOTICE: Your previous config.sh list may be incorrect.
23855 The extensions now available to you are
23857 but the default list from your previous config.sh is
23866 : Exclude those that are not xs extensions
23870 rp="What extensions do you wish to include?"
23873 none) static_ext=' ' ;;
23874 *) static_ext="$ans" ;;
23879 # Encode is a special case. If we are building Encode as a static
23880 # extension, we need to explicitly list its subextensions as well.
23881 # For other nested extensions, this is handled automatically by
23882 # the appropriate Makefile.PL.
23883 case " $static_ext " in
23884 *" Encode "*) # Add the subextensions of Encode
23886 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23887 static_ext="$static_ext Encode/$xxx"
23888 known_extensions="$known_extensions Encode/$xxx"
23894 set X $dynamic_ext $static_ext $nonxs_ext
23898 # Sanity check: We require an extension suitable for use with
23899 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23900 # should show up as failures in the test suite, but it's helpful to
23901 # catch them now.) The 'extensions' list is normally sorted
23902 # alphabetically, so we need to accept either
23903 # DB_File ... Fcntl ... IO ....
23904 # or something like
23905 # Fcntl ... NDBM_File ... IO ....
23906 case " $extensions" in
23907 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23908 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23909 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23910 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23911 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23915 : Remove libraries needed only for extensions
23916 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23917 : The exception is SunOS 4.x, which needs them.
23918 case "${osname}X${osvers}" in
23922 *) case "$usedl" in
23923 $define|true|[yY]*)
23924 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23928 *) perllibs="$libs"
23934 : Remove build directory name from cppstdin so it can be used from
23935 : either the present location or the final installed location.
23937 : Get out of the UU directory to get correct path name.
23939 case "$cppstdin" in
23941 echo "Stripping down cppstdin path name"
23947 : end of configuration questions
23949 echo "End of configuration questions."
23952 : back to where it started
23953 if test -d ../UU; then
23957 : configuration may be unconditionally patched via a 'config.arch' file
23958 if $test -f config.arch; then
23959 echo "I see a config.arch file, loading it." >&4
23963 : configuration may be patched via a 'config.over' file
23964 if $test -f config.over; then
23967 rp='I see a config.over file. Do you wish to load it?'
23970 n*) echo "OK, I'll ignore it.";;
23972 echo "Configuration override changes have been loaded."
23977 : in case they want portability, strip down executable paths
23978 case "$d_portable" in
23981 echo "Stripping down executable paths..." >&4
23982 for file in $loclist $trylist; do
23984 eval $file=`basename $temp`
23989 : create config.sh file
23991 echo "Creating config.sh..." >&4
23992 $spitshell <<EOT >config.sh
23995 # This file was produced by running the Configure script. It holds all the
23996 # definitions figured out by Configure. Should you modify one of these values,
23997 # do not forget to propagate your changes by running "Configure -der". You may
23998 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24001 # Package name : $package
24002 # Source directory : $src
24003 # Configuration time: $cf_time
24004 # Configured by : $cf_by
24005 # Target system : $myuname
24008 : Add in command line options if available
24009 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24011 $spitshell <<EOT >>config.sh
24020 Revision='$Revision'
24028 alignbytes='$alignbytes'
24029 ansi2knr='$ansi2knr'
24030 aphostname='$aphostname'
24031 api_revision='$api_revision'
24032 api_subversion='$api_subversion'
24033 api_version='$api_version'
24034 api_versionstring='$api_versionstring'
24037 archlibexp='$archlibexp'
24038 archname64='$archname64'
24039 archname='$archname'
24040 archobjs='$archobjs'
24041 asctime_r_proto='$asctime_r_proto'
24050 byteorder='$byteorder'
24052 castflags='$castflags'
24055 cccdlflags='$cccdlflags'
24056 ccdlflags='$ccdlflags'
24058 ccflags_uselargefiles='$ccflags_uselargefiles'
24060 ccsymbols='$ccsymbols'
24061 ccversion='$ccversion'
24063 cf_email='$cf_email'
24065 charbits='$charbits'
24066 charsize='$charsize'
24070 clocktype='$clocktype'
24072 compress='$compress'
24073 contains='$contains'
24077 cpp_stuff='$cpp_stuff'
24078 cppccsymbols='$cppccsymbols'
24079 cppflags='$cppflags'
24081 cppminus='$cppminus'
24083 cppstdin='$cppstdin'
24084 cppsymbols='$cppsymbols'
24085 crypt_r_proto='$crypt_r_proto'
24086 cryptlib='$cryptlib'
24088 ctermid_r_proto='$ctermid_r_proto'
24089 ctime_r_proto='$ctime_r_proto'
24090 d_Gconvert='$d_Gconvert'
24091 d_PRIEUldbl='$d_PRIEUldbl'
24092 d_PRIFUldbl='$d_PRIFUldbl'
24093 d_PRIGUldbl='$d_PRIGUldbl'
24094 d_PRIXU64='$d_PRIXU64'
24095 d_PRId64='$d_PRId64'
24096 d_PRIeldbl='$d_PRIeldbl'
24097 d_PRIfldbl='$d_PRIfldbl'
24098 d_PRIgldbl='$d_PRIgldbl'
24099 d_PRIi64='$d_PRIi64'
24100 d_PRIo64='$d_PRIo64'
24101 d_PRIu64='$d_PRIu64'
24102 d_PRIx64='$d_PRIx64'
24103 d_SCNfldbl='$d_SCNfldbl'
24104 d__fwalk='$d__fwalk'
24105 d_access='$d_access'
24106 d_accessx='$d_accessx'
24110 d_archlib='$d_archlib'
24111 d_asctime64='$d_asctime64'
24112 d_asctime_r='$d_asctime_r'
24117 d_attribute_deprecated='$d_attribute_deprecated'
24118 d_attribute_format='$d_attribute_format'
24119 d_attribute_malloc='$d_attribute_malloc'
24120 d_attribute_nonnull='$d_attribute_nonnull'
24121 d_attribute_noreturn='$d_attribute_noreturn'
24122 d_attribute_pure='$d_attribute_pure'
24123 d_attribute_unused='$d_attribute_unused'
24124 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24125 d_backtrace='$d_backtrace'
24129 d_bsdgetpgrp='$d_bsdgetpgrp'
24130 d_bsdsetpgrp='$d_bsdsetpgrp'
24131 d_builtin_choose_expr='$d_builtin_choose_expr'
24132 d_builtin_expect='$d_builtin_expect'
24134 d_c99_variadic_macros='$d_c99_variadic_macros'
24135 d_casti32='$d_casti32'
24136 d_castneg='$d_castneg'
24138 d_charvspr='$d_charvspr'
24140 d_chroot='$d_chroot'
24141 d_chsize='$d_chsize'
24143 d_clearenv='$d_clearenv'
24144 d_closedir='$d_closedir'
24145 d_cmsghdr_s='$d_cmsghdr_s'
24147 d_copysign='$d_copysign'
24148 d_copysignl='$d_copysignl'
24149 d_cplusplus='$d_cplusplus'
24151 d_crypt_r='$d_crypt_r'
24153 d_ctermid='$d_ctermid'
24154 d_ctermid_r='$d_ctermid_r'
24155 d_ctime64='$d_ctime64'
24156 d_ctime_r='$d_ctime_r'
24157 d_cuserid='$d_cuserid'
24158 d_dbl_dig='$d_dbl_dig'
24159 d_dbminitproto='$d_dbminitproto'
24160 d_difftime64='$d_difftime64'
24161 d_difftime='$d_difftime'
24162 d_dir_dd_fd='$d_dir_dd_fd'
24164 d_dirnamlen='$d_dirnamlen'
24165 d_dladdr='$d_dladdr'
24166 d_dlerror='$d_dlerror'
24167 d_dlopen='$d_dlopen'
24168 d_dlsymun='$d_dlsymun'
24169 d_dosuid='$d_dosuid'
24170 d_drand48_r='$d_drand48_r'
24171 d_drand48proto='$d_drand48proto'
24173 d_eaccess='$d_eaccess'
24174 d_endgrent='$d_endgrent'
24175 d_endgrent_r='$d_endgrent_r'
24176 d_endhent='$d_endhent'
24177 d_endhostent_r='$d_endhostent_r'
24178 d_endnent='$d_endnent'
24179 d_endnetent_r='$d_endnetent_r'
24180 d_endpent='$d_endpent'
24181 d_endprotoent_r='$d_endprotoent_r'
24182 d_endpwent='$d_endpwent'
24183 d_endpwent_r='$d_endpwent_r'
24184 d_endsent='$d_endsent'
24185 d_endservent_r='$d_endservent_r'
24186 d_eofnblk='$d_eofnblk'
24189 d_eunice='$d_eunice'
24192 d_faststdio='$d_faststdio'
24193 d_fchdir='$d_fchdir'
24194 d_fchmod='$d_fchmod'
24195 d_fchown='$d_fchown'
24197 d_fcntl_can_lock='$d_fcntl_can_lock'
24198 d_fd_macros='$d_fd_macros'
24199 d_fd_set='$d_fd_set'
24201 d_fds_bits='$d_fds_bits'
24202 d_fegetround='$d_fegetround'
24203 d_fgetpos='$d_fgetpos'
24204 d_finite='$d_finite'
24205 d_finitel='$d_finitel'
24206 d_flexfnam='$d_flexfnam'
24208 d_flockproto='$d_flockproto'
24213 d_fp_class='$d_fp_class'
24214 d_fp_classify='$d_fp_classify'
24215 d_fp_classl='$d_fp_classl'
24216 d_fpathconf='$d_fpathconf'
24217 d_fpclass='$d_fpclass'
24218 d_fpclassify='$d_fpclassify'
24219 d_fpclassl='$d_fpclassl'
24220 d_fpgetround='$d_fpgetround'
24221 d_fpos64_t='$d_fpos64_t'
24222 d_frexpl='$d_frexpl'
24223 d_fs_data_s='$d_fs_data_s'
24224 d_fseeko='$d_fseeko'
24225 d_fsetpos='$d_fsetpos'
24226 d_fstatfs='$d_fstatfs'
24227 d_fstatvfs='$d_fstatvfs'
24229 d_ftello='$d_ftello'
24231 d_futimes='$d_futimes'
24232 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24233 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24234 d_getaddrinfo='$d_getaddrinfo'
24235 d_getcwd='$d_getcwd'
24236 d_getespwnam='$d_getespwnam'
24237 d_getfsstat='$d_getfsstat'
24238 d_getgrent='$d_getgrent'
24239 d_getgrent_r='$d_getgrent_r'
24240 d_getgrgid_r='$d_getgrgid_r'
24241 d_getgrnam_r='$d_getgrnam_r'
24242 d_getgrps='$d_getgrps'
24243 d_gethbyaddr='$d_gethbyaddr'
24244 d_gethbyname='$d_gethbyname'
24245 d_gethent='$d_gethent'
24246 d_gethname='$d_gethname'
24247 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24248 d_gethostbyname_r='$d_gethostbyname_r'
24249 d_gethostent_r='$d_gethostent_r'
24250 d_gethostprotos='$d_gethostprotos'
24251 d_getitimer='$d_getitimer'
24252 d_getlogin='$d_getlogin'
24253 d_getlogin_r='$d_getlogin_r'
24254 d_getmnt='$d_getmnt'
24255 d_getmntent='$d_getmntent'
24256 d_getnameinfo='$d_getnameinfo'
24257 d_getnbyaddr='$d_getnbyaddr'
24258 d_getnbyname='$d_getnbyname'
24259 d_getnent='$d_getnent'
24260 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24261 d_getnetbyname_r='$d_getnetbyname_r'
24262 d_getnetent_r='$d_getnetent_r'
24263 d_getnetprotos='$d_getnetprotos'
24264 d_getpagsz='$d_getpagsz'
24265 d_getpbyname='$d_getpbyname'
24266 d_getpbynumber='$d_getpbynumber'
24267 d_getpent='$d_getpent'
24268 d_getpgid='$d_getpgid'
24269 d_getpgrp2='$d_getpgrp2'
24270 d_getpgrp='$d_getpgrp'
24271 d_getppid='$d_getppid'
24272 d_getprior='$d_getprior'
24273 d_getprotobyname_r='$d_getprotobyname_r'
24274 d_getprotobynumber_r='$d_getprotobynumber_r'
24275 d_getprotoent_r='$d_getprotoent_r'
24276 d_getprotoprotos='$d_getprotoprotos'
24277 d_getprpwnam='$d_getprpwnam'
24278 d_getpwent='$d_getpwent'
24279 d_getpwent_r='$d_getpwent_r'
24280 d_getpwnam_r='$d_getpwnam_r'
24281 d_getpwuid_r='$d_getpwuid_r'
24282 d_getsbyname='$d_getsbyname'
24283 d_getsbyport='$d_getsbyport'
24284 d_getsent='$d_getsent'
24285 d_getservbyname_r='$d_getservbyname_r'
24286 d_getservbyport_r='$d_getservbyport_r'
24287 d_getservent_r='$d_getservent_r'
24288 d_getservprotos='$d_getservprotos'
24289 d_getspnam='$d_getspnam'
24290 d_getspnam_r='$d_getspnam_r'
24291 d_gettimeod='$d_gettimeod'
24292 d_gmtime64='$d_gmtime64'
24293 d_gmtime_r='$d_gmtime_r'
24294 d_gnulibc='$d_gnulibc'
24295 d_grpasswd='$d_grpasswd'
24296 d_hasmntopt='$d_hasmntopt'
24300 d_ilogbl='$d_ilogbl'
24301 d_inc_version_list='$d_inc_version_list'
24303 d_inetaton='$d_inetaton'
24304 d_inetntop='$d_inetntop'
24305 d_inetpton='$d_inetpton'
24306 d_int64_t='$d_int64_t'
24307 d_ip_mreq='$d_ip_mreq'
24308 d_ip_mreq_source='$d_ip_mreq_source'
24309 d_ipv6_mreq='$d_ipv6_mreq'
24310 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24311 d_isascii='$d_isascii'
24312 d_isblank='$d_isblank'
24313 d_isfinite='$d_isfinite'
24314 d_isfinitel='$d_isfinitel'
24316 d_isinfl='$d_isinfl'
24317 d_isless='$d_isless'
24319 d_isnanl='$d_isnanl'
24320 d_isnormal='$d_isnormal'
24323 d_killpg='$d_killpg'
24324 d_lc_monetary_2008='$d_lc_monetary_2008'
24325 d_lchown='$d_lchown'
24326 d_ldbl_dig='$d_ldbl_dig'
24327 d_ldexpl='$d_ldexpl'
24328 d_lgamma='$d_lgamma'
24329 d_lgamma_r='$d_lgamma_r'
24330 d_libm_lib_version='$d_libm_lib_version'
24331 d_libname_unique='$d_libname_unique'
24333 d_llrint='$d_llrint'
24334 d_llrintl='$d_llrintl'
24335 d_llround='$d_llround'
24336 d_llroundl='$d_llroundl'
24337 d_localtime64='$d_localtime64'
24338 d_localtime_r='$d_localtime_r'
24339 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24340 d_locconv='$d_locconv'
24345 d_longdbl='$d_longdbl'
24346 d_longlong='$d_longlong'
24348 d_lrintl='$d_lrintl'
24349 d_lround='$d_lround'
24350 d_lroundl='$d_lroundl'
24351 d_lseekproto='$d_lseekproto'
24353 d_madvise='$d_madvise'
24354 d_malloc_good_size='$d_malloc_good_size'
24355 d_malloc_size='$d_malloc_size'
24357 d_mbstowcs='$d_mbstowcs'
24358 d_mbtowc='$d_mbtowc'
24359 d_memchr='$d_memchr'
24360 d_memcmp='$d_memcmp'
24361 d_memcpy='$d_memcpy'
24362 d_memmove='$d_memmove'
24363 d_memset='$d_memset'
24365 d_mkdtemp='$d_mkdtemp'
24366 d_mkfifo='$d_mkfifo'
24367 d_mkstemp='$d_mkstemp'
24368 d_mkstemps='$d_mkstemps'
24369 d_mktime64='$d_mktime64'
24370 d_mktime='$d_mktime'
24373 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24374 d_modflproto='$d_modflproto'
24375 d_mprotect='$d_mprotect'
24377 d_msg_ctrunc='$d_msg_ctrunc'
24378 d_msg_dontroute='$d_msg_dontroute'
24379 d_msg_oob='$d_msg_oob'
24380 d_msg_peek='$d_msg_peek'
24381 d_msg_proxy='$d_msg_proxy'
24382 d_msgctl='$d_msgctl'
24383 d_msgget='$d_msgget'
24384 d_msghdr_s='$d_msghdr_s'
24385 d_msgrcv='$d_msgrcv'
24386 d_msgsnd='$d_msgsnd'
24388 d_munmap='$d_munmap'
24389 d_mymalloc='$d_mymalloc'
24392 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24393 d_nearbyint='$d_nearbyint'
24394 d_nextafter='$d_nextafter'
24395 d_nexttoward='$d_nexttoward'
24397 d_nl_langinfo='$d_nl_langinfo'
24398 d_nv_preserves_uv='$d_nv_preserves_uv'
24399 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24400 d_off64_t='$d_off64_t'
24401 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24402 d_oldpthreads='$d_oldpthreads'
24403 d_oldsock='$d_oldsock'
24405 d_pathconf='$d_pathconf'
24407 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24408 d_phostname='$d_phostname'
24411 d_portable='$d_portable'
24413 d_prctl_set_name='$d_prctl_set_name'
24414 d_printf_format_null='$d_printf_format_null'
24415 d_procselfexe='$d_procselfexe'
24416 d_pseudofork='$d_pseudofork'
24417 d_pthread_atfork='$d_pthread_atfork'
24418 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24419 d_pthread_yield='$d_pthread_yield'
24420 d_ptrdiff_t='$d_ptrdiff_t'
24422 d_pwchange='$d_pwchange'
24423 d_pwclass='$d_pwclass'
24424 d_pwcomment='$d_pwcomment'
24425 d_pwexpire='$d_pwexpire'
24426 d_pwgecos='$d_pwgecos'
24427 d_pwpasswd='$d_pwpasswd'
24428 d_pwquota='$d_pwquota'
24431 d_random_r='$d_random_r'
24432 d_re_comp='$d_re_comp'
24433 d_readdir64_r='$d_readdir64_r'
24434 d_readdir='$d_readdir'
24435 d_readdir_r='$d_readdir_r'
24436 d_readlink='$d_readlink'
24438 d_recvmsg='$d_recvmsg'
24439 d_regcmp='$d_regcmp'
24440 d_regcomp='$d_regcomp'
24441 d_remainder='$d_remainder'
24442 d_remquo='$d_remquo'
24443 d_rename='$d_rename'
24444 d_rewinddir='$d_rewinddir'
24448 d_safebcpy='$d_safebcpy'
24449 d_safemcpy='$d_safemcpy'
24450 d_sanemcmp='$d_sanemcmp'
24451 d_sbrkproto='$d_sbrkproto'
24452 d_scalbn='$d_scalbn'
24453 d_scalbnl='$d_scalbnl'
24454 d_sched_yield='$d_sched_yield'
24455 d_scm_rights='$d_scm_rights'
24456 d_seekdir='$d_seekdir'
24457 d_select='$d_select'
24459 d_semctl='$d_semctl'
24460 d_semctl_semid_ds='$d_semctl_semid_ds'
24461 d_semctl_semun='$d_semctl_semun'
24462 d_semget='$d_semget'
24464 d_sendmsg='$d_sendmsg'
24465 d_setegid='$d_setegid'
24466 d_seteuid='$d_seteuid'
24467 d_setgrent='$d_setgrent'
24468 d_setgrent_r='$d_setgrent_r'
24469 d_setgrps='$d_setgrps'
24470 d_sethent='$d_sethent'
24471 d_sethostent_r='$d_sethostent_r'
24472 d_setitimer='$d_setitimer'
24473 d_setlinebuf='$d_setlinebuf'
24474 d_setlocale='$d_setlocale'
24475 d_setlocale_r='$d_setlocale_r'
24476 d_setnent='$d_setnent'
24477 d_setnetent_r='$d_setnetent_r'
24478 d_setpent='$d_setpent'
24479 d_setpgid='$d_setpgid'
24480 d_setpgrp2='$d_setpgrp2'
24481 d_setpgrp='$d_setpgrp'
24482 d_setprior='$d_setprior'
24483 d_setproctitle='$d_setproctitle'
24484 d_setprotoent_r='$d_setprotoent_r'
24485 d_setpwent='$d_setpwent'
24486 d_setpwent_r='$d_setpwent_r'
24487 d_setregid='$d_setregid'
24488 d_setresgid='$d_setresgid'
24489 d_setresuid='$d_setresuid'
24490 d_setreuid='$d_setreuid'
24491 d_setrgid='$d_setrgid'
24492 d_setruid='$d_setruid'
24493 d_setsent='$d_setsent'
24494 d_setservent_r='$d_setservent_r'
24495 d_setsid='$d_setsid'
24496 d_setvbuf='$d_setvbuf'
24499 d_shmatprototype='$d_shmatprototype'
24500 d_shmctl='$d_shmctl'
24502 d_shmget='$d_shmget'
24503 d_sigaction='$d_sigaction'
24504 d_signbit='$d_signbit'
24505 d_sigprocmask='$d_sigprocmask'
24506 d_sigsetjmp='$d_sigsetjmp'
24507 d_sin6_scope_id='$d_sin6_scope_id'
24508 d_sitearch='$d_sitearch'
24509 d_snprintf='$d_snprintf'
24510 d_sockaddr_in6='$d_sockaddr_in6'
24511 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24512 d_sockatmark='$d_sockatmark'
24513 d_sockatmarkproto='$d_sockatmarkproto'
24514 d_socket='$d_socket'
24515 d_socklen_t='$d_socklen_t'
24516 d_sockpair='$d_sockpair'
24517 d_socks5_init='$d_socks5_init'
24518 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24520 d_srand48_r='$d_srand48_r'
24521 d_srandom_r='$d_srandom_r'
24522 d_sresgproto='$d_sresgproto'
24523 d_sresuproto='$d_sresuproto'
24525 d_statblks='$d_statblks'
24526 d_statfs_f_flags='$d_statfs_f_flags'
24527 d_statfs_s='$d_statfs_s'
24528 d_static_inline='$d_static_inline'
24529 d_statvfs='$d_statvfs'
24530 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24531 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24532 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24533 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24534 d_stdio_stream_array='$d_stdio_stream_array'
24535 d_stdiobase='$d_stdiobase'
24536 d_stdstdio='$d_stdstdio'
24537 d_strchr='$d_strchr'
24538 d_strcoll='$d_strcoll'
24539 d_strctcpy='$d_strctcpy'
24540 d_strerrm='$d_strerrm'
24541 d_strerror='$d_strerror'
24542 d_strerror_r='$d_strerror_r'
24543 d_strftime='$d_strftime'
24544 d_strlcat='$d_strlcat'
24545 d_strlcpy='$d_strlcpy'
24546 d_strtod='$d_strtod'
24547 d_strtol='$d_strtol'
24548 d_strtold='$d_strtold'
24549 d_strtoll='$d_strtoll'
24550 d_strtoq='$d_strtoq'
24551 d_strtoul='$d_strtoul'
24552 d_strtoull='$d_strtoull'
24553 d_strtouq='$d_strtouq'
24554 d_strxfrm='$d_strxfrm'
24555 d_suidsafe='$d_suidsafe'
24556 d_symlink='$d_symlink'
24557 d_syscall='$d_syscall'
24558 d_syscallproto='$d_syscallproto'
24559 d_sysconf='$d_sysconf'
24560 d_sysernlst='$d_sysernlst'
24561 d_syserrlst='$d_syserrlst'
24562 d_system='$d_system'
24563 d_tcgetpgrp='$d_tcgetpgrp'
24564 d_tcsetpgrp='$d_tcsetpgrp'
24565 d_telldir='$d_telldir'
24566 d_telldirproto='$d_telldirproto'
24567 d_tgamma='$d_tgamma'
24569 d_timegm='$d_timegm'
24571 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24572 d_tm_tm_zone='$d_tm_tm_zone'
24573 d_tmpnam_r='$d_tmpnam_r'
24575 d_truncate='$d_truncate'
24576 d_truncl='$d_truncl'
24577 d_ttyname_r='$d_ttyname_r'
24578 d_tzname='$d_tzname'
24579 d_u32align='$d_u32align'
24580 d_ualarm='$d_ualarm'
24583 d_union_semun='$d_union_semun'
24584 d_unordered='$d_unordered'
24585 d_unsetenv='$d_unsetenv'
24586 d_usleep='$d_usleep'
24587 d_usleepproto='$d_usleepproto'
24589 d_vendorarch='$d_vendorarch'
24590 d_vendorbin='$d_vendorbin'
24591 d_vendorlib='$d_vendorlib'
24592 d_vendorscript='$d_vendorscript'
24594 d_void_closedir='$d_void_closedir'
24595 d_voidsig='$d_voidsig'
24596 d_voidtty='$d_voidtty'
24597 d_volatile='$d_volatile'
24598 d_vprintf='$d_vprintf'
24599 d_vsnprintf='$d_vsnprintf'
24601 d_waitpid='$d_waitpid'
24602 d_wcscmp='$d_wcscmp'
24603 d_wcstombs='$d_wcstombs'
24604 d_wcsxfrm='$d_wcsxfrm'
24605 d_wctomb='$d_wctomb'
24606 d_writev='$d_writev'
24609 db_hashtype='$db_hashtype'
24610 db_prefixtype='$db_prefixtype'
24611 db_version_major='$db_version_major'
24612 db_version_minor='$db_version_minor'
24613 db_version_patch='$db_version_patch'
24614 direntrytype='$direntrytype'
24617 doubleinfbytes='$doubleinfbytes'
24618 doublekind='$doublekind'
24619 doublemantbits='$doublemantbits'
24620 doublenanbytes='$doublenanbytes'
24621 doublesize='$doublesize'
24623 drand48_r_proto='$drand48_r_proto'
24625 dynamic_ext='$dynamic_ext'
24631 endgrent_r_proto='$endgrent_r_proto'
24632 endhostent_r_proto='$endhostent_r_proto'
24633 endnetent_r_proto='$endnetent_r_proto'
24634 endprotoent_r_proto='$endprotoent_r_proto'
24635 endpwent_r_proto='$endpwent_r_proto'
24636 endservent_r_proto='$endservent_r_proto'
24637 eunicefix='$eunicefix'
24640 extensions='$extensions'
24641 extern_C='$extern_C'
24643 fflushNULL='$fflushNULL'
24644 fflushall='$fflushall'
24646 firstmakefile='$firstmakefile'
24648 fpossize='$fpossize'
24649 fpostype='$fpostype'
24650 freetype='$freetype'
24653 full_csh='$full_csh'
24654 full_sed='$full_sed'
24655 gccansipedantic='$gccansipedantic'
24656 gccosandvers='$gccosandvers'
24657 gccversion='$gccversion'
24658 getgrent_r_proto='$getgrent_r_proto'
24659 getgrgid_r_proto='$getgrgid_r_proto'
24660 getgrnam_r_proto='$getgrnam_r_proto'
24661 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24662 gethostbyname_r_proto='$gethostbyname_r_proto'
24663 gethostent_r_proto='$gethostent_r_proto'
24664 getlogin_r_proto='$getlogin_r_proto'
24665 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24666 getnetbyname_r_proto='$getnetbyname_r_proto'
24667 getnetent_r_proto='$getnetent_r_proto'
24668 getprotobyname_r_proto='$getprotobyname_r_proto'
24669 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24670 getprotoent_r_proto='$getprotoent_r_proto'
24671 getpwent_r_proto='$getpwent_r_proto'
24672 getpwnam_r_proto='$getpwnam_r_proto'
24673 getpwuid_r_proto='$getpwuid_r_proto'
24674 getservbyname_r_proto='$getservbyname_r_proto'
24675 getservbyport_r_proto='$getservbyport_r_proto'
24676 getservent_r_proto='$getservent_r_proto'
24677 getspnam_r_proto='$getspnam_r_proto'
24678 gidformat='$gidformat'
24684 gmtime_r_proto='$gmtime_r_proto'
24685 gnulibc_version='$gnulibc_version'
24687 groupcat='$groupcat'
24688 groupstype='$groupstype'
24691 h_sysfile='$h_sysfile'
24694 hostgenerate='$hostgenerate'
24695 hostosname='$hostosname'
24696 hostperl='$hostperl'
24697 html1dir='$html1dir'
24698 html1direxp='$html1direxp'
24699 html3dir='$html3dir'
24700 html3direxp='$html3direxp'
24709 i_arpainet='$i_arpainet'
24710 i_assert='$i_assert'
24712 i_bsdioctl='$i_bsdioctl'
24716 i_dirent='$i_dirent'
24718 i_execinfo='$i_execinfo'
24723 i_fp_class='$i_fp_class'
24725 i_gdbm_ndbm='$i_gdbm_ndbm'
24726 i_gdbmndbm='$i_gdbmndbm'
24728 i_ieeefp='$i_ieeefp'
24729 i_inttypes='$i_inttypes'
24730 i_langinfo='$i_langinfo'
24731 i_libutil='$i_libutil'
24732 i_limits='$i_limits'
24733 i_locale='$i_locale'
24734 i_machcthr='$i_machcthr'
24735 i_malloc='$i_malloc'
24736 i_mallocmalloc='$i_mallocmalloc'
24738 i_memory='$i_memory'
24739 i_mntent='$i_mntent'
24742 i_neterrno='$i_neterrno'
24743 i_netinettcp='$i_netinettcp'
24747 i_pthread='$i_pthread'
24749 i_quadmath='$i_quadmath'
24750 i_rpcsvcdbm='$i_rpcsvcdbm'
24752 i_shadow='$i_shadow'
24754 i_stdarg='$i_stdarg'
24755 i_stdbool='$i_stdbool'
24756 i_stddef='$i_stddef'
24757 i_stdint='$i_stdint'
24758 i_stdlib='$i_stdlib'
24759 i_string='$i_string'
24760 i_sunmath='$i_sunmath'
24761 i_sysaccess='$i_sysaccess'
24762 i_sysdir='$i_sysdir'
24763 i_sysfile='$i_sysfile'
24764 i_sysfilio='$i_sysfilio'
24766 i_sysioctl='$i_sysioctl'
24767 i_syslog='$i_syslog'
24768 i_sysmman='$i_sysmman'
24769 i_sysmode='$i_sysmode'
24770 i_sysmount='$i_sysmount'
24771 i_sysndir='$i_sysndir'
24772 i_sysparam='$i_sysparam'
24773 i_syspoll='$i_syspoll'
24774 i_sysresrc='$i_sysresrc'
24775 i_syssecrt='$i_syssecrt'
24776 i_sysselct='$i_sysselct'
24777 i_syssockio='$i_syssockio'
24778 i_sysstat='$i_sysstat'
24779 i_sysstatfs='$i_sysstatfs'
24780 i_sysstatvfs='$i_sysstatvfs'
24781 i_systime='$i_systime'
24782 i_systimek='$i_systimek'
24783 i_systimes='$i_systimes'
24784 i_systypes='$i_systypes'
24785 i_sysuio='$i_sysuio'
24787 i_sysutsname='$i_sysutsname'
24788 i_sysvfs='$i_sysvfs'
24789 i_syswait='$i_syswait'
24790 i_termio='$i_termio'
24791 i_termios='$i_termios'
24793 i_unistd='$i_unistd'
24796 i_values='$i_values'
24797 i_varargs='$i_varargs'
24798 i_varhdr='$i_varhdr'
24800 ignore_versioned_solibs='$ignore_versioned_solibs'
24801 inc_version_list='$inc_version_list'
24802 inc_version_list_init='$inc_version_list_init'
24806 initialinstalllocation='$initialinstalllocation'
24807 installarchlib='$installarchlib'
24808 installbin='$installbin'
24809 installhtml1dir='$installhtml1dir'
24810 installhtml3dir='$installhtml3dir'
24811 installman1dir='$installman1dir'
24812 installman3dir='$installman3dir'
24813 installprefix='$installprefix'
24814 installprefixexp='$installprefixexp'
24815 installprivlib='$installprivlib'
24816 installscript='$installscript'
24817 installsitearch='$installsitearch'
24818 installsitebin='$installsitebin'
24819 installsitehtml1dir='$installsitehtml1dir'
24820 installsitehtml3dir='$installsitehtml3dir'
24821 installsitelib='$installsitelib'
24822 installsiteman1dir='$installsiteman1dir'
24823 installsiteman3dir='$installsiteman3dir'
24824 installsitescript='$installsitescript'
24825 installstyle='$installstyle'
24826 installusrbinperl='$installusrbinperl'
24827 installvendorarch='$installvendorarch'
24828 installvendorbin='$installvendorbin'
24829 installvendorhtml1dir='$installvendorhtml1dir'
24830 installvendorhtml3dir='$installvendorhtml3dir'
24831 installvendorlib='$installvendorlib'
24832 installvendorman1dir='$installvendorman1dir'
24833 installvendorman3dir='$installvendorman3dir'
24834 installvendorscript='$installvendorscript'
24836 issymlink='$issymlink'
24837 ivdformat='$ivdformat'
24840 known_extensions='$known_extensions'
24843 ld_can_script='$ld_can_script'
24844 lddlflags='$lddlflags'
24846 ldflags_uselargefiles='$ldflags_uselargefiles'
24847 ldlibpthname='$ldlibpthname'
24854 libsdirs='$libsdirs'
24855 libsfiles='$libsfiles'
24856 libsfound='$libsfound'
24857 libspath='$libspath'
24858 libswanted='$libswanted'
24859 libswanted_uselargefiles='$libswanted_uselargefiles'
24865 localtime_r_proto='$localtime_r_proto'
24866 locincpth='$locincpth'
24867 loclibpth='$loclibpth'
24868 longdblinfbytes='$longdblinfbytes'
24869 longdblkind='$longdblkind'
24870 longdblmantbits='$longdblmantbits'
24871 longdblnanbytes='$longdblnanbytes'
24872 longdblsize='$longdblsize'
24873 longlongsize='$longlongsize'
24874 longsize='$longsize'
24878 lseeksize='$lseeksize'
24879 lseektype='$lseektype'
24883 make_set_make='$make_set_make'
24884 mallocobj='$mallocobj'
24885 mallocsrc='$mallocsrc'
24886 malloctype='$malloctype'
24888 man1direxp='$man1direxp'
24891 man3direxp='$man3direxp'
24893 mips_type='$mips_type'
24894 mistrustnm='$mistrustnm'
24896 mmaptype='$mmaptype'
24897 modetype='$modetype'
24899 multiarch='$multiarch'
24901 myarchname='$myarchname'
24902 mydomain='$mydomain'
24903 myhostname='$myhostname'
24906 need_va_copy='$need_va_copy'
24907 netdb_hlen_type='$netdb_hlen_type'
24908 netdb_host_type='$netdb_host_type'
24909 netdb_name_type='$netdb_name_type'
24910 netdb_net_type='$netdb_net_type'
24913 nm_so_opt='$nm_so_opt'
24914 nonxs_ext='$nonxs_ext'
24916 nvEUformat='$nvEUformat'
24917 nvFUformat='$nvFUformat'
24918 nvGUformat='$nvGUformat'
24919 nv_overflows_integers_at='$nv_overflows_integers_at'
24920 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24921 nveformat='$nveformat'
24922 nvfformat='$nvfformat'
24923 nvgformat='$nvgformat'
24924 nvmantbits='$nvmantbits'
24927 o_nonblock='$o_nonblock'
24929 old_pthread_create_joinable='$old_pthread_create_joinable'
24930 optimize='$optimize'
24931 orderlib='$orderlib'
24934 otherlibdirs='$otherlibdirs'
24938 patchlevel='$patchlevel'
24939 path_sep='$path_sep'
24942 perl_patchlevel='$perl_patchlevel'
24943 perl_static_inline='$perl_static_inline'
24944 perladmin='$perladmin'
24945 perllibs='$perllibs'
24946 perlpath='$perlpath'
24948 phostname='$phostname'
24954 prefixexp='$prefixexp'
24956 privlibexp='$privlibexp'
24957 procselfexe='$procselfexe'
24958 prototype='$prototype'
24960 quadkind='$quadkind'
24961 quadtype='$quadtype'
24962 randbits='$randbits'
24963 randfunc='$randfunc'
24964 random_r_proto='$random_r_proto'
24965 randseedtype='$randseedtype'
24967 rd_nodata='$rd_nodata'
24968 readdir64_r_proto='$readdir64_r_proto'
24969 readdir_r_proto='$readdir_r_proto'
24970 revision='$revision'
24976 sGMTIME_max='$sGMTIME_max'
24977 sGMTIME_min='$sGMTIME_min'
24978 sLOCALTIME_max='$sLOCALTIME_max'
24979 sLOCALTIME_min='$sLOCALTIME_min'
24980 sPRIEUldbl='$sPRIEUldbl'
24981 sPRIFUldbl='$sPRIFUldbl'
24982 sPRIGUldbl='$sPRIGUldbl'
24983 sPRIXU64='$sPRIXU64'
24985 sPRIeldbl='$sPRIeldbl'
24986 sPRIfldbl='$sPRIfldbl'
24987 sPRIgldbl='$sPRIgldbl'
24992 sSCNfldbl='$sSCNfldbl'
24993 sched_yield='$sched_yield'
24994 scriptdir='$scriptdir'
24995 scriptdirexp='$scriptdirexp'
24997 seedfunc='$seedfunc'
24998 selectminbits='$selectminbits'
24999 selecttype='$selecttype'
25000 sendmail='$sendmail'
25001 setgrent_r_proto='$setgrent_r_proto'
25002 sethostent_r_proto='$sethostent_r_proto'
25003 setlocale_r_proto='$setlocale_r_proto'
25004 setnetent_r_proto='$setnetent_r_proto'
25005 setprotoent_r_proto='$setprotoent_r_proto'
25006 setpwent_r_proto='$setpwent_r_proto'
25007 setservent_r_proto='$setservent_r_proto'
25010 sharpbang='$sharpbang'
25011 shmattype='$shmattype'
25012 shortsize='$shortsize'
25015 sig_count='$sig_count'
25016 sig_name='$sig_name'
25017 sig_name_init='$sig_name_init'
25019 sig_num_init='$sig_num_init'
25020 sig_size='$sig_size'
25021 signal_t='$signal_t'
25022 sitearch='$sitearch'
25023 sitearchexp='$sitearchexp'
25025 sitebinexp='$sitebinexp'
25026 sitehtml1dir='$sitehtml1dir'
25027 sitehtml1direxp='$sitehtml1direxp'
25028 sitehtml3dir='$sitehtml3dir'
25029 sitehtml3direxp='$sitehtml3direxp'
25031 sitelib_stem='$sitelib_stem'
25032 sitelibexp='$sitelibexp'
25033 siteman1dir='$siteman1dir'
25034 siteman1direxp='$siteman1direxp'
25035 siteman3dir='$siteman3dir'
25036 siteman3direxp='$siteman3direxp'
25037 siteprefix='$siteprefix'
25038 siteprefixexp='$siteprefixexp'
25039 sitescript='$sitescript'
25040 sitescriptexp='$sitescriptexp'
25041 sizesize='$sizesize'
25042 sizetype='$sizetype'
25046 sockethdr='$sockethdr'
25047 socketlib='$socketlib'
25048 socksizetype='$socksizetype'
25050 spackage='$spackage'
25051 spitshell='$spitshell'
25052 srand48_r_proto='$srand48_r_proto'
25053 srandom_r_proto='$srandom_r_proto'
25055 ssizetype='$ssizetype'
25056 st_ino_sign='$st_ino_sign'
25057 st_ino_size='$st_ino_size'
25058 startperl='$startperl'
25060 static_ext='$static_ext'
25062 stdio_base='$stdio_base'
25063 stdio_bufsiz='$stdio_bufsiz'
25064 stdio_cnt='$stdio_cnt'
25065 stdio_filbuf='$stdio_filbuf'
25066 stdio_ptr='$stdio_ptr'
25067 stdio_stream_array='$stdio_stream_array'
25068 strerror_r_proto='$strerror_r_proto'
25071 subversion='$subversion'
25076 targetarch='$targetarch'
25077 targetdir='$targetdir'
25078 targetenv='$targetenv'
25079 targethost='$targethost'
25080 targetmkdir='$targetmkdir'
25081 targetport='$targetport'
25082 targetsh='$targetsh'
25086 timeincl='$timeincl'
25087 timetype='$timetype'
25088 tmpnam_r_proto='$tmpnam_r_proto'
25094 ttyname_r_proto='$ttyname_r_proto'
25103 uidformat='$uidformat'
25109 uquadtype='$uquadtype'
25110 use5005threads='$use5005threads'
25111 use64bitall='$use64bitall'
25112 use64bitint='$use64bitint'
25113 usecbacktrace='$usecbacktrace'
25114 usecrosscompile='$usecrosscompile'
25115 usedevel='$usedevel'
25117 usedtrace='$usedtrace'
25118 usefaststdio='$usefaststdio'
25119 useithreads='$useithreads'
25120 usekernprocpathname='$usekernprocpathname'
25121 uselargefiles='$uselargefiles'
25122 uselongdouble='$uselongdouble'
25123 usemallocwrap='$usemallocwrap'
25124 usemorebits='$usemorebits'
25125 usemultiplicity='$usemultiplicity'
25126 usemymalloc='$usemymalloc'
25128 usensgetexecutablepath='$usensgetexecutablepath'
25129 useopcode='$useopcode'
25130 useperlio='$useperlio'
25131 useposix='$useposix'
25132 usequadmath='$usequadmath'
25133 usereentrant='$usereentrant'
25134 userelocatableinc='$userelocatableinc'
25135 useshrplib='$useshrplib'
25136 usesitecustomize='$usesitecustomize'
25137 usesocks='$usesocks'
25138 usethreads='$usethreads'
25139 usevendorprefix='$usevendorprefix'
25140 useversionedarchname='$useversionedarchname'
25141 usevfork='$usevfork'
25144 uvXUformat='$uvXUformat'
25145 uvoformat='$uvoformat'
25148 uvuformat='$uvuformat'
25149 uvxformat='$uvxformat'
25151 vendorarch='$vendorarch'
25152 vendorarchexp='$vendorarchexp'
25153 vendorbin='$vendorbin'
25154 vendorbinexp='$vendorbinexp'
25155 vendorhtml1dir='$vendorhtml1dir'
25156 vendorhtml1direxp='$vendorhtml1direxp'
25157 vendorhtml3dir='$vendorhtml3dir'
25158 vendorhtml3direxp='$vendorhtml3direxp'
25159 vendorlib='$vendorlib'
25160 vendorlib_stem='$vendorlib_stem'
25161 vendorlibexp='$vendorlibexp'
25162 vendorman1dir='$vendorman1dir'
25163 vendorman1direxp='$vendorman1direxp'
25164 vendorman3dir='$vendorman3dir'
25165 vendorman3direxp='$vendorman3direxp'
25166 vendorprefix='$vendorprefix'
25167 vendorprefixexp='$vendorprefixexp'
25168 vendorscript='$vendorscript'
25169 vendorscriptexp='$vendorscriptexp'
25171 version_patchlevel_string='$version_patchlevel_string'
25172 versiononly='$versiononly'
25176 yaccflags='$yaccflags'
25181 : add special variables
25182 $test -f $src/patchlevel.h && \
25183 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25184 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25185 echo "PERL_CONFIG_SH=true" >>config.sh
25187 : propagate old symbols
25188 if $test -f UU/config.sh; then
25189 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25190 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25191 config.sh config.sh UU/oldconfig.sh |\
25192 $sort | $uniq -u >UU/oldsyms
25193 set X `$cat UU/oldsyms`
25199 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25201 echo ": Variables propagated from previous config.sh file." >>config.sh
25202 for sym in `$cat UU/oldsyms`; do
25203 echo " Propagating $hint variable "'$'"$sym..."
25204 eval 'tmp="$'"${sym}"'"'
25206 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25212 : preserve RCS keywords in files with variable substitution, grrr
25215 : Finish up by extracting the .SH files
25219 echo "Extraction done."
25229 If you'd like to make any changes to the config.sh file before I begin
25230 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25233 rp="Press return or use a shell escape to edit config.sh:"
25238 *) : in case they cannot read
25239 sh 1>&4 -c "$ans";;
25244 : if this fails, just run all the .SH files by hand
25253 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25260 Now you need to generate make dependencies by running "$make depend".
25261 You might prefer to run it in background: "$make depend > makedepend.out &"
25262 It can take a while, so you might not want to run it right now.
25267 rp="Run $make depend now?"
25271 $make depend && echo "Now you must run '$make'."
25274 echo "You must run '$make depend' then '$make'."
25277 elif test -f [Mm]akefile; then
25279 echo "Now you must run a $make."
25281 echo "Configure done."
25284 if $test -f Policy.sh; then
25287 If you compile $package on a different machine or from a different object
25288 directory, copy the Policy.sh file from this object directory to the
25289 new one before you run Configure -- this will help you with most of
25290 the policy defaults.
25294 if $test -f config.msg; then
25295 echo "Hmm. I also noted the following information while running:"
25297 $cat config.msg >&4
25300 $rm -f kit*isdone ark*isdone