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 ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
384 d_attribute_deprecated=''
385 d_attribute_format=''
386 d_attribute_malloc=''
387 d_attribute_nonnull=''
388 d_attribute_noreturn=''
390 d_attribute_unused=''
391 d_attribute_warn_unused_result=''
392 d_printf_format_null=''
396 d_builtin_choose_expr=''
399 d_c99_variadic_macros=''
449 endhostent_r_proto=''
455 endprotoent_r_proto=''
461 endservent_r_proto=''
526 gethostbyaddr_r_proto=''
528 gethostbyname_r_proto=''
530 gethostent_r_proto=''
543 getnetbyaddr_r_proto=''
545 getnetbyname_r_proto=''
559 d_getprotobyname_r=''
560 getprotobyname_r_proto=''
561 d_getprotobynumber_r=''
562 getprotobynumber_r_proto=''
564 getprotoent_r_proto=''
576 getservbyname_r_proto=''
578 getservbyport_r_proto=''
580 getservent_r_proto=''
613 d_lc_monetary_2008=''
618 d_libm_lib_version=''
625 d_localtime_r_needs_tzset=''
645 d_malloc_good_size=''
693 d_old_pthread_create_joinable=''
694 old_pthread_create_joinable=''
696 d_pthread_attr_setscope=''
744 sethostent_r_proto=''
761 setprotoent_r_proto=''
773 setservent_r_proto=''
795 d_ipv6_mreq_source=''
812 d_sprintf_returns_strlen=''
825 perl_static_inline=''
830 d_stdio_ptr_lval_nochange_cnt=''
831 d_stdio_ptr_lval_sets_cnt=''
983 d_gdbm_ndbm_h_uses_prototypes=''
984 d_gdbmndbm_h_uses_prototypes=''
986 d_ndbm_h_uses_prototypes=''
1062 d_inc_version_list=''
1064 inc_version_list_init=''
1068 installusrbinperl=''
1084 ignore_versioned_solibs=''
1145 d_perl_otherlibdirs=''
1153 api_versionstring=''
1159 version_patchlevel_string=''
1163 d_nv_preserves_uv=''
1164 d_nv_zero_is_allbits_zero=''
1175 nv_overflows_integers_at=''
1176 nv_preserves_uv_bits=''
1249 installsitehtml1dir=''
1252 installsitehtml3dir=''
1259 installsiteman1dir=''
1262 installsiteman3dir=''
1267 installsitescript=''
1285 d_stdio_stream_array=''
1286 stdio_stream_array=''
1304 usekernprocpathname=''
1305 ccflags_uselargefiles=''
1306 ldflags_uselargefiles=''
1307 libswanted_uselargefiles=''
1316 usensgetexecutablepath=''
1330 installvendorarch=''
1337 installvendorhtml1dir=''
1339 vendorhtml1direxp=''
1340 installvendorhtml3dir=''
1342 vendorhtml3direxp=''
1348 installvendorman1dir=''
1351 installvendorman3dir=''
1358 installvendorscript=''
1369 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1372 : We must find out about Eunice early
1374 if test -f /etc/unixtovms; then
1375 eunicefix=/etc/unixtovms
1377 if test -f /etc/unixtovms.exe; then
1378 eunicefix=/etc/unixtovms.exe
1381 : Set executable suffix now -- needed before hints available
1382 if test -f "/libs/version.library"; then
1385 elif test -f "/system/gnu_library/bin/ar.pm"; then
1388 elif test -n "$DJGPP"; then
1391 elif test -f /kern/cookiejar; then
1394 elif test -d c:/. -o -n "$is_os2" ; then
1401 : Trailing extension. Override this in a hint file, if needed.
1402 : Extra object files, if any, needed on this platform.
1405 : Possible local include directories to search.
1406 : Set locincpth to "" in a hint file to defeat local include searches.
1407 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1408 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1410 : no include file wanted by default
1413 : Enable -DEBUGGING and -DDEBUGGING from the command line
1418 : change the next line if compiling for Xenix/286 on Xenix/386
1419 xlibpth='/usr/lib/386 /lib/386'
1420 : Possible local library directories to search.
1421 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1422 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1424 : general looking path for locating libraries
1425 glibpth="/lib /usr/lib $xlibpth"
1426 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1427 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1428 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1429 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1431 : Private path used by Configure to find libraries. Its value
1432 : is prepended to libpth. This variable takes care of special
1433 : machines, like the mips. Usually, it should be empty.
1436 : default library list
1438 : some systems want to use only the non-versioned libso:s
1439 ignore_versioned_solibs=''
1440 : set usethreads on the Configure command line to enable threads.
1441 usereentrant='undef'
1445 : set useposix=false in your hint file to disable the POSIX extension.
1447 : set useopcode=false in your hint file to disable the Opcode extension.
1450 ccflags_uselargefiles=''
1451 ldflags_uselargefiles=''
1452 libswanted_uselargefiles=''
1453 : set usemultiplicity on the Configure command line to enable multiplicity.
1454 : set usesocks on the Configure command line to enable socks.
1455 : List of libraries we want.
1456 : If anyone needs extra -lxxx, put those in a hint file.
1457 libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
1458 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1459 : We probably want to search /usr/shlib before most other libraries.
1460 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1461 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1462 glibpth="/usr/shlib $glibpth"
1463 : Do not use vfork unless overridden by a hint file.
1466 : Find the basic shell for Bourne shell scripts
1470 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1473 if test -f "$xxx"; then
1476 : Build up a list and do a single loop so we can 'break' out.
1477 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1478 for xxx in sh bash ksh pdksh ash; do
1480 try="$try ${p}/${xxx}"
1484 if test -f "$xxx"; then
1487 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1490 elif test -f "$xxx.exe"; then
1501 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1503 Usually it's in /bin/sh. How did you even get this far?
1504 Please contact me (Perl Maintainers) at perlbug@perl.org and
1505 we'll try to straighten this all out.
1511 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1512 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1515 : see if sh knows # comments
1516 if `$sh -c '#' >/dev/null 2>&1`; then
1520 test -f $xcat$_exe || xcat=/usr/bin/cat
1521 if test ! -f $xcat$_exe; then
1522 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1523 if test -f $p/cat$_exe; then
1528 if test ! -f $xcat$_exe; then
1529 echo "Can't find cat anywhere!"
1533 echo "#!$xcat" >sharp
1536 ./sharp > today 2>/dev/null
1537 if test -s today; then
1540 echo "#! $xcat" > sharp
1543 ./sharp > today 2>/dev/null
1544 if test -s today; then
1552 echo "Your $sh doesn't grok # comments--I will strip them later on."
1555 echo "exec grep -v '^[ ]*#'" >spitshell
1557 $eunicefix spitshell
1558 spitshell=`pwd`/spitshell
1560 echo "I presume that if # doesn't work, #! won't work either!"
1565 : figure out how to guarantee sh startup
1567 '') startsh=${sharpbang}${sh} ;;
1579 : echo "Yup, it does."
1581 echo "Hmm... '$startsh' does not guarantee sh startup..."
1582 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1586 : Save command line options in file UU/cmdline.opt for later use in
1587 : generating config.sh.
1588 cat > cmdline.opt <<EOSH
1589 : Configure command line arguments.
1598 cat >>cmdline.opt <<EOSH
1599 config_arg$argn='$arg'
1601 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1604 arg_exp=`cat cmdl.opt`
1605 args_exp="$args_exp$args_sep'$arg_exp'"
1606 argn=`expr $argn + 1`
1611 : produce awk script to parse command line options
1612 cat >options.awk <<'EOF'
1614 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1616 len = length(optstr);
1617 for (i = 1; i <= len; i++) {
1618 c = substr(optstr, i, 1);
1619 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1630 if (substr(str, 1, 1) != "-") {
1631 printf("'%s'\n", str);
1635 for (i = 2; i <= len; i++) {
1636 c = substr(str, i, 1);
1638 printf("-%s\n", substr(str, i));
1644 printf("'%s'\n", substr(str, i + 1));
1657 : process the command line options
1658 set X `for arg in "$@"; do echo "X$arg"; done |
1659 sed -e s/X// | awk -f options.awk`
1664 : set up default values
1674 rm -f optdef.sh posthint.sh
1675 cat >optdef.sh <<EOS
1681 while test $# -gt 0; do
1683 -d) shift; fastread=yes;;
1684 -e) shift; alldone=cont;;
1688 if test -r "$1"; then
1691 echo "$me: cannot read config file $1." >&2
1697 -h) shift; error=true;;
1698 -r) shift; reuseval=true;;
1699 -s) shift; silent=true; realsilent=true;;
1700 -E) shift; alldone=exit;;
1701 -K) shift; knowitall=true;;
1702 -O) shift; override=true;;
1703 -S) shift; silent=true; extractsh=true;;
1708 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1709 echo "$me: ignoring -D $1" >&2
1712 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1713 *) echo "$1='define'" >> optdef.sh;;
1720 *=) echo "$1" >> optdef.sh;;
1722 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1723 echo "$me: ignoring -U $1" >&2
1725 *) echo "$1='undef'" >> optdef.sh;;
1736 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1740 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1741 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1747 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1748 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1749 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1750 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1751 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1752 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1758 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1760 echo "$yyy=''" >> posthint.sh ;;
1765 echo "$yyy='$zzz'" >> posthint.sh ;;
1767 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1769 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1774 echo "$yyy=$zzz" >> posthint.sh ;;
1775 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1779 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1782 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1790 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1791 [-U symbol] [-U symbol=] [-A command:symbol...]
1792 -d : use defaults for all answers.
1793 -e : go on without questioning past the production of config.sh.
1794 -f : specify an alternate default configuration file.
1795 -h : print this help message and exit (with an error status).
1796 -r : reuse C symbols value if possible (skips costly nm extraction).
1797 -s : silent mode, only echoes questions and essential information.
1798 -D : define symbol to have some value:
1799 -D symbol symbol gets the value 'define'
1800 -D symbol=value symbol gets the value 'value'
1801 common used examples (see INSTALL for more info):
1802 -Duse64bitint use 64bit integers
1803 -Duse64bitall use 64bit integers and pointers
1804 -Dusethreads use thread support
1805 -Dinc_version_list=none do not include older perl trees in @INC
1806 -DEBUGGING=none DEBUGGING options
1807 -Dcc=gcc choose your compiler
1808 -Dprefix=/opt/perl5 choose your destination
1809 -E : stop at the end of questions, after having produced config.sh.
1810 -K : do not use unless you know what you are doing.
1811 -O : let -D and -U override definitions from loaded configuration file.
1812 -S : perform variable substitutions on all .SH files (can mix with -f)
1813 -U : undefine symbol:
1814 -U symbol symbol gets the value 'undef'
1815 -U symbol= symbol gets completely empty
1817 -A : manipulate symbol after the platform specific hints have been applied:
1818 -A append:symbol=value append value to symbol
1819 -A symbol=value like append:, but with a separating space
1820 -A define:symbol=value define symbol to have value
1821 -A clear:symbol define symbol to be ''
1822 -A define:symbol define symbol to be 'define'
1823 -A eval:symbol=value define symbol to be eval of value
1824 -A prepend:symbol=value prepend value to symbol
1825 -A undef:symbol define symbol to be 'undef'
1826 -A undef:symbol= define symbol to be ''
1827 e.g.: -A prepend:libswanted='cl pthread '
1828 -A ccflags=-DSOME_MACRO
1829 -V : print version number and exit (with a zero status).
1836 case "$fastread$alldone" in
1839 case "$extractsh" in
1842 if test ! -t 0; then
1843 echo "Say 'sh Configure', not 'sh <Configure'"
1853 true) exec 1>/dev/null;;
1856 : run the defines and the undefines, if any, but leave the file out there...
1859 : create the posthint manipulation script and leave the file out there...
1864 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1865 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1866 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1867 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1868 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1871 : Some greps do not return status, grrr.
1872 echo "grimblepritz" >grimble
1873 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1875 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1881 : the following should work in any shell
1885 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1886 cat >contains <<'EOSS'
1887 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1892 : Find the path to the source tree
1895 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1899 *) src=`cd ../$src && pwd` ;;
1912 if test -f $rsrc/Configure && \
1913 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1915 : found it, so we are ok.
1918 for src in . .. ../.. ../../.. ../../../..; do
1919 if test -f ../$src/Configure && \
1920 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1931 Sorry, I can't seem to locate the source dir for $package. Please start
1932 Configure with an explicit path -- i.e. /some/path/Configure.
1940 echo "Sources for $package found in \"$src\"." >&4
1944 : script used to extract .SH files with variable substitutions
1945 cat >extract <<'EOS'
1947 echo "Doing variable substitutions on .SH files..."
1948 if test -f MANIFEST; then
1949 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1951 echo "(Looking for .SH files under the source directory.)"
1952 set x `(cd "$src"; find . -name "*.SH" -print)`
1956 0) set x `(cd "$src"; echo *.SH)`; shift;;
1958 if test ! -f "$src/$1"; then
1964 while test $name; do
1965 if test ! -d "$name"; then
1966 create="$name $create";
1967 name=`echo $name | sed -e "s|^[^/]*$||"`;
1968 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1973 for file in $create; do
1982 dir=`expr X$file : 'X\(.*\)/'`
1983 file=`expr X$file : 'X.*/\(.*\)'`
1984 (cd "$dir" && . ./$file)
1994 dir=`expr X$file : 'X\(.*\)/'`
1995 file=`expr X$file : 'X.*/\(.*\)'`
1996 (set x $dir; shift; eval $mkdir_p)
1997 sh <"$src/$dir/$file"
2006 if test -f "$src/config_h.SH"; then
2007 if test ! -f config.h; then
2008 : oops, they left it out of MANIFEST, probably, so do it anyway.
2009 . "$src/config_h.SH"
2014 : extract files and exit if asked to do so
2015 case "$extractsh" in
2017 case "$realsilent" in
2021 case "$config_sh" in
2022 '') config_sh='config.sh';;
2025 echo "Fetching answers from $config_sh..."
2028 test "$override" && . ./optdef.sh
2032 echo "Extraction done."
2037 : Eunice requires " " instead of "", can you believe it
2040 echo "Beginning of configuration questions for $package."
2042 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2044 : first determine how to suppress newline on echo command
2046 echo "Checking echo to see how to suppress newlines..."
2047 (echo "hi there\c" ; echo " ") >.echotmp
2048 if $contains c .echotmp >/dev/null 2>&1 ; then
2059 echo $n "The star should be here-->$c"
2063 : Now test for existence of everything in MANIFEST
2065 if test -f "$rsrc/MANIFEST"; then
2066 echo "First let's make sure your kit is complete. Checking..." >&4
2067 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2068 (split -l 50 2>/dev/null || split -50)
2071 for filelist in x??; do
2072 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2073 >/dev/null 2>>"$tmppwd/missing")
2075 if test -s missing; then
2079 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2081 You have the option of continuing the configuration process, despite the
2082 distinct possibility that your kit is damaged, by typing 'y'es. If you
2083 do, don't blame me if something goes wrong. I advise you to type 'n'o
2084 and contact the author (perlbug@perl.org).
2087 echo $n "Continue? [n] $c" >&4
2091 echo "Continuing..." >&4
2095 echo "ABORTING..." >&4
2100 echo "Looks good..."
2103 echo "There is no MANIFEST file. I hope your kit is complete !"
2107 : Find the appropriate value for a newline for tr
2109 if test -n "$DJGPP"; then
2112 if test X"$trnl" = X; then
2113 case "`echo foo|tr '\n' x 2>/dev/null`" in
2117 if test X"$trnl" = X; then
2118 case "`echo foo|tr '\012' x 2>/dev/null`" in
2119 foox) trnl='\012' ;;
2122 if test X"$trnl" = X; then
2123 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2124 fooxy) trnl='\n\r' ;;
2127 if test X"$trnl" = X; then
2130 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2136 : compute the number of columns on the terminal for proper question formatting
2141 : set up the echo used in my read
2142 myecho="case \"\$xxxm\" in
2143 '') echo $n \"\$rp $c\" >&4;;
2145 '') echo $n \"[\$xxxm] $c\";;
2147 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2149 echo $n \"[\$xxxm] $c\" >&4
2151 echo $n \"\$rp [\$xxxm] $c\" >&4
2157 : now set up to do reads with possible shell escape and default assignment
2163 case "\$fastread" in
2164 yes) case "\$dflt" in
2167 case "\$silent-\$rp" in
2172 *) case "\$silent" in
2173 true) case "\$rp" in
2178 while expr "X\$ans" : "X!" >/dev/null; do
2182 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2190 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2199 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2204 echo "(OK, I'll run with -d after this question.)" >&4
2207 echo "*** Sorry, \$1 not supported yet." >&4
2217 echo "*** Substitution done -- please confirm."
2219 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2224 echo "*** Error -- try again."
2231 case "\$ans\$xxxm\$nostick" in
2243 : create .config dir to save info across Configure sessions
2244 test -d ../.config || mkdir ../.config
2245 cat >../.config/README <<EOF
2246 This directory created by Configure to save information that should
2247 persist across sessions for $package.
2249 You may safely delete it if you wish.
2252 : See if we are using a devel version and want that
2253 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2256 usedevel="$define" ;;
2257 *) case "$xversion" in
2260 *** WHOA THERE!!! ***
2262 This is an UNSTABLE DEVELOPMENT release.
2263 The version of this $package distribution is $xversion, that is, odd,
2264 (as opposed to even) and that signifies a development release.
2265 If you want a maintenance release, you want an even-numbered version.
2267 Do ***NOT*** install this into production use.
2268 Data corruption and crashes are possible.
2270 It is most seriously suggested that you do not continue any further
2271 unless you want to help in developing and debugging Perl.
2273 If you *still* want to build perl, you can answer 'y' now,
2274 or pass -Dusedevel to Configure.
2277 rp='Do you really want to continue?'
2281 [yY]) echo >&4 "Okay, continuing."
2282 usedevel="$define" ;;
2283 *) echo >&4 "Okay, bye."
2294 case "$versiononly" in
2295 '') versiononly="$define" ;;
2297 case "$installusrbinperl" in
2298 '') installusrbinperl="$undef" ;;
2303 : general instructions
2306 user=`(logname) 2>/dev/null`
2308 '') user=`whoami 2>&1`;;
2310 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2313 rp='Would you like to see the instructions?'
2324 This installation shell script will examine your system and ask you questions
2325 to determine how the perl5 package should be installed. If you get
2326 stuck on a question, you may use a ! shell escape to start a subshell or
2327 execute a command. Many of the questions will have default answers in square
2328 brackets; typing carriage return will give you the default.
2330 On some of the questions which ask for file or directory names you are allowed
2331 to use the ~name construct to specify the login directory belonging to "name",
2332 even if you don't have a shell which knows about that. Questions where this is
2333 allowed will be marked "(~name ok)".
2337 dflt='Type carriage return to continue'
2341 The prompter used in this script allows you to use shell variables and
2342 backticks in your answers. You may use $1, $2, etc... to refer to the words
2343 in the default answer, as if the default line was a set of arguments given to a
2344 script shell. This means you may also use $* to repeat the whole default line,
2345 so you do not have to re-type everything to add something to the default.
2347 Every time there is a substitution, you will have to confirm. If there is an
2348 error (e.g. an unmatched backtick), the default answer will remain unchanged
2349 and you will be prompted again.
2351 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2352 the questions and use the computed defaults (or the previous answers if there
2353 was already a config.sh file). Type 'Configure -h' for a list of options.
2354 You may also start interactively and then answer '& -d' at any prompt to turn
2355 on the non-interactive behaviour for the remainder of the execution.
2361 Much effort has been expended to ensure that this shell script will run on any
2362 Unix system. If despite that it blows up on yours, your best bet is to edit
2363 Configure and run it again. If you can't run Configure for some reason,
2364 you'll have to generate a config.sh file by hand. Whatever problems you
2365 have, let me (perlbug@perl.org) know how I blew it.
2367 This installation script affects things in two ways:
2369 1) it may do direct variable substitutions on some of the files included
2371 2) it builds a config.h file for inclusion in C programs. You may edit
2372 any of these files as the need arises after running this script.
2374 If you make a mistake on a question, there is no easy way to back up to it
2375 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2376 files. Configure will offer to let you do this before it runs the SH files.
2379 dflt='Type carriage return to continue'
2381 case "$firsttime" in
2382 true) echo $user >>../.config/instruct;;
2386 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2387 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2388 if test "X$sysroot" = X; then
2393 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2394 # _sysroot is used in places where we need --sysroot=foo
2395 # but using the rest of the flags could cause issues.
2396 _sysroot="--sysroot=$sysroot";
2400 ccflags="$ccflags $_sysroot"
2405 ldflags="$ldflags $_sysroot"
2410 cppflags="$cppflags $_sysroot"
2412 # lddlflags updated below in lddlflags section;
2413 # same with cccdlflags
2417 # Adjust some defaults to also use $sysroot
2418 for var in xlibpth loclibpth locincpth glibpth; do
2421 for path in $xxx; do
2422 eval $var=\"\$$var $sysroot$path\"
2428 : find out where common programs are
2430 echo "Locating common programs..." >&4
2443 if test -d \$dir/\$thing; then
2449 for thisthing in \$dir/\$thing; do
2450 : just loop through to pick last item
2452 if test -f \$thisthing; then
2455 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2458 elif test -f \$dir/\$thing.exe; then
2459 if test -n "$DJGPP"; then
2460 echo \$dir/\$thing.exe
2461 elif test "$eunicefix" != ":"; then
2462 : on Eunice apparently
2515 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2516 pth="$pth $sysroot/lib $sysroot/usr/lib"
2517 for file in $loclist; do
2521 if test -f "$xxx"; then
2524 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2525 xxx=`./loc $file $file $pth`
2528 '') xxx=`./loc $file $file $pth`;;
2529 *) xxx=`./loc $xxx $xxx $pth`;;
2531 eval $file=$xxx$_exe
2535 echo $file is in $xxx.
2538 echo $file is in $xxx.
2541 echo "I don't know where '$file' is, and my life depends on it." >&4
2542 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2548 echo "Don't worry if any of the following aren't found..."
2550 for file in $trylist; do
2554 if test -f "$xxx"; then
2557 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2558 xxx=`./loc $file $file $pth`
2561 '') xxx=`./loc $file $file $pth`;;
2562 *) xxx=`./loc $xxx $xxx $pth`;;
2564 eval $file=$xxx$_exe
2568 echo $file is in $xxx.
2571 echo $file is in $xxx.
2574 echo "I don't see $file out there, $say."
2581 echo "Substituting grep for egrep."
2588 *) if $less -R </dev/null >/dev/null 2>&1; then
2589 echo "Substituting less -R for less."
2597 echo "Substituting cp for ln."
2606 echo "I can't find make or gmake, and my life depends on it." >&4
2607 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2615 *) # We can't have osname yet.
2616 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2617 # Assume that gmake, if found, is definitely GNU make
2618 # and prefer it over the system make.
2619 echo "Substituting gmake for make."
2627 echo "Hopefully test is built into your sh."
2630 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2631 echo "Using the test built into your sh."
2639 echo "Hopefully echo is built into your sh."
2644 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2645 $echo $n "hi there$c" >foo1
2646 echo $n "hi there$c" >foo2
2647 if cmp foo1 foo2 >/dev/null 2>&1; then
2648 echo "They are compatible. In fact, they may be identical."
2655 They are not compatible! You are probably running ksh on a non-USG system.
2656 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2657 have echo built in and we may have to run some Bourne shell scripts. That
2658 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2661 $echo $n "The star should be here-->$c"
2668 # This question was auctioned at YAPC::Europe-2007 in Vienna
2669 # I never promised you could answer it. I only auctioned the question.
2671 The following message is sponsored by
2673 Dresden.pm<--The stars should be here.
2675 Dear Perl user, system administrator or package
2676 maintainer, the Perl community sends greetings to
2677 you. Do you (emblematical) greet back [Y/n]? n
2681 : Check what type of C compiler we use
2685 cat <<'EOSC' >>trygcc
2690 int main(int argc, char *argv[]) {
2694 if $cc -o try $ccflags $ldflags try.c; then
2697 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2703 # Skip this test because it gives a false match on output like:
2704 # ./trygcc: line 23: cc: command not found
2705 # case "`$cc -v -c try.c 2>&1`" in
2706 # *gcc*) trygcc=no ;;
2708 if $test X"$trygcc" = Xyes; then
2709 if gcc -o try -c try.c; then
2711 echo "You seem to have a working gcc, though." >&4
2712 # Switching compilers may undo the work of hints files.
2713 # The most common problem is -D_REENTRANT for threads.
2714 # This heuristic catches that case, but gets false positives
2715 # if -Dusethreads was not actually specified. Better to
2716 # bail out here with a useful message than fail
2717 # mysteriously later. Should we perhaps just try to
2718 # re-invoke Configure -Dcc=gcc config_args ?
2719 if $test -f usethreads.cbu; then
2722 *** However, any setting of the C compiler flags (e.g. for thread support)
2723 *** will be lost. It may be necessary for you to restart Configure and
2724 *** add -Dcc=gcc to your Configure command line.
2727 rp="Would you like to go ahead and try gcc anyway?"
2730 rp="Would you like to use it?"
2733 if $test -f myread; then
2736 if $test -f UU/myread; then
2739 echo "Cannot find myread, sorry. Aborting." >&2
2744 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2757 cat <<'EOSC' >>checkcc
2762 int main(int argc, char *argv[]) {
2766 if $cc -o try $ccflags $ldflags try.c; then
2769 if $test X"$despair" = Xyes; then
2770 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2773 You need to find a working C compiler.
2774 Either (purchase and) install the C compiler supplied by your OS vendor,
2775 or for a free C compiler try http://gcc.gnu.org/
2776 I cannot continue any further, aborting.
2785 : determine whether symbolic links are supported
2788 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2789 echo "Symbolic links are supported." >&4
2792 echo "Symbolic links are NOT supported." >&4
2797 : determine whether symbolic links are supported
2801 echo "Checking how to test for symbolic links..." >&4
2803 if $test "X$issymlink" = X; then
2805 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2806 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2808 if test $? = 0; then
2811 echo "Your builtin 'test -h' may be broken." >&4
2814 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2817 if test -f "$p/$test"; then
2826 echo "Trying external '$test -h'." >&4
2827 issymlink="$test -h"
2828 if $test ! -h sym >/dev/null 2>&1; then
2829 echo "External '$test -h' is broken, too." >&4
2837 if $test "X$issymlink" = X; then
2838 if $test -L sym 2>/dev/null; then
2839 issymlink="$test -L"
2840 echo "The builtin '$test -L' worked." >&4
2843 if $test "X$issymlink" != X; then
2844 echo "You can test for symbolic links with '$issymlink'." >&4
2846 echo "I do not know how you can test for symbolic links." >&4
2850 *) echo "No symbolic links, so not testing for their testing..." >&4
2855 : Make symlinks util
2856 case "$mksymlinks" in
2859 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2862 *) case "$lns:$issymlink" in
2863 *"ln"*" -s:"*"test -"?)
2864 echo "Creating the symbolic links..." >&4
2866 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2876 print "# dir = ", dir, "file = ", file
2877 mf[dir] = mf[dir]" "source"/"dir"/"file;
2880 if (d != ".") { print("mkdir -p "d) }
2881 print("ln -sf "mf[d]" "d);
2883 }' source="$src" > UU/mksymlinks.$$
2887 if test ! -d t/base; then
2888 echo "Failed to create the subdirectories. Aborting." >&4
2892 if test ! -f t/base/lex.t; then
2893 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2896 if test ! -f win32/win32.c; then
2897 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2902 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2910 : Check for Cross-Compilation
2911 if $test "X$targethost" = "X"; then
2914 if $test "X$targetenv" = "X"; then
2917 case "$usecrosscompile" in
2919 $echo "Cross-compiling..."
2922 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2923 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2924 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2925 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2926 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2927 # leave out ld, choosing it is more complex
2928 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2929 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2930 # We are in a weird spot. Just before us, some values
2931 # were 'saved', to be restored after the hints are
2932 # run. This means that the changes we made to ar,
2933 # nm and ranlib will get reverted.
2934 # To avoid that, we hijack the saving mechanism and
2935 # have it save our new values.
2936 for file in ar nm ranlib; do
2938 eval $file=$xxx$_exe
2943 case "$targetarch" in
2944 '') echo "Targetarch not defined." >&4; croak=y ;;
2945 *) echo "Using targetarch $targetarch." >&4 ;;
2947 case "$targethost" in
2948 '') echo "Targethost not defined." >&4; croak=y ;;
2949 *) echo "Using targethost $targethost." >&4
2954 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2956 : compile a host miniperl and generate_uudmap, unless we got passed them
2957 if $test "X$hostperl" = X; then
2958 echo "Building host miniperl and generate_uudmap binaries" >&4
2966 $src/Configure -des -Dusedevel -Dmksymlinks
2968 case "$hostgenerate" in
2969 '') $make generate_uudmap
2970 hostgenerate=$src/host/generate_uudmap
2972 "$undef") hostgenerate=''
2975 hostperl=$src/host/miniperl
2978 hostosname=`$hostperl -le 'print $^O'`
2981 usecrosscompile="$undef"
2985 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2986 case "$targethost" in
2987 '') echo "Checking for cross-compile" >&4
2988 case "$usecrosscompile$multiarch" in
2989 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2990 if [ -f Makefile ]; then
2992 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2994 echo "Configure done."
2998 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3005 *) echo "Using targethost $targethost." >&4
3007 /*) run=$src/Cross/run
3008 targetmkdir=$src/Cross/mkdir
3010 from=$src/Cross/from
3012 *) pwd=`$test -f ../Configure & cd ..; pwd`
3014 targetmkdir=$pwd/Cross/mkdir
3016 from=$pwd/Cross/from
3019 case "$targetrun" in
3020 '') targetrun=ssh ;;
3025 case "$targetfrom" in
3026 '') targetfrom=scp ;;
3030 from=$from-$targetfrom
3031 case "$targetdir" in
3033 echo "Guessing targetdir $targetdir." >&4
3036 case "$targetuser" in
3038 echo "Guessing targetuser $targetuser." >&4
3041 case "$targetport" in
3043 echo "Guessing targetport $targetport." >&4
3046 case "$targetfrom" in
3050 case "$targetrun" in
3070 '') cwd=$targetdir ;;
3075 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3081 *) echo "Unknown targetrun '$targetrun'" >&4
3085 case "$targetmkdir" in
3087 cat >$targetmkdir <<EOF
3089 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3091 $chmod a+rx $targetmkdir
3093 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3105 $targetmkdir \`dirname \$f\`
3106 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3109 $targetmkdir $targetdir/\`dirname \$f\`
3110 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3123 $mkdir -p $targetdir/\`dirname \$f\`
3124 $cp \$f $targetdir/\$f || exit 1
3127 $targetmkdir $targetdir/\`dirname \$f\`
3128 $cp \$f $targetdir/\$f || exit 1
3135 *) echo "Unknown targetto '$targetto'" >&4
3139 case "$targetfrom" in
3146 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3151 cp) cat >$from <<EOF
3156 cp $targetdir/\$f . || exit 1
3161 *) echo "Unknown targetfrom '$targetfrom'" >&4
3165 if $test ! -f $run; then
3166 echo "Target 'run' script '$run' not found." >&4
3170 if $test ! -f $to; then
3171 echo "Target 'to' script '$to' not found." >&4
3175 if $test ! -f $from; then
3176 echo "Target 'from' script '$from' not found." >&4
3180 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3184 Using '$run' for remote execution,
3185 and '$from' and '$to'
3186 for remote file transfer.
3192 usecrosscompile="$undef"
3197 : see whether [:lower:] and [:upper:] are supported character classes
3199 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3201 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3205 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3206 # (0xd9 and 0xe2), therefore that is a nice testing point.
3207 if test "X$up" = X -o "X$low" = X; then
3208 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3214 if test "X$up" = X -o "X$low" = X; then
3215 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3221 if test "X$up" = X -o "X$low" = X; then
3222 case "`echo RS | od -x 2>/dev/null`" in
3224 echo "Hey, this might be EBCDIC." >&4
3225 if test "X$up" = X -o "X$low" = X; then
3226 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3227 rs) up='[A-IJ-RS-Z]'
3232 if test "X$up" = X -o "X$low" = X; then
3233 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3243 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3245 echo "Using $up and $low to convert case." >&4
3248 echo "I don't know how to translate letters from upper to lower case." >&4
3249 echo "Your tr is not acting any way I know of." >&4
3253 : set up the translation script tr, must be called with ./tr of course
3257 '[A-Z][a-z]') exec $tr '$up' '$low';;
3258 '[a-z][A-Z]') exec $tr '$low' '$up';;
3265 : Try to determine whether config.sh was made on this system
3266 case "$config_sh" in
3268 myuname=`$uname -a 2>/dev/null`
3269 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3270 # Downcase everything to avoid ambiguity.
3271 # Remove slashes and single quotes so we can use parts of this in
3272 # directory and file names.
3273 # Remove newlines so myuname is sane to use elsewhere.
3274 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3275 # because the A-Z/a-z are not consecutive.
3276 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3277 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3278 newmyuname="$myuname"
3280 case "$knowitall" in
3282 if test -f ../config.sh; then
3283 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3284 eval "`grep myuname= ../config.sh`"
3286 if test "X$myuname" = "X$newmyuname"; then
3294 : Get old answers from old config file if Configure was run on the
3295 : same system, otherwise use the hints.
3298 if test -f config.sh; then
3300 rp="I see a config.sh file. Shall I use it to set the defaults?"
3303 n*|N*) echo "OK, I'll ignore it."
3304 mv config.sh config.sh.old
3305 myuname="$newmyuname"
3307 *) echo "Fetching default answers from your old config.sh file..." >&4
3315 : Older versions did not always set $sh. Catch re-use of such
3325 if test ! -f config.sh; then
3328 First time through, eh? I have some defaults handy for some systems
3329 that need some extra help getting the Configure answers right:
3332 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3334 : Half the following guesses are probably wrong... If you have better
3335 : tests or hints, please send them to perlbug@perl.org
3336 : The metaconfig authors would also appreciate a copy...
3337 $test -f /irix && osname=irix
3338 $test -f /xenix && osname=sco_xenix
3339 $test -f /dynix && osname=dynix
3340 $test -f /dnix && osname=dnix
3341 $test -f /lynx.os && osname=lynxos
3342 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3343 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3344 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3345 $test -f /bin/mips && /bin/mips && osname=mips
3346 $test -d /usr/apollo/bin && osname=apollo
3347 $test -f /etc/saf/_sactab && osname=svr4
3348 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3349 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3350 if $test -d /MachTen -o -d /MachTen_Folder; then
3352 if $test -x /sbin/version; then
3353 osvers=`/sbin/version | $awk '{print $2}' |
3354 $sed -e 's/[A-Za-z]$//'`
3355 elif $test -x /usr/etc/version; then
3356 osvers=`/usr/etc/version | $awk '{print $2}' |
3357 $sed -e 's/[A-Za-z]$//'`
3363 $test -f /sys/posix.dll &&
3364 $test -f /usr/bin/what &&
3365 set X `/usr/bin/what /sys/posix.dll` &&
3366 $test "$3" = UWIN &&
3370 if $test -f $uname; then
3378 umips) osname=umips ;;
3381 [23]100) osname=mips ;;
3383 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3384 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3387 elif $test -f /etc/kconfig; then
3389 if test "$lns" = "$ln -s"; then
3391 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3393 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3400 if test -n "$DJGPP"; then
3409 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3411 # oslevel can fail with:
3412 # oslevel: Unable to acquire lock.
3413 *not\ found) osvers="$4"."$3" ;;
3414 '<3240'|'<>3240') osvers=3.2.0 ;;
3415 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3416 '=3250'|'>3250') osvers=3.2.5 ;;
3420 bitrig) osname=bitrig
3423 bsd386) osname=bsd386
3426 cygwin*) osname=cygwin
3429 *dc.osx) osname=dcosx
3435 domainos) osname=apollo
3441 dragonfly) osname=dragonfly
3444 dynixptx*) osname=dynixptx
3445 osvers=`echo "$4"|sed 's/^v//'`
3447 freebsd) osname=freebsd
3449 genix) osname=genix ;;
3453 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3466 $test -f /system/lib/libandroid.so && osname=linux-android
3470 netbsd*) osname=netbsd
3473 news-os) osvers="$3"
3475 4*) osname=newsos4 ;;
3479 nonstop-ux) osname=nonstopux ;;
3480 openbsd) osname=openbsd
3486 POSIX-BC | posix-bc ) osname=posix-bc
3489 powerux | power_ux | powermax_os | powermaxos | \
3490 powerunix | power_unix) osname=powerux
3496 solaris) osname=solaris
3498 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3505 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3509 titanos) osname=titanos
3518 ultrix) osname=ultrix
3521 osf1|mls+) case "$5" in
3524 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3527 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3530 hp*) osname=hp_osf1 ;;
3531 mips) osname=mips_osf1 ;;
3534 # UnixWare 7.1.2 is known as Open UNIX 8
3535 openunix|unixware) osname=svr5
3543 $2) case "$osname" in
3547 : svr4.x or possibly later
3557 if test -f /stand/boot ; then
3558 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3559 if test -n "$INITPROG" -a -f "$INITPROG"; then
3560 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3561 if test -n "$isesix"; then
3569 *) if test -f /etc/systemid; then
3571 set `echo $3 | $sed 's/\./ /g'` $4
3572 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3574 elif $test -f $src/hints/sco_$1_$2.sh; then
3576 elif $test -f $src/hints/sco_$1.sh; then
3581 '') : Still unknown. Probably a generic Sys V.
3590 *) case "$osname" in
3591 '') : Still unknown. Probably a generic BSD.
3599 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3600 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3601 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3604 $rm -f UU/kernel.what
3605 elif test -d c:/. -o -n "$is_os2" ; then
3612 case "$targetarch" in
3615 case "$targetarch" in
3617 # Will load qnx.sh, which should change osname to nto
3622 # Catch arm-linux-androideabi, mipsel-linux-android,
3623 # and i686-linux-android
3624 osname=linux-android
3628 # Something like arm-linux-gnueabihf is really just
3635 # XXX perhaps we should just assume
3636 # osvers to be 2, or maybe take the value
3637 # from targetarch. Using $run before the
3638 # hints are run is somewhat icky.
3639 set X `$run $uname -a 2>/dev/null`
3642 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3647 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3654 : Now look for a hint file osname_osvers, unless one has been
3655 : specified already.
3658 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3659 : Also try without trailing minor version numbers.
3660 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3661 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3662 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3663 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3666 *) case "$osvers" in
3669 *) if $test -f $src/hints/$file.sh ; then
3671 elif $test -f $src/hints/$xfile.sh ; then
3673 elif $test -f $src/hints/$xxfile.sh ; then
3675 elif $test -f $src/hints/$xxxfile.sh ; then
3677 elif $test -f $src/hints/$xxxxfile.sh ; then
3679 elif $test -f "$src/hints/${osname}.sh" ; then
3688 if $test -f Policy.sh ; then
3691 none) dflt="Policy" ;;
3692 *) dflt="Policy $dflt" ;;
3697 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3701 if $test -f Policy.sh ; then
3704 There's also a Policy hint file available, which should make the
3705 site-specific (policy) questions easier to answer.
3712 You may give one or more space-separated answers, or "none" if appropriate.
3713 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3714 previous run of Configure, you may specify it as well as or instead of
3715 OS-specific hints. If hints are provided for your OS, you should use them:
3716 although Perl can probably be built without hints on many platforms, using
3717 hints often improve performance and may enable features that Configure can't
3718 set up on its own. If there are no hints that match your OS, specify "none";
3719 DO NOT give a wrong version or a wrong OS.
3723 rp="Which of these apply, if any?"
3726 for file in $tans; do
3727 if $test X$file = XPolicy -a -f Policy.sh; then
3729 $cat Policy.sh >> UU/config.sh
3730 elif $test -f $src/hints/$file.sh; then
3731 . $src/hints/$file.sh
3732 $cat $src/hints/$file.sh >> UU/config.sh
3733 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3736 : Give one chance to correct a possible typo.
3737 echo "$file.sh does not exist"
3739 rp="hint to use instead?"
3741 for file in $ans; do
3742 if $test -f "$src/hints/$file.sh"; then
3743 . $src/hints/$file.sh
3744 $cat $src/hints/$file.sh >> UU/config.sh
3745 elif $test X$ans = X -o X$ans = Xnone ; then
3748 echo "$file.sh does not exist -- ignored."
3755 : Remember our hint file for later.
3756 if $test -f "$src/hints/$file.sh" ; then
3766 echo "Fetching default answers from $config_sh..." >&4
3770 cp $config_sh config.sh 2>/dev/null
3780 test "$override" && . ./optdef.sh
3782 : Restore computed paths
3783 for file in $loclist $trylist; do
3784 eval $file="\$_$file"
3789 Configure uses the operating system name and version to set some defaults.
3790 The default value is probably right if the name rings a bell. Otherwise,
3791 since spelling matters for me, either accept the default or answer "none"
3798 ''|' '|none) dflt=none ;;
3799 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3802 *) dflt="$osname" ;;
3804 rp="Operating system name?"
3808 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3814 ''|' '|none) dflt=none ;;
3815 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3816 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3818 ''|' ') dflt=none ;;
3823 *) dflt="$osvers" ;;
3825 rp="Operating system version?"
3835 : who configured the system
3836 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3839 cf_by=`(logname) 2>/dev/null`
3842 cf_by=`(whoami) 2>/dev/null`
3844 "") cf_by=unknown ;;
3849 : decide how portable to be. Allow command line overrides.
3850 case "$d_portable" in
3852 *) d_portable="$define" ;;
3855 : set up shell script to do ~ expansion
3861 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3864 if $test -f /bin/csh; then
3865 /bin/csh -f -c "glob \$1"
3870 name=\`$expr x\$1 : '..\([^/]*\)'\`
3871 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3872 if $test ! -d "\$dir"; then
3874 echo "\$me: can't locate home directory for: \$name" >&2
3879 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3895 : now set up to get a file name
3899 cat <<'EOSC' >>getfile
3915 : getfile will accept an answer from the comma-separated list
3916 : enclosed in parentheses even if it does not meet other criteria.
3917 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3918 fn=`echo $fn | sed 's/(.*)//'`
3924 loc_file=`expr $fn : '.*:\(.*\)'`
3925 fn=`expr $fn : '\(.*\):.*'`
3933 */*) fullpath=true;;
3942 *e*) exp_file=true;;
3945 *p*) nopath_ok=true;;
3950 *d*) type='Directory';;
3951 *l*) type='Locate';;
3956 Locate) what='File';;
3961 case "$d_portable" in
3969 while test "$type"; do
3974 true) rp="$rp (~name ok)";;
3977 if test -f UU/getfile.ok && \
3978 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3997 value=`UU/filexp $ans`
4000 if test "$ans" != "$value"; then
4001 echo "(That expands to $value on this system.)"
4015 /*) value="$ansexp" ;;
4016 [a-zA-Z]:/*) value="$ansexp" ;;
4021 echo "I shall only accept a full path name, as in /bin/ls." >&4
4022 echo "Use a ! shell escape if you wish to check pathnames." >&4
4025 echo "Please give a full path name, starting with slash." >&4
4028 echo "Note that using ~name is ok provided it expands well." >&4
4041 for fp in $gfpth; do
4042 if test "X$fp" = X.; then
4047 if test -f "$pf"; then
4049 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4051 echo "($value is not a plain file, but that's ok.)"
4054 if test X"$type" = X; then
4061 for fp in $gfpth; do
4062 if test "X$fp" = X.; then
4067 direxp="$fp/$ansexp"
4069 if test -d "$direxp"; then
4077 if test -d "$ansexp"; then
4078 echo "(Looking for $loc_file in directory $value.)"
4079 value="$value/$loc_file"
4080 ansexp="$ansexp/$loc_file"
4082 if test -f "$ansexp"; then
4085 case "$nopath_ok" in
4086 true) case "$value" in
4088 *) echo "Assuming $value will be in people's path."
4104 if test "$fastread" = yes; then
4109 rp="$what $value doesn't exist. Use that name anyway?"
4128 test "X$gfpthkeep" != Xy && gfpth=""
4131 : determine root of directory hierarchy where package will be installed.
4134 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4137 dflt=`echo "$prefix" | sed 's/.$//'`
4145 By default, $package will be installed in $dflt/bin, manual pages
4146 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4147 installation directories. Typically this is something like /usr/local.
4148 If you wish to have binaries under /usr/bin but other parts of the
4149 installation under /usr/local, that's ok: you will be prompted
4150 separately for each of the installation directories, the prefix being
4151 only used to set the defaults.
4155 rp='Installation prefix to use?'
4163 *) oldprefix="$prefix";;
4170 : allow them to override the AFS root
4173 *) afsroot=$afsroot ;;
4179 $define|true) afs=true ;;
4180 $undef|false) afs=false ;;
4181 *) if $test -d $afsroot; then
4189 echo "AFS may be running... I'll be extra cautious then..." >&4
4191 echo "AFS does not seem to be running..." >&4
4194 : determine installation prefix for where package is to be installed.
4198 Since you are running AFS, I need to distinguish the directory in which
4199 files will reside from the directory in which they are installed (and from
4200 which they are presumably copied to the former directory by occult means).
4203 case "$installprefix" in
4204 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4205 *) dflt="$installprefix";;
4210 In some special cases, particularly when building $package for distribution,
4211 it is convenient to distinguish the directory in which files should be
4212 installed from the directory ($prefix) in which they will
4213 eventually reside. For most users, these two directories are the same.
4216 case "$installprefix" in
4218 *) dflt=$installprefix;;
4222 rp='What installation prefix should I use for installing files?'
4224 installprefix="$ans"
4225 installprefixexp="$ansexp"
4227 : Perform the prefixexp/installprefixexp correction if necessary
4228 cat <<EOS >installprefix
4231 cat <<'EOSC' >>installprefix
4232 : Change installation prefix, if necessary.
4233 if $test X"$prefix" != X"$installprefix"; then
4234 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4236 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4239 chmod +x installprefix
4240 $eunicefix installprefix
4242 : Set variables such as privlib and privlibexp from the output of ./getfile
4243 : performing the prefixexp/installprefixexp correction if necessary.
4244 cat <<EOS >setprefixvar
4247 cat <<'EOSC' >>setprefixvar
4248 eval "${prefixvar}=\"\$ans\""
4249 eval "${prefixvar}exp=\"\$ansexp\""
4252 chmod +x setprefixvar
4253 $eunicefix setprefixvar
4255 : set up the script used to warn in case of inconsistency
4264 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4266 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4267 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4272 echo "*** WHOA THERE!!! ***" >&4
4273 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4276 rp=" Keep the $hint value?"
4279 y) td=$was; tu=$was;;
4283 : function used to set '$1' to '$val'
4284 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4286 $define$undef) . ./whoa; eval "$var=\$td";;
4287 $undef$define) . ./whoa; eval "$var=\$tu";;
4288 *) eval "$var=$val";;
4291 : get the patchlevel
4293 echo "Getting the current patchlevel..." >&4
4294 if $test -r $rsrc/patchlevel.h;then
4295 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4296 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4297 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4298 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4299 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4300 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4301 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4310 $echo "(You do not have patchlevel.h. Eek.)"
4312 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4313 version_patchlevel_string="version $patchlevel subversion $subversion"
4314 case "$perl_patchlevel" in
4316 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4317 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4321 $echo "(You have $package $version_patchlevel_string.)"
4325 : XXX Should be a Configure test for double-dots in filenames.
4326 version=`echo $revision $patchlevel $subversion | \
4327 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4328 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4329 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4332 version=`echo $revision $patchlevel $subversion | \
4333 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4334 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4335 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4338 : Special case the 5.005_xx maintenance series, which used 5.005
4339 : without any subversion label as a subdirectory in $sitelib
4340 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4341 api_versionstring='5.005'
4344 : Do we want threads support and if so, what type
4345 case "$usethreads" in
4346 $define|true|[yY]*) dflt='y';;
4347 *) # Catch case where user specified ithreads or 5005threads but
4348 # forgot -Dusethreads (A.D. 4/2002)
4349 case "$useithreads$use5005threads" in
4350 *$define*) dflt='y';;
4357 Perl can be built to offer a form of threading support on some systems
4358 To do so, Configure can be run with -Dusethreads.
4360 Note that Perl built with threading support runs slightly slower
4361 and uses slightly more memory than plain Perl.
4363 If this doesn't make any sense to you, just accept the default '$dflt'.
4365 rp='Build a threading Perl?'
4368 y|Y) val="$define" ;;
4374 if $test $patchlevel -lt 9; then
4375 case "$usethreads" in
4377 : Default to ithreads unless overridden on command line or with
4380 case "$use5005threads" in
4382 echo "5.005 threads are no longer supported"
4386 case "$useithreads" in
4387 $undef|false|[nN]*) dflt='n';;
4389 rp='Use the newer interpreter-based ithreads?'
4392 y|Y) val="$define" ;;
4397 : Now set use5005threads to the opposite value.
4398 case "$useithreads" in
4399 $define) val="$undef" ;;
4406 useithreads="$undef"
4407 use5005threads="$undef"
4411 case "$useithreads$use5005threads" in
4415 You cannot have both the ithreads and the 5.005 threads enabled
4416 at the same time. Disabling the 5.005 threads since they are
4417 much less stable than the ithreads.
4420 use5005threads="$undef"
4425 : perl-5.9.x and later
4427 if test X"$usethreads" = "X$define"; then
4428 case "$use5005threads" in
4432 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4439 use5005threads="$undef"
4440 useithreads="$usethreads"
4443 case "$d_oldpthreads" in
4444 '') : Configure tests would be welcome here. For now, assume undef.
4446 *) val="$d_oldpthreads" ;;
4452 : Look for a hint-file generated 'call-back-unit'. If the
4453 : user has specified that a threading perl is to be built,
4454 : we may need to set or change some other defaults.
4455 if $test -f usethreads.cbu; then
4456 echo "Your platform has some specific hints regarding threaded builds, using them..."
4459 case "$usethreads" in
4460 "$define"|true|[yY]*)
4462 (Your platform does not have any specific hints for threaded builds.
4463 Assuming POSIX threads, then.)
4469 : Check if multiplicity is required
4472 Perl can be built so that multiple Perl interpreters can coexist
4473 within the same Perl executable.
4476 case "$useithreads" in
4479 This multiple interpreter support is required for interpreter-based threads.
4483 *) case "$usemultiplicity" in
4484 $define|true|[yY]*) dflt='y';;
4488 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4489 rp='Build Perl for multiplicity?'
4492 y|Y) val="$define" ;;
4500 : Check if morebits is requested
4501 case "$usemorebits" in
4502 "$define"|true|[yY]*)
4503 use64bitint="$define"
4504 uselongdouble="$define"
4505 usemorebits="$define"
4507 *) usemorebits="$undef"
4511 : Determine the C compiler to be used
4517 rp="Use which C compiler?"
4521 : See whether they have no cc but they do have gcc
4523 if $test -f cc.cbu; then
4528 : make some quick guesses about what we are up against
4530 $echo $n "Hmm... $c"
4540 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4541 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4543 echo "Looks kind of like an OSF/1 system, but we'll see..."
4545 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4546 xxx=`./loc addbib blurfl $pth`
4547 if $test -f $xxx; then
4548 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4552 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4553 echo "Looks kind of like an extended USG system, but we'll see..."
4555 echo "Looks kind of like a USG system, but we'll see..."
4559 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4560 echo "Looks kind of like a BSD system, but we'll see..."
4564 echo "Looks kind of like a Version 7 system, but we'll see..."
4567 case "$eunicefix" in
4570 There is, however, a strange, musty smell in the air that reminds me of
4571 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4575 : it so happens the Eunice I know will not run shell scripts in Unix format
4579 echo "Congratulations. You aren't running Eunice."
4583 : Detect OS2. The p_ variable is set above in the Head.U unit.
4584 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4585 : semicolon as a patch separator
4590 I have the feeling something is not exactly right, however...don't tell me...
4591 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4592 (Or you may be running DOS with DJGPP.)
4597 if test -f /xenix; then
4598 echo "Actually, this looks more like a XENIX system..."
4603 echo "It's not Xenix..."
4608 if test -f /venix; then
4609 echo "Actually, this looks more like a VENIX system..."
4616 echo "Nor is it Venix..."
4619 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4620 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4623 : Check if we are using GNU gcc and what its version is
4625 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4629 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4631 printf("%s\n", __VERSION__);
4633 printf("%s\n", "1");
4639 if $cc -o try $ccflags $ldflags try.c; then
4640 gccversion=`$run ./try`
4641 case "$gccversion" in
4642 '') echo "You are not using GNU cc." ;;
4643 *) echo "You are using GNU cc $gccversion."
4649 echo "*** WHOA THERE!!! ***" >&4
4650 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4651 case "$knowitall" in
4653 echo " You'd better start hunting for one and let me know about it." >&4
4659 case "$gccversion" in
4660 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4662 case "$gccversion" in
4663 '') gccosandvers='' ;;
4664 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4665 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4667 case "$gccosandvers" in
4668 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4669 $osname$osvers) ;; # looking good
4670 $osname*) cat <<EOM >&4
4672 *** WHOA THERE!!! ***
4674 Your gcc has not been compiled for the exact release of
4675 your operating system ($gccosandvers versus $osname$osvers).
4677 In general it is a good idea to keep gcc synchronized with
4678 the operating system because otherwise serious problems
4679 may ensue when trying to compile software, like Perl.
4681 I'm trying to be optimistic here, though, and will continue.
4682 If later during the configuration and build icky compilation
4683 problems appear (headerfile conflicts being the most common
4684 manifestation), I suggest reinstalling the gcc to match
4685 your operating system release.
4689 *) gccosandvers='' ;; # failed to parse, better be silent
4697 # gcc 3.* complain about adding -Idirectories that they already know about,
4698 # so we will take those off from locincpth.
4699 case "$gccversion" in
4701 echo "main(){}">try.c
4702 for incdir in $locincpth; do
4703 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4704 grep '^c[cp]p*[01]: warning: changing search order '`
4705 if test "X$warn" != X; then
4706 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4712 # gcc 4.9 by default does some optimizations that break perl.
4713 # see ticket 121505.
4715 # The -fwrapv disables those optimizations (and probably others,) so
4716 # for gcc 4.9 (and later, since the optimizations probably won't go
4717 # away), add -fwrapv unless the user requests -fno-wrapv, which
4718 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4719 # which turns the overflows -fwrapv ignores into runtime errors.
4720 case "$gccversion" in
4721 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4723 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4724 *) ccflags="$ccflags -fwrapv" ;;
4728 : What should the include directory be ?
4729 : Use sysroot if set, so findhdr looks in the right place.
4731 $echo $n "Hmm... $c"
4732 dflt="$sysroot/usr/include"
4735 if $test -f /bin/mips && /bin/mips; then
4736 echo "Looks like a MIPS system..."
4737 $cat >usr.c <<'EOCP'
4738 #ifdef SYSTYPE_BSD43
4742 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4743 dflt='/bsd43/usr/include'
4747 mips_type='System V'
4749 $rm -f usr.c usr.out
4750 echo "and you're compiling with the $mips_type compiler and libraries."
4754 echo "Doesn't look like a MIPS system."
4764 case "$xxx_prompt" in
4767 rp='Where are the include files you want to use?'
4775 : see how we invoke the C preprocessor
4777 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4778 cat <<'EOT' >testcpp.c
4784 if test ! -f cppstdin; then
4785 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4786 # AIX cc -E doesn't show the absolute headerfile
4787 # locations but we'll cheat by using the -M flag.
4788 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
4790 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4793 echo "Keeping your $hint cppstdin wrapper."
4796 wrapper=`pwd`/cppstdin
4800 if $test "X$cppstdin" != "X" && \
4801 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4802 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4804 echo "You used to use $cppstdin $cppminus so we'll use that again."
4806 '') echo "But let's see if we can live without a wrapper..." ;;
4808 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4809 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4811 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4814 echo "(However, $cpprun $cpplast does not work, let's see...)"
4822 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4829 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4830 $cc -E <testcpp.c >testcpp.out 2>&1; \
4831 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4832 echo "Yup, it does."
4833 x_cpp="$cc $cppflags -E"
4835 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4836 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4837 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4838 echo "Yup, it does."
4839 x_cpp="$cc $cppflags -E"
4841 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4842 $cc -P <testcpp.c >testcpp.out 2>&1; \
4843 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4844 echo "Yipee, that works!"
4845 x_cpp="$cc $cppflags -P"
4847 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4848 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4849 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4850 echo "At long last!"
4851 x_cpp="$cc $cppflags -P"
4853 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4854 $cpp <testcpp.c >testcpp.out 2>&1; \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4857 x_cpp="$cpp $cppflags"
4859 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4860 $cpp - <testcpp.c >testcpp.out 2>&1; \
4861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4862 echo "Hooray, it works! I was beginning to wonder."
4863 x_cpp="$cpp $cppflags"
4865 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4866 $wrapper <testcpp.c >testcpp.out 2>&1; \
4867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4873 rp="No dice. I can't find a C preprocessor. Name one:"
4877 $x_cpp <testcpp.c >testcpp.out 2>&1
4878 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 echo "OK, that will do." >&4
4881 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4896 echo "Perhaps can we force $cc -E using a wrapper..."
4897 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4904 echo "Nope, we'll have to live without it..."
4918 "$wrapper"|'cppstdin') ;;
4919 *) $rm -f $wrapper;;
4921 $rm -f testcpp.c testcpp.out
4923 : Adjust cppfilter for path component separator
4925 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4926 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4930 : Use gcc to determine libpth and incpth
4931 # If using gcc or clang, we can get better values for libpth, incpth
4932 # and usrinc directly from the compiler.
4933 # Note that ccname for clang is also gcc.
4936 $echo 'extern int foo;' > try.c
4937 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4939 if $test $# -gt 0; then
4941 incpth="`$echo $incpth|$sed 's/^ //'`"
4943 j="`$echo $i|$sed 's,/include$,/lib,'`"
4944 if $test -d $j; then
4948 libpth="`$echo $libpth|$sed 's/^ //'`"
4949 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4950 if $test -d $xxx; then
4953 *) libpth="$libpth $xxx";;
4960 '') for i in $incpth; do
4961 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4969 case "$usecrosscompile" in
4972 '') echo "Incpth not defined." >&4; croak=y ;;
4973 *) echo "Using incpth '$incpth'." >&4 ;;
4976 '') echo "Libpth not defined." >&4; croak=y ;;
4977 *) echo "Using libpth '$libpth'." >&4 ;;
4980 '') echo "Usrinc not defined." >&4; croak=y ;;
4981 *) echo "Using usrinc $usrinc." >&4 ;;
4985 if test "X$sysroot" = X; then
4986 echo "Cannot continue, aborting." >&4; exit 1
4988 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4997 : Default value for incpth is just usrinc
4999 '') incpth="$usrinc";;
5002 : Set private lib path
5005 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5010 '') dlist="$loclibpth $plibpth $glibpth";;
5011 *) dlist="$libpth";;
5014 : Now check and see which directories actually exist, avoiding duplicates
5017 if $test -d $xxx; then
5020 *) libpth="$libpth $xxx";;
5026 Some systems have incompatible or broken versions of libraries. Among
5027 the directories listed in the question below, please remove any you
5028 know not to be holding relevant libraries, and add any that are needed.
5029 Say "none" for none.
5033 if test "X$sysroot" != X; then
5035 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5048 rp="Directories to use for library searches?"
5055 : compute shared library extension
5058 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5068 On some systems, shared libraries may be available. Answer 'none' if
5069 you want to suppress searching of shared libraries for the remainder
5070 of this configuration.
5073 rp='What is the file extension used for shared libraries?'
5077 : Does target system insist that shared library basenames are unique
5080 Some dynamic loaders assume that the *basename* of shared library filenames
5081 are globally unique. We'll default this to undef as we assume your system
5082 is not this weird. Set to defined if you're on one of them.
5087 rp='Make shared library basenames unique?'
5090 y|Y) val="$define" ;;
5093 set d_libname_unique
5096 : Define several unixisms.
5097 : Hints files or command line option can be used to override them.
5098 : The convoluted testing is in case hints files set either the old
5101 '') case "$exe_ext" in
5103 *) _exe="$exe_ext" ;;
5108 '') case "$lib_ext" in
5115 '') case "$obj_ext" in
5122 '') case "$path_sep" in
5133 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5135 : Which makefile gets called first. This is used by make depend.
5136 case "$firstmakefile" in
5137 '') firstmakefile='makefile';;
5140 : Check is we will use socks
5142 $define|true|[yY]*) dflt='y';;
5147 Perl can be built to use the SOCKS proxy protocol library. To do so,
5148 Configure must be run with -Dusesocks. If you use SOCKS you also need
5149 to use the PerlIO abstraction layer, this will be implicitly selected.
5151 If this doesn't make any sense to you, just accept the default '$dflt'.
5153 rp='Build Perl for SOCKS?'
5156 y|Y) val="$define" ;;
5162 : Check for uselongdouble support
5164 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5167 case "$uselongdouble" in
5168 $define|true|[yY]*) dflt='y';;
5173 Perl can be built to take advantage of long doubles which
5174 (if available) may give more accuracy and range for floating point numbers.
5176 If this doesn't make any sense to you, just accept the default '$dflt'.
5178 rp='Try to use long doubles if available?'
5181 y|Y) val="$define" ;;
5187 case "$uselongdouble" in
5188 true|[yY]*) uselongdouble="$define" ;;
5191 : Look for a hint-file generated 'call-back-unit'. If the
5192 : user has specified that long doubles should be used,
5193 : we may need to set or change some other defaults.
5194 if $test -f uselongdouble.cbu; then
5195 echo "Your platform has some specific hints regarding long doubles, using them..."
5196 . ./uselongdouble.cbu
5198 case "$uselongdouble" in
5201 (Your platform does not have any specific hints for long doubles.)
5207 : Check if quadmath is requested
5208 case "$usequadmath" in
5209 "$define"|true|[yY]*) usequadmath="$define" ;;
5210 *) usequadmath="$undef" ;;
5213 : Looking for optional libraries
5215 echo "Checking for optional libraries..." >&4
5220 case "$libswanted" in
5221 '') libswanted='c_s';;
5224 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5226 case "$usecbacktrace" in
5227 "$define") libswanted="$libswanted bfd" ;;
5229 case "$usequadmath" in
5230 "$define") libswanted="$libswanted quadmath" ;;
5236 for thisdir in $libpth $xlibpth; do
5237 test -d $thisdir && libspath="$libspath $thisdir"
5239 for thislib in $libswanted; do
5240 for thisdir in $libspath; do
5242 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5243 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5244 $test -f "$xxx" && eval $libscheck
5245 $test -f "$xxx" && libstyle=shared
5246 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5247 $test -f "$xxx" && eval $libscheck
5248 $test -f "$xxx" && libstyle=shared
5250 if test ! -f "$xxx"; then
5251 xxx=$thisdir/lib$thislib.$so
5252 $test -f "$xxx" && eval $libscheck
5253 $test -f "$xxx" && libstyle=shared
5255 if test ! -f "$xxx"; then
5256 xxx=$thisdir/lib$thislib$_a
5257 $test -f "$xxx" && eval $libscheck
5258 $test -f "$xxx" && libstyle=static
5260 if test ! -f "$xxx"; then
5261 xxx=$thisdir/$thislib$_a
5262 $test -f "$xxx" && eval $libscheck
5263 $test -f "$xxx" && libstyle=static
5265 if test ! -f "$xxx"; then
5266 xxx=$thisdir/lib${thislib}_s$_a
5267 $test -f "$xxx" && eval $libscheck
5268 $test -f "$xxx" && libstyle=static
5269 $test -f "$xxx" && thislib=${thislib}_s
5271 if test ! -f "$xxx"; then
5272 xxx=$thisdir/Slib$thislib$_a
5273 $test -f "$xxx" && eval $libscheck
5274 $test -f "$xxx" && libstyle=static
5276 if $test -f "$xxx"; then
5278 shared) echo "Found -l$thislib (shared)." ;;
5279 static) echo "Found -l$thislib." ;;
5280 *) echo "Found -l$thislib ($libstyle)." ;;
5284 *) dflt="$dflt -l$thislib"
5285 libsfound="$libsfound $xxx"
5287 libsfiles="$libsfiles $yyy"
5288 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5289 case " $libsdirs " in
5291 *) libsdirs="$libsdirs $yyy" ;;
5298 if $test ! -f "$xxx"; then
5299 echo "No -l$thislib."
5310 ' '|'') dflt='none';;
5315 In order to compile $package on your machine, a number of libraries
5316 are usually needed. Include any other special libraries here as well.
5317 Say "none" for none. The default list is almost always right.
5321 rp="What libraries to use?"
5328 : determine optimization, if desired, or use for debug flag also
5330 ' '|$undef) dflt='none';;
5332 *) dflt="$optimize";;
5336 By default, $package compiles with the -O flag to use the optimizer.
5337 Alternately, you might want to use the symbolic debugger, which uses
5338 the -g flag (on traditional Unix systems). Either flag can be
5339 specified here. To use neither flag, specify the word "none".
5342 rp="What optimizer/debugger flag should be used?"
5346 'none') optimize=" ";;
5349 : Check what DEBUGGING is required from the command line
5350 : -DEBUGGING or -DDEBUGGING or
5351 : -DEBUGGING=both = -g + -DDEBUGGING
5352 : -DEBUGGING=-g or -Doptimize=-g = -g
5353 : -DEBUGGING=none or -UDEBUGGING =
5354 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5357 *) DEBUGGING=$EBUGGING ;;
5360 case "$DEBUGGING" in
5364 *) optimize="$optimize -g" ;;
5368 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5376 case "$DEBUGGING" in
5377 both|$define) dflt='-DDEBUGGING'
5380 : argument order is deliberate, as the flag will start with - which set could
5381 : think is an option
5382 checkccflag='check=$1; flag=$2; callback=$3;
5384 echo "Checking if your compiler accepts $flag" 2>&1;
5385 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5386 echo "int main(void) { return 0; }" > gcctest.c;
5387 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5388 echo "Yes, it does." 2>&1;
5389 if $test -s gcctest.out ; then
5390 echo "But your platform does not like it:";
5395 echo "Leaving current flags $ccflags alone." 2>&1
5397 *) dflt="$dflt $flag";
5403 echo "Nope, it does not, but that is ok." 2>&1;
5407 : We will not override a previous value, but we might want to
5408 : augment a hint file
5410 default|recommended)
5411 case "$gccversion" in
5412 1*) dflt="$dflt -fpcc-struct-return" ;;
5414 case "$optimize:$DEBUGGING" in
5415 *-g*:old) dflt="$dflt -DDEBUGGING";;
5417 case "$gccversion" in
5418 2*) if $test -d /etc/conf/kconfig.d &&
5419 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5421 # Interactive Systems (ISC) POSIX mode.
5426 case "$gccversion" in
5429 ?*) set strict-aliasing -fno-strict-aliasing
5433 # For gcc, adding -pipe speeds up compilations for some, but apparently
5434 # some assemblers can't read from stdin. (It also slows down compilations
5435 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5436 case "$gccversion" in
5442 # on x86_64 (at least) we require an extra library (libssp) in the
5443 # link command line. This library is not named, so I infer that it is
5444 # an implementation detail that may change. Hence the safest approach
5445 # is to add the flag to the flags passed to the compiler at link time,
5446 # as that way the compiler can do the right implementation dependant
5448 case "$gccversion" in
5449 ?*) set stack-protector-strong -fstack-protector-strong
5452 *-fstack-protector-strong*) ;; # It got added.
5453 *) # Try the plain/older -fstack-protector.
5454 set stack-protector -fstack-protector
5463 case "$mips_type" in
5464 *BSD*|'') inclwanted="$locincpth $usrinc";;
5465 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5467 for thisincl in $inclwanted; do
5468 if $test -d $thisincl; then
5469 if $test x$thisincl != x$usrinc; then
5471 *" -I$thisincl "*);;
5472 *) dflt="$dflt -I$thisincl ";;
5478 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5480 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5488 *) dflt="$dflt -D$2";;
5492 set signal.h LANGUAGE_C; eval $inctest
5496 ccflags="$ccflags -DSOCKS"
5501 default|recommended) dflt="$ccflags $dflt" ;;
5502 *) dflt="$ccflags";;
5511 Your C compiler may want other flags. For this question you should include
5512 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5513 but you should NOT include libraries or ld flags like -lwhatever. If you
5514 want $package to honor its debug switch, you should include -DDEBUGGING here.
5515 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5517 To use no flags, specify the word "none".
5523 rp="Any additional cc flags?"
5530 : the following weeds options from ccflags that are of no interest to cpp
5532 '') cppflags="$ccflags" ;;
5533 *) cppflags="$cppflags $ccflags" ;;
5535 case "$gccversion" in
5536 1*) cppflags="$cppflags -D__GNUC__"
5538 case "$mips_type" in
5540 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5546 echo "Let me guess what the preprocessor flags are..." >&4
5560 *) ftry="$previous $flag";;
5562 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5563 >cpp1.out 2>/dev/null && \
5564 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5565 >cpp2.out 2>/dev/null && \
5566 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5567 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5569 cppflags="$cppflags $ftry"
5579 *-*) echo "They appear to be: $cppflags";;
5581 $rm -f cpp.c cpp?.out
5585 : flags used in final linking phase
5587 '') if ./venix; then
5593 *-posix*) dflt="$dflt -posix" ;;
5596 *) dflt="$ldflags";;
5598 # See note above about -fstack-protector
5600 *-fstack-protector-strong*)
5602 *-fstack-protector-strong*) ;; # Don't add it again
5603 *) dflt="$dflt -fstack-protector-strong" ;;
5606 *-fstack-protector*)
5608 *-fstack-protector*) ;; # Don't add it again
5609 *) dflt="$dflt -fstack-protector" ;;
5614 : Try to guess additional flags to pick up local libraries.
5615 for thislibdir in $libpth; do
5616 case " $loclibpth " in
5619 *"-L$thislibdir "*) ;;
5620 *) dflt="$dflt -L$thislibdir" ;;
5632 Your C linker may need flags. For this question you should
5633 include -L/whatever and any other flags used by the C linker, but you
5634 should NOT include libraries like -lwhatever.
5636 Make sure you include the appropriate -L/path flags if your C linker
5637 does not normally search all of the directories you specified above,
5640 To use no flags, specify the word "none".
5644 rp="Any additional ld flags (NOT including libraries)?"
5650 rmlist="$rmlist pdp11"
5654 echo "Checking your choice of C compiler and flags for coherency..." >&4
5655 $cat > try.c <<'EOF'
5657 int main() { printf("Ok\n"); return(0); }
5659 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5661 $cat >try.msg <<'EOM'
5662 I've tried to compile and run the following simple program:
5665 $cat try.c >> try.msg
5667 $cat >> try.msg <<EOM
5674 and I got the following output:
5678 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5679 if $sh -c "$run ./try " >>try.msg 2>&1; then
5683 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5686 echo "The program compiled OK, but exited with status $?." >>try.msg
5687 rp="You have a problem. Shall I abort Configure"
5691 echo "I can't compile the test program." >>try.msg
5692 rp="You have a BIG problem. Shall I abort Configure"
5698 case "$knowitall" in
5700 echo "(The supplied flags or libraries might be incorrect.)"
5708 *) echo "Ok. Stopping Configure." >&4
5713 n) echo "OK, that should do.";;
5715 $rm_try gcctest gcctest.out
5717 : define a shorthand compile call
5721 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5722 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5726 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5727 : define a shorthand compile call for compilations that should be ok.
5731 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5733 : determine filename position in cpp output
5735 echo "Computing filename position in cpp output for #include directives..." >&4
5737 vos) testaccess=-e ;;
5740 echo '#include <stdio.h>' > foo.c
5743 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5744 $grep '^[ ]*#.*stdio\.h' | \
5745 while read cline; do
5748 while $test \$# -gt 0; do
5749 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5754 pos=\`expr \$pos + 1\`
5766 *) pos="${fieldn}th";;
5768 echo "Your cpp writes the filename in the $pos field of the line."
5770 : locate header file
5775 for usrincdir in $incpth
5777 if test -f \$usrincdir/\$wanted; then
5778 echo "\$usrincdir/\$wanted"
5782 awkprg='{ print \$$fieldn }'
5783 echo "#include <\$wanted>" > foo\$\$.c
5784 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5785 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5786 while read cline; do
5787 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5789 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5790 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5795 # status = 0: grep returned 0 lines, case statement not executed
5796 # status = 1: headerfile found
5797 # status = 2: while loop executed, no headerfile found
5801 if test \$status -eq 1; then
5808 : define an alternate in-header-list? function
5809 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5810 cont=true; xxf="echo \"<\$1> found.\" >&4";
5811 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5812 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5814 case $# in 4) instead=instead;; *) instead="at last";; esac;
5815 while $test "$cont"; do
5817 var=$2; eval "was=\$$2";
5818 if $test "$xxx" && $test -r "$xxx";
5820 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5823 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5824 set $yyy; shift; shift; yyy=$@;
5825 case $# in 0) cont="";;
5826 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5827 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5828 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5829 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5833 do set $yyy; var=$2; eval "was=\$$2";
5834 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5835 set $yyy; shift; shift; yyy=$@;
5838 : see if stdlib is available
5839 set stdlib.h i_stdlib
5842 : check for lengths of integral types
5846 echo "Checking to see how big your integers are..." >&4
5855 printf("intsize=%d;\n", (int)sizeof(int));
5856 printf("longsize=%d;\n", (int)sizeof(long));
5857 printf("shortsize=%d;\n", (int)sizeof(short));
5862 if eval $compile_ok && $run ./try > /dev/null; then
5864 echo "Your integers are $intsize bytes long."
5865 echo "Your long integers are $longsize bytes long."
5866 echo "Your short integers are $shortsize bytes long."
5870 Help! I can't compile and run the intsize test program: please enlighten me!
5871 (This is probably a misconfiguration in your system or libraries, and
5872 you really ought to fix it. Still, I'll try anyway.)
5876 rp="What is the size of an integer (in bytes)?"
5880 rp="What is the size of a long integer (in bytes)?"
5884 rp="What is the size of a short integer (in bytes)?"
5892 : check for long long
5894 echo "Checking to see if you have long long..." >&4
5895 echo 'int main() { long long x = 7; return 0; }' > try.c
5897 if eval $compile; then
5899 echo "You have long long."
5902 echo "You do not have long long."
5908 : check for length of long long
5909 case "${d_longlong}${longlongsize}" in
5912 echo "Checking to see how big your long longs are..." >&4
5913 $cat >try.c <<'EOCP'
5917 printf("%d\n", (int)sizeof(long long));
5922 if eval $compile_ok; then
5923 longlongsize=`$run ./try`
5924 echo "Your long longs are $longlongsize bytes long."
5928 echo "(I can't seem to compile the test program. Guessing...)"
5929 rp="What is the size of a long long (in bytes)?"
5933 if $test "X$longsize" = "X$longlongsize"; then
5934 echo "(That isn't any different from an ordinary long.)"
5940 : see if inttypes.h is available
5941 : we want a real compile instead of Inhdr because some systems
5942 : have an inttypes.h which includes non-existent headers
5945 #include <inttypes.h>
5947 static int32_t foo32 = 0x12345678;
5951 if eval $compile; then
5952 echo "<inttypes.h> found." >&4
5955 echo "<inttypes.h> NOT found." >&4
5964 echo "Checking to see if you have int64_t..." >&4
5966 #include <sys/types.h>
5967 #$i_inttypes I_INTTYPES
5969 #include <inttypes.h>
5971 int main() { int64_t x = 7; }
5974 if eval $compile; then
5976 echo "You have int64_t."
5979 echo "You do not have int64_t."
5985 : Check if 64bit ints have a quad type
5987 echo "Checking which 64-bit integer type we could use..." >&4
5993 val='"unsigned int"'
5998 *) case "$longsize" in
6002 val='"unsigned long"'
6007 *) case "$d_longlong:$longlongsize" in
6012 val='"unsigned long long"'
6017 *) case "$d_int64_t" in
6036 '') echo "Alas, no 64-bit integer types in sight." >&4
6039 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6044 : Do we want 64bit support
6045 case "$uselonglong" in
6046 "$define"|true|[yY]*)
6049 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6051 use64bitint="$define"
6054 case "$use64bits" in
6055 "$define"|true|[yY]*)
6058 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6060 use64bitint="$define"
6063 case "$use64bitints" in
6064 "$define"|true|[yY]*)
6067 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6069 use64bitint="$define"
6072 case "$use64bitsint" in
6073 "$define"|true|[yY]*)
6076 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6078 use64bitint="$define"
6081 case "$uselonglongs" in
6082 "$define"|true|[yY]*)
6085 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6087 use64bitint="$define"
6090 case "$use64bitsall" in
6091 "$define"|true|[yY]*)
6094 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6096 use64bitall="$define"
6101 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6103 case "$use64bitall" in
6104 "$define"|true|[yY]*) use64bitint="$define" ;;
6110 You have natively 64-bit long integers.
6114 *) case "$use64bitint" in
6115 "$define"|true|[yY]*) dflt='y';;
6124 Perl can be built to take advantage of 64-bit integer types
6125 on some systems. To do so, Configure can be run with -Duse64bitint.
6126 Choosing this option will most probably introduce binary incompatibilities.
6128 If this doesn't make any sense to you, just accept the default '$dflt'.
6129 (The default has been chosen based on your configuration.)
6131 rp='Try to use 64-bit integers, if available?'
6134 [yY]*) val="$define" ;;
6142 case "$use64bitall" in
6143 "$define"|true|[yY]*) dflt='y' ;;
6144 *) case "$longsize" in
6152 You may also choose to try maximal 64-bitness. It means using as much
6153 64-bitness as possible on the platform. This in turn means even more
6154 binary incompatibilities. On the other hand, your platform may not
6155 have any more 64-bitness available than what you already have chosen.
6157 If this doesn't make any sense to you, just accept the default '$dflt'.
6158 (The default has been chosen based on your configuration.)
6160 rp='Try to use maximal 64-bit support, if available?'
6163 [yY]*) val="$define" ;;
6168 case "$use64bitall" in
6170 case "$use64bitint" in
6174 Since you have chosen a maximally 64-bit build, I'm also turning on
6175 the use of 64-bit integers.
6177 use64bitint="$define" ;;
6182 : Look for a hint-file generated 'call-back-unit'. If the
6183 : user has specified that a 64-bit perl is to be built,
6184 : we may need to set or change some other defaults.
6185 if $test -f use64bitint.cbu; then
6186 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6189 case "$use64bitint" in
6190 "$define"|true|[yY]*)
6191 : This test was common to all the OpenBSD forks, and seems harmless for
6194 echo "Checking if your C library has broken 64-bit functions..." >&4
6197 typedef $uquadtype myULL;
6204 {4294967303.15, 4294967303ULL},
6205 {4294967294.2, 4294967294ULL},
6206 {4294967295.7, 4294967295ULL},
6209 for (p = test; p->u; p++) {
6210 myULL x = (myULL)p->d;
6221 if eval $compile_ok; then
6222 libcquad=`$run ./try`
6223 echo "Your C library's 64-bit functions are $libcquad."
6225 echo "(I can't seem to compile the test program.)"
6226 echo "Assuming that your C library's 64-bit functions are ok."
6235 *** You have a C library with broken 64-bit functions.
6236 *** 64-bit support does not work reliably in this configuration.
6237 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6238 *** Cannot continue, aborting.
6245 4) case "$archname64" in
6246 '') archname64=64int ;;
6253 : Look for a hint-file generated 'call-back-unit'. If the
6254 : user has specified that a maximally 64-bit perl is to be built,
6255 : we may need to set or change some other defaults.
6256 if $test -f use64bitall.cbu; then
6257 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6260 case "$use64bitall" in
6261 "$define"|true|[yY]*)
6263 4) case "$archname64" in
6264 ''|64int) archname64=64all ;;
6271 case "$d_quad:$use64bitint" in
6275 *** You have chosen to use 64-bit integers,
6276 *** but none can be found.
6277 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6278 *** Cannot continue, aborting.
6285 : Check if we are using the GNU C library
6287 echo "Checking for GNU C Library..." >&4
6289 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6290 alone are insufficient to distinguish different versions, such as
6291 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6292 libc version 2.1.0. A. Dougherty, June 3, 2002.
6298 # ifdef __GLIBC_MINOR__
6299 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6300 # include <gnu/libc-version.h>
6301 printf("%s\n", gnu_get_libc_version());
6303 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6306 printf("%d\n", __GLIBC__);
6315 if eval $compile_ok && $run ./try > glibc.ver; then
6317 gnulibc_version=`$cat glibc.ver`
6318 echo "You are using the GNU C Library version $gnulibc_version"
6322 echo "You are not using the GNU C Library"
6328 : see if nm is to be used to determine whether a symbol is defined or not
6332 case "$d_gnulibc" in
6335 echo "nm probably won't work on the GNU C Library." >&4
6341 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6343 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6344 echo "'nm' won't be sufficient on this system." >&4
6350 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6351 if $test $dflt -gt 20; then
6361 true|$define) dflt=y;;
6368 I can use $nm to extract the symbols from your C libraries. This
6369 is a time consuming task which may generate huge output on the disk (up
6370 to 3 megabytes) but that should make the symbols extraction faster. The
6371 alternative is to skip the 'nm' extraction part and to compile a small
6372 test program instead to determine whether each symbol is present. If
6373 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6374 this may be the best solution.
6376 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6379 rp="Shall I use $nm to extract C symbols from the libraries?"
6382 [Nn]*) usenm=false;;
6391 : nm options which may be necessary
6393 '') if $test -f /mach_boot; then
6395 elif $test -d /usr/ccs/lib; then
6396 nm_opt='-p' # Solaris (and SunOS?)
6397 elif $test -f /dgux; then
6399 elif $test -f /lib64/rld; then
6400 nm_opt='-p' # 64-bit Irix
6406 : nm options which may be necessary for shared libraries but illegal
6407 : for archive libraries. Thank you, Linux.
6408 case "$nm_so_opt" in
6409 '') case "$myuname" in
6411 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6412 nm_so_opt='--dynamic'
6419 : Figure out where the libc is located
6422 : get list of predefined functions in a handy place
6427 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6433 *) for thislib in $libs; do
6436 : Handle C library specially below.
6439 thislib=`echo $thislib | $sed -e 's/^-l//'`
6440 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6442 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6444 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6446 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6448 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6450 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6452 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6457 libnames="$libnames $try"
6459 *) libnames="$libnames $thislib" ;;
6468 for xxx in $libpth; do
6469 $test -r $1 || set $xxx/libc.$so
6470 : The messy sed command sorts on library version numbers.
6472 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6473 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6475 s/[0-9][0-9]*/0000&/g
6476 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6479 $sort | $sed -e 's/^.* //'`
6482 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6483 $test -r $1 || set $sysroot/lib/libsys_s$_a
6489 if $test -r "$1"; then
6490 echo "Your (shared) C library seems to be in $1."
6492 elif $test -r /lib/libc && $test -r /lib/clib; then
6493 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6495 libc='/lib/clib /lib/libc'
6496 if $test -r /lib/syslib; then
6497 echo "(Your math library is in /lib/syslib.)"
6498 libc="$libc /lib/syslib"
6500 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6501 echo "Your C library seems to be in $libc, as you said before."
6502 elif $test -r $incpath/usr/lib/libc$_a; then
6503 libc=$incpath/usr/lib/libc$_a;
6504 echo "Your C library seems to be in $libc. That's fine."
6505 elif $test -r /lib/libc$_a; then
6507 echo "Your C library seems to be in $libc. You're normal."
6509 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6511 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6512 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6513 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6515 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6517 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6520 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6522 if $test -r "$tans"; then
6523 echo "Your C library seems to be in $tans, of all places."
6529 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6533 If the guess above is wrong (which it might be if you're using a strange
6534 compiler, or your machine supports multiple models), you can override it here.
6539 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6541 I can't seem to find your C library. I've looked in the following places:
6544 $sed 's/^/ /' libpath
6547 None of these seems to contain your C library. I need to get its name...
6552 rp='Where is your C library?'
6557 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6558 set X `cat libnames`
6561 case $# in 1) xxx=file; esac
6562 echo "Extracting names from the following $xxx for later perusal:" >&4
6564 $sed 's/^/ /' libnames >&4
6566 $echo $n "This may take a while...$c" >&4
6570 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6571 *) $nm $nm_opt $file 2>/dev/null;;
6576 $grep fprintf libc.tmp > libc.ptf
6577 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6578 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6580 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6582 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6584 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6586 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6588 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6592 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6596 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6600 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6604 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6605 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6609 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6613 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6617 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6621 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6625 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6629 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6633 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6638 $nm -p $* 2>/dev/null >libc.tmp
6639 $grep fprintf libc.tmp > libc.ptf
6640 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6641 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6647 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6649 if $ar t $libc > libc.tmp && \
6650 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6652 for thisname in $libnames $libc; do
6653 $ar t $thisname >>libc.tmp
6655 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6657 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6658 for thisname in $libnames $libc; do
6659 $ar tv $thisname >>libc.tmp
6660 emximp -o tmp.imp $thisname \
6662 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6663 < tmp.imp >>libc.tmp
6666 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6669 echo "$ar didn't seem to work right." >&4
6670 echo "Maybe this is a Cray...trying bld instead..." >&4
6672 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6675 for thisname in $libnames; do
6677 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6678 $ar t $thisname >>libc.tmp
6682 echo "That didn't work either. Giving up." >&4
6692 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6693 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6695 *) if $test -f /lib/syscalls.exp; then
6697 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6698 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6699 /lib/syscalls.exp >>libc.list
6705 $rm -f libnames libpath
6707 : Check if we are using C++
6709 echo "Checking for C++..." >&4
6710 $cat >try.c <<'EOCP'
6722 if eval $compile_ok && $run ./try; then
6724 echo "You are using a C++ compiler."
6727 echo "You are not using a C++ compiler."
6733 : is a C symbol defined?
6736 -v) tf=libc.tmp; tdc="";;
6737 -a) tf=libc.tmp; tdc="[]";;
6738 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6740 case "$d_cplusplus" in
6741 $define) extern_C="extern \"C\"" ;;
6742 *) extern_C="extern" ;;
6745 case "$reuseval-$4" in
6747 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6752 if $test "$runnm" = true; then
6753 if $contains $tlook $tf >/dev/null 2>&1; then
6755 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6756 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;
6757 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6758 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6762 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;
6763 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6769 $define) tval=true;;
6776 : define an is-in-libc? function
6777 inlibc='echo " "; td=$define; tu=$undef;
6778 sym=$1; var=$2; eval "was=\$$2";
6780 case "$reuseval$was" in
6790 echo "$sym() found." >&4;
6791 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6793 echo "$sym() NOT found." >&4;
6794 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6798 $define) echo "$sym() found." >&4;;
6799 *) echo "$sym() NOT found." >&4;;
6803 : check for length of double
6805 case "$doublesize" in
6807 echo "Checking to see how big your double precision numbers are..." >&4
6816 printf("%d\n", (int)sizeof(double));
6821 if eval $compile_ok; then
6822 doublesize=`$run ./try`
6823 echo "Your double is $doublesize bytes long."
6826 echo "(I can't seem to compile the test program. Guessing...)"
6827 rp="What is the size of a double precision number (in bytes)?"
6835 : see if this is a float.h system
6839 : check for long doubles
6841 echo "Checking to see if you have long double..." >&4
6842 echo 'int main() { long double x = 7.0; }' > try.c
6844 if eval $compile; then
6846 echo "You have long double."
6849 echo "You do not have long double."
6855 : see if ldexpl exists
6859 : check for length of long double
6860 case "${d_longdbl}${longdblsize}" in
6863 echo "Checking to see how big your long doubles are..." >&4
6864 $cat >try.c <<'EOCP'
6868 printf("%d\n", sizeof(long double));
6873 if eval $compile; then
6874 longdblsize=`$run ./try`
6875 echo "Your long doubles are $longdblsize bytes long."
6879 echo "(I can't seem to compile the test program. Guessing...)" >&4
6880 rp="What is the size of a long double (in bytes)?"
6884 if $test "X$doublesize" = "X$longdblsize"; then
6885 echo "That isn't any different from an ordinary double."
6886 echo "I'll keep your setting anyway, but you may see some"
6887 echo "harmless compilation warnings."
6893 $echo "Checking the kind of long doubles you have..." >&4
6894 case "$d_longdbl" in
6899 #define LONGDBLSIZE $longdblsize
6900 #define DOUBLESIZE $doublesize
6908 static const long double d = -0.1L;
6910 unsigned const char* b = (unsigned const char*)(&d);
6911 #if DOUBLESIZE == LONGDBLSIZE
6912 printf("0\n"); /* if it floats like double */
6915 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6916 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6917 /* IEEE 754 128-bit little-endian */
6921 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6922 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6927 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6928 * while 64-bits platforms have it in 16 bytes. */
6929 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6930 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6931 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6932 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6933 * Also known as "extended precision". */
6937 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6938 /* is there ever big-endian 80-bit, really? */
6943 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6944 /* software "double double", the 106 is 53+53.
6945 * but irix thinks it is 107. */
6946 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6947 /* double double 128-bit little-endian,
6948 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6952 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6953 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6954 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6959 printf("-1\n"); /* unknown */
6964 if eval $compile; then
6965 longdblkind=`$run ./try`
6972 case "$longdblkind" in
6973 0) echo "Your long doubles are doubles." >&4 ;;
6974 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6975 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6976 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6977 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
6978 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
6979 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
6980 *) echo "Cannot figure out your long double." >&4 ;;
6984 : determine the architecture name
6986 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6987 tarch=`arch`"-$osname"
6988 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6989 if uname -m > tmparch 2>&1 ; then
6990 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6991 -e 's/$/'"-$osname/" tmparch`
6999 case "$myarchname" in
7002 echo "(Your architecture name used to be $myarchname.)"
7006 case "$targetarch" in
7008 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7013 *) dflt="$archname";;
7015 rp='What is your architecture name'
7019 : optionally add API version to the architecture for versioned archlibs
7020 case "$useversionedarchname" in
7021 $define|true|[yY]*) dflt='y';;
7024 rp='Add the Perl API version to your archname?'
7027 y|Y) useversionedarchname="$define" ;;
7028 *) useversionedarchname="$undef" ;;
7030 case "$useversionedarchname" in
7033 *-$api_versionstring)
7034 echo "...and architecture name already has -$api_versionstring" >&4
7037 archname="$archname-$api_versionstring"
7038 echo "...setting architecture name to $archname." >&4
7044 case "$usethreads" in
7046 echo "Threads selected." >&4
7048 *-thread*) echo "...and architecture name already has -thread." >&4
7050 *) archname="$archname-thread"
7051 echo "...setting architecture name to $archname." >&4
7056 case "$usemultiplicity" in
7058 echo "Multiplicity selected." >&4
7060 *-multi*) echo "...and architecture name already has -multi." >&4
7062 *) archname="$archname-multi"
7063 echo "...setting architecture name to $archname." >&4
7068 case "$use64bitint$use64bitall" in
7070 case "$archname64" in
7072 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7075 case "$use64bitint" in
7076 "$define") echo "64 bit integers selected." >&4 ;;
7078 case "$use64bitall" in
7079 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7082 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7084 *) archname="$archname-$archname64"
7085 echo "...setting architecture name to $archname." >&4
7091 case "$uselongdouble" in
7093 echo "Long doubles selected." >&4
7094 case "$longdblsize" in
7096 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7100 *-ld*) echo "...and architecture name already has -ld." >&4
7102 *) archname="$archname-ld"
7103 echo "...setting architecture name to $archname." >&4
7110 case "$usequadmath" in
7112 echo "quadmath selected." >&4
7114 *-ld*) echo "...and architecture name already has -quadmath." >&4
7116 *) archname="$archname-quadmath"
7117 echo "...setting architecture name to $archname." >&4
7122 if $test -f archname.cbu; then
7123 echo "Your platform has some specific hints for architecture name, using them..."
7127 : set the prefixit variable, to compute a suitable default value
7128 prefixit='case "$3" in
7130 case "$oldprefix" in
7131 "") eval "$1=\"\$$2\"";;
7138 ""|" ") eval "$1=\"\$$2\"";;
7144 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7146 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7147 /*-$oldprefix/*|\~*-$oldprefix/*)
7148 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7149 *) eval "$1=\"\$$2\"";;
7153 : determine installation style
7154 : For now, try to deduce it from prefix unless it is already set.
7155 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7156 case "$installstyle" in
7157 '') case "$prefix" in
7158 *perl*) dflt='lib';;
7159 *) dflt='lib/perl5' ;;
7162 *) dflt="$installstyle" ;;
7164 : Probably not worth prompting for this since we prompt for all
7165 : the directories individually, and the prompt would be too long and
7169 : determine where public executables go
7174 rp='Pathname where the public executables will reside?'
7176 if $test "X$ansexp" != "X$binexp"; then
7180 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7181 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7182 : this via initialinstalllocation
7185 case "$userelocatableinc" in
7186 $define|true|[yY]*) dflt='y' ;;
7191 Would you like to build Perl so that the installation is relocatable, so that
7192 library paths in @INC are determined relative to the path of the perl binary?
7193 This is not advised for system Perl installs, or if you need to run setid
7194 scripts or scripts under taint mode.
7196 If this doesn't make any sense to you, just accept the default '$dflt'.
7198 rp='Use relocatable @INC?'
7201 y|Y) val="$define" ;;
7204 set userelocatableinc
7207 initialinstalllocation="$binexp"
7208 : Default prefix is now "up one level from where the binaries are"
7209 case "$userelocatableinc" in
7215 installprefixexp=".../.."
7219 : determine where private library files go
7220 : Usual default is /usr/local/lib/perl5/$version.
7221 : Also allow things like /opt/perl/lib/$version, since
7222 : /opt/perl/lib/perl5... would be redundant.
7223 : The default "style" setting is made in installstyle.U
7224 case "$installstyle" in
7225 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7226 *) set dflt privlib lib/$version ;;
7231 There are some auxiliary files for $package that need to be put into a
7232 private library directory that is accessible by everyone.
7237 rp='Pathname where the private library files will reside?'
7242 : set the prefixup variable, to restore leading tilda escape
7243 prefixup='case "$prefixexp" in
7245 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7248 : determine where public architecture dependent libraries go
7251 : privlib default is /usr/local/lib/$package/$version
7252 : archlib default is /usr/local/lib/$package/$version/$archname
7253 : privlib may have an optional trailing /share.
7254 tdflt=`echo $privlib | $sed 's,/share$,,'`
7255 tdflt=$tdflt/$archname
7264 $spackage contains architecture-dependent library files. If you are
7265 sharing libraries in a heterogeneous environment, you might store
7266 these files in a separate location. Otherwise, you can just include
7267 them with the rest of the public library files.
7272 rp='Where do you want to put the public architecture-dependent libraries?'
7276 if $test X"$archlib" = X"$privlib"; then
7282 : see if setuid scripts can be secure
7285 Some kernels have a bug that prevents setuid #! scripts from being
7286 secure. Some sites have disabled setuid #! scripts because of this.
7288 First let's decide if your kernel supports secure setuid #! scripts.
7289 (If setuid #! scripts would be secure but have been disabled anyway,
7290 don't say that they are secure if asked.)
7295 if $test -d /dev/fd; then
7296 echo "#!$ls" >reflect
7297 chmod +x,u+s reflect
7298 ./reflect >flect 2>&1
7299 if $contains "/dev/fd" flect >/dev/null; then
7300 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7304 If you are not sure if they are secure, I can check but I'll need a
7305 username and password different from the one you are using right now.
7306 If you don't have such a username or don't want me to test, simply
7310 rp='Other username to test security of setuid scripts with?'
7315 case "$d_suidsafe" in
7316 '') echo "I'll assume setuid scripts are *not* secure." >&4
7319 echo "Well, the $hint value is *not* secure." >&4
7321 *) echo "Well, the $hint value *is* secure." >&4
7326 $rm -f reflect flect
7327 echo "#!$ls" >reflect
7328 chmod +x,u+s reflect
7331 echo '"su" will (probably) prompt you for '"$ans's password."
7332 su $ans -c './reflect >flect'
7333 if $contains "/dev/fd" flect >/dev/null; then
7334 echo "Okay, it looks like setuid scripts are secure." >&4
7337 echo "I don't think setuid scripts are secure." >&4
7342 rp='Does your kernel have *secure* setuid scripts?'
7345 [yY]*) val="$define";;
7350 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7351 echo "(That's for file descriptors, not floppy disks.)"
7357 $rm -f reflect flect
7359 : now see if they want to do setuid emulation
7360 if $test $patchlevel -lt 11; then
7363 case "$d_suidsafe" in
7366 echo "No need to emulate SUID scripts since they are secure here." >&4
7370 Some systems have disabled setuid scripts, especially systems where
7371 setuid scripts cannot be secure. On systems where setuid scripts have
7372 been disabled, the setuid/setgid bits on scripts are currently
7373 useless. It is possible for $package to detect those bits and emulate
7374 setuid/setgid in a secure fashion. This emulation will only work if
7375 setuid scripts have been disabled in your kernel.
7379 "$define") dflt=y ;;
7382 rp="Do you want to do setuid/setgid emulation?"
7385 [yY]*) val="$define";;
7397 SUID emulation has been removed for 5.12
7398 Please re-run Configure without -Dd_dosuid
7407 : Find perl5.005 or later.
7408 echo "Looking for a previously installed perl5.005 or later... "
7410 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7411 : Check if this perl is recent and can load a simple module
7412 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7415 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7425 '') echo "None found. That's ok.";;
7426 *) echo "Using $perl5." ;;
7429 : Set the siteprefix variables
7432 After $package is installed, you may wish to install various
7433 add-on modules and utilities. Typically, these add-ons will
7434 be installed under $prefix with the rest
7435 of this package. However, you may wish to install such add-ons
7436 elsewhere under a different prefix.
7438 If you do not wish to put everything under a single prefix, that's
7439 ok. You will be prompted for the individual locations; this siteprefix
7440 is only used to suggest the defaults.
7442 The default should be fine for most people.
7446 rp='Installation prefix to use for add-on modules and utilities?'
7447 : XXX Here might be another good place for an installstyle setting.
7448 case "$siteprefix" in
7450 *) dflt=$siteprefix ;;
7453 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7455 case "$siteprefix" in
7459 *) oldsiteprefix="$prefix";;
7464 siteprefixexp="$ansexp"
7466 : determine where site specific libraries go.
7467 : Usual default is /usr/local/lib/perl5/site_perl/$version
7468 : The default "style" setting is made in installstyle.U
7469 : XXX No longer works with Prefixit stuff.
7470 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7472 '') case "$installstyle" in
7473 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7474 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7482 The installation process will create a directory for
7483 site-specific extensions and modules. Most users find it convenient
7484 to place all site-specific files in this directory rather than in the
7485 main distribution directory.
7489 rp='Pathname for the site-specific library files?'
7493 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7495 : Determine list of previous versions to include in @INC
7496 $cat > getverlist <<EOPL
7499 \$api_versionstring = "$api_versionstring";
7500 \$version = "$version";
7501 \$stem = "$sitelib_stem";
7502 \$archname = "$archname";
7504 $cat >> getverlist <<'EOPL'
7505 # The list found is store twice for each entry: the original name, and
7506 # the binary broken down version as pack "sss", so sorting is easy and
7507 # unambiguous. This will work for all versions that have a maximum of
7508 # three digit groups, separate by '.'s or '_'s. Names are extended with
7509 # ".0.0" to ensure at least three elements for the pack.
7510 # -- H.Merijn Brand (m)'06 23-10-2006
7512 # Can't have leading @ because metaconfig interprets it as a command!
7513 ;@inc_version_list=();
7514 # XXX Redo to do opendir/readdir?
7517 ;@candidates = map {
7518 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7519 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7525 ($pversion, $aversion, $vsn5005) = map {
7526 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7527 foreach $d (@candidates) {
7528 if ($d->[1] lt $pversion) {
7529 if ($d->[1] ge $aversion) {
7530 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7532 elsif ($d->[1] ge $vsn5005) {
7533 unshift(@inc_version_list, grep { -d } $d->[0]);
7537 # Skip newer version. I.e. don't look in
7538 # 5.7.0 if we're installing 5.6.1.
7542 if (@inc_version_list) {
7543 print join(' ', @inc_version_list);
7546 # Blank space to preserve value for next Configure run.
7551 case "$inc_version_list" in
7552 '') if test -x "$perl5$exe_ext"; then
7553 dflt=`$perl5 getverlist`
7558 $undef) dflt='none' ;;
7559 *) eval dflt=\"$inc_version_list\" ;;
7562 ''|' ') dflt=none ;;
7569 In order to ease the process of upgrading, this version of perl
7570 can be configured to use modules built and installed with earlier
7571 versions of perl that were installed under $prefix. Specify here
7572 the list of earlier versions that this version of perl should check.
7573 If Configure detected no earlier versions of perl installed under
7574 $prefix, then the list will be empty. Answer 'none' to tell perl
7575 to not search earlier versions.
7577 The default should almost always be sensible, so if you're not sure,
7578 just accept the default.
7581 rp='List of earlier versions to include in @INC?'
7584 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7585 *) inc_version_list="$ans" ;;
7587 case "$inc_version_list" in
7589 inc_version_list_init='0'
7590 d_inc_version_list="$undef"
7592 *) inc_version_list_init=`echo $inc_version_list |
7593 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7594 d_inc_version_list="$define"
7599 : see if malloc/malloc.h has to be included
7600 set malloc/malloc.h i_mallocmalloc
7603 : see if this is a malloc.h system
7604 : we want a real compile instead of Inhdr because some systems have a
7605 : malloc.h that just gives a compile error saying to use stdlib.h instead
7610 #$i_mallocmalloc I_MALLOCMALLOC
7611 #ifdef I_MALLOCMALLOC
7612 # include <malloc/malloc.h>
7615 int main () { return 0; }
7618 if eval $compile; then
7619 echo "<malloc.h> found." >&4
7622 echo "<malloc.h> NOT found." >&4
7629 : check for length of pointer
7633 echo "Checking to see how big your pointers are..." >&4
7642 printf("%d\n", (int)sizeof(void *));
7647 if eval $compile_ok; then
7648 ptrsize=`$run ./try`
7649 echo "Your pointers are $ptrsize bytes long."
7652 echo "(I can't seem to compile the test program. Guessing...)" >&4
7653 rp="What is the size of a pointer (in bytes)?"
7660 case "$use64bitall" in
7661 "$define"|true|[yY]*)
7665 *** You have chosen a maximally 64-bit build,
7666 *** but your pointers are only 4 bytes wide.
7667 *** Please rerun Configure without -Duse64bitall.
7672 *** Since you have quads, you could possibly try with -Duse64bitint.
7677 *** Cannot continue, aborting.
7688 : determine whether to use malloc wrapping
7690 case "$usemallocwrap" in
7691 [yY]*|true|$define) dflt='y' ;;
7692 [nN]*|false|$undef) dflt='n' ;;
7693 *) case "$usedevel" in
7694 [yY]*|true|$define) dflt='y' ;;
7699 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7701 usemallocwrap="$ans"
7704 usemallocwrap="$define" ;;
7706 usemallocwrap="$undef" ;;
7709 : determine which malloc to compile in
7711 case "$usemymalloc" in
7712 [yY]*|true|$define) dflt='y' ;;
7713 [nN]*|false|$undef) dflt='n' ;;
7714 *) case "$ptrsize" in
7718 if test "$useithreads" = "$define"; then dflt='n'; fi
7721 rp="Do you wish to attempt to use the malloc that comes with $package?"
7727 mallocsrc='malloc.c'
7728 mallocobj="malloc$_o"
7729 d_mymalloc="$define"
7732 : Remove malloc from list of libraries to use
7733 echo "Removing unneeded -lmalloc from library list" >&4
7734 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7737 echo "libs = $libs" >&4
7749 : compute the return types of malloc and free
7751 $cat >malloc.c <<END
7755 #include <sys/types.h>
7769 case "$malloctype" in
7771 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7778 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7782 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7789 echo "Your system uses $freetype free(), it would seem." >&4
7791 : determine where site specific architecture-dependent libraries go.
7792 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7793 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7794 : sitelib may have an optional trailing /share.
7796 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7797 dflt="$dflt/$archname"
7802 set sitearch sitearch none
7806 The installation process will also create a directory for
7807 architecture-dependent site-specific extensions and modules.
7811 rp='Pathname for the site-specific architecture-dependent library files?'
7815 if $test X"$sitearch" = X"$sitelib"; then
7818 d_sitearch="$define"
7821 : Set the vendorprefix variables
7824 The installation process will also create a directory for
7825 vendor-supplied add-ons. Vendors who supply perl with their system
7826 may find it convenient to place all vendor-supplied files in this
7827 directory rather than in the main distribution directory. This will
7828 ease upgrades between binary-compatible maintenance versions of perl.
7830 Of course you may also use these directories in whatever way you see
7831 fit. For example, you might use them to access modules shared over a
7832 company-wide network.
7834 The default answer should be fine for most people.
7835 This causes further questions about vendor add-ons to be skipped
7836 and no vendor-specific directories will be configured for perl.
7839 rp='Do you want to configure vendor-specific add-on directories?'
7840 case "$usevendorprefix" in
7841 define|true|[yY]*) dflt=y ;;
7842 *) : User may have set vendorprefix directly on Configure command line.
7843 case "$vendorprefix" in
7852 rp='Installation prefix to use for vendor-supplied add-ons?'
7853 case "$vendorprefix" in
7854 '') dflt="$prefix" ;;
7855 *) dflt=$vendorprefix ;;
7858 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7860 case "$vendorprefix" in
7864 *) oldvendorprefix="$prefix";;
7868 usevendorprefix="$define"
7870 vendorprefixexp="$ansexp"
7872 *) usevendorprefix="$undef"
7878 : Set the vendorlib variables
7879 case "$vendorprefix" in
7880 '') d_vendorlib="$undef"
7884 *) d_vendorlib="$define"
7885 : determine where vendor-supplied modules go.
7886 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7887 case "$vendorlib" in
7889 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7890 case "$installstyle" in
7891 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7892 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7895 *) dflt="$vendorlib"
7899 rp='Pathname for the vendor-supplied library files?'
7902 vendorlibexp="$ansexp"
7905 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7909 : Set the vendorarch variables
7910 case "$vendorprefix" in
7911 '') d_vendorarch="$undef"
7915 *) d_vendorarch="$define"
7916 : determine where vendor-supplied architecture-dependent libraries go.
7917 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7918 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7919 : vendorlib may have an optional trailing /share.
7920 case "$vendorarch" in
7921 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7922 dflt="$dflt/$archname"
7924 *) dflt="$vendorarch" ;;
7927 rp='Pathname for vendor-supplied architecture-dependent files?'
7930 vendorarchexp="$ansexp"
7933 prefixvar=vendorarch
7935 if $test X"$vendorarch" = X"$vendorlib"; then
7936 d_vendorarch="$undef"
7938 d_vendorarch="$define"
7941 : Final catch-all directories to search
7944 Lastly, you can have perl look in other directories for extensions and
7945 modules in addition to those already specified.
7946 These directories will be searched after
7950 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7951 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7953 case "$otherlibdirs" in
7954 ''|' ') dflt='none' ;;
7955 *) dflt="$otherlibdirs" ;;
7958 Enter a colon-separated set of extra paths to include in perl's @INC
7959 search path, or enter 'none' for no extra paths.
7963 rp='Colon-separated list of additional directories for perl to search?'
7966 ' '|''|none) otherlibdirs=' ' ;;
7967 *) otherlibdirs="$ans" ;;
7969 case "$otherlibdirs" in
7973 set d_perl_otherlibdirs
7976 : Cruising for prototypes
7978 echo "Checking out function prototypes..." >&4
7979 $cat >prototype.c <<EOCP
7984 int main(int argc, char *argv[]) {
7987 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7988 echo "Your C compiler appears to support function prototypes."
7991 echo "Your C compiler doesn't seem to understand function prototypes."
7998 : Check if ansi2knr is required
7999 case "$prototype" in
8001 *) ansi2knr='ansi2knr'
8006 This version of $package can only be compiled by a compiler that
8007 understands function prototypes. Unfortunately, your C compiler
8009 doesn't seem to understand them. Sorry about that.
8011 If GNU cc is available for your system, perhaps you could try that instead.
8013 Eventually, we hope to support building Perl with pre-ANSI compilers.
8014 If you would like to help in that effort, please contact <perlbug@perl.org>.
8016 Aborting Configure now.
8023 dflt_dtrace='/usr/sbin/dtrace'
8024 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8028 Perl can be built to support DTrace on platforms that support it.
8029 DTrace is a diagnosis and performance analysis tool from Sun.
8031 If this doesn't make any sense to you, just accept the default '$dflt'.
8035 case "$usedtrace" in
8041 dflt_dtrace=$usedtrace
8048 rp='Support DTrace if available?'
8051 y|Y) val="$define" ;;
8057 test "X$usedtrace" != "X$define" && break
8060 rp='Where is the dtrace executable?'
8069 if $dtrace -h -s ../perldtrace.d \
8070 -o perldtrace.tmp >/dev/null 2>&1 \
8071 && rm -f perldtrace.tmp
8074 echo "Good: your $dtrace knows about the -h flag."
8078 *** $me: Fatal Error: $dtrace doesn't support -h flag
8080 *** Your installed dtrace doesn't support the -h switch to compile a D
8081 *** program into a C header. Can't continue.
8093 *** $me: Fatal Error: $dtrace not found.
8100 echo "*** $dtrace was not found."
8106 : See if we want extra modules installed
8113 Perl can be built with extra modules or bundles of modules which
8114 will be fetched from the CPAN and installed alongside Perl.
8116 Notice that you will need access to the CPAN; either via the Internet,
8117 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8118 be asked later to configure the CPAN.pm module which will in turn do
8119 the installation of the rest of the extra modules or bundles.)
8121 Notice also that if the modules require any external software such as
8122 libraries and headers (the libz library and the zlib.h header for the
8123 Compress::Zlib module, for example) you MUST have any such software
8124 already installed, this configuration process will NOT install such
8127 If this doesn't make any sense to you, just accept the default '$dflt'.
8129 rp='Install any extra modules (y or n)?'
8135 Please list any extra modules or bundles to be installed from CPAN,
8136 with spaces between the names. The names can be in any format the
8137 'install' command of CPAN.pm will understand. (Answer 'none',
8138 without the quotes, to install no extra modules or bundles.)
8148 $rm -f ../extras.lst
8150 *) echo "(Saving the list of extras for later...)"
8151 echo "$extras" > ../extras.lst
8159 : determine where html pages for programs go
8160 set html1dir html1dir none
8164 If you wish to install html files for programs in $spackage, indicate
8165 the appropriate directory here. To skip installing html files,
8169 ''|none|$undef|' ') dflt=none ;;
8170 *) dflt=$html1dir ;;
8173 rp="Directory for the main $spackage html pages?"
8177 : Use ' ' for none so value is preserved next time through Configure
8178 $test X"$html1dir" = "X" && html1dir=' '
8180 : determine where html pages for libraries and modules go
8181 set html3dir html3dir none
8185 If you wish to install html files for modules associated with $spackage,
8186 indicate the appropriate directory here. To skip installing html files,
8189 : There is no obvious default. If they have specified html1dir, then
8190 : try to key off that, possibly changing .../html1 into .../html3.
8192 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8193 *) dflt=$html3dir ;;
8196 rp="Directory for the $spackage module html pages?"
8200 : Use ' ' for none so value is preserved next time through Configure
8201 $test X"$html3dir" = "X" && html3dir=' '
8203 : determine whether to install perl also as /usr/bin/perl
8206 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8208 Many scripts expect perl to be installed as /usr/bin/perl.
8210 If you want to, I can install the perl you are about to compile
8211 as /usr/bin/perl (in addition to $bin/perl).
8213 if test -f /usr/bin/perl; then
8216 However, please note that because you already have a /usr/bin/perl,
8217 overwriting that with a new Perl would very probably cause problems.
8218 Therefore I'm assuming you don't want to do that (unless you insist).
8221 case "$installusrbinperl" in
8222 "$define"|[yY]*) dflt='y';;
8228 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8231 case "$installusrbinperl" in
8232 "$undef"|[nN]*) dflt='n';;
8236 rp="Do you want to install perl as /usr/bin/perl?"
8239 [yY]*) val="$define";;
8245 set installusrbinperl
8248 : see if dlopen exists
8250 xxx_ccflags="$ccflags"
8252 : with g++ one needs -shared to get is-in-libc to work for dlopen
8253 case "$gccversion" in
8255 *) case "$d_cplusplus" in
8256 "$define") ccflags="$ccflags -shared" ;;
8263 ccflags="$xxx_ccflags"
8265 : see if this is a unistd.h system
8266 set unistd.h i_unistd
8269 : determine which dynamic loading, if any, to compile in
8271 dldir="ext/DynaLoader"
8284 $define) dflt='y' ;;
8286 : Does a dl_xxx.xs file exist for this operating system
8287 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8290 rp="Do you wish to use dynamic loading?"
8297 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8298 dflt="$dldir/dl_${osname}.xs"
8299 elif $test "$d_dlopen" = "$define" ; then
8300 dflt="$dldir/dl_dlopen.xs"
8305 *) dflt="$dldir/$dlsrc"
8308 echo "The following dynamic loading files are available:"
8309 : Can not go over to $dldir because getfile has path hard-coded in.
8310 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8311 rp="Source file to use for dynamic loading"
8317 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8321 Some systems may require passing special flags to $cc -c to
8322 compile modules that will be used to create a shared library.
8323 To use no flags, say "none".
8326 case "$cccdlflags" in
8327 '') case "$gccversion" in
8328 '') case "$osname" in
8330 irix*) dflt='-KPIC' ;;
8331 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8332 sunos) dflt='-pic' ;;
8336 *) case "$osname" in
8337 darwin) dflt='none' ;;
8338 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8343 *) dflt="$cccdlflags" ;;
8350 # If -Dsysroot was specified, now's the time to add it
8352 if test "X$sysroot" != X; then
8353 case "$gccversion" in
8358 dflt="$dflt --sysroot=$sysroot" ;;
8368 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8371 none) cccdlflags=' ' ;;
8372 *) cccdlflags="$ans" ;;
8377 Some systems use ld to create libraries that can be dynamically loaded,
8378 while other systems (such as those using ELF) use $cc.
8382 : Determine if this is ELF
8384 /* Test for whether ELF binaries are produced */
8396 int i = open("a.out",O_RDONLY);
8399 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8400 exit(0); /* succeed (yes, it is ELF) */
8404 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8410 '') if $test $bin_ELF = "$define"; then
8412 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8416 echo "I'll use ld to build dynamic libraries."
8424 rp="What command should be used to create dynamic libraries?"
8430 Some systems may require passing special flags to $ld to create a
8431 library that can be dynamically loaded. If your ld flags include
8432 -L/other/path options to locate libraries outside your loader's normal
8433 search path, you may need to specify those -L options here as well. To
8434 use no flags, say "none".
8437 case "$lddlflags" in
8438 '') case "$osname" in
8439 haiku) dflt='-shared' ;;
8441 case "$gccversion" in
8442 '') dflt="$dflt +vnocompatwarnings" ;;
8445 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8446 solaris) # See [perl #66604].
8447 # On Solaris 11, gcc -m64 on amd64
8448 # appears not to understand -G. gcc versions at
8449 # least as old as 3.4.3 support -shared, so just
8450 # use that with Solaris 11 and later, but keep
8451 # the old behavior for older Solaris versions.
8452 case "$gccversion" in
8454 *) case "$osvers" in
8455 2.?|2.10) dflt='-G' ;;
8456 *) dflt='-shared' ;;
8461 sunos) dflt='-assert nodefinitions' ;;
8462 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8466 *) dflt="$lddlflags" ;;
8469 : Only do this for gcc, since, for example, qcc has no concept
8471 if $test "X$sysroot" != X; then
8472 case "$gccversion" in
8474 *) dflt="$dflt --sysroot $sysroot" ;;
8478 : Try to guess additional flags to pick up local libraries.
8479 : Be careful not to append to a plain 'none'
8483 for thisflag in $ldflags; do
8488 *) dflt="$dflt $thisflag" ;;
8495 ''|' ') dflt='none' ;;
8499 *-fstack-protector-strong*)
8501 *-fstack-protector-strong*) ;; # Don't add it again
8502 *) dflt="$dflt -fstack-protector-strong" ;;
8505 *-fstack-protector*)
8507 *-fstack-protector*) ;; # Don't add it again
8508 *) dflt="$dflt -fstack-protector" ;;
8513 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8516 none) lddlflags=' ' ;;
8517 *) lddlflags="$ans" ;;
8522 Some systems may require passing special flags to $cc to indicate that
8523 the resulting executable will use dynamic linking. To use no flags,
8527 case "$ccdlflags" in
8528 '') case "$osname" in
8529 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8530 sunos) dflt='none' ;;
8534 *) dflt="$ccdlflags" ;;
8536 rp="Any special flags to pass to $cc to use dynamic linking?"
8539 none) ccdlflags=' ' ;;
8540 *) ccdlflags="$ans" ;;
8552 ld_can_script="$undef"
8553 case "$bin_ELF$usedl" in
8555 # Abuse try.h and a.out names for neat cleanup
8567 if $cc $cccdlflags $ccdlflags $ccflags \
8568 $ldflags $lddlflags -o a.out try.c \
8569 -Wl,--version-script=try.h >/dev/null 2>&1 \
8570 && $test -s a.out ; then
8571 echo "ld supports scripting" >&4
8572 ld_can_script="$define"
8574 echo "ld does not support scripting" >&4
8580 : Do we want a shared libperl?
8584 # No dynamic loading being used, so don't bother even to prompt.
8587 *) case "$useshrplib" in
8588 '') case "$osname" in
8589 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8591 also='Building a shared libperl is required for dynamic loading to work on your system.'
8605 The perl executable is normally obtained by linking perlmain.c with
8606 libperl${_a}, any static extensions (usually just DynaLoader), and
8607 any other libraries needed on this system (such as -lm, etc.). Since
8608 your system supports dynamic loading, it is probably possible to build
8609 a shared libperl.$so. If you will have more than one executable linked
8610 to libperl.$so, this will significantly reduce the size of each
8611 executable, but it may have a noticeable effect on performance. The
8612 default is probably sensible for your system.
8616 rp="Build a shared libperl.$so (y/n)"
8620 useshrplib='true' ;;
8621 *) useshrplib='false' ;;
8626 case "$useshrplib" in
8628 case "$userelocatableinc" in
8630 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8631 echo "See INSTALL for an explanation why that won't work." >&4
8637 # Figure out a good name for libperl.so. Since it gets stored in
8638 # a version-specific architecture-dependent library, the version
8639 # number isn't really that important, except for making cc/ld happy.
8641 # A name such as libperl.so.10.1
8642 majmin="libperl.$so.$patchlevel.$subversion"
8643 # A name such as libperl.so.100
8644 majonly=`echo $patchlevel $subversion |
8645 $awk '{printf "%d%02d", $1, $2}'`
8646 majonly=libperl.$so.$majonly
8647 # I'd prefer to keep the os-specific stuff here to a minimum, and
8648 # rely on figuring it out from the naming of libc.
8649 case "${osname}${osvers}" in
8650 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8653 cygwin*) # ld links now against the dll directly
8654 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8655 majonly=`echo $patchlevel $subversion |
8656 $awk '{printf "%03d%03d", $1, $2}'`
8657 majonly=cygperl5.$majonly.$so
8660 *) # Try to guess based on whether libc has major.minor.
8662 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8663 *libc.$so.[0-9]*) dflt=$majonly ;;
8664 *) dflt=libperl.$so ;;
8674 I need to select a good name for the shared libperl. If your system uses
8675 library names with major and minor numbers, then you might want something
8676 like $majmin. Alternatively, if your system uses a single version
8677 number for shared libraries, then you might want to use $majonly.
8678 Or, your system might be quite happy with a simple libperl.$so.
8680 Since the shared libperl will get installed into a version-specific
8681 architecture-dependent directory, the version number of the shared perl
8682 library probably isn't important, so the default should be o.k.
8685 rp='What name do you want to give to the shared libperl?'
8688 echo "Ok, I'll use $libperl"
8691 libperl="libperl${_a}"
8695 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8699 WARNING: Use of the shrpdir variable for the installation location of
8700 the shared $libperl is not supported. It was never documented and
8701 will not work in this version. Let me (perlbug@perl.org)
8702 know of any problems this may cause.
8708 But your current setting of $shrpdir is
8709 the default anyway, so it's harmless.
8714 Further, your current attempted setting of $shrpdir
8715 conflicts with the value of $archlibexp/CORE
8716 that installperl will use.
8723 # How will the perl executable find the installed shared $libperl?
8724 # Add $xxx to ccdlflags.
8725 # If we can't figure out a command-line option, use $shrpenv to
8726 # set env LD_RUN_PATH. The main perl makefile uses this.
8727 shrpdir=$archlibexp/CORE
8730 if "$useshrplib"; then
8733 # We'll set it in Makefile.SH...
8738 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8739 xxx="-Wl,-R$shrpdir"
8741 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8742 xxx="-Wl,-rpath,$shrpdir"
8745 # hpux doesn't like the default, either.
8746 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8749 # cygwin needs only ldlibpth
8752 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8758 # Only add $xxx if it isn't already in ccdlflags.
8759 case " $ccdlflags " in
8761 *) ccdlflags="$ccdlflags $xxx"
8764 Adding $xxx to the flags
8765 passed to $ld so that the perl executable will find the
8766 installed shared $libperl.
8774 # Fix ccdlflags in AIX for building external extensions.
8775 # (For building Perl itself bare -bE:perl.exp is needed,
8776 # Makefile.SH takes care of this.)
8778 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8780 # Respect a hint or command-line value.
8782 '') shrpenv="$tmp_shrpenv" ;;
8784 case "$ldlibpthname" in
8785 '') ldlibpthname=LD_LIBRARY_PATH ;;
8786 none) ldlibpthname='' ;;
8789 : determine where manual pages are on this system
8793 syspath='/usr/share/man/man1 /usr/man/man1'
8794 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8795 syspath="$syspath /usr/man/u_man/man1"
8796 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8797 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8798 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8799 sysman=`./loc . /usr/man/man1 $syspath`
8802 if $test -d "$sysman"; then
8803 echo "System manual is in $sysman." >&4
8805 echo "Could not find manual pages in source form." >&4
8808 : determine where manual pages go
8809 set man1dir man1dir none
8813 $spackage has manual pages available in source form.
8817 echo "However, you don't have nroff, so they're probably useless to you."
8819 '') man1dir="none";;
8822 echo "If you don't want the manual sources installed, answer 'none'."
8827 lookpath="$prefixexp/share/man/man1"
8828 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8829 lookpath="$lookpath $prefixexp/man/p_man/man1"
8830 lookpath="$lookpath $prefixexp/man/u_man/man1"
8831 lookpath="$lookpath $prefixexp/man/man.1"
8833 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8834 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8844 rp="Where do the main $spackage manual pages (source) go?"
8846 if $test "X$man1direxp" != "X$ansexp"; then
8857 : What suffix to use on installed man pages
8864 rp="What suffix should be used for the main $spackage man pages?"
8866 '') case "$man1dir" in
8880 *) dflt="$man1ext";;
8887 : see if we can have long filenames
8889 first=123456789abcdef
8891 if (echo hi >$first) 2>/dev/null; then
8892 if $test -f 123456789abcde; then
8893 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8896 echo 'You can have filenames longer than 14 characters.'>&4
8901 You can't have filenames longer than 14 chars.
8902 You can't even think about them!
8908 $rm -rf 123456789abcde*
8910 : determine where library module manual pages go
8911 set man3dir man3dir none
8915 $spackage has manual pages for many of the library modules.
8921 However, you don't have nroff, so they're probably useless to you.
8924 '') man3dir="none";;
8928 case "$d_flexfnam" in
8931 However, your system can't handle the long file names like File::Basename.3.
8934 '') man3dir="none";;
8938 echo "If you don't want the manual sources installed, answer 'none'."
8939 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8941 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8942 if $test -d "$privlib/man/man3"; then
8945 WARNING: Previous versions of perl installed man3 pages into
8946 $privlib/man/man3. This version will suggest a
8947 new default of $dflt.
8951 rp='Do you wish to preserve the old behavior?(y/n)'
8954 y*) dflt="$privlib/man/man3" ;;
8959 *) dflt="$man3dir" ;;
8966 rp="Where do the $package library man pages (source) go?"
8976 : What suffix to use on installed man pages
8982 rp="What suffix should be used for the $package library man pages?"
8984 '') case "$man3dir" in
8998 *) dflt="$man3ext";;
9005 : see if we have to deal with yellow pages, now NIS.
9006 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9012 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9020 rp='Are you getting the hosts file via yellow pages?'
9023 y*) hostcat='ypcat hosts';;
9024 *) hostcat='cat /etc/hosts';;
9030 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9033 '') test -f /etc/group && groupcat='cat /etc/group';;
9036 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9039 : now get the host name
9041 echo "Figuring out host name..." >&4
9042 case "$myhostname" in
9044 echo 'Maybe "hostname" will work...'
9045 if tans=`sh -c hostname 2>&1` ; then
9053 if $test "$cont"; then
9055 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9056 if tans=`cat /etc/systemid 2>&1` ; then
9058 phostname='cat /etc/systemid'
9059 echo "Whadyaknow. Xenix always was a bit strange..."
9062 elif $test -r /etc/systemid; then
9063 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9066 if $test "$cont"; then
9067 echo 'No, maybe "uuname -l" will work...'
9068 if tans=`sh -c 'uuname -l' 2>&1` ; then
9070 phostname='uuname -l'
9072 echo 'Strange. Maybe "uname -n" will work...'
9073 if tans=`sh -c 'uname -n' 2>&1` ; then
9075 phostname='uname -n'
9077 echo 'Oh well, maybe I can mine it out of whoami.h...'
9078 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9079 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9080 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9082 case "$myhostname" in
9083 '') echo "Does this machine have an identity crisis or something?"
9086 echo "Well, you said $myhostname before..."
9087 phostname='echo $myhostname';;
9093 case "$myhostname" in
9094 '') myhostname=noname ;;
9096 : you do not want to know about this
9101 if $test "$myhostname" ; then
9103 rp='Your host name appears to be "'$myhostname'".'" Right?"
9111 : bad guess or no guess
9112 while $test "X$myhostname" = X ; do
9114 rp="Please type the (one word) name of your host:"
9119 : translate upper to lower if necessary
9120 case "$myhostname" in
9122 echo "(Normalizing case in your host name)"
9123 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9127 case "$myhostname" in
9129 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9130 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9131 echo "(Trimming domain name from host name--host name is now $myhostname)"
9133 *) case "$mydomain" in
9136 test "X$hostcat" = "Xypcat hosts" &&
9137 ypmatch "$myhostname" hosts 2>/dev/null |\
9138 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9141 test "X$hostcat" != "X" &&
9142 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9143 /[ ]$myhostname[ . ]/p" > hosts
9146 if $test -f hosts; then
9147 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9148 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9149 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9150 hosts | $sort | $uniq | \
9151 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9152 case `$echo X$dflt` in
9153 X*\ *) echo "(Several hosts in the database matched hostname)"
9156 X.) echo "(You do not have fully-qualified names in the hosts database)"
9160 echo "(I cannot locate a hosts database anywhere)"
9165 tans=`./loc resolv.conf X /etc /usr/etc`
9166 if $test -f "$tans"; then
9167 echo "(Attempting domain name extraction from $tans)"
9168 dflt=.`$sed -n -e 's/ / /g' \
9169 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9172 .) dflt=.`$sed -n -e 's/ / /g' \
9173 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9181 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9182 dflt=.`sh -c domainname 2>/dev/null`
9185 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9189 case "$dflt$osname" in
9190 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9191 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9195 .) echo "(Lost all hope -- silly guess then)"
9201 *) dflt="$mydomain";;
9205 rp="What is your domain name?"
9215 : translate upper to lower if necessary
9218 echo "(Normalizing case in your domain name)"
9219 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9223 : a little sanity check here
9224 case "$phostname" in
9227 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9228 $myhostname$mydomain|$myhostname) ;;
9230 case "$phostname" in
9232 echo "(That doesn't agree with your whoami.h file, by the way.)"
9235 echo "(That doesn't agree with your $phostname command, by the way.)"
9243 : determine the e-mail address of the user who is running us
9246 I need to get your e-mail address in Internet format if possible, i.e.
9247 something like user@host.domain. Please answer accurately since I have
9248 no easy means to double check it. The default value provided below
9249 is most probably close to reality but may not be valid from outside
9250 your organization...
9254 while test "$cont"; do
9255 case "$MAILDOMAIN" in
9257 if $test -s /etc/mailname; then
9258 maildomain=`$cat /etc/mailname`
9260 maildomain="$myhostname$mydomain"
9263 *) maildomain="$MAILDOMAIN";;
9266 '') dflt="$cf_by@$maildomain";;
9267 *) dflt="$cf_email";;
9269 rp='What is your e-mail address?'
9275 rp='Address does not look like an Internet one. Use it anyway?'
9289 : Ask e-mail of administrator
9292 If you or somebody else will be maintaining perl at your site, please
9293 fill in the correct e-mail address here so that they may be contacted
9294 if necessary. Currently, the "perlbug" program included with perl
9295 will send mail to this address in addition to perlbug@perl.org. You may
9296 enter "none" for no administrator.
9299 case "$perladmin" in
9300 '') dflt="$cf_email";;
9301 *) dflt="$perladmin";;
9303 rp='Perl administrator e-mail address'
9307 : determine whether to only install version-specific parts.
9310 Do you want to install only the version-specific parts of the perl
9311 distribution? Usually you do *not* want to do this.
9313 case "$versiononly" in
9314 "$define"|[Yy]*|true) dflt='y' ;;
9317 rp="Do you want to install only the version-specific parts of perl?"
9320 [yY]*) val="$define";;
9326 case "$versiononly" in
9327 "$define") inc_version_list=''
9328 inc_version_list_init=0
9332 : figure out how to guarantee perl startup
9333 : XXX Note that this currently takes advantage of the bug that binexp ignores
9334 : the Configure -Dinstallprefix setting, which in turn means that under
9335 : relocatable @INC, initialinstalllocation is what binexp started as.
9336 case "$startperl" in
9338 case "$sharpbang" in
9342 I can use the #! construct to start perl on your system. This will
9343 make startup of perl scripts faster, but may cause problems if you
9344 want to share those scripts and perl is not in a standard place
9345 ($initialinstalllocation/perl) on all your platforms. The alternative
9346 is to force a shell by starting the script with a single ':' character.
9349 case "$versiononly" in
9350 "$define") dflt="$initialinstalllocation/perl$version";;
9351 *) dflt="$initialinstalllocation/perl";;
9353 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9356 none) startperl=": # use perl";;
9357 *) startperl="#!$ans"
9358 if $test 30 -lt `echo "$ans" | wc -c`; then
9361 WARNING: Some systems limit the #! command to 32 characters.
9362 If you experience difficulty running Perl scripts with #!, try
9363 installing Perl in a directory with a shorter pathname.
9369 *) startperl=": # use perl"
9374 echo "I'll use $startperl to start perl scripts."
9376 : figure best path for perl in scripts
9379 case "$versiononly" in
9380 "$define") perlpath="$initialinstalllocation/perl$version";;
9381 *) perlpath="$initialinstalllocation/perl";;
9383 case "$startperl" in
9388 I will use the "eval 'exec'" idiom to start Perl on your system.
9389 I can use the full path of your Perl binary for this purpose, but
9390 doing so may cause problems if you want to share those scripts and
9391 Perl is not always in a standard place ($initialinstalllocation/perl).
9394 dflt="$initialinstalllocation/perl"
9395 rp="What path shall I use in \"eval 'exec'\"?"
9402 case "$startperl" in
9404 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9407 : determine where public executable scripts go
9408 set scriptdir scriptdir
9410 case "$scriptdir" in
9413 : guess some guesses
9414 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9415 $test -d /usr/share/bin && dflt=/usr/share/bin
9416 $test -d /usr/local/script && dflt=/usr/local/script
9417 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9418 $test -d $prefixexp/script && dflt=$prefixexp/script
9422 *) dflt="$scriptdir"
9427 Some installations have a separate directory just for executable scripts so
9428 that they can mount it across multiple architectures but keep the scripts in
9429 one spot. You might, for example, have a subdirectory of /usr/share for this.
9430 Or you might just lump your scripts in with all your other executables.
9434 rp='Where do you keep publicly executable scripts?'
9436 if $test "X$ansexp" != "X$scriptdirexp"; then
9442 : A little fix up for an irregularly named variable.
9443 installscript="$installscriptdir"
9445 : determine where add-on public executables go
9447 '') dflt=$siteprefix/bin ;;
9451 rp='Pathname where the add-on public executables should be installed?'
9456 : determine where add-on html pages go
9457 : There is no standard location, so try to copy the previously-selected
9458 : directory structure for the core html pages.
9459 case "$sitehtml1dir" in
9460 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9461 *) dflt=$sitehtml1dir ;;
9464 ''|' ') dflt=none ;;
9467 rp='Pathname where the site-specific html pages should be installed?'
9469 prefixvar=sitehtml1dir
9472 : determine where add-on library html pages go
9473 : There is no standard location, so try to copy the previously-selected
9474 : directory structure for the core html pages.
9475 case "$sitehtml3dir" in
9476 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9477 *) dflt=$sitehtml3dir ;;
9480 ''|' ') dflt=none ;;
9483 rp='Pathname where the site-specific library html pages should be installed?'
9485 prefixvar=sitehtml3dir
9488 : determine where add-on manual pages go
9489 case "$siteman1dir" in
9490 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9491 *) dflt=$siteman1dir ;;
9494 ''|' ') dflt=none ;;
9497 rp='Pathname where the site-specific manual pages should be installed?'
9499 prefixvar=siteman1dir
9502 : determine where add-on library man pages go
9503 case "$siteman3dir" in
9504 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9505 *) dflt=$siteman3dir ;;
9508 ''|' ') dflt=none ;;
9511 rp='Pathname where the site-specific library manual pages should be installed?'
9513 prefixvar=siteman3dir
9516 : determine where add-on public executable scripts go
9517 case "$sitescript" in
9518 '') dflt=$siteprefix/script
9519 $test -d $dflt || dflt=$sitebin ;;
9520 *) dflt="$sitescript" ;;
9523 rp='Pathname where add-on public executable scripts should be installed?'
9525 prefixvar=sitescript
9528 : see if backtrace exists
9529 set backtrace d_backtrace
9532 : add flags if using c backtrace
9533 case "$usecbacktrace" in
9534 "") usecbacktrace=$undef ;;
9536 case "$d_backtrace" in
9538 case " $ccflags " in
9539 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9540 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9544 echo "This system does not support backtrace" >&4
9545 usecbacktrace=$undef
9551 : Check if faststdio is requested and available
9552 case "$usefaststdio" in
9553 $define|true|[yY]*|'')
9554 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9564 Perl can be built to use 'fast stdio', which means using the stdio
9565 library but also directly manipulating the stdio buffers to enable
9566 faster I/O. Using stdio is better for backward compatibility (especially
9567 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9568 interface has been preferred instead of stdio.
9570 If this doesn't make any sense to you, just accept the default '$dflt'.
9572 rp='Use the "fast stdio" if available?'
9575 y|Y) val="$define" ;;
9582 : define an is-a-typedef? function
9583 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9585 "") inclist="sys/types.h";;
9587 eval "varval=\$$var";
9591 for inc in $inclist; do
9592 echo "#include <$inc>" >>temp.c;
9594 echo "#ifdef $type" >> temp.c;
9595 echo "printf(\"We have $type\");" >> temp.c;
9596 echo "#endif" >> temp.c;
9597 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9598 if $contains $type temp.E >/dev/null 2>&1; then
9604 *) eval "$var=\$varval";;
9607 : define an is-a-typedef? function that prompts if the type is not available.
9608 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9610 "") inclist="sys/types.h";;
9612 eval "varval=\$$var";
9616 for inc in $inclist; do
9617 echo "#include <$inc>" >>temp.c;
9619 echo "#ifdef $type" >> temp.c;
9620 echo "printf(\"We have $type\");" >> temp.c;
9621 echo "#endif" >> temp.c;
9622 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9624 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9625 if $contains $type temp.E >/dev/null 2>&1; then
9626 echo "$type found." >&4;
9629 echo "$type NOT found." >&4;
9635 *) eval "$var=\$varval";;
9638 : see what type lseek is declared as in the kernel
9639 rp="What is the type used for lseek's offset on this system?"
9640 set off_t lseektype long stdio.h sys/types.h
9644 echo "Checking to see how big your file offsets are..." >&4
9646 #include <sys/types.h>
9650 printf("%d\n", (int)sizeof($lseektype));
9655 if eval $compile_ok; then
9656 lseeksize=`$run ./try`
9657 echo "Your file offsets are $lseeksize bytes long."
9661 echo "(I can't seem to compile the test program. Guessing...)"
9662 rp="What is the size of your file offsets (in bytes)?"
9668 : see what type file positions are declared as in the library
9669 rp="What is the type for file position used by fsetpos()?"
9670 set fpos_t fpostype long stdio.h sys/types.h
9673 : Check size for Fpos_t
9676 *_t) zzz="$fpostype" ;;
9679 echo "Checking the size of $zzz..." >&4
9681 #include <sys/types.h>
9688 printf("%d\n", (int)sizeof($fpostype));
9693 if eval $compile_ok; then
9697 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9700 echo "Your $zzz is $fpossize bytes long."
9706 echo "(I can't compile the test program. Guessing...)" >&4
9707 rp="What is the size of your file positions (in bytes)?"
9712 : Check for large file support
9713 # Backward compatibility (uselfs is deprecated).
9715 "$define"|true|[yY]*)
9718 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9720 uselargefiles="$define"
9724 case "$lseeksize:$fpossize" in
9727 You can have files larger than 2 gigabytes.
9730 *) case "$uselargefiles" in
9731 "$undef"|false|[nN]*) dflt='n' ;;
9736 Perl can be built to understand large files (files larger than 2 gigabytes)
9737 on some systems. To do so, Configure can be run with -Duselargefiles.
9739 If this doesn't make any sense to you, just accept the default '$dflt'.
9741 rp='Try to understand large files, if available?'
9744 y|Y) val="$define" ;;
9751 : Look for a hint-file generated 'call-back-unit'. If the
9752 : user has specified that a large files perl is to be built,
9753 : we may need to set or change some other defaults.
9754 if $test -f uselargefiles.cbu; then
9755 echo "Your platform has some specific hints regarding large file builds, using them..."
9756 . ./uselargefiles.cbu
9758 case "$uselargefiles" in
9760 if $test -f uselargefiles.cbu; then
9762 echo "Rechecking to see how big your file offsets are..." >&4
9764 #include <sys/types.h>
9768 printf("%d\n", (int)sizeof($lseektype));
9773 if eval $compile_ok; then
9774 lseeksize=`$run ./try`
9775 $echo "Your file offsets are now $lseeksize bytes long."
9779 echo "(I can't seem to compile the test program. Guessing...)"
9780 rp="What is the size of your file offsets (in bytes)?"
9785 *_t) zzz="$fpostype" ;;
9788 $echo $n "Rechecking the size of $zzz...$c" >&4
9790 #include <sys/types.h>
9797 printf("%d\n", (int)sizeof($fpostype));
9802 if eval $compile_ok; then
9807 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9810 echo " $fpossize bytes." >&4
9816 echo "(I can't compile the test program. Guessing...)" >&4
9817 rp="What is the size of your file positions (in bytes)?"
9826 : Check if we want perlio
9829 : Set the vendorbin variables
9830 case "$vendorprefix" in
9831 '') d_vendorbin="$undef"
9835 *) d_vendorbin="$define"
9836 : determine where vendor-supplied executables go.
9837 case "$vendorbin" in
9838 '') dflt=$vendorprefix/bin ;;
9839 *) dflt="$vendorbin" ;;
9842 rp='Pathname for the vendor-supplied executables directory?'
9845 vendorbinexp="$ansexp"
9851 : Set the vendorhtml1dir variables
9852 case "$vendorprefix" in
9853 '') vendorhtml1dir=''
9854 vendorhtml1direxp=''
9856 *) : determine where vendor-supplied html pages go.
9857 : There is no standard location, so try to copy the previously-selected
9858 : directory structure for the core html pages.
9859 : XXX Better default suggestions would be welcome.
9860 case "$vendorhtml1dir" in
9861 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9862 *) dflt=$vendorhtml1dir ;;
9865 ''|' ') dflt=none ;;
9868 rp='Pathname for the vendor-supplied html pages?'
9870 vendorhtml1dir="$ans"
9871 vendorhtml1direxp="$ansexp"
9874 : Use ' ' for none so value is preserved next time through Configure
9875 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9876 prefixvar=vendorhtml1dir
9879 : Set the vendorhtml3dir variables
9880 case "$vendorprefix" in
9881 '') vendorhtml3dir=''
9882 vendorhtml3direxp=''
9884 *) : determine where vendor-supplied module html pages go.
9885 : There is no standard location, so try to copy the previously-selected
9886 : directory structure for the core html pages.
9887 : XXX Better default suggestions would be welcome.
9888 case "$vendorhtml3dir" in
9889 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9890 *) dflt=$vendorhtml3dir ;;
9893 ''|' ') dflt=none ;;
9896 rp='Pathname for the vendor-supplied html pages?'
9898 vendorhtml3dir="$ans"
9899 vendorhtml3direxp="$ansexp"
9902 : Use ' ' for none so value is preserved next time through Configure
9903 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9904 prefixvar=vendorhtml3dir
9907 : Set the vendorman1dir variables
9908 case "$vendorprefix" in
9909 '') vendorman1dir=''
9912 *) : determine where vendor-supplied manual pages go.
9913 case "$vendorman1dir" in
9914 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9915 *) dflt=$vendorman1dir ;;
9918 ''|' ') dflt=none ;;
9921 rp='Pathname for the vendor-supplied manual section 1 pages?'
9923 vendorman1dir="$ans"
9924 vendorman1direxp="$ansexp"
9927 : Use ' ' for none so value is preserved next time through Configure
9928 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9929 prefixvar=vendorman1dir
9932 : Set the vendorman3dir variables
9933 case "$vendorprefix" in
9934 '') vendorman3dir=''
9937 *) : determine where vendor-supplied module manual pages go.
9938 case "$vendorman3dir" in
9939 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9940 *) dflt=$vendorman3dir ;;
9943 ''|' ') dflt=none ;;
9946 rp='Pathname for the vendor-supplied manual section 3 pages?'
9948 vendorman3dir="$ans"
9949 vendorman3direxp="$ansexp"
9952 : Use ' ' for none so value is preserved next time through Configure
9953 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9954 prefixvar=vendorman3dir
9957 : Set the vendorscript variables
9958 case "$vendorprefix" in
9959 '') d_vendorscript="$undef"
9963 *) d_vendorscript="$define"
9964 : determine where vendor-supplied scripts go.
9965 case "$vendorscript" in
9966 '') dflt=$vendorprefix/script
9967 $test -d $dflt || dflt=$vendorbin ;;
9968 *) dflt="$vendorscript" ;;
9972 The installation process will create a directory for
9973 vendor-supplied scripts.
9977 rp='Pathname for the vendor-supplied scripts directory?'
9980 vendorscriptexp="$ansexp"
9983 prefixvar=vendorscript
9986 : script used to emit important warnings
9989 if test \$# -gt 0; then
9994 echo "*** WARNING:" >&4
9995 sed -e 's/^/*** /' <msg >&4
9997 cat msg >>config.msg
9998 echo " " >>config.msg
10004 : see which of string.h or strings.h is needed
10006 strings=`./findhdr string.h`
10007 if $test "$strings" && $test -r "$strings"; then
10008 echo "Using <string.h> instead of <strings.h>." >&4
10012 strings=`./findhdr strings.h`
10013 if $test "$strings" && $test -r "$strings"; then
10014 echo "Using <strings.h> instead of <string.h>." >&4
10016 ./warn "No string header found -- You'll surely have problems."
10021 case "$i_string" in
10022 "$undef") strings=`./findhdr strings.h`;;
10023 *) strings=`./findhdr string.h`;;
10026 : see if qgcvt exists
10030 : Check what kind of doubles your system has
10031 $echo "Checking the kind of doubles you have..." >&4
10033 #$i_stdlib I_STDLIB
10034 #define DOUBLESIZE $doublesize
10036 #include <stdlib.h>
10039 static const double d = -0.1;
10041 unsigned const char* b = (unsigned const char*)(&d);
10042 #if DOUBLESIZE == 4
10043 if (b[0] == 0xCD && b[3] == 0xBD) {
10044 /* IEEE 754 32-bit little-endian */
10048 if (b[0] == 0xBD && b[3] == 0xCD) {
10049 /* IEEE 754 32-bit big-endian */
10054 #if DOUBLESIZE == 8
10055 if (b[0] == 0x9A && b[7] == 0xBF) {
10056 /* IEEE 754 64-bit little-endian */
10060 if (b[0] == 0xBF && b[7] == 0x9A) {
10061 /* IEEE 754 64-bit big-endian */
10065 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10066 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10067 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10068 * 99 99 b9 bf 9a 99 99 99 */
10072 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10073 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10074 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10075 * 99 99 99 9a bf b9 99 99 */
10080 #if DOUBLESIZE == 16
10081 if (b[0] == 0x9A && b[15] == 0xBF) {
10082 /* IEEE 754 128-bit little-endian */
10086 if (b[0] == 0xBF && b[15] == 0x9A) {
10087 /* IEEE 754 128-bit big-endian */
10092 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10093 * Whether those environments can still build Perl is debatable. */
10094 printf("-1\n"); /* unknown */
10099 if eval $compile; then
10100 doublekind=`$run ./try`
10104 case "$doublekind" in
10105 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10106 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10107 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10108 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10109 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10110 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10111 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10112 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10113 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10117 : Check print/scan long double stuff
10120 if $test X"$d_longdbl" = X"$define"; then
10122 echo "Checking how to print long doubles..." >&4
10124 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10125 $cat >try.c <<'EOCP'
10126 #include <sys/types.h>
10129 double d = 123.456;
10130 printf("%.3f\n", d);
10134 if eval $compile; then
10138 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10139 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10140 echo "We will use %f."
10146 if $test X"$sPRIfldbl" = X; then
10147 $cat >try.c <<'EOCP'
10148 #include <sys/types.h>
10151 long double d = 123.456;
10152 printf("%.3Lf\n", d);
10156 if eval $compile; then
10160 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10161 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10162 echo "We will use %Lf."
10168 if $test X"$sPRIfldbl" = X; then
10169 $cat >try.c <<'EOCP'
10170 #include <sys/types.h>
10173 long double d = 123.456;
10174 printf("%.3llf\n", d);
10178 if eval $compile; then
10182 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10183 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10184 echo "We will use %llf."
10190 if $test X"$sPRIfldbl" = X; then
10191 $cat >try.c <<'EOCP'
10192 #include <sys/types.h>
10195 long double d = 123.456;
10196 printf("%.3lf\n", d);
10200 if eval $compile; then
10204 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10205 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10206 echo "We will use %lf."
10212 if $test X"$sPRIfldbl" = X; then
10213 echo "Cannot figure out how to print long doubles." >&4
10215 sSCNfldbl=$sPRIfldbl # expect consistency
10222 case "$sPRIfldbl" in
10223 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10224 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10225 d_SCNfldbl="$undef";
10227 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10228 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10229 d_SCNfldbl="$define";
10233 : Before committing on uselongdouble, see whether that looks sane.
10234 if $test "$uselongdouble" = "$define"; then
10237 echo "Checking if your long double math functions work right..." >&4
10242 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10245 case "$osname:$gccversion" in
10246 aix:) saveccflags="$ccflags"
10247 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10250 if eval $compile_ok; then
10254 3) echo "Your long double math functions are working correctly." >&4 ;;
10255 *) echo "Your long double math functions are broken, not using long doubles." >&4
10256 uselongdouble=$undef
10260 case "$osname:$gccversion" in
10261 aix:) ccflags="$saveccflags" ;; # restore
10265 : Check how to convert floats to strings.
10267 if test "X$d_Gconvert" = X; then
10270 echo "Checking for an efficient way to convert floats to strings."
10272 case "$uselongdouble" in
10273 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10275 case "$d_longdbl" in
10276 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10278 case "$d_PRIgldbl" in
10279 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10282 #ifdef TRY_gconvert
10283 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10284 char *myname = "gconvert";
10287 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10288 char *myname = "gcvt";
10291 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10292 char *myname = "qgcvt";
10293 #define DOUBLETYPE long double
10296 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10297 #ifdef HAS_PRIgldbl
10298 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10300 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10303 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10305 char *myname = "sprintf";
10309 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10310 #define DOUBLETYPE long double
10312 #define DOUBLETYPE double
10318 #$i_stdlib I_STDLIB
10320 #include <stdlib.h>
10322 #$i_string I_STRING
10324 # include <string.h>
10326 # include <strings.h>
10329 int checkit(char *expect, char *got)
10331 if (strcmp(expect, got)) {
10332 printf("%s oddity: Expected %s, got %s\n",
10333 myname, expect, got);
10343 /* This must be 1st test on (which?) platform */
10344 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10345 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10346 checkit("0.1", buf);
10348 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10349 checkit("0.01", buf);
10351 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10352 checkit("0.001", buf);
10354 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10355 checkit("0.0001", buf);
10357 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10358 if (strlen(buf) > 5)
10359 checkit("9e-005", buf); /* for Microsoft ?? */
10361 checkit("9e-05", buf);
10363 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10366 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10367 checkit("1.1", buf);
10369 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10370 checkit("1.01", buf);
10372 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10373 checkit("1.001", buf);
10375 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10376 checkit("1.0001", buf);
10378 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10379 checkit("1.00001", buf);
10381 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10382 checkit("1.000001", buf);
10384 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10387 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10388 checkit("-1", buf);
10390 /* Some Linux gcvt's give 1.e+5 here. */
10391 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10392 checkit("100000", buf);
10394 /* Some Linux gcvt's give -1.e+5 here. */
10395 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10396 checkit("-100000", buf);
10398 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10399 checkit("123.456", buf);
10401 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10402 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10403 /* 34 should be enough to scare even long double
10404 * places into using the e notation. */
10405 if (strlen(buf) > 5)
10406 checkit("1e+034", buf); /* for Microsoft */
10408 checkit("1e+34", buf);
10410 /* For Perl, if you add additional tests here, also add them to
10411 * t/base/num.t for benefit of platforms not using Configure or
10412 * overriding d_Gconvert */
10417 : first add preferred functions to our list
10419 for xxx_convert in $gconvert_preference; do
10420 case $xxx_convert in
10421 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10422 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10425 : then add any others
10426 for xxx_convert in gconvert gcvt sprintf; do
10427 case "$xxx_list" in
10429 *) xxx_list="$xxx_list $xxx_convert" ;;
10433 case "$d_longdbl$uselongdouble" in
10435 : again, add preferred functions to our list first
10437 for xxx_convert in $gconvert_ld_preference; do
10438 case $xxx_convert in
10439 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10440 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10443 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10444 for xxx_convert in qgcvt sprintf $xxx_list; do
10445 case "$xxx_ld_list" in
10446 $xxx_convert*|*" $xxx_convert"*) ;;
10447 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10450 : if sprintf cannot do long doubles, move it to the end
10451 if test "$d_PRIgldbl" != "$define"; then
10452 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10454 : if no qgcvt, remove it
10455 if test "$d_qgcvt" != "$define"; then
10456 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10459 xxx_list="$xxx_ld_list"
10463 for xxx_convert in $xxx_list; do
10464 echo "Trying $xxx_convert..."
10465 $rm -f try try$_o core
10466 set try -DTRY_$xxx_convert
10467 if eval $compile; then
10468 echo "$xxx_convert() found." >&4
10469 if $run ./try; then
10470 echo "I'll use $xxx_convert to convert floats into a string." >&4
10473 echo "...But $xxx_convert didn't work as I expected."
10477 echo "$xxx_convert NOT found." >&4
10481 if test X$xxx_convert = X; then
10482 echo "*** WHOA THERE!!! ***" >&4
10483 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10484 xxx_convert=sprintf
10487 case "$xxx_convert" in
10488 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10489 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10490 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10491 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10492 "$define$define$define")
10493 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10494 "$define$define$undef")
10495 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10496 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10504 : see if _fwalk exists
10508 : Initialize h_fcntl
10511 : Initialize h_sysfile
10514 : access call always available on UNIX
10515 set access d_access
10518 : locate the flags for 'access()'
10519 case "$d_access" in
10522 $cat >access.c <<EOCP
10523 #include <sys/types.h>
10528 #include <sys/file.h>
10531 #include <unistd.h>
10533 #$i_stdlib I_STDLIB
10535 #include <stdlib.h>
10541 : check sys/file.h first, no particular reason here
10542 if $test `./findhdr sys/file.h` && \
10543 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10545 echo "<sys/file.h> defines the *_OK access constants." >&4
10546 elif $test `./findhdr fcntl.h` && \
10547 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10549 echo "<fcntl.h> defines the *_OK access constants." >&4
10550 elif $test `./findhdr unistd.h` && \
10551 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10552 echo "<unistd.h> defines the *_OK access constants." >&4
10554 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10560 : see if accessx exists
10561 set accessx d_accessx
10564 : see if acosh exists
10568 : see if aintl exists
10572 : see if alarm exists
10576 : see if 64bit time functions exists
10578 set ctime64 d_ctime64
10581 set localtime64 d_localtime64
10584 set gmtime64 d_gmtime64
10587 set mktime64 d_mktime64
10590 set difftime64 d_difftime64
10593 set asctime64 d_asctime64
10596 : see if POSIX threads are available
10597 set pthread.h i_pthread
10600 : define a function to check prototypes
10601 $cat > protochk <<EOSH
10604 optimize="$optimize"
10606 prototype="$prototype"
10609 usethreads=$usethreads
10610 i_pthread=$i_pthread
10611 pthread_h_first=$pthread_h_first
10614 $cat >> protochk <<'EOSH'
10619 while test $# -ge 2; do
10621 $define) echo "#include <$2>" >> try.c ;;
10622 literal) echo "$2" >> try.c ;;
10624 # Extra magic for the benefit of systems that need pthread.h
10625 # to be included early to correctly detect threadsafe functions.
10626 # Such functions must guarantee themselves, though, that the usethreads
10627 # and i_pthread have been defined, before calling protochk.
10628 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10629 echo "#include <pthread.h>" >> try.c
10634 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10635 cat >> try.c <<'EOCP'
10636 #ifdef CAN_PROTOTYPE
10637 #define _(args) args
10642 echo "$foo" >> try.c
10643 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10644 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10650 $eunicefix protochk
10652 : Define hasproto macro for Configure internal use
10653 hasproto='varname=$1; func=$2; shift; shift;
10654 while $test $# -ge 2; do
10656 $define) echo "#include <$2>";;
10660 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10661 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10662 echo "$func() prototype found.";
10665 echo "$func() prototype NOT found.";
10672 : see if sys/types.h has to be included
10673 set sys/types.h i_systypes
10676 : see if sys/select.h has to be included
10677 set sys/select.h i_sysselct
10680 : Define hasfield macro for Configure internal use
10681 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10682 while $test $# -ge 2; do
10684 $define) echo "#include <$2>";;
10688 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10690 if eval $compile; then
10699 : see if we should include time.h, sys/time.h, or both
10701 if test "X$timeincl" = X; then
10702 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10703 $echo $n "I'm now running the test program...$c"
10705 #include <sys/types.h>
10710 #ifdef SYSTIMEKERNEL
10713 #include <sys/time.h>
10716 #include <sys/select.h>
10718 #$i_stdlib I_STDLIB
10720 #include <stdlib.h>
10726 struct timeval bar;
10729 struct timezone tzp;
10731 if (foo.tm_sec == foo.tm_sec)
10734 if (bar.tv_sec == bar.tv_sec)
10741 for s_timezone in '-DS_TIMEZONE' ''; do
10743 for s_timeval in '-DS_TIMEVAL' ''; do
10744 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10745 for i_time in '' '-DI_TIME'; do
10746 for i_systime in '-DI_SYSTIME' ''; do
10749 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10750 if eval $compile; then
10751 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10755 $echo $n "Succeeded with $flags$c"
10767 *SYSTIMEKERNEL*) i_systimek="$define"
10768 timeincl=`./findhdr sys/time.h`
10769 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10770 *) i_systimek="$undef";;
10773 *I_TIME*) i_time="$define"
10774 timeincl=`./findhdr time.h`" $timeincl"
10775 echo "We'll include <time.h>." >&4;;
10776 *) i_time="$undef";;
10779 *I_SYSTIME*) i_systime="$define"
10780 timeincl=`./findhdr sys/time.h`" $timeincl"
10781 echo "We'll include <sys/time.h>." >&4;;
10782 *) i_systime="$undef";;
10786 : see if struct tm knows about tm_zone
10787 case "$i_systime$i_time" in
10790 echo "Checking to see if your struct tm has tm_zone field..." >&4
10791 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10799 case "$d_tm_tm_zone" in
10800 "$define") echo "Yes, it does." ;;
10801 *) echo "No, it doesn't." ;;
10803 : see if struct tm knows about tm_gmtoff
10804 case "$i_systime$i_time" in
10807 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10808 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10816 case "$d_tm_tm_gmtoff" in
10817 "$define") echo "Yes, it does." ;;
10818 *) echo "No, it doesn't." ;;
10821 : see if asctime_r exists
10822 set asctime_r d_asctime_r
10824 case "$d_asctime_r" in
10826 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10827 case "$d_asctime_r_proto:$usethreads" in
10828 ":define") d_asctime_r_proto=define
10829 set d_asctime_r_proto asctime_r $hdrs
10833 case "$d_asctime_r_proto" in
10835 case "$asctime_r_proto" in
10836 ''|0) try='char* asctime_r(const struct tm*, char*);'
10837 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10839 case "$asctime_r_proto" in
10840 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10841 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10843 case "$asctime_r_proto" in
10844 ''|0) try='int asctime_r(const struct tm*, char*);'
10845 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10847 case "$asctime_r_proto" in
10848 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10849 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10851 case "$asctime_r_proto" in
10852 ''|0) d_asctime_r=undef
10854 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10855 * ) case "$asctime_r_proto" in
10856 REENTRANT_PROTO*) ;;
10857 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10859 echo "Prototype: $try" ;;
10862 *) case "$usethreads" in
10863 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10870 *) asctime_r_proto=0
10874 : see if asinh exists
10878 : see if atanh exists
10882 : see if atolf exists
10886 : see if atoll exists
10890 : Look for GCC-style attribute format
10891 case "$d_attribute_format" in
10894 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10895 $cat >attrib.c <<'EOCP'
10897 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10899 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10900 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10901 echo "Your C compiler doesn't support __attribute__((format))."
10904 echo "Your C compiler supports __attribute__((format))."
10908 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10912 *) val="$d_attribute_format" ;;
10914 set d_attribute_format
10918 : Look for GCC-style attribute format with null format allowed
10919 case "$d_printf_format_null" in
10920 '') case "$d_attribute_format" in
10923 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10924 $cat >attrib.c <<EOCP
10926 #$i_stdlib I_STDLIB
10928 #include <stdlib.h>
10930 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10931 int null_printf (char* pat,...) { return (int)pat; }
10932 int main () { exit(null_printf(NULL)); }
10934 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10935 : run the executable in case it produces a run-time warning
10936 if $run ./attrib >>attrib.out 2>&1; then
10937 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10938 echo "Your C compiler doesn't allow __printf__ format to be null."
10941 echo "Your C compiler allows __printf__ format to be null."
10945 echo "Your C compiler executable failed with __printf__ format null."
10949 echo "Your C compiler fails with __printf__ format null."
10956 *) val="$d_printf_format_null" ;;
10958 set d_printf_format_null
10962 : Look for GCC-style attribute malloc
10963 case "$d_attribute_malloc" in
10966 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10967 $cat >attrib.c <<'EOCP'
10969 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10971 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10972 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10973 echo "Your C compiler doesn't support __attribute__((malloc))."
10976 echo "Your C compiler supports __attribute__((malloc))."
10980 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10984 *) val="$d_attribute_malloc" ;;
10986 set d_attribute_malloc
10990 : Look for GCC-style attribute nonnull
10991 case "$d_attribute_nonnull" in
10994 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10995 $cat >attrib.c <<'EOCP'
10997 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10999 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11000 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11001 echo "Your C compiler doesn't support __attribute__((nonnull))."
11004 echo "Your C compiler supports __attribute__((nonnull))."
11008 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11012 *) val="$d_attribute_nonnull" ;;
11014 set d_attribute_nonnull
11018 : Look for GCC-style attribute noreturn
11019 case "$d_attribute_noreturn" in
11022 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11023 $cat >attrib.c <<'EOCP'
11025 void fall_over_dead( void ) __attribute__((noreturn));
11027 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11028 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11029 echo "Your C compiler doesn't support __attribute__((noreturn))."
11032 echo "Your C compiler supports __attribute__((noreturn))."
11036 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11040 *) val="$d_attribute_noreturn" ;;
11042 set d_attribute_noreturn
11046 : Look for GCC-style attribute pure
11047 case "$d_attribute_pure" in
11050 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11051 $cat >attrib.c <<'EOCP'
11053 int square( int n ) __attribute__((pure));
11055 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11056 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11057 echo "Your C compiler doesn't support __attribute__((pure))."
11060 echo "Your C compiler supports __attribute__((pure))."
11064 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11068 *) val="$d_attribute_pure" ;;
11070 set d_attribute_pure
11074 : Look for GCC-style attribute unused
11075 case "$d_attribute_unused" in
11078 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11079 $cat >attrib.c <<'EOCP'
11081 int do_something( int dummy __attribute__((unused)), int n );
11083 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11084 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11085 echo "Your C compiler doesn't support __attribute__((unused))."
11088 echo "Your C compiler supports __attribute__((unused))."
11092 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11096 *) val="$d_attribute_unused" ;;
11098 set d_attribute_unused
11102 : Look for GCC-style attribute deprecated
11103 case "$d_attribute_deprecated" in
11106 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11107 $cat >attrib.c <<'EOCP'
11109 int I_am_deprecated(void) __attribute__((deprecated));
11111 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11112 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11113 echo "Your C compiler doesn't support __attribute__((deprecated))."
11116 echo "Your C compiler supports __attribute__((deprecated))."
11120 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11124 *) val="$d_attribute_deprecated" ;;
11126 set d_attribute_deprecated
11130 : Look for GCC-style attribute warn_unused_result
11131 case "$d_attribute_warn_unused_result" in
11134 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11135 $cat >attrib.c <<'EOCP'
11137 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11139 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11140 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11141 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11144 echo "Your C compiler supports __attribute__((warn_unused_result))."
11148 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11152 *) val="$d_attribute_warn_unused_result" ;;
11154 set d_attribute_warn_unused_result
11158 : see if bcmp exists
11162 : see if bcopy exists
11166 : see if getpgrp exists
11167 set getpgrp d_getpgrp
11170 case "$d_getpgrp" in
11173 echo "Checking to see which flavor of getpgrp is in use..."
11175 #$i_unistd I_UNISTD
11176 #include <sys/types.h>
11178 # include <unistd.h>
11180 #$i_stdlib I_STDLIB
11182 #include <stdlib.h>
11186 if (getuid() == 0) {
11187 printf("(I see you are running Configure as super-user...)\n");
11190 #ifdef TRY_BSD_PGRP
11191 if (getpgrp(1) == 0)
11200 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11201 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11203 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11204 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11207 echo "I can't seem to compile and run the test program."
11209 xxx="a USG one, i.e. you use getpgrp()."
11211 # SVR4 systems can appear rather BSD-ish.
11212 case "$i_unistd" in
11214 xxx="a BSD one, i.e. you use getpgrp(pid)."
11218 xxx="probably a USG one, i.e. you use getpgrp()."
11223 echo "Assuming your getpgrp is $xxx" >&4
11232 : see if setpgrp exists
11233 set setpgrp d_setpgrp
11236 case "$d_setpgrp" in
11239 echo "Checking to see which flavor of setpgrp is in use..."
11241 #$i_unistd I_UNISTD
11242 #include <sys/types.h>
11244 # include <unistd.h>
11246 #$i_stdlib I_STDLIB
11248 #include <stdlib.h>
11252 if (getuid() == 0) {
11253 printf("(I see you are running Configure as super-user...)\n");
11256 #ifdef TRY_BSD_PGRP
11257 if (-1 == setpgrp(1, 1))
11260 if (setpgrp() != -1)
11266 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11267 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11269 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11270 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11273 echo "(I can't seem to compile and run the test program.)"
11275 xxx="a USG one, i.e. you use setpgrp()."
11277 # SVR4 systems can appear rather BSD-ish.
11278 case "$i_unistd" in
11280 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11284 xxx="probably a USG one, i.e. you use setpgrp()."
11289 echo "Assuming your setpgrp is $xxx" >&4
11298 : Look for GCC-style __builtin_choose_expr
11299 case "$d_builtin_choose_expr" in
11302 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11303 $cat >try.c <<'EOCP'
11304 #include <assert.h>
11305 #include <stdlib.h>
11308 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11311 assert( SYRINX(1) == 2112 );
11312 assert( SYRINX(1) != 5150 );
11313 assert( SYRINX(0) == 5150 );
11314 assert( SYRINX(0) != 2112 );
11315 puts( "All good!" );
11321 if eval $compile && $run ./try; then
11322 echo "Your C compiler supports __builtin_choose_expr."
11325 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11329 *) val="$d_builtin_choose_expr" ;;
11332 set d_builtin_choose_expr
11336 : Look for GCC-style __builtin_expect
11337 case "$d_builtin_expect" in
11340 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11341 $cat >try.c <<'EOCP'
11344 if ( __builtin_expect(n, 0) ) n = 1;
11345 /* Remember shell exit code truth is 0, C truth is non-zero */
11350 if eval $compile && $run ./try; then
11351 echo "Your C compiler supports __builtin_expect."
11354 echo "Your C compiler doesn't seem to understand __builtin_expect."
11358 *) val="$d_builtin_expect" ;;
11361 set d_builtin_expect
11365 : see if bzero exists
11369 : see if stdarg is available
11371 if $test `./findhdr stdarg.h`; then
11372 echo "<stdarg.h> found." >&4
11375 echo "<stdarg.h> NOT found." >&4
11379 : see if varargs is available
11381 if $test `./findhdr varargs.h`; then
11382 echo "<varargs.h> found." >&4
11384 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11387 : set up the varargs testing programs
11388 $cat > varargs.c <<EOP
11390 #include <stdarg.h>
11393 #include <varargs.h>
11397 int f(char *p, ...)
11411 p = va_arg(ap, char *);
11417 $cat > varargs <<EOP
11419 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11428 : now check which varargs header should be included
11434 if `./varargs I_STDARG`; then
11436 elif `./varargs I_VARARGS`; then
11441 if `./varargs I_VARARGS`; then
11449 echo "*** WHOA THERE!!! ***" >&4
11450 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11451 case "$knowitall" in
11453 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11457 echo "I could not find the definition for va_dcl... You have problems..." >&4
11458 val="$undef"; set i_stdarg; eval $setvar
11459 val="$undef"; set i_varargs; eval $setvar
11464 case "$i_varhdr" in
11466 val="$define"; set i_stdarg; eval $setvar
11467 val="$undef"; set i_varargs; eval $setvar
11470 val="$undef"; set i_stdarg; eval $setvar
11471 val="$define"; set i_varargs; eval $setvar
11474 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11478 : see if the Compiler supports C99 variadic macros
11479 case "$i_stdarg$i_stdlib" in
11481 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11484 #include <stdarg.h>
11486 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11490 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11496 if eval $compile && $run ./try 2>&1 >/dev/null; then
11497 case "`$run ./try`" in
11499 echo "You have C99 variadic macros." >&4
11500 d_c99_variadic_macros="$define"
11503 echo "You don't have functional C99 variadic macros." >&4
11504 d_c99_variadic_macros="$undef"
11508 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11509 d_c99_variadic_macros="$undef"
11514 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11515 d_c99_variadic_macros="$undef"
11519 : see if signal is declared as pointer to function returning int or void
11521 xxx=`./findhdr signal.h`
11522 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11523 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11524 echo "You have int (*signal())() instead of void." >&4
11526 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11527 echo "You have void (*signal())()." >&4
11529 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11530 echo "You have int (*signal())() instead of void." >&4
11532 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11533 echo "You have void (*signal())()." >&4
11536 case "$d_voidsig" in
11538 echo "I can't determine whether signal handler returns void or int..." >&4
11540 rp="What type does your signal handler return?"
11543 v*) val="$define";;
11547 echo "As you already told me, signal handler returns void." >&4
11550 *) echo "As you already told me, signal handler returns int." >&4
11557 case "$d_voidsig" in
11558 "$define") signal_t="void";;
11559 *) signal_t="int";;
11563 : check for ability to cast large floats to 32-bit ints.
11565 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11566 if $test "$intsize" -ge 4; then
11573 #$i_stdlib I_STDLIB
11575 #include <stdlib.h>
11577 #include <sys/types.h>
11578 #include <signal.h>
11579 $signal_t blech(int s) { exit(3); }
11586 signal(SIGFPE, blech);
11588 /* Don't let compiler optimize the test away. Store the number
11589 in a writable string for gcc to pass to sscanf under HP-UX.
11591 sprintf(str, "2147483647");
11592 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11596 /* x86 processors will probably give 0x8000 0000, which is a
11597 sign change. We don't want that. We want to mimic SPARC
11598 behavior here, which is to preserve the sign and give
11601 if (i32 != ($xxx) f)
11607 if eval $compile_ok; then
11608 $run ./try 2>/dev/null
11611 echo "(I can't seem to compile the test program--assuming it can't)"
11616 echo "Yup, it can."
11619 echo "Nope, it can't."
11626 : check for ability to cast negative floats to unsigned
11628 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11631 #$i_stdlib I_STDLIB
11633 #include <stdlib.h>
11635 #include <sys/types.h>
11636 #include <signal.h>
11637 $signal_t blech(int s) { exit(7); }
11638 $signal_t blech_in_list(int s) { exit(4); }
11639 unsigned long dummy_long(unsigned long p) { return p; }
11640 unsigned int dummy_int(unsigned int p) { return p; }
11641 unsigned short dummy_short(unsigned short p) { return p; }
11645 unsigned long along;
11647 unsigned short ashort;
11651 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11652 a direct f = -123. assignment. gcc-2.8.0 reportedly
11653 optimized the whole file away
11655 /* Store the number in a writable string for gcc to pass to
11656 sscanf under HP-UX.
11658 sprintf(str, "-123");
11659 sscanf(str, "%lf", &f); /* f = -123.; */
11661 signal(SIGFPE, blech);
11662 along = (unsigned long)f;
11663 aint = (unsigned int)f;
11664 ashort = (unsigned short)f;
11665 if (along != (unsigned long)-123)
11667 if (aint != (unsigned int)-123)
11669 if (ashort != (unsigned short)-123)
11671 sprintf(str, "1073741824.");
11672 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11675 along = (unsigned long)f;
11676 if (along != 0x80000000)
11680 along = (unsigned long)f;
11681 if (along != 0x7fffffff)
11685 along = (unsigned long)f;
11686 if (along != 0x80000001)
11690 signal(SIGFPE, blech_in_list);
11691 sprintf(str, "123.");
11692 sscanf(str, "%lf", &f); /* f = 123.; */
11693 along = dummy_long((unsigned long)f);
11694 aint = dummy_int((unsigned int)f);
11695 ashort = dummy_short((unsigned short)f);
11696 if (along != (unsigned long)123)
11698 if (aint != (unsigned int)123)
11700 if (ashort != (unsigned short)123)
11707 if eval $compile_ok; then
11708 $run ./try 2>/dev/null
11711 echo "(I can't seem to compile the test program--assuming it can't)"
11714 case "$castflags" in
11716 echo "Yup, it can."
11719 echo "Nope, it can't."
11726 : see if cbrt exists
11730 : see if vprintf exists
11732 if set vprintf val -f d_vprintf; eval $csym; $val; then
11733 echo 'vprintf() found.' >&4
11736 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11737 #$i_varargs I_VARARGS
11739 #$i_stdlib I_STDLIB
11740 #$i_unistd I_UNISTD
11743 # include <stdarg.h>
11744 #else /* I_VARARGS */
11745 # include <varargs.h>
11749 # include <unistd.h>
11753 # include <stdlib.h>
11756 #include <stdio.h> /* vsprintf prototype */
11759 void xxx(int n, ...)
11764 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11766 int main() { xxx(1, "foo"); }
11768 #else /* I_VARARGS */
11776 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11778 int main() { xxx("foo"); }
11784 if eval $compile_ok; then
11785 if $run ./try; then
11786 echo "Your vsprintf() returns (int)." >&4
11789 echo "Your vsprintf() returns (char*)." >&4
11793 echo 'I am unable to compile the vsprintf() test program.' >&4
11794 # We shouldn't get here. If we do, assume the standard signature,
11795 # not the old BSD one.
11796 echo 'Guessing that vsprintf() returns (int).' >&4
11800 echo 'vprintf() NOT found.' >&4
11811 : see if chown exists
11815 : see if chroot exists
11816 set chroot d_chroot
11819 : see if chsize exists
11820 set chsize d_chsize
11823 : see if class exists
11827 : see if clearenv exists
11828 set clearenv d_clearenv
11831 : Define hasstruct macro for Configure internal use
11832 hasstruct='varname=$1; struct=$2; shift; shift;
11833 while $test $# -ge 2; do
11835 $define) echo "#include <$2>";;
11839 echo "int main () { struct $struct foo; }" >> try.c;
11841 if eval $compile; then
11850 : see whether socket exists
11854 $echo $n "Hmm... $c" >&4
11855 if set socket val -f d_socket; eval $csym; $val; then
11856 echo "Looks like you have Berkeley networking support." >&4
11858 if set setsockopt val -f; eval $csym; $val; then
11861 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11862 d_oldsock="$define"
11865 if $contains socklib libc.list >/dev/null 2>&1; then
11866 echo "Looks like you have Berkeley networking support." >&4
11868 : we will have to assume that it supports the 4.2 BSD interface
11871 echo "You don't have Berkeley networking in libc$_a..." >&4
11872 if test "X$d_socket" = "X$define"; then
11873 echo "...but you seem to believe that you have sockets." >&4
11875 for net in net socket
11877 if test -f $sysroot/usr/lib/lib$net$_a; then
11878 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11879 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11880 if $contains socket libc.list >/dev/null 2>&1; then
11885 echo "...but the Wollongong group seems to have hacked it in." >&4
11886 sockethdr="-I$sysroot/usr/netinclude"
11889 echo "Found Berkeley sockets interface in lib$net." >&4
11890 if $contains setsockopt libc.list >/dev/null 2>&1; then
11893 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11894 d_oldsock="$define"
11900 if test "X$d_socket" != "X$define"; then
11901 echo "or anywhere else I see." >&4
11909 : see if socketpair exists
11910 set socketpair d_sockpair
11915 echo "Checking the availability sa_len in the sock struct ..." >&4
11917 #include <sys/types.h>
11918 #include <sys/socket.h>
11920 struct sockaddr sa;
11921 return (sa.sa_len);
11925 set try; if eval $compile; then
11928 set d_sockaddr_sa_len; eval $setvar
11932 echo "Checking the availability struct sockaddr_in6 ..." >&4
11934 #include <sys/types.h>
11935 #include <sys/socket.h>
11936 #include <netinet/in.h>
11938 struct sockaddr_in6 sin6;
11939 return (sin6.sin6_family);
11943 set try; if eval $compile; then
11946 set d_sockaddr_in6; eval $setvar
11950 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11952 #include <sys/types.h>
11953 #include <sys/socket.h>
11954 #include <netinet/in.h>
11956 struct sockaddr_in6 sin6;
11957 return (sin6.sin6_scope_id);
11961 set try; if eval $compile; then
11964 set d_sin6_scope_id; eval $setvar
11968 echo "Checking the availability struct ip_mreq ..." >&4
11970 #include <sys/types.h>
11971 #include <sys/socket.h>
11972 #include <netinet/in.h>
11974 struct ip_mreq mreq;
11975 return (mreq.imr_multiaddr.s_addr);
11979 set try; if eval $compile; then
11982 set d_ip_mreq; eval $setvar
11986 echo "Checking the availability struct ip_mreq_source ..." >&4
11988 #include <sys/types.h>
11989 #include <sys/socket.h>
11990 #include <netinet/in.h>
11992 struct ip_mreq_source mreq;
11993 return (mreq.imr_multiaddr.s_addr);
11997 set try; if eval $compile; then
12000 set d_ip_mreq_source; eval $setvar
12004 echo "Checking the availability struct ipv6_mreq ..." >&4
12006 #include <sys/types.h>
12007 #include <sys/socket.h>
12008 #include <netinet/in.h>
12010 struct ipv6_mreq mreq;
12011 return (mreq.ipv6mr_interface);
12015 set try; if eval $compile; then
12018 set d_ipv6_mreq; eval $setvar
12022 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12024 #include <sys/types.h>
12025 #include <sys/socket.h>
12026 #include <netinet/in.h>
12028 struct ipv6_mreq_source mreq;
12029 return (mreq.imr_multiaddr.s_addr);
12033 set try; if eval $compile; then
12036 set d_ipv6_mreq_source; eval $setvar
12040 echo "Checking the availability of certain socket constants..." >&4
12041 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12042 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12044 #include <sys/types.h>
12045 #include <sys/socket.h>
12051 set try; if eval $compile; then
12054 set d_${enum}; eval $setvar
12058 : see if this is a sys/uio.h system
12059 set sys/uio.h i_sysuio
12062 : Check for cmsghdr support
12064 echo "Checking to see if your system supports struct cmsghdr..." >&4
12065 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12067 case "$d_cmsghdr_s" in
12068 "$define") echo "Yes, it does." ;;
12069 *) echo "No, it doesn't." ;;
12073 : check for const keyword
12075 echo 'Checking to see if your C compiler knows about "const"...' >&4
12076 $cat >const.c <<'EOCP'
12077 typedef struct spug { int drokk; } spug;
12081 const spug y = { 0 };
12084 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12086 echo "Yup, it does."
12089 echo "Nope, it doesn't."
12094 : see if copysign exists
12095 set copysign d_copysign
12098 : see if copysignl exists
12099 set copysignl d_copysignl
12102 : see if crypt exists
12107 $define) cryptlib='' ;;
12108 *) if set crypt val -f d_crypt; eval $csym; $val; then
12109 echo 'crypt() found.' >&4
12113 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12114 if $test -z "$cryptlib"; then
12115 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12119 if $test -z "$cryptlib"; then
12120 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12124 if $test -z "$cryptlib"; then
12125 cryptlib=`./loc libcrypt$_a "" $libpth`
12129 if $test -z "$cryptlib"; then
12130 echo 'crypt() NOT found.' >&4
12141 : see if this is a crypt.h system
12142 set crypt.h i_crypt
12145 : see if crypt_r exists
12146 set crypt_r d_crypt_r
12148 case "$d_crypt_r" in
12150 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12151 case "$d_crypt_r_proto:$usethreads" in
12152 ":define") d_crypt_r_proto=define
12153 set d_crypt_r_proto crypt_r $hdrs
12157 case "$d_crypt_r_proto" in
12159 case "$crypt_r_proto" in
12160 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12161 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12163 case "$crypt_r_proto" in
12164 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12165 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12167 case "$crypt_r_proto" in
12168 ''|0) d_crypt_r=undef
12170 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12171 * ) case "$crypt_r_proto" in
12172 REENTRANT_PROTO*) ;;
12173 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12175 echo "Prototype: $try" ;;
12178 *) case "$usethreads" in
12179 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12190 : get csh whereabouts
12192 'csh') val="$undef" ;;
12193 *) val="$define" ;;
12197 : Respect a hint or command line value for full_csh.
12198 case "$full_csh" in
12199 '') full_csh=$csh ;;
12202 : see if ctermid exists
12203 set ctermid d_ctermid
12206 : see if ctermid_r exists
12207 set ctermid_r d_ctermid_r
12209 case "$d_ctermid_r" in
12211 hdrs="$i_systypes sys/types.h define stdio.h "
12212 case "$d_ctermid_r_proto:$usethreads" in
12213 ":define") d_ctermid_r_proto=define
12214 set d_ctermid_r_proto ctermid_r $hdrs
12218 case "$d_ctermid_r_proto" in
12220 case "$ctermid_r_proto" in
12221 ''|0) try='char* ctermid_r(char*);'
12222 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12224 case "$ctermid_r_proto" in
12225 ''|0) d_ctermid_r=undef
12227 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12228 * ) case "$ctermid_r_proto" in
12229 REENTRANT_PROTO*) ;;
12230 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12232 echo "Prototype: $try" ;;
12235 *) case "$usethreads" in
12236 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12243 *) ctermid_r_proto=0
12247 : see if ctime_r exists
12248 set ctime_r d_ctime_r
12250 case "$d_ctime_r" in
12252 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12253 case "$d_ctime_r_proto:$usethreads" in
12254 ":define") d_ctime_r_proto=define
12255 set d_ctime_r_proto ctime_r $hdrs
12259 case "$d_ctime_r_proto" in
12261 case "$ctime_r_proto" in
12262 ''|0) try='char* ctime_r(const time_t*, char*);'
12263 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12265 case "$ctime_r_proto" in
12266 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12267 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12269 case "$ctime_r_proto" in
12270 ''|0) try='int ctime_r(const time_t*, char*);'
12271 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12273 case "$ctime_r_proto" in
12274 ''|0) try='int ctime_r(const time_t*, char*, int);'
12275 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12277 case "$ctime_r_proto" in
12278 ''|0) d_ctime_r=undef
12280 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12281 * ) case "$ctime_r_proto" in
12282 REENTRANT_PROTO*) ;;
12283 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12285 echo "Prototype: $try" ;;
12288 *) case "$usethreads" in
12289 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12300 : see if cuserid exists
12301 set cuserid d_cuserid
12304 : see if this is a limits.h system
12305 set limits.h i_limits
12308 : See if number of significant digits in a double precision number is known
12310 $cat >dbl_dig.c <<EOM
12311 #$i_limits I_LIMITS
12314 #include <limits.h>
12320 printf("Contains DBL_DIG");
12323 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12324 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12325 echo "DBL_DIG found." >&4
12328 echo "DBL_DIG NOT found." >&4
12335 : see if dbm.h is available
12336 : see if dbmclose exists
12337 set dbmclose d_dbmclose
12340 case "$d_dbmclose" in
12350 *) set rpcsvc/dbm.h i_rpcsvcdbm
12355 *) echo "We won't be including <dbm.h>"
12365 : see if prototype for dbminit is available
12367 set d_dbminitproto dbminit $i_dbm dbm.h
12370 : see if difftime exists
12371 set difftime d_difftime
12374 : see if this is a dirent system
12376 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12378 echo "<dirent.h> found." >&4
12381 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12382 echo "<sys/dir.h> found." >&4
12385 xinc=`./findhdr sys/ndir.h`
12387 echo "<dirent.h> NOT found." >&4
12392 : Look for type of directory structure.
12394 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12396 case "$direntrytype" in
12398 case "$i_dirent" in
12399 $define) guess1='struct dirent' ;;
12400 *) guess1='struct direct' ;;
12403 *) guess1="$direntrytype"
12408 'struct dirent') guess2='struct direct' ;;
12409 *) guess2='struct dirent' ;;
12412 if $contains "$guess1" try.c >/dev/null 2>&1; then
12413 direntrytype="$guess1"
12414 echo "Your directory entries are $direntrytype." >&4
12415 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12416 direntrytype="$guess2"
12417 echo "Your directory entries seem to be $direntrytype." >&4
12419 echo "I don't recognize your system's directory entries." >&4
12420 rp="What type is used for directory entries on this system?"
12423 direntrytype="$ans"
12427 : see if the directory entry stores field length
12429 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12430 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12431 echo "Good, your directory entry keeps length information in d_namlen." >&4
12434 echo "Your directory entry does not know about the d_namlen field." >&4
12441 : Look for DIR.dd_fd
12442 case "$i_dirent" in
12444 echo "Checking to see if DIR has a dd_fd member variable" >&4
12446 #$i_stdlib I_STDLIB
12448 #include <stdlib.h>
12450 #include <dirent.h>
12460 if eval $compile; then
12461 echo "Yes, it does."
12464 echo "No, it does not."
12469 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12477 : see if this is an sysdir system
12478 set sys/dir.h i_sysdir
12481 : see if this is an sysndir system
12482 set sys/ndir.h i_sysndir
12487 $cat >dirfd.c <<EOM
12489 #$i_stdlib I_STDLIB
12491 #include <stdlib.h>
12493 #$i_dirent I_DIRENT /**/
12494 #$i_sysdir I_SYS_DIR /**/
12495 #$i_sysndir I_SYS_NDIR /**/
12496 #$i_systypes I_SYS_TYPES /**/
12497 #if defined(I_SYS_TYPES)
12498 #include <sys/types.h>
12500 #if defined(I_DIRENT)
12501 #include <dirent.h>
12504 #include <sys/ndir.h>
12508 #include <ndir.h> /* may be wrong in the future */
12510 #include <sys/dir.h>
12516 DIR *dirp = opendir(".");
12517 if (dirfd(dirp) >= 0)
12525 if eval $compile; then
12529 $define) echo "dirfd() found." >&4 ;;
12530 *) echo "dirfd() NOT found." >&4 ;;
12536 : see if dladdr exists
12537 set dladdr d_dladdr
12540 : see if dlerror exists
12543 set dlerror d_dlerror
12547 : see if dlfcn is available
12548 set dlfcn.h i_dlfcn
12551 : Check what extension to use for shared libs
12556 On a few systems, the dynamically loaded modules that perl generates and uses
12557 will need a different extension than shared libs. The default will probably
12563 *) dflt="$dlext" ;;
12565 rp='What is the extension of dynamically loaded modules'
12574 : Check if dlsym need a leading underscore
12580 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12581 $cat >dyna.c <<'EOM'
12588 #$i_stdlib I_STDLIB
12590 #include <stdlib.h>
12594 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12596 #include <sys/types.h>
12601 extern int fred() ;
12610 int mode = RTLD_LAZY ;
12612 handle = dlopen("./dyna.$dlext", mode) ;
12613 if (handle == NULL) {
12618 symbol = dlsym(handle, "fred") ;
12619 if (symbol == NULL) {
12620 /* try putting a leading underscore */
12621 symbol = dlsym(handle, "_fred") ;
12622 if (symbol == NULL) {
12635 : Call the object file tmp-dyna.o in case dlext=o.
12636 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12637 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12638 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12639 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12642 1) echo "Test program failed using dlopen." >&4
12643 echo "Perhaps you should not use dynamic loading." >&4;;
12644 2) echo "Test program failed using dlsym." >&4
12645 echo "Perhaps you should not use dynamic loading." >&4;;
12646 3) echo "dlsym needs a leading underscore" >&4
12648 4) echo "dlsym doesn't need a leading underscore." >&4;;
12651 echo "I can't compile and run the test program." >&4
12652 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12657 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12662 : see if drand48_r exists
12663 set drand48_r d_drand48_r
12665 case "$d_drand48_r" in
12667 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12668 case "$d_drand48_r_proto:$usethreads" in
12669 ":define") d_drand48_r_proto=define
12670 set d_drand48_r_proto drand48_r $hdrs
12674 case "$d_drand48_r_proto" in
12676 case "$drand48_r_proto" in
12677 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12678 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12680 case "$drand48_r_proto" in
12681 ''|0) d_drand48_r=undef
12683 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12684 * ) case "$drand48_r_proto" in
12685 REENTRANT_PROTO*) ;;
12686 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12688 echo "Prototype: $try" ;;
12691 *) case "$usethreads" in
12692 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12699 *) drand48_r_proto=0
12703 : see if prototype for drand48 is available
12705 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12708 : see if dup2 exists
12712 : see if eaccess exists
12713 set eaccess d_eaccess
12716 : see if endgrent exists
12717 set endgrent d_endgrent
12720 : see if this is an grp system
12726 xxx=`./findhdr grp.h`
12727 $cppstdin $cppflags $cppminus < $xxx >$$.h
12729 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12741 set d_grpasswd; eval $setvar
12745 : see if endgrent_r exists
12746 set endgrent_r d_endgrent_r
12748 case "$d_endgrent_r" in
12750 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12751 case "$d_endgrent_r_proto:$usethreads" in
12752 ":define") d_endgrent_r_proto=define
12753 set d_endgrent_r_proto endgrent_r $hdrs
12757 case "$d_endgrent_r_proto" in
12759 case "$endgrent_r_proto" in
12760 ''|0) try='int endgrent_r(FILE**);'
12761 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12763 case "$endgrent_r_proto" in
12764 ''|0) try='void endgrent_r(FILE**);'
12765 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12767 case "$endgrent_r_proto" in
12768 ''|0) d_endgrent_r=undef
12770 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12771 * ) case "$endgrent_r_proto" in
12772 REENTRANT_PROTO*) ;;
12773 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12775 echo "Prototype: $try" ;;
12778 *) case "$usethreads" in
12779 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12786 *) endgrent_r_proto=0
12790 : see if endhostent exists
12791 set endhostent d_endhent
12794 : see if this is a netdb.h system
12795 set netdb.h i_netdb
12798 : see if endhostent_r exists
12799 set endhostent_r d_endhostent_r
12801 case "$d_endhostent_r" in
12803 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12804 case "$d_endhostent_r_proto:$usethreads" in
12805 ":define") d_endhostent_r_proto=define
12806 set d_endhostent_r_proto endhostent_r $hdrs
12810 case "$d_endhostent_r_proto" in
12812 case "$endhostent_r_proto" in
12813 ''|0) try='int endhostent_r(struct hostent_data*);'
12814 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12816 case "$endhostent_r_proto" in
12817 ''|0) try='void endhostent_r(struct hostent_data*);'
12818 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12820 case "$endhostent_r_proto" in
12821 ''|0) d_endhostent_r=undef
12822 endhostent_r_proto=0
12823 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12824 * ) case "$endhostent_r_proto" in
12825 REENTRANT_PROTO*) ;;
12826 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12828 echo "Prototype: $try" ;;
12831 *) case "$usethreads" in
12832 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12834 d_endhostent_r=undef
12835 endhostent_r_proto=0
12839 *) endhostent_r_proto=0
12843 : see if endnetent exists
12844 set endnetent d_endnent
12847 : see if endnetent_r exists
12848 set endnetent_r d_endnetent_r
12850 case "$d_endnetent_r" in
12852 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12853 case "$d_endnetent_r_proto:$usethreads" in
12854 ":define") d_endnetent_r_proto=define
12855 set d_endnetent_r_proto endnetent_r $hdrs
12859 case "$d_endnetent_r_proto" in
12861 case "$endnetent_r_proto" in
12862 ''|0) try='int endnetent_r(struct netent_data*);'
12863 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12865 case "$endnetent_r_proto" in
12866 ''|0) try='void endnetent_r(struct netent_data*);'
12867 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12869 case "$endnetent_r_proto" in
12870 ''|0) d_endnetent_r=undef
12871 endnetent_r_proto=0
12872 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12873 * ) case "$endnetent_r_proto" in
12874 REENTRANT_PROTO*) ;;
12875 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12877 echo "Prototype: $try" ;;
12880 *) case "$usethreads" in
12881 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12883 d_endnetent_r=undef
12884 endnetent_r_proto=0
12888 *) endnetent_r_proto=0
12892 : see if endprotoent exists
12893 set endprotoent d_endpent
12896 : see if endprotoent_r exists
12897 set endprotoent_r d_endprotoent_r
12899 case "$d_endprotoent_r" in
12901 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12902 case "$d_endprotoent_r_proto:$usethreads" in
12903 ":define") d_endprotoent_r_proto=define
12904 set d_endprotoent_r_proto endprotoent_r $hdrs
12908 case "$d_endprotoent_r_proto" in
12910 case "$endprotoent_r_proto" in
12911 ''|0) try='int endprotoent_r(struct protoent_data*);'
12912 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12914 case "$endprotoent_r_proto" in
12915 ''|0) try='void endprotoent_r(struct protoent_data*);'
12916 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12918 case "$endprotoent_r_proto" in
12919 ''|0) d_endprotoent_r=undef
12920 endprotoent_r_proto=0
12921 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12922 * ) case "$endprotoent_r_proto" in
12923 REENTRANT_PROTO*) ;;
12924 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12926 echo "Prototype: $try" ;;
12929 *) case "$usethreads" in
12930 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12932 d_endprotoent_r=undef
12933 endprotoent_r_proto=0
12937 *) endprotoent_r_proto=0
12941 : see if endpwent exists
12942 set endpwent d_endpwent
12945 : see if this is a pwd.h system
12951 xxx=`./findhdr pwd.h`
12952 $cppstdin $cppflags $cppminus < $xxx >$$.h
12954 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12962 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12970 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12978 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12986 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12994 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13002 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13010 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13022 set d_pwquota; eval $setvar
13023 set d_pwage; eval $setvar
13024 set d_pwchange; eval $setvar
13025 set d_pwclass; eval $setvar
13026 set d_pwexpire; eval $setvar
13027 set d_pwcomment; eval $setvar
13028 set d_pwgecos; eval $setvar
13029 set d_pwpasswd; eval $setvar
13033 : see if endpwent_r exists
13034 set endpwent_r d_endpwent_r
13036 case "$d_endpwent_r" in
13038 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13039 case "$d_endpwent_r_proto:$usethreads" in
13040 ":define") d_endpwent_r_proto=define
13041 set d_endpwent_r_proto endpwent_r $hdrs
13045 case "$d_endpwent_r_proto" in
13047 case "$endpwent_r_proto" in
13048 ''|0) try='int endpwent_r(FILE**);'
13049 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13051 case "$endpwent_r_proto" in
13052 ''|0) try='void endpwent_r(FILE**);'
13053 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13055 case "$endpwent_r_proto" in
13056 ''|0) d_endpwent_r=undef
13058 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13059 * ) case "$endpwent_r_proto" in
13060 REENTRANT_PROTO*) ;;
13061 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13063 echo "Prototype: $try" ;;
13066 *) case "$usethreads" in
13067 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13074 *) endpwent_r_proto=0
13078 : see if endservent exists
13079 set endservent d_endsent
13082 : see if endservent_r exists
13083 set endservent_r d_endservent_r
13085 case "$d_endservent_r" in
13087 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13088 case "$d_endservent_r_proto:$usethreads" in
13089 ":define") d_endservent_r_proto=define
13090 set d_endservent_r_proto endservent_r $hdrs
13094 case "$d_endservent_r_proto" in
13096 case "$endservent_r_proto" in
13097 ''|0) try='int endservent_r(struct servent_data*);'
13098 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13100 case "$endservent_r_proto" in
13101 ''|0) try='void endservent_r(struct servent_data*);'
13102 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13104 case "$endservent_r_proto" in
13105 ''|0) d_endservent_r=undef
13106 endservent_r_proto=0
13107 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13108 * ) case "$endservent_r_proto" in
13109 REENTRANT_PROTO*) ;;
13110 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13112 echo "Prototype: $try" ;;
13115 *) case "$usethreads" in
13116 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13118 d_endservent_r=undef
13119 endservent_r_proto=0
13123 *) endservent_r_proto=0
13127 : Locate the flags for 'open()'
13130 #include <sys/types.h>
13135 #include <sys/file.h>
13137 #$i_stdlib I_STDLIB
13139 #include <stdlib.h>
13150 : check sys/file.h first to get FREAD on Sun
13151 if $test `./findhdr sys/file.h` && \
13152 set try -DI_SYS_FILE && eval $compile; then
13154 echo "<sys/file.h> defines the O_* constants..." >&4
13155 if $run ./try; then
13156 echo "and you have the 3 argument form of open()." >&4
13159 echo "but not the 3 argument form of open(). Oh, well." >&4
13162 elif $test `./findhdr fcntl.h` && \
13163 set try -DI_FCNTL && eval $compile; then
13165 echo "<fcntl.h> defines the O_* constants..." >&4
13166 if $run ./try; then
13167 echo "and you have the 3 argument form of open()." >&4
13170 echo "but not the 3 argument form of open(). Oh, well." >&4
13175 echo "I can't find the O_* constant definitions! You got problems." >&4
13181 : see if this is a sys/file.h system
13186 : do we need to include sys/file.h ?
13190 if $h_sysfile; then
13192 echo "We'll be including <sys/file.h>." >&4
13195 echo "We won't be including <sys/file.h>." >&4
13205 : see if fcntl.h is there
13210 : see if we can include fcntl.h
13216 echo "We'll be including <fcntl.h>." >&4
13219 if $h_sysfile; then
13220 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13222 echo "We won't be including <fcntl.h>." >&4
13234 : see if fork exists
13238 : see if pipe exists
13242 : check for non-blocking I/O stuff
13243 case "$h_sysfile" in
13244 true) echo "#include <sys/file.h>" > head.c;;
13247 true) echo "#include <fcntl.h>" > head.c;;
13248 *) echo "#include <sys/fcntl.h>" > head.c;;
13253 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13254 case "$o_nonblock" in
13256 $cat head.c > try.c
13257 $cat >>try.c <<EOCP
13259 #$i_stdlib I_STDLIB
13261 #include <stdlib.h>
13269 printf("O_NONBLOCK\n");
13273 printf("O_NDELAY\n");
13277 printf("FNDELAY\n");
13284 if eval $compile_ok; then
13285 o_nonblock=`$run ./try`
13286 case "$o_nonblock" in
13287 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13288 *) echo "Seems like we can use $o_nonblock.";;
13291 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13294 *) echo "Using $hint value $o_nonblock.";;
13299 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13302 case "$d_fork:$d_pipe" in
13304 $cat head.c > try.c
13305 $cat >>try.c <<EOCP
13307 #include <sys/types.h>
13308 #include <signal.h>
13310 #$i_stdlib I_STDLIB
13312 #include <stdlib.h>
13318 #define MY_O_NONBLOCK $o_nonblock
13319 #ifndef errno /* XXX need better Configure test */
13322 #$i_unistd I_UNISTD
13324 #include <unistd.h>
13326 #$i_string I_STRING
13328 #include <string.h>
13330 #include <strings.h>
13332 $signal_t blech(int x) { exit(3); }
13334 $cat >> try.c <<'EOCP'
13343 ret = pipe(pd); /* Down: child -> parent */
13346 ret = pipe(pu); /* Up: parent -> child */
13350 close(pd[1]); /* Parent reads from pd[0] */
13351 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13353 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13358 signal(SIGALRM, blech);
13360 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13362 sprintf(string, "%d\n", ret);
13363 ret = write(2, string, strlen(string));
13364 if (ret != strlen(string))
13368 if (errno == EAGAIN) {
13369 printf("EAGAIN\n");
13374 if (errno == EWOULDBLOCK)
13375 printf("EWOULDBLOCK\n");
13378 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13381 sleep(2); /* Give it time to close our pipe */
13383 ret = read(pd[0], buf, 1); /* Should read EOF */
13385 sprintf(string, "%d\n", ret);
13386 ret = write(4, string, strlen(string));
13387 if (ret != strlen(string))
13392 close(pd[0]); /* We write to pd[1] */
13393 close(pu[1]); /* We read from pu[0] */
13394 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13397 close(pd[1]); /* Pipe pd is now fully closed! */
13398 exit(0); /* Bye bye, thank you for playing! */
13402 if eval $compile_ok; then
13403 echo "$startsh" >mtry
13404 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13406 $run ./mtry >/dev/null 2>&1
13408 0) eagain=`$cat try.out`;;
13409 1) echo "Could not perform non-blocking setting!";;
13410 2) echo "I did a successful read() for something that was not there!";;
13411 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13412 4) echo "Could not find F_SETFL!";;
13413 *) echo "Something terribly wrong happened during testing.";;
13415 rd_nodata=`$cat try.ret`
13416 echo "A read() system call with no data present returns $rd_nodata."
13417 case "$rd_nodata" in
13420 echo "(That's peculiar, fixing that to be -1.)"
13426 echo "Forcing errno EAGAIN on read() with no data available."
13430 echo "Your read() sets errno to $eagain when no data is available."
13433 status=`$cat try.err`
13435 0) echo "And it correctly returns 0 to signal EOF.";;
13436 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13437 *) echo "However, your read() returns '$status' on EOF??";;
13440 if test "$status" = "$rd_nodata"; then
13441 echo "WARNING: you can't distinguish between EOF and no data!"
13445 echo "I can't compile the test program--assuming errno EAGAIN will do."
13449 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13458 echo "Using $hint value $eagain."
13459 echo "Your read() returns $rd_nodata when no data is present."
13460 case "$d_eofnblk" in
13461 "$define") echo "And you can see EOF because read() returns 0.";;
13462 "$undef") echo "But you can't see EOF status from read() returned value.";;
13464 echo "(Assuming you can't see EOF status from read anyway.)"
13470 $rm_try head.c mtry
13472 : see if erf exists
13476 : see if erfc exists
13480 : see if exp2 exists
13484 : see if expm1 exists
13488 : see if _ptr and _cnt from stdio act std
13491 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13492 echo "(Looks like you have stdio.h from BSD.)"
13493 case "$stdio_ptr" in
13494 '') stdio_ptr='((fp)->_p)'
13497 *) ptr_lval=$d_stdio_ptr_lval;;
13499 case "$stdio_cnt" in
13500 '') stdio_cnt='((fp)->_r)'
13503 *) cnt_lval=$d_stdio_cnt_lval;;
13505 case "$stdio_base" in
13506 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13508 case "$stdio_bufsiz" in
13509 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13511 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13512 echo "(Looks like you have stdio.h from Linux.)"
13513 case "$stdio_ptr" in
13514 '') stdio_ptr='((fp)->_IO_read_ptr)'
13517 *) ptr_lval=$d_stdio_ptr_lval;;
13519 case "$stdio_cnt" in
13520 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13523 *) cnt_lval=$d_stdio_cnt_lval;;
13525 case "$stdio_base" in
13526 '') stdio_base='((fp)->_IO_read_base)';;
13528 case "$stdio_bufsiz" in
13529 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13532 case "$stdio_ptr" in
13533 '') stdio_ptr='((fp)->_ptr)'
13536 *) ptr_lval=$d_stdio_ptr_lval;;
13538 case "$stdio_cnt" in
13539 '') stdio_cnt='((fp)->_cnt)'
13542 *) cnt_lval=$d_stdio_cnt_lval;;
13544 case "$stdio_base" in
13545 '') stdio_base='((fp)->_base)';;
13547 case "$stdio_bufsiz" in
13548 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13552 : test whether _ptr and _cnt really work
13553 echo "Checking how std your stdio is..." >&4
13556 #$i_stdlib I_STDLIB
13558 #include <stdlib.h>
13560 #define FILE_ptr(fp) $stdio_ptr
13561 #define FILE_cnt(fp) $stdio_cnt
13563 FILE *fp = fopen("try.c", "r");
13566 18 <= FILE_cnt(fp) &&
13567 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13575 if eval $compile && $to try.c; then
13576 if $run ./try; then
13577 echo "Your stdio acts pretty std."
13580 echo "Your stdio isn't very std."
13583 echo "Your stdio doesn't appear very std."
13587 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13588 # direct buffer manipulation no longer works. The Configure tests
13589 # should be changed to correctly detect this, but until then,
13590 # the following check should at least let perl compile and run.
13591 # (This quick fix should be updated before 5.8.1.)
13592 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13593 # A. Dougherty, June 3, 2002.
13594 case "$d_gnulibc" in
13596 case "$gnulibc_version" in
13600 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13609 : Can _ptr be used as an lvalue?
13610 case "$d_stdstdio$ptr_lval" in
13611 $define$define) val=$define ;;
13614 set d_stdio_ptr_lval
13617 : Can _cnt be used as an lvalue?
13618 case "$d_stdstdio$cnt_lval" in
13619 $define$define) val=$define ;;
13622 set d_stdio_cnt_lval
13626 : test whether setting _ptr sets _cnt as a side effect
13627 d_stdio_ptr_lval_sets_cnt="$undef"
13628 d_stdio_ptr_lval_nochange_cnt="$undef"
13629 case "$d_stdio_ptr_lval$d_stdstdio" in
13631 echo "Checking to see what happens if we set the stdio ptr..." >&4
13634 /* Can we scream? */
13635 /* Eat dust sed :-) */
13636 /* In the buffer space, no one can hear you scream. */
13637 #$i_stdlib I_STDLIB
13639 #include <stdlib.h>
13641 #define FILE_ptr(fp) $stdio_ptr
13642 #define FILE_cnt(fp) $stdio_cnt
13643 #include <sys/types.h>
13645 FILE *fp = fopen("try.c", "r");
13650 puts("Fail even to read");
13653 c = getc(fp); /* Read away the first # */
13655 puts("Fail even to read");
13659 18 <= FILE_cnt(fp) &&
13660 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13662 puts("Fail even to read");
13665 ptr = (char*) FILE_ptr(fp);
13666 cnt = (size_t)FILE_cnt(fp);
13668 FILE_ptr(fp) += 42;
13670 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13671 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13674 if (FILE_cnt(fp) <= 20) {
13675 printf ("Fail (<20 chars to test)");
13678 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13679 puts("Fail compare");
13682 if (cnt == FILE_cnt(fp)) {
13683 puts("Pass_unchanged");
13686 if (FILE_cnt(fp) == (cnt - 42)) {
13687 puts("Pass_changed");
13690 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13696 if eval $compile && $to try.c; then
13697 case `$run ./try` in
13699 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13700 d_stdio_ptr_lval_sets_cnt="$define" ;;
13702 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13703 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13705 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13707 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13710 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13716 : see if _base is also standard
13718 case "$d_stdstdio" in
13722 #$i_stdlib I_STDLIB
13724 #include <stdlib.h>
13726 #define FILE_base(fp) $stdio_base
13727 #define FILE_bufsiz(fp) $stdio_bufsiz
13729 FILE *fp = fopen("try.c", "r");
13732 19 <= FILE_bufsiz(fp) &&
13733 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13740 if eval $compile && $to try.c; then
13741 if $run ./try; then
13742 echo "And its _base field acts std."
13745 echo "But its _base field isn't std."
13748 echo "However, it seems to be lacking the _base field."
13756 : see if fast_stdio exists
13758 case "$d_stdstdio:$d_stdio_ptr_lval" in
13760 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13762 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13773 : see if fchdir exists
13774 set fchdir d_fchdir
13777 : see if fchmod exists
13778 set fchmod d_fchmod
13781 : see if fchown exists
13782 set fchown d_fchown
13785 : see if this is an fcntl system
13789 : See if fcntl-based locking works.
13792 #$i_stdlib I_STDLIB
13794 #include <stdlib.h>
13796 #include <unistd.h>
13798 #include <signal.h>
13799 $signal_t blech(int x) { exit(3); }
13801 #if defined(F_SETLK) && defined(F_SETLKW)
13802 struct flock flock;
13804 fd = open("try.c", O_RDONLY);
13805 flock.l_type = F_RDLCK;
13806 flock.l_whence = SEEK_SET;
13807 flock.l_start = flock.l_len = 0;
13808 signal(SIGALRM, blech);
13810 retval = fcntl(fd, F_SETLK, &flock);
13812 (retval < 0 ? exit(2) : exit(0));
13818 echo "Checking if fcntl-based file locking works... "
13822 if eval $compile_ok; then
13823 if $run ./try; then
13824 echo "Yes, it seems to work."
13827 echo "Nope, it didn't work."
13832 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13833 *** This is (almost) impossible.
13834 *** If your NFS lock daemons are not feeling well, something like
13835 *** this may happen, please investigate. Cannot continue, aborting.
13843 echo "I'm unable to compile the test program, so I'll assume not."
13848 echo "Nope, since you don't even have fcntl()."
13851 set d_fcntl_can_lock
13855 : check for fd_set items
13858 Checking to see how well your C compiler handles fd_set and friends ...
13861 #$i_stdlib I_STDLIB
13863 #include <stdlib.h>
13865 #$i_systime I_SYS_TIME
13866 #$i_sysselct I_SYS_SELECT
13867 #$d_socket HAS_SOCKET
13868 #include <sys/types.h>
13870 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13873 #include <sys/time.h>
13875 #ifdef I_SYS_SELECT
13876 #include <sys/select.h>
13885 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13893 if eval $compile; then
13894 d_fds_bits="$define"
13896 echo "Well, your system knows about the normal fd_set typedef..." >&4
13897 if $run ./try; then
13898 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13899 d_fd_macros="$define"
13902 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13904 d_fd_macros="$undef"
13908 Hmm, your compiler has some difficulty with fd_set. Checking further...
13911 if eval $compile; then
13912 d_fds_bits="$undef"
13914 echo "Well, your system has some sort of fd_set available..." >&4
13915 if $run ./try; then
13916 echo "and you have the normal fd_set macros." >&4
13917 d_fd_macros="$define"
13920 but not the normal fd_set macros! Gross! More work for me...
13922 d_fd_macros="$undef"
13925 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13927 d_fds_bits="$undef"
13928 d_fd_macros="$undef"
13933 : see if fdim exists
13937 : see if fegetround exists
13938 set fegetround d_fegetround
13941 : see if fgetpos exists
13942 set fgetpos d_fgetpos
13945 : see if finite exists
13946 set finite d_finite
13949 : see if finitel exists
13950 set finitel d_finitel
13953 : see if flock exists
13957 : see if prototype for flock is available
13959 set d_flockproto flock $i_sysfile sys/file.h
13962 : see if fma exists
13966 : see if fmax exists
13970 : see if fmin exists
13974 : see if fp_class exists
13975 set fp_class d_fp_class
13978 : see if this is a math.h system
13982 : check for fpclassify
13983 echo "Checking to see if you have fpclassify..." >&4
13989 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13992 if eval $compile; then
13994 echo "You have fpclassify."
13997 echo "You do not have fpclassify."
14003 : see if fp_classify exists
14004 set fp_classify d_fp_classify
14007 : see if fp_classl exists
14008 set fp_classl d_fp_classl
14011 : see if pathconf exists
14012 set pathconf d_pathconf
14015 : see if fpathconf exists
14016 set fpathconf d_fpathconf
14019 : see if fpclass exists
14020 set fpclass d_fpclass
14023 : see if fpclassl exists
14024 set fpclassl d_fpclassl
14027 : see if fpgetround exists
14028 set fpgetround d_fpgetround
14031 : check for fpos64_t
14033 echo "Checking to see if you have fpos64_t..." >&4
14036 int main() { fpos64_t x = 7; }
14039 if eval $compile; then
14041 echo "You have fpos64_t."
14044 echo "You do not have fpos64_t."
14045 case "$fpossize" in
14046 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14053 : see if frexpl exists
14054 set frexpl d_frexpl
14057 : see if this is a sys/param system
14058 set sys/param.h i_sysparam
14061 : see if this is a sys/mount.h system
14062 set sys/mount.h i_sysmount
14065 : Check for fs_data_s
14067 echo "Checking to see if your system supports struct fs_data..." >&4
14068 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14070 case "$d_fs_data_s" in
14071 "$define") echo "Yes, it does." ;;
14072 *) echo "No, it doesn't." ;;
14075 : see if fseeko exists
14076 set fseeko d_fseeko
14078 case "$longsize" in
14079 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14082 : see if fsetpos exists
14083 set fsetpos d_fsetpos
14086 : see if fstatfs exists
14087 set fstatfs d_fstatfs
14090 : see if statvfs exists
14091 set statvfs d_statvfs
14094 : see if fstatvfs exists
14095 set fstatvfs d_fstatvfs
14099 : see if fsync exists
14103 : see if ftello exists
14104 set ftello d_ftello
14106 case "$longsize" in
14107 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14110 : check for a working futimes
14113 echo "Checking if you have a working futimes()" >&4
14116 #include <sys/time.h>
14123 fd = open ("try.c", O_RDWR);
14124 if (-1 == fd) exit (1);
14125 rv = futimes (fd, NULL);
14126 exit (rv == -1 ? errno : 0);
14130 if eval $compile; then
14134 0) echo "Yes, you have" >&4
14135 d_futimes="$define"
14137 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14141 echo "No, it does not (probably harmless)" >&4
14145 : see if ndbm.h is available
14148 : Compatibility location for RedHat 7.1
14149 set gdbm/ndbm.h i_gdbmndbm
14151 : Compatibility location for Debian 4.0
14152 set gdbm-ndbm.h i_gdbm_ndbm
14156 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14157 : see if dbm_open exists
14158 set dbm_open d_dbm_open
14160 case "$d_dbm_open" in
14163 i_gdbmndbm="$undef"
14164 i_gdbm_ndbm="$undef"
14165 echo "We won't be including <ndbm.h>"
14175 ndbm_hdr_protochk='name=$1; hdr=$2;
14176 eval "ihdr=\$""i_$name";
14178 if $test "$ihdr" = "$define"; then
14179 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14180 case "$d_cplusplus" in
14181 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14182 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14185 $define) $echo "Your <$hdr> seems to have prototypes";;
14186 *) $echo "Your <$hdr> does not seem to have prototypes";;
14189 set "d_${name}_h_uses_prototypes";
14193 eval $ndbm_hdr_protochk
14194 set gdbmndbm gdbm/ndbm.h
14195 eval $ndbm_hdr_protochk
14196 set gdbm_ndbm gdbm-ndbm.h
14197 eval $ndbm_hdr_protochk
14199 : see if getaddrinfo exists
14200 set getaddrinfo d_getaddrinfo
14203 : see if getcwd exists
14204 set getcwd d_getcwd
14207 : see if getespwnam exists
14208 set getespwnam d_getespwnam
14211 : see if getfsstat exists
14212 set getfsstat d_getfsstat
14215 : see if getgrent exists
14216 set getgrent d_getgrent
14219 : see if getgrent_r exists
14220 set getgrent_r d_getgrent_r
14222 case "$d_getgrent_r" in
14224 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14225 case "$d_getgrent_r_proto:$usethreads" in
14226 ":define") d_getgrent_r_proto=define
14227 set d_getgrent_r_proto getgrent_r $hdrs
14231 case "$d_getgrent_r_proto" in
14233 case "$getgrent_r_proto" in
14234 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14235 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14237 case "$getgrent_r_proto" in
14238 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14239 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14241 case "$getgrent_r_proto" in
14242 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14243 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14245 case "$getgrent_r_proto" in
14246 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14247 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14249 case "$getgrent_r_proto" in
14250 ''|0) try='int getgrent_r(struct group*, char*, int);'
14251 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14253 case "$getgrent_r_proto" in
14254 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14255 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14257 case "$getgrent_r_proto" in
14258 ''|0) d_getgrent_r=undef
14260 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14261 * ) case "$getgrent_r_proto" in
14262 REENTRANT_PROTO*) ;;
14263 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14265 echo "Prototype: $try" ;;
14268 *) case "$usethreads" in
14269 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14276 *) getgrent_r_proto=0
14280 : see if getgrgid_r exists
14281 set getgrgid_r d_getgrgid_r
14283 case "$d_getgrgid_r" in
14285 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14286 case "$d_getgrgid_r_proto:$usethreads" in
14287 ":define") d_getgrgid_r_proto=define
14288 set d_getgrgid_r_proto getgrgid_r $hdrs
14292 case "$d_getgrgid_r_proto" in
14294 case "$getgrgid_r_proto" in
14295 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14296 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14298 case "$getgrgid_r_proto" in
14299 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14300 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14302 case "$getgrgid_r_proto" in
14303 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14304 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14306 case "$getgrgid_r_proto" in
14307 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14308 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14310 case "$getgrgid_r_proto" in
14311 ''|0) d_getgrgid_r=undef
14313 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14314 * ) case "$getgrgid_r_proto" in
14315 REENTRANT_PROTO*) ;;
14316 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14318 echo "Prototype: $try" ;;
14321 *) case "$usethreads" in
14322 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14329 *) getgrgid_r_proto=0
14333 : see if getgrnam_r exists
14334 set getgrnam_r d_getgrnam_r
14336 case "$d_getgrnam_r" in
14338 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14339 case "$d_getgrnam_r_proto:$usethreads" in
14340 ":define") d_getgrnam_r_proto=define
14341 set d_getgrnam_r_proto getgrnam_r $hdrs
14345 case "$d_getgrnam_r_proto" in
14347 case "$getgrnam_r_proto" in
14348 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14349 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14351 case "$getgrnam_r_proto" in
14352 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14353 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14355 case "$getgrnam_r_proto" in
14356 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14357 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14359 case "$getgrnam_r_proto" in
14360 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14361 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14363 case "$getgrnam_r_proto" in
14364 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14365 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14367 case "$getgrnam_r_proto" in
14368 ''|0) d_getgrnam_r=undef
14370 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14371 * ) case "$getgrnam_r_proto" in
14372 REENTRANT_PROTO*) ;;
14373 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14375 echo "Prototype: $try" ;;
14378 *) case "$usethreads" in
14379 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14386 *) getgrnam_r_proto=0
14390 : see if gethostbyaddr exists
14391 set gethostbyaddr d_gethbyaddr
14394 : see if gethostbyname exists
14395 set gethostbyname d_gethbyname
14398 : see if gethostent exists
14399 set gethostent d_gethent
14402 : see how we will look up host name
14405 if set gethostname val -f d_gethname; eval $csym; $val; then
14406 echo 'gethostname() found.' >&4
14407 d_gethname="$define"
14410 if set uname val -f d_uname; eval $csym; $val; then
14413 uname() was found, but you're running xenix, and older versions of xenix
14414 have a broken uname(). If you don't really know whether your xenix is old
14415 enough to have a broken system call, use the default answer.
14420 "$define") dflt=n;;
14422 rp='Is your uname() broken?'
14425 n*) d_uname="$define"; call=uname;;
14428 echo 'uname() found.' >&4
14435 case "$d_gethname" in
14436 '') d_gethname="$undef";;
14439 '') d_uname="$undef";;
14441 case "$d_uname$d_gethname" in
14446 Every now and then someone has a $call() that lies about the hostname
14447 but can't be fixed for political or economic reasons. If you wish, I can
14448 pretend $call() isn't there and maybe compute hostname at run-time
14449 thanks to the '$phostname' command.
14452 rp="Shall I ignore $call() from now on?"
14455 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14458 case "$phostname" in
14459 '') aphostname='';;
14460 *) case "$aphostname" in
14462 *) set X $phostname
14466 file=`./loc $file $file $pth`
14467 aphostname=`echo $file $*`
14472 case "$d_uname$d_gethname" in
14475 case "$phostname" in
14477 echo "There will be no way for $package to get your hostname." >&4;;
14479 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14483 case "$d_phostname" in
14484 '') d_phostname="$undef";;
14487 : see if gethostbyaddr_r exists
14488 set gethostbyaddr_r d_gethostbyaddr_r
14490 case "$d_gethostbyaddr_r" in
14492 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14493 case "$d_gethostbyaddr_r_proto:$usethreads" in
14494 ":define") d_gethostbyaddr_r_proto=define
14495 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14499 case "$d_gethostbyaddr_r_proto" in
14501 case "$gethostbyaddr_r_proto" in
14502 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14503 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14505 case "$gethostbyaddr_r_proto" in
14506 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14507 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14509 case "$gethostbyaddr_r_proto" in
14510 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14511 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14513 case "$gethostbyaddr_r_proto" in
14514 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14515 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14517 case "$gethostbyaddr_r_proto" in
14518 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14519 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14521 case "$gethostbyaddr_r_proto" in
14522 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14523 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14525 case "$gethostbyaddr_r_proto" in
14526 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14527 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14529 case "$gethostbyaddr_r_proto" in
14530 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14531 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14533 case "$gethostbyaddr_r_proto" in
14534 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14535 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14537 case "$gethostbyaddr_r_proto" in
14538 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14539 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14541 case "$gethostbyaddr_r_proto" in
14542 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14543 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14545 case "$gethostbyaddr_r_proto" in
14546 ''|0) d_gethostbyaddr_r=undef
14547 gethostbyaddr_r_proto=0
14548 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14549 * ) case "$gethostbyaddr_r_proto" in
14550 REENTRANT_PROTO*) ;;
14551 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14553 echo "Prototype: $try" ;;
14556 *) case "$usethreads" in
14557 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14559 d_gethostbyaddr_r=undef
14560 gethostbyaddr_r_proto=0
14564 *) gethostbyaddr_r_proto=0
14568 : see if gethostbyname_r exists
14569 set gethostbyname_r d_gethostbyname_r
14571 case "$d_gethostbyname_r" in
14573 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14574 case "$d_gethostbyname_r_proto:$usethreads" in
14575 ":define") d_gethostbyname_r_proto=define
14576 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14580 case "$d_gethostbyname_r_proto" in
14582 case "$gethostbyname_r_proto" in
14583 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14584 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14586 case "$gethostbyname_r_proto" in
14587 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14588 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14590 case "$gethostbyname_r_proto" in
14591 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14592 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14594 case "$gethostbyname_r_proto" in
14595 ''|0) d_gethostbyname_r=undef
14596 gethostbyname_r_proto=0
14597 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14598 * ) case "$gethostbyname_r_proto" in
14599 REENTRANT_PROTO*) ;;
14600 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14602 echo "Prototype: $try" ;;
14605 *) case "$usethreads" in
14606 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14608 d_gethostbyname_r=undef
14609 gethostbyname_r_proto=0
14613 *) gethostbyname_r_proto=0
14617 : see if gethostent_r exists
14618 set gethostent_r d_gethostent_r
14620 case "$d_gethostent_r" in
14622 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14623 case "$d_gethostent_r_proto:$usethreads" in
14624 ":define") d_gethostent_r_proto=define
14625 set d_gethostent_r_proto gethostent_r $hdrs
14629 case "$d_gethostent_r_proto" in
14631 case "$gethostent_r_proto" in
14632 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14633 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14635 case "$gethostent_r_proto" in
14636 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14637 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14639 case "$gethostent_r_proto" in
14640 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14641 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14643 case "$gethostent_r_proto" in
14644 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14645 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14647 case "$gethostent_r_proto" in
14648 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14649 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14651 case "$gethostent_r_proto" in
14652 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14653 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14655 case "$gethostent_r_proto" in
14656 ''|0) d_gethostent_r=undef
14657 gethostent_r_proto=0
14658 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14659 * ) case "$gethostent_r_proto" in
14660 REENTRANT_PROTO*) ;;
14661 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14663 echo "Prototype: $try" ;;
14666 *) case "$usethreads" in
14667 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14669 d_gethostent_r=undef
14670 gethostent_r_proto=0
14674 *) gethostent_r_proto=0
14678 : see if prototypes for various gethostxxx netdb.h functions are available
14680 set d_gethostprotos gethostent $i_netdb netdb.h
14683 : see if getitimer exists
14684 set getitimer d_getitimer
14687 : see if getlogin exists
14688 set getlogin d_getlogin
14691 : see if getlogin_r exists
14692 set getlogin_r d_getlogin_r
14694 case "$d_getlogin_r" in
14696 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14697 case "$d_getlogin_r_proto:$usethreads" in
14698 ":define") d_getlogin_r_proto=define
14699 set d_getlogin_r_proto getlogin_r $hdrs
14703 case "$d_getlogin_r_proto" in
14705 case "$getlogin_r_proto" in
14706 ''|0) try='int getlogin_r(char*, size_t);'
14707 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14709 case "$getlogin_r_proto" in
14710 ''|0) try='int getlogin_r(char*, int);'
14711 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14713 case "$getlogin_r_proto" in
14714 ''|0) try='char* getlogin_r(char*, size_t);'
14715 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14717 case "$getlogin_r_proto" in
14718 ''|0) try='char* getlogin_r(char*, int);'
14719 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14721 case "$getlogin_r_proto" in
14722 ''|0) d_getlogin_r=undef
14724 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14725 * ) case "$getlogin_r_proto" in
14726 REENTRANT_PROTO*) ;;
14727 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14729 echo "Prototype: $try" ;;
14732 *) case "$usethreads" in
14733 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14740 *) getlogin_r_proto=0
14744 : see if getmnt exists
14745 set getmnt d_getmnt
14748 : see if getmntent exists
14749 set getmntent d_getmntent
14752 : see if getnameinfo exists
14753 set getnameinfo d_getnameinfo
14756 : see if getnetbyaddr exists
14757 set getnetbyaddr d_getnbyaddr
14760 : see if getnetbyname exists
14761 set getnetbyname d_getnbyname
14764 : see if getnetent exists
14765 set getnetent d_getnent
14768 : see if getnetbyaddr_r exists
14769 set getnetbyaddr_r d_getnetbyaddr_r
14771 case "$d_getnetbyaddr_r" in
14773 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14774 case "$d_getnetbyaddr_r_proto:$usethreads" in
14775 ":define") d_getnetbyaddr_r_proto=define
14776 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14780 case "$d_getnetbyaddr_r_proto" in
14782 case "$getnetbyaddr_r_proto" in
14783 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14784 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14786 case "$getnetbyaddr_r_proto" in
14787 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14788 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14790 case "$getnetbyaddr_r_proto" in
14791 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14792 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14794 case "$getnetbyaddr_r_proto" in
14795 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14796 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14798 case "$getnetbyaddr_r_proto" in
14799 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14800 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14802 case "$getnetbyaddr_r_proto" in
14803 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14804 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14806 case "$getnetbyaddr_r_proto" in
14807 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14808 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14810 case "$getnetbyaddr_r_proto" in
14811 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14812 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14814 case "$getnetbyaddr_r_proto" in
14815 ''|0) d_getnetbyaddr_r=undef
14816 getnetbyaddr_r_proto=0
14817 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14818 * ) case "$getnetbyaddr_r_proto" in
14819 REENTRANT_PROTO*) ;;
14820 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14822 echo "Prototype: $try" ;;
14825 *) case "$usethreads" in
14826 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14828 d_getnetbyaddr_r=undef
14829 getnetbyaddr_r_proto=0
14833 *) getnetbyaddr_r_proto=0
14837 : see if getnetbyname_r exists
14838 set getnetbyname_r d_getnetbyname_r
14840 case "$d_getnetbyname_r" in
14842 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14843 case "$d_getnetbyname_r_proto:$usethreads" in
14844 ":define") d_getnetbyname_r_proto=define
14845 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14849 case "$d_getnetbyname_r_proto" in
14851 case "$getnetbyname_r_proto" in
14852 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14853 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14855 case "$getnetbyname_r_proto" in
14856 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14857 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14859 case "$getnetbyname_r_proto" in
14860 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14861 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14863 case "$getnetbyname_r_proto" in
14864 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14865 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14867 case "$getnetbyname_r_proto" in
14868 ''|0) d_getnetbyname_r=undef
14869 getnetbyname_r_proto=0
14870 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14871 * ) case "$getnetbyname_r_proto" in
14872 REENTRANT_PROTO*) ;;
14873 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14875 echo "Prototype: $try" ;;
14878 *) case "$usethreads" in
14879 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14881 d_getnetbyname_r=undef
14882 getnetbyname_r_proto=0
14886 *) getnetbyname_r_proto=0
14890 : see if getnetent_r exists
14891 set getnetent_r d_getnetent_r
14893 case "$d_getnetent_r" in
14895 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14896 case "$d_getnetent_r_proto:$usethreads" in
14897 ":define") d_getnetent_r_proto=define
14898 set d_getnetent_r_proto getnetent_r $hdrs
14902 case "$d_getnetent_r_proto" in
14904 case "$getnetent_r_proto" in
14905 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14906 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14908 case "$getnetent_r_proto" in
14909 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14910 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14912 case "$getnetent_r_proto" in
14913 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14914 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14916 case "$getnetent_r_proto" in
14917 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14918 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14920 case "$getnetent_r_proto" in
14921 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14922 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14924 case "$getnetent_r_proto" in
14925 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14926 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14928 case "$getnetent_r_proto" in
14929 ''|0) d_getnetent_r=undef
14930 getnetent_r_proto=0
14931 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14932 * ) case "$getnetent_r_proto" in
14933 REENTRANT_PROTO*) ;;
14934 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14936 echo "Prototype: $try" ;;
14939 *) case "$usethreads" in
14940 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14942 d_getnetent_r=undef
14943 getnetent_r_proto=0
14947 *) getnetent_r_proto=0
14951 : see if prototypes for various getnetxxx netdb.h functions are available
14953 set d_getnetprotos getnetent $i_netdb netdb.h
14956 : see if getpagesize exists
14957 set getpagesize d_getpagsz
14960 : Optional checks for getprotobyname and getprotobynumber
14962 : see if getprotobyname exists
14963 set getprotobyname d_getpbyname
14966 : see if getprotobynumber exists
14967 set getprotobynumber d_getpbynumber
14970 : see if getprotoent exists
14971 set getprotoent d_getpent
14974 : see if getpgid exists
14975 set getpgid d_getpgid
14978 : see if getpgrp2 exists
14979 set getpgrp2 d_getpgrp2
14982 : see if getppid exists
14983 set getppid d_getppid
14986 : see if getpriority exists
14987 set getpriority d_getprior
14990 : see if getprotobyname_r exists
14991 set getprotobyname_r d_getprotobyname_r
14993 case "$d_getprotobyname_r" in
14995 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14996 case "$d_getprotobyname_r_proto:$usethreads" in
14997 ":define") d_getprotobyname_r_proto=define
14998 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15002 case "$d_getprotobyname_r_proto" in
15004 case "$getprotobyname_r_proto" in
15005 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15006 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15008 case "$getprotobyname_r_proto" in
15009 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15010 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15012 case "$getprotobyname_r_proto" in
15013 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15014 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15016 case "$getprotobyname_r_proto" in
15017 ''|0) d_getprotobyname_r=undef
15018 getprotobyname_r_proto=0
15019 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15020 * ) case "$getprotobyname_r_proto" in
15021 REENTRANT_PROTO*) ;;
15022 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15024 echo "Prototype: $try" ;;
15027 *) case "$usethreads" in
15028 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15030 d_getprotobyname_r=undef
15031 getprotobyname_r_proto=0
15035 *) getprotobyname_r_proto=0
15039 : see if getprotobynumber_r exists
15040 set getprotobynumber_r d_getprotobynumber_r
15042 case "$d_getprotobynumber_r" in
15044 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15045 case "$d_getprotobynumber_r_proto:$usethreads" in
15046 ":define") d_getprotobynumber_r_proto=define
15047 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15051 case "$d_getprotobynumber_r_proto" in
15053 case "$getprotobynumber_r_proto" in
15054 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15055 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15057 case "$getprotobynumber_r_proto" in
15058 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15059 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15061 case "$getprotobynumber_r_proto" in
15062 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15063 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15065 case "$getprotobynumber_r_proto" in
15066 ''|0) d_getprotobynumber_r=undef
15067 getprotobynumber_r_proto=0
15068 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15069 * ) case "$getprotobynumber_r_proto" in
15070 REENTRANT_PROTO*) ;;
15071 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15073 echo "Prototype: $try" ;;
15076 *) case "$usethreads" in
15077 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15079 d_getprotobynumber_r=undef
15080 getprotobynumber_r_proto=0
15084 *) getprotobynumber_r_proto=0
15088 : see if getprotoent_r exists
15089 set getprotoent_r d_getprotoent_r
15091 case "$d_getprotoent_r" in
15093 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15094 case "$d_getprotoent_r_proto:$usethreads" in
15095 ":define") d_getprotoent_r_proto=define
15096 set d_getprotoent_r_proto getprotoent_r $hdrs
15100 case "$d_getprotoent_r_proto" in
15102 case "$getprotoent_r_proto" in
15103 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15104 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15106 case "$getprotoent_r_proto" in
15107 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15108 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15110 case "$getprotoent_r_proto" in
15111 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15112 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15114 case "$getprotoent_r_proto" in
15115 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15116 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15118 case "$getprotoent_r_proto" in
15119 ''|0) d_getprotoent_r=undef
15120 getprotoent_r_proto=0
15121 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15122 * ) case "$getprotoent_r_proto" in
15123 REENTRANT_PROTO*) ;;
15124 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15126 echo "Prototype: $try" ;;
15129 *) case "$usethreads" in
15130 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15132 d_getprotoent_r=undef
15133 getprotoent_r_proto=0
15137 *) getprotoent_r_proto=0
15141 : see if prototypes for various getprotoxxx netdb.h functions are available
15143 set d_getprotoprotos getprotoent $i_netdb netdb.h
15146 : see if getprpwnam exists
15147 set getprpwnam d_getprpwnam
15150 : see if getpwent exists
15151 set getpwent d_getpwent
15154 : see if getpwent_r exists
15155 set getpwent_r d_getpwent_r
15157 case "$d_getpwent_r" in
15159 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15160 case "$d_getpwent_r_proto:$usethreads" in
15161 ":define") d_getpwent_r_proto=define
15162 set d_getpwent_r_proto getpwent_r $hdrs
15166 case "$d_getpwent_r_proto" in
15168 case "$getpwent_r_proto" in
15169 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15170 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15172 case "$getpwent_r_proto" in
15173 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15174 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15176 case "$getpwent_r_proto" in
15177 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15178 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15180 case "$getpwent_r_proto" in
15181 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15182 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15184 case "$getpwent_r_proto" in
15185 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15186 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15188 case "$getpwent_r_proto" in
15189 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15190 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15192 case "$getpwent_r_proto" in
15193 ''|0) d_getpwent_r=undef
15195 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15196 * ) case "$getpwent_r_proto" in
15197 REENTRANT_PROTO*) ;;
15198 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15200 echo "Prototype: $try" ;;
15203 *) case "$usethreads" in
15204 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15211 *) getpwent_r_proto=0
15215 : see if getpwnam_r exists
15216 set getpwnam_r d_getpwnam_r
15218 case "$d_getpwnam_r" in
15220 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15221 case "$d_getpwnam_r_proto:$usethreads" in
15222 ":define") d_getpwnam_r_proto=define
15223 set d_getpwnam_r_proto getpwnam_r $hdrs
15227 case "$d_getpwnam_r_proto" in
15229 case "$getpwnam_r_proto" in
15230 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15231 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15233 case "$getpwnam_r_proto" in
15234 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15235 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15237 case "$getpwnam_r_proto" in
15238 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15239 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15241 case "$getpwnam_r_proto" in
15242 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15243 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15245 case "$getpwnam_r_proto" in
15246 ''|0) d_getpwnam_r=undef
15248 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15249 * ) case "$getpwnam_r_proto" in
15250 REENTRANT_PROTO*) ;;
15251 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15253 echo "Prototype: $try" ;;
15256 *) case "$usethreads" in
15257 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15264 *) getpwnam_r_proto=0
15268 : see if getpwuid_r exists
15269 set getpwuid_r d_getpwuid_r
15271 case "$d_getpwuid_r" in
15273 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15274 case "$d_getpwuid_r_proto:$usethreads" in
15275 ":define") d_getpwuid_r_proto=define
15276 set d_getpwuid_r_proto getpwuid_r $hdrs
15280 case "$d_getpwuid_r_proto" in
15282 case "$getpwuid_r_proto" in
15283 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15284 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15286 case "$getpwuid_r_proto" in
15287 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15288 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15290 case "$getpwuid_r_proto" in
15291 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15292 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15294 case "$getpwuid_r_proto" in
15295 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15296 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15298 case "$getpwuid_r_proto" in
15299 ''|0) d_getpwuid_r=undef
15301 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15302 * ) case "$getpwuid_r_proto" in
15303 REENTRANT_PROTO*) ;;
15304 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15306 echo "Prototype: $try" ;;
15309 *) case "$usethreads" in
15310 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15317 *) getpwuid_r_proto=0
15321 : Optional checks for getsbyname and getsbyport
15323 : see if getservbyname exists
15324 set getservbyname d_getsbyname
15327 : see if getservbyport exists
15328 set getservbyport d_getsbyport
15331 : see if getservent exists
15332 set getservent d_getsent
15335 : see if getservbyname_r exists
15336 set getservbyname_r d_getservbyname_r
15338 case "$d_getservbyname_r" in
15340 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15341 case "$d_getservbyname_r_proto:$usethreads" in
15342 ":define") d_getservbyname_r_proto=define
15343 set d_getservbyname_r_proto getservbyname_r $hdrs
15347 case "$d_getservbyname_r_proto" in
15349 case "$getservbyname_r_proto" in
15350 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15351 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15353 case "$getservbyname_r_proto" in
15354 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15355 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15357 case "$getservbyname_r_proto" in
15358 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15359 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15361 case "$getservbyname_r_proto" in
15362 ''|0) d_getservbyname_r=undef
15363 getservbyname_r_proto=0
15364 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15365 * ) case "$getservbyname_r_proto" in
15366 REENTRANT_PROTO*) ;;
15367 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15369 echo "Prototype: $try" ;;
15372 *) case "$usethreads" in
15373 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15375 d_getservbyname_r=undef
15376 getservbyname_r_proto=0
15380 *) getservbyname_r_proto=0
15384 : see if getservbyport_r exists
15385 set getservbyport_r d_getservbyport_r
15387 case "$d_getservbyport_r" in
15389 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15390 case "$d_getservbyport_r_proto:$usethreads" in
15391 ":define") d_getservbyport_r_proto=define
15392 set d_getservbyport_r_proto getservbyport_r $hdrs
15396 case "$d_getservbyport_r_proto" in
15398 case "$getservbyport_r_proto" in
15399 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15400 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15402 case "$getservbyport_r_proto" in
15403 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15404 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15406 case "$getservbyport_r_proto" in
15407 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15408 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15410 case "$getservbyport_r_proto" in
15411 ''|0) d_getservbyport_r=undef
15412 getservbyport_r_proto=0
15413 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15414 * ) case "$getservbyport_r_proto" in
15415 REENTRANT_PROTO*) ;;
15416 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15418 echo "Prototype: $try" ;;
15421 *) case "$usethreads" in
15422 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15424 d_getservbyport_r=undef
15425 getservbyport_r_proto=0
15429 *) getservbyport_r_proto=0
15433 : see if getservent_r exists
15434 set getservent_r d_getservent_r
15436 case "$d_getservent_r" in
15438 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15439 case "$d_getservent_r_proto:$usethreads" in
15440 ":define") d_getservent_r_proto=define
15441 set d_getservent_r_proto getservent_r $hdrs
15445 case "$d_getservent_r_proto" in
15447 case "$getservent_r_proto" in
15448 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15449 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15451 case "$getservent_r_proto" in
15452 ''|0) try='int getservent_r(struct servent*, char*, int);'
15453 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15455 case "$getservent_r_proto" in
15456 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15457 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15459 case "$getservent_r_proto" in
15460 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15461 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15463 case "$getservent_r_proto" in
15464 ''|0) d_getservent_r=undef
15465 getservent_r_proto=0
15466 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15467 * ) case "$getservent_r_proto" in
15468 REENTRANT_PROTO*) ;;
15469 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15471 echo "Prototype: $try" ;;
15474 *) case "$usethreads" in
15475 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15477 d_getservent_r=undef
15478 getservent_r_proto=0
15482 *) getservent_r_proto=0
15486 : see if prototypes for various getservxxx netdb.h functions are available
15488 set d_getservprotos getservent $i_netdb netdb.h
15491 : see if getspnam exists
15492 set getspnam d_getspnam
15495 : see if this is a shadow.h system
15496 set shadow.h i_shadow
15499 : see if getspnam_r exists
15500 set getspnam_r d_getspnam_r
15502 case "$d_getspnam_r" in
15504 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15505 case "$d_getspnam_r_proto:$usethreads" in
15506 ":define") d_getspnam_r_proto=define
15507 set d_getspnam_r_proto getspnam_r $hdrs
15511 case "$d_getspnam_r_proto" in
15513 case "$getspnam_r_proto" in
15514 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15515 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15517 case "$getspnam_r_proto" in
15518 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15519 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15521 case "$getspnam_r_proto" in
15522 ''|0) d_getspnam_r=undef
15524 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15525 * ) case "$getspnam_r_proto" in
15526 REENTRANT_PROTO*) ;;
15527 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15529 echo "Prototype: $try" ;;
15532 *) case "$usethreads" in
15533 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15540 *) getspnam_r_proto=0
15544 : see if gettimeofday or ftime exists
15545 set gettimeofday d_gettimeod
15547 case "$d_gettimeod" in
15553 val="$undef"; set d_ftime; eval $setvar
15556 case "$d_gettimeod$d_ftime" in
15559 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15563 : see if gmtime_r exists
15564 set gmtime_r d_gmtime_r
15566 case "$d_gmtime_r" in
15568 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15569 case "$d_gmtime_r_proto:$usethreads" in
15570 ":define") d_gmtime_r_proto=define
15571 set d_gmtime_r_proto gmtime_r $hdrs
15575 case "$d_gmtime_r_proto" in
15577 case "$gmtime_r_proto" in
15578 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15579 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15581 case "$gmtime_r_proto" in
15582 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15583 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15585 case "$gmtime_r_proto" in
15586 ''|0) d_gmtime_r=undef
15588 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15589 * ) case "$gmtime_r_proto" in
15590 REENTRANT_PROTO*) ;;
15591 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15593 echo "Prototype: $try" ;;
15596 *) case "$usethreads" in
15597 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15604 *) gmtime_r_proto=0
15608 : see if hasmntopt exists
15609 set hasmntopt d_hasmntopt
15612 : see if this is a netinet/in.h or sys/in.h system
15613 set netinet/in.h i_niin sys/in.h i_sysin
15616 : see if arpa/inet.h has to be included
15617 set arpa/inet.h i_arpainet
15620 : see if htonl --and friends-- exists
15625 : Maybe they are macros.
15628 $cat >htonl.c <<EOM
15630 #include <sys/types.h>
15631 #$i_niin I_NETINET_IN
15633 #$i_arpainet I_ARPA_INET
15634 #ifdef I_NETINET_IN
15635 #include <netinet/in.h>
15638 #include <sys/in.h>
15641 #include <arpa/inet.h>
15644 printf("Defined as a macro.");
15647 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15648 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15650 echo "But it seems to be defined as a macro." >&4
15658 : see if hypot exists
15662 : see if ilogb exists
15666 : see if ilogbl exists
15667 set ilogbl d_ilogbl
15672 if set index val -f; eval $csym; $val; then
15673 if set strchr val -f d_strchr; eval $csym; $val; then
15674 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15677 echo "strchr() found." >&4
15681 echo "index() found." >&4
15686 echo "index() found." >&4
15689 if set strchr val -f d_strchr; eval $csym; $val; then
15692 echo "strchr() found." >&4
15694 echo "No index() or strchr() found!" >&4
15699 set d_strchr; eval $setvar
15701 set d_index; eval $setvar
15703 : check whether inet_aton exists
15704 set inet_aton d_inetaton
15707 : see if inet_ntop exists
15708 set inet_ntop d_inetntop
15711 : see if inet_pton exists
15712 set inet_pton d_inetpton
15717 $cat >isascii.c <<EOCP
15720 #$i_stdlib I_STDLIB
15722 #include <stdlib.h>
15733 if eval $compile; then
15734 echo "isascii() found." >&4
15737 echo "isascii() NOT found." >&4
15746 $cat >isblank.c <<'EOCP'
15757 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15758 echo "isblank() found." >&4
15761 echo "isblank() NOT found." >&4
15768 : check for isfinite
15769 echo "Checking to see if you have isfinite..." >&4
15775 int main() { return isfinite(0.0); }
15778 if eval $compile; then
15780 echo "You have isfinite."
15783 echo "You do not have isfinite."
15789 : see if isfinitel exists
15790 set isfinitel d_isfinitel
15794 echo "Checking to see if you have isinf..." >&4
15800 int main() { return isinf(0.0); }
15803 if eval $compile; then
15805 echo "You have isinf."
15808 echo "You do not have isinf."
15814 : see if isinfl exists
15815 set isinfl d_isinfl
15819 echo "Checking to see if you have isless..." >&4
15825 int main() { return isless(0.0); }
15828 if eval $compile; then
15830 echo "You have isless."
15833 echo "You do not have isless."
15840 echo "Checking to see if you have isnan..." >&4
15846 int main() { return isnan(0.0); }
15849 if eval $compile; then
15851 echo "You have isnan."
15854 echo "You do not have isnan."
15860 : see if isnanl exists
15861 set isnanl d_isnanl
15864 : check for isnormal
15865 echo "Checking to see if you have isnormal..." >&4
15871 int main() { return isnormal(0.0); }
15874 if eval $compile; then
15876 echo "You have isnormal."
15879 echo "You do not have isnormal."
15889 : see if j0l exists
15893 : see if killpg exists
15894 set killpg d_killpg
15897 : see if localeconv exists
15898 set localeconv d_locconv
15901 : see if libc has the POSIX.1-2008 currency locale rules
15902 case "$d_locconv:$d_lc_monetary_2008" in
15905 #include <locale.h>
15907 struct lconv *lc = localeconv();
15908 char int_p_cs_precedes = lc->int_p_cs_precedes;
15913 if eval $compile; then
15914 d_lc_monetary_2008="$define"
15916 d_lc_monetary_2008="$undef"
15922 : see if lchown exists
15924 $cat > try.c <<'EOCP'
15925 /* System header to define __stub macros and hopefully few prototypes,
15926 which can conflict with char lchown(); below. */
15927 #include <assert.h>
15928 /* Override any gcc2 internal prototype to avoid an error. */
15929 /* We use char because int might match the return type of a gcc2
15930 builtin and then its argument prototype would still apply. */
15933 /* The GNU C library defines this for functions which it implements
15934 to always fail with ENOSYS. Some functions are actually named
15935 something starting with __ and the normal name is an alias. */
15936 #if defined (__stub_lchown) || defined (__stub___lchown)
15944 if eval $compile; then
15945 $echo "lchown() found." >&4
15948 $echo "lchown() NOT found." >&4
15954 : See if number of significant digits in a double precision number is known
15956 $cat >ldbl_dig.c <<EOM
15957 #$i_limits I_LIMITS
15960 #include <limits.h>
15966 printf("Contains LDBL_DIG");
15969 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15970 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15971 echo "LDBL_DIG found." >&4
15974 echo "LDBL_DIG NOT found." >&4
15981 : see if lgamma exists
15982 set lgamma d_lgamma
15985 : see if lgamma_r exists
15986 set lgamma_r d_lgamma_r
15989 : check to see if math.h defines _LIB_VERSION
15990 d_libm_lib_version="$undef"
15994 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15996 #include <unistd.h>
15998 int main (int argc, char *argv[])
16000 printf ("%d\n", _LIB_VERSION);
16005 if eval $compile; then
16007 echo "Yes, it does ($foo)" >&4
16008 d_libm_lib_version="$define"
16010 echo "No, it does not (probably harmless)" >&4
16017 : see if link exists
16021 : see if llrint exists
16022 set llrint d_llrint
16025 : see if llrintl exists
16026 set llrintl d_llrintl
16029 : see if llround exists
16030 set llround d_llround
16033 : see if llroundl exists
16034 set llroundl d_llroundl
16037 : see if localtime_r exists
16038 set localtime_r d_localtime_r
16040 case "$d_localtime_r" in
16042 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16043 case "$d_localtime_r_proto:$usethreads" in
16044 ":define") d_localtime_r_proto=define
16045 set d_localtime_r_proto localtime_r $hdrs
16049 case "$d_localtime_r_proto" in
16051 case "$localtime_r_proto" in
16052 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16053 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16055 case "$localtime_r_proto" in
16056 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16057 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16059 case "$localtime_r_proto" in
16060 ''|0) d_localtime_r=undef
16061 localtime_r_proto=0
16062 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16063 * ) case "$localtime_r_proto" in
16064 REENTRANT_PROTO*) ;;
16065 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16067 echo "Prototype: $try" ;;
16070 *) case "$usethreads" in
16071 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16073 d_localtime_r=undef
16074 localtime_r_proto=0
16078 *) localtime_r_proto=0
16082 : see if localtime_r calls tzset
16083 case "$localtime_r_proto" in
16086 /* Does our libc's localtime_r call tzset ?
16087 * return 0 if so, 1 otherwise.
16089 #$i_systypes I_SYS_TYPES
16090 #$i_unistd I_UNISTD
16092 #$i_stdlib I_STDLIB
16093 #$i_string I_STRING
16094 #$i_malloc I_MALLOC
16096 # include <sys/types.h>
16099 # include <unistd.h>
16105 #include <stdlib.h>
16108 # include <string.h>
16110 # include <strings.h>
16113 # include <malloc.h>
16117 time_t t = time(0L);
16118 char w_tz[]="TZ" "=GMT+5",
16119 e_tz[]="TZ" "=GMT-5",
16120 *tz_e = (char*)malloc(16),
16121 *tz_w = (char*)malloc(16);
16122 struct tm tm_e, tm_w;
16123 memset(&tm_e,'\0',sizeof(struct tm));
16124 memset(&tm_w,'\0',sizeof(struct tm));
16129 localtime_r(&t, &tm_e);
16132 localtime_r(&t, &tm_w);
16134 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16140 if eval $compile; then
16141 if $run ./try; then
16142 d_localtime_r_needs_tzset=undef;
16144 d_localtime_r_needs_tzset=define;
16147 d_localtime_r_needs_tzset=undef;
16151 d_localtime_r_needs_tzset=undef;
16156 : see if lockf exists
16160 : see if log1p exists
16164 : see if log2 exists
16168 : see if logb exists
16172 : see if lrint exists
16176 : see if lrintl exists
16177 set lrintl d_lrintl
16180 : see if lround exists
16181 set lround d_lround
16184 : see if lroundl exists
16185 set lroundl d_lroundl
16188 : see if prototype for lseek is available
16190 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16193 : see if lstat exists
16197 : see if madvise exists
16198 set madvise d_madvise
16201 : see if malloc_size exists
16202 set malloc_size d_malloc_size
16205 : see if malloc_size_good exists
16206 set malloc_good_size d_malloc_good_size
16209 : see if mblen exists
16213 : see if mbstowcs exists
16214 set mbstowcs d_mbstowcs
16217 : see if mbtowc exists
16218 set mbtowc d_mbtowc
16221 : see if memchr exists
16222 set memchr d_memchr
16225 : see if memcmp exists
16226 set memcmp d_memcmp
16229 : see if memcpy exists
16230 set memcpy d_memcpy
16233 : see if memmove exists
16234 set memmove d_memmove
16237 : see if memset exists
16238 set memset d_memset
16241 : see if mkdir exists
16245 : see if mkdtemp exists
16246 set mkdtemp d_mkdtemp
16249 : see if mkfifo exists
16250 set mkfifo d_mkfifo
16253 : see if mkstemp exists
16254 set mkstemp d_mkstemp
16257 : see if mkstemps exists
16258 set mkstemps d_mkstemps
16261 : see if mktime exists
16262 set mktime d_mktime
16265 : see if this is a sys/mman.h system
16266 set sys/mman.h i_sysmman
16269 : see if mmap exists
16272 : see what shmat returns
16273 : default to something harmless
16275 case "$i_sysmman$d_mmap" in
16277 $cat >mmap.c <<'END'
16278 #include <sys/mman.h>
16281 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16286 echo "and it returns ($mmaptype)." >&4
16292 : see if sqrtl exists
16296 : see if scalbnl exists
16297 set scalbnl d_scalbnl
16300 : see if truncl exists
16301 set truncl d_truncl
16304 : see if modfl exists
16308 : see if prototype for modfl is available
16310 set d_modflproto modfl $i_math math.h
16313 d_modfl_pow32_bug="$undef"
16315 case "$d_longdbl$d_modfl" in
16318 Checking to see whether your modfl() is okay for large values...
16324 if $test "X$d_modflproto" != "X$define"; then
16325 $cat >>try.c <<EOCP
16326 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16327 long double modfl (long double, long double *);
16330 $cat >>try.c <<EOCP
16332 long double nv = 4294967303.15;
16338 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16342 case "$osname:$gccversion" in
16343 aix:) saveccflags="$ccflags"
16344 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16347 if eval $compile; then
16350 *" 4294967303.150000 1.150000 4294967302.000000")
16351 echo >&4 "Your modfl() is broken for large values."
16352 d_modfl_pow32_bug="$define"
16354 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16358 *" 4294967303.150000 0.150000 4294967303.000000")
16359 echo >&4 "Your modfl() seems okay for large values."
16361 *) echo >&4 "I don't understand your modfl() at all."
16367 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16370 case "$osname:$gccversion" in
16371 aix:) ccflags="$saveccflags" ;; # restore
16376 if $test "$uselongdouble" = "$define"; then
16378 if $test "$d_sqrtl" != "$define"; then
16379 message="$message sqrtl"
16381 if $test "$d_modfl" != "$define"; then
16382 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16383 echo "You have both truncl and copysignl, so I can emulate modfl."
16385 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16386 echo "You have both aintl and copysignl, so I can emulate modfl."
16388 message="$message modfl"
16392 if $test "$d_frexpl" != "$define"; then
16393 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16394 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16396 message="$message frexpl"
16399 if $test "$d_ldexpl" != "$define"; then
16400 message="$message ldexpl"
16403 if $test "$message" != ""; then
16406 *** You requested the use of long doubles but you do not seem to have
16407 *** the following mathematical functions needed for long double support:
16409 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16410 *** Cannot continue, aborting.
16418 : see if mprotect exists
16419 set mprotect d_mprotect
16422 : see if msgctl exists
16423 set msgctl d_msgctl
16426 : see if msgget exists
16427 set msgget d_msgget
16430 : see if msgsnd exists
16431 set msgsnd d_msgsnd
16434 : see if msgrcv exists
16435 set msgrcv d_msgrcv
16438 : see how much of the 'msg*(2)' library is present.
16441 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16442 *"$undef"*) h_msg=false;;
16446 case "`ipcs 2>&1`" in
16447 "SVID messages"*"not configured"*)
16448 echo "Your $osname does not have the msg*(2) configured." >&4
16451 set msgctl d_msgctl
16453 set msgget d_msgget
16455 set msgsnd d_msgsnd
16457 set msgrcv d_msgrcv
16463 : we could also check for sys/ipc.h ...
16464 if $h_msg && $test `./findhdr sys/msg.h`; then
16465 echo "You have the full msg*(2) library." >&4
16468 echo "You don't have the full msg*(2) library." >&4
16474 : Check for msghdr_s
16476 echo "Checking to see if your system supports struct msghdr..." >&4
16477 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16479 case "$d_msghdr_s" in
16480 "$define") echo "Yes, it does." ;;
16481 *) echo "No, it doesn't." ;;
16485 : see if msync exists
16489 : see if munmap exists
16490 set munmap d_munmap
16493 : see if nan exists
16497 : see if nearbyint exists
16498 set nearbyint d_nearbyint
16501 : see if nextafter exists
16502 set nextafter d_nextafter
16505 : see if nexttoward exists
16506 set nexttoward d_nexttoward
16509 : see if nice exists
16513 : see if this is a langinfo.h system
16514 set langinfo.h i_langinfo
16517 : see if nl_langinfo exists
16518 set nl_langinfo d_nl_langinfo
16521 : see if this is a quadmath.h system
16522 set quadmath.h i_quadmath
16525 : check for volatile keyword
16527 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16528 $cat >try.c <<'EOCP'
16531 typedef struct _goo_struct goo_struct;
16532 goo_struct * volatile goo = ((goo_struct *)0);
16533 struct _goo_struct {
16538 typedef unsigned short foo_t;
16539 char *volatile foo;
16541 volatile foo_t blech;
16545 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16547 echo "Yup, it does."
16550 echo "Nope, it doesn't."
16556 : Check basic sizes
16558 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16560 case "$use64bitint:$d_quad:$quadtype" in
16563 uvtype="$uquadtype"
16568 uvtype="unsigned long"
16574 case "$uselongdouble:$d_longdbl" in
16576 nvtype="long double"
16577 nvsize=$longdblsize
16584 case "$usequadmath:$i_quadmath" in
16586 nvtype="__float128"
16592 *** You requested the use of the quadmath library, but you
16593 *** do not seem to have the quadmath library installed.
16594 *** Cannot continue, aborting.
16600 define:*) $cat <<EOM >&4
16602 *** You requested the use of the quadmath library, but you
16603 *** do not seem to have the required header, <quadmath.h>.
16605 case "$gccversion" in
16608 *** Your gcc looks a bit old:
16614 *** You are not running a gcc.
16619 *** For the quadmath library you need at least gcc 4.6.
16620 *** Cannot continue, aborting.
16626 $echo "(IV will be "$ivtype", $ivsize bytes)"
16627 $echo "(UV will be "$uvtype", $uvsize bytes)"
16628 $echo "(NV will be "$nvtype", $nvsize bytes)"
16631 #$i_inttypes I_INTTYPES
16633 #include <inttypes.h>
16638 int8_t i = INT8_MAX;
16639 uint8_t u = UINT8_MAX;
16640 printf("int8_t\n");
16643 int16_t i = INT16_MAX;
16644 uint16_t u = UINT16_MAX;
16645 printf("int16_t\n");
16648 int32_t i = INT32_MAX;
16649 uint32_t u = UINT32_MAX;
16650 printf("int32_t\n");
16655 i8type="signed char"
16656 u8type="unsigned char"
16661 '') case "$shortsize" in
16663 u16type="unsigned short"
16671 '') set try -DINT16
16672 if eval $compile; then
16673 case "`$run ./try`" in
16685 '') if $test $shortsize -ge 2; then
16687 u16type="unsigned short"
16695 '') case "$longsize" in
16697 u32type="unsigned long"
16701 *) case "$intsize" in
16703 u32type="unsigned int"
16713 '') set try -DINT32
16714 if eval $compile; then
16715 case "`$run ./try`" in
16727 '') if $test $intsize -ge 4; then
16729 u32type="unsigned int"
16737 '') case "$d_quad:$quadtype" in
16739 i64type="$quadtype"
16740 u64type="$uquadtype"
16748 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16749 : volatile so that the compiler has to store it out to memory.
16750 if test X"$d_volatile" = X"$define"; then
16755 #$i_stdlib I_STDLIB
16757 #include <stdlib.h>
16759 #include <sys/types.h>
16760 #include <signal.h>
16762 $volatile int bletched = 0;
16763 $signal_t blech(int s) { bletched = 1; }
16768 int n = 8 * $uvsize;
16771 signal(SIGFPE, blech);
16774 for (i = 0; i < n; i++) {
16775 u = u << 1 | ($uvtype)1;
16777 if (($uvtype)d != u)
16781 d = ($nvtype)(u - 1);
16782 if (($uvtype)d != (u - 1))
16789 printf("%d\n", ((i == n) ? -n : i));
16795 d_nv_preserves_uv="$undef"
16796 if eval $compile; then
16797 nv_preserves_uv_bits="`$run ./try`"
16799 case "$nv_preserves_uv_bits" in
16801 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16802 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16803 d_nv_preserves_uv="$define"
16805 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16806 d_nv_preserves_uv="$undef" ;;
16807 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16808 nv_preserves_uv_bits="0" ;;
16812 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16813 : volatile so that the compiler has to store it out to memory.
16814 if test X"$d_volatile" = X"$define"; then
16820 typedef $nvtype NV;
16827 while(count < 256) {
16828 $volatile NV up = value + 1.0;
16829 $volatile NV negated = -value;
16830 $volatile NV down = negated - 1.0;
16831 $volatile NV got_up = up - value;
16832 int up_good = got_up == 1.0;
16833 int got_down = down - negated;
16834 int down_good = got_down == -1.0;
16836 if (down_good != up_good) {
16838 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16839 up_good, (double) got_up, down_good, (double) got_down,
16840 count, (double) value);
16847 fputs("256.0", stdout);
16850 fputs("2.0", stdout);
16856 fputs("*", stdout);
16862 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16863 count, (double) value);
16869 nv_overflows_integers_at='0'
16870 if eval $compile; then
16876 The largest integer your NVs can preserve is equal to $xxx
16878 nv_overflows_integers_at="$xxx"
16881 Cannot determine the largest integer value your NVs can hold, unexpected output
16888 Cannot determine the largest integer value your NVs can hold
16895 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16896 : volatile so that the compiler has to store it out to memory.
16897 if test X"$d_volatile" = X"$define"; then
16902 #$i_stdlib I_STDLIB
16904 #include <stdlib.h>
16906 #$i_string I_STRING
16908 # include <string.h>
16910 # include <strings.h>
16912 #include <sys/types.h>
16913 #include <signal.h>
16915 $volatile int bletched = 0;
16916 $signal_t blech(int s) { bletched = 1; }
16919 int checkit($nvtype d, char *where) {
16920 unsigned char *p = (char *)&d;
16921 unsigned char *end = p + sizeof(d);
16931 printf("No - %s: 0x", where);
16933 printf ("%02X", *p++);
16938 int main(int argc, char **argv) {
16941 fail += checkit(d, "0.0");
16943 /* The compiler shouldn't be assuming that bletched is 0 */
16946 fail += checkit(d, "bleched");
16949 signal(SIGFPE, blech);
16952 /* Paranoia - the compiler should have no way of knowing that ANSI says
16953 that argv[argc] will always be NULL. Actually, if it did assume this it
16954 would be buggy, as this is C and main() can be called from elsewhere in
16956 d = argv[argc] ? 1 : 0;
16959 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16962 fail += checkit(d, "ternary");
16964 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16967 printf("No - memset doesn't give 0.0\n");
16968 /* This might just blow up: */
16969 printf("(gives %g)\n", d);
16975 printf("No - something bleched\n");
16980 printf("No - %d fail(s)\n", fail);
16989 d_nv_zero_is_allbits_zero="$undef"
16990 if eval $compile; then
16996 0.0 is represented as all bits zero in memory
16998 d_nv_zero_is_allbits_zero="$define"
17001 0.0 is not represented as all bits zero in memory
17003 d_nv_zero_is_allbits_zero="$undef"
17008 0.0 is not represented as all bits zero in memory
17010 d_nv_zero_is_allbits_zero="$undef"
17016 : check for off64_t
17018 echo "Checking to see if you have off64_t..." >&4
17020 #include <sys/types.h>
17021 #include <unistd.h>
17022 int main() { off64_t x = 7; }
17025 if eval $compile; then
17027 echo "You have off64_t."
17030 echo "You do not have off64_t."
17031 case "$lseeksize" in
17032 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17039 : how to create joinable pthreads
17040 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17042 echo "Checking what constant to use for creating joinable pthreads..." >&4
17043 $cat >try.c <<'EOCP'
17044 #include <pthread.h>
17046 int detachstate = JOINABLE;
17049 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17050 if eval $compile; then
17051 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17052 val="$undef" # Yes, undef.
17053 set d_old_pthread_create_joinable
17056 set old_pthread_create_joinable
17059 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17060 if eval $compile; then
17061 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17063 set d_old_pthread_create_joinable
17065 val=PTHREAD_CREATE_UNDETACHED
17066 set old_pthread_create_joinable
17069 set try -DJOINABLE=__UNDETACHED
17070 if eval $compile; then
17071 echo "You seem to use __UNDETACHED." >&4
17073 set d_old_pthread_create_joinable
17076 set old_pthread_create_joinable
17079 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17081 set d_old_pthread_create_joinable
17084 set old_pthread_create_joinable
17091 d_old_pthread_create_joinable="$undef"
17092 old_pthread_create_joinable=""
17095 : see if pause exists
17099 : see if poll exists
17103 : see if prctl exists
17107 : see if prctl supports PR_SET_NAME
17108 d_prctl_set_name=$undef
17113 #include <unistd.h>
17115 #include <sys/prctl.h>
17117 int main (int argc, char *argv[])
17119 return (prctl (PR_SET_NAME, "Test"));
17123 if eval $compile_ok && $run ./try; then
17124 echo "Your prctl (PR_SET_NAME, ...) works"
17125 d_prctl_set_name=$define
17131 : see if readlink exists
17132 set readlink d_readlink
17135 : Check if exe is symlink to abs path of executing program
17139 case "$d_readlink" in
17141 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
17142 : more tidy to avoid an extra level of symlink
17143 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17144 while test $# -gt 0; do
17147 if $issymlink $try; then
17148 $ls -l $try > reflect
17149 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17150 echo "You have $type-like $try."
17151 procselfexe='"'$try'"'
17153 : This will break out of the loop
17164 : backward compatibility for d_hvfork
17165 if test X$d_hvfork != X; then
17166 d_vfork="$d_hvfork"
17169 : see if there is a vfork
17174 d_pseudofork=$undef
17176 : Ok, but do we want to use it. vfork is reportedly unreliable in
17177 : perl on Solaris 2.x, and probably elsewhere.
17181 case "$usevfork" in
17187 Perl can only use a vfork() that doesn't suffer from strict
17188 restrictions on calling functions or modifying global data in
17189 the child. For example, glibc-2.1 contains such a vfork()
17190 that is unsuitable. If your system provides a proper fork()
17191 call, chances are that you do NOT want perl to use vfork().
17194 rp="Do you still want to use vfork()?"
17199 echo "Ok, we won't use vfork()."
17208 $define) usevfork='true';;
17209 *) usevfork='false';;
17212 : see whether the pthread_atfork exists
17214 #include <pthread.h>
17217 #ifdef PTHREAD_ATFORK
17218 pthread_atfork(NULL,NULL,NULL);
17223 : see if pthread_atfork exists
17224 set try -DPTHREAD_ATFORK
17225 if eval $compile; then
17230 case "$usethreads" in
17233 $define) echo 'pthread_atfork found.' >&4 ;;
17234 *) echo 'pthread_atfork NOT found.' >&4 ;;
17237 set d_pthread_atfork
17240 : see if pthread_attr_setscope exists
17241 set pthread_attr_setscope d_pthread_attr_setscope
17244 : see whether the various POSIXish _yields exist
17246 #include <pthread.h>
17252 #ifdef PTHREAD_YIELD
17255 #ifdef PTHREAD_YIELD_NULL
17256 pthread_yield(NULL);
17262 : see if sched_yield exists
17263 set try -DSCHED_YIELD
17264 if eval $compile; then
17266 sched_yield='sched_yield()'
17270 case "$usethreads" in
17273 $define) echo 'sched_yield() found.' >&4 ;;
17274 *) echo 'sched_yield() NOT found.' >&4 ;;
17280 : see if pthread_yield exists
17281 set try -DPTHREAD_YIELD
17282 if eval $compile; then
17284 case "$sched_yield" in
17285 '') sched_yield='pthread_yield()' ;;
17288 set try -DPTHREAD_YIELD_NULL
17289 if eval $compile; then
17291 case "$sched_yield" in
17292 '') sched_yield='pthread_yield(NULL)' ;;
17298 case "$usethreads" in
17301 $define) echo 'pthread_yield() found.' >&4 ;;
17302 *) echo 'pthread_yield() NOT found.' >&4 ;;
17306 set d_pthread_yield
17308 case "$sched_yield" in
17309 '') sched_yield=undef ;;
17313 : check for ptrdiff_t
17315 echo "Checking to see if you have ptrdiff_t..." >&4
17317 #include <stddef.h>
17318 int main() { ptrdiff_t x = 7; }
17321 if eval $compile; then
17323 echo "You have ptrdiff_t."
17326 echo "You do not have ptrdiff_t."
17332 : see if random_r exists
17333 set random_r d_random_r
17335 case "$d_random_r" in
17337 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17338 case "$d_random_r_proto:$usethreads" in
17339 ":define") d_random_r_proto=define
17340 set d_random_r_proto random_r $hdrs
17344 case "$d_random_r_proto" in
17346 case "$random_r_proto" in
17347 ''|0) try='int random_r(int*, struct random_data*);'
17348 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17350 case "$random_r_proto" in
17351 ''|0) try='int random_r(long*, struct random_data*);'
17352 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17354 case "$random_r_proto" in
17355 ''|0) try='int random_r(struct random_data*, int32_t*);'
17356 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17358 case "$random_r_proto" in
17359 ''|0) d_random_r=undef
17361 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17362 * ) case "$random_r_proto" in
17363 REENTRANT_PROTO*) ;;
17364 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17366 echo "Prototype: $try" ;;
17369 *) case "$usethreads" in
17370 define) echo "random_r has no prototype, not using it." >&4 ;;
17377 *) random_r_proto=0
17381 : see if readdir and friends exist
17382 set readdir d_readdir
17384 set seekdir d_seekdir
17386 set telldir d_telldir
17388 set rewinddir d_rewinddir
17391 : see if readdir64_r exists
17392 set readdir64_r d_readdir64_r
17394 case "$d_readdir64_r" in
17396 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17397 case "$d_readdir64_r_proto:$usethreads" in
17398 ":define") d_readdir64_r_proto=define
17399 set d_readdir64_r_proto readdir64_r $hdrs
17403 case "$d_readdir64_r_proto" in
17405 case "$readdir64_r_proto" in
17406 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17407 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17409 case "$readdir64_r_proto" in
17410 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17411 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17413 case "$readdir64_r_proto" in
17414 ''|0) d_readdir64_r=undef
17415 readdir64_r_proto=0
17416 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17417 * ) case "$readdir64_r_proto" in
17418 REENTRANT_PROTO*) ;;
17419 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17421 echo "Prototype: $try" ;;
17424 *) case "$usethreads" in
17425 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17427 d_readdir64_r=undef
17428 readdir64_r_proto=0
17432 *) readdir64_r_proto=0
17436 : see if readdir_r exists
17437 set readdir_r d_readdir_r
17439 case "$d_readdir_r" in
17441 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17442 case "$d_readdir_r_proto:$usethreads" in
17443 ":define") d_readdir_r_proto=define
17444 set d_readdir_r_proto readdir_r $hdrs
17448 case "$d_readdir_r_proto" in
17450 case "$readdir_r_proto" in
17451 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17452 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17454 case "$readdir_r_proto" in
17455 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17456 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17458 case "$readdir_r_proto" in
17459 ''|0) d_readdir_r=undef
17461 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17462 * ) case "$readdir_r_proto" in
17463 REENTRANT_PROTO*) ;;
17464 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17466 echo "Prototype: $try" ;;
17469 *) case "$usethreads" in
17470 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17477 *) readdir_r_proto=0
17481 : see if readv exists
17485 : see if recvmsg exists
17486 set recvmsg d_recvmsg
17489 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17491 if set regcomp val -f d_regcomp; eval $csym; $val; then
17492 echo 'regcomp() found.' >&4
17493 d_regcomp="$define"
17496 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17497 echo 'regcmp() found.' >&4
17501 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17502 echo 're_comp() found, assuming re_exec() also exists.' >&4
17503 d_re_comp="$define"
17508 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17515 : see if remainder exists
17516 set remainder d_remainder
17519 : see if remquo exists
17520 set remquo d_remquo
17523 : see if rename exists
17524 set rename d_rename
17527 : see if rint exists
17531 : see if rmdir exists
17535 : see if round exists
17539 : see if memory.h is available.
17544 : See if it conflicts with string.h
17550 $cppstdin $cppflags $cppminus < $strings > mem.h
17551 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17553 echo "We won't be including <memory.h>."
17563 : can bcopy handle overlapping blocks?
17566 case "$d_memmove" in
17567 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17568 *) case "$d_bcopy" in
17570 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17572 #$i_memory I_MEMORY
17573 #$i_stdlib I_STDLIB
17574 #$i_string I_STRING
17575 #$i_unistd I_UNISTD
17577 $cat >>try.c <<'EOCP'
17580 # include <memory.h>
17583 # include <stdlib.h>
17586 # include <string.h>
17588 # include <strings.h>
17591 # include <unistd.h> /* Needed for NetBSD */
17595 char buf[128], abc[128];
17601 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17602 try to store the string in read-only memory. */
17603 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17605 for (align = 7; align >= 0; align--) {
17606 for (len = 36; len; len--) {
17608 bcopy(abc, b, len);
17609 for (off = 1; off <= len; off++) {
17610 bcopy(b, b+off, len);
17611 bcopy(b+off, b, len);
17612 if (bcmp(b, abc, len))
17621 if eval $compile_ok; then
17622 if $run ./try 2>/dev/null; then
17623 echo "Yes, it can."
17626 echo "It can't, sorry."
17629 echo "(I can't compile the test program, so we'll assume not...)"
17639 : can memcpy handle overlapping blocks?
17642 case "$d_memmove" in
17643 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17644 *) case "$d_memcpy" in
17646 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17648 #$i_memory I_MEMORY
17649 #$i_stdlib I_STDLIB
17650 #$i_string I_STRING
17651 #$i_unistd I_UNISTD
17653 $cat >>try.c <<'EOCP'
17656 # include <memory.h>
17659 # include <stdlib.h>
17662 # include <string.h>
17664 # include <strings.h>
17667 # include <unistd.h> /* Needed for NetBSD */
17671 char buf[128], abc[128];
17677 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17678 try to store the string in read-only memory. */
17679 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17681 for (align = 7; align >= 0; align--) {
17682 for (len = 36; len; len--) {
17684 memcpy(b, abc, len);
17685 for (off = 1; off <= len; off++) {
17686 memcpy(b+off, b, len);
17687 memcpy(b, b+off, len);
17688 if (memcmp(b, abc, len))
17697 if eval $compile_ok; then
17698 if $run ./try 2>/dev/null; then
17699 echo "Yes, it can."
17702 echo "It can't, sorry."
17705 echo "(I can't compile the test program, so we'll assume not...)"
17715 : can memcmp be trusted to compare relative magnitude?
17717 case "$d_memcmp" in
17720 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17722 #$i_memory I_MEMORY
17723 #$i_stdlib I_STDLIB
17724 #$i_string I_STRING
17725 #$i_unistd I_UNISTD
17727 $cat >>try.c <<'EOCP'
17730 # include <memory.h>
17733 # include <stdlib.h>
17736 # include <string.h>
17738 # include <strings.h>
17741 # include <unistd.h> /* Needed for NetBSD */
17747 if ((a < b) && memcmp(&a, &b, 1) < 0)
17753 if eval $compile_ok; then
17754 if $run ./try 2>/dev/null; then
17755 echo "Yes, it can."
17758 echo "No, it can't (it uses signed chars)."
17761 echo "(I can't compile the test program, so we'll assume not...)"
17769 : see if prototype for sbrk is available
17771 set d_sbrkproto sbrk $i_unistd unistd.h
17774 : see if scalbn exists
17775 set scalbn d_scalbn
17778 : see if select exists
17779 set select d_select
17782 : see if semctl exists
17783 set semctl d_semctl
17786 : see if semget exists
17787 set semget d_semget
17790 : see if semop exists
17794 : see how much of the 'sem*(2)' library is present.
17797 case "$d_semctl$d_semget$d_semop" in
17798 *"$undef"*) h_sem=false;;
17802 case "`ipcs 2>&1`" in
17803 "SVID messages"*"not configured"*)
17804 echo "Your $osname does not have the sem*(2) configured." >&4
17807 set semctl d_semctl
17809 set semget d_semget
17817 : we could also check for sys/ipc.h ...
17818 if $h_sem && $test `./findhdr sys/sem.h`; then
17819 echo "You have the full sem*(2) library." >&4
17822 echo "You don't have the full sem*(2) library." >&4
17828 : see whether sys/sem.h defines union semun
17830 $cat > try.c <<'END'
17831 #include <sys/types.h>
17832 #include <sys/ipc.h>
17833 #include <sys/sem.h>
17834 int main () { union semun semun; semun.buf = 0; }
17837 if eval $compile; then
17838 echo "You have union semun in <sys/sem.h>." >&4
17841 echo "You do not have union semun in <sys/sem.h>." >&4
17848 : see how to do semctl IPC_STAT
17852 $cat > tryh.h <<END
17855 # define S_IRUSR S_IREAD
17856 # define S_IWUSR S_IWRITE
17857 # define S_IXUSR S_IEXEC
17859 # define S_IRUSR 0400
17860 # define S_IWUSR 0200
17861 # define S_IXUSR 0100
17863 # define S_IRGRP (S_IRUSR>>3)
17864 # define S_IWGRP (S_IWUSR>>3)
17865 # define S_IXGRP (S_IXUSR>>3)
17866 # define S_IROTH (S_IRUSR>>6)
17867 # define S_IWOTH (S_IWUSR>>6)
17868 # define S_IXOTH (S_IXUSR>>6)
17871 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17872 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17873 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17876 : see whether semctl IPC_STAT can use union semun
17877 case "$d_semctl_semun" in
17881 #include <sys/types.h>
17882 #include <sys/ipc.h>
17883 #include <sys/sem.h>
17884 #include <sys/stat.h>
17891 #$d_union_semun HAS_UNION_SEMUN
17894 #ifndef HAS_UNION_SEMUN
17897 struct semid_ds *buf;
17898 unsigned short *array;
17904 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17905 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17907 struct semid_ds argbuf;
17910 st = semctl(sem, 0, IPC_STAT, arg);
17914 # endif /* IPC_STAT */
17915 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17917 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17918 # endif /* IPC_RMID */
17919 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17921 #endif /* IPC_PRIVATE && ... */
17922 printf("semget failed: errno = %d\n", errno);
17927 if eval $compile; then
17930 semun) val="$define" ;;
17938 case "$d_semctl_semun" in
17940 echo "You can use union semun for semctl IPC_STAT." >&4
17943 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17948 : see whether semctl IPC_STAT can use struct semid_ds pointer
17949 case "$d_semctl_semid_ds" in
17952 $cat > try.c <<'END'
17953 #include <sys/types.h>
17954 #include <sys/ipc.h>
17955 #include <sys/sem.h>
17956 #include <sys/stat.h>
17964 struct semid_ds arg;
17967 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17968 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17971 st = semctl(sem, 0, IPC_STAT, &arg);
17973 printf("semid_ds\n");
17975 # endif /* IPC_STAT */
17976 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17978 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17979 # endif /* IPC_RMID */
17980 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17982 #endif /* IPC_PRIVATE && ... */
17983 printf("semget failed: errno = %d\n", errno);
17989 if eval $compile; then
17992 semid_ds) val="$define" ;;
17996 set d_semctl_semid_ds
18000 case "$d_semctl_semid_ds" in
18002 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18004 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18010 # We do not have the full sem*(2) library, so assume we can not
18016 set d_semctl_semid_ds
18022 : see if sendmsg exists
18023 set sendmsg d_sendmsg
18026 : see if setegid exists
18027 set setegid d_setegid
18030 : see if seteuid exists
18031 set seteuid d_seteuid
18034 : see if setgrent exists
18035 set setgrent d_setgrent
18038 : see if setgrent_r exists
18039 set setgrent_r d_setgrent_r
18041 case "$d_setgrent_r" in
18043 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18044 case "$d_setgrent_r_proto:$usethreads" in
18045 ":define") d_setgrent_r_proto=define
18046 set d_setgrent_r_proto setgrent_r $hdrs
18050 case "$d_setgrent_r_proto" in
18052 case "$setgrent_r_proto" in
18053 ''|0) try='int setgrent_r(FILE**);'
18054 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18056 case "$setgrent_r_proto" in
18057 ''|0) try='void setgrent_r(FILE**);'
18058 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18060 case "$setgrent_r_proto" in
18061 ''|0) d_setgrent_r=undef
18063 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18064 * ) case "$setgrent_r_proto" in
18065 REENTRANT_PROTO*) ;;
18066 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18068 echo "Prototype: $try" ;;
18071 *) case "$usethreads" in
18072 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18079 *) setgrent_r_proto=0
18083 : see if sethostent exists
18084 set sethostent d_sethent
18087 : see if sethostent_r exists
18088 set sethostent_r d_sethostent_r
18090 case "$d_sethostent_r" in
18092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18093 case "$d_sethostent_r_proto:$usethreads" in
18094 ":define") d_sethostent_r_proto=define
18095 set d_sethostent_r_proto sethostent_r $hdrs
18099 case "$d_sethostent_r_proto" in
18101 case "$sethostent_r_proto" in
18102 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18103 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18105 case "$sethostent_r_proto" in
18106 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18107 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18109 case "$sethostent_r_proto" in
18110 ''|0) d_sethostent_r=undef
18111 sethostent_r_proto=0
18112 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18113 * ) case "$sethostent_r_proto" in
18114 REENTRANT_PROTO*) ;;
18115 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18117 echo "Prototype: $try" ;;
18120 *) case "$usethreads" in
18121 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18123 d_sethostent_r=undef
18124 sethostent_r_proto=0
18128 *) sethostent_r_proto=0
18132 : see if setitimer exists
18133 set setitimer d_setitimer
18136 : see if setlinebuf exists
18137 set setlinebuf d_setlinebuf
18140 : see if setlocale exists
18141 set setlocale d_setlocale
18144 : see if locale.h is available
18145 set locale.h i_locale
18148 : see if setlocale_r exists
18149 set setlocale_r d_setlocale_r
18151 case "$d_setlocale_r" in
18153 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18154 case "$d_setlocale_r_proto:$usethreads" in
18155 ":define") d_setlocale_r_proto=define
18156 set d_setlocale_r_proto setlocale_r $hdrs
18160 case "$d_setlocale_r_proto" in
18162 case "$setlocale_r_proto" in
18163 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18164 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18166 case "$setlocale_r_proto" in
18167 ''|0) d_setlocale_r=undef
18168 setlocale_r_proto=0
18169 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18170 * ) case "$setlocale_r_proto" in
18171 REENTRANT_PROTO*) ;;
18172 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18174 echo "Prototype: $try" ;;
18177 *) case "$usethreads" in
18178 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18180 d_setlocale_r=undef
18181 setlocale_r_proto=0
18185 *) setlocale_r_proto=0
18189 : see if setnetent exists
18190 set setnetent d_setnent
18193 : see if setnetent_r exists
18194 set setnetent_r d_setnetent_r
18196 case "$d_setnetent_r" in
18198 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18199 case "$d_setnetent_r_proto:$usethreads" in
18200 ":define") d_setnetent_r_proto=define
18201 set d_setnetent_r_proto setnetent_r $hdrs
18205 case "$d_setnetent_r_proto" in
18207 case "$setnetent_r_proto" in
18208 ''|0) try='int setnetent_r(int, struct netent_data*);'
18209 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18211 case "$setnetent_r_proto" in
18212 ''|0) try='void setnetent_r(int, struct netent_data*);'
18213 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18215 case "$setnetent_r_proto" in
18216 ''|0) d_setnetent_r=undef
18217 setnetent_r_proto=0
18218 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18219 * ) case "$setnetent_r_proto" in
18220 REENTRANT_PROTO*) ;;
18221 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18223 echo "Prototype: $try" ;;
18226 *) case "$usethreads" in
18227 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18229 d_setnetent_r=undef
18230 setnetent_r_proto=0
18234 *) setnetent_r_proto=0
18238 : see if setprotoent exists
18239 set setprotoent d_setpent
18242 : see if setpgid exists
18243 set setpgid d_setpgid
18246 : see if setpgrp2 exists
18247 set setpgrp2 d_setpgrp2
18250 : see if setpriority exists
18251 set setpriority d_setprior
18254 : see if setproctitle exists
18255 set setproctitle d_setproctitle
18258 : see if setprotoent_r exists
18259 set setprotoent_r d_setprotoent_r
18261 case "$d_setprotoent_r" in
18263 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18264 case "$d_setprotoent_r_proto:$usethreads" in
18265 ":define") d_setprotoent_r_proto=define
18266 set d_setprotoent_r_proto setprotoent_r $hdrs
18270 case "$d_setprotoent_r_proto" in
18272 case "$setprotoent_r_proto" in
18273 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18274 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18276 case "$setprotoent_r_proto" in
18277 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18278 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18280 case "$setprotoent_r_proto" in
18281 ''|0) d_setprotoent_r=undef
18282 setprotoent_r_proto=0
18283 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18284 * ) case "$setprotoent_r_proto" in
18285 REENTRANT_PROTO*) ;;
18286 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18288 echo "Prototype: $try" ;;
18291 *) case "$usethreads" in
18292 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18294 d_setprotoent_r=undef
18295 setprotoent_r_proto=0
18299 *) setprotoent_r_proto=0
18303 : see if setpwent exists
18304 set setpwent d_setpwent
18307 : see if setpwent_r exists
18308 set setpwent_r d_setpwent_r
18310 case "$d_setpwent_r" in
18312 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18313 case "$d_setpwent_r_proto:$usethreads" in
18314 ":define") d_setpwent_r_proto=define
18315 set d_setpwent_r_proto setpwent_r $hdrs
18319 case "$d_setpwent_r_proto" in
18321 case "$setpwent_r_proto" in
18322 ''|0) try='int setpwent_r(FILE**);'
18323 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18325 case "$setpwent_r_proto" in
18326 ''|0) try='void setpwent_r(FILE**);'
18327 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18329 case "$setpwent_r_proto" in
18330 ''|0) d_setpwent_r=undef
18332 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18333 * ) case "$setpwent_r_proto" in
18334 REENTRANT_PROTO*) ;;
18335 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18337 echo "Prototype: $try" ;;
18340 *) case "$usethreads" in
18341 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18348 *) setpwent_r_proto=0
18352 : see if setregid exists
18353 set setregid d_setregid
18355 set setresgid d_setresgid
18358 : see if setreuid exists
18359 set setreuid d_setreuid
18361 set setresuid d_setresuid
18364 : see if setrgid exists
18365 set setrgid d_setrgid
18368 : see if setruid exists
18369 set setruid d_setruid
18372 : see if setservent exists
18373 set setservent d_setsent
18376 : see if setservent_r exists
18377 set setservent_r d_setservent_r
18379 case "$d_setservent_r" in
18381 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18382 case "$d_setservent_r_proto:$usethreads" in
18383 ":define") d_setservent_r_proto=define
18384 set d_setservent_r_proto setservent_r $hdrs
18388 case "$d_setservent_r_proto" in
18390 case "$setservent_r_proto" in
18391 ''|0) try='int setservent_r(int, struct servent_data*);'
18392 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18394 case "$setservent_r_proto" in
18395 ''|0) try='void setservent_r(int, struct servent_data*);'
18396 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18398 case "$setservent_r_proto" in
18399 ''|0) d_setservent_r=undef
18400 setservent_r_proto=0
18401 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18402 * ) case "$setservent_r_proto" in
18403 REENTRANT_PROTO*) ;;
18404 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18406 echo "Prototype: $try" ;;
18409 *) case "$usethreads" in
18410 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18412 d_setservent_r=undef
18413 setservent_r_proto=0
18417 *) setservent_r_proto=0
18421 : see if setsid exists
18422 set setsid d_setsid
18425 : see if setvbuf exists
18426 set setvbuf d_setvbuf
18429 : see if shmctl exists
18430 set shmctl d_shmctl
18433 : see if shmget exists
18434 set shmget d_shmget
18437 : see if shmat exists
18440 : see what shmat returns
18443 $cat >shmat.c <<'END'
18444 #include <sys/shm.h>
18447 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18452 echo "and it returns ($shmattype)." >&4
18453 : see if a prototype for shmat is available
18454 xxx=`./findhdr sys/shm.h`
18455 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18456 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18467 set d_shmatprototype
18470 : see if shmdt exists
18474 : see how much of the 'shm*(2)' library is present.
18477 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18478 *"$undef"*) h_shm=false;;
18482 case "`ipcs 2>&1`" in
18483 "SVID shared memory"*"not configured"*)
18484 echo "Your $osname does not have the shm*(2) configured." >&4
18487 set shmctl d_shmctl
18489 set shmget d_shmget
18499 : we could also check for sys/ipc.h ...
18500 if $h_shm && $test `./findhdr sys/shm.h`; then
18501 echo "You have the full shm*(2) library." >&4
18504 echo "You don't have the full shm*(2) library." >&4
18510 : see if we have sigaction
18512 if set sigaction val -f d_sigaction; eval $csym; $val; then
18513 echo 'sigaction() found.' >&4
18516 #include <sys/types.h>
18517 #include <signal.h>
18518 #$i_stdlib I_STDLIB
18520 #include <stdlib.h>
18524 struct sigaction act, oact;
18526 oact.sa_handler = 0;
18527 /* so that act and oact are used */
18528 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18532 if eval $compile_ok; then
18535 echo "But you don't seem to have a usable struct sigaction." >&4
18539 echo 'sigaction NOT found.' >&4
18542 set d_sigaction; eval $setvar
18545 : see if this is a sunmath.h system
18546 set sunmath.h i_sunmath
18549 : see if signbit exists
18550 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18553 #$i_sunmath I_SUNMATH
18557 #ifdef I_SUNMATH /* Solaris special math library */
18558 # include <sunmath.h>
18561 int main(int argc, char **argv)
18565 if ((signbit(x) == 0) && (signbit(y) != 0))
18573 if eval $compile; then
18574 if $run ./try; then
18578 $echo "Signbit seems to be available, but doesn't work as I expected."
18579 $echo "I won't use it." >&4
18590 : see if sigprocmask exists
18591 set sigprocmask d_sigprocmask
18594 : see if sigsetjmp exists
18596 case "$d_sigsetjmp" in
18599 #include <setjmp.h>
18600 #$i_stdlib I_STDLIB
18602 #include <stdlib.h>
18608 if (sigsetjmp(env,1))
18611 siglongjmp(env, 1);
18616 if eval $compile; then
18617 if $run ./try >/dev/null 2>&1; then
18618 echo "POSIX sigsetjmp found." >&4
18622 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18628 echo "sigsetjmp not found." >&4
18632 *) val="$d_sigsetjmp"
18633 case "$d_sigsetjmp" in
18634 $define) echo "POSIX sigsetjmp found." >&4;;
18635 $undef) echo "sigsetjmp not found." >&4;;
18643 : see if snprintf exists
18644 set snprintf d_snprintf
18647 : see if vsnprintf exists
18648 set vsnprintf d_vsnprintf
18651 case "$d_snprintf-$d_vsnprintf" in
18654 Checking whether your snprintf() and vsnprintf() work okay...
18656 $cat >try.c <<'EOCP'
18657 /* v?snprintf testing logic courtesy of Russ Allbery.
18658 * According to C99:
18659 * - if the buffer is too short it still must be \0-terminated
18660 * - if the buffer is too short the potentially required length
18661 * must be returned and not -1
18662 * - if the buffer is NULL the potentially required length
18663 * must be returned and not -1 or core dump
18666 #include <stdarg.h>
18670 int test (char *format, ...)
18675 va_start (args, format);
18676 count = vsnprintf (buf, sizeof buf, format, args);
18683 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18684 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18688 if eval $compile; then
18691 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18693 Your snprintf() and snprintf() don't seem to be working okay.
18695 d_snprintf="$undef"
18696 d_vsnprintf="$undef"
18700 echo "(I can't seem to compile the test program--assuming they don't)"
18701 d_snprintf="$undef"
18702 d_vsnprintf="$undef"
18708 : see if sockatmark exists
18709 set sockatmark d_sockatmark
18712 : see if prototype for sockatmark is available
18714 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18717 : see if socks5_init exists
18718 set socks5_init d_socks5_init
18721 : see if sprintf returns the length of the string in the buffer as per ANSI
18722 $echo "Checking whether sprintf returns the length of the string..." >&4
18725 #$i_stdlib I_STDLIB
18727 #include <stdlib.h>
18729 #$i_string I_STRING
18731 # include <string.h>
18733 # include <strings.h>
18742 int check (size_t expect, int test) {
18743 size_t got = strlen(buffer);
18747 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18752 int main(int argc, char **argv) {
18755 check(sprintf(buffer, ""), ++test);
18756 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18757 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18764 if eval $compile; then
18768 sprintf returns the length of the string (as ANSI says it should)
18770 d_sprintf_returns_strlen="$define"
18773 sprintf does not return the length of the string (how old is this system?)
18775 d_sprintf_returns_strlen="$undef"
18779 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18780 d_sprintf_returns_strlen="$undef"
18784 : see if srand48_r exists
18785 set srand48_r d_srand48_r
18787 case "$d_srand48_r" in
18789 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18790 case "$d_srand48_r_proto:$usethreads" in
18791 ":define") d_srand48_r_proto=define
18792 set d_srand48_r_proto srand48_r $hdrs
18796 case "$d_srand48_r_proto" in
18798 case "$srand48_r_proto" in
18799 ''|0) try='int srand48_r(long, struct drand48_data*);'
18800 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18802 case "$srand48_r_proto" in
18803 ''|0) d_srand48_r=undef
18805 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18806 * ) case "$srand48_r_proto" in
18807 REENTRANT_PROTO*) ;;
18808 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18810 echo "Prototype: $try" ;;
18813 *) case "$usethreads" in
18814 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18821 *) srand48_r_proto=0
18825 : see if srandom_r exists
18826 set srandom_r d_srandom_r
18828 case "$d_srandom_r" in
18830 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18831 case "$d_srandom_r_proto:$usethreads" in
18832 ":define") d_srandom_r_proto=define
18833 set d_srandom_r_proto srandom_r $hdrs
18837 case "$d_srandom_r_proto" in
18839 case "$srandom_r_proto" in
18840 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18841 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18843 case "$srandom_r_proto" in
18844 ''|0) d_srandom_r=undef
18846 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18847 * ) case "$srandom_r_proto" in
18848 REENTRANT_PROTO*) ;;
18849 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18851 echo "Prototype: $try" ;;
18854 *) case "$usethreads" in
18855 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18862 *) srandom_r_proto=0
18866 : see if prototype for setresgid is available
18868 set d_sresgproto setresgid $i_unistd unistd.h
18871 : see if prototype for setresuid is available
18873 set d_sresuproto setresuid $i_unistd unistd.h
18876 : see if stat exists
18880 : see if sys/stat.h is available
18881 set sys/stat.h i_sysstat
18884 : see if stat knows about block sizes
18886 echo "Checking to see if your struct stat has st_blocks field..." >&4
18887 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18890 : see if this is a sys/vfs.h system
18891 set sys/vfs.h i_sysvfs
18894 : see if this is a sys/statfs.h system
18895 set sys/statfs.h i_sysstatfs
18898 : Check for statfs_s
18900 echo "Checking to see if your system supports struct statfs..." >&4
18901 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
18903 case "$d_statfs_s" in
18904 "$define") echo "Yes, it does." ;;
18905 *) echo "No, it doesn't." ;;
18909 : see if struct statfs knows about f_flags
18910 case "$d_statfs_s" in
18913 echo "Checking to see if your struct statfs has f_flags field..." >&4
18914 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
18918 set d_statfs_f_flags
18922 case "$d_statfs_f_flags" in
18923 "$define") echo "Yes, it does." ;;
18924 *) echo "No, it doesn't." ;;
18927 : see what flavor, if any, of static inline is supported
18929 echo "Checking to see if your system supports static inline..."
18930 $cat > try.c <<'EOCP'
18931 #include <stdlib.h>
18932 extern int f_via_a(int x);
18933 extern int f_via_b(int x);
18934 int main(int argc, char **argv)
18943 return EXIT_SUCCESS;
18946 return EXIT_FAILURE;
18950 $cat > a.c <<'EOCP'
18951 static INLINE int f(int x) {
18962 $cat > b.c <<'EOCP'
18963 extern int f(int x);
18971 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18972 case "$perl_static_inline" in
18973 '') # Check the various possibilities, and break out on success.
18974 # For gcc, prefer __inline__, which will still permit
18975 # cflags.SH to add in -ansi.
18976 case "$gccversion" in
18977 '') xxx="inline __inline__ __inline _inline";;
18978 *) xxx="__inline__ inline __inline _inline";;
18980 for inline in $xxx; do
18981 set try -DINLINE=$inline a.c
18982 if eval $compile && $run ./try; then
18983 # Now make sure there is no external linkage of static
18985 set try -DINLINE=$inline -DUSE_B a.c b.c
18986 if eval $compile && $run ./try; then
18987 $echo "Your compiler supports static $inline, " >&4
18988 $echo "but it also creates an external definition," >&4
18989 $echo "so I won't use it." >&4
18992 $echo "Your compiler supports static $inline." >&4
18994 perl_static_inline="static $inline";
18998 $echo "Your compiler does NOT support static $inline." >&4
19003 *inline*) # Some variant of inline exists.
19004 echo "Keeping your $hint value of $perl_static_inline."
19007 static) # No inline capabilities
19008 echo "Keeping your $hint value of $perl_static_inline."
19011 *) # Unrecognized previous value -- blindly trust the supplied
19012 # value and hope it makes sense. Use old value for
19013 # d_static_inline, if there is one.
19014 echo "Keeping your $hint value of $perl_static_inline."
19015 case "$d_static_inline" in
19017 *) val=$d_static_inline ;;
19021 # Fallback to plain 'static' if nothing worked.
19022 case "$perl_static_inline" in
19024 perl_static_inline="static"
19028 set d_static_inline
19030 $rm -f a.[co] b.[co]
19033 : Check stream access
19035 Checking how to access stdio streams by file descriptor number...
19037 case "$stdio_stream_array" in
19038 '') $cat >try.c <<EOCP
19041 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19045 for s in _iob __iob __sF
19047 set try -DSTDIO_STREAM_ARRAY=$s
19048 if eval $compile; then
19049 case "`$run ./try`" in
19050 yes) stdio_stream_array=$s; break ;;
19056 case "$stdio_stream_array" in
19058 I can't figure out how to access stdio streams by file descriptor number.
19060 d_stdio_stream_array="$undef"
19063 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19065 d_stdio_stream_array="$define"
19069 : see if strcoll exists
19070 set strcoll d_strcoll
19073 : check for structure copying
19075 echo "Checking to see if your C compiler can copy structs..." >&4
19076 $cat >try.c <<'EOCP'
19086 if $cc -c try.c >/dev/null 2>&1 ; then
19088 echo "Yup, it can."
19091 echo "Nope, it can't."
19097 : see if strerror and/or sys_errlist[] exist
19099 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19100 if set strerror val -f d_strerror; eval $csym; $val; then
19101 echo 'strerror() found.' >&4
19102 d_strerror="$define"
19103 d_strerrm='strerror(e)'
19104 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19105 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19106 d_syserrlst="$define"
19108 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19109 d_syserrlst="$undef"
19111 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19112 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19113 echo 'strerror() found in string header.' >&4
19114 d_strerror="$define"
19115 d_strerrm='strerror(e)'
19116 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19117 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19118 d_syserrlst="$define"
19120 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19121 d_syserrlst="$undef"
19123 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19124 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19125 d_strerror="$undef"
19126 d_syserrlst="$define"
19127 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19129 echo 'strerror() and sys_errlist[] NOT found.' >&4
19130 d_strerror="$undef"
19131 d_syserrlst="$undef"
19132 d_strerrm='"unknown"'
19136 : see if strerror_r exists
19137 set strerror_r d_strerror_r
19139 case "$d_strerror_r" in
19141 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19142 case "$d_strerror_r_proto:$usethreads" in
19143 ":define") d_strerror_r_proto=define
19144 set d_strerror_r_proto strerror_r $hdrs
19148 case "$d_strerror_r_proto" in
19150 case "$strerror_r_proto" in
19151 ''|0) try='int strerror_r(int, char*, size_t);'
19152 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19154 case "$strerror_r_proto" in
19155 ''|0) try='int strerror_r(int, char*, int);'
19156 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19158 case "$strerror_r_proto" in
19159 ''|0) try='char* strerror_r(int, char*, size_t);'
19160 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19162 case "$strerror_r_proto" in
19163 ''|0) d_strerror_r=undef
19165 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19166 * ) case "$strerror_r_proto" in
19167 REENTRANT_PROTO*) ;;
19168 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19170 echo "Prototype: $try" ;;
19173 *) case "$usethreads" in
19174 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19181 *) strerror_r_proto=0
19185 : see if strftime exists
19186 set strftime d_strftime
19189 : see if strlcat exists
19190 set strlcat d_strlcat
19193 : see if strlcpy exists
19194 set strlcpy d_strlcpy
19197 : see if strtod exists
19198 set strtod d_strtod
19201 : see if strtol exists
19202 set strtol d_strtol
19205 : see if strtold exists
19206 set strtold d_strtold
19209 : see if strtoll exists
19210 set strtoll d_strtoll
19213 case "$d_longlong-$d_strtoll" in
19216 Checking whether your strtoll() works okay...
19218 $cat >try.c <<'EOCP'
19221 #define strtoll __strtoll
19224 #define strtoll _strtoll
19227 extern long long int strtoll(char *s, char **, int);
19228 static int bad = 0;
19229 int check(char *s, long long ell, int een) {
19232 gll = strtoll(s, 0, 10);
19233 if (!((gll == ell) && (errno == een)))
19237 check(" 1", 1LL, 0);
19238 check(" 0", 0LL, 0);
19239 check("-1", -1LL, 0);
19240 check("-9223372036854775808", -9223372036854775808LL, 0);
19241 check("-9223372036854775808", -9223372036854775808LL, 0);
19242 check(" 9223372036854775807", 9223372036854775807LL, 0);
19243 check("-9223372036854775808", -9223372036854775808LL, 0);
19244 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19245 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19251 if eval $compile; then
19254 ok) echo "Your strtoll() seems to be working okay." ;;
19256 Your strtoll() doesn't seem to be working okay.
19262 echo "(I can't seem to compile the test program--assuming it doesn't)"
19268 : see if strtoq exists
19269 set strtoq d_strtoq
19272 : see if strtoul exists
19273 set strtoul d_strtoul
19276 case "$d_strtoul" in
19279 Checking whether your strtoul() works okay...
19281 $cat >try.c <<'EOCP'
19284 extern unsigned long int strtoul(char *s, char **, int);
19285 static int bad = 0;
19286 void check(char *s, unsigned long eul, int een) {
19289 gul = strtoul(s, 0, 10);
19290 if (!((gul == eul) && (errno == een)))
19294 check(" 1", 1L, 0);
19295 check(" 0", 0L, 0);
19297 case "$longsize" in
19299 $cat >>try.c <<'EOCP'
19300 check("18446744073709551615", 18446744073709551615UL, 0);
19301 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19302 #if 0 /* strtoul() for /^-/ strings is undefined. */
19303 check("-1", 18446744073709551615UL, 0);
19304 check("-18446744073709551614", 2, 0);
19305 check("-18446744073709551615", 1, 0);
19306 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19307 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19312 $cat >>try.c <<'EOCP'
19313 check("4294967295", 4294967295UL, 0);
19314 check("4294967296", 4294967295UL, ERANGE);
19315 #if 0 /* strtoul() for /^-/ strings is undefined. */
19316 check("-1", 4294967295UL, 0);
19317 check("-4294967294", 2, 0);
19318 check("-4294967295", 1, 0);
19319 check("-4294967296", 4294967295UL, ERANGE);
19320 check("-4294967297", 4294967295UL, ERANGE);
19325 : Should we write these tests to be more portable by sprintf-ing
19326 : ~0 and then manipulating that char string as input for strtol?
19329 $cat >>try.c <<'EOCP'
19336 if eval $compile; then
19337 case "`$run ./try`" in
19338 ok) echo "Your strtoul() seems to be working okay." ;;
19340 Your strtoul() doesn't seem to be working okay.
19346 echo "(I can't seem to compile the test program--assuming it doesn't)"
19352 : see if strtoull exists
19353 set strtoull d_strtoull
19356 case "$d_longlong-$d_strtoull" in
19359 Checking whether your strtoull() works okay...
19361 $cat >try.c <<'EOCP'
19364 #define strtoull __strtoull
19367 extern unsigned long long int strtoull(char *s, char **, int);
19368 static int bad = 0;
19369 int check(char *s, long long eull, int een) {
19372 gull = strtoull(s, 0, 10);
19373 if (!((gull == eull) && (errno == een)))
19377 check(" 1", 1LL, 0);
19378 check(" 0", 0LL, 0);
19379 check("18446744073709551615", 18446744073709551615ULL, 0);
19380 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19381 #if 0 /* strtoull() for /^-/ strings is undefined. */
19382 check("-1", 18446744073709551615ULL, 0);
19383 check("-18446744073709551614", 2LL, 0);
19384 check("-18446744073709551615", 1LL, 0);
19385 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19386 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19393 if eval $compile; then
19394 case "`$run ./try`" in
19395 ok) echo "Your strtoull() seems to be working okay." ;;
19397 Your strtoull() doesn't seem to be working okay.
19399 d_strtoull="$undef"
19403 echo "(I can't seem to compile the test program--assuming it doesn't)"
19404 d_strtoull="$undef"
19409 : see if strtouq exists
19410 set strtouq d_strtouq
19413 case "$d_strtouq" in
19416 Checking whether your strtouq() works okay...
19418 $cat >try.c <<'EOCP'
19421 extern unsigned long long int strtouq(char *s, char **, int);
19422 static int bad = 0;
19423 void check(char *s, unsigned long long eull, int een) {
19424 unsigned long long gull;
19426 gull = strtouq(s, 0, 10);
19427 if (!((gull == eull) && (errno == een)))
19431 check(" 1", 1LL, 0);
19432 check(" 0", 0LL, 0);
19433 check("18446744073709551615", 18446744073709551615ULL, 0);
19434 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19435 #if 0 /* strtouq() for /^-/ strings is undefined. */
19436 check("-1", 18446744073709551615ULL, 0);
19437 check("-18446744073709551614", 2LL, 0);
19438 check("-18446744073709551615", 1LL, 0);
19439 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19440 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19448 if eval $compile; then
19449 case "`$run ./try`" in
19450 ok) echo "Your strtouq() seems to be working okay." ;;
19452 Your strtouq() doesn't seem to be working okay.
19458 echo "(I can't seem to compile the test program--assuming it doesn't)"
19464 : see if strxfrm exists
19465 set strxfrm d_strxfrm
19468 : see if symlink exists
19469 set symlink d_symlink
19472 : see if syscall exists
19473 set syscall d_syscall
19476 : see if prototype for syscall is available
19478 set d_syscallproto syscall $i_unistd unistd.h
19481 : see if sysconf exists
19482 set sysconf d_sysconf
19485 : see if system exists
19486 set system d_system
19489 : see if tcgetpgrp exists
19490 set tcgetpgrp d_tcgetpgrp
19493 : see if tcsetpgrp exists
19494 set tcsetpgrp d_tcsetpgrp
19497 : see if prototype for telldir is available
19499 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19502 : see if tgamma exists
19503 set tgamma d_tgamma
19506 : see if time exists
19508 if test "X$d_time" = X -o X"$timetype" = X; then
19509 if set time val -f d_time; eval $csym; $val; then
19510 echo 'time() found.' >&4
19512 rp="What is the type returned by time() on this system?"
19513 set time_t timetype long stdio.h sys/types.h
19516 echo 'time() not found, hope that will do.' >&4
19524 : see if timegm exists
19525 set timegm d_timegm
19528 : see if this is a sys/times.h system
19529 set sys/times.h i_systimes
19532 : see if times exists
19534 if set times val -f d_times; eval $csym; $val; then
19535 echo 'times() found.' >&4
19538 case "$i_systimes" in
19539 "$define") inc='sys/times.h';;
19541 rp="What is the type returned by times() on this system?"
19542 set clock_t clocktype long stdio.h sys/types.h $inc
19545 echo 'times() NOT found, hope that will do.' >&4
19550 : see if tmpnam_r exists
19551 set tmpnam_r d_tmpnam_r
19553 case "$d_tmpnam_r" in
19555 hdrs="$i_systypes sys/types.h define stdio.h "
19556 case "$d_tmpnam_r_proto:$usethreads" in
19557 ":define") d_tmpnam_r_proto=define
19558 set d_tmpnam_r_proto tmpnam_r $hdrs
19562 case "$d_tmpnam_r_proto" in
19564 case "$tmpnam_r_proto" in
19565 ''|0) try='char* tmpnam_r(char*);'
19566 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19568 case "$tmpnam_r_proto" in
19569 ''|0) d_tmpnam_r=undef
19571 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19572 * ) case "$tmpnam_r_proto" in
19573 REENTRANT_PROTO*) ;;
19574 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19576 echo "Prototype: $try" ;;
19579 *) case "$usethreads" in
19580 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19587 *) tmpnam_r_proto=0
19591 : see if trunc exists
19595 : see if truncate exists
19596 set truncate d_truncate
19599 : see if ttyname_r exists
19600 set ttyname_r d_ttyname_r
19602 case "$d_ttyname_r" in
19604 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19605 case "$d_ttyname_r_proto:$usethreads" in
19606 ":define") d_ttyname_r_proto=define
19607 set d_ttyname_r_proto ttyname_r $hdrs
19611 case "$d_ttyname_r_proto" in
19613 case "$ttyname_r_proto" in
19614 ''|0) try='int ttyname_r(int, char*, size_t);'
19615 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19617 case "$ttyname_r_proto" in
19618 ''|0) try='int ttyname_r(int, char*, int);'
19619 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19621 case "$ttyname_r_proto" in
19622 ''|0) try='char* ttyname_r(int, char*, int);'
19623 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19625 case "$ttyname_r_proto" in
19626 ''|0) d_ttyname_r=undef
19628 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19629 * ) case "$ttyname_r_proto" in
19630 REENTRANT_PROTO*) ;;
19631 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19633 echo "Prototype: $try" ;;
19636 *) case "$usethreads" in
19637 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19644 *) ttyname_r_proto=0
19648 : see if tzname[] exists
19650 if set tzname val -a d_tzname; eval $csym; $val; then
19652 echo 'tzname[] found.' >&4
19655 echo 'tzname[] NOT found.' >&4
19660 : Check if is a multiplatform env
19662 darwin) multiarch="$define" ;;
19664 case "$multiarch" in
19665 ''|[nN]*) multiarch="$undef" ;;
19668 : check for ordering of bytes in a UV
19670 case "$multiarch" in
19673 You seem to be doing a multiarchitecture build,
19674 skipping the byteorder check.
19680 case "$byteorder" in
19683 In the following, larger digits indicate more significance. A big-endian
19684 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19685 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19686 machines may have weird orders like 3412. A Cray will report 87654321,
19687 an Alpha will report 12345678. If the test program works the default is
19689 I'm now running the test program...
19693 #$i_stdlib I_STDLIB
19695 #include <stdlib.h>
19697 #include <sys/types.h>
19698 typedef $uvtype UV;
19708 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19710 u.l = (UV)0x04030201;
19711 for (i = 0; i < $uvsize; i++)
19712 printf("%c", u.c[i]+'0');
19719 if eval $compile && $run ./try > /dev/null; then
19722 [1-4][1-4][1-4][1-4]|12345678|87654321)
19723 echo "(The test program ran ok.)"
19724 echo "byteorder=$dflt"
19727 ????|????????) echo "(The test program ran ok.)" ;;
19728 *) echo "(The test program didn't run right for some reason.)" ;;
19733 (I can't seem to compile the test program. Guessing big-endian...)
19736 case "$xxx_prompt" in
19738 rp="What is the order of bytes in $uvtype?"
19751 : Checking 32bit alignedness
19754 Checking to see whether you can access character data unalignedly...
19756 case "$d_u32align" in
19757 '') $cat >try.c <<EOCP
19759 #$i_stdlib I_STDLIB
19761 #include <stdlib.h>
19763 #define U32 $u32type
19764 #define BYTEORDER 0x$byteorder
19766 #include <signal.h>
19768 $signal_t bletch(int s) { exit(4); }
19771 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19772 volatile U8 buf[8];
19776 if (sizeof(U32) != 4) {
19777 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19784 signal(SIGBUS, bletch);
19796 for (i = 0; i < 4; i++) {
19797 up = (U32*)(buf + i);
19798 if (! ((*up == 1 << (8*i)) || /* big-endian */
19799 (*up == 1 << (8*(3-i))) /* little-endian */
19803 printf("read failed (%x)\n", *up);
19809 for (i = 0; i < 4; i++) {
19810 up = (U32*)(buf + i);
19812 if (*up != 0xBeef) {
19813 printf("write failed (%x)\n", *up);
19827 if eval $compile_ok; then
19828 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19829 $run ./try 2>&1 >/dev/null
19832 You can access character data pretty unalignedly.
19834 d_u32align="$undef"
19837 It seems that you must access character data in an aligned manner.
19839 d_u32align="$define"
19843 rp='Can you access character data at unaligned addresses?'
19847 [yY]*) d_u32align="$undef" ;;
19848 *) d_u32align="$define" ;;
19855 : see if ualarm exists
19856 set ualarm d_ualarm
19859 : see if umask exists
19863 : see if unordered exists
19864 set unordered d_unordered
19867 : see if unsetenv exists
19868 set unsetenv d_unsetenv
19871 : see if usleep exists
19872 set usleep d_usleep
19875 : see if prototype for usleep is available
19877 set d_usleepproto usleep $i_unistd unistd.h
19880 : see if ustat exists
19884 : see if closedir exists
19885 set closedir d_closedir
19888 case "$d_closedir" in
19891 echo "Checking whether closedir() returns a status..." >&4
19893 #$i_dirent I_DIRENT /**/
19894 #$i_sysdir I_SYS_DIR /**/
19895 #$i_sysndir I_SYS_NDIR /**/
19896 #$i_systypes I_SYS_TYPES /**/
19898 #if defined(I_SYS_TYPES)
19899 #include <sys/types.h>
19901 #if defined(I_DIRENT)
19902 #include <dirent.h>
19905 #include <sys/ndir.h>
19909 #include <ndir.h> /* may be wrong in the future */
19911 #include <sys/dir.h>
19916 int main() { return closedir(opendir(".")); }
19919 if eval $compile_ok; then
19920 if $run ./try > /dev/null 2>&1 ; then
19921 echo "Yes, it does."
19924 echo "No, it doesn't."
19928 echo "(I can't seem to compile the test program--assuming it doesn't)"
19936 set d_void_closedir
19940 : see if there is a wait4
19944 : see if waitpid exists
19945 set waitpid d_waitpid
19950 $cat >try.c <<'EOCP'
19956 return (wcscmp (s, s) ? 1 : 0);
19961 if eval $compile; then
19964 0) echo "A working wcscmp() found." >&4
19966 *) echo "wcscmp() found, but it doesn't work" >&4
19970 echo "wcscmp() NOT found." >&4
19976 : see if wcstombs exists
19977 set wcstombs d_wcstombs
19982 $cat >try.c <<'EOCP'
19987 wchar_t dst[4], *src = L" ";
19989 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19994 if eval $compile; then
19997 0) echo "A working wcsxfrm() found." >&4
19999 *) echo "wcsxfrm() found, but it doesn't work" >&4
20003 echo "wcsxfrm() NOT found." >&4
20009 : see if wctomb exists
20010 set wctomb d_wctomb
20013 : see if writev exists
20014 set writev d_writev
20017 : check for alignment requirements
20019 case "$alignbytes" in
20020 '') echo "Checking alignment constraints..." >&4
20021 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20022 $cat >try.c <<'EOCP'
20023 typedef long double NV;
20026 $cat >try.c <<'EOCP'
20030 $cat >>try.c <<'EOCP'
20038 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20043 if eval $compile_ok; then
20047 echo "(I can't seem to compile the test program...)"
20049 case "$multiarch" in
20051 : The usual safe value is 8, but Darwin with -Duselongdouble
20052 : needs 16. Hence, we will take 8 as a minimum, but allow
20053 : Configure to pick a larger value if needed.
20054 if $test "$dflt" -lt 8; then
20056 echo "Setting alignment to 8 for multiarch support.">&4
20061 *) dflt="$alignbytes"
20064 rp="Doubles must be aligned on a how-many-byte boundary?"
20069 : set the base revision
20072 : length of character in bytes. Is always 1, otherwise it is not C
20073 : This used to be a test using sizeof
20076 : Check for the number of bits in a character
20077 case "$charbits" in
20078 '') echo "Checking how long a character is (in bits)..." >&4
20085 for (c = 1, n = 0; c; c <<= 1, n++) ;
20086 printf ("%d\n", n);
20091 if eval $compile_ok; then
20095 echo "(I can't seem to compile the test program. Guessing...)"
20102 rp="What is the length of a character (in bits)?"
20106 case "$charbits" in
20109 Your system has an unsigned character size of $charbits bits, which
20110 is rather unusual (normally it is 8 bits). Perl likely will not work
20111 correctly on your system, with subtle bugs in various places.
20113 rp='Do you really want to continue?'
20117 [yY]) echo >&4 "Okay, continuing." ;;
20122 : how do we concatenate cpp tokens here?
20124 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20125 $cat >cpp_stuff.c <<'EOCP'
20126 #define RCAT(a,b)a/**/b
20127 #define ACAT(a,b)a ## b
20131 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20132 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20133 echo "Oh! Smells like ANSI's been here." >&4
20134 echo "We can catify or stringify, separately or together!"
20136 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20137 echo "Ah, yes! The good old days!" >&4
20138 echo "However, in the good old days we don't know how to stringify and"
20139 echo "catify at the same time."
20143 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20144 You're going to have to edit the values of CAT[2-5] in config.h...
20146 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20150 : see if this is a db.h system
20156 : Check db version.
20158 echo "Checking Berkeley DB version ..." >&4
20164 #include <sys/types.h>
20166 #$i_stdlib I_STDLIB
20168 #include <stdlib.h>
20171 int main(int argc, char *argv[])
20173 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20174 int Major, Minor, Patch ;
20175 unsigned long Version ;
20176 (void)db_version(&Major, &Minor, &Patch) ;
20178 printf("%d %d %d %d %d %d\n",
20179 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20180 Major, Minor, Patch);
20183 printf("You have Berkeley DB Version 2 or greater.\n");
20185 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20186 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20187 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20188 Major, Minor, Patch) ;
20190 /* check that db.h & libdb are compatible */
20191 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20192 printf("db.h and libdb are incompatible.\n") ;
20196 printf("db.h and libdb are compatible.\n") ;
20198 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20199 + DB_VERSION_PATCH ;
20201 /* needs to be >= 2.3.4 */
20202 if (Version < 2003004) {
20203 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20204 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20210 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20215 printf("You have Berkeley DB Version 1.\n");
20216 exit(0); /* DB version < 2: the coast is clear. */
20218 exit(1); /* <db.h> not Berkeley DB? */
20224 if eval $compile_ok && $run ./try; then
20225 echo 'Looks OK.' >&4
20227 db_version_major=$1
20228 db_version_minor=$2
20229 db_version_patch=$3
20231 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20235 : Remove db from list of libraries to use
20236 echo "Removing unusable -ldb from library list" >&4
20237 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20240 echo "libs = $libs" >&4
20250 : Check the return type needed for hash
20252 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20258 #include <sys/types.h>
20261 #ifndef DB_VERSION_MAJOR
20262 u_int32_t hash_cb (const void* ptr, size_t size)
20268 info.hash = hash_cb;
20272 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20273 if $contains warning try.out >>/dev/null 2>&1 ; then
20276 db_hashtype='u_int32_t'
20279 : XXX Maybe we should just give up here.
20280 db_hashtype=u_int32_t
20282 echo "Help: I can't seem to compile the db test program." >&4
20283 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20286 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20288 *) db_hashtype=u_int32_t
20293 : Check the return type needed for prefix
20295 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20301 #include <sys/types.h>
20304 #ifndef DB_VERSION_MAJOR
20305 size_t prefix_cb (const DBT *key1, const DBT *key2)
20311 info.prefix = prefix_cb;
20315 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20316 if $contains warning try.out >>/dev/null 2>&1 ; then
20317 db_prefixtype='int'
20319 db_prefixtype='size_t'
20322 db_prefixtype='size_t'
20323 : XXX Maybe we should just give up here.
20325 echo "Help: I can't seem to compile the db test program." >&4
20326 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20329 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20331 *) db_prefixtype='size_t'
20335 : How can we generate normalized random numbers ?
20337 echo "Using our internal random number implementation..." >&4
20340 *-Dmy_rand=*|*-Dmy_srand=*)
20341 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20342 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20343 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20344 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20348 randfunc=Perl_drand48
20349 drand01="Perl_drand48()"
20350 seedfunc="Perl_drand48_init"
20354 : Determine if this is an EBCDIC system
20356 echo "Determining whether or not we are on an EBCDIC system..." >&4
20357 $cat >try.c <<'EOM'
20360 if ('M'==0xd4) return 0;
20367 if eval $compile_ok; then
20368 if $run ./try; then
20369 echo "You seem to speak EBCDIC." >&4
20372 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20375 echo "I'm unable to compile the test program." >&4
20376 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20382 : Check how to flush
20385 Checking how to flush all pending stdio output...
20387 # I only know how to find the first 32 possibly open files on SunOS.
20388 # See also hints/sunos_4_1.sh and util.c --AD
20390 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20392 $cat >>try.c <<EOCP
20394 #$i_stdlib I_STDLIB
20396 #include <stdlib.h>
20398 #$i_unistd I_UNISTD
20400 # include <unistd.h>
20402 #$d_sysconf HAS_SYSCONF
20403 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20404 #ifdef HAS_STDIO_STREAM_ARRAY
20405 # define STDIO_STREAM_ARRAY $stdio_stream_array
20410 p = fopen("try.out", "w");
20414 # ifdef TRY_FPRINTF
20418 #ifdef TRY_FFLUSH_NULL
20421 #ifdef TRY_FFLUSH_ALL
20423 long open_max = -1;
20424 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20425 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20427 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20428 open_max = sysconf(_SC_OPEN_MAX);
20431 open_max = FOPEN_MAX;
20434 open_max = OPEN_MAX;
20443 # ifdef HAS_STDIO_STREAM_ARRAY
20444 if (open_max > 0) {
20446 for (i = 0; i < open_max; i++)
20447 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20448 STDIO_STREAM_ARRAY[i]._file < open_max &&
20449 STDIO_STREAM_ARRAY[i]._flag)
20450 fflush(&STDIO_STREAM_ARRAY[i]);
20458 : first we have to find out how _not_ to flush
20460 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20462 set try -DTRY_FPUTC
20463 if eval $compile; then
20464 $run ./try 2>/dev/null
20467 if $test ! -s try.out -a "X$code" = X42; then
20473 set try -DTRY_FPRINTF
20474 if eval $compile; then
20475 $run ./try 2>/dev/null
20478 if $test ! -s try.out -a "X$code" = X42; then
20479 output=-DTRY_FPRINTF
20485 : check for fflush NULL behavior
20486 case "$fflushNULL" in
20487 '') set try -DTRY_FFLUSH_NULL $output
20488 if eval $compile; then
20489 $run ./try 2>/dev/null
20492 if $test -s try.out -a "X$code" = X42; then
20493 fflushNULL="`$cat try.out`"
20495 if $test "X$code" != X42; then
20497 (If this test failed, don't worry, we'll try another method shortly.)
20502 $rm -f core try.core core.try.*
20503 case "$fflushNULL" in
20505 Your fflush(NULL) works okay for output streams.
20506 Let's see if it clobbers input pipes...
20508 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20509 # bug that improperly flushes the input end of pipes. So we avoid the
20510 # autoflush on fork/system/exec support for now. :-(
20511 $cat >tryp.c <<EOCP
20514 main(int argc, char **argv)
20520 while ((i = getc(stdin)) != -1
20521 && (*bp++ = i) != '\n'
20522 && bp < &buf[1024])
20525 fprintf(stdout, "%s", buf);
20533 fflushNULL="$define"
20535 if eval $compile; then
20537 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20538 if $test "X$targethost" != X; then
20541 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20543 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20545 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20547 fflush(NULL) seems to behave okay with input streams.
20549 fflushNULL="$define"
20552 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20554 fflushNULL="$undef"
20557 $rm -f core tryp.c tryp.core core.tryp.*
20560 Your fflush(NULL) isn't working (contrary to ANSI C).
20562 fflushNULL="$undef"
20565 Cannot figure out whether your fflush(NULL) works or not.
20566 I'm assuming it doesn't (contrary to ANSI C).
20568 fflushNULL="$undef"
20572 $define|true|[yY]*)
20573 fflushNULL="$define"
20576 fflushNULL="$undef"
20579 : check explicit looping only if NULL did not work, and if the pipe
20580 : bug does not show up on an explicit flush too
20581 case "$fflushNULL" in
20583 $cat >tryp.c <<EOCP
20586 main(int argc, char **argv)
20592 while ((i = getc(stdin)) != -1
20593 && (*bp++ = i) != '\n'
20594 && bp < &buf[1024])
20597 fprintf(stdout, "%s", buf);
20606 if eval $compile; then
20608 if $test "X$targethost" != X; then
20611 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20613 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20615 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20617 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20619 : now check for fflushall behaviour
20620 case "$fflushall" in
20621 '') set try -DTRY_FFLUSH_ALL $output
20622 if eval $compile; then
20624 (Now testing the other method--but note that this also may fail.)
20626 $run ./try 2>/dev/null
20629 if $test -s try.out -a "X$code" = X42; then
20630 fflushall="`$cat try.out`"
20634 case "$fflushall" in
20636 Whew. Flushing explicitly all the stdio streams works.
20638 fflushall="$define"
20641 Sigh. Flushing explicitly all the stdio streams doesn't work.
20646 Cannot figure out whether flushing stdio streams explicitly works or not.
20647 I'm assuming it doesn't.
20653 "$define"|true|[yY]*)
20654 fflushall="$define"
20662 All is futile. Even fflush(stdin) clobbers input pipes!
20669 $rm -f core tryp.c tryp.core core.tryp.*
20671 *) fflushall="$undef"
20675 case "$fflushNULL$fflushall" in
20678 OK, I give up. I cannot figure out how to flush pending stdio output.
20679 We won't be flushing handles at all before fork/exec/popen.
20685 : Store the full pathname to the ar program for use in the C program
20686 : Respect a hint or command line value for full_ar.
20691 : Store the full pathname to the sed program for use in the C program
20694 : see what type gids are declared as in the kernel
20696 echo "Looking for the type for group ids returned by getgid()."
20697 set gid_t gidtype xxx stdio.h sys/types.h
20701 xxx=`./findhdr sys/user.h`
20702 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20704 unsigned) dflt="$1 $2" ;;
20708 *) dflt="$gidtype";;
20711 gid_t) echo "gid_t found." ;;
20712 *) rp="What is the type for group ids returned by getgid()?"
20718 : Check the size of GID
20721 *_t) zzz="$gidtype" ;;
20724 echo "Checking the size of $zzz..." >&4
20726 #include <sys/types.h>
20728 #$i_stdlib I_STDLIB
20730 #include <stdlib.h>
20733 printf("%d\n", (int)sizeof($gidtype));
20738 if eval $compile_ok; then
20742 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20745 echo "Your $zzz is $gidsize bytes long."
20750 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20754 : Check if GID is signed
20757 *_t) zzz="$gidtype" ;;
20760 echo "Checking the sign of $zzz..." >&4
20762 #include <sys/types.h>
20773 if eval $compile; then
20777 echo "(I can't execute the test program--guessing unsigned.)" >&4
20781 1) echo "Your $zzz is unsigned." ;;
20782 -1) echo "Your $zzz is signed." ;;
20788 echo "(I can't compile the test program--guessing unsigned.)" >&4
20792 : Check 64bit sizes
20795 if $test X"$quadtype" != X; then
20797 echo "Checking how to print 64-bit integers..." >&4
20799 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20800 $cat >try.c <<'EOCP'
20801 #include <sys/types.h>
20804 int q = 12345678901;
20805 printf("%ld\n", q);
20809 if eval $compile; then
20813 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20814 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20815 echo "We will use %d."
20821 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20822 $cat >try.c <<'EOCP'
20823 #include <sys/types.h>
20826 long q = 12345678901;
20827 printf("%ld\n", q);
20831 if eval $compile; then
20835 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20836 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20837 echo "We will use %ld."
20843 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20844 $cat >try.c <<'EOCP'
20845 #include <sys/types.h>
20846 #include <inttypes.h>
20849 int64_t q = 12345678901;
20850 printf("%" PRId64 "\n", q);
20854 if eval $compile; then
20858 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20859 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20860 echo "We will use the C9X style."
20866 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20868 #include <sys/types.h>
20871 $quadtype q = 12345678901;
20872 printf("%Ld\n", q);
20876 if eval $compile; then
20880 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20881 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20882 echo "We will use %Ld."
20888 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20889 $cat >try.c <<'EOCP'
20890 #include <sys/types.h>
20893 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20894 printf("%lld\n", q);
20898 if eval $compile; then
20902 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20903 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20904 echo "We will use the %lld style."
20910 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20912 #include <sys/types.h>
20915 $quadtype q = 12345678901;
20916 printf("%qd\n", q);
20920 if eval $compile; then
20924 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20925 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20926 echo "We will use %qd."
20932 if $test X"$sPRId64" = X; then
20933 echo "Cannot figure out how to print 64-bit integers." >&4
20940 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20941 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20943 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20944 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20948 : Check format strings for internal types
20950 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20952 if $test X"$ivsize" = X8; then
20953 ivdformat="$sPRId64"
20954 uvuformat="$sPRIu64"
20955 uvoformat="$sPRIo64"
20956 uvxformat="$sPRIx64"
20957 uvXUformat="$sPRIXU64"
20959 if $test X"$ivsize" = X"$longsize"; then
20966 if $test X"$ivsize" = X"$intsize"; then
20974 if $test X"$ivsize" = X"$shortsize"; then
20985 if $test X"$usequadmath" = X"$define"; then
20993 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20994 nveformat="$sPRIeldbl"
20995 nvfformat="$sPRIfldbl"
20996 nvgformat="$sPRIgldbl"
20997 nvEUformat="$sPRIEUldbl"
20998 nvFUformat="$sPRIFUldbl"
20999 nvGUformat="$sPRIGUldbl"
21010 case "$ivdformat" in
21011 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21016 : Check format string for GID
21019 $echo "Checking the format string to be used for gids..." >&4
21022 -1) if $test X"$gidsize" = X"$ivsize"; then
21023 gidformat="$ivdformat"
21025 if $test X"$gidsize" = X"$longsize"; then
21028 if $test X"$gidsize" = X"$intsize"; then
21031 if $test X"$gidsize" = X"$shortsize"; then
21038 *) if $test X"$gidsize" = X"$uvsize"; then
21039 gidformat="$uvuformat"
21041 if $test X"$gidsize" = X"$longsize"; then
21044 if $test X"$gidsize" = X"$intsize"; then
21047 if $test X"$gidsize" = X"$shortsize"; then
21056 : see if getgroups exists
21057 set getgroups d_getgrps
21060 : see if setgroups exists
21061 set setgroups d_setgrps
21064 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21066 case "$d_getgrps$d_setgrps" in
21068 case "$groupstype" in
21069 '') dflt="$gidtype" ;;
21070 *) dflt="$groupstype" ;;
21073 What type of pointer is the second argument to getgroups() and setgroups()?
21074 Usually this is the same as group ids, $gidtype, but not always.
21077 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21081 *) groupstype="$gidtype";;
21084 : check whether make sets MAKE
21086 echo "Checking if your $make program sets \$(MAKE)..." >&4
21087 case "$make_set_make" in
21089 $sed 's/^X //' > testmake.mak << 'EOF'
21091 X @echo 'maketemp="$(MAKE)"'
21093 case "`$make -f testmake.mak 2>/dev/null`" in
21094 *maketemp=*) make_set_make='#' ;;
21095 *) make_set_make="MAKE=$make" ;;
21097 $rm -f testmake.mak
21100 case "$make_set_make" in
21101 '#') echo "Yup, it does.";;
21102 *) echo "Nope, it doesn't.";;
21105 : see what type is used for mode_t
21106 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21107 set mode_t modetype int stdio.h sys/types.h
21110 : see if we need va_copy
21112 case "$i_stdarg" in
21115 #include <stdarg.h>
21117 #$i_stdlib I_STDLIB
21119 #include <stdlib.h>
21121 #include <signal.h>
21124 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21126 return vfprintf(f, fmt, *valp);
21130 myvfprintf(FILE *f, const char *fmt, va_list val)
21132 return ivfprintf(f, fmt, &val);
21136 myprintf(char *fmt, ...)
21139 va_start(val, fmt);
21140 return myvfprintf(stdout, fmt, val);
21144 main(int ac, char **av)
21146 signal(SIGSEGV, exit);
21148 myprintf("%s%cs all right, then\n", "that", '\'');
21153 if eval $compile && $run ./try 2>&1 >/dev/null; then
21154 case "`$run ./try`" in
21155 "that's all right, then")
21161 yes) echo "It seems that you don't need va_copy()." >&4
21162 need_va_copy="$undef"
21164 *) echo "It seems that va_copy() or similar will be needed." >&4
21165 need_va_copy="$define"
21170 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21171 need_va_copy="$undef"
21175 : see what type is used for size_t
21176 rp="What is the type used for the length parameter for string functions?"
21177 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21180 : check for type of arguments to gethostbyaddr.
21181 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21182 case "$d_gethbyaddr" in
21186 Checking to see what type of arguments are accepted by gethostbyaddr().
21188 hdrs="$define sys/types.h
21189 $d_socket sys/socket.h
21190 $i_niin netinet/in.h
21192 $i_unistd unistd.h"
21193 : The first arg can 'char *' or 'void *'
21194 : The second arg is some of integral type
21195 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21196 for yyy in size_t long int; do
21197 case "$netdb_host_type" in
21198 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21199 if ./protochk "$try" $hdrs; then
21200 echo "Your system accepts $xxx for the first arg."
21201 echo "...and $yyy for the second arg."
21202 netdb_host_type="$xxx"
21203 netdb_hlen_type="$yyy"
21209 : In case none of those worked, prompt the user.
21210 case "$netdb_host_type" in
21211 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21214 netdb_host_type=$ans
21215 rp='What is the type for the 2nd argument to gethostbyaddr?'
21218 netdb_hlen_type=$ans
21222 *) : no gethostbyaddr, so pick harmless defaults
21223 netdb_host_type='char *'
21224 netdb_hlen_type="$sizetype"
21227 # Remove the "const" if needed. -- but then we'll have a
21229 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21232 : check for type of argument to gethostbyname.
21233 if test "X$netdb_name_type" = X ; then
21234 case "$d_gethbyname" in
21238 Checking to see what type of argument is accepted by gethostbyname().
21240 hdrs="$define sys/types.h
21241 $d_socket sys/socket.h
21242 $i_niin netinet/in.h
21244 $i_unistd unistd.h"
21245 for xxx in "const char *" "char *"; do
21246 case "$netdb_name_type" in
21247 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21248 if ./protochk "$try" $hdrs; then
21249 echo "Your system accepts $xxx."
21250 netdb_name_type="$xxx"
21255 : In case none of those worked, prompt the user.
21256 case "$netdb_name_type" in
21257 '') rp='What is the type for the 1st argument to gethostbyname?'
21260 netdb_name_type=$ans
21264 *) : no gethostbyname, so pick harmless default
21265 netdb_name_type='char *'
21270 : check for type of 1st argument to getnetbyaddr.
21271 if test "X$netdb_net_type" = X ; then
21272 case "$d_getnbyaddr" in
21276 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21278 hdrs="$define sys/types.h
21279 $d_socket sys/socket.h
21280 $i_niin netinet/in.h
21282 $i_unistd unistd.h"
21283 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21284 case "$netdb_net_type" in
21285 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21286 if ./protochk "$try" $hdrs; then
21287 echo "Your system accepts $xxx."
21288 netdb_net_type="$xxx"
21293 : In case none of those worked, prompt the user.
21294 case "$netdb_net_type" in
21295 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21298 netdb_net_type=$ans
21302 *) : no getnetbyaddr, so pick harmless default
21303 netdb_net_type='long'
21307 : locate the preferred pager for this system
21314 [a-zA-Z]:/*) dflt=$pg;;
21318 [a-zA-Z]:/*) dflt=$more;;
21322 [a-zA-Z]:/*) dflt=$less;;
21325 '') dflt=/usr/ucb/more;;
21333 rp='What pager is used on your system?'
21337 : see what type pids are declared as in the kernel
21338 rp="What is the type of process ids on this system?"
21339 set pid_t pidtype int stdio.h sys/types.h
21342 : see if ar generates random libraries by itself
21344 echo "Checking how to generate random libraries on your machine..." >&4
21345 echo 'int bar1() { return bar2(); }' > bar1.c
21346 echo 'int bar2() { return 2; }' > bar2.c
21348 #$i_stdlib I_STDLIB
21350 #include <stdlib.h>
21352 int main() { printf("%d\n", bar1()); exit(0); }
21354 $cc $ccflags -c bar1.c >/dev/null 2>&1
21355 $cc $ccflags -c bar2.c >/dev/null 2>&1
21356 $cc $ccflags -c foo.c >/dev/null 2>&1
21357 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21358 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21359 $run ./foobar >/dev/null 2>&1; then
21360 echo "$ar appears to generate random libraries itself."
21362 if [ "X$ranlib" = "X" ]; then
21365 elif $ar s bar$_a >/dev/null 2>&1 &&
21366 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21367 $run ./foobar >/dev/null 2>&1; then
21368 echo "a table of contents needs to be added with '$ar s'."
21371 elif $ar ts bar$_a >/dev/null 2>&1 &&
21372 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21373 $run ./foobar >/dev/null 2>&1; then
21374 echo "a table of contents needs to be added with '$ar ts'."
21381 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21382 $test -f $ranlib || ranlib=''
21385 if $test -n "$ranlib"; then
21386 echo "your system has '$ranlib'; we'll use that."
21389 echo "your system doesn't seem to support random libraries"
21390 echo "so we'll use lorder and tsort to order the libraries."
21397 : see if this is a values.h system
21398 set values.h i_values
21401 : Check the max offset that gmtime and localtime accept
21402 echo "Checking max offsets that gmtime () accepts"
21405 define) yyy="#include <values.h>" ;;
21409 case "$sGMTIME_min/$sGMTIME_max" in
21412 #include <sys/types.h>
21421 void gm_check (time_t t, int min_year, int max_year)
21424 if ( tmp == NULL ||
21425 /* Check tm_year overflow */
21426 tmp->tm_year < min_year || tmp->tm_year > max_year)
21437 gm_check (MAXLONG, 69, 0x7fffffff);
21439 if (tmp == NULL || tmp->tm_year < 0) {
21440 for (i = 63; i >= 0; i--) {
21441 time_t x = pt | ((time_t)1 << i);
21442 if (x < 0 || x < pt) continue;
21443 gm_check (x, 69, 0x7fffffff);
21446 printf ("sGMTIME_max=%ld\n", pt);
21455 gm_check (MINLONG, -1900, 70);
21458 for (i = 36; i >= 0; i--) {
21459 time_t x = pt - ((time_t)1 << i);
21460 if (x > 0) continue;
21461 gm_check (x, -1900, 70);
21464 printf ("sGMTIME_min=%ld\n", pt);
21468 int main (int argc, char *argv[])
21470 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21477 if eval $compile; then
21478 eval `$run ./try 2>/dev/null`
21480 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21486 echo "Checking max offsets that localtime () accepts"
21488 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21491 #include <sys/types.h>
21500 void local_check (time_t t, int min_year, int max_year)
21502 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21505 tmp = localtime (&t);
21506 if ( tmp == NULL ||
21507 /* Check tm_year overflow */
21508 tmp->tm_year < min_year || tmp->tm_year > max_year)
21512 } /* local_check */
21519 local_check (MAXLONG, 69, 0x7fffffff);
21521 if (tmp == NULL || tmp->tm_year < 0) {
21522 for (i = 63; i >= 0; i--) {
21523 time_t x = pt | ((time_t)1 << i);
21524 if (x < 0 || x < pt) continue;
21525 local_check (x, 69, 0x7fffffff);
21528 printf ("sLOCALTIME_max=%ld\n", pt);
21537 local_check (MINLONG, -1900, 70);
21540 for (i = 36; i >= 0; i--) {
21541 time_t x = pt - ((time_t)1 << i);
21542 if (x > 0) continue;
21543 local_check (x, -1900, 70);
21546 printf ("sLOCALTIME_min=%ld\n", pt);
21550 int main (int argc, char *argv[])
21558 if eval $compile; then
21559 eval `$run ./try 2>/dev/null`
21561 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21567 : check for type of arguments to select.
21568 case "$selecttype" in
21569 '') case "$d_select" in
21573 Checking to see what type of arguments are accepted by select().
21575 hdrs="$define sys/types.h
21576 $i_systime sys/time.h
21577 $i_sysselct sys/select.h
21578 $d_socket sys/socket.h"
21579 : The first arg can be int, unsigned, or size_t
21580 : The last arg may or may not be 'const'
21582 : void pointer has been seen but using that
21583 : breaks the selectminbits test
21584 for xxx in 'fd_set *' 'int *'; do
21585 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21586 for tmo in 'struct timeval *' 'const struct timeval *'; do
21588 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21589 if ./protochk "$try" $hdrs; then
21590 echo "Your system accepts $xxx."
21599 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21600 case "$d_fd_set" in
21601 $define) dflt="fd_set *" ;;
21610 *) : no select, so pick a harmless default
21617 : check for the select 'width'
21618 case "$selectminbits" in
21619 '') safebits=`expr $ptrsize \* 8`
21620 case "$d_select" in
21624 Checking to see on how many bits at a time your select() operates...
21627 #include <sys/types.h>
21629 #$i_systime I_SYS_TIME
21630 #$i_systimek I_SYS_TIME_KERNEL
21635 # ifdef I_SYS_TIME_KERNEL
21638 # include <sys/time.h>
21639 # ifdef I_SYS_TIME_KERNEL
21643 #$i_sysselct I_SYS_SELECT
21644 #ifdef I_SYS_SELECT
21645 #include <sys/select.h>
21647 #$d_socket HAS_SOCKET
21649 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21652 #$i_stdlib I_STDLIB
21654 #include <stdlib.h>
21657 #define S sizeof(*(b))
21659 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21660 #define NBITS (NBYTES * 8)
21662 char *s = (char *)malloc(NBYTES);
21671 fp = fopen("try.c", "r");
21677 b = ($selecttype)s;
21678 for (i = 0; i < NBITS; i++)
21682 select(fd + 1, b, 0, 0, &t);
21683 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21685 printf("%d\n", i + 1);
21690 if eval $compile_ok; then
21691 selectminbits=`$run ./try 2>/dev/null`
21692 case "$selectminbits" in
21694 Cannot figure out on how many bits at a time your select() operates.
21695 I'll play safe and guess it is $safebits bits.
21697 selectminbits=$safebits
21698 bits="$safebits bits"
21701 *) bits="$selectminbits bits" ;;
21703 echo "Your select() operates on $bits at a time." >&4
21705 rp='What is the minimum number of bits your select() operates on?'
21706 case "$byteorder" in
21707 12345678) dflt=64 ;;
21713 selectminbits="$val"
21717 *) : no select, so pick a harmless default
21718 selectminbits=$safebits
21724 : Trace out the files included by signal.h, then look for SIGxxx names.
21725 if [ "X$fieldn" = X ]; then
21726 : Just make some guesses. We check them later.
21727 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21729 xxx=`echo '#include <signal.h>' |
21730 $cppstdin $cppminus $cppflags 2>/dev/null |
21731 $grep '^[ ]*#.*include' |
21732 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21733 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21736 for xx in $xxx /dev/null ; do
21737 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21739 case "$xxxfiles" in
21740 '') xxxfiles=`./findhdr signal.h` ;;
21743 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21744 print substr($2, 4, 20)
21746 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21747 print substr($3, 4, 20)
21749 : Append some common names just in case the awk scan failed.
21750 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21751 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21752 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21753 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21754 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21756 : generate a few handy files for later
21757 $cat > signal.c <<EOCP
21758 #include <sys/types.h>
21759 #include <signal.h>
21760 #$i_stdlib I_STDLIB
21762 #include <stdlib.h>
21767 /* Strange style to avoid deeply-nested #if/#else/#endif */
21770 # define NSIG (_NSIG)
21776 # define NSIG (SIGMAX+1)
21782 # define NSIG (SIG_MAX+1)
21788 # define NSIG (_SIG_MAX+1)
21794 # define NSIG (MAXSIG+1)
21800 # define NSIG (MAX_SIG+1)
21805 # ifdef SIGARRAYSIZE
21806 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21812 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21816 /* Default to some arbitrary number that's big enough to get most
21817 of the common signals.
21823 printf("NSIG %d\n", NSIG);
21829 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21831 printf "#ifdef SIG"; printf $1; printf "\n"
21832 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21833 printf $1; printf ");\n"
21837 printf "#endif /* JUST_NSIG */\n";
21838 printf "exit(0);\n}\n";
21841 $cat >signal.awk <<'EOP'
21842 BEGIN { ndups = 0 }
21843 $1 ~ /^NSIG$/ { nsig = $2 }
21844 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21845 if ($2 > maxsig) { maxsig = $2 }
21846 if (sig_name[$2]) {
21847 dup_name[ndups] = $1
21848 dup_num[ndups] = $2
21860 printf("NSIG %d\n", nsig);
21861 for (n = 1; n < nsig; n++) {
21863 printf("%s %d\n", sig_name[n], sig_num[n])
21866 printf("NUM%d %d\n", n, n)
21869 for (n = 0; n < ndups; n++) {
21870 printf("%s %d\n", dup_name[n], dup_num[n])
21874 $cat >signal_cmd <<EOS
21876 if $test -s signal.lst; then
21877 echo "Using your existing signal.lst file"
21882 $cat >>signal_cmd <<'EOS'
21885 if eval $compile_ok; then
21886 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21887 $uniq | $awk -f signal.awk >signal.lst
21889 echo "(I can't seem be able to compile the whole test program)" >&4
21890 echo "(I'll try it in little pieces.)" >&4
21891 set signal -DJUST_NSIG
21892 if eval $compile_ok; then
21893 $run ./signal$_exe > signal.nsg
21896 echo "I can't seem to figure out how many signals you have." >&4
21897 echo "Guessing 50." >&4
21898 echo 'NSIG 50' > signal.nsg
21900 : Now look at all the signal names, one at a time.
21901 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21902 $cat > signal.c <<EOCP
21903 #include <sys/types.h>
21904 #include <signal.h>
21907 printf("$xx %d\n", SIG${xx});
21912 if eval $compile; then
21913 echo "SIG${xx} found."
21914 $run ./signal$_exe >> signal.ls1
21916 echo "SIG${xx} NOT found."
21919 if $test -s signal.ls1; then
21920 $cat signal.nsg signal.ls1 |
21921 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21925 if $test -s signal.lst; then
21928 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21929 echo 'kill -l' >signal
21930 set X `csh -f <signal`
21934 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21936 echo $@ | $tr ' ' $trnl | \
21937 $awk '{ printf "%s %d\n", $1, ++s; }
21938 END { printf "NSIG %d\n", ++s }' >signal.lst
21940 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21942 chmod a+x signal_cmd
21943 $eunicefix signal_cmd
21945 : generate list of signal names
21947 case "$sig_name_init" in
21949 *) case "$sig_num_init" in
21950 ''|*,*) doinit=yes ;;
21955 echo "Generating a list of signal names and numbers..." >&4
21957 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21958 sig_name=`$awk 'BEGIN { printf "ZERO " }
21959 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21960 sig_num=`$awk 'BEGIN { printf "0 " }
21961 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21962 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21963 !/^NSIG/ { printf "\"%s\", ", $1 }
21964 END { printf "0\n" }' signal.lst`
21965 sig_num_init=`$awk 'BEGIN { printf "0, " }
21966 !/^NSIG/ { printf "%d, ", $2}
21967 END { printf "0\n"}' signal.lst`
21970 echo "The following $sig_count signals are available:"
21972 echo $sig_name | $awk \
21973 'BEGIN { linelen = 0 }
21975 for (i = 1; i <= NF; i++) {
21976 name = "SIG" $i " "
21977 linelen = linelen + length(name)
21978 if (linelen > 70) {
21980 linelen = length(name)
21986 sig_size=`echo $sig_name | awk '{print NF}'`
21987 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21989 : Check size of size
21991 case "$sizetype" in
21992 *_t) zzz="$sizetype" ;;
21993 *) zzz="filesize" ;;
21995 echo "Checking the size of $zzz..." >&4
21997 #include <sys/types.h>
21999 #$i_stdlib I_STDLIB
22001 #include <stdlib.h>
22004 printf("%d\n", (int)sizeof($sizetype));
22009 if eval $compile_ok; then
22013 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22016 echo "Your $zzz size is $sizesize bytes."
22021 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22025 : check for socklen_t
22027 echo "Checking to see if you have socklen_t..." >&4
22029 #include <sys/types.h>
22030 #$d_socket HAS_SOCKET
22032 #include <sys/socket.h>
22034 int main() { socklen_t x = 16; }
22037 if eval $compile; then
22039 echo "You have socklen_t."
22042 echo "You do not have socklen_t."
22043 case "$sizetype" in
22044 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22051 : see if this is a socks.h system
22052 set socks.h i_socks
22055 : check for type of the size argument to socket calls
22056 case "$d_socket" in
22060 Checking to see what type is the last argument of accept().
22063 case "$d_socklen_t" in
22064 "$define") yyy="$yyy socklen_t"
22066 yyy="$yyy $sizetype int long unsigned"
22067 for xxx in $yyy; do
22068 case "$socksizetype" in
22069 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22070 case "$usesocks" in
22072 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22073 echo "Your system accepts '$xxx *' for the last argument of accept()."
22074 socksizetype="$xxx"
22077 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22078 echo "Your system accepts '$xxx *' for the last argument of accept()."
22079 socksizetype="$xxx"
22086 : In case none of those worked, prompt the user.
22087 case "$socksizetype" in
22088 '') rp='What is the type for socket address structure sizes?'
22095 *) : no sockets, so pick relatively harmless default
22100 : see what type is used for signed size_t
22101 set ssize_t ssizetype int stdio.h sys/types.h
22106 #$i_stdlib I_STDLIB
22108 #include <stdlib.h>
22110 #include <sys/types.h>
22111 #define Size_t $sizetype
22112 #define SSize_t $dflt
22115 if (sizeof(Size_t) == sizeof(SSize_t))
22117 else if (sizeof(Size_t) == sizeof(int))
22126 if eval $compile_ok && $run ./try > /dev/null; then
22127 ssizetype=`$run ./try`
22128 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22131 Help! I can't compile and run the ssize_t test program: please enlighten me!
22132 (This is probably a misconfiguration in your system or libraries, and
22133 you really ought to fix it. Still, I'll try anyway.)
22135 I need a type that is the same size as $sizetype, but is guaranteed to
22136 be signed. Common values are ssize_t, int and long.
22139 rp="What signed type is the same size as $sizetype?"
22145 : Check the size of st_ino
22147 $echo "Checking the size of st_ino..." >&4
22148 $cat > try.c <<EOCP
22149 #include <sys/stat.h>
22151 #$i_stdlib I_STDLIB
22153 #include <stdlib.h>
22157 printf("%d\n", (int)sizeof(st.st_ino));
22162 if eval $compile_ok; then
22166 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22168 *) st_ino_size=$val
22169 $echo "Your st_ino is $st_ino_size bytes long."
22174 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22178 : Check if st_ino is signed
22180 $echo "Checking the sign of st_ino..." >&4
22181 $cat > try.c <<EOCP
22182 #include <sys/stat.h>
22187 if (foo.st_ino < 0)
22194 if eval $compile; then
22198 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22200 *) st_ino_sign=$val
22201 case "$st_ino_sign" in
22202 1) $echo "Your st_ino is unsigned." ;;
22203 -1) $echo "Your st_ino is signed." ;;
22209 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22213 : see what type of char stdio uses.
22215 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22216 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22217 echo "Your stdio uses unsigned chars." >&4
22218 stdchar="unsigned char"
22220 echo "Your stdio uses signed chars." >&4
22225 : see what type uids are declared as in the kernel
22227 echo "Looking for the type for user ids returned by getuid()."
22228 set uid_t uidtype xxx stdio.h sys/types.h
22232 xxx=`./findhdr sys/user.h`
22233 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22235 unsigned) dflt="$1 $2" ;;
22239 *) dflt="$uidtype";;
22242 uid_t) echo "uid_t found." ;;
22243 *) rp="What is the type for user ids returned by getuid()?"
22249 : Check size of UID
22252 *_t) zzz="$uidtype" ;;
22255 echo "Checking the size of $zzz..." >&4
22257 #include <sys/types.h>
22259 #$i_stdlib I_STDLIB
22261 #include <stdlib.h>
22264 printf("%d\n", (int)sizeof($uidtype));
22269 if eval $compile_ok; then
22273 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22276 echo "Your $zzz is $uidsize bytes long."
22281 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22284 : Check if UID is signed
22287 *_t) zzz="$uidtype" ;;
22290 echo "Checking the sign of $zzz..." >&4
22292 #include <sys/types.h>
22303 if eval $compile; then
22307 echo "(I can't execute the test program--guessing unsigned.)" >&4
22311 1) echo "Your $zzz is unsigned." ;;
22312 -1) echo "Your $zzz is signed." ;;
22318 echo "(I can't compile the test program--guessing unsigned.)" >&4
22322 : Check format string for UID
22324 $echo "Checking the format string to be used for uids..." >&4
22327 -1) if $test X"$uidsize" = X"$ivsize"; then
22328 uidformat="$ivdformat"
22330 if $test X"$uidsize" = X"$longsize"; then
22333 if $test X"$uidsize" = X"$intsize"; then
22336 if $test X"$uidsize" = X"$shortsize"; then
22343 *) if $test X"$uidsize" = X"$uvsize"; then
22344 uidformat="$uvuformat"
22346 if $test X"$uidsize" = X"$longsize"; then
22349 if $test X"$uidsize" = X"$intsize"; then
22352 if $test X"$uidsize" = X"$shortsize"; then
22361 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22363 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22364 $cat >try.c <<'EOM'
22365 /* Intentionally a long probe as I'd like to sanity check that the exact
22366 approach is going to work, as thinking it will work, but only having it
22367 part working at runtime is worse than not having it. */
22369 #include <sys/types.h>
22370 #include <sys/sysctl.h>
22371 #include <sys/param.h>
22373 #include <string.h>
22374 #include <stdlib.h>
22375 #include <unistd.h>
22378 main(int argc, char **argv) {
22380 char *argv_leaf = strrchr(argv[0], '/');
22386 mib[1] = KERN_PROC;
22387 mib[2] = KERN_PROC_PATHNAME;
22391 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22395 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22400 if (size < strlen(argv_leaf) + 1) {
22401 fprintf(stderr, "size %lu is too short for a path\n",
22402 (unsigned long) size);
22406 if (size > MAXPATHLEN * MAXPATHLEN) {
22407 fprintf(stderr, "size %lu is too long for a path\n",
22408 (unsigned long) size);
22412 buffer = malloc(size);
22418 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22423 if (strlen(buffer) + 1 != size) {
22424 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22425 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22430 if (*buffer != '/') {
22431 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22435 if (strstr(buffer, "/./")) {
22436 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22440 if (strstr(buffer, "/../")) {
22441 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22445 buffer_leaf = strrchr(buffer, '/');
22446 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22447 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22459 if eval $compile; then
22460 if $run ./try; then
22461 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22464 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22468 echo "I'm unable to compile the test program." >&4
22469 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22473 set usekernprocpathname
22476 : Determine if we can use _NSGetExecutablePath to find executing program
22478 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22479 $cat >try.c <<'EOM'
22480 /* Intentionally a long probe as I'd like to sanity check that the exact
22481 approach is going to work, as thinking it will work, but only having it
22482 part working at runtime is worse than not having it. */
22483 #include <mach-o/dyld.h>
22485 #include <stdlib.h>
22486 #include <sys/param.h>
22487 #include <string.h>
22490 main(int argc, char **argv) {
22492 uint32_t size = sizeof(buf);
22496 char *argv_leaf = strrchr(argv[0], '/');
22500 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22504 _NSGetExecutablePath(buf, &size);
22505 if (size > MAXPATHLEN * MAXPATHLEN) {
22506 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22507 (unsigned int) size);
22511 buffer = malloc(size);
22517 result = _NSGetExecutablePath(buffer, &size);
22519 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22520 result, (unsigned int) size);
22524 tidied = realpath(buffer, NULL);
22526 perror("realpath");
22532 if (*tidied != '/') {
22533 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22537 if (strstr(tidied, "/./")) {
22538 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22542 if (strstr(tidied, "/../")) {
22543 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22547 tidied_leaf = strrchr(tidied, '/');
22548 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22549 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22561 if eval $compile; then
22562 if $run ./try; then
22563 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22566 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22569 echo "I'm unable to compile the test program." >&4
22570 echo "I'll assume no _NSGetExecutablePath here." >&4
22573 set usensgetexecutablepath
22576 : Check if site customization support was requested
22577 case "$usesitecustomize" in
22578 $define|true|[Yy]*)
22579 usesitecustomize="$define"
22582 usesitecustomize="$undef"
22586 : see if prototypes support variable argument declarations
22588 case "$prototype$i_stdarg" in
22590 echo "It appears we'll be able to prototype varargs functions." >&4
22594 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22601 : determine compiler compiler
22610 if $test -f "$byacc$_exe"; then
22612 comp="byacc or $comp"
22614 if $test -f "$bison$_exe"; then
22615 comp="$comp or bison -y"
22617 rp="Which compiler compiler ($comp) shall I use?"
22626 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22632 : see if this is a assert.h system
22633 set assert.h i_assert
22636 : see if this is a bfd.h system
22640 : see if this is an execinfo.h system
22641 set execinfo.h i_execinfo
22644 : see if this is a fenv.h system
22648 : see if this is a fp.h system
22652 : see if this is a fp_class.h system
22653 set fp_class.h i_fp_class
22656 : see if gdbm.h is available
22661 : see if gdbm_open exists
22662 set gdbm_open d_gdbm_open
22664 case "$d_gdbm_open" in
22667 echo "We won't be including <gdbm.h>"
22676 : see if this is a ieeefp.h system
22677 case "$i_ieeefp" in
22678 '' ) set ieeefp.h i_ieeefp
22683 : see if this is a libutil.h system
22684 set libutil.h i_libutil
22687 : see if mach cthreads are available
22688 if test "X$usethreads" = "X$define"; then
22689 set mach/cthreads.h i_machcthr
22692 i_machcthr="$undef"
22695 : see if this is a mntent.h system
22696 set mntent.h i_mntent
22699 : see if net/errno.h is available
22701 set net/errno.h val
22704 : Unfortunately, it causes problems on some systems. Arrgh.
22707 cat > try.c <<'EOM'
22710 #include <net/errno.h>
22716 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22717 echo "We'll be including <net/errno.h>." >&4
22719 echo "We won't be including <net/errno.h>." >&4
22728 : see if netinet/tcp.h is available
22729 set netinet/tcp.h i_netinettcp
22732 : see if this is a poll.h system
22736 : see if this is a prot.h system
22740 : Preprocessor symbols
22742 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22743 $cat <<'EOSH' > Cppsym.know
22744 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22745 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22746 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22747 arch_pwr ardent ARM ARM32 atarist att386 att3b
22748 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22749 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22750 byteorder byte_order
22751 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22752 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22753 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22754 ELF encore EPI EXTENSIONS
22755 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22756 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22757 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22758 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22759 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22760 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22761 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22762 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22763 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22765 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22766 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22767 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22769 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22770 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22771 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22772 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22773 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22774 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22775 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22776 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22777 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22778 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22779 ns32000 ns32016 ns32332 ns32k nsc32000
22780 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22781 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22782 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22783 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22785 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22786 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22787 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22788 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22789 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22790 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22791 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22792 SYSV4 SYSV5 sysV68 sysV88
22793 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22794 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22795 tower32_800 tower32_850 tss
22796 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22797 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22798 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22799 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22800 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22801 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22803 vax venix VMESA vms
22804 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22805 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22808 # Maybe put other stuff here too.
22809 ./tr '-' '_' <<EOSH >>Cppsym.know
22812 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22813 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22814 $cat Cppsym.know > Cppsym.c
22815 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22816 $rm -f Cppsym.a Cppsym.b Cppsym.c
22817 cat <<EOSH > Cppsym
22819 if $test \$# -gt 0; then
22820 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22821 if $test -s Cppsym.got; then
22828 $tr " " "$trnl" | ./Cppsym.try
22834 cat <<EOSH > Cppsym.try
22836 cat <<'EOCP' > try.c
22839 #define STRINGIFY(a) "a"
22841 #if cpp_stuff == 42
22842 #define StGiFy(a) #a
22843 #define STRINGIFY(a) StGiFy(a)
22845 #if $cpp_stuff != 1 && $cpp_stuff != 42
22846 # include "Bletch: How does this C preprocessor stringify macros?"
22852 cat <<'EOSH' >> Cppsym.try
22854 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22855 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22856 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22857 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22859 echo 'return 0;}' >> try.c
22861 cat <<EOSH >> Cppsym.try
22863 case "$osname-$gccversion" in
22864 irix-) ccflags="\$ccflags -woff 1178" ;;
22865 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22867 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22869 chmod +x Cppsym.try
22870 $eunicefix Cppsym.try
22871 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22872 : Add in any Linux cpp "predefined macros":
22873 case "$osname::$gccversion" in
22874 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22876 rm -f $tHdrH'.h' $tHdrH
22878 # Filter out macro arguments, such as Linux's __INT8_C(c)
22879 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22880 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22881 if [ -s $tHdrH'_cppsym.real' ]; then
22882 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22885 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22888 : now check the C compiler for additional symbols
22889 postprocess_cc_v=''
22891 aix) postprocess_cc_v="|$tr , ' '" ;;
22898 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22901 -D*) echo "\$i" | $sed 's/^-D//';;
22902 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22907 postprocess_cc_v=''
22910 ./ccsym > ccsym1.raw
22911 if $test -s ccsym1.raw; then
22912 $sort ccsym1.raw | $uniq >ccsym.raw
22914 mv ccsym1.raw ccsym.raw
22917 $awk '/\=/ { print $0; next }
22918 { print $0"=1" }' ccsym.raw >ccsym.list
22919 $comm -13 Cppsym.true ccsym.list >ccsym.own
22920 $comm -12 Cppsym.true ccsym.list >ccsym.com
22921 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22923 if $test -z ccsym.raw; then
22924 echo "Your C compiler doesn't seem to define any symbols!" >&4
22926 echo "However, your C preprocessor defines the following symbols:"
22929 cppsymbols=`$cat Cppsym.true`
22930 cppsymbols=`echo $cppsymbols`
22931 cppccsymbols="$cppsymbols"
22933 if $test -s ccsym.com; then
22934 echo "Your C compiler and pre-processor define these symbols:"
22935 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22938 cppccsymbols=`$cat ccsym.com`
22939 cppccsymbols=`echo $cppccsymbols`
22940 $test "$silent" || sleep 1
22942 if $test -s ccsym.cpp; then
22943 $test "$also" && echo " "
22944 echo "Your C pre-processor ${also}defines the following symbols:"
22945 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22947 cppsymbols=`$cat ccsym.cpp`
22948 cppsymbols=`echo $cppsymbols`
22949 $test "$silent" || sleep 1
22951 if $test -s ccsym.own; then
22952 $test "$also" && echo " "
22953 echo "Your C compiler ${also}defines the following cpp symbols:"
22954 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22955 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22956 ccsymbols=`$cat ccsym.own`
22957 ccsymbols=`echo $ccsymbols`
22958 $test "$silent" || sleep 1
22962 : add -D_FORTIFY_SOURCE if feasible and not already there
22963 case "$gccversion" in
22964 4.*) case "$optimize$ccflags" in
22965 *-O*) case "$ccflags$cppsymbols" in
22966 *_FORTIFY_SOURCE=*) # Don't add it again.
22967 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22969 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22970 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22974 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22978 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22982 : see if this is a termio system
22986 if $test `./findhdr termios.h`; then
22987 set tcsetattr i_termios
22993 "$define") echo "You have POSIX termios.h... good!" >&4;;
22994 *) if ./Cppsym pyr; then
22995 case "`$run /bin/universe`" in
22996 ucb) if $test `./findhdr sgtty.h`; then
22998 echo "<sgtty.h> found." >&4
23000 echo "System is pyramid with BSD universe."
23001 ./warn "<sgtty.h> not found--you could have problems."
23003 *) if $test `./findhdr termio.h`; then
23005 echo "<termio.h> found." >&4
23007 echo "System is pyramid with USG universe."
23008 ./warn "<termio.h> not found--you could have problems."
23012 if $test `./findhdr termio.h`; then
23013 echo "<termio.h> found." >&4
23015 elif $test `./findhdr sgtty.h`; then
23016 echo "<sgtty.h> found." >&4
23019 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23022 if $test `./findhdr sgtty.h`; then
23023 echo "<sgtty.h> found." >&4
23025 elif $test `./findhdr termio.h`; then
23026 echo "<termio.h> found." >&4
23029 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23033 set i_termio; eval $setvar
23034 val=$val2; set i_sgtty; eval $setvar
23035 val=$val3; set i_termios; eval $setvar
23037 : see if stdbool is available
23038 : we want a real compile instead of Inhdr because some Solaris systems
23039 : have stdbool.h, but it can only be used if the compiler indicates it
23040 : is sufficiently c99-compliant.
23044 #include <stdbool.h>
23049 int main(int argc, char **argv)
23055 if eval $compile; then
23056 echo "<stdbool.h> found." >&4
23059 echo "<stdbool.h> NOT found." >&4
23066 : see if stddef is available
23067 set stddef.h i_stddef
23070 : see if stdint is available
23071 set stdint.h i_stdint
23074 : see if sys/access.h is available
23075 set sys/access.h i_sysaccess
23078 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23079 set sys/filio.h i_sysfilio
23082 if $test `./findhdr sys/ioctl.h`; then
23084 echo '<sys/ioctl.h> found.' >&4
23087 if $test $i_sysfilio = "$define"; then
23088 echo '<sys/ioctl.h> NOT found.' >&4
23090 $test $i_sgtty = "$define" && xxx="sgtty.h"
23091 $test $i_termio = "$define" && xxx="termio.h"
23092 $test $i_termios = "$define" && xxx="termios.h"
23093 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23099 : see if socket ioctl defs are in sys/sockio.h
23101 xxx=`./findhdr sys/sockio.h`
23102 if $test "$xxx"; then
23103 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23105 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23108 echo "No socket ioctls found in <sys/sockio.h>." >&4
23113 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23119 : see if this is a syslog.h system
23120 set syslog.h i_syslog
23123 : see if this is a sys/mode.h system
23124 set sys/mode.h i_sysmode
23127 : see if there is a sys/poll.h file
23128 set sys/poll.h i_syspoll
23131 : see if sys/resource.h has to be included
23132 set sys/resource.h i_sysresrc
23135 : see if sys/security.h is available
23136 set sys/security.h i_syssecrt
23139 : see if this is a sys/statvfs.h system
23140 set sys/statvfs.h i_sysstatvfs
23143 : see if this is a sys/un.h system
23144 set sys/un.h i_sysun
23147 : see if this is a sys/utsname.h system
23148 set sys/utsname.h i_sysutsname
23151 : see if this is a syswait system
23152 set sys/wait.h i_syswait
23155 : see if this is a ustat.h system
23156 set ustat.h i_ustat
23159 : see if this is an utime system
23160 set utime.h i_utime
23163 : see if this is a vfork system
23166 set vfork.h i_vfork
23176 echo "Looking for extensions..." >&4
23177 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23178 : contain old or inaccurate or duplicate values.
23179 nonxs_extensions=''
23181 : We do not use find because it might not be available.
23182 : We do not just use MANIFEST because the user may have dropped
23183 : some additional extensions into the source tree and expect them
23186 : Function to recursively find available extensions, ignoring DynaLoader
23187 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23188 : In 5.10.1 and later, extensions are stored in directories
23189 : like File-Glob instead of the older File/Glob/.
23193 DynaLoader|dynaload) ;;
23195 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
23196 case "$this_ext" in
23197 Scalar/List/Utils) this_ext="List/Util" ;;
23198 PathTools) this_ext="Cwd" ;;
23200 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
23201 if $contains " $this_ext " $tdir/$$.tmp; then
23203 echo "Duplicate directories detected for extension $xxx" >&4;
23204 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23205 case "$knowitall" in
23213 echo "Ok. Stopping Configure." >&4;
23214 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23217 echo "Ok. You will need to correct config.sh before running make." >&4;
23219 $ls -1 $xxx > $tdir/$$.tmp;
23220 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
23221 xs_extensions="$xs_extensions $this_ext";
23222 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
23223 xs_extensions="$xs_extensions $this_ext";
23224 elif $test -d $xxx; then
23225 nonxs_extensions="$nonxs_extensions $this_ext";
23227 $rm -f $tdir/$$.tmp;
23235 eval $find_extensions
23239 eval $find_extensions
23243 eval $find_extensions
23244 set X $xs_extensions
23246 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23247 set X $nonxs_extensions
23249 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23251 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23253 : Now see which are supported on this system.
23255 for xxx in $xs_extensions ; do
23259 $define) avail_ext="$avail_ext $xxx" ;;
23262 GDBM_File|gdbm_fil)
23264 $define) avail_ext="$avail_ext $xxx" ;;
23267 I18N/Langinfo|i18n_lan)
23268 case "$i_langinfo$d_nl_langinfo" in
23269 $define$define) avail_ext="$avail_ext $xxx" ;;
23273 : XXX Do we need a useipcsysv variable here
23274 case "${d_msg}${d_sem}${d_shm}" in
23275 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23278 NDBM_File|ndbm_fil)
23281 case "$osname-$use64bitint" in
23284 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23287 *) avail_ext="$avail_ext $xxx" ;;
23292 ODBM_File|odbm_fil)
23293 case "${i_dbm}${i_rpcsvcdbm}" in
23295 case "$d_cplusplus" in
23296 define) ;; # delete as a function name will not work
23297 *) case "$osname-$use64bitint" in
23300 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23303 *) avail_ext="$avail_ext $xxx" ;;
23311 case "$useopcode" in
23312 true|define|y) avail_ext="$avail_ext $xxx" ;;
23316 case "$useposix" in
23317 true|define|y) avail_ext="$avail_ext $xxx" ;;
23321 case "$d_socket" in
23322 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23325 Sys/Syslog|sys/syslog)
23326 : XXX syslog requires socket
23327 case "$d_socket" in
23328 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23332 case "$usethreads" in
23334 case "$use5005threads" in
23335 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23339 threads|threads/shared)
23340 # threads and threads::shared are special cases.
23341 # To stop people from asking "Perl 5.8.0 was supposed
23342 # to have this new fancy threads implementation but my
23343 # perl doesn't have it" and from people trying to
23344 # (re)install the threads module using CPAN.pm and
23345 # CPAN.pm then offering to reinstall Perl 5.8.0,
23346 # the threads.pm and threads/shared.pm will always be
23347 # there, croaking informatively ("you need to rebuild
23348 # all of Perl with threads, sorry") when threads haven't
23349 # been compiled in.
23351 avail_ext="$avail_ext $xxx"
23357 cygwin) avail_ext="$avail_ext $xxx" ;;
23360 XS/APItest|xs/apitest)
23361 # This is just for testing. Skip it unless we have dynamic loading.
23364 $define) avail_ext="$avail_ext $xxx" ;;
23367 XS/Typemap|xs/typemap)
23368 # This is just for testing. Skip it unless we have dynamic loading.
23370 $define) avail_ext="$avail_ext $xxx" ;;
23373 *) avail_ext="$avail_ext $xxx"
23382 case "$onlyextensions" in
23384 *) keepextensions=''
23385 echo "You have requested that only certain extensions be included..." >&4
23386 for i in $onlyextensions; do
23387 case " $avail_ext " in
23389 echo "Keeping extension $i."
23390 keepextensions="$keepextensions $i"
23392 *) echo "Ignoring extension $i." ;;
23395 avail_ext="$keepextensions"
23399 case "$noextensions" in
23401 *) keepextensions=''
23402 echo "You have requested that certain extensions be ignored..." >&4
23403 for i in $avail_ext; do
23404 case " $noextensions " in
23405 *" $i "*) echo "Ignoring extension $i." ;;
23406 *) echo "Keeping extension $i.";
23407 keepextensions="$keepextensions $i"
23411 avail_ext="$keepextensions"
23415 : Now see which nonxs extensions are supported on this system.
23416 : For now assume all are.
23418 for xxx in $nonxs_extensions ; do
23422 *) nonxs_ext="$nonxs_ext $xxx"
23434 A number of extensions are supplied with $package. You may choose to
23435 compile these extensions for dynamic loading (the default), compile
23436 them into the $package executable (static loading), or not include
23437 them at all. Answer "none" to include no extensions.
23438 Note that DynaLoader is always built and need not be mentioned here.
23441 case "$dynamic_ext" in
23443 : Exclude those listed in static_ext
23445 for xxx in $avail_ext; do
23446 case " $static_ext " in
23448 *) dflt="$dflt $xxx" ;;
23455 *) dflt="$dynamic_ext"
23456 # Perhaps we are reusing an old out-of-date config.sh.
23459 if test X"$dynamic_ext" != X"$avail_ext"; then
23461 NOTICE: Your previous config.sh list may be incorrect.
23462 The extensions now available to you are
23464 but the default list from your previous config.sh is
23476 rp="What extensions do you wish to load dynamically?"
23479 none) dynamic_ext=' ' ;;
23480 *) dynamic_ext="$ans" ;;
23483 case "$static_ext" in
23485 : Exclude those already listed in dynamic linking
23487 for xxx in $avail_ext; do
23488 case " $dynamic_ext " in
23490 *) dflt="$dflt $xxx" ;;
23497 *) dflt="$static_ext"
23504 rp="What extensions do you wish to load statically?"
23507 none) static_ext=' ' ;;
23508 *) static_ext="$ans" ;;
23513 A number of extensions are supplied with $package. Answer "none"
23514 to include no extensions.
23515 Note that DynaLoader is always built and need not be mentioned here.
23518 case "$static_ext" in
23519 '') dflt="$avail_ext" ;;
23520 *) dflt="$static_ext"
23521 # Perhaps we are reusing an old out-of-date config.sh.
23524 if test X"$static_ext" != X"$avail_ext"; then
23526 NOTICE: Your previous config.sh list may be incorrect.
23527 The extensions now available to you are
23529 but the default list from your previous config.sh is
23538 : Exclude those that are not xs extensions
23542 rp="What extensions do you wish to include?"
23545 none) static_ext=' ' ;;
23546 *) static_ext="$ans" ;;
23551 # Encode is a special case. If we are building Encode as a static
23552 # extension, we need to explicitly list its subextensions as well.
23553 # For other nested extensions, this is handled automatically by
23554 # the appropriate Makefile.PL.
23555 case " $static_ext " in
23556 *" Encode "*) # Add the subextensions of Encode
23558 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23559 static_ext="$static_ext Encode/$xxx"
23560 known_extensions="$known_extensions Encode/$xxx"
23566 set X $dynamic_ext $static_ext $nonxs_ext
23570 # Sanity check: We require an extension suitable for use with
23571 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23572 # should show up as failures in the test suite, but it's helpful to
23573 # catch them now.) The 'extensions' list is normally sorted
23574 # alphabetically, so we need to accept either
23575 # DB_File ... Fcntl ... IO ....
23576 # or something like
23577 # Fcntl ... NDBM_File ... IO ....
23578 case " $extensions" in
23579 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23580 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23581 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23582 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23583 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23587 : Remove libraries needed only for extensions
23588 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23589 : The exception is SunOS 4.x, which needs them.
23590 case "${osname}X${osvers}" in
23594 *) case "$usedl" in
23595 $define|true|[yY]*)
23596 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23600 *) perllibs="$libs"
23606 : Remove build directory name from cppstdin so it can be used from
23607 : either the present location or the final installed location.
23609 : Get out of the UU directory to get correct path name.
23611 case "$cppstdin" in
23613 echo "Stripping down cppstdin path name"
23619 : end of configuration questions
23621 echo "End of configuration questions."
23624 : back to where it started
23625 if test -d ../UU; then
23629 : configuration may be unconditionally patched via a 'config.arch' file
23630 if $test -f config.arch; then
23631 echo "I see a config.arch file, loading it." >&4
23635 : configuration may be patched via a 'config.over' file
23636 if $test -f config.over; then
23639 rp='I see a config.over file. Do you wish to load it?'
23642 n*) echo "OK, I'll ignore it.";;
23644 echo "Configuration override changes have been loaded."
23649 : in case they want portability, strip down executable paths
23650 case "$d_portable" in
23653 echo "Stripping down executable paths..." >&4
23654 for file in $loclist $trylist; do
23656 eval $file=`basename $temp`
23661 : create config.sh file
23663 echo "Creating config.sh..." >&4
23664 $spitshell <<EOT >config.sh
23667 # This file was produced by running the Configure script. It holds all the
23668 # definitions figured out by Configure. Should you modify one of these values,
23669 # do not forget to propagate your changes by running "Configure -der". You may
23670 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23673 # Package name : $package
23674 # Source directory : $src
23675 # Configuration time: $cf_time
23676 # Configured by : $cf_by
23677 # Target system : $myuname
23680 : Add in command line options if available
23681 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23683 $spitshell <<EOT >>config.sh
23692 Revision='$Revision'
23700 alignbytes='$alignbytes'
23701 ansi2knr='$ansi2knr'
23702 aphostname='$aphostname'
23703 api_revision='$api_revision'
23704 api_subversion='$api_subversion'
23705 api_version='$api_version'
23706 api_versionstring='$api_versionstring'
23709 archlibexp='$archlibexp'
23710 archname64='$archname64'
23711 archname='$archname'
23712 archobjs='$archobjs'
23713 asctime_r_proto='$asctime_r_proto'
23722 byteorder='$byteorder'
23724 castflags='$castflags'
23727 cccdlflags='$cccdlflags'
23728 ccdlflags='$ccdlflags'
23730 ccflags_uselargefiles='$ccflags_uselargefiles'
23732 ccsymbols='$ccsymbols'
23733 ccversion='$ccversion'
23735 cf_email='$cf_email'
23737 charbits='$charbits'
23738 charsize='$charsize'
23742 clocktype='$clocktype'
23744 compress='$compress'
23745 contains='$contains'
23749 cpp_stuff='$cpp_stuff'
23750 cppccsymbols='$cppccsymbols'
23751 cppflags='$cppflags'
23753 cppminus='$cppminus'
23755 cppstdin='$cppstdin'
23756 cppsymbols='$cppsymbols'
23757 crypt_r_proto='$crypt_r_proto'
23758 cryptlib='$cryptlib'
23760 ctermid_r_proto='$ctermid_r_proto'
23761 ctime_r_proto='$ctime_r_proto'
23762 d_Gconvert='$d_Gconvert'
23763 d_PRIEUldbl='$d_PRIEUldbl'
23764 d_PRIFUldbl='$d_PRIFUldbl'
23765 d_PRIGUldbl='$d_PRIGUldbl'
23766 d_PRIXU64='$d_PRIXU64'
23767 d_PRId64='$d_PRId64'
23768 d_PRIeldbl='$d_PRIeldbl'
23769 d_PRIfldbl='$d_PRIfldbl'
23770 d_PRIgldbl='$d_PRIgldbl'
23771 d_PRIi64='$d_PRIi64'
23772 d_PRIo64='$d_PRIo64'
23773 d_PRIu64='$d_PRIu64'
23774 d_PRIx64='$d_PRIx64'
23775 d_SCNfldbl='$d_SCNfldbl'
23776 d__fwalk='$d__fwalk'
23777 d_access='$d_access'
23778 d_accessx='$d_accessx'
23782 d_archlib='$d_archlib'
23783 d_asctime64='$d_asctime64'
23784 d_asctime_r='$d_asctime_r'
23789 d_attribute_deprecated='$d_attribute_deprecated'
23790 d_attribute_format='$d_attribute_format'
23791 d_attribute_malloc='$d_attribute_malloc'
23792 d_attribute_nonnull='$d_attribute_nonnull'
23793 d_attribute_noreturn='$d_attribute_noreturn'
23794 d_attribute_pure='$d_attribute_pure'
23795 d_attribute_unused='$d_attribute_unused'
23796 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23797 d_backtrace='$d_backtrace'
23801 d_bsdgetpgrp='$d_bsdgetpgrp'
23802 d_bsdsetpgrp='$d_bsdsetpgrp'
23803 d_builtin_choose_expr='$d_builtin_choose_expr'
23804 d_builtin_expect='$d_builtin_expect'
23806 d_c99_variadic_macros='$d_c99_variadic_macros'
23807 d_casti32='$d_casti32'
23808 d_castneg='$d_castneg'
23810 d_charvspr='$d_charvspr'
23812 d_chroot='$d_chroot'
23813 d_chsize='$d_chsize'
23815 d_clearenv='$d_clearenv'
23816 d_closedir='$d_closedir'
23817 d_cmsghdr_s='$d_cmsghdr_s'
23819 d_copysign='$d_copysign'
23820 d_copysignl='$d_copysignl'
23821 d_cplusplus='$d_cplusplus'
23823 d_crypt_r='$d_crypt_r'
23825 d_ctermid='$d_ctermid'
23826 d_ctermid_r='$d_ctermid_r'
23827 d_ctime64='$d_ctime64'
23828 d_ctime_r='$d_ctime_r'
23829 d_cuserid='$d_cuserid'
23830 d_dbl_dig='$d_dbl_dig'
23831 d_dbminitproto='$d_dbminitproto'
23832 d_difftime64='$d_difftime64'
23833 d_difftime='$d_difftime'
23834 d_dir_dd_fd='$d_dir_dd_fd'
23836 d_dirnamlen='$d_dirnamlen'
23837 d_dladdr='$d_dladdr'
23838 d_dlerror='$d_dlerror'
23839 d_dlopen='$d_dlopen'
23840 d_dlsymun='$d_dlsymun'
23841 d_dosuid='$d_dosuid'
23842 d_drand48_r='$d_drand48_r'
23843 d_drand48proto='$d_drand48proto'
23845 d_eaccess='$d_eaccess'
23846 d_endgrent='$d_endgrent'
23847 d_endgrent_r='$d_endgrent_r'
23848 d_endhent='$d_endhent'
23849 d_endhostent_r='$d_endhostent_r'
23850 d_endnent='$d_endnent'
23851 d_endnetent_r='$d_endnetent_r'
23852 d_endpent='$d_endpent'
23853 d_endprotoent_r='$d_endprotoent_r'
23854 d_endpwent='$d_endpwent'
23855 d_endpwent_r='$d_endpwent_r'
23856 d_endsent='$d_endsent'
23857 d_endservent_r='$d_endservent_r'
23858 d_eofnblk='$d_eofnblk'
23861 d_eunice='$d_eunice'
23864 d_faststdio='$d_faststdio'
23865 d_fchdir='$d_fchdir'
23866 d_fchmod='$d_fchmod'
23867 d_fchown='$d_fchown'
23869 d_fcntl_can_lock='$d_fcntl_can_lock'
23870 d_fd_macros='$d_fd_macros'
23871 d_fd_set='$d_fd_set'
23873 d_fds_bits='$d_fds_bits'
23874 d_fegetround='$d_fegetround'
23875 d_fgetpos='$d_fgetpos'
23876 d_finite='$d_finite'
23877 d_finitel='$d_finitel'
23878 d_flexfnam='$d_flexfnam'
23880 d_flockproto='$d_flockproto'
23885 d_fp_class='$d_fp_class'
23886 d_fp_classify='$d_fp_classify'
23887 d_fp_classl='$d_fp_classl'
23888 d_fpathconf='$d_fpathconf'
23889 d_fpclass='$d_fpclass'
23890 d_fpclassify='$d_fpclassify'
23891 d_fpclassl='$d_fpclassl'
23892 d_fpgetround='$d_fpgetround'
23893 d_fpos64_t='$d_fpos64_t'
23894 d_frexpl='$d_frexpl'
23895 d_fs_data_s='$d_fs_data_s'
23896 d_fseeko='$d_fseeko'
23897 d_fsetpos='$d_fsetpos'
23898 d_fstatfs='$d_fstatfs'
23899 d_fstatvfs='$d_fstatvfs'
23901 d_ftello='$d_ftello'
23903 d_futimes='$d_futimes'
23904 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23905 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23906 d_getaddrinfo='$d_getaddrinfo'
23907 d_getcwd='$d_getcwd'
23908 d_getespwnam='$d_getespwnam'
23909 d_getfsstat='$d_getfsstat'
23910 d_getgrent='$d_getgrent'
23911 d_getgrent_r='$d_getgrent_r'
23912 d_getgrgid_r='$d_getgrgid_r'
23913 d_getgrnam_r='$d_getgrnam_r'
23914 d_getgrps='$d_getgrps'
23915 d_gethbyaddr='$d_gethbyaddr'
23916 d_gethbyname='$d_gethbyname'
23917 d_gethent='$d_gethent'
23918 d_gethname='$d_gethname'
23919 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23920 d_gethostbyname_r='$d_gethostbyname_r'
23921 d_gethostent_r='$d_gethostent_r'
23922 d_gethostprotos='$d_gethostprotos'
23923 d_getitimer='$d_getitimer'
23924 d_getlogin='$d_getlogin'
23925 d_getlogin_r='$d_getlogin_r'
23926 d_getmnt='$d_getmnt'
23927 d_getmntent='$d_getmntent'
23928 d_getnameinfo='$d_getnameinfo'
23929 d_getnbyaddr='$d_getnbyaddr'
23930 d_getnbyname='$d_getnbyname'
23931 d_getnent='$d_getnent'
23932 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23933 d_getnetbyname_r='$d_getnetbyname_r'
23934 d_getnetent_r='$d_getnetent_r'
23935 d_getnetprotos='$d_getnetprotos'
23936 d_getpagsz='$d_getpagsz'
23937 d_getpbyname='$d_getpbyname'
23938 d_getpbynumber='$d_getpbynumber'
23939 d_getpent='$d_getpent'
23940 d_getpgid='$d_getpgid'
23941 d_getpgrp2='$d_getpgrp2'
23942 d_getpgrp='$d_getpgrp'
23943 d_getppid='$d_getppid'
23944 d_getprior='$d_getprior'
23945 d_getprotobyname_r='$d_getprotobyname_r'
23946 d_getprotobynumber_r='$d_getprotobynumber_r'
23947 d_getprotoent_r='$d_getprotoent_r'
23948 d_getprotoprotos='$d_getprotoprotos'
23949 d_getprpwnam='$d_getprpwnam'
23950 d_getpwent='$d_getpwent'
23951 d_getpwent_r='$d_getpwent_r'
23952 d_getpwnam_r='$d_getpwnam_r'
23953 d_getpwuid_r='$d_getpwuid_r'
23954 d_getsbyname='$d_getsbyname'
23955 d_getsbyport='$d_getsbyport'
23956 d_getsent='$d_getsent'
23957 d_getservbyname_r='$d_getservbyname_r'
23958 d_getservbyport_r='$d_getservbyport_r'
23959 d_getservent_r='$d_getservent_r'
23960 d_getservprotos='$d_getservprotos'
23961 d_getspnam='$d_getspnam'
23962 d_getspnam_r='$d_getspnam_r'
23963 d_gettimeod='$d_gettimeod'
23964 d_gmtime64='$d_gmtime64'
23965 d_gmtime_r='$d_gmtime_r'
23966 d_gnulibc='$d_gnulibc'
23967 d_grpasswd='$d_grpasswd'
23968 d_hasmntopt='$d_hasmntopt'
23972 d_ilogbl='$d_ilogbl'
23973 d_inc_version_list='$d_inc_version_list'
23975 d_inetaton='$d_inetaton'
23976 d_inetntop='$d_inetntop'
23977 d_inetpton='$d_inetpton'
23978 d_int64_t='$d_int64_t'
23979 d_ip_mreq='$d_ip_mreq'
23980 d_ip_mreq_source='$d_ip_mreq_source'
23981 d_ipv6_mreq='$d_ipv6_mreq'
23982 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23983 d_isascii='$d_isascii'
23984 d_isblank='$d_isblank'
23985 d_isfinite='$d_isfinite'
23986 d_isfinitel='$d_isfinitel'
23988 d_isinfl='$d_isinfl'
23989 d_isless='$d_isless'
23991 d_isnanl='$d_isnanl'
23992 d_isnormal='$d_isnormal'
23995 d_killpg='$d_killpg'
23996 d_lc_monetary_2008='$d_lc_monetary_2008'
23997 d_lchown='$d_lchown'
23998 d_ldbl_dig='$d_ldbl_dig'
23999 d_ldexpl='$d_ldexpl'
24000 d_lgamma='$d_lgamma'
24001 d_lgamma_r='$d_lgamma_r'
24002 d_libm_lib_version='$d_libm_lib_version'
24003 d_libname_unique='$d_libname_unique'
24005 d_llrint='$d_llrint'
24006 d_llrintl='$d_llrintl'
24007 d_llround='$d_llround'
24008 d_llroundl='$d_llroundl'
24009 d_localtime64='$d_localtime64'
24010 d_localtime_r='$d_localtime_r'
24011 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24012 d_locconv='$d_locconv'
24017 d_longdbl='$d_longdbl'
24018 d_longlong='$d_longlong'
24020 d_lrintl='$d_lrintl'
24021 d_lround='$d_lround'
24022 d_lroundl='$d_lroundl'
24023 d_lseekproto='$d_lseekproto'
24025 d_madvise='$d_madvise'
24026 d_malloc_good_size='$d_malloc_good_size'
24027 d_malloc_size='$d_malloc_size'
24029 d_mbstowcs='$d_mbstowcs'
24030 d_mbtowc='$d_mbtowc'
24031 d_memchr='$d_memchr'
24032 d_memcmp='$d_memcmp'
24033 d_memcpy='$d_memcpy'
24034 d_memmove='$d_memmove'
24035 d_memset='$d_memset'
24037 d_mkdtemp='$d_mkdtemp'
24038 d_mkfifo='$d_mkfifo'
24039 d_mkstemp='$d_mkstemp'
24040 d_mkstemps='$d_mkstemps'
24041 d_mktime64='$d_mktime64'
24042 d_mktime='$d_mktime'
24045 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24046 d_modflproto='$d_modflproto'
24047 d_mprotect='$d_mprotect'
24049 d_msg_ctrunc='$d_msg_ctrunc'
24050 d_msg_dontroute='$d_msg_dontroute'
24051 d_msg_oob='$d_msg_oob'
24052 d_msg_peek='$d_msg_peek'
24053 d_msg_proxy='$d_msg_proxy'
24054 d_msgctl='$d_msgctl'
24055 d_msgget='$d_msgget'
24056 d_msghdr_s='$d_msghdr_s'
24057 d_msgrcv='$d_msgrcv'
24058 d_msgsnd='$d_msgsnd'
24060 d_munmap='$d_munmap'
24061 d_mymalloc='$d_mymalloc'
24064 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24065 d_nearbyint='$d_nearbyint'
24066 d_nextafter='$d_nextafter'
24067 d_nexttoward='$d_nexttoward'
24069 d_nl_langinfo='$d_nl_langinfo'
24070 d_nv_preserves_uv='$d_nv_preserves_uv'
24071 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24072 d_off64_t='$d_off64_t'
24073 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24074 d_oldpthreads='$d_oldpthreads'
24075 d_oldsock='$d_oldsock'
24077 d_pathconf='$d_pathconf'
24079 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24080 d_phostname='$d_phostname'
24083 d_portable='$d_portable'
24085 d_prctl_set_name='$d_prctl_set_name'
24086 d_printf_format_null='$d_printf_format_null'
24087 d_procselfexe='$d_procselfexe'
24088 d_pseudofork='$d_pseudofork'
24089 d_pthread_atfork='$d_pthread_atfork'
24090 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24091 d_pthread_yield='$d_pthread_yield'
24092 d_ptrdiff_t='$d_ptrdiff_t'
24094 d_pwchange='$d_pwchange'
24095 d_pwclass='$d_pwclass'
24096 d_pwcomment='$d_pwcomment'
24097 d_pwexpire='$d_pwexpire'
24098 d_pwgecos='$d_pwgecos'
24099 d_pwpasswd='$d_pwpasswd'
24100 d_pwquota='$d_pwquota'
24103 d_random_r='$d_random_r'
24104 d_re_comp='$d_re_comp'
24105 d_readdir64_r='$d_readdir64_r'
24106 d_readdir='$d_readdir'
24107 d_readdir_r='$d_readdir_r'
24108 d_readlink='$d_readlink'
24110 d_recvmsg='$d_recvmsg'
24111 d_regcmp='$d_regcmp'
24112 d_regcomp='$d_regcomp'
24113 d_remainder='$d_remainder'
24114 d_remquo='$d_remquo'
24115 d_rename='$d_rename'
24116 d_rewinddir='$d_rewinddir'
24120 d_safebcpy='$d_safebcpy'
24121 d_safemcpy='$d_safemcpy'
24122 d_sanemcmp='$d_sanemcmp'
24123 d_sbrkproto='$d_sbrkproto'
24124 d_scalbn='$d_scalbn'
24125 d_scalbnl='$d_scalbnl'
24126 d_sched_yield='$d_sched_yield'
24127 d_scm_rights='$d_scm_rights'
24128 d_seekdir='$d_seekdir'
24129 d_select='$d_select'
24131 d_semctl='$d_semctl'
24132 d_semctl_semid_ds='$d_semctl_semid_ds'
24133 d_semctl_semun='$d_semctl_semun'
24134 d_semget='$d_semget'
24136 d_sendmsg='$d_sendmsg'
24137 d_setegid='$d_setegid'
24138 d_seteuid='$d_seteuid'
24139 d_setgrent='$d_setgrent'
24140 d_setgrent_r='$d_setgrent_r'
24141 d_setgrps='$d_setgrps'
24142 d_sethent='$d_sethent'
24143 d_sethostent_r='$d_sethostent_r'
24144 d_setitimer='$d_setitimer'
24145 d_setlinebuf='$d_setlinebuf'
24146 d_setlocale='$d_setlocale'
24147 d_setlocale_r='$d_setlocale_r'
24148 d_setnent='$d_setnent'
24149 d_setnetent_r='$d_setnetent_r'
24150 d_setpent='$d_setpent'
24151 d_setpgid='$d_setpgid'
24152 d_setpgrp2='$d_setpgrp2'
24153 d_setpgrp='$d_setpgrp'
24154 d_setprior='$d_setprior'
24155 d_setproctitle='$d_setproctitle'
24156 d_setprotoent_r='$d_setprotoent_r'
24157 d_setpwent='$d_setpwent'
24158 d_setpwent_r='$d_setpwent_r'
24159 d_setregid='$d_setregid'
24160 d_setresgid='$d_setresgid'
24161 d_setresuid='$d_setresuid'
24162 d_setreuid='$d_setreuid'
24163 d_setrgid='$d_setrgid'
24164 d_setruid='$d_setruid'
24165 d_setsent='$d_setsent'
24166 d_setservent_r='$d_setservent_r'
24167 d_setsid='$d_setsid'
24168 d_setvbuf='$d_setvbuf'
24171 d_shmatprototype='$d_shmatprototype'
24172 d_shmctl='$d_shmctl'
24174 d_shmget='$d_shmget'
24175 d_sigaction='$d_sigaction'
24176 d_signbit='$d_signbit'
24177 d_sigprocmask='$d_sigprocmask'
24178 d_sigsetjmp='$d_sigsetjmp'
24179 d_sin6_scope_id='$d_sin6_scope_id'
24180 d_sitearch='$d_sitearch'
24181 d_snprintf='$d_snprintf'
24182 d_sockaddr_in6='$d_sockaddr_in6'
24183 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24184 d_sockatmark='$d_sockatmark'
24185 d_sockatmarkproto='$d_sockatmarkproto'
24186 d_socket='$d_socket'
24187 d_socklen_t='$d_socklen_t'
24188 d_sockpair='$d_sockpair'
24189 d_socks5_init='$d_socks5_init'
24190 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24192 d_srand48_r='$d_srand48_r'
24193 d_srandom_r='$d_srandom_r'
24194 d_sresgproto='$d_sresgproto'
24195 d_sresuproto='$d_sresuproto'
24197 d_statblks='$d_statblks'
24198 d_statfs_f_flags='$d_statfs_f_flags'
24199 d_statfs_s='$d_statfs_s'
24200 d_static_inline='$d_static_inline'
24201 d_statvfs='$d_statvfs'
24202 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24203 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24204 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24205 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24206 d_stdio_stream_array='$d_stdio_stream_array'
24207 d_stdiobase='$d_stdiobase'
24208 d_stdstdio='$d_stdstdio'
24209 d_strchr='$d_strchr'
24210 d_strcoll='$d_strcoll'
24211 d_strctcpy='$d_strctcpy'
24212 d_strerrm='$d_strerrm'
24213 d_strerror='$d_strerror'
24214 d_strerror_r='$d_strerror_r'
24215 d_strftime='$d_strftime'
24216 d_strlcat='$d_strlcat'
24217 d_strlcpy='$d_strlcpy'
24218 d_strtod='$d_strtod'
24219 d_strtol='$d_strtol'
24220 d_strtold='$d_strtold'
24221 d_strtoll='$d_strtoll'
24222 d_strtoq='$d_strtoq'
24223 d_strtoul='$d_strtoul'
24224 d_strtoull='$d_strtoull'
24225 d_strtouq='$d_strtouq'
24226 d_strxfrm='$d_strxfrm'
24227 d_suidsafe='$d_suidsafe'
24228 d_symlink='$d_symlink'
24229 d_syscall='$d_syscall'
24230 d_syscallproto='$d_syscallproto'
24231 d_sysconf='$d_sysconf'
24232 d_sysernlst='$d_sysernlst'
24233 d_syserrlst='$d_syserrlst'
24234 d_system='$d_system'
24235 d_tcgetpgrp='$d_tcgetpgrp'
24236 d_tcsetpgrp='$d_tcsetpgrp'
24237 d_telldir='$d_telldir'
24238 d_telldirproto='$d_telldirproto'
24239 d_tgamma='$d_tgamma'
24241 d_timegm='$d_timegm'
24243 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24244 d_tm_tm_zone='$d_tm_tm_zone'
24245 d_tmpnam_r='$d_tmpnam_r'
24247 d_truncate='$d_truncate'
24248 d_truncl='$d_truncl'
24249 d_ttyname_r='$d_ttyname_r'
24250 d_tzname='$d_tzname'
24251 d_u32align='$d_u32align'
24252 d_ualarm='$d_ualarm'
24255 d_union_semun='$d_union_semun'
24256 d_unordered='$d_unordered'
24257 d_unsetenv='$d_unsetenv'
24258 d_usleep='$d_usleep'
24259 d_usleepproto='$d_usleepproto'
24261 d_vendorarch='$d_vendorarch'
24262 d_vendorbin='$d_vendorbin'
24263 d_vendorlib='$d_vendorlib'
24264 d_vendorscript='$d_vendorscript'
24266 d_void_closedir='$d_void_closedir'
24267 d_voidsig='$d_voidsig'
24268 d_voidtty='$d_voidtty'
24269 d_volatile='$d_volatile'
24270 d_vprintf='$d_vprintf'
24271 d_vsnprintf='$d_vsnprintf'
24273 d_waitpid='$d_waitpid'
24274 d_wcscmp='$d_wcscmp'
24275 d_wcstombs='$d_wcstombs'
24276 d_wcsxfrm='$d_wcsxfrm'
24277 d_wctomb='$d_wctomb'
24278 d_writev='$d_writev'
24281 db_hashtype='$db_hashtype'
24282 db_prefixtype='$db_prefixtype'
24283 db_version_major='$db_version_major'
24284 db_version_minor='$db_version_minor'
24285 db_version_patch='$db_version_patch'
24286 direntrytype='$direntrytype'
24289 doublekind='$doublekind'
24290 doublesize='$doublesize'
24292 drand48_r_proto='$drand48_r_proto'
24294 dynamic_ext='$dynamic_ext'
24300 endgrent_r_proto='$endgrent_r_proto'
24301 endhostent_r_proto='$endhostent_r_proto'
24302 endnetent_r_proto='$endnetent_r_proto'
24303 endprotoent_r_proto='$endprotoent_r_proto'
24304 endpwent_r_proto='$endpwent_r_proto'
24305 endservent_r_proto='$endservent_r_proto'
24306 eunicefix='$eunicefix'
24309 extensions='$extensions'
24310 extern_C='$extern_C'
24312 fflushNULL='$fflushNULL'
24313 fflushall='$fflushall'
24315 firstmakefile='$firstmakefile'
24317 fpossize='$fpossize'
24318 fpostype='$fpostype'
24319 freetype='$freetype'
24322 full_csh='$full_csh'
24323 full_sed='$full_sed'
24324 gccansipedantic='$gccansipedantic'
24325 gccosandvers='$gccosandvers'
24326 gccversion='$gccversion'
24327 getgrent_r_proto='$getgrent_r_proto'
24328 getgrgid_r_proto='$getgrgid_r_proto'
24329 getgrnam_r_proto='$getgrnam_r_proto'
24330 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24331 gethostbyname_r_proto='$gethostbyname_r_proto'
24332 gethostent_r_proto='$gethostent_r_proto'
24333 getlogin_r_proto='$getlogin_r_proto'
24334 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24335 getnetbyname_r_proto='$getnetbyname_r_proto'
24336 getnetent_r_proto='$getnetent_r_proto'
24337 getprotobyname_r_proto='$getprotobyname_r_proto'
24338 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24339 getprotoent_r_proto='$getprotoent_r_proto'
24340 getpwent_r_proto='$getpwent_r_proto'
24341 getpwnam_r_proto='$getpwnam_r_proto'
24342 getpwuid_r_proto='$getpwuid_r_proto'
24343 getservbyname_r_proto='$getservbyname_r_proto'
24344 getservbyport_r_proto='$getservbyport_r_proto'
24345 getservent_r_proto='$getservent_r_proto'
24346 getspnam_r_proto='$getspnam_r_proto'
24347 gidformat='$gidformat'
24353 gmtime_r_proto='$gmtime_r_proto'
24354 gnulibc_version='$gnulibc_version'
24356 groupcat='$groupcat'
24357 groupstype='$groupstype'
24360 h_sysfile='$h_sysfile'
24363 hostgenerate='$hostgenerate'
24364 hostosname='$hostosname'
24365 hostperl='$hostperl'
24366 html1dir='$html1dir'
24367 html1direxp='$html1direxp'
24368 html3dir='$html3dir'
24369 html3direxp='$html3direxp'
24378 i_arpainet='$i_arpainet'
24379 i_assert='$i_assert'
24381 i_bsdioctl='$i_bsdioctl'
24385 i_dirent='$i_dirent'
24387 i_execinfo='$i_execinfo'
24392 i_fp_class='$i_fp_class'
24394 i_gdbm_ndbm='$i_gdbm_ndbm'
24395 i_gdbmndbm='$i_gdbmndbm'
24397 i_ieeefp='$i_ieeefp'
24398 i_inttypes='$i_inttypes'
24399 i_langinfo='$i_langinfo'
24400 i_libutil='$i_libutil'
24401 i_limits='$i_limits'
24402 i_locale='$i_locale'
24403 i_machcthr='$i_machcthr'
24404 i_malloc='$i_malloc'
24405 i_mallocmalloc='$i_mallocmalloc'
24407 i_memory='$i_memory'
24408 i_mntent='$i_mntent'
24411 i_neterrno='$i_neterrno'
24412 i_netinettcp='$i_netinettcp'
24416 i_pthread='$i_pthread'
24418 i_quadmath='$i_quadmath'
24419 i_rpcsvcdbm='$i_rpcsvcdbm'
24421 i_shadow='$i_shadow'
24423 i_stdarg='$i_stdarg'
24424 i_stdbool='$i_stdbool'
24425 i_stddef='$i_stddef'
24426 i_stdint='$i_stdint'
24427 i_stdlib='$i_stdlib'
24428 i_string='$i_string'
24429 i_sunmath='$i_sunmath'
24430 i_sysaccess='$i_sysaccess'
24431 i_sysdir='$i_sysdir'
24432 i_sysfile='$i_sysfile'
24433 i_sysfilio='$i_sysfilio'
24435 i_sysioctl='$i_sysioctl'
24436 i_syslog='$i_syslog'
24437 i_sysmman='$i_sysmman'
24438 i_sysmode='$i_sysmode'
24439 i_sysmount='$i_sysmount'
24440 i_sysndir='$i_sysndir'
24441 i_sysparam='$i_sysparam'
24442 i_syspoll='$i_syspoll'
24443 i_sysresrc='$i_sysresrc'
24444 i_syssecrt='$i_syssecrt'
24445 i_sysselct='$i_sysselct'
24446 i_syssockio='$i_syssockio'
24447 i_sysstat='$i_sysstat'
24448 i_sysstatfs='$i_sysstatfs'
24449 i_sysstatvfs='$i_sysstatvfs'
24450 i_systime='$i_systime'
24451 i_systimek='$i_systimek'
24452 i_systimes='$i_systimes'
24453 i_systypes='$i_systypes'
24454 i_sysuio='$i_sysuio'
24456 i_sysutsname='$i_sysutsname'
24457 i_sysvfs='$i_sysvfs'
24458 i_syswait='$i_syswait'
24459 i_termio='$i_termio'
24460 i_termios='$i_termios'
24462 i_unistd='$i_unistd'
24465 i_values='$i_values'
24466 i_varargs='$i_varargs'
24467 i_varhdr='$i_varhdr'
24469 ignore_versioned_solibs='$ignore_versioned_solibs'
24470 inc_version_list='$inc_version_list'
24471 inc_version_list_init='$inc_version_list_init'
24475 initialinstalllocation='$initialinstalllocation'
24476 installarchlib='$installarchlib'
24477 installbin='$installbin'
24478 installhtml1dir='$installhtml1dir'
24479 installhtml3dir='$installhtml3dir'
24480 installman1dir='$installman1dir'
24481 installman3dir='$installman3dir'
24482 installprefix='$installprefix'
24483 installprefixexp='$installprefixexp'
24484 installprivlib='$installprivlib'
24485 installscript='$installscript'
24486 installsitearch='$installsitearch'
24487 installsitebin='$installsitebin'
24488 installsitehtml1dir='$installsitehtml1dir'
24489 installsitehtml3dir='$installsitehtml3dir'
24490 installsitelib='$installsitelib'
24491 installsiteman1dir='$installsiteman1dir'
24492 installsiteman3dir='$installsiteman3dir'
24493 installsitescript='$installsitescript'
24494 installstyle='$installstyle'
24495 installusrbinperl='$installusrbinperl'
24496 installvendorarch='$installvendorarch'
24497 installvendorbin='$installvendorbin'
24498 installvendorhtml1dir='$installvendorhtml1dir'
24499 installvendorhtml3dir='$installvendorhtml3dir'
24500 installvendorlib='$installvendorlib'
24501 installvendorman1dir='$installvendorman1dir'
24502 installvendorman3dir='$installvendorman3dir'
24503 installvendorscript='$installvendorscript'
24505 issymlink='$issymlink'
24506 ivdformat='$ivdformat'
24509 known_extensions='$known_extensions'
24512 ld_can_script='$ld_can_script'
24513 lddlflags='$lddlflags'
24515 ldflags_uselargefiles='$ldflags_uselargefiles'
24516 ldlibpthname='$ldlibpthname'
24523 libsdirs='$libsdirs'
24524 libsfiles='$libsfiles'
24525 libsfound='$libsfound'
24526 libspath='$libspath'
24527 libswanted='$libswanted'
24528 libswanted_uselargefiles='$libswanted_uselargefiles'
24534 localtime_r_proto='$localtime_r_proto'
24535 locincpth='$locincpth'
24536 loclibpth='$loclibpth'
24537 longdblkind='$longdblkind'
24538 longdblsize='$longdblsize'
24539 longlongsize='$longlongsize'
24540 longsize='$longsize'
24544 lseeksize='$lseeksize'
24545 lseektype='$lseektype'
24549 make_set_make='$make_set_make'
24550 mallocobj='$mallocobj'
24551 mallocsrc='$mallocsrc'
24552 malloctype='$malloctype'
24554 man1direxp='$man1direxp'
24557 man3direxp='$man3direxp'
24559 mips_type='$mips_type'
24560 mistrustnm='$mistrustnm'
24562 mmaptype='$mmaptype'
24563 modetype='$modetype'
24565 multiarch='$multiarch'
24567 myarchname='$myarchname'
24568 mydomain='$mydomain'
24569 myhostname='$myhostname'
24572 need_va_copy='$need_va_copy'
24573 netdb_hlen_type='$netdb_hlen_type'
24574 netdb_host_type='$netdb_host_type'
24575 netdb_name_type='$netdb_name_type'
24576 netdb_net_type='$netdb_net_type'
24579 nm_so_opt='$nm_so_opt'
24580 nonxs_ext='$nonxs_ext'
24582 nvEUformat='$nvEUformat'
24583 nvFUformat='$nvFUformat'
24584 nvGUformat='$nvGUformat'
24585 nv_overflows_integers_at='$nv_overflows_integers_at'
24586 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24587 nveformat='$nveformat'
24588 nvfformat='$nvfformat'
24589 nvgformat='$nvgformat'
24592 o_nonblock='$o_nonblock'
24594 old_pthread_create_joinable='$old_pthread_create_joinable'
24595 optimize='$optimize'
24596 orderlib='$orderlib'
24599 otherlibdirs='$otherlibdirs'
24603 patchlevel='$patchlevel'
24604 path_sep='$path_sep'
24607 perl_patchlevel='$perl_patchlevel'
24608 perl_static_inline='$perl_static_inline'
24609 perladmin='$perladmin'
24610 perllibs='$perllibs'
24611 perlpath='$perlpath'
24613 phostname='$phostname'
24619 prefixexp='$prefixexp'
24621 privlibexp='$privlibexp'
24622 procselfexe='$procselfexe'
24623 prototype='$prototype'
24625 quadkind='$quadkind'
24626 quadtype='$quadtype'
24627 randbits='$randbits'
24628 randfunc='$randfunc'
24629 random_r_proto='$random_r_proto'
24630 randseedtype='$randseedtype'
24632 rd_nodata='$rd_nodata'
24633 readdir64_r_proto='$readdir64_r_proto'
24634 readdir_r_proto='$readdir_r_proto'
24635 revision='$revision'
24641 sGMTIME_max='$sGMTIME_max'
24642 sGMTIME_min='$sGMTIME_min'
24643 sLOCALTIME_max='$sLOCALTIME_max'
24644 sLOCALTIME_min='$sLOCALTIME_min'
24645 sPRIEUldbl='$sPRIEUldbl'
24646 sPRIFUldbl='$sPRIFUldbl'
24647 sPRIGUldbl='$sPRIGUldbl'
24648 sPRIXU64='$sPRIXU64'
24650 sPRIeldbl='$sPRIeldbl'
24651 sPRIfldbl='$sPRIfldbl'
24652 sPRIgldbl='$sPRIgldbl'
24657 sSCNfldbl='$sSCNfldbl'
24658 sched_yield='$sched_yield'
24659 scriptdir='$scriptdir'
24660 scriptdirexp='$scriptdirexp'
24662 seedfunc='$seedfunc'
24663 selectminbits='$selectminbits'
24664 selecttype='$selecttype'
24665 sendmail='$sendmail'
24666 setgrent_r_proto='$setgrent_r_proto'
24667 sethostent_r_proto='$sethostent_r_proto'
24668 setlocale_r_proto='$setlocale_r_proto'
24669 setnetent_r_proto='$setnetent_r_proto'
24670 setprotoent_r_proto='$setprotoent_r_proto'
24671 setpwent_r_proto='$setpwent_r_proto'
24672 setservent_r_proto='$setservent_r_proto'
24675 sharpbang='$sharpbang'
24676 shmattype='$shmattype'
24677 shortsize='$shortsize'
24680 sig_count='$sig_count'
24681 sig_name='$sig_name'
24682 sig_name_init='$sig_name_init'
24684 sig_num_init='$sig_num_init'
24685 sig_size='$sig_size'
24686 signal_t='$signal_t'
24687 sitearch='$sitearch'
24688 sitearchexp='$sitearchexp'
24690 sitebinexp='$sitebinexp'
24691 sitehtml1dir='$sitehtml1dir'
24692 sitehtml1direxp='$sitehtml1direxp'
24693 sitehtml3dir='$sitehtml3dir'
24694 sitehtml3direxp='$sitehtml3direxp'
24696 sitelib_stem='$sitelib_stem'
24697 sitelibexp='$sitelibexp'
24698 siteman1dir='$siteman1dir'
24699 siteman1direxp='$siteman1direxp'
24700 siteman3dir='$siteman3dir'
24701 siteman3direxp='$siteman3direxp'
24702 siteprefix='$siteprefix'
24703 siteprefixexp='$siteprefixexp'
24704 sitescript='$sitescript'
24705 sitescriptexp='$sitescriptexp'
24706 sizesize='$sizesize'
24707 sizetype='$sizetype'
24711 sockethdr='$sockethdr'
24712 socketlib='$socketlib'
24713 socksizetype='$socksizetype'
24715 spackage='$spackage'
24716 spitshell='$spitshell'
24717 srand48_r_proto='$srand48_r_proto'
24718 srandom_r_proto='$srandom_r_proto'
24720 ssizetype='$ssizetype'
24721 st_ino_sign='$st_ino_sign'
24722 st_ino_size='$st_ino_size'
24723 startperl='$startperl'
24725 static_ext='$static_ext'
24727 stdio_base='$stdio_base'
24728 stdio_bufsiz='$stdio_bufsiz'
24729 stdio_cnt='$stdio_cnt'
24730 stdio_filbuf='$stdio_filbuf'
24731 stdio_ptr='$stdio_ptr'
24732 stdio_stream_array='$stdio_stream_array'
24733 strerror_r_proto='$strerror_r_proto'
24736 subversion='$subversion'
24741 targetarch='$targetarch'
24742 targetdir='$targetdir'
24743 targetenv='$targetenv'
24744 targethost='$targethost'
24745 targetmkdir='$targetmkdir'
24746 targetport='$targetport'
24747 targetsh='$targetsh'
24751 timeincl='$timeincl'
24752 timetype='$timetype'
24753 tmpnam_r_proto='$tmpnam_r_proto'
24759 ttyname_r_proto='$ttyname_r_proto'
24768 uidformat='$uidformat'
24774 uquadtype='$uquadtype'
24775 use5005threads='$use5005threads'
24776 use64bitall='$use64bitall'
24777 use64bitint='$use64bitint'
24778 usecbacktrace='$usecbacktrace'
24779 usecrosscompile='$usecrosscompile'
24780 usedevel='$usedevel'
24782 usedtrace='$usedtrace'
24783 usefaststdio='$usefaststdio'
24784 useithreads='$useithreads'
24785 usekernprocpathname='$usekernprocpathname'
24786 uselargefiles='$uselargefiles'
24787 uselongdouble='$uselongdouble'
24788 usemallocwrap='$usemallocwrap'
24789 usemorebits='$usemorebits'
24790 usemultiplicity='$usemultiplicity'
24791 usemymalloc='$usemymalloc'
24793 usensgetexecutablepath='$usensgetexecutablepath'
24794 useopcode='$useopcode'
24795 useperlio='$useperlio'
24796 useposix='$useposix'
24797 usequadmath='$usequadmath'
24798 usereentrant='$usereentrant'
24799 userelocatableinc='$userelocatableinc'
24800 useshrplib='$useshrplib'
24801 usesitecustomize='$usesitecustomize'
24802 usesocks='$usesocks'
24803 usethreads='$usethreads'
24804 usevendorprefix='$usevendorprefix'
24805 useversionedarchname='$useversionedarchname'
24806 usevfork='$usevfork'
24809 uvXUformat='$uvXUformat'
24810 uvoformat='$uvoformat'
24813 uvuformat='$uvuformat'
24814 uvxformat='$uvxformat'
24816 vendorarch='$vendorarch'
24817 vendorarchexp='$vendorarchexp'
24818 vendorbin='$vendorbin'
24819 vendorbinexp='$vendorbinexp'
24820 vendorhtml1dir='$vendorhtml1dir'
24821 vendorhtml1direxp='$vendorhtml1direxp'
24822 vendorhtml3dir='$vendorhtml3dir'
24823 vendorhtml3direxp='$vendorhtml3direxp'
24824 vendorlib='$vendorlib'
24825 vendorlib_stem='$vendorlib_stem'
24826 vendorlibexp='$vendorlibexp'
24827 vendorman1dir='$vendorman1dir'
24828 vendorman1direxp='$vendorman1direxp'
24829 vendorman3dir='$vendorman3dir'
24830 vendorman3direxp='$vendorman3direxp'
24831 vendorprefix='$vendorprefix'
24832 vendorprefixexp='$vendorprefixexp'
24833 vendorscript='$vendorscript'
24834 vendorscriptexp='$vendorscriptexp'
24836 version_patchlevel_string='$version_patchlevel_string'
24837 versiononly='$versiononly'
24841 yaccflags='$yaccflags'
24846 : add special variables
24847 $test -f $src/patchlevel.h && \
24848 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24849 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24850 echo "PERL_CONFIG_SH=true" >>config.sh
24852 : propagate old symbols
24853 if $test -f UU/config.sh; then
24854 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24855 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24856 config.sh config.sh UU/oldconfig.sh |\
24857 $sort | $uniq -u >UU/oldsyms
24858 set X `$cat UU/oldsyms`
24864 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24866 echo ": Variables propagated from previous config.sh file." >>config.sh
24867 for sym in `$cat UU/oldsyms`; do
24868 echo " Propagating $hint variable "'$'"$sym..."
24869 eval 'tmp="$'"${sym}"'"'
24871 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24877 : preserve RCS keywords in files with variable substitution, grrr
24880 : Finish up by extracting the .SH files
24884 echo "Extraction done."
24894 If you'd like to make any changes to the config.sh file before I begin
24895 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24898 rp="Press return or use a shell escape to edit config.sh:"
24903 *) : in case they cannot read
24904 sh 1>&4 -c "$ans";;
24909 : if this fails, just run all the .SH files by hand
24918 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24925 Now you need to generate make dependencies by running "$make depend".
24926 You might prefer to run it in background: "$make depend > makedepend.out &"
24927 It can take a while, so you might not want to run it right now.
24932 rp="Run $make depend now?"
24936 $make depend && echo "Now you must run '$make'."
24939 echo "You must run '$make depend' then '$make'."
24942 elif test -f [Mm]akefile; then
24944 echo "Now you must run a $make."
24946 echo "Configure done."
24949 if $test -f Policy.sh; then
24952 If you compile $package on a different machine or from a different object
24953 directory, copy the Policy.sh file from this object directory to the
24954 new one before you run Configure -- this will help you with most of
24955 the policy defaults.
24959 if $test -f config.msg; then
24960 echo "Hmm. I also noted the following information while running:"
24962 $cat config.msg >&4
24965 $rm -f kit*isdone ark*isdone