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=''
623 d_localtime_r_needs_tzset=''
641 d_malloc_good_size=''
689 d_old_pthread_create_joinable=''
690 old_pthread_create_joinable=''
692 d_pthread_attr_setscope=''
740 sethostent_r_proto=''
757 setprotoent_r_proto=''
769 setservent_r_proto=''
791 d_ipv6_mreq_source=''
808 d_sprintf_returns_strlen=''
821 perl_static_inline=''
826 d_stdio_ptr_lval_nochange_cnt=''
827 d_stdio_ptr_lval_sets_cnt=''
979 d_gdbm_ndbm_h_uses_prototypes=''
980 d_gdbmndbm_h_uses_prototypes=''
982 d_ndbm_h_uses_prototypes=''
1058 d_inc_version_list=''
1060 inc_version_list_init=''
1064 installusrbinperl=''
1080 ignore_versioned_solibs=''
1141 d_perl_otherlibdirs=''
1149 api_versionstring=''
1155 version_patchlevel_string=''
1159 d_nv_preserves_uv=''
1160 d_nv_zero_is_allbits_zero=''
1171 nv_overflows_integers_at=''
1172 nv_preserves_uv_bits=''
1245 installsitehtml1dir=''
1248 installsitehtml3dir=''
1255 installsiteman1dir=''
1258 installsiteman3dir=''
1263 installsitescript=''
1281 d_stdio_stream_array=''
1282 stdio_stream_array=''
1300 usekernprocpathname=''
1301 ccflags_uselargefiles=''
1302 ldflags_uselargefiles=''
1303 libswanted_uselargefiles=''
1312 usensgetexecutablepath=''
1326 installvendorarch=''
1333 installvendorhtml1dir=''
1335 vendorhtml1direxp=''
1336 installvendorhtml3dir=''
1338 vendorhtml3direxp=''
1344 installvendorman1dir=''
1347 installvendorman3dir=''
1354 installvendorscript=''
1365 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1368 : We must find out about Eunice early
1370 if test -f /etc/unixtovms; then
1371 eunicefix=/etc/unixtovms
1373 if test -f /etc/unixtovms.exe; then
1374 eunicefix=/etc/unixtovms.exe
1377 : Set executable suffix now -- needed before hints available
1378 if test -f "/libs/version.library"; then
1381 elif test -f "/system/gnu_library/bin/ar.pm"; then
1384 elif test -n "$DJGPP"; then
1387 elif test -f /kern/cookiejar; then
1390 elif test -d c:/. -o -n "$is_os2" ; then
1397 : Trailing extension. Override this in a hint file, if needed.
1398 : Extra object files, if any, needed on this platform.
1401 : Possible local include directories to search.
1402 : Set locincpth to "" in a hint file to defeat local include searches.
1403 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1404 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1406 : no include file wanted by default
1409 : Enable -DEBUGGING and -DDEBUGGING from the command line
1414 : change the next line if compiling for Xenix/286 on Xenix/386
1415 xlibpth='/usr/lib/386 /lib/386'
1416 : Possible local library directories to search.
1417 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1418 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1420 : general looking path for locating libraries
1421 glibpth="/lib /usr/lib $xlibpth"
1422 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1423 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1424 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1425 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1427 : Private path used by Configure to find libraries. Its value
1428 : is prepended to libpth. This variable takes care of special
1429 : machines, like the mips. Usually, it should be empty.
1432 : default library list
1434 : some systems want to use only the non-versioned libso:s
1435 ignore_versioned_solibs=''
1436 : set usethreads on the Configure command line to enable threads.
1437 usereentrant='undef'
1441 : set useposix=false in your hint file to disable the POSIX extension.
1443 : set useopcode=false in your hint file to disable the Opcode extension.
1446 ccflags_uselargefiles=''
1447 ldflags_uselargefiles=''
1448 libswanted_uselargefiles=''
1449 : set usemultiplicity on the Configure command line to enable multiplicity.
1450 : set usesocks on the Configure command line to enable socks.
1451 : List of libraries we want.
1452 : If anyone needs extra -lxxx, put those in a hint file.
1453 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1454 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1455 : We probably want to search /usr/shlib before most other libraries.
1456 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1457 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1458 glibpth="/usr/shlib $glibpth"
1459 : Do not use vfork unless overridden by a hint file.
1462 : Find the basic shell for Bourne shell scripts
1466 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1469 if test -f "$xxx"; then
1472 : Build up a list and do a single loop so we can 'break' out.
1473 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1474 for xxx in sh bash ksh pdksh ash; do
1476 try="$try ${p}/${xxx}"
1480 if test -f "$xxx"; then
1483 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1486 elif test -f "$xxx.exe"; then
1497 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1499 Usually it's in /bin/sh. How did you even get this far?
1500 Please contact me (Perl Maintainers) at perlbug@perl.org and
1501 we'll try to straighten this all out.
1507 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1508 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1511 : see if sh knows # comments
1512 if `$sh -c '#' >/dev/null 2>&1`; then
1516 test -f $xcat$_exe || xcat=/usr/bin/cat
1517 if test ! -f $xcat$_exe; then
1518 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1519 if test -f $p/cat$_exe; then
1524 if test ! -f $xcat$_exe; then
1525 echo "Can't find cat anywhere!"
1529 echo "#!$xcat" >sharp
1532 ./sharp > today 2>/dev/null
1533 if test -s today; then
1536 echo "#! $xcat" > sharp
1539 ./sharp > today 2>/dev/null
1540 if test -s today; then
1548 echo "Your $sh doesn't grok # comments--I will strip them later on."
1551 echo "exec grep -v '^[ ]*#'" >spitshell
1553 $eunicefix spitshell
1554 spitshell=`pwd`/spitshell
1556 echo "I presume that if # doesn't work, #! won't work either!"
1561 : figure out how to guarantee sh startup
1563 '') startsh=${sharpbang}${sh} ;;
1575 : echo "Yup, it does."
1577 echo "Hmm... '$startsh' does not guarantee sh startup..."
1578 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1582 : Save command line options in file UU/cmdline.opt for later use in
1583 : generating config.sh.
1584 cat > cmdline.opt <<EOSH
1585 : Configure command line arguments.
1594 cat >>cmdline.opt <<EOSH
1595 config_arg$argn='$arg'
1597 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1600 arg_exp=`cat cmdl.opt`
1601 args_exp="$args_exp$args_sep'$arg_exp'"
1602 argn=`expr $argn + 1`
1607 : produce awk script to parse command line options
1608 cat >options.awk <<'EOF'
1610 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1612 len = length(optstr);
1613 for (i = 1; i <= len; i++) {
1614 c = substr(optstr, i, 1);
1615 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1626 if (substr(str, 1, 1) != "-") {
1627 printf("'%s'\n", str);
1631 for (i = 2; i <= len; i++) {
1632 c = substr(str, i, 1);
1634 printf("-%s\n", substr(str, i));
1640 printf("'%s'\n", substr(str, i + 1));
1653 : process the command line options
1654 set X `for arg in "$@"; do echo "X$arg"; done |
1655 sed -e s/X// | awk -f options.awk`
1660 : set up default values
1670 rm -f optdef.sh posthint.sh
1671 cat >optdef.sh <<EOS
1677 while test $# -gt 0; do
1679 -d) shift; fastread=yes;;
1680 -e) shift; alldone=cont;;
1684 if test -r "$1"; then
1687 echo "$me: cannot read config file $1." >&2
1693 -h) shift; error=true;;
1694 -r) shift; reuseval=true;;
1695 -s) shift; silent=true; realsilent=true;;
1696 -E) shift; alldone=exit;;
1697 -K) shift; knowitall=true;;
1698 -O) shift; override=true;;
1699 -S) shift; silent=true; extractsh=true;;
1704 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1705 echo "$me: ignoring -D $1" >&2
1708 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1709 *) echo "$1='define'" >> optdef.sh;;
1716 *=) echo "$1" >> optdef.sh;;
1718 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1719 echo "$me: ignoring -U $1" >&2
1721 *) echo "$1='undef'" >> optdef.sh;;
1732 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1736 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1737 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1743 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1744 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1745 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1746 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1747 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1748 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1754 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1756 echo "$yyy=''" >> posthint.sh ;;
1761 echo "$yyy='$zzz'" >> posthint.sh ;;
1763 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1765 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1770 echo "$yyy=$zzz" >> posthint.sh ;;
1771 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1775 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1778 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1786 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1787 [-U symbol] [-U symbol=] [-A command:symbol...]
1788 -d : use defaults for all answers.
1789 -e : go on without questioning past the production of config.sh.
1790 -f : specify an alternate default configuration file.
1791 -h : print this help message and exit (with an error status).
1792 -r : reuse C symbols value if possible (skips costly nm extraction).
1793 -s : silent mode, only echoes questions and essential information.
1794 -D : define symbol to have some value:
1795 -D symbol symbol gets the value 'define'
1796 -D symbol=value symbol gets the value 'value'
1797 common used examples (see INSTALL for more info):
1798 -Duse64bitint use 64bit integers
1799 -Duse64bitall use 64bit integers and pointers
1800 -Dusethreads use thread support
1801 -Dinc_version_list=none do not include older perl trees in @INC
1802 -DEBUGGING=none DEBUGGING options
1803 -Dcc=gcc choose your compiler
1804 -Dprefix=/opt/perl5 choose your destination
1805 -E : stop at the end of questions, after having produced config.sh.
1806 -K : do not use unless you know what you are doing.
1807 -O : let -D and -U override definitions from loaded configuration file.
1808 -S : perform variable substitutions on all .SH files (can mix with -f)
1809 -U : undefine symbol:
1810 -U symbol symbol gets the value 'undef'
1811 -U symbol= symbol gets completely empty
1813 -A : manipulate symbol after the platform specific hints have been applied:
1814 -A append:symbol=value append value to symbol
1815 -A symbol=value like append:, but with a separating space
1816 -A define:symbol=value define symbol to have value
1817 -A clear:symbol define symbol to be ''
1818 -A define:symbol define symbol to be 'define'
1819 -A eval:symbol=value define symbol to be eval of value
1820 -A prepend:symbol=value prepend value to symbol
1821 -A undef:symbol define symbol to be 'undef'
1822 -A undef:symbol= define symbol to be ''
1823 e.g.: -A prepend:libswanted='cl pthread '
1824 -A ccflags=-DSOME_MACRO
1825 -V : print version number and exit (with a zero status).
1832 case "$fastread$alldone" in
1835 case "$extractsh" in
1838 if test ! -t 0; then
1839 echo "Say 'sh Configure', not 'sh <Configure'"
1849 true) exec 1>/dev/null;;
1852 : run the defines and the undefines, if any, but leave the file out there...
1855 : create the posthint manipulation script and leave the file out there...
1860 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1861 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1862 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1863 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1864 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1867 : Some greps do not return status, grrr.
1868 echo "grimblepritz" >grimble
1869 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1871 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1877 : the following should work in any shell
1881 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1882 cat >contains <<'EOSS'
1883 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1888 : Find the path to the source tree
1891 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1895 *) src=`cd ../$src && pwd` ;;
1908 if test -f $rsrc/Configure && \
1909 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1911 : found it, so we are ok.
1914 for src in . .. ../.. ../../.. ../../../..; do
1915 if test -f ../$src/Configure && \
1916 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1927 Sorry, I can't seem to locate the source dir for $package. Please start
1928 Configure with an explicit path -- i.e. /some/path/Configure.
1936 echo "Sources for $package found in \"$src\"." >&4
1940 : script used to extract .SH files with variable substitutions
1941 cat >extract <<'EOS'
1943 echo "Doing variable substitutions on .SH files..."
1944 if test -f MANIFEST; then
1945 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1947 echo "(Looking for .SH files under the source directory.)"
1948 set x `(cd "$src"; find . -name "*.SH" -print)`
1952 0) set x `(cd "$src"; echo *.SH)`; shift;;
1954 if test ! -f "$src/$1"; then
1960 while test $name; do
1961 if test ! -d "$name"; then
1962 create="$name $create";
1963 name=`echo $name | sed -e "s|^[^/]*$||"`;
1964 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1969 for file in $create; do
1978 dir=`expr X$file : 'X\(.*\)/'`
1979 file=`expr X$file : 'X.*/\(.*\)'`
1980 (cd "$dir" && . ./$file)
1990 dir=`expr X$file : 'X\(.*\)/'`
1991 file=`expr X$file : 'X.*/\(.*\)'`
1992 (set x $dir; shift; eval $mkdir_p)
1993 sh <"$src/$dir/$file"
2002 if test -f "$src/config_h.SH"; then
2003 if test ! -f config.h; then
2004 : oops, they left it out of MANIFEST, probably, so do it anyway.
2005 . "$src/config_h.SH"
2010 : extract files and exit if asked to do so
2011 case "$extractsh" in
2013 case "$realsilent" in
2017 case "$config_sh" in
2018 '') config_sh='config.sh';;
2021 echo "Fetching answers from $config_sh..."
2024 test "$override" && . ./optdef.sh
2028 echo "Extraction done."
2033 : Eunice requires " " instead of "", can you believe it
2036 echo "Beginning of configuration questions for $package."
2038 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2040 : first determine how to suppress newline on echo command
2042 echo "Checking echo to see how to suppress newlines..."
2043 (echo "hi there\c" ; echo " ") >.echotmp
2044 if $contains c .echotmp >/dev/null 2>&1 ; then
2055 echo $n "The star should be here-->$c"
2059 : Now test for existence of everything in MANIFEST
2061 if test -f "$rsrc/MANIFEST"; then
2062 echo "First let's make sure your kit is complete. Checking..." >&4
2063 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2064 (split -l 50 2>/dev/null || split -50)
2067 for filelist in x??; do
2068 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2069 >/dev/null 2>>"$tmppwd/missing")
2071 if test -s missing; then
2075 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2077 You have the option of continuing the configuration process, despite the
2078 distinct possibility that your kit is damaged, by typing 'y'es. If you
2079 do, don't blame me if something goes wrong. I advise you to type 'n'o
2080 and contact the author (perlbug@perl.org).
2083 echo $n "Continue? [n] $c" >&4
2087 echo "Continuing..." >&4
2091 echo "ABORTING..." >&4
2096 echo "Looks good..."
2099 echo "There is no MANIFEST file. I hope your kit is complete !"
2103 : Find the appropriate value for a newline for tr
2105 if test -n "$DJGPP"; then
2108 if test X"$trnl" = X; then
2109 case "`echo foo|tr '\n' x 2>/dev/null`" in
2113 if test X"$trnl" = X; then
2114 case "`echo foo|tr '\012' x 2>/dev/null`" in
2115 foox) trnl='\012' ;;
2118 if test X"$trnl" = X; then
2119 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2120 fooxy) trnl='\n\r' ;;
2123 if test X"$trnl" = X; then
2126 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2132 : compute the number of columns on the terminal for proper question formatting
2137 : set up the echo used in my read
2138 myecho="case \"\$xxxm\" in
2139 '') echo $n \"\$rp $c\" >&4;;
2141 '') echo $n \"[\$xxxm] $c\";;
2143 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2145 echo $n \"[\$xxxm] $c\" >&4
2147 echo $n \"\$rp [\$xxxm] $c\" >&4
2153 : now set up to do reads with possible shell escape and default assignment
2159 case "\$fastread" in
2160 yes) case "\$dflt" in
2163 case "\$silent-\$rp" in
2168 *) case "\$silent" in
2169 true) case "\$rp" in
2174 while expr "X\$ans" : "X!" >/dev/null; do
2178 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2186 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2195 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2200 echo "(OK, I'll run with -d after this question.)" >&4
2203 echo "*** Sorry, \$1 not supported yet." >&4
2213 echo "*** Substitution done -- please confirm."
2215 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2220 echo "*** Error -- try again."
2227 case "\$ans\$xxxm\$nostick" in
2239 : create .config dir to save info across Configure sessions
2240 test -d ../.config || mkdir ../.config
2241 cat >../.config/README <<EOF
2242 This directory created by Configure to save information that should
2243 persist across sessions for $package.
2245 You may safely delete it if you wish.
2248 : See if we are using a devel version and want that
2249 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2252 usedevel="$define" ;;
2253 *) case "$xversion" in
2256 *** WHOA THERE!!! ***
2258 This is an UNSTABLE DEVELOPMENT release.
2259 The version of this $package distribution is $xversion, that is, odd,
2260 (as opposed to even) and that signifies a development release.
2261 If you want a maintenance release, you want an even-numbered version.
2263 Do ***NOT*** install this into production use.
2264 Data corruption and crashes are possible.
2266 It is most seriously suggested that you do not continue any further
2267 unless you want to help in developing and debugging Perl.
2269 If you *still* want to build perl, you can answer 'y' now,
2270 or pass -Dusedevel to Configure.
2273 rp='Do you really want to continue?'
2277 [yY]) echo >&4 "Okay, continuing."
2278 usedevel="$define" ;;
2279 *) echo >&4 "Okay, bye."
2290 case "$versiononly" in
2291 '') versiononly="$define" ;;
2293 case "$installusrbinperl" in
2294 '') installusrbinperl="$undef" ;;
2299 : general instructions
2302 user=`(logname) 2>/dev/null`
2304 '') user=`whoami 2>&1`;;
2306 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2309 rp='Would you like to see the instructions?'
2320 This installation shell script will examine your system and ask you questions
2321 to determine how the perl5 package should be installed. If you get
2322 stuck on a question, you may use a ! shell escape to start a subshell or
2323 execute a command. Many of the questions will have default answers in square
2324 brackets; typing carriage return will give you the default.
2326 On some of the questions which ask for file or directory names you are allowed
2327 to use the ~name construct to specify the login directory belonging to "name",
2328 even if you don't have a shell which knows about that. Questions where this is
2329 allowed will be marked "(~name ok)".
2333 dflt='Type carriage return to continue'
2337 The prompter used in this script allows you to use shell variables and
2338 backticks in your answers. You may use $1, $2, etc... to refer to the words
2339 in the default answer, as if the default line was a set of arguments given to a
2340 script shell. This means you may also use $* to repeat the whole default line,
2341 so you do not have to re-type everything to add something to the default.
2343 Every time there is a substitution, you will have to confirm. If there is an
2344 error (e.g. an unmatched backtick), the default answer will remain unchanged
2345 and you will be prompted again.
2347 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2348 the questions and use the computed defaults (or the previous answers if there
2349 was already a config.sh file). Type 'Configure -h' for a list of options.
2350 You may also start interactively and then answer '& -d' at any prompt to turn
2351 on the non-interactive behaviour for the remainder of the execution.
2357 Much effort has been expended to ensure that this shell script will run on any
2358 Unix system. If despite that it blows up on yours, your best bet is to edit
2359 Configure and run it again. If you can't run Configure for some reason,
2360 you'll have to generate a config.sh file by hand. Whatever problems you
2361 have, let me (perlbug@perl.org) know how I blew it.
2363 This installation script affects things in two ways:
2365 1) it may do direct variable substitutions on some of the files included
2367 2) it builds a config.h file for inclusion in C programs. You may edit
2368 any of these files as the need arises after running this script.
2370 If you make a mistake on a question, there is no easy way to back up to it
2371 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2372 files. Configure will offer to let you do this before it runs the SH files.
2375 dflt='Type carriage return to continue'
2377 case "$firsttime" in
2378 true) echo $user >>../.config/instruct;;
2382 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2383 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2384 if test "X$sysroot" = X; then
2389 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2390 # _sysroot is used in places where we need --sysroot=foo
2391 # but using the rest of the flags could cause issues.
2392 _sysroot="--sysroot=$sysroot";
2396 ccflags="$ccflags $_sysroot"
2401 ldflags="$ldflags $_sysroot"
2406 cppflags="$cppflags $_sysroot"
2408 # lddlflags updated below in lddlflags section;
2409 # same with cccdlflags
2413 # Adjust some defaults to also use $sysroot
2414 for var in xlibpth loclibpth locincpth glibpth; do
2417 for path in $xxx; do
2418 eval $var=\"\$$var $sysroot$path\"
2424 : find out where common programs are
2426 echo "Locating common programs..." >&4
2439 if test -d \$dir/\$thing; then
2445 for thisthing in \$dir/\$thing; do
2446 : just loop through to pick last item
2448 if test -f \$thisthing; then
2451 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2454 elif test -f \$dir/\$thing.exe; then
2455 if test -n "$DJGPP"; then
2456 echo \$dir/\$thing.exe
2457 elif test "$eunicefix" != ":"; then
2458 : on Eunice apparently
2511 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2512 pth="$pth $sysroot/lib $sysroot/usr/lib"
2513 for file in $loclist; do
2517 if test -f "$xxx"; then
2520 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2521 xxx=`./loc $file $file $pth`
2524 '') xxx=`./loc $file $file $pth`;;
2525 *) xxx=`./loc $xxx $xxx $pth`;;
2527 eval $file=$xxx$_exe
2531 echo $file is in $xxx.
2534 echo $file is in $xxx.
2537 echo "I don't know where '$file' is, and my life depends on it." >&4
2538 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2544 echo "Don't worry if any of the following aren't found..."
2546 for file in $trylist; do
2550 if test -f "$xxx"; then
2553 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2554 xxx=`./loc $file $file $pth`
2557 '') xxx=`./loc $file $file $pth`;;
2558 *) xxx=`./loc $xxx $xxx $pth`;;
2560 eval $file=$xxx$_exe
2564 echo $file is in $xxx.
2567 echo $file is in $xxx.
2570 echo "I don't see $file out there, $say."
2577 echo "Substituting grep for egrep."
2584 *) if $less -R </dev/null >/dev/null 2>&1; then
2585 echo "Substituting less -R for less."
2593 echo "Substituting cp for ln."
2602 echo "I can't find make or gmake, and my life depends on it." >&4
2603 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2611 *) # We can't have osname yet.
2612 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2613 # Assume that gmake, if found, is definitely GNU make
2614 # and prefer it over the system make.
2615 echo "Substituting gmake for make."
2623 echo "Hopefully test is built into your sh."
2626 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2627 echo "Using the test built into your sh."
2635 echo "Hopefully echo is built into your sh."
2640 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2641 $echo $n "hi there$c" >foo1
2642 echo $n "hi there$c" >foo2
2643 if cmp foo1 foo2 >/dev/null 2>&1; then
2644 echo "They are compatible. In fact, they may be identical."
2651 They are not compatible! You are probably running ksh on a non-USG system.
2652 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2653 have echo built in and we may have to run some Bourne shell scripts. That
2654 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2657 $echo $n "The star should be here-->$c"
2664 # This question was auctioned at YAPC::Europe-2007 in Vienna
2665 # I never promised you could answer it. I only auctioned the question.
2667 The following message is sponsored by
2669 Dresden.pm<--The stars should be here.
2671 Dear Perl user, system administrator or package
2672 maintainer, the Perl community sends greetings to
2673 you. Do you (emblematical) greet back [Y/n]? n
2677 : Check what type of C compiler we use
2681 cat <<'EOSC' >>trygcc
2686 int main(int argc, char *argv[]) {
2690 if $cc -o try $ccflags $ldflags try.c; then
2693 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2699 # Skip this test because it gives a false match on output like:
2700 # ./trygcc: line 23: cc: command not found
2701 # case "`$cc -v -c try.c 2>&1`" in
2702 # *gcc*) trygcc=no ;;
2704 if $test X"$trygcc" = Xyes; then
2705 if gcc -o try -c try.c; then
2707 echo "You seem to have a working gcc, though." >&4
2708 # Switching compilers may undo the work of hints files.
2709 # The most common problem is -D_REENTRANT for threads.
2710 # This heuristic catches that case, but gets false positives
2711 # if -Dusethreads was not actually specified. Better to
2712 # bail out here with a useful message than fail
2713 # mysteriously later. Should we perhaps just try to
2714 # re-invoke Configure -Dcc=gcc config_args ?
2715 if $test -f usethreads.cbu; then
2718 *** However, any setting of the C compiler flags (e.g. for thread support)
2719 *** will be lost. It may be necessary for you to restart Configure and
2720 *** add -Dcc=gcc to your Configure command line.
2723 rp="Would you like to go ahead and try gcc anyway?"
2726 rp="Would you like to use it?"
2729 if $test -f myread; then
2732 if $test -f UU/myread; then
2735 echo "Cannot find myread, sorry. Aborting." >&2
2740 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2753 cat <<'EOSC' >>checkcc
2758 int main(int argc, char *argv[]) {
2762 if $cc -o try $ccflags $ldflags try.c; then
2765 if $test X"$despair" = Xyes; then
2766 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2769 You need to find a working C compiler.
2770 Either (purchase and) install the C compiler supplied by your OS vendor,
2771 or for a free C compiler try http://gcc.gnu.org/
2772 I cannot continue any further, aborting.
2781 : determine whether symbolic links are supported
2784 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2785 echo "Symbolic links are supported." >&4
2788 echo "Symbolic links are NOT supported." >&4
2793 : determine whether symbolic links are supported
2797 echo "Checking how to test for symbolic links..." >&4
2799 if $test "X$issymlink" = X; then
2801 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2802 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2804 if test $? = 0; then
2807 echo "Your builtin 'test -h' may be broken." >&4
2810 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2813 if test -f "$p/$test"; then
2822 echo "Trying external '$test -h'." >&4
2823 issymlink="$test -h"
2824 if $test ! -h sym >/dev/null 2>&1; then
2825 echo "External '$test -h' is broken, too." >&4
2833 if $test "X$issymlink" = X; then
2834 if $test -L sym 2>/dev/null; then
2835 issymlink="$test -L"
2836 echo "The builtin '$test -L' worked." >&4
2839 if $test "X$issymlink" != X; then
2840 echo "You can test for symbolic links with '$issymlink'." >&4
2842 echo "I do not know how you can test for symbolic links." >&4
2846 *) echo "No symbolic links, so not testing for their testing..." >&4
2851 : Make symlinks util
2852 case "$mksymlinks" in
2855 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2858 *) case "$lns:$issymlink" in
2859 *"ln"*" -s:"*"test -"?)
2860 echo "Creating the symbolic links..." >&4
2862 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2872 print "# dir = ", dir, "file = ", file
2873 mf[dir] = mf[dir]" "source"/"dir"/"file;
2876 if (d != ".") { print("mkdir -p "d) }
2877 print("ln -sf "mf[d]" "d);
2879 }' source="$src" > UU/mksymlinks.$$
2883 if test ! -d t/base; then
2884 echo "Failed to create the subdirectories. Aborting." >&4
2888 if test ! -f t/base/lex.t; then
2889 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2892 if test ! -f win32/win32.c; then
2893 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2898 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2906 : Check for Cross-Compilation
2907 if $test "X$targethost" = "X"; then
2910 if $test "X$targetenv" = "X"; then
2913 case "$usecrosscompile" in
2915 $echo "Cross-compiling..."
2918 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2919 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2920 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2921 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2922 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2923 # leave out ld, choosing it is more complex
2924 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2925 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2926 # We are in a weird spot. Just before us, some values
2927 # were 'saved', to be restored after the hints are
2928 # run. This means that the changes we made to ar,
2929 # nm and ranlib will get reverted.
2930 # To avoid that, we hijack the saving mechanism and
2931 # have it save our new values.
2932 for file in ar nm ranlib; do
2934 eval $file=$xxx$_exe
2939 case "$targetarch" in
2940 '') echo "Targetarch not defined." >&4; croak=y ;;
2941 *) echo "Using targetarch $targetarch." >&4 ;;
2943 case "$targethost" in
2944 '') echo "Targethost not defined." >&4; croak=y ;;
2945 *) echo "Using targethost $targethost." >&4
2950 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2952 : compile a host miniperl and generate_uudmap, unless we got passed them
2953 if $test "X$hostperl" = X; then
2954 echo "Building host miniperl and generate_uudmap binaries" >&4
2962 $src/Configure -des -Dusedevel -Dmksymlinks
2964 case "$hostgenerate" in
2965 '') $make generate_uudmap
2966 hostgenerate=$src/host/generate_uudmap
2968 "$undef") hostgenerate=''
2971 hostperl=$src/host/miniperl
2974 hostosname=`$hostperl -le 'print $^O'`
2977 usecrosscompile="$undef"
2981 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2982 case "$targethost" in
2983 '') echo "Checking for cross-compile" >&4
2984 case "$usecrosscompile$multiarch" in
2985 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2986 if [ -f Makefile ]; then
2988 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2990 echo "Configure done."
2994 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3001 *) echo "Using targethost $targethost." >&4
3003 /*) run=$src/Cross/run
3004 targetmkdir=$src/Cross/mkdir
3006 from=$src/Cross/from
3008 *) pwd=`$test -f ../Configure & cd ..; pwd`
3010 targetmkdir=$pwd/Cross/mkdir
3012 from=$pwd/Cross/from
3015 case "$targetrun" in
3016 '') targetrun=ssh ;;
3021 case "$targetfrom" in
3022 '') targetfrom=scp ;;
3026 from=$from-$targetfrom
3027 case "$targetdir" in
3029 echo "Guessing targetdir $targetdir." >&4
3032 case "$targetuser" in
3034 echo "Guessing targetuser $targetuser." >&4
3037 case "$targetport" in
3039 echo "Guessing targetport $targetport." >&4
3042 case "$targetfrom" in
3046 case "$targetrun" in
3066 '') cwd=$targetdir ;;
3071 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3077 *) echo "Unknown targetrun '$targetrun'" >&4
3081 case "$targetmkdir" in
3083 cat >$targetmkdir <<EOF
3085 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3087 $chmod a+rx $targetmkdir
3089 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3101 $targetmkdir \`dirname \$f\`
3102 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3105 $targetmkdir $targetdir/\`dirname \$f\`
3106 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3119 $mkdir -p $targetdir/\`dirname \$f\`
3120 $cp \$f $targetdir/\$f || exit 1
3123 $targetmkdir $targetdir/\`dirname \$f\`
3124 $cp \$f $targetdir/\$f || exit 1
3131 *) echo "Unknown targetto '$targetto'" >&4
3135 case "$targetfrom" in
3142 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3147 cp) cat >$from <<EOF
3152 cp $targetdir/\$f . || exit 1
3157 *) echo "Unknown targetfrom '$targetfrom'" >&4
3161 if $test ! -f $run; then
3162 echo "Target 'run' script '$run' not found." >&4
3166 if $test ! -f $to; then
3167 echo "Target 'to' script '$to' not found." >&4
3171 if $test ! -f $from; then
3172 echo "Target 'from' script '$from' not found." >&4
3176 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3180 Using '$run' for remote execution,
3181 and '$from' and '$to'
3182 for remote file transfer.
3188 usecrosscompile="$undef"
3193 : see whether [:lower:] and [:upper:] are supported character classes
3195 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3197 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3201 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3202 # (0xd9 and 0xe2), therefore that is a nice testing point.
3203 if test "X$up" = X -o "X$low" = X; then
3204 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3210 if test "X$up" = X -o "X$low" = X; then
3211 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3217 if test "X$up" = X -o "X$low" = X; then
3218 case "`echo RS | od -x 2>/dev/null`" in
3220 echo "Hey, this might be EBCDIC." >&4
3221 if test "X$up" = X -o "X$low" = X; then
3222 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3223 rs) up='[A-IJ-RS-Z]'
3228 if test "X$up" = X -o "X$low" = X; then
3229 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3239 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3241 echo "Using $up and $low to convert case." >&4
3244 echo "I don't know how to translate letters from upper to lower case." >&4
3245 echo "Your tr is not acting any way I know of." >&4
3249 : set up the translation script tr, must be called with ./tr of course
3253 '[A-Z][a-z]') exec $tr '$up' '$low';;
3254 '[a-z][A-Z]') exec $tr '$low' '$up';;
3261 : Try to determine whether config.sh was made on this system
3262 case "$config_sh" in
3264 myuname=`$uname -a 2>/dev/null`
3265 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3266 # Downcase everything to avoid ambiguity.
3267 # Remove slashes and single quotes so we can use parts of this in
3268 # directory and file names.
3269 # Remove newlines so myuname is sane to use elsewhere.
3270 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3271 # because the A-Z/a-z are not consecutive.
3272 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3273 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3274 newmyuname="$myuname"
3276 case "$knowitall" in
3278 if test -f ../config.sh; then
3279 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3280 eval "`grep myuname= ../config.sh`"
3282 if test "X$myuname" = "X$newmyuname"; then
3290 : Get old answers from old config file if Configure was run on the
3291 : same system, otherwise use the hints.
3294 if test -f config.sh; then
3296 rp="I see a config.sh file. Shall I use it to set the defaults?"
3299 n*|N*) echo "OK, I'll ignore it."
3300 mv config.sh config.sh.old
3301 myuname="$newmyuname"
3303 *) echo "Fetching default answers from your old config.sh file..." >&4
3311 : Older versions did not always set $sh. Catch re-use of such
3321 if test ! -f config.sh; then
3324 First time through, eh? I have some defaults handy for some systems
3325 that need some extra help getting the Configure answers right:
3328 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3330 : Half the following guesses are probably wrong... If you have better
3331 : tests or hints, please send them to perlbug@perl.org
3332 : The metaconfig authors would also appreciate a copy...
3333 $test -f /irix && osname=irix
3334 $test -f /xenix && osname=sco_xenix
3335 $test -f /dynix && osname=dynix
3336 $test -f /dnix && osname=dnix
3337 $test -f /lynx.os && osname=lynxos
3338 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3339 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3340 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3341 $test -f /bin/mips && /bin/mips && osname=mips
3342 $test -d /usr/apollo/bin && osname=apollo
3343 $test -f /etc/saf/_sactab && osname=svr4
3344 $test -d /usr/include/minix && osname=minix
3345 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3346 if $test -d /MachTen -o -d /MachTen_Folder; then
3348 if $test -x /sbin/version; then
3349 osvers=`/sbin/version | $awk '{print $2}' |
3350 $sed -e 's/[A-Za-z]$//'`
3351 elif $test -x /usr/etc/version; then
3352 osvers=`/usr/etc/version | $awk '{print $2}' |
3353 $sed -e 's/[A-Za-z]$//'`
3359 $test -f /sys/posix.dll &&
3360 $test -f /usr/bin/what &&
3361 set X `/usr/bin/what /sys/posix.dll` &&
3362 $test "$3" = UWIN &&
3366 if $test -f $uname; then
3374 umips) osname=umips ;;
3377 [23]100) osname=mips ;;
3379 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3380 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3383 elif $test -f /etc/kconfig; then
3385 if test "$lns" = "$ln -s"; then
3387 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3389 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3396 if test -n "$DJGPP"; then
3405 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3407 # oslevel can fail with:
3408 # oslevel: Unable to acquire lock.
3409 *not\ found) osvers="$4"."$3" ;;
3410 '<3240'|'<>3240') osvers=3.2.0 ;;
3411 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3412 '=3250'|'>3250') osvers=3.2.5 ;;
3416 bitrig) osname=bitrig
3419 bsd386) osname=bsd386
3422 cygwin*) osname=cygwin
3425 *dc.osx) osname=dcosx
3431 domainos) osname=apollo
3437 dragonfly) osname=dragonfly
3440 dynixptx*) osname=dynixptx
3441 osvers=`echo "$4"|sed 's/^v//'`
3443 freebsd) osname=freebsd
3445 genix) osname=genix ;;
3449 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3462 $test -f /system/lib/libandroid.so && osname=linux-android
3466 netbsd*) osname=netbsd
3469 news-os) osvers="$3"
3471 4*) osname=newsos4 ;;
3475 nonstop-ux) osname=nonstopux ;;
3476 openbsd) osname=openbsd
3482 POSIX-BC | posix-bc ) osname=posix-bc
3485 powerux | power_ux | powermax_os | powermaxos | \
3486 powerunix | power_unix) osname=powerux
3492 solaris) osname=solaris
3494 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3501 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3505 titanos) osname=titanos
3514 ultrix) osname=ultrix
3517 osf1|mls+) case "$5" in
3520 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3523 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3526 hp*) osname=hp_osf1 ;;
3527 mips) osname=mips_osf1 ;;
3530 # UnixWare 7.1.2 is known as Open UNIX 8
3531 openunix|unixware) osname=svr5
3539 $2) case "$osname" in
3543 : svr4.x or possibly later
3553 if test -f /stand/boot ; then
3554 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3555 if test -n "$INITPROG" -a -f "$INITPROG"; then
3556 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3557 if test -n "$isesix"; then
3565 *) if test -f /etc/systemid; then
3567 set `echo $3 | $sed 's/\./ /g'` $4
3568 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3570 elif $test -f $src/hints/sco_$1_$2.sh; then
3572 elif $test -f $src/hints/sco_$1.sh; then
3577 '') : Still unknown. Probably a generic Sys V.
3586 *) case "$osname" in
3587 '') : Still unknown. Probably a generic BSD.
3595 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3596 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3597 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3600 $rm -f UU/kernel.what
3601 elif test -d c:/. -o -n "$is_os2" ; then
3608 case "$targetarch" in
3611 case "$targetarch" in
3613 # Will load qnx.sh, which should change osname to nto
3618 # Catch arm-linux-androideabi, mipsel-linux-android,
3619 # and i686-linux-android
3620 osname=linux-android
3624 # Something like arm-linux-gnueabihf is really just
3631 # XXX perhaps we should just assume
3632 # osvers to be 2, or maybe take the value
3633 # from targetarch. Using $run before the
3634 # hints are run is somewhat icky.
3635 set X `$run $uname -a 2>/dev/null`
3638 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3643 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3650 : Now look for a hint file osname_osvers, unless one has been
3651 : specified already.
3654 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3655 : Also try without trailing minor version numbers.
3656 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3657 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3658 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3659 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3662 *) case "$osvers" in
3665 *) if $test -f $src/hints/$file.sh ; then
3667 elif $test -f $src/hints/$xfile.sh ; then
3669 elif $test -f $src/hints/$xxfile.sh ; then
3671 elif $test -f $src/hints/$xxxfile.sh ; then
3673 elif $test -f $src/hints/$xxxxfile.sh ; then
3675 elif $test -f "$src/hints/${osname}.sh" ; then
3684 if $test -f Policy.sh ; then
3687 none) dflt="Policy" ;;
3688 *) dflt="Policy $dflt" ;;
3693 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3697 if $test -f Policy.sh ; then
3700 There's also a Policy hint file available, which should make the
3701 site-specific (policy) questions easier to answer.
3708 You may give one or more space-separated answers, or "none" if appropriate.
3709 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3710 previous run of Configure, you may specify it as well as or instead of
3711 OS-specific hints. If hints are provided for your OS, you should use them:
3712 although Perl can probably be built without hints on many platforms, using
3713 hints often improve performance and may enable features that Configure can't
3714 set up on its own. If there are no hints that match your OS, specify "none";
3715 DO NOT give a wrong version or a wrong OS.
3719 rp="Which of these apply, if any?"
3722 for file in $tans; do
3723 if $test X$file = XPolicy -a -f Policy.sh; then
3725 $cat Policy.sh >> UU/config.sh
3726 elif $test -f $src/hints/$file.sh; then
3727 . $src/hints/$file.sh
3728 $cat $src/hints/$file.sh >> UU/config.sh
3729 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3732 : Give one chance to correct a possible typo.
3733 echo "$file.sh does not exist"
3735 rp="hint to use instead?"
3737 for file in $ans; do
3738 if $test -f "$src/hints/$file.sh"; then
3739 . $src/hints/$file.sh
3740 $cat $src/hints/$file.sh >> UU/config.sh
3741 elif $test X$ans = X -o X$ans = Xnone ; then
3744 echo "$file.sh does not exist -- ignored."
3751 : Remember our hint file for later.
3752 if $test -f "$src/hints/$file.sh" ; then
3762 echo "Fetching default answers from $config_sh..." >&4
3766 cp $config_sh config.sh 2>/dev/null
3776 test "$override" && . ./optdef.sh
3778 : Restore computed paths
3779 for file in $loclist $trylist; do
3780 eval $file="\$_$file"
3785 Configure uses the operating system name and version to set some defaults.
3786 The default value is probably right if the name rings a bell. Otherwise,
3787 since spelling matters for me, either accept the default or answer "none"
3794 ''|' '|none) dflt=none ;;
3795 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3798 *) dflt="$osname" ;;
3800 rp="Operating system name?"
3804 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3810 ''|' '|none) dflt=none ;;
3811 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3812 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3814 ''|' ') dflt=none ;;
3819 *) dflt="$osvers" ;;
3821 rp="Operating system version?"
3831 : who configured the system
3832 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3835 cf_by=`(logname) 2>/dev/null`
3838 cf_by=`(whoami) 2>/dev/null`
3840 "") cf_by=unknown ;;
3845 : decide how portable to be. Allow command line overrides.
3846 case "$d_portable" in
3848 *) d_portable="$define" ;;
3851 : set up shell script to do ~ expansion
3857 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3860 if $test -f /bin/csh; then
3861 /bin/csh -f -c "glob \$1"
3866 name=\`$expr x\$1 : '..\([^/]*\)'\`
3867 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3868 if $test ! -d "\$dir"; then
3870 echo "\$me: can't locate home directory for: \$name" >&2
3875 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3891 : now set up to get a file name
3895 cat <<'EOSC' >>getfile
3911 : getfile will accept an answer from the comma-separated list
3912 : enclosed in parentheses even if it does not meet other criteria.
3913 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3914 fn=`echo $fn | sed 's/(.*)//'`
3920 loc_file=`expr $fn : '.*:\(.*\)'`
3921 fn=`expr $fn : '\(.*\):.*'`
3929 */*) fullpath=true;;
3938 *e*) exp_file=true;;
3941 *p*) nopath_ok=true;;
3946 *d*) type='Directory';;
3947 *l*) type='Locate';;
3952 Locate) what='File';;
3957 case "$d_portable" in
3965 while test "$type"; do
3970 true) rp="$rp (~name ok)";;
3973 if test -f UU/getfile.ok && \
3974 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3993 value=`UU/filexp $ans`
3996 if test "$ans" != "$value"; then
3997 echo "(That expands to $value on this system.)"
4011 /*) value="$ansexp" ;;
4012 [a-zA-Z]:/*) value="$ansexp" ;;
4017 echo "I shall only accept a full path name, as in /bin/ls." >&4
4018 echo "Use a ! shell escape if you wish to check pathnames." >&4
4021 echo "Please give a full path name, starting with slash." >&4
4024 echo "Note that using ~name is ok provided it expands well." >&4
4037 for fp in $gfpth; do
4038 if test "X$fp" = X.; then
4043 if test -f "$pf"; then
4045 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4047 echo "($value is not a plain file, but that's ok.)"
4050 if test X"$type" = X; then
4057 for fp in $gfpth; do
4058 if test "X$fp" = X.; then
4063 direxp="$fp/$ansexp"
4065 if test -d "$direxp"; then
4073 if test -d "$ansexp"; then
4074 echo "(Looking for $loc_file in directory $value.)"
4075 value="$value/$loc_file"
4076 ansexp="$ansexp/$loc_file"
4078 if test -f "$ansexp"; then
4081 case "$nopath_ok" in
4082 true) case "$value" in
4084 *) echo "Assuming $value will be in people's path."
4100 if test "$fastread" = yes; then
4105 rp="$what $value doesn't exist. Use that name anyway?"
4124 test "X$gfpthkeep" != Xy && gfpth=""
4127 : determine root of directory hierarchy where package will be installed.
4130 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4133 dflt=`echo "$prefix" | sed 's/.$//'`
4141 By default, $package will be installed in $dflt/bin, manual pages
4142 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4143 installation directories. Typically this is something like /usr/local.
4144 If you wish to have binaries under /usr/bin but other parts of the
4145 installation under /usr/local, that's ok: you will be prompted
4146 separately for each of the installation directories, the prefix being
4147 only used to set the defaults.
4151 rp='Installation prefix to use?'
4159 *) oldprefix="$prefix";;
4166 : allow them to override the AFS root
4169 *) afsroot=$afsroot ;;
4175 $define|true) afs=true ;;
4176 $undef|false) afs=false ;;
4177 *) if $test -d $afsroot; then
4185 echo "AFS may be running... I'll be extra cautious then..." >&4
4187 echo "AFS does not seem to be running..." >&4
4190 : determine installation prefix for where package is to be installed.
4194 Since you are running AFS, I need to distinguish the directory in which
4195 files will reside from the directory in which they are installed (and from
4196 which they are presumably copied to the former directory by occult means).
4199 case "$installprefix" in
4200 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4201 *) dflt="$installprefix";;
4206 In some special cases, particularly when building $package for distribution,
4207 it is convenient to distinguish the directory in which files should be
4208 installed from the directory ($prefix) in which they will
4209 eventually reside. For most users, these two directories are the same.
4212 case "$installprefix" in
4214 *) dflt=$installprefix;;
4218 rp='What installation prefix should I use for installing files?'
4220 installprefix="$ans"
4221 installprefixexp="$ansexp"
4223 : Perform the prefixexp/installprefixexp correction if necessary
4224 cat <<EOS >installprefix
4227 cat <<'EOSC' >>installprefix
4228 : Change installation prefix, if necessary.
4229 if $test X"$prefix" != X"$installprefix"; then
4230 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4232 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4235 chmod +x installprefix
4236 $eunicefix installprefix
4238 : Set variables such as privlib and privlibexp from the output of ./getfile
4239 : performing the prefixexp/installprefixexp correction if necessary.
4240 cat <<EOS >setprefixvar
4243 cat <<'EOSC' >>setprefixvar
4244 eval "${prefixvar}=\"\$ans\""
4245 eval "${prefixvar}exp=\"\$ansexp\""
4248 chmod +x setprefixvar
4249 $eunicefix setprefixvar
4251 : set up the script used to warn in case of inconsistency
4260 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4262 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4263 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4268 echo "*** WHOA THERE!!! ***" >&4
4269 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4272 rp=" Keep the $hint value?"
4275 y) td=$was; tu=$was;;
4279 : function used to set '$1' to '$val'
4280 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4282 $define$undef) . ./whoa; eval "$var=\$td";;
4283 $undef$define) . ./whoa; eval "$var=\$tu";;
4284 *) eval "$var=$val";;
4287 : get the patchlevel
4289 echo "Getting the current patchlevel..." >&4
4290 if $test -r $rsrc/patchlevel.h;then
4291 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4292 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4293 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4294 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4295 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4296 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4297 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4306 $echo "(You do not have patchlevel.h. Eek.)"
4308 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4309 version_patchlevel_string="version $patchlevel subversion $subversion"
4310 case "$perl_patchlevel" in
4312 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4313 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4317 $echo "(You have $package $version_patchlevel_string.)"
4321 : XXX Should be a Configure test for double-dots in filenames.
4322 version=`echo $revision $patchlevel $subversion | \
4323 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4324 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4325 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4328 version=`echo $revision $patchlevel $subversion | \
4329 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4330 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4331 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4334 : Special case the 5.005_xx maintenance series, which used 5.005
4335 : without any subversion label as a subdirectory in $sitelib
4336 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4337 api_versionstring='5.005'
4340 : Do we want threads support and if so, what type
4341 case "$usethreads" in
4342 $define|true|[yY]*) dflt='y';;
4343 *) # Catch case where user specified ithreads or 5005threads but
4344 # forgot -Dusethreads (A.D. 4/2002)
4345 case "$useithreads$use5005threads" in
4346 *$define*) dflt='y';;
4353 Perl can be built to offer a form of threading support on some systems
4354 To do so, Configure can be run with -Dusethreads.
4356 Note that Perl built with threading support runs slightly slower
4357 and uses slightly more memory than plain Perl.
4359 If this doesn't make any sense to you, just accept the default '$dflt'.
4361 rp='Build a threading Perl?'
4364 y|Y) val="$define" ;;
4370 if $test $patchlevel -lt 9; then
4371 case "$usethreads" in
4373 : Default to ithreads unless overridden on command line or with
4376 case "$use5005threads" in
4378 echo "5.005 threads are no longer supported"
4382 case "$useithreads" in
4383 $undef|false|[nN]*) dflt='n';;
4385 rp='Use the newer interpreter-based ithreads?'
4388 y|Y) val="$define" ;;
4393 : Now set use5005threads to the opposite value.
4394 case "$useithreads" in
4395 $define) val="$undef" ;;
4402 useithreads="$undef"
4403 use5005threads="$undef"
4407 case "$useithreads$use5005threads" in
4411 You cannot have both the ithreads and the 5.005 threads enabled
4412 at the same time. Disabling the 5.005 threads since they are
4413 much less stable than the ithreads.
4416 use5005threads="$undef"
4421 : perl-5.9.x and later
4423 if test X"$usethreads" = "X$define"; then
4424 case "$use5005threads" in
4428 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4435 use5005threads="$undef"
4436 useithreads="$usethreads"
4439 case "$d_oldpthreads" in
4440 '') : Configure tests would be welcome here. For now, assume undef.
4442 *) val="$d_oldpthreads" ;;
4448 : Look for a hint-file generated 'call-back-unit'. If the
4449 : user has specified that a threading perl is to be built,
4450 : we may need to set or change some other defaults.
4451 if $test -f usethreads.cbu; then
4452 echo "Your platform has some specific hints regarding threaded builds, using them..."
4455 case "$usethreads" in
4456 "$define"|true|[yY]*)
4458 (Your platform does not have any specific hints for threaded builds.
4459 Assuming POSIX threads, then.)
4465 : Check if multiplicity is required
4468 Perl can be built so that multiple Perl interpreters can coexist
4469 within the same Perl executable.
4472 case "$useithreads" in
4475 This multiple interpreter support is required for interpreter-based threads.
4479 *) case "$usemultiplicity" in
4480 $define|true|[yY]*) dflt='y';;
4484 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4485 rp='Build Perl for multiplicity?'
4488 y|Y) val="$define" ;;
4496 : Check if morebits is requested
4497 case "$usemorebits" in
4498 "$define"|true|[yY]*)
4499 use64bitint="$define"
4500 uselongdouble="$define"
4501 usemorebits="$define"
4503 *) usemorebits="$undef"
4507 : Determine the C compiler to be used
4513 rp="Use which C compiler?"
4517 : See whether they have no cc but they do have gcc
4519 if $test -f cc.cbu; then
4524 : make some quick guesses about what we are up against
4526 $echo $n "Hmm... $c"
4536 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4537 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4539 echo "Looks kind of like an OSF/1 system, but we'll see..."
4541 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4542 xxx=`./loc addbib blurfl $pth`
4543 if $test -f $xxx; then
4544 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4548 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4549 echo "Looks kind of like an extended USG system, but we'll see..."
4551 echo "Looks kind of like a USG system, but we'll see..."
4555 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4556 echo "Looks kind of like a BSD system, but we'll see..."
4560 echo "Looks kind of like a Version 7 system, but we'll see..."
4563 case "$eunicefix" in
4566 There is, however, a strange, musty smell in the air that reminds me of
4567 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4571 : it so happens the Eunice I know will not run shell scripts in Unix format
4575 echo "Congratulations. You aren't running Eunice."
4579 : Detect OS2. The p_ variable is set above in the Head.U unit.
4580 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4581 : semicolon as a patch separator
4586 I have the feeling something is not exactly right, however...don't tell me...
4587 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4588 (Or you may be running DOS with DJGPP.)
4593 if test -f /xenix; then
4594 echo "Actually, this looks more like a XENIX system..."
4599 echo "It's not Xenix..."
4604 if test -f /venix; then
4605 echo "Actually, this looks more like a VENIX system..."
4612 echo "Nor is it Venix..."
4615 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4616 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4619 : Check if we are using GNU gcc and what its version is
4621 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4625 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4627 printf("%s\n", __VERSION__);
4629 printf("%s\n", "1");
4635 if $cc -o try $ccflags $ldflags try.c; then
4636 gccversion=`$run ./try`
4637 case "$gccversion" in
4638 '') echo "You are not using GNU cc." ;;
4639 *) echo "You are using GNU cc $gccversion."
4645 echo "*** WHOA THERE!!! ***" >&4
4646 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4647 case "$knowitall" in
4649 echo " You'd better start hunting for one and let me know about it." >&4
4655 case "$gccversion" in
4656 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4658 case "$gccversion" in
4659 '') gccosandvers='' ;;
4660 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4661 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4663 case "$gccosandvers" in
4664 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4665 $osname$osvers) ;; # looking good
4666 $osname*) cat <<EOM >&4
4668 *** WHOA THERE!!! ***
4670 Your gcc has not been compiled for the exact release of
4671 your operating system ($gccosandvers versus $osname$osvers).
4673 In general it is a good idea to keep gcc synchronized with
4674 the operating system because otherwise serious problems
4675 may ensue when trying to compile software, like Perl.
4677 I'm trying to be optimistic here, though, and will continue.
4678 If later during the configuration and build icky compilation
4679 problems appear (headerfile conflicts being the most common
4680 manifestation), I suggest reinstalling the gcc to match
4681 your operating system release.
4685 *) gccosandvers='' ;; # failed to parse, better be silent
4693 # gcc 3.* complain about adding -Idirectories that they already know about,
4694 # so we will take those off from locincpth.
4695 case "$gccversion" in
4697 echo "main(){}">try.c
4698 for incdir in $locincpth; do
4699 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4700 grep '^c[cp]p*[01]: warning: changing search order '`
4701 if test "X$warn" != X; then
4702 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4708 # gcc 4.9 by default does some optimizations that break perl.
4709 # see ticket 121505.
4711 # The -fwrapv disables those optimizations (and probably others,) so
4712 # for gcc 4.9 (and later, since the optimizations probably won't go
4713 # away), add -fwrapv unless the user requests -fno-wrapv, which
4714 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4715 # which turns the overflows -fwrapv ignores into runtime errors.
4716 case "$gccversion" in
4717 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4719 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4720 *) ccflags="$ccflags -fwrapv" ;;
4724 : What should the include directory be ?
4725 : Use sysroot if set, so findhdr looks in the right place.
4727 $echo $n "Hmm... $c"
4728 dflt="$sysroot/usr/include"
4731 if $test -f /bin/mips && /bin/mips; then
4732 echo "Looks like a MIPS system..."
4733 $cat >usr.c <<'EOCP'
4734 #ifdef SYSTYPE_BSD43
4738 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4739 dflt='/bsd43/usr/include'
4743 mips_type='System V'
4745 $rm -f usr.c usr.out
4746 echo "and you're compiling with the $mips_type compiler and libraries."
4750 echo "Doesn't look like a MIPS system."
4760 case "$xxx_prompt" in
4763 rp='Where are the include files you want to use?'
4771 : see how we invoke the C preprocessor
4773 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4774 cat <<'EOT' >testcpp.c
4780 if test ! -f cppstdin; then
4781 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4782 # AIX cc -E doesn't show the absolute headerfile
4783 # locations but we'll cheat by using the -M flag.
4784 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
4786 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4789 echo "Keeping your $hint cppstdin wrapper."
4792 wrapper=`pwd`/cppstdin
4796 if $test "X$cppstdin" != "X" && \
4797 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4798 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4800 echo "You used to use $cppstdin $cppminus so we'll use that again."
4802 '') echo "But let's see if we can live without a wrapper..." ;;
4804 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4805 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4807 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4810 echo "(However, $cpprun $cpplast does not work, let's see...)"
4818 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4825 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4826 $cc -E <testcpp.c >testcpp.out 2>&1; \
4827 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4828 echo "Yup, it does."
4829 x_cpp="$cc $cppflags -E"
4831 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4832 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4834 echo "Yup, it does."
4835 x_cpp="$cc $cppflags -E"
4837 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4838 $cc -P <testcpp.c >testcpp.out 2>&1; \
4839 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4840 echo "Yipee, that works!"
4841 x_cpp="$cc $cppflags -P"
4843 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4844 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4845 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4846 echo "At long last!"
4847 x_cpp="$cc $cppflags -P"
4849 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4850 $cpp <testcpp.c >testcpp.out 2>&1; \
4851 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4853 x_cpp="$cpp $cppflags"
4855 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4856 $cpp - <testcpp.c >testcpp.out 2>&1; \
4857 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4858 echo "Hooray, it works! I was beginning to wonder."
4859 x_cpp="$cpp $cppflags"
4861 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4862 $wrapper <testcpp.c >testcpp.out 2>&1; \
4863 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 rp="No dice. I can't find a C preprocessor. Name one:"
4873 $x_cpp <testcpp.c >testcpp.out 2>&1
4874 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4875 echo "OK, that will do." >&4
4877 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4892 echo "Perhaps can we force $cc -E using a wrapper..."
4893 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4894 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4900 echo "Nope, we'll have to live without it..."
4914 "$wrapper"|'cppstdin') ;;
4915 *) $rm -f $wrapper;;
4917 $rm -f testcpp.c testcpp.out
4919 : Adjust cppfilter for path component separator
4921 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4922 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4926 : Use gcc to determine libpth and incpth
4927 # If using gcc or clang, we can get better values for libpth, incpth
4928 # and usrinc directly from the compiler.
4929 # Note that ccname for clang is also gcc.
4932 $echo 'extern int foo;' > try.c
4933 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4935 if $test $# -gt 0; then
4937 incpth="`$echo $incpth|$sed 's/^ //'`"
4939 j="`$echo $i|$sed 's,/include$,/lib,'`"
4940 if $test -d $j; then
4944 libpth="`$echo $libpth|$sed 's/^ //'`"
4945 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4946 if $test -d $xxx; then
4949 *) libpth="$libpth $xxx";;
4956 '') for i in $incpth; do
4957 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4965 case "$usecrosscompile" in
4968 '') echo "Incpth not defined." >&4; croak=y ;;
4969 *) echo "Using incpth '$incpth'." >&4 ;;
4972 '') echo "Libpth not defined." >&4; croak=y ;;
4973 *) echo "Using libpth '$libpth'." >&4 ;;
4976 '') echo "Usrinc not defined." >&4; croak=y ;;
4977 *) echo "Using usrinc $usrinc." >&4 ;;
4981 if test "X$sysroot" = X; then
4982 echo "Cannot continue, aborting." >&4; exit 1
4984 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4993 : Default value for incpth is just usrinc
4995 '') incpth="$usrinc";;
4998 : Set private lib path
5001 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5006 '') dlist="$loclibpth $plibpth $glibpth";;
5007 *) dlist="$libpth";;
5010 : Now check and see which directories actually exist, avoiding duplicates
5013 if $test -d $xxx; then
5016 *) libpth="$libpth $xxx";;
5022 Some systems have incompatible or broken versions of libraries. Among
5023 the directories listed in the question below, please remove any you
5024 know not to be holding relevant libraries, and add any that are needed.
5025 Say "none" for none.
5029 if test "X$sysroot" != X; then
5031 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5044 rp="Directories to use for library searches?"
5051 : compute shared library extension
5054 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5064 On some systems, shared libraries may be available. Answer 'none' if
5065 you want to suppress searching of shared libraries for the remainder
5066 of this configuration.
5069 rp='What is the file extension used for shared libraries?'
5073 : Does target system insist that shared library basenames are unique
5076 Some dynamic loaders assume that the *basename* of shared library filenames
5077 are globally unique. We'll default this to undef as we assume your system
5078 is not this weird. Set to defined if you're on one of them.
5083 rp='Make shared library basenames unique?'
5086 y|Y) val="$define" ;;
5089 set d_libname_unique
5092 : Define several unixisms.
5093 : Hints files or command line option can be used to override them.
5094 : The convoluted testing is in case hints files set either the old
5097 '') case "$exe_ext" in
5099 *) _exe="$exe_ext" ;;
5104 '') case "$lib_ext" in
5111 '') case "$obj_ext" in
5118 '') case "$path_sep" in
5129 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5131 : Which makefile gets called first. This is used by make depend.
5132 case "$firstmakefile" in
5133 '') firstmakefile='makefile';;
5136 : Check is we will use socks
5138 $define|true|[yY]*) dflt='y';;
5143 Perl can be built to use the SOCKS proxy protocol library. To do so,
5144 Configure must be run with -Dusesocks. If you use SOCKS you also need
5145 to use the PerlIO abstraction layer, this will be implicitly selected.
5147 If this doesn't make any sense to you, just accept the default '$dflt'.
5149 rp='Build Perl for SOCKS?'
5152 y|Y) val="$define" ;;
5158 : Check for uselongdouble support
5160 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5163 case "$uselongdouble" in
5164 $define|true|[yY]*) dflt='y';;
5169 Perl can be built to take advantage of long doubles which
5170 (if available) may give more accuracy and range for floating point numbers.
5172 If this doesn't make any sense to you, just accept the default '$dflt'.
5174 rp='Try to use long doubles if available?'
5177 y|Y) val="$define" ;;
5183 case "$uselongdouble" in
5184 true|[yY]*) uselongdouble="$define" ;;
5187 : Look for a hint-file generated 'call-back-unit'. If the
5188 : user has specified that long doubles should be used,
5189 : we may need to set or change some other defaults.
5190 if $test -f uselongdouble.cbu; then
5191 echo "Your platform has some specific hints regarding long doubles, using them..."
5192 . ./uselongdouble.cbu
5194 case "$uselongdouble" in
5197 (Your platform does not have any specific hints for long doubles.)
5203 : Check if quadmath is requested
5204 case "$usequadmath" in
5205 "$define"|true|[yY]*) usequadmath="$define" ;;
5206 *) usequadmath="$undef" ;;
5209 : Looking for optional libraries
5211 echo "Checking for optional libraries..." >&4
5216 case "$libswanted" in
5217 '') libswanted='c_s';;
5220 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5222 case "$usecbacktrace" in
5223 "$define") libswanted="$libswanted bfd" ;;
5225 case "$usequadmath" in
5226 "$define") libswanted="$libswanted quadmath" ;;
5232 for thisdir in $libpth $xlibpth; do
5233 test -d $thisdir && libspath="$libspath $thisdir"
5235 for thislib in $libswanted; do
5236 for thisdir in $libspath; do
5238 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5239 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5240 $test -f "$xxx" && eval $libscheck
5241 $test -f "$xxx" && libstyle=shared
5242 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5243 $test -f "$xxx" && eval $libscheck
5244 $test -f "$xxx" && libstyle=shared
5246 if test ! -f "$xxx"; then
5247 xxx=$thisdir/lib$thislib.$so
5248 $test -f "$xxx" && eval $libscheck
5249 $test -f "$xxx" && libstyle=shared
5251 if test ! -f "$xxx"; then
5252 xxx=$thisdir/lib$thislib$_a
5253 $test -f "$xxx" && eval $libscheck
5254 $test -f "$xxx" && libstyle=static
5256 if test ! -f "$xxx"; then
5257 xxx=$thisdir/$thislib$_a
5258 $test -f "$xxx" && eval $libscheck
5259 $test -f "$xxx" && libstyle=static
5261 if test ! -f "$xxx"; then
5262 xxx=$thisdir/lib${thislib}_s$_a
5263 $test -f "$xxx" && eval $libscheck
5264 $test -f "$xxx" && libstyle=static
5265 $test -f "$xxx" && thislib=${thislib}_s
5267 if test ! -f "$xxx"; then
5268 xxx=$thisdir/Slib$thislib$_a
5269 $test -f "$xxx" && eval $libscheck
5270 $test -f "$xxx" && libstyle=static
5272 if $test -f "$xxx"; then
5274 shared) echo "Found -l$thislib (shared)." ;;
5275 static) echo "Found -l$thislib." ;;
5276 *) echo "Found -l$thislib ($libstyle)." ;;
5280 *) dflt="$dflt -l$thislib"
5281 libsfound="$libsfound $xxx"
5283 libsfiles="$libsfiles $yyy"
5284 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5285 case " $libsdirs " in
5287 *) libsdirs="$libsdirs $yyy" ;;
5294 if $test ! -f "$xxx"; then
5295 echo "No -l$thislib."
5306 ' '|'') dflt='none';;
5311 In order to compile $package on your machine, a number of libraries
5312 are usually needed. Include any other special libraries here as well.
5313 Say "none" for none. The default list is almost always right.
5317 rp="What libraries to use?"
5324 : determine optimization, if desired, or use for debug flag also
5326 ' '|$undef) dflt='none';;
5328 *) dflt="$optimize";;
5332 By default, $package compiles with the -O flag to use the optimizer.
5333 Alternately, you might want to use the symbolic debugger, which uses
5334 the -g flag (on traditional Unix systems). Either flag can be
5335 specified here. To use neither flag, specify the word "none".
5338 rp="What optimizer/debugger flag should be used?"
5342 'none') optimize=" ";;
5345 : Check what DEBUGGING is required from the command line
5346 : -DEBUGGING or -DDEBUGGING or
5347 : -DEBUGGING=both = -g + -DDEBUGGING
5348 : -DEBUGGING=-g or -Doptimize=-g = -g
5349 : -DEBUGGING=none or -UDEBUGGING =
5350 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5353 *) DEBUGGING=$EBUGGING ;;
5356 case "$DEBUGGING" in
5360 *) optimize="$optimize -g" ;;
5364 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5372 case "$DEBUGGING" in
5373 both|$define) dflt='-DDEBUGGING'
5376 : argument order is deliberate, as the flag will start with - which set could
5377 : think is an option
5378 checkccflag='check=$1; flag=$2; callback=$3;
5380 echo "Checking if your compiler accepts $flag" 2>&1;
5381 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5382 echo "int main(void) { return 0; }" > gcctest.c;
5383 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5384 echo "Yes, it does." 2>&1;
5385 if $test -s gcctest.out ; then
5386 echo "But your platform does not like it:";
5391 echo "Leaving current flags $ccflags alone." 2>&1
5393 *) dflt="$dflt $flag";
5399 echo "Nope, it does not, but that is ok." 2>&1;
5403 : We will not override a previous value, but we might want to
5404 : augment a hint file
5406 default|recommended)
5407 case "$gccversion" in
5408 1*) dflt="$dflt -fpcc-struct-return" ;;
5410 case "$optimize:$DEBUGGING" in
5411 *-g*:old) dflt="$dflt -DDEBUGGING";;
5413 case "$gccversion" in
5414 2*) if $test -d /etc/conf/kconfig.d &&
5415 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5417 # Interactive Systems (ISC) POSIX mode.
5422 case "$gccversion" in
5425 ?*) set strict-aliasing -fno-strict-aliasing
5429 # For gcc, adding -pipe speeds up compilations for some, but apparently
5430 # some assemblers can't read from stdin. (It also slows down compilations
5431 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5432 case "$gccversion" in
5438 # on x86_64 (at least) we require an extra library (libssp) in the
5439 # link command line. This library is not named, so I infer that it is
5440 # an implementation detail that may change. Hence the safest approach
5441 # is to add the flag to the flags passed to the compiler at link time,
5442 # as that way the compiler can do the right implementation dependant
5444 case "$gccversion" in
5445 ?*) set stack-protector-strong -fstack-protector-strong
5448 *-fstack-protector-strong*) ;; # It got added.
5449 *) # Try the plain/older -fstack-protector.
5450 set stack-protector -fstack-protector
5459 case "$mips_type" in
5460 *BSD*|'') inclwanted="$locincpth $usrinc";;
5461 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5463 for thisincl in $inclwanted; do
5464 if $test -d $thisincl; then
5465 if $test x$thisincl != x$usrinc; then
5467 *" -I$thisincl "*);;
5468 *) dflt="$dflt -I$thisincl ";;
5474 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5476 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5484 *) dflt="$dflt -D$2";;
5488 set signal.h LANGUAGE_C; eval $inctest
5492 ccflags="$ccflags -DSOCKS"
5497 default|recommended) dflt="$ccflags $dflt" ;;
5498 *) dflt="$ccflags";;
5507 Your C compiler may want other flags. For this question you should include
5508 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5509 but you should NOT include libraries or ld flags like -lwhatever. If you
5510 want $package to honor its debug switch, you should include -DDEBUGGING here.
5511 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5513 To use no flags, specify the word "none".
5519 rp="Any additional cc flags?"
5526 : the following weeds options from ccflags that are of no interest to cpp
5528 '') cppflags="$ccflags" ;;
5529 *) cppflags="$cppflags $ccflags" ;;
5531 case "$gccversion" in
5532 1*) cppflags="$cppflags -D__GNUC__"
5534 case "$mips_type" in
5536 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5542 echo "Let me guess what the preprocessor flags are..." >&4
5556 *) ftry="$previous $flag";;
5558 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5559 >cpp1.out 2>/dev/null && \
5560 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5561 >cpp2.out 2>/dev/null && \
5562 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5563 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5565 cppflags="$cppflags $ftry"
5575 *-*) echo "They appear to be: $cppflags";;
5577 $rm -f cpp.c cpp?.out
5581 : flags used in final linking phase
5583 '') if ./venix; then
5589 *-posix*) dflt="$dflt -posix" ;;
5592 *) dflt="$ldflags";;
5594 # See note above about -fstack-protector
5596 *-fstack-protector-strong*)
5598 *-fstack-protector-strong*) ;; # Don't add it again
5599 *) dflt="$dflt -fstack-protector-strong" ;;
5602 *-fstack-protector*)
5604 *-fstack-protector*) ;; # Don't add it again
5605 *) dflt="$dflt -fstack-protector" ;;
5610 : Try to guess additional flags to pick up local libraries.
5611 for thislibdir in $libpth; do
5612 case " $loclibpth " in
5615 *"-L$thislibdir "*) ;;
5616 *) dflt="$dflt -L$thislibdir" ;;
5628 Your C linker may need flags. For this question you should
5629 include -L/whatever and any other flags used by the C linker, but you
5630 should NOT include libraries like -lwhatever.
5632 Make sure you include the appropriate -L/path flags if your C linker
5633 does not normally search all of the directories you specified above,
5636 To use no flags, specify the word "none".
5640 rp="Any additional ld flags (NOT including libraries)?"
5646 rmlist="$rmlist pdp11"
5650 echo "Checking your choice of C compiler and flags for coherency..." >&4
5651 $cat > try.c <<'EOF'
5653 int main() { printf("Ok\n"); return(0); }
5655 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5657 $cat >try.msg <<'EOM'
5658 I've tried to compile and run the following simple program:
5661 $cat try.c >> try.msg
5663 $cat >> try.msg <<EOM
5670 and I got the following output:
5674 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5675 if $sh -c "$run ./try " >>try.msg 2>&1; then
5679 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5682 echo "The program compiled OK, but exited with status $?." >>try.msg
5683 rp="You have a problem. Shall I abort Configure"
5687 echo "I can't compile the test program." >>try.msg
5688 rp="You have a BIG problem. Shall I abort Configure"
5694 case "$knowitall" in
5696 echo "(The supplied flags or libraries might be incorrect.)"
5704 *) echo "Ok. Stopping Configure." >&4
5709 n) echo "OK, that should do.";;
5711 $rm_try gcctest gcctest.out
5713 : define a shorthand compile call
5717 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5718 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5722 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5723 : define a shorthand compile call for compilations that should be ok.
5727 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5729 : determine filename position in cpp output
5731 echo "Computing filename position in cpp output for #include directives..." >&4
5733 vos) testaccess=-e ;;
5736 echo '#include <stdio.h>' > foo.c
5739 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5740 $grep '^[ ]*#.*stdio\.h' | \
5741 while read cline; do
5744 while $test \$# -gt 0; do
5745 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5750 pos=\`expr \$pos + 1\`
5762 *) pos="${fieldn}th";;
5764 echo "Your cpp writes the filename in the $pos field of the line."
5766 : locate header file
5771 for usrincdir in $incpth
5773 if test -f \$usrincdir/\$wanted; then
5774 echo "\$usrincdir/\$wanted"
5778 awkprg='{ print \$$fieldn }'
5779 echo "#include <\$wanted>" > foo\$\$.c
5780 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5781 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5782 while read cline; do
5783 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5785 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5786 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5791 # status = 0: grep returned 0 lines, case statement not executed
5792 # status = 1: headerfile found
5793 # status = 2: while loop executed, no headerfile found
5797 if test \$status -eq 1; then
5804 : define an alternate in-header-list? function
5805 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5806 cont=true; xxf="echo \"<\$1> found.\" >&4";
5807 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5808 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5810 case $# in 4) instead=instead;; *) instead="at last";; esac;
5811 while $test "$cont"; do
5813 var=$2; eval "was=\$$2";
5814 if $test "$xxx" && $test -r "$xxx";
5816 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5819 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5820 set $yyy; shift; shift; yyy=$@;
5821 case $# in 0) cont="";;
5822 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5823 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5824 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5825 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5829 do set $yyy; var=$2; eval "was=\$$2";
5830 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5831 set $yyy; shift; shift; yyy=$@;
5834 : see if stdlib is available
5835 set stdlib.h i_stdlib
5838 : check for lengths of integral types
5842 echo "Checking to see how big your integers are..." >&4
5851 printf("intsize=%d;\n", (int)sizeof(int));
5852 printf("longsize=%d;\n", (int)sizeof(long));
5853 printf("shortsize=%d;\n", (int)sizeof(short));
5858 if eval $compile_ok && $run ./try > /dev/null; then
5860 echo "Your integers are $intsize bytes long."
5861 echo "Your long integers are $longsize bytes long."
5862 echo "Your short integers are $shortsize bytes long."
5866 Help! I can't compile and run the intsize test program: please enlighten me!
5867 (This is probably a misconfiguration in your system or libraries, and
5868 you really ought to fix it. Still, I'll try anyway.)
5872 rp="What is the size of an integer (in bytes)?"
5876 rp="What is the size of a long integer (in bytes)?"
5880 rp="What is the size of a short integer (in bytes)?"
5888 : check for long long
5890 echo "Checking to see if you have long long..." >&4
5891 echo 'int main() { long long x = 7; return 0; }' > try.c
5893 if eval $compile; then
5895 echo "You have long long."
5898 echo "You do not have long long."
5904 : check for length of long long
5905 case "${d_longlong}${longlongsize}" in
5908 echo "Checking to see how big your long longs are..." >&4
5909 $cat >try.c <<'EOCP'
5913 printf("%d\n", (int)sizeof(long long));
5918 if eval $compile_ok; then
5919 longlongsize=`$run ./try`
5920 echo "Your long longs are $longlongsize bytes long."
5924 echo "(I can't seem to compile the test program. Guessing...)"
5925 rp="What is the size of a long long (in bytes)?"
5929 if $test "X$longsize" = "X$longlongsize"; then
5930 echo "(That isn't any different from an ordinary long.)"
5936 : see if inttypes.h is available
5937 : we want a real compile instead of Inhdr because some systems
5938 : have an inttypes.h which includes non-existent headers
5941 #include <inttypes.h>
5943 static int32_t foo32 = 0x12345678;
5947 if eval $compile; then
5948 echo "<inttypes.h> found." >&4
5951 echo "<inttypes.h> NOT found." >&4
5960 echo "Checking to see if you have int64_t..." >&4
5962 #include <sys/types.h>
5963 #$i_inttypes I_INTTYPES
5965 #include <inttypes.h>
5967 int main() { int64_t x = 7; }
5970 if eval $compile; then
5972 echo "You have int64_t."
5975 echo "You do not have int64_t."
5981 : Check if 64bit ints have a quad type
5983 echo "Checking which 64-bit integer type we could use..." >&4
5989 val='"unsigned int"'
5994 *) case "$longsize" in
5998 val='"unsigned long"'
6003 *) case "$d_longlong:$longlongsize" in
6008 val='"unsigned long long"'
6013 *) case "$d_int64_t" in
6032 '') echo "Alas, no 64-bit integer types in sight." >&4
6035 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6040 : Do we want 64bit support
6041 case "$uselonglong" in
6042 "$define"|true|[yY]*)
6045 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6047 use64bitint="$define"
6050 case "$use64bits" in
6051 "$define"|true|[yY]*)
6054 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6056 use64bitint="$define"
6059 case "$use64bitints" in
6060 "$define"|true|[yY]*)
6063 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6065 use64bitint="$define"
6068 case "$use64bitsint" in
6069 "$define"|true|[yY]*)
6072 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6074 use64bitint="$define"
6077 case "$uselonglongs" in
6078 "$define"|true|[yY]*)
6081 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6083 use64bitint="$define"
6086 case "$use64bitsall" in
6087 "$define"|true|[yY]*)
6090 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6092 use64bitall="$define"
6097 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6099 case "$use64bitall" in
6100 "$define"|true|[yY]*) use64bitint="$define" ;;
6106 You have natively 64-bit long integers.
6110 *) case "$use64bitint" in
6111 "$define"|true|[yY]*) dflt='y';;
6120 Perl can be built to take advantage of 64-bit integer types
6121 on some systems. To do so, Configure can be run with -Duse64bitint.
6122 Choosing this option will most probably introduce binary incompatibilities.
6124 If this doesn't make any sense to you, just accept the default '$dflt'.
6125 (The default has been chosen based on your configuration.)
6127 rp='Try to use 64-bit integers, if available?'
6130 [yY]*) val="$define" ;;
6138 case "$use64bitall" in
6139 "$define"|true|[yY]*) dflt='y' ;;
6140 *) case "$longsize" in
6148 You may also choose to try maximal 64-bitness. It means using as much
6149 64-bitness as possible on the platform. This in turn means even more
6150 binary incompatibilities. On the other hand, your platform may not
6151 have any more 64-bitness available than what you already have chosen.
6153 If this doesn't make any sense to you, just accept the default '$dflt'.
6154 (The default has been chosen based on your configuration.)
6156 rp='Try to use maximal 64-bit support, if available?'
6159 [yY]*) val="$define" ;;
6164 case "$use64bitall" in
6166 case "$use64bitint" in
6170 Since you have chosen a maximally 64-bit build, I'm also turning on
6171 the use of 64-bit integers.
6173 use64bitint="$define" ;;
6178 : Look for a hint-file generated 'call-back-unit'. If the
6179 : user has specified that a 64-bit perl is to be built,
6180 : we may need to set or change some other defaults.
6181 if $test -f use64bitint.cbu; then
6182 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6185 case "$use64bitint" in
6186 "$define"|true|[yY]*)
6187 : This test was common to all the OpenBSD forks, and seems harmless for
6190 echo "Checking if your C library has broken 64-bit functions..." >&4
6193 typedef $uquadtype myULL;
6200 {4294967303.15, 4294967303ULL},
6201 {4294967294.2, 4294967294ULL},
6202 {4294967295.7, 4294967295ULL},
6205 for (p = test; p->u; p++) {
6206 myULL x = (myULL)p->d;
6217 if eval $compile_ok; then
6218 libcquad=`$run ./try`
6219 echo "Your C library's 64-bit functions are $libcquad."
6221 echo "(I can't seem to compile the test program.)"
6222 echo "Assuming that your C library's 64-bit functions are ok."
6231 *** You have a C library with broken 64-bit functions.
6232 *** 64-bit support does not work reliably in this configuration.
6233 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6234 *** Cannot continue, aborting.
6241 4) case "$archname64" in
6242 '') archname64=64int ;;
6249 : Look for a hint-file generated 'call-back-unit'. If the
6250 : user has specified that a maximally 64-bit perl is to be built,
6251 : we may need to set or change some other defaults.
6252 if $test -f use64bitall.cbu; then
6253 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6256 case "$use64bitall" in
6257 "$define"|true|[yY]*)
6259 4) case "$archname64" in
6260 ''|64int) archname64=64all ;;
6267 case "$d_quad:$use64bitint" in
6271 *** You have chosen to use 64-bit integers,
6272 *** but none can be found.
6273 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6274 *** Cannot continue, aborting.
6281 : Check if we are using the GNU C library
6283 echo "Checking for GNU C Library..." >&4
6285 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6286 alone are insufficient to distinguish different versions, such as
6287 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6288 libc version 2.1.0. A. Dougherty, June 3, 2002.
6294 # ifdef __GLIBC_MINOR__
6295 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6296 # include <gnu/libc-version.h>
6297 printf("%s\n", gnu_get_libc_version());
6299 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6302 printf("%d\n", __GLIBC__);
6311 if eval $compile_ok && $run ./try > glibc.ver; then
6313 gnulibc_version=`$cat glibc.ver`
6314 echo "You are using the GNU C Library version $gnulibc_version"
6318 echo "You are not using the GNU C Library"
6324 : see if nm is to be used to determine whether a symbol is defined or not
6328 case "$d_gnulibc" in
6331 echo "nm probably won't work on the GNU C Library." >&4
6337 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6339 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6340 echo "'nm' won't be sufficient on this system." >&4
6346 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6347 if $test $dflt -gt 20; then
6357 true|$define) dflt=y;;
6364 I can use $nm to extract the symbols from your C libraries. This
6365 is a time consuming task which may generate huge output on the disk (up
6366 to 3 megabytes) but that should make the symbols extraction faster. The
6367 alternative is to skip the 'nm' extraction part and to compile a small
6368 test program instead to determine whether each symbol is present. If
6369 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6370 this may be the best solution.
6372 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6375 rp="Shall I use $nm to extract C symbols from the libraries?"
6378 [Nn]*) usenm=false;;
6387 : nm options which may be necessary
6389 '') if $test -f /mach_boot; then
6391 elif $test -d /usr/ccs/lib; then
6392 nm_opt='-p' # Solaris (and SunOS?)
6393 elif $test -f /dgux; then
6395 elif $test -f /lib64/rld; then
6396 nm_opt='-p' # 64-bit Irix
6402 : nm options which may be necessary for shared libraries but illegal
6403 : for archive libraries. Thank you, Linux.
6404 case "$nm_so_opt" in
6405 '') case "$myuname" in
6407 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6408 nm_so_opt='--dynamic'
6415 : Figure out where the libc is located
6418 : get list of predefined functions in a handy place
6423 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6429 *) for thislib in $libs; do
6432 : Handle C library specially below.
6435 thislib=`echo $thislib | $sed -e 's/^-l//'`
6436 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6438 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6440 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6442 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6444 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6446 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6448 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6453 libnames="$libnames $try"
6455 *) libnames="$libnames $thislib" ;;
6464 for xxx in $libpth; do
6465 $test -r $1 || set $xxx/libc.$so
6466 : The messy sed command sorts on library version numbers.
6468 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6469 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6471 s/[0-9][0-9]*/0000&/g
6472 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6475 $sort | $sed -e 's/^.* //'`
6478 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6479 $test -r $1 || set $sysroot/lib/libsys_s$_a
6485 if $test -r "$1"; then
6486 echo "Your (shared) C library seems to be in $1."
6488 elif $test -r /lib/libc && $test -r /lib/clib; then
6489 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6491 libc='/lib/clib /lib/libc'
6492 if $test -r /lib/syslib; then
6493 echo "(Your math library is in /lib/syslib.)"
6494 libc="$libc /lib/syslib"
6496 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6497 echo "Your C library seems to be in $libc, as you said before."
6498 elif $test -r $incpath/usr/lib/libc$_a; then
6499 libc=$incpath/usr/lib/libc$_a;
6500 echo "Your C library seems to be in $libc. That's fine."
6501 elif $test -r /lib/libc$_a; then
6503 echo "Your C library seems to be in $libc. You're normal."
6505 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6507 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6508 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6509 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6511 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6513 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6516 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6518 if $test -r "$tans"; then
6519 echo "Your C library seems to be in $tans, of all places."
6525 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6529 If the guess above is wrong (which it might be if you're using a strange
6530 compiler, or your machine supports multiple models), you can override it here.
6535 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6537 I can't seem to find your C library. I've looked in the following places:
6540 $sed 's/^/ /' libpath
6543 None of these seems to contain your C library. I need to get its name...
6548 rp='Where is your C library?'
6553 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6554 set X `cat libnames`
6557 case $# in 1) xxx=file; esac
6558 echo "Extracting names from the following $xxx for later perusal:" >&4
6560 $sed 's/^/ /' libnames >&4
6562 $echo $n "This may take a while...$c" >&4
6566 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6567 *) $nm $nm_opt $file 2>/dev/null;;
6572 $grep fprintf libc.tmp > libc.ptf
6573 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6574 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6576 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6578 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6580 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6582 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6584 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6586 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6588 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6592 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6596 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6600 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6601 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6603 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6605 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6609 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6613 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6617 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6621 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6625 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6629 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6634 $nm -p $* 2>/dev/null >libc.tmp
6635 $grep fprintf libc.tmp > libc.ptf
6636 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6637 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6643 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6645 if $ar t $libc > libc.tmp && \
6646 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6648 for thisname in $libnames $libc; do
6649 $ar t $thisname >>libc.tmp
6651 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6653 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6654 for thisname in $libnames $libc; do
6655 $ar tv $thisname >>libc.tmp
6656 emximp -o tmp.imp $thisname \
6658 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6659 < tmp.imp >>libc.tmp
6662 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6665 echo "$ar didn't seem to work right." >&4
6666 echo "Maybe this is a Cray...trying bld instead..." >&4
6668 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6671 for thisname in $libnames; do
6673 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6674 $ar t $thisname >>libc.tmp
6678 echo "That didn't work either. Giving up." >&4
6688 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6689 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6691 *) if $test -f /lib/syscalls.exp; then
6693 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6694 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6695 /lib/syscalls.exp >>libc.list
6701 $rm -f libnames libpath
6703 : Check if we are using C++
6705 echo "Checking for C++..." >&4
6706 $cat >try.c <<'EOCP'
6718 if eval $compile_ok && $run ./try; then
6720 echo "You are using a C++ compiler."
6723 echo "You are not using a C++ compiler."
6729 : is a C symbol defined?
6732 -v) tf=libc.tmp; tdc="";;
6733 -a) tf=libc.tmp; tdc="[]";;
6734 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6736 case "$d_cplusplus" in
6737 $define) extern_C="extern \"C\"" ;;
6738 *) extern_C="extern" ;;
6741 case "$reuseval-$4" in
6743 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6748 if $test "$runnm" = true; then
6749 if $contains $tlook $tf >/dev/null 2>&1; then
6751 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6752 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;
6753 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6754 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6758 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;
6759 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6765 $define) tval=true;;
6772 : define an is-in-libc? function
6773 inlibc='echo " "; td=$define; tu=$undef;
6774 sym=$1; var=$2; eval "was=\$$2";
6776 case "$reuseval$was" in
6786 echo "$sym() found." >&4;
6787 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6789 echo "$sym() NOT found." >&4;
6790 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6794 $define) echo "$sym() found." >&4;;
6795 *) echo "$sym() NOT found." >&4;;
6799 : check for length of double
6801 case "$doublesize" in
6803 echo "Checking to see how big your double precision numbers are..." >&4
6812 printf("%d\n", (int)sizeof(double));
6817 if eval $compile_ok; then
6818 doublesize=`$run ./try`
6819 echo "Your double is $doublesize bytes long."
6822 echo "(I can't seem to compile the test program. Guessing...)"
6823 rp="What is the size of a double precision number (in bytes)?"
6831 : see if this is a float.h system
6835 : check for long doubles
6837 echo "Checking to see if you have long double..." >&4
6838 echo 'int main() { long double x = 7.0; }' > try.c
6840 if eval $compile; then
6842 echo "You have long double."
6845 echo "You do not have long double."
6851 : see if ldexpl exists
6855 : check for length of long double
6856 case "${d_longdbl}${longdblsize}" in
6859 echo "Checking to see how big your long doubles are..." >&4
6860 $cat >try.c <<'EOCP'
6864 printf("%d\n", sizeof(long double));
6869 if eval $compile; then
6870 longdblsize=`$run ./try`
6871 echo "Your long doubles are $longdblsize bytes long."
6875 echo "(I can't seem to compile the test program. Guessing...)" >&4
6876 rp="What is the size of a long double (in bytes)?"
6880 if $test "X$doublesize" = "X$longdblsize"; then
6881 echo "That isn't any different from an ordinary double."
6882 echo "I'll keep your setting anyway, but you may see some"
6883 echo "harmless compilation warnings."
6889 $echo "Checking the kind of long doubles you have..." >&4
6890 case "$d_longdbl" in
6895 #define LONGDBLSIZE $longdblsize
6896 #define DOUBLESIZE $doublesize
6904 static const long double d = -0.1L;
6906 unsigned const char* b = (unsigned const char*)(&d);
6907 #if DOUBLESIZE == LONGDBLSIZE
6908 printf("0\n"); /* if it floats like double */
6911 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6912 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6913 /* IEEE 754 128-bit little-endian */
6917 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6918 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6923 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6924 * while 64-bits platforms have it in 16 bytes. */
6925 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6926 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6927 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6928 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6929 * Also known as "extended precision". */
6933 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6934 /* is there ever big-endian 80-bit, really? */
6939 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6940 /* software "double double", the 106 is 53+53.
6941 * but irix thinks it is 107. */
6942 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6943 /* double double 128-bit little-endian,
6944 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6948 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6949 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6950 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6955 printf("-1\n"); /* unknown */
6960 if eval $compile; then
6961 longdblkind=`$run ./try`
6968 case "$longdblkind" in
6969 0) echo "Your long doubles are doubles." >&4 ;;
6970 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6971 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6972 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6973 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
6974 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
6975 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
6976 *) echo "Cannot figure out your long double." >&4 ;;
6980 : determine the architecture name
6982 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6983 tarch=`arch`"-$osname"
6984 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6985 if uname -m > tmparch 2>&1 ; then
6986 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6987 -e 's/$/'"-$osname/" tmparch`
6995 case "$myarchname" in
6998 echo "(Your architecture name used to be $myarchname.)"
7002 case "$targetarch" in
7004 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7009 *) dflt="$archname";;
7011 rp='What is your architecture name'
7015 : optionally add API version to the architecture for versioned archlibs
7016 case "$useversionedarchname" in
7017 $define|true|[yY]*) dflt='y';;
7020 rp='Add the Perl API version to your archname?'
7023 y|Y) useversionedarchname="$define" ;;
7024 *) useversionedarchname="$undef" ;;
7026 case "$useversionedarchname" in
7029 *-$api_versionstring)
7030 echo "...and architecture name already has -$api_versionstring" >&4
7033 archname="$archname-$api_versionstring"
7034 echo "...setting architecture name to $archname." >&4
7040 case "$usethreads" in
7042 echo "Threads selected." >&4
7044 *-thread*) echo "...and architecture name already has -thread." >&4
7046 *) archname="$archname-thread"
7047 echo "...setting architecture name to $archname." >&4
7052 case "$usemultiplicity" in
7054 echo "Multiplicity selected." >&4
7056 *-multi*) echo "...and architecture name already has -multi." >&4
7058 *) archname="$archname-multi"
7059 echo "...setting architecture name to $archname." >&4
7064 case "$use64bitint$use64bitall" in
7066 case "$archname64" in
7068 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7071 case "$use64bitint" in
7072 "$define") echo "64 bit integers selected." >&4 ;;
7074 case "$use64bitall" in
7075 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7078 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7080 *) archname="$archname-$archname64"
7081 echo "...setting architecture name to $archname." >&4
7087 case "$uselongdouble" in
7089 echo "Long doubles selected." >&4
7090 case "$longdblsize" in
7092 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7096 *-ld*) echo "...and architecture name already has -ld." >&4
7098 *) archname="$archname-ld"
7099 echo "...setting architecture name to $archname." >&4
7106 case "$usequadmath" in
7108 echo "quadmath selected." >&4
7110 *-ld*) echo "...and architecture name already has -quadmath." >&4
7112 *) archname="$archname-quadmath"
7113 echo "...setting architecture name to $archname." >&4
7118 if $test -f archname.cbu; then
7119 echo "Your platform has some specific hints for architecture name, using them..."
7123 : set the prefixit variable, to compute a suitable default value
7124 prefixit='case "$3" in
7126 case "$oldprefix" in
7127 "") eval "$1=\"\$$2\"";;
7134 ""|" ") eval "$1=\"\$$2\"";;
7140 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7142 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7143 /*-$oldprefix/*|\~*-$oldprefix/*)
7144 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7145 *) eval "$1=\"\$$2\"";;
7149 : determine installation style
7150 : For now, try to deduce it from prefix unless it is already set.
7151 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7152 case "$installstyle" in
7153 '') case "$prefix" in
7154 *perl*) dflt='lib';;
7155 *) dflt='lib/perl5' ;;
7158 *) dflt="$installstyle" ;;
7160 : Probably not worth prompting for this since we prompt for all
7161 : the directories individually, and the prompt would be too long and
7165 : determine where public executables go
7170 rp='Pathname where the public executables will reside?'
7172 if $test "X$ansexp" != "X$binexp"; then
7176 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7177 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7178 : this via initialinstalllocation
7181 case "$userelocatableinc" in
7182 $define|true|[yY]*) dflt='y' ;;
7187 Would you like to build Perl so that the installation is relocatable, so that
7188 library paths in @INC are determined relative to the path of the perl binary?
7189 This is not advised for system Perl installs, or if you need to run setid
7190 scripts or scripts under taint mode.
7192 If this doesn't make any sense to you, just accept the default '$dflt'.
7194 rp='Use relocatable @INC?'
7197 y|Y) val="$define" ;;
7200 set userelocatableinc
7203 initialinstalllocation="$binexp"
7204 : Default prefix is now "up one level from where the binaries are"
7205 case "$userelocatableinc" in
7211 installprefixexp=".../.."
7215 : determine where private library files go
7216 : Usual default is /usr/local/lib/perl5/$version.
7217 : Also allow things like /opt/perl/lib/$version, since
7218 : /opt/perl/lib/perl5... would be redundant.
7219 : The default "style" setting is made in installstyle.U
7220 case "$installstyle" in
7221 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7222 *) set dflt privlib lib/$version ;;
7227 There are some auxiliary files for $package that need to be put into a
7228 private library directory that is accessible by everyone.
7233 rp='Pathname where the private library files will reside?'
7238 : set the prefixup variable, to restore leading tilda escape
7239 prefixup='case "$prefixexp" in
7241 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7244 : determine where public architecture dependent libraries go
7247 : privlib default is /usr/local/lib/$package/$version
7248 : archlib default is /usr/local/lib/$package/$version/$archname
7249 : privlib may have an optional trailing /share.
7250 tdflt=`echo $privlib | $sed 's,/share$,,'`
7251 tdflt=$tdflt/$archname
7260 $spackage contains architecture-dependent library files. If you are
7261 sharing libraries in a heterogeneous environment, you might store
7262 these files in a separate location. Otherwise, you can just include
7263 them with the rest of the public library files.
7268 rp='Where do you want to put the public architecture-dependent libraries?'
7272 if $test X"$archlib" = X"$privlib"; then
7278 : see if setuid scripts can be secure
7281 Some kernels have a bug that prevents setuid #! scripts from being
7282 secure. Some sites have disabled setuid #! scripts because of this.
7284 First let's decide if your kernel supports secure setuid #! scripts.
7285 (If setuid #! scripts would be secure but have been disabled anyway,
7286 don't say that they are secure if asked.)
7291 if $test -d /dev/fd; then
7292 echo "#!$ls" >reflect
7293 chmod +x,u+s reflect
7294 ./reflect >flect 2>&1
7295 if $contains "/dev/fd" flect >/dev/null; then
7296 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7300 If you are not sure if they are secure, I can check but I'll need a
7301 username and password different from the one you are using right now.
7302 If you don't have such a username or don't want me to test, simply
7306 rp='Other username to test security of setuid scripts with?'
7311 case "$d_suidsafe" in
7312 '') echo "I'll assume setuid scripts are *not* secure." >&4
7315 echo "Well, the $hint value is *not* secure." >&4
7317 *) echo "Well, the $hint value *is* secure." >&4
7322 $rm -f reflect flect
7323 echo "#!$ls" >reflect
7324 chmod +x,u+s reflect
7327 echo '"su" will (probably) prompt you for '"$ans's password."
7328 su $ans -c './reflect >flect'
7329 if $contains "/dev/fd" flect >/dev/null; then
7330 echo "Okay, it looks like setuid scripts are secure." >&4
7333 echo "I don't think setuid scripts are secure." >&4
7338 rp='Does your kernel have *secure* setuid scripts?'
7341 [yY]*) val="$define";;
7346 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7347 echo "(That's for file descriptors, not floppy disks.)"
7353 $rm -f reflect flect
7355 : now see if they want to do setuid emulation
7356 if $test $patchlevel -lt 11; then
7359 case "$d_suidsafe" in
7362 echo "No need to emulate SUID scripts since they are secure here." >&4
7366 Some systems have disabled setuid scripts, especially systems where
7367 setuid scripts cannot be secure. On systems where setuid scripts have
7368 been disabled, the setuid/setgid bits on scripts are currently
7369 useless. It is possible for $package to detect those bits and emulate
7370 setuid/setgid in a secure fashion. This emulation will only work if
7371 setuid scripts have been disabled in your kernel.
7375 "$define") dflt=y ;;
7378 rp="Do you want to do setuid/setgid emulation?"
7381 [yY]*) val="$define";;
7393 SUID emulation has been removed for 5.12
7394 Please re-run Configure without -Dd_dosuid
7403 : Find perl5.005 or later.
7404 echo "Looking for a previously installed perl5.005 or later... "
7406 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7407 : Check if this perl is recent and can load a simple module
7408 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7411 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7421 '') echo "None found. That's ok.";;
7422 *) echo "Using $perl5." ;;
7425 : Set the siteprefix variables
7428 After $package is installed, you may wish to install various
7429 add-on modules and utilities. Typically, these add-ons will
7430 be installed under $prefix with the rest
7431 of this package. However, you may wish to install such add-ons
7432 elsewhere under a different prefix.
7434 If you do not wish to put everything under a single prefix, that's
7435 ok. You will be prompted for the individual locations; this siteprefix
7436 is only used to suggest the defaults.
7438 The default should be fine for most people.
7442 rp='Installation prefix to use for add-on modules and utilities?'
7443 : XXX Here might be another good place for an installstyle setting.
7444 case "$siteprefix" in
7446 *) dflt=$siteprefix ;;
7449 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7451 case "$siteprefix" in
7455 *) oldsiteprefix="$prefix";;
7460 siteprefixexp="$ansexp"
7462 : determine where site specific libraries go.
7463 : Usual default is /usr/local/lib/perl5/site_perl/$version
7464 : The default "style" setting is made in installstyle.U
7465 : XXX No longer works with Prefixit stuff.
7466 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7468 '') case "$installstyle" in
7469 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7470 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7478 The installation process will create a directory for
7479 site-specific extensions and modules. Most users find it convenient
7480 to place all site-specific files in this directory rather than in the
7481 main distribution directory.
7485 rp='Pathname for the site-specific library files?'
7489 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7491 : Determine list of previous versions to include in @INC
7492 $cat > getverlist <<EOPL
7495 \$api_versionstring = "$api_versionstring";
7496 \$version = "$version";
7497 \$stem = "$sitelib_stem";
7498 \$archname = "$archname";
7500 $cat >> getverlist <<'EOPL'
7501 # The list found is store twice for each entry: the original name, and
7502 # the binary broken down version as pack "sss", so sorting is easy and
7503 # unambiguous. This will work for all versions that have a maximum of
7504 # three digit groups, separate by '.'s or '_'s. Names are extended with
7505 # ".0.0" to ensure at least three elements for the pack.
7506 # -- H.Merijn Brand (m)'06 23-10-2006
7508 # Can't have leading @ because metaconfig interprets it as a command!
7509 ;@inc_version_list=();
7510 # XXX Redo to do opendir/readdir?
7513 ;@candidates = map {
7514 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7515 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7521 ($pversion, $aversion, $vsn5005) = map {
7522 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7523 foreach $d (@candidates) {
7524 if ($d->[1] lt $pversion) {
7525 if ($d->[1] ge $aversion) {
7526 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7528 elsif ($d->[1] ge $vsn5005) {
7529 unshift(@inc_version_list, grep { -d } $d->[0]);
7533 # Skip newer version. I.e. don't look in
7534 # 5.7.0 if we're installing 5.6.1.
7538 if (@inc_version_list) {
7539 print join(' ', @inc_version_list);
7542 # Blank space to preserve value for next Configure run.
7547 case "$inc_version_list" in
7548 '') if test -x "$perl5$exe_ext"; then
7549 dflt=`$perl5 getverlist`
7554 $undef) dflt='none' ;;
7555 *) eval dflt=\"$inc_version_list\" ;;
7558 ''|' ') dflt=none ;;
7565 In order to ease the process of upgrading, this version of perl
7566 can be configured to use modules built and installed with earlier
7567 versions of perl that were installed under $prefix. Specify here
7568 the list of earlier versions that this version of perl should check.
7569 If Configure detected no earlier versions of perl installed under
7570 $prefix, then the list will be empty. Answer 'none' to tell perl
7571 to not search earlier versions.
7573 The default should almost always be sensible, so if you're not sure,
7574 just accept the default.
7577 rp='List of earlier versions to include in @INC?'
7580 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7581 *) inc_version_list="$ans" ;;
7583 case "$inc_version_list" in
7585 inc_version_list_init='0'
7586 d_inc_version_list="$undef"
7588 *) inc_version_list_init=`echo $inc_version_list |
7589 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7590 d_inc_version_list="$define"
7595 : see if malloc/malloc.h has to be included
7596 set malloc/malloc.h i_mallocmalloc
7599 : see if this is a malloc.h system
7600 : we want a real compile instead of Inhdr because some systems have a
7601 : malloc.h that just gives a compile error saying to use stdlib.h instead
7606 #$i_mallocmalloc I_MALLOCMALLOC
7607 #ifdef I_MALLOCMALLOC
7608 # include <malloc/malloc.h>
7611 int main () { return 0; }
7614 if eval $compile; then
7615 echo "<malloc.h> found." >&4
7618 echo "<malloc.h> NOT found." >&4
7625 : check for length of pointer
7629 echo "Checking to see how big your pointers are..." >&4
7638 printf("%d\n", (int)sizeof(void *));
7643 if eval $compile_ok; then
7644 ptrsize=`$run ./try`
7645 echo "Your pointers are $ptrsize bytes long."
7648 echo "(I can't seem to compile the test program. Guessing...)" >&4
7649 rp="What is the size of a pointer (in bytes)?"
7656 case "$use64bitall" in
7657 "$define"|true|[yY]*)
7661 *** You have chosen a maximally 64-bit build,
7662 *** but your pointers are only 4 bytes wide.
7663 *** Please rerun Configure without -Duse64bitall.
7668 *** Since you have quads, you could possibly try with -Duse64bitint.
7673 *** Cannot continue, aborting.
7684 : determine whether to use malloc wrapping
7686 case "$usemallocwrap" in
7687 [yY]*|true|$define) dflt='y' ;;
7688 [nN]*|false|$undef) dflt='n' ;;
7689 *) case "$usedevel" in
7690 [yY]*|true|$define) dflt='y' ;;
7695 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7697 usemallocwrap="$ans"
7700 usemallocwrap="$define" ;;
7702 usemallocwrap="$undef" ;;
7705 : determine which malloc to compile in
7707 case "$usemymalloc" in
7708 [yY]*|true|$define) dflt='y' ;;
7709 [nN]*|false|$undef) dflt='n' ;;
7710 *) case "$ptrsize" in
7714 if test "$useithreads" = "$define"; then dflt='n'; fi
7717 rp="Do you wish to attempt to use the malloc that comes with $package?"
7723 mallocsrc='malloc.c'
7724 mallocobj="malloc$_o"
7725 d_mymalloc="$define"
7728 : Remove malloc from list of libraries to use
7729 echo "Removing unneeded -lmalloc from library list" >&4
7730 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7733 echo "libs = $libs" >&4
7745 : compute the return types of malloc and free
7747 $cat >malloc.c <<END
7751 #include <sys/types.h>
7765 case "$malloctype" in
7767 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7774 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7778 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7785 echo "Your system uses $freetype free(), it would seem." >&4
7787 : determine where site specific architecture-dependent libraries go.
7788 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7789 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7790 : sitelib may have an optional trailing /share.
7792 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7793 dflt="$dflt/$archname"
7798 set sitearch sitearch none
7802 The installation process will also create a directory for
7803 architecture-dependent site-specific extensions and modules.
7807 rp='Pathname for the site-specific architecture-dependent library files?'
7811 if $test X"$sitearch" = X"$sitelib"; then
7814 d_sitearch="$define"
7817 : Set the vendorprefix variables
7820 The installation process will also create a directory for
7821 vendor-supplied add-ons. Vendors who supply perl with their system
7822 may find it convenient to place all vendor-supplied files in this
7823 directory rather than in the main distribution directory. This will
7824 ease upgrades between binary-compatible maintenance versions of perl.
7826 Of course you may also use these directories in whatever way you see
7827 fit. For example, you might use them to access modules shared over a
7828 company-wide network.
7830 The default answer should be fine for most people.
7831 This causes further questions about vendor add-ons to be skipped
7832 and no vendor-specific directories will be configured for perl.
7835 rp='Do you want to configure vendor-specific add-on directories?'
7836 case "$usevendorprefix" in
7837 define|true|[yY]*) dflt=y ;;
7838 *) : User may have set vendorprefix directly on Configure command line.
7839 case "$vendorprefix" in
7848 rp='Installation prefix to use for vendor-supplied add-ons?'
7849 case "$vendorprefix" in
7850 '') dflt="$prefix" ;;
7851 *) dflt=$vendorprefix ;;
7854 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7856 case "$vendorprefix" in
7860 *) oldvendorprefix="$prefix";;
7864 usevendorprefix="$define"
7866 vendorprefixexp="$ansexp"
7868 *) usevendorprefix="$undef"
7874 : Set the vendorlib variables
7875 case "$vendorprefix" in
7876 '') d_vendorlib="$undef"
7880 *) d_vendorlib="$define"
7881 : determine where vendor-supplied modules go.
7882 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7883 case "$vendorlib" in
7885 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7886 case "$installstyle" in
7887 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7888 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7891 *) dflt="$vendorlib"
7895 rp='Pathname for the vendor-supplied library files?'
7898 vendorlibexp="$ansexp"
7901 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7905 : Set the vendorarch variables
7906 case "$vendorprefix" in
7907 '') d_vendorarch="$undef"
7911 *) d_vendorarch="$define"
7912 : determine where vendor-supplied architecture-dependent libraries go.
7913 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7914 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7915 : vendorlib may have an optional trailing /share.
7916 case "$vendorarch" in
7917 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7918 dflt="$dflt/$archname"
7920 *) dflt="$vendorarch" ;;
7923 rp='Pathname for vendor-supplied architecture-dependent files?'
7926 vendorarchexp="$ansexp"
7929 prefixvar=vendorarch
7931 if $test X"$vendorarch" = X"$vendorlib"; then
7932 d_vendorarch="$undef"
7934 d_vendorarch="$define"
7937 : Final catch-all directories to search
7940 Lastly, you can have perl look in other directories for extensions and
7941 modules in addition to those already specified.
7942 These directories will be searched after
7946 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7947 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7949 case "$otherlibdirs" in
7950 ''|' ') dflt='none' ;;
7951 *) dflt="$otherlibdirs" ;;
7954 Enter a colon-separated set of extra paths to include in perl's @INC
7955 search path, or enter 'none' for no extra paths.
7959 rp='Colon-separated list of additional directories for perl to search?'
7962 ' '|''|none) otherlibdirs=' ' ;;
7963 *) otherlibdirs="$ans" ;;
7965 case "$otherlibdirs" in
7969 set d_perl_otherlibdirs
7972 : Cruising for prototypes
7974 echo "Checking out function prototypes..." >&4
7975 $cat >prototype.c <<EOCP
7980 int main(int argc, char *argv[]) {
7983 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7984 echo "Your C compiler appears to support function prototypes."
7987 echo "Your C compiler doesn't seem to understand function prototypes."
7994 : Check if ansi2knr is required
7995 case "$prototype" in
7997 *) ansi2knr='ansi2knr'
8002 This version of $package can only be compiled by a compiler that
8003 understands function prototypes. Unfortunately, your C compiler
8005 doesn't seem to understand them. Sorry about that.
8007 If GNU cc is available for your system, perhaps you could try that instead.
8009 Eventually, we hope to support building Perl with pre-ANSI compilers.
8010 If you would like to help in that effort, please contact <perlbug@perl.org>.
8012 Aborting Configure now.
8019 dflt_dtrace='/usr/sbin/dtrace'
8020 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8024 Perl can be built to support DTrace on platforms that support it.
8025 DTrace is a diagnosis and performance analysis tool from Sun.
8027 If this doesn't make any sense to you, just accept the default '$dflt'.
8031 case "$usedtrace" in
8037 dflt_dtrace=$usedtrace
8044 rp='Support DTrace if available?'
8047 y|Y) val="$define" ;;
8053 test "X$usedtrace" != "X$define" && break
8056 rp='Where is the dtrace executable?'
8065 if $dtrace -h -s ../perldtrace.d \
8066 -o perldtrace.tmp >/dev/null 2>&1 \
8067 && rm -f perldtrace.tmp
8070 echo "Good: your $dtrace knows about the -h flag."
8074 *** $me: Fatal Error: $dtrace doesn't support -h flag
8076 *** Your installed dtrace doesn't support the -h switch to compile a D
8077 *** program into a C header. Can't continue.
8089 *** $me: Fatal Error: $dtrace not found.
8096 echo "*** $dtrace was not found."
8102 : See if we want extra modules installed
8109 Perl can be built with extra modules or bundles of modules which
8110 will be fetched from the CPAN and installed alongside Perl.
8112 Notice that you will need access to the CPAN; either via the Internet,
8113 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8114 be asked later to configure the CPAN.pm module which will in turn do
8115 the installation of the rest of the extra modules or bundles.)
8117 Notice also that if the modules require any external software such as
8118 libraries and headers (the libz library and the zlib.h header for the
8119 Compress::Zlib module, for example) you MUST have any such software
8120 already installed, this configuration process will NOT install such
8123 If this doesn't make any sense to you, just accept the default '$dflt'.
8125 rp='Install any extra modules (y or n)?'
8131 Please list any extra modules or bundles to be installed from CPAN,
8132 with spaces between the names. The names can be in any format the
8133 'install' command of CPAN.pm will understand. (Answer 'none',
8134 without the quotes, to install no extra modules or bundles.)
8144 $rm -f ../extras.lst
8146 *) echo "(Saving the list of extras for later...)"
8147 echo "$extras" > ../extras.lst
8155 : determine where html pages for programs go
8156 set html1dir html1dir none
8160 If you wish to install html files for programs in $spackage, indicate
8161 the appropriate directory here. To skip installing html files,
8165 ''|none|$undef|' ') dflt=none ;;
8166 *) dflt=$html1dir ;;
8169 rp="Directory for the main $spackage html pages?"
8173 : Use ' ' for none so value is preserved next time through Configure
8174 $test X"$html1dir" = "X" && html1dir=' '
8176 : determine where html pages for libraries and modules go
8177 set html3dir html3dir none
8181 If you wish to install html files for modules associated with $spackage,
8182 indicate the appropriate directory here. To skip installing html files,
8185 : There is no obvious default. If they have specified html1dir, then
8186 : try to key off that, possibly changing .../html1 into .../html3.
8188 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8189 *) dflt=$html3dir ;;
8192 rp="Directory for the $spackage module html pages?"
8196 : Use ' ' for none so value is preserved next time through Configure
8197 $test X"$html3dir" = "X" && html3dir=' '
8199 : determine whether to install perl also as /usr/bin/perl
8202 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8204 Many scripts expect perl to be installed as /usr/bin/perl.
8206 If you want to, I can install the perl you are about to compile
8207 as /usr/bin/perl (in addition to $bin/perl).
8209 if test -f /usr/bin/perl; then
8212 However, please note that because you already have a /usr/bin/perl,
8213 overwriting that with a new Perl would very probably cause problems.
8214 Therefore I'm assuming you don't want to do that (unless you insist).
8217 case "$installusrbinperl" in
8218 "$define"|[yY]*) dflt='y';;
8224 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8227 case "$installusrbinperl" in
8228 "$undef"|[nN]*) dflt='n';;
8232 rp="Do you want to install perl as /usr/bin/perl?"
8235 [yY]*) val="$define";;
8241 set installusrbinperl
8244 : see if dlopen exists
8246 xxx_ccflags="$ccflags"
8248 : with g++ one needs -shared to get is-in-libc to work for dlopen
8249 case "$gccversion" in
8251 *) case "$d_cplusplus" in
8252 "$define") ccflags="$ccflags -shared" ;;
8259 ccflags="$xxx_ccflags"
8261 : see if this is a unistd.h system
8262 set unistd.h i_unistd
8265 : determine which dynamic loading, if any, to compile in
8267 dldir="ext/DynaLoader"
8280 $define) dflt='y' ;;
8282 : Does a dl_xxx.xs file exist for this operating system
8283 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8286 rp="Do you wish to use dynamic loading?"
8293 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8294 dflt="$dldir/dl_${osname}.xs"
8295 elif $test "$d_dlopen" = "$define" ; then
8296 dflt="$dldir/dl_dlopen.xs"
8301 *) dflt="$dldir/$dlsrc"
8304 echo "The following dynamic loading files are available:"
8305 : Can not go over to $dldir because getfile has path hard-coded in.
8306 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8307 rp="Source file to use for dynamic loading"
8313 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8317 Some systems may require passing special flags to $cc -c to
8318 compile modules that will be used to create a shared library.
8319 To use no flags, say "none".
8322 case "$cccdlflags" in
8323 '') case "$gccversion" in
8324 '') case "$osname" in
8326 irix*) dflt='-KPIC' ;;
8327 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8328 sunos) dflt='-pic' ;;
8332 *) case "$osname" in
8333 darwin) dflt='none' ;;
8334 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8339 *) dflt="$cccdlflags" ;;
8346 # If -Dsysroot was specified, now's the time to add it
8348 if test "X$sysroot" != X; then
8349 case "$gccversion" in
8354 dflt="$dflt --sysroot=$sysroot" ;;
8364 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8367 none) cccdlflags=' ' ;;
8368 *) cccdlflags="$ans" ;;
8373 Some systems use ld to create libraries that can be dynamically loaded,
8374 while other systems (such as those using ELF) use $cc.
8378 : Determine if this is ELF
8380 /* Test for whether ELF binaries are produced */
8392 int i = open("a.out",O_RDONLY);
8395 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8396 exit(0); /* succeed (yes, it is ELF) */
8400 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8406 '') if $test $bin_ELF = "$define"; then
8408 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8412 echo "I'll use ld to build dynamic libraries."
8420 rp="What command should be used to create dynamic libraries?"
8426 Some systems may require passing special flags to $ld to create a
8427 library that can be dynamically loaded. If your ld flags include
8428 -L/other/path options to locate libraries outside your loader's normal
8429 search path, you may need to specify those -L options here as well. To
8430 use no flags, say "none".
8433 case "$lddlflags" in
8434 '') case "$osname" in
8435 haiku) dflt='-shared' ;;
8437 case "$gccversion" in
8438 '') dflt="$dflt +vnocompatwarnings" ;;
8441 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8442 solaris) # See [perl #66604].
8443 # On Solaris 11, gcc -m64 on amd64
8444 # appears not to understand -G. gcc versions at
8445 # least as old as 3.4.3 support -shared, so just
8446 # use that with Solaris 11 and later, but keep
8447 # the old behavior for older Solaris versions.
8448 case "$gccversion" in
8450 *) case "$osvers" in
8451 2.?|2.10) dflt='-G' ;;
8452 *) dflt='-shared' ;;
8457 sunos) dflt='-assert nodefinitions' ;;
8458 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8462 *) dflt="$lddlflags" ;;
8465 : Only do this for gcc, since, for example, qcc has no concept
8467 if $test "X$sysroot" != X; then
8468 case "$gccversion" in
8470 *) dflt="$dflt --sysroot $sysroot" ;;
8474 : Try to guess additional flags to pick up local libraries.
8475 : Be careful not to append to a plain 'none'
8479 for thisflag in $ldflags; do
8484 *) dflt="$dflt $thisflag" ;;
8491 ''|' ') dflt='none' ;;
8495 *-fstack-protector-strong*)
8497 *-fstack-protector-strong*) ;; # Don't add it again
8498 *) dflt="$dflt -fstack-protector-strong" ;;
8501 *-fstack-protector*)
8503 *-fstack-protector*) ;; # Don't add it again
8504 *) dflt="$dflt -fstack-protector" ;;
8509 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8512 none) lddlflags=' ' ;;
8513 *) lddlflags="$ans" ;;
8518 Some systems may require passing special flags to $cc to indicate that
8519 the resulting executable will use dynamic linking. To use no flags,
8523 case "$ccdlflags" in
8524 '') case "$osname" in
8525 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8526 sunos) dflt='none' ;;
8530 *) dflt="$ccdlflags" ;;
8532 rp="Any special flags to pass to $cc to use dynamic linking?"
8535 none) ccdlflags=' ' ;;
8536 *) ccdlflags="$ans" ;;
8548 ld_can_script="$undef"
8549 case "$bin_ELF$usedl" in
8551 # Abuse try.h and a.out names for neat cleanup
8563 if $cc $cccdlflags $ccdlflags $ccflags \
8564 $ldflags $lddlflags -o a.out try.c \
8565 -Wl,--version-script=try.h >/dev/null 2>&1 \
8566 && $test -s a.out ; then
8567 echo "ld supports scripting" >&4
8568 ld_can_script="$define"
8570 echo "ld does not support scripting" >&4
8576 : Do we want a shared libperl?
8580 # No dynamic loading being used, so don't bother even to prompt.
8583 *) case "$useshrplib" in
8584 '') case "$osname" in
8585 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8587 also='Building a shared libperl is required for dynamic loading to work on your system.'
8601 The perl executable is normally obtained by linking perlmain.c with
8602 libperl${_a}, any static extensions (usually just DynaLoader), and
8603 any other libraries needed on this system (such as -lm, etc.). Since
8604 your system supports dynamic loading, it is probably possible to build
8605 a shared libperl.$so. If you will have more than one executable linked
8606 to libperl.$so, this will significantly reduce the size of each
8607 executable, but it may have a noticeable effect on performance. The
8608 default is probably sensible for your system.
8612 rp="Build a shared libperl.$so (y/n)"
8616 useshrplib='true' ;;
8617 *) useshrplib='false' ;;
8622 case "$useshrplib" in
8624 case "$userelocatableinc" in
8626 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8627 echo "See INSTALL for an explanation why that won't work." >&4
8633 # Figure out a good name for libperl.so. Since it gets stored in
8634 # a version-specific architecture-dependent library, the version
8635 # number isn't really that important, except for making cc/ld happy.
8637 # A name such as libperl.so.10.1
8638 majmin="libperl.$so.$patchlevel.$subversion"
8639 # A name such as libperl.so.100
8640 majonly=`echo $patchlevel $subversion |
8641 $awk '{printf "%d%02d", $1, $2}'`
8642 majonly=libperl.$so.$majonly
8643 # I'd prefer to keep the os-specific stuff here to a minimum, and
8644 # rely on figuring it out from the naming of libc.
8645 case "${osname}${osvers}" in
8646 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8649 cygwin*) # ld links now against the dll directly
8650 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8651 majonly=`echo $patchlevel $subversion |
8652 $awk '{printf "%03d%03d", $1, $2}'`
8653 majonly=cygperl5.$majonly.$so
8656 *) # Try to guess based on whether libc has major.minor.
8658 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8659 *libc.$so.[0-9]*) dflt=$majonly ;;
8660 *) dflt=libperl.$so ;;
8670 I need to select a good name for the shared libperl. If your system uses
8671 library names with major and minor numbers, then you might want something
8672 like $majmin. Alternatively, if your system uses a single version
8673 number for shared libraries, then you might want to use $majonly.
8674 Or, your system might be quite happy with a simple libperl.$so.
8676 Since the shared libperl will get installed into a version-specific
8677 architecture-dependent directory, the version number of the shared perl
8678 library probably isn't important, so the default should be o.k.
8681 rp='What name do you want to give to the shared libperl?'
8684 echo "Ok, I'll use $libperl"
8687 libperl="libperl${_a}"
8691 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8695 WARNING: Use of the shrpdir variable for the installation location of
8696 the shared $libperl is not supported. It was never documented and
8697 will not work in this version. Let me (perlbug@perl.org)
8698 know of any problems this may cause.
8704 But your current setting of $shrpdir is
8705 the default anyway, so it's harmless.
8710 Further, your current attempted setting of $shrpdir
8711 conflicts with the value of $archlibexp/CORE
8712 that installperl will use.
8719 # How will the perl executable find the installed shared $libperl?
8720 # Add $xxx to ccdlflags.
8721 # If we can't figure out a command-line option, use $shrpenv to
8722 # set env LD_RUN_PATH. The main perl makefile uses this.
8723 shrpdir=$archlibexp/CORE
8726 if "$useshrplib"; then
8729 # We'll set it in Makefile.SH...
8734 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8735 xxx="-Wl,-R$shrpdir"
8737 bsdos|linux|irix*|dec_osf|gnu*)
8738 xxx="-Wl,-rpath,$shrpdir"
8741 # Haiku doesn't like the default, either.
8744 # hpux doesn't like the default, either.
8745 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8748 # cygwin needs only ldlibpth
8751 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8757 # Only add $xxx if it isn't already in ccdlflags.
8758 case " $ccdlflags " in
8760 *) ccdlflags="$ccdlflags $xxx"
8763 Adding $xxx to the flags
8764 passed to $ld so that the perl executable will find the
8765 installed shared $libperl.
8773 # Fix ccdlflags in AIX for building external extensions.
8774 # (For building Perl itself bare -bE:perl.exp is needed,
8775 # Makefile.SH takes care of this.)
8777 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8779 # Respect a hint or command-line value.
8781 '') shrpenv="$tmp_shrpenv" ;;
8783 case "$ldlibpthname" in
8784 '') ldlibpthname=LD_LIBRARY_PATH ;;
8785 none) ldlibpthname='' ;;
8788 : determine where manual pages are on this system
8792 syspath='/usr/share/man/man1 /usr/man/man1'
8793 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8794 syspath="$syspath /usr/man/u_man/man1"
8795 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8796 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8797 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8798 sysman=`./loc . /usr/man/man1 $syspath`
8801 if $test -d "$sysman"; then
8802 echo "System manual is in $sysman." >&4
8804 echo "Could not find manual pages in source form." >&4
8807 : determine where manual pages go
8808 set man1dir man1dir none
8812 $spackage has manual pages available in source form.
8816 echo "However, you don't have nroff, so they're probably useless to you."
8818 '') man1dir="none";;
8821 echo "If you don't want the manual sources installed, answer 'none'."
8826 lookpath="$prefixexp/share/man/man1"
8827 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8828 lookpath="$lookpath $prefixexp/man/p_man/man1"
8829 lookpath="$lookpath $prefixexp/man/u_man/man1"
8830 lookpath="$lookpath $prefixexp/man/man.1"
8832 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8833 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8843 rp="Where do the main $spackage manual pages (source) go?"
8845 if $test "X$man1direxp" != "X$ansexp"; then
8856 : What suffix to use on installed man pages
8863 rp="What suffix should be used for the main $spackage man pages?"
8865 '') case "$man1dir" in
8879 *) dflt="$man1ext";;
8886 : see if we can have long filenames
8888 first=123456789abcdef
8890 if (echo hi >$first) 2>/dev/null; then
8891 if $test -f 123456789abcde; then
8892 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8895 echo 'You can have filenames longer than 14 characters.'>&4
8900 You can't have filenames longer than 14 chars.
8901 You can't even think about them!
8907 $rm -rf 123456789abcde*
8909 : determine where library module manual pages go
8910 set man3dir man3dir none
8914 $spackage has manual pages for many of the library modules.
8920 However, you don't have nroff, so they're probably useless to you.
8923 '') man3dir="none";;
8927 case "$d_flexfnam" in
8930 However, your system can't handle the long file names like File::Basename.3.
8933 '') man3dir="none";;
8937 echo "If you don't want the manual sources installed, answer 'none'."
8938 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8940 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8941 if $test -d "$privlib/man/man3"; then
8944 WARNING: Previous versions of perl installed man3 pages into
8945 $privlib/man/man3. This version will suggest a
8946 new default of $dflt.
8950 rp='Do you wish to preserve the old behavior?(y/n)'
8953 y*) dflt="$privlib/man/man3" ;;
8958 *) dflt="$man3dir" ;;
8965 rp="Where do the $package library man pages (source) go?"
8975 : What suffix to use on installed man pages
8981 rp="What suffix should be used for the $package library man pages?"
8983 '') case "$man3dir" in
8997 *) dflt="$man3ext";;
9004 : see if we have to deal with yellow pages, now NIS.
9005 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9011 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9019 rp='Are you getting the hosts file via yellow pages?'
9022 y*) hostcat='ypcat hosts';;
9023 *) hostcat='cat /etc/hosts';;
9029 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9032 '') test -f /etc/group && groupcat='cat /etc/group';;
9035 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9038 : now get the host name
9040 echo "Figuring out host name..." >&4
9041 case "$myhostname" in
9043 echo 'Maybe "hostname" will work...'
9044 if tans=`sh -c hostname 2>&1` ; then
9052 if $test "$cont"; then
9054 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9055 if tans=`cat /etc/systemid 2>&1` ; then
9057 phostname='cat /etc/systemid'
9058 echo "Whadyaknow. Xenix always was a bit strange..."
9061 elif $test -r /etc/systemid; then
9062 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9065 if $test "$cont"; then
9066 echo 'No, maybe "uuname -l" will work...'
9067 if tans=`sh -c 'uuname -l' 2>&1` ; then
9069 phostname='uuname -l'
9071 echo 'Strange. Maybe "uname -n" will work...'
9072 if tans=`sh -c 'uname -n' 2>&1` ; then
9074 phostname='uname -n'
9076 echo 'Oh well, maybe I can mine it out of whoami.h...'
9077 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9078 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9079 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9081 case "$myhostname" in
9082 '') echo "Does this machine have an identity crisis or something?"
9085 echo "Well, you said $myhostname before..."
9086 phostname='echo $myhostname';;
9092 case "$myhostname" in
9093 '') myhostname=noname ;;
9095 : you do not want to know about this
9100 if $test "$myhostname" ; then
9102 rp='Your host name appears to be "'$myhostname'".'" Right?"
9110 : bad guess or no guess
9111 while $test "X$myhostname" = X ; do
9113 rp="Please type the (one word) name of your host:"
9118 : translate upper to lower if necessary
9119 case "$myhostname" in
9121 echo "(Normalizing case in your host name)"
9122 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9126 case "$myhostname" in
9128 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9129 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9130 echo "(Trimming domain name from host name--host name is now $myhostname)"
9132 *) case "$mydomain" in
9135 test "X$hostcat" = "Xypcat hosts" &&
9136 ypmatch "$myhostname" hosts 2>/dev/null |\
9137 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9140 test "X$hostcat" != "X" &&
9141 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9142 /[ ]$myhostname[ . ]/p" > hosts
9145 if $test -f hosts; then
9146 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9147 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9148 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9149 hosts | $sort | $uniq | \
9150 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9151 case `$echo X$dflt` in
9152 X*\ *) echo "(Several hosts in the database matched hostname)"
9155 X.) echo "(You do not have fully-qualified names in the hosts database)"
9159 echo "(I cannot locate a hosts database anywhere)"
9164 tans=`./loc resolv.conf X /etc /usr/etc`
9165 if $test -f "$tans"; then
9166 echo "(Attempting domain name extraction from $tans)"
9167 dflt=.`$sed -n -e 's/ / /g' \
9168 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9171 .) dflt=.`$sed -n -e 's/ / /g' \
9172 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9180 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9181 dflt=.`sh -c domainname 2>/dev/null`
9184 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9188 case "$dflt$osname" in
9189 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9190 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9194 .) echo "(Lost all hope -- silly guess then)"
9200 *) dflt="$mydomain";;
9204 rp="What is your domain name?"
9214 : translate upper to lower if necessary
9217 echo "(Normalizing case in your domain name)"
9218 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9222 : a little sanity check here
9223 case "$phostname" in
9226 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9227 $myhostname$mydomain|$myhostname) ;;
9229 case "$phostname" in
9231 echo "(That doesn't agree with your whoami.h file, by the way.)"
9234 echo "(That doesn't agree with your $phostname command, by the way.)"
9242 : determine the e-mail address of the user who is running us
9245 I need to get your e-mail address in Internet format if possible, i.e.
9246 something like user@host.domain. Please answer accurately since I have
9247 no easy means to double check it. The default value provided below
9248 is most probably close to reality but may not be valid from outside
9249 your organization...
9253 while test "$cont"; do
9254 case "$MAILDOMAIN" in
9256 if $test -s /etc/mailname; then
9257 maildomain=`$cat /etc/mailname`
9259 maildomain="$myhostname$mydomain"
9262 *) maildomain="$MAILDOMAIN";;
9265 '') dflt="$cf_by@$maildomain";;
9266 *) dflt="$cf_email";;
9268 rp='What is your e-mail address?'
9274 rp='Address does not look like an Internet one. Use it anyway?'
9288 : Ask e-mail of administrator
9291 If you or somebody else will be maintaining perl at your site, please
9292 fill in the correct e-mail address here so that they may be contacted
9293 if necessary. Currently, the "perlbug" program included with perl
9294 will send mail to this address in addition to perlbug@perl.org. You may
9295 enter "none" for no administrator.
9298 case "$perladmin" in
9299 '') dflt="$cf_email";;
9300 *) dflt="$perladmin";;
9302 rp='Perl administrator e-mail address'
9306 : determine whether to only install version-specific parts.
9309 Do you want to install only the version-specific parts of the perl
9310 distribution? Usually you do *not* want to do this.
9312 case "$versiononly" in
9313 "$define"|[Yy]*|true) dflt='y' ;;
9316 rp="Do you want to install only the version-specific parts of perl?"
9319 [yY]*) val="$define";;
9325 case "$versiononly" in
9326 "$define") inc_version_list=''
9327 inc_version_list_init=0
9331 : figure out how to guarantee perl startup
9332 : XXX Note that this currently takes advantage of the bug that binexp ignores
9333 : the Configure -Dinstallprefix setting, which in turn means that under
9334 : relocatable @INC, initialinstalllocation is what binexp started as.
9335 case "$startperl" in
9337 case "$sharpbang" in
9341 I can use the #! construct to start perl on your system. This will
9342 make startup of perl scripts faster, but may cause problems if you
9343 want to share those scripts and perl is not in a standard place
9344 ($initialinstalllocation/perl) on all your platforms. The alternative
9345 is to force a shell by starting the script with a single ':' character.
9348 case "$versiononly" in
9349 "$define") dflt="$initialinstalllocation/perl$version";;
9350 *) dflt="$initialinstalllocation/perl";;
9352 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9355 none) startperl=": # use perl";;
9356 *) startperl="#!$ans"
9357 if $test 30 -lt `echo "$ans" | wc -c`; then
9360 WARNING: Some systems limit the #! command to 32 characters.
9361 If you experience difficulty running Perl scripts with #!, try
9362 installing Perl in a directory with a shorter pathname.
9368 *) startperl=": # use perl"
9373 echo "I'll use $startperl to start perl scripts."
9375 : figure best path for perl in scripts
9378 case "$versiononly" in
9379 "$define") perlpath="$initialinstalllocation/perl$version";;
9380 *) perlpath="$initialinstalllocation/perl";;
9382 case "$startperl" in
9387 I will use the "eval 'exec'" idiom to start Perl on your system.
9388 I can use the full path of your Perl binary for this purpose, but
9389 doing so may cause problems if you want to share those scripts and
9390 Perl is not always in a standard place ($initialinstalllocation/perl).
9393 dflt="$initialinstalllocation/perl"
9394 rp="What path shall I use in \"eval 'exec'\"?"
9401 case "$startperl" in
9403 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9406 : determine where public executable scripts go
9407 set scriptdir scriptdir
9409 case "$scriptdir" in
9412 : guess some guesses
9413 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9414 $test -d /usr/share/bin && dflt=/usr/share/bin
9415 $test -d /usr/local/script && dflt=/usr/local/script
9416 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9417 $test -d $prefixexp/script && dflt=$prefixexp/script
9421 *) dflt="$scriptdir"
9426 Some installations have a separate directory just for executable scripts so
9427 that they can mount it across multiple architectures but keep the scripts in
9428 one spot. You might, for example, have a subdirectory of /usr/share for this.
9429 Or you might just lump your scripts in with all your other executables.
9433 rp='Where do you keep publicly executable scripts?'
9435 if $test "X$ansexp" != "X$scriptdirexp"; then
9441 : A little fix up for an irregularly named variable.
9442 installscript="$installscriptdir"
9444 : determine where add-on public executables go
9446 '') dflt=$siteprefix/bin ;;
9450 rp='Pathname where the add-on public executables should be installed?'
9455 : determine where add-on html pages go
9456 : There is no standard location, so try to copy the previously-selected
9457 : directory structure for the core html pages.
9458 case "$sitehtml1dir" in
9459 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9460 *) dflt=$sitehtml1dir ;;
9463 ''|' ') dflt=none ;;
9466 rp='Pathname where the site-specific html pages should be installed?'
9468 prefixvar=sitehtml1dir
9471 : determine where add-on library html pages go
9472 : There is no standard location, so try to copy the previously-selected
9473 : directory structure for the core html pages.
9474 case "$sitehtml3dir" in
9475 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9476 *) dflt=$sitehtml3dir ;;
9479 ''|' ') dflt=none ;;
9482 rp='Pathname where the site-specific library html pages should be installed?'
9484 prefixvar=sitehtml3dir
9487 : determine where add-on manual pages go
9488 case "$siteman1dir" in
9489 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9490 *) dflt=$siteman1dir ;;
9493 ''|' ') dflt=none ;;
9496 rp='Pathname where the site-specific manual pages should be installed?'
9498 prefixvar=siteman1dir
9501 : determine where add-on library man pages go
9502 case "$siteman3dir" in
9503 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9504 *) dflt=$siteman3dir ;;
9507 ''|' ') dflt=none ;;
9510 rp='Pathname where the site-specific library manual pages should be installed?'
9512 prefixvar=siteman3dir
9515 : determine where add-on public executable scripts go
9516 case "$sitescript" in
9517 '') dflt=$siteprefix/script
9518 $test -d $dflt || dflt=$sitebin ;;
9519 *) dflt="$sitescript" ;;
9522 rp='Pathname where add-on public executable scripts should be installed?'
9524 prefixvar=sitescript
9527 : see if backtrace exists
9528 set backtrace d_backtrace
9531 : add flags if using c backtrace
9532 case "$usecbacktrace" in
9533 "") usecbacktrace=$undef ;;
9535 case "$d_backtrace" in
9537 case " $ccflags " in
9538 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9539 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9543 echo "This system does not support backtrace" >&4
9544 usecbacktrace=$undef
9550 : Check if faststdio is requested and available
9551 case "$usefaststdio" in
9552 $define|true|[yY]*|'')
9553 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9563 Perl can be built to use 'fast stdio', which means using the stdio
9564 library but also directly manipulating the stdio buffers to enable
9565 faster I/O. Using stdio is better for backward compatibility (especially
9566 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9567 interface has been preferred instead of stdio.
9569 If this doesn't make any sense to you, just accept the default '$dflt'.
9571 rp='Use the "fast stdio" if available?'
9574 y|Y) val="$define" ;;
9581 : define an is-a-typedef? function
9582 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9584 "") inclist="sys/types.h";;
9586 eval "varval=\$$var";
9590 for inc in $inclist; do
9591 echo "#include <$inc>" >>temp.c;
9593 echo "#ifdef $type" >> temp.c;
9594 echo "printf(\"We have $type\");" >> temp.c;
9595 echo "#endif" >> temp.c;
9596 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9597 if $contains $type temp.E >/dev/null 2>&1; then
9603 *) eval "$var=\$varval";;
9606 : define an is-a-typedef? function that prompts if the type is not available.
9607 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9609 "") inclist="sys/types.h";;
9611 eval "varval=\$$var";
9615 for inc in $inclist; do
9616 echo "#include <$inc>" >>temp.c;
9618 echo "#ifdef $type" >> temp.c;
9619 echo "printf(\"We have $type\");" >> temp.c;
9620 echo "#endif" >> temp.c;
9621 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9623 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9624 if $contains $type temp.E >/dev/null 2>&1; then
9625 echo "$type found." >&4;
9628 echo "$type NOT found." >&4;
9634 *) eval "$var=\$varval";;
9637 : see what type lseek is declared as in the kernel
9638 rp="What is the type used for lseek's offset on this system?"
9639 set off_t lseektype long stdio.h sys/types.h
9643 echo "Checking to see how big your file offsets are..." >&4
9645 #include <sys/types.h>
9649 printf("%d\n", (int)sizeof($lseektype));
9654 if eval $compile_ok; then
9655 lseeksize=`$run ./try`
9656 echo "Your file offsets are $lseeksize bytes long."
9660 echo "(I can't seem to compile the test program. Guessing...)"
9661 rp="What is the size of your file offsets (in bytes)?"
9667 : see what type file positions are declared as in the library
9668 rp="What is the type for file position used by fsetpos()?"
9669 set fpos_t fpostype long stdio.h sys/types.h
9672 : Check size for Fpos_t
9675 *_t) zzz="$fpostype" ;;
9678 echo "Checking the size of $zzz..." >&4
9680 #include <sys/types.h>
9687 printf("%d\n", (int)sizeof($fpostype));
9692 if eval $compile_ok; then
9696 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9699 echo "Your $zzz is $fpossize bytes long."
9705 echo "(I can't compile the test program. Guessing...)" >&4
9706 rp="What is the size of your file positions (in bytes)?"
9711 : Check for large file support
9712 # Backward compatibility (uselfs is deprecated).
9714 "$define"|true|[yY]*)
9717 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9719 uselargefiles="$define"
9723 case "$lseeksize:$fpossize" in
9726 You can have files larger than 2 gigabytes.
9729 *) case "$uselargefiles" in
9730 "$undef"|false|[nN]*) dflt='n' ;;
9735 Perl can be built to understand large files (files larger than 2 gigabytes)
9736 on some systems. To do so, Configure can be run with -Duselargefiles.
9738 If this doesn't make any sense to you, just accept the default '$dflt'.
9740 rp='Try to understand large files, if available?'
9743 y|Y) val="$define" ;;
9750 : Look for a hint-file generated 'call-back-unit'. If the
9751 : user has specified that a large files perl is to be built,
9752 : we may need to set or change some other defaults.
9753 if $test -f uselargefiles.cbu; then
9754 echo "Your platform has some specific hints regarding large file builds, using them..."
9755 . ./uselargefiles.cbu
9757 case "$uselargefiles" in
9759 if $test -f uselargefiles.cbu; then
9761 echo "Rechecking to see how big your file offsets are..." >&4
9763 #include <sys/types.h>
9767 printf("%d\n", (int)sizeof($lseektype));
9772 if eval $compile_ok; then
9773 lseeksize=`$run ./try`
9774 $echo "Your file offsets are now $lseeksize bytes long."
9778 echo "(I can't seem to compile the test program. Guessing...)"
9779 rp="What is the size of your file offsets (in bytes)?"
9784 *_t) zzz="$fpostype" ;;
9787 $echo $n "Rechecking the size of $zzz...$c" >&4
9789 #include <sys/types.h>
9796 printf("%d\n", (int)sizeof($fpostype));
9801 if eval $compile_ok; then
9806 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9809 echo " $fpossize bytes." >&4
9815 echo "(I can't compile the test program. Guessing...)" >&4
9816 rp="What is the size of your file positions (in bytes)?"
9825 : Check if we want perlio
9828 : Set the vendorbin variables
9829 case "$vendorprefix" in
9830 '') d_vendorbin="$undef"
9834 *) d_vendorbin="$define"
9835 : determine where vendor-supplied executables go.
9836 case "$vendorbin" in
9837 '') dflt=$vendorprefix/bin ;;
9838 *) dflt="$vendorbin" ;;
9841 rp='Pathname for the vendor-supplied executables directory?'
9844 vendorbinexp="$ansexp"
9850 : Set the vendorhtml1dir variables
9851 case "$vendorprefix" in
9852 '') vendorhtml1dir=''
9853 vendorhtml1direxp=''
9855 *) : determine where vendor-supplied html pages go.
9856 : There is no standard location, so try to copy the previously-selected
9857 : directory structure for the core html pages.
9858 : XXX Better default suggestions would be welcome.
9859 case "$vendorhtml1dir" in
9860 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9861 *) dflt=$vendorhtml1dir ;;
9864 ''|' ') dflt=none ;;
9867 rp='Pathname for the vendor-supplied html pages?'
9869 vendorhtml1dir="$ans"
9870 vendorhtml1direxp="$ansexp"
9873 : Use ' ' for none so value is preserved next time through Configure
9874 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9875 prefixvar=vendorhtml1dir
9878 : Set the vendorhtml3dir variables
9879 case "$vendorprefix" in
9880 '') vendorhtml3dir=''
9881 vendorhtml3direxp=''
9883 *) : determine where vendor-supplied module html pages go.
9884 : There is no standard location, so try to copy the previously-selected
9885 : directory structure for the core html pages.
9886 : XXX Better default suggestions would be welcome.
9887 case "$vendorhtml3dir" in
9888 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9889 *) dflt=$vendorhtml3dir ;;
9892 ''|' ') dflt=none ;;
9895 rp='Pathname for the vendor-supplied html pages?'
9897 vendorhtml3dir="$ans"
9898 vendorhtml3direxp="$ansexp"
9901 : Use ' ' for none so value is preserved next time through Configure
9902 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9903 prefixvar=vendorhtml3dir
9906 : Set the vendorman1dir variables
9907 case "$vendorprefix" in
9908 '') vendorman1dir=''
9911 *) : determine where vendor-supplied manual pages go.
9912 case "$vendorman1dir" in
9913 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9914 *) dflt=$vendorman1dir ;;
9917 ''|' ') dflt=none ;;
9920 rp='Pathname for the vendor-supplied manual section 1 pages?'
9922 vendorman1dir="$ans"
9923 vendorman1direxp="$ansexp"
9926 : Use ' ' for none so value is preserved next time through Configure
9927 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9928 prefixvar=vendorman1dir
9931 : Set the vendorman3dir variables
9932 case "$vendorprefix" in
9933 '') vendorman3dir=''
9936 *) : determine where vendor-supplied module manual pages go.
9937 case "$vendorman3dir" in
9938 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9939 *) dflt=$vendorman3dir ;;
9942 ''|' ') dflt=none ;;
9945 rp='Pathname for the vendor-supplied manual section 3 pages?'
9947 vendorman3dir="$ans"
9948 vendorman3direxp="$ansexp"
9951 : Use ' ' for none so value is preserved next time through Configure
9952 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9953 prefixvar=vendorman3dir
9956 : Set the vendorscript variables
9957 case "$vendorprefix" in
9958 '') d_vendorscript="$undef"
9962 *) d_vendorscript="$define"
9963 : determine where vendor-supplied scripts go.
9964 case "$vendorscript" in
9965 '') dflt=$vendorprefix/script
9966 $test -d $dflt || dflt=$vendorbin ;;
9967 *) dflt="$vendorscript" ;;
9971 The installation process will create a directory for
9972 vendor-supplied scripts.
9976 rp='Pathname for the vendor-supplied scripts directory?'
9979 vendorscriptexp="$ansexp"
9982 prefixvar=vendorscript
9985 : script used to emit important warnings
9988 if test \$# -gt 0; then
9993 echo "*** WARNING:" >&4
9994 sed -e 's/^/*** /' <msg >&4
9996 cat msg >>config.msg
9997 echo " " >>config.msg
10003 : see which of string.h or strings.h is needed
10005 strings=`./findhdr string.h`
10006 if $test "$strings" && $test -r "$strings"; then
10007 echo "Using <string.h> instead of <strings.h>." >&4
10011 strings=`./findhdr strings.h`
10012 if $test "$strings" && $test -r "$strings"; then
10013 echo "Using <strings.h> instead of <string.h>." >&4
10015 ./warn "No string header found -- You'll surely have problems."
10020 case "$i_string" in
10021 "$undef") strings=`./findhdr strings.h`;;
10022 *) strings=`./findhdr string.h`;;
10025 : see if qgcvt exists
10029 : Check what kind of doubles your system has
10030 $echo "Checking the kind of doubles you have..." >&4
10032 #$i_stdlib I_STDLIB
10033 #define DOUBLESIZE $doublesize
10035 #include <stdlib.h>
10038 static const double d = -0.1;
10040 unsigned const char* b = (unsigned const char*)(&d);
10041 #if DOUBLESIZE == 4
10042 if (b[0] == 0xCD && b[3] == 0xBD) {
10043 /* IEEE 754 32-bit little-endian */
10047 if (b[0] == 0xBD && b[3] == 0xCD) {
10048 /* IEEE 754 32-bit big-endian */
10053 #if DOUBLESIZE == 8
10054 if (b[0] == 0x9A && b[7] == 0xBF) {
10055 /* IEEE 754 64-bit little-endian */
10059 if (b[0] == 0xBF && b[7] == 0x9A) {
10060 /* IEEE 754 64-bit big-endian */
10064 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10065 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10066 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10067 * 99 99 b9 bf 9a 99 99 99 */
10071 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10072 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10073 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10074 * 99 99 99 9a bf b9 99 99 */
10079 #if DOUBLESIZE == 16
10080 if (b[0] == 0x9A && b[15] == 0xBF) {
10081 /* IEEE 754 128-bit little-endian */
10085 if (b[0] == 0xBF && b[15] == 0x9A) {
10086 /* IEEE 754 128-bit big-endian */
10091 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10092 * Whether those environments can still build Perl is debatable. */
10093 printf("-1\n"); /* unknown */
10098 if eval $compile; then
10099 doublekind=`$run ./try`
10103 case "$doublekind" in
10104 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10105 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10106 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10107 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10108 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10109 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10110 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10114 : Check print/scan long double stuff
10117 if $test X"$d_longdbl" = X"$define"; then
10119 echo "Checking how to print long doubles..." >&4
10121 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10122 $cat >try.c <<'EOCP'
10123 #include <sys/types.h>
10126 double d = 123.456;
10127 printf("%.3f\n", d);
10131 if eval $compile; then
10135 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10136 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10137 echo "We will use %f."
10143 if $test X"$sPRIfldbl" = X; then
10144 $cat >try.c <<'EOCP'
10145 #include <sys/types.h>
10148 long double d = 123.456;
10149 printf("%.3Lf\n", d);
10153 if eval $compile; then
10157 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10158 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10159 echo "We will use %Lf."
10165 if $test X"$sPRIfldbl" = X; then
10166 $cat >try.c <<'EOCP'
10167 #include <sys/types.h>
10170 long double d = 123.456;
10171 printf("%.3llf\n", d);
10175 if eval $compile; then
10179 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10180 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10181 echo "We will use %llf."
10187 if $test X"$sPRIfldbl" = X; then
10188 $cat >try.c <<'EOCP'
10189 #include <sys/types.h>
10192 long double d = 123.456;
10193 printf("%.3lf\n", d);
10197 if eval $compile; then
10201 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10202 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10203 echo "We will use %lf."
10209 if $test X"$sPRIfldbl" = X; then
10210 echo "Cannot figure out how to print long doubles." >&4
10212 sSCNfldbl=$sPRIfldbl # expect consistency
10219 case "$sPRIfldbl" in
10220 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10221 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10222 d_SCNfldbl="$undef";
10224 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10225 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10226 d_SCNfldbl="$define";
10230 : Before committing on uselongdouble, see whether that looks sane.
10231 if $test "$uselongdouble" = "$define"; then
10234 echo "Checking if your long double math functions work right..." >&4
10239 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10242 case "$osname:$gccversion" in
10243 aix:) saveccflags="$ccflags"
10244 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10247 if eval $compile_ok; then
10251 3) echo "Your long double math functions are working correctly." >&4 ;;
10252 *) echo "Your long double math functions are broken, not using long doubles." >&4
10253 uselongdouble=$undef
10257 case "$osname:$gccversion" in
10258 aix:) ccflags="$saveccflags" ;; # restore
10262 : Check how to convert floats to strings.
10264 if test "X$d_Gconvert" = X; then
10267 echo "Checking for an efficient way to convert floats to strings."
10269 case "$uselongdouble" in
10270 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10272 case "$d_longdbl" in
10273 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10275 case "$d_PRIgldbl" in
10276 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10279 #ifdef TRY_gconvert
10280 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10281 char *myname = "gconvert";
10284 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10285 char *myname = "gcvt";
10288 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10289 char *myname = "qgcvt";
10290 #define DOUBLETYPE long double
10293 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10294 #ifdef HAS_PRIgldbl
10295 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10297 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10300 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10302 char *myname = "sprintf";
10306 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10307 #define DOUBLETYPE long double
10309 #define DOUBLETYPE double
10315 #$i_stdlib I_STDLIB
10317 #include <stdlib.h>
10319 #$i_string I_STRING
10321 # include <string.h>
10323 # include <strings.h>
10326 int checkit(char *expect, char *got)
10328 if (strcmp(expect, got)) {
10329 printf("%s oddity: Expected %s, got %s\n",
10330 myname, expect, got);
10340 /* This must be 1st test on (which?) platform */
10341 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10342 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10343 checkit("0.1", buf);
10345 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10346 checkit("0.01", buf);
10348 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10349 checkit("0.001", buf);
10351 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10352 checkit("0.0001", buf);
10354 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10355 if (strlen(buf) > 5)
10356 checkit("9e-005", buf); /* for Microsoft ?? */
10358 checkit("9e-05", buf);
10360 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10363 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10364 checkit("1.1", buf);
10366 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10367 checkit("1.01", buf);
10369 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10370 checkit("1.001", buf);
10372 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10373 checkit("1.0001", buf);
10375 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10376 checkit("1.00001", buf);
10378 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10379 checkit("1.000001", buf);
10381 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10384 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10385 checkit("-1", buf);
10387 /* Some Linux gcvt's give 1.e+5 here. */
10388 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10389 checkit("100000", buf);
10391 /* Some Linux gcvt's give -1.e+5 here. */
10392 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10393 checkit("-100000", buf);
10395 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10396 checkit("123.456", buf);
10398 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10399 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10400 /* 34 should be enough to scare even long double
10401 * places into using the e notation. */
10402 if (strlen(buf) > 5)
10403 checkit("1e+034", buf); /* for Microsoft */
10405 checkit("1e+34", buf);
10407 /* For Perl, if you add additional tests here, also add them to
10408 * t/base/num.t for benefit of platforms not using Configure or
10409 * overriding d_Gconvert */
10414 : first add preferred functions to our list
10416 for xxx_convert in $gconvert_preference; do
10417 case $xxx_convert in
10418 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10419 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10422 : then add any others
10423 for xxx_convert in gconvert gcvt sprintf; do
10424 case "$xxx_list" in
10426 *) xxx_list="$xxx_list $xxx_convert" ;;
10430 case "$d_longdbl$uselongdouble" in
10432 : again, add preferred functions to our list first
10434 for xxx_convert in $gconvert_ld_preference; do
10435 case $xxx_convert in
10436 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10437 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10440 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10441 for xxx_convert in qgcvt sprintf $xxx_list; do
10442 case "$xxx_ld_list" in
10443 $xxx_convert*|*" $xxx_convert"*) ;;
10444 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10447 : if sprintf cannot do long doubles, move it to the end
10448 if test "$d_PRIgldbl" != "$define"; then
10449 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10451 : if no qgcvt, remove it
10452 if test "$d_qgcvt" != "$define"; then
10453 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10456 xxx_list="$xxx_ld_list"
10460 for xxx_convert in $xxx_list; do
10461 echo "Trying $xxx_convert..."
10462 $rm -f try try$_o core
10463 set try -DTRY_$xxx_convert
10464 if eval $compile; then
10465 echo "$xxx_convert() found." >&4
10466 if $run ./try; then
10467 echo "I'll use $xxx_convert to convert floats into a string." >&4
10470 echo "...But $xxx_convert didn't work as I expected."
10474 echo "$xxx_convert NOT found." >&4
10478 if test X$xxx_convert = X; then
10479 echo "*** WHOA THERE!!! ***" >&4
10480 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10481 xxx_convert=sprintf
10484 case "$xxx_convert" in
10485 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10486 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10487 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10488 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10489 "$define$define$define")
10490 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10491 "$define$define$undef")
10492 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10493 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10501 : see if _fwalk exists
10505 : Initialize h_fcntl
10508 : Initialize h_sysfile
10511 : access call always available on UNIX
10512 set access d_access
10515 : locate the flags for 'access()'
10516 case "$d_access" in
10519 $cat >access.c <<EOCP
10520 #include <sys/types.h>
10525 #include <sys/file.h>
10528 #include <unistd.h>
10530 #$i_stdlib I_STDLIB
10532 #include <stdlib.h>
10538 : check sys/file.h first, no particular reason here
10539 if $test `./findhdr sys/file.h` && \
10540 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10542 echo "<sys/file.h> defines the *_OK access constants." >&4
10543 elif $test `./findhdr fcntl.h` && \
10544 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10546 echo "<fcntl.h> defines the *_OK access constants." >&4
10547 elif $test `./findhdr unistd.h` && \
10548 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10549 echo "<unistd.h> defines the *_OK access constants." >&4
10551 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10557 : see if accessx exists
10558 set accessx d_accessx
10561 : see if acosh exists
10565 : see if aintl exists
10569 : see if alarm exists
10573 : see if 64bit time functions exists
10575 set ctime64 d_ctime64
10578 set localtime64 d_localtime64
10581 set gmtime64 d_gmtime64
10584 set mktime64 d_mktime64
10587 set difftime64 d_difftime64
10590 set asctime64 d_asctime64
10593 : see if POSIX threads are available
10594 set pthread.h i_pthread
10597 : define a function to check prototypes
10598 $cat > protochk <<EOSH
10601 optimize="$optimize"
10603 prototype="$prototype"
10606 usethreads=$usethreads
10607 i_pthread=$i_pthread
10608 pthread_h_first=$pthread_h_first
10611 $cat >> protochk <<'EOSH'
10616 while test $# -ge 2; do
10618 $define) echo "#include <$2>" >> try.c ;;
10619 literal) echo "$2" >> try.c ;;
10621 # Extra magic for the benefit of systems that need pthread.h
10622 # to be included early to correctly detect threadsafe functions.
10623 # Such functions must guarantee themselves, though, that the usethreads
10624 # and i_pthread have been defined, before calling protochk.
10625 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10626 echo "#include <pthread.h>" >> try.c
10631 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10632 cat >> try.c <<'EOCP'
10633 #ifdef CAN_PROTOTYPE
10634 #define _(args) args
10639 echo "$foo" >> try.c
10640 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10641 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10647 $eunicefix protochk
10649 : Define hasproto macro for Configure internal use
10650 hasproto='varname=$1; func=$2; shift; shift;
10651 while $test $# -ge 2; do
10653 $define) echo "#include <$2>";;
10657 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10658 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10659 echo "$func() prototype found.";
10662 echo "$func() prototype NOT found.";
10669 : see if sys/types.h has to be included
10670 set sys/types.h i_systypes
10673 : see if sys/select.h has to be included
10674 set sys/select.h i_sysselct
10677 : Define hasfield macro for Configure internal use
10678 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10679 while $test $# -ge 2; do
10681 $define) echo "#include <$2>";;
10685 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10687 if eval $compile; then
10696 : see if we should include time.h, sys/time.h, or both
10698 if test "X$timeincl" = X; then
10699 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10700 $echo $n "I'm now running the test program...$c"
10702 #include <sys/types.h>
10707 #ifdef SYSTIMEKERNEL
10710 #include <sys/time.h>
10713 #include <sys/select.h>
10715 #$i_stdlib I_STDLIB
10717 #include <stdlib.h>
10723 struct timeval bar;
10726 struct timezone tzp;
10728 if (foo.tm_sec == foo.tm_sec)
10731 if (bar.tv_sec == bar.tv_sec)
10738 for s_timezone in '-DS_TIMEZONE' ''; do
10740 for s_timeval in '-DS_TIMEVAL' ''; do
10741 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10742 for i_time in '' '-DI_TIME'; do
10743 for i_systime in '-DI_SYSTIME' ''; do
10746 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10747 if eval $compile; then
10748 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10752 $echo $n "Succeeded with $flags$c"
10764 *SYSTIMEKERNEL*) i_systimek="$define"
10765 timeincl=`./findhdr sys/time.h`
10766 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10767 *) i_systimek="$undef";;
10770 *I_TIME*) i_time="$define"
10771 timeincl=`./findhdr time.h`" $timeincl"
10772 echo "We'll include <time.h>." >&4;;
10773 *) i_time="$undef";;
10776 *I_SYSTIME*) i_systime="$define"
10777 timeincl=`./findhdr sys/time.h`" $timeincl"
10778 echo "We'll include <sys/time.h>." >&4;;
10779 *) i_systime="$undef";;
10783 : see if struct tm knows about tm_zone
10784 case "$i_systime$i_time" in
10787 echo "Checking to see if your struct tm has tm_zone field..." >&4
10788 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10796 case "$d_tm_tm_zone" in
10797 "$define") echo "Yes, it does." ;;
10798 *) echo "No, it doesn't." ;;
10800 : see if struct tm knows about tm_gmtoff
10801 case "$i_systime$i_time" in
10804 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10805 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10813 case "$d_tm_tm_gmtoff" in
10814 "$define") echo "Yes, it does." ;;
10815 *) echo "No, it doesn't." ;;
10818 : see if asctime_r exists
10819 set asctime_r d_asctime_r
10821 case "$d_asctime_r" in
10823 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10824 case "$d_asctime_r_proto:$usethreads" in
10825 ":define") d_asctime_r_proto=define
10826 set d_asctime_r_proto asctime_r $hdrs
10830 case "$d_asctime_r_proto" in
10832 case "$asctime_r_proto" in
10833 ''|0) try='char* asctime_r(const struct tm*, char*);'
10834 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10836 case "$asctime_r_proto" in
10837 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10838 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10840 case "$asctime_r_proto" in
10841 ''|0) try='int asctime_r(const struct tm*, char*);'
10842 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10844 case "$asctime_r_proto" in
10845 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10846 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10848 case "$asctime_r_proto" in
10849 ''|0) d_asctime_r=undef
10851 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10852 * ) case "$asctime_r_proto" in
10853 REENTRANT_PROTO*) ;;
10854 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10856 echo "Prototype: $try" ;;
10859 *) case "$usethreads" in
10860 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10867 *) asctime_r_proto=0
10871 : see if asinh exists
10875 : see if atanh exists
10879 : see if atolf exists
10883 : see if atoll exists
10887 : Look for GCC-style attribute format
10888 case "$d_attribute_format" in
10891 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10892 $cat >attrib.c <<'EOCP'
10894 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10896 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10897 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10898 echo "Your C compiler doesn't support __attribute__((format))."
10901 echo "Your C compiler supports __attribute__((format))."
10905 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10909 *) val="$d_attribute_format" ;;
10911 set d_attribute_format
10915 : Look for GCC-style attribute format with null format allowed
10916 case "$d_printf_format_null" in
10917 '') case "$d_attribute_format" in
10920 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10921 $cat >attrib.c <<EOCP
10923 #$i_stdlib I_STDLIB
10925 #include <stdlib.h>
10927 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10928 int null_printf (char* pat,...) { return (int)pat; }
10929 int main () { exit(null_printf(NULL)); }
10931 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10932 : run the executable in case it produces a run-time warning
10933 if $run ./attrib >>attrib.out 2>&1; then
10934 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10935 echo "Your C compiler doesn't allow __printf__ format to be null."
10938 echo "Your C compiler allows __printf__ format to be null."
10942 echo "Your C compiler executable failed with __printf__ format null."
10946 echo "Your C compiler fails with __printf__ format null."
10953 *) val="$d_printf_format_null" ;;
10955 set d_printf_format_null
10959 : Look for GCC-style attribute malloc
10960 case "$d_attribute_malloc" in
10963 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10964 $cat >attrib.c <<'EOCP'
10966 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10968 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10969 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10970 echo "Your C compiler doesn't support __attribute__((malloc))."
10973 echo "Your C compiler supports __attribute__((malloc))."
10977 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10981 *) val="$d_attribute_malloc" ;;
10983 set d_attribute_malloc
10987 : Look for GCC-style attribute nonnull
10988 case "$d_attribute_nonnull" in
10991 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10992 $cat >attrib.c <<'EOCP'
10994 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10996 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10997 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10998 echo "Your C compiler doesn't support __attribute__((nonnull))."
11001 echo "Your C compiler supports __attribute__((nonnull))."
11005 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11009 *) val="$d_attribute_nonnull" ;;
11011 set d_attribute_nonnull
11015 : Look for GCC-style attribute noreturn
11016 case "$d_attribute_noreturn" in
11019 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11020 $cat >attrib.c <<'EOCP'
11022 void fall_over_dead( void ) __attribute__((noreturn));
11024 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11025 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11026 echo "Your C compiler doesn't support __attribute__((noreturn))."
11029 echo "Your C compiler supports __attribute__((noreturn))."
11033 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11037 *) val="$d_attribute_noreturn" ;;
11039 set d_attribute_noreturn
11043 : Look for GCC-style attribute pure
11044 case "$d_attribute_pure" in
11047 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11048 $cat >attrib.c <<'EOCP'
11050 int square( int n ) __attribute__((pure));
11052 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11053 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11054 echo "Your C compiler doesn't support __attribute__((pure))."
11057 echo "Your C compiler supports __attribute__((pure))."
11061 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11065 *) val="$d_attribute_pure" ;;
11067 set d_attribute_pure
11071 : Look for GCC-style attribute unused
11072 case "$d_attribute_unused" in
11075 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11076 $cat >attrib.c <<'EOCP'
11078 int do_something( int dummy __attribute__((unused)), int n );
11080 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11081 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11082 echo "Your C compiler doesn't support __attribute__((unused))."
11085 echo "Your C compiler supports __attribute__((unused))."
11089 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11093 *) val="$d_attribute_unused" ;;
11095 set d_attribute_unused
11099 : Look for GCC-style attribute deprecated
11100 case "$d_attribute_deprecated" in
11103 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11104 $cat >attrib.c <<'EOCP'
11106 int I_am_deprecated(void) __attribute__((deprecated));
11108 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11109 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11110 echo "Your C compiler doesn't support __attribute__((deprecated))."
11113 echo "Your C compiler supports __attribute__((deprecated))."
11117 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11121 *) val="$d_attribute_deprecated" ;;
11123 set d_attribute_deprecated
11127 : Look for GCC-style attribute warn_unused_result
11128 case "$d_attribute_warn_unused_result" in
11131 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11132 $cat >attrib.c <<'EOCP'
11134 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11136 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11137 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11138 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11141 echo "Your C compiler supports __attribute__((warn_unused_result))."
11145 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11149 *) val="$d_attribute_warn_unused_result" ;;
11151 set d_attribute_warn_unused_result
11155 : see if bcmp exists
11159 : see if bcopy exists
11163 : see if getpgrp exists
11164 set getpgrp d_getpgrp
11167 case "$d_getpgrp" in
11170 echo "Checking to see which flavor of getpgrp is in use..."
11172 #$i_unistd I_UNISTD
11173 #include <sys/types.h>
11175 # include <unistd.h>
11177 #$i_stdlib I_STDLIB
11179 #include <stdlib.h>
11183 if (getuid() == 0) {
11184 printf("(I see you are running Configure as super-user...)\n");
11187 #ifdef TRY_BSD_PGRP
11188 if (getpgrp(1) == 0)
11197 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11198 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11200 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11201 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11204 echo "I can't seem to compile and run the test program."
11206 xxx="a USG one, i.e. you use getpgrp()."
11208 # SVR4 systems can appear rather BSD-ish.
11209 case "$i_unistd" in
11211 xxx="a BSD one, i.e. you use getpgrp(pid)."
11215 xxx="probably a USG one, i.e. you use getpgrp()."
11220 echo "Assuming your getpgrp is $xxx" >&4
11229 : see if setpgrp exists
11230 set setpgrp d_setpgrp
11233 case "$d_setpgrp" in
11236 echo "Checking to see which flavor of setpgrp is in use..."
11238 #$i_unistd I_UNISTD
11239 #include <sys/types.h>
11241 # include <unistd.h>
11243 #$i_stdlib I_STDLIB
11245 #include <stdlib.h>
11249 if (getuid() == 0) {
11250 printf("(I see you are running Configure as super-user...)\n");
11253 #ifdef TRY_BSD_PGRP
11254 if (-1 == setpgrp(1, 1))
11257 if (setpgrp() != -1)
11263 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11264 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11266 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11267 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11270 echo "(I can't seem to compile and run the test program.)"
11272 xxx="a USG one, i.e. you use setpgrp()."
11274 # SVR4 systems can appear rather BSD-ish.
11275 case "$i_unistd" in
11277 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11281 xxx="probably a USG one, i.e. you use setpgrp()."
11286 echo "Assuming your setpgrp is $xxx" >&4
11295 : Look for GCC-style __builtin_choose_expr
11296 case "$d_builtin_choose_expr" in
11299 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11300 $cat >try.c <<'EOCP'
11301 #include <assert.h>
11302 #include <stdlib.h>
11305 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11308 assert( SYRINX(1) == 2112 );
11309 assert( SYRINX(1) != 5150 );
11310 assert( SYRINX(0) == 5150 );
11311 assert( SYRINX(0) != 2112 );
11312 puts( "All good!" );
11318 if eval $compile && $run ./try; then
11319 echo "Your C compiler supports __builtin_choose_expr."
11322 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11326 *) val="$d_builtin_choose_expr" ;;
11329 set d_builtin_choose_expr
11333 : Look for GCC-style __builtin_expect
11334 case "$d_builtin_expect" in
11337 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11338 $cat >try.c <<'EOCP'
11341 if ( __builtin_expect(n, 0) ) n = 1;
11342 /* Remember shell exit code truth is 0, C truth is non-zero */
11347 if eval $compile && $run ./try; then
11348 echo "Your C compiler supports __builtin_expect."
11351 echo "Your C compiler doesn't seem to understand __builtin_expect."
11355 *) val="$d_builtin_expect" ;;
11358 set d_builtin_expect
11362 : see if bzero exists
11366 : see if stdarg is available
11368 if $test `./findhdr stdarg.h`; then
11369 echo "<stdarg.h> found." >&4
11372 echo "<stdarg.h> NOT found." >&4
11376 : see if varargs is available
11378 if $test `./findhdr varargs.h`; then
11379 echo "<varargs.h> found." >&4
11381 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11384 : set up the varargs testing programs
11385 $cat > varargs.c <<EOP
11387 #include <stdarg.h>
11390 #include <varargs.h>
11394 int f(char *p, ...)
11408 p = va_arg(ap, char *);
11414 $cat > varargs <<EOP
11416 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11425 : now check which varargs header should be included
11431 if `./varargs I_STDARG`; then
11433 elif `./varargs I_VARARGS`; then
11438 if `./varargs I_VARARGS`; then
11446 echo "*** WHOA THERE!!! ***" >&4
11447 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11448 case "$knowitall" in
11450 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11454 echo "I could not find the definition for va_dcl... You have problems..." >&4
11455 val="$undef"; set i_stdarg; eval $setvar
11456 val="$undef"; set i_varargs; eval $setvar
11461 case "$i_varhdr" in
11463 val="$define"; set i_stdarg; eval $setvar
11464 val="$undef"; set i_varargs; eval $setvar
11467 val="$undef"; set i_stdarg; eval $setvar
11468 val="$define"; set i_varargs; eval $setvar
11471 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11475 : see if the Compiler supports C99 variadic macros
11476 case "$i_stdarg$i_stdlib" in
11478 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11481 #include <stdarg.h>
11483 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11487 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11493 if eval $compile && $run ./try 2>&1 >/dev/null; then
11494 case "`$run ./try`" in
11496 echo "You have C99 variadic macros." >&4
11497 d_c99_variadic_macros="$define"
11500 echo "You don't have functional C99 variadic macros." >&4
11501 d_c99_variadic_macros="$undef"
11505 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11506 d_c99_variadic_macros="$undef"
11511 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11512 d_c99_variadic_macros="$undef"
11516 : see if signal is declared as pointer to function returning int or void
11518 xxx=`./findhdr signal.h`
11519 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11520 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11521 echo "You have int (*signal())() instead of void." >&4
11523 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11524 echo "You have void (*signal())()." >&4
11526 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11527 echo "You have int (*signal())() instead of void." >&4
11529 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11530 echo "You have void (*signal())()." >&4
11533 case "$d_voidsig" in
11535 echo "I can't determine whether signal handler returns void or int..." >&4
11537 rp="What type does your signal handler return?"
11540 v*) val="$define";;
11544 echo "As you already told me, signal handler returns void." >&4
11547 *) echo "As you already told me, signal handler returns int." >&4
11554 case "$d_voidsig" in
11555 "$define") signal_t="void";;
11556 *) signal_t="int";;
11560 : check for ability to cast large floats to 32-bit ints.
11562 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11563 if $test "$intsize" -ge 4; then
11570 #$i_stdlib I_STDLIB
11572 #include <stdlib.h>
11574 #include <sys/types.h>
11575 #include <signal.h>
11576 $signal_t blech(int s) { exit(3); }
11583 signal(SIGFPE, blech);
11585 /* Don't let compiler optimize the test away. Store the number
11586 in a writable string for gcc to pass to sscanf under HP-UX.
11588 sprintf(str, "2147483647");
11589 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11593 /* x86 processors will probably give 0x8000 0000, which is a
11594 sign change. We don't want that. We want to mimic SPARC
11595 behavior here, which is to preserve the sign and give
11598 if (i32 != ($xxx) f)
11604 if eval $compile_ok; then
11608 echo "(I can't seem to compile the test program--assuming it can't)"
11613 echo "Yup, it can."
11616 echo "Nope, it can't."
11623 : check for ability to cast negative floats to unsigned
11625 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11628 #$i_stdlib I_STDLIB
11630 #include <stdlib.h>
11632 #include <sys/types.h>
11633 #include <signal.h>
11634 $signal_t blech(int s) { exit(7); }
11635 $signal_t blech_in_list(int s) { exit(4); }
11636 unsigned long dummy_long(unsigned long p) { return p; }
11637 unsigned int dummy_int(unsigned int p) { return p; }
11638 unsigned short dummy_short(unsigned short p) { return p; }
11642 unsigned long along;
11644 unsigned short ashort;
11648 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11649 a direct f = -123. assignment. gcc-2.8.0 reportedly
11650 optimized the whole file away
11652 /* Store the number in a writable string for gcc to pass to
11653 sscanf under HP-UX.
11655 sprintf(str, "-123");
11656 sscanf(str, "%lf", &f); /* f = -123.; */
11658 signal(SIGFPE, blech);
11659 along = (unsigned long)f;
11660 aint = (unsigned int)f;
11661 ashort = (unsigned short)f;
11662 if (along != (unsigned long)-123)
11664 if (aint != (unsigned int)-123)
11666 if (ashort != (unsigned short)-123)
11668 sprintf(str, "1073741824.");
11669 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11672 along = (unsigned long)f;
11673 if (along != 0x80000000)
11677 along = (unsigned long)f;
11678 if (along != 0x7fffffff)
11682 along = (unsigned long)f;
11683 if (along != 0x80000001)
11687 signal(SIGFPE, blech_in_list);
11688 sprintf(str, "123.");
11689 sscanf(str, "%lf", &f); /* f = 123.; */
11690 along = dummy_long((unsigned long)f);
11691 aint = dummy_int((unsigned int)f);
11692 ashort = dummy_short((unsigned short)f);
11693 if (along != (unsigned long)123)
11695 if (aint != (unsigned int)123)
11697 if (ashort != (unsigned short)123)
11704 if eval $compile_ok; then
11708 echo "(I can't seem to compile the test program--assuming it can't)"
11711 case "$castflags" in
11713 echo "Yup, it can."
11716 echo "Nope, it can't."
11723 : see if cbrt exists
11727 : see if vprintf exists
11729 if set vprintf val -f d_vprintf; eval $csym; $val; then
11730 echo 'vprintf() found.' >&4
11733 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11734 #$i_varargs I_VARARGS
11736 #$i_stdlib I_STDLIB
11737 #$i_unistd I_UNISTD
11740 # include <stdarg.h>
11741 #else /* I_VARARGS */
11742 # include <varargs.h>
11746 # include <unistd.h>
11750 # include <stdlib.h>
11753 #include <stdio.h> /* vsprintf prototype */
11756 void xxx(int n, ...)
11761 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11763 int main() { xxx(1, "foo"); }
11765 #else /* I_VARARGS */
11773 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11775 int main() { xxx("foo"); }
11781 if eval $compile_ok; then
11782 if $run ./try; then
11783 echo "Your vsprintf() returns (int)." >&4
11786 echo "Your vsprintf() returns (char*)." >&4
11790 echo 'I am unable to compile the vsprintf() test program.' >&4
11791 # We shouldn't get here. If we do, assume the standard signature,
11792 # not the old BSD one.
11793 echo 'Guessing that vsprintf() returns (int).' >&4
11797 echo 'vprintf() NOT found.' >&4
11808 : see if chown exists
11812 : see if chroot exists
11813 set chroot d_chroot
11816 : see if chsize exists
11817 set chsize d_chsize
11820 : see if class exists
11824 : see if clearenv exists
11825 set clearenv d_clearenv
11828 : Define hasstruct macro for Configure internal use
11829 hasstruct='varname=$1; struct=$2; shift; shift;
11830 while $test $# -ge 2; do
11832 $define) echo "#include <$2>";;
11836 echo "int main () { struct $struct foo; }" >> try.c;
11838 if eval $compile; then
11847 : see whether socket exists
11851 $echo $n "Hmm... $c" >&4
11852 if set socket val -f d_socket; eval $csym; $val; then
11853 echo "Looks like you have Berkeley networking support." >&4
11855 if set setsockopt val -f; eval $csym; $val; then
11858 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11859 d_oldsock="$define"
11862 if $contains socklib libc.list >/dev/null 2>&1; then
11863 echo "Looks like you have Berkeley networking support." >&4
11865 : we will have to assume that it supports the 4.2 BSD interface
11868 echo "You don't have Berkeley networking in libc$_a..." >&4
11869 if test "X$d_socket" = "X$define"; then
11870 echo "...but you seem to believe that you have sockets." >&4
11872 for net in net socket
11874 if test -f $sysroot/usr/lib/lib$net$_a; then
11875 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11876 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11877 if $contains socket libc.list >/dev/null 2>&1; then
11882 echo "...but the Wollongong group seems to have hacked it in." >&4
11883 sockethdr="-I$sysroot/usr/netinclude"
11886 echo "Found Berkeley sockets interface in lib$net." >&4
11887 if $contains setsockopt libc.list >/dev/null 2>&1; then
11890 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11891 d_oldsock="$define"
11897 if test "X$d_socket" != "X$define"; then
11898 echo "or anywhere else I see." >&4
11906 : see if socketpair exists
11907 set socketpair d_sockpair
11912 echo "Checking the availability sa_len in the sock struct ..." >&4
11914 #include <sys/types.h>
11915 #include <sys/socket.h>
11917 struct sockaddr sa;
11918 return (sa.sa_len);
11922 set try; if eval $compile; then
11925 set d_sockaddr_sa_len; eval $setvar
11929 echo "Checking the availability struct sockaddr_in6 ..." >&4
11931 #include <sys/types.h>
11932 #include <sys/socket.h>
11933 #include <netinet/in.h>
11935 struct sockaddr_in6 sin6;
11936 return (sin6.sin6_family);
11940 set try; if eval $compile; then
11943 set d_sockaddr_in6; eval $setvar
11947 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11949 #include <sys/types.h>
11950 #include <sys/socket.h>
11951 #include <netinet/in.h>
11953 struct sockaddr_in6 sin6;
11954 return (sin6.sin6_scope_id);
11958 set try; if eval $compile; then
11961 set d_sin6_scope_id; eval $setvar
11965 echo "Checking the availability struct ip_mreq ..." >&4
11967 #include <sys/types.h>
11968 #include <sys/socket.h>
11969 #include <netinet/in.h>
11971 struct ip_mreq mreq;
11972 return (mreq.imr_multiaddr.s_addr);
11976 set try; if eval $compile; then
11979 set d_ip_mreq; eval $setvar
11983 echo "Checking the availability struct ip_mreq_source ..." >&4
11985 #include <sys/types.h>
11986 #include <sys/socket.h>
11987 #include <netinet/in.h>
11989 struct ip_mreq_source mreq;
11990 return (mreq.imr_multiaddr.s_addr);
11994 set try; if eval $compile; then
11997 set d_ip_mreq_source; eval $setvar
12001 echo "Checking the availability struct ipv6_mreq ..." >&4
12003 #include <sys/types.h>
12004 #include <sys/socket.h>
12005 #include <netinet/in.h>
12007 struct ipv6_mreq mreq;
12008 return (mreq.ipv6mr_interface);
12012 set try; if eval $compile; then
12015 set d_ipv6_mreq; eval $setvar
12019 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12021 #include <sys/types.h>
12022 #include <sys/socket.h>
12023 #include <netinet/in.h>
12025 struct ipv6_mreq_source mreq;
12026 return (mreq.imr_multiaddr.s_addr);
12030 set try; if eval $compile; then
12033 set d_ipv6_mreq_source; eval $setvar
12037 echo "Checking the availability of certain socket constants..." >&4
12038 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12039 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12041 #include <sys/types.h>
12042 #include <sys/socket.h>
12048 set try; if eval $compile; then
12051 set d_${enum}; eval $setvar
12055 : see if this is a sys/uio.h system
12056 set sys/uio.h i_sysuio
12059 : Check for cmsghdr support
12061 echo "Checking to see if your system supports struct cmsghdr..." >&4
12062 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12064 case "$d_cmsghdr_s" in
12065 "$define") echo "Yes, it does." ;;
12066 *) echo "No, it doesn't." ;;
12070 : check for const keyword
12072 echo 'Checking to see if your C compiler knows about "const"...' >&4
12073 $cat >const.c <<'EOCP'
12074 typedef struct spug { int drokk; } spug;
12078 const spug y = { 0 };
12081 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12083 echo "Yup, it does."
12086 echo "Nope, it doesn't."
12091 : see if copysign exists
12092 set copysign d_copysign
12095 : see if copysignl exists
12096 set copysignl d_copysignl
12099 : see if crypt exists
12104 $define) cryptlib='' ;;
12105 *) if set crypt val -f d_crypt; eval $csym; $val; then
12106 echo 'crypt() found.' >&4
12110 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12111 if $test -z "$cryptlib"; then
12112 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12116 if $test -z "$cryptlib"; then
12117 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12121 if $test -z "$cryptlib"; then
12122 cryptlib=`./loc libcrypt$_a "" $libpth`
12126 if $test -z "$cryptlib"; then
12127 echo 'crypt() NOT found.' >&4
12138 : see if this is a crypt.h system
12139 set crypt.h i_crypt
12142 : see if crypt_r exists
12143 set crypt_r d_crypt_r
12145 case "$d_crypt_r" in
12147 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12148 case "$d_crypt_r_proto:$usethreads" in
12149 ":define") d_crypt_r_proto=define
12150 set d_crypt_r_proto crypt_r $hdrs
12154 case "$d_crypt_r_proto" in
12156 case "$crypt_r_proto" in
12157 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12158 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12160 case "$crypt_r_proto" in
12161 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12162 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12164 case "$crypt_r_proto" in
12165 ''|0) d_crypt_r=undef
12167 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12168 * ) case "$crypt_r_proto" in
12169 REENTRANT_PROTO*) ;;
12170 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12172 echo "Prototype: $try" ;;
12175 *) case "$usethreads" in
12176 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12187 : get csh whereabouts
12189 'csh') val="$undef" ;;
12190 *) val="$define" ;;
12194 : Respect a hint or command line value for full_csh.
12195 case "$full_csh" in
12196 '') full_csh=$csh ;;
12199 : see if ctermid exists
12200 set ctermid d_ctermid
12203 : see if ctermid_r exists
12204 set ctermid_r d_ctermid_r
12206 case "$d_ctermid_r" in
12208 hdrs="$i_systypes sys/types.h define stdio.h "
12209 case "$d_ctermid_r_proto:$usethreads" in
12210 ":define") d_ctermid_r_proto=define
12211 set d_ctermid_r_proto ctermid_r $hdrs
12215 case "$d_ctermid_r_proto" in
12217 case "$ctermid_r_proto" in
12218 ''|0) try='char* ctermid_r(char*);'
12219 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12221 case "$ctermid_r_proto" in
12222 ''|0) d_ctermid_r=undef
12224 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12225 * ) case "$ctermid_r_proto" in
12226 REENTRANT_PROTO*) ;;
12227 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12229 echo "Prototype: $try" ;;
12232 *) case "$usethreads" in
12233 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12240 *) ctermid_r_proto=0
12244 : see if ctime_r exists
12245 set ctime_r d_ctime_r
12247 case "$d_ctime_r" in
12249 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12250 case "$d_ctime_r_proto:$usethreads" in
12251 ":define") d_ctime_r_proto=define
12252 set d_ctime_r_proto ctime_r $hdrs
12256 case "$d_ctime_r_proto" in
12258 case "$ctime_r_proto" in
12259 ''|0) try='char* ctime_r(const time_t*, char*);'
12260 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12262 case "$ctime_r_proto" in
12263 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12264 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12266 case "$ctime_r_proto" in
12267 ''|0) try='int ctime_r(const time_t*, char*);'
12268 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12270 case "$ctime_r_proto" in
12271 ''|0) try='int ctime_r(const time_t*, char*, int);'
12272 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12274 case "$ctime_r_proto" in
12275 ''|0) d_ctime_r=undef
12277 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12278 * ) case "$ctime_r_proto" in
12279 REENTRANT_PROTO*) ;;
12280 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12282 echo "Prototype: $try" ;;
12285 *) case "$usethreads" in
12286 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12297 : see if cuserid exists
12298 set cuserid d_cuserid
12301 : see if this is a limits.h system
12302 set limits.h i_limits
12305 : See if number of significant digits in a double precision number is known
12307 $cat >dbl_dig.c <<EOM
12308 #$i_limits I_LIMITS
12311 #include <limits.h>
12317 printf("Contains DBL_DIG");
12320 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12321 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12322 echo "DBL_DIG found." >&4
12325 echo "DBL_DIG NOT found." >&4
12332 : see if dbm.h is available
12333 : see if dbmclose exists
12334 set dbmclose d_dbmclose
12337 case "$d_dbmclose" in
12347 *) set rpcsvc/dbm.h i_rpcsvcdbm
12352 *) echo "We won't be including <dbm.h>"
12362 : see if prototype for dbminit is available
12364 set d_dbminitproto dbminit $i_dbm dbm.h
12367 : see if difftime exists
12368 set difftime d_difftime
12371 : see if this is a dirent system
12373 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12375 echo "<dirent.h> found." >&4
12378 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12379 echo "<sys/dir.h> found." >&4
12382 xinc=`./findhdr sys/ndir.h`
12384 echo "<dirent.h> NOT found." >&4
12389 : Look for type of directory structure.
12391 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12393 case "$direntrytype" in
12395 case "$i_dirent" in
12396 $define) guess1='struct dirent' ;;
12397 *) guess1='struct direct' ;;
12400 *) guess1="$direntrytype"
12405 'struct dirent') guess2='struct direct' ;;
12406 *) guess2='struct dirent' ;;
12409 if $contains "$guess1" try.c >/dev/null 2>&1; then
12410 direntrytype="$guess1"
12411 echo "Your directory entries are $direntrytype." >&4
12412 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12413 direntrytype="$guess2"
12414 echo "Your directory entries seem to be $direntrytype." >&4
12416 echo "I don't recognize your system's directory entries." >&4
12417 rp="What type is used for directory entries on this system?"
12420 direntrytype="$ans"
12424 : see if the directory entry stores field length
12426 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12427 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12428 echo "Good, your directory entry keeps length information in d_namlen." >&4
12431 echo "Your directory entry does not know about the d_namlen field." >&4
12438 : Look for DIR.dd_fd
12439 case "$i_dirent" in
12441 echo "Checking to see if DIR has a dd_fd member variable" >&4
12443 #$i_stdlib I_STDLIB
12445 #include <stdlib.h>
12447 #include <dirent.h>
12457 if eval $compile; then
12458 echo "Yes, it does."
12461 echo "No, it does not."
12466 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12474 : see if this is an sysdir system
12475 set sys/dir.h i_sysdir
12478 : see if this is an sysndir system
12479 set sys/ndir.h i_sysndir
12484 $cat >dirfd.c <<EOM
12486 #$i_stdlib I_STDLIB
12488 #include <stdlib.h>
12490 #$i_dirent I_DIRENT /**/
12491 #$i_sysdir I_SYS_DIR /**/
12492 #$i_sysndir I_SYS_NDIR /**/
12493 #$i_systypes I_SYS_TYPES /**/
12494 #if defined(I_SYS_TYPES)
12495 #include <sys/types.h>
12497 #if defined(I_DIRENT)
12498 #include <dirent.h>
12501 #include <sys/ndir.h>
12505 #include <ndir.h> /* may be wrong in the future */
12507 #include <sys/dir.h>
12513 DIR *dirp = opendir(".");
12514 if (dirfd(dirp) >= 0)
12522 if eval $compile; then
12526 $define) echo "dirfd() found." >&4 ;;
12527 *) echo "dirfd() NOT found." >&4 ;;
12533 : see if dladdr exists
12534 set dladdr d_dladdr
12537 : see if dlerror exists
12540 set dlerror d_dlerror
12544 : see if dlfcn is available
12545 set dlfcn.h i_dlfcn
12548 : Check what extension to use for shared libs
12553 On a few systems, the dynamically loaded modules that perl generates and uses
12554 will need a different extension than shared libs. The default will probably
12560 *) dflt="$dlext" ;;
12562 rp='What is the extension of dynamically loaded modules'
12571 : Check if dlsym need a leading underscore
12577 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12578 $cat >dyna.c <<'EOM'
12585 #$i_stdlib I_STDLIB
12587 #include <stdlib.h>
12591 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12593 #include <sys/types.h>
12598 extern int fred() ;
12607 int mode = RTLD_LAZY ;
12609 handle = dlopen("./dyna.$dlext", mode) ;
12610 if (handle == NULL) {
12615 symbol = dlsym(handle, "fred") ;
12616 if (symbol == NULL) {
12617 /* try putting a leading underscore */
12618 symbol = dlsym(handle, "_fred") ;
12619 if (symbol == NULL) {
12632 : Call the object file tmp-dyna.o in case dlext=o.
12633 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12634 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12635 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12636 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12639 1) echo "Test program failed using dlopen." >&4
12640 echo "Perhaps you should not use dynamic loading." >&4;;
12641 2) echo "Test program failed using dlsym." >&4
12642 echo "Perhaps you should not use dynamic loading." >&4;;
12643 3) echo "dlsym needs a leading underscore" >&4
12645 4) echo "dlsym doesn't need a leading underscore." >&4;;
12648 echo "I can't compile and run the test program." >&4
12649 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12654 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12659 : see if drand48_r exists
12660 set drand48_r d_drand48_r
12662 case "$d_drand48_r" in
12664 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12665 case "$d_drand48_r_proto:$usethreads" in
12666 ":define") d_drand48_r_proto=define
12667 set d_drand48_r_proto drand48_r $hdrs
12671 case "$d_drand48_r_proto" in
12673 case "$drand48_r_proto" in
12674 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12675 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12677 case "$drand48_r_proto" in
12678 ''|0) d_drand48_r=undef
12680 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12681 * ) case "$drand48_r_proto" in
12682 REENTRANT_PROTO*) ;;
12683 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12685 echo "Prototype: $try" ;;
12688 *) case "$usethreads" in
12689 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12696 *) drand48_r_proto=0
12700 : see if prototype for drand48 is available
12702 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12705 : see if dup2 exists
12709 : see if eaccess exists
12710 set eaccess d_eaccess
12713 : see if endgrent exists
12714 set endgrent d_endgrent
12717 : see if this is an grp system
12723 xxx=`./findhdr grp.h`
12724 $cppstdin $cppflags $cppminus < $xxx >$$.h
12726 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12738 set d_grpasswd; eval $setvar
12742 : see if endgrent_r exists
12743 set endgrent_r d_endgrent_r
12745 case "$d_endgrent_r" in
12747 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12748 case "$d_endgrent_r_proto:$usethreads" in
12749 ":define") d_endgrent_r_proto=define
12750 set d_endgrent_r_proto endgrent_r $hdrs
12754 case "$d_endgrent_r_proto" in
12756 case "$endgrent_r_proto" in
12757 ''|0) try='int endgrent_r(FILE**);'
12758 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12760 case "$endgrent_r_proto" in
12761 ''|0) try='void endgrent_r(FILE**);'
12762 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12764 case "$endgrent_r_proto" in
12765 ''|0) d_endgrent_r=undef
12767 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12768 * ) case "$endgrent_r_proto" in
12769 REENTRANT_PROTO*) ;;
12770 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12772 echo "Prototype: $try" ;;
12775 *) case "$usethreads" in
12776 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12783 *) endgrent_r_proto=0
12787 : see if endhostent exists
12788 set endhostent d_endhent
12791 : see if this is a netdb.h system
12792 set netdb.h i_netdb
12795 : see if endhostent_r exists
12796 set endhostent_r d_endhostent_r
12798 case "$d_endhostent_r" in
12800 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12801 case "$d_endhostent_r_proto:$usethreads" in
12802 ":define") d_endhostent_r_proto=define
12803 set d_endhostent_r_proto endhostent_r $hdrs
12807 case "$d_endhostent_r_proto" in
12809 case "$endhostent_r_proto" in
12810 ''|0) try='int endhostent_r(struct hostent_data*);'
12811 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12813 case "$endhostent_r_proto" in
12814 ''|0) try='void endhostent_r(struct hostent_data*);'
12815 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12817 case "$endhostent_r_proto" in
12818 ''|0) d_endhostent_r=undef
12819 endhostent_r_proto=0
12820 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12821 * ) case "$endhostent_r_proto" in
12822 REENTRANT_PROTO*) ;;
12823 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12825 echo "Prototype: $try" ;;
12828 *) case "$usethreads" in
12829 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12831 d_endhostent_r=undef
12832 endhostent_r_proto=0
12836 *) endhostent_r_proto=0
12840 : see if endnetent exists
12841 set endnetent d_endnent
12844 : see if endnetent_r exists
12845 set endnetent_r d_endnetent_r
12847 case "$d_endnetent_r" in
12849 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12850 case "$d_endnetent_r_proto:$usethreads" in
12851 ":define") d_endnetent_r_proto=define
12852 set d_endnetent_r_proto endnetent_r $hdrs
12856 case "$d_endnetent_r_proto" in
12858 case "$endnetent_r_proto" in
12859 ''|0) try='int endnetent_r(struct netent_data*);'
12860 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12862 case "$endnetent_r_proto" in
12863 ''|0) try='void endnetent_r(struct netent_data*);'
12864 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12866 case "$endnetent_r_proto" in
12867 ''|0) d_endnetent_r=undef
12868 endnetent_r_proto=0
12869 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12870 * ) case "$endnetent_r_proto" in
12871 REENTRANT_PROTO*) ;;
12872 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12874 echo "Prototype: $try" ;;
12877 *) case "$usethreads" in
12878 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12880 d_endnetent_r=undef
12881 endnetent_r_proto=0
12885 *) endnetent_r_proto=0
12889 : see if endprotoent exists
12890 set endprotoent d_endpent
12893 : see if endprotoent_r exists
12894 set endprotoent_r d_endprotoent_r
12896 case "$d_endprotoent_r" in
12898 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12899 case "$d_endprotoent_r_proto:$usethreads" in
12900 ":define") d_endprotoent_r_proto=define
12901 set d_endprotoent_r_proto endprotoent_r $hdrs
12905 case "$d_endprotoent_r_proto" in
12907 case "$endprotoent_r_proto" in
12908 ''|0) try='int endprotoent_r(struct protoent_data*);'
12909 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12911 case "$endprotoent_r_proto" in
12912 ''|0) try='void endprotoent_r(struct protoent_data*);'
12913 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12915 case "$endprotoent_r_proto" in
12916 ''|0) d_endprotoent_r=undef
12917 endprotoent_r_proto=0
12918 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12919 * ) case "$endprotoent_r_proto" in
12920 REENTRANT_PROTO*) ;;
12921 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12923 echo "Prototype: $try" ;;
12926 *) case "$usethreads" in
12927 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12929 d_endprotoent_r=undef
12930 endprotoent_r_proto=0
12934 *) endprotoent_r_proto=0
12938 : see if endpwent exists
12939 set endpwent d_endpwent
12942 : see if this is a pwd.h system
12948 xxx=`./findhdr pwd.h`
12949 $cppstdin $cppflags $cppminus < $xxx >$$.h
12951 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12959 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12967 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12975 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12983 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12991 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12999 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13007 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13019 set d_pwquota; eval $setvar
13020 set d_pwage; eval $setvar
13021 set d_pwchange; eval $setvar
13022 set d_pwclass; eval $setvar
13023 set d_pwexpire; eval $setvar
13024 set d_pwcomment; eval $setvar
13025 set d_pwgecos; eval $setvar
13026 set d_pwpasswd; eval $setvar
13030 : see if endpwent_r exists
13031 set endpwent_r d_endpwent_r
13033 case "$d_endpwent_r" in
13035 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13036 case "$d_endpwent_r_proto:$usethreads" in
13037 ":define") d_endpwent_r_proto=define
13038 set d_endpwent_r_proto endpwent_r $hdrs
13042 case "$d_endpwent_r_proto" in
13044 case "$endpwent_r_proto" in
13045 ''|0) try='int endpwent_r(FILE**);'
13046 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13048 case "$endpwent_r_proto" in
13049 ''|0) try='void endpwent_r(FILE**);'
13050 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13052 case "$endpwent_r_proto" in
13053 ''|0) d_endpwent_r=undef
13055 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13056 * ) case "$endpwent_r_proto" in
13057 REENTRANT_PROTO*) ;;
13058 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13060 echo "Prototype: $try" ;;
13063 *) case "$usethreads" in
13064 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13071 *) endpwent_r_proto=0
13075 : see if endservent exists
13076 set endservent d_endsent
13079 : see if endservent_r exists
13080 set endservent_r d_endservent_r
13082 case "$d_endservent_r" in
13084 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13085 case "$d_endservent_r_proto:$usethreads" in
13086 ":define") d_endservent_r_proto=define
13087 set d_endservent_r_proto endservent_r $hdrs
13091 case "$d_endservent_r_proto" in
13093 case "$endservent_r_proto" in
13094 ''|0) try='int endservent_r(struct servent_data*);'
13095 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13097 case "$endservent_r_proto" in
13098 ''|0) try='void endservent_r(struct servent_data*);'
13099 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13101 case "$endservent_r_proto" in
13102 ''|0) d_endservent_r=undef
13103 endservent_r_proto=0
13104 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13105 * ) case "$endservent_r_proto" in
13106 REENTRANT_PROTO*) ;;
13107 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13109 echo "Prototype: $try" ;;
13112 *) case "$usethreads" in
13113 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13115 d_endservent_r=undef
13116 endservent_r_proto=0
13120 *) endservent_r_proto=0
13124 : Locate the flags for 'open()'
13127 #include <sys/types.h>
13132 #include <sys/file.h>
13134 #$i_stdlib I_STDLIB
13136 #include <stdlib.h>
13147 : check sys/file.h first to get FREAD on Sun
13148 if $test `./findhdr sys/file.h` && \
13149 set try -DI_SYS_FILE && eval $compile; then
13151 echo "<sys/file.h> defines the O_* constants..." >&4
13152 if $run ./try; then
13153 echo "and you have the 3 argument form of open()." >&4
13156 echo "but not the 3 argument form of open(). Oh, well." >&4
13159 elif $test `./findhdr fcntl.h` && \
13160 set try -DI_FCNTL && eval $compile; then
13162 echo "<fcntl.h> defines the O_* constants..." >&4
13163 if $run ./try; then
13164 echo "and you have the 3 argument form of open()." >&4
13167 echo "but not the 3 argument form of open(). Oh, well." >&4
13172 echo "I can't find the O_* constant definitions! You got problems." >&4
13178 : see if this is a sys/file.h system
13183 : do we need to include sys/file.h ?
13187 if $h_sysfile; then
13189 echo "We'll be including <sys/file.h>." >&4
13192 echo "We won't be including <sys/file.h>." >&4
13202 : see if fcntl.h is there
13207 : see if we can include fcntl.h
13213 echo "We'll be including <fcntl.h>." >&4
13216 if $h_sysfile; then
13217 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13219 echo "We won't be including <fcntl.h>." >&4
13231 : see if fork exists
13235 : see if pipe exists
13239 : check for non-blocking I/O stuff
13240 case "$h_sysfile" in
13241 true) echo "#include <sys/file.h>" > head.c;;
13244 true) echo "#include <fcntl.h>" > head.c;;
13245 *) echo "#include <sys/fcntl.h>" > head.c;;
13250 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13251 case "$o_nonblock" in
13253 $cat head.c > try.c
13254 $cat >>try.c <<EOCP
13256 #$i_stdlib I_STDLIB
13258 #include <stdlib.h>
13266 printf("O_NONBLOCK\n");
13270 printf("O_NDELAY\n");
13274 printf("FNDELAY\n");
13281 if eval $compile_ok; then
13282 o_nonblock=`$run ./try`
13283 case "$o_nonblock" in
13284 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13285 *) echo "Seems like we can use $o_nonblock.";;
13288 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13291 *) echo "Using $hint value $o_nonblock.";;
13296 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13299 case "$d_fork:$d_pipe" in
13301 $cat head.c > try.c
13302 $cat >>try.c <<EOCP
13304 #include <sys/types.h>
13305 #include <signal.h>
13307 #$i_stdlib I_STDLIB
13309 #include <stdlib.h>
13315 #define MY_O_NONBLOCK $o_nonblock
13316 #ifndef errno /* XXX need better Configure test */
13319 #$i_unistd I_UNISTD
13321 #include <unistd.h>
13323 #$i_string I_STRING
13325 #include <string.h>
13327 #include <strings.h>
13329 $signal_t blech(int x) { exit(3); }
13331 $cat >> try.c <<'EOCP'
13340 ret = pipe(pd); /* Down: child -> parent */
13343 ret = pipe(pu); /* Up: parent -> child */
13347 close(pd[1]); /* Parent reads from pd[0] */
13348 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13350 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13355 signal(SIGALRM, blech);
13357 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13359 sprintf(string, "%d\n", ret);
13360 ret = write(2, string, strlen(string));
13361 if (ret != strlen(string))
13365 if (errno == EAGAIN) {
13366 printf("EAGAIN\n");
13371 if (errno == EWOULDBLOCK)
13372 printf("EWOULDBLOCK\n");
13375 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13378 sleep(2); /* Give it time to close our pipe */
13380 ret = read(pd[0], buf, 1); /* Should read EOF */
13382 sprintf(string, "%d\n", ret);
13383 ret = write(4, string, strlen(string));
13384 if (ret != strlen(string))
13389 close(pd[0]); /* We write to pd[1] */
13390 close(pu[1]); /* We read from pu[0] */
13391 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13394 close(pd[1]); /* Pipe pd is now fully closed! */
13395 exit(0); /* Bye bye, thank you for playing! */
13399 if eval $compile_ok; then
13400 echo "$startsh" >mtry
13401 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13403 $run ./mtry >/dev/null 2>&1
13405 0) eagain=`$cat try.out`;;
13406 1) echo "Could not perform non-blocking setting!";;
13407 2) echo "I did a successful read() for something that was not there!";;
13408 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13409 4) echo "Could not find F_SETFL!";;
13410 *) echo "Something terribly wrong happened during testing.";;
13412 rd_nodata=`$cat try.ret`
13413 echo "A read() system call with no data present returns $rd_nodata."
13414 case "$rd_nodata" in
13417 echo "(That's peculiar, fixing that to be -1.)"
13423 echo "Forcing errno EAGAIN on read() with no data available."
13427 echo "Your read() sets errno to $eagain when no data is available."
13430 status=`$cat try.err`
13432 0) echo "And it correctly returns 0 to signal EOF.";;
13433 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13434 *) echo "However, your read() returns '$status' on EOF??";;
13437 if test "$status" = "$rd_nodata"; then
13438 echo "WARNING: you can't distinguish between EOF and no data!"
13442 echo "I can't compile the test program--assuming errno EAGAIN will do."
13446 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13455 echo "Using $hint value $eagain."
13456 echo "Your read() returns $rd_nodata when no data is present."
13457 case "$d_eofnblk" in
13458 "$define") echo "And you can see EOF because read() returns 0.";;
13459 "$undef") echo "But you can't see EOF status from read() returned value.";;
13461 echo "(Assuming you can't see EOF status from read anyway.)"
13467 $rm_try head.c mtry
13469 : see if erf exists
13473 : see if erfc exists
13477 : see if exp2 exists
13481 : see if expm1 exists
13485 : see if _ptr and _cnt from stdio act std
13488 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13489 echo "(Looks like you have stdio.h from BSD.)"
13490 case "$stdio_ptr" in
13491 '') stdio_ptr='((fp)->_p)'
13494 *) ptr_lval=$d_stdio_ptr_lval;;
13496 case "$stdio_cnt" in
13497 '') stdio_cnt='((fp)->_r)'
13500 *) cnt_lval=$d_stdio_cnt_lval;;
13502 case "$stdio_base" in
13503 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13505 case "$stdio_bufsiz" in
13506 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13508 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13509 echo "(Looks like you have stdio.h from Linux.)"
13510 case "$stdio_ptr" in
13511 '') stdio_ptr='((fp)->_IO_read_ptr)'
13514 *) ptr_lval=$d_stdio_ptr_lval;;
13516 case "$stdio_cnt" in
13517 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13520 *) cnt_lval=$d_stdio_cnt_lval;;
13522 case "$stdio_base" in
13523 '') stdio_base='((fp)->_IO_read_base)';;
13525 case "$stdio_bufsiz" in
13526 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13529 case "$stdio_ptr" in
13530 '') stdio_ptr='((fp)->_ptr)'
13533 *) ptr_lval=$d_stdio_ptr_lval;;
13535 case "$stdio_cnt" in
13536 '') stdio_cnt='((fp)->_cnt)'
13539 *) cnt_lval=$d_stdio_cnt_lval;;
13541 case "$stdio_base" in
13542 '') stdio_base='((fp)->_base)';;
13544 case "$stdio_bufsiz" in
13545 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13549 : test whether _ptr and _cnt really work
13550 echo "Checking how std your stdio is..." >&4
13553 #$i_stdlib I_STDLIB
13555 #include <stdlib.h>
13557 #define FILE_ptr(fp) $stdio_ptr
13558 #define FILE_cnt(fp) $stdio_cnt
13560 FILE *fp = fopen("try.c", "r");
13563 18 <= FILE_cnt(fp) &&
13564 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13572 if eval $compile && $to try.c; then
13573 if $run ./try; then
13574 echo "Your stdio acts pretty std."
13577 echo "Your stdio isn't very std."
13580 echo "Your stdio doesn't appear very std."
13584 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13585 # direct buffer manipulation no longer works. The Configure tests
13586 # should be changed to correctly detect this, but until then,
13587 # the following check should at least let perl compile and run.
13588 # (This quick fix should be updated before 5.8.1.)
13589 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13590 # A. Dougherty, June 3, 2002.
13591 case "$d_gnulibc" in
13593 case "$gnulibc_version" in
13597 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13606 : Can _ptr be used as an lvalue?
13607 case "$d_stdstdio$ptr_lval" in
13608 $define$define) val=$define ;;
13611 set d_stdio_ptr_lval
13614 : Can _cnt be used as an lvalue?
13615 case "$d_stdstdio$cnt_lval" in
13616 $define$define) val=$define ;;
13619 set d_stdio_cnt_lval
13623 : test whether setting _ptr sets _cnt as a side effect
13624 d_stdio_ptr_lval_sets_cnt="$undef"
13625 d_stdio_ptr_lval_nochange_cnt="$undef"
13626 case "$d_stdio_ptr_lval$d_stdstdio" in
13628 echo "Checking to see what happens if we set the stdio ptr..." >&4
13631 /* Can we scream? */
13632 /* Eat dust sed :-) */
13633 /* In the buffer space, no one can hear you scream. */
13634 #$i_stdlib I_STDLIB
13636 #include <stdlib.h>
13638 #define FILE_ptr(fp) $stdio_ptr
13639 #define FILE_cnt(fp) $stdio_cnt
13640 #include <sys/types.h>
13642 FILE *fp = fopen("try.c", "r");
13647 puts("Fail even to read");
13650 c = getc(fp); /* Read away the first # */
13652 puts("Fail even to read");
13656 18 <= FILE_cnt(fp) &&
13657 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13659 puts("Fail even to read");
13662 ptr = (char*) FILE_ptr(fp);
13663 cnt = (size_t)FILE_cnt(fp);
13665 FILE_ptr(fp) += 42;
13667 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13668 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13671 if (FILE_cnt(fp) <= 20) {
13672 printf ("Fail (<20 chars to test)");
13675 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13676 puts("Fail compare");
13679 if (cnt == FILE_cnt(fp)) {
13680 puts("Pass_unchanged");
13683 if (FILE_cnt(fp) == (cnt - 42)) {
13684 puts("Pass_changed");
13687 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13693 if eval $compile && $to try.c; then
13694 case `$run ./try` in
13696 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13697 d_stdio_ptr_lval_sets_cnt="$define" ;;
13699 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13700 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13702 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13704 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13707 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13713 : see if _base is also standard
13715 case "$d_stdstdio" in
13719 #$i_stdlib I_STDLIB
13721 #include <stdlib.h>
13723 #define FILE_base(fp) $stdio_base
13724 #define FILE_bufsiz(fp) $stdio_bufsiz
13726 FILE *fp = fopen("try.c", "r");
13729 19 <= FILE_bufsiz(fp) &&
13730 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13737 if eval $compile && $to try.c; then
13738 if $run ./try; then
13739 echo "And its _base field acts std."
13742 echo "But its _base field isn't std."
13745 echo "However, it seems to be lacking the _base field."
13753 : see if fast_stdio exists
13755 case "$d_stdstdio:$d_stdio_ptr_lval" in
13757 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13759 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13770 : see if fchdir exists
13771 set fchdir d_fchdir
13774 : see if fchmod exists
13775 set fchmod d_fchmod
13778 : see if fchown exists
13779 set fchown d_fchown
13782 : see if this is an fcntl system
13786 : See if fcntl-based locking works.
13789 #$i_stdlib I_STDLIB
13791 #include <stdlib.h>
13793 #include <unistd.h>
13795 #include <signal.h>
13796 $signal_t blech(int x) { exit(3); }
13798 #if defined(F_SETLK) && defined(F_SETLKW)
13799 struct flock flock;
13801 fd = open("try.c", O_RDONLY);
13802 flock.l_type = F_RDLCK;
13803 flock.l_whence = SEEK_SET;
13804 flock.l_start = flock.l_len = 0;
13805 signal(SIGALRM, blech);
13807 retval = fcntl(fd, F_SETLK, &flock);
13809 (retval < 0 ? exit(2) : exit(0));
13815 echo "Checking if fcntl-based file locking works... "
13819 if eval $compile_ok; then
13820 if $run ./try; then
13821 echo "Yes, it seems to work."
13824 echo "Nope, it didn't work."
13829 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13830 *** This is (almost) impossible.
13831 *** If your NFS lock daemons are not feeling well, something like
13832 *** this may happen, please investigate. Cannot continue, aborting.
13840 echo "I'm unable to compile the test program, so I'll assume not."
13845 echo "Nope, since you don't even have fcntl()."
13848 set d_fcntl_can_lock
13852 : check for fd_set items
13855 Checking to see how well your C compiler handles fd_set and friends ...
13858 #$i_stdlib I_STDLIB
13860 #include <stdlib.h>
13862 #$i_systime I_SYS_TIME
13863 #$i_sysselct I_SYS_SELECT
13864 #$d_socket HAS_SOCKET
13865 #include <sys/types.h>
13867 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13870 #include <sys/time.h>
13872 #ifdef I_SYS_SELECT
13873 #include <sys/select.h>
13882 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13890 if eval $compile; then
13891 d_fds_bits="$define"
13893 echo "Well, your system knows about the normal fd_set typedef..." >&4
13894 if $run ./try; then
13895 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13896 d_fd_macros="$define"
13899 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13901 d_fd_macros="$undef"
13905 Hmm, your compiler has some difficulty with fd_set. Checking further...
13908 if eval $compile; then
13909 d_fds_bits="$undef"
13911 echo "Well, your system has some sort of fd_set available..." >&4
13912 if $run ./try; then
13913 echo "and you have the normal fd_set macros." >&4
13914 d_fd_macros="$define"
13917 but not the normal fd_set macros! Gross! More work for me...
13919 d_fd_macros="$undef"
13922 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13924 d_fds_bits="$undef"
13925 d_fd_macros="$undef"
13930 : see if fdim exists
13934 : see if fegetround exists
13935 set fegetround d_fegetround
13938 : see if fgetpos exists
13939 set fgetpos d_fgetpos
13942 : see if finite exists
13943 set finite d_finite
13946 : see if finitel exists
13947 set finitel d_finitel
13950 : see if flock exists
13954 : see if prototype for flock is available
13956 set d_flockproto flock $i_sysfile sys/file.h
13959 : see if fma exists
13963 : see if fmax exists
13967 : see if fmin exists
13971 : see if fp_class exists
13972 set fp_class d_fp_class
13975 : see if this is a math.h system
13979 : check for fpclassify
13980 echo "Checking to see if you have fpclassify..." >&4
13986 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13989 if eval $compile; then
13991 echo "You have fpclassify."
13994 echo "You do not have fpclassify."
14000 : see if fp_classify exists
14001 set fp_classify d_fp_classify
14004 : see if fp_classl exists
14005 set fp_classl d_fp_classl
14008 : see if pathconf exists
14009 set pathconf d_pathconf
14012 : see if fpathconf exists
14013 set fpathconf d_fpathconf
14016 : see if fpclass exists
14017 set fpclass d_fpclass
14020 : see if fpclassl exists
14021 set fpclassl d_fpclassl
14024 : see if fpgetround exists
14025 set fpgetround d_fpgetround
14028 : check for fpos64_t
14030 echo "Checking to see if you have fpos64_t..." >&4
14033 int main() { fpos64_t x = 7; }
14036 if eval $compile; then
14038 echo "You have fpos64_t."
14041 echo "You do not have fpos64_t."
14042 case "$fpossize" in
14043 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14050 : see if frexpl exists
14051 set frexpl d_frexpl
14054 : see if this is a sys/param system
14055 set sys/param.h i_sysparam
14058 : see if this is a sys/mount.h system
14059 set sys/mount.h i_sysmount
14062 : Check for fs_data_s
14064 echo "Checking to see if your system supports struct fs_data..." >&4
14065 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14067 case "$d_fs_data_s" in
14068 "$define") echo "Yes, it does." ;;
14069 *) echo "No, it doesn't." ;;
14072 : see if fseeko exists
14073 set fseeko d_fseeko
14075 case "$longsize" in
14076 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14079 : see if fsetpos exists
14080 set fsetpos d_fsetpos
14083 : see if fstatfs exists
14084 set fstatfs d_fstatfs
14087 : see if statvfs exists
14088 set statvfs d_statvfs
14091 : see if fstatvfs exists
14092 set fstatvfs d_fstatvfs
14096 : see if fsync exists
14100 : see if ftello exists
14101 set ftello d_ftello
14103 case "$longsize" in
14104 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14107 : check for a working futimes
14110 echo "Checking if you have a working futimes()" >&4
14113 #include <sys/time.h>
14120 fd = open ("try.c", O_RDWR);
14121 if (-1 == fd) exit (1);
14122 rv = futimes (fd, NULL);
14123 exit (rv == -1 ? errno : 0);
14127 if eval $compile; then
14131 0) echo "Yes, you have" >&4
14132 d_futimes="$define"
14134 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14138 echo "No, it does not (probably harmless)" >&4
14142 : see if ndbm.h is available
14145 : Compatibility location for RedHat 7.1
14146 set gdbm/ndbm.h i_gdbmndbm
14148 : Compatibility location for Debian 4.0
14149 set gdbm-ndbm.h i_gdbm_ndbm
14153 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14154 : see if dbm_open exists
14155 set dbm_open d_dbm_open
14157 case "$d_dbm_open" in
14160 i_gdbmndbm="$undef"
14161 i_gdbm_ndbm="$undef"
14162 echo "We won't be including <ndbm.h>"
14172 ndbm_hdr_protochk='name=$1; hdr=$2;
14173 eval "ihdr=\$""i_$name";
14175 if $test "$ihdr" = "$define"; then
14176 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14177 case "$d_cplusplus" in
14178 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14179 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14182 $define) $echo "Your <$hdr> seems to have prototypes";;
14183 *) $echo "Your <$hdr> does not seem to have prototypes";;
14186 set "d_${name}_h_uses_prototypes";
14190 eval $ndbm_hdr_protochk
14191 set gdbmndbm gdbm/ndbm.h
14192 eval $ndbm_hdr_protochk
14193 set gdbm_ndbm gdbm-ndbm.h
14194 eval $ndbm_hdr_protochk
14196 : see if getaddrinfo exists
14197 set getaddrinfo d_getaddrinfo
14200 : see if getcwd exists
14201 set getcwd d_getcwd
14204 : see if getespwnam exists
14205 set getespwnam d_getespwnam
14208 : see if getfsstat exists
14209 set getfsstat d_getfsstat
14212 : see if getgrent exists
14213 set getgrent d_getgrent
14216 : see if getgrent_r exists
14217 set getgrent_r d_getgrent_r
14219 case "$d_getgrent_r" in
14221 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14222 case "$d_getgrent_r_proto:$usethreads" in
14223 ":define") d_getgrent_r_proto=define
14224 set d_getgrent_r_proto getgrent_r $hdrs
14228 case "$d_getgrent_r_proto" in
14230 case "$getgrent_r_proto" in
14231 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14232 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14234 case "$getgrent_r_proto" in
14235 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14236 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14238 case "$getgrent_r_proto" in
14239 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14240 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14242 case "$getgrent_r_proto" in
14243 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14244 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14246 case "$getgrent_r_proto" in
14247 ''|0) try='int getgrent_r(struct group*, char*, int);'
14248 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14250 case "$getgrent_r_proto" in
14251 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14252 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14254 case "$getgrent_r_proto" in
14255 ''|0) d_getgrent_r=undef
14257 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14258 * ) case "$getgrent_r_proto" in
14259 REENTRANT_PROTO*) ;;
14260 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14262 echo "Prototype: $try" ;;
14265 *) case "$usethreads" in
14266 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14273 *) getgrent_r_proto=0
14277 : see if getgrgid_r exists
14278 set getgrgid_r d_getgrgid_r
14280 case "$d_getgrgid_r" in
14282 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14283 case "$d_getgrgid_r_proto:$usethreads" in
14284 ":define") d_getgrgid_r_proto=define
14285 set d_getgrgid_r_proto getgrgid_r $hdrs
14289 case "$d_getgrgid_r_proto" in
14291 case "$getgrgid_r_proto" in
14292 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14293 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14295 case "$getgrgid_r_proto" in
14296 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14297 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14299 case "$getgrgid_r_proto" in
14300 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14301 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14303 case "$getgrgid_r_proto" in
14304 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14305 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14307 case "$getgrgid_r_proto" in
14308 ''|0) d_getgrgid_r=undef
14310 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14311 * ) case "$getgrgid_r_proto" in
14312 REENTRANT_PROTO*) ;;
14313 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14315 echo "Prototype: $try" ;;
14318 *) case "$usethreads" in
14319 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14326 *) getgrgid_r_proto=0
14330 : see if getgrnam_r exists
14331 set getgrnam_r d_getgrnam_r
14333 case "$d_getgrnam_r" in
14335 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14336 case "$d_getgrnam_r_proto:$usethreads" in
14337 ":define") d_getgrnam_r_proto=define
14338 set d_getgrnam_r_proto getgrnam_r $hdrs
14342 case "$d_getgrnam_r_proto" in
14344 case "$getgrnam_r_proto" in
14345 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14346 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14348 case "$getgrnam_r_proto" in
14349 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14350 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14352 case "$getgrnam_r_proto" in
14353 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14354 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14356 case "$getgrnam_r_proto" in
14357 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14358 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14360 case "$getgrnam_r_proto" in
14361 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14362 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14364 case "$getgrnam_r_proto" in
14365 ''|0) d_getgrnam_r=undef
14367 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14368 * ) case "$getgrnam_r_proto" in
14369 REENTRANT_PROTO*) ;;
14370 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14372 echo "Prototype: $try" ;;
14375 *) case "$usethreads" in
14376 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14383 *) getgrnam_r_proto=0
14387 : see if gethostbyaddr exists
14388 set gethostbyaddr d_gethbyaddr
14391 : see if gethostbyname exists
14392 set gethostbyname d_gethbyname
14395 : see if gethostent exists
14396 set gethostent d_gethent
14399 : see how we will look up host name
14402 if set gethostname val -f d_gethname; eval $csym; $val; then
14403 echo 'gethostname() found.' >&4
14404 d_gethname="$define"
14407 if set uname val -f d_uname; eval $csym; $val; then
14410 uname() was found, but you're running xenix, and older versions of xenix
14411 have a broken uname(). If you don't really know whether your xenix is old
14412 enough to have a broken system call, use the default answer.
14417 "$define") dflt=n;;
14419 rp='Is your uname() broken?'
14422 n*) d_uname="$define"; call=uname;;
14425 echo 'uname() found.' >&4
14432 case "$d_gethname" in
14433 '') d_gethname="$undef";;
14436 '') d_uname="$undef";;
14438 case "$d_uname$d_gethname" in
14443 Every now and then someone has a $call() that lies about the hostname
14444 but can't be fixed for political or economic reasons. If you wish, I can
14445 pretend $call() isn't there and maybe compute hostname at run-time
14446 thanks to the '$phostname' command.
14449 rp="Shall I ignore $call() from now on?"
14452 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14455 case "$phostname" in
14456 '') aphostname='';;
14457 *) case "$aphostname" in
14459 *) set X $phostname
14463 file=`./loc $file $file $pth`
14464 aphostname=`echo $file $*`
14469 case "$d_uname$d_gethname" in
14472 case "$phostname" in
14474 echo "There will be no way for $package to get your hostname." >&4;;
14476 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14480 case "$d_phostname" in
14481 '') d_phostname="$undef";;
14484 : see if gethostbyaddr_r exists
14485 set gethostbyaddr_r d_gethostbyaddr_r
14487 case "$d_gethostbyaddr_r" in
14489 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14490 case "$d_gethostbyaddr_r_proto:$usethreads" in
14491 ":define") d_gethostbyaddr_r_proto=define
14492 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14496 case "$d_gethostbyaddr_r_proto" in
14498 case "$gethostbyaddr_r_proto" in
14499 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14500 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14502 case "$gethostbyaddr_r_proto" in
14503 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14504 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14506 case "$gethostbyaddr_r_proto" in
14507 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14508 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14510 case "$gethostbyaddr_r_proto" in
14511 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14512 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14514 case "$gethostbyaddr_r_proto" in
14515 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14516 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14518 case "$gethostbyaddr_r_proto" in
14519 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14520 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14522 case "$gethostbyaddr_r_proto" in
14523 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14524 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14526 case "$gethostbyaddr_r_proto" in
14527 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14528 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14530 case "$gethostbyaddr_r_proto" in
14531 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14532 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14534 case "$gethostbyaddr_r_proto" in
14535 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14536 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14538 case "$gethostbyaddr_r_proto" in
14539 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14540 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14542 case "$gethostbyaddr_r_proto" in
14543 ''|0) d_gethostbyaddr_r=undef
14544 gethostbyaddr_r_proto=0
14545 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14546 * ) case "$gethostbyaddr_r_proto" in
14547 REENTRANT_PROTO*) ;;
14548 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14550 echo "Prototype: $try" ;;
14553 *) case "$usethreads" in
14554 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14556 d_gethostbyaddr_r=undef
14557 gethostbyaddr_r_proto=0
14561 *) gethostbyaddr_r_proto=0
14565 : see if gethostbyname_r exists
14566 set gethostbyname_r d_gethostbyname_r
14568 case "$d_gethostbyname_r" in
14570 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14571 case "$d_gethostbyname_r_proto:$usethreads" in
14572 ":define") d_gethostbyname_r_proto=define
14573 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14577 case "$d_gethostbyname_r_proto" in
14579 case "$gethostbyname_r_proto" in
14580 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14581 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14583 case "$gethostbyname_r_proto" in
14584 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14585 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14587 case "$gethostbyname_r_proto" in
14588 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14589 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14591 case "$gethostbyname_r_proto" in
14592 ''|0) d_gethostbyname_r=undef
14593 gethostbyname_r_proto=0
14594 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14595 * ) case "$gethostbyname_r_proto" in
14596 REENTRANT_PROTO*) ;;
14597 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14599 echo "Prototype: $try" ;;
14602 *) case "$usethreads" in
14603 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14605 d_gethostbyname_r=undef
14606 gethostbyname_r_proto=0
14610 *) gethostbyname_r_proto=0
14614 : see if gethostent_r exists
14615 set gethostent_r d_gethostent_r
14617 case "$d_gethostent_r" in
14619 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14620 case "$d_gethostent_r_proto:$usethreads" in
14621 ":define") d_gethostent_r_proto=define
14622 set d_gethostent_r_proto gethostent_r $hdrs
14626 case "$d_gethostent_r_proto" in
14628 case "$gethostent_r_proto" in
14629 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14630 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14632 case "$gethostent_r_proto" in
14633 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14634 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14636 case "$gethostent_r_proto" in
14637 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14638 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14640 case "$gethostent_r_proto" in
14641 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14642 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14644 case "$gethostent_r_proto" in
14645 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14646 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14648 case "$gethostent_r_proto" in
14649 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14650 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14652 case "$gethostent_r_proto" in
14653 ''|0) d_gethostent_r=undef
14654 gethostent_r_proto=0
14655 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14656 * ) case "$gethostent_r_proto" in
14657 REENTRANT_PROTO*) ;;
14658 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14660 echo "Prototype: $try" ;;
14663 *) case "$usethreads" in
14664 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14666 d_gethostent_r=undef
14667 gethostent_r_proto=0
14671 *) gethostent_r_proto=0
14675 : see if prototypes for various gethostxxx netdb.h functions are available
14677 set d_gethostprotos gethostent $i_netdb netdb.h
14680 : see if getitimer exists
14681 set getitimer d_getitimer
14684 : see if getlogin exists
14685 set getlogin d_getlogin
14688 : see if getlogin_r exists
14689 set getlogin_r d_getlogin_r
14691 case "$d_getlogin_r" in
14693 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14694 case "$d_getlogin_r_proto:$usethreads" in
14695 ":define") d_getlogin_r_proto=define
14696 set d_getlogin_r_proto getlogin_r $hdrs
14700 case "$d_getlogin_r_proto" in
14702 case "$getlogin_r_proto" in
14703 ''|0) try='int getlogin_r(char*, size_t);'
14704 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14706 case "$getlogin_r_proto" in
14707 ''|0) try='int getlogin_r(char*, int);'
14708 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14710 case "$getlogin_r_proto" in
14711 ''|0) try='char* getlogin_r(char*, size_t);'
14712 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14714 case "$getlogin_r_proto" in
14715 ''|0) try='char* getlogin_r(char*, int);'
14716 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14718 case "$getlogin_r_proto" in
14719 ''|0) d_getlogin_r=undef
14721 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14722 * ) case "$getlogin_r_proto" in
14723 REENTRANT_PROTO*) ;;
14724 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14726 echo "Prototype: $try" ;;
14729 *) case "$usethreads" in
14730 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14737 *) getlogin_r_proto=0
14741 : see if getmnt exists
14742 set getmnt d_getmnt
14745 : see if getmntent exists
14746 set getmntent d_getmntent
14749 : see if getnameinfo exists
14750 set getnameinfo d_getnameinfo
14753 : see if getnetbyaddr exists
14754 set getnetbyaddr d_getnbyaddr
14757 : see if getnetbyname exists
14758 set getnetbyname d_getnbyname
14761 : see if getnetent exists
14762 set getnetent d_getnent
14765 : see if getnetbyaddr_r exists
14766 set getnetbyaddr_r d_getnetbyaddr_r
14768 case "$d_getnetbyaddr_r" in
14770 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14771 case "$d_getnetbyaddr_r_proto:$usethreads" in
14772 ":define") d_getnetbyaddr_r_proto=define
14773 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14777 case "$d_getnetbyaddr_r_proto" in
14779 case "$getnetbyaddr_r_proto" in
14780 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14781 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14783 case "$getnetbyaddr_r_proto" in
14784 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14785 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14787 case "$getnetbyaddr_r_proto" in
14788 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14789 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14791 case "$getnetbyaddr_r_proto" in
14792 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14793 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14795 case "$getnetbyaddr_r_proto" in
14796 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14797 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14799 case "$getnetbyaddr_r_proto" in
14800 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14801 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14803 case "$getnetbyaddr_r_proto" in
14804 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14805 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14807 case "$getnetbyaddr_r_proto" in
14808 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14809 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14811 case "$getnetbyaddr_r_proto" in
14812 ''|0) d_getnetbyaddr_r=undef
14813 getnetbyaddr_r_proto=0
14814 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14815 * ) case "$getnetbyaddr_r_proto" in
14816 REENTRANT_PROTO*) ;;
14817 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14819 echo "Prototype: $try" ;;
14822 *) case "$usethreads" in
14823 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14825 d_getnetbyaddr_r=undef
14826 getnetbyaddr_r_proto=0
14830 *) getnetbyaddr_r_proto=0
14834 : see if getnetbyname_r exists
14835 set getnetbyname_r d_getnetbyname_r
14837 case "$d_getnetbyname_r" in
14839 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14840 case "$d_getnetbyname_r_proto:$usethreads" in
14841 ":define") d_getnetbyname_r_proto=define
14842 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14846 case "$d_getnetbyname_r_proto" in
14848 case "$getnetbyname_r_proto" in
14849 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14850 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14852 case "$getnetbyname_r_proto" in
14853 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14854 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14856 case "$getnetbyname_r_proto" in
14857 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14858 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14860 case "$getnetbyname_r_proto" in
14861 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14862 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14864 case "$getnetbyname_r_proto" in
14865 ''|0) d_getnetbyname_r=undef
14866 getnetbyname_r_proto=0
14867 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14868 * ) case "$getnetbyname_r_proto" in
14869 REENTRANT_PROTO*) ;;
14870 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14872 echo "Prototype: $try" ;;
14875 *) case "$usethreads" in
14876 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14878 d_getnetbyname_r=undef
14879 getnetbyname_r_proto=0
14883 *) getnetbyname_r_proto=0
14887 : see if getnetent_r exists
14888 set getnetent_r d_getnetent_r
14890 case "$d_getnetent_r" in
14892 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14893 case "$d_getnetent_r_proto:$usethreads" in
14894 ":define") d_getnetent_r_proto=define
14895 set d_getnetent_r_proto getnetent_r $hdrs
14899 case "$d_getnetent_r_proto" in
14901 case "$getnetent_r_proto" in
14902 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14903 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14905 case "$getnetent_r_proto" in
14906 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14907 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14909 case "$getnetent_r_proto" in
14910 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14911 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14913 case "$getnetent_r_proto" in
14914 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14915 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14917 case "$getnetent_r_proto" in
14918 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14919 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14921 case "$getnetent_r_proto" in
14922 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14923 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14925 case "$getnetent_r_proto" in
14926 ''|0) d_getnetent_r=undef
14927 getnetent_r_proto=0
14928 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14929 * ) case "$getnetent_r_proto" in
14930 REENTRANT_PROTO*) ;;
14931 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14933 echo "Prototype: $try" ;;
14936 *) case "$usethreads" in
14937 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14939 d_getnetent_r=undef
14940 getnetent_r_proto=0
14944 *) getnetent_r_proto=0
14948 : see if prototypes for various getnetxxx netdb.h functions are available
14950 set d_getnetprotos getnetent $i_netdb netdb.h
14953 : see if getpagesize exists
14954 set getpagesize d_getpagsz
14957 : Optional checks for getprotobyname and getprotobynumber
14959 : see if getprotobyname exists
14960 set getprotobyname d_getpbyname
14963 : see if getprotobynumber exists
14964 set getprotobynumber d_getpbynumber
14967 : see if getprotoent exists
14968 set getprotoent d_getpent
14971 : see if getpgid exists
14972 set getpgid d_getpgid
14975 : see if getpgrp2 exists
14976 set getpgrp2 d_getpgrp2
14979 : see if getppid exists
14980 set getppid d_getppid
14983 : see if getpriority exists
14984 set getpriority d_getprior
14987 : see if getprotobyname_r exists
14988 set getprotobyname_r d_getprotobyname_r
14990 case "$d_getprotobyname_r" in
14992 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14993 case "$d_getprotobyname_r_proto:$usethreads" in
14994 ":define") d_getprotobyname_r_proto=define
14995 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14999 case "$d_getprotobyname_r_proto" in
15001 case "$getprotobyname_r_proto" in
15002 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15003 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15005 case "$getprotobyname_r_proto" in
15006 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15007 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15009 case "$getprotobyname_r_proto" in
15010 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15011 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15013 case "$getprotobyname_r_proto" in
15014 ''|0) d_getprotobyname_r=undef
15015 getprotobyname_r_proto=0
15016 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15017 * ) case "$getprotobyname_r_proto" in
15018 REENTRANT_PROTO*) ;;
15019 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15021 echo "Prototype: $try" ;;
15024 *) case "$usethreads" in
15025 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15027 d_getprotobyname_r=undef
15028 getprotobyname_r_proto=0
15032 *) getprotobyname_r_proto=0
15036 : see if getprotobynumber_r exists
15037 set getprotobynumber_r d_getprotobynumber_r
15039 case "$d_getprotobynumber_r" in
15041 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15042 case "$d_getprotobynumber_r_proto:$usethreads" in
15043 ":define") d_getprotobynumber_r_proto=define
15044 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15048 case "$d_getprotobynumber_r_proto" in
15050 case "$getprotobynumber_r_proto" in
15051 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15052 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15054 case "$getprotobynumber_r_proto" in
15055 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15056 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15058 case "$getprotobynumber_r_proto" in
15059 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15060 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15062 case "$getprotobynumber_r_proto" in
15063 ''|0) d_getprotobynumber_r=undef
15064 getprotobynumber_r_proto=0
15065 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15066 * ) case "$getprotobynumber_r_proto" in
15067 REENTRANT_PROTO*) ;;
15068 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15070 echo "Prototype: $try" ;;
15073 *) case "$usethreads" in
15074 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15076 d_getprotobynumber_r=undef
15077 getprotobynumber_r_proto=0
15081 *) getprotobynumber_r_proto=0
15085 : see if getprotoent_r exists
15086 set getprotoent_r d_getprotoent_r
15088 case "$d_getprotoent_r" in
15090 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15091 case "$d_getprotoent_r_proto:$usethreads" in
15092 ":define") d_getprotoent_r_proto=define
15093 set d_getprotoent_r_proto getprotoent_r $hdrs
15097 case "$d_getprotoent_r_proto" in
15099 case "$getprotoent_r_proto" in
15100 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15101 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15103 case "$getprotoent_r_proto" in
15104 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15105 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15107 case "$getprotoent_r_proto" in
15108 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15109 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15111 case "$getprotoent_r_proto" in
15112 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15113 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15115 case "$getprotoent_r_proto" in
15116 ''|0) d_getprotoent_r=undef
15117 getprotoent_r_proto=0
15118 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15119 * ) case "$getprotoent_r_proto" in
15120 REENTRANT_PROTO*) ;;
15121 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15123 echo "Prototype: $try" ;;
15126 *) case "$usethreads" in
15127 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15129 d_getprotoent_r=undef
15130 getprotoent_r_proto=0
15134 *) getprotoent_r_proto=0
15138 : see if prototypes for various getprotoxxx netdb.h functions are available
15140 set d_getprotoprotos getprotoent $i_netdb netdb.h
15143 : see if getprpwnam exists
15144 set getprpwnam d_getprpwnam
15147 : see if getpwent exists
15148 set getpwent d_getpwent
15151 : see if getpwent_r exists
15152 set getpwent_r d_getpwent_r
15154 case "$d_getpwent_r" in
15156 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15157 case "$d_getpwent_r_proto:$usethreads" in
15158 ":define") d_getpwent_r_proto=define
15159 set d_getpwent_r_proto getpwent_r $hdrs
15163 case "$d_getpwent_r_proto" in
15165 case "$getpwent_r_proto" in
15166 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15167 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15169 case "$getpwent_r_proto" in
15170 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15171 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15173 case "$getpwent_r_proto" in
15174 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15175 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15177 case "$getpwent_r_proto" in
15178 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15179 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15181 case "$getpwent_r_proto" in
15182 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15183 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15185 case "$getpwent_r_proto" in
15186 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15187 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15189 case "$getpwent_r_proto" in
15190 ''|0) d_getpwent_r=undef
15192 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15193 * ) case "$getpwent_r_proto" in
15194 REENTRANT_PROTO*) ;;
15195 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15197 echo "Prototype: $try" ;;
15200 *) case "$usethreads" in
15201 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15208 *) getpwent_r_proto=0
15212 : see if getpwnam_r exists
15213 set getpwnam_r d_getpwnam_r
15215 case "$d_getpwnam_r" in
15217 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15218 case "$d_getpwnam_r_proto:$usethreads" in
15219 ":define") d_getpwnam_r_proto=define
15220 set d_getpwnam_r_proto getpwnam_r $hdrs
15224 case "$d_getpwnam_r_proto" in
15226 case "$getpwnam_r_proto" in
15227 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15228 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15230 case "$getpwnam_r_proto" in
15231 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15232 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15234 case "$getpwnam_r_proto" in
15235 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15236 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15238 case "$getpwnam_r_proto" in
15239 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15240 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15242 case "$getpwnam_r_proto" in
15243 ''|0) d_getpwnam_r=undef
15245 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15246 * ) case "$getpwnam_r_proto" in
15247 REENTRANT_PROTO*) ;;
15248 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15250 echo "Prototype: $try" ;;
15253 *) case "$usethreads" in
15254 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15261 *) getpwnam_r_proto=0
15265 : see if getpwuid_r exists
15266 set getpwuid_r d_getpwuid_r
15268 case "$d_getpwuid_r" in
15270 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15271 case "$d_getpwuid_r_proto:$usethreads" in
15272 ":define") d_getpwuid_r_proto=define
15273 set d_getpwuid_r_proto getpwuid_r $hdrs
15277 case "$d_getpwuid_r_proto" in
15279 case "$getpwuid_r_proto" in
15280 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15281 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15283 case "$getpwuid_r_proto" in
15284 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15285 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15287 case "$getpwuid_r_proto" in
15288 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15289 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15291 case "$getpwuid_r_proto" in
15292 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15293 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15295 case "$getpwuid_r_proto" in
15296 ''|0) d_getpwuid_r=undef
15298 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15299 * ) case "$getpwuid_r_proto" in
15300 REENTRANT_PROTO*) ;;
15301 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15303 echo "Prototype: $try" ;;
15306 *) case "$usethreads" in
15307 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15314 *) getpwuid_r_proto=0
15318 : Optional checks for getsbyname and getsbyport
15320 : see if getservbyname exists
15321 set getservbyname d_getsbyname
15324 : see if getservbyport exists
15325 set getservbyport d_getsbyport
15328 : see if getservent exists
15329 set getservent d_getsent
15332 : see if getservbyname_r exists
15333 set getservbyname_r d_getservbyname_r
15335 case "$d_getservbyname_r" in
15337 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15338 case "$d_getservbyname_r_proto:$usethreads" in
15339 ":define") d_getservbyname_r_proto=define
15340 set d_getservbyname_r_proto getservbyname_r $hdrs
15344 case "$d_getservbyname_r_proto" in
15346 case "$getservbyname_r_proto" in
15347 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15348 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15350 case "$getservbyname_r_proto" in
15351 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15352 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15354 case "$getservbyname_r_proto" in
15355 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15356 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15358 case "$getservbyname_r_proto" in
15359 ''|0) d_getservbyname_r=undef
15360 getservbyname_r_proto=0
15361 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15362 * ) case "$getservbyname_r_proto" in
15363 REENTRANT_PROTO*) ;;
15364 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15366 echo "Prototype: $try" ;;
15369 *) case "$usethreads" in
15370 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15372 d_getservbyname_r=undef
15373 getservbyname_r_proto=0
15377 *) getservbyname_r_proto=0
15381 : see if getservbyport_r exists
15382 set getservbyport_r d_getservbyport_r
15384 case "$d_getservbyport_r" in
15386 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15387 case "$d_getservbyport_r_proto:$usethreads" in
15388 ":define") d_getservbyport_r_proto=define
15389 set d_getservbyport_r_proto getservbyport_r $hdrs
15393 case "$d_getservbyport_r_proto" in
15395 case "$getservbyport_r_proto" in
15396 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15397 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15399 case "$getservbyport_r_proto" in
15400 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15401 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15403 case "$getservbyport_r_proto" in
15404 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15405 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15407 case "$getservbyport_r_proto" in
15408 ''|0) d_getservbyport_r=undef
15409 getservbyport_r_proto=0
15410 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15411 * ) case "$getservbyport_r_proto" in
15412 REENTRANT_PROTO*) ;;
15413 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15415 echo "Prototype: $try" ;;
15418 *) case "$usethreads" in
15419 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15421 d_getservbyport_r=undef
15422 getservbyport_r_proto=0
15426 *) getservbyport_r_proto=0
15430 : see if getservent_r exists
15431 set getservent_r d_getservent_r
15433 case "$d_getservent_r" in
15435 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15436 case "$d_getservent_r_proto:$usethreads" in
15437 ":define") d_getservent_r_proto=define
15438 set d_getservent_r_proto getservent_r $hdrs
15442 case "$d_getservent_r_proto" in
15444 case "$getservent_r_proto" in
15445 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15446 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15448 case "$getservent_r_proto" in
15449 ''|0) try='int getservent_r(struct servent*, char*, int);'
15450 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15452 case "$getservent_r_proto" in
15453 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15454 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15456 case "$getservent_r_proto" in
15457 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15458 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15460 case "$getservent_r_proto" in
15461 ''|0) d_getservent_r=undef
15462 getservent_r_proto=0
15463 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15464 * ) case "$getservent_r_proto" in
15465 REENTRANT_PROTO*) ;;
15466 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15468 echo "Prototype: $try" ;;
15471 *) case "$usethreads" in
15472 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15474 d_getservent_r=undef
15475 getservent_r_proto=0
15479 *) getservent_r_proto=0
15483 : see if prototypes for various getservxxx netdb.h functions are available
15485 set d_getservprotos getservent $i_netdb netdb.h
15488 : see if getspnam exists
15489 set getspnam d_getspnam
15492 : see if this is a shadow.h system
15493 set shadow.h i_shadow
15496 : see if getspnam_r exists
15497 set getspnam_r d_getspnam_r
15499 case "$d_getspnam_r" in
15501 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15502 case "$d_getspnam_r_proto:$usethreads" in
15503 ":define") d_getspnam_r_proto=define
15504 set d_getspnam_r_proto getspnam_r $hdrs
15508 case "$d_getspnam_r_proto" in
15510 case "$getspnam_r_proto" in
15511 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15512 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15514 case "$getspnam_r_proto" in
15515 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15516 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15518 case "$getspnam_r_proto" in
15519 ''|0) d_getspnam_r=undef
15521 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15522 * ) case "$getspnam_r_proto" in
15523 REENTRANT_PROTO*) ;;
15524 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15526 echo "Prototype: $try" ;;
15529 *) case "$usethreads" in
15530 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15537 *) getspnam_r_proto=0
15541 : see if gettimeofday or ftime exists
15542 set gettimeofday d_gettimeod
15544 case "$d_gettimeod" in
15550 val="$undef"; set d_ftime; eval $setvar
15553 case "$d_gettimeod$d_ftime" in
15556 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15560 : see if gmtime_r exists
15561 set gmtime_r d_gmtime_r
15563 case "$d_gmtime_r" in
15565 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15566 case "$d_gmtime_r_proto:$usethreads" in
15567 ":define") d_gmtime_r_proto=define
15568 set d_gmtime_r_proto gmtime_r $hdrs
15572 case "$d_gmtime_r_proto" in
15574 case "$gmtime_r_proto" in
15575 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15576 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15578 case "$gmtime_r_proto" in
15579 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15580 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15582 case "$gmtime_r_proto" in
15583 ''|0) d_gmtime_r=undef
15585 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15586 * ) case "$gmtime_r_proto" in
15587 REENTRANT_PROTO*) ;;
15588 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15590 echo "Prototype: $try" ;;
15593 *) case "$usethreads" in
15594 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15601 *) gmtime_r_proto=0
15605 : see if hasmntopt exists
15606 set hasmntopt d_hasmntopt
15609 : see if this is a netinet/in.h or sys/in.h system
15610 set netinet/in.h i_niin sys/in.h i_sysin
15613 : see if arpa/inet.h has to be included
15614 set arpa/inet.h i_arpainet
15617 : see if htonl --and friends-- exists
15622 : Maybe they are macros.
15625 $cat >htonl.c <<EOM
15627 #include <sys/types.h>
15628 #$i_niin I_NETINET_IN
15630 #$i_arpainet I_ARPA_INET
15631 #ifdef I_NETINET_IN
15632 #include <netinet/in.h>
15635 #include <sys/in.h>
15638 #include <arpa/inet.h>
15641 printf("Defined as a macro.");
15644 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15645 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15647 echo "But it seems to be defined as a macro." >&4
15655 : see if hypot exists
15659 : see if ilogb exists
15663 : see if ilogbl exists
15664 set ilogbl d_ilogbl
15669 if set index val -f; eval $csym; $val; then
15670 if set strchr val -f d_strchr; eval $csym; $val; then
15671 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15674 echo "strchr() found." >&4
15678 echo "index() found." >&4
15683 echo "index() found." >&4
15686 if set strchr val -f d_strchr; eval $csym; $val; then
15689 echo "strchr() found." >&4
15691 echo "No index() or strchr() found!" >&4
15696 set d_strchr; eval $setvar
15698 set d_index; eval $setvar
15700 : check whether inet_aton exists
15701 set inet_aton d_inetaton
15704 : see if inet_ntop exists
15705 set inet_ntop d_inetntop
15708 : see if inet_pton exists
15709 set inet_pton d_inetpton
15714 $cat >isascii.c <<EOCP
15717 #$i_stdlib I_STDLIB
15719 #include <stdlib.h>
15730 if eval $compile; then
15731 echo "isascii() found." >&4
15734 echo "isascii() NOT found." >&4
15743 $cat >isblank.c <<'EOCP'
15754 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15755 echo "isblank() found." >&4
15758 echo "isblank() NOT found." >&4
15765 : check for isfinite
15766 echo "Checking to see if you have isfinite..." >&4
15772 int main() { return isfinite(0.0); }
15775 if eval $compile; then
15777 echo "You have isfinite."
15780 echo "You do not have isfinite."
15786 : see if isfinitel exists
15787 set isfinitel d_isfinitel
15791 echo "Checking to see if you have isinf..." >&4
15797 int main() { return isinf(0.0); }
15800 if eval $compile; then
15802 echo "You have isinf."
15805 echo "You do not have isinf."
15811 : see if isinfl exists
15812 set isinfl d_isinfl
15816 echo "Checking to see if you have isless..." >&4
15822 int main() { return isless(0.0); }
15825 if eval $compile; then
15827 echo "You have isless."
15830 echo "You do not have isless."
15837 echo "Checking to see if you have isnan..." >&4
15843 int main() { return isnan(0.0); }
15846 if eval $compile; then
15848 echo "You have isnan."
15851 echo "You do not have isnan."
15857 : see if isnanl exists
15858 set isnanl d_isnanl
15861 : check for isnormal
15862 echo "Checking to see if you have isnormal..." >&4
15868 int main() { return isnormal(0.0); }
15871 if eval $compile; then
15873 echo "You have isnormal."
15876 echo "You do not have isnormal."
15886 : see if j0l exists
15890 : see if killpg exists
15891 set killpg d_killpg
15894 : see if localeconv exists
15895 set localeconv d_locconv
15898 : see if libc has the POSIX.1-2008 currency locale rules
15899 case "$d_locconv:$d_lc_monetary_2008" in
15902 #include <locale.h>
15904 struct lconv *lc = localeconv();
15905 char int_p_cs_precedes = lc->int_p_cs_precedes;
15910 if eval $compile; then
15911 d_lc_monetary_2008="$define"
15913 d_lc_monetary_2008="$undef"
15919 : see if lchown exists
15921 $cat > try.c <<'EOCP'
15922 /* System header to define __stub macros and hopefully few prototypes,
15923 which can conflict with char lchown(); below. */
15924 #include <assert.h>
15925 /* Override any gcc2 internal prototype to avoid an error. */
15926 /* We use char because int might match the return type of a gcc2
15927 builtin and then its argument prototype would still apply. */
15930 /* The GNU C library defines this for functions which it implements
15931 to always fail with ENOSYS. Some functions are actually named
15932 something starting with __ and the normal name is an alias. */
15933 #if defined (__stub_lchown) || defined (__stub___lchown)
15941 if eval $compile; then
15942 $echo "lchown() found." >&4
15945 $echo "lchown() NOT found." >&4
15951 : See if number of significant digits in a double precision number is known
15953 $cat >ldbl_dig.c <<EOM
15954 #$i_limits I_LIMITS
15957 #include <limits.h>
15963 printf("Contains LDBL_DIG");
15966 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15967 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15968 echo "LDBL_DIG found." >&4
15971 echo "LDBL_DIG NOT found." >&4
15978 : see if lgamma exists
15979 set lgamma d_lgamma
15982 : see if lgamma_r exists
15983 set lgamma_r d_lgamma_r
15986 : check to see if math.h defines _LIB_VERSION
15987 d_libm_lib_version="$undef"
15991 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15993 #include <unistd.h>
15995 int main (int argc, char *argv[])
15997 printf ("%d\n", _LIB_VERSION);
16002 if eval $compile; then
16004 echo "Yes, it does ($foo)" >&4
16005 d_libm_lib_version="$define"
16007 echo "No, it does not (probably harmless)" >&4
16014 : see if link exists
16018 : see if llrint exists
16019 set llrint d_llrint
16022 : see if llround exists
16023 set llround d_llround
16026 : see if localtime_r exists
16027 set localtime_r d_localtime_r
16029 case "$d_localtime_r" in
16031 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16032 case "$d_localtime_r_proto:$usethreads" in
16033 ":define") d_localtime_r_proto=define
16034 set d_localtime_r_proto localtime_r $hdrs
16038 case "$d_localtime_r_proto" in
16040 case "$localtime_r_proto" in
16041 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16042 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16044 case "$localtime_r_proto" in
16045 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16046 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16048 case "$localtime_r_proto" in
16049 ''|0) d_localtime_r=undef
16050 localtime_r_proto=0
16051 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16052 * ) case "$localtime_r_proto" in
16053 REENTRANT_PROTO*) ;;
16054 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16056 echo "Prototype: $try" ;;
16059 *) case "$usethreads" in
16060 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16062 d_localtime_r=undef
16063 localtime_r_proto=0
16067 *) localtime_r_proto=0
16071 : see if localtime_r calls tzset
16072 case "$localtime_r_proto" in
16075 /* Does our libc's localtime_r call tzset ?
16076 * return 0 if so, 1 otherwise.
16078 #$i_systypes I_SYS_TYPES
16079 #$i_unistd I_UNISTD
16081 #$i_stdlib I_STDLIB
16082 #$i_string I_STRING
16083 #$i_malloc I_MALLOC
16085 # include <sys/types.h>
16088 # include <unistd.h>
16094 #include <stdlib.h>
16097 # include <string.h>
16099 # include <strings.h>
16102 # include <malloc.h>
16106 time_t t = time(0L);
16107 char w_tz[]="TZ" "=GMT+5",
16108 e_tz[]="TZ" "=GMT-5",
16109 *tz_e = (char*)malloc(16),
16110 *tz_w = (char*)malloc(16);
16111 struct tm tm_e, tm_w;
16112 memset(&tm_e,'\0',sizeof(struct tm));
16113 memset(&tm_w,'\0',sizeof(struct tm));
16118 localtime_r(&t, &tm_e);
16121 localtime_r(&t, &tm_w);
16123 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16129 if eval $compile; then
16130 if $run ./try; then
16131 d_localtime_r_needs_tzset=undef;
16133 d_localtime_r_needs_tzset=define;
16136 d_localtime_r_needs_tzset=undef;
16140 d_localtime_r_needs_tzset=undef;
16145 : see if lockf exists
16149 : see if log1p exists
16153 : see if log2 exists
16157 : see if logb exists
16161 : see if lrint exists
16165 : see if lround exists
16166 set lround d_lround
16169 : see if prototype for lseek is available
16171 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16174 : see if lstat exists
16178 : see if madvise exists
16179 set madvise d_madvise
16182 : see if malloc_size exists
16183 set malloc_size d_malloc_size
16186 : see if malloc_size_good exists
16187 set malloc_good_size d_malloc_good_size
16190 : see if mblen exists
16194 : see if mbstowcs exists
16195 set mbstowcs d_mbstowcs
16198 : see if mbtowc exists
16199 set mbtowc d_mbtowc
16202 : see if memchr exists
16203 set memchr d_memchr
16206 : see if memcmp exists
16207 set memcmp d_memcmp
16210 : see if memcpy exists
16211 set memcpy d_memcpy
16214 : see if memmove exists
16215 set memmove d_memmove
16218 : see if memset exists
16219 set memset d_memset
16222 : see if mkdir exists
16226 : see if mkdtemp exists
16227 set mkdtemp d_mkdtemp
16230 : see if mkfifo exists
16231 set mkfifo d_mkfifo
16234 : see if mkstemp exists
16235 set mkstemp d_mkstemp
16238 : see if mkstemps exists
16239 set mkstemps d_mkstemps
16242 : see if mktime exists
16243 set mktime d_mktime
16246 : see if this is a sys/mman.h system
16247 set sys/mman.h i_sysmman
16250 : see if mmap exists
16253 : see what shmat returns
16254 : default to something harmless
16256 case "$i_sysmman$d_mmap" in
16258 $cat >mmap.c <<'END'
16259 #include <sys/mman.h>
16262 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16267 echo "and it returns ($mmaptype)." >&4
16273 : see if sqrtl exists
16277 : see if scalbnl exists
16278 set scalbnl d_scalbnl
16281 : see if truncl exists
16282 set truncl d_truncl
16285 : see if modfl exists
16289 : see if prototype for modfl is available
16291 set d_modflproto modfl $i_math math.h
16294 d_modfl_pow32_bug="$undef"
16296 case "$d_longdbl$d_modfl" in
16299 Checking to see whether your modfl() is okay for large values...
16305 if $test "X$d_modflproto" != "X$define"; then
16306 $cat >>try.c <<EOCP
16307 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16308 long double modfl (long double, long double *);
16311 $cat >>try.c <<EOCP
16313 long double nv = 4294967303.15;
16319 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16323 case "$osname:$gccversion" in
16324 aix:) saveccflags="$ccflags"
16325 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16328 if eval $compile; then
16331 *" 4294967303.150000 1.150000 4294967302.000000")
16332 echo >&4 "Your modfl() is broken for large values."
16333 d_modfl_pow32_bug="$define"
16335 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16339 *" 4294967303.150000 0.150000 4294967303.000000")
16340 echo >&4 "Your modfl() seems okay for large values."
16342 *) echo >&4 "I don't understand your modfl() at all."
16348 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16351 case "$osname:$gccversion" in
16352 aix:) ccflags="$saveccflags" ;; # restore
16357 if $test "$uselongdouble" = "$define"; then
16359 if $test "$d_sqrtl" != "$define"; then
16360 message="$message sqrtl"
16362 if $test "$d_modfl" != "$define"; then
16363 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16364 echo "You have both truncl and copysignl, so I can emulate modfl."
16366 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16367 echo "You have both aintl and copysignl, so I can emulate modfl."
16369 message="$message modfl"
16373 if $test "$d_frexpl" != "$define"; then
16374 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16375 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16377 message="$message frexpl"
16380 if $test "$d_ldexpl" != "$define"; then
16381 message="$message ldexpl"
16384 if $test "$message" != ""; then
16387 *** You requested the use of long doubles but you do not seem to have
16388 *** the following mathematical functions needed for long double support:
16390 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16391 *** Cannot continue, aborting.
16399 : see if mprotect exists
16400 set mprotect d_mprotect
16403 : see if msgctl exists
16404 set msgctl d_msgctl
16407 : see if msgget exists
16408 set msgget d_msgget
16411 : see if msgsnd exists
16412 set msgsnd d_msgsnd
16415 : see if msgrcv exists
16416 set msgrcv d_msgrcv
16419 : see how much of the 'msg*(2)' library is present.
16422 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16423 *"$undef"*) h_msg=false;;
16427 case "`ipcs 2>&1`" in
16428 "SVID messages"*"not configured"*)
16429 echo "Your $osname does not have the msg*(2) configured." >&4
16432 set msgctl d_msgctl
16434 set msgget d_msgget
16436 set msgsnd d_msgsnd
16438 set msgrcv d_msgrcv
16444 : we could also check for sys/ipc.h ...
16445 if $h_msg && $test `./findhdr sys/msg.h`; then
16446 echo "You have the full msg*(2) library." >&4
16449 echo "You don't have the full msg*(2) library." >&4
16455 : Check for msghdr_s
16457 echo "Checking to see if your system supports struct msghdr..." >&4
16458 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16460 case "$d_msghdr_s" in
16461 "$define") echo "Yes, it does." ;;
16462 *) echo "No, it doesn't." ;;
16466 : see if msync exists
16470 : see if munmap exists
16471 set munmap d_munmap
16474 : see if nan exists
16478 : see if nearbyint exists
16479 set nearbyint d_nearbyint
16482 : see if nextafter exists
16483 set nextafter d_nextafter
16486 : see if nexttoward exists
16487 set nexttoward d_nexttoward
16490 : see if nice exists
16494 : see if this is a langinfo.h system
16495 set langinfo.h i_langinfo
16498 : see if nl_langinfo exists
16499 set nl_langinfo d_nl_langinfo
16502 : see if this is a quadmath.h system
16503 set quadmath.h i_quadmath
16506 : check for volatile keyword
16508 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16509 $cat >try.c <<'EOCP'
16512 typedef struct _goo_struct goo_struct;
16513 goo_struct * volatile goo = ((goo_struct *)0);
16514 struct _goo_struct {
16519 typedef unsigned short foo_t;
16520 char *volatile foo;
16522 volatile foo_t blech;
16526 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16528 echo "Yup, it does."
16531 echo "Nope, it doesn't."
16537 : Check basic sizes
16539 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16541 case "$use64bitint:$d_quad:$quadtype" in
16544 uvtype="$uquadtype"
16549 uvtype="unsigned long"
16555 case "$uselongdouble:$d_longdbl" in
16557 nvtype="long double"
16558 nvsize=$longdblsize
16565 case "$usequadmath:$i_quadmath" in
16567 nvtype="__float128"
16573 *** You requested the use of the quadmath library, but you
16574 *** do not seem to have the quadmath library installed.
16575 *** Cannot continue, aborting.
16581 define:*) $cat <<EOM >&4
16583 *** You requested the use of the quadmath library, but you
16584 *** do not seem to have the required header, <quadmath.h>.
16586 case "$gccversion" in
16589 *** Your gcc looks a bit old:
16595 *** You are not running a gcc.
16600 *** For the quadmath library you need at least gcc 4.6.
16601 *** Cannot continue, aborting.
16607 $echo "(IV will be "$ivtype", $ivsize bytes)"
16608 $echo "(UV will be "$uvtype", $uvsize bytes)"
16609 $echo "(NV will be "$nvtype", $nvsize bytes)"
16612 #$i_inttypes I_INTTYPES
16614 #include <inttypes.h>
16619 int8_t i = INT8_MAX;
16620 uint8_t u = UINT8_MAX;
16621 printf("int8_t\n");
16624 int16_t i = INT16_MAX;
16625 uint16_t u = UINT16_MAX;
16626 printf("int16_t\n");
16629 int32_t i = INT32_MAX;
16630 uint32_t u = UINT32_MAX;
16631 printf("int32_t\n");
16636 i8type="signed char"
16637 u8type="unsigned char"
16642 '') case "$shortsize" in
16644 u16type="unsigned short"
16652 '') set try -DINT16
16653 if eval $compile; then
16654 case "`$run ./try`" in
16666 '') if $test $shortsize -ge 2; then
16668 u16type="unsigned short"
16676 '') case "$longsize" in
16678 u32type="unsigned long"
16682 *) case "$intsize" in
16684 u32type="unsigned int"
16694 '') set try -DINT32
16695 if eval $compile; then
16696 case "`$run ./try`" in
16708 '') if $test $intsize -ge 4; then
16710 u32type="unsigned int"
16718 '') case "$d_quad:$quadtype" in
16720 i64type="$quadtype"
16721 u64type="$uquadtype"
16729 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16730 : volatile so that the compiler has to store it out to memory.
16731 if test X"$d_volatile" = X"$define"; then
16736 #$i_stdlib I_STDLIB
16738 #include <stdlib.h>
16740 #include <sys/types.h>
16741 #include <signal.h>
16743 $volatile int bletched = 0;
16744 $signal_t blech(int s) { bletched = 1; }
16749 int n = 8 * $uvsize;
16752 signal(SIGFPE, blech);
16755 for (i = 0; i < n; i++) {
16756 u = u << 1 | ($uvtype)1;
16758 if (($uvtype)d != u)
16762 d = ($nvtype)(u - 1);
16763 if (($uvtype)d != (u - 1))
16770 printf("%d\n", ((i == n) ? -n : i));
16776 d_nv_preserves_uv="$undef"
16777 if eval $compile; then
16778 nv_preserves_uv_bits="`$run ./try`"
16780 case "$nv_preserves_uv_bits" in
16782 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16783 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16784 d_nv_preserves_uv="$define"
16786 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16787 d_nv_preserves_uv="$undef" ;;
16788 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16789 nv_preserves_uv_bits="0" ;;
16793 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16794 : volatile so that the compiler has to store it out to memory.
16795 if test X"$d_volatile" = X"$define"; then
16801 typedef $nvtype NV;
16808 while(count < 256) {
16809 $volatile NV up = value + 1.0;
16810 $volatile NV negated = -value;
16811 $volatile NV down = negated - 1.0;
16812 $volatile NV got_up = up - value;
16813 int up_good = got_up == 1.0;
16814 int got_down = down - negated;
16815 int down_good = got_down == -1.0;
16817 if (down_good != up_good) {
16819 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16820 up_good, (double) got_up, down_good, (double) got_down,
16821 count, (double) value);
16828 fputs("256.0", stdout);
16831 fputs("2.0", stdout);
16837 fputs("*", stdout);
16843 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16844 count, (double) value);
16850 nv_overflows_integers_at='0'
16851 if eval $compile; then
16857 The largest integer your NVs can preserve is equal to $xxx
16859 nv_overflows_integers_at="$xxx"
16862 Cannot determine the largest integer value your NVs can hold, unexpected output
16869 Cannot determine the largest integer value your NVs can hold
16876 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16877 : volatile so that the compiler has to store it out to memory.
16878 if test X"$d_volatile" = X"$define"; then
16883 #$i_stdlib I_STDLIB
16885 #include <stdlib.h>
16887 #$i_string I_STRING
16889 # include <string.h>
16891 # include <strings.h>
16893 #include <sys/types.h>
16894 #include <signal.h>
16896 $volatile int bletched = 0;
16897 $signal_t blech(int s) { bletched = 1; }
16900 int checkit($nvtype d, char *where) {
16901 unsigned char *p = (char *)&d;
16902 unsigned char *end = p + sizeof(d);
16912 printf("No - %s: 0x", where);
16914 printf ("%02X", *p++);
16919 int main(int argc, char **argv) {
16922 fail += checkit(d, "0.0");
16924 /* The compiler shouldn't be assuming that bletched is 0 */
16927 fail += checkit(d, "bleched");
16930 signal(SIGFPE, blech);
16933 /* Paranoia - the compiler should have no way of knowing that ANSI says
16934 that argv[argc] will always be NULL. Actually, if it did assume this it
16935 would be buggy, as this is C and main() can be called from elsewhere in
16937 d = argv[argc] ? 1 : 0;
16940 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16943 fail += checkit(d, "ternary");
16945 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16948 printf("No - memset doesn't give 0.0\n");
16949 /* This might just blow up: */
16950 printf("(gives %g)\n", d);
16956 printf("No - something bleched\n");
16961 printf("No - %d fail(s)\n", fail);
16970 d_nv_zero_is_allbits_zero="$undef"
16971 if eval $compile; then
16977 0.0 is represented as all bits zero in memory
16979 d_nv_zero_is_allbits_zero="$define"
16982 0.0 is not represented as all bits zero in memory
16984 d_nv_zero_is_allbits_zero="$undef"
16989 0.0 is not represented as all bits zero in memory
16991 d_nv_zero_is_allbits_zero="$undef"
16997 : check for off64_t
16999 echo "Checking to see if you have off64_t..." >&4
17001 #include <sys/types.h>
17002 #include <unistd.h>
17003 int main() { off64_t x = 7; }
17006 if eval $compile; then
17008 echo "You have off64_t."
17011 echo "You do not have off64_t."
17012 case "$lseeksize" in
17013 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17020 : how to create joinable pthreads
17021 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17023 echo "Checking what constant to use for creating joinable pthreads..." >&4
17024 $cat >try.c <<'EOCP'
17025 #include <pthread.h>
17027 int detachstate = JOINABLE;
17030 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17031 if eval $compile; then
17032 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17033 val="$undef" # Yes, undef.
17034 set d_old_pthread_create_joinable
17037 set old_pthread_create_joinable
17040 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17041 if eval $compile; then
17042 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17044 set d_old_pthread_create_joinable
17046 val=PTHREAD_CREATE_UNDETACHED
17047 set old_pthread_create_joinable
17050 set try -DJOINABLE=__UNDETACHED
17051 if eval $compile; then
17052 echo "You seem to use __UNDETACHED." >&4
17054 set d_old_pthread_create_joinable
17057 set old_pthread_create_joinable
17060 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17062 set d_old_pthread_create_joinable
17065 set old_pthread_create_joinable
17072 d_old_pthread_create_joinable="$undef"
17073 old_pthread_create_joinable=""
17076 : see if pause exists
17080 : see if poll exists
17084 : see if prctl exists
17088 : see if prctl supports PR_SET_NAME
17089 d_prctl_set_name=$undef
17094 #include <unistd.h>
17096 #include <sys/prctl.h>
17098 int main (int argc, char *argv[])
17100 return (prctl (PR_SET_NAME, "Test"));
17104 if eval $compile_ok && $run ./try; then
17105 echo "Your prctl (PR_SET_NAME, ...) works"
17106 d_prctl_set_name=$define
17112 : see if readlink exists
17113 set readlink d_readlink
17116 : Check if exe is symlink to abs path of executing program
17120 case "$d_readlink" in
17122 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
17123 : more tidy to avoid an extra level of symlink
17124 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17125 while test $# -gt 0; do
17128 if $issymlink $try; then
17129 $ls -l $try > reflect
17130 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17131 echo "You have $type-like $try."
17132 procselfexe='"'$try'"'
17134 : This will break out of the loop
17145 : backward compatibility for d_hvfork
17146 if test X$d_hvfork != X; then
17147 d_vfork="$d_hvfork"
17150 : see if there is a vfork
17155 d_pseudofork=$undef
17157 : Ok, but do we want to use it. vfork is reportedly unreliable in
17158 : perl on Solaris 2.x, and probably elsewhere.
17162 case "$usevfork" in
17168 Perl can only use a vfork() that doesn't suffer from strict
17169 restrictions on calling functions or modifying global data in
17170 the child. For example, glibc-2.1 contains such a vfork()
17171 that is unsuitable. If your system provides a proper fork()
17172 call, chances are that you do NOT want perl to use vfork().
17175 rp="Do you still want to use vfork()?"
17180 echo "Ok, we won't use vfork()."
17189 $define) usevfork='true';;
17190 *) usevfork='false';;
17193 : see whether the pthread_atfork exists
17195 #include <pthread.h>
17198 #ifdef PTHREAD_ATFORK
17199 pthread_atfork(NULL,NULL,NULL);
17204 : see if pthread_atfork exists
17205 set try -DPTHREAD_ATFORK
17206 if eval $compile; then
17211 case "$usethreads" in
17214 $define) echo 'pthread_atfork found.' >&4 ;;
17215 *) echo 'pthread_atfork NOT found.' >&4 ;;
17218 set d_pthread_atfork
17221 : see if pthread_attr_setscope exists
17222 set pthread_attr_setscope d_pthread_attr_setscope
17225 : see whether the various POSIXish _yields exist
17227 #include <pthread.h>
17233 #ifdef PTHREAD_YIELD
17236 #ifdef PTHREAD_YIELD_NULL
17237 pthread_yield(NULL);
17243 : see if sched_yield exists
17244 set try -DSCHED_YIELD
17245 if eval $compile; then
17247 sched_yield='sched_yield()'
17251 case "$usethreads" in
17254 $define) echo 'sched_yield() found.' >&4 ;;
17255 *) echo 'sched_yield() NOT found.' >&4 ;;
17261 : see if pthread_yield exists
17262 set try -DPTHREAD_YIELD
17263 if eval $compile; then
17265 case "$sched_yield" in
17266 '') sched_yield='pthread_yield()' ;;
17269 set try -DPTHREAD_YIELD_NULL
17270 if eval $compile; then
17272 case "$sched_yield" in
17273 '') sched_yield='pthread_yield(NULL)' ;;
17279 case "$usethreads" in
17282 $define) echo 'pthread_yield() found.' >&4 ;;
17283 *) echo 'pthread_yield() NOT found.' >&4 ;;
17287 set d_pthread_yield
17289 case "$sched_yield" in
17290 '') sched_yield=undef ;;
17294 : check for ptrdiff_t
17296 echo "Checking to see if you have ptrdiff_t..." >&4
17298 #include <stddef.h>
17299 int main() { ptrdiff_t x = 7; }
17302 if eval $compile; then
17304 echo "You have ptrdiff_t."
17307 echo "You do not have ptrdiff_t."
17313 : see if random_r exists
17314 set random_r d_random_r
17316 case "$d_random_r" in
17318 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17319 case "$d_random_r_proto:$usethreads" in
17320 ":define") d_random_r_proto=define
17321 set d_random_r_proto random_r $hdrs
17325 case "$d_random_r_proto" in
17327 case "$random_r_proto" in
17328 ''|0) try='int random_r(int*, struct random_data*);'
17329 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17331 case "$random_r_proto" in
17332 ''|0) try='int random_r(long*, struct random_data*);'
17333 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17335 case "$random_r_proto" in
17336 ''|0) try='int random_r(struct random_data*, int32_t*);'
17337 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17339 case "$random_r_proto" in
17340 ''|0) d_random_r=undef
17342 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17343 * ) case "$random_r_proto" in
17344 REENTRANT_PROTO*) ;;
17345 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17347 echo "Prototype: $try" ;;
17350 *) case "$usethreads" in
17351 define) echo "random_r has no prototype, not using it." >&4 ;;
17358 *) random_r_proto=0
17362 : see if readdir and friends exist
17363 set readdir d_readdir
17365 set seekdir d_seekdir
17367 set telldir d_telldir
17369 set rewinddir d_rewinddir
17372 : see if readdir64_r exists
17373 set readdir64_r d_readdir64_r
17375 case "$d_readdir64_r" in
17377 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17378 case "$d_readdir64_r_proto:$usethreads" in
17379 ":define") d_readdir64_r_proto=define
17380 set d_readdir64_r_proto readdir64_r $hdrs
17384 case "$d_readdir64_r_proto" in
17386 case "$readdir64_r_proto" in
17387 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17388 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17390 case "$readdir64_r_proto" in
17391 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17392 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17394 case "$readdir64_r_proto" in
17395 ''|0) d_readdir64_r=undef
17396 readdir64_r_proto=0
17397 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17398 * ) case "$readdir64_r_proto" in
17399 REENTRANT_PROTO*) ;;
17400 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17402 echo "Prototype: $try" ;;
17405 *) case "$usethreads" in
17406 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17408 d_readdir64_r=undef
17409 readdir64_r_proto=0
17413 *) readdir64_r_proto=0
17417 : see if readdir_r exists
17418 set readdir_r d_readdir_r
17420 case "$d_readdir_r" in
17422 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17423 case "$d_readdir_r_proto:$usethreads" in
17424 ":define") d_readdir_r_proto=define
17425 set d_readdir_r_proto readdir_r $hdrs
17429 case "$d_readdir_r_proto" in
17431 case "$readdir_r_proto" in
17432 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17433 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17435 case "$readdir_r_proto" in
17436 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17437 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17439 case "$readdir_r_proto" in
17440 ''|0) d_readdir_r=undef
17442 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17443 * ) case "$readdir_r_proto" in
17444 REENTRANT_PROTO*) ;;
17445 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17447 echo "Prototype: $try" ;;
17450 *) case "$usethreads" in
17451 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17458 *) readdir_r_proto=0
17462 : see if readv exists
17466 : see if recvmsg exists
17467 set recvmsg d_recvmsg
17470 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17472 if set regcomp val -f d_regcomp; eval $csym; $val; then
17473 echo 'regcomp() found.' >&4
17474 d_regcomp="$define"
17477 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17478 echo 'regcmp() found.' >&4
17482 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17483 echo 're_comp() found, assuming re_exec() also exists.' >&4
17484 d_re_comp="$define"
17489 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17496 : see if remainder exists
17497 set remainder d_remainder
17500 : see if remquo exists
17501 set remquo d_remquo
17504 : see if rename exists
17505 set rename d_rename
17508 : see if rint exists
17512 : see if rmdir exists
17516 : see if round exists
17520 : see if memory.h is available.
17525 : See if it conflicts with string.h
17531 $cppstdin $cppflags $cppminus < $strings > mem.h
17532 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17534 echo "We won't be including <memory.h>."
17544 : can bcopy handle overlapping blocks?
17547 case "$d_memmove" in
17548 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17549 *) case "$d_bcopy" in
17551 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17553 #$i_memory I_MEMORY
17554 #$i_stdlib I_STDLIB
17555 #$i_string I_STRING
17556 #$i_unistd I_UNISTD
17558 $cat >>try.c <<'EOCP'
17561 # include <memory.h>
17564 # include <stdlib.h>
17567 # include <string.h>
17569 # include <strings.h>
17572 # include <unistd.h> /* Needed for NetBSD */
17576 char buf[128], abc[128];
17582 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17583 try to store the string in read-only memory. */
17584 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17586 for (align = 7; align >= 0; align--) {
17587 for (len = 36; len; len--) {
17589 bcopy(abc, b, len);
17590 for (off = 1; off <= len; off++) {
17591 bcopy(b, b+off, len);
17592 bcopy(b+off, b, len);
17593 if (bcmp(b, abc, len))
17602 if eval $compile_ok; then
17603 if $run ./try 2>/dev/null; then
17604 echo "Yes, it can."
17607 echo "It can't, sorry."
17610 echo "(I can't compile the test program, so we'll assume not...)"
17620 : can memcpy handle overlapping blocks?
17623 case "$d_memmove" in
17624 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17625 *) case "$d_memcpy" in
17627 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17629 #$i_memory I_MEMORY
17630 #$i_stdlib I_STDLIB
17631 #$i_string I_STRING
17632 #$i_unistd I_UNISTD
17634 $cat >>try.c <<'EOCP'
17637 # include <memory.h>
17640 # include <stdlib.h>
17643 # include <string.h>
17645 # include <strings.h>
17648 # include <unistd.h> /* Needed for NetBSD */
17652 char buf[128], abc[128];
17658 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17659 try to store the string in read-only memory. */
17660 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17662 for (align = 7; align >= 0; align--) {
17663 for (len = 36; len; len--) {
17665 memcpy(b, abc, len);
17666 for (off = 1; off <= len; off++) {
17667 memcpy(b+off, b, len);
17668 memcpy(b, b+off, len);
17669 if (memcmp(b, abc, len))
17678 if eval $compile_ok; then
17679 if $run ./try 2>/dev/null; then
17680 echo "Yes, it can."
17683 echo "It can't, sorry."
17686 echo "(I can't compile the test program, so we'll assume not...)"
17696 : can memcmp be trusted to compare relative magnitude?
17698 case "$d_memcmp" in
17701 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17703 #$i_memory I_MEMORY
17704 #$i_stdlib I_STDLIB
17705 #$i_string I_STRING
17706 #$i_unistd I_UNISTD
17708 $cat >>try.c <<'EOCP'
17711 # include <memory.h>
17714 # include <stdlib.h>
17717 # include <string.h>
17719 # include <strings.h>
17722 # include <unistd.h> /* Needed for NetBSD */
17728 if ((a < b) && memcmp(&a, &b, 1) < 0)
17734 if eval $compile_ok; then
17735 if $run ./try 2>/dev/null; then
17736 echo "Yes, it can."
17739 echo "No, it can't (it uses signed chars)."
17742 echo "(I can't compile the test program, so we'll assume not...)"
17750 : see if prototype for sbrk is available
17752 set d_sbrkproto sbrk $i_unistd unistd.h
17755 : see if scalbn exists
17756 set scalbn d_scalbn
17759 : see if select exists
17760 set select d_select
17763 : see if semctl exists
17764 set semctl d_semctl
17767 : see if semget exists
17768 set semget d_semget
17771 : see if semop exists
17775 : see how much of the 'sem*(2)' library is present.
17778 case "$d_semctl$d_semget$d_semop" in
17779 *"$undef"*) h_sem=false;;
17783 case "`ipcs 2>&1`" in
17784 "SVID messages"*"not configured"*)
17785 echo "Your $osname does not have the sem*(2) configured." >&4
17788 set semctl d_semctl
17790 set semget d_semget
17798 : we could also check for sys/ipc.h ...
17799 if $h_sem && $test `./findhdr sys/sem.h`; then
17800 echo "You have the full sem*(2) library." >&4
17803 echo "You don't have the full sem*(2) library." >&4
17809 : see whether sys/sem.h defines union semun
17811 $cat > try.c <<'END'
17812 #include <sys/types.h>
17813 #include <sys/ipc.h>
17814 #include <sys/sem.h>
17815 int main () { union semun semun; semun.buf = 0; }
17818 if eval $compile; then
17819 echo "You have union semun in <sys/sem.h>." >&4
17822 echo "You do not have union semun in <sys/sem.h>." >&4
17829 : see how to do semctl IPC_STAT
17833 $cat > tryh.h <<END
17836 # define S_IRUSR S_IREAD
17837 # define S_IWUSR S_IWRITE
17838 # define S_IXUSR S_IEXEC
17840 # define S_IRUSR 0400
17841 # define S_IWUSR 0200
17842 # define S_IXUSR 0100
17844 # define S_IRGRP (S_IRUSR>>3)
17845 # define S_IWGRP (S_IWUSR>>3)
17846 # define S_IXGRP (S_IXUSR>>3)
17847 # define S_IROTH (S_IRUSR>>6)
17848 # define S_IWOTH (S_IWUSR>>6)
17849 # define S_IXOTH (S_IXUSR>>6)
17852 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17853 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17854 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17857 : see whether semctl IPC_STAT can use union semun
17858 case "$d_semctl_semun" in
17862 #include <sys/types.h>
17863 #include <sys/ipc.h>
17864 #include <sys/sem.h>
17865 #include <sys/stat.h>
17872 #$d_union_semun HAS_UNION_SEMUN
17875 #ifndef HAS_UNION_SEMUN
17878 struct semid_ds *buf;
17879 unsigned short *array;
17885 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17886 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17888 struct semid_ds argbuf;
17891 st = semctl(sem, 0, IPC_STAT, arg);
17895 # endif /* IPC_STAT */
17896 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17898 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17899 # endif /* IPC_RMID */
17900 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17902 #endif /* IPC_PRIVATE && ... */
17903 printf("semget failed: errno = %d\n", errno);
17908 if eval $compile; then
17911 semun) val="$define" ;;
17919 case "$d_semctl_semun" in
17921 echo "You can use union semun for semctl IPC_STAT." >&4
17924 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17929 : see whether semctl IPC_STAT can use struct semid_ds pointer
17930 case "$d_semctl_semid_ds" in
17933 $cat > try.c <<'END'
17934 #include <sys/types.h>
17935 #include <sys/ipc.h>
17936 #include <sys/sem.h>
17937 #include <sys/stat.h>
17945 struct semid_ds arg;
17948 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17949 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17952 st = semctl(sem, 0, IPC_STAT, &arg);
17954 printf("semid_ds\n");
17956 # endif /* IPC_STAT */
17957 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17959 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17960 # endif /* IPC_RMID */
17961 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17963 #endif /* IPC_PRIVATE && ... */
17964 printf("semget failed: errno = %d\n", errno);
17970 if eval $compile; then
17973 semid_ds) val="$define" ;;
17977 set d_semctl_semid_ds
17981 case "$d_semctl_semid_ds" in
17983 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17985 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17991 # We do not have the full sem*(2) library, so assume we can not
17997 set d_semctl_semid_ds
18003 : see if sendmsg exists
18004 set sendmsg d_sendmsg
18007 : see if setegid exists
18008 set setegid d_setegid
18011 : see if seteuid exists
18012 set seteuid d_seteuid
18015 : see if setgrent exists
18016 set setgrent d_setgrent
18019 : see if setgrent_r exists
18020 set setgrent_r d_setgrent_r
18022 case "$d_setgrent_r" in
18024 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18025 case "$d_setgrent_r_proto:$usethreads" in
18026 ":define") d_setgrent_r_proto=define
18027 set d_setgrent_r_proto setgrent_r $hdrs
18031 case "$d_setgrent_r_proto" in
18033 case "$setgrent_r_proto" in
18034 ''|0) try='int setgrent_r(FILE**);'
18035 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18037 case "$setgrent_r_proto" in
18038 ''|0) try='void setgrent_r(FILE**);'
18039 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18041 case "$setgrent_r_proto" in
18042 ''|0) d_setgrent_r=undef
18044 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18045 * ) case "$setgrent_r_proto" in
18046 REENTRANT_PROTO*) ;;
18047 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18049 echo "Prototype: $try" ;;
18052 *) case "$usethreads" in
18053 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18060 *) setgrent_r_proto=0
18064 : see if sethostent exists
18065 set sethostent d_sethent
18068 : see if sethostent_r exists
18069 set sethostent_r d_sethostent_r
18071 case "$d_sethostent_r" in
18073 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18074 case "$d_sethostent_r_proto:$usethreads" in
18075 ":define") d_sethostent_r_proto=define
18076 set d_sethostent_r_proto sethostent_r $hdrs
18080 case "$d_sethostent_r_proto" in
18082 case "$sethostent_r_proto" in
18083 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18084 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18086 case "$sethostent_r_proto" in
18087 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18088 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18090 case "$sethostent_r_proto" in
18091 ''|0) d_sethostent_r=undef
18092 sethostent_r_proto=0
18093 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18094 * ) case "$sethostent_r_proto" in
18095 REENTRANT_PROTO*) ;;
18096 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18098 echo "Prototype: $try" ;;
18101 *) case "$usethreads" in
18102 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18104 d_sethostent_r=undef
18105 sethostent_r_proto=0
18109 *) sethostent_r_proto=0
18113 : see if setitimer exists
18114 set setitimer d_setitimer
18117 : see if setlinebuf exists
18118 set setlinebuf d_setlinebuf
18121 : see if setlocale exists
18122 set setlocale d_setlocale
18125 : see if locale.h is available
18126 set locale.h i_locale
18129 : see if setlocale_r exists
18130 set setlocale_r d_setlocale_r
18132 case "$d_setlocale_r" in
18134 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18135 case "$d_setlocale_r_proto:$usethreads" in
18136 ":define") d_setlocale_r_proto=define
18137 set d_setlocale_r_proto setlocale_r $hdrs
18141 case "$d_setlocale_r_proto" in
18143 case "$setlocale_r_proto" in
18144 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18145 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18147 case "$setlocale_r_proto" in
18148 ''|0) d_setlocale_r=undef
18149 setlocale_r_proto=0
18150 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18151 * ) case "$setlocale_r_proto" in
18152 REENTRANT_PROTO*) ;;
18153 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18155 echo "Prototype: $try" ;;
18158 *) case "$usethreads" in
18159 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18161 d_setlocale_r=undef
18162 setlocale_r_proto=0
18166 *) setlocale_r_proto=0
18170 : see if setnetent exists
18171 set setnetent d_setnent
18174 : see if setnetent_r exists
18175 set setnetent_r d_setnetent_r
18177 case "$d_setnetent_r" in
18179 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18180 case "$d_setnetent_r_proto:$usethreads" in
18181 ":define") d_setnetent_r_proto=define
18182 set d_setnetent_r_proto setnetent_r $hdrs
18186 case "$d_setnetent_r_proto" in
18188 case "$setnetent_r_proto" in
18189 ''|0) try='int setnetent_r(int, struct netent_data*);'
18190 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18192 case "$setnetent_r_proto" in
18193 ''|0) try='void setnetent_r(int, struct netent_data*);'
18194 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18196 case "$setnetent_r_proto" in
18197 ''|0) d_setnetent_r=undef
18198 setnetent_r_proto=0
18199 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18200 * ) case "$setnetent_r_proto" in
18201 REENTRANT_PROTO*) ;;
18202 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18204 echo "Prototype: $try" ;;
18207 *) case "$usethreads" in
18208 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18210 d_setnetent_r=undef
18211 setnetent_r_proto=0
18215 *) setnetent_r_proto=0
18219 : see if setprotoent exists
18220 set setprotoent d_setpent
18223 : see if setpgid exists
18224 set setpgid d_setpgid
18227 : see if setpgrp2 exists
18228 set setpgrp2 d_setpgrp2
18231 : see if setpriority exists
18232 set setpriority d_setprior
18235 : see if setproctitle exists
18236 set setproctitle d_setproctitle
18239 : see if setprotoent_r exists
18240 set setprotoent_r d_setprotoent_r
18242 case "$d_setprotoent_r" in
18244 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18245 case "$d_setprotoent_r_proto:$usethreads" in
18246 ":define") d_setprotoent_r_proto=define
18247 set d_setprotoent_r_proto setprotoent_r $hdrs
18251 case "$d_setprotoent_r_proto" in
18253 case "$setprotoent_r_proto" in
18254 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18255 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18257 case "$setprotoent_r_proto" in
18258 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18259 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18261 case "$setprotoent_r_proto" in
18262 ''|0) d_setprotoent_r=undef
18263 setprotoent_r_proto=0
18264 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18265 * ) case "$setprotoent_r_proto" in
18266 REENTRANT_PROTO*) ;;
18267 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18269 echo "Prototype: $try" ;;
18272 *) case "$usethreads" in
18273 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18275 d_setprotoent_r=undef
18276 setprotoent_r_proto=0
18280 *) setprotoent_r_proto=0
18284 : see if setpwent exists
18285 set setpwent d_setpwent
18288 : see if setpwent_r exists
18289 set setpwent_r d_setpwent_r
18291 case "$d_setpwent_r" in
18293 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18294 case "$d_setpwent_r_proto:$usethreads" in
18295 ":define") d_setpwent_r_proto=define
18296 set d_setpwent_r_proto setpwent_r $hdrs
18300 case "$d_setpwent_r_proto" in
18302 case "$setpwent_r_proto" in
18303 ''|0) try='int setpwent_r(FILE**);'
18304 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18306 case "$setpwent_r_proto" in
18307 ''|0) try='void setpwent_r(FILE**);'
18308 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18310 case "$setpwent_r_proto" in
18311 ''|0) d_setpwent_r=undef
18313 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18314 * ) case "$setpwent_r_proto" in
18315 REENTRANT_PROTO*) ;;
18316 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18318 echo "Prototype: $try" ;;
18321 *) case "$usethreads" in
18322 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18329 *) setpwent_r_proto=0
18333 : see if setregid exists
18334 set setregid d_setregid
18336 set setresgid d_setresgid
18339 : see if setreuid exists
18340 set setreuid d_setreuid
18342 set setresuid d_setresuid
18345 : see if setrgid exists
18346 set setrgid d_setrgid
18349 : see if setruid exists
18350 set setruid d_setruid
18353 : see if setservent exists
18354 set setservent d_setsent
18357 : see if setservent_r exists
18358 set setservent_r d_setservent_r
18360 case "$d_setservent_r" in
18362 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18363 case "$d_setservent_r_proto:$usethreads" in
18364 ":define") d_setservent_r_proto=define
18365 set d_setservent_r_proto setservent_r $hdrs
18369 case "$d_setservent_r_proto" in
18371 case "$setservent_r_proto" in
18372 ''|0) try='int setservent_r(int, struct servent_data*);'
18373 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18375 case "$setservent_r_proto" in
18376 ''|0) try='void setservent_r(int, struct servent_data*);'
18377 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18379 case "$setservent_r_proto" in
18380 ''|0) d_setservent_r=undef
18381 setservent_r_proto=0
18382 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18383 * ) case "$setservent_r_proto" in
18384 REENTRANT_PROTO*) ;;
18385 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18387 echo "Prototype: $try" ;;
18390 *) case "$usethreads" in
18391 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18393 d_setservent_r=undef
18394 setservent_r_proto=0
18398 *) setservent_r_proto=0
18402 : see if setsid exists
18403 set setsid d_setsid
18406 : see if setvbuf exists
18407 set setvbuf d_setvbuf
18410 : see if shmctl exists
18411 set shmctl d_shmctl
18414 : see if shmget exists
18415 set shmget d_shmget
18418 : see if shmat exists
18421 : see what shmat returns
18424 $cat >shmat.c <<'END'
18425 #include <sys/shm.h>
18428 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18433 echo "and it returns ($shmattype)." >&4
18434 : see if a prototype for shmat is available
18435 xxx=`./findhdr sys/shm.h`
18436 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18437 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18448 set d_shmatprototype
18451 : see if shmdt exists
18455 : see how much of the 'shm*(2)' library is present.
18458 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18459 *"$undef"*) h_shm=false;;
18463 case "`ipcs 2>&1`" in
18464 "SVID shared memory"*"not configured"*)
18465 echo "Your $osname does not have the shm*(2) configured." >&4
18468 set shmctl d_shmctl
18470 set shmget d_shmget
18480 : we could also check for sys/ipc.h ...
18481 if $h_shm && $test `./findhdr sys/shm.h`; then
18482 echo "You have the full shm*(2) library." >&4
18485 echo "You don't have the full shm*(2) library." >&4
18491 : see if we have sigaction
18493 if set sigaction val -f d_sigaction; eval $csym; $val; then
18494 echo 'sigaction() found.' >&4
18497 #include <sys/types.h>
18498 #include <signal.h>
18499 #$i_stdlib I_STDLIB
18501 #include <stdlib.h>
18505 struct sigaction act, oact;
18507 oact.sa_handler = 0;
18508 /* so that act and oact are used */
18509 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18513 if eval $compile_ok; then
18516 echo "But you don't seem to have a usable struct sigaction." >&4
18520 echo 'sigaction NOT found.' >&4
18523 set d_sigaction; eval $setvar
18526 : see if this is a sunmath.h system
18527 set sunmath.h i_sunmath
18530 : see if signbit exists
18531 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18534 #$i_sunmath I_SUNMATH
18538 #ifdef I_SUNMATH /* Solaris special math library */
18539 # include <sunmath.h>
18542 int main(int argc, char **argv)
18546 if ((signbit(x) == 0) && (signbit(y) != 0))
18554 if eval $compile; then
18555 if $run ./try; then
18559 $echo "Signbit seems to be available, but doesn't work as I expected."
18560 $echo "I won't use it." >&4
18571 : see if sigprocmask exists
18572 set sigprocmask d_sigprocmask
18575 : see if sigsetjmp exists
18577 case "$d_sigsetjmp" in
18580 #include <setjmp.h>
18581 #$i_stdlib I_STDLIB
18583 #include <stdlib.h>
18589 if (sigsetjmp(env,1))
18592 siglongjmp(env, 1);
18597 if eval $compile; then
18598 if $run ./try >/dev/null 2>&1; then
18599 echo "POSIX sigsetjmp found." >&4
18603 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18609 echo "sigsetjmp not found." >&4
18613 *) val="$d_sigsetjmp"
18614 case "$d_sigsetjmp" in
18615 $define) echo "POSIX sigsetjmp found." >&4;;
18616 $undef) echo "sigsetjmp not found." >&4;;
18624 : see if snprintf exists
18625 set snprintf d_snprintf
18628 : see if vsnprintf exists
18629 set vsnprintf d_vsnprintf
18632 case "$d_snprintf-$d_vsnprintf" in
18635 Checking whether your snprintf() and vsnprintf() work okay...
18637 $cat >try.c <<'EOCP'
18638 /* v?snprintf testing logic courtesy of Russ Allbery.
18639 * According to C99:
18640 * - if the buffer is too short it still must be \0-terminated
18641 * - if the buffer is too short the potentially required length
18642 * must be returned and not -1
18643 * - if the buffer is NULL the potentially required length
18644 * must be returned and not -1 or core dump
18647 #include <stdarg.h>
18651 int test (char *format, ...)
18656 va_start (args, format);
18657 count = vsnprintf (buf, sizeof buf, format, args);
18664 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18665 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18669 if eval $compile; then
18672 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18674 Your snprintf() and snprintf() don't seem to be working okay.
18676 d_snprintf="$undef"
18677 d_vsnprintf="$undef"
18681 echo "(I can't seem to compile the test program--assuming they don't)"
18682 d_snprintf="$undef"
18683 d_vsnprintf="$undef"
18689 : see if sockatmark exists
18690 set sockatmark d_sockatmark
18693 : see if prototype for sockatmark is available
18695 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18698 : see if socks5_init exists
18699 set socks5_init d_socks5_init
18702 : see if sprintf returns the length of the string in the buffer as per ANSI
18703 $echo "Checking whether sprintf returns the length of the string..." >&4
18706 #$i_stdlib I_STDLIB
18708 #include <stdlib.h>
18710 #$i_string I_STRING
18712 # include <string.h>
18714 # include <strings.h>
18723 int check (size_t expect, int test) {
18724 size_t got = strlen(buffer);
18728 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18733 int main(int argc, char **argv) {
18736 check(sprintf(buffer, ""), ++test);
18737 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18738 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18745 if eval $compile; then
18749 sprintf returns the length of the string (as ANSI says it should)
18751 d_sprintf_returns_strlen="$define"
18754 sprintf does not return the length of the string (how old is this system?)
18756 d_sprintf_returns_strlen="$undef"
18760 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18761 d_sprintf_returns_strlen="$undef"
18765 : see if srand48_r exists
18766 set srand48_r d_srand48_r
18768 case "$d_srand48_r" in
18770 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18771 case "$d_srand48_r_proto:$usethreads" in
18772 ":define") d_srand48_r_proto=define
18773 set d_srand48_r_proto srand48_r $hdrs
18777 case "$d_srand48_r_proto" in
18779 case "$srand48_r_proto" in
18780 ''|0) try='int srand48_r(long, struct drand48_data*);'
18781 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18783 case "$srand48_r_proto" in
18784 ''|0) d_srand48_r=undef
18786 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18787 * ) case "$srand48_r_proto" in
18788 REENTRANT_PROTO*) ;;
18789 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18791 echo "Prototype: $try" ;;
18794 *) case "$usethreads" in
18795 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18802 *) srand48_r_proto=0
18806 : see if srandom_r exists
18807 set srandom_r d_srandom_r
18809 case "$d_srandom_r" in
18811 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18812 case "$d_srandom_r_proto:$usethreads" in
18813 ":define") d_srandom_r_proto=define
18814 set d_srandom_r_proto srandom_r $hdrs
18818 case "$d_srandom_r_proto" in
18820 case "$srandom_r_proto" in
18821 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18822 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18824 case "$srandom_r_proto" in
18825 ''|0) d_srandom_r=undef
18827 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18828 * ) case "$srandom_r_proto" in
18829 REENTRANT_PROTO*) ;;
18830 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18832 echo "Prototype: $try" ;;
18835 *) case "$usethreads" in
18836 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18843 *) srandom_r_proto=0
18847 : see if prototype for setresgid is available
18849 set d_sresgproto setresgid $i_unistd unistd.h
18852 : see if prototype for setresuid is available
18854 set d_sresuproto setresuid $i_unistd unistd.h
18857 : see if stat exists
18861 : see if sys/stat.h is available
18862 set sys/stat.h i_sysstat
18865 : see if stat knows about block sizes
18867 echo "Checking to see if your struct stat has st_blocks field..." >&4
18868 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18871 : see if this is a sys/vfs.h system
18872 set sys/vfs.h i_sysvfs
18875 : see if this is a sys/statfs.h system
18876 set sys/statfs.h i_sysstatfs
18879 : Check for statfs_s
18881 echo "Checking to see if your system supports struct statfs..." >&4
18882 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
18884 case "$d_statfs_s" in
18885 "$define") echo "Yes, it does." ;;
18886 *) echo "No, it doesn't." ;;
18890 : see if struct statfs knows about f_flags
18891 case "$d_statfs_s" in
18894 echo "Checking to see if your struct statfs has f_flags field..." >&4
18895 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
18899 set d_statfs_f_flags
18903 case "$d_statfs_f_flags" in
18904 "$define") echo "Yes, it does." ;;
18905 *) echo "No, it doesn't." ;;
18908 : see what flavor, if any, of static inline is supported
18910 echo "Checking to see if your system supports static inline..."
18911 $cat > try.c <<'EOCP'
18912 #include <stdlib.h>
18913 extern int f_via_a(int x);
18914 extern int f_via_b(int x);
18915 int main(int argc, char **argv)
18924 return EXIT_SUCCESS;
18927 return EXIT_FAILURE;
18931 $cat > a.c <<'EOCP'
18932 static INLINE int f(int x) {
18943 $cat > b.c <<'EOCP'
18944 extern int f(int x);
18952 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18953 case "$perl_static_inline" in
18954 '') # Check the various possibilities, and break out on success.
18955 # For gcc, prefer __inline__, which will still permit
18956 # cflags.SH to add in -ansi.
18957 case "$gccversion" in
18958 '') xxx="inline __inline__ __inline _inline";;
18959 *) xxx="__inline__ inline __inline _inline";;
18961 for inline in $xxx; do
18962 set try -DINLINE=$inline a.c
18963 if eval $compile && $run ./try; then
18964 # Now make sure there is no external linkage of static
18966 set try -DINLINE=$inline -DUSE_B a.c b.c
18967 if eval $compile && $run ./try; then
18968 $echo "Your compiler supports static $inline, " >&4
18969 $echo "but it also creates an external definition," >&4
18970 $echo "so I won't use it." >&4
18973 $echo "Your compiler supports static $inline." >&4
18975 perl_static_inline="static $inline";
18979 $echo "Your compiler does NOT support static $inline." >&4
18984 *inline*) # Some variant of inline exists.
18985 echo "Keeping your $hint value of $perl_static_inline."
18988 static) # No inline capabilities
18989 echo "Keeping your $hint value of $perl_static_inline."
18992 *) # Unrecognized previous value -- blindly trust the supplied
18993 # value and hope it makes sense. Use old value for
18994 # d_static_inline, if there is one.
18995 echo "Keeping your $hint value of $perl_static_inline."
18996 case "$d_static_inline" in
18998 *) val=$d_static_inline ;;
19002 # Fallback to plain 'static' if nothing worked.
19003 case "$perl_static_inline" in
19005 perl_static_inline="static"
19009 set d_static_inline
19011 $rm -f a.[co] b.[co]
19014 : Check stream access
19016 Checking how to access stdio streams by file descriptor number...
19018 case "$stdio_stream_array" in
19019 '') $cat >try.c <<EOCP
19022 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19026 for s in _iob __iob __sF
19028 set try -DSTDIO_STREAM_ARRAY=$s
19029 if eval $compile; then
19030 case "`$run ./try`" in
19031 yes) stdio_stream_array=$s; break ;;
19037 case "$stdio_stream_array" in
19039 I can't figure out how to access stdio streams by file descriptor number.
19041 d_stdio_stream_array="$undef"
19044 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19046 d_stdio_stream_array="$define"
19050 : see if strcoll exists
19051 set strcoll d_strcoll
19054 : check for structure copying
19056 echo "Checking to see if your C compiler can copy structs..." >&4
19057 $cat >try.c <<'EOCP'
19067 if $cc -c try.c >/dev/null 2>&1 ; then
19069 echo "Yup, it can."
19072 echo "Nope, it can't."
19078 : see if strerror and/or sys_errlist[] exist
19080 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19081 if set strerror val -f d_strerror; eval $csym; $val; then
19082 echo 'strerror() found.' >&4
19083 d_strerror="$define"
19084 d_strerrm='strerror(e)'
19085 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19086 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19087 d_syserrlst="$define"
19089 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19090 d_syserrlst="$undef"
19092 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19093 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19094 echo 'strerror() found in string header.' >&4
19095 d_strerror="$define"
19096 d_strerrm='strerror(e)'
19097 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19098 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19099 d_syserrlst="$define"
19101 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19102 d_syserrlst="$undef"
19104 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19105 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19106 d_strerror="$undef"
19107 d_syserrlst="$define"
19108 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19110 echo 'strerror() and sys_errlist[] NOT found.' >&4
19111 d_strerror="$undef"
19112 d_syserrlst="$undef"
19113 d_strerrm='"unknown"'
19117 : see if strerror_r exists
19118 set strerror_r d_strerror_r
19120 case "$d_strerror_r" in
19122 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19123 case "$d_strerror_r_proto:$usethreads" in
19124 ":define") d_strerror_r_proto=define
19125 set d_strerror_r_proto strerror_r $hdrs
19129 case "$d_strerror_r_proto" in
19131 case "$strerror_r_proto" in
19132 ''|0) try='int strerror_r(int, char*, size_t);'
19133 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19135 case "$strerror_r_proto" in
19136 ''|0) try='int strerror_r(int, char*, int);'
19137 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19139 case "$strerror_r_proto" in
19140 ''|0) try='char* strerror_r(int, char*, size_t);'
19141 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19143 case "$strerror_r_proto" in
19144 ''|0) d_strerror_r=undef
19146 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19147 * ) case "$strerror_r_proto" in
19148 REENTRANT_PROTO*) ;;
19149 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19151 echo "Prototype: $try" ;;
19154 *) case "$usethreads" in
19155 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19162 *) strerror_r_proto=0
19166 : see if strftime exists
19167 set strftime d_strftime
19170 : see if strlcat exists
19171 set strlcat d_strlcat
19174 : see if strlcpy exists
19175 set strlcpy d_strlcpy
19178 : see if strtod exists
19179 set strtod d_strtod
19182 : see if strtol exists
19183 set strtol d_strtol
19186 : see if strtold exists
19187 set strtold d_strtold
19190 : see if strtoll exists
19191 set strtoll d_strtoll
19194 case "$d_longlong-$d_strtoll" in
19197 Checking whether your strtoll() works okay...
19199 $cat >try.c <<'EOCP'
19202 #define strtoll __strtoll
19205 #define strtoll _strtoll
19208 extern long long int strtoll(char *s, char **, int);
19209 static int bad = 0;
19210 int check(char *s, long long ell, int een) {
19213 gll = strtoll(s, 0, 10);
19214 if (!((gll == ell) && (errno == een)))
19218 check(" 1", 1LL, 0);
19219 check(" 0", 0LL, 0);
19220 check("-1", -1LL, 0);
19221 check("-9223372036854775808", -9223372036854775808LL, 0);
19222 check("-9223372036854775808", -9223372036854775808LL, 0);
19223 check(" 9223372036854775807", 9223372036854775807LL, 0);
19224 check("-9223372036854775808", -9223372036854775808LL, 0);
19225 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19226 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19232 if eval $compile; then
19235 ok) echo "Your strtoll() seems to be working okay." ;;
19237 Your strtoll() doesn't seem to be working okay.
19243 echo "(I can't seem to compile the test program--assuming it doesn't)"
19249 : see if strtoq exists
19250 set strtoq d_strtoq
19253 : see if strtoul exists
19254 set strtoul d_strtoul
19257 case "$d_strtoul" in
19260 Checking whether your strtoul() works okay...
19262 $cat >try.c <<'EOCP'
19265 extern unsigned long int strtoul(char *s, char **, int);
19266 static int bad = 0;
19267 void check(char *s, unsigned long eul, int een) {
19270 gul = strtoul(s, 0, 10);
19271 if (!((gul == eul) && (errno == een)))
19275 check(" 1", 1L, 0);
19276 check(" 0", 0L, 0);
19278 case "$longsize" in
19280 $cat >>try.c <<'EOCP'
19281 check("18446744073709551615", 18446744073709551615UL, 0);
19282 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19283 #if 0 /* strtoul() for /^-/ strings is undefined. */
19284 check("-1", 18446744073709551615UL, 0);
19285 check("-18446744073709551614", 2, 0);
19286 check("-18446744073709551615", 1, 0);
19287 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19288 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19293 $cat >>try.c <<'EOCP'
19294 check("4294967295", 4294967295UL, 0);
19295 check("4294967296", 4294967295UL, ERANGE);
19296 #if 0 /* strtoul() for /^-/ strings is undefined. */
19297 check("-1", 4294967295UL, 0);
19298 check("-4294967294", 2, 0);
19299 check("-4294967295", 1, 0);
19300 check("-4294967296", 4294967295UL, ERANGE);
19301 check("-4294967297", 4294967295UL, ERANGE);
19306 : Should we write these tests to be more portable by sprintf-ing
19307 : ~0 and then manipulating that char string as input for strtol?
19310 $cat >>try.c <<'EOCP'
19317 if eval $compile; then
19318 case "`$run ./try`" in
19319 ok) echo "Your strtoul() seems to be working okay." ;;
19321 Your strtoul() doesn't seem to be working okay.
19327 echo "(I can't seem to compile the test program--assuming it doesn't)"
19333 : see if strtoull exists
19334 set strtoull d_strtoull
19337 case "$d_longlong-$d_strtoull" in
19340 Checking whether your strtoull() works okay...
19342 $cat >try.c <<'EOCP'
19345 #define strtoull __strtoull
19348 extern unsigned long long int strtoull(char *s, char **, int);
19349 static int bad = 0;
19350 int check(char *s, long long eull, int een) {
19353 gull = strtoull(s, 0, 10);
19354 if (!((gull == eull) && (errno == een)))
19358 check(" 1", 1LL, 0);
19359 check(" 0", 0LL, 0);
19360 check("18446744073709551615", 18446744073709551615ULL, 0);
19361 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19362 #if 0 /* strtoull() for /^-/ strings is undefined. */
19363 check("-1", 18446744073709551615ULL, 0);
19364 check("-18446744073709551614", 2LL, 0);
19365 check("-18446744073709551615", 1LL, 0);
19366 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19367 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19374 if eval $compile; then
19375 case "`$run ./try`" in
19376 ok) echo "Your strtoull() seems to be working okay." ;;
19378 Your strtoull() doesn't seem to be working okay.
19380 d_strtoull="$undef"
19384 echo "(I can't seem to compile the test program--assuming it doesn't)"
19385 d_strtoull="$undef"
19390 : see if strtouq exists
19391 set strtouq d_strtouq
19394 case "$d_strtouq" in
19397 Checking whether your strtouq() works okay...
19399 $cat >try.c <<'EOCP'
19402 extern unsigned long long int strtouq(char *s, char **, int);
19403 static int bad = 0;
19404 void check(char *s, unsigned long long eull, int een) {
19405 unsigned long long gull;
19407 gull = strtouq(s, 0, 10);
19408 if (!((gull == eull) && (errno == een)))
19412 check(" 1", 1LL, 0);
19413 check(" 0", 0LL, 0);
19414 check("18446744073709551615", 18446744073709551615ULL, 0);
19415 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19416 #if 0 /* strtouq() for /^-/ strings is undefined. */
19417 check("-1", 18446744073709551615ULL, 0);
19418 check("-18446744073709551614", 2LL, 0);
19419 check("-18446744073709551615", 1LL, 0);
19420 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19421 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19429 if eval $compile; then
19430 case "`$run ./try`" in
19431 ok) echo "Your strtouq() seems to be working okay." ;;
19433 Your strtouq() doesn't seem to be working okay.
19439 echo "(I can't seem to compile the test program--assuming it doesn't)"
19445 : see if strxfrm exists
19446 set strxfrm d_strxfrm
19449 : see if symlink exists
19450 set symlink d_symlink
19453 : see if syscall exists
19454 set syscall d_syscall
19457 : see if prototype for syscall is available
19459 set d_syscallproto syscall $i_unistd unistd.h
19462 : see if sysconf exists
19463 set sysconf d_sysconf
19466 : see if system exists
19467 set system d_system
19470 : see if tcgetpgrp exists
19471 set tcgetpgrp d_tcgetpgrp
19474 : see if tcsetpgrp exists
19475 set tcsetpgrp d_tcsetpgrp
19478 : see if prototype for telldir is available
19480 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19483 : see if tgamma exists
19484 set tgamma d_tgamma
19487 : see if time exists
19489 if test "X$d_time" = X -o X"$timetype" = X; then
19490 if set time val -f d_time; eval $csym; $val; then
19491 echo 'time() found.' >&4
19493 rp="What is the type returned by time() on this system?"
19494 set time_t timetype long stdio.h sys/types.h
19497 echo 'time() not found, hope that will do.' >&4
19505 : see if timegm exists
19506 set timegm d_timegm
19509 : see if this is a sys/times.h system
19510 set sys/times.h i_systimes
19513 : see if times exists
19515 if set times val -f d_times; eval $csym; $val; then
19516 echo 'times() found.' >&4
19519 case "$i_systimes" in
19520 "$define") inc='sys/times.h';;
19522 rp="What is the type returned by times() on this system?"
19523 set clock_t clocktype long stdio.h sys/types.h $inc
19526 echo 'times() NOT found, hope that will do.' >&4
19531 : see if tmpnam_r exists
19532 set tmpnam_r d_tmpnam_r
19534 case "$d_tmpnam_r" in
19536 hdrs="$i_systypes sys/types.h define stdio.h "
19537 case "$d_tmpnam_r_proto:$usethreads" in
19538 ":define") d_tmpnam_r_proto=define
19539 set d_tmpnam_r_proto tmpnam_r $hdrs
19543 case "$d_tmpnam_r_proto" in
19545 case "$tmpnam_r_proto" in
19546 ''|0) try='char* tmpnam_r(char*);'
19547 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19549 case "$tmpnam_r_proto" in
19550 ''|0) d_tmpnam_r=undef
19552 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19553 * ) case "$tmpnam_r_proto" in
19554 REENTRANT_PROTO*) ;;
19555 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19557 echo "Prototype: $try" ;;
19560 *) case "$usethreads" in
19561 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19568 *) tmpnam_r_proto=0
19572 : see if trunc exists
19576 : see if truncate exists
19577 set truncate d_truncate
19580 : see if ttyname_r exists
19581 set ttyname_r d_ttyname_r
19583 case "$d_ttyname_r" in
19585 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19586 case "$d_ttyname_r_proto:$usethreads" in
19587 ":define") d_ttyname_r_proto=define
19588 set d_ttyname_r_proto ttyname_r $hdrs
19592 case "$d_ttyname_r_proto" in
19594 case "$ttyname_r_proto" in
19595 ''|0) try='int ttyname_r(int, char*, size_t);'
19596 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19598 case "$ttyname_r_proto" in
19599 ''|0) try='int ttyname_r(int, char*, int);'
19600 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19602 case "$ttyname_r_proto" in
19603 ''|0) try='char* ttyname_r(int, char*, int);'
19604 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19606 case "$ttyname_r_proto" in
19607 ''|0) d_ttyname_r=undef
19609 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19610 * ) case "$ttyname_r_proto" in
19611 REENTRANT_PROTO*) ;;
19612 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19614 echo "Prototype: $try" ;;
19617 *) case "$usethreads" in
19618 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19625 *) ttyname_r_proto=0
19629 : see if tzname[] exists
19631 if set tzname val -a d_tzname; eval $csym; $val; then
19633 echo 'tzname[] found.' >&4
19636 echo 'tzname[] NOT found.' >&4
19641 : Check if is a multiplatform env
19643 darwin) multiarch="$define" ;;
19645 case "$multiarch" in
19646 ''|[nN]*) multiarch="$undef" ;;
19649 : check for ordering of bytes in a UV
19651 case "$multiarch" in
19654 You seem to be doing a multiarchitecture build,
19655 skipping the byteorder check.
19661 case "$byteorder" in
19664 In the following, larger digits indicate more significance. A big-endian
19665 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19666 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19667 machines may have weird orders like 3412. A Cray will report 87654321,
19668 an Alpha will report 12345678. If the test program works the default is
19670 I'm now running the test program...
19674 #$i_stdlib I_STDLIB
19676 #include <stdlib.h>
19678 #include <sys/types.h>
19679 typedef $uvtype UV;
19689 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19691 u.l = (UV)0x04030201;
19692 for (i = 0; i < $uvsize; i++)
19693 printf("%c", u.c[i]+'0');
19700 if eval $compile && $run ./try > /dev/null; then
19703 [1-4][1-4][1-4][1-4]|12345678|87654321)
19704 echo "(The test program ran ok.)"
19705 echo "byteorder=$dflt"
19708 ????|????????) echo "(The test program ran ok.)" ;;
19709 *) echo "(The test program didn't run right for some reason.)" ;;
19714 (I can't seem to compile the test program. Guessing big-endian...)
19717 case "$xxx_prompt" in
19719 rp="What is the order of bytes in $uvtype?"
19732 : Checking 32bit alignedness
19735 Checking to see whether you can access character data unalignedly...
19737 case "$d_u32align" in
19738 '') $cat >try.c <<EOCP
19740 #$i_stdlib I_STDLIB
19742 #include <stdlib.h>
19744 #define U32 $u32type
19745 #define BYTEORDER 0x$byteorder
19747 #include <signal.h>
19749 $signal_t bletch(int s) { exit(4); }
19752 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19753 volatile U8 buf[8];
19757 if (sizeof(U32) != 4) {
19758 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19765 signal(SIGBUS, bletch);
19777 for (i = 0; i < 4; i++) {
19778 up = (U32*)(buf + i);
19779 if (! ((*up == 1 << (8*i)) || /* big-endian */
19780 (*up == 1 << (8*(3-i))) /* little-endian */
19784 printf("read failed (%x)\n", *up);
19790 for (i = 0; i < 4; i++) {
19791 up = (U32*)(buf + i);
19793 if (*up != 0xBeef) {
19794 printf("write failed (%x)\n", *up);
19808 if eval $compile_ok; then
19809 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19810 $run ./try 2>&1 >/dev/null
19813 You can access character data pretty unalignedly.
19815 d_u32align="$undef"
19818 It seems that you must access character data in an aligned manner.
19820 d_u32align="$define"
19824 rp='Can you access character data at unaligned addresses?'
19828 [yY]*) d_u32align="$undef" ;;
19829 *) d_u32align="$define" ;;
19836 : see if ualarm exists
19837 set ualarm d_ualarm
19840 : see if umask exists
19844 : see if unordered exists
19845 set unordered d_unordered
19848 : see if unsetenv exists
19849 set unsetenv d_unsetenv
19852 : see if usleep exists
19853 set usleep d_usleep
19856 : see if prototype for usleep is available
19858 set d_usleepproto usleep $i_unistd unistd.h
19861 : see if ustat exists
19865 : see if closedir exists
19866 set closedir d_closedir
19869 case "$d_closedir" in
19872 echo "Checking whether closedir() returns a status..." >&4
19874 #$i_dirent I_DIRENT /**/
19875 #$i_sysdir I_SYS_DIR /**/
19876 #$i_sysndir I_SYS_NDIR /**/
19877 #$i_systypes I_SYS_TYPES /**/
19879 #if defined(I_SYS_TYPES)
19880 #include <sys/types.h>
19882 #if defined(I_DIRENT)
19883 #include <dirent.h>
19886 #include <sys/ndir.h>
19890 #include <ndir.h> /* may be wrong in the future */
19892 #include <sys/dir.h>
19897 int main() { return closedir(opendir(".")); }
19900 if eval $compile_ok; then
19901 if $run ./try > /dev/null 2>&1 ; then
19902 echo "Yes, it does."
19905 echo "No, it doesn't."
19909 echo "(I can't seem to compile the test program--assuming it doesn't)"
19917 set d_void_closedir
19921 : see if there is a wait4
19925 : see if waitpid exists
19926 set waitpid d_waitpid
19931 $cat >try.c <<'EOCP'
19937 return (wcscmp (s, s) ? 1 : 0);
19942 if eval $compile; then
19945 0) echo "A working wcscmp() found." >&4
19947 *) echo "wcscmp() found, but it doesn't work" >&4
19951 echo "wcscmp() NOT found." >&4
19957 : see if wcstombs exists
19958 set wcstombs d_wcstombs
19963 $cat >try.c <<'EOCP'
19968 wchar_t dst[4], *src = L" ";
19970 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19975 if eval $compile; then
19978 0) echo "A working wcsxfrm() found." >&4
19980 *) echo "wcsxfrm() found, but it doesn't work" >&4
19984 echo "wcsxfrm() NOT found." >&4
19990 : see if wctomb exists
19991 set wctomb d_wctomb
19994 : see if writev exists
19995 set writev d_writev
19998 : check for alignment requirements
20000 case "$alignbytes" in
20001 '') echo "Checking alignment constraints..." >&4
20002 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20003 $cat >try.c <<'EOCP'
20004 typedef long double NV;
20007 $cat >try.c <<'EOCP'
20011 $cat >>try.c <<'EOCP'
20019 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20024 if eval $compile_ok; then
20028 echo "(I can't seem to compile the test program...)"
20030 case "$multiarch" in
20032 : The usual safe value is 8, but Darwin with -Duselongdouble
20033 : needs 16. Hence, we will take 8 as a minimum, but allow
20034 : Configure to pick a larger value if needed.
20035 if $test "$dflt" -lt 8; then
20037 echo "Setting alignment to 8 for multiarch support.">&4
20042 *) dflt="$alignbytes"
20045 rp="Doubles must be aligned on a how-many-byte boundary?"
20050 : set the base revision
20053 : length of character in bytes. Is always 1, otherwise it is not C
20054 : This used to be a test using sizeof
20057 : Check for the number of bits in a character
20058 case "$charbits" in
20059 '') echo "Checking how long a character is (in bits)..." >&4
20066 for (c = 1, n = 0; c; c <<= 1, n++) ;
20067 printf ("%d\n", n);
20072 if eval $compile_ok; then
20076 echo "(I can't seem to compile the test program. Guessing...)"
20083 rp="What is the length of a character (in bits)?"
20087 case "$charbits" in
20090 Your system has an unsigned character size of $charbits bits, which
20091 is rather unusual (normally it is 8 bits). Perl likely will not work
20092 correctly on your system, with subtle bugs in various places.
20094 rp='Do you really want to continue?'
20098 [yY]) echo >&4 "Okay, continuing." ;;
20103 : how do we concatenate cpp tokens here?
20105 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20106 $cat >cpp_stuff.c <<'EOCP'
20107 #define RCAT(a,b)a/**/b
20108 #define ACAT(a,b)a ## b
20112 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20113 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20114 echo "Oh! Smells like ANSI's been here." >&4
20115 echo "We can catify or stringify, separately or together!"
20117 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20118 echo "Ah, yes! The good old days!" >&4
20119 echo "However, in the good old days we don't know how to stringify and"
20120 echo "catify at the same time."
20124 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20125 You're going to have to edit the values of CAT[2-5] in config.h...
20127 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20131 : see if this is a db.h system
20137 : Check db version.
20139 echo "Checking Berkeley DB version ..." >&4
20145 #include <sys/types.h>
20147 #$i_stdlib I_STDLIB
20149 #include <stdlib.h>
20152 int main(int argc, char *argv[])
20154 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20155 int Major, Minor, Patch ;
20156 unsigned long Version ;
20157 (void)db_version(&Major, &Minor, &Patch) ;
20159 printf("%d %d %d %d %d %d\n",
20160 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20161 Major, Minor, Patch);
20164 printf("You have Berkeley DB Version 2 or greater.\n");
20166 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20167 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20168 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20169 Major, Minor, Patch) ;
20171 /* check that db.h & libdb are compatible */
20172 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20173 printf("db.h and libdb are incompatible.\n") ;
20177 printf("db.h and libdb are compatible.\n") ;
20179 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20180 + DB_VERSION_PATCH ;
20182 /* needs to be >= 2.3.4 */
20183 if (Version < 2003004) {
20184 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20185 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20191 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20196 printf("You have Berkeley DB Version 1.\n");
20197 exit(0); /* DB version < 2: the coast is clear. */
20199 exit(1); /* <db.h> not Berkeley DB? */
20205 if eval $compile_ok && $run ./try; then
20206 echo 'Looks OK.' >&4
20208 db_version_major=$1
20209 db_version_minor=$2
20210 db_version_patch=$3
20212 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20216 : Remove db from list of libraries to use
20217 echo "Removing unusable -ldb from library list" >&4
20218 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20221 echo "libs = $libs" >&4
20231 : Check the return type needed for hash
20233 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20239 #include <sys/types.h>
20242 #ifndef DB_VERSION_MAJOR
20243 u_int32_t hash_cb (const void* ptr, size_t size)
20249 info.hash = hash_cb;
20253 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20254 if $contains warning try.out >>/dev/null 2>&1 ; then
20257 db_hashtype='u_int32_t'
20260 : XXX Maybe we should just give up here.
20261 db_hashtype=u_int32_t
20263 echo "Help: I can't seem to compile the db test program." >&4
20264 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20267 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20269 *) db_hashtype=u_int32_t
20274 : Check the return type needed for prefix
20276 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20282 #include <sys/types.h>
20285 #ifndef DB_VERSION_MAJOR
20286 size_t prefix_cb (const DBT *key1, const DBT *key2)
20292 info.prefix = prefix_cb;
20296 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20297 if $contains warning try.out >>/dev/null 2>&1 ; then
20298 db_prefixtype='int'
20300 db_prefixtype='size_t'
20303 db_prefixtype='size_t'
20304 : XXX Maybe we should just give up here.
20306 echo "Help: I can't seem to compile the db test program." >&4
20307 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20310 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20312 *) db_prefixtype='size_t'
20316 : How can we generate normalized random numbers ?
20318 echo "Using our internal random number implementation..." >&4
20321 *-Dmy_rand=*|*-Dmy_srand=*)
20322 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20323 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20324 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20325 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20329 randfunc=Perl_drand48
20330 drand01="Perl_drand48()"
20331 seedfunc="Perl_drand48_init"
20335 : Determine if this is an EBCDIC system
20337 echo "Determining whether or not we are on an EBCDIC system..." >&4
20338 $cat >try.c <<'EOM'
20341 if ('M'==0xd4) return 0;
20348 if eval $compile_ok; then
20349 if $run ./try; then
20350 echo "You seem to speak EBCDIC." >&4
20353 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20356 echo "I'm unable to compile the test program." >&4
20357 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20363 : Check how to flush
20366 Checking how to flush all pending stdio output...
20368 # I only know how to find the first 32 possibly open files on SunOS.
20369 # See also hints/sunos_4_1.sh and util.c --AD
20371 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20373 $cat >>try.c <<EOCP
20375 #$i_stdlib I_STDLIB
20377 #include <stdlib.h>
20379 #$i_unistd I_UNISTD
20381 # include <unistd.h>
20383 #$d_sysconf HAS_SYSCONF
20384 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20385 #ifdef HAS_STDIO_STREAM_ARRAY
20386 # define STDIO_STREAM_ARRAY $stdio_stream_array
20391 p = fopen("try.out", "w");
20395 # ifdef TRY_FPRINTF
20399 #ifdef TRY_FFLUSH_NULL
20402 #ifdef TRY_FFLUSH_ALL
20404 long open_max = -1;
20405 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20406 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20408 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20409 open_max = sysconf(_SC_OPEN_MAX);
20412 open_max = FOPEN_MAX;
20415 open_max = OPEN_MAX;
20424 # ifdef HAS_STDIO_STREAM_ARRAY
20425 if (open_max > 0) {
20427 for (i = 0; i < open_max; i++)
20428 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20429 STDIO_STREAM_ARRAY[i]._file < open_max &&
20430 STDIO_STREAM_ARRAY[i]._flag)
20431 fflush(&STDIO_STREAM_ARRAY[i]);
20439 : first we have to find out how _not_ to flush
20441 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20443 set try -DTRY_FPUTC
20444 if eval $compile; then
20445 $run ./try 2>/dev/null
20448 if $test ! -s try.out -a "X$code" = X42; then
20454 set try -DTRY_FPRINTF
20455 if eval $compile; then
20456 $run ./try 2>/dev/null
20459 if $test ! -s try.out -a "X$code" = X42; then
20460 output=-DTRY_FPRINTF
20466 : check for fflush NULL behavior
20467 case "$fflushNULL" in
20468 '') set try -DTRY_FFLUSH_NULL $output
20469 if eval $compile; then
20470 $run ./try 2>/dev/null
20473 if $test -s try.out -a "X$code" = X42; then
20474 fflushNULL="`$cat try.out`"
20476 if $test "X$code" != X42; then
20478 (If this test failed, don't worry, we'll try another method shortly.)
20483 $rm -f core try.core core.try.*
20484 case "$fflushNULL" in
20486 Your fflush(NULL) works okay for output streams.
20487 Let's see if it clobbers input pipes...
20489 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20490 # bug that improperly flushes the input end of pipes. So we avoid the
20491 # autoflush on fork/system/exec support for now. :-(
20492 $cat >tryp.c <<EOCP
20495 main(int argc, char **argv)
20501 while ((i = getc(stdin)) != -1
20502 && (*bp++ = i) != '\n'
20503 && bp < &buf[1024])
20506 fprintf(stdout, "%s", buf);
20514 fflushNULL="$define"
20516 if eval $compile; then
20518 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20519 if $test "X$targethost" != X; then
20522 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20524 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20526 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20528 fflush(NULL) seems to behave okay with input streams.
20530 fflushNULL="$define"
20533 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20535 fflushNULL="$undef"
20538 $rm -f core tryp.c tryp.core core.tryp.*
20541 Your fflush(NULL) isn't working (contrary to ANSI C).
20543 fflushNULL="$undef"
20546 Cannot figure out whether your fflush(NULL) works or not.
20547 I'm assuming it doesn't (contrary to ANSI C).
20549 fflushNULL="$undef"
20553 $define|true|[yY]*)
20554 fflushNULL="$define"
20557 fflushNULL="$undef"
20560 : check explicit looping only if NULL did not work, and if the pipe
20561 : bug does not show up on an explicit flush too
20562 case "$fflushNULL" in
20564 $cat >tryp.c <<EOCP
20567 main(int argc, char **argv)
20573 while ((i = getc(stdin)) != -1
20574 && (*bp++ = i) != '\n'
20575 && bp < &buf[1024])
20578 fprintf(stdout, "%s", buf);
20587 if eval $compile; then
20589 if $test "X$targethost" != X; then
20592 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20594 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20596 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20598 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20600 : now check for fflushall behaviour
20601 case "$fflushall" in
20602 '') set try -DTRY_FFLUSH_ALL $output
20603 if eval $compile; then
20605 (Now testing the other method--but note that this also may fail.)
20607 $run ./try 2>/dev/null
20610 if $test -s try.out -a "X$code" = X42; then
20611 fflushall="`$cat try.out`"
20615 case "$fflushall" in
20617 Whew. Flushing explicitly all the stdio streams works.
20619 fflushall="$define"
20622 Sigh. Flushing explicitly all the stdio streams doesn't work.
20627 Cannot figure out whether flushing stdio streams explicitly works or not.
20628 I'm assuming it doesn't.
20634 "$define"|true|[yY]*)
20635 fflushall="$define"
20643 All is futile. Even fflush(stdin) clobbers input pipes!
20650 $rm -f core tryp.c tryp.core core.tryp.*
20652 *) fflushall="$undef"
20656 case "$fflushNULL$fflushall" in
20659 OK, I give up. I cannot figure out how to flush pending stdio output.
20660 We won't be flushing handles at all before fork/exec/popen.
20666 : Store the full pathname to the ar program for use in the C program
20667 : Respect a hint or command line value for full_ar.
20672 : Store the full pathname to the sed program for use in the C program
20675 : see what type gids are declared as in the kernel
20677 echo "Looking for the type for group ids returned by getgid()."
20678 set gid_t gidtype xxx stdio.h sys/types.h
20682 xxx=`./findhdr sys/user.h`
20683 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20685 unsigned) dflt="$1 $2" ;;
20689 *) dflt="$gidtype";;
20692 gid_t) echo "gid_t found." ;;
20693 *) rp="What is the type for group ids returned by getgid()?"
20699 : Check the size of GID
20702 *_t) zzz="$gidtype" ;;
20705 echo "Checking the size of $zzz..." >&4
20707 #include <sys/types.h>
20709 #$i_stdlib I_STDLIB
20711 #include <stdlib.h>
20714 printf("%d\n", (int)sizeof($gidtype));
20719 if eval $compile_ok; then
20723 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20726 echo "Your $zzz is $gidsize bytes long."
20731 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20735 : Check if GID is signed
20738 *_t) zzz="$gidtype" ;;
20741 echo "Checking the sign of $zzz..." >&4
20743 #include <sys/types.h>
20754 if eval $compile; then
20758 echo "(I can't execute the test program--guessing unsigned.)" >&4
20762 1) echo "Your $zzz is unsigned." ;;
20763 -1) echo "Your $zzz is signed." ;;
20769 echo "(I can't compile the test program--guessing unsigned.)" >&4
20773 : Check 64bit sizes
20776 if $test X"$quadtype" != X; then
20778 echo "Checking how to print 64-bit integers..." >&4
20780 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20781 $cat >try.c <<'EOCP'
20782 #include <sys/types.h>
20785 int q = 12345678901;
20786 printf("%ld\n", q);
20790 if eval $compile; then
20794 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20795 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20796 echo "We will use %d."
20802 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20803 $cat >try.c <<'EOCP'
20804 #include <sys/types.h>
20807 long q = 12345678901;
20808 printf("%ld\n", q);
20812 if eval $compile; then
20816 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20817 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20818 echo "We will use %ld."
20824 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20825 $cat >try.c <<'EOCP'
20826 #include <sys/types.h>
20827 #include <inttypes.h>
20830 int64_t q = 12345678901;
20831 printf("%" PRId64 "\n", q);
20835 if eval $compile; then
20839 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20840 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20841 echo "We will use the C9X style."
20847 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20849 #include <sys/types.h>
20852 $quadtype q = 12345678901;
20853 printf("%Ld\n", q);
20857 if eval $compile; then
20861 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20862 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20863 echo "We will use %Ld."
20869 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20870 $cat >try.c <<'EOCP'
20871 #include <sys/types.h>
20874 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20875 printf("%lld\n", q);
20879 if eval $compile; then
20883 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20884 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20885 echo "We will use the %lld style."
20891 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20893 #include <sys/types.h>
20896 $quadtype q = 12345678901;
20897 printf("%qd\n", q);
20901 if eval $compile; then
20905 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20906 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20907 echo "We will use %qd."
20913 if $test X"$sPRId64" = X; then
20914 echo "Cannot figure out how to print 64-bit integers." >&4
20921 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20922 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20924 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20925 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20929 : Check format strings for internal types
20931 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20933 if $test X"$ivsize" = X8; then
20934 ivdformat="$sPRId64"
20935 uvuformat="$sPRIu64"
20936 uvoformat="$sPRIo64"
20937 uvxformat="$sPRIx64"
20938 uvXUformat="$sPRIXU64"
20940 if $test X"$ivsize" = X"$longsize"; then
20947 if $test X"$ivsize" = X"$intsize"; then
20955 if $test X"$ivsize" = X"$shortsize"; then
20966 if $test X"$usequadmath" = X"$define"; then
20974 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20975 nveformat="$sPRIeldbl"
20976 nvfformat="$sPRIfldbl"
20977 nvgformat="$sPRIgldbl"
20978 nvEUformat="$sPRIEUldbl"
20979 nvFUformat="$sPRIFUldbl"
20980 nvGUformat="$sPRIGUldbl"
20991 case "$ivdformat" in
20992 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20997 : Check format string for GID
21000 $echo "Checking the format string to be used for gids..." >&4
21003 -1) if $test X"$gidsize" = X"$ivsize"; then
21004 gidformat="$ivdformat"
21006 if $test X"$gidsize" = X"$longsize"; then
21009 if $test X"$gidsize" = X"$intsize"; then
21012 if $test X"$gidsize" = X"$shortsize"; then
21019 *) if $test X"$gidsize" = X"$uvsize"; then
21020 gidformat="$uvuformat"
21022 if $test X"$gidsize" = X"$longsize"; then
21025 if $test X"$gidsize" = X"$intsize"; then
21028 if $test X"$gidsize" = X"$shortsize"; then
21037 : see if getgroups exists
21038 set getgroups d_getgrps
21041 : see if setgroups exists
21042 set setgroups d_setgrps
21045 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21047 case "$d_getgrps$d_setgrps" in
21049 case "$groupstype" in
21050 '') dflt="$gidtype" ;;
21051 *) dflt="$groupstype" ;;
21054 What type of pointer is the second argument to getgroups() and setgroups()?
21055 Usually this is the same as group ids, $gidtype, but not always.
21058 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21062 *) groupstype="$gidtype";;
21065 : check whether make sets MAKE
21067 echo "Checking if your $make program sets \$(MAKE)..." >&4
21068 case "$make_set_make" in
21070 $sed 's/^X //' > testmake.mak << 'EOF'
21072 X @echo 'maketemp="$(MAKE)"'
21074 case "`$make -f testmake.mak 2>/dev/null`" in
21075 *maketemp=*) make_set_make='#' ;;
21076 *) make_set_make="MAKE=$make" ;;
21078 $rm -f testmake.mak
21081 case "$make_set_make" in
21082 '#') echo "Yup, it does.";;
21083 *) echo "Nope, it doesn't.";;
21086 : see what type is used for mode_t
21087 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21088 set mode_t modetype int stdio.h sys/types.h
21091 : see if we need va_copy
21093 case "$i_stdarg" in
21096 #include <stdarg.h>
21098 #$i_stdlib I_STDLIB
21100 #include <stdlib.h>
21102 #include <signal.h>
21105 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21107 return vfprintf(f, fmt, *valp);
21111 myvfprintf(FILE *f, const char *fmt, va_list val)
21113 return ivfprintf(f, fmt, &val);
21117 myprintf(char *fmt, ...)
21120 va_start(val, fmt);
21121 return myvfprintf(stdout, fmt, val);
21125 main(int ac, char **av)
21127 signal(SIGSEGV, exit);
21129 myprintf("%s%cs all right, then\n", "that", '\'');
21134 if eval $compile && $run ./try 2>&1 >/dev/null; then
21135 case "`$run ./try`" in
21136 "that's all right, then")
21142 yes) echo "It seems that you don't need va_copy()." >&4
21143 need_va_copy="$undef"
21145 *) echo "It seems that va_copy() or similar will be needed." >&4
21146 need_va_copy="$define"
21151 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21152 need_va_copy="$undef"
21156 : see what type is used for size_t
21157 rp="What is the type used for the length parameter for string functions?"
21158 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21161 : check for type of arguments to gethostbyaddr.
21162 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21163 case "$d_gethbyaddr" in
21167 Checking to see what type of arguments are accepted by gethostbyaddr().
21169 hdrs="$define sys/types.h
21170 $d_socket sys/socket.h
21171 $i_niin netinet/in.h
21173 $i_unistd unistd.h"
21174 : The first arg can 'char *' or 'void *'
21175 : The second arg is some of integral type
21176 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21177 for yyy in size_t long int; do
21178 case "$netdb_host_type" in
21179 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21180 if ./protochk "$try" $hdrs; then
21181 echo "Your system accepts $xxx for the first arg."
21182 echo "...and $yyy for the second arg."
21183 netdb_host_type="$xxx"
21184 netdb_hlen_type="$yyy"
21190 : In case none of those worked, prompt the user.
21191 case "$netdb_host_type" in
21192 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21195 netdb_host_type=$ans
21196 rp='What is the type for the 2nd argument to gethostbyaddr?'
21199 netdb_hlen_type=$ans
21203 *) : no gethostbyaddr, so pick harmless defaults
21204 netdb_host_type='char *'
21205 netdb_hlen_type="$sizetype"
21208 # Remove the "const" if needed. -- but then we'll have a
21210 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21213 : check for type of argument to gethostbyname.
21214 if test "X$netdb_name_type" = X ; then
21215 case "$d_gethbyname" in
21219 Checking to see what type of argument is accepted by gethostbyname().
21221 hdrs="$define sys/types.h
21222 $d_socket sys/socket.h
21223 $i_niin netinet/in.h
21225 $i_unistd unistd.h"
21226 for xxx in "const char *" "char *"; do
21227 case "$netdb_name_type" in
21228 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21229 if ./protochk "$try" $hdrs; then
21230 echo "Your system accepts $xxx."
21231 netdb_name_type="$xxx"
21236 : In case none of those worked, prompt the user.
21237 case "$netdb_name_type" in
21238 '') rp='What is the type for the 1st argument to gethostbyname?'
21241 netdb_name_type=$ans
21245 *) : no gethostbyname, so pick harmless default
21246 netdb_name_type='char *'
21251 : check for type of 1st argument to getnetbyaddr.
21252 if test "X$netdb_net_type" = X ; then
21253 case "$d_getnbyaddr" in
21257 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21259 hdrs="$define sys/types.h
21260 $d_socket sys/socket.h
21261 $i_niin netinet/in.h
21263 $i_unistd unistd.h"
21264 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21265 case "$netdb_net_type" in
21266 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21267 if ./protochk "$try" $hdrs; then
21268 echo "Your system accepts $xxx."
21269 netdb_net_type="$xxx"
21274 : In case none of those worked, prompt the user.
21275 case "$netdb_net_type" in
21276 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21279 netdb_net_type=$ans
21283 *) : no getnetbyaddr, so pick harmless default
21284 netdb_net_type='long'
21288 : locate the preferred pager for this system
21295 [a-zA-Z]:/*) dflt=$pg;;
21299 [a-zA-Z]:/*) dflt=$more;;
21303 [a-zA-Z]:/*) dflt=$less;;
21306 '') dflt=/usr/ucb/more;;
21314 rp='What pager is used on your system?'
21318 : see what type pids are declared as in the kernel
21319 rp="What is the type of process ids on this system?"
21320 set pid_t pidtype int stdio.h sys/types.h
21323 : see if ar generates random libraries by itself
21325 echo "Checking how to generate random libraries on your machine..." >&4
21326 echo 'int bar1() { return bar2(); }' > bar1.c
21327 echo 'int bar2() { return 2; }' > bar2.c
21329 #$i_stdlib I_STDLIB
21331 #include <stdlib.h>
21333 int main() { printf("%d\n", bar1()); exit(0); }
21335 $cc $ccflags -c bar1.c >/dev/null 2>&1
21336 $cc $ccflags -c bar2.c >/dev/null 2>&1
21337 $cc $ccflags -c foo.c >/dev/null 2>&1
21338 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21339 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21340 $run ./foobar >/dev/null 2>&1; then
21341 echo "$ar appears to generate random libraries itself."
21343 if [ "X$ranlib" = "X" ]; then
21346 elif $ar s bar$_a >/dev/null 2>&1 &&
21347 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21348 $run ./foobar >/dev/null 2>&1; then
21349 echo "a table of contents needs to be added with '$ar s'."
21352 elif $ar ts bar$_a >/dev/null 2>&1 &&
21353 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21354 $run ./foobar >/dev/null 2>&1; then
21355 echo "a table of contents needs to be added with '$ar ts'."
21362 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21363 $test -f $ranlib || ranlib=''
21366 if $test -n "$ranlib"; then
21367 echo "your system has '$ranlib'; we'll use that."
21370 echo "your system doesn't seem to support random libraries"
21371 echo "so we'll use lorder and tsort to order the libraries."
21378 : see if this is a values.h system
21379 set values.h i_values
21382 : Check the max offset that gmtime and localtime accept
21383 echo "Checking max offsets that gmtime () accepts"
21386 define) yyy="#include <values.h>" ;;
21390 case "$sGMTIME_min/$sGMTIME_max" in
21393 #include <sys/types.h>
21402 void gm_check (time_t t, int min_year, int max_year)
21405 if ( tmp == NULL ||
21406 /* Check tm_year overflow */
21407 tmp->tm_year < min_year || tmp->tm_year > max_year)
21418 gm_check (MAXLONG, 69, 0x7fffffff);
21420 if (tmp == NULL || tmp->tm_year < 0) {
21421 for (i = 63; i >= 0; i--) {
21422 time_t x = pt | ((time_t)1 << i);
21423 if (x < 0 || x < pt) continue;
21424 gm_check (x, 69, 0x7fffffff);
21427 printf ("sGMTIME_max=%ld\n", pt);
21436 gm_check (MINLONG, -1900, 70);
21439 for (i = 36; i >= 0; i--) {
21440 time_t x = pt - ((time_t)1 << i);
21441 if (x > 0) continue;
21442 gm_check (x, -1900, 70);
21445 printf ("sGMTIME_min=%ld\n", pt);
21449 int main (int argc, char *argv[])
21457 if eval $compile; then
21460 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21466 echo "Checking max offsets that localtime () accepts"
21468 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21471 #include <sys/types.h>
21480 void local_check (time_t t, int min_year, int max_year)
21482 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21485 tmp = localtime (&t);
21486 if ( tmp == NULL ||
21487 /* Check tm_year overflow */
21488 tmp->tm_year < min_year || tmp->tm_year > max_year)
21492 } /* local_check */
21499 local_check (MAXLONG, 69, 0x7fffffff);
21501 if (tmp == NULL || tmp->tm_year < 0) {
21502 for (i = 63; i >= 0; i--) {
21503 time_t x = pt | ((time_t)1 << i);
21504 if (x < 0 || x < pt) continue;
21505 local_check (x, 69, 0x7fffffff);
21508 printf ("sLOCALTIME_max=%ld\n", pt);
21517 local_check (MINLONG, -1900, 70);
21520 for (i = 36; i >= 0; i--) {
21521 time_t x = pt - ((time_t)1 << i);
21522 if (x > 0) continue;
21523 local_check (x, -1900, 70);
21526 printf ("sLOCALTIME_min=%ld\n", pt);
21530 int main (int argc, char *argv[])
21538 if eval $compile; then
21541 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21547 : check for type of arguments to select.
21548 case "$selecttype" in
21549 '') case "$d_select" in
21553 Checking to see what type of arguments are accepted by select().
21555 hdrs="$define sys/types.h
21556 $i_systime sys/time.h
21557 $i_sysselct sys/select.h
21558 $d_socket sys/socket.h"
21559 : The first arg can be int, unsigned, or size_t
21560 : The last arg may or may not be 'const'
21562 : void pointer has been seen but using that
21563 : breaks the selectminbits test
21564 for xxx in 'fd_set *' 'int *'; do
21565 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21566 for tmo in 'struct timeval *' 'const struct timeval *'; do
21568 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21569 if ./protochk "$try" $hdrs; then
21570 echo "Your system accepts $xxx."
21579 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21580 case "$d_fd_set" in
21581 $define) dflt="fd_set *" ;;
21590 *) : no select, so pick a harmless default
21597 : check for the select 'width'
21598 case "$selectminbits" in
21599 '') safebits=`expr $ptrsize \* 8`
21600 case "$d_select" in
21604 Checking to see on how many bits at a time your select() operates...
21607 #include <sys/types.h>
21609 #$i_systime I_SYS_TIME
21610 #$i_systimek I_SYS_TIME_KERNEL
21615 # ifdef I_SYS_TIME_KERNEL
21618 # include <sys/time.h>
21619 # ifdef I_SYS_TIME_KERNEL
21623 #$i_sysselct I_SYS_SELECT
21624 #ifdef I_SYS_SELECT
21625 #include <sys/select.h>
21627 #$d_socket HAS_SOCKET
21629 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21632 #$i_stdlib I_STDLIB
21634 #include <stdlib.h>
21637 #define S sizeof(*(b))
21639 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21640 #define NBITS (NBYTES * 8)
21642 char *s = (char *)malloc(NBYTES);
21651 fp = fopen("try.c", "r");
21657 b = ($selecttype)s;
21658 for (i = 0; i < NBITS; i++)
21662 select(fd + 1, b, 0, 0, &t);
21663 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21665 printf("%d\n", i + 1);
21670 if eval $compile_ok; then
21671 selectminbits=`$run ./try`
21672 case "$selectminbits" in
21674 Cannot figure out on how many bits at a time your select() operates.
21675 I'll play safe and guess it is $safebits bits.
21677 selectminbits=$safebits
21678 bits="$safebits bits"
21681 *) bits="$selectminbits bits" ;;
21683 echo "Your select() operates on $bits at a time." >&4
21685 rp='What is the minimum number of bits your select() operates on?'
21686 case "$byteorder" in
21687 12345678) dflt=64 ;;
21693 selectminbits="$val"
21697 *) : no select, so pick a harmless default
21698 selectminbits=$safebits
21704 : Trace out the files included by signal.h, then look for SIGxxx names.
21705 if [ "X$fieldn" = X ]; then
21706 : Just make some guesses. We check them later.
21707 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21709 xxx=`echo '#include <signal.h>' |
21710 $cppstdin $cppminus $cppflags 2>/dev/null |
21711 $grep '^[ ]*#.*include' |
21712 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21713 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21716 for xx in $xxx /dev/null ; do
21717 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21719 case "$xxxfiles" in
21720 '') xxxfiles=`./findhdr signal.h` ;;
21723 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21724 print substr($2, 4, 20)
21726 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21727 print substr($3, 4, 20)
21729 : Append some common names just in case the awk scan failed.
21730 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21731 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21732 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21733 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21734 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21736 : generate a few handy files for later
21737 $cat > signal.c <<EOCP
21738 #include <sys/types.h>
21739 #include <signal.h>
21740 #$i_stdlib I_STDLIB
21742 #include <stdlib.h>
21747 /* Strange style to avoid deeply-nested #if/#else/#endif */
21750 # define NSIG (_NSIG)
21756 # define NSIG (SIGMAX+1)
21762 # define NSIG (SIG_MAX+1)
21768 # define NSIG (_SIG_MAX+1)
21774 # define NSIG (MAXSIG+1)
21780 # define NSIG (MAX_SIG+1)
21785 # ifdef SIGARRAYSIZE
21786 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21792 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21796 /* Default to some arbitrary number that's big enough to get most
21797 of the common signals.
21803 printf("NSIG %d\n", NSIG);
21809 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21811 printf "#ifdef SIG"; printf $1; printf "\n"
21812 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21813 printf $1; printf ");\n"
21817 printf "#endif /* JUST_NSIG */\n";
21818 printf "exit(0);\n}\n";
21821 $cat >signal.awk <<'EOP'
21822 BEGIN { ndups = 0 }
21823 $1 ~ /^NSIG$/ { nsig = $2 }
21824 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21825 if ($2 > maxsig) { maxsig = $2 }
21826 if (sig_name[$2]) {
21827 dup_name[ndups] = $1
21828 dup_num[ndups] = $2
21840 printf("NSIG %d\n", nsig);
21841 for (n = 1; n < nsig; n++) {
21843 printf("%s %d\n", sig_name[n], sig_num[n])
21846 printf("NUM%d %d\n", n, n)
21849 for (n = 0; n < ndups; n++) {
21850 printf("%s %d\n", dup_name[n], dup_num[n])
21854 $cat >signal_cmd <<EOS
21856 if $test -s signal.lst; then
21857 echo "Using your existing signal.lst file"
21862 $cat >>signal_cmd <<'EOS'
21865 if eval $compile_ok; then
21866 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21867 $uniq | $awk -f signal.awk >signal.lst
21869 echo "(I can't seem be able to compile the whole test program)" >&4
21870 echo "(I'll try it in little pieces.)" >&4
21871 set signal -DJUST_NSIG
21872 if eval $compile_ok; then
21873 $run ./signal$_exe > signal.nsg
21876 echo "I can't seem to figure out how many signals you have." >&4
21877 echo "Guessing 50." >&4
21878 echo 'NSIG 50' > signal.nsg
21880 : Now look at all the signal names, one at a time.
21881 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21882 $cat > signal.c <<EOCP
21883 #include <sys/types.h>
21884 #include <signal.h>
21887 printf("$xx %d\n", SIG${xx});
21892 if eval $compile; then
21893 echo "SIG${xx} found."
21894 $run ./signal$_exe >> signal.ls1
21896 echo "SIG${xx} NOT found."
21899 if $test -s signal.ls1; then
21900 $cat signal.nsg signal.ls1 |
21901 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21905 if $test -s signal.lst; then
21908 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21909 echo 'kill -l' >signal
21910 set X `csh -f <signal`
21914 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21916 echo $@ | $tr ' ' $trnl | \
21917 $awk '{ printf "%s %d\n", $1, ++s; }
21918 END { printf "NSIG %d\n", ++s }' >signal.lst
21920 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21922 chmod a+x signal_cmd
21923 $eunicefix signal_cmd
21925 : generate list of signal names
21927 case "$sig_name_init" in
21929 *) case "$sig_num_init" in
21930 ''|*,*) doinit=yes ;;
21935 echo "Generating a list of signal names and numbers..." >&4
21937 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21938 sig_name=`$awk 'BEGIN { printf "ZERO " }
21939 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21940 sig_num=`$awk 'BEGIN { printf "0 " }
21941 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21942 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21943 !/^NSIG/ { printf "\"%s\", ", $1 }
21944 END { printf "0\n" }' signal.lst`
21945 sig_num_init=`$awk 'BEGIN { printf "0, " }
21946 !/^NSIG/ { printf "%d, ", $2}
21947 END { printf "0\n"}' signal.lst`
21950 echo "The following $sig_count signals are available:"
21952 echo $sig_name | $awk \
21953 'BEGIN { linelen = 0 }
21955 for (i = 1; i <= NF; i++) {
21956 name = "SIG" $i " "
21957 linelen = linelen + length(name)
21958 if (linelen > 70) {
21960 linelen = length(name)
21966 sig_size=`echo $sig_name | awk '{print NF}'`
21967 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21969 : Check size of size
21971 case "$sizetype" in
21972 *_t) zzz="$sizetype" ;;
21973 *) zzz="filesize" ;;
21975 echo "Checking the size of $zzz..." >&4
21977 #include <sys/types.h>
21979 #$i_stdlib I_STDLIB
21981 #include <stdlib.h>
21984 printf("%d\n", (int)sizeof($sizetype));
21989 if eval $compile_ok; then
21993 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21996 echo "Your $zzz size is $sizesize bytes."
22001 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22005 : check for socklen_t
22007 echo "Checking to see if you have socklen_t..." >&4
22009 #include <sys/types.h>
22010 #$d_socket HAS_SOCKET
22012 #include <sys/socket.h>
22014 int main() { socklen_t x = 16; }
22017 if eval $compile; then
22019 echo "You have socklen_t."
22022 echo "You do not have socklen_t."
22023 case "$sizetype" in
22024 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22031 : see if this is a socks.h system
22032 set socks.h i_socks
22035 : check for type of the size argument to socket calls
22036 case "$d_socket" in
22040 Checking to see what type is the last argument of accept().
22043 case "$d_socklen_t" in
22044 "$define") yyy="$yyy socklen_t"
22046 yyy="$yyy $sizetype int long unsigned"
22047 for xxx in $yyy; do
22048 case "$socksizetype" in
22049 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22050 case "$usesocks" in
22052 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22053 echo "Your system accepts '$xxx *' for the last argument of accept()."
22054 socksizetype="$xxx"
22057 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22058 echo "Your system accepts '$xxx *' for the last argument of accept()."
22059 socksizetype="$xxx"
22066 : In case none of those worked, prompt the user.
22067 case "$socksizetype" in
22068 '') rp='What is the type for socket address structure sizes?'
22075 *) : no sockets, so pick relatively harmless default
22080 : see what type is used for signed size_t
22081 set ssize_t ssizetype int stdio.h sys/types.h
22086 #$i_stdlib I_STDLIB
22088 #include <stdlib.h>
22090 #include <sys/types.h>
22091 #define Size_t $sizetype
22092 #define SSize_t $dflt
22095 if (sizeof(Size_t) == sizeof(SSize_t))
22097 else if (sizeof(Size_t) == sizeof(int))
22106 if eval $compile_ok && $run ./try > /dev/null; then
22107 ssizetype=`$run ./try`
22108 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22111 Help! I can't compile and run the ssize_t test program: please enlighten me!
22112 (This is probably a misconfiguration in your system or libraries, and
22113 you really ought to fix it. Still, I'll try anyway.)
22115 I need a type that is the same size as $sizetype, but is guaranteed to
22116 be signed. Common values are ssize_t, int and long.
22119 rp="What signed type is the same size as $sizetype?"
22125 : Check the size of st_ino
22127 $echo "Checking the size of st_ino..." >&4
22128 $cat > try.c <<EOCP
22129 #include <sys/stat.h>
22131 #$i_stdlib I_STDLIB
22133 #include <stdlib.h>
22137 printf("%d\n", (int)sizeof(st.st_ino));
22142 if eval $compile_ok; then
22146 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22148 *) st_ino_size=$val
22149 $echo "Your st_ino is $st_ino_size bytes long."
22154 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22158 : Check if st_ino is signed
22160 $echo "Checking the sign of st_ino..." >&4
22161 $cat > try.c <<EOCP
22162 #include <sys/stat.h>
22167 if (foo.st_ino < 0)
22174 if eval $compile; then
22178 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22180 *) st_ino_sign=$val
22181 case "$st_ino_sign" in
22182 1) $echo "Your st_ino is unsigned." ;;
22183 -1) $echo "Your st_ino is signed." ;;
22189 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22193 : see what type of char stdio uses.
22195 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22196 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22197 echo "Your stdio uses unsigned chars." >&4
22198 stdchar="unsigned char"
22200 echo "Your stdio uses signed chars." >&4
22205 : see what type uids are declared as in the kernel
22207 echo "Looking for the type for user ids returned by getuid()."
22208 set uid_t uidtype xxx stdio.h sys/types.h
22212 xxx=`./findhdr sys/user.h`
22213 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22215 unsigned) dflt="$1 $2" ;;
22219 *) dflt="$uidtype";;
22222 uid_t) echo "uid_t found." ;;
22223 *) rp="What is the type for user ids returned by getuid()?"
22229 : Check size of UID
22232 *_t) zzz="$uidtype" ;;
22235 echo "Checking the size of $zzz..." >&4
22237 #include <sys/types.h>
22239 #$i_stdlib I_STDLIB
22241 #include <stdlib.h>
22244 printf("%d\n", (int)sizeof($uidtype));
22249 if eval $compile_ok; then
22253 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22256 echo "Your $zzz is $uidsize bytes long."
22261 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22264 : Check if UID is signed
22267 *_t) zzz="$uidtype" ;;
22270 echo "Checking the sign of $zzz..." >&4
22272 #include <sys/types.h>
22283 if eval $compile; then
22287 echo "(I can't execute the test program--guessing unsigned.)" >&4
22291 1) echo "Your $zzz is unsigned." ;;
22292 -1) echo "Your $zzz is signed." ;;
22298 echo "(I can't compile the test program--guessing unsigned.)" >&4
22302 : Check format string for UID
22304 $echo "Checking the format string to be used for uids..." >&4
22307 -1) if $test X"$uidsize" = X"$ivsize"; then
22308 uidformat="$ivdformat"
22310 if $test X"$uidsize" = X"$longsize"; then
22313 if $test X"$uidsize" = X"$intsize"; then
22316 if $test X"$uidsize" = X"$shortsize"; then
22323 *) if $test X"$uidsize" = X"$uvsize"; then
22324 uidformat="$uvuformat"
22326 if $test X"$uidsize" = X"$longsize"; then
22329 if $test X"$uidsize" = X"$intsize"; then
22332 if $test X"$uidsize" = X"$shortsize"; then
22341 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22343 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22344 $cat >try.c <<'EOM'
22345 /* Intentionally a long probe as I'd like to sanity check that the exact
22346 approach is going to work, as thinking it will work, but only having it
22347 part working at runtime is worse than not having it. */
22349 #include <sys/types.h>
22350 #include <sys/sysctl.h>
22351 #include <sys/param.h>
22353 #include <string.h>
22354 #include <stdlib.h>
22355 #include <unistd.h>
22358 main(int argc, char **argv) {
22360 char *argv_leaf = strrchr(argv[0], '/');
22366 mib[1] = KERN_PROC;
22367 mib[2] = KERN_PROC_PATHNAME;
22371 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22375 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22380 if (size < strlen(argv_leaf) + 1) {
22381 fprintf(stderr, "size %lu is too short for a path\n",
22382 (unsigned long) size);
22386 if (size > MAXPATHLEN * MAXPATHLEN) {
22387 fprintf(stderr, "size %lu is too long for a path\n",
22388 (unsigned long) size);
22392 buffer = malloc(size);
22398 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22403 if (strlen(buffer) + 1 != size) {
22404 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22405 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22410 if (*buffer != '/') {
22411 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22415 if (strstr(buffer, "/./")) {
22416 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22420 if (strstr(buffer, "/../")) {
22421 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22425 buffer_leaf = strrchr(buffer, '/');
22426 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22427 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22439 if eval $compile; then
22440 if $run ./try; then
22441 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22444 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22448 echo "I'm unable to compile the test program." >&4
22449 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22453 set usekernprocpathname
22456 : Determine if we can use _NSGetExecutablePath to find executing program
22458 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22459 $cat >try.c <<'EOM'
22460 /* Intentionally a long probe as I'd like to sanity check that the exact
22461 approach is going to work, as thinking it will work, but only having it
22462 part working at runtime is worse than not having it. */
22463 #include <mach-o/dyld.h>
22465 #include <stdlib.h>
22466 #include <sys/param.h>
22467 #include <string.h>
22470 main(int argc, char **argv) {
22472 uint32_t size = sizeof(buf);
22476 char *argv_leaf = strrchr(argv[0], '/');
22480 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22484 _NSGetExecutablePath(buf, &size);
22485 if (size > MAXPATHLEN * MAXPATHLEN) {
22486 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22487 (unsigned int) size);
22491 buffer = malloc(size);
22497 result = _NSGetExecutablePath(buffer, &size);
22499 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22500 result, (unsigned int) size);
22504 tidied = realpath(buffer, NULL);
22506 perror("realpath");
22512 if (*tidied != '/') {
22513 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22517 if (strstr(tidied, "/./")) {
22518 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22522 if (strstr(tidied, "/../")) {
22523 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22527 tidied_leaf = strrchr(tidied, '/');
22528 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22529 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22541 if eval $compile; then
22542 if $run ./try; then
22543 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22546 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22549 echo "I'm unable to compile the test program." >&4
22550 echo "I'll assume no _NSGetExecutablePath here." >&4
22553 set usensgetexecutablepath
22556 : Check if site customization support was requested
22557 case "$usesitecustomize" in
22558 $define|true|[Yy]*)
22559 usesitecustomize="$define"
22562 usesitecustomize="$undef"
22566 : see if prototypes support variable argument declarations
22568 case "$prototype$i_stdarg" in
22570 echo "It appears we'll be able to prototype varargs functions." >&4
22574 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22581 : determine compiler compiler
22590 if $test -f "$byacc$_exe"; then
22592 comp="byacc or $comp"
22594 if $test -f "$bison$_exe"; then
22595 comp="$comp or bison -y"
22597 rp="Which compiler compiler ($comp) shall I use?"
22606 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22612 : see if this is a assert.h system
22613 set assert.h i_assert
22616 : see if this is a bfd.h system
22620 : see if this is an execinfo.h system
22621 set execinfo.h i_execinfo
22624 : see if this is a fenv.h system
22628 : see if this is a fp.h system
22632 : see if this is a fp_class.h system
22633 set fp_class.h i_fp_class
22636 : see if gdbm.h is available
22641 : see if gdbm_open exists
22642 set gdbm_open d_gdbm_open
22644 case "$d_gdbm_open" in
22647 echo "We won't be including <gdbm.h>"
22656 : see if this is a ieeefp.h system
22657 case "$i_ieeefp" in
22658 '' ) set ieeefp.h i_ieeefp
22663 : see if this is a libutil.h system
22664 set libutil.h i_libutil
22667 : see if mach cthreads are available
22668 if test "X$usethreads" = "X$define"; then
22669 set mach/cthreads.h i_machcthr
22672 i_machcthr="$undef"
22675 : see if this is a mntent.h system
22676 set mntent.h i_mntent
22679 : see if net/errno.h is available
22681 set net/errno.h val
22684 : Unfortunately, it causes problems on some systems. Arrgh.
22687 cat > try.c <<'EOM'
22690 #include <net/errno.h>
22696 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22697 echo "We'll be including <net/errno.h>." >&4
22699 echo "We won't be including <net/errno.h>." >&4
22708 : see if netinet/tcp.h is available
22709 set netinet/tcp.h i_netinettcp
22712 : see if this is a poll.h system
22716 : see if this is a prot.h system
22720 : Preprocessor symbols
22722 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22723 $cat <<'EOSH' > Cppsym.know
22724 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22725 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22726 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22727 arch_pwr ardent ARM ARM32 atarist att386 att3b
22728 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22729 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22730 byteorder byte_order
22731 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22732 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22733 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22734 ELF encore EPI EXTENSIONS
22735 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22736 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22737 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22738 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22739 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22740 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22741 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22742 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22743 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22745 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22746 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22747 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22749 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22750 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22751 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22752 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22753 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22754 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22755 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22756 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22757 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22758 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22759 ns32000 ns32016 ns32332 ns32k nsc32000
22760 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22761 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22762 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22763 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22765 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22766 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22767 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22768 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22769 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22770 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22771 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22772 SYSV4 SYSV5 sysV68 sysV88
22773 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22774 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22775 tower32_800 tower32_850 tss
22776 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22777 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22778 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22779 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22780 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22781 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22783 vax venix VMESA vms
22784 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22785 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22788 # Maybe put other stuff here too.
22789 ./tr '-' '_' <<EOSH >>Cppsym.know
22792 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22793 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22794 $cat Cppsym.know > Cppsym.c
22795 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22796 $rm -f Cppsym.a Cppsym.b Cppsym.c
22797 cat <<EOSH > Cppsym
22799 if $test \$# -gt 0; then
22800 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22801 if $test -s Cppsym.got; then
22808 $tr " " "$trnl" | ./Cppsym.try
22814 cat <<EOSH > Cppsym.try
22816 cat <<'EOCP' > try.c
22819 #define STRINGIFY(a) "a"
22821 #if cpp_stuff == 42
22822 #define StGiFy(a) #a
22823 #define STRINGIFY(a) StGiFy(a)
22825 #if $cpp_stuff != 1 && $cpp_stuff != 42
22826 # include "Bletch: How does this C preprocessor stringify macros?"
22832 cat <<'EOSH' >> Cppsym.try
22834 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22835 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22836 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22837 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22839 echo 'return 0;}' >> try.c
22841 cat <<EOSH >> Cppsym.try
22843 case "$osname-$gccversion" in
22844 irix-) ccflags="\$ccflags -woff 1178" ;;
22845 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22847 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22849 chmod +x Cppsym.try
22850 $eunicefix Cppsym.try
22851 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22852 : Add in any Linux cpp "predefined macros":
22853 case "$osname::$gccversion" in
22854 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22856 rm -f $tHdrH'.h' $tHdrH
22858 # Filter out macro arguments, such as Linux's __INT8_C(c)
22859 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22860 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22861 if [ -s $tHdrH'_cppsym.real' ]; then
22862 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22865 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22868 : now check the C compiler for additional symbols
22869 postprocess_cc_v=''
22871 aix) postprocess_cc_v="|$tr , ' '" ;;
22878 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22881 -D*) echo "\$i" | $sed 's/^-D//';;
22882 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22887 postprocess_cc_v=''
22890 ./ccsym > ccsym1.raw
22891 if $test -s ccsym1.raw; then
22892 $sort ccsym1.raw | $uniq >ccsym.raw
22894 mv ccsym1.raw ccsym.raw
22897 $awk '/\=/ { print $0; next }
22898 { print $0"=1" }' ccsym.raw >ccsym.list
22899 $comm -13 Cppsym.true ccsym.list >ccsym.own
22900 $comm -12 Cppsym.true ccsym.list >ccsym.com
22901 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22903 if $test -z ccsym.raw; then
22904 echo "Your C compiler doesn't seem to define any symbols!" >&4
22906 echo "However, your C preprocessor defines the following symbols:"
22909 cppsymbols=`$cat Cppsym.true`
22910 cppsymbols=`echo $cppsymbols`
22911 cppccsymbols="$cppsymbols"
22913 if $test -s ccsym.com; then
22914 echo "Your C compiler and pre-processor define these symbols:"
22915 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22918 cppccsymbols=`$cat ccsym.com`
22919 cppccsymbols=`echo $cppccsymbols`
22920 $test "$silent" || sleep 1
22922 if $test -s ccsym.cpp; then
22923 $test "$also" && echo " "
22924 echo "Your C pre-processor ${also}defines the following symbols:"
22925 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22927 cppsymbols=`$cat ccsym.cpp`
22928 cppsymbols=`echo $cppsymbols`
22929 $test "$silent" || sleep 1
22931 if $test -s ccsym.own; then
22932 $test "$also" && echo " "
22933 echo "Your C compiler ${also}defines the following cpp symbols:"
22934 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22935 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22936 ccsymbols=`$cat ccsym.own`
22937 ccsymbols=`echo $ccsymbols`
22938 $test "$silent" || sleep 1
22942 : add -D_FORTIFY_SOURCE if feasible and not already there
22943 case "$gccversion" in
22944 4.*) case "$optimize$ccflags" in
22945 *-O*) case "$ccflags$cppsymbols" in
22946 *_FORTIFY_SOURCE=*) # Don't add it again.
22947 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22949 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22950 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22954 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22958 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22962 : see if this is a termio system
22966 if $test `./findhdr termios.h`; then
22967 set tcsetattr i_termios
22973 "$define") echo "You have POSIX termios.h... good!" >&4;;
22974 *) if ./Cppsym pyr; then
22975 case "`$run /bin/universe`" in
22976 ucb) if $test `./findhdr sgtty.h`; then
22978 echo "<sgtty.h> found." >&4
22980 echo "System is pyramid with BSD universe."
22981 ./warn "<sgtty.h> not found--you could have problems."
22983 *) if $test `./findhdr termio.h`; then
22985 echo "<termio.h> found." >&4
22987 echo "System is pyramid with USG universe."
22988 ./warn "<termio.h> not found--you could have problems."
22992 if $test `./findhdr termio.h`; then
22993 echo "<termio.h> found." >&4
22995 elif $test `./findhdr sgtty.h`; then
22996 echo "<sgtty.h> found." >&4
22999 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23002 if $test `./findhdr sgtty.h`; then
23003 echo "<sgtty.h> found." >&4
23005 elif $test `./findhdr termio.h`; then
23006 echo "<termio.h> found." >&4
23009 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23013 set i_termio; eval $setvar
23014 val=$val2; set i_sgtty; eval $setvar
23015 val=$val3; set i_termios; eval $setvar
23017 : see if stdbool is available
23018 : we want a real compile instead of Inhdr because some Solaris systems
23019 : have stdbool.h, but it can only be used if the compiler indicates it
23020 : is sufficiently c99-compliant.
23024 #include <stdbool.h>
23029 int main(int argc, char **argv)
23035 if eval $compile; then
23036 echo "<stdbool.h> found." >&4
23039 echo "<stdbool.h> NOT found." >&4
23046 : see if stddef is available
23047 set stddef.h i_stddef
23050 : see if stdint is available
23051 set stdint.h i_stdint
23054 : see if sys/access.h is available
23055 set sys/access.h i_sysaccess
23058 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23059 set sys/filio.h i_sysfilio
23062 if $test `./findhdr sys/ioctl.h`; then
23064 echo '<sys/ioctl.h> found.' >&4
23067 if $test $i_sysfilio = "$define"; then
23068 echo '<sys/ioctl.h> NOT found.' >&4
23070 $test $i_sgtty = "$define" && xxx="sgtty.h"
23071 $test $i_termio = "$define" && xxx="termio.h"
23072 $test $i_termios = "$define" && xxx="termios.h"
23073 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23079 : see if socket ioctl defs are in sys/sockio.h
23081 xxx=`./findhdr sys/sockio.h`
23082 if $test "$xxx"; then
23083 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23085 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23088 echo "No socket ioctls found in <sys/sockio.h>." >&4
23093 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23099 : see if this is a syslog.h system
23100 set syslog.h i_syslog
23103 : see if this is a sys/mode.h system
23104 set sys/mode.h i_sysmode
23107 : see if there is a sys/poll.h file
23108 set sys/poll.h i_syspoll
23111 : see if sys/resource.h has to be included
23112 set sys/resource.h i_sysresrc
23115 : see if sys/security.h is available
23116 set sys/security.h i_syssecrt
23119 : see if this is a sys/statvfs.h system
23120 set sys/statvfs.h i_sysstatvfs
23123 : see if this is a sys/un.h system
23124 set sys/un.h i_sysun
23127 : see if this is a sys/utsname.h system
23128 set sys/utsname.h i_sysutsname
23131 : see if this is a syswait system
23132 set sys/wait.h i_syswait
23135 : see if this is a ustat.h system
23136 set ustat.h i_ustat
23139 : see if this is an utime system
23140 set utime.h i_utime
23143 : see if this is a vfork system
23146 set vfork.h i_vfork
23156 echo "Looking for extensions..." >&4
23157 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23158 : contain old or inaccurate or duplicate values.
23159 nonxs_extensions=''
23161 : We do not use find because it might not be available.
23162 : We do not just use MANIFEST because the user may have dropped
23163 : some additional extensions into the source tree and expect them
23166 : Function to recursively find available extensions, ignoring DynaLoader
23167 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23168 : In 5.10.1 and later, extensions are stored in directories
23169 : like File-Glob instead of the older File/Glob/.
23173 DynaLoader|dynaload) ;;
23175 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
23176 case "$this_ext" in
23177 Scalar/List/Utils) this_ext="List/Util" ;;
23178 PathTools) this_ext="Cwd" ;;
23180 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
23181 if $contains " $this_ext " $tdir/$$.tmp; then
23183 echo "Duplicate directories detected for extension $xxx" >&4;
23184 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23185 case "$knowitall" in
23193 echo "Ok. Stopping Configure." >&4;
23194 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23197 echo "Ok. You will need to correct config.sh before running make." >&4;
23199 $ls -1 $xxx > $tdir/$$.tmp;
23200 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
23201 xs_extensions="$xs_extensions $this_ext";
23202 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
23203 xs_extensions="$xs_extensions $this_ext";
23204 elif $test -d $xxx; then
23205 nonxs_extensions="$nonxs_extensions $this_ext";
23207 $rm -f $tdir/$$.tmp;
23215 eval $find_extensions
23219 eval $find_extensions
23223 eval $find_extensions
23224 set X $xs_extensions
23226 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23227 set X $nonxs_extensions
23229 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23231 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23233 : Now see which are supported on this system.
23235 for xxx in $xs_extensions ; do
23239 $define) avail_ext="$avail_ext $xxx" ;;
23242 GDBM_File|gdbm_fil)
23244 $define) avail_ext="$avail_ext $xxx" ;;
23247 I18N/Langinfo|i18n_lan)
23248 case "$i_langinfo$d_nl_langinfo" in
23249 $define$define) avail_ext="$avail_ext $xxx" ;;
23253 : XXX Do we need a useipcsysv variable here
23254 case "${d_msg}${d_sem}${d_shm}" in
23255 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23258 NDBM_File|ndbm_fil)
23261 case "$osname-$use64bitint" in
23264 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23267 *) avail_ext="$avail_ext $xxx" ;;
23272 ODBM_File|odbm_fil)
23273 case "${i_dbm}${i_rpcsvcdbm}" in
23275 case "$d_cplusplus" in
23276 define) ;; # delete as a function name will not work
23277 *) case "$osname-$use64bitint" in
23280 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23283 *) avail_ext="$avail_ext $xxx" ;;
23291 case "$useopcode" in
23292 true|define|y) avail_ext="$avail_ext $xxx" ;;
23296 case "$useposix" in
23297 true|define|y) avail_ext="$avail_ext $xxx" ;;
23301 case "$d_socket" in
23302 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23305 Sys/Syslog|sys/syslog)
23306 : XXX syslog requires socket
23307 case "$d_socket" in
23308 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23312 case "$usethreads" in
23314 case "$use5005threads" in
23315 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23319 threads|threads/shared)
23320 # threads and threads::shared are special cases.
23321 # To stop people from asking "Perl 5.8.0 was supposed
23322 # to have this new fancy threads implementation but my
23323 # perl doesn't have it" and from people trying to
23324 # (re)install the threads module using CPAN.pm and
23325 # CPAN.pm then offering to reinstall Perl 5.8.0,
23326 # the threads.pm and threads/shared.pm will always be
23327 # there, croaking informatively ("you need to rebuild
23328 # all of Perl with threads, sorry") when threads haven't
23329 # been compiled in.
23331 avail_ext="$avail_ext $xxx"
23337 cygwin) avail_ext="$avail_ext $xxx" ;;
23340 XS/APItest|xs/apitest)
23341 # This is just for testing. Skip it unless we have dynamic loading.
23344 $define) avail_ext="$avail_ext $xxx" ;;
23347 XS/Typemap|xs/typemap)
23348 # This is just for testing. Skip it unless we have dynamic loading.
23350 $define) avail_ext="$avail_ext $xxx" ;;
23353 *) avail_ext="$avail_ext $xxx"
23362 case "$onlyextensions" in
23364 *) keepextensions=''
23365 echo "You have requested that only certain extensions be included..." >&4
23366 for i in $onlyextensions; do
23367 case " $avail_ext " in
23369 echo "Keeping extension $i."
23370 keepextensions="$keepextensions $i"
23372 *) echo "Ignoring extension $i." ;;
23375 avail_ext="$keepextensions"
23379 case "$noextensions" in
23381 *) keepextensions=''
23382 echo "You have requested that certain extensions be ignored..." >&4
23383 for i in $avail_ext; do
23384 case " $noextensions " in
23385 *" $i "*) echo "Ignoring extension $i." ;;
23386 *) echo "Keeping extension $i.";
23387 keepextensions="$keepextensions $i"
23391 avail_ext="$keepextensions"
23395 : Now see which nonxs extensions are supported on this system.
23396 : For now assume all are.
23398 for xxx in $nonxs_extensions ; do
23402 *) nonxs_ext="$nonxs_ext $xxx"
23414 A number of extensions are supplied with $package. You may choose to
23415 compile these extensions for dynamic loading (the default), compile
23416 them into the $package executable (static loading), or not include
23417 them at all. Answer "none" to include no extensions.
23418 Note that DynaLoader is always built and need not be mentioned here.
23421 case "$dynamic_ext" in
23423 : Exclude those listed in static_ext
23425 for xxx in $avail_ext; do
23426 case " $static_ext " in
23428 *) dflt="$dflt $xxx" ;;
23435 *) dflt="$dynamic_ext"
23436 # Perhaps we are reusing an old out-of-date config.sh.
23439 if test X"$dynamic_ext" != X"$avail_ext"; then
23441 NOTICE: Your previous config.sh list may be incorrect.
23442 The extensions now available to you are
23444 but the default list from your previous config.sh is
23456 rp="What extensions do you wish to load dynamically?"
23459 none) dynamic_ext=' ' ;;
23460 *) dynamic_ext="$ans" ;;
23463 case "$static_ext" in
23465 : Exclude those already listed in dynamic linking
23467 for xxx in $avail_ext; do
23468 case " $dynamic_ext " in
23470 *) dflt="$dflt $xxx" ;;
23477 *) dflt="$static_ext"
23484 rp="What extensions do you wish to load statically?"
23487 none) static_ext=' ' ;;
23488 *) static_ext="$ans" ;;
23493 A number of extensions are supplied with $package. Answer "none"
23494 to include no extensions.
23495 Note that DynaLoader is always built and need not be mentioned here.
23498 case "$static_ext" in
23499 '') dflt="$avail_ext" ;;
23500 *) dflt="$static_ext"
23501 # Perhaps we are reusing an old out-of-date config.sh.
23504 if test X"$static_ext" != X"$avail_ext"; then
23506 NOTICE: Your previous config.sh list may be incorrect.
23507 The extensions now available to you are
23509 but the default list from your previous config.sh is
23518 : Exclude those that are not xs extensions
23522 rp="What extensions do you wish to include?"
23525 none) static_ext=' ' ;;
23526 *) static_ext="$ans" ;;
23531 # Encode is a special case. If we are building Encode as a static
23532 # extension, we need to explicitly list its subextensions as well.
23533 # For other nested extensions, this is handled automatically by
23534 # the appropriate Makefile.PL.
23535 case " $static_ext " in
23536 *" Encode "*) # Add the subextensions of Encode
23538 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23539 static_ext="$static_ext Encode/$xxx"
23540 known_extensions="$known_extensions Encode/$xxx"
23546 set X $dynamic_ext $static_ext $nonxs_ext
23550 # Sanity check: We require an extension suitable for use with
23551 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23552 # should show up as failures in the test suite, but it's helpful to
23553 # catch them now.) The 'extensions' list is normally sorted
23554 # alphabetically, so we need to accept either
23555 # DB_File ... Fcntl ... IO ....
23556 # or something like
23557 # Fcntl ... NDBM_File ... IO ....
23558 case " $extensions" in
23559 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23560 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23561 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23562 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23563 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23567 : Remove libraries needed only for extensions
23568 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23569 : The exception is SunOS 4.x, which needs them.
23570 case "${osname}X${osvers}" in
23574 *) case "$usedl" in
23575 $define|true|[yY]*)
23576 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23580 *) perllibs="$libs"
23586 : Remove build directory name from cppstdin so it can be used from
23587 : either the present location or the final installed location.
23589 : Get out of the UU directory to get correct path name.
23591 case "$cppstdin" in
23593 echo "Stripping down cppstdin path name"
23599 : end of configuration questions
23601 echo "End of configuration questions."
23604 : back to where it started
23605 if test -d ../UU; then
23609 : configuration may be unconditionally patched via a 'config.arch' file
23610 if $test -f config.arch; then
23611 echo "I see a config.arch file, loading it." >&4
23615 : configuration may be patched via a 'config.over' file
23616 if $test -f config.over; then
23619 rp='I see a config.over file. Do you wish to load it?'
23622 n*) echo "OK, I'll ignore it.";;
23624 echo "Configuration override changes have been loaded."
23629 : in case they want portability, strip down executable paths
23630 case "$d_portable" in
23633 echo "Stripping down executable paths..." >&4
23634 for file in $loclist $trylist; do
23636 eval $file=`basename $temp`
23641 : create config.sh file
23643 echo "Creating config.sh..." >&4
23644 $spitshell <<EOT >config.sh
23647 # This file was produced by running the Configure script. It holds all the
23648 # definitions figured out by Configure. Should you modify one of these values,
23649 # do not forget to propagate your changes by running "Configure -der". You may
23650 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23653 # Package name : $package
23654 # Source directory : $src
23655 # Configuration time: $cf_time
23656 # Configured by : $cf_by
23657 # Target system : $myuname
23660 : Add in command line options if available
23661 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23663 $spitshell <<EOT >>config.sh
23672 Revision='$Revision'
23680 alignbytes='$alignbytes'
23681 ansi2knr='$ansi2knr'
23682 aphostname='$aphostname'
23683 api_revision='$api_revision'
23684 api_subversion='$api_subversion'
23685 api_version='$api_version'
23686 api_versionstring='$api_versionstring'
23689 archlibexp='$archlibexp'
23690 archname64='$archname64'
23691 archname='$archname'
23692 archobjs='$archobjs'
23693 asctime_r_proto='$asctime_r_proto'
23702 byteorder='$byteorder'
23704 castflags='$castflags'
23707 cccdlflags='$cccdlflags'
23708 ccdlflags='$ccdlflags'
23710 ccflags_uselargefiles='$ccflags_uselargefiles'
23712 ccsymbols='$ccsymbols'
23713 ccversion='$ccversion'
23715 cf_email='$cf_email'
23717 charbits='$charbits'
23718 charsize='$charsize'
23722 clocktype='$clocktype'
23724 compress='$compress'
23725 contains='$contains'
23729 cpp_stuff='$cpp_stuff'
23730 cppccsymbols='$cppccsymbols'
23731 cppflags='$cppflags'
23733 cppminus='$cppminus'
23735 cppstdin='$cppstdin'
23736 cppsymbols='$cppsymbols'
23737 crypt_r_proto='$crypt_r_proto'
23738 cryptlib='$cryptlib'
23740 ctermid_r_proto='$ctermid_r_proto'
23741 ctime_r_proto='$ctime_r_proto'
23742 d_Gconvert='$d_Gconvert'
23743 d_PRIEUldbl='$d_PRIEUldbl'
23744 d_PRIFUldbl='$d_PRIFUldbl'
23745 d_PRIGUldbl='$d_PRIGUldbl'
23746 d_PRIXU64='$d_PRIXU64'
23747 d_PRId64='$d_PRId64'
23748 d_PRIeldbl='$d_PRIeldbl'
23749 d_PRIfldbl='$d_PRIfldbl'
23750 d_PRIgldbl='$d_PRIgldbl'
23751 d_PRIi64='$d_PRIi64'
23752 d_PRIo64='$d_PRIo64'
23753 d_PRIu64='$d_PRIu64'
23754 d_PRIx64='$d_PRIx64'
23755 d_SCNfldbl='$d_SCNfldbl'
23756 d__fwalk='$d__fwalk'
23757 d_access='$d_access'
23758 d_accessx='$d_accessx'
23762 d_archlib='$d_archlib'
23763 d_asctime64='$d_asctime64'
23764 d_asctime_r='$d_asctime_r'
23769 d_attribute_deprecated='$d_attribute_deprecated'
23770 d_attribute_format='$d_attribute_format'
23771 d_attribute_malloc='$d_attribute_malloc'
23772 d_attribute_nonnull='$d_attribute_nonnull'
23773 d_attribute_noreturn='$d_attribute_noreturn'
23774 d_attribute_pure='$d_attribute_pure'
23775 d_attribute_unused='$d_attribute_unused'
23776 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23777 d_backtrace='$d_backtrace'
23781 d_bsdgetpgrp='$d_bsdgetpgrp'
23782 d_bsdsetpgrp='$d_bsdsetpgrp'
23783 d_builtin_choose_expr='$d_builtin_choose_expr'
23784 d_builtin_expect='$d_builtin_expect'
23786 d_c99_variadic_macros='$d_c99_variadic_macros'
23787 d_casti32='$d_casti32'
23788 d_castneg='$d_castneg'
23790 d_charvspr='$d_charvspr'
23792 d_chroot='$d_chroot'
23793 d_chsize='$d_chsize'
23795 d_clearenv='$d_clearenv'
23796 d_closedir='$d_closedir'
23797 d_cmsghdr_s='$d_cmsghdr_s'
23799 d_copysign='$d_copysign'
23800 d_copysignl='$d_copysignl'
23801 d_cplusplus='$d_cplusplus'
23803 d_crypt_r='$d_crypt_r'
23805 d_ctermid='$d_ctermid'
23806 d_ctermid_r='$d_ctermid_r'
23807 d_ctime64='$d_ctime64'
23808 d_ctime_r='$d_ctime_r'
23809 d_cuserid='$d_cuserid'
23810 d_dbl_dig='$d_dbl_dig'
23811 d_dbminitproto='$d_dbminitproto'
23812 d_difftime64='$d_difftime64'
23813 d_difftime='$d_difftime'
23814 d_dir_dd_fd='$d_dir_dd_fd'
23816 d_dirnamlen='$d_dirnamlen'
23817 d_dladdr='$d_dladdr'
23818 d_dlerror='$d_dlerror'
23819 d_dlopen='$d_dlopen'
23820 d_dlsymun='$d_dlsymun'
23821 d_dosuid='$d_dosuid'
23822 d_drand48_r='$d_drand48_r'
23823 d_drand48proto='$d_drand48proto'
23825 d_eaccess='$d_eaccess'
23826 d_endgrent='$d_endgrent'
23827 d_endgrent_r='$d_endgrent_r'
23828 d_endhent='$d_endhent'
23829 d_endhostent_r='$d_endhostent_r'
23830 d_endnent='$d_endnent'
23831 d_endnetent_r='$d_endnetent_r'
23832 d_endpent='$d_endpent'
23833 d_endprotoent_r='$d_endprotoent_r'
23834 d_endpwent='$d_endpwent'
23835 d_endpwent_r='$d_endpwent_r'
23836 d_endsent='$d_endsent'
23837 d_endservent_r='$d_endservent_r'
23838 d_eofnblk='$d_eofnblk'
23841 d_eunice='$d_eunice'
23844 d_faststdio='$d_faststdio'
23845 d_fchdir='$d_fchdir'
23846 d_fchmod='$d_fchmod'
23847 d_fchown='$d_fchown'
23849 d_fcntl_can_lock='$d_fcntl_can_lock'
23850 d_fd_macros='$d_fd_macros'
23851 d_fd_set='$d_fd_set'
23853 d_fds_bits='$d_fds_bits'
23854 d_fegetround='$d_fegetround'
23855 d_fgetpos='$d_fgetpos'
23856 d_finite='$d_finite'
23857 d_finitel='$d_finitel'
23858 d_flexfnam='$d_flexfnam'
23860 d_flockproto='$d_flockproto'
23865 d_fp_class='$d_fp_class'
23866 d_fp_classify='$d_fp_classify'
23867 d_fp_classl='$d_fp_classl'
23868 d_fpathconf='$d_fpathconf'
23869 d_fpclass='$d_fpclass'
23870 d_fpclassify='$d_fpclassify'
23871 d_fpclassl='$d_fpclassl'
23872 d_fpgetround='$d_fpgetround'
23873 d_fpos64_t='$d_fpos64_t'
23874 d_frexpl='$d_frexpl'
23875 d_fs_data_s='$d_fs_data_s'
23876 d_fseeko='$d_fseeko'
23877 d_fsetpos='$d_fsetpos'
23878 d_fstatfs='$d_fstatfs'
23879 d_fstatvfs='$d_fstatvfs'
23881 d_ftello='$d_ftello'
23883 d_futimes='$d_futimes'
23884 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23885 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23886 d_getaddrinfo='$d_getaddrinfo'
23887 d_getcwd='$d_getcwd'
23888 d_getespwnam='$d_getespwnam'
23889 d_getfsstat='$d_getfsstat'
23890 d_getgrent='$d_getgrent'
23891 d_getgrent_r='$d_getgrent_r'
23892 d_getgrgid_r='$d_getgrgid_r'
23893 d_getgrnam_r='$d_getgrnam_r'
23894 d_getgrps='$d_getgrps'
23895 d_gethbyaddr='$d_gethbyaddr'
23896 d_gethbyname='$d_gethbyname'
23897 d_gethent='$d_gethent'
23898 d_gethname='$d_gethname'
23899 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23900 d_gethostbyname_r='$d_gethostbyname_r'
23901 d_gethostent_r='$d_gethostent_r'
23902 d_gethostprotos='$d_gethostprotos'
23903 d_getitimer='$d_getitimer'
23904 d_getlogin='$d_getlogin'
23905 d_getlogin_r='$d_getlogin_r'
23906 d_getmnt='$d_getmnt'
23907 d_getmntent='$d_getmntent'
23908 d_getnameinfo='$d_getnameinfo'
23909 d_getnbyaddr='$d_getnbyaddr'
23910 d_getnbyname='$d_getnbyname'
23911 d_getnent='$d_getnent'
23912 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23913 d_getnetbyname_r='$d_getnetbyname_r'
23914 d_getnetent_r='$d_getnetent_r'
23915 d_getnetprotos='$d_getnetprotos'
23916 d_getpagsz='$d_getpagsz'
23917 d_getpbyname='$d_getpbyname'
23918 d_getpbynumber='$d_getpbynumber'
23919 d_getpent='$d_getpent'
23920 d_getpgid='$d_getpgid'
23921 d_getpgrp2='$d_getpgrp2'
23922 d_getpgrp='$d_getpgrp'
23923 d_getppid='$d_getppid'
23924 d_getprior='$d_getprior'
23925 d_getprotobyname_r='$d_getprotobyname_r'
23926 d_getprotobynumber_r='$d_getprotobynumber_r'
23927 d_getprotoent_r='$d_getprotoent_r'
23928 d_getprotoprotos='$d_getprotoprotos'
23929 d_getprpwnam='$d_getprpwnam'
23930 d_getpwent='$d_getpwent'
23931 d_getpwent_r='$d_getpwent_r'
23932 d_getpwnam_r='$d_getpwnam_r'
23933 d_getpwuid_r='$d_getpwuid_r'
23934 d_getsbyname='$d_getsbyname'
23935 d_getsbyport='$d_getsbyport'
23936 d_getsent='$d_getsent'
23937 d_getservbyname_r='$d_getservbyname_r'
23938 d_getservbyport_r='$d_getservbyport_r'
23939 d_getservent_r='$d_getservent_r'
23940 d_getservprotos='$d_getservprotos'
23941 d_getspnam='$d_getspnam'
23942 d_getspnam_r='$d_getspnam_r'
23943 d_gettimeod='$d_gettimeod'
23944 d_gmtime64='$d_gmtime64'
23945 d_gmtime_r='$d_gmtime_r'
23946 d_gnulibc='$d_gnulibc'
23947 d_grpasswd='$d_grpasswd'
23948 d_hasmntopt='$d_hasmntopt'
23952 d_ilogbl='$d_ilogbl'
23953 d_inc_version_list='$d_inc_version_list'
23955 d_inetaton='$d_inetaton'
23956 d_inetntop='$d_inetntop'
23957 d_inetpton='$d_inetpton'
23958 d_int64_t='$d_int64_t'
23959 d_ip_mreq='$d_ip_mreq'
23960 d_ip_mreq_source='$d_ip_mreq_source'
23961 d_ipv6_mreq='$d_ipv6_mreq'
23962 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23963 d_isascii='$d_isascii'
23964 d_isblank='$d_isblank'
23965 d_isfinite='$d_isfinite'
23966 d_isfinitel='$d_isfinitel'
23968 d_isinfl='$d_isinfl'
23969 d_isless='$d_isless'
23971 d_isnanl='$d_isnanl'
23972 d_isnormal='$d_isnormal'
23975 d_killpg='$d_killpg'
23976 d_lc_monetary_2008='$d_lc_monetary_2008'
23977 d_lchown='$d_lchown'
23978 d_ldbl_dig='$d_ldbl_dig'
23979 d_ldexpl='$d_ldexpl'
23980 d_lgamma='$d_lgamma'
23981 d_lgamma_r='$d_lgamma_r'
23982 d_libm_lib_version='$d_libm_lib_version'
23983 d_libname_unique='$d_libname_unique'
23985 d_llrint='$d_llrint'
23986 d_llround='$d_llround'
23987 d_localtime64='$d_localtime64'
23988 d_localtime_r='$d_localtime_r'
23989 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23990 d_locconv='$d_locconv'
23995 d_longdbl='$d_longdbl'
23996 d_longlong='$d_longlong'
23998 d_lround='$d_lround'
23999 d_lseekproto='$d_lseekproto'
24001 d_madvise='$d_madvise'
24002 d_malloc_good_size='$d_malloc_good_size'
24003 d_malloc_size='$d_malloc_size'
24005 d_mbstowcs='$d_mbstowcs'
24006 d_mbtowc='$d_mbtowc'
24007 d_memchr='$d_memchr'
24008 d_memcmp='$d_memcmp'
24009 d_memcpy='$d_memcpy'
24010 d_memmove='$d_memmove'
24011 d_memset='$d_memset'
24013 d_mkdtemp='$d_mkdtemp'
24014 d_mkfifo='$d_mkfifo'
24015 d_mkstemp='$d_mkstemp'
24016 d_mkstemps='$d_mkstemps'
24017 d_mktime64='$d_mktime64'
24018 d_mktime='$d_mktime'
24021 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24022 d_modflproto='$d_modflproto'
24023 d_mprotect='$d_mprotect'
24025 d_msg_ctrunc='$d_msg_ctrunc'
24026 d_msg_dontroute='$d_msg_dontroute'
24027 d_msg_oob='$d_msg_oob'
24028 d_msg_peek='$d_msg_peek'
24029 d_msg_proxy='$d_msg_proxy'
24030 d_msgctl='$d_msgctl'
24031 d_msgget='$d_msgget'
24032 d_msghdr_s='$d_msghdr_s'
24033 d_msgrcv='$d_msgrcv'
24034 d_msgsnd='$d_msgsnd'
24036 d_munmap='$d_munmap'
24037 d_mymalloc='$d_mymalloc'
24040 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24041 d_nearbyint='$d_nearbyint'
24042 d_nextafter='$d_nextafter'
24043 d_nexttoward='$d_nexttoward'
24045 d_nl_langinfo='$d_nl_langinfo'
24046 d_nv_preserves_uv='$d_nv_preserves_uv'
24047 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24048 d_off64_t='$d_off64_t'
24049 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24050 d_oldpthreads='$d_oldpthreads'
24051 d_oldsock='$d_oldsock'
24053 d_pathconf='$d_pathconf'
24055 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24056 d_phostname='$d_phostname'
24059 d_portable='$d_portable'
24061 d_prctl_set_name='$d_prctl_set_name'
24062 d_printf_format_null='$d_printf_format_null'
24063 d_procselfexe='$d_procselfexe'
24064 d_pseudofork='$d_pseudofork'
24065 d_pthread_atfork='$d_pthread_atfork'
24066 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24067 d_pthread_yield='$d_pthread_yield'
24068 d_ptrdiff_t='$d_ptrdiff_t'
24070 d_pwchange='$d_pwchange'
24071 d_pwclass='$d_pwclass'
24072 d_pwcomment='$d_pwcomment'
24073 d_pwexpire='$d_pwexpire'
24074 d_pwgecos='$d_pwgecos'
24075 d_pwpasswd='$d_pwpasswd'
24076 d_pwquota='$d_pwquota'
24079 d_random_r='$d_random_r'
24080 d_re_comp='$d_re_comp'
24081 d_readdir64_r='$d_readdir64_r'
24082 d_readdir='$d_readdir'
24083 d_readdir_r='$d_readdir_r'
24084 d_readlink='$d_readlink'
24086 d_recvmsg='$d_recvmsg'
24087 d_regcmp='$d_regcmp'
24088 d_regcomp='$d_regcomp'
24089 d_remainder='$d_remainder'
24090 d_remquo='$d_remquo'
24091 d_rename='$d_rename'
24092 d_rewinddir='$d_rewinddir'
24096 d_safebcpy='$d_safebcpy'
24097 d_safemcpy='$d_safemcpy'
24098 d_sanemcmp='$d_sanemcmp'
24099 d_sbrkproto='$d_sbrkproto'
24100 d_scalbn='$d_scalbn'
24101 d_scalbnl='$d_scalbnl'
24102 d_sched_yield='$d_sched_yield'
24103 d_scm_rights='$d_scm_rights'
24104 d_seekdir='$d_seekdir'
24105 d_select='$d_select'
24107 d_semctl='$d_semctl'
24108 d_semctl_semid_ds='$d_semctl_semid_ds'
24109 d_semctl_semun='$d_semctl_semun'
24110 d_semget='$d_semget'
24112 d_sendmsg='$d_sendmsg'
24113 d_setegid='$d_setegid'
24114 d_seteuid='$d_seteuid'
24115 d_setgrent='$d_setgrent'
24116 d_setgrent_r='$d_setgrent_r'
24117 d_setgrps='$d_setgrps'
24118 d_sethent='$d_sethent'
24119 d_sethostent_r='$d_sethostent_r'
24120 d_setitimer='$d_setitimer'
24121 d_setlinebuf='$d_setlinebuf'
24122 d_setlocale='$d_setlocale'
24123 d_setlocale_r='$d_setlocale_r'
24124 d_setnent='$d_setnent'
24125 d_setnetent_r='$d_setnetent_r'
24126 d_setpent='$d_setpent'
24127 d_setpgid='$d_setpgid'
24128 d_setpgrp2='$d_setpgrp2'
24129 d_setpgrp='$d_setpgrp'
24130 d_setprior='$d_setprior'
24131 d_setproctitle='$d_setproctitle'
24132 d_setprotoent_r='$d_setprotoent_r'
24133 d_setpwent='$d_setpwent'
24134 d_setpwent_r='$d_setpwent_r'
24135 d_setregid='$d_setregid'
24136 d_setresgid='$d_setresgid'
24137 d_setresuid='$d_setresuid'
24138 d_setreuid='$d_setreuid'
24139 d_setrgid='$d_setrgid'
24140 d_setruid='$d_setruid'
24141 d_setsent='$d_setsent'
24142 d_setservent_r='$d_setservent_r'
24143 d_setsid='$d_setsid'
24144 d_setvbuf='$d_setvbuf'
24147 d_shmatprototype='$d_shmatprototype'
24148 d_shmctl='$d_shmctl'
24150 d_shmget='$d_shmget'
24151 d_sigaction='$d_sigaction'
24152 d_signbit='$d_signbit'
24153 d_sigprocmask='$d_sigprocmask'
24154 d_sigsetjmp='$d_sigsetjmp'
24155 d_sin6_scope_id='$d_sin6_scope_id'
24156 d_sitearch='$d_sitearch'
24157 d_snprintf='$d_snprintf'
24158 d_sockaddr_in6='$d_sockaddr_in6'
24159 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24160 d_sockatmark='$d_sockatmark'
24161 d_sockatmarkproto='$d_sockatmarkproto'
24162 d_socket='$d_socket'
24163 d_socklen_t='$d_socklen_t'
24164 d_sockpair='$d_sockpair'
24165 d_socks5_init='$d_socks5_init'
24166 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24168 d_srand48_r='$d_srand48_r'
24169 d_srandom_r='$d_srandom_r'
24170 d_sresgproto='$d_sresgproto'
24171 d_sresuproto='$d_sresuproto'
24173 d_statblks='$d_statblks'
24174 d_statfs_f_flags='$d_statfs_f_flags'
24175 d_statfs_s='$d_statfs_s'
24176 d_static_inline='$d_static_inline'
24177 d_statvfs='$d_statvfs'
24178 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24179 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24180 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24181 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24182 d_stdio_stream_array='$d_stdio_stream_array'
24183 d_stdiobase='$d_stdiobase'
24184 d_stdstdio='$d_stdstdio'
24185 d_strchr='$d_strchr'
24186 d_strcoll='$d_strcoll'
24187 d_strctcpy='$d_strctcpy'
24188 d_strerrm='$d_strerrm'
24189 d_strerror='$d_strerror'
24190 d_strerror_r='$d_strerror_r'
24191 d_strftime='$d_strftime'
24192 d_strlcat='$d_strlcat'
24193 d_strlcpy='$d_strlcpy'
24194 d_strtod='$d_strtod'
24195 d_strtol='$d_strtol'
24196 d_strtold='$d_strtold'
24197 d_strtoll='$d_strtoll'
24198 d_strtoq='$d_strtoq'
24199 d_strtoul='$d_strtoul'
24200 d_strtoull='$d_strtoull'
24201 d_strtouq='$d_strtouq'
24202 d_strxfrm='$d_strxfrm'
24203 d_suidsafe='$d_suidsafe'
24204 d_symlink='$d_symlink'
24205 d_syscall='$d_syscall'
24206 d_syscallproto='$d_syscallproto'
24207 d_sysconf='$d_sysconf'
24208 d_sysernlst='$d_sysernlst'
24209 d_syserrlst='$d_syserrlst'
24210 d_system='$d_system'
24211 d_tcgetpgrp='$d_tcgetpgrp'
24212 d_tcsetpgrp='$d_tcsetpgrp'
24213 d_telldir='$d_telldir'
24214 d_telldirproto='$d_telldirproto'
24215 d_tgamma='$d_tgamma'
24217 d_timegm='$d_timegm'
24219 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24220 d_tm_tm_zone='$d_tm_tm_zone'
24221 d_tmpnam_r='$d_tmpnam_r'
24223 d_truncate='$d_truncate'
24224 d_truncl='$d_truncl'
24225 d_ttyname_r='$d_ttyname_r'
24226 d_tzname='$d_tzname'
24227 d_u32align='$d_u32align'
24228 d_ualarm='$d_ualarm'
24231 d_union_semun='$d_union_semun'
24232 d_unordered='$d_unordered'
24233 d_unsetenv='$d_unsetenv'
24234 d_usleep='$d_usleep'
24235 d_usleepproto='$d_usleepproto'
24237 d_vendorarch='$d_vendorarch'
24238 d_vendorbin='$d_vendorbin'
24239 d_vendorlib='$d_vendorlib'
24240 d_vendorscript='$d_vendorscript'
24242 d_void_closedir='$d_void_closedir'
24243 d_voidsig='$d_voidsig'
24244 d_voidtty='$d_voidtty'
24245 d_volatile='$d_volatile'
24246 d_vprintf='$d_vprintf'
24247 d_vsnprintf='$d_vsnprintf'
24249 d_waitpid='$d_waitpid'
24250 d_wcscmp='$d_wcscmp'
24251 d_wcstombs='$d_wcstombs'
24252 d_wcsxfrm='$d_wcsxfrm'
24253 d_wctomb='$d_wctomb'
24254 d_writev='$d_writev'
24257 db_hashtype='$db_hashtype'
24258 db_prefixtype='$db_prefixtype'
24259 db_version_major='$db_version_major'
24260 db_version_minor='$db_version_minor'
24261 db_version_patch='$db_version_patch'
24262 direntrytype='$direntrytype'
24265 doublekind='$doublekind'
24266 doublesize='$doublesize'
24268 drand48_r_proto='$drand48_r_proto'
24270 dynamic_ext='$dynamic_ext'
24276 endgrent_r_proto='$endgrent_r_proto'
24277 endhostent_r_proto='$endhostent_r_proto'
24278 endnetent_r_proto='$endnetent_r_proto'
24279 endprotoent_r_proto='$endprotoent_r_proto'
24280 endpwent_r_proto='$endpwent_r_proto'
24281 endservent_r_proto='$endservent_r_proto'
24282 eunicefix='$eunicefix'
24285 extensions='$extensions'
24286 extern_C='$extern_C'
24288 fflushNULL='$fflushNULL'
24289 fflushall='$fflushall'
24291 firstmakefile='$firstmakefile'
24293 fpossize='$fpossize'
24294 fpostype='$fpostype'
24295 freetype='$freetype'
24298 full_csh='$full_csh'
24299 full_sed='$full_sed'
24300 gccansipedantic='$gccansipedantic'
24301 gccosandvers='$gccosandvers'
24302 gccversion='$gccversion'
24303 getgrent_r_proto='$getgrent_r_proto'
24304 getgrgid_r_proto='$getgrgid_r_proto'
24305 getgrnam_r_proto='$getgrnam_r_proto'
24306 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24307 gethostbyname_r_proto='$gethostbyname_r_proto'
24308 gethostent_r_proto='$gethostent_r_proto'
24309 getlogin_r_proto='$getlogin_r_proto'
24310 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24311 getnetbyname_r_proto='$getnetbyname_r_proto'
24312 getnetent_r_proto='$getnetent_r_proto'
24313 getprotobyname_r_proto='$getprotobyname_r_proto'
24314 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24315 getprotoent_r_proto='$getprotoent_r_proto'
24316 getpwent_r_proto='$getpwent_r_proto'
24317 getpwnam_r_proto='$getpwnam_r_proto'
24318 getpwuid_r_proto='$getpwuid_r_proto'
24319 getservbyname_r_proto='$getservbyname_r_proto'
24320 getservbyport_r_proto='$getservbyport_r_proto'
24321 getservent_r_proto='$getservent_r_proto'
24322 getspnam_r_proto='$getspnam_r_proto'
24323 gidformat='$gidformat'
24329 gmtime_r_proto='$gmtime_r_proto'
24330 gnulibc_version='$gnulibc_version'
24332 groupcat='$groupcat'
24333 groupstype='$groupstype'
24336 h_sysfile='$h_sysfile'
24339 hostgenerate='$hostgenerate'
24340 hostosname='$hostosname'
24341 hostperl='$hostperl'
24342 html1dir='$html1dir'
24343 html1direxp='$html1direxp'
24344 html3dir='$html3dir'
24345 html3direxp='$html3direxp'
24354 i_arpainet='$i_arpainet'
24355 i_assert='$i_assert'
24357 i_bsdioctl='$i_bsdioctl'
24361 i_dirent='$i_dirent'
24363 i_execinfo='$i_execinfo'
24368 i_fp_class='$i_fp_class'
24370 i_gdbm_ndbm='$i_gdbm_ndbm'
24371 i_gdbmndbm='$i_gdbmndbm'
24373 i_ieeefp='$i_ieeefp'
24374 i_inttypes='$i_inttypes'
24375 i_langinfo='$i_langinfo'
24376 i_libutil='$i_libutil'
24377 i_limits='$i_limits'
24378 i_locale='$i_locale'
24379 i_machcthr='$i_machcthr'
24380 i_malloc='$i_malloc'
24381 i_mallocmalloc='$i_mallocmalloc'
24383 i_memory='$i_memory'
24384 i_mntent='$i_mntent'
24387 i_neterrno='$i_neterrno'
24388 i_netinettcp='$i_netinettcp'
24392 i_pthread='$i_pthread'
24394 i_quadmath='$i_quadmath'
24395 i_rpcsvcdbm='$i_rpcsvcdbm'
24397 i_shadow='$i_shadow'
24399 i_stdarg='$i_stdarg'
24400 i_stdbool='$i_stdbool'
24401 i_stddef='$i_stddef'
24402 i_stdint='$i_stdint'
24403 i_stdlib='$i_stdlib'
24404 i_string='$i_string'
24405 i_sunmath='$i_sunmath'
24406 i_sysaccess='$i_sysaccess'
24407 i_sysdir='$i_sysdir'
24408 i_sysfile='$i_sysfile'
24409 i_sysfilio='$i_sysfilio'
24411 i_sysioctl='$i_sysioctl'
24412 i_syslog='$i_syslog'
24413 i_sysmman='$i_sysmman'
24414 i_sysmode='$i_sysmode'
24415 i_sysmount='$i_sysmount'
24416 i_sysndir='$i_sysndir'
24417 i_sysparam='$i_sysparam'
24418 i_syspoll='$i_syspoll'
24419 i_sysresrc='$i_sysresrc'
24420 i_syssecrt='$i_syssecrt'
24421 i_sysselct='$i_sysselct'
24422 i_syssockio='$i_syssockio'
24423 i_sysstat='$i_sysstat'
24424 i_sysstatfs='$i_sysstatfs'
24425 i_sysstatvfs='$i_sysstatvfs'
24426 i_systime='$i_systime'
24427 i_systimek='$i_systimek'
24428 i_systimes='$i_systimes'
24429 i_systypes='$i_systypes'
24430 i_sysuio='$i_sysuio'
24432 i_sysutsname='$i_sysutsname'
24433 i_sysvfs='$i_sysvfs'
24434 i_syswait='$i_syswait'
24435 i_termio='$i_termio'
24436 i_termios='$i_termios'
24438 i_unistd='$i_unistd'
24441 i_values='$i_values'
24442 i_varargs='$i_varargs'
24443 i_varhdr='$i_varhdr'
24445 ignore_versioned_solibs='$ignore_versioned_solibs'
24446 inc_version_list='$inc_version_list'
24447 inc_version_list_init='$inc_version_list_init'
24451 initialinstalllocation='$initialinstalllocation'
24452 installarchlib='$installarchlib'
24453 installbin='$installbin'
24454 installhtml1dir='$installhtml1dir'
24455 installhtml3dir='$installhtml3dir'
24456 installman1dir='$installman1dir'
24457 installman3dir='$installman3dir'
24458 installprefix='$installprefix'
24459 installprefixexp='$installprefixexp'
24460 installprivlib='$installprivlib'
24461 installscript='$installscript'
24462 installsitearch='$installsitearch'
24463 installsitebin='$installsitebin'
24464 installsitehtml1dir='$installsitehtml1dir'
24465 installsitehtml3dir='$installsitehtml3dir'
24466 installsitelib='$installsitelib'
24467 installsiteman1dir='$installsiteman1dir'
24468 installsiteman3dir='$installsiteman3dir'
24469 installsitescript='$installsitescript'
24470 installstyle='$installstyle'
24471 installusrbinperl='$installusrbinperl'
24472 installvendorarch='$installvendorarch'
24473 installvendorbin='$installvendorbin'
24474 installvendorhtml1dir='$installvendorhtml1dir'
24475 installvendorhtml3dir='$installvendorhtml3dir'
24476 installvendorlib='$installvendorlib'
24477 installvendorman1dir='$installvendorman1dir'
24478 installvendorman3dir='$installvendorman3dir'
24479 installvendorscript='$installvendorscript'
24481 issymlink='$issymlink'
24482 ivdformat='$ivdformat'
24485 known_extensions='$known_extensions'
24488 ld_can_script='$ld_can_script'
24489 lddlflags='$lddlflags'
24491 ldflags_uselargefiles='$ldflags_uselargefiles'
24492 ldlibpthname='$ldlibpthname'
24499 libsdirs='$libsdirs'
24500 libsfiles='$libsfiles'
24501 libsfound='$libsfound'
24502 libspath='$libspath'
24503 libswanted='$libswanted'
24504 libswanted_uselargefiles='$libswanted_uselargefiles'
24510 localtime_r_proto='$localtime_r_proto'
24511 locincpth='$locincpth'
24512 loclibpth='$loclibpth'
24513 longdblkind='$longdblkind'
24514 longdblsize='$longdblsize'
24515 longlongsize='$longlongsize'
24516 longsize='$longsize'
24520 lseeksize='$lseeksize'
24521 lseektype='$lseektype'
24525 make_set_make='$make_set_make'
24526 mallocobj='$mallocobj'
24527 mallocsrc='$mallocsrc'
24528 malloctype='$malloctype'
24530 man1direxp='$man1direxp'
24533 man3direxp='$man3direxp'
24535 mips_type='$mips_type'
24536 mistrustnm='$mistrustnm'
24538 mmaptype='$mmaptype'
24539 modetype='$modetype'
24541 multiarch='$multiarch'
24543 myarchname='$myarchname'
24544 mydomain='$mydomain'
24545 myhostname='$myhostname'
24548 need_va_copy='$need_va_copy'
24549 netdb_hlen_type='$netdb_hlen_type'
24550 netdb_host_type='$netdb_host_type'
24551 netdb_name_type='$netdb_name_type'
24552 netdb_net_type='$netdb_net_type'
24555 nm_so_opt='$nm_so_opt'
24556 nonxs_ext='$nonxs_ext'
24558 nvEUformat='$nvEUformat'
24559 nvFUformat='$nvFUformat'
24560 nvGUformat='$nvGUformat'
24561 nv_overflows_integers_at='$nv_overflows_integers_at'
24562 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24563 nveformat='$nveformat'
24564 nvfformat='$nvfformat'
24565 nvgformat='$nvgformat'
24568 o_nonblock='$o_nonblock'
24570 old_pthread_create_joinable='$old_pthread_create_joinable'
24571 optimize='$optimize'
24572 orderlib='$orderlib'
24575 otherlibdirs='$otherlibdirs'
24579 patchlevel='$patchlevel'
24580 path_sep='$path_sep'
24583 perl_patchlevel='$perl_patchlevel'
24584 perl_static_inline='$perl_static_inline'
24585 perladmin='$perladmin'
24586 perllibs='$perllibs'
24587 perlpath='$perlpath'
24589 phostname='$phostname'
24595 prefixexp='$prefixexp'
24597 privlibexp='$privlibexp'
24598 procselfexe='$procselfexe'
24599 prototype='$prototype'
24601 quadkind='$quadkind'
24602 quadtype='$quadtype'
24603 randbits='$randbits'
24604 randfunc='$randfunc'
24605 random_r_proto='$random_r_proto'
24606 randseedtype='$randseedtype'
24608 rd_nodata='$rd_nodata'
24609 readdir64_r_proto='$readdir64_r_proto'
24610 readdir_r_proto='$readdir_r_proto'
24611 revision='$revision'
24617 sGMTIME_max='$sGMTIME_max'
24618 sGMTIME_min='$sGMTIME_min'
24619 sLOCALTIME_max='$sLOCALTIME_max'
24620 sLOCALTIME_min='$sLOCALTIME_min'
24621 sPRIEUldbl='$sPRIEUldbl'
24622 sPRIFUldbl='$sPRIFUldbl'
24623 sPRIGUldbl='$sPRIGUldbl'
24624 sPRIXU64='$sPRIXU64'
24626 sPRIeldbl='$sPRIeldbl'
24627 sPRIfldbl='$sPRIfldbl'
24628 sPRIgldbl='$sPRIgldbl'
24633 sSCNfldbl='$sSCNfldbl'
24634 sched_yield='$sched_yield'
24635 scriptdir='$scriptdir'
24636 scriptdirexp='$scriptdirexp'
24638 seedfunc='$seedfunc'
24639 selectminbits='$selectminbits'
24640 selecttype='$selecttype'
24641 sendmail='$sendmail'
24642 setgrent_r_proto='$setgrent_r_proto'
24643 sethostent_r_proto='$sethostent_r_proto'
24644 setlocale_r_proto='$setlocale_r_proto'
24645 setnetent_r_proto='$setnetent_r_proto'
24646 setprotoent_r_proto='$setprotoent_r_proto'
24647 setpwent_r_proto='$setpwent_r_proto'
24648 setservent_r_proto='$setservent_r_proto'
24651 sharpbang='$sharpbang'
24652 shmattype='$shmattype'
24653 shortsize='$shortsize'
24656 sig_count='$sig_count'
24657 sig_name='$sig_name'
24658 sig_name_init='$sig_name_init'
24660 sig_num_init='$sig_num_init'
24661 sig_size='$sig_size'
24662 signal_t='$signal_t'
24663 sitearch='$sitearch'
24664 sitearchexp='$sitearchexp'
24666 sitebinexp='$sitebinexp'
24667 sitehtml1dir='$sitehtml1dir'
24668 sitehtml1direxp='$sitehtml1direxp'
24669 sitehtml3dir='$sitehtml3dir'
24670 sitehtml3direxp='$sitehtml3direxp'
24672 sitelib_stem='$sitelib_stem'
24673 sitelibexp='$sitelibexp'
24674 siteman1dir='$siteman1dir'
24675 siteman1direxp='$siteman1direxp'
24676 siteman3dir='$siteman3dir'
24677 siteman3direxp='$siteman3direxp'
24678 siteprefix='$siteprefix'
24679 siteprefixexp='$siteprefixexp'
24680 sitescript='$sitescript'
24681 sitescriptexp='$sitescriptexp'
24682 sizesize='$sizesize'
24683 sizetype='$sizetype'
24687 sockethdr='$sockethdr'
24688 socketlib='$socketlib'
24689 socksizetype='$socksizetype'
24691 spackage='$spackage'
24692 spitshell='$spitshell'
24693 srand48_r_proto='$srand48_r_proto'
24694 srandom_r_proto='$srandom_r_proto'
24696 ssizetype='$ssizetype'
24697 st_ino_sign='$st_ino_sign'
24698 st_ino_size='$st_ino_size'
24699 startperl='$startperl'
24701 static_ext='$static_ext'
24703 stdio_base='$stdio_base'
24704 stdio_bufsiz='$stdio_bufsiz'
24705 stdio_cnt='$stdio_cnt'
24706 stdio_filbuf='$stdio_filbuf'
24707 stdio_ptr='$stdio_ptr'
24708 stdio_stream_array='$stdio_stream_array'
24709 strerror_r_proto='$strerror_r_proto'
24712 subversion='$subversion'
24717 targetarch='$targetarch'
24718 targetdir='$targetdir'
24719 targetenv='$targetenv'
24720 targethost='$targethost'
24721 targetmkdir='$targetmkdir'
24722 targetport='$targetport'
24723 targetsh='$targetsh'
24727 timeincl='$timeincl'
24728 timetype='$timetype'
24729 tmpnam_r_proto='$tmpnam_r_proto'
24735 ttyname_r_proto='$ttyname_r_proto'
24744 uidformat='$uidformat'
24750 uquadtype='$uquadtype'
24751 use5005threads='$use5005threads'
24752 use64bitall='$use64bitall'
24753 use64bitint='$use64bitint'
24754 usecbacktrace='$usecbacktrace'
24755 usecrosscompile='$usecrosscompile'
24756 usedevel='$usedevel'
24758 usedtrace='$usedtrace'
24759 usefaststdio='$usefaststdio'
24760 useithreads='$useithreads'
24761 usekernprocpathname='$usekernprocpathname'
24762 uselargefiles='$uselargefiles'
24763 uselongdouble='$uselongdouble'
24764 usemallocwrap='$usemallocwrap'
24765 usemorebits='$usemorebits'
24766 usemultiplicity='$usemultiplicity'
24767 usemymalloc='$usemymalloc'
24769 usensgetexecutablepath='$usensgetexecutablepath'
24770 useopcode='$useopcode'
24771 useperlio='$useperlio'
24772 useposix='$useposix'
24773 usequadmath='$usequadmath'
24774 usereentrant='$usereentrant'
24775 userelocatableinc='$userelocatableinc'
24776 useshrplib='$useshrplib'
24777 usesitecustomize='$usesitecustomize'
24778 usesocks='$usesocks'
24779 usethreads='$usethreads'
24780 usevendorprefix='$usevendorprefix'
24781 useversionedarchname='$useversionedarchname'
24782 usevfork='$usevfork'
24785 uvXUformat='$uvXUformat'
24786 uvoformat='$uvoformat'
24789 uvuformat='$uvuformat'
24790 uvxformat='$uvxformat'
24792 vendorarch='$vendorarch'
24793 vendorarchexp='$vendorarchexp'
24794 vendorbin='$vendorbin'
24795 vendorbinexp='$vendorbinexp'
24796 vendorhtml1dir='$vendorhtml1dir'
24797 vendorhtml1direxp='$vendorhtml1direxp'
24798 vendorhtml3dir='$vendorhtml3dir'
24799 vendorhtml3direxp='$vendorhtml3direxp'
24800 vendorlib='$vendorlib'
24801 vendorlib_stem='$vendorlib_stem'
24802 vendorlibexp='$vendorlibexp'
24803 vendorman1dir='$vendorman1dir'
24804 vendorman1direxp='$vendorman1direxp'
24805 vendorman3dir='$vendorman3dir'
24806 vendorman3direxp='$vendorman3direxp'
24807 vendorprefix='$vendorprefix'
24808 vendorprefixexp='$vendorprefixexp'
24809 vendorscript='$vendorscript'
24810 vendorscriptexp='$vendorscriptexp'
24812 version_patchlevel_string='$version_patchlevel_string'
24813 versiononly='$versiononly'
24817 yaccflags='$yaccflags'
24822 : add special variables
24823 $test -f $src/patchlevel.h && \
24824 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24825 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24826 echo "PERL_CONFIG_SH=true" >>config.sh
24828 : propagate old symbols
24829 if $test -f UU/config.sh; then
24830 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24831 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24832 config.sh config.sh UU/oldconfig.sh |\
24833 $sort | $uniq -u >UU/oldsyms
24834 set X `$cat UU/oldsyms`
24840 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24842 echo ": Variables propagated from previous config.sh file." >>config.sh
24843 for sym in `$cat UU/oldsyms`; do
24844 echo " Propagating $hint variable "'$'"$sym..."
24845 eval 'tmp="$'"${sym}"'"'
24847 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24853 : preserve RCS keywords in files with variable substitution, grrr
24856 : Finish up by extracting the .SH files
24860 echo "Extraction done."
24870 If you'd like to make any changes to the config.sh file before I begin
24871 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24874 rp="Press return or use a shell escape to edit config.sh:"
24879 *) : in case they cannot read
24880 sh 1>&4 -c "$ans";;
24885 : if this fails, just run all the .SH files by hand
24894 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24901 Now you need to generate make dependencies by running "$make depend".
24902 You might prefer to run it in background: "$make depend > makedepend.out &"
24903 It can take a while, so you might not want to run it right now.
24908 rp="Run $make depend now?"
24912 $make depend && echo "Now you must run '$make'."
24915 echo "You must run '$make depend' then '$make'."
24918 elif test -f [Mm]akefile; then
24920 echo "Now you must run a $make."
24922 echo "Configure done."
24925 if $test -f Policy.sh; then
24928 If you compile $package on a different machine or from a different object
24929 directory, copy the Policy.sh file from this object directory to the
24930 new one before you run Configure -- this will help you with most of
24931 the policy defaults.
24935 if $test -f config.msg; then
24936 echo "Hmm. I also noted the following information while running:"
24938 $cat config.msg >&4
24941 $rm -f kit*isdone ark*isdone