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. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated using [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
344 useversionedarchname=''
350 initialinstalllocation=''
382 d_attribute_deprecated=''
383 d_attribute_format=''
384 d_attribute_malloc=''
385 d_attribute_nonnull=''
386 d_attribute_noreturn=''
388 d_attribute_unused=''
389 d_attribute_warn_unused_result=''
390 d_printf_format_null=''
394 d_builtin_choose_expr=''
397 d_c99_variadic_macros=''
447 endhostent_r_proto=''
453 endprotoent_r_proto=''
459 endservent_r_proto=''
525 gethostbyaddr_r_proto=''
527 gethostbyname_r_proto=''
529 gethostent_r_proto=''
542 getnetbyaddr_r_proto=''
544 getnetbyname_r_proto=''
558 d_getprotobyname_r=''
559 getprotobyname_r_proto=''
560 d_getprotobynumber_r=''
561 getprotobynumber_r_proto=''
563 getprotoent_r_proto=''
575 getservbyname_r_proto=''
577 getservbyport_r_proto=''
579 getservent_r_proto=''
615 d_libm_lib_version=''
620 d_localtime_r_needs_tzset=''
623 d_lc_monetary_2008=''
639 d_malloc_good_size=''
687 d_old_pthread_create_joinable=''
688 old_pthread_create_joinable=''
690 d_pthread_attr_setscope=''
735 sethostent_r_proto=''
752 setprotoent_r_proto=''
764 setservent_r_proto=''
786 d_ipv6_mreq_source=''
803 d_sprintf_returns_strlen=''
815 perl_static_inline=''
820 d_stdio_ptr_lval_nochange_cnt=''
821 d_stdio_ptr_lval_sets_cnt=''
974 d_gdbm_ndbm_h_uses_prototypes=''
975 d_gdbmndbm_h_uses_prototypes=''
977 d_ndbm_h_uses_prototypes=''
1053 d_inc_version_list=''
1055 inc_version_list_init=''
1059 installusrbinperl=''
1075 ignore_versioned_solibs=''
1135 d_perl_otherlibdirs=''
1143 api_versionstring=''
1149 version_patchlevel_string=''
1153 d_nv_preserves_uv=''
1154 d_nv_zero_is_allbits_zero=''
1165 nv_overflows_integers_at=''
1166 nv_preserves_uv_bits=''
1239 installsitehtml1dir=''
1242 installsitehtml3dir=''
1249 installsiteman1dir=''
1252 installsiteman3dir=''
1257 installsitescript=''
1275 d_stdio_stream_array=''
1276 stdio_stream_array=''
1294 usekernprocpathname=''
1295 ccflags_uselargefiles=''
1296 ldflags_uselargefiles=''
1297 libswanted_uselargefiles=''
1307 usensgetexecutablepath=''
1320 installvendorarch=''
1327 installvendorhtml1dir=''
1329 vendorhtml1direxp=''
1330 installvendorhtml3dir=''
1332 vendorhtml3direxp=''
1338 installvendorman1dir=''
1341 installvendorman3dir=''
1348 installvendorscript=''
1359 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1362 : We must find out about Eunice early
1364 if test -f /etc/unixtovms; then
1365 eunicefix=/etc/unixtovms
1367 if test -f /etc/unixtovms.exe; then
1368 eunicefix=/etc/unixtovms.exe
1371 : Set executable suffix now -- needed before hints available
1372 if test -f "/libs/version.library"; then
1375 elif test -f "/system/gnu_library/bin/ar.pm"; then
1378 elif test -n "$DJGPP"; then
1381 elif test -f /kern/cookiejar; then
1384 elif test -d c:/. -o -n "$is_os2" ; then
1391 : Trailing extension. Override this in a hint file, if needed.
1392 : Extra object files, if any, needed on this platform.
1395 : Possible local include directories to search.
1396 : Set locincpth to "" in a hint file to defeat local include searches.
1397 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1398 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1400 : no include file wanted by default
1403 : Enable -DEBUGGING and -DDEBUGGING from the command line
1408 : change the next line if compiling for Xenix/286 on Xenix/386
1409 xlibpth='/usr/lib/386 /lib/386'
1410 : Possible local library directories to search.
1411 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1412 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1414 : general looking path for locating libraries
1415 glibpth="/lib /usr/lib $xlibpth"
1416 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1417 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1418 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1419 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1421 : Private path used by Configure to find libraries. Its value
1422 : is prepended to libpth. This variable takes care of special
1423 : machines, like the mips. Usually, it should be empty.
1426 : default library list
1428 : some systems want to use only the non-versioned libso:s
1429 ignore_versioned_solibs=''
1430 : set usethreads on the Configure command line to enable threads.
1431 usereentrant='undef'
1435 : set useposix=false in your hint file to disable the POSIX extension.
1437 : set useopcode=false in your hint file to disable the Opcode extension.
1440 ccflags_uselargefiles=''
1441 ldflags_uselargefiles=''
1442 libswanted_uselargefiles=''
1443 : set usemultiplicity on the Configure command line to enable multiplicity.
1444 : set usesocks on the Configure command line to enable socks.
1445 : List of libraries we want.
1446 : If anyone needs extra -lxxx, put those in a hint file.
1447 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1448 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1449 : We probably want to search /usr/shlib before most other libraries.
1450 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1451 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1452 glibpth="/usr/shlib $glibpth"
1453 : Do not use vfork unless overridden by a hint file.
1456 : Find the basic shell for Bourne shell scripts
1460 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1463 if test -f "$xxx"; then
1466 : Build up a list and do a single loop so we can 'break' out.
1467 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1468 for xxx in sh bash ksh pdksh ash; do
1470 try="$try ${p}/${xxx}"
1474 if test -f "$xxx"; then
1477 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1480 elif test -f "$xxx.exe"; then
1491 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1493 Usually it's in /bin/sh. How did you even get this far?
1494 Please contact me (Perl Maintainers) at perlbug@perl.org and
1495 we'll try to straighten this all out.
1501 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1502 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1505 : see if sh knows # comments
1506 if `$sh -c '#' >/dev/null 2>&1`; then
1510 test -f $xcat$_exe || xcat=/usr/bin/cat
1511 if test ! -f $xcat$_exe; then
1512 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1513 if test -f $p/cat$_exe; then
1518 if test ! -f $xcat$_exe; then
1519 echo "Can't find cat anywhere!"
1523 echo "#!$xcat" >sharp
1526 ./sharp > today 2>/dev/null
1527 if test -s today; then
1530 echo "#! $xcat" > sharp
1533 ./sharp > today 2>/dev/null
1534 if test -s today; then
1542 echo "Your $sh doesn't grok # comments--I will strip them later on."
1545 echo "exec grep -v '^[ ]*#'" >spitshell
1547 $eunicefix spitshell
1548 spitshell=`pwd`/spitshell
1550 echo "I presume that if # doesn't work, #! won't work either!"
1555 : figure out how to guarantee sh startup
1557 '') startsh=${sharpbang}${sh} ;;
1569 : echo "Yup, it does."
1571 echo "Hmm... '$startsh' does not guarantee sh startup..."
1572 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1576 : Save command line options in file UU/cmdline.opt for later use in
1577 : generating config.sh.
1578 cat > cmdline.opt <<EOSH
1579 : Configure command line arguments.
1588 cat >>cmdline.opt <<EOSH
1589 config_arg$argn='$arg'
1591 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1594 arg_exp=`cat cmdl.opt`
1595 args_exp="$args_exp$args_sep'$arg_exp'"
1596 argn=`expr $argn + 1`
1601 : produce awk script to parse command line options
1602 cat >options.awk <<'EOF'
1604 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1606 len = length(optstr);
1607 for (i = 1; i <= len; i++) {
1608 c = substr(optstr, i, 1);
1609 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1620 if (substr(str, 1, 1) != "-") {
1621 printf("'%s'\n", str);
1625 for (i = 2; i <= len; i++) {
1626 c = substr(str, i, 1);
1628 printf("-%s\n", substr(str, i));
1634 printf("'%s'\n", substr(str, i + 1));
1647 : process the command line options
1648 set X `for arg in "$@"; do echo "X$arg"; done |
1649 sed -e s/X// | awk -f options.awk`
1654 : set up default values
1664 rm -f optdef.sh posthint.sh
1665 cat >optdef.sh <<EOS
1671 while test $# -gt 0; do
1673 -d) shift; fastread=yes;;
1674 -e) shift; alldone=cont;;
1678 if test -r "$1"; then
1681 echo "$me: cannot read config file $1." >&2
1687 -h) shift; error=true;;
1688 -r) shift; reuseval=true;;
1689 -s) shift; silent=true; realsilent=true;;
1690 -E) shift; alldone=exit;;
1691 -K) shift; knowitall=true;;
1692 -O) shift; override=true;;
1693 -S) shift; silent=true; extractsh=true;;
1698 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1699 echo "$me: ignoring -D $1" >&2
1702 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1703 *) echo "$1='define'" >> optdef.sh;;
1710 *=) echo "$1" >> optdef.sh;;
1712 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1713 echo "$me: ignoring -U $1" >&2
1715 *) echo "$1='undef'" >> optdef.sh;;
1726 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1730 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1731 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1737 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1738 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1739 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1740 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1741 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1742 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1748 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1750 echo "$yyy=''" >> posthint.sh ;;
1755 echo "$yyy='$zzz'" >> posthint.sh ;;
1757 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1759 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1764 echo "$yyy=$zzz" >> posthint.sh ;;
1765 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1769 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1772 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1780 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1781 [-U symbol] [-U symbol=] [-A command:symbol...]
1782 -d : use defaults for all answers.
1783 -e : go on without questioning past the production of config.sh.
1784 -f : specify an alternate default configuration file.
1785 -h : print this help message and exit (with an error status).
1786 -r : reuse C symbols value if possible (skips costly nm extraction).
1787 -s : silent mode, only echoes questions and essential information.
1788 -D : define symbol to have some value:
1789 -D symbol symbol gets the value 'define'
1790 -D symbol=value symbol gets the value 'value'
1791 common used examples (see INSTALL for more info):
1792 -Duse64bitint use 64bit integers
1793 -Duse64bitall use 64bit integers and pointers
1794 -Dusethreads use thread support
1795 -Dinc_version_list=none do not include older perl trees in @INC
1796 -DEBUGGING=none DEBUGGING options
1797 -Dcc=gcc choose your compiler
1798 -Dprefix=/opt/perl5 choose your destination
1799 -E : stop at the end of questions, after having produced config.sh.
1800 -K : do not use unless you know what you are doing.
1801 -O : let -D and -U override definitions from loaded configuration file.
1802 -S : perform variable substitutions on all .SH files (can mix with -f)
1803 -U : undefine symbol:
1804 -U symbol symbol gets the value 'undef'
1805 -U symbol= symbol gets completely empty
1807 -A : manipulate symbol after the platform specific hints have been applied:
1808 -A append:symbol=value append value to symbol
1809 -A symbol=value like append:, but with a separating space
1810 -A define:symbol=value define symbol to have value
1811 -A clear:symbol define symbol to be ''
1812 -A define:symbol define symbol to be 'define'
1813 -A eval:symbol=value define symbol to be eval of value
1814 -A prepend:symbol=value prepend value to symbol
1815 -A undef:symbol define symbol to be 'undef'
1816 -A undef:symbol= define symbol to be ''
1817 e.g.: -A prepend:libswanted='cl pthread '
1818 -A ccflags=-DSOME_MACRO
1819 -V : print version number and exit (with a zero status).
1826 case "$fastread$alldone" in
1829 case "$extractsh" in
1832 if test ! -t 0; then
1833 echo "Say 'sh Configure', not 'sh <Configure'"
1843 true) exec 1>/dev/null;;
1846 : run the defines and the undefines, if any, but leave the file out there...
1849 : create the posthint manipulation script and leave the file out there...
1854 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1855 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1856 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1857 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1858 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1861 : Some greps do not return status, grrr.
1862 echo "grimblepritz" >grimble
1863 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1865 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1871 : the following should work in any shell
1875 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1876 cat >contains <<'EOSS'
1877 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1882 : Find the path to the source tree
1885 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1889 *) src=`cd ../$src && pwd` ;;
1902 if test -f $rsrc/Configure && \
1903 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1905 : found it, so we are ok.
1908 for src in . .. ../.. ../../.. ../../../..; do
1909 if test -f ../$src/Configure && \
1910 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1921 Sorry, I can't seem to locate the source dir for $package. Please start
1922 Configure with an explicit path -- i.e. /some/path/Configure.
1930 echo "Sources for $package found in \"$src\"." >&4
1934 : script used to extract .SH files with variable substitutions
1935 cat >extract <<'EOS'
1937 echo "Doing variable substitutions on .SH files..."
1938 if test -f MANIFEST; then
1939 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1941 echo "(Looking for .SH files under the source directory.)"
1942 set x `(cd "$src"; find . -name "*.SH" -print)`
1946 0) set x `(cd "$src"; echo *.SH)`; shift;;
1948 if test ! -f "$src/$1"; then
1954 while test $name; do
1955 if test ! -d "$name"; then
1956 create="$name $create";
1957 name=`echo $name | sed -e "s|^[^/]*$||"`;
1958 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1963 for file in $create; do
1972 dir=`expr X$file : 'X\(.*\)/'`
1973 file=`expr X$file : 'X.*/\(.*\)'`
1974 (cd "$dir" && . ./$file)
1984 dir=`expr X$file : 'X\(.*\)/'`
1985 file=`expr X$file : 'X.*/\(.*\)'`
1986 (set x $dir; shift; eval $mkdir_p)
1987 sh <"$src/$dir/$file"
1996 if test -f "$src/config_h.SH"; then
1997 if test ! -f config.h; then
1998 : oops, they left it out of MANIFEST, probably, so do it anyway.
1999 . "$src/config_h.SH"
2004 : extract files and exit if asked to do so
2005 case "$extractsh" in
2007 case "$realsilent" in
2011 case "$config_sh" in
2012 '') config_sh='config.sh';;
2015 echo "Fetching answers from $config_sh..."
2018 test "$override" && . ./optdef.sh
2022 echo "Extraction done."
2027 : Eunice requires " " instead of "", can you believe it
2030 echo "Beginning of configuration questions for $package."
2032 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2034 : first determine how to suppress newline on echo command
2036 echo "Checking echo to see how to suppress newlines..."
2037 (echo "hi there\c" ; echo " ") >.echotmp
2038 if $contains c .echotmp >/dev/null 2>&1 ; then
2049 echo $n "The star should be here-->$c"
2053 : Now test for existence of everything in MANIFEST
2055 if test -f "$rsrc/MANIFEST"; then
2056 echo "First let's make sure your kit is complete. Checking..." >&4
2057 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2058 (split -l 50 2>/dev/null || split -50)
2061 for filelist in x??; do
2062 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2063 >/dev/null 2>>"$tmppwd/missing")
2065 if test -s missing; then
2069 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2071 You have the option of continuing the configuration process, despite the
2072 distinct possibility that your kit is damaged, by typing 'y'es. If you
2073 do, don't blame me if something goes wrong. I advise you to type 'n'o
2074 and contact the author (perlbug@perl.org).
2077 echo $n "Continue? [n] $c" >&4
2081 echo "Continuing..." >&4
2085 echo "ABORTING..." >&4
2090 echo "Looks good..."
2093 echo "There is no MANIFEST file. I hope your kit is complete !"
2097 : Find the appropriate value for a newline for tr
2099 if test -n "$DJGPP"; then
2102 if test X"$trnl" = X; then
2103 case "`echo foo|tr '\n' x 2>/dev/null`" in
2107 if test X"$trnl" = X; then
2108 case "`echo foo|tr '\012' x 2>/dev/null`" in
2109 foox) trnl='\012' ;;
2112 if test X"$trnl" = X; then
2113 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2114 fooxy) trnl='\n\r' ;;
2117 if test X"$trnl" = X; then
2120 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2126 : compute the number of columns on the terminal for proper question formatting
2131 : set up the echo used in my read
2132 myecho="case \"\$xxxm\" in
2133 '') echo $n \"\$rp $c\" >&4;;
2135 '') echo $n \"[\$xxxm] $c\";;
2137 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2139 echo $n \"[\$xxxm] $c\" >&4
2141 echo $n \"\$rp [\$xxxm] $c\" >&4
2147 : now set up to do reads with possible shell escape and default assignment
2153 case "\$fastread" in
2154 yes) case "\$dflt" in
2157 case "\$silent-\$rp" in
2162 *) case "\$silent" in
2163 true) case "\$rp" in
2168 while expr "X\$ans" : "X!" >/dev/null; do
2172 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2180 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2189 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2194 echo "(OK, I'll run with -d after this question.)" >&4
2197 echo "*** Sorry, \$1 not supported yet." >&4
2207 echo "*** Substitution done -- please confirm."
2209 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2214 echo "*** Error -- try again."
2221 case "\$ans\$xxxm\$nostick" in
2233 : create .config dir to save info across Configure sessions
2234 test -d ../.config || mkdir ../.config
2235 cat >../.config/README <<EOF
2236 This directory created by Configure to save information that should
2237 persist across sessions for $package.
2239 You may safely delete it if you wish.
2242 : See if we are using a devel version and want that
2243 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2246 usedevel="$define" ;;
2247 *) case "$xversion" in
2250 *** WHOA THERE!!! ***
2252 This is an UNSTABLE DEVELOPMENT release.
2253 The version of this $package distribution is $xversion, that is, odd,
2254 (as opposed to even) and that signifies a development release.
2255 If you want a maintenance release, you want an even-numbered version.
2257 Do ***NOT*** install this into production use.
2258 Data corruption and crashes are possible.
2260 It is most seriously suggested that you do not continue any further
2261 unless you want to help in developing and debugging Perl.
2263 If you *still* want to build perl, you can answer 'y' now,
2264 or pass -Dusedevel to Configure.
2267 rp='Do you really want to continue?'
2271 [yY]) echo >&4 "Okay, continuing."
2272 usedevel="$define" ;;
2273 *) echo >&4 "Okay, bye."
2284 case "$versiononly" in
2285 '') versiononly="$define" ;;
2287 case "$installusrbinperl" in
2288 '') installusrbinperl="$undef" ;;
2293 : general instructions
2296 user=`(logname) 2>/dev/null`
2298 '') user=`whoami 2>&1`;;
2300 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2303 rp='Would you like to see the instructions?'
2314 This installation shell script will examine your system and ask you questions
2315 to determine how the perl5 package should be installed. If you get
2316 stuck on a question, you may use a ! shell escape to start a subshell or
2317 execute a command. Many of the questions will have default answers in square
2318 brackets; typing carriage return will give you the default.
2320 On some of the questions which ask for file or directory names you are allowed
2321 to use the ~name construct to specify the login directory belonging to "name",
2322 even if you don't have a shell which knows about that. Questions where this is
2323 allowed will be marked "(~name ok)".
2327 dflt='Type carriage return to continue'
2331 The prompter used in this script allows you to use shell variables and
2332 backticks in your answers. You may use $1, $2, etc... to refer to the words
2333 in the default answer, as if the default line was a set of arguments given to a
2334 script shell. This means you may also use $* to repeat the whole default line,
2335 so you do not have to re-type everything to add something to the default.
2337 Every time there is a substitution, you will have to confirm. If there is an
2338 error (e.g. an unmatched backtick), the default answer will remain unchanged
2339 and you will be prompted again.
2341 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2342 the questions and use the computed defaults (or the previous answers if there
2343 was already a config.sh file). Type 'Configure -h' for a list of options.
2344 You may also start interactively and then answer '& -d' at any prompt to turn
2345 on the non-interactive behaviour for the remainder of the execution.
2351 Much effort has been expended to ensure that this shell script will run on any
2352 Unix system. If despite that it blows up on yours, your best bet is to edit
2353 Configure and run it again. If you can't run Configure for some reason,
2354 you'll have to generate a config.sh file by hand. Whatever problems you
2355 have, let me (perlbug@perl.org) know how I blew it.
2357 This installation script affects things in two ways:
2359 1) it may do direct variable substitutions on some of the files included
2361 2) it builds a config.h file for inclusion in C programs. You may edit
2362 any of these files as the need arises after running this script.
2364 If you make a mistake on a question, there is no easy way to back up to it
2365 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2366 files. Configure will offer to let you do this before it runs the SH files.
2369 dflt='Type carriage return to continue'
2371 case "$firsttime" in
2372 true) echo $user >>../.config/instruct;;
2376 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2377 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2378 if test "X$sysroot" = X; then
2383 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2384 # _sysroot is used in places where we need --sysroot=foo
2385 # but using the rest of the flags could cause issues.
2386 _sysroot="--sysroot=$sysroot";
2390 ccflags="$ccflags $_sysroot"
2395 ldflags="$ldflags $_sysroot"
2400 cppflags="$cppflags $_sysroot"
2402 # lddlflags updated below in lddlflags section;
2403 # same with cccdlflags
2407 # Adjust some defaults to also use $sysroot
2408 for var in xlibpth loclibpth locincpth glibpth; do
2411 for path in $xxx; do
2412 eval $var=\"\$$var $sysroot$path\"
2418 : find out where common programs are
2420 echo "Locating common programs..." >&4
2433 if test -d \$dir/\$thing; then
2439 for thisthing in \$dir/\$thing; do
2440 : just loop through to pick last item
2442 if test -f \$thisthing; then
2445 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2448 elif test -f \$dir/\$thing.exe; then
2449 if test -n "$DJGPP"; then
2450 echo \$dir/\$thing.exe
2451 elif test "$eunicefix" != ":"; then
2452 : on Eunice apparently
2505 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2506 pth="$pth $sysroot/lib $sysroot/usr/lib"
2507 for file in $loclist; do
2511 if test -f "$xxx"; then
2514 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2515 xxx=`./loc $file $file $pth`
2518 '') xxx=`./loc $file $file $pth`;;
2519 *) xxx=`./loc $xxx $xxx $pth`;;
2521 eval $file=$xxx$_exe
2525 echo $file is in $xxx.
2528 echo $file is in $xxx.
2531 echo "I don't know where '$file' is, and my life depends on it." >&4
2532 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2538 echo "Don't worry if any of the following aren't found..."
2540 for file in $trylist; do
2544 if test -f "$xxx"; then
2547 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2548 xxx=`./loc $file $file $pth`
2551 '') xxx=`./loc $file $file $pth`;;
2552 *) xxx=`./loc $xxx $xxx $pth`;;
2554 eval $file=$xxx$_exe
2558 echo $file is in $xxx.
2561 echo $file is in $xxx.
2564 echo "I don't see $file out there, $say."
2571 echo "Substituting grep for egrep."
2578 *) if $less -R </dev/null >/dev/null 2>&1; then
2579 echo "Substituting less -R for less."
2587 echo "Substituting cp for ln."
2596 echo "I can't find make or gmake, and my life depends on it." >&4
2597 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2605 *) # We can't have osname yet.
2606 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2607 # Assume that gmake, if found, is definitely GNU make
2608 # and prefer it over the system make.
2609 echo "Substituting gmake for make."
2617 echo "Hopefully test is built into your sh."
2620 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2621 echo "Using the test built into your sh."
2629 echo "Hopefully echo is built into your sh."
2634 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2635 $echo $n "hi there$c" >foo1
2636 echo $n "hi there$c" >foo2
2637 if cmp foo1 foo2 >/dev/null 2>&1; then
2638 echo "They are compatible. In fact, they may be identical."
2645 They are not compatible! You are probably running ksh on a non-USG system.
2646 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2647 have echo built in and we may have to run some Bourne shell scripts. That
2648 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2651 $echo $n "The star should be here-->$c"
2658 # This question was auctioned at YAPC::Europe-2007 in Vienna
2659 # I never promised you could answer it. I only auctioned the question.
2661 The following message is sponsored by
2663 Dresden.pm<--The stars should be here.
2665 Dear Perl user, system administrator or package
2666 maintainer, the Perl community sends greetings to
2667 you. Do you (emblematical) greet back [Y/n]? n
2671 : Check what type of C compiler we use
2675 cat <<'EOSC' >>trygcc
2680 int main(int argc, char *argv[]) {
2684 if $cc -o try $ccflags $ldflags try.c; then
2687 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2693 # Skip this test because it gives a false match on output like:
2694 # ./trygcc: line 23: cc: command not found
2695 # case "`$cc -v -c try.c 2>&1`" in
2696 # *gcc*) trygcc=no ;;
2698 if $test X"$trygcc" = Xyes; then
2699 if gcc -o try -c try.c; then
2701 echo "You seem to have a working gcc, though." >&4
2702 # Switching compilers may undo the work of hints files.
2703 # The most common problem is -D_REENTRANT for threads.
2704 # This heuristic catches that case, but gets false positives
2705 # if -Dusethreads was not actually specified. Better to
2706 # bail out here with a useful message than fail
2707 # mysteriously later. Should we perhaps just try to
2708 # re-invoke Configure -Dcc=gcc config_args ?
2709 if $test -f usethreads.cbu; then
2712 *** However, any setting of the C compiler flags (e.g. for thread support)
2713 *** will be lost. It may be necessary for you to restart Configure and
2714 *** add -Dcc=gcc to your Configure command line.
2717 rp="Would you like to go ahead and try gcc anyway?"
2720 rp="Would you like to use it?"
2723 if $test -f myread; then
2726 if $test -f UU/myread; then
2729 echo "Cannot find myread, sorry. Aborting." >&2
2734 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2747 cat <<'EOSC' >>checkcc
2752 int main(int argc, char *argv[]) {
2756 if $cc -o try $ccflags $ldflags try.c; then
2759 if $test X"$despair" = Xyes; then
2760 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2763 You need to find a working C compiler.
2764 Either (purchase and) install the C compiler supplied by your OS vendor,
2765 or for a free C compiler try http://gcc.gnu.org/
2766 I cannot continue any further, aborting.
2775 : determine whether symbolic links are supported
2778 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2779 echo "Symbolic links are supported." >&4
2782 echo "Symbolic links are NOT supported." >&4
2787 : determine whether symbolic links are supported
2791 echo "Checking how to test for symbolic links..." >&4
2793 if $test "X$issymlink" = X; then
2795 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2796 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2798 if test $? = 0; then
2801 echo "Your builtin 'test -h' may be broken." >&4
2804 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2807 if test -f "$p/$test"; then
2816 echo "Trying external '$test -h'." >&4
2817 issymlink="$test -h"
2818 if $test ! -h sym >/dev/null 2>&1; then
2819 echo "External '$test -h' is broken, too." >&4
2827 if $test "X$issymlink" = X; then
2828 if $test -L sym 2>/dev/null; then
2829 issymlink="$test -L"
2830 echo "The builtin '$test -L' worked." >&4
2833 if $test "X$issymlink" != X; then
2834 echo "You can test for symbolic links with '$issymlink'." >&4
2836 echo "I do not know how you can test for symbolic links." >&4
2840 *) echo "No symbolic links, so not testing for their testing..." >&4
2845 : Make symlinks util
2846 case "$mksymlinks" in
2849 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2852 *) case "$lns:$issymlink" in
2853 *"ln"*" -s:"*"test -"?)
2854 echo "Creating the symbolic links..." >&4
2856 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2866 print "# dir = ", dir, "file = ", file
2867 mf[dir] = mf[dir]" "src"/"dir"/"file;
2870 if (d != ".") { print("mkdir -p "d) }
2871 print("ln -sf "mf[d]" "d);
2873 }' src="$src" > UU/mksymlinks.$$
2877 if test ! -d t/base; then
2878 echo "Failed to create the subdirectories. Aborting." >&4
2882 if test ! -f t/base/lex.t; then
2883 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2886 if test ! -f win32/win32.c; then
2887 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2892 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2900 : Check for Cross-Compilation
2901 if $test "X$targethost" = "X"; then
2904 if $test "X$targetenv" = "X"; then
2907 case "$usecrosscompile" in
2909 $echo "Cross-compiling..."
2912 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2913 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2914 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2915 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2916 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2917 # leave out ld, choosing it is more complex
2918 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2919 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2920 # We are in a weird spot. Just before us, some values
2921 # were 'saved', to be restored after the hints are
2922 # run. This means that the changes we made to ar,
2923 # nm and ranlib will get reverted.
2924 # To avoid that, we hijack the saving mechanism and
2925 # have it save our new values.
2926 for file in ar nm ranlib; do
2928 eval $file=$xxx$_exe
2933 case "$targetarch" in
2934 '') echo "Targetarch not defined." >&4; croak=y ;;
2935 *) echo "Using targetarch $targetarch." >&4 ;;
2937 case "$targethost" in
2938 '') echo "Targethost not defined." >&4; croak=y ;;
2939 *) echo "Using targethost $targethost." >&4
2944 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2946 : compile a host miniperl and generate_uudmap, unless we got passed them
2947 if $test "X$hostperl" = X; then
2948 echo "Building host miniperl and generate_uudmap binaries" >&4
2956 $src/Configure -des -Dusedevel -Dmksymlinks
2958 case "$hostgenerate" in
2959 '') $make generate_uudmap
2960 hostgenerate=$src/host/generate_uudmap
2962 "$undef") hostgenerate=''
2965 hostperl=$src/host/miniperl
2968 hostosname=`$hostperl -le 'print $^O'`
2971 usecrosscompile="$undef"
2975 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2976 case "$targethost" in
2977 '') echo "Checking for cross-compile" >&4
2978 case "$usecrosscompile$multiarch" in
2979 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2980 if [ -f Makefile ]; then
2982 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2984 echo "Configure done."
2988 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2995 *) echo "Using targethost $targethost." >&4
2997 /*) run=$src/Cross/run
2998 targetmkdir=$src/Cross/mkdir
3000 from=$src/Cross/from
3002 *) pwd=`$test -f ../Configure & cd ..; pwd`
3004 targetmkdir=$pwd/Cross/mkdir
3006 from=$pwd/Cross/from
3009 case "$targetrun" in
3010 '') targetrun=ssh ;;
3015 case "$targetfrom" in
3016 '') targetfrom=scp ;;
3020 from=$from-$targetfrom
3021 case "$targetdir" in
3023 echo "Guessing targetdir $targetdir." >&4
3026 case "$targetuser" in
3028 echo "Guessing targetuser $targetuser." >&4
3031 case "$targetport" in
3033 echo "Guessing targetport $targetport." >&4
3036 case "$targetfrom" in
3040 case "$targetrun" in
3060 '') cwd=$targetdir ;;
3065 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3071 *) echo "Unknown targetrun '$targetrun'" >&4
3075 case "$targetmkdir" in
3077 cat >$targetmkdir <<EOF
3079 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3081 $chmod a+rx $targetmkdir
3083 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3095 $targetmkdir \`dirname \$f\`
3096 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3099 $targetmkdir $targetdir/\`dirname \$f\`
3100 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3113 $mkdir -p $targetdir/\`dirname \$f\`
3114 $cp \$f $targetdir/\$f || exit 1
3117 $targetmkdir $targetdir/\`dirname \$f\`
3118 $cp \$f $targetdir/\$f || exit 1
3125 *) echo "Unknown targetto '$targetto'" >&4
3129 case "$targetfrom" in
3136 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3141 cp) cat >$from <<EOF
3146 cp $targetdir/\$f . || exit 1
3151 *) echo "Unknown targetfrom '$targetfrom'" >&4
3155 if $test ! -f $run; then
3156 echo "Target 'run' script '$run' not found." >&4
3160 if $test ! -f $to; then
3161 echo "Target 'to' script '$to' not found." >&4
3165 if $test ! -f $from; then
3166 echo "Target 'from' script '$from' not found." >&4
3170 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3174 Using '$run' for remote execution,
3175 and '$from' and '$to'
3176 for remote file transfer.
3182 usecrosscompile="$undef"
3187 : see whether [:lower:] and [:upper:] are supported character classes
3189 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3191 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3195 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3196 # (0xd9 and 0xe2), therefore that is a nice testing point.
3197 if test "X$up" = X -o "X$low" = X; then
3198 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3204 if test "X$up" = X -o "X$low" = X; then
3205 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3211 if test "X$up" = X -o "X$low" = X; then
3212 case "`echo RS | od -x 2>/dev/null`" in
3214 echo "Hey, this might be EBCDIC." >&4
3215 if test "X$up" = X -o "X$low" = X; then
3216 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3217 rs) up='[A-IJ-RS-Z]'
3222 if test "X$up" = X -o "X$low" = X; then
3223 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3233 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3235 echo "Using $up and $low to convert case." >&4
3238 echo "I don't know how to translate letters from upper to lower case." >&4
3239 echo "Your tr is not acting any way I know of." >&4
3243 : set up the translation script tr, must be called with ./tr of course
3247 '[A-Z][a-z]') exec $tr '$up' '$low';;
3248 '[a-z][A-Z]') exec $tr '$low' '$up';;
3255 : Try to determine whether config.sh was made on this system
3256 case "$config_sh" in
3258 myuname=`$uname -a 2>/dev/null`
3259 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3260 # Downcase everything to avoid ambiguity.
3261 # Remove slashes and single quotes so we can use parts of this in
3262 # directory and file names.
3263 # Remove newlines so myuname is sane to use elsewhere.
3264 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3265 # because the A-Z/a-z are not consecutive.
3266 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3267 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3268 newmyuname="$myuname"
3270 case "$knowitall" in
3272 if test -f ../config.sh; then
3273 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3274 eval "`grep myuname= ../config.sh`"
3276 if test "X$myuname" = "X$newmyuname"; then
3284 : Get old answers from old config file if Configure was run on the
3285 : same system, otherwise use the hints.
3288 if test -f config.sh; then
3290 rp="I see a config.sh file. Shall I use it to set the defaults?"
3293 n*|N*) echo "OK, I'll ignore it."
3294 mv config.sh config.sh.old
3295 myuname="$newmyuname"
3297 *) echo "Fetching default answers from your old config.sh file..." >&4
3305 : Older versions did not always set $sh. Catch re-use of such
3315 if test ! -f config.sh; then
3318 First time through, eh? I have some defaults handy for some systems
3319 that need some extra help getting the Configure answers right:
3322 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3324 : Half the following guesses are probably wrong... If you have better
3325 : tests or hints, please send them to perlbug@perl.org
3326 : The metaconfig authors would also appreciate a copy...
3327 $test -f /irix && osname=irix
3328 $test -f /xenix && osname=sco_xenix
3329 $test -f /dynix && osname=dynix
3330 $test -f /dnix && osname=dnix
3331 $test -f /lynx.os && osname=lynxos
3332 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3333 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3334 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3335 $test -f /bin/mips && /bin/mips && osname=mips
3336 $test -d /usr/apollo/bin && osname=apollo
3337 $test -f /etc/saf/_sactab && osname=svr4
3338 $test -d /usr/include/minix && osname=minix
3339 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3340 if $test -d /MachTen -o -d /MachTen_Folder; then
3342 if $test -x /sbin/version; then
3343 osvers=`/sbin/version | $awk '{print $2}' |
3344 $sed -e 's/[A-Za-z]$//'`
3345 elif $test -x /usr/etc/version; then
3346 osvers=`/usr/etc/version | $awk '{print $2}' |
3347 $sed -e 's/[A-Za-z]$//'`
3353 $test -f /sys/posix.dll &&
3354 $test -f /usr/bin/what &&
3355 set X `/usr/bin/what /sys/posix.dll` &&
3356 $test "$3" = UWIN &&
3360 if $test -f $uname; then
3368 umips) osname=umips ;;
3371 [23]100) osname=mips ;;
3373 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3374 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3377 elif $test -f /etc/kconfig; then
3379 if test "$lns" = "$ln -s"; then
3381 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3383 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3390 if test -n "$DJGPP"; then
3399 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3401 # oslevel can fail with:
3402 # oslevel: Unable to acquire lock.
3403 *not\ found) osvers="$4"."$3" ;;
3404 '<3240'|'<>3240') osvers=3.2.0 ;;
3405 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3406 '=3250'|'>3250') osvers=3.2.5 ;;
3410 bitrig) osname=bitrig
3413 bsd386) osname=bsd386
3416 cygwin*) osname=cygwin
3419 *dc.osx) osname=dcosx
3425 domainos) osname=apollo
3431 dragonfly) osname=dragonfly
3434 dynixptx*) osname=dynixptx
3435 osvers=`echo "$4"|sed 's/^v//'`
3437 freebsd) osname=freebsd
3439 genix) osname=genix ;;
3443 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3456 $test -f /system/lib/libandroid.so && osname=linux-android
3460 netbsd*) osname=netbsd
3463 news-os) osvers="$3"
3465 4*) osname=newsos4 ;;
3469 nonstop-ux) osname=nonstopux ;;
3470 openbsd) osname=openbsd
3476 POSIX-BC | posix-bc ) osname=posix-bc
3479 powerux | power_ux | powermax_os | powermaxos | \
3480 powerunix | power_unix) osname=powerux
3486 solaris) osname=solaris
3488 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3495 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3499 titanos) osname=titanos
3508 ultrix) osname=ultrix
3511 osf1|mls+) case "$5" in
3514 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3517 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3520 hp*) osname=hp_osf1 ;;
3521 mips) osname=mips_osf1 ;;
3524 # UnixWare 7.1.2 is known as Open UNIX 8
3525 openunix|unixware) osname=svr5
3533 $2) case "$osname" in
3537 : svr4.x or possibly later
3547 if test -f /stand/boot ; then
3548 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3549 if test -n "$INITPROG" -a -f "$INITPROG"; then
3550 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3551 if test -n "$isesix"; then
3559 *) if test -f /etc/systemid; then
3561 set `echo $3 | $sed 's/\./ /g'` $4
3562 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3564 elif $test -f $src/hints/sco_$1_$2.sh; then
3566 elif $test -f $src/hints/sco_$1.sh; then
3571 '') : Still unknown. Probably a generic Sys V.
3580 *) case "$osname" in
3581 '') : Still unknown. Probably a generic BSD.
3589 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3590 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3591 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3594 $rm -f UU/kernel.what
3595 elif test -d c:/. -o -n "$is_os2" ; then
3602 case "$targetarch" in
3605 case "$targetarch" in
3607 # Will load qnx.sh, which should change osname to nto
3612 # Catch arm-linux-androideabi, mipsel-linux-android,
3613 # and i686-linux-android
3614 osname=linux-android
3618 # Something like arm-linux-gnueabihf is really just
3625 # XXX perhaps we should just assume
3626 # osvers to be 2, or maybe take the value
3627 # from targetarch. Using $run before the
3628 # hints are run is somewhat icky.
3629 set X `$run $uname -a 2>/dev/null`
3632 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3637 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3644 : Now look for a hint file osname_osvers, unless one has been
3645 : specified already.
3648 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3649 : Also try without trailing minor version numbers.
3650 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3651 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3652 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3653 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3656 *) case "$osvers" in
3659 *) if $test -f $src/hints/$file.sh ; then
3661 elif $test -f $src/hints/$xfile.sh ; then
3663 elif $test -f $src/hints/$xxfile.sh ; then
3665 elif $test -f $src/hints/$xxxfile.sh ; then
3667 elif $test -f $src/hints/$xxxxfile.sh ; then
3669 elif $test -f "$src/hints/${osname}.sh" ; then
3678 if $test -f Policy.sh ; then
3681 none) dflt="Policy" ;;
3682 *) dflt="Policy $dflt" ;;
3687 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3691 if $test -f Policy.sh ; then
3694 There's also a Policy hint file available, which should make the
3695 site-specific (policy) questions easier to answer.
3702 You may give one or more space-separated answers, or "none" if appropriate.
3703 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3704 previous run of Configure, you may specify it as well as or instead of
3705 OS-specific hints. If hints are provided for your OS, you should use them:
3706 although Perl can probably be built without hints on many platforms, using
3707 hints often improve performance and may enable features that Configure can't
3708 set up on its own. If there are no hints that match your OS, specify "none";
3709 DO NOT give a wrong version or a wrong OS.
3713 rp="Which of these apply, if any?"
3716 for file in $tans; do
3717 if $test X$file = XPolicy -a -f Policy.sh; then
3719 $cat Policy.sh >> UU/config.sh
3720 elif $test -f $src/hints/$file.sh; then
3721 . $src/hints/$file.sh
3722 $cat $src/hints/$file.sh >> UU/config.sh
3723 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3726 : Give one chance to correct a possible typo.
3727 echo "$file.sh does not exist"
3729 rp="hint to use instead?"
3731 for file in $ans; do
3732 if $test -f "$src/hints/$file.sh"; then
3733 . $src/hints/$file.sh
3734 $cat $src/hints/$file.sh >> UU/config.sh
3735 elif $test X$ans = X -o X$ans = Xnone ; then
3738 echo "$file.sh does not exist -- ignored."
3745 : Remember our hint file for later.
3746 if $test -f "$src/hints/$file.sh" ; then
3756 echo "Fetching default answers from $config_sh..." >&4
3760 cp $config_sh config.sh 2>/dev/null
3770 test "$override" && . ./optdef.sh
3772 : Restore computed paths
3773 for file in $loclist $trylist; do
3774 eval $file="\$_$file"
3779 Configure uses the operating system name and version to set some defaults.
3780 The default value is probably right if the name rings a bell. Otherwise,
3781 since spelling matters for me, either accept the default or answer "none"
3788 ''|' '|none) dflt=none ;;
3789 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3792 *) dflt="$osname" ;;
3794 rp="Operating system name?"
3798 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3804 ''|' '|none) dflt=none ;;
3805 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3806 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3808 ''|' ') dflt=none ;;
3813 *) dflt="$osvers" ;;
3815 rp="Operating system version?"
3825 : who configured the system
3826 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3829 cf_by=`(logname) 2>/dev/null`
3832 cf_by=`(whoami) 2>/dev/null`
3834 "") cf_by=unknown ;;
3839 : decide how portable to be. Allow command line overrides.
3840 case "$d_portable" in
3842 *) d_portable="$define" ;;
3845 : set up shell script to do ~ expansion
3851 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3854 if $test -f /bin/csh; then
3855 /bin/csh -f -c "glob \$1"
3860 name=\`$expr x\$1 : '..\([^/]*\)'\`
3861 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3862 if $test ! -d "\$dir"; then
3864 echo "\$me: can't locate home directory for: \$name" >&2
3869 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3885 : now set up to get a file name
3889 cat <<'EOSC' >>getfile
3905 : getfile will accept an answer from the comma-separated list
3906 : enclosed in parentheses even if it does not meet other criteria.
3907 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3908 fn=`echo $fn | sed 's/(.*)//'`
3914 loc_file=`expr $fn : '.*:\(.*\)'`
3915 fn=`expr $fn : '\(.*\):.*'`
3923 */*) fullpath=true;;
3932 *e*) exp_file=true;;
3935 *p*) nopath_ok=true;;
3940 *d*) type='Directory';;
3941 *l*) type='Locate';;
3946 Locate) what='File';;
3951 case "$d_portable" in
3959 while test "$type"; do
3964 true) rp="$rp (~name ok)";;
3967 if test -f UU/getfile.ok && \
3968 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3987 value=`UU/filexp $ans`
3990 if test "$ans" != "$value"; then
3991 echo "(That expands to $value on this system.)"
4005 /*) value="$ansexp" ;;
4006 [a-zA-Z]:/*) value="$ansexp" ;;
4011 echo "I shall only accept a full path name, as in /bin/ls." >&4
4012 echo "Use a ! shell escape if you wish to check pathnames." >&4
4015 echo "Please give a full path name, starting with slash." >&4
4018 echo "Note that using ~name is ok provided it expands well." >&4
4031 for fp in $gfpth; do
4032 if test "X$fp" = X.; then
4037 if test -f "$pf"; then
4039 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4041 echo "($value is not a plain file, but that's ok.)"
4044 if test X"$type" = X; then
4051 for fp in $gfpth; do
4052 if test "X$fp" = X.; then
4057 direxp="$fp/$ansexp"
4059 if test -d "$direxp"; then
4067 if test -d "$ansexp"; then
4068 echo "(Looking for $loc_file in directory $value.)"
4069 value="$value/$loc_file"
4070 ansexp="$ansexp/$loc_file"
4072 if test -f "$ansexp"; then
4075 case "$nopath_ok" in
4076 true) case "$value" in
4078 *) echo "Assuming $value will be in people's path."
4094 if test "$fastread" = yes; then
4099 rp="$what $value doesn't exist. Use that name anyway?"
4118 test "X$gfpthkeep" != Xy && gfpth=""
4121 : determine root of directory hierarchy where package will be installed.
4124 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4127 dflt=`echo "$prefix" | sed 's/.$//'`
4135 By default, $package will be installed in $dflt/bin, manual pages
4136 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4137 installation directories. Typically this is something like /usr/local.
4138 If you wish to have binaries under /usr/bin but other parts of the
4139 installation under /usr/local, that's ok: you will be prompted
4140 separately for each of the installation directories, the prefix being
4141 only used to set the defaults.
4145 rp='Installation prefix to use?'
4153 *) oldprefix="$prefix";;
4160 : allow them to override the AFS root
4163 *) afsroot=$afsroot ;;
4169 $define|true) afs=true ;;
4170 $undef|false) afs=false ;;
4171 *) if $test -d $afsroot; then
4179 echo "AFS may be running... I'll be extra cautious then..." >&4
4181 echo "AFS does not seem to be running..." >&4
4184 : determine installation prefix for where package is to be installed.
4188 Since you are running AFS, I need to distinguish the directory in which
4189 files will reside from the directory in which they are installed (and from
4190 which they are presumably copied to the former directory by occult means).
4193 case "$installprefix" in
4194 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4195 *) dflt="$installprefix";;
4200 In some special cases, particularly when building $package for distribution,
4201 it is convenient to distinguish the directory in which files should be
4202 installed from the directory ($prefix) in which they will
4203 eventually reside. For most users, these two directories are the same.
4206 case "$installprefix" in
4208 *) dflt=$installprefix;;
4212 rp='What installation prefix should I use for installing files?'
4214 installprefix="$ans"
4215 installprefixexp="$ansexp"
4217 : Perform the prefixexp/installprefixexp correction if necessary
4218 cat <<EOS >installprefix
4221 cat <<'EOSC' >>installprefix
4222 : Change installation prefix, if necessary.
4223 if $test X"$prefix" != X"$installprefix"; then
4224 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4226 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4229 chmod +x installprefix
4230 $eunicefix installprefix
4232 : Set variables such as privlib and privlibexp from the output of ./getfile
4233 : performing the prefixexp/installprefixexp correction if necessary.
4234 cat <<EOS >setprefixvar
4237 cat <<'EOSC' >>setprefixvar
4238 eval "${prefixvar}=\"\$ans\""
4239 eval "${prefixvar}exp=\"\$ansexp\""
4242 chmod +x setprefixvar
4243 $eunicefix setprefixvar
4245 : set up the script used to warn in case of inconsistency
4254 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4256 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4257 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4262 echo "*** WHOA THERE!!! ***" >&4
4263 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4266 rp=" Keep the $hint value?"
4269 y) td=$was; tu=$was;;
4273 : function used to set '$1' to '$val'
4274 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4276 $define$undef) . ./whoa; eval "$var=\$td";;
4277 $undef$define) . ./whoa; eval "$var=\$tu";;
4278 *) eval "$var=$val";;
4281 : get the patchlevel
4283 echo "Getting the current patchlevel..." >&4
4284 if $test -r $rsrc/patchlevel.h;then
4285 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4286 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4287 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4288 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4289 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4290 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4291 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4300 $echo "(You do not have patchlevel.h. Eek.)"
4302 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4303 version_patchlevel_string="version $patchlevel subversion $subversion"
4304 case "$perl_patchlevel" in
4306 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4307 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4311 $echo "(You have $package $version_patchlevel_string.)"
4315 : XXX Should be a Configure test for double-dots in filenames.
4316 version=`echo $revision $patchlevel $subversion | \
4317 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4318 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4319 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
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 : Special case the 5.005_xx maintenance series, which used 5.005
4329 : without any subversion label as a subdirectory in $sitelib
4330 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4331 api_versionstring='5.005'
4334 : Do we want threads support and if so, what type
4335 case "$usethreads" in
4336 $define|true|[yY]*) dflt='y';;
4337 *) # Catch case where user specified ithreads or 5005threads but
4338 # forgot -Dusethreads (A.D. 4/2002)
4339 case "$useithreads$use5005threads" in
4340 *$define*) dflt='y';;
4347 Perl can be built to offer a form of threading support on some systems
4348 To do so, Configure can be run with -Dusethreads.
4350 Note that Perl built with threading support runs slightly slower
4351 and uses slightly more memory than plain Perl.
4353 If this doesn't make any sense to you, just accept the default '$dflt'.
4355 rp='Build a threading Perl?'
4358 y|Y) val="$define" ;;
4364 if $test $patchlevel -lt 9; then
4365 case "$usethreads" in
4367 : Default to ithreads unless overridden on command line or with
4370 case "$use5005threads" in
4372 echo "5.005 threads are no longer supported"
4376 case "$useithreads" in
4377 $undef|false|[nN]*) dflt='n';;
4379 rp='Use the newer interpreter-based ithreads?'
4382 y|Y) val="$define" ;;
4387 : Now set use5005threads to the opposite value.
4388 case "$useithreads" in
4389 $define) val="$undef" ;;
4396 useithreads="$undef"
4397 use5005threads="$undef"
4401 case "$useithreads$use5005threads" in
4405 You cannot have both the ithreads and the 5.005 threads enabled
4406 at the same time. Disabling the 5.005 threads since they are
4407 much less stable than the ithreads.
4410 use5005threads="$undef"
4415 : perl-5.9.x and later
4417 if test X"$usethreads" = "X$define"; then
4418 case "$use5005threads" in
4422 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4429 use5005threads="$undef"
4430 useithreads="$usethreads"
4433 case "$d_oldpthreads" in
4434 '') : Configure tests would be welcome here. For now, assume undef.
4436 *) val="$d_oldpthreads" ;;
4442 : Look for a hint-file generated 'call-back-unit'. If the
4443 : user has specified that a threading perl is to be built,
4444 : we may need to set or change some other defaults.
4445 if $test -f usethreads.cbu; then
4446 echo "Your platform has some specific hints regarding threaded builds, using them..."
4449 case "$usethreads" in
4450 "$define"|true|[yY]*)
4452 (Your platform does not have any specific hints for threaded builds.
4453 Assuming POSIX threads, then.)
4459 : Check if multiplicity is required
4462 Perl can be built so that multiple Perl interpreters can coexist
4463 within the same Perl executable.
4466 case "$useithreads" in
4469 This multiple interpreter support is required for interpreter-based threads.
4473 *) case "$usemultiplicity" in
4474 $define|true|[yY]*) dflt='y';;
4478 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4479 rp='Build Perl for multiplicity?'
4482 y|Y) val="$define" ;;
4490 : Check if usequadmath is requested
4491 case "$usequadmath" in
4492 "$define"|true|[yY]*)
4493 usequadmath="$define"
4495 *) usequadmath="$undef" ;;
4498 : Check if morebits is requested
4499 case "$usemorebits" in
4500 "$define"|true|[yY]*)
4501 use64bitint="$define"
4502 uselongdouble="$define"
4503 usemorebits="$define"
4505 *) usemorebits="$undef"
4509 : Determine the C compiler to be used
4515 rp="Use which C compiler?"
4519 : See whether they have no cc but they do have gcc
4521 if $test -f cc.cbu; then
4526 : make some quick guesses about what we are up against
4528 $echo $n "Hmm... $c"
4538 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4539 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4541 echo "Looks kind of like an OSF/1 system, but we'll see..."
4543 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4544 xxx=`./loc addbib blurfl $pth`
4545 if $test -f $xxx; then
4546 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4550 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4551 echo "Looks kind of like an extended USG system, but we'll see..."
4553 echo "Looks kind of like a USG system, but we'll see..."
4557 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4558 echo "Looks kind of like a BSD system, but we'll see..."
4562 echo "Looks kind of like a Version 7 system, but we'll see..."
4565 case "$eunicefix" in
4568 There is, however, a strange, musty smell in the air that reminds me of
4569 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4573 : it so happens the Eunice I know will not run shell scripts in Unix format
4577 echo "Congratulations. You aren't running Eunice."
4581 : Detect OS2. The p_ variable is set above in the Head.U unit.
4582 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4583 : semicolon as a patch separator
4588 I have the feeling something is not exactly right, however...don't tell me...
4589 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4590 (Or you may be running DOS with DJGPP.)
4595 if test -f /xenix; then
4596 echo "Actually, this looks more like a XENIX system..."
4601 echo "It's not Xenix..."
4606 if test -f /venix; then
4607 echo "Actually, this looks more like a VENIX system..."
4614 echo "Nor is it Venix..."
4617 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4618 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4621 : Check if we are using GNU gcc and what its version is
4623 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4627 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4629 printf("%s\n", __VERSION__);
4631 printf("%s\n", "1");
4637 if $cc -o try $ccflags $ldflags try.c; then
4638 gccversion=`$run ./try`
4639 case "$gccversion" in
4640 '') echo "You are not using GNU cc." ;;
4641 *) echo "You are using GNU cc $gccversion."
4647 echo "*** WHOA THERE!!! ***" >&4
4648 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4649 case "$knowitall" in
4651 echo " You'd better start hunting for one and let me know about it." >&4
4657 case "$gccversion" in
4658 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4660 case "$gccversion" in
4661 '') gccosandvers='' ;;
4662 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4663 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4665 case "$gccosandvers" in
4666 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4667 $osname$osvers) ;; # looking good
4668 $osname*) cat <<EOM >&4
4670 *** WHOA THERE!!! ***
4672 Your gcc has not been compiled for the exact release of
4673 your operating system ($gccosandvers versus $osname$osvers).
4675 In general it is a good idea to keep gcc synchronized with
4676 the operating system because otherwise serious problems
4677 may ensue when trying to compile software, like Perl.
4679 I'm trying to be optimistic here, though, and will continue.
4680 If later during the configuration and build icky compilation
4681 problems appear (headerfile conflicts being the most common
4682 manifestation), I suggest reinstalling the gcc to match
4683 your operating system release.
4687 *) gccosandvers='' ;; # failed to parse, better be silent
4695 # gcc 3.* complain about adding -Idirectories that they already know about,
4696 # so we will take those off from locincpth.
4697 case "$gccversion" in
4699 echo "main(){}">try.c
4700 for incdir in $locincpth; do
4701 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4702 grep '^c[cp]p*[01]: warning: changing search order '`
4703 if test "X$warn" != X; then
4704 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4710 # gcc 4.9 by default does some optimizations that break perl.
4711 # see ticket 121505.
4713 # The -fwrapv disables those optimizations (and probably others,) so
4714 # for gcc 4.9 (and later, since the optimizations probably won't go
4715 # away), add -fwrapv unless the user requests -fno-wrapv, which
4716 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4717 # which turns the overflows -fwrapv ignores into runtime errors.
4718 case "$gccversion" in
4719 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4721 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4722 *) ccflags="$ccflags -fwrapv" ;;
4726 : What should the include directory be ?
4727 : Use sysroot if set, so findhdr looks in the right place.
4729 $echo $n "Hmm... $c"
4730 dflt="$sysroot/usr/include"
4733 if $test -f /bin/mips && /bin/mips; then
4734 echo "Looks like a MIPS system..."
4735 $cat >usr.c <<'EOCP'
4736 #ifdef SYSTYPE_BSD43
4740 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4741 dflt='/bsd43/usr/include'
4745 mips_type='System V'
4747 $rm -f usr.c usr.out
4748 echo "and you're compiling with the $mips_type compiler and libraries."
4752 echo "Doesn't look like a MIPS system."
4762 case "$xxx_prompt" in
4765 rp='Where are the include files you want to use?'
4773 : see how we invoke the C preprocessor
4775 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4776 cat <<'EOT' >testcpp.c
4782 if test ! -f cppstdin; then
4783 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4784 # AIX cc -E doesn't show the absolute headerfile
4785 # locations but we'll cheat by using the -M flag.
4786 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
4788 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4791 echo "Keeping your $hint cppstdin wrapper."
4794 wrapper=`pwd`/cppstdin
4798 if $test "X$cppstdin" != "X" && \
4799 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4800 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4802 echo "You used to use $cppstdin $cppminus so we'll use that again."
4804 '') echo "But let's see if we can live without a wrapper..." ;;
4806 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4807 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4809 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4812 echo "(However, $cpprun $cpplast does not work, let's see...)"
4820 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4827 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4828 $cc -E <testcpp.c >testcpp.out 2>&1; \
4829 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4830 echo "Yup, it does."
4831 x_cpp="$cc $cppflags -E"
4833 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4834 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4835 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4836 echo "Yup, it does."
4837 x_cpp="$cc $cppflags -E"
4839 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4840 $cc -P <testcpp.c >testcpp.out 2>&1; \
4841 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4842 echo "Yipee, that works!"
4843 x_cpp="$cc $cppflags -P"
4845 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4846 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4847 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4848 echo "At long last!"
4849 x_cpp="$cc $cppflags -P"
4851 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4852 $cpp <testcpp.c >testcpp.out 2>&1; \
4853 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4855 x_cpp="$cpp $cppflags"
4857 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4858 $cpp - <testcpp.c >testcpp.out 2>&1; \
4859 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4860 echo "Hooray, it works! I was beginning to wonder."
4861 x_cpp="$cpp $cppflags"
4863 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4864 $wrapper <testcpp.c >testcpp.out 2>&1; \
4865 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4871 rp="No dice. I can't find a C preprocessor. Name one:"
4875 $x_cpp <testcpp.c >testcpp.out 2>&1
4876 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4877 echo "OK, that will do." >&4
4879 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4894 echo "Perhaps can we force $cc -E using a wrapper..."
4895 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4896 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4902 echo "Nope, we'll have to live without it..."
4916 "$wrapper"|'cppstdin') ;;
4917 *) $rm -f $wrapper;;
4919 $rm -f testcpp.c testcpp.out
4921 : Adjust cppfilter for path component separator
4923 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4924 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4928 : Use gcc to determine libpth and incpth
4929 # If using gcc or clang, we can get better values for libpth, incpth
4930 # and usrinc directly from the compiler.
4931 # Note that ccname for clang is also gcc.
4934 $echo 'extern int foo;' > try.c
4935 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4937 if $test $# -gt 0; then
4939 incpth="`$echo $incpth|$sed 's/^ //'`"
4941 j="`$echo $i|$sed 's,/include$,/lib,'`"
4942 if $test -d $j; then
4946 libpth="`$echo $libpth|$sed 's/^ //'`"
4947 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4948 if $test -d $xxx; then
4951 *) libpth="$libpth $xxx";;
4958 '') for i in $incpth; do
4959 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4967 case "$usecrosscompile" in
4970 '') echo "Incpth not defined." >&4; croak=y ;;
4971 *) echo "Using incpth '$incpth'." >&4 ;;
4974 '') echo "Libpth not defined." >&4; croak=y ;;
4975 *) echo "Using libpth '$libpth'." >&4 ;;
4978 '') echo "Usrinc not defined." >&4; croak=y ;;
4979 *) echo "Using usrinc $usrinc." >&4 ;;
4983 if test "X$sysroot" = X; then
4984 echo "Cannot continue, aborting." >&4; exit 1
4986 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4995 : Default value for incpth is just usrinc
4997 '') incpth="$usrinc";;
5000 : Set private lib path
5003 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5008 '') dlist="$loclibpth $plibpth $glibpth";;
5009 *) dlist="$libpth";;
5012 : Now check and see which directories actually exist, avoiding duplicates
5015 if $test -d $xxx; then
5018 *) libpth="$libpth $xxx";;
5024 Some systems have incompatible or broken versions of libraries. Among
5025 the directories listed in the question below, please remove any you
5026 know not to be holding relevant libraries, and add any that are needed.
5027 Say "none" for none.
5031 if test "X$sysroot" != X; then
5033 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5046 rp="Directories to use for library searches?"
5053 : compute shared library extension
5056 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5066 On some systems, shared libraries may be available. Answer 'none' if
5067 you want to suppress searching of shared libraries for the remainder
5068 of this configuration.
5071 rp='What is the file extension used for shared libraries?'
5075 : Does target system insist that shared library basenames are unique
5078 Some dynamic loaders assume that the *basename* of shared library filenames
5079 are globally unique. We'll default this to undef as we assume your system
5080 is not this weird. Set to defined if you're on one of them.
5085 rp='Make shared library basenames unique?'
5088 y|Y) val="$define" ;;
5091 set d_libname_unique
5094 : Define several unixisms.
5095 : Hints files or command line option can be used to override them.
5096 : The convoluted testing is in case hints files set either the old
5099 '') case "$exe_ext" in
5101 *) _exe="$exe_ext" ;;
5106 '') case "$lib_ext" in
5113 '') case "$obj_ext" in
5120 '') case "$path_sep" in
5131 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5133 : Which makefile gets called first. This is used by make depend.
5134 case "$firstmakefile" in
5135 '') firstmakefile='makefile';;
5138 : Check is we will use socks
5140 $define|true|[yY]*) dflt='y';;
5145 Perl can be built to use the SOCKS proxy protocol library. To do so,
5146 Configure must be run with -Dusesocks. If you use SOCKS you also need
5147 to use the PerlIO abstraction layer, this will be implicitly selected.
5149 If this doesn't make any sense to you, just accept the default '$dflt'.
5151 rp='Build Perl for SOCKS?'
5154 y|Y) val="$define" ;;
5160 : Check for uselongdouble support
5162 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5165 case "$uselongdouble" in
5166 $define|true|[yY]*) dflt='y';;
5171 Perl can be built to take advantage of long doubles which
5172 (if available) may give more accuracy and range for floating point numbers.
5174 If this doesn't make any sense to you, just accept the default '$dflt'.
5176 rp='Try to use long doubles if available?'
5179 y|Y) val="$define" ;;
5185 case "$uselongdouble" in
5186 true|[yY]*) uselongdouble="$define" ;;
5189 : Look for a hint-file generated 'call-back-unit'. If the
5190 : user has specified that long doubles should be used,
5191 : we may need to set or change some other defaults.
5192 if $test -f uselongdouble.cbu; then
5193 echo "Your platform has some specific hints regarding long doubles, using them..."
5194 . ./uselongdouble.cbu
5196 case "$uselongdouble" in
5199 (Your platform does not have any specific hints for long doubles.)
5205 : Looking for optional libraries
5207 echo "Checking for optional libraries..." >&4
5212 case "$libswanted" in
5213 '') libswanted='c_s';;
5216 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5218 case "$usecbacktrace" in
5219 "$define") libswanted="$libswanted bfd" ;;
5221 case "$usequadmath" in
5222 "$define") libswanted="$libswanted quadmath" ;;
5228 for thisdir in $libpth $xlibpth; do
5229 test -d $thisdir && libspath="$libspath $thisdir"
5231 for thislib in $libswanted; do
5232 for thisdir in $libspath; do
5234 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5235 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5236 $test -f "$xxx" && eval $libscheck
5237 $test -f "$xxx" && libstyle=shared
5238 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5239 $test -f "$xxx" && eval $libscheck
5240 $test -f "$xxx" && libstyle=shared
5242 if test ! -f "$xxx"; then
5243 xxx=$thisdir/lib$thislib.$so
5244 $test -f "$xxx" && eval $libscheck
5245 $test -f "$xxx" && libstyle=shared
5247 if test ! -f "$xxx"; then
5248 xxx=$thisdir/lib$thislib$_a
5249 $test -f "$xxx" && eval $libscheck
5250 $test -f "$xxx" && libstyle=static
5252 if test ! -f "$xxx"; then
5253 xxx=$thisdir/$thislib$_a
5254 $test -f "$xxx" && eval $libscheck
5255 $test -f "$xxx" && libstyle=static
5257 if test ! -f "$xxx"; then
5258 xxx=$thisdir/lib${thislib}_s$_a
5259 $test -f "$xxx" && eval $libscheck
5260 $test -f "$xxx" && libstyle=static
5261 $test -f "$xxx" && thislib=${thislib}_s
5263 if test ! -f "$xxx"; then
5264 xxx=$thisdir/Slib$thislib$_a
5265 $test -f "$xxx" && eval $libscheck
5266 $test -f "$xxx" && libstyle=static
5268 if $test -f "$xxx"; then
5270 shared) echo "Found -l$thislib (shared)." ;;
5271 static) echo "Found -l$thislib." ;;
5272 *) echo "Found -l$thislib ($libstyle)." ;;
5276 *) dflt="$dflt -l$thislib"
5277 libsfound="$libsfound $xxx"
5279 libsfiles="$libsfiles $yyy"
5280 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5281 case " $libsdirs " in
5283 *) libsdirs="$libsdirs $yyy" ;;
5290 if $test ! -f "$xxx"; then
5291 echo "No -l$thislib."
5302 ' '|'') dflt='none';;
5307 In order to compile $package on your machine, a number of libraries
5308 are usually needed. Include any other special libraries here as well.
5309 Say "none" for none. The default list is almost always right.
5313 rp="What libraries to use?"
5320 : determine optimization, if desired, or use for debug flag also
5322 ' '|$undef) dflt='none';;
5324 *) dflt="$optimize";;
5328 By default, $package compiles with the -O flag to use the optimizer.
5329 Alternately, you might want to use the symbolic debugger, which uses
5330 the -g flag (on traditional Unix systems). Either flag can be
5331 specified here. To use neither flag, specify the word "none".
5334 rp="What optimizer/debugger flag should be used?"
5338 'none') optimize=" ";;
5341 : Check what DEBUGGING is required from the command line
5342 : -DEBUGGING or -DDEBUGGING or
5343 : -DEBUGGING=both = -g + -DDEBUGGING
5344 : -DEBUGGING=-g or -Doptimize=-g = -g
5345 : -DEBUGGING=none or -UDEBUGGING =
5346 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5349 *) DEBUGGING=$EBUGGING ;;
5352 case "$DEBUGGING" in
5356 *) optimize="$optimize -g" ;;
5360 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5368 case "$DEBUGGING" in
5369 both|$define) dflt='-DDEBUGGING'
5372 : argument order is deliberate, as the flag will start with - which set could
5373 : think is an option
5374 checkccflag='check=$1; flag=$2; callback=$3;
5376 echo "Checking if your compiler accepts $flag" 2>&1;
5377 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5378 echo "int main(void) { return 0; }" > gcctest.c;
5379 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5380 echo "Yes, it does." 2>&1;
5381 if $test -s gcctest.out ; then
5382 echo "But your platform does not like it:";
5387 echo "Leaving current flags $ccflags alone." 2>&1
5389 *) dflt="$dflt $flag";
5395 echo "Nope, it does not, but that is ok." 2>&1;
5399 : We will not override a previous value, but we might want to
5400 : augment a hint file
5402 default|recommended)
5403 case "$gccversion" in
5404 1*) dflt="$dflt -fpcc-struct-return" ;;
5406 case "$optimize:$DEBUGGING" in
5407 *-g*:old) dflt="$dflt -DDEBUGGING";;
5409 case "$gccversion" in
5410 2*) if $test -d /etc/conf/kconfig.d &&
5411 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5413 # Interactive Systems (ISC) POSIX mode.
5418 case "$gccversion" in
5421 ?*) set strict-aliasing -fno-strict-aliasing
5425 # For gcc, adding -pipe speeds up compilations for some, but apparently
5426 # some assemblers can't read from stdin. (It also slows down compilations
5427 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5428 case "$gccversion" in
5434 # on x86_64 (at least) we require an extra library (libssp) in the
5435 # link command line. This library is not named, so I infer that it is
5436 # an implementation detail that may change. Hence the safest approach
5437 # is to add the flag to the flags passed to the compiler at link time,
5438 # as that way the compiler can do the right implementation dependant
5440 case "$gccversion" in
5441 ?*) set stack-protector-strong -fstack-protector-strong
5444 *-fstack-protector-strong*) ;; # It got added.
5445 *) # Try the plain/older -fstack-protector.
5446 set stack-protector -fstack-protector
5455 case "$mips_type" in
5456 *BSD*|'') inclwanted="$locincpth $usrinc";;
5457 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5459 for thisincl in $inclwanted; do
5460 if $test -d $thisincl; then
5461 if $test x$thisincl != x$usrinc; then
5463 *" -I$thisincl "*);;
5464 *) dflt="$dflt -I$thisincl ";;
5470 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5472 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5480 *) dflt="$dflt -D$2";;
5484 set signal.h LANGUAGE_C; eval $inctest
5488 ccflags="$ccflags -DSOCKS"
5493 default|recommended) dflt="$ccflags $dflt" ;;
5494 *) dflt="$ccflags";;
5503 Your C compiler may want other flags. For this question you should include
5504 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5505 but you should NOT include libraries or ld flags like -lwhatever. If you
5506 want $package to honor its debug switch, you should include -DDEBUGGING here.
5507 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5509 To use no flags, specify the word "none".
5515 rp="Any additional cc flags?"
5522 : the following weeds options from ccflags that are of no interest to cpp
5524 '') cppflags="$ccflags" ;;
5525 *) cppflags="$cppflags $ccflags" ;;
5527 case "$gccversion" in
5528 1*) cppflags="$cppflags -D__GNUC__"
5530 case "$mips_type" in
5532 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5538 echo "Let me guess what the preprocessor flags are..." >&4
5552 *) ftry="$previous $flag";;
5554 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5555 >cpp1.out 2>/dev/null && \
5556 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5557 >cpp2.out 2>/dev/null && \
5558 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5559 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5561 cppflags="$cppflags $ftry"
5571 *-*) echo "They appear to be: $cppflags";;
5573 $rm -f cpp.c cpp?.out
5577 : flags used in final linking phase
5579 '') if ./venix; then
5585 *-posix*) dflt="$dflt -posix" ;;
5588 *) dflt="$ldflags";;
5590 # See note above about -fstack-protector
5592 *-fstack-protector-strong*)
5594 *-fstack-protector-strong*) ;; # Don't add it again
5595 *) dflt="$dflt -fstack-protector-strong" ;;
5598 *-fstack-protector*)
5600 *-fstack-protector*) ;; # Don't add it again
5601 *) dflt="$dflt -fstack-protector" ;;
5606 : Try to guess additional flags to pick up local libraries.
5607 for thislibdir in $libpth; do
5608 case " $loclibpth " in
5611 *"-L$thislibdir "*) ;;
5612 *) dflt="$dflt -L$thislibdir" ;;
5624 Your C linker may need flags. For this question you should
5625 include -L/whatever and any other flags used by the C linker, but you
5626 should NOT include libraries like -lwhatever.
5628 Make sure you include the appropriate -L/path flags if your C linker
5629 does not normally search all of the directories you specified above,
5632 To use no flags, specify the word "none".
5636 rp="Any additional ld flags (NOT including libraries)?"
5642 rmlist="$rmlist pdp11"
5646 echo "Checking your choice of C compiler and flags for coherency..." >&4
5647 $cat > try.c <<'EOF'
5649 int main() { printf("Ok\n"); return(0); }
5651 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5653 $cat >try.msg <<'EOM'
5654 I've tried to compile and run the following simple program:
5657 $cat try.c >> try.msg
5659 $cat >> try.msg <<EOM
5666 and I got the following output:
5670 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5671 if $sh -c "$run ./try " >>try.msg 2>&1; then
5675 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5678 echo "The program compiled OK, but exited with status $?." >>try.msg
5679 rp="You have a problem. Shall I abort Configure"
5683 echo "I can't compile the test program." >>try.msg
5684 rp="You have a BIG problem. Shall I abort Configure"
5690 case "$knowitall" in
5692 echo "(The supplied flags or libraries might be incorrect.)"
5700 *) echo "Ok. Stopping Configure." >&4
5705 n) echo "OK, that should do.";;
5707 $rm_try gcctest gcctest.out
5709 : define a shorthand compile call
5713 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5714 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5718 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5719 : define a shorthand compile call for compilations that should be ok.
5723 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5725 : determine filename position in cpp output
5727 echo "Computing filename position in cpp output for #include directives..." >&4
5729 vos) testaccess=-e ;;
5732 echo '#include <stdio.h>' > foo.c
5735 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5736 $grep '^[ ]*#.*stdio\.h' | \
5737 while read cline; do
5740 while $test \$# -gt 0; do
5741 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5746 pos=\`expr \$pos + 1\`
5758 *) pos="${fieldn}th";;
5760 echo "Your cpp writes the filename in the $pos field of the line."
5762 : locate header file
5767 for usrincdir in $incpth
5769 if test -f \$usrincdir/\$wanted; then
5770 echo "\$usrincdir/\$wanted"
5774 awkprg='{ print \$$fieldn }'
5775 echo "#include <\$wanted>" > foo\$\$.c
5776 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5777 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5778 while read cline; do
5779 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5781 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5782 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5787 # status = 0: grep returned 0 lines, case statement not executed
5788 # status = 1: headerfile found
5789 # status = 2: while loop executed, no headerfile found
5793 if test \$status -eq 1; then
5800 : define an alternate in-header-list? function
5801 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5802 cont=true; xxf="echo \"<\$1> found.\" >&4";
5803 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5804 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5806 case $# in 4) instead=instead;; *) instead="at last";; esac;
5807 while $test "$cont"; do
5809 var=$2; eval "was=\$$2";
5810 if $test "$xxx" && $test -r "$xxx";
5812 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5815 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5816 set $yyy; shift; shift; yyy=$@;
5817 case $# in 0) cont="";;
5818 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5819 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5820 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5821 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5825 do set $yyy; var=$2; eval "was=\$$2";
5826 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5827 set $yyy; shift; shift; yyy=$@;
5830 : see if stdlib is available
5831 set stdlib.h i_stdlib
5834 : check for lengths of integral types
5838 echo "Checking to see how big your integers are..." >&4
5847 printf("intsize=%d;\n", (int)sizeof(int));
5848 printf("longsize=%d;\n", (int)sizeof(long));
5849 printf("shortsize=%d;\n", (int)sizeof(short));
5854 if eval $compile_ok && $run ./try > /dev/null; then
5856 echo "Your integers are $intsize bytes long."
5857 echo "Your long integers are $longsize bytes long."
5858 echo "Your short integers are $shortsize bytes long."
5862 Help! I can't compile and run the intsize test program: please enlighten me!
5863 (This is probably a misconfiguration in your system or libraries, and
5864 you really ought to fix it. Still, I'll try anyway.)
5868 rp="What is the size of an integer (in bytes)?"
5872 rp="What is the size of a long integer (in bytes)?"
5876 rp="What is the size of a short integer (in bytes)?"
5884 : check for long long
5886 echo "Checking to see if you have long long..." >&4
5887 echo 'int main() { long long x = 7; return 0; }' > try.c
5889 if eval $compile; then
5891 echo "You have long long."
5894 echo "You do not have long long."
5900 : check for length of long long
5901 case "${d_longlong}${longlongsize}" in
5904 echo "Checking to see how big your long longs are..." >&4
5905 $cat >try.c <<'EOCP'
5909 printf("%d\n", (int)sizeof(long long));
5914 if eval $compile_ok; then
5915 longlongsize=`$run ./try`
5916 echo "Your long longs are $longlongsize bytes long."
5920 echo "(I can't seem to compile the test program. Guessing...)"
5921 rp="What is the size of a long long (in bytes)?"
5925 if $test "X$longsize" = "X$longlongsize"; then
5926 echo "(That isn't any different from an ordinary long.)"
5932 : see if inttypes.h is available
5933 : we want a real compile instead of Inhdr because some systems
5934 : have an inttypes.h which includes non-existent headers
5937 #include <inttypes.h>
5939 static int32_t foo32 = 0x12345678;
5943 if eval $compile; then
5944 echo "<inttypes.h> found." >&4
5947 echo "<inttypes.h> NOT found." >&4
5956 echo "Checking to see if you have int64_t..." >&4
5958 #include <sys/types.h>
5959 #$i_inttypes I_INTTYPES
5961 #include <inttypes.h>
5963 int main() { int64_t x = 7; }
5966 if eval $compile; then
5968 echo "You have int64_t."
5971 echo "You do not have int64_t."
5977 : Check if 64bit ints have a quad type
5979 echo "Checking which 64-bit integer type we could use..." >&4
5985 val='"unsigned int"'
5990 *) case "$longsize" in
5994 val='"unsigned long"'
5999 *) case "$d_longlong:$longlongsize" in
6004 val='"unsigned long long"'
6009 *) case "$d_int64_t" in
6028 '') echo "Alas, no 64-bit integer types in sight." >&4
6031 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6036 : Do we want 64bit support
6037 case "$uselonglong" in
6038 "$define"|true|[yY]*)
6041 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6043 use64bitint="$define"
6046 case "$use64bits" in
6047 "$define"|true|[yY]*)
6050 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6052 use64bitint="$define"
6055 case "$use64bitints" in
6056 "$define"|true|[yY]*)
6059 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6061 use64bitint="$define"
6064 case "$use64bitsint" in
6065 "$define"|true|[yY]*)
6068 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6070 use64bitint="$define"
6073 case "$uselonglongs" in
6074 "$define"|true|[yY]*)
6077 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6079 use64bitint="$define"
6082 case "$use64bitsall" in
6083 "$define"|true|[yY]*)
6086 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6088 use64bitall="$define"
6093 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6095 case "$use64bitall" in
6096 "$define"|true|[yY]*) use64bitint="$define" ;;
6102 You have natively 64-bit long integers.
6106 *) case "$use64bitint" in
6107 "$define"|true|[yY]*) dflt='y';;
6116 Perl can be built to take advantage of 64-bit integer types
6117 on some systems. To do so, Configure can be run with -Duse64bitint.
6118 Choosing this option will most probably introduce binary incompatibilities.
6120 If this doesn't make any sense to you, just accept the default '$dflt'.
6121 (The default has been chosen based on your configuration.)
6123 rp='Try to use 64-bit integers, if available?'
6126 [yY]*) val="$define" ;;
6134 case "$use64bitall" in
6135 "$define"|true|[yY]*) dflt='y' ;;
6136 *) case "$longsize" in
6144 You may also choose to try maximal 64-bitness. It means using as much
6145 64-bitness as possible on the platform. This in turn means even more
6146 binary incompatibilities. On the other hand, your platform may not
6147 have any more 64-bitness available than what you already have chosen.
6149 If this doesn't make any sense to you, just accept the default '$dflt'.
6150 (The default has been chosen based on your configuration.)
6152 rp='Try to use maximal 64-bit support, if available?'
6155 [yY]*) val="$define" ;;
6160 case "$use64bitall" in
6162 case "$use64bitint" in
6166 Since you have chosen a maximally 64-bit build, I'm also turning on
6167 the use of 64-bit integers.
6169 use64bitint="$define" ;;
6174 : Look for a hint-file generated 'call-back-unit'. If the
6175 : user has specified that a 64-bit perl is to be built,
6176 : we may need to set or change some other defaults.
6177 if $test -f use64bitint.cbu; then
6178 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6181 case "$use64bitint" in
6182 "$define"|true|[yY]*)
6183 : This test was common to all the OpenBSD forks, and seems harmless for
6186 echo "Checking if your C library has broken 64-bit functions..." >&4
6189 typedef $uquadtype myULL;
6196 {4294967303.15, 4294967303ULL},
6197 {4294967294.2, 4294967294ULL},
6198 {4294967295.7, 4294967295ULL},
6201 for (p = test; p->u; p++) {
6202 myULL x = (myULL)p->d;
6213 if eval $compile_ok; then
6214 libcquad=`$run ./try`
6215 echo "Your C library's 64-bit functions are $libcquad."
6217 echo "(I can't seem to compile the test program.)"
6218 echo "Assuming that your C library's 64-bit functions are ok."
6227 *** You have a C library with broken 64-bit functions.
6228 *** 64-bit support does not work reliably in this configuration.
6229 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6230 *** Cannot continue, aborting.
6237 4) case "$archname64" in
6238 '') archname64=64int ;;
6245 : Look for a hint-file generated 'call-back-unit'. If the
6246 : user has specified that a maximally 64-bit perl is to be built,
6247 : we may need to set or change some other defaults.
6248 if $test -f use64bitall.cbu; then
6249 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6252 case "$use64bitall" in
6253 "$define"|true|[yY]*)
6255 4) case "$archname64" in
6256 ''|64int) archname64=64all ;;
6263 case "$d_quad:$use64bitint" in
6267 *** You have chosen to use 64-bit integers,
6268 *** but none can be found.
6269 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6270 *** Cannot continue, aborting.
6277 : Check if we are using the GNU C library
6279 echo "Checking for GNU C Library..." >&4
6281 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6282 alone are insufficient to distinguish different versions, such as
6283 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6284 libc version 2.1.0. A. Dougherty, June 3, 2002.
6290 # ifdef __GLIBC_MINOR__
6291 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6292 # include <gnu/libc-version.h>
6293 printf("%s\n", gnu_get_libc_version());
6295 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6298 printf("%d\n", __GLIBC__);
6307 if eval $compile_ok && $run ./try > glibc.ver; then
6309 gnulibc_version=`$cat glibc.ver`
6310 echo "You are using the GNU C Library version $gnulibc_version"
6314 echo "You are not using the GNU C Library"
6320 : see if nm is to be used to determine whether a symbol is defined or not
6324 case "$d_gnulibc" in
6327 echo "nm probably won't work on the GNU C Library." >&4
6333 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6335 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6336 echo "'nm' won't be sufficient on this system." >&4
6342 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6343 if $test $dflt -gt 20; then
6353 true|$define) dflt=y;;
6360 I can use $nm to extract the symbols from your C libraries. This
6361 is a time consuming task which may generate huge output on the disk (up
6362 to 3 megabytes) but that should make the symbols extraction faster. The
6363 alternative is to skip the 'nm' extraction part and to compile a small
6364 test program instead to determine whether each symbol is present. If
6365 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6366 this may be the best solution.
6368 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6371 rp="Shall I use $nm to extract C symbols from the libraries?"
6374 [Nn]*) usenm=false;;
6383 : nm options which may be necessary
6385 '') if $test -f /mach_boot; then
6387 elif $test -d /usr/ccs/lib; then
6388 nm_opt='-p' # Solaris (and SunOS?)
6389 elif $test -f /dgux; then
6391 elif $test -f /lib64/rld; then
6392 nm_opt='-p' # 64-bit Irix
6398 : nm options which may be necessary for shared libraries but illegal
6399 : for archive libraries. Thank you, Linux.
6400 case "$nm_so_opt" in
6401 '') case "$myuname" in
6403 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6404 nm_so_opt='--dynamic'
6411 : Figure out where the libc is located
6414 : get list of predefined functions in a handy place
6419 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6425 *) for thislib in $libs; do
6428 : Handle C library specially below.
6431 thislib=`echo $thislib | $sed -e 's/^-l//'`
6432 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6434 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6436 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6438 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6440 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6442 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6444 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6449 libnames="$libnames $try"
6451 *) libnames="$libnames $thislib" ;;
6460 for xxx in $libpth; do
6461 $test -r $1 || set $xxx/libc.$so
6462 : The messy sed command sorts on library version numbers.
6464 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6465 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6467 s/[0-9][0-9]*/0000&/g
6468 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6471 $sort | $sed -e 's/^.* //'`
6474 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6475 $test -r $1 || set $sysroot/lib/libsys_s$_a
6481 if $test -r "$1"; then
6482 echo "Your (shared) C library seems to be in $1."
6484 elif $test -r /lib/libc && $test -r /lib/clib; then
6485 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6487 libc='/lib/clib /lib/libc'
6488 if $test -r /lib/syslib; then
6489 echo "(Your math library is in /lib/syslib.)"
6490 libc="$libc /lib/syslib"
6492 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6493 echo "Your C library seems to be in $libc, as you said before."
6494 elif $test -r $incpath/usr/lib/libc$_a; then
6495 libc=$incpath/usr/lib/libc$_a;
6496 echo "Your C library seems to be in $libc. That's fine."
6497 elif $test -r /lib/libc$_a; then
6499 echo "Your C library seems to be in $libc. You're normal."
6501 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6503 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6504 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6505 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6507 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6509 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6512 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6514 if $test -r "$tans"; then
6515 echo "Your C library seems to be in $tans, of all places."
6521 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6525 If the guess above is wrong (which it might be if you're using a strange
6526 compiler, or your machine supports multiple models), you can override it here.
6531 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6533 I can't seem to find your C library. I've looked in the following places:
6536 $sed 's/^/ /' libpath
6539 None of these seems to contain your C library. I need to get its name...
6544 rp='Where is your C library?'
6549 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6550 set X `cat libnames`
6553 case $# in 1) xxx=file; esac
6554 echo "Extracting names from the following $xxx for later perusal:" >&4
6556 $sed 's/^/ /' libnames >&4
6558 $echo $n "This may take a while...$c" >&4
6562 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6563 *) $nm $nm_opt $file 2>/dev/null;;
6568 $grep fprintf libc.tmp > libc.ptf
6569 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6570 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6572 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6574 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6576 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6578 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6580 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6582 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6584 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6586 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6588 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6592 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6596 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6597 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6599 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6601 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6603 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6605 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6609 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6613 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6617 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6621 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6625 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6630 $nm -p $* 2>/dev/null >libc.tmp
6631 $grep fprintf libc.tmp > libc.ptf
6632 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6633 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6639 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6641 if $ar t $libc > libc.tmp && \
6642 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6644 for thisname in $libnames $libc; do
6645 $ar t $thisname >>libc.tmp
6647 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6649 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6650 for thisname in $libnames $libc; do
6651 $ar tv $thisname >>libc.tmp
6652 emximp -o tmp.imp $thisname \
6654 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6655 < tmp.imp >>libc.tmp
6658 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6661 echo "$ar didn't seem to work right." >&4
6662 echo "Maybe this is a Cray...trying bld instead..." >&4
6664 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6667 for thisname in $libnames; do
6669 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6670 $ar t $thisname >>libc.tmp
6674 echo "That didn't work either. Giving up." >&4
6684 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6685 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6687 *) if $test -f /lib/syscalls.exp; then
6689 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6690 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6691 /lib/syscalls.exp >>libc.list
6697 $rm -f libnames libpath
6699 : Check if we are using C++
6701 echo "Checking for C++..." >&4
6702 $cat >try.c <<'EOCP'
6714 if eval $compile_ok && $run ./try; then
6716 echo "You are using a C++ compiler."
6719 echo "You are not using a C++ compiler."
6725 : is a C symbol defined?
6728 -v) tf=libc.tmp; tdc="";;
6729 -a) tf=libc.tmp; tdc="[]";;
6730 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6732 case "$d_cplusplus" in
6733 $define) extern_C="extern \"C\"" ;;
6734 *) extern_C="extern" ;;
6737 case "$reuseval-$4" in
6739 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6744 if $test "$runnm" = true; then
6745 if $contains $tlook $tf >/dev/null 2>&1; then
6747 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6748 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;
6749 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6750 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6754 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;
6755 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6761 $define) tval=true;;
6768 : define an is-in-libc? function
6769 inlibc='echo " "; td=$define; tu=$undef;
6770 sym=$1; var=$2; eval "was=\$$2";
6772 case "$reuseval$was" in
6782 echo "$sym() found." >&4;
6783 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6785 echo "$sym() NOT found." >&4;
6786 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6790 $define) echo "$sym() found." >&4;;
6791 *) echo "$sym() NOT found." >&4;;
6795 : check for length of double
6797 case "$doublesize" in
6799 echo "Checking to see how big your double precision numbers are..." >&4
6808 printf("%d\n", (int)sizeof(double));
6813 if eval $compile_ok; then
6814 doublesize=`$run ./try`
6815 echo "Your double is $doublesize bytes long."
6818 echo "(I can't seem to compile the test program. Guessing...)"
6819 rp="What is the size of a double precision number (in bytes)?"
6827 : see if this is a float.h system
6832 $echo "Checking the kind of doubles you have..." >&4
6835 #define DOUBLESIZE $doublesize
6840 static const double d = -0.1;
6842 unsigned const char* b = (unsigned const char*)(&d);
6844 if (b[0] == 0xCD && b[3] == 0xBD) {
6845 /* IEEE 754 32-bit little-endian */
6849 if (b[0] == 0xBD && b[3] == 0xCD) {
6850 /* IEEE 754 32-bit big-endian */
6856 if (b[0] == 0x9A && b[7] == 0xBF) {
6857 /* IEEE 754 64-bit little-endian */
6861 if (b[0] == 0xBF && b[7] == 0x9A) {
6862 /* IEEE 754 64-bit big-endian */
6866 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
6867 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
6868 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
6869 * 99 99 b9 bf 9a 99 99 99 */
6873 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
6874 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
6875 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
6876 * 99 99 99 9a bf b9 99 99 */
6881 #if DOUBLESIZE == 16
6882 if (b[0] == 0x9A && b[15] == 0xBF) {
6883 /* IEEE 754 128-bit little-endian */
6887 if (b[0] == 0xBF && b[15] == 0x9A) {
6888 /* IEEE 754 128-bit big-endian */
6893 /* Rumoredly some old ARM processors have 'mixed endian' doubles,
6894 * two 32-bit little endians stored in big-endian order. */
6895 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
6896 * Whether those environments can still build Perl is debatable. */
6897 printf("-1\n"); /* unknown */
6902 if eval $compile; then
6903 doublekind=`$run ./try`
6907 case "$doublekind" in
6908 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
6909 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
6910 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
6911 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
6912 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
6913 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
6914 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
6918 : check for long doubles
6920 echo "Checking to see if you have long double..." >&4
6921 echo 'int main() { long double x = 7.0; }' > try.c
6923 if eval $compile; then
6925 echo "You have long double."
6928 echo "You do not have long double."
6934 : see if ldexpl exists
6938 : see if this is a quadmath.h system
6939 set quadmath.h i_quadmath
6942 : check for length of long double
6943 case "${d_longdbl}${longdblsize}" in
6946 echo "Checking to see how big your long doubles are..." >&4
6947 $cat >try.c <<'EOCP'
6951 printf("%d\n", sizeof(long double));
6956 if eval $compile; then
6957 longdblsize=`$run ./try`
6958 echo "Your long doubles are $longdblsize bytes long."
6962 echo "(I can't seem to compile the test program. Guessing...)" >&4
6963 rp="What is the size of a long double (in bytes)?"
6967 if $test "X$doublesize" = "X$longdblsize"; then
6968 echo "That isn't any different from an ordinary double."
6969 echo "I'll keep your setting anyway, but you may see some"
6970 echo "harmless compilation warnings."
6977 $echo "Checking the kind of long doubles you have..." >&4
6978 case "$d_longdbl" in
6983 #define LONGDBLSIZE $longdblsize
6984 #define DOUBLESIZE $doublesize
6991 static const long double d = -0.1L;
6994 unsigned const char* b = (unsigned const char*)(&d);
6995 #if DOUBLESIZE == LONGDBLSIZE
6996 printf("0\n"); /* if it floats like double */
6999 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
7000 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
7001 /* IEEE 754 128-bit little-endian */
7005 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
7006 /* IEEE 128-bit big-endian, e.g. solaris sparc */
7011 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
7012 * while 64-bits platforms have it in 16 bytes. */
7013 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
7014 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
7015 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
7016 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7017 * Also known as "extended precision". */
7021 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
7022 /* is there ever big-endian 80-bit, really? */
7027 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7028 /* software "double double", the 106 is 53+53.
7029 * but irix thinks it is 107. */
7030 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7031 /* double double 128-bit little-endian,
7032 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7036 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7037 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
7038 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7043 printf("-1\n"); /* unknown */
7048 if eval $compile; then
7049 longdblkind=`$run ./try`
7056 case "$longdblkind" in
7057 0) echo "Your long doubles are doubles." >&4 ;;
7058 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7059 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7060 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7061 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7062 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
7063 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
7064 *) echo "Cannot figure out your long double." >&4 ;;
7068 : Check print/scan long double stuff
7071 if $test X"$d_longdbl" = X"$define"; then
7073 echo "Checking how to print long doubles..." >&4
7075 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7076 $cat >try.c <<'EOCP'
7077 #include <sys/types.h>
7081 printf("%.3f\n", d);
7085 if eval $compile; then
7089 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7090 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7091 echo "We will use %f."
7097 if $test X"$sPRIfldbl" = X; then
7098 $cat >try.c <<'EOCP'
7099 #include <sys/types.h>
7102 long double d = 123.456;
7103 printf("%.3Lf\n", d);
7107 if eval $compile; then
7111 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7112 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7113 echo "We will use %Lf."
7119 if $test X"$sPRIfldbl" = X; then
7120 $cat >try.c <<'EOCP'
7121 #include <sys/types.h>
7124 long double d = 123.456;
7125 printf("%.3llf\n", d);
7129 if eval $compile; then
7133 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7134 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7135 echo "We will use %llf."
7141 if $test X"$sPRIfldbl" = X; then
7142 $cat >try.c <<'EOCP'
7143 #include <sys/types.h>
7146 long double d = 123.456;
7147 printf("%.3lf\n", d);
7151 if eval $compile; then
7155 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7156 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7157 echo "We will use %lf."
7163 if $test X"$sPRIfldbl" = X; then
7164 echo "Cannot figure out how to print long doubles." >&4
7166 sSCNfldbl=$sPRIfldbl # expect consistency
7173 case "$sPRIfldbl" in
7174 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7175 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7176 d_SCNfldbl="$undef";
7178 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7179 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7180 d_SCNfldbl="$define";
7184 : Before committing on uselongdouble, see whether that looks sane.
7185 if $test "$uselongdouble" = "$define"; then
7188 echo "Checking if your long double math functions work right..." >&4
7193 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
7196 case "$osname:$gccversion" in
7197 aix:) saveccflags="$ccflags"
7198 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
7201 if eval $compile_ok; then
7205 3) echo "Your long double math functions are working correctly." >&4 ;;
7206 *) echo "Your long double math functions are broken, not using long doubles." >&4
7207 uselongdouble=$undef
7211 case "$osname:$gccversion" in
7212 aix:) ccflags="$saveccflags" ;; # restore
7216 : determine the architecture name
7218 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7219 tarch=`arch`"-$osname"
7220 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7221 if uname -m > tmparch 2>&1 ; then
7222 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7223 -e 's/$/'"-$osname/" tmparch`
7231 case "$myarchname" in
7234 echo "(Your architecture name used to be $myarchname.)"
7238 case "$targetarch" in
7240 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7245 *) dflt="$archname";;
7247 rp='What is your architecture name'
7251 : optionally add API version to the architecture for versioned archlibs
7252 case "$useversionedarchname" in
7253 $define|true|[yY]*) dflt='y';;
7256 rp='Add the Perl API version to your archname?'
7259 y|Y) useversionedarchname="$define" ;;
7260 *) useversionedarchname="$undef" ;;
7262 case "$useversionedarchname" in
7265 *-$api_versionstring)
7266 echo "...and architecture name already has -$api_versionstring" >&4
7269 archname="$archname-$api_versionstring"
7270 echo "...setting architecture name to $archname." >&4
7276 case "$usethreads" in
7278 echo "Threads selected." >&4
7280 *-thread*) echo "...and architecture name already has -thread." >&4
7282 *) archname="$archname-thread"
7283 echo "...setting architecture name to $archname." >&4
7288 case "$usemultiplicity" in
7290 echo "Multiplicity selected." >&4
7292 *-multi*) echo "...and architecture name already has -multi." >&4
7294 *) archname="$archname-multi"
7295 echo "...setting architecture name to $archname." >&4
7300 case "$use64bitint$use64bitall" in
7302 case "$archname64" in
7304 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7307 case "$use64bitint" in
7308 "$define") echo "64 bit integers selected." >&4 ;;
7310 case "$use64bitall" in
7311 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7314 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7316 *) archname="$archname-$archname64"
7317 echo "...setting architecture name to $archname." >&4
7323 case "$uselongdouble" in
7325 echo "Long doubles selected." >&4
7326 case "$longdblsize" in
7328 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7332 *-ld*) echo "...and architecture name already has -ld." >&4
7334 *) archname="$archname-ld"
7335 echo "...setting architecture name to $archname." >&4
7342 case "$usequadmath" in
7344 echo "quadmath selected." >&4
7346 *-ld*) echo "...and architecture name already has -quadmath." >&4
7348 *) archname="$archname-quadmath"
7349 echo "...setting architecture name to $archname." >&4
7354 if $test -f archname.cbu; then
7355 echo "Your platform has some specific hints for architecture name, using them..."
7359 : set the prefixit variable, to compute a suitable default value
7360 prefixit='case "$3" in
7362 case "$oldprefix" in
7363 "") eval "$1=\"\$$2\"";;
7370 ""|" ") eval "$1=\"\$$2\"";;
7376 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7378 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7379 /*-$oldprefix/*|\~*-$oldprefix/*)
7380 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7381 *) eval "$1=\"\$$2\"";;
7385 : determine installation style
7386 : For now, try to deduce it from prefix unless it is already set.
7387 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7388 case "$installstyle" in
7389 '') case "$prefix" in
7390 *perl*) dflt='lib';;
7391 *) dflt='lib/perl5' ;;
7394 *) dflt="$installstyle" ;;
7396 : Probably not worth prompting for this since we prompt for all
7397 : the directories individually, and the prompt would be too long and
7401 : determine where public executables go
7406 rp='Pathname where the public executables will reside?'
7408 if $test "X$ansexp" != "X$binexp"; then
7412 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7413 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7414 : this via initialinstalllocation
7417 case "$userelocatableinc" in
7418 $define|true|[yY]*) dflt='y' ;;
7423 Would you like to build Perl so that the installation is relocatable, so that
7424 library paths in @INC are determined relative to the path of the perl binary?
7425 This is not advised for system Perl installs, or if you need to run setid
7426 scripts or scripts under taint mode.
7428 If this doesn't make any sense to you, just accept the default '$dflt'.
7430 rp='Use relocatable @INC?'
7433 y|Y) val="$define" ;;
7436 set userelocatableinc
7439 initialinstalllocation="$binexp"
7440 : Default prefix is now "up one level from where the binaries are"
7441 case "$userelocatableinc" in
7447 installprefixexp=".../.."
7451 : determine where private library files go
7452 : Usual default is /usr/local/lib/perl5/$version.
7453 : Also allow things like /opt/perl/lib/$version, since
7454 : /opt/perl/lib/perl5... would be redundant.
7455 : The default "style" setting is made in installstyle.U
7456 case "$installstyle" in
7457 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7458 *) set dflt privlib lib/$version ;;
7463 There are some auxiliary files for $package that need to be put into a
7464 private library directory that is accessible by everyone.
7469 rp='Pathname where the private library files will reside?'
7474 : set the prefixup variable, to restore leading tilda escape
7475 prefixup='case "$prefixexp" in
7477 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7480 : determine where public architecture dependent libraries go
7483 : privlib default is /usr/local/lib/$package/$version
7484 : archlib default is /usr/local/lib/$package/$version/$archname
7485 : privlib may have an optional trailing /share.
7486 tdflt=`echo $privlib | $sed 's,/share$,,'`
7487 tdflt=$tdflt/$archname
7496 $spackage contains architecture-dependent library files. If you are
7497 sharing libraries in a heterogeneous environment, you might store
7498 these files in a separate location. Otherwise, you can just include
7499 them with the rest of the public library files.
7504 rp='Where do you want to put the public architecture-dependent libraries?'
7508 if $test X"$archlib" = X"$privlib"; then
7514 : see if setuid scripts can be secure
7517 Some kernels have a bug that prevents setuid #! scripts from being
7518 secure. Some sites have disabled setuid #! scripts because of this.
7520 First let's decide if your kernel supports secure setuid #! scripts.
7521 (If setuid #! scripts would be secure but have been disabled anyway,
7522 don't say that they are secure if asked.)
7527 if $test -d /dev/fd; then
7528 echo "#!$ls" >reflect
7529 chmod +x,u+s reflect
7530 ./reflect >flect 2>&1
7531 if $contains "/dev/fd" flect >/dev/null; then
7532 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7536 If you are not sure if they are secure, I can check but I'll need a
7537 username and password different from the one you are using right now.
7538 If you don't have such a username or don't want me to test, simply
7542 rp='Other username to test security of setuid scripts with?'
7547 case "$d_suidsafe" in
7548 '') echo "I'll assume setuid scripts are *not* secure." >&4
7551 echo "Well, the $hint value is *not* secure." >&4
7553 *) echo "Well, the $hint value *is* secure." >&4
7558 $rm -f reflect flect
7559 echo "#!$ls" >reflect
7560 chmod +x,u+s reflect
7563 echo '"su" will (probably) prompt you for '"$ans's password."
7564 su $ans -c './reflect >flect'
7565 if $contains "/dev/fd" flect >/dev/null; then
7566 echo "Okay, it looks like setuid scripts are secure." >&4
7569 echo "I don't think setuid scripts are secure." >&4
7574 rp='Does your kernel have *secure* setuid scripts?'
7577 [yY]*) val="$define";;
7582 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7583 echo "(That's for file descriptors, not floppy disks.)"
7589 $rm -f reflect flect
7591 : now see if they want to do setuid emulation
7592 if $test $patchlevel -lt 11; then
7595 case "$d_suidsafe" in
7598 echo "No need to emulate SUID scripts since they are secure here." >&4
7602 Some systems have disabled setuid scripts, especially systems where
7603 setuid scripts cannot be secure. On systems where setuid scripts have
7604 been disabled, the setuid/setgid bits on scripts are currently
7605 useless. It is possible for $package to detect those bits and emulate
7606 setuid/setgid in a secure fashion. This emulation will only work if
7607 setuid scripts have been disabled in your kernel.
7611 "$define") dflt=y ;;
7614 rp="Do you want to do setuid/setgid emulation?"
7617 [yY]*) val="$define";;
7629 SUID emulation has been removed for 5.12
7630 Please re-run Configure without -Dd_dosuid
7639 : Find perl5.005 or later.
7640 echo "Looking for a previously installed perl5.005 or later... "
7642 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7643 : Check if this perl is recent and can load a simple module
7644 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7647 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7657 '') echo "None found. That's ok.";;
7658 *) echo "Using $perl5." ;;
7661 : Set the siteprefix variables
7664 After $package is installed, you may wish to install various
7665 add-on modules and utilities. Typically, these add-ons will
7666 be installed under $prefix with the rest
7667 of this package. However, you may wish to install such add-ons
7668 elsewhere under a different prefix.
7670 If you do not wish to put everything under a single prefix, that's
7671 ok. You will be prompted for the individual locations; this siteprefix
7672 is only used to suggest the defaults.
7674 The default should be fine for most people.
7678 rp='Installation prefix to use for add-on modules and utilities?'
7679 : XXX Here might be another good place for an installstyle setting.
7680 case "$siteprefix" in
7682 *) dflt=$siteprefix ;;
7685 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7687 case "$siteprefix" in
7691 *) oldsiteprefix="$prefix";;
7696 siteprefixexp="$ansexp"
7698 : determine where site specific libraries go.
7699 : Usual default is /usr/local/lib/perl5/site_perl/$version
7700 : The default "style" setting is made in installstyle.U
7701 : XXX No longer works with Prefixit stuff.
7702 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7704 '') case "$installstyle" in
7705 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7706 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7714 The installation process will create a directory for
7715 site-specific extensions and modules. Most users find it convenient
7716 to place all site-specific files in this directory rather than in the
7717 main distribution directory.
7721 rp='Pathname for the site-specific library files?'
7725 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7727 : Determine list of previous versions to include in @INC
7728 $cat > getverlist <<EOPL
7731 \$api_versionstring = "$api_versionstring";
7732 \$version = "$version";
7733 \$stem = "$sitelib_stem";
7734 \$archname = "$archname";
7736 $cat >> getverlist <<'EOPL'
7737 # The list found is store twice for each entry: the original name, and
7738 # the binary broken down version as pack "sss", so sorting is easy and
7739 # unambiguous. This will work for all versions that have a maximum of
7740 # three digit groups, separate by '.'s or '_'s. Names are extended with
7741 # ".0.0" to ensure at least three elements for the pack.
7742 # -- H.Merijn Brand (m)'06 23-10-2006
7744 # Can't have leading @ because metaconfig interprets it as a command!
7745 ;@inc_version_list=();
7746 # XXX Redo to do opendir/readdir?
7749 ;@candidates = map {
7750 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7751 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7757 ($pversion, $aversion, $vsn5005) = map {
7758 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7759 foreach $d (@candidates) {
7760 if ($d->[1] lt $pversion) {
7761 if ($d->[1] ge $aversion) {
7762 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7764 elsif ($d->[1] ge $vsn5005) {
7765 unshift(@inc_version_list, grep { -d } $d->[0]);
7769 # Skip newer version. I.e. don't look in
7770 # 5.7.0 if we're installing 5.6.1.
7774 if (@inc_version_list) {
7775 print join(' ', @inc_version_list);
7778 # Blank space to preserve value for next Configure run.
7783 case "$inc_version_list" in
7784 '') if test -x "$perl5$exe_ext"; then
7785 dflt=`$perl5 getverlist`
7790 $undef) dflt='none' ;;
7791 *) eval dflt=\"$inc_version_list\" ;;
7794 ''|' ') dflt=none ;;
7801 In order to ease the process of upgrading, this version of perl
7802 can be configured to use modules built and installed with earlier
7803 versions of perl that were installed under $prefix. Specify here
7804 the list of earlier versions that this version of perl should check.
7805 If Configure detected no earlier versions of perl installed under
7806 $prefix, then the list will be empty. Answer 'none' to tell perl
7807 to not search earlier versions.
7809 The default should almost always be sensible, so if you're not sure,
7810 just accept the default.
7813 rp='List of earlier versions to include in @INC?'
7816 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7817 *) inc_version_list="$ans" ;;
7819 case "$inc_version_list" in
7821 inc_version_list_init='0'
7822 d_inc_version_list="$undef"
7824 *) inc_version_list_init=`echo $inc_version_list |
7825 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7826 d_inc_version_list="$define"
7831 : see if malloc/malloc.h has to be included
7832 set malloc/malloc.h i_mallocmalloc
7835 : see if this is a malloc.h system
7836 : we want a real compile instead of Inhdr because some systems have a
7837 : malloc.h that just gives a compile error saying to use stdlib.h instead
7842 #$i_mallocmalloc I_MALLOCMALLOC
7843 #ifdef I_MALLOCMALLOC
7844 # include <malloc/malloc.h>
7847 int main () { return 0; }
7850 if eval $compile; then
7851 echo "<malloc.h> found." >&4
7854 echo "<malloc.h> NOT found." >&4
7861 : check for length of pointer
7865 echo "Checking to see how big your pointers are..." >&4
7874 printf("%d\n", (int)sizeof(void *));
7879 if eval $compile_ok; then
7880 ptrsize=`$run ./try`
7881 echo "Your pointers are $ptrsize bytes long."
7884 echo "(I can't seem to compile the test program. Guessing...)" >&4
7885 rp="What is the size of a pointer (in bytes)?"
7892 case "$use64bitall" in
7893 "$define"|true|[yY]*)
7897 *** You have chosen a maximally 64-bit build,
7898 *** but your pointers are only 4 bytes wide.
7899 *** Please rerun Configure without -Duse64bitall.
7904 *** Since you have quads, you could possibly try with -Duse64bitint.
7909 *** Cannot continue, aborting.
7920 : determine whether to use malloc wrapping
7922 case "$usemallocwrap" in
7923 [yY]*|true|$define) dflt='y' ;;
7924 [nN]*|false|$undef) dflt='n' ;;
7925 *) case "$usedevel" in
7926 [yY]*|true|$define) dflt='y' ;;
7931 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7933 usemallocwrap="$ans"
7936 usemallocwrap="$define" ;;
7938 usemallocwrap="$undef" ;;
7941 : determine which malloc to compile in
7943 case "$usemymalloc" in
7944 [yY]*|true|$define) dflt='y' ;;
7945 [nN]*|false|$undef) dflt='n' ;;
7946 *) case "$ptrsize" in
7950 if test "$useithreads" = "$define"; then dflt='n'; fi
7953 rp="Do you wish to attempt to use the malloc that comes with $package?"
7959 mallocsrc='malloc.c'
7960 mallocobj="malloc$_o"
7961 d_mymalloc="$define"
7964 : Remove malloc from list of libraries to use
7965 echo "Removing unneeded -lmalloc from library list" >&4
7966 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7969 echo "libs = $libs" >&4
7981 : compute the return types of malloc and free
7983 $cat >malloc.c <<END
7987 #include <sys/types.h>
8001 case "$malloctype" in
8003 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
8010 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
8014 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
8021 echo "Your system uses $freetype free(), it would seem." >&4
8023 : determine where site specific architecture-dependent libraries go.
8024 : sitelib default is /usr/local/lib/perl5/site_perl/$version
8025 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
8026 : sitelib may have an optional trailing /share.
8028 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
8029 dflt="$dflt/$archname"
8034 set sitearch sitearch none
8038 The installation process will also create a directory for
8039 architecture-dependent site-specific extensions and modules.
8043 rp='Pathname for the site-specific architecture-dependent library files?'
8047 if $test X"$sitearch" = X"$sitelib"; then
8050 d_sitearch="$define"
8053 : Set the vendorprefix variables
8056 The installation process will also create a directory for
8057 vendor-supplied add-ons. Vendors who supply perl with their system
8058 may find it convenient to place all vendor-supplied files in this
8059 directory rather than in the main distribution directory. This will
8060 ease upgrades between binary-compatible maintenance versions of perl.
8062 Of course you may also use these directories in whatever way you see
8063 fit. For example, you might use them to access modules shared over a
8064 company-wide network.
8066 The default answer should be fine for most people.
8067 This causes further questions about vendor add-ons to be skipped
8068 and no vendor-specific directories will be configured for perl.
8071 rp='Do you want to configure vendor-specific add-on directories?'
8072 case "$usevendorprefix" in
8073 define|true|[yY]*) dflt=y ;;
8074 *) : User may have set vendorprefix directly on Configure command line.
8075 case "$vendorprefix" in
8084 rp='Installation prefix to use for vendor-supplied add-ons?'
8085 case "$vendorprefix" in
8086 '') dflt="$prefix" ;;
8087 *) dflt=$vendorprefix ;;
8090 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
8092 case "$vendorprefix" in
8096 *) oldvendorprefix="$prefix";;
8100 usevendorprefix="$define"
8102 vendorprefixexp="$ansexp"
8104 *) usevendorprefix="$undef"
8110 : Set the vendorlib variables
8111 case "$vendorprefix" in
8112 '') d_vendorlib="$undef"
8116 *) d_vendorlib="$define"
8117 : determine where vendor-supplied modules go.
8118 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8119 case "$vendorlib" in
8121 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8122 case "$installstyle" in
8123 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8124 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8127 *) dflt="$vendorlib"
8131 rp='Pathname for the vendor-supplied library files?'
8134 vendorlibexp="$ansexp"
8137 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8141 : Set the vendorarch variables
8142 case "$vendorprefix" in
8143 '') d_vendorarch="$undef"
8147 *) d_vendorarch="$define"
8148 : determine where vendor-supplied architecture-dependent libraries go.
8149 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8150 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8151 : vendorlib may have an optional trailing /share.
8152 case "$vendorarch" in
8153 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8154 dflt="$dflt/$archname"
8156 *) dflt="$vendorarch" ;;
8159 rp='Pathname for vendor-supplied architecture-dependent files?'
8162 vendorarchexp="$ansexp"
8165 prefixvar=vendorarch
8167 if $test X"$vendorarch" = X"$vendorlib"; then
8168 d_vendorarch="$undef"
8170 d_vendorarch="$define"
8173 : Final catch-all directories to search
8176 Lastly, you can have perl look in other directories for extensions and
8177 modules in addition to those already specified.
8178 These directories will be searched after
8182 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8183 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8185 case "$otherlibdirs" in
8186 ''|' ') dflt='none' ;;
8187 *) dflt="$otherlibdirs" ;;
8190 Enter a colon-separated set of extra paths to include in perl's @INC
8191 search path, or enter 'none' for no extra paths.
8195 rp='Colon-separated list of additional directories for perl to search?'
8198 ' '|''|none) otherlibdirs=' ' ;;
8199 *) otherlibdirs="$ans" ;;
8201 case "$otherlibdirs" in
8205 set d_perl_otherlibdirs
8208 : Cruising for prototypes
8210 echo "Checking out function prototypes..." >&4
8211 $cat >prototype.c <<EOCP
8216 int main(int argc, char *argv[]) {
8219 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8220 echo "Your C compiler appears to support function prototypes."
8223 echo "Your C compiler doesn't seem to understand function prototypes."
8230 : Check if ansi2knr is required
8231 case "$prototype" in
8233 *) ansi2knr='ansi2knr'
8238 This version of $package can only be compiled by a compiler that
8239 understands function prototypes. Unfortunately, your C compiler
8241 doesn't seem to understand them. Sorry about that.
8243 If GNU cc is available for your system, perhaps you could try that instead.
8245 Eventually, we hope to support building Perl with pre-ANSI compilers.
8246 If you would like to help in that effort, please contact <perlbug@perl.org>.
8248 Aborting Configure now.
8255 dflt_dtrace='/usr/sbin/dtrace'
8256 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8260 Perl can be built to support DTrace on platforms that support it.
8261 DTrace is a diagnosis and performance analysis tool from Sun.
8263 If this doesn't make any sense to you, just accept the default '$dflt'.
8267 case "$usedtrace" in
8273 dflt_dtrace=$usedtrace
8280 rp='Support DTrace if available?'
8283 y|Y) val="$define" ;;
8289 test "X$usedtrace" != "X$define" && break
8292 rp='Where is the dtrace executable?'
8301 if $dtrace -h -s ../perldtrace.d \
8302 -o perldtrace.tmp >/dev/null 2>&1 \
8303 && rm -f perldtrace.tmp
8306 echo "Good: your $dtrace knows about the -h flag."
8310 *** $me: Fatal Error: $dtrace doesn't support -h flag
8312 *** Your installed dtrace doesn't support the -h switch to compile a D
8313 *** program into a C header. Can't continue.
8325 *** $me: Fatal Error: $dtrace not found.
8332 echo "*** $dtrace was not found."
8338 : See if we want extra modules installed
8345 Perl can be built with extra modules or bundles of modules which
8346 will be fetched from the CPAN and installed alongside Perl.
8348 Notice that you will need access to the CPAN; either via the Internet,
8349 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8350 be asked later to configure the CPAN.pm module which will in turn do
8351 the installation of the rest of the extra modules or bundles.)
8353 Notice also that if the modules require any external software such as
8354 libraries and headers (the libz library and the zlib.h header for the
8355 Compress::Zlib module, for example) you MUST have any such software
8356 already installed, this configuration process will NOT install such
8359 If this doesn't make any sense to you, just accept the default '$dflt'.
8361 rp='Install any extra modules (y or n)?'
8367 Please list any extra modules or bundles to be installed from CPAN,
8368 with spaces between the names. The names can be in any format the
8369 'install' command of CPAN.pm will understand. (Answer 'none',
8370 without the quotes, to install no extra modules or bundles.)
8380 $rm -f ../extras.lst
8382 *) echo "(Saving the list of extras for later...)"
8383 echo "$extras" > ../extras.lst
8391 : determine where html pages for programs go
8392 set html1dir html1dir none
8396 If you wish to install html files for programs in $spackage, indicate
8397 the appropriate directory here. To skip installing html files,
8401 ''|none|$undef|' ') dflt=none ;;
8402 *) dflt=$html1dir ;;
8405 rp="Directory for the main $spackage html pages?"
8409 : Use ' ' for none so value is preserved next time through Configure
8410 $test X"$html1dir" = "X" && html1dir=' '
8412 : determine where html pages for libraries and modules go
8413 set html3dir html3dir none
8417 If you wish to install html files for modules associated with $spackage,
8418 indicate the appropriate directory here. To skip installing html files,
8421 : There is no obvious default. If they have specified html1dir, then
8422 : try to key off that, possibly changing .../html1 into .../html3.
8424 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8425 *) dflt=$html3dir ;;
8428 rp="Directory for the $spackage module html pages?"
8432 : Use ' ' for none so value is preserved next time through Configure
8433 $test X"$html3dir" = "X" && html3dir=' '
8435 : determine whether to install perl also as /usr/bin/perl
8438 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8440 Many scripts expect perl to be installed as /usr/bin/perl.
8442 If you want to, I can install the perl you are about to compile
8443 as /usr/bin/perl (in addition to $bin/perl).
8445 if test -f /usr/bin/perl; then
8448 However, please note that because you already have a /usr/bin/perl,
8449 overwriting that with a new Perl would very probably cause problems.
8450 Therefore I'm assuming you don't want to do that (unless you insist).
8453 case "$installusrbinperl" in
8454 "$define"|[yY]*) dflt='y';;
8460 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8463 case "$installusrbinperl" in
8464 "$undef"|[nN]*) dflt='n';;
8468 rp="Do you want to install perl as /usr/bin/perl?"
8471 [yY]*) val="$define";;
8477 set installusrbinperl
8480 : see if dlopen exists
8482 xxx_ccflags="$ccflags"
8484 : with g++ one needs -shared to get is-in-libc to work for dlopen
8485 case "$gccversion" in
8487 *) case "$d_cplusplus" in
8488 "$define") ccflags="$ccflags -shared" ;;
8495 ccflags="$xxx_ccflags"
8497 : see if this is a unistd.h system
8498 set unistd.h i_unistd
8501 : determine which dynamic loading, if any, to compile in
8503 dldir="ext/DynaLoader"
8516 $define) dflt='y' ;;
8518 : Does a dl_xxx.xs file exist for this operating system
8519 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8522 rp="Do you wish to use dynamic loading?"
8529 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8530 dflt="$dldir/dl_${osname}.xs"
8531 elif $test "$d_dlopen" = "$define" ; then
8532 dflt="$dldir/dl_dlopen.xs"
8537 *) dflt="$dldir/$dlsrc"
8540 echo "The following dynamic loading files are available:"
8541 : Can not go over to $dldir because getfile has path hard-coded in.
8542 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8543 rp="Source file to use for dynamic loading"
8549 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8553 Some systems may require passing special flags to $cc -c to
8554 compile modules that will be used to create a shared library.
8555 To use no flags, say "none".
8558 case "$cccdlflags" in
8559 '') case "$gccversion" in
8560 '') case "$osname" in
8562 irix*) dflt='-KPIC' ;;
8563 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8564 sunos) dflt='-pic' ;;
8568 *) case "$osname" in
8569 darwin) dflt='none' ;;
8570 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8575 *) dflt="$cccdlflags" ;;
8582 # If -Dsysroot was specified, now's the time to add it
8584 if test "X$sysroot" != X; then
8585 case "$gccversion" in
8590 dflt="$dflt --sysroot=$sysroot" ;;
8600 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8603 none) cccdlflags=' ' ;;
8604 *) cccdlflags="$ans" ;;
8609 Some systems use ld to create libraries that can be dynamically loaded,
8610 while other systems (such as those using ELF) use $cc.
8614 : Determine if this is ELF
8616 /* Test for whether ELF binaries are produced */
8628 int i = open("a.out",O_RDONLY);
8631 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8632 exit(0); /* succeed (yes, it is ELF) */
8636 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8642 '') if $test $bin_ELF = "$define"; then
8644 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8648 echo "I'll use ld to build dynamic libraries."
8656 rp="What command should be used to create dynamic libraries?"
8662 Some systems may require passing special flags to $ld to create a
8663 library that can be dynamically loaded. If your ld flags include
8664 -L/other/path options to locate libraries outside your loader's normal
8665 search path, you may need to specify those -L options here as well. To
8666 use no flags, say "none".
8669 case "$lddlflags" in
8670 '') case "$osname" in
8671 haiku) dflt='-shared' ;;
8673 case "$gccversion" in
8674 '') dflt="$dflt +vnocompatwarnings" ;;
8677 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8678 solaris) # See [perl #66604].
8679 # On Solaris 11, gcc -m64 on amd64
8680 # appears not to understand -G. gcc versions at
8681 # least as old as 3.4.3 support -shared, so just
8682 # use that with Solaris 11 and later, but keep
8683 # the old behavior for older Solaris versions.
8684 case "$gccversion" in
8686 *) case "$osvers" in
8687 2.?|2.10) dflt='-G' ;;
8688 *) dflt='-shared' ;;
8693 sunos) dflt='-assert nodefinitions' ;;
8694 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8698 *) dflt="$lddlflags" ;;
8701 : Only do this for gcc, since, for example, qcc has no concept
8703 if $test "X$sysroot" != X; then
8704 case "$gccversion" in
8706 *) dflt="$dflt --sysroot $sysroot" ;;
8710 : Try to guess additional flags to pick up local libraries.
8711 : Be careful not to append to a plain 'none'
8715 for thisflag in $ldflags; do
8720 *) dflt="$dflt $thisflag" ;;
8727 ''|' ') dflt='none' ;;
8731 *-fstack-protector-strong*)
8733 *-fstack-protector-strong*) ;; # Don't add it again
8734 *) dflt="$dflt -fstack-protector-strong" ;;
8737 *-fstack-protector*)
8739 *-fstack-protector*) ;; # Don't add it again
8740 *) dflt="$dflt -fstack-protector" ;;
8745 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8748 none) lddlflags=' ' ;;
8749 *) lddlflags="$ans" ;;
8754 Some systems may require passing special flags to $cc to indicate that
8755 the resulting executable will use dynamic linking. To use no flags,
8759 case "$ccdlflags" in
8760 '') case "$osname" in
8761 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8762 sunos) dflt='none' ;;
8766 *) dflt="$ccdlflags" ;;
8768 rp="Any special flags to pass to $cc to use dynamic linking?"
8771 none) ccdlflags=' ' ;;
8772 *) ccdlflags="$ans" ;;
8784 ld_can_script="$undef"
8785 case "$bin_ELF$usedl" in
8787 # Abuse try.h and a.out names for neat cleanup
8799 if $cc $cccdlflags $ccdlflags $ccflags \
8800 $ldflags $lddlflags -o a.out try.c \
8801 -Wl,--version-script=try.h >/dev/null 2>&1 \
8802 && $test -s a.out ; then
8803 echo "ld supports scripting" >&4
8804 ld_can_script="$define"
8806 echo "ld does not support scripting" >&4
8812 : Do we want a shared libperl?
8816 # No dynamic loading being used, so don't bother even to prompt.
8819 *) case "$useshrplib" in
8820 '') case "$osname" in
8821 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8823 also='Building a shared libperl is required for dynamic loading to work on your system.'
8837 The perl executable is normally obtained by linking perlmain.c with
8838 libperl${_a}, any static extensions (usually just DynaLoader), and
8839 any other libraries needed on this system (such as -lm, etc.). Since
8840 your system supports dynamic loading, it is probably possible to build
8841 a shared libperl.$so. If you will have more than one executable linked
8842 to libperl.$so, this will significantly reduce the size of each
8843 executable, but it may have a noticeable effect on performance. The
8844 default is probably sensible for your system.
8848 rp="Build a shared libperl.$so (y/n)"
8852 useshrplib='true' ;;
8853 *) useshrplib='false' ;;
8858 case "$useshrplib" in
8860 case "$userelocatableinc" in
8862 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8863 echo "See INSTALL for an explanation why that won't work." >&4
8869 # Figure out a good name for libperl.so. Since it gets stored in
8870 # a version-specific architecture-dependent library, the version
8871 # number isn't really that important, except for making cc/ld happy.
8873 # A name such as libperl.so.10.1
8874 majmin="libperl.$so.$patchlevel.$subversion"
8875 # A name such as libperl.so.100
8876 majonly=`echo $patchlevel $subversion |
8877 $awk '{printf "%d%02d", $1, $2}'`
8878 majonly=libperl.$so.$majonly
8879 # I'd prefer to keep the os-specific stuff here to a minimum, and
8880 # rely on figuring it out from the naming of libc.
8881 case "${osname}${osvers}" in
8882 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8885 cygwin*) # ld links now against the dll directly
8886 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8887 majonly=`echo $patchlevel $subversion |
8888 $awk '{printf "%03d%03d", $1, $2}'`
8889 majonly=cygperl5.$majonly.$so
8892 *) # Try to guess based on whether libc has major.minor.
8894 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8895 *libc.$so.[0-9]*) dflt=$majonly ;;
8896 *) dflt=libperl.$so ;;
8906 I need to select a good name for the shared libperl. If your system uses
8907 library names with major and minor numbers, then you might want something
8908 like $majmin. Alternatively, if your system uses a single version
8909 number for shared libraries, then you might want to use $majonly.
8910 Or, your system might be quite happy with a simple libperl.$so.
8912 Since the shared libperl will get installed into a version-specific
8913 architecture-dependent directory, the version number of the shared perl
8914 library probably isn't important, so the default should be o.k.
8917 rp='What name do you want to give to the shared libperl?'
8920 echo "Ok, I'll use $libperl"
8923 libperl="libperl${_a}"
8927 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8931 WARNING: Use of the shrpdir variable for the installation location of
8932 the shared $libperl is not supported. It was never documented and
8933 will not work in this version. Let me (perlbug@perl.org)
8934 know of any problems this may cause.
8940 But your current setting of $shrpdir is
8941 the default anyway, so it's harmless.
8946 Further, your current attempted setting of $shrpdir
8947 conflicts with the value of $archlibexp/CORE
8948 that installperl will use.
8955 # How will the perl executable find the installed shared $libperl?
8956 # Add $xxx to ccdlflags.
8957 # If we can't figure out a command-line option, use $shrpenv to
8958 # set env LD_RUN_PATH. The main perl makefile uses this.
8959 shrpdir=$archlibexp/CORE
8962 if "$useshrplib"; then
8965 # We'll set it in Makefile.SH...
8970 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8971 xxx="-Wl,-R$shrpdir"
8973 bsdos|linux|irix*|dec_osf|gnu*)
8974 xxx="-Wl,-rpath,$shrpdir"
8977 # Haiku doesn't like the default, either.
8980 # hpux doesn't like the default, either.
8981 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8984 # cygwin needs only ldlibpth
8987 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8993 # Only add $xxx if it isn't already in ccdlflags.
8994 case " $ccdlflags " in
8996 *) ccdlflags="$ccdlflags $xxx"
8999 Adding $xxx to the flags
9000 passed to $ld so that the perl executable will find the
9001 installed shared $libperl.
9009 # Fix ccdlflags in AIX for building external extensions.
9010 # (For building Perl itself bare -bE:perl.exp is needed,
9011 # Makefile.SH takes care of this.)
9013 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
9015 # Respect a hint or command-line value.
9017 '') shrpenv="$tmp_shrpenv" ;;
9019 case "$ldlibpthname" in
9020 '') ldlibpthname=LD_LIBRARY_PATH ;;
9021 none) ldlibpthname='' ;;
9024 : determine where manual pages are on this system
9028 syspath='/usr/share/man/man1 /usr/man/man1'
9029 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
9030 syspath="$syspath /usr/man/u_man/man1"
9031 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
9032 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
9033 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
9034 sysman=`./loc . /usr/man/man1 $syspath`
9037 if $test -d "$sysman"; then
9038 echo "System manual is in $sysman." >&4
9040 echo "Could not find manual pages in source form." >&4
9043 : determine where manual pages go
9044 set man1dir man1dir none
9048 $spackage has manual pages available in source form.
9052 echo "However, you don't have nroff, so they're probably useless to you."
9054 '') man1dir="none";;
9057 echo "If you don't want the manual sources installed, answer 'none'."
9062 lookpath="$prefixexp/share/man/man1"
9063 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
9064 lookpath="$lookpath $prefixexp/man/p_man/man1"
9065 lookpath="$lookpath $prefixexp/man/u_man/man1"
9066 lookpath="$lookpath $prefixexp/man/man.1"
9068 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
9069 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
9079 rp="Where do the main $spackage manual pages (source) go?"
9081 if $test "X$man1direxp" != "X$ansexp"; then
9092 : What suffix to use on installed man pages
9099 rp="What suffix should be used for the main $spackage man pages?"
9101 '') case "$man1dir" in
9115 *) dflt="$man1ext";;
9122 : see if we can have long filenames
9124 first=123456789abcdef
9126 if (echo hi >$first) 2>/dev/null; then
9127 if $test -f 123456789abcde; then
9128 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
9131 echo 'You can have filenames longer than 14 characters.'>&4
9136 You can't have filenames longer than 14 chars.
9137 You can't even think about them!
9143 $rm -rf 123456789abcde*
9145 : determine where library module manual pages go
9146 set man3dir man3dir none
9150 $spackage has manual pages for many of the library modules.
9156 However, you don't have nroff, so they're probably useless to you.
9159 '') man3dir="none";;
9163 case "$d_flexfnam" in
9166 However, your system can't handle the long file names like File::Basename.3.
9169 '') man3dir="none";;
9173 echo "If you don't want the manual sources installed, answer 'none'."
9174 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9176 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9177 if $test -d "$privlib/man/man3"; then
9180 WARNING: Previous versions of perl installed man3 pages into
9181 $privlib/man/man3. This version will suggest a
9182 new default of $dflt.
9186 rp='Do you wish to preserve the old behavior?(y/n)'
9189 y*) dflt="$privlib/man/man3" ;;
9194 *) dflt="$man3dir" ;;
9201 rp="Where do the $package library man pages (source) go?"
9211 : What suffix to use on installed man pages
9217 rp="What suffix should be used for the $package library man pages?"
9219 '') case "$man3dir" in
9233 *) dflt="$man3ext";;
9240 : see if we have to deal with yellow pages, now NIS.
9241 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9247 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9255 rp='Are you getting the hosts file via yellow pages?'
9258 y*) hostcat='ypcat hosts';;
9259 *) hostcat='cat /etc/hosts';;
9265 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9268 '') test -f /etc/group && groupcat='cat /etc/group';;
9271 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9274 : now get the host name
9276 echo "Figuring out host name..." >&4
9277 case "$myhostname" in
9279 echo 'Maybe "hostname" will work...'
9280 if tans=`sh -c hostname 2>&1` ; then
9288 if $test "$cont"; then
9290 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9291 if tans=`cat /etc/systemid 2>&1` ; then
9293 phostname='cat /etc/systemid'
9294 echo "Whadyaknow. Xenix always was a bit strange..."
9297 elif $test -r /etc/systemid; then
9298 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9301 if $test "$cont"; then
9302 echo 'No, maybe "uuname -l" will work...'
9303 if tans=`sh -c 'uuname -l' 2>&1` ; then
9305 phostname='uuname -l'
9307 echo 'Strange. Maybe "uname -n" will work...'
9308 if tans=`sh -c 'uname -n' 2>&1` ; then
9310 phostname='uname -n'
9312 echo 'Oh well, maybe I can mine it out of whoami.h...'
9313 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9314 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9315 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9317 case "$myhostname" in
9318 '') echo "Does this machine have an identity crisis or something?"
9321 echo "Well, you said $myhostname before..."
9322 phostname='echo $myhostname';;
9328 case "$myhostname" in
9329 '') myhostname=noname ;;
9331 : you do not want to know about this
9336 if $test "$myhostname" ; then
9338 rp='Your host name appears to be "'$myhostname'".'" Right?"
9346 : bad guess or no guess
9347 while $test "X$myhostname" = X ; do
9349 rp="Please type the (one word) name of your host:"
9354 : translate upper to lower if necessary
9355 case "$myhostname" in
9357 echo "(Normalizing case in your host name)"
9358 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9362 case "$myhostname" in
9364 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9365 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9366 echo "(Trimming domain name from host name--host name is now $myhostname)"
9368 *) case "$mydomain" in
9371 test "X$hostcat" = "Xypcat hosts" &&
9372 ypmatch "$myhostname" hosts 2>/dev/null |\
9373 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9376 test "X$hostcat" != "X" &&
9377 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9378 /[ ]$myhostname[ . ]/p" > hosts
9381 if $test -f hosts; then
9382 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9383 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9384 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9385 hosts | $sort | $uniq | \
9386 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9387 case `$echo X$dflt` in
9388 X*\ *) echo "(Several hosts in the database matched hostname)"
9391 X.) echo "(You do not have fully-qualified names in the hosts database)"
9395 echo "(I cannot locate a hosts database anywhere)"
9400 tans=`./loc resolv.conf X /etc /usr/etc`
9401 if $test -f "$tans"; then
9402 echo "(Attempting domain name extraction from $tans)"
9403 dflt=.`$sed -n -e 's/ / /g' \
9404 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9407 .) dflt=.`$sed -n -e 's/ / /g' \
9408 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9416 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9417 dflt=.`sh -c domainname 2>/dev/null`
9420 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9424 case "$dflt$osname" in
9425 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9426 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9430 .) echo "(Lost all hope -- silly guess then)"
9436 *) dflt="$mydomain";;
9440 rp="What is your domain name?"
9450 : translate upper to lower if necessary
9453 echo "(Normalizing case in your domain name)"
9454 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9458 : a little sanity check here
9459 case "$phostname" in
9462 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9463 $myhostname$mydomain|$myhostname) ;;
9465 case "$phostname" in
9467 echo "(That doesn't agree with your whoami.h file, by the way.)"
9470 echo "(That doesn't agree with your $phostname command, by the way.)"
9478 : determine the e-mail address of the user who is running us
9481 I need to get your e-mail address in Internet format if possible, i.e.
9482 something like user@host.domain. Please answer accurately since I have
9483 no easy means to double check it. The default value provided below
9484 is most probably close to reality but may not be valid from outside
9485 your organization...
9489 while test "$cont"; do
9490 case "$MAILDOMAIN" in
9492 if $test -s /etc/mailname; then
9493 maildomain=`$cat /etc/mailname`
9495 maildomain="$myhostname$mydomain"
9498 *) maildomain="$MAILDOMAIN";;
9501 '') dflt="$cf_by@$maildomain";;
9502 *) dflt="$cf_email";;
9504 rp='What is your e-mail address?'
9510 rp='Address does not look like an Internet one. Use it anyway?'
9524 : Ask e-mail of administrator
9527 If you or somebody else will be maintaining perl at your site, please
9528 fill in the correct e-mail address here so that they may be contacted
9529 if necessary. Currently, the "perlbug" program included with perl
9530 will send mail to this address in addition to perlbug@perl.org. You may
9531 enter "none" for no administrator.
9534 case "$perladmin" in
9535 '') dflt="$cf_email";;
9536 *) dflt="$perladmin";;
9538 rp='Perl administrator e-mail address'
9542 : determine whether to only install version-specific parts.
9545 Do you want to install only the version-specific parts of the perl
9546 distribution? Usually you do *not* want to do this.
9548 case "$versiononly" in
9549 "$define"|[Yy]*|true) dflt='y' ;;
9552 rp="Do you want to install only the version-specific parts of perl?"
9555 [yY]*) val="$define";;
9561 case "$versiononly" in
9562 "$define") inc_version_list=''
9563 inc_version_list_init=0
9567 : figure out how to guarantee perl startup
9568 : XXX Note that this currently takes advantage of the bug that binexp ignores
9569 : the Configure -Dinstallprefix setting, which in turn means that under
9570 : relocatable @INC, initialinstalllocation is what binexp started as.
9571 case "$startperl" in
9573 case "$sharpbang" in
9577 I can use the #! construct to start perl on your system. This will
9578 make startup of perl scripts faster, but may cause problems if you
9579 want to share those scripts and perl is not in a standard place
9580 ($initialinstalllocation/perl) on all your platforms. The alternative
9581 is to force a shell by starting the script with a single ':' character.
9584 case "$versiononly" in
9585 "$define") dflt="$initialinstalllocation/perl$version";;
9586 *) dflt="$initialinstalllocation/perl";;
9588 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9591 none) startperl=": # use perl";;
9592 *) startperl="#!$ans"
9593 if $test 30 -lt `echo "$ans" | wc -c`; then
9596 WARNING: Some systems limit the #! command to 32 characters.
9597 If you experience difficulty running Perl scripts with #!, try
9598 installing Perl in a directory with a shorter pathname.
9604 *) startperl=": # use perl"
9609 echo "I'll use $startperl to start perl scripts."
9611 : figure best path for perl in scripts
9614 case "$versiononly" in
9615 "$define") perlpath="$initialinstalllocation/perl$version";;
9616 *) perlpath="$initialinstalllocation/perl";;
9618 case "$startperl" in
9623 I will use the "eval 'exec'" idiom to start Perl on your system.
9624 I can use the full path of your Perl binary for this purpose, but
9625 doing so may cause problems if you want to share those scripts and
9626 Perl is not always in a standard place ($initialinstalllocation/perl).
9629 dflt="$initialinstalllocation/perl"
9630 rp="What path shall I use in \"eval 'exec'\"?"
9637 case "$startperl" in
9639 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9642 : determine where public executable scripts go
9643 set scriptdir scriptdir
9645 case "$scriptdir" in
9648 : guess some guesses
9649 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9650 $test -d /usr/share/bin && dflt=/usr/share/bin
9651 $test -d /usr/local/script && dflt=/usr/local/script
9652 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9653 $test -d $prefixexp/script && dflt=$prefixexp/script
9657 *) dflt="$scriptdir"
9662 Some installations have a separate directory just for executable scripts so
9663 that they can mount it across multiple architectures but keep the scripts in
9664 one spot. You might, for example, have a subdirectory of /usr/share for this.
9665 Or you might just lump your scripts in with all your other executables.
9669 rp='Where do you keep publicly executable scripts?'
9671 if $test "X$ansexp" != "X$scriptdirexp"; then
9677 : A little fix up for an irregularly named variable.
9678 installscript="$installscriptdir"
9680 : determine where add-on public executables go
9682 '') dflt=$siteprefix/bin ;;
9686 rp='Pathname where the add-on public executables should be installed?'
9691 : determine where add-on html pages go
9692 : There is no standard location, so try to copy the previously-selected
9693 : directory structure for the core html pages.
9694 case "$sitehtml1dir" in
9695 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9696 *) dflt=$sitehtml1dir ;;
9699 ''|' ') dflt=none ;;
9702 rp='Pathname where the site-specific html pages should be installed?'
9704 prefixvar=sitehtml1dir
9707 : determine where add-on library html pages go
9708 : There is no standard location, so try to copy the previously-selected
9709 : directory structure for the core html pages.
9710 case "$sitehtml3dir" in
9711 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9712 *) dflt=$sitehtml3dir ;;
9715 ''|' ') dflt=none ;;
9718 rp='Pathname where the site-specific library html pages should be installed?'
9720 prefixvar=sitehtml3dir
9723 : determine where add-on manual pages go
9724 case "$siteman1dir" in
9725 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9726 *) dflt=$siteman1dir ;;
9729 ''|' ') dflt=none ;;
9732 rp='Pathname where the site-specific manual pages should be installed?'
9734 prefixvar=siteman1dir
9737 : determine where add-on library man pages go
9738 case "$siteman3dir" in
9739 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9740 *) dflt=$siteman3dir ;;
9743 ''|' ') dflt=none ;;
9746 rp='Pathname where the site-specific library manual pages should be installed?'
9748 prefixvar=siteman3dir
9751 : determine where add-on public executable scripts go
9752 case "$sitescript" in
9753 '') dflt=$siteprefix/script
9754 $test -d $dflt || dflt=$sitebin ;;
9755 *) dflt="$sitescript" ;;
9758 rp='Pathname where add-on public executable scripts should be installed?'
9760 prefixvar=sitescript
9763 : see if backtrace exists
9764 set backtrace d_backtrace
9767 : add flags if using c backtrace
9768 case "$usecbacktrace" in
9769 "") usecbacktrace=$undef ;;
9771 case "$d_backtrace" in
9773 case " $ccflags " in
9774 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9775 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9779 echo "This system does not support backtrace" >&4
9780 usecbacktrace=$undef
9786 : Check if faststdio is requested and available
9787 case "$usefaststdio" in
9788 $define|true|[yY]*|'')
9789 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9799 Perl can be built to use 'fast stdio', which means using the stdio
9800 library but also directly manipulating the stdio buffers to enable
9801 faster I/O. Using stdio is better for backward compatibility (especially
9802 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9803 interface has been preferred instead of stdio.
9805 If this doesn't make any sense to you, just accept the default '$dflt'.
9807 rp='Use the "fast stdio" if available?'
9810 y|Y) val="$define" ;;
9817 : define an is-a-typedef? function
9818 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9820 "") inclist="sys/types.h";;
9822 eval "varval=\$$var";
9826 for inc in $inclist; do
9827 echo "#include <$inc>" >>temp.c;
9829 echo "#ifdef $type" >> temp.c;
9830 echo "printf(\"We have $type\");" >> temp.c;
9831 echo "#endif" >> temp.c;
9832 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9833 if $contains $type temp.E >/dev/null 2>&1; then
9839 *) eval "$var=\$varval";;
9842 : define an is-a-typedef? function that prompts if the type is not available.
9843 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9845 "") inclist="sys/types.h";;
9847 eval "varval=\$$var";
9851 for inc in $inclist; do
9852 echo "#include <$inc>" >>temp.c;
9854 echo "#ifdef $type" >> temp.c;
9855 echo "printf(\"We have $type\");" >> temp.c;
9856 echo "#endif" >> temp.c;
9857 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9859 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9860 if $contains $type temp.E >/dev/null 2>&1; then
9861 echo "$type found." >&4;
9864 echo "$type NOT found." >&4;
9870 *) eval "$var=\$varval";;
9873 : see what type lseek is declared as in the kernel
9874 rp="What is the type used for lseek's offset on this system?"
9875 set off_t lseektype long stdio.h sys/types.h
9879 echo "Checking to see how big your file offsets are..." >&4
9881 #include <sys/types.h>
9885 printf("%d\n", (int)sizeof($lseektype));
9890 if eval $compile_ok; then
9891 lseeksize=`$run ./try`
9892 echo "Your file offsets are $lseeksize bytes long."
9896 echo "(I can't seem to compile the test program. Guessing...)"
9897 rp="What is the size of your file offsets (in bytes)?"
9903 : see what type file positions are declared as in the library
9904 rp="What is the type for file position used by fsetpos()?"
9905 set fpos_t fpostype long stdio.h sys/types.h
9908 : Check size for Fpos_t
9911 *_t) zzz="$fpostype" ;;
9914 echo "Checking the size of $zzz..." >&4
9916 #include <sys/types.h>
9923 printf("%d\n", (int)sizeof($fpostype));
9928 if eval $compile_ok; then
9932 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9935 echo "Your $zzz is $fpossize bytes long."
9941 echo "(I can't compile the test program. Guessing...)" >&4
9942 rp="What is the size of your file positions (in bytes)?"
9947 : Check for large file support
9948 # Backward compatibility (uselfs is deprecated).
9950 "$define"|true|[yY]*)
9953 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9955 uselargefiles="$define"
9959 case "$lseeksize:$fpossize" in
9962 You can have files larger than 2 gigabytes.
9965 *) case "$uselargefiles" in
9966 "$undef"|false|[nN]*) dflt='n' ;;
9971 Perl can be built to understand large files (files larger than 2 gigabytes)
9972 on some systems. To do so, Configure can be run with -Duselargefiles.
9974 If this doesn't make any sense to you, just accept the default '$dflt'.
9976 rp='Try to understand large files, if available?'
9979 y|Y) val="$define" ;;
9986 : Look for a hint-file generated 'call-back-unit'. If the
9987 : user has specified that a large files perl is to be built,
9988 : we may need to set or change some other defaults.
9989 if $test -f uselargefiles.cbu; then
9990 echo "Your platform has some specific hints regarding large file builds, using them..."
9991 . ./uselargefiles.cbu
9993 case "$uselargefiles" in
9995 if $test -f uselargefiles.cbu; then
9997 echo "Rechecking to see how big your file offsets are..." >&4
9999 #include <sys/types.h>
10003 printf("%d\n", (int)sizeof($lseektype));
10008 if eval $compile_ok; then
10009 lseeksize=`$run ./try`
10010 $echo "Your file offsets are now $lseeksize bytes long."
10014 echo "(I can't seem to compile the test program. Guessing...)"
10015 rp="What is the size of your file offsets (in bytes)?"
10019 case "$fpostype" in
10020 *_t) zzz="$fpostype" ;;
10023 $echo $n "Rechecking the size of $zzz...$c" >&4
10024 $cat > try.c <<EOCP
10025 #include <sys/types.h>
10027 #$i_stdlib I_STDLIB
10029 #include <stdlib.h>
10032 printf("%d\n", (int)sizeof($fpostype));
10037 if eval $compile_ok; then
10042 echo "(I can't execute the test program--guessing $fpossize.)" >&4
10045 echo " $fpossize bytes." >&4
10051 echo "(I can't compile the test program. Guessing...)" >&4
10052 rp="What is the size of your file positions (in bytes)?"
10061 : Check if we want perlio
10062 useperlio="$define"
10064 : Set the vendorbin variables
10065 case "$vendorprefix" in
10066 '') d_vendorbin="$undef"
10070 *) d_vendorbin="$define"
10071 : determine where vendor-supplied executables go.
10072 case "$vendorbin" in
10073 '') dflt=$vendorprefix/bin ;;
10074 *) dflt="$vendorbin" ;;
10077 rp='Pathname for the vendor-supplied executables directory?'
10080 vendorbinexp="$ansexp"
10083 prefixvar=vendorbin
10086 : Set the vendorhtml1dir variables
10087 case "$vendorprefix" in
10088 '') vendorhtml1dir=''
10089 vendorhtml1direxp=''
10091 *) : determine where vendor-supplied html pages go.
10092 : There is no standard location, so try to copy the previously-selected
10093 : directory structure for the core html pages.
10094 : XXX Better default suggestions would be welcome.
10095 case "$vendorhtml1dir" in
10096 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10097 *) dflt=$vendorhtml1dir ;;
10100 ''|' ') dflt=none ;;
10103 rp='Pathname for the vendor-supplied html pages?'
10105 vendorhtml1dir="$ans"
10106 vendorhtml1direxp="$ansexp"
10109 : Use ' ' for none so value is preserved next time through Configure
10110 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
10111 prefixvar=vendorhtml1dir
10114 : Set the vendorhtml3dir variables
10115 case "$vendorprefix" in
10116 '') vendorhtml3dir=''
10117 vendorhtml3direxp=''
10119 *) : determine where vendor-supplied module html pages go.
10120 : There is no standard location, so try to copy the previously-selected
10121 : directory structure for the core html pages.
10122 : XXX Better default suggestions would be welcome.
10123 case "$vendorhtml3dir" in
10124 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10125 *) dflt=$vendorhtml3dir ;;
10128 ''|' ') dflt=none ;;
10131 rp='Pathname for the vendor-supplied html pages?'
10133 vendorhtml3dir="$ans"
10134 vendorhtml3direxp="$ansexp"
10137 : Use ' ' for none so value is preserved next time through Configure
10138 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10139 prefixvar=vendorhtml3dir
10142 : Set the vendorman1dir variables
10143 case "$vendorprefix" in
10144 '') vendorman1dir=''
10145 vendorman1direxp=''
10147 *) : determine where vendor-supplied manual pages go.
10148 case "$vendorman1dir" in
10149 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10150 *) dflt=$vendorman1dir ;;
10153 ''|' ') dflt=none ;;
10156 rp='Pathname for the vendor-supplied manual section 1 pages?'
10158 vendorman1dir="$ans"
10159 vendorman1direxp="$ansexp"
10162 : Use ' ' for none so value is preserved next time through Configure
10163 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10164 prefixvar=vendorman1dir
10167 : Set the vendorman3dir variables
10168 case "$vendorprefix" in
10169 '') vendorman3dir=''
10170 vendorman3direxp=''
10172 *) : determine where vendor-supplied module manual pages go.
10173 case "$vendorman3dir" in
10174 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10175 *) dflt=$vendorman3dir ;;
10178 ''|' ') dflt=none ;;
10181 rp='Pathname for the vendor-supplied manual section 3 pages?'
10183 vendorman3dir="$ans"
10184 vendorman3direxp="$ansexp"
10187 : Use ' ' for none so value is preserved next time through Configure
10188 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10189 prefixvar=vendorman3dir
10192 : Set the vendorscript variables
10193 case "$vendorprefix" in
10194 '') d_vendorscript="$undef"
10198 *) d_vendorscript="$define"
10199 : determine where vendor-supplied scripts go.
10200 case "$vendorscript" in
10201 '') dflt=$vendorprefix/script
10202 $test -d $dflt || dflt=$vendorbin ;;
10203 *) dflt="$vendorscript" ;;
10207 The installation process will create a directory for
10208 vendor-supplied scripts.
10212 rp='Pathname for the vendor-supplied scripts directory?'
10214 vendorscript="$ans"
10215 vendorscriptexp="$ansexp"
10218 prefixvar=vendorscript
10221 : script used to emit important warnings
10224 if test \$# -gt 0; then
10229 echo "*** WARNING:" >&4
10230 sed -e 's/^/*** /' <msg >&4
10232 cat msg >>config.msg
10233 echo " " >>config.msg
10239 : see which of string.h or strings.h is needed
10241 strings=`./findhdr string.h`
10242 if $test "$strings" && $test -r "$strings"; then
10243 echo "Using <string.h> instead of <strings.h>." >&4
10247 strings=`./findhdr strings.h`
10248 if $test "$strings" && $test -r "$strings"; then
10249 echo "Using <strings.h> instead of <string.h>." >&4
10251 ./warn "No string header found -- You'll surely have problems."
10256 case "$i_string" in
10257 "$undef") strings=`./findhdr strings.h`;;
10258 *) strings=`./findhdr string.h`;;
10261 : see if qgcvt exists
10265 : Check how to convert floats to strings.
10267 if test "X$d_Gconvert" = X; then
10270 echo "Checking for an efficient way to convert floats to strings."
10272 case "$uselongdouble" in
10273 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10275 case "$d_longdbl" in
10276 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10278 case "$d_PRIgldbl" in
10279 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10282 #ifdef TRY_gconvert
10283 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10284 char *myname = "gconvert";
10287 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10288 char *myname = "gcvt";
10291 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10292 char *myname = "qgcvt";
10293 #define DOUBLETYPE long double
10296 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10297 #ifdef HAS_PRIgldbl
10298 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10300 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10303 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10305 char *myname = "sprintf";
10309 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10310 #define DOUBLETYPE long double
10312 #define DOUBLETYPE double
10318 #$i_stdlib I_STDLIB
10320 #include <stdlib.h>
10322 #$i_string I_STRING
10324 # include <string.h>
10326 # include <strings.h>
10329 int checkit(char *expect, char *got)
10331 if (strcmp(expect, got)) {
10332 printf("%s oddity: Expected %s, got %s\n",
10333 myname, expect, got);
10343 /* This must be 1st test on (which?) platform */
10344 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10345 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10346 checkit("0.1", buf);
10348 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10349 checkit("0.01", buf);
10351 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10352 checkit("0.001", buf);
10354 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10355 checkit("0.0001", buf);
10357 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10358 if (strlen(buf) > 5)
10359 checkit("9e-005", buf); /* for Microsoft ?? */
10361 checkit("9e-05", buf);
10363 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10366 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10367 checkit("1.1", buf);
10369 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10370 checkit("1.01", buf);
10372 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10373 checkit("1.001", buf);
10375 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10376 checkit("1.0001", buf);
10378 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10379 checkit("1.00001", buf);
10381 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10382 checkit("1.000001", buf);
10384 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10387 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10388 checkit("-1", buf);
10390 /* Some Linux gcvt's give 1.e+5 here. */
10391 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10392 checkit("100000", buf);
10394 /* Some Linux gcvt's give -1.e+5 here. */
10395 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10396 checkit("-100000", buf);
10398 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10399 checkit("123.456", buf);
10401 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10402 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10403 /* 34 should be enough to scare even long double
10404 * places into using the e notation. */
10405 if (strlen(buf) > 5)
10406 checkit("1e+034", buf); /* for Microsoft */
10408 checkit("1e+34", buf);
10410 /* For Perl, if you add additional tests here, also add them to
10411 * t/base/num.t for benefit of platforms not using Configure or
10412 * overriding d_Gconvert */
10417 : first add preferred functions to our list
10419 for xxx_convert in $gconvert_preference; do
10420 case $xxx_convert in
10421 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10422 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10425 : then add any others
10426 for xxx_convert in gconvert gcvt sprintf; do
10427 case "$xxx_list" in
10429 *) xxx_list="$xxx_list $xxx_convert" ;;
10433 case "$d_longdbl$uselongdouble" in
10435 : again, add preferred functions to our list first
10437 for xxx_convert in $gconvert_ld_preference; do
10438 case $xxx_convert in
10439 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10440 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10443 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10444 for xxx_convert in qgcvt sprintf $xxx_list; do
10445 case "$xxx_ld_list" in
10446 $xxx_convert*|*" $xxx_convert"*) ;;
10447 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10450 : if sprintf cannot do long doubles, move it to the end
10451 if test "$d_PRIgldbl" != "$define"; then
10452 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10454 : if no qgcvt, remove it
10455 if test "$d_qgcvt" != "$define"; then
10456 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10459 xxx_list="$xxx_ld_list"
10463 for xxx_convert in $xxx_list; do
10464 echo "Trying $xxx_convert..."
10465 $rm -f try try$_o core
10466 set try -DTRY_$xxx_convert
10467 if eval $compile; then
10468 echo "$xxx_convert() found." >&4
10469 if $run ./try; then
10470 echo "I'll use $xxx_convert to convert floats into a string." >&4
10473 echo "...But $xxx_convert didn't work as I expected."
10477 echo "$xxx_convert NOT found." >&4
10481 if test X$xxx_convert = X; then
10482 echo "*** WHOA THERE!!! ***" >&4
10483 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10484 xxx_convert=sprintf
10487 case "$xxx_convert" in
10488 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10489 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10490 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10491 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10492 "$define$define$define")
10493 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10494 "$define$define$undef")
10495 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10496 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10504 : see if _fwalk exists
10508 : Initialize h_fcntl
10511 : Initialize h_sysfile
10514 : access call always available on UNIX
10515 set access d_access
10518 : locate the flags for 'access()'
10519 case "$d_access" in
10522 $cat >access.c <<EOCP
10523 #include <sys/types.h>
10528 #include <sys/file.h>
10531 #include <unistd.h>
10533 #$i_stdlib I_STDLIB
10535 #include <stdlib.h>
10541 : check sys/file.h first, no particular reason here
10542 if $test `./findhdr sys/file.h` && \
10543 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10545 echo "<sys/file.h> defines the *_OK access constants." >&4
10546 elif $test `./findhdr fcntl.h` && \
10547 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10549 echo "<fcntl.h> defines the *_OK access constants." >&4
10550 elif $test `./findhdr unistd.h` && \
10551 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10552 echo "<unistd.h> defines the *_OK access constants." >&4
10554 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10560 : see if accessx exists
10561 set accessx d_accessx
10564 : see if aintl exists
10568 : see if alarm exists
10572 : see if 64bit time functions exists
10574 set ctime64 d_ctime64
10577 set localtime64 d_localtime64
10580 set gmtime64 d_gmtime64
10583 set mktime64 d_mktime64
10586 set difftime64 d_difftime64
10589 set asctime64 d_asctime64
10592 : see if POSIX threads are available
10593 set pthread.h i_pthread
10596 : define a function to check prototypes
10597 $cat > protochk <<EOSH
10600 optimize="$optimize"
10602 prototype="$prototype"
10605 usethreads=$usethreads
10606 i_pthread=$i_pthread
10607 pthread_h_first=$pthread_h_first
10610 $cat >> protochk <<'EOSH'
10615 while test $# -ge 2; do
10617 $define) echo "#include <$2>" >> try.c ;;
10618 literal) echo "$2" >> try.c ;;
10620 # Extra magic for the benefit of systems that need pthread.h
10621 # to be included early to correctly detect threadsafe functions.
10622 # Such functions must guarantee themselves, though, that the usethreads
10623 # and i_pthread have been defined, before calling protochk.
10624 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10625 echo "#include <pthread.h>" >> try.c
10630 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10631 cat >> try.c <<'EOCP'
10632 #ifdef CAN_PROTOTYPE
10633 #define _(args) args
10638 echo "$foo" >> try.c
10639 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10640 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10646 $eunicefix protochk
10648 : Define hasproto macro for Configure internal use
10649 hasproto='varname=$1; func=$2; shift; shift;
10650 while $test $# -ge 2; do
10652 $define) echo "#include <$2>";;
10656 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10657 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10658 echo "$func() prototype found.";
10661 echo "$func() prototype NOT found.";
10668 : see if sys/types.h has to be included
10669 set sys/types.h i_systypes
10672 : see if sys/select.h has to be included
10673 set sys/select.h i_sysselct
10676 : Define hasfield macro for Configure internal use
10677 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10678 while $test $# -ge 2; do
10680 $define) echo "#include <$2>";;
10684 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10686 if eval $compile; then
10695 : see if we should include time.h, sys/time.h, or both
10697 if test "X$timeincl" = X; then
10698 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10699 $echo $n "I'm now running the test program...$c"
10701 #include <sys/types.h>
10706 #ifdef SYSTIMEKERNEL
10709 #include <sys/time.h>
10712 #include <sys/select.h>
10714 #$i_stdlib I_STDLIB
10716 #include <stdlib.h>
10722 struct timeval bar;
10725 struct timezone tzp;
10727 if (foo.tm_sec == foo.tm_sec)
10730 if (bar.tv_sec == bar.tv_sec)
10737 for s_timezone in '-DS_TIMEZONE' ''; do
10739 for s_timeval in '-DS_TIMEVAL' ''; do
10740 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10741 for i_time in '' '-DI_TIME'; do
10742 for i_systime in '-DI_SYSTIME' ''; do
10745 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10746 if eval $compile; then
10747 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10751 $echo $n "Succeeded with $flags$c"
10763 *SYSTIMEKERNEL*) i_systimek="$define"
10764 timeincl=`./findhdr sys/time.h`
10765 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10766 *) i_systimek="$undef";;
10769 *I_TIME*) i_time="$define"
10770 timeincl=`./findhdr time.h`" $timeincl"
10771 echo "We'll include <time.h>." >&4;;
10772 *) i_time="$undef";;
10775 *I_SYSTIME*) i_systime="$define"
10776 timeincl=`./findhdr sys/time.h`" $timeincl"
10777 echo "We'll include <sys/time.h>." >&4;;
10778 *) i_systime="$undef";;
10782 : see if struct tm knows about tm_zone
10783 case "$i_systime$i_time" in
10786 echo "Checking to see if your struct tm has tm_zone field..." >&4
10787 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10795 case "$d_tm_tm_zone" in
10796 "$define") echo "Yes, it does." ;;
10797 *) echo "No, it doesn't." ;;
10799 : see if struct tm knows about tm_gmtoff
10800 case "$i_systime$i_time" in
10803 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10804 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10812 case "$d_tm_tm_gmtoff" in
10813 "$define") echo "Yes, it does." ;;
10814 *) echo "No, it doesn't." ;;
10817 : see if asctime_r exists
10818 set asctime_r d_asctime_r
10820 case "$d_asctime_r" in
10822 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10823 case "$d_asctime_r_proto:$usethreads" in
10824 ":define") d_asctime_r_proto=define
10825 set d_asctime_r_proto asctime_r $hdrs
10829 case "$d_asctime_r_proto" in
10831 case "$asctime_r_proto" in
10832 ''|0) try='char* asctime_r(const struct tm*, char*);'
10833 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10835 case "$asctime_r_proto" in
10836 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10837 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10839 case "$asctime_r_proto" in
10840 ''|0) try='int asctime_r(const struct tm*, char*);'
10841 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10843 case "$asctime_r_proto" in
10844 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10845 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10847 case "$asctime_r_proto" in
10848 ''|0) d_asctime_r=undef
10850 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10851 * ) case "$asctime_r_proto" in
10852 REENTRANT_PROTO*) ;;
10853 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10855 echo "Prototype: $try" ;;
10858 *) case "$usethreads" in
10859 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10866 *) asctime_r_proto=0
10870 : see if atolf exists
10874 : see if atoll exists
10878 : Look for GCC-style attribute format
10879 case "$d_attribute_format" in
10882 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10883 $cat >attrib.c <<'EOCP'
10885 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10887 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10888 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10889 echo "Your C compiler doesn't support __attribute__((format))."
10892 echo "Your C compiler supports __attribute__((format))."
10896 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10900 *) val="$d_attribute_format" ;;
10902 set d_attribute_format
10906 : Look for GCC-style attribute format with null format allowed
10907 case "$d_printf_format_null" in
10908 '') case "$d_attribute_format" in
10911 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10912 $cat >attrib.c <<EOCP
10914 #$i_stdlib I_STDLIB
10916 #include <stdlib.h>
10918 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10919 int null_printf (char* pat,...) { return (int)pat; }
10920 int main () { exit(null_printf(NULL)); }
10922 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10923 : run the executable in case it produces a run-time warning
10924 if $run ./attrib >>attrib.out 2>&1; then
10925 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10926 echo "Your C compiler doesn't allow __printf__ format to be null."
10929 echo "Your C compiler allows __printf__ format to be null."
10933 echo "Your C compiler executable failed with __printf__ format null."
10937 echo "Your C compiler fails with __printf__ format null."
10944 *) val="$d_printf_format_null" ;;
10946 set d_printf_format_null
10950 : Look for GCC-style attribute malloc
10951 case "$d_attribute_malloc" in
10954 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10955 $cat >attrib.c <<'EOCP'
10957 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10959 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10960 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10961 echo "Your C compiler doesn't support __attribute__((malloc))."
10964 echo "Your C compiler supports __attribute__((malloc))."
10968 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10972 *) val="$d_attribute_malloc" ;;
10974 set d_attribute_malloc
10978 : Look for GCC-style attribute nonnull
10979 case "$d_attribute_nonnull" in
10982 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10983 $cat >attrib.c <<'EOCP'
10985 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10987 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10988 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10989 echo "Your C compiler doesn't support __attribute__((nonnull))."
10992 echo "Your C compiler supports __attribute__((nonnull))."
10996 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11000 *) val="$d_attribute_nonnull" ;;
11002 set d_attribute_nonnull
11006 : Look for GCC-style attribute noreturn
11007 case "$d_attribute_noreturn" in
11010 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11011 $cat >attrib.c <<'EOCP'
11013 void fall_over_dead( void ) __attribute__((noreturn));
11015 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11016 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11017 echo "Your C compiler doesn't support __attribute__((noreturn))."
11020 echo "Your C compiler supports __attribute__((noreturn))."
11024 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11028 *) val="$d_attribute_noreturn" ;;
11030 set d_attribute_noreturn
11034 : Look for GCC-style attribute pure
11035 case "$d_attribute_pure" in
11038 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11039 $cat >attrib.c <<'EOCP'
11041 int square( int n ) __attribute__((pure));
11043 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11044 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11045 echo "Your C compiler doesn't support __attribute__((pure))."
11048 echo "Your C compiler supports __attribute__((pure))."
11052 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11056 *) val="$d_attribute_pure" ;;
11058 set d_attribute_pure
11062 : Look for GCC-style attribute unused
11063 case "$d_attribute_unused" in
11066 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11067 $cat >attrib.c <<'EOCP'
11069 int do_something( int dummy __attribute__((unused)), int n );
11071 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11072 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11073 echo "Your C compiler doesn't support __attribute__((unused))."
11076 echo "Your C compiler supports __attribute__((unused))."
11080 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11084 *) val="$d_attribute_unused" ;;
11086 set d_attribute_unused
11090 : Look for GCC-style attribute deprecated
11091 case "$d_attribute_deprecated" in
11094 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11095 $cat >attrib.c <<'EOCP'
11097 int I_am_deprecated(void) __attribute__((deprecated));
11099 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11100 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11101 echo "Your C compiler doesn't support __attribute__((deprecated))."
11104 echo "Your C compiler supports __attribute__((deprecated))."
11108 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11112 *) val="$d_attribute_deprecated" ;;
11114 set d_attribute_deprecated
11118 : Look for GCC-style attribute warn_unused_result
11119 case "$d_attribute_warn_unused_result" in
11122 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11123 $cat >attrib.c <<'EOCP'
11125 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11127 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11128 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11129 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11132 echo "Your C compiler supports __attribute__((warn_unused_result))."
11136 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11140 *) val="$d_attribute_warn_unused_result" ;;
11142 set d_attribute_warn_unused_result
11146 : see if bcmp exists
11150 : see if bcopy exists
11154 : see if getpgrp exists
11155 set getpgrp d_getpgrp
11158 case "$d_getpgrp" in
11161 echo "Checking to see which flavor of getpgrp is in use..."
11163 #$i_unistd I_UNISTD
11164 #include <sys/types.h>
11166 # include <unistd.h>
11168 #$i_stdlib I_STDLIB
11170 #include <stdlib.h>
11174 if (getuid() == 0) {
11175 printf("(I see you are running Configure as super-user...)\n");
11178 #ifdef TRY_BSD_PGRP
11179 if (getpgrp(1) == 0)
11188 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11189 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11191 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11192 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11195 echo "I can't seem to compile and run the test program."
11197 xxx="a USG one, i.e. you use getpgrp()."
11199 # SVR4 systems can appear rather BSD-ish.
11200 case "$i_unistd" in
11202 xxx="a BSD one, i.e. you use getpgrp(pid)."
11206 xxx="probably a USG one, i.e. you use getpgrp()."
11211 echo "Assuming your getpgrp is $xxx" >&4
11220 : see if setpgrp exists
11221 set setpgrp d_setpgrp
11224 case "$d_setpgrp" in
11227 echo "Checking to see which flavor of setpgrp is in use..."
11229 #$i_unistd I_UNISTD
11230 #include <sys/types.h>
11232 # include <unistd.h>
11234 #$i_stdlib I_STDLIB
11236 #include <stdlib.h>
11240 if (getuid() == 0) {
11241 printf("(I see you are running Configure as super-user...)\n");
11244 #ifdef TRY_BSD_PGRP
11245 if (-1 == setpgrp(1, 1))
11248 if (setpgrp() != -1)
11254 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11255 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11257 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11258 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11261 echo "(I can't seem to compile and run the test program.)"
11263 xxx="a USG one, i.e. you use setpgrp()."
11265 # SVR4 systems can appear rather BSD-ish.
11266 case "$i_unistd" in
11268 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11272 xxx="probably a USG one, i.e. you use setpgrp()."
11277 echo "Assuming your setpgrp is $xxx" >&4
11286 : Look for GCC-style __builtin_choose_expr
11287 case "$d_builtin_choose_expr" in
11290 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11291 $cat >try.c <<'EOCP'
11292 #include <assert.h>
11293 #include <stdlib.h>
11296 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11299 assert( SYRINX(1) == 2112 );
11300 assert( SYRINX(1) != 5150 );
11301 assert( SYRINX(0) == 5150 );
11302 assert( SYRINX(0) != 2112 );
11303 puts( "All good!" );
11309 if eval $compile && $run ./try; then
11310 echo "Your C compiler supports __builtin_choose_expr."
11313 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11317 *) val="$d_builtin_choose_expr" ;;
11320 set d_builtin_choose_expr
11324 : Look for GCC-style __builtin_expect
11325 case "$d_builtin_expect" in
11328 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11329 $cat >try.c <<'EOCP'
11332 if ( __builtin_expect(n, 0) ) n = 1;
11333 /* Remember shell exit code truth is 0, C truth is non-zero */
11338 if eval $compile && $run ./try; then
11339 echo "Your C compiler supports __builtin_expect."
11342 echo "Your C compiler doesn't seem to understand __builtin_expect."
11346 *) val="$d_builtin_expect" ;;
11349 set d_builtin_expect
11353 : see if bzero exists
11357 : see if stdarg is available
11359 if $test `./findhdr stdarg.h`; then
11360 echo "<stdarg.h> found." >&4
11363 echo "<stdarg.h> NOT found." >&4
11367 : see if varargs is available
11369 if $test `./findhdr varargs.h`; then
11370 echo "<varargs.h> found." >&4
11372 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11375 : set up the varargs testing programs
11376 $cat > varargs.c <<EOP
11378 #include <stdarg.h>
11381 #include <varargs.h>
11385 int f(char *p, ...)
11399 p = va_arg(ap, char *);
11405 $cat > varargs <<EOP
11407 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11416 : now check which varargs header should be included
11422 if `./varargs I_STDARG`; then
11424 elif `./varargs I_VARARGS`; then
11429 if `./varargs I_VARARGS`; then
11437 echo "*** WHOA THERE!!! ***" >&4
11438 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11439 case "$knowitall" in
11441 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11445 echo "I could not find the definition for va_dcl... You have problems..." >&4
11446 val="$undef"; set i_stdarg; eval $setvar
11447 val="$undef"; set i_varargs; eval $setvar
11452 case "$i_varhdr" in
11454 val="$define"; set i_stdarg; eval $setvar
11455 val="$undef"; set i_varargs; eval $setvar
11458 val="$undef"; set i_stdarg; eval $setvar
11459 val="$define"; set i_varargs; eval $setvar
11462 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11466 : see if the Compiler supports C99 variadic macros
11467 case "$i_stdarg$i_stdlib" in
11469 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11472 #include <stdarg.h>
11474 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11478 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11484 if eval $compile && $run ./try 2>&1 >/dev/null; then
11485 case "`$run ./try`" in
11487 echo "You have C99 variadic macros." >&4
11488 d_c99_variadic_macros="$define"
11491 echo "You don't have functional C99 variadic macros." >&4
11492 d_c99_variadic_macros="$undef"
11496 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11497 d_c99_variadic_macros="$undef"
11502 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11503 d_c99_variadic_macros="$undef"
11507 : see if signal is declared as pointer to function returning int or void
11509 xxx=`./findhdr signal.h`
11510 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11511 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11512 echo "You have int (*signal())() instead of void." >&4
11514 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11515 echo "You have void (*signal())()." >&4
11517 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11518 echo "You have int (*signal())() instead of void." >&4
11520 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11521 echo "You have void (*signal())()." >&4
11524 case "$d_voidsig" in
11526 echo "I can't determine whether signal handler returns void or int..." >&4
11528 rp="What type does your signal handler return?"
11531 v*) val="$define";;
11535 echo "As you already told me, signal handler returns void." >&4
11538 *) echo "As you already told me, signal handler returns int." >&4
11545 case "$d_voidsig" in
11546 "$define") signal_t="void";;
11547 *) signal_t="int";;
11551 : check for ability to cast large floats to 32-bit ints.
11553 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11554 if $test "$intsize" -ge 4; then
11561 #$i_stdlib I_STDLIB
11563 #include <stdlib.h>
11565 #include <sys/types.h>
11566 #include <signal.h>
11567 $signal_t blech(int s) { exit(3); }
11574 signal(SIGFPE, blech);
11576 /* Don't let compiler optimize the test away. Store the number
11577 in a writable string for gcc to pass to sscanf under HP-UX.
11579 sprintf(str, "2147483647");
11580 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11584 /* x86 processors will probably give 0x8000 0000, which is a
11585 sign change. We don't want that. We want to mimic SPARC
11586 behavior here, which is to preserve the sign and give
11589 if (i32 != ($xxx) f)
11595 if eval $compile_ok; then
11599 echo "(I can't seem to compile the test program--assuming it can't)"
11604 echo "Yup, it can."
11607 echo "Nope, it can't."
11614 : check for ability to cast negative floats to unsigned
11616 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11619 #$i_stdlib I_STDLIB
11621 #include <stdlib.h>
11623 #include <sys/types.h>
11624 #include <signal.h>
11625 $signal_t blech(int s) { exit(7); }
11626 $signal_t blech_in_list(int s) { exit(4); }
11627 unsigned long dummy_long(unsigned long p) { return p; }
11628 unsigned int dummy_int(unsigned int p) { return p; }
11629 unsigned short dummy_short(unsigned short p) { return p; }
11633 unsigned long along;
11635 unsigned short ashort;
11639 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11640 a direct f = -123. assignment. gcc-2.8.0 reportedly
11641 optimized the whole file away
11643 /* Store the number in a writable string for gcc to pass to
11644 sscanf under HP-UX.
11646 sprintf(str, "-123");
11647 sscanf(str, "%lf", &f); /* f = -123.; */
11649 signal(SIGFPE, blech);
11650 along = (unsigned long)f;
11651 aint = (unsigned int)f;
11652 ashort = (unsigned short)f;
11653 if (along != (unsigned long)-123)
11655 if (aint != (unsigned int)-123)
11657 if (ashort != (unsigned short)-123)
11659 sprintf(str, "1073741824.");
11660 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11663 along = (unsigned long)f;
11664 if (along != 0x80000000)
11668 along = (unsigned long)f;
11669 if (along != 0x7fffffff)
11673 along = (unsigned long)f;
11674 if (along != 0x80000001)
11678 signal(SIGFPE, blech_in_list);
11679 sprintf(str, "123.");
11680 sscanf(str, "%lf", &f); /* f = 123.; */
11681 along = dummy_long((unsigned long)f);
11682 aint = dummy_int((unsigned int)f);
11683 ashort = dummy_short((unsigned short)f);
11684 if (along != (unsigned long)123)
11686 if (aint != (unsigned int)123)
11688 if (ashort != (unsigned short)123)
11695 if eval $compile_ok; then
11699 echo "(I can't seem to compile the test program--assuming it can't)"
11702 case "$castflags" in
11704 echo "Yup, it can."
11707 echo "Nope, it can't."
11714 : see if vprintf exists
11716 if set vprintf val -f d_vprintf; eval $csym; $val; then
11717 echo 'vprintf() found.' >&4
11720 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11721 #$i_varargs I_VARARGS
11723 #$i_stdlib I_STDLIB
11724 #$i_unistd I_UNISTD
11727 # include <stdarg.h>
11728 #else /* I_VARARGS */
11729 # include <varargs.h>
11733 # include <unistd.h>
11737 # include <stdlib.h>
11740 #include <stdio.h> /* vsprintf prototype */
11743 void xxx(int n, ...)
11748 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11750 int main() { xxx(1, "foo"); }
11752 #else /* I_VARARGS */
11760 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11762 int main() { xxx("foo"); }
11768 if eval $compile_ok; then
11769 if $run ./try; then
11770 echo "Your vsprintf() returns (int)." >&4
11773 echo "Your vsprintf() returns (char*)." >&4
11777 echo 'I am unable to compile the vsprintf() test program.' >&4
11778 # We shouldn't get here. If we do, assume the standard signature,
11779 # not the old BSD one.
11780 echo 'Guessing that vsprintf() returns (int).' >&4
11784 echo 'vprintf() NOT found.' >&4
11795 : see if chown exists
11799 : see if chroot exists
11800 set chroot d_chroot
11803 : see if chsize exists
11804 set chsize d_chsize
11807 : see if class exists
11811 : see if clearenv exists
11812 set clearenv d_clearenv
11815 : Define hasstruct macro for Configure internal use
11816 hasstruct='varname=$1; struct=$2; shift; shift;
11817 while $test $# -ge 2; do
11819 $define) echo "#include <$2>";;
11823 echo "int main () { struct $struct foo; }" >> try.c;
11825 if eval $compile; then
11834 : see whether socket exists
11838 $echo $n "Hmm... $c" >&4
11839 if set socket val -f d_socket; eval $csym; $val; then
11840 echo "Looks like you have Berkeley networking support." >&4
11842 if set setsockopt val -f; eval $csym; $val; then
11845 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11846 d_oldsock="$define"
11849 if $contains socklib libc.list >/dev/null 2>&1; then
11850 echo "Looks like you have Berkeley networking support." >&4
11852 : we will have to assume that it supports the 4.2 BSD interface
11855 echo "You don't have Berkeley networking in libc$_a..." >&4
11856 if test "X$d_socket" = "X$define"; then
11857 echo "...but you seem to believe that you have sockets." >&4
11859 for net in net socket
11861 if test -f $sysroot/usr/lib/lib$net$_a; then
11862 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11863 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11864 if $contains socket libc.list >/dev/null 2>&1; then
11869 echo "...but the Wollongong group seems to have hacked it in." >&4
11870 sockethdr="-I$sysroot/usr/netinclude"
11873 echo "Found Berkeley sockets interface in lib$net." >&4
11874 if $contains setsockopt libc.list >/dev/null 2>&1; then
11877 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11878 d_oldsock="$define"
11884 if test "X$d_socket" != "X$define"; then
11885 echo "or anywhere else I see." >&4
11893 : see if socketpair exists
11894 set socketpair d_sockpair
11899 echo "Checking the availability sa_len in the sock struct ..." >&4
11901 #include <sys/types.h>
11902 #include <sys/socket.h>
11904 struct sockaddr sa;
11905 return (sa.sa_len);
11909 set try; if eval $compile; then
11912 set d_sockaddr_sa_len; eval $setvar
11916 echo "Checking the availability struct sockaddr_in6 ..." >&4
11918 #include <sys/types.h>
11919 #include <sys/socket.h>
11920 #include <netinet/in.h>
11922 struct sockaddr_in6 sin6;
11923 return (sin6.sin6_family);
11927 set try; if eval $compile; then
11930 set d_sockaddr_in6; eval $setvar
11934 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11936 #include <sys/types.h>
11937 #include <sys/socket.h>
11938 #include <netinet/in.h>
11940 struct sockaddr_in6 sin6;
11941 return (sin6.sin6_scope_id);
11945 set try; if eval $compile; then
11948 set d_sin6_scope_id; eval $setvar
11952 echo "Checking the availability struct ip_mreq ..." >&4
11954 #include <sys/types.h>
11955 #include <sys/socket.h>
11956 #include <netinet/in.h>
11958 struct ip_mreq mreq;
11959 return (mreq.imr_multiaddr.s_addr);
11963 set try; if eval $compile; then
11966 set d_ip_mreq; eval $setvar
11970 echo "Checking the availability struct ip_mreq_source ..." >&4
11972 #include <sys/types.h>
11973 #include <sys/socket.h>
11974 #include <netinet/in.h>
11976 struct ip_mreq_source mreq;
11977 return (mreq.imr_multiaddr.s_addr);
11981 set try; if eval $compile; then
11984 set d_ip_mreq_source; eval $setvar
11988 echo "Checking the availability struct ipv6_mreq ..." >&4
11990 #include <sys/types.h>
11991 #include <sys/socket.h>
11992 #include <netinet/in.h>
11994 struct ipv6_mreq mreq;
11995 return (mreq.ipv6mr_interface);
11999 set try; if eval $compile; then
12002 set d_ipv6_mreq; eval $setvar
12006 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12008 #include <sys/types.h>
12009 #include <sys/socket.h>
12010 #include <netinet/in.h>
12012 struct ipv6_mreq_source mreq;
12013 return (mreq.imr_multiaddr.s_addr);
12017 set try; if eval $compile; then
12020 set d_ipv6_mreq_source; eval $setvar
12024 echo "Checking the availability of certain socket constants..." >&4
12025 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12026 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12028 #include <sys/types.h>
12029 #include <sys/socket.h>
12035 set try; if eval $compile; then
12038 set d_${enum}; eval $setvar
12042 : see if this is a sys/uio.h system
12043 set sys/uio.h i_sysuio
12046 : Check for cmsghdr support
12048 echo "Checking to see if your system supports struct cmsghdr..." >&4
12049 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12051 case "$d_cmsghdr_s" in
12052 "$define") echo "Yes, it does." ;;
12053 *) echo "No, it doesn't." ;;
12057 : check for const keyword
12059 echo 'Checking to see if your C compiler knows about "const"...' >&4
12060 $cat >const.c <<'EOCP'
12061 typedef struct spug { int drokk; } spug;
12065 const spug y = { 0 };
12068 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12070 echo "Yup, it does."
12073 echo "Nope, it doesn't."
12078 : see if copysignl exists
12079 set copysignl d_copysignl
12082 : see if crypt exists
12087 $define) cryptlib='' ;;
12088 *) if set crypt val -f d_crypt; eval $csym; $val; then
12089 echo 'crypt() found.' >&4
12093 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12094 if $test -z "$cryptlib"; then
12095 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12099 if $test -z "$cryptlib"; then
12100 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12104 if $test -z "$cryptlib"; then
12105 cryptlib=`./loc libcrypt$_a "" $libpth`
12109 if $test -z "$cryptlib"; then
12110 echo 'crypt() NOT found.' >&4
12121 : see if this is a crypt.h system
12122 set crypt.h i_crypt
12125 : see if crypt_r exists
12126 set crypt_r d_crypt_r
12128 case "$d_crypt_r" in
12130 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12131 case "$d_crypt_r_proto:$usethreads" in
12132 ":define") d_crypt_r_proto=define
12133 set d_crypt_r_proto crypt_r $hdrs
12137 case "$d_crypt_r_proto" in
12139 case "$crypt_r_proto" in
12140 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12141 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12143 case "$crypt_r_proto" in
12144 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12145 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12147 case "$crypt_r_proto" in
12148 ''|0) d_crypt_r=undef
12150 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12151 * ) case "$crypt_r_proto" in
12152 REENTRANT_PROTO*) ;;
12153 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12155 echo "Prototype: $try" ;;
12158 *) case "$usethreads" in
12159 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12170 : get csh whereabouts
12172 'csh') val="$undef" ;;
12173 *) val="$define" ;;
12177 : Respect a hint or command line value for full_csh.
12178 case "$full_csh" in
12179 '') full_csh=$csh ;;
12182 : see if ctermid exists
12183 set ctermid d_ctermid
12186 : see if ctermid_r exists
12187 set ctermid_r d_ctermid_r
12189 case "$d_ctermid_r" in
12191 hdrs="$i_systypes sys/types.h define stdio.h "
12192 case "$d_ctermid_r_proto:$usethreads" in
12193 ":define") d_ctermid_r_proto=define
12194 set d_ctermid_r_proto ctermid_r $hdrs
12198 case "$d_ctermid_r_proto" in
12200 case "$ctermid_r_proto" in
12201 ''|0) try='char* ctermid_r(char*);'
12202 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12204 case "$ctermid_r_proto" in
12205 ''|0) d_ctermid_r=undef
12207 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12208 * ) case "$ctermid_r_proto" in
12209 REENTRANT_PROTO*) ;;
12210 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12212 echo "Prototype: $try" ;;
12215 *) case "$usethreads" in
12216 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12223 *) ctermid_r_proto=0
12227 : see if ctime_r exists
12228 set ctime_r d_ctime_r
12230 case "$d_ctime_r" in
12232 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12233 case "$d_ctime_r_proto:$usethreads" in
12234 ":define") d_ctime_r_proto=define
12235 set d_ctime_r_proto ctime_r $hdrs
12239 case "$d_ctime_r_proto" in
12241 case "$ctime_r_proto" in
12242 ''|0) try='char* ctime_r(const time_t*, char*);'
12243 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12245 case "$ctime_r_proto" in
12246 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12247 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12249 case "$ctime_r_proto" in
12250 ''|0) try='int ctime_r(const time_t*, char*);'
12251 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12253 case "$ctime_r_proto" in
12254 ''|0) try='int ctime_r(const time_t*, char*, int);'
12255 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12257 case "$ctime_r_proto" in
12258 ''|0) d_ctime_r=undef
12260 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12261 * ) case "$ctime_r_proto" in
12262 REENTRANT_PROTO*) ;;
12263 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12265 echo "Prototype: $try" ;;
12268 *) case "$usethreads" in
12269 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12280 : see if cuserid exists
12281 set cuserid d_cuserid
12284 : see if this is a limits.h system
12285 set limits.h i_limits
12288 : See if number of significant digits in a double precision number is known
12290 $cat >dbl_dig.c <<EOM
12291 #$i_limits I_LIMITS
12294 #include <limits.h>
12300 printf("Contains DBL_DIG");
12303 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12304 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12305 echo "DBL_DIG found." >&4
12308 echo "DBL_DIG NOT found." >&4
12315 : see if dbm.h is available
12316 : see if dbmclose exists
12317 set dbmclose d_dbmclose
12320 case "$d_dbmclose" in
12330 *) set rpcsvc/dbm.h i_rpcsvcdbm
12335 *) echo "We won't be including <dbm.h>"
12345 : see if prototype for dbminit is available
12347 set d_dbminitproto dbminit $i_dbm dbm.h
12350 : see if difftime exists
12351 set difftime d_difftime
12354 : see if this is a dirent system
12356 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12358 echo "<dirent.h> found." >&4
12361 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12362 echo "<sys/dir.h> found." >&4
12365 xinc=`./findhdr sys/ndir.h`
12367 echo "<dirent.h> NOT found." >&4
12372 : Look for type of directory structure.
12374 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12376 case "$direntrytype" in
12378 case "$i_dirent" in
12379 $define) guess1='struct dirent' ;;
12380 *) guess1='struct direct' ;;
12383 *) guess1="$direntrytype"
12388 'struct dirent') guess2='struct direct' ;;
12389 *) guess2='struct dirent' ;;
12392 if $contains "$guess1" try.c >/dev/null 2>&1; then
12393 direntrytype="$guess1"
12394 echo "Your directory entries are $direntrytype." >&4
12395 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12396 direntrytype="$guess2"
12397 echo "Your directory entries seem to be $direntrytype." >&4
12399 echo "I don't recognize your system's directory entries." >&4
12400 rp="What type is used for directory entries on this system?"
12403 direntrytype="$ans"
12407 : see if the directory entry stores field length
12409 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12410 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12411 echo "Good, your directory entry keeps length information in d_namlen." >&4
12414 echo "Your directory entry does not know about the d_namlen field." >&4
12421 : Look for DIR.dd_fd
12422 case "$i_dirent" in
12424 echo "Checking to see if DIR has a dd_fd member variable" >&4
12426 #$i_stdlib I_STDLIB
12428 #include <stdlib.h>
12430 #include <dirent.h>
12440 if eval $compile; then
12441 echo "Yes, it does."
12444 echo "No, it does not."
12449 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12457 : see if this is an sysdir system
12458 set sys/dir.h i_sysdir
12461 : see if this is an sysndir system
12462 set sys/ndir.h i_sysndir
12467 $cat >dirfd.c <<EOM
12469 #$i_stdlib I_STDLIB
12471 #include <stdlib.h>
12473 #$i_dirent I_DIRENT /**/
12474 #$i_sysdir I_SYS_DIR /**/
12475 #$i_sysndir I_SYS_NDIR /**/
12476 #$i_systypes I_SYS_TYPES /**/
12477 #if defined(I_SYS_TYPES)
12478 #include <sys/types.h>
12480 #if defined(I_DIRENT)
12481 #include <dirent.h>
12484 #include <sys/ndir.h>
12488 #include <ndir.h> /* may be wrong in the future */
12490 #include <sys/dir.h>
12496 DIR *dirp = opendir(".");
12497 if (dirfd(dirp) >= 0)
12505 if eval $compile; then
12509 $define) echo "dirfd() found." >&4 ;;
12510 *) echo "dirfd() NOT found." >&4 ;;
12516 : see if dladdr exists
12517 set dladdr d_dladdr
12520 : see if dlerror exists
12523 set dlerror d_dlerror
12527 : see if dlfcn is available
12528 set dlfcn.h i_dlfcn
12531 : Check what extension to use for shared libs
12536 On a few systems, the dynamically loaded modules that perl generates and uses
12537 will need a different extension than shared libs. The default will probably
12543 *) dflt="$dlext" ;;
12545 rp='What is the extension of dynamically loaded modules'
12554 : Check if dlsym need a leading underscore
12560 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12561 $cat >dyna.c <<'EOM'
12568 #$i_stdlib I_STDLIB
12570 #include <stdlib.h>
12574 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12576 #include <sys/types.h>
12581 extern int fred() ;
12590 int mode = RTLD_LAZY ;
12592 handle = dlopen("./dyna.$dlext", mode) ;
12593 if (handle == NULL) {
12598 symbol = dlsym(handle, "fred") ;
12599 if (symbol == NULL) {
12600 /* try putting a leading underscore */
12601 symbol = dlsym(handle, "_fred") ;
12602 if (symbol == NULL) {
12615 : Call the object file tmp-dyna.o in case dlext=o.
12616 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12617 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12618 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12619 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12622 1) echo "Test program failed using dlopen." >&4
12623 echo "Perhaps you should not use dynamic loading." >&4;;
12624 2) echo "Test program failed using dlsym." >&4
12625 echo "Perhaps you should not use dynamic loading." >&4;;
12626 3) echo "dlsym needs a leading underscore" >&4
12628 4) echo "dlsym doesn't need a leading underscore." >&4;;
12631 echo "I can't compile and run the test program." >&4
12632 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12637 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12642 : see if drand48_r exists
12643 set drand48_r d_drand48_r
12645 case "$d_drand48_r" in
12647 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12648 case "$d_drand48_r_proto:$usethreads" in
12649 ":define") d_drand48_r_proto=define
12650 set d_drand48_r_proto drand48_r $hdrs
12654 case "$d_drand48_r_proto" in
12656 case "$drand48_r_proto" in
12657 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12658 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12660 case "$drand48_r_proto" in
12661 ''|0) d_drand48_r=undef
12663 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12664 * ) case "$drand48_r_proto" in
12665 REENTRANT_PROTO*) ;;
12666 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12668 echo "Prototype: $try" ;;
12671 *) case "$usethreads" in
12672 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12679 *) drand48_r_proto=0
12683 : see if prototype for drand48 is available
12685 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12688 : see if dup2 exists
12692 : see if eaccess exists
12693 set eaccess d_eaccess
12696 : see if endgrent exists
12697 set endgrent d_endgrent
12700 : see if this is an grp system
12706 xxx=`./findhdr grp.h`
12707 $cppstdin $cppflags $cppminus < $xxx >$$.h
12709 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12721 set d_grpasswd; eval $setvar
12725 : see if endgrent_r exists
12726 set endgrent_r d_endgrent_r
12728 case "$d_endgrent_r" in
12730 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12731 case "$d_endgrent_r_proto:$usethreads" in
12732 ":define") d_endgrent_r_proto=define
12733 set d_endgrent_r_proto endgrent_r $hdrs
12737 case "$d_endgrent_r_proto" in
12739 case "$endgrent_r_proto" in
12740 ''|0) try='int endgrent_r(FILE**);'
12741 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12743 case "$endgrent_r_proto" in
12744 ''|0) try='void endgrent_r(FILE**);'
12745 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12747 case "$endgrent_r_proto" in
12748 ''|0) d_endgrent_r=undef
12750 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12751 * ) case "$endgrent_r_proto" in
12752 REENTRANT_PROTO*) ;;
12753 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12755 echo "Prototype: $try" ;;
12758 *) case "$usethreads" in
12759 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12766 *) endgrent_r_proto=0
12770 : see if endhostent exists
12771 set endhostent d_endhent
12774 : see if this is a netdb.h system
12775 set netdb.h i_netdb
12778 : see if endhostent_r exists
12779 set endhostent_r d_endhostent_r
12781 case "$d_endhostent_r" in
12783 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12784 case "$d_endhostent_r_proto:$usethreads" in
12785 ":define") d_endhostent_r_proto=define
12786 set d_endhostent_r_proto endhostent_r $hdrs
12790 case "$d_endhostent_r_proto" in
12792 case "$endhostent_r_proto" in
12793 ''|0) try='int endhostent_r(struct hostent_data*);'
12794 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12796 case "$endhostent_r_proto" in
12797 ''|0) try='void endhostent_r(struct hostent_data*);'
12798 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12800 case "$endhostent_r_proto" in
12801 ''|0) d_endhostent_r=undef
12802 endhostent_r_proto=0
12803 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12804 * ) case "$endhostent_r_proto" in
12805 REENTRANT_PROTO*) ;;
12806 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12808 echo "Prototype: $try" ;;
12811 *) case "$usethreads" in
12812 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12814 d_endhostent_r=undef
12815 endhostent_r_proto=0
12819 *) endhostent_r_proto=0
12823 : see if endnetent exists
12824 set endnetent d_endnent
12827 : see if endnetent_r exists
12828 set endnetent_r d_endnetent_r
12830 case "$d_endnetent_r" in
12832 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12833 case "$d_endnetent_r_proto:$usethreads" in
12834 ":define") d_endnetent_r_proto=define
12835 set d_endnetent_r_proto endnetent_r $hdrs
12839 case "$d_endnetent_r_proto" in
12841 case "$endnetent_r_proto" in
12842 ''|0) try='int endnetent_r(struct netent_data*);'
12843 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12845 case "$endnetent_r_proto" in
12846 ''|0) try='void endnetent_r(struct netent_data*);'
12847 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12849 case "$endnetent_r_proto" in
12850 ''|0) d_endnetent_r=undef
12851 endnetent_r_proto=0
12852 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12853 * ) case "$endnetent_r_proto" in
12854 REENTRANT_PROTO*) ;;
12855 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12857 echo "Prototype: $try" ;;
12860 *) case "$usethreads" in
12861 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12863 d_endnetent_r=undef
12864 endnetent_r_proto=0
12868 *) endnetent_r_proto=0
12872 : see if endprotoent exists
12873 set endprotoent d_endpent
12876 : see if endprotoent_r exists
12877 set endprotoent_r d_endprotoent_r
12879 case "$d_endprotoent_r" in
12881 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12882 case "$d_endprotoent_r_proto:$usethreads" in
12883 ":define") d_endprotoent_r_proto=define
12884 set d_endprotoent_r_proto endprotoent_r $hdrs
12888 case "$d_endprotoent_r_proto" in
12890 case "$endprotoent_r_proto" in
12891 ''|0) try='int endprotoent_r(struct protoent_data*);'
12892 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12894 case "$endprotoent_r_proto" in
12895 ''|0) try='void endprotoent_r(struct protoent_data*);'
12896 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12898 case "$endprotoent_r_proto" in
12899 ''|0) d_endprotoent_r=undef
12900 endprotoent_r_proto=0
12901 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12902 * ) case "$endprotoent_r_proto" in
12903 REENTRANT_PROTO*) ;;
12904 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12906 echo "Prototype: $try" ;;
12909 *) case "$usethreads" in
12910 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12912 d_endprotoent_r=undef
12913 endprotoent_r_proto=0
12917 *) endprotoent_r_proto=0
12921 : see if endpwent exists
12922 set endpwent d_endpwent
12925 : see if this is a pwd.h system
12931 xxx=`./findhdr pwd.h`
12932 $cppstdin $cppflags $cppminus < $xxx >$$.h
12934 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12942 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12950 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12958 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12966 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12974 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12982 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12990 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13002 set d_pwquota; eval $setvar
13003 set d_pwage; eval $setvar
13004 set d_pwchange; eval $setvar
13005 set d_pwclass; eval $setvar
13006 set d_pwexpire; eval $setvar
13007 set d_pwcomment; eval $setvar
13008 set d_pwgecos; eval $setvar
13009 set d_pwpasswd; eval $setvar
13013 : see if endpwent_r exists
13014 set endpwent_r d_endpwent_r
13016 case "$d_endpwent_r" in
13018 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13019 case "$d_endpwent_r_proto:$usethreads" in
13020 ":define") d_endpwent_r_proto=define
13021 set d_endpwent_r_proto endpwent_r $hdrs
13025 case "$d_endpwent_r_proto" in
13027 case "$endpwent_r_proto" in
13028 ''|0) try='int endpwent_r(FILE**);'
13029 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13031 case "$endpwent_r_proto" in
13032 ''|0) try='void endpwent_r(FILE**);'
13033 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13035 case "$endpwent_r_proto" in
13036 ''|0) d_endpwent_r=undef
13038 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13039 * ) case "$endpwent_r_proto" in
13040 REENTRANT_PROTO*) ;;
13041 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13043 echo "Prototype: $try" ;;
13046 *) case "$usethreads" in
13047 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13054 *) endpwent_r_proto=0
13058 : see if endservent exists
13059 set endservent d_endsent
13062 : see if endservent_r exists
13063 set endservent_r d_endservent_r
13065 case "$d_endservent_r" in
13067 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13068 case "$d_endservent_r_proto:$usethreads" in
13069 ":define") d_endservent_r_proto=define
13070 set d_endservent_r_proto endservent_r $hdrs
13074 case "$d_endservent_r_proto" in
13076 case "$endservent_r_proto" in
13077 ''|0) try='int endservent_r(struct servent_data*);'
13078 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13080 case "$endservent_r_proto" in
13081 ''|0) try='void endservent_r(struct servent_data*);'
13082 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13084 case "$endservent_r_proto" in
13085 ''|0) d_endservent_r=undef
13086 endservent_r_proto=0
13087 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13088 * ) case "$endservent_r_proto" in
13089 REENTRANT_PROTO*) ;;
13090 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13092 echo "Prototype: $try" ;;
13095 *) case "$usethreads" in
13096 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13098 d_endservent_r=undef
13099 endservent_r_proto=0
13103 *) endservent_r_proto=0
13107 : Locate the flags for 'open()'
13110 #include <sys/types.h>
13115 #include <sys/file.h>
13117 #$i_stdlib I_STDLIB
13119 #include <stdlib.h>
13130 : check sys/file.h first to get FREAD on Sun
13131 if $test `./findhdr sys/file.h` && \
13132 set try -DI_SYS_FILE && eval $compile; then
13134 echo "<sys/file.h> defines the O_* constants..." >&4
13135 if $run ./try; then
13136 echo "and you have the 3 argument form of open()." >&4
13139 echo "but not the 3 argument form of open(). Oh, well." >&4
13142 elif $test `./findhdr fcntl.h` && \
13143 set try -DI_FCNTL && eval $compile; then
13145 echo "<fcntl.h> defines the O_* constants..." >&4
13146 if $run ./try; then
13147 echo "and you have the 3 argument form of open()." >&4
13150 echo "but not the 3 argument form of open(). Oh, well." >&4
13155 echo "I can't find the O_* constant definitions! You got problems." >&4
13161 : see if this is a sys/file.h system
13166 : do we need to include sys/file.h ?
13170 if $h_sysfile; then
13172 echo "We'll be including <sys/file.h>." >&4
13175 echo "We won't be including <sys/file.h>." >&4
13185 : see if acosh exists
13189 : see if asinh exists
13193 : see if atanh exists
13197 : see if cbrt exists
13201 : see if copysign exists
13202 set copysign d_copysign
13205 : see if erf exists
13209 : see if erfc exists
13213 : see if exp2 exists
13217 : see if expm1 exists
13221 : see if fdim exists
13225 : see if fma exists
13229 : see if fmax exists
13233 : see if fmin exists
13237 : see if hypot exists
13241 : see if ilogb exists
13245 : see if lgamma exists
13246 set lgamma d_lgamma
13249 : see if lgamma_r exists
13250 set lgamma_r d_lgamma_r
13253 : see if llrint exists
13254 set llrint d_llrint
13257 : see if llround exists
13258 set llround d_llround
13261 : see if log1p exists
13265 : see if log2 exists
13269 : see if logb exists
13273 : see if lrint exists
13277 : see if lround exists
13278 set lround d_lround
13281 : see if nan exists
13285 : see if nearbyint exists
13286 set nearbyint d_nearbyint
13289 : see if nextafter exists
13290 set nextafter d_nextafter
13293 : see if nexttoward exists
13294 set nexttoward d_nexttoward
13297 : see if remainder exists
13298 set remainder d_remainder
13301 : see if remquo exists
13302 set remquo d_remquo
13305 : see if rint exists
13309 : see if round exists
13313 : see if scalbn exists
13314 set scalbn d_scalbn
13317 : see if tgamma exists
13318 set tgamma d_tgamma
13321 : see if trunc exists
13325 : see if fcntl.h is there
13330 : see if we can include fcntl.h
13336 echo "We'll be including <fcntl.h>." >&4
13339 if $h_sysfile; then
13340 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13342 echo "We won't be including <fcntl.h>." >&4
13354 : see if fork exists
13358 : see if pipe exists
13362 : check for non-blocking I/O stuff
13363 case "$h_sysfile" in
13364 true) echo "#include <sys/file.h>" > head.c;;
13367 true) echo "#include <fcntl.h>" > head.c;;
13368 *) echo "#include <sys/fcntl.h>" > head.c;;
13373 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13374 case "$o_nonblock" in
13376 $cat head.c > try.c
13377 $cat >>try.c <<EOCP
13379 #$i_stdlib I_STDLIB
13381 #include <stdlib.h>
13389 printf("O_NONBLOCK\n");
13393 printf("O_NDELAY\n");
13397 printf("FNDELAY\n");
13404 if eval $compile_ok; then
13405 o_nonblock=`$run ./try`
13406 case "$o_nonblock" in
13407 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13408 *) echo "Seems like we can use $o_nonblock.";;
13411 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13414 *) echo "Using $hint value $o_nonblock.";;
13419 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13422 case "$d_fork:$d_pipe" in
13424 $cat head.c > try.c
13425 $cat >>try.c <<EOCP
13427 #include <sys/types.h>
13428 #include <signal.h>
13430 #$i_stdlib I_STDLIB
13432 #include <stdlib.h>
13438 #define MY_O_NONBLOCK $o_nonblock
13439 #ifndef errno /* XXX need better Configure test */
13442 #$i_unistd I_UNISTD
13444 #include <unistd.h>
13446 #$i_string I_STRING
13448 #include <string.h>
13450 #include <strings.h>
13452 $signal_t blech(int x) { exit(3); }
13454 $cat >> try.c <<'EOCP'
13463 ret = pipe(pd); /* Down: child -> parent */
13466 ret = pipe(pu); /* Up: parent -> child */
13470 close(pd[1]); /* Parent reads from pd[0] */
13471 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13473 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13478 signal(SIGALRM, blech);
13480 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13482 sprintf(string, "%d\n", ret);
13483 ret = write(2, string, strlen(string));
13484 if (ret != strlen(string))
13488 if (errno == EAGAIN) {
13489 printf("EAGAIN\n");
13494 if (errno == EWOULDBLOCK)
13495 printf("EWOULDBLOCK\n");
13498 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13501 sleep(2); /* Give it time to close our pipe */
13503 ret = read(pd[0], buf, 1); /* Should read EOF */
13505 sprintf(string, "%d\n", ret);
13506 ret = write(4, string, strlen(string));
13507 if (ret != strlen(string))
13512 close(pd[0]); /* We write to pd[1] */
13513 close(pu[1]); /* We read from pu[0] */
13514 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13517 close(pd[1]); /* Pipe pd is now fully closed! */
13518 exit(0); /* Bye bye, thank you for playing! */
13522 if eval $compile_ok; then
13523 echo "$startsh" >mtry
13524 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13526 $run ./mtry >/dev/null 2>&1
13528 0) eagain=`$cat try.out`;;
13529 1) echo "Could not perform non-blocking setting!";;
13530 2) echo "I did a successful read() for something that was not there!";;
13531 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13532 4) echo "Could not find F_SETFL!";;
13533 *) echo "Something terribly wrong happened during testing.";;
13535 rd_nodata=`$cat try.ret`
13536 echo "A read() system call with no data present returns $rd_nodata."
13537 case "$rd_nodata" in
13540 echo "(That's peculiar, fixing that to be -1.)"
13546 echo "Forcing errno EAGAIN on read() with no data available."
13550 echo "Your read() sets errno to $eagain when no data is available."
13553 status=`$cat try.err`
13555 0) echo "And it correctly returns 0 to signal EOF.";;
13556 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13557 *) echo "However, your read() returns '$status' on EOF??";;
13560 if test "$status" = "$rd_nodata"; then
13561 echo "WARNING: you can't distinguish between EOF and no data!"
13565 echo "I can't compile the test program--assuming errno EAGAIN will do."
13569 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13578 echo "Using $hint value $eagain."
13579 echo "Your read() returns $rd_nodata when no data is present."
13580 case "$d_eofnblk" in
13581 "$define") echo "And you can see EOF because read() returns 0.";;
13582 "$undef") echo "But you can't see EOF status from read() returned value.";;
13584 echo "(Assuming you can't see EOF status from read anyway.)"
13590 $rm_try head.c mtry
13592 : see if _ptr and _cnt from stdio act std
13595 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13596 echo "(Looks like you have stdio.h from BSD.)"
13597 case "$stdio_ptr" in
13598 '') stdio_ptr='((fp)->_p)'
13601 *) ptr_lval=$d_stdio_ptr_lval;;
13603 case "$stdio_cnt" in
13604 '') stdio_cnt='((fp)->_r)'
13607 *) cnt_lval=$d_stdio_cnt_lval;;
13609 case "$stdio_base" in
13610 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13612 case "$stdio_bufsiz" in
13613 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13615 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13616 echo "(Looks like you have stdio.h from Linux.)"
13617 case "$stdio_ptr" in
13618 '') stdio_ptr='((fp)->_IO_read_ptr)'
13621 *) ptr_lval=$d_stdio_ptr_lval;;
13623 case "$stdio_cnt" in
13624 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13627 *) cnt_lval=$d_stdio_cnt_lval;;
13629 case "$stdio_base" in
13630 '') stdio_base='((fp)->_IO_read_base)';;
13632 case "$stdio_bufsiz" in
13633 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13636 case "$stdio_ptr" in
13637 '') stdio_ptr='((fp)->_ptr)'
13640 *) ptr_lval=$d_stdio_ptr_lval;;
13642 case "$stdio_cnt" in
13643 '') stdio_cnt='((fp)->_cnt)'
13646 *) cnt_lval=$d_stdio_cnt_lval;;
13648 case "$stdio_base" in
13649 '') stdio_base='((fp)->_base)';;
13651 case "$stdio_bufsiz" in
13652 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13656 : test whether _ptr and _cnt really work
13657 echo "Checking how std your stdio is..." >&4
13660 #$i_stdlib I_STDLIB
13662 #include <stdlib.h>
13664 #define FILE_ptr(fp) $stdio_ptr
13665 #define FILE_cnt(fp) $stdio_cnt
13667 FILE *fp = fopen("try.c", "r");
13670 18 <= FILE_cnt(fp) &&
13671 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13679 if eval $compile && $to try.c; then
13680 if $run ./try; then
13681 echo "Your stdio acts pretty std."
13684 echo "Your stdio isn't very std."
13687 echo "Your stdio doesn't appear very std."
13691 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13692 # direct buffer manipulation no longer works. The Configure tests
13693 # should be changed to correctly detect this, but until then,
13694 # the following check should at least let perl compile and run.
13695 # (This quick fix should be updated before 5.8.1.)
13696 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13697 # A. Dougherty, June 3, 2002.
13698 case "$d_gnulibc" in
13700 case "$gnulibc_version" in
13704 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13713 : Can _ptr be used as an lvalue?
13714 case "$d_stdstdio$ptr_lval" in
13715 $define$define) val=$define ;;
13718 set d_stdio_ptr_lval
13721 : Can _cnt be used as an lvalue?
13722 case "$d_stdstdio$cnt_lval" in
13723 $define$define) val=$define ;;
13726 set d_stdio_cnt_lval
13730 : test whether setting _ptr sets _cnt as a side effect
13731 d_stdio_ptr_lval_sets_cnt="$undef"
13732 d_stdio_ptr_lval_nochange_cnt="$undef"
13733 case "$d_stdio_ptr_lval$d_stdstdio" in
13735 echo "Checking to see what happens if we set the stdio ptr..." >&4
13738 /* Can we scream? */
13739 /* Eat dust sed :-) */
13740 /* In the buffer space, no one can hear you scream. */
13741 #$i_stdlib I_STDLIB
13743 #include <stdlib.h>
13745 #define FILE_ptr(fp) $stdio_ptr
13746 #define FILE_cnt(fp) $stdio_cnt
13747 #include <sys/types.h>
13749 FILE *fp = fopen("try.c", "r");
13754 puts("Fail even to read");
13757 c = getc(fp); /* Read away the first # */
13759 puts("Fail even to read");
13763 18 <= FILE_cnt(fp) &&
13764 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13766 puts("Fail even to read");
13769 ptr = (char*) FILE_ptr(fp);
13770 cnt = (size_t)FILE_cnt(fp);
13772 FILE_ptr(fp) += 42;
13774 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13775 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13778 if (FILE_cnt(fp) <= 20) {
13779 printf ("Fail (<20 chars to test)");
13782 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13783 puts("Fail compare");
13786 if (cnt == FILE_cnt(fp)) {
13787 puts("Pass_unchanged");
13790 if (FILE_cnt(fp) == (cnt - 42)) {
13791 puts("Pass_changed");
13794 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13800 if eval $compile && $to try.c; then
13801 case `$run ./try` in
13803 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13804 d_stdio_ptr_lval_sets_cnt="$define" ;;
13806 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13807 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13809 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13811 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13814 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13820 : see if _base is also standard
13822 case "$d_stdstdio" in
13826 #$i_stdlib I_STDLIB
13828 #include <stdlib.h>
13830 #define FILE_base(fp) $stdio_base
13831 #define FILE_bufsiz(fp) $stdio_bufsiz
13833 FILE *fp = fopen("try.c", "r");
13836 19 <= FILE_bufsiz(fp) &&
13837 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13844 if eval $compile && $to try.c; then
13845 if $run ./try; then
13846 echo "And its _base field acts std."
13849 echo "But its _base field isn't std."
13852 echo "However, it seems to be lacking the _base field."
13860 : see if fast_stdio exists
13862 case "$d_stdstdio:$d_stdio_ptr_lval" in
13864 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13866 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13877 : see if fchdir exists
13878 set fchdir d_fchdir
13881 : see if fchmod exists
13882 set fchmod d_fchmod
13885 : see if fchown exists
13886 set fchown d_fchown
13889 : see if this is an fcntl system
13893 : See if fcntl-based locking works.
13896 #$i_stdlib I_STDLIB
13898 #include <stdlib.h>
13900 #include <unistd.h>
13902 #include <signal.h>
13903 $signal_t blech(int x) { exit(3); }
13905 #if defined(F_SETLK) && defined(F_SETLKW)
13906 struct flock flock;
13908 fd = open("try.c", O_RDONLY);
13909 flock.l_type = F_RDLCK;
13910 flock.l_whence = SEEK_SET;
13911 flock.l_start = flock.l_len = 0;
13912 signal(SIGALRM, blech);
13914 retval = fcntl(fd, F_SETLK, &flock);
13916 (retval < 0 ? exit(2) : exit(0));
13922 echo "Checking if fcntl-based file locking works... "
13926 if eval $compile_ok; then
13927 if $run ./try; then
13928 echo "Yes, it seems to work."
13931 echo "Nope, it didn't work."
13936 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13937 *** This is (almost) impossible.
13938 *** If your NFS lock daemons are not feeling well, something like
13939 *** this may happen, please investigate. Cannot continue, aborting.
13947 echo "I'm unable to compile the test program, so I'll assume not."
13952 echo "Nope, since you don't even have fcntl()."
13955 set d_fcntl_can_lock
13959 : check for fd_set items
13962 Checking to see how well your C compiler handles fd_set and friends ...
13965 #$i_stdlib I_STDLIB
13967 #include <stdlib.h>
13969 #$i_systime I_SYS_TIME
13970 #$i_sysselct I_SYS_SELECT
13971 #$d_socket HAS_SOCKET
13972 #include <sys/types.h>
13974 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13977 #include <sys/time.h>
13979 #ifdef I_SYS_SELECT
13980 #include <sys/select.h>
13989 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13997 if eval $compile; then
13998 d_fds_bits="$define"
14000 echo "Well, your system knows about the normal fd_set typedef..." >&4
14001 if $run ./try; then
14002 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14003 d_fd_macros="$define"
14006 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14008 d_fd_macros="$undef"
14012 Hmm, your compiler has some difficulty with fd_set. Checking further...
14015 if eval $compile; then
14016 d_fds_bits="$undef"
14018 echo "Well, your system has some sort of fd_set available..." >&4
14019 if $run ./try; then
14020 echo "and you have the normal fd_set macros." >&4
14021 d_fd_macros="$define"
14024 but not the normal fd_set macros! Gross! More work for me...
14026 d_fd_macros="$undef"
14029 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14031 d_fds_bits="$undef"
14032 d_fd_macros="$undef"
14037 : see if fegetround exists
14038 set fegetround d_fegetround
14041 : see if fgetpos exists
14042 set fgetpos d_fgetpos
14045 : see if finite exists
14046 set finite d_finite
14049 : see if finitel exists
14050 set finitel d_finitel
14053 : see if flock exists
14057 : see if prototype for flock is available
14059 set d_flockproto flock $i_sysfile sys/file.h
14062 : see if fp_class exists
14063 set fp_class d_fp_class
14066 : see if this is a math.h system
14070 : check for fpclassify
14071 echo "Checking to see if you have fpclassify..." >&4
14077 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14080 if eval $compile; then
14082 echo "You have fpclassify."
14085 echo "You do not have fpclassify."
14091 : see if fp_classify exists
14092 set fp_classify d_fp_classify
14095 : see if fp_classl exists
14096 set fp_classl d_fp_classl
14099 : see if pathconf exists
14100 set pathconf d_pathconf
14103 : see if fpathconf exists
14104 set fpathconf d_fpathconf
14107 : see if fpclass exists
14108 set fpclass d_fpclass
14111 : see if fpclassl exists
14112 set fpclassl d_fpclassl
14115 : see if fpgetround exists
14116 set fpgetround d_fpgetround
14119 : check for fpos64_t
14121 echo "Checking to see if you have fpos64_t..." >&4
14124 int main() { fpos64_t x = 7; }
14127 if eval $compile; then
14129 echo "You have fpos64_t."
14132 echo "You do not have fpos64_t."
14133 case "$fpossize" in
14134 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14141 : see if frexpl exists
14142 set frexpl d_frexpl
14145 : see if this is a sys/param system
14146 set sys/param.h i_sysparam
14149 : see if this is a sys/mount.h system
14150 set sys/mount.h i_sysmount
14153 : Check for fs_data_s
14155 echo "Checking to see if your system supports struct fs_data..." >&4
14156 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14158 case "$d_fs_data_s" in
14159 "$define") echo "Yes, it does." ;;
14160 *) echo "No, it doesn't." ;;
14163 : see if fseeko exists
14164 set fseeko d_fseeko
14166 case "$longsize" in
14167 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14170 : see if fsetpos exists
14171 set fsetpos d_fsetpos
14174 : see if fstatfs exists
14175 set fstatfs d_fstatfs
14178 : see if statvfs exists
14179 set statvfs d_statvfs
14182 : see if fstatvfs exists
14183 set fstatvfs d_fstatvfs
14187 : see if fsync exists
14191 : see if ftello exists
14192 set ftello d_ftello
14194 case "$longsize" in
14195 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14198 : check for a working futimes
14201 echo "Checking if you have a working futimes()" >&4
14204 #include <sys/time.h>
14211 fd = open ("try.c", O_RDWR);
14212 if (-1 == fd) exit (1);
14213 rv = futimes (fd, NULL);
14214 exit (rv == -1 ? errno : 0);
14218 if eval $compile; then
14222 0) echo "Yes, you have" >&4
14223 d_futimes="$define"
14225 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14229 echo "No, it does not (probably harmless)" >&4
14233 : see if ndbm.h is available
14236 : Compatibility location for RedHat 7.1
14237 set gdbm/ndbm.h i_gdbmndbm
14239 : Compatibility location for Debian 4.0
14240 set gdbm-ndbm.h i_gdbm_ndbm
14244 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14245 : see if dbm_open exists
14246 set dbm_open d_dbm_open
14248 case "$d_dbm_open" in
14251 i_gdbmndbm="$undef"
14252 i_gdbm_ndbm="$undef"
14253 echo "We won't be including <ndbm.h>"
14263 ndbm_hdr_protochk='name=$1; hdr=$2;
14264 eval "ihdr=\$""i_$name";
14266 if $test "$ihdr" = "$define"; then
14267 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14268 case "$d_cplusplus" in
14269 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14270 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14273 $define) $echo "Your <$hdr> seems to have prototypes";;
14274 *) $echo "Your <$hdr> does not seem to have prototypes";;
14277 set "d_${name}_h_uses_prototypes";
14281 eval $ndbm_hdr_protochk
14282 set gdbmndbm gdbm/ndbm.h
14283 eval $ndbm_hdr_protochk
14284 set gdbm_ndbm gdbm-ndbm.h
14285 eval $ndbm_hdr_protochk
14287 : see if getaddrinfo exists
14288 set getaddrinfo d_getaddrinfo
14291 : see if getcwd exists
14292 set getcwd d_getcwd
14295 : see if getespwnam exists
14296 set getespwnam d_getespwnam
14299 : see if getfsstat exists
14300 set getfsstat d_getfsstat
14303 : see if getgrent exists
14304 set getgrent d_getgrent
14307 : see if getgrent_r exists
14308 set getgrent_r d_getgrent_r
14310 case "$d_getgrent_r" in
14312 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14313 case "$d_getgrent_r_proto:$usethreads" in
14314 ":define") d_getgrent_r_proto=define
14315 set d_getgrent_r_proto getgrent_r $hdrs
14319 case "$d_getgrent_r_proto" in
14321 case "$getgrent_r_proto" in
14322 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14323 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14325 case "$getgrent_r_proto" in
14326 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14327 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14329 case "$getgrent_r_proto" in
14330 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14331 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14333 case "$getgrent_r_proto" in
14334 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14335 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14337 case "$getgrent_r_proto" in
14338 ''|0) try='int getgrent_r(struct group*, char*, int);'
14339 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14341 case "$getgrent_r_proto" in
14342 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14343 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14345 case "$getgrent_r_proto" in
14346 ''|0) d_getgrent_r=undef
14348 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14349 * ) case "$getgrent_r_proto" in
14350 REENTRANT_PROTO*) ;;
14351 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14353 echo "Prototype: $try" ;;
14356 *) case "$usethreads" in
14357 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14364 *) getgrent_r_proto=0
14368 : see if getgrgid_r exists
14369 set getgrgid_r d_getgrgid_r
14371 case "$d_getgrgid_r" in
14373 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14374 case "$d_getgrgid_r_proto:$usethreads" in
14375 ":define") d_getgrgid_r_proto=define
14376 set d_getgrgid_r_proto getgrgid_r $hdrs
14380 case "$d_getgrgid_r_proto" in
14382 case "$getgrgid_r_proto" in
14383 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14384 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14386 case "$getgrgid_r_proto" in
14387 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14388 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14390 case "$getgrgid_r_proto" in
14391 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14392 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14394 case "$getgrgid_r_proto" in
14395 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14396 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14398 case "$getgrgid_r_proto" in
14399 ''|0) d_getgrgid_r=undef
14401 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14402 * ) case "$getgrgid_r_proto" in
14403 REENTRANT_PROTO*) ;;
14404 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14406 echo "Prototype: $try" ;;
14409 *) case "$usethreads" in
14410 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14417 *) getgrgid_r_proto=0
14421 : see if getgrnam_r exists
14422 set getgrnam_r d_getgrnam_r
14424 case "$d_getgrnam_r" in
14426 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14427 case "$d_getgrnam_r_proto:$usethreads" in
14428 ":define") d_getgrnam_r_proto=define
14429 set d_getgrnam_r_proto getgrnam_r $hdrs
14433 case "$d_getgrnam_r_proto" in
14435 case "$getgrnam_r_proto" in
14436 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14437 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14439 case "$getgrnam_r_proto" in
14440 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14441 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14443 case "$getgrnam_r_proto" in
14444 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14445 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14447 case "$getgrnam_r_proto" in
14448 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14449 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14451 case "$getgrnam_r_proto" in
14452 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14453 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14455 case "$getgrnam_r_proto" in
14456 ''|0) d_getgrnam_r=undef
14458 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14459 * ) case "$getgrnam_r_proto" in
14460 REENTRANT_PROTO*) ;;
14461 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14463 echo "Prototype: $try" ;;
14466 *) case "$usethreads" in
14467 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14474 *) getgrnam_r_proto=0
14478 : see if gethostbyaddr exists
14479 set gethostbyaddr d_gethbyaddr
14482 : see if gethostbyname exists
14483 set gethostbyname d_gethbyname
14486 : see if gethostent exists
14487 set gethostent d_gethent
14490 : see how we will look up host name
14493 if set gethostname val -f d_gethname; eval $csym; $val; then
14494 echo 'gethostname() found.' >&4
14495 d_gethname="$define"
14498 if set uname val -f d_uname; eval $csym; $val; then
14501 uname() was found, but you're running xenix, and older versions of xenix
14502 have a broken uname(). If you don't really know whether your xenix is old
14503 enough to have a broken system call, use the default answer.
14508 "$define") dflt=n;;
14510 rp='Is your uname() broken?'
14513 n*) d_uname="$define"; call=uname;;
14516 echo 'uname() found.' >&4
14523 case "$d_gethname" in
14524 '') d_gethname="$undef";;
14527 '') d_uname="$undef";;
14529 case "$d_uname$d_gethname" in
14534 Every now and then someone has a $call() that lies about the hostname
14535 but can't be fixed for political or economic reasons. If you wish, I can
14536 pretend $call() isn't there and maybe compute hostname at run-time
14537 thanks to the '$phostname' command.
14540 rp="Shall I ignore $call() from now on?"
14543 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14546 case "$phostname" in
14547 '') aphostname='';;
14548 *) case "$aphostname" in
14550 *) set X $phostname
14554 file=`./loc $file $file $pth`
14555 aphostname=`echo $file $*`
14560 case "$d_uname$d_gethname" in
14563 case "$phostname" in
14565 echo "There will be no way for $package to get your hostname." >&4;;
14567 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14571 case "$d_phostname" in
14572 '') d_phostname="$undef";;
14575 : see if gethostbyaddr_r exists
14576 set gethostbyaddr_r d_gethostbyaddr_r
14578 case "$d_gethostbyaddr_r" in
14580 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14581 case "$d_gethostbyaddr_r_proto:$usethreads" in
14582 ":define") d_gethostbyaddr_r_proto=define
14583 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14587 case "$d_gethostbyaddr_r_proto" in
14589 case "$gethostbyaddr_r_proto" in
14590 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14591 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14593 case "$gethostbyaddr_r_proto" in
14594 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14595 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14597 case "$gethostbyaddr_r_proto" in
14598 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14599 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14601 case "$gethostbyaddr_r_proto" in
14602 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14603 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14605 case "$gethostbyaddr_r_proto" in
14606 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14607 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14609 case "$gethostbyaddr_r_proto" in
14610 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14611 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14613 case "$gethostbyaddr_r_proto" in
14614 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14615 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14617 case "$gethostbyaddr_r_proto" in
14618 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14619 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14621 case "$gethostbyaddr_r_proto" in
14622 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14623 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14625 case "$gethostbyaddr_r_proto" in
14626 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14627 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14629 case "$gethostbyaddr_r_proto" in
14630 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14631 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14633 case "$gethostbyaddr_r_proto" in
14634 ''|0) d_gethostbyaddr_r=undef
14635 gethostbyaddr_r_proto=0
14636 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14637 * ) case "$gethostbyaddr_r_proto" in
14638 REENTRANT_PROTO*) ;;
14639 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14641 echo "Prototype: $try" ;;
14644 *) case "$usethreads" in
14645 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14647 d_gethostbyaddr_r=undef
14648 gethostbyaddr_r_proto=0
14652 *) gethostbyaddr_r_proto=0
14656 : see if gethostbyname_r exists
14657 set gethostbyname_r d_gethostbyname_r
14659 case "$d_gethostbyname_r" in
14661 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14662 case "$d_gethostbyname_r_proto:$usethreads" in
14663 ":define") d_gethostbyname_r_proto=define
14664 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14668 case "$d_gethostbyname_r_proto" in
14670 case "$gethostbyname_r_proto" in
14671 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14672 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14674 case "$gethostbyname_r_proto" in
14675 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14676 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14678 case "$gethostbyname_r_proto" in
14679 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14680 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14682 case "$gethostbyname_r_proto" in
14683 ''|0) d_gethostbyname_r=undef
14684 gethostbyname_r_proto=0
14685 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14686 * ) case "$gethostbyname_r_proto" in
14687 REENTRANT_PROTO*) ;;
14688 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14690 echo "Prototype: $try" ;;
14693 *) case "$usethreads" in
14694 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14696 d_gethostbyname_r=undef
14697 gethostbyname_r_proto=0
14701 *) gethostbyname_r_proto=0
14705 : see if gethostent_r exists
14706 set gethostent_r d_gethostent_r
14708 case "$d_gethostent_r" in
14710 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14711 case "$d_gethostent_r_proto:$usethreads" in
14712 ":define") d_gethostent_r_proto=define
14713 set d_gethostent_r_proto gethostent_r $hdrs
14717 case "$d_gethostent_r_proto" in
14719 case "$gethostent_r_proto" in
14720 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14721 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14723 case "$gethostent_r_proto" in
14724 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14725 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14727 case "$gethostent_r_proto" in
14728 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14729 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14731 case "$gethostent_r_proto" in
14732 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14733 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14735 case "$gethostent_r_proto" in
14736 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14737 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14739 case "$gethostent_r_proto" in
14740 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14741 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14743 case "$gethostent_r_proto" in
14744 ''|0) d_gethostent_r=undef
14745 gethostent_r_proto=0
14746 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14747 * ) case "$gethostent_r_proto" in
14748 REENTRANT_PROTO*) ;;
14749 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14751 echo "Prototype: $try" ;;
14754 *) case "$usethreads" in
14755 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14757 d_gethostent_r=undef
14758 gethostent_r_proto=0
14762 *) gethostent_r_proto=0
14766 : see if prototypes for various gethostxxx netdb.h functions are available
14768 set d_gethostprotos gethostent $i_netdb netdb.h
14771 : see if getitimer exists
14772 set getitimer d_getitimer
14775 : see if getlogin exists
14776 set getlogin d_getlogin
14779 : see if getlogin_r exists
14780 set getlogin_r d_getlogin_r
14782 case "$d_getlogin_r" in
14784 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14785 case "$d_getlogin_r_proto:$usethreads" in
14786 ":define") d_getlogin_r_proto=define
14787 set d_getlogin_r_proto getlogin_r $hdrs
14791 case "$d_getlogin_r_proto" in
14793 case "$getlogin_r_proto" in
14794 ''|0) try='int getlogin_r(char*, size_t);'
14795 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14797 case "$getlogin_r_proto" in
14798 ''|0) try='int getlogin_r(char*, int);'
14799 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14801 case "$getlogin_r_proto" in
14802 ''|0) try='char* getlogin_r(char*, size_t);'
14803 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14805 case "$getlogin_r_proto" in
14806 ''|0) try='char* getlogin_r(char*, int);'
14807 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14809 case "$getlogin_r_proto" in
14810 ''|0) d_getlogin_r=undef
14812 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14813 * ) case "$getlogin_r_proto" in
14814 REENTRANT_PROTO*) ;;
14815 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14817 echo "Prototype: $try" ;;
14820 *) case "$usethreads" in
14821 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14828 *) getlogin_r_proto=0
14832 : see if getmnt exists
14833 set getmnt d_getmnt
14836 : see if getmntent exists
14837 set getmntent d_getmntent
14840 : see if getnameinfo exists
14841 set getnameinfo d_getnameinfo
14844 : see if getnetbyaddr exists
14845 set getnetbyaddr d_getnbyaddr
14848 : see if getnetbyname exists
14849 set getnetbyname d_getnbyname
14852 : see if getnetent exists
14853 set getnetent d_getnent
14856 : see if getnetbyaddr_r exists
14857 set getnetbyaddr_r d_getnetbyaddr_r
14859 case "$d_getnetbyaddr_r" in
14861 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14862 case "$d_getnetbyaddr_r_proto:$usethreads" in
14863 ":define") d_getnetbyaddr_r_proto=define
14864 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14868 case "$d_getnetbyaddr_r_proto" in
14870 case "$getnetbyaddr_r_proto" in
14871 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14872 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14874 case "$getnetbyaddr_r_proto" in
14875 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14876 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14878 case "$getnetbyaddr_r_proto" in
14879 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14880 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14882 case "$getnetbyaddr_r_proto" in
14883 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14884 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14886 case "$getnetbyaddr_r_proto" in
14887 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14888 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14890 case "$getnetbyaddr_r_proto" in
14891 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14892 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14894 case "$getnetbyaddr_r_proto" in
14895 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14896 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14898 case "$getnetbyaddr_r_proto" in
14899 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14900 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14902 case "$getnetbyaddr_r_proto" in
14903 ''|0) d_getnetbyaddr_r=undef
14904 getnetbyaddr_r_proto=0
14905 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14906 * ) case "$getnetbyaddr_r_proto" in
14907 REENTRANT_PROTO*) ;;
14908 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14910 echo "Prototype: $try" ;;
14913 *) case "$usethreads" in
14914 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14916 d_getnetbyaddr_r=undef
14917 getnetbyaddr_r_proto=0
14921 *) getnetbyaddr_r_proto=0
14925 : see if getnetbyname_r exists
14926 set getnetbyname_r d_getnetbyname_r
14928 case "$d_getnetbyname_r" in
14930 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14931 case "$d_getnetbyname_r_proto:$usethreads" in
14932 ":define") d_getnetbyname_r_proto=define
14933 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14937 case "$d_getnetbyname_r_proto" in
14939 case "$getnetbyname_r_proto" in
14940 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14941 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14943 case "$getnetbyname_r_proto" in
14944 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14945 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14947 case "$getnetbyname_r_proto" in
14948 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14949 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14951 case "$getnetbyname_r_proto" in
14952 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14953 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14955 case "$getnetbyname_r_proto" in
14956 ''|0) d_getnetbyname_r=undef
14957 getnetbyname_r_proto=0
14958 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14959 * ) case "$getnetbyname_r_proto" in
14960 REENTRANT_PROTO*) ;;
14961 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14963 echo "Prototype: $try" ;;
14966 *) case "$usethreads" in
14967 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14969 d_getnetbyname_r=undef
14970 getnetbyname_r_proto=0
14974 *) getnetbyname_r_proto=0
14978 : see if getnetent_r exists
14979 set getnetent_r d_getnetent_r
14981 case "$d_getnetent_r" in
14983 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14984 case "$d_getnetent_r_proto:$usethreads" in
14985 ":define") d_getnetent_r_proto=define
14986 set d_getnetent_r_proto getnetent_r $hdrs
14990 case "$d_getnetent_r_proto" in
14992 case "$getnetent_r_proto" in
14993 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14994 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14996 case "$getnetent_r_proto" in
14997 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14998 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15000 case "$getnetent_r_proto" in
15001 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15002 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15004 case "$getnetent_r_proto" in
15005 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15006 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15008 case "$getnetent_r_proto" in
15009 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15010 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15012 case "$getnetent_r_proto" in
15013 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15014 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15016 case "$getnetent_r_proto" in
15017 ''|0) d_getnetent_r=undef
15018 getnetent_r_proto=0
15019 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15020 * ) case "$getnetent_r_proto" in
15021 REENTRANT_PROTO*) ;;
15022 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15024 echo "Prototype: $try" ;;
15027 *) case "$usethreads" in
15028 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15030 d_getnetent_r=undef
15031 getnetent_r_proto=0
15035 *) getnetent_r_proto=0
15039 : see if prototypes for various getnetxxx netdb.h functions are available
15041 set d_getnetprotos getnetent $i_netdb netdb.h
15044 : see if getpagesize exists
15045 set getpagesize d_getpagsz
15048 : Optional checks for getprotobyname and getprotobynumber
15050 : see if getprotobyname exists
15051 set getprotobyname d_getpbyname
15054 : see if getprotobynumber exists
15055 set getprotobynumber d_getpbynumber
15058 : see if getprotoent exists
15059 set getprotoent d_getpent
15062 : see if getpgid exists
15063 set getpgid d_getpgid
15066 : see if getpgrp2 exists
15067 set getpgrp2 d_getpgrp2
15070 : see if getppid exists
15071 set getppid d_getppid
15074 : see if getpriority exists
15075 set getpriority d_getprior
15078 : see if getprotobyname_r exists
15079 set getprotobyname_r d_getprotobyname_r
15081 case "$d_getprotobyname_r" in
15083 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15084 case "$d_getprotobyname_r_proto:$usethreads" in
15085 ":define") d_getprotobyname_r_proto=define
15086 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15090 case "$d_getprotobyname_r_proto" in
15092 case "$getprotobyname_r_proto" in
15093 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15094 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15096 case "$getprotobyname_r_proto" in
15097 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15098 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15100 case "$getprotobyname_r_proto" in
15101 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15102 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15104 case "$getprotobyname_r_proto" in
15105 ''|0) d_getprotobyname_r=undef
15106 getprotobyname_r_proto=0
15107 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15108 * ) case "$getprotobyname_r_proto" in
15109 REENTRANT_PROTO*) ;;
15110 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15112 echo "Prototype: $try" ;;
15115 *) case "$usethreads" in
15116 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15118 d_getprotobyname_r=undef
15119 getprotobyname_r_proto=0
15123 *) getprotobyname_r_proto=0
15127 : see if getprotobynumber_r exists
15128 set getprotobynumber_r d_getprotobynumber_r
15130 case "$d_getprotobynumber_r" in
15132 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15133 case "$d_getprotobynumber_r_proto:$usethreads" in
15134 ":define") d_getprotobynumber_r_proto=define
15135 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15139 case "$d_getprotobynumber_r_proto" in
15141 case "$getprotobynumber_r_proto" in
15142 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15143 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15145 case "$getprotobynumber_r_proto" in
15146 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15147 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15149 case "$getprotobynumber_r_proto" in
15150 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15151 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15153 case "$getprotobynumber_r_proto" in
15154 ''|0) d_getprotobynumber_r=undef
15155 getprotobynumber_r_proto=0
15156 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15157 * ) case "$getprotobynumber_r_proto" in
15158 REENTRANT_PROTO*) ;;
15159 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15161 echo "Prototype: $try" ;;
15164 *) case "$usethreads" in
15165 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15167 d_getprotobynumber_r=undef
15168 getprotobynumber_r_proto=0
15172 *) getprotobynumber_r_proto=0
15176 : see if getprotoent_r exists
15177 set getprotoent_r d_getprotoent_r
15179 case "$d_getprotoent_r" in
15181 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15182 case "$d_getprotoent_r_proto:$usethreads" in
15183 ":define") d_getprotoent_r_proto=define
15184 set d_getprotoent_r_proto getprotoent_r $hdrs
15188 case "$d_getprotoent_r_proto" in
15190 case "$getprotoent_r_proto" in
15191 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15192 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15194 case "$getprotoent_r_proto" in
15195 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15196 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15198 case "$getprotoent_r_proto" in
15199 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15200 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15202 case "$getprotoent_r_proto" in
15203 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15204 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15206 case "$getprotoent_r_proto" in
15207 ''|0) d_getprotoent_r=undef
15208 getprotoent_r_proto=0
15209 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15210 * ) case "$getprotoent_r_proto" in
15211 REENTRANT_PROTO*) ;;
15212 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15214 echo "Prototype: $try" ;;
15217 *) case "$usethreads" in
15218 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15220 d_getprotoent_r=undef
15221 getprotoent_r_proto=0
15225 *) getprotoent_r_proto=0
15229 : see if prototypes for various getprotoxxx netdb.h functions are available
15231 set d_getprotoprotos getprotoent $i_netdb netdb.h
15234 : see if getprpwnam exists
15235 set getprpwnam d_getprpwnam
15238 : see if getpwent exists
15239 set getpwent d_getpwent
15242 : see if getpwent_r exists
15243 set getpwent_r d_getpwent_r
15245 case "$d_getpwent_r" in
15247 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15248 case "$d_getpwent_r_proto:$usethreads" in
15249 ":define") d_getpwent_r_proto=define
15250 set d_getpwent_r_proto getpwent_r $hdrs
15254 case "$d_getpwent_r_proto" in
15256 case "$getpwent_r_proto" in
15257 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15258 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15260 case "$getpwent_r_proto" in
15261 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15262 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15264 case "$getpwent_r_proto" in
15265 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15266 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15268 case "$getpwent_r_proto" in
15269 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15270 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15272 case "$getpwent_r_proto" in
15273 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15274 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15276 case "$getpwent_r_proto" in
15277 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15278 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15280 case "$getpwent_r_proto" in
15281 ''|0) d_getpwent_r=undef
15283 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15284 * ) case "$getpwent_r_proto" in
15285 REENTRANT_PROTO*) ;;
15286 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15288 echo "Prototype: $try" ;;
15291 *) case "$usethreads" in
15292 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15299 *) getpwent_r_proto=0
15303 : see if getpwnam_r exists
15304 set getpwnam_r d_getpwnam_r
15306 case "$d_getpwnam_r" in
15308 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15309 case "$d_getpwnam_r_proto:$usethreads" in
15310 ":define") d_getpwnam_r_proto=define
15311 set d_getpwnam_r_proto getpwnam_r $hdrs
15315 case "$d_getpwnam_r_proto" in
15317 case "$getpwnam_r_proto" in
15318 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15319 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15321 case "$getpwnam_r_proto" in
15322 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15323 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15325 case "$getpwnam_r_proto" in
15326 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15327 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15329 case "$getpwnam_r_proto" in
15330 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15331 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15333 case "$getpwnam_r_proto" in
15334 ''|0) d_getpwnam_r=undef
15336 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15337 * ) case "$getpwnam_r_proto" in
15338 REENTRANT_PROTO*) ;;
15339 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15341 echo "Prototype: $try" ;;
15344 *) case "$usethreads" in
15345 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15352 *) getpwnam_r_proto=0
15356 : see if getpwuid_r exists
15357 set getpwuid_r d_getpwuid_r
15359 case "$d_getpwuid_r" in
15361 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15362 case "$d_getpwuid_r_proto:$usethreads" in
15363 ":define") d_getpwuid_r_proto=define
15364 set d_getpwuid_r_proto getpwuid_r $hdrs
15368 case "$d_getpwuid_r_proto" in
15370 case "$getpwuid_r_proto" in
15371 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15372 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15374 case "$getpwuid_r_proto" in
15375 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15376 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15378 case "$getpwuid_r_proto" in
15379 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15380 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15382 case "$getpwuid_r_proto" in
15383 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15384 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15386 case "$getpwuid_r_proto" in
15387 ''|0) d_getpwuid_r=undef
15389 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15390 * ) case "$getpwuid_r_proto" in
15391 REENTRANT_PROTO*) ;;
15392 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15394 echo "Prototype: $try" ;;
15397 *) case "$usethreads" in
15398 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15405 *) getpwuid_r_proto=0
15409 : Optional checks for getsbyname and getsbyport
15411 : see if getservbyname exists
15412 set getservbyname d_getsbyname
15415 : see if getservbyport exists
15416 set getservbyport d_getsbyport
15419 : see if getservent exists
15420 set getservent d_getsent
15423 : see if getservbyname_r exists
15424 set getservbyname_r d_getservbyname_r
15426 case "$d_getservbyname_r" in
15428 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15429 case "$d_getservbyname_r_proto:$usethreads" in
15430 ":define") d_getservbyname_r_proto=define
15431 set d_getservbyname_r_proto getservbyname_r $hdrs
15435 case "$d_getservbyname_r_proto" in
15437 case "$getservbyname_r_proto" in
15438 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15439 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15441 case "$getservbyname_r_proto" in
15442 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15443 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15445 case "$getservbyname_r_proto" in
15446 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15447 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15449 case "$getservbyname_r_proto" in
15450 ''|0) d_getservbyname_r=undef
15451 getservbyname_r_proto=0
15452 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15453 * ) case "$getservbyname_r_proto" in
15454 REENTRANT_PROTO*) ;;
15455 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15457 echo "Prototype: $try" ;;
15460 *) case "$usethreads" in
15461 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15463 d_getservbyname_r=undef
15464 getservbyname_r_proto=0
15468 *) getservbyname_r_proto=0
15472 : see if getservbyport_r exists
15473 set getservbyport_r d_getservbyport_r
15475 case "$d_getservbyport_r" in
15477 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15478 case "$d_getservbyport_r_proto:$usethreads" in
15479 ":define") d_getservbyport_r_proto=define
15480 set d_getservbyport_r_proto getservbyport_r $hdrs
15484 case "$d_getservbyport_r_proto" in
15486 case "$getservbyport_r_proto" in
15487 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15488 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15490 case "$getservbyport_r_proto" in
15491 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15492 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15494 case "$getservbyport_r_proto" in
15495 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15496 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15498 case "$getservbyport_r_proto" in
15499 ''|0) d_getservbyport_r=undef
15500 getservbyport_r_proto=0
15501 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15502 * ) case "$getservbyport_r_proto" in
15503 REENTRANT_PROTO*) ;;
15504 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15506 echo "Prototype: $try" ;;
15509 *) case "$usethreads" in
15510 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15512 d_getservbyport_r=undef
15513 getservbyport_r_proto=0
15517 *) getservbyport_r_proto=0
15521 : see if getservent_r exists
15522 set getservent_r d_getservent_r
15524 case "$d_getservent_r" in
15526 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15527 case "$d_getservent_r_proto:$usethreads" in
15528 ":define") d_getservent_r_proto=define
15529 set d_getservent_r_proto getservent_r $hdrs
15533 case "$d_getservent_r_proto" in
15535 case "$getservent_r_proto" in
15536 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15537 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15539 case "$getservent_r_proto" in
15540 ''|0) try='int getservent_r(struct servent*, char*, int);'
15541 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15543 case "$getservent_r_proto" in
15544 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15545 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15547 case "$getservent_r_proto" in
15548 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15549 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15551 case "$getservent_r_proto" in
15552 ''|0) d_getservent_r=undef
15553 getservent_r_proto=0
15554 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15555 * ) case "$getservent_r_proto" in
15556 REENTRANT_PROTO*) ;;
15557 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15559 echo "Prototype: $try" ;;
15562 *) case "$usethreads" in
15563 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15565 d_getservent_r=undef
15566 getservent_r_proto=0
15570 *) getservent_r_proto=0
15574 : see if prototypes for various getservxxx netdb.h functions are available
15576 set d_getservprotos getservent $i_netdb netdb.h
15579 : see if getspnam exists
15580 set getspnam d_getspnam
15583 : see if this is a shadow.h system
15584 set shadow.h i_shadow
15587 : see if getspnam_r exists
15588 set getspnam_r d_getspnam_r
15590 case "$d_getspnam_r" in
15592 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15593 case "$d_getspnam_r_proto:$usethreads" in
15594 ":define") d_getspnam_r_proto=define
15595 set d_getspnam_r_proto getspnam_r $hdrs
15599 case "$d_getspnam_r_proto" in
15601 case "$getspnam_r_proto" in
15602 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15603 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15605 case "$getspnam_r_proto" in
15606 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15607 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15609 case "$getspnam_r_proto" in
15610 ''|0) d_getspnam_r=undef
15612 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15613 * ) case "$getspnam_r_proto" in
15614 REENTRANT_PROTO*) ;;
15615 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15617 echo "Prototype: $try" ;;
15620 *) case "$usethreads" in
15621 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15628 *) getspnam_r_proto=0
15632 : see if gettimeofday or ftime exists
15633 set gettimeofday d_gettimeod
15635 case "$d_gettimeod" in
15641 val="$undef"; set d_ftime; eval $setvar
15644 case "$d_gettimeod$d_ftime" in
15647 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15651 : see if gmtime_r exists
15652 set gmtime_r d_gmtime_r
15654 case "$d_gmtime_r" in
15656 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15657 case "$d_gmtime_r_proto:$usethreads" in
15658 ":define") d_gmtime_r_proto=define
15659 set d_gmtime_r_proto gmtime_r $hdrs
15663 case "$d_gmtime_r_proto" in
15665 case "$gmtime_r_proto" in
15666 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15667 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15669 case "$gmtime_r_proto" in
15670 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15671 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15673 case "$gmtime_r_proto" in
15674 ''|0) d_gmtime_r=undef
15676 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15677 * ) case "$gmtime_r_proto" in
15678 REENTRANT_PROTO*) ;;
15679 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15681 echo "Prototype: $try" ;;
15684 *) case "$usethreads" in
15685 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15692 *) gmtime_r_proto=0
15696 : see if hasmntopt exists
15697 set hasmntopt d_hasmntopt
15700 : see if this is a netinet/in.h or sys/in.h system
15701 set netinet/in.h i_niin sys/in.h i_sysin
15704 : see if arpa/inet.h has to be included
15705 set arpa/inet.h i_arpainet
15708 : see if htonl --and friends-- exists
15713 : Maybe they are macros.
15716 $cat >htonl.c <<EOM
15718 #include <sys/types.h>
15719 #$i_niin I_NETINET_IN
15721 #$i_arpainet I_ARPA_INET
15722 #ifdef I_NETINET_IN
15723 #include <netinet/in.h>
15726 #include <sys/in.h>
15729 #include <arpa/inet.h>
15732 printf("Defined as a macro.");
15735 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15736 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15738 echo "But it seems to be defined as a macro." >&4
15746 : see if ilogbl exists
15747 set ilogbl d_ilogbl
15752 if set index val -f; eval $csym; $val; then
15753 if set strchr val -f d_strchr; eval $csym; $val; then
15754 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15757 echo "strchr() found." >&4
15761 echo "index() found." >&4
15766 echo "index() found." >&4
15769 if set strchr val -f d_strchr; eval $csym; $val; then
15772 echo "strchr() found." >&4
15774 echo "No index() or strchr() found!" >&4
15779 set d_strchr; eval $setvar
15781 set d_index; eval $setvar
15783 : check whether inet_aton exists
15784 set inet_aton d_inetaton
15787 : see if inet_ntop exists
15788 set inet_ntop d_inetntop
15791 : see if inet_pton exists
15792 set inet_pton d_inetpton
15797 $cat >isascii.c <<EOCP
15800 #$i_stdlib I_STDLIB
15802 #include <stdlib.h>
15813 if eval $compile; then
15814 echo "isascii() found." >&4
15817 echo "isascii() NOT found." >&4
15826 $cat >isblank.c <<'EOCP'
15837 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15838 echo "isblank() found." >&4
15841 echo "isblank() NOT found." >&4
15848 : check for isfinite
15849 echo "Checking to see if you have isfinite..." >&4
15855 int main() { return isfinite(0.0); }
15858 if eval $compile; then
15860 echo "You have isfinite."
15863 echo "You do not have isfinite."
15869 : see if isfinitel exists
15870 set isfinitel d_isfinitel
15874 echo "Checking to see if you have isinf..." >&4
15880 int main() { return isinf(0.0); }
15883 if eval $compile; then
15885 echo "You have isinf."
15888 echo "You do not have isinf."
15894 : see if isinfl exists
15895 set isinfl d_isinfl
15899 echo "Checking to see if you have isless..." >&4
15905 int main() { return isless(0.0); }
15908 if eval $compile; then
15910 echo "You have isless."
15913 echo "You do not have isless."
15920 echo "Checking to see if you have isnan..." >&4
15926 int main() { return isnan(0.0); }
15929 if eval $compile; then
15931 echo "You have isnan."
15934 echo "You do not have isnan."
15940 : see if isnanl exists
15941 set isnanl d_isnanl
15944 : check for isnormal
15945 echo "Checking to see if you have isnormal..." >&4
15951 int main() { return isnormal(0.0); }
15954 if eval $compile; then
15956 echo "You have isnormal."
15959 echo "You do not have isnormal."
15969 : see if j0l exists
15973 : see if killpg exists
15974 set killpg d_killpg
15977 : see if lchown exists
15979 $cat > try.c <<'EOCP'
15980 /* System header to define __stub macros and hopefully few prototypes,
15981 which can conflict with char lchown(); below. */
15982 #include <assert.h>
15983 /* Override any gcc2 internal prototype to avoid an error. */
15984 /* We use char because int might match the return type of a gcc2
15985 builtin and then its argument prototype would still apply. */
15988 /* The GNU C library defines this for functions which it implements
15989 to always fail with ENOSYS. Some functions are actually named
15990 something starting with __ and the normal name is an alias. */
15991 #if defined (__stub_lchown) || defined (__stub___lchown)
15999 if eval $compile; then
16000 $echo "lchown() found." >&4
16003 $echo "lchown() NOT found." >&4
16009 : See if number of significant digits in a double precision number is known
16011 $cat >ldbl_dig.c <<EOM
16012 #$i_limits I_LIMITS
16015 #include <limits.h>
16021 printf("Contains LDBL_DIG");
16024 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16025 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16026 echo "LDBL_DIG found." >&4
16029 echo "LDBL_DIG NOT found." >&4
16036 : check to see if math.h defines _LIB_VERSION
16037 d_libm_lib_version="$undef"
16041 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16043 #include <unistd.h>
16045 int main (int argc, char *argv[])
16047 printf ("%d\n", _LIB_VERSION);
16052 if eval $compile; then
16054 echo "Yes, it does ($foo)" >&4
16055 d_libm_lib_version="$define"
16057 echo "No, it does not (probably harmless)" >&4
16064 : check for fpclassify
16066 echo "Checking to see if you have fpclassify..." >&4
16072 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
16075 if eval $compile; then
16077 echo "You have fpclassify."
16080 echo "You do not have fpclassify."
16086 : check for isfinite
16088 echo "Checking to see if you have isfinite..." >&4
16094 int main() { return isfinite(0.0); }
16097 if eval $compile; then
16099 echo "You have isfinite."
16102 echo "You do not have isfinite."
16110 echo "Checking to see if you have isinf..." >&4
16116 int main() { return isinf(0.0); }
16119 if eval $compile; then
16121 echo "You have isinf."
16124 echo "You do not have isinf."
16132 echo "Checking to see if you have isnan..." >&4
16138 int main() { return isnan(0.0); }
16141 if eval $compile; then
16143 echo "You have isnan."
16146 echo "You do not have isnan."
16152 : see if this is a quadmath.h system
16153 set quadmath.h i_quadmath
16156 : see if link exists
16160 : see if localtime_r exists
16161 set localtime_r d_localtime_r
16163 case "$d_localtime_r" in
16165 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16166 case "$d_localtime_r_proto:$usethreads" in
16167 ":define") d_localtime_r_proto=define
16168 set d_localtime_r_proto localtime_r $hdrs
16172 case "$d_localtime_r_proto" in
16174 case "$localtime_r_proto" in
16175 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16176 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16178 case "$localtime_r_proto" in
16179 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16180 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16182 case "$localtime_r_proto" in
16183 ''|0) d_localtime_r=undef
16184 localtime_r_proto=0
16185 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16186 * ) case "$localtime_r_proto" in
16187 REENTRANT_PROTO*) ;;
16188 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16190 echo "Prototype: $try" ;;
16193 *) case "$usethreads" in
16194 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16196 d_localtime_r=undef
16197 localtime_r_proto=0
16201 *) localtime_r_proto=0
16205 : see if localtime_r calls tzset
16206 case "$localtime_r_proto" in
16209 /* Does our libc's localtime_r call tzset ?
16210 * return 0 if so, 1 otherwise.
16212 #$i_systypes I_SYS_TYPES
16213 #$i_unistd I_UNISTD
16215 #$i_stdlib I_STDLIB
16216 #$i_string I_STRING
16217 #$i_malloc I_MALLOC
16219 # include <sys/types.h>
16222 # include <unistd.h>
16228 #include <stdlib.h>
16231 # include <string.h>
16233 # include <strings.h>
16236 # include <malloc.h>
16240 time_t t = time(0L);
16241 char w_tz[]="TZ" "=GMT+5",
16242 e_tz[]="TZ" "=GMT-5",
16243 *tz_e = (char*)malloc(16),
16244 *tz_w = (char*)malloc(16);
16245 struct tm tm_e, tm_w;
16246 memset(&tm_e,'\0',sizeof(struct tm));
16247 memset(&tm_w,'\0',sizeof(struct tm));
16252 localtime_r(&t, &tm_e);
16255 localtime_r(&t, &tm_w);
16257 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16263 if eval $compile; then
16264 if $run ./try; then
16265 d_localtime_r_needs_tzset=undef;
16267 d_localtime_r_needs_tzset=define;
16270 d_localtime_r_needs_tzset=undef;
16274 d_localtime_r_needs_tzset=undef;
16279 : see if localeconv exists
16280 set localeconv d_locconv
16283 : see if libc has the POSIX.1-2008 currency locale rules
16284 case "$d_locconv:$d_lc_monetary_2008" in
16287 #include <locale.h>
16289 struct lconv *lc = localeconv();
16290 char int_p_cs_precedes = lc->int_p_cs_precedes;
16295 if eval $compile; then
16296 d_lc_monetary_2008="$define"
16298 d_lc_monetary_2008="$undef"
16304 : see if lockf exists
16308 : see if prototype for lseek is available
16310 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16313 : see if lstat exists
16317 : see if madvise exists
16318 set madvise d_madvise
16321 : see if malloc_size exists
16322 set malloc_size d_malloc_size
16325 : see if malloc_size_good exists
16326 set malloc_good_size d_malloc_good_size
16329 : see if mblen exists
16333 : see if mbstowcs exists
16334 set mbstowcs d_mbstowcs
16337 : see if mbtowc exists
16338 set mbtowc d_mbtowc
16341 : see if memchr exists
16342 set memchr d_memchr
16345 : see if memcmp exists
16346 set memcmp d_memcmp
16349 : see if memcpy exists
16350 set memcpy d_memcpy
16353 : see if memmove exists
16354 set memmove d_memmove
16357 : see if memset exists
16358 set memset d_memset
16361 : see if mkdir exists
16365 : see if mkdtemp exists
16366 set mkdtemp d_mkdtemp
16369 : see if mkfifo exists
16370 set mkfifo d_mkfifo
16373 : see if mkstemp exists
16374 set mkstemp d_mkstemp
16377 : see if mkstemps exists
16378 set mkstemps d_mkstemps
16381 : see if mktime exists
16382 set mktime d_mktime
16385 : see if this is a sys/mman.h system
16386 set sys/mman.h i_sysmman
16389 : see if mmap exists
16392 : see what shmat returns
16393 : default to something harmless
16395 case "$i_sysmman$d_mmap" in
16397 $cat >mmap.c <<'END'
16398 #include <sys/mman.h>
16401 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16406 echo "and it returns ($mmaptype)." >&4
16412 : see if sqrtl exists
16416 : see if scalbnl exists
16417 set scalbnl d_scalbnl
16420 : see if truncl exists
16421 set truncl d_truncl
16424 : see if modfl exists
16428 : see if prototype for modfl is available
16430 set d_modflproto modfl $i_math math.h
16433 d_modfl_pow32_bug="$undef"
16435 case "$d_longdbl$d_modfl" in
16438 Checking to see whether your modfl() is okay for large values...
16444 if $test "X$d_modflproto" != "X$define"; then
16445 $cat >>try.c <<EOCP
16446 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16447 long double modfl (long double, long double *);
16450 $cat >>try.c <<EOCP
16452 long double nv = 4294967303.15;
16458 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16462 case "$osname:$gccversion" in
16463 aix:) saveccflags="$ccflags"
16464 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16467 if eval $compile; then
16470 *" 4294967303.150000 1.150000 4294967302.000000")
16471 echo >&4 "Your modfl() is broken for large values."
16472 d_modfl_pow32_bug="$define"
16474 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16478 *" 4294967303.150000 0.150000 4294967303.000000")
16479 echo >&4 "Your modfl() seems okay for large values."
16481 *) echo >&4 "I don't understand your modfl() at all."
16487 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16490 case "$osname:$gccversion" in
16491 aix:) ccflags="$saveccflags" ;; # restore
16496 if $test "$uselongdouble" = "$define"; then
16498 if $test "$d_sqrtl" != "$define"; then
16499 message="$message sqrtl"
16501 if $test "$d_modfl" != "$define"; then
16502 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16503 echo "You have both truncl and copysignl, so I can emulate modfl."
16505 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16506 echo "You have both aintl and copysignl, so I can emulate modfl."
16508 message="$message modfl"
16512 if $test "$d_frexpl" != "$define"; then
16513 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16514 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16516 message="$message frexpl"
16519 if $test "$d_ldexpl" != "$define"; then
16520 message="$message ldexpl"
16523 if $test "$message" != ""; then
16526 *** You requested the use of long doubles but you do not seem to have
16527 *** the following mathematical functions needed for long double support:
16529 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16530 *** Cannot continue, aborting.
16538 : see if mprotect exists
16539 set mprotect d_mprotect
16542 : see if msgctl exists
16543 set msgctl d_msgctl
16546 : see if msgget exists
16547 set msgget d_msgget
16550 : see if msgsnd exists
16551 set msgsnd d_msgsnd
16554 : see if msgrcv exists
16555 set msgrcv d_msgrcv
16558 : see how much of the 'msg*(2)' library is present.
16561 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16562 *"$undef"*) h_msg=false;;
16566 case "`ipcs 2>&1`" in
16567 "SVID messages"*"not configured"*)
16568 echo "Your $osname does not have the msg*(2) configured." >&4
16571 set msgctl d_msgctl
16573 set msgget d_msgget
16575 set msgsnd d_msgsnd
16577 set msgrcv d_msgrcv
16583 : we could also check for sys/ipc.h ...
16584 if $h_msg && $test `./findhdr sys/msg.h`; then
16585 echo "You have the full msg*(2) library." >&4
16588 echo "You don't have the full msg*(2) library." >&4
16594 : Check for msghdr_s
16596 echo "Checking to see if your system supports struct msghdr..." >&4
16597 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16599 case "$d_msghdr_s" in
16600 "$define") echo "Yes, it does." ;;
16601 *) echo "No, it doesn't." ;;
16605 : see if msync exists
16609 : see if munmap exists
16610 set munmap d_munmap
16613 : see if nice exists
16617 : see if this is a langinfo.h system
16618 set langinfo.h i_langinfo
16621 : see if nl_langinfo exists
16622 set nl_langinfo d_nl_langinfo
16625 : check for volatile keyword
16627 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16628 $cat >try.c <<'EOCP'
16631 typedef struct _goo_struct goo_struct;
16632 goo_struct * volatile goo = ((goo_struct *)0);
16633 struct _goo_struct {
16638 typedef unsigned short foo_t;
16639 char *volatile foo;
16641 volatile foo_t blech;
16645 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16647 echo "Yup, it does."
16650 echo "Nope, it doesn't."
16656 : Check basic sizes
16658 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16660 case "$use64bitint:$d_quad:$quadtype" in
16663 uvtype="$uquadtype"
16668 uvtype="unsigned long"
16674 case "$uselongdouble:$d_longdbl" in
16676 nvtype="long double"
16677 nvsize=$longdblsize
16684 case "$usequadmath:$i_quadmath" in
16686 nvtype="__float128"
16692 *** You requested the use of the quadmath library, but you
16693 *** do not seem to have the quadmath library installed.
16694 *** Cannot continue, aborting.
16700 define:*) $cat <<EOM >&4
16702 *** You requested the use of the quadmath library, but you
16703 *** do not seem to have the required header, <quadmath.h>.
16705 case "$gccversion" in
16708 *** Your gcc looks a bit old:
16714 *** You are not running a gcc.
16719 *** For the quadmath library you need at least gcc 4.6.
16720 *** Cannot continue, aborting.
16726 $echo "(IV will be "$ivtype", $ivsize bytes)"
16727 $echo "(UV will be "$uvtype", $uvsize bytes)"
16728 $echo "(NV will be "$nvtype", $nvsize bytes)"
16731 #$i_inttypes I_INTTYPES
16733 #include <inttypes.h>
16738 int8_t i = INT8_MAX;
16739 uint8_t u = UINT8_MAX;
16740 printf("int8_t\n");
16743 int16_t i = INT16_MAX;
16744 uint16_t u = UINT16_MAX;
16745 printf("int16_t\n");
16748 int32_t i = INT32_MAX;
16749 uint32_t u = UINT32_MAX;
16750 printf("int32_t\n");
16755 i8type="signed char"
16756 u8type="unsigned char"
16761 '') case "$shortsize" in
16763 u16type="unsigned short"
16771 '') set try -DINT16
16772 if eval $compile; then
16773 case "`$run ./try`" in
16785 '') if $test $shortsize -ge 2; then
16787 u16type="unsigned short"
16795 '') case "$longsize" in
16797 u32type="unsigned long"
16801 *) case "$intsize" in
16803 u32type="unsigned int"
16813 '') set try -DINT32
16814 if eval $compile; then
16815 case "`$run ./try`" in
16827 '') if $test $intsize -ge 4; then
16829 u32type="unsigned int"
16837 '') case "$d_quad:$quadtype" in
16839 i64type="$quadtype"
16840 u64type="$uquadtype"
16848 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16849 : volatile so that the compiler has to store it out to memory.
16850 if test X"$d_volatile" = X"$define"; then
16855 #$i_stdlib I_STDLIB
16857 #include <stdlib.h>
16859 #include <sys/types.h>
16860 #include <signal.h>
16862 $volatile int bletched = 0;
16863 $signal_t blech(int s) { bletched = 1; }
16868 int n = 8 * $uvsize;
16871 signal(SIGFPE, blech);
16874 for (i = 0; i < n; i++) {
16875 u = u << 1 | ($uvtype)1;
16877 if (($uvtype)d != u)
16881 d = ($nvtype)(u - 1);
16882 if (($uvtype)d != (u - 1))
16889 printf("%d\n", ((i == n) ? -n : i));
16895 d_nv_preserves_uv="$undef"
16896 if eval $compile; then
16897 nv_preserves_uv_bits="`$run ./try`"
16899 case "$nv_preserves_uv_bits" in
16901 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16902 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16903 d_nv_preserves_uv="$define"
16905 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16906 d_nv_preserves_uv="$undef" ;;
16907 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16908 nv_preserves_uv_bits="0" ;;
16912 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16913 : volatile so that the compiler has to store it out to memory.
16914 if test X"$d_volatile" = X"$define"; then
16920 typedef $nvtype NV;
16927 while(count < 256) {
16928 $volatile NV up = value + 1.0;
16929 $volatile NV negated = -value;
16930 $volatile NV down = negated - 1.0;
16931 $volatile NV got_up = up - value;
16932 int up_good = got_up == 1.0;
16933 int got_down = down - negated;
16934 int down_good = got_down == -1.0;
16936 if (down_good != up_good) {
16938 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16939 up_good, (double) got_up, down_good, (double) got_down,
16940 count, (double) value);
16947 fputs("256.0", stdout);
16950 fputs("2.0", stdout);
16956 fputs("*", stdout);
16962 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16963 count, (double) value);
16969 nv_overflows_integers_at='0'
16970 if eval $compile; then
16976 The largest integer your NVs can preserve is equal to $xxx
16978 nv_overflows_integers_at="$xxx"
16981 Cannot determine the largest integer value your NVs can hold, unexpected output
16988 Cannot determine the largest integer value your NVs can hold
16995 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16996 : volatile so that the compiler has to store it out to memory.
16997 if test X"$d_volatile" = X"$define"; then
17002 #$i_stdlib I_STDLIB
17004 #include <stdlib.h>
17006 #$i_string I_STRING
17008 # include <string.h>
17010 # include <strings.h>
17012 #include <sys/types.h>
17013 #include <signal.h>
17015 $volatile int bletched = 0;
17016 $signal_t blech(int s) { bletched = 1; }
17019 int checkit($nvtype d, char *where) {
17020 unsigned char *p = (char *)&d;
17021 unsigned char *end = p + sizeof(d);
17031 printf("No - %s: 0x", where);
17033 printf ("%02X", *p++);
17038 int main(int argc, char **argv) {
17041 fail += checkit(d, "0.0");
17043 /* The compiler shouldn't be assuming that bletched is 0 */
17046 fail += checkit(d, "bleched");
17049 signal(SIGFPE, blech);
17052 /* Paranoia - the compiler should have no way of knowing that ANSI says
17053 that argv[argc] will always be NULL. Actually, if it did assume this it
17054 would be buggy, as this is C and main() can be called from elsewhere in
17056 d = argv[argc] ? 1 : 0;
17059 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17062 fail += checkit(d, "ternary");
17064 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17067 printf("No - memset doesn't give 0.0\n");
17068 /* This might just blow up: */
17069 printf("(gives %g)\n", d);
17075 printf("No - something bleched\n");
17080 printf("No - %d fail(s)\n", fail);
17089 d_nv_zero_is_allbits_zero="$undef"
17090 if eval $compile; then
17096 0.0 is represented as all bits zero in memory
17098 d_nv_zero_is_allbits_zero="$define"
17101 0.0 is not represented as all bits zero in memory
17103 d_nv_zero_is_allbits_zero="$undef"
17108 0.0 is not represented as all bits zero in memory
17110 d_nv_zero_is_allbits_zero="$undef"
17116 : check for off64_t
17118 echo "Checking to see if you have off64_t..." >&4
17120 #include <sys/types.h>
17121 #include <unistd.h>
17122 int main() { off64_t x = 7; }
17125 if eval $compile; then
17127 echo "You have off64_t."
17130 echo "You do not have off64_t."
17131 case "$lseeksize" in
17132 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17139 : how to create joinable pthreads
17140 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17142 echo "Checking what constant to use for creating joinable pthreads..." >&4
17143 $cat >try.c <<'EOCP'
17144 #include <pthread.h>
17146 int detachstate = JOINABLE;
17149 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17150 if eval $compile; then
17151 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17152 val="$undef" # Yes, undef.
17153 set d_old_pthread_create_joinable
17156 set old_pthread_create_joinable
17159 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17160 if eval $compile; then
17161 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17163 set d_old_pthread_create_joinable
17165 val=PTHREAD_CREATE_UNDETACHED
17166 set old_pthread_create_joinable
17169 set try -DJOINABLE=__UNDETACHED
17170 if eval $compile; then
17171 echo "You seem to use __UNDETACHED." >&4
17173 set d_old_pthread_create_joinable
17176 set old_pthread_create_joinable
17179 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17181 set d_old_pthread_create_joinable
17184 set old_pthread_create_joinable
17191 d_old_pthread_create_joinable="$undef"
17192 old_pthread_create_joinable=""
17195 : see if pause exists
17199 : see if poll exists
17203 : see if prctl exists
17207 : see if prctl supports PR_SET_NAME
17208 d_prctl_set_name=$undef
17213 #include <unistd.h>
17215 #include <sys/prctl.h>
17217 int main (int argc, char *argv[])
17219 return (prctl (PR_SET_NAME, "Test"));
17223 if eval $compile_ok && $run ./try; then
17224 echo "Your prctl (PR_SET_NAME, ...) works"
17225 d_prctl_set_name=$define
17231 : see if readlink exists
17232 set readlink d_readlink
17235 : Check if exe is symlink to abs path of executing program
17239 case "$d_readlink" in
17241 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
17242 : more tidy to avoid an extra level of symlink
17243 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17244 while test $# -gt 0; do
17247 if $issymlink $try; then
17248 $ls -l $try > reflect
17249 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17250 echo "You have $type-like $try."
17251 procselfexe='"'$try'"'
17253 : This will break out of the loop
17264 : backward compatibility for d_hvfork
17265 if test X$d_hvfork != X; then
17266 d_vfork="$d_hvfork"
17269 : see if there is a vfork
17274 d_pseudofork=$undef
17276 : Ok, but do we want to use it. vfork is reportedly unreliable in
17277 : perl on Solaris 2.x, and probably elsewhere.
17281 case "$usevfork" in
17287 Perl can only use a vfork() that doesn't suffer from strict
17288 restrictions on calling functions or modifying global data in
17289 the child. For example, glibc-2.1 contains such a vfork()
17290 that is unsuitable. If your system provides a proper fork()
17291 call, chances are that you do NOT want perl to use vfork().
17294 rp="Do you still want to use vfork()?"
17299 echo "Ok, we won't use vfork()."
17308 $define) usevfork='true';;
17309 *) usevfork='false';;
17312 : see whether the pthread_atfork exists
17314 #include <pthread.h>
17317 #ifdef PTHREAD_ATFORK
17318 pthread_atfork(NULL,NULL,NULL);
17323 : see if pthread_atfork exists
17324 set try -DPTHREAD_ATFORK
17325 if eval $compile; then
17330 case "$usethreads" in
17333 $define) echo 'pthread_atfork found.' >&4 ;;
17334 *) echo 'pthread_atfork NOT found.' >&4 ;;
17337 set d_pthread_atfork
17340 : see if pthread_attr_setscope exists
17341 set pthread_attr_setscope d_pthread_attr_setscope
17344 : see whether the various POSIXish _yields exist
17346 #include <pthread.h>
17352 #ifdef PTHREAD_YIELD
17355 #ifdef PTHREAD_YIELD_NULL
17356 pthread_yield(NULL);
17362 : see if sched_yield exists
17363 set try -DSCHED_YIELD
17364 if eval $compile; then
17366 sched_yield='sched_yield()'
17370 case "$usethreads" in
17373 $define) echo 'sched_yield() found.' >&4 ;;
17374 *) echo 'sched_yield() NOT found.' >&4 ;;
17380 : see if pthread_yield exists
17381 set try -DPTHREAD_YIELD
17382 if eval $compile; then
17384 case "$sched_yield" in
17385 '') sched_yield='pthread_yield()' ;;
17388 set try -DPTHREAD_YIELD_NULL
17389 if eval $compile; then
17391 case "$sched_yield" in
17392 '') sched_yield='pthread_yield(NULL)' ;;
17398 case "$usethreads" in
17401 $define) echo 'pthread_yield() found.' >&4 ;;
17402 *) echo 'pthread_yield() NOT found.' >&4 ;;
17406 set d_pthread_yield
17408 case "$sched_yield" in
17409 '') sched_yield=undef ;;
17413 : check for ptrdiff_t
17415 echo "Checking to see if you have ptrdiff_t..." >&4
17417 #include <stddef.h>
17418 int main() { ptrdiff_t x = 7; }
17421 if eval $compile; then
17423 echo "You have ptrdiff_t."
17426 echo "You do not have ptrdiff_t."
17432 : see if random_r exists
17433 set random_r d_random_r
17435 case "$d_random_r" in
17437 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17438 case "$d_random_r_proto:$usethreads" in
17439 ":define") d_random_r_proto=define
17440 set d_random_r_proto random_r $hdrs
17444 case "$d_random_r_proto" in
17446 case "$random_r_proto" in
17447 ''|0) try='int random_r(int*, struct random_data*);'
17448 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17450 case "$random_r_proto" in
17451 ''|0) try='int random_r(long*, struct random_data*);'
17452 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17454 case "$random_r_proto" in
17455 ''|0) try='int random_r(struct random_data*, int32_t*);'
17456 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17458 case "$random_r_proto" in
17459 ''|0) d_random_r=undef
17461 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17462 * ) case "$random_r_proto" in
17463 REENTRANT_PROTO*) ;;
17464 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17466 echo "Prototype: $try" ;;
17469 *) case "$usethreads" in
17470 define) echo "random_r has no prototype, not using it." >&4 ;;
17477 *) random_r_proto=0
17481 : see if readdir and friends exist
17482 set readdir d_readdir
17484 set seekdir d_seekdir
17486 set telldir d_telldir
17488 set rewinddir d_rewinddir
17491 : see if readdir64_r exists
17492 set readdir64_r d_readdir64_r
17494 case "$d_readdir64_r" in
17496 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17497 case "$d_readdir64_r_proto:$usethreads" in
17498 ":define") d_readdir64_r_proto=define
17499 set d_readdir64_r_proto readdir64_r $hdrs
17503 case "$d_readdir64_r_proto" in
17505 case "$readdir64_r_proto" in
17506 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17507 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17509 case "$readdir64_r_proto" in
17510 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17511 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17513 case "$readdir64_r_proto" in
17514 ''|0) d_readdir64_r=undef
17515 readdir64_r_proto=0
17516 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17517 * ) case "$readdir64_r_proto" in
17518 REENTRANT_PROTO*) ;;
17519 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17521 echo "Prototype: $try" ;;
17524 *) case "$usethreads" in
17525 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17527 d_readdir64_r=undef
17528 readdir64_r_proto=0
17532 *) readdir64_r_proto=0
17536 : see if readdir_r exists
17537 set readdir_r d_readdir_r
17539 case "$d_readdir_r" in
17541 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17542 case "$d_readdir_r_proto:$usethreads" in
17543 ":define") d_readdir_r_proto=define
17544 set d_readdir_r_proto readdir_r $hdrs
17548 case "$d_readdir_r_proto" in
17550 case "$readdir_r_proto" in
17551 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17552 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17554 case "$readdir_r_proto" in
17555 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17556 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17558 case "$readdir_r_proto" in
17559 ''|0) d_readdir_r=undef
17561 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17562 * ) case "$readdir_r_proto" in
17563 REENTRANT_PROTO*) ;;
17564 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17566 echo "Prototype: $try" ;;
17569 *) case "$usethreads" in
17570 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17577 *) readdir_r_proto=0
17581 : see if readv exists
17585 : see if recvmsg exists
17586 set recvmsg d_recvmsg
17589 : see if rename exists
17590 set rename d_rename
17593 : see if rmdir exists
17597 : see if memory.h is available.
17602 : See if it conflicts with string.h
17608 $cppstdin $cppflags $cppminus < $strings > mem.h
17609 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17611 echo "We won't be including <memory.h>."
17621 : can bcopy handle overlapping blocks?
17624 case "$d_memmove" in
17625 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17626 *) case "$d_bcopy" in
17628 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17630 #$i_memory I_MEMORY
17631 #$i_stdlib I_STDLIB
17632 #$i_string I_STRING
17633 #$i_unistd I_UNISTD
17635 $cat >>try.c <<'EOCP'
17638 # include <memory.h>
17641 # include <stdlib.h>
17644 # include <string.h>
17646 # include <strings.h>
17649 # include <unistd.h> /* Needed for NetBSD */
17653 char buf[128], abc[128];
17659 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17660 try to store the string in read-only memory. */
17661 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17663 for (align = 7; align >= 0; align--) {
17664 for (len = 36; len; len--) {
17666 bcopy(abc, b, len);
17667 for (off = 1; off <= len; off++) {
17668 bcopy(b, b+off, len);
17669 bcopy(b+off, b, len);
17670 if (bcmp(b, abc, len))
17679 if eval $compile_ok; then
17680 if $run ./try 2>/dev/null; then
17681 echo "Yes, it can."
17684 echo "It can't, sorry."
17687 echo "(I can't compile the test program, so we'll assume not...)"
17697 : can memcpy handle overlapping blocks?
17700 case "$d_memmove" in
17701 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17702 *) case "$d_memcpy" in
17704 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17706 #$i_memory I_MEMORY
17707 #$i_stdlib I_STDLIB
17708 #$i_string I_STRING
17709 #$i_unistd I_UNISTD
17711 $cat >>try.c <<'EOCP'
17714 # include <memory.h>
17717 # include <stdlib.h>
17720 # include <string.h>
17722 # include <strings.h>
17725 # include <unistd.h> /* Needed for NetBSD */
17729 char buf[128], abc[128];
17735 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17736 try to store the string in read-only memory. */
17737 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17739 for (align = 7; align >= 0; align--) {
17740 for (len = 36; len; len--) {
17742 memcpy(b, abc, len);
17743 for (off = 1; off <= len; off++) {
17744 memcpy(b+off, b, len);
17745 memcpy(b, b+off, len);
17746 if (memcmp(b, abc, len))
17755 if eval $compile_ok; then
17756 if $run ./try 2>/dev/null; then
17757 echo "Yes, it can."
17760 echo "It can't, sorry."
17763 echo "(I can't compile the test program, so we'll assume not...)"
17773 : can memcmp be trusted to compare relative magnitude?
17775 case "$d_memcmp" in
17778 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17780 #$i_memory I_MEMORY
17781 #$i_stdlib I_STDLIB
17782 #$i_string I_STRING
17783 #$i_unistd I_UNISTD
17785 $cat >>try.c <<'EOCP'
17788 # include <memory.h>
17791 # include <stdlib.h>
17794 # include <string.h>
17796 # include <strings.h>
17799 # include <unistd.h> /* Needed for NetBSD */
17805 if ((a < b) && memcmp(&a, &b, 1) < 0)
17811 if eval $compile_ok; then
17812 if $run ./try 2>/dev/null; then
17813 echo "Yes, it can."
17816 echo "No, it can't (it uses signed chars)."
17819 echo "(I can't compile the test program, so we'll assume not...)"
17827 : see if prototype for sbrk is available
17829 set d_sbrkproto sbrk $i_unistd unistd.h
17832 : see if select exists
17833 set select d_select
17836 : see if semctl exists
17837 set semctl d_semctl
17840 : see if semget exists
17841 set semget d_semget
17844 : see if semop exists
17848 : see how much of the 'sem*(2)' library is present.
17851 case "$d_semctl$d_semget$d_semop" in
17852 *"$undef"*) h_sem=false;;
17856 case "`ipcs 2>&1`" in
17857 "SVID messages"*"not configured"*)
17858 echo "Your $osname does not have the sem*(2) configured." >&4
17861 set semctl d_semctl
17863 set semget d_semget
17871 : we could also check for sys/ipc.h ...
17872 if $h_sem && $test `./findhdr sys/sem.h`; then
17873 echo "You have the full sem*(2) library." >&4
17876 echo "You don't have the full sem*(2) library." >&4
17882 : see whether sys/sem.h defines union semun
17884 $cat > try.c <<'END'
17885 #include <sys/types.h>
17886 #include <sys/ipc.h>
17887 #include <sys/sem.h>
17888 int main () { union semun semun; semun.buf = 0; }
17891 if eval $compile; then
17892 echo "You have union semun in <sys/sem.h>." >&4
17895 echo "You do not have union semun in <sys/sem.h>." >&4
17902 : see how to do semctl IPC_STAT
17906 $cat > tryh.h <<END
17909 # define S_IRUSR S_IREAD
17910 # define S_IWUSR S_IWRITE
17911 # define S_IXUSR S_IEXEC
17913 # define S_IRUSR 0400
17914 # define S_IWUSR 0200
17915 # define S_IXUSR 0100
17917 # define S_IRGRP (S_IRUSR>>3)
17918 # define S_IWGRP (S_IWUSR>>3)
17919 # define S_IXGRP (S_IXUSR>>3)
17920 # define S_IROTH (S_IRUSR>>6)
17921 # define S_IWOTH (S_IWUSR>>6)
17922 # define S_IXOTH (S_IXUSR>>6)
17925 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17926 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17927 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17930 : see whether semctl IPC_STAT can use union semun
17931 case "$d_semctl_semun" in
17935 #include <sys/types.h>
17936 #include <sys/ipc.h>
17937 #include <sys/sem.h>
17938 #include <sys/stat.h>
17945 #$d_union_semun HAS_UNION_SEMUN
17948 #ifndef HAS_UNION_SEMUN
17951 struct semid_ds *buf;
17952 unsigned short *array;
17958 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17959 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17961 struct semid_ds argbuf;
17964 st = semctl(sem, 0, IPC_STAT, arg);
17968 # endif /* IPC_STAT */
17969 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17971 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17972 # endif /* IPC_RMID */
17973 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17975 #endif /* IPC_PRIVATE && ... */
17976 printf("semget failed: errno = %d\n", errno);
17981 if eval $compile; then
17984 semun) val="$define" ;;
17992 case "$d_semctl_semun" in
17994 echo "You can use union semun for semctl IPC_STAT." >&4
17997 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18002 : see whether semctl IPC_STAT can use struct semid_ds pointer
18003 case "$d_semctl_semid_ds" in
18006 $cat > try.c <<'END'
18007 #include <sys/types.h>
18008 #include <sys/ipc.h>
18009 #include <sys/sem.h>
18010 #include <sys/stat.h>
18018 struct semid_ds arg;
18021 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18022 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18025 st = semctl(sem, 0, IPC_STAT, &arg);
18027 printf("semid_ds\n");
18029 # endif /* IPC_STAT */
18030 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18032 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18033 # endif /* IPC_RMID */
18034 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18036 #endif /* IPC_PRIVATE && ... */
18037 printf("semget failed: errno = %d\n", errno);
18043 if eval $compile; then
18046 semid_ds) val="$define" ;;
18050 set d_semctl_semid_ds
18054 case "$d_semctl_semid_ds" in
18056 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18058 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18064 # We do not have the full sem*(2) library, so assume we can not
18070 set d_semctl_semid_ds
18076 : see if sendmsg exists
18077 set sendmsg d_sendmsg
18080 : see if setegid exists
18081 set setegid d_setegid
18084 : see if seteuid exists
18085 set seteuid d_seteuid
18088 : see if setgrent exists
18089 set setgrent d_setgrent
18092 : see if setgrent_r exists
18093 set setgrent_r d_setgrent_r
18095 case "$d_setgrent_r" in
18097 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18098 case "$d_setgrent_r_proto:$usethreads" in
18099 ":define") d_setgrent_r_proto=define
18100 set d_setgrent_r_proto setgrent_r $hdrs
18104 case "$d_setgrent_r_proto" in
18106 case "$setgrent_r_proto" in
18107 ''|0) try='int setgrent_r(FILE**);'
18108 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18110 case "$setgrent_r_proto" in
18111 ''|0) try='void setgrent_r(FILE**);'
18112 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18114 case "$setgrent_r_proto" in
18115 ''|0) d_setgrent_r=undef
18117 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18118 * ) case "$setgrent_r_proto" in
18119 REENTRANT_PROTO*) ;;
18120 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18122 echo "Prototype: $try" ;;
18125 *) case "$usethreads" in
18126 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18133 *) setgrent_r_proto=0
18137 : see if sethostent exists
18138 set sethostent d_sethent
18141 : see if sethostent_r exists
18142 set sethostent_r d_sethostent_r
18144 case "$d_sethostent_r" in
18146 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18147 case "$d_sethostent_r_proto:$usethreads" in
18148 ":define") d_sethostent_r_proto=define
18149 set d_sethostent_r_proto sethostent_r $hdrs
18153 case "$d_sethostent_r_proto" in
18155 case "$sethostent_r_proto" in
18156 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18157 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18159 case "$sethostent_r_proto" in
18160 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18161 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18163 case "$sethostent_r_proto" in
18164 ''|0) d_sethostent_r=undef
18165 sethostent_r_proto=0
18166 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18167 * ) case "$sethostent_r_proto" in
18168 REENTRANT_PROTO*) ;;
18169 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18171 echo "Prototype: $try" ;;
18174 *) case "$usethreads" in
18175 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18177 d_sethostent_r=undef
18178 sethostent_r_proto=0
18182 *) sethostent_r_proto=0
18186 : see if setitimer exists
18187 set setitimer d_setitimer
18190 : see if setlinebuf exists
18191 set setlinebuf d_setlinebuf
18194 : see if setlocale exists
18195 set setlocale d_setlocale
18198 : see if locale.h is available
18199 set locale.h i_locale
18202 : see if setlocale_r exists
18203 set setlocale_r d_setlocale_r
18205 case "$d_setlocale_r" in
18207 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18208 case "$d_setlocale_r_proto:$usethreads" in
18209 ":define") d_setlocale_r_proto=define
18210 set d_setlocale_r_proto setlocale_r $hdrs
18214 case "$d_setlocale_r_proto" in
18216 case "$setlocale_r_proto" in
18217 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18218 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18220 case "$setlocale_r_proto" in
18221 ''|0) d_setlocale_r=undef
18222 setlocale_r_proto=0
18223 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18224 * ) case "$setlocale_r_proto" in
18225 REENTRANT_PROTO*) ;;
18226 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18228 echo "Prototype: $try" ;;
18231 *) case "$usethreads" in
18232 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18234 d_setlocale_r=undef
18235 setlocale_r_proto=0
18239 *) setlocale_r_proto=0
18243 : see if setnetent exists
18244 set setnetent d_setnent
18247 : see if setnetent_r exists
18248 set setnetent_r d_setnetent_r
18250 case "$d_setnetent_r" in
18252 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18253 case "$d_setnetent_r_proto:$usethreads" in
18254 ":define") d_setnetent_r_proto=define
18255 set d_setnetent_r_proto setnetent_r $hdrs
18259 case "$d_setnetent_r_proto" in
18261 case "$setnetent_r_proto" in
18262 ''|0) try='int setnetent_r(int, struct netent_data*);'
18263 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18265 case "$setnetent_r_proto" in
18266 ''|0) try='void setnetent_r(int, struct netent_data*);'
18267 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18269 case "$setnetent_r_proto" in
18270 ''|0) d_setnetent_r=undef
18271 setnetent_r_proto=0
18272 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18273 * ) case "$setnetent_r_proto" in
18274 REENTRANT_PROTO*) ;;
18275 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18277 echo "Prototype: $try" ;;
18280 *) case "$usethreads" in
18281 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18283 d_setnetent_r=undef
18284 setnetent_r_proto=0
18288 *) setnetent_r_proto=0
18292 : see if setprotoent exists
18293 set setprotoent d_setpent
18296 : see if setpgid exists
18297 set setpgid d_setpgid
18300 : see if setpgrp2 exists
18301 set setpgrp2 d_setpgrp2
18304 : see if setpriority exists
18305 set setpriority d_setprior
18308 : see if setproctitle exists
18309 set setproctitle d_setproctitle
18312 : see if setprotoent_r exists
18313 set setprotoent_r d_setprotoent_r
18315 case "$d_setprotoent_r" in
18317 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18318 case "$d_setprotoent_r_proto:$usethreads" in
18319 ":define") d_setprotoent_r_proto=define
18320 set d_setprotoent_r_proto setprotoent_r $hdrs
18324 case "$d_setprotoent_r_proto" in
18326 case "$setprotoent_r_proto" in
18327 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18328 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18330 case "$setprotoent_r_proto" in
18331 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18332 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18334 case "$setprotoent_r_proto" in
18335 ''|0) d_setprotoent_r=undef
18336 setprotoent_r_proto=0
18337 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18338 * ) case "$setprotoent_r_proto" in
18339 REENTRANT_PROTO*) ;;
18340 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18342 echo "Prototype: $try" ;;
18345 *) case "$usethreads" in
18346 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18348 d_setprotoent_r=undef
18349 setprotoent_r_proto=0
18353 *) setprotoent_r_proto=0
18357 : see if setpwent exists
18358 set setpwent d_setpwent
18361 : see if setpwent_r exists
18362 set setpwent_r d_setpwent_r
18364 case "$d_setpwent_r" in
18366 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18367 case "$d_setpwent_r_proto:$usethreads" in
18368 ":define") d_setpwent_r_proto=define
18369 set d_setpwent_r_proto setpwent_r $hdrs
18373 case "$d_setpwent_r_proto" in
18375 case "$setpwent_r_proto" in
18376 ''|0) try='int setpwent_r(FILE**);'
18377 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18379 case "$setpwent_r_proto" in
18380 ''|0) try='void setpwent_r(FILE**);'
18381 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18383 case "$setpwent_r_proto" in
18384 ''|0) d_setpwent_r=undef
18386 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18387 * ) case "$setpwent_r_proto" in
18388 REENTRANT_PROTO*) ;;
18389 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18391 echo "Prototype: $try" ;;
18394 *) case "$usethreads" in
18395 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18402 *) setpwent_r_proto=0
18406 : see if setregid exists
18407 set setregid d_setregid
18409 set setresgid d_setresgid
18412 : see if setreuid exists
18413 set setreuid d_setreuid
18415 set setresuid d_setresuid
18418 : see if setrgid exists
18419 set setrgid d_setrgid
18422 : see if setruid exists
18423 set setruid d_setruid
18426 : see if setservent exists
18427 set setservent d_setsent
18430 : see if setservent_r exists
18431 set setservent_r d_setservent_r
18433 case "$d_setservent_r" in
18435 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18436 case "$d_setservent_r_proto:$usethreads" in
18437 ":define") d_setservent_r_proto=define
18438 set d_setservent_r_proto setservent_r $hdrs
18442 case "$d_setservent_r_proto" in
18444 case "$setservent_r_proto" in
18445 ''|0) try='int setservent_r(int, struct servent_data*);'
18446 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18448 case "$setservent_r_proto" in
18449 ''|0) try='void setservent_r(int, struct servent_data*);'
18450 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18452 case "$setservent_r_proto" in
18453 ''|0) d_setservent_r=undef
18454 setservent_r_proto=0
18455 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18456 * ) case "$setservent_r_proto" in
18457 REENTRANT_PROTO*) ;;
18458 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18460 echo "Prototype: $try" ;;
18463 *) case "$usethreads" in
18464 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18466 d_setservent_r=undef
18467 setservent_r_proto=0
18471 *) setservent_r_proto=0
18475 : see if setsid exists
18476 set setsid d_setsid
18479 : see if setvbuf exists
18480 set setvbuf d_setvbuf
18483 : see if shmctl exists
18484 set shmctl d_shmctl
18487 : see if shmget exists
18488 set shmget d_shmget
18491 : see if shmat exists
18494 : see what shmat returns
18497 $cat >shmat.c <<'END'
18498 #include <sys/shm.h>
18501 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18506 echo "and it returns ($shmattype)." >&4
18507 : see if a prototype for shmat is available
18508 xxx=`./findhdr sys/shm.h`
18509 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18510 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18521 set d_shmatprototype
18524 : see if shmdt exists
18528 : see how much of the 'shm*(2)' library is present.
18531 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18532 *"$undef"*) h_shm=false;;
18536 case "`ipcs 2>&1`" in
18537 "SVID shared memory"*"not configured"*)
18538 echo "Your $osname does not have the shm*(2) configured." >&4
18541 set shmctl d_shmctl
18543 set shmget d_shmget
18553 : we could also check for sys/ipc.h ...
18554 if $h_shm && $test `./findhdr sys/shm.h`; then
18555 echo "You have the full shm*(2) library." >&4
18558 echo "You don't have the full shm*(2) library." >&4
18564 : see if we have sigaction
18566 if set sigaction val -f d_sigaction; eval $csym; $val; then
18567 echo 'sigaction() found.' >&4
18570 #include <sys/types.h>
18571 #include <signal.h>
18572 #$i_stdlib I_STDLIB
18574 #include <stdlib.h>
18578 struct sigaction act, oact;
18580 oact.sa_handler = 0;
18581 /* so that act and oact are used */
18582 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18586 if eval $compile_ok; then
18589 echo "But you don't seem to have a usable struct sigaction." >&4
18593 echo 'sigaction NOT found.' >&4
18596 set d_sigaction; eval $setvar
18599 : see if this is a sunmath.h system
18600 set sunmath.h i_sunmath
18603 : see if signbit exists
18604 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18607 #$i_sunmath I_SUNMATH
18611 #ifdef I_SUNMATH /* Solaris special math library */
18612 # include <sunmath.h>
18615 int main(int argc, char **argv)
18619 if ((signbit(x) == 0) && (signbit(y) != 0))
18627 if eval $compile; then
18628 if $run ./try; then
18632 $echo "Signbit seems to be available, but doesn't work as I expected."
18633 $echo "I won't use it." >&4
18644 : see if sigprocmask exists
18645 set sigprocmask d_sigprocmask
18648 : see if sigsetjmp exists
18650 case "$d_sigsetjmp" in
18653 #include <setjmp.h>
18654 #$i_stdlib I_STDLIB
18656 #include <stdlib.h>
18662 if (sigsetjmp(env,1))
18665 siglongjmp(env, 1);
18670 if eval $compile; then
18671 if $run ./try >/dev/null 2>&1; then
18672 echo "POSIX sigsetjmp found." >&4
18676 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18682 echo "sigsetjmp not found." >&4
18686 *) val="$d_sigsetjmp"
18687 case "$d_sigsetjmp" in
18688 $define) echo "POSIX sigsetjmp found." >&4;;
18689 $undef) echo "sigsetjmp not found." >&4;;
18697 : see if snprintf exists
18698 set snprintf d_snprintf
18701 : see if vsnprintf exists
18702 set vsnprintf d_vsnprintf
18705 case "$d_snprintf-$d_vsnprintf" in
18708 Checking whether your snprintf() and vsnprintf() work okay...
18710 $cat >try.c <<'EOCP'
18711 /* v?snprintf testing logic courtesy of Russ Allbery.
18712 * According to C99:
18713 * - if the buffer is too short it still must be \0-terminated
18714 * - if the buffer is too short the potentially required length
18715 * must be returned and not -1
18716 * - if the buffer is NULL the potentially required length
18717 * must be returned and not -1 or core dump
18720 #include <stdarg.h>
18724 int test (char *format, ...)
18729 va_start (args, format);
18730 count = vsnprintf (buf, sizeof buf, format, args);
18737 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18738 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18742 if eval $compile; then
18745 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18747 Your snprintf() and snprintf() don't seem to be working okay.
18749 d_snprintf="$undef"
18750 d_vsnprintf="$undef"
18754 echo "(I can't seem to compile the test program--assuming they don't)"
18755 d_snprintf="$undef"
18756 d_vsnprintf="$undef"
18762 : see if sockatmark exists
18763 set sockatmark d_sockatmark
18766 : see if prototype for sockatmark is available
18768 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18771 : see if socks5_init exists
18772 set socks5_init d_socks5_init
18775 : see if sprintf returns the length of the string in the buffer as per ANSI
18776 $echo "Checking whether sprintf returns the length of the string..." >&4
18779 #$i_stdlib I_STDLIB
18781 #include <stdlib.h>
18783 #$i_string I_STRING
18785 # include <string.h>
18787 # include <strings.h>
18796 int check (size_t expect, int test) {
18797 size_t got = strlen(buffer);
18801 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18806 int main(int argc, char **argv) {
18809 check(sprintf(buffer, ""), ++test);
18810 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18811 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18818 if eval $compile; then
18822 sprintf returns the length of the string (as ANSI says it should)
18824 d_sprintf_returns_strlen="$define"
18827 sprintf does not return the length of the string (how old is this system?)
18829 d_sprintf_returns_strlen="$undef"
18833 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18834 d_sprintf_returns_strlen="$undef"
18838 : see if srand48_r exists
18839 set srand48_r d_srand48_r
18841 case "$d_srand48_r" in
18843 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18844 case "$d_srand48_r_proto:$usethreads" in
18845 ":define") d_srand48_r_proto=define
18846 set d_srand48_r_proto srand48_r $hdrs
18850 case "$d_srand48_r_proto" in
18852 case "$srand48_r_proto" in
18853 ''|0) try='int srand48_r(long, struct drand48_data*);'
18854 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18856 case "$srand48_r_proto" in
18857 ''|0) d_srand48_r=undef
18859 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18860 * ) case "$srand48_r_proto" in
18861 REENTRANT_PROTO*) ;;
18862 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18864 echo "Prototype: $try" ;;
18867 *) case "$usethreads" in
18868 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18875 *) srand48_r_proto=0
18879 : see if srandom_r exists
18880 set srandom_r d_srandom_r
18882 case "$d_srandom_r" in
18884 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18885 case "$d_srandom_r_proto:$usethreads" in
18886 ":define") d_srandom_r_proto=define
18887 set d_srandom_r_proto srandom_r $hdrs
18891 case "$d_srandom_r_proto" in
18893 case "$srandom_r_proto" in
18894 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18895 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18897 case "$srandom_r_proto" in
18898 ''|0) d_srandom_r=undef
18900 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18901 * ) case "$srandom_r_proto" in
18902 REENTRANT_PROTO*) ;;
18903 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18905 echo "Prototype: $try" ;;
18908 *) case "$usethreads" in
18909 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18916 *) srandom_r_proto=0
18920 : see if prototype for setresgid is available
18922 set d_sresgproto setresgid $i_unistd unistd.h
18925 : see if prototype for setresuid is available
18927 set d_sresuproto setresuid $i_unistd unistd.h
18930 : see if sys/stat.h is available
18931 set sys/stat.h i_sysstat
18934 : see if stat knows about block sizes
18936 echo "Checking to see if your struct stat has st_blocks field..." >&4
18937 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18940 : see if this is a sys/vfs.h system
18941 set sys/vfs.h i_sysvfs
18944 : see if this is a sys/statfs.h system
18945 set sys/statfs.h i_sysstatfs
18948 : Check for statfs_s
18950 echo "Checking to see if your system supports struct statfs..." >&4
18951 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
18953 case "$d_statfs_s" in
18954 "$define") echo "Yes, it does." ;;
18955 *) echo "No, it doesn't." ;;
18959 : see if struct statfs knows about f_flags
18960 case "$d_statfs_s" in
18963 echo "Checking to see if your struct statfs has f_flags field..." >&4
18964 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
18968 set d_statfs_f_flags
18972 case "$d_statfs_f_flags" in
18973 "$define") echo "Yes, it does." ;;
18974 *) echo "No, it doesn't." ;;
18977 : see what flavor, if any, of static inline is supported
18979 echo "Checking to see if your system supports static inline..."
18980 $cat > try.c <<'EOCP'
18981 #include <stdlib.h>
18982 extern int f_via_a(int x);
18983 extern int f_via_b(int x);
18984 int main(int argc, char **argv)
18993 return EXIT_SUCCESS;
18996 return EXIT_FAILURE;
19000 $cat > a.c <<'EOCP'
19001 static INLINE int f(int x) {
19012 $cat > b.c <<'EOCP'
19013 extern int f(int x);
19021 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19022 case "$perl_static_inline" in
19023 '') # Check the various possibilities, and break out on success.
19024 # For gcc, prefer __inline__, which will still permit
19025 # cflags.SH to add in -ansi.
19026 case "$gccversion" in
19027 '') xxx="inline __inline__ __inline _inline";;
19028 *) xxx="__inline__ inline __inline _inline";;
19030 for inline in $xxx; do
19031 set try -DINLINE=$inline a.c
19032 if eval $compile && $run ./try; then
19033 # Now make sure there is no external linkage of static
19035 set try -DINLINE=$inline -DUSE_B a.c b.c
19036 if eval $compile && $run ./try; then
19037 $echo "Your compiler supports static $inline, " >&4
19038 $echo "but it also creates an external definition," >&4
19039 $echo "so I won't use it." >&4
19042 $echo "Your compiler supports static $inline." >&4
19044 perl_static_inline="static $inline";
19048 $echo "Your compiler does NOT support static $inline." >&4
19053 *inline*) # Some variant of inline exists.
19054 echo "Keeping your $hint value of $perl_static_inline."
19057 static) # No inline capabilities
19058 echo "Keeping your $hint value of $perl_static_inline."
19061 *) # Unrecognized previous value -- blindly trust the supplied
19062 # value and hope it makes sense. Use old value for
19063 # d_static_inline, if there is one.
19064 echo "Keeping your $hint value of $perl_static_inline."
19065 case "$d_static_inline" in
19067 *) val=$d_static_inline ;;
19071 # Fallback to plain 'static' if nothing worked.
19072 case "$perl_static_inline" in
19074 perl_static_inline="static"
19078 set d_static_inline
19080 $rm -f a.[co] b.[co]
19083 : Check stream access
19085 Checking how to access stdio streams by file descriptor number...
19087 case "$stdio_stream_array" in
19088 '') $cat >try.c <<EOCP
19091 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19095 for s in _iob __iob __sF
19097 set try -DSTDIO_STREAM_ARRAY=$s
19098 if eval $compile; then
19099 case "`$run ./try`" in
19100 yes) stdio_stream_array=$s; break ;;
19106 case "$stdio_stream_array" in
19108 I can't figure out how to access stdio streams by file descriptor number.
19110 d_stdio_stream_array="$undef"
19113 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19115 d_stdio_stream_array="$define"
19119 : see if strcoll exists
19120 set strcoll d_strcoll
19123 : check for structure copying
19125 echo "Checking to see if your C compiler can copy structs..." >&4
19126 $cat >try.c <<'EOCP'
19136 if $cc -c try.c >/dev/null 2>&1 ; then
19138 echo "Yup, it can."
19141 echo "Nope, it can't."
19147 : see if strerror and/or sys_errlist[] exist
19149 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19150 if set strerror val -f d_strerror; eval $csym; $val; then
19151 echo 'strerror() found.' >&4
19152 d_strerror="$define"
19153 d_strerrm='strerror(e)'
19154 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19155 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19156 d_syserrlst="$define"
19158 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19159 d_syserrlst="$undef"
19161 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19162 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19163 echo 'strerror() found in string header.' >&4
19164 d_strerror="$define"
19165 d_strerrm='strerror(e)'
19166 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19167 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19168 d_syserrlst="$define"
19170 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19171 d_syserrlst="$undef"
19173 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19174 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19175 d_strerror="$undef"
19176 d_syserrlst="$define"
19177 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19179 echo 'strerror() and sys_errlist[] NOT found.' >&4
19180 d_strerror="$undef"
19181 d_syserrlst="$undef"
19182 d_strerrm='"unknown"'
19186 : see if strerror_r exists
19187 set strerror_r d_strerror_r
19189 case "$d_strerror_r" in
19191 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19192 case "$d_strerror_r_proto:$usethreads" in
19193 ":define") d_strerror_r_proto=define
19194 set d_strerror_r_proto strerror_r $hdrs
19198 case "$d_strerror_r_proto" in
19200 case "$strerror_r_proto" in
19201 ''|0) try='int strerror_r(int, char*, size_t);'
19202 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19204 case "$strerror_r_proto" in
19205 ''|0) try='int strerror_r(int, char*, int);'
19206 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19208 case "$strerror_r_proto" in
19209 ''|0) try='char* strerror_r(int, char*, size_t);'
19210 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19212 case "$strerror_r_proto" in
19213 ''|0) d_strerror_r=undef
19215 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19216 * ) case "$strerror_r_proto" in
19217 REENTRANT_PROTO*) ;;
19218 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19220 echo "Prototype: $try" ;;
19223 *) case "$usethreads" in
19224 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19231 *) strerror_r_proto=0
19235 : see if strftime exists
19236 set strftime d_strftime
19239 : see if strlcat exists
19240 set strlcat d_strlcat
19243 : see if strlcpy exists
19244 set strlcpy d_strlcpy
19247 : see if strtod exists
19248 set strtod d_strtod
19251 : see if strtol exists
19252 set strtol d_strtol
19255 : see if strtold exists
19256 set strtold d_strtold
19259 : see if strtoll exists
19260 set strtoll d_strtoll
19263 case "$d_longlong-$d_strtoll" in
19266 Checking whether your strtoll() works okay...
19268 $cat >try.c <<'EOCP'
19271 #define strtoll __strtoll
19274 #define strtoll _strtoll
19277 extern long long int strtoll(char *s, char **, int);
19278 static int bad = 0;
19279 int check(char *s, long long ell, int een) {
19282 gll = strtoll(s, 0, 10);
19283 if (!((gll == ell) && (errno == een)))
19287 check(" 1", 1LL, 0);
19288 check(" 0", 0LL, 0);
19289 check("-1", -1LL, 0);
19290 check("-9223372036854775808", -9223372036854775808LL, 0);
19291 check("-9223372036854775808", -9223372036854775808LL, 0);
19292 check(" 9223372036854775807", 9223372036854775807LL, 0);
19293 check("-9223372036854775808", -9223372036854775808LL, 0);
19294 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19295 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19301 if eval $compile; then
19304 ok) echo "Your strtoll() seems to be working okay." ;;
19306 Your strtoll() doesn't seem to be working okay.
19312 echo "(I can't seem to compile the test program--assuming it doesn't)"
19318 : see if strtoq exists
19319 set strtoq d_strtoq
19322 : see if strtoul exists
19323 set strtoul d_strtoul
19326 case "$d_strtoul" in
19329 Checking whether your strtoul() works okay...
19331 $cat >try.c <<'EOCP'
19334 extern unsigned long int strtoul(char *s, char **, int);
19335 static int bad = 0;
19336 void check(char *s, unsigned long eul, int een) {
19339 gul = strtoul(s, 0, 10);
19340 if (!((gul == eul) && (errno == een)))
19344 check(" 1", 1L, 0);
19345 check(" 0", 0L, 0);
19347 case "$longsize" in
19349 $cat >>try.c <<'EOCP'
19350 check("18446744073709551615", 18446744073709551615UL, 0);
19351 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19352 #if 0 /* strtoul() for /^-/ strings is undefined. */
19353 check("-1", 18446744073709551615UL, 0);
19354 check("-18446744073709551614", 2, 0);
19355 check("-18446744073709551615", 1, 0);
19356 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19357 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19362 $cat >>try.c <<'EOCP'
19363 check("4294967295", 4294967295UL, 0);
19364 check("4294967296", 4294967295UL, ERANGE);
19365 #if 0 /* strtoul() for /^-/ strings is undefined. */
19366 check("-1", 4294967295UL, 0);
19367 check("-4294967294", 2, 0);
19368 check("-4294967295", 1, 0);
19369 check("-4294967296", 4294967295UL, ERANGE);
19370 check("-4294967297", 4294967295UL, ERANGE);
19375 : Should we write these tests to be more portable by sprintf-ing
19376 : ~0 and then manipulating that char string as input for strtol?
19379 $cat >>try.c <<'EOCP'
19386 if eval $compile; then
19387 case "`$run ./try`" in
19388 ok) echo "Your strtoul() seems to be working okay." ;;
19390 Your strtoul() doesn't seem to be working okay.
19396 echo "(I can't seem to compile the test program--assuming it doesn't)"
19402 : see if strtoull exists
19403 set strtoull d_strtoull
19406 case "$d_longlong-$d_strtoull" in
19409 Checking whether your strtoull() works okay...
19411 $cat >try.c <<'EOCP'
19414 #define strtoull __strtoull
19417 extern unsigned long long int strtoull(char *s, char **, int);
19418 static int bad = 0;
19419 int check(char *s, long long eull, int een) {
19422 gull = strtoull(s, 0, 10);
19423 if (!((gull == eull) && (errno == een)))
19427 check(" 1", 1LL, 0);
19428 check(" 0", 0LL, 0);
19429 check("18446744073709551615", 18446744073709551615ULL, 0);
19430 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19431 #if 0 /* strtoull() for /^-/ strings is undefined. */
19432 check("-1", 18446744073709551615ULL, 0);
19433 check("-18446744073709551614", 2LL, 0);
19434 check("-18446744073709551615", 1LL, 0);
19435 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19436 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19443 if eval $compile; then
19444 case "`$run ./try`" in
19445 ok) echo "Your strtoull() seems to be working okay." ;;
19447 Your strtoull() doesn't seem to be working okay.
19449 d_strtoull="$undef"
19453 echo "(I can't seem to compile the test program--assuming it doesn't)"
19454 d_strtoull="$undef"
19459 : see if strtouq exists
19460 set strtouq d_strtouq
19463 case "$d_strtouq" in
19466 Checking whether your strtouq() works okay...
19468 $cat >try.c <<'EOCP'
19471 extern unsigned long long int strtouq(char *s, char **, int);
19472 static int bad = 0;
19473 void check(char *s, unsigned long long eull, int een) {
19474 unsigned long long gull;
19476 gull = strtouq(s, 0, 10);
19477 if (!((gull == eull) && (errno == een)))
19481 check(" 1", 1LL, 0);
19482 check(" 0", 0LL, 0);
19483 check("18446744073709551615", 18446744073709551615ULL, 0);
19484 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19485 #if 0 /* strtouq() for /^-/ strings is undefined. */
19486 check("-1", 18446744073709551615ULL, 0);
19487 check("-18446744073709551614", 2LL, 0);
19488 check("-18446744073709551615", 1LL, 0);
19489 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19490 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19498 if eval $compile; then
19499 case "`$run ./try`" in
19500 ok) echo "Your strtouq() seems to be working okay." ;;
19502 Your strtouq() doesn't seem to be working okay.
19508 echo "(I can't seem to compile the test program--assuming it doesn't)"
19514 : see if strxfrm exists
19515 set strxfrm d_strxfrm
19518 : see if symlink exists
19519 set symlink d_symlink
19522 : see if syscall exists
19523 set syscall d_syscall
19526 : see if prototype for syscall is available
19528 set d_syscallproto syscall $i_unistd unistd.h
19531 : see if sysconf exists
19532 set sysconf d_sysconf
19535 : see if system exists
19536 set system d_system
19539 : see if tcgetpgrp exists
19540 set tcgetpgrp d_tcgetpgrp
19543 : see if tcsetpgrp exists
19544 set tcsetpgrp d_tcsetpgrp
19547 : see if prototype for telldir is available
19549 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19552 : see if time exists
19554 if test "X$d_time" = X -o X"$timetype" = X; then
19555 if set time val -f d_time; eval $csym; $val; then
19556 echo 'time() found.' >&4
19558 rp="What is the type returned by time() on this system?"
19559 set time_t timetype long stdio.h sys/types.h
19562 echo 'time() not found, hope that will do.' >&4
19570 : see if timegm exists
19571 set timegm d_timegm
19574 : see if this is a sys/times.h system
19575 set sys/times.h i_systimes
19578 : see if times exists
19580 if set times val -f d_times; eval $csym; $val; then
19581 echo 'times() found.' >&4
19584 case "$i_systimes" in
19585 "$define") inc='sys/times.h';;
19587 rp="What is the type returned by times() on this system?"
19588 set clock_t clocktype long stdio.h sys/types.h $inc
19591 echo 'times() NOT found, hope that will do.' >&4
19596 : see if tmpnam_r exists
19597 set tmpnam_r d_tmpnam_r
19599 case "$d_tmpnam_r" in
19601 hdrs="$i_systypes sys/types.h define stdio.h "
19602 case "$d_tmpnam_r_proto:$usethreads" in
19603 ":define") d_tmpnam_r_proto=define
19604 set d_tmpnam_r_proto tmpnam_r $hdrs
19608 case "$d_tmpnam_r_proto" in
19610 case "$tmpnam_r_proto" in
19611 ''|0) try='char* tmpnam_r(char*);'
19612 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19614 case "$tmpnam_r_proto" in
19615 ''|0) d_tmpnam_r=undef
19617 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19618 * ) case "$tmpnam_r_proto" in
19619 REENTRANT_PROTO*) ;;
19620 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19622 echo "Prototype: $try" ;;
19625 *) case "$usethreads" in
19626 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19633 *) tmpnam_r_proto=0
19637 : see if truncate exists
19638 set truncate d_truncate
19641 : see if ttyname_r exists
19642 set ttyname_r d_ttyname_r
19644 case "$d_ttyname_r" in
19646 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19647 case "$d_ttyname_r_proto:$usethreads" in
19648 ":define") d_ttyname_r_proto=define
19649 set d_ttyname_r_proto ttyname_r $hdrs
19653 case "$d_ttyname_r_proto" in
19655 case "$ttyname_r_proto" in
19656 ''|0) try='int ttyname_r(int, char*, size_t);'
19657 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19659 case "$ttyname_r_proto" in
19660 ''|0) try='int ttyname_r(int, char*, int);'
19661 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19663 case "$ttyname_r_proto" in
19664 ''|0) try='char* ttyname_r(int, char*, int);'
19665 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19667 case "$ttyname_r_proto" in
19668 ''|0) d_ttyname_r=undef
19670 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19671 * ) case "$ttyname_r_proto" in
19672 REENTRANT_PROTO*) ;;
19673 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19675 echo "Prototype: $try" ;;
19678 *) case "$usethreads" in
19679 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19686 *) ttyname_r_proto=0
19690 : see if tzname[] exists
19692 if set tzname val -a d_tzname; eval $csym; $val; then
19694 echo 'tzname[] found.' >&4
19697 echo 'tzname[] NOT found.' >&4
19702 : Check if is a multiplatform env
19704 darwin) multiarch="$define" ;;
19706 case "$multiarch" in
19707 ''|[nN]*) multiarch="$undef" ;;
19710 : check for ordering of bytes in a UV
19712 case "$multiarch" in
19715 You seem to be doing a multiarchitecture build,
19716 skipping the byteorder check.
19722 case "$byteorder" in
19725 In the following, larger digits indicate more significance. A big-endian
19726 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19727 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19728 machines may have weird orders like 3412. A Cray will report 87654321,
19729 an Alpha will report 12345678. If the test program works the default is
19731 I'm now running the test program...
19735 #$i_stdlib I_STDLIB
19737 #include <stdlib.h>
19739 #include <sys/types.h>
19740 typedef $uvtype UV;
19750 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19752 u.l = (UV)0x04030201;
19753 for (i = 0; i < $uvsize; i++)
19754 printf("%c", u.c[i]+'0');
19761 if eval $compile && $run ./try > /dev/null; then
19764 [1-4][1-4][1-4][1-4]|12345678|87654321)
19765 echo "(The test program ran ok.)"
19766 echo "byteorder=$dflt"
19769 ????|????????) echo "(The test program ran ok.)" ;;
19770 *) echo "(The test program didn't run right for some reason.)" ;;
19775 (I can't seem to compile the test program. Guessing big-endian...)
19778 case "$xxx_prompt" in
19780 rp="What is the order of bytes in $uvtype?"
19793 : Checking 32bit alignedness
19796 Checking to see whether you can access character data unalignedly...
19798 case "$d_u32align" in
19799 '') $cat >try.c <<EOCP
19801 #$i_stdlib I_STDLIB
19803 #include <stdlib.h>
19805 #define U32 $u32type
19806 #define BYTEORDER 0x$byteorder
19808 #include <signal.h>
19810 $signal_t bletch(int s) { exit(4); }
19813 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19814 volatile U8 buf[8];
19818 if (sizeof(U32) != 4) {
19819 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19826 signal(SIGBUS, bletch);
19838 for (i = 0; i < 4; i++) {
19839 up = (U32*)(buf + i);
19840 if (! ((*up == 1 << (8*i)) || /* big-endian */
19841 (*up == 1 << (8*(3-i))) /* little-endian */
19845 printf("read failed (%x)\n", *up);
19851 for (i = 0; i < 4; i++) {
19852 up = (U32*)(buf + i);
19854 if (*up != 0xBeef) {
19855 printf("write failed (%x)\n", *up);
19869 if eval $compile_ok; then
19870 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19871 $run ./try 2>&1 >/dev/null
19874 You can access character data pretty unalignedly.
19876 d_u32align="$undef"
19879 It seems that you must access character data in an aligned manner.
19881 d_u32align="$define"
19885 rp='Can you access character data at unaligned addresses?'
19889 [yY]*) d_u32align="$undef" ;;
19890 *) d_u32align="$define" ;;
19897 : see if ualarm exists
19898 set ualarm d_ualarm
19901 : see if umask exists
19905 : see if unordered exists
19906 set unordered d_unordered
19909 : see if unsetenv exists
19910 set unsetenv d_unsetenv
19913 : see if usleep exists
19914 set usleep d_usleep
19917 : see if prototype for usleep is available
19919 set d_usleepproto usleep $i_unistd unistd.h
19922 : see if ustat exists
19926 : see if closedir exists
19927 set closedir d_closedir
19930 case "$d_closedir" in
19933 echo "Checking whether closedir() returns a status..." >&4
19935 #$i_dirent I_DIRENT /**/
19936 #$i_sysdir I_SYS_DIR /**/
19937 #$i_sysndir I_SYS_NDIR /**/
19938 #$i_systypes I_SYS_TYPES /**/
19940 #if defined(I_SYS_TYPES)
19941 #include <sys/types.h>
19943 #if defined(I_DIRENT)
19944 #include <dirent.h>
19947 #include <sys/ndir.h>
19951 #include <ndir.h> /* may be wrong in the future */
19953 #include <sys/dir.h>
19958 int main() { return closedir(opendir(".")); }
19961 if eval $compile_ok; then
19962 if $run ./try > /dev/null 2>&1 ; then
19963 echo "Yes, it does."
19966 echo "No, it doesn't."
19970 echo "(I can't seem to compile the test program--assuming it doesn't)"
19978 set d_void_closedir
19982 : see if there is a wait4
19986 : see if waitpid exists
19987 set waitpid d_waitpid
19992 $cat >try.c <<'EOCP'
19998 return (wcscmp (s, s) ? 1 : 0);
20003 if eval $compile; then
20006 0) echo "A working wcscmp() found." >&4
20008 *) echo "wcscmp() found, but it doesn't work" >&4
20012 echo "wcscmp() NOT found." >&4
20018 : see if wcstombs exists
20019 set wcstombs d_wcstombs
20024 $cat >try.c <<'EOCP'
20029 wchar_t dst[4], *src = L" ";
20031 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20036 if eval $compile; then
20039 0) echo "A working wcsxfrm() found." >&4
20041 *) echo "wcsxfrm() found, but it doesn't work" >&4
20045 echo "wcsxfrm() NOT found." >&4
20051 : see if wctomb exists
20052 set wctomb d_wctomb
20055 : see if writev exists
20056 set writev d_writev
20059 : check for alignment requirements
20061 case "$alignbytes" in
20062 '') echo "Checking alignment constraints..." >&4
20063 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20064 $cat >try.c <<'EOCP'
20065 typedef long double NV;
20068 $cat >try.c <<'EOCP'
20072 $cat >>try.c <<'EOCP'
20080 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20085 if eval $compile_ok; then
20089 echo "(I can't seem to compile the test program...)"
20091 case "$multiarch" in
20093 : The usual safe value is 8, but Darwin with -Duselongdouble
20094 : needs 16. Hence, we will take 8 as a minimum, but allow
20095 : Configure to pick a larger value if needed.
20096 if $test "$dflt" -lt 8; then
20098 echo "Setting alignment to 8 for multiarch support.">&4
20103 *) dflt="$alignbytes"
20106 rp="Doubles must be aligned on a how-many-byte boundary?"
20111 : set the base revision
20114 : length of character in bytes. Is always 1, otherwise it is not C
20115 : This used to be a test using sizeof
20118 : Check for the number of bits in a character
20119 case "$charbits" in
20120 '') echo "Checking how long a character is (in bits)..." >&4
20127 for (c = 1, n = 0; c; c <<= 1, n++) ;
20128 printf ("%d\n", n);
20133 if eval $compile_ok; then
20137 echo "(I can't seem to compile the test program. Guessing...)"
20144 rp="What is the length of a character (in bits)?"
20148 case "$charbits" in
20151 Your system has an unsigned character size of $charbits bits, which
20152 is rather unusual (normally it is 8 bits). Perl likely will not work
20153 correctly on your system, with subtle bugs in various places.
20155 rp='Do you really want to continue?'
20159 [yY]) echo >&4 "Okay, continuing." ;;
20164 : how do we concatenate cpp tokens here?
20166 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20167 $cat >cpp_stuff.c <<'EOCP'
20168 #define RCAT(a,b)a/**/b
20169 #define ACAT(a,b)a ## b
20173 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20174 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20175 echo "Oh! Smells like ANSI's been here." >&4
20176 echo "We can catify or stringify, separately or together!"
20178 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20179 echo "Ah, yes! The good old days!" >&4
20180 echo "However, in the good old days we don't know how to stringify and"
20181 echo "catify at the same time."
20185 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20186 You're going to have to edit the values of CAT[2-5] in config.h...
20188 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20192 : see if this is a db.h system
20198 : Check db version.
20200 echo "Checking Berkeley DB version ..." >&4
20206 #include <sys/types.h>
20208 #$i_stdlib I_STDLIB
20210 #include <stdlib.h>
20213 int main(int argc, char *argv[])
20215 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20216 int Major, Minor, Patch ;
20217 unsigned long Version ;
20218 (void)db_version(&Major, &Minor, &Patch) ;
20220 printf("%d %d %d %d %d %d\n",
20221 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20222 Major, Minor, Patch);
20225 printf("You have Berkeley DB Version 2 or greater.\n");
20227 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20228 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20229 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20230 Major, Minor, Patch) ;
20232 /* check that db.h & libdb are compatible */
20233 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20234 printf("db.h and libdb are incompatible.\n") ;
20238 printf("db.h and libdb are compatible.\n") ;
20240 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20241 + DB_VERSION_PATCH ;
20243 /* needs to be >= 2.3.4 */
20244 if (Version < 2003004) {
20245 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20246 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20252 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20257 printf("You have Berkeley DB Version 1.\n");
20258 exit(0); /* DB version < 2: the coast is clear. */
20260 exit(1); /* <db.h> not Berkeley DB? */
20266 if eval $compile_ok && $run ./try; then
20267 echo 'Looks OK.' >&4
20269 db_version_major=$1
20270 db_version_minor=$2
20271 db_version_patch=$3
20273 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20277 : Remove db from list of libraries to use
20278 echo "Removing unusable -ldb from library list" >&4
20279 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20282 echo "libs = $libs" >&4
20292 : Check the return type needed for hash
20294 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20300 #include <sys/types.h>
20303 #ifndef DB_VERSION_MAJOR
20304 u_int32_t hash_cb (const void* ptr, size_t size)
20310 info.hash = hash_cb;
20314 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20315 if $contains warning try.out >>/dev/null 2>&1 ; then
20318 db_hashtype='u_int32_t'
20321 : XXX Maybe we should just give up here.
20322 db_hashtype=u_int32_t
20324 echo "Help: I can't seem to compile the db test program." >&4
20325 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20328 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20330 *) db_hashtype=u_int32_t
20335 : Check the return type needed for prefix
20337 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20343 #include <sys/types.h>
20346 #ifndef DB_VERSION_MAJOR
20347 size_t prefix_cb (const DBT *key1, const DBT *key2)
20353 info.prefix = prefix_cb;
20357 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20358 if $contains warning try.out >>/dev/null 2>&1 ; then
20359 db_prefixtype='int'
20361 db_prefixtype='size_t'
20364 db_prefixtype='size_t'
20365 : XXX Maybe we should just give up here.
20367 echo "Help: I can't seem to compile the db test program." >&4
20368 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20371 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20373 *) db_prefixtype='size_t'
20377 : How can we generate normalized random numbers ?
20379 echo "Using our internal random number implementation..." >&4
20382 *-Dmy_rand=*|*-Dmy_srand=*)
20383 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20384 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20385 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20386 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20390 randfunc=Perl_drand48
20391 drand01="Perl_drand48()"
20392 seedfunc="Perl_drand48_init"
20396 : Determine if this is an EBCDIC system
20398 echo "Determining whether or not we are on an EBCDIC system..." >&4
20399 $cat >try.c <<'EOM'
20402 if ('M'==0xd4) return 0;
20409 if eval $compile_ok; then
20410 if $run ./try; then
20411 echo "You seem to speak EBCDIC." >&4
20414 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20417 echo "I'm unable to compile the test program." >&4
20418 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20424 : Check how to flush
20427 Checking how to flush all pending stdio output...
20429 # I only know how to find the first 32 possibly open files on SunOS.
20430 # See also hints/sunos_4_1.sh and util.c --AD
20432 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20434 $cat >>try.c <<EOCP
20436 #$i_stdlib I_STDLIB
20438 #include <stdlib.h>
20440 #$i_unistd I_UNISTD
20442 # include <unistd.h>
20444 #$d_sysconf HAS_SYSCONF
20445 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20446 #ifdef HAS_STDIO_STREAM_ARRAY
20447 # define STDIO_STREAM_ARRAY $stdio_stream_array
20452 p = fopen("try.out", "w");
20456 # ifdef TRY_FPRINTF
20460 #ifdef TRY_FFLUSH_NULL
20463 #ifdef TRY_FFLUSH_ALL
20465 long open_max = -1;
20466 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20467 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20469 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20470 open_max = sysconf(_SC_OPEN_MAX);
20473 open_max = FOPEN_MAX;
20476 open_max = OPEN_MAX;
20485 # ifdef HAS_STDIO_STREAM_ARRAY
20486 if (open_max > 0) {
20488 for (i = 0; i < open_max; i++)
20489 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20490 STDIO_STREAM_ARRAY[i]._file < open_max &&
20491 STDIO_STREAM_ARRAY[i]._flag)
20492 fflush(&STDIO_STREAM_ARRAY[i]);
20500 : first we have to find out how _not_ to flush
20502 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20504 set try -DTRY_FPUTC
20505 if eval $compile; then
20506 $run ./try 2>/dev/null
20509 if $test ! -s try.out -a "X$code" = X42; then
20515 set try -DTRY_FPRINTF
20516 if eval $compile; then
20517 $run ./try 2>/dev/null
20520 if $test ! -s try.out -a "X$code" = X42; then
20521 output=-DTRY_FPRINTF
20527 : check for fflush NULL behavior
20528 case "$fflushNULL" in
20529 '') set try -DTRY_FFLUSH_NULL $output
20530 if eval $compile; then
20531 $run ./try 2>/dev/null
20534 if $test -s try.out -a "X$code" = X42; then
20535 fflushNULL="`$cat try.out`"
20537 if $test "X$code" != X42; then
20539 (If this test failed, don't worry, we'll try another method shortly.)
20544 $rm -f core try.core core.try.*
20545 case "$fflushNULL" in
20547 Your fflush(NULL) works okay for output streams.
20548 Let's see if it clobbers input pipes...
20550 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20551 # bug that improperly flushes the input end of pipes. So we avoid the
20552 # autoflush on fork/system/exec support for now. :-(
20553 $cat >tryp.c <<EOCP
20556 main(int argc, char **argv)
20562 while ((i = getc(stdin)) != -1
20563 && (*bp++ = i) != '\n'
20564 && bp < &buf[1024])
20567 fprintf(stdout, "%s", buf);
20575 fflushNULL="$define"
20577 if eval $compile; then
20579 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20580 if $test "X$targethost" != X; then
20583 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20585 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20587 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20589 fflush(NULL) seems to behave okay with input streams.
20591 fflushNULL="$define"
20594 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20596 fflushNULL="$undef"
20599 $rm -f core tryp.c tryp.core core.tryp.*
20602 Your fflush(NULL) isn't working (contrary to ANSI C).
20604 fflushNULL="$undef"
20607 Cannot figure out whether your fflush(NULL) works or not.
20608 I'm assuming it doesn't (contrary to ANSI C).
20610 fflushNULL="$undef"
20614 $define|true|[yY]*)
20615 fflushNULL="$define"
20618 fflushNULL="$undef"
20621 : check explicit looping only if NULL did not work, and if the pipe
20622 : bug does not show up on an explicit flush too
20623 case "$fflushNULL" in
20625 $cat >tryp.c <<EOCP
20628 main(int argc, char **argv)
20634 while ((i = getc(stdin)) != -1
20635 && (*bp++ = i) != '\n'
20636 && bp < &buf[1024])
20639 fprintf(stdout, "%s", buf);
20648 if eval $compile; then
20650 if $test "X$targethost" != X; then
20653 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20655 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20657 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20659 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20661 : now check for fflushall behaviour
20662 case "$fflushall" in
20663 '') set try -DTRY_FFLUSH_ALL $output
20664 if eval $compile; then
20666 (Now testing the other method--but note that this also may fail.)
20668 $run ./try 2>/dev/null
20671 if $test -s try.out -a "X$code" = X42; then
20672 fflushall="`$cat try.out`"
20676 case "$fflushall" in
20678 Whew. Flushing explicitly all the stdio streams works.
20680 fflushall="$define"
20683 Sigh. Flushing explicitly all the stdio streams doesn't work.
20688 Cannot figure out whether flushing stdio streams explicitly works or not.
20689 I'm assuming it doesn't.
20695 "$define"|true|[yY]*)
20696 fflushall="$define"
20704 All is futile. Even fflush(stdin) clobbers input pipes!
20711 $rm -f core tryp.c tryp.core core.tryp.*
20713 *) fflushall="$undef"
20717 case "$fflushNULL$fflushall" in
20720 OK, I give up. I cannot figure out how to flush pending stdio output.
20721 We won't be flushing handles at all before fork/exec/popen.
20727 : Store the full pathname to the ar program for use in the C program
20728 : Respect a hint or command line value for full_ar.
20733 : Store the full pathname to the sed program for use in the C program
20736 : see what type gids are declared as in the kernel
20738 echo "Looking for the type for group ids returned by getgid()."
20739 set gid_t gidtype xxx stdio.h sys/types.h
20743 xxx=`./findhdr sys/user.h`
20744 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20746 unsigned) dflt="$1 $2" ;;
20750 *) dflt="$gidtype";;
20753 gid_t) echo "gid_t found." ;;
20754 *) rp="What is the type for group ids returned by getgid()?"
20760 : Check the size of GID
20763 *_t) zzz="$gidtype" ;;
20766 echo "Checking the size of $zzz..." >&4
20768 #include <sys/types.h>
20770 #$i_stdlib I_STDLIB
20772 #include <stdlib.h>
20775 printf("%d\n", (int)sizeof($gidtype));
20780 if eval $compile_ok; then
20784 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20787 echo "Your $zzz is $gidsize bytes long."
20792 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20796 : Check if GID is signed
20799 *_t) zzz="$gidtype" ;;
20802 echo "Checking the sign of $zzz..." >&4
20804 #include <sys/types.h>
20815 if eval $compile; then
20819 echo "(I can't execute the test program--guessing unsigned.)" >&4
20823 1) echo "Your $zzz is unsigned." ;;
20824 -1) echo "Your $zzz is signed." ;;
20830 echo "(I can't compile the test program--guessing unsigned.)" >&4
20834 : Check 64bit sizes
20837 if $test X"$quadtype" != X; then
20839 echo "Checking how to print 64-bit integers..." >&4
20841 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20842 $cat >try.c <<'EOCP'
20843 #include <sys/types.h>
20846 int q = 12345678901;
20847 printf("%ld\n", q);
20851 if eval $compile; then
20855 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20856 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20857 echo "We will use %d."
20863 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20864 $cat >try.c <<'EOCP'
20865 #include <sys/types.h>
20868 long q = 12345678901;
20869 printf("%ld\n", q);
20873 if eval $compile; then
20877 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20878 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20879 echo "We will use %ld."
20885 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20886 $cat >try.c <<'EOCP'
20887 #include <sys/types.h>
20888 #include <inttypes.h>
20891 int64_t q = 12345678901;
20892 printf("%" PRId64 "\n", q);
20896 if eval $compile; then
20900 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20901 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20902 echo "We will use the C9X style."
20908 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20910 #include <sys/types.h>
20913 $quadtype q = 12345678901;
20914 printf("%Ld\n", q);
20918 if eval $compile; then
20922 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20923 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20924 echo "We will use %Ld."
20930 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20931 $cat >try.c <<'EOCP'
20932 #include <sys/types.h>
20935 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20936 printf("%lld\n", q);
20940 if eval $compile; then
20944 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20945 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20946 echo "We will use the %lld style."
20952 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20954 #include <sys/types.h>
20957 $quadtype q = 12345678901;
20958 printf("%qd\n", q);
20962 if eval $compile; then
20966 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20967 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20968 echo "We will use %qd."
20974 if $test X"$sPRId64" = X; then
20975 echo "Cannot figure out how to print 64-bit integers." >&4
20982 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20983 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20985 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20986 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20990 : Check format strings for internal types
20992 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20994 if $test X"$ivsize" = X8; then
20995 ivdformat="$sPRId64"
20996 uvuformat="$sPRIu64"
20997 uvoformat="$sPRIo64"
20998 uvxformat="$sPRIx64"
20999 uvXUformat="$sPRIXU64"
21001 if $test X"$ivsize" = X"$longsize"; then
21008 if $test X"$ivsize" = X"$intsize"; then
21016 if $test X"$ivsize" = X"$shortsize"; then
21027 if $test X"$usequadmath" = X"$define"; then
21035 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21036 nveformat="$sPRIeldbl"
21037 nvfformat="$sPRIfldbl"
21038 nvgformat="$sPRIgldbl"
21039 nvEUformat="$sPRIEUldbl"
21040 nvFUformat="$sPRIFUldbl"
21041 nvGUformat="$sPRIGUldbl"
21052 case "$ivdformat" in
21053 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21058 : Check format string for GID
21061 $echo "Checking the format string to be used for gids..." >&4
21064 -1) if $test X"$gidsize" = X"$ivsize"; then
21065 gidformat="$ivdformat"
21067 if $test X"$gidsize" = X"$longsize"; then
21070 if $test X"$gidsize" = X"$intsize"; then
21073 if $test X"$gidsize" = X"$shortsize"; then
21080 *) if $test X"$gidsize" = X"$uvsize"; then
21081 gidformat="$uvuformat"
21083 if $test X"$gidsize" = X"$longsize"; then
21086 if $test X"$gidsize" = X"$intsize"; then
21089 if $test X"$gidsize" = X"$shortsize"; then
21098 : see if getgroups exists
21099 set getgroups d_getgrps
21102 : see if setgroups exists
21103 set setgroups d_setgrps
21106 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21108 case "$d_getgrps$d_setgrps" in
21110 case "$groupstype" in
21111 '') dflt="$gidtype" ;;
21112 *) dflt="$groupstype" ;;
21115 What type of pointer is the second argument to getgroups() and setgroups()?
21116 Usually this is the same as group ids, $gidtype, but not always.
21119 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21123 *) groupstype="$gidtype";;
21126 : check whether make sets MAKE
21128 echo "Checking if your $make program sets \$(MAKE)..." >&4
21129 case "$make_set_make" in
21131 $sed 's/^X //' > testmake.mak << 'EOF'
21133 X @echo 'maketemp="$(MAKE)"'
21135 case "`$make -f testmake.mak 2>/dev/null`" in
21136 *maketemp=*) make_set_make='#' ;;
21137 *) make_set_make="MAKE=$make" ;;
21139 $rm -f testmake.mak
21142 case "$make_set_make" in
21143 '#') echo "Yup, it does.";;
21144 *) echo "Nope, it doesn't.";;
21147 : see what type is used for mode_t
21148 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21149 set mode_t modetype int stdio.h sys/types.h
21152 : see if we need va_copy
21154 case "$i_stdarg" in
21157 #include <stdarg.h>
21159 #$i_stdlib I_STDLIB
21161 #include <stdlib.h>
21163 #include <signal.h>
21166 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21168 return vfprintf(f, fmt, *valp);
21172 myvfprintf(FILE *f, const char *fmt, va_list val)
21174 return ivfprintf(f, fmt, &val);
21178 myprintf(char *fmt, ...)
21181 va_start(val, fmt);
21182 return myvfprintf(stdout, fmt, val);
21186 main(int ac, char **av)
21188 signal(SIGSEGV, exit);
21190 myprintf("%s%cs all right, then\n", "that", '\'');
21195 if eval $compile && $run ./try 2>&1 >/dev/null; then
21196 case "`$run ./try`" in
21197 "that's all right, then")
21203 yes) echo "It seems that you don't need va_copy()." >&4
21204 need_va_copy="$undef"
21206 *) echo "It seems that va_copy() or similar will be needed." >&4
21207 need_va_copy="$define"
21212 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21213 need_va_copy="$undef"
21217 : see what type is used for size_t
21218 rp="What is the type used for the length parameter for string functions?"
21219 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21222 : check for type of arguments to gethostbyaddr.
21223 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21224 case "$d_gethbyaddr" in
21228 Checking to see what type of arguments are accepted by gethostbyaddr().
21230 hdrs="$define sys/types.h
21231 $d_socket sys/socket.h
21232 $i_niin netinet/in.h
21234 $i_unistd unistd.h"
21235 : The first arg can 'char *' or 'void *'
21236 : The second arg is some of integral type
21237 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21238 for yyy in size_t long int; do
21239 case "$netdb_host_type" in
21240 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21241 if ./protochk "$try" $hdrs; then
21242 echo "Your system accepts $xxx for the first arg."
21243 echo "...and $yyy for the second arg."
21244 netdb_host_type="$xxx"
21245 netdb_hlen_type="$yyy"
21251 : In case none of those worked, prompt the user.
21252 case "$netdb_host_type" in
21253 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21256 netdb_host_type=$ans
21257 rp='What is the type for the 2nd argument to gethostbyaddr?'
21260 netdb_hlen_type=$ans
21264 *) : no gethostbyaddr, so pick harmless defaults
21265 netdb_host_type='char *'
21266 netdb_hlen_type="$sizetype"
21269 # Remove the "const" if needed. -- but then we'll have a
21271 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21274 : check for type of argument to gethostbyname.
21275 if test "X$netdb_name_type" = X ; then
21276 case "$d_gethbyname" in
21280 Checking to see what type of argument is accepted by gethostbyname().
21282 hdrs="$define sys/types.h
21283 $d_socket sys/socket.h
21284 $i_niin netinet/in.h
21286 $i_unistd unistd.h"
21287 for xxx in "const char *" "char *"; do
21288 case "$netdb_name_type" in
21289 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21290 if ./protochk "$try" $hdrs; then
21291 echo "Your system accepts $xxx."
21292 netdb_name_type="$xxx"
21297 : In case none of those worked, prompt the user.
21298 case "$netdb_name_type" in
21299 '') rp='What is the type for the 1st argument to gethostbyname?'
21302 netdb_name_type=$ans
21306 *) : no gethostbyname, so pick harmless default
21307 netdb_name_type='char *'
21312 : check for type of 1st argument to getnetbyaddr.
21313 if test "X$netdb_net_type" = X ; then
21314 case "$d_getnbyaddr" in
21318 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21320 hdrs="$define sys/types.h
21321 $d_socket sys/socket.h
21322 $i_niin netinet/in.h
21324 $i_unistd unistd.h"
21325 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21326 case "$netdb_net_type" in
21327 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21328 if ./protochk "$try" $hdrs; then
21329 echo "Your system accepts $xxx."
21330 netdb_net_type="$xxx"
21335 : In case none of those worked, prompt the user.
21336 case "$netdb_net_type" in
21337 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21340 netdb_net_type=$ans
21344 *) : no getnetbyaddr, so pick harmless default
21345 netdb_net_type='long'
21349 : locate the preferred pager for this system
21356 [a-zA-Z]:/*) dflt=$pg;;
21360 [a-zA-Z]:/*) dflt=$more;;
21364 [a-zA-Z]:/*) dflt=$less;;
21367 '') dflt=/usr/ucb/more;;
21375 rp='What pager is used on your system?'
21379 : see what type pids are declared as in the kernel
21380 rp="What is the type of process ids on this system?"
21381 set pid_t pidtype int stdio.h sys/types.h
21384 : see if ar generates random libraries by itself
21386 echo "Checking how to generate random libraries on your machine..." >&4
21387 echo 'int bar1() { return bar2(); }' > bar1.c
21388 echo 'int bar2() { return 2; }' > bar2.c
21390 #$i_stdlib I_STDLIB
21392 #include <stdlib.h>
21394 int main() { printf("%d\n", bar1()); exit(0); }
21396 $cc $ccflags -c bar1.c >/dev/null 2>&1
21397 $cc $ccflags -c bar2.c >/dev/null 2>&1
21398 $cc $ccflags -c foo.c >/dev/null 2>&1
21399 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21400 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21401 $run ./foobar >/dev/null 2>&1; then
21402 echo "$ar appears to generate random libraries itself."
21404 if [ "X$ranlib" = "X" ]; then
21407 elif $ar s bar$_a >/dev/null 2>&1 &&
21408 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21409 $run ./foobar >/dev/null 2>&1; then
21410 echo "a table of contents needs to be added with '$ar s'."
21413 elif $ar ts bar$_a >/dev/null 2>&1 &&
21414 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21415 $run ./foobar >/dev/null 2>&1; then
21416 echo "a table of contents needs to be added with '$ar ts'."
21423 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21424 $test -f $ranlib || ranlib=''
21427 if $test -n "$ranlib"; then
21428 echo "your system has '$ranlib'; we'll use that."
21431 echo "your system doesn't seem to support random libraries"
21432 echo "so we'll use lorder and tsort to order the libraries."
21439 : see if this is a values.h system
21440 set values.h i_values
21443 : Check the max offset that gmtime and localtime accept
21444 echo "Checking max offsets that gmtime () accepts"
21447 define) yyy="#include <values.h>" ;;
21451 case "$sGMTIME_min/$sGMTIME_max" in
21454 #include <sys/types.h>
21463 void gm_check (time_t t, int min_year, int max_year)
21466 if ( tmp == NULL ||
21467 /* Check tm_year overflow */
21468 tmp->tm_year < min_year || tmp->tm_year > max_year)
21479 gm_check (MAXLONG, 69, 0x7fffffff);
21481 if (tmp == NULL || tmp->tm_year < 0) {
21482 for (i = 63; i >= 0; i--) {
21483 time_t x = pt | ((time_t)1 << i);
21484 if (x < 0 || x < pt) continue;
21485 gm_check (x, 69, 0x7fffffff);
21488 printf ("sGMTIME_max=%ld\n", pt);
21497 gm_check (MINLONG, -1900, 70);
21500 for (i = 36; i >= 0; i--) {
21501 time_t x = pt - ((time_t)1 << i);
21502 if (x > 0) continue;
21503 gm_check (x, -1900, 70);
21506 printf ("sGMTIME_min=%ld\n", pt);
21510 int main (int argc, char *argv[])
21512 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
21519 if eval $compile; then
21522 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21528 echo "Checking max offsets that localtime () accepts"
21530 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21533 #include <sys/types.h>
21542 void local_check (time_t t, int min_year, int max_year)
21544 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21547 tmp = localtime (&t);
21548 if ( tmp == NULL ||
21549 /* Check tm_year overflow */
21550 tmp->tm_year < min_year || tmp->tm_year > max_year)
21554 } /* local_check */
21561 local_check (MAXLONG, 69, 0x7fffffff);
21563 if (tmp == NULL || tmp->tm_year < 0) {
21564 for (i = 63; i >= 0; i--) {
21565 time_t x = pt | ((time_t)1 << i);
21566 if (x < 0 || x < pt) continue;
21567 local_check (x, 69, 0x7fffffff);
21570 printf ("sLOCALTIME_max=%ld\n", pt);
21579 local_check (MINLONG, -1900, 70);
21582 for (i = 36; i >= 0; i--) {
21583 time_t x = pt - ((time_t)1 << i);
21584 if (x > 0) continue;
21585 local_check (x, -1900, 70);
21588 printf ("sLOCALTIME_min=%ld\n", pt);
21592 int main (int argc, char *argv[])
21600 if eval $compile; then
21603 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21609 : check for type of arguments to select.
21610 case "$selecttype" in
21611 '') case "$d_select" in
21615 Checking to see what type of arguments are accepted by select().
21617 hdrs="$define sys/types.h
21618 $i_systime sys/time.h
21619 $i_sysselct sys/select.h
21620 $d_socket sys/socket.h"
21621 : The first arg can be int, unsigned, or size_t
21622 : The last arg may or may not be 'const'
21624 : void pointer has been seen but using that
21625 : breaks the selectminbits test
21626 for xxx in 'fd_set *' 'int *'; do
21627 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21628 for tmo in 'struct timeval *' 'const struct timeval *'; do
21630 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21631 if ./protochk "$try" $hdrs; then
21632 echo "Your system accepts $xxx."
21641 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21642 case "$d_fd_set" in
21643 $define) dflt="fd_set *" ;;
21652 *) : no select, so pick a harmless default
21659 : check for the select 'width'
21660 case "$selectminbits" in
21661 '') safebits=`expr $ptrsize \* 8`
21662 case "$d_select" in
21666 Checking to see on how many bits at a time your select() operates...
21669 #include <sys/types.h>
21671 #$i_systime I_SYS_TIME
21672 #$i_systimek I_SYS_TIME_KERNEL
21677 # ifdef I_SYS_TIME_KERNEL
21680 # include <sys/time.h>
21681 # ifdef I_SYS_TIME_KERNEL
21685 #$i_sysselct I_SYS_SELECT
21686 #ifdef I_SYS_SELECT
21687 #include <sys/select.h>
21689 #$d_socket HAS_SOCKET
21691 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21694 #$i_stdlib I_STDLIB
21696 #include <stdlib.h>
21699 #define S sizeof(*(b))
21701 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21702 #define NBITS (NBYTES * 8)
21704 char *s = (char *)malloc(NBYTES);
21713 fp = fopen("try.c", "r");
21719 b = ($selecttype)s;
21720 for (i = 0; i < NBITS; i++)
21724 select(fd + 1, b, 0, 0, &t);
21725 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21727 printf("%d\n", i + 1);
21732 if eval $compile_ok; then
21733 selectminbits=`$run ./try`
21734 case "$selectminbits" in
21736 Cannot figure out on how many bits at a time your select() operates.
21737 I'll play safe and guess it is $safebits bits.
21739 selectminbits=$safebits
21740 bits="$safebits bits"
21743 *) bits="$selectminbits bits" ;;
21745 echo "Your select() operates on $bits at a time." >&4
21747 rp='What is the minimum number of bits your select() operates on?'
21748 case "$byteorder" in
21749 12345678) dflt=64 ;;
21755 selectminbits="$val"
21759 *) : no select, so pick a harmless default
21760 selectminbits=$safebits
21766 : Trace out the files included by signal.h, then look for SIGxxx names.
21767 if [ "X$fieldn" = X ]; then
21768 : Just make some guesses. We check them later.
21769 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21771 xxx=`echo '#include <signal.h>' |
21772 $cppstdin $cppminus $cppflags 2>/dev/null |
21773 $grep '^[ ]*#.*include' |
21774 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21775 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21778 for xx in $xxx /dev/null ; do
21779 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21781 case "$xxxfiles" in
21782 '') xxxfiles=`./findhdr signal.h` ;;
21785 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21786 print substr($2, 4, 20)
21788 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21789 print substr($3, 4, 20)
21791 : Append some common names just in case the awk scan failed.
21792 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21793 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21794 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21795 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21796 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21798 : generate a few handy files for later
21799 $cat > signal.c <<EOCP
21800 #include <sys/types.h>
21801 #include <signal.h>
21802 #$i_stdlib I_STDLIB
21804 #include <stdlib.h>
21809 /* Strange style to avoid deeply-nested #if/#else/#endif */
21812 # define NSIG (_NSIG)
21818 # define NSIG (SIGMAX+1)
21824 # define NSIG (SIG_MAX+1)
21830 # define NSIG (_SIG_MAX+1)
21836 # define NSIG (MAXSIG+1)
21842 # define NSIG (MAX_SIG+1)
21847 # ifdef SIGARRAYSIZE
21848 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21854 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21858 /* Default to some arbitrary number that's big enough to get most
21859 of the common signals.
21865 printf("NSIG %d\n", NSIG);
21871 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21873 printf "#ifdef SIG"; printf $1; printf "\n"
21874 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21875 printf $1; printf ");\n"
21879 printf "#endif /* JUST_NSIG */\n";
21880 printf "exit(0);\n}\n";
21883 $cat >signal.awk <<'EOP'
21884 BEGIN { ndups = 0 }
21885 $1 ~ /^NSIG$/ { nsig = $2 }
21886 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21887 if ($2 > maxsig) { maxsig = $2 }
21888 if (sig_name[$2]) {
21889 dup_name[ndups] = $1
21890 dup_num[ndups] = $2
21902 printf("NSIG %d\n", nsig);
21903 for (n = 1; n < nsig; n++) {
21905 printf("%s %d\n", sig_name[n], sig_num[n])
21908 printf("NUM%d %d\n", n, n)
21911 for (n = 0; n < ndups; n++) {
21912 printf("%s %d\n", dup_name[n], dup_num[n])
21916 $cat >signal_cmd <<EOS
21918 if $test -s signal.lst; then
21919 echo "Using your existing signal.lst file"
21924 $cat >>signal_cmd <<'EOS'
21927 if eval $compile_ok; then
21928 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21929 $uniq | $awk -f signal.awk >signal.lst
21931 echo "(I can't seem be able to compile the whole test program)" >&4
21932 echo "(I'll try it in little pieces.)" >&4
21933 set signal -DJUST_NSIG
21934 if eval $compile_ok; then
21935 $run ./signal$_exe > signal.nsg
21938 echo "I can't seem to figure out how many signals you have." >&4
21939 echo "Guessing 50." >&4
21940 echo 'NSIG 50' > signal.nsg
21942 : Now look at all the signal names, one at a time.
21943 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21944 $cat > signal.c <<EOCP
21945 #include <sys/types.h>
21946 #include <signal.h>
21949 printf("$xx %d\n", SIG${xx});
21954 if eval $compile; then
21955 echo "SIG${xx} found."
21956 $run ./signal$_exe >> signal.ls1
21958 echo "SIG${xx} NOT found."
21961 if $test -s signal.ls1; then
21962 $cat signal.nsg signal.ls1 |
21963 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21967 if $test -s signal.lst; then
21970 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21971 echo 'kill -l' >signal
21972 set X `csh -f <signal`
21976 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21978 echo $@ | $tr ' ' $trnl | \
21979 $awk '{ printf "%s %d\n", $1, ++s; }
21980 END { printf "NSIG %d\n", ++s }' >signal.lst
21982 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21984 chmod a+x signal_cmd
21985 $eunicefix signal_cmd
21987 : generate list of signal names
21989 case "$sig_name_init" in
21991 *) case "$sig_num_init" in
21992 ''|*,*) doinit=yes ;;
21997 echo "Generating a list of signal names and numbers..." >&4
21999 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22000 sig_name=`$awk 'BEGIN { printf "ZERO " }
22001 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22002 sig_num=`$awk 'BEGIN { printf "0 " }
22003 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22004 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22005 !/^NSIG/ { printf "\"%s\", ", $1 }
22006 END { printf "0\n" }' signal.lst`
22007 sig_num_init=`$awk 'BEGIN { printf "0, " }
22008 !/^NSIG/ { printf "%d, ", $2}
22009 END { printf "0\n"}' signal.lst`
22012 echo "The following $sig_count signals are available:"
22014 echo $sig_name | $awk \
22015 'BEGIN { linelen = 0 }
22017 for (i = 1; i <= NF; i++) {
22018 name = "SIG" $i " "
22019 linelen = linelen + length(name)
22020 if (linelen > 70) {
22022 linelen = length(name)
22028 sig_size=`echo $sig_name | awk '{print NF}'`
22029 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22031 : Check size of size
22033 case "$sizetype" in
22034 *_t) zzz="$sizetype" ;;
22035 *) zzz="filesize" ;;
22037 echo "Checking the size of $zzz..." >&4
22039 #include <sys/types.h>
22041 #$i_stdlib I_STDLIB
22043 #include <stdlib.h>
22046 printf("%d\n", (int)sizeof($sizetype));
22051 if eval $compile_ok; then
22055 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22058 echo "Your $zzz size is $sizesize bytes."
22063 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22067 : check for socklen_t
22069 echo "Checking to see if you have socklen_t..." >&4
22071 #include <sys/types.h>
22072 #$d_socket HAS_SOCKET
22074 #include <sys/socket.h>
22076 int main() { socklen_t x = 16; }
22079 if eval $compile; then
22081 echo "You have socklen_t."
22084 echo "You do not have socklen_t."
22085 case "$sizetype" in
22086 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22093 : see if this is a socks.h system
22094 set socks.h i_socks
22097 : check for type of the size argument to socket calls
22098 case "$d_socket" in
22102 Checking to see what type is the last argument of accept().
22105 case "$d_socklen_t" in
22106 "$define") yyy="$yyy socklen_t"
22108 yyy="$yyy $sizetype int long unsigned"
22109 for xxx in $yyy; do
22110 case "$socksizetype" in
22111 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22112 case "$usesocks" in
22114 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22115 echo "Your system accepts '$xxx *' for the last argument of accept()."
22116 socksizetype="$xxx"
22119 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22120 echo "Your system accepts '$xxx *' for the last argument of accept()."
22121 socksizetype="$xxx"
22128 : In case none of those worked, prompt the user.
22129 case "$socksizetype" in
22130 '') rp='What is the type for socket address structure sizes?'
22137 *) : no sockets, so pick relatively harmless default
22142 : see what type is used for signed size_t
22143 set ssize_t ssizetype int stdio.h sys/types.h
22148 #$i_stdlib I_STDLIB
22150 #include <stdlib.h>
22152 #include <sys/types.h>
22153 #define Size_t $sizetype
22154 #define SSize_t $dflt
22157 if (sizeof(Size_t) == sizeof(SSize_t))
22159 else if (sizeof(Size_t) == sizeof(int))
22168 if eval $compile_ok && $run ./try > /dev/null; then
22169 ssizetype=`$run ./try`
22170 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22173 Help! I can't compile and run the ssize_t test program: please enlighten me!
22174 (This is probably a misconfiguration in your system or libraries, and
22175 you really ought to fix it. Still, I'll try anyway.)
22177 I need a type that is the same size as $sizetype, but is guaranteed to
22178 be signed. Common values are ssize_t, int and long.
22181 rp="What signed type is the same size as $sizetype?"
22187 : Check the size of st_ino
22189 $echo "Checking the size of st_ino..." >&4
22190 $cat > try.c <<EOCP
22191 #include <sys/stat.h>
22193 #$i_stdlib I_STDLIB
22195 #include <stdlib.h>
22199 printf("%d\n", (int)sizeof(st.st_ino));
22204 if eval $compile_ok; then
22208 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22210 *) st_ino_size=$val
22211 $echo "Your st_ino is $st_ino_size bytes long."
22216 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22220 : Check if st_ino is signed
22222 $echo "Checking the sign of st_ino..." >&4
22223 $cat > try.c <<EOCP
22224 #include <sys/stat.h>
22229 if (foo.st_ino < 0)
22236 if eval $compile; then
22240 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22242 *) st_ino_sign=$val
22243 case "$st_ino_sign" in
22244 1) $echo "Your st_ino is unsigned." ;;
22245 -1) $echo "Your st_ino is signed." ;;
22251 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22255 : see what type of char stdio uses.
22257 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22258 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22259 echo "Your stdio uses unsigned chars." >&4
22260 stdchar="unsigned char"
22262 echo "Your stdio uses signed chars." >&4
22267 : see what type uids are declared as in the kernel
22269 echo "Looking for the type for user ids returned by getuid()."
22270 set uid_t uidtype xxx stdio.h sys/types.h
22274 xxx=`./findhdr sys/user.h`
22275 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22277 unsigned) dflt="$1 $2" ;;
22281 *) dflt="$uidtype";;
22284 uid_t) echo "uid_t found." ;;
22285 *) rp="What is the type for user ids returned by getuid()?"
22291 : Check size of UID
22294 *_t) zzz="$uidtype" ;;
22297 echo "Checking the size of $zzz..." >&4
22299 #include <sys/types.h>
22301 #$i_stdlib I_STDLIB
22303 #include <stdlib.h>
22306 printf("%d\n", (int)sizeof($uidtype));
22311 if eval $compile_ok; then
22315 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22318 echo "Your $zzz is $uidsize bytes long."
22323 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22326 : Check if UID is signed
22329 *_t) zzz="$uidtype" ;;
22332 echo "Checking the sign of $zzz..." >&4
22334 #include <sys/types.h>
22345 if eval $compile; then
22349 echo "(I can't execute the test program--guessing unsigned.)" >&4
22353 1) echo "Your $zzz is unsigned." ;;
22354 -1) echo "Your $zzz is signed." ;;
22360 echo "(I can't compile the test program--guessing unsigned.)" >&4
22364 : Check format string for UID
22366 $echo "Checking the format string to be used for uids..." >&4
22369 -1) if $test X"$uidsize" = X"$ivsize"; then
22370 uidformat="$ivdformat"
22372 if $test X"$uidsize" = X"$longsize"; then
22375 if $test X"$uidsize" = X"$intsize"; then
22378 if $test X"$uidsize" = X"$shortsize"; then
22385 *) if $test X"$uidsize" = X"$uvsize"; then
22386 uidformat="$uvuformat"
22388 if $test X"$uidsize" = X"$longsize"; then
22391 if $test X"$uidsize" = X"$intsize"; then
22394 if $test X"$uidsize" = X"$shortsize"; then
22403 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22405 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22406 $cat >try.c <<'EOM'
22407 /* Intentionally a long probe as I'd like to sanity check that the exact
22408 approach is going to work, as thinking it will work, but only having it
22409 part working at runtime is worse than not having it. */
22411 #include <sys/types.h>
22412 #include <sys/sysctl.h>
22413 #include <sys/param.h>
22415 #include <string.h>
22416 #include <stdlib.h>
22417 #include <unistd.h>
22420 main(int argc, char **argv) {
22422 char *argv_leaf = strrchr(argv[0], '/');
22428 mib[1] = KERN_PROC;
22429 mib[2] = KERN_PROC_PATHNAME;
22433 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22437 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22442 if (size < strlen(argv_leaf) + 1) {
22443 fprintf(stderr, "size %lu is too short for a path\n",
22444 (unsigned long) size);
22448 if (size > MAXPATHLEN * MAXPATHLEN) {
22449 fprintf(stderr, "size %lu is too long for a path\n",
22450 (unsigned long) size);
22454 buffer = malloc(size);
22460 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22465 if (strlen(buffer) + 1 != size) {
22466 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22467 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22472 if (*buffer != '/') {
22473 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22477 if (strstr(buffer, "/./")) {
22478 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22482 if (strstr(buffer, "/../")) {
22483 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22487 buffer_leaf = strrchr(buffer, '/');
22488 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22489 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22501 if eval $compile; then
22502 if $run ./try; then
22503 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22506 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22510 echo "I'm unable to compile the test program." >&4
22511 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22515 set usekernprocpathname
22518 : Determine if we can use _NSGetExecutablePath to find executing program
22520 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22521 $cat >try.c <<'EOM'
22522 /* Intentionally a long probe as I'd like to sanity check that the exact
22523 approach is going to work, as thinking it will work, but only having it
22524 part working at runtime is worse than not having it. */
22525 #include <mach-o/dyld.h>
22527 #include <stdlib.h>
22528 #include <sys/param.h>
22529 #include <string.h>
22532 main(int argc, char **argv) {
22534 uint32_t size = sizeof(buf);
22538 char *argv_leaf = strrchr(argv[0], '/');
22542 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22546 _NSGetExecutablePath(buf, &size);
22547 if (size > MAXPATHLEN * MAXPATHLEN) {
22548 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22549 (unsigned int) size);
22553 buffer = malloc(size);
22559 result = _NSGetExecutablePath(buffer, &size);
22561 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22562 result, (unsigned int) size);
22566 tidied = realpath(buffer, NULL);
22568 perror("realpath");
22574 if (*tidied != '/') {
22575 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22579 if (strstr(tidied, "/./")) {
22580 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22584 if (strstr(tidied, "/../")) {
22585 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22589 tidied_leaf = strrchr(tidied, '/');
22590 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22591 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22603 if eval $compile; then
22604 if $run ./try; then
22605 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22608 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22611 echo "I'm unable to compile the test program." >&4
22612 echo "I'll assume no _NSGetExecutablePath here." >&4
22615 set usensgetexecutablepath
22618 : Check if site customization support was requested
22619 case "$usesitecustomize" in
22620 $define|true|[Yy]*)
22621 usesitecustomize="$define"
22624 usesitecustomize="$undef"
22628 : see if prototypes support variable argument declarations
22630 case "$prototype$i_stdarg" in
22632 echo "It appears we'll be able to prototype varargs functions." >&4
22636 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22643 : determine compiler compiler
22652 if $test -f "$byacc$_exe"; then
22654 comp="byacc or $comp"
22656 if $test -f "$bison$_exe"; then
22657 comp="$comp or bison -y"
22659 rp="Which compiler compiler ($comp) shall I use?"
22668 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22674 : see if this is a assert.h system
22675 set assert.h i_assert
22678 : see if this is a bfd.h system
22682 : see if this is an execinfo.h system
22683 set execinfo.h i_execinfo
22686 : see if this is a fenv.h system
22690 : see if this is a fp.h system
22694 : see if this is a fp_class.h system
22695 set fp_class.h i_fp_class
22698 : see if gdbm.h is available
22703 : see if gdbm_open exists
22704 set gdbm_open d_gdbm_open
22706 case "$d_gdbm_open" in
22709 echo "We won't be including <gdbm.h>"
22718 : see if this is a ieeefp.h system
22719 case "$i_ieeefp" in
22720 '' ) set ieeefp.h i_ieeefp
22725 : see if this is a libutil.h system
22726 set libutil.h i_libutil
22729 : see if mach cthreads are available
22730 if test "X$usethreads" = "X$define"; then
22731 set mach/cthreads.h i_machcthr
22734 i_machcthr="$undef"
22737 : see if this is a mntent.h system
22738 set mntent.h i_mntent
22741 : see if net/errno.h is available
22743 set net/errno.h val
22746 : Unfortunately, it causes problems on some systems. Arrgh.
22749 cat > try.c <<'EOM'
22752 #include <net/errno.h>
22758 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22759 echo "We'll be including <net/errno.h>." >&4
22761 echo "We won't be including <net/errno.h>." >&4
22770 : see if netinet/tcp.h is available
22771 set netinet/tcp.h i_netinettcp
22774 : see if this is a poll.h system
22778 : see if this is a prot.h system
22782 : Preprocessor symbols
22784 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22785 $cat <<'EOSH' > Cppsym.know
22786 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22787 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22788 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22789 arch_pwr ardent ARM ARM32 atarist att386 att3b
22790 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22791 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22792 byteorder byte_order
22793 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22794 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22795 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22796 ELF encore EPI EXTENSIONS
22797 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22798 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22799 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22800 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22801 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22802 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22803 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22804 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22805 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22807 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22808 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22809 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22811 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22812 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22813 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22814 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22815 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22816 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22817 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22818 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22819 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22820 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22821 ns32000 ns32016 ns32332 ns32k nsc32000
22822 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22823 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22824 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22825 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22827 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22828 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22829 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22830 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22831 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22832 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22833 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22834 SYSV4 SYSV5 sysV68 sysV88
22835 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22836 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22837 tower32_800 tower32_850 tss
22838 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22839 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22840 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22841 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22842 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22843 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22845 vax venix VMESA vms
22846 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22847 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22850 # Maybe put other stuff here too.
22851 ./tr '-' '_' <<EOSH >>Cppsym.know
22854 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22855 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22856 $cat Cppsym.know > Cppsym.c
22857 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22858 $rm -f Cppsym.a Cppsym.b Cppsym.c
22859 cat <<EOSH > Cppsym
22861 if $test \$# -gt 0; then
22862 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22863 if $test -s Cppsym.got; then
22870 $tr " " "$trnl" | ./Cppsym.try
22876 cat <<EOSH > Cppsym.try
22878 cat <<'EOCP' > try.c
22881 #define STRINGIFY(a) "a"
22883 #if cpp_stuff == 42
22884 #define StGiFy(a) #a
22885 #define STRINGIFY(a) StGiFy(a)
22887 #if $cpp_stuff != 1 && $cpp_stuff != 42
22888 # include "Bletch: How does this C preprocessor stringify macros?"
22894 cat <<'EOSH' >> Cppsym.try
22896 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22897 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22898 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22899 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22901 echo 'return 0;}' >> try.c
22903 cat <<EOSH >> Cppsym.try
22905 case "$osname-$gccversion" in
22906 irix-) ccflags="\$ccflags -woff 1178" ;;
22907 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22909 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22911 chmod +x Cppsym.try
22912 $eunicefix Cppsym.try
22913 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22914 : Add in any Linux cpp "predefined macros":
22915 case "$osname::$gccversion" in
22916 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22918 rm -f $tHdrH'.h' $tHdrH
22920 # Filter out macro arguments, such as Linux's __INT8_C(c)
22921 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22922 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22923 if [ -s $tHdrH'_cppsym.real' ]; then
22924 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22927 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22930 : now check the C compiler for additional symbols
22931 postprocess_cc_v=''
22933 aix) postprocess_cc_v="|$tr , ' '" ;;
22940 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22943 -D*) echo "\$i" | $sed 's/^-D//';;
22944 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22949 postprocess_cc_v=''
22952 ./ccsym > ccsym1.raw
22953 if $test -s ccsym1.raw; then
22954 $sort ccsym1.raw | $uniq >ccsym.raw
22956 mv ccsym1.raw ccsym.raw
22959 $awk '/\=/ { print $0; next }
22960 { print $0"=1" }' ccsym.raw >ccsym.list
22961 $comm -13 Cppsym.true ccsym.list >ccsym.own
22962 $comm -12 Cppsym.true ccsym.list >ccsym.com
22963 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22965 if $test -z ccsym.raw; then
22966 echo "Your C compiler doesn't seem to define any symbols!" >&4
22968 echo "However, your C preprocessor defines the following symbols:"
22971 cppsymbols=`$cat Cppsym.true`
22972 cppsymbols=`echo $cppsymbols`
22973 cppccsymbols="$cppsymbols"
22975 if $test -s ccsym.com; then
22976 echo "Your C compiler and pre-processor define these symbols:"
22977 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22980 cppccsymbols=`$cat ccsym.com`
22981 cppccsymbols=`echo $cppccsymbols`
22982 $test "$silent" || sleep 1
22984 if $test -s ccsym.cpp; then
22985 $test "$also" && echo " "
22986 echo "Your C pre-processor ${also}defines the following symbols:"
22987 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22989 cppsymbols=`$cat ccsym.cpp`
22990 cppsymbols=`echo $cppsymbols`
22991 $test "$silent" || sleep 1
22993 if $test -s ccsym.own; then
22994 $test "$also" && echo " "
22995 echo "Your C compiler ${also}defines the following cpp symbols:"
22996 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22997 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22998 ccsymbols=`$cat ccsym.own`
22999 ccsymbols=`echo $ccsymbols`
23000 $test "$silent" || sleep 1
23004 : add -D_FORTIFY_SOURCE if feasible and not already there
23005 case "$gccversion" in
23006 4.*) case "$optimize$ccflags" in
23007 *-O*) case "$ccflags$cppsymbols" in
23008 *_FORTIFY_SOURCE=*) # Don't add it again.
23009 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23011 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23012 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23016 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23020 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
23024 : see if this is a termio system
23028 if $test `./findhdr termios.h`; then
23029 set tcsetattr i_termios
23035 "$define") echo "You have POSIX termios.h... good!" >&4;;
23036 *) if ./Cppsym pyr; then
23037 case "`$run /bin/universe`" in
23038 ucb) if $test `./findhdr sgtty.h`; then
23040 echo "<sgtty.h> found." >&4
23042 echo "System is pyramid with BSD universe."
23043 ./warn "<sgtty.h> not found--you could have problems."
23045 *) if $test `./findhdr termio.h`; then
23047 echo "<termio.h> found." >&4
23049 echo "System is pyramid with USG universe."
23050 ./warn "<termio.h> not found--you could have problems."
23054 if $test `./findhdr termio.h`; then
23055 echo "<termio.h> found." >&4
23057 elif $test `./findhdr sgtty.h`; then
23058 echo "<sgtty.h> found." >&4
23061 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23064 if $test `./findhdr sgtty.h`; then
23065 echo "<sgtty.h> found." >&4
23067 elif $test `./findhdr termio.h`; then
23068 echo "<termio.h> found." >&4
23071 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23075 set i_termio; eval $setvar
23076 val=$val2; set i_sgtty; eval $setvar
23077 val=$val3; set i_termios; eval $setvar
23079 : see if stdbool is available
23080 : we want a real compile instead of Inhdr because some Solaris systems
23081 : have stdbool.h, but it can only be used if the compiler indicates it
23082 : is sufficiently c99-compliant.
23086 #include <stdbool.h>
23091 int main(int argc, char **argv)
23097 if eval $compile; then
23098 echo "<stdbool.h> found." >&4
23101 echo "<stdbool.h> NOT found." >&4
23108 : see if stddef is available
23109 set stddef.h i_stddef
23112 : see if stdint is available
23113 set stdint.h i_stdint
23116 : see if sys/access.h is available
23117 set sys/access.h i_sysaccess
23120 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23121 set sys/filio.h i_sysfilio
23124 if $test `./findhdr sys/ioctl.h`; then
23126 echo '<sys/ioctl.h> found.' >&4
23129 if $test $i_sysfilio = "$define"; then
23130 echo '<sys/ioctl.h> NOT found.' >&4
23132 $test $i_sgtty = "$define" && xxx="sgtty.h"
23133 $test $i_termio = "$define" && xxx="termio.h"
23134 $test $i_termios = "$define" && xxx="termios.h"
23135 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23141 : see if socket ioctl defs are in sys/sockio.h
23143 xxx=`./findhdr sys/sockio.h`
23144 if $test "$xxx"; then
23145 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23147 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23150 echo "No socket ioctls found in <sys/sockio.h>." >&4
23155 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23161 : see if this is a syslog.h system
23162 set syslog.h i_syslog
23165 : see if this is a sys/mode.h system
23166 set sys/mode.h i_sysmode
23169 : see if there is a sys/poll.h file
23170 set sys/poll.h i_syspoll
23173 : see if sys/resource.h has to be included
23174 set sys/resource.h i_sysresrc
23177 : see if sys/security.h is available
23178 set sys/security.h i_syssecrt
23181 : see if this is a sys/statvfs.h system
23182 set sys/statvfs.h i_sysstatvfs
23185 : see if this is a sys/un.h system
23186 set sys/un.h i_sysun
23189 : see if this is a sys/utsname.h system
23190 set sys/utsname.h i_sysutsname
23193 : see if this is a syswait system
23194 set sys/wait.h i_syswait
23197 : see if this is a ustat.h system
23198 set ustat.h i_ustat
23201 : see if this is an utime system
23202 set utime.h i_utime
23205 : see if this is a vfork system
23208 set vfork.h i_vfork
23218 echo "Looking for extensions..." >&4
23219 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23220 : contain old or inaccurate or duplicate values.
23221 nonxs_extensions=''
23223 : We do not use find because it might not be available.
23224 : We do not just use MANIFEST because the user may have dropped
23225 : some additional extensions into the source tree and expect them
23228 : Function to recursively find available extensions, ignoring DynaLoader
23229 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23230 : In 5.10.1 and later, extensions are stored in directories
23231 : like File-Glob instead of the older File/Glob/.
23235 DynaLoader|dynaload) ;;
23237 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
23238 case "$this_ext" in
23239 Scalar/List/Utils) this_ext="List/Util" ;;
23240 PathTools) this_ext="Cwd" ;;
23242 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
23243 if $contains " $this_ext " $tdir/$$.tmp; then
23245 echo "Duplicate directories detected for extension $xxx" >&4;
23246 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23247 case "$knowitall" in
23255 echo "Ok. Stopping Configure." >&4;
23256 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23259 echo "Ok. You will need to correct config.sh before running make." >&4;
23261 $ls -1 $xxx > $tdir/$$.tmp;
23262 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
23263 xs_extensions="$xs_extensions $this_ext";
23264 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
23265 xs_extensions="$xs_extensions $this_ext";
23266 elif $test -d $xxx; then
23267 nonxs_extensions="$nonxs_extensions $this_ext";
23269 $rm -f $tdir/$$.tmp;
23277 eval $find_extensions
23281 eval $find_extensions
23285 eval $find_extensions
23286 set X $xs_extensions
23288 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23289 set X $nonxs_extensions
23291 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23293 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23295 : Now see which are supported on this system.
23297 for xxx in $xs_extensions ; do
23301 $define) avail_ext="$avail_ext $xxx" ;;
23304 GDBM_File|gdbm_fil)
23306 $define) avail_ext="$avail_ext $xxx" ;;
23309 I18N/Langinfo|i18n_lan)
23310 case "$i_langinfo$d_nl_langinfo" in
23311 $define$define) avail_ext="$avail_ext $xxx" ;;
23315 : XXX Do we need a useipcsysv variable here
23316 case "${d_msg}${d_sem}${d_shm}" in
23317 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23320 NDBM_File|ndbm_fil)
23323 case "$osname-$use64bitint" in
23326 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23329 *) avail_ext="$avail_ext $xxx" ;;
23334 ODBM_File|odbm_fil)
23335 case "${i_dbm}${i_rpcsvcdbm}" in
23337 case "$d_cplusplus" in
23338 define) ;; # delete as a function name will not work
23339 *) case "$osname-$use64bitint" in
23342 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23345 *) avail_ext="$avail_ext $xxx" ;;
23353 case "$useopcode" in
23354 true|define|y) avail_ext="$avail_ext $xxx" ;;
23358 case "$useposix" in
23359 true|define|y) avail_ext="$avail_ext $xxx" ;;
23363 case "$d_socket" in
23364 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23367 Sys/Syslog|sys/syslog)
23368 : XXX syslog requires socket
23369 case "$d_socket" in
23370 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23374 case "$usethreads" in
23376 case "$use5005threads" in
23377 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23381 threads|threads/shared)
23382 # threads and threads::shared are special cases.
23383 # To stop people from asking "Perl 5.8.0 was supposed
23384 # to have this new fancy threads implementation but my
23385 # perl doesn't have it" and from people trying to
23386 # (re)install the threads module using CPAN.pm and
23387 # CPAN.pm then offering to reinstall Perl 5.8.0,
23388 # the threads.pm and threads/shared.pm will always be
23389 # there, croaking informatively ("you need to rebuild
23390 # all of Perl with threads, sorry") when threads haven't
23391 # been compiled in.
23393 avail_ext="$avail_ext $xxx"
23399 cygwin) avail_ext="$avail_ext $xxx" ;;
23402 XS/APItest|xs/apitest)
23403 # This is just for testing. Skip it unless we have dynamic loading.
23406 $define) avail_ext="$avail_ext $xxx" ;;
23409 XS/Typemap|xs/typemap)
23410 # This is just for testing. Skip it unless we have dynamic loading.
23412 $define) avail_ext="$avail_ext $xxx" ;;
23415 *) avail_ext="$avail_ext $xxx"
23424 case "$onlyextensions" in
23426 *) keepextensions=''
23427 echo "You have requested that only certain extensions be included..." >&4
23428 for i in $onlyextensions; do
23429 case " $avail_ext " in
23431 echo "Keeping extension $i."
23432 keepextensions="$keepextensions $i"
23434 *) echo "Ignoring extension $i." ;;
23437 avail_ext="$keepextensions"
23441 case "$noextensions" in
23443 *) keepextensions=''
23444 echo "You have requested that certain extensions be ignored..." >&4
23445 for i in $avail_ext; do
23446 case " $noextensions " in
23447 *" $i "*) echo "Ignoring extension $i." ;;
23448 *) echo "Keeping extension $i.";
23449 keepextensions="$keepextensions $i"
23453 avail_ext="$keepextensions"
23457 : Now see which nonxs extensions are supported on this system.
23458 : For now assume all are.
23460 for xxx in $nonxs_extensions ; do
23464 *) nonxs_ext="$nonxs_ext $xxx"
23476 A number of extensions are supplied with $package. You may choose to
23477 compile these extensions for dynamic loading (the default), compile
23478 them into the $package executable (static loading), or not include
23479 them at all. Answer "none" to include no extensions.
23480 Note that DynaLoader is always built and need not be mentioned here.
23483 case "$dynamic_ext" in
23485 : Exclude those listed in static_ext
23487 for xxx in $avail_ext; do
23488 case " $static_ext " in
23490 *) dflt="$dflt $xxx" ;;
23497 *) dflt="$dynamic_ext"
23498 # Perhaps we are reusing an old out-of-date config.sh.
23501 if test X"$dynamic_ext" != X"$avail_ext"; then
23503 NOTICE: Your previous config.sh list may be incorrect.
23504 The extensions now available to you are
23506 but the default list from your previous config.sh is
23518 rp="What extensions do you wish to load dynamically?"
23521 none) dynamic_ext=' ' ;;
23522 *) dynamic_ext="$ans" ;;
23525 case "$static_ext" in
23527 : Exclude those already listed in dynamic linking
23529 for xxx in $avail_ext; do
23530 case " $dynamic_ext " in
23532 *) dflt="$dflt $xxx" ;;
23539 *) dflt="$static_ext"
23546 rp="What extensions do you wish to load statically?"
23549 none) static_ext=' ' ;;
23550 *) static_ext="$ans" ;;
23555 A number of extensions are supplied with $package. Answer "none"
23556 to include no extensions.
23557 Note that DynaLoader is always built and need not be mentioned here.
23560 case "$static_ext" in
23561 '') dflt="$avail_ext" ;;
23562 *) dflt="$static_ext"
23563 # Perhaps we are reusing an old out-of-date config.sh.
23566 if test X"$static_ext" != X"$avail_ext"; then
23568 NOTICE: Your previous config.sh list may be incorrect.
23569 The extensions now available to you are
23571 but the default list from your previous config.sh is
23580 : Exclude those that are not xs extensions
23584 rp="What extensions do you wish to include?"
23587 none) static_ext=' ' ;;
23588 *) static_ext="$ans" ;;
23593 # Encode is a special case. If we are building Encode as a static
23594 # extension, we need to explicitly list its subextensions as well.
23595 # For other nested extensions, this is handled automatically by
23596 # the appropriate Makefile.PL.
23597 case " $static_ext " in
23598 *" Encode "*) # Add the subextensions of Encode
23600 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23601 static_ext="$static_ext Encode/$xxx"
23602 known_extensions="$known_extensions Encode/$xxx"
23608 set X $dynamic_ext $static_ext $nonxs_ext
23612 # Sanity check: We require an extension suitable for use with
23613 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23614 # should show up as failures in the test suite, but it's helpful to
23615 # catch them now.) The 'extensions' list is normally sorted
23616 # alphabetically, so we need to accept either
23617 # DB_File ... Fcntl ... IO ....
23618 # or something like
23619 # Fcntl ... NDBM_File ... IO ....
23620 case " $extensions" in
23621 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23622 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23623 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23624 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23625 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23629 : Remove libraries needed only for extensions
23630 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23631 : The exception is SunOS 4.x, which needs them.
23632 case "${osname}X${osvers}" in
23636 *) case "$usedl" in
23637 $define|true|[yY]*)
23638 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23642 *) perllibs="$libs"
23648 : Remove build directory name from cppstdin so it can be used from
23649 : either the present location or the final installed location.
23651 : Get out of the UU directory to get correct path name.
23653 case "$cppstdin" in
23655 echo "Stripping down cppstdin path name"
23661 : end of configuration questions
23663 echo "End of configuration questions."
23666 : back to where it started
23667 if test -d ../UU; then
23671 : configuration may be unconditionally patched via a 'config.arch' file
23672 if $test -f config.arch; then
23673 echo "I see a config.arch file, loading it." >&4
23677 : configuration may be patched via a 'config.over' file
23678 if $test -f config.over; then
23681 rp='I see a config.over file. Do you wish to load it?'
23684 n*) echo "OK, I'll ignore it.";;
23686 echo "Configuration override changes have been loaded."
23691 : in case they want portability, strip down executable paths
23692 case "$d_portable" in
23695 echo "Stripping down executable paths..." >&4
23696 for file in $loclist $trylist; do
23698 eval $file=`basename $temp`
23703 : create config.sh file
23705 echo "Creating config.sh..." >&4
23706 $spitshell <<EOT >config.sh
23709 # This file was produced by running the Configure script. It holds all the
23710 # definitions figured out by Configure. Should you modify one of these values,
23711 # do not forget to propagate your changes by running "Configure -der". You may
23712 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23715 # Package name : $package
23716 # Source directory : $src
23717 # Configuration time: $cf_time
23718 # Configured by : $cf_by
23719 # Target system : $myuname
23722 : Add in command line options if available
23723 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23725 $spitshell <<EOT >>config.sh
23734 Revision='$Revision'
23742 alignbytes='$alignbytes'
23743 ansi2knr='$ansi2knr'
23744 aphostname='$aphostname'
23745 api_revision='$api_revision'
23746 api_subversion='$api_subversion'
23747 api_version='$api_version'
23748 api_versionstring='$api_versionstring'
23751 archlibexp='$archlibexp'
23752 archname64='$archname64'
23753 archname='$archname'
23754 archobjs='$archobjs'
23755 asctime_r_proto='$asctime_r_proto'
23764 byteorder='$byteorder'
23766 castflags='$castflags'
23769 cccdlflags='$cccdlflags'
23770 ccdlflags='$ccdlflags'
23772 ccflags_uselargefiles='$ccflags_uselargefiles'
23774 ccsymbols='$ccsymbols'
23775 ccversion='$ccversion'
23777 cf_email='$cf_email'
23779 charbits='$charbits'
23780 charsize='$charsize'
23784 clocktype='$clocktype'
23786 compress='$compress'
23787 contains='$contains'
23791 cpp_stuff='$cpp_stuff'
23792 cppccsymbols='$cppccsymbols'
23793 cppflags='$cppflags'
23795 cppminus='$cppminus'
23797 cppstdin='$cppstdin'
23798 cppsymbols='$cppsymbols'
23799 crypt_r_proto='$crypt_r_proto'
23800 cryptlib='$cryptlib'
23802 ctermid_r_proto='$ctermid_r_proto'
23803 ctime_r_proto='$ctime_r_proto'
23804 d_Gconvert='$d_Gconvert'
23805 d_PRIEUldbl='$d_PRIEUldbl'
23806 d_PRIFUldbl='$d_PRIFUldbl'
23807 d_PRIGUldbl='$d_PRIGUldbl'
23808 d_PRIXU64='$d_PRIXU64'
23809 d_PRId64='$d_PRId64'
23810 d_PRIeldbl='$d_PRIeldbl'
23811 d_PRIfldbl='$d_PRIfldbl'
23812 d_PRIgldbl='$d_PRIgldbl'
23813 d_PRIi64='$d_PRIi64'
23814 d_PRIo64='$d_PRIo64'
23815 d_PRIu64='$d_PRIu64'
23816 d_PRIx64='$d_PRIx64'
23817 d_SCNfldbl='$d_SCNfldbl'
23818 d__fwalk='$d__fwalk'
23819 d_access='$d_access'
23820 d_accessx='$d_accessx'
23824 d_archlib='$d_archlib'
23825 d_asctime64='$d_asctime64'
23826 d_asctime_r='$d_asctime_r'
23831 d_attribute_deprecated='$d_attribute_deprecated'
23832 d_attribute_format='$d_attribute_format'
23833 d_attribute_malloc='$d_attribute_malloc'
23834 d_attribute_nonnull='$d_attribute_nonnull'
23835 d_attribute_noreturn='$d_attribute_noreturn'
23836 d_attribute_pure='$d_attribute_pure'
23837 d_attribute_unused='$d_attribute_unused'
23838 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23839 d_backtrace='$d_backtrace'
23843 d_bsdgetpgrp='$d_bsdgetpgrp'
23844 d_bsdsetpgrp='$d_bsdsetpgrp'
23845 d_builtin_choose_expr='$d_builtin_choose_expr'
23846 d_builtin_expect='$d_builtin_expect'
23848 d_c99_variadic_macros='$d_c99_variadic_macros'
23849 d_casti32='$d_casti32'
23850 d_castneg='$d_castneg'
23852 d_charvspr='$d_charvspr'
23854 d_chroot='$d_chroot'
23855 d_chsize='$d_chsize'
23857 d_clearenv='$d_clearenv'
23858 d_closedir='$d_closedir'
23859 d_cmsghdr_s='$d_cmsghdr_s'
23861 d_copysign='$d_copysign'
23862 d_copysignl='$d_copysignl'
23863 d_cplusplus='$d_cplusplus'
23865 d_crypt_r='$d_crypt_r'
23867 d_ctermid='$d_ctermid'
23868 d_ctermid_r='$d_ctermid_r'
23869 d_ctime64='$d_ctime64'
23870 d_ctime_r='$d_ctime_r'
23871 d_cuserid='$d_cuserid'
23872 d_dbl_dig='$d_dbl_dig'
23873 d_dbminitproto='$d_dbminitproto'
23874 d_difftime64='$d_difftime64'
23875 d_difftime='$d_difftime'
23876 d_dir_dd_fd='$d_dir_dd_fd'
23878 d_dirnamlen='$d_dirnamlen'
23879 d_dladdr='$d_dladdr'
23880 d_dlerror='$d_dlerror'
23881 d_dlopen='$d_dlopen'
23882 d_dlsymun='$d_dlsymun'
23883 d_dosuid='$d_dosuid'
23884 d_drand48_r='$d_drand48_r'
23885 d_drand48proto='$d_drand48proto'
23887 d_eaccess='$d_eaccess'
23888 d_endgrent='$d_endgrent'
23889 d_endgrent_r='$d_endgrent_r'
23890 d_endhent='$d_endhent'
23891 d_endhostent_r='$d_endhostent_r'
23892 d_endnent='$d_endnent'
23893 d_endnetent_r='$d_endnetent_r'
23894 d_endpent='$d_endpent'
23895 d_endprotoent_r='$d_endprotoent_r'
23896 d_endpwent='$d_endpwent'
23897 d_endpwent_r='$d_endpwent_r'
23898 d_endsent='$d_endsent'
23899 d_endservent_r='$d_endservent_r'
23900 d_eofnblk='$d_eofnblk'
23903 d_eunice='$d_eunice'
23906 d_faststdio='$d_faststdio'
23907 d_fchdir='$d_fchdir'
23908 d_fchmod='$d_fchmod'
23909 d_fchown='$d_fchown'
23911 d_fcntl_can_lock='$d_fcntl_can_lock'
23912 d_fd_macros='$d_fd_macros'
23913 d_fd_set='$d_fd_set'
23915 d_fds_bits='$d_fds_bits'
23916 d_fegetround='$d_fegetround'
23917 d_fgetpos='$d_fgetpos'
23918 d_finite='$d_finite'
23919 d_finitel='$d_finitel'
23920 d_flexfnam='$d_flexfnam'
23922 d_flockproto='$d_flockproto'
23927 d_fp_class='$d_fp_class'
23928 d_fp_classify='$d_fp_classify'
23929 d_fp_classl='$d_fp_classl'
23930 d_fpathconf='$d_fpathconf'
23931 d_fpclass='$d_fpclass'
23932 d_fpclassify='$d_fpclassify'
23933 d_fpclassl='$d_fpclassl'
23934 d_fpgetround='$d_fpgetround'
23935 d_fpos64_t='$d_fpos64_t'
23936 d_frexpl='$d_frexpl'
23937 d_fs_data_s='$d_fs_data_s'
23938 d_fseeko='$d_fseeko'
23939 d_fsetpos='$d_fsetpos'
23940 d_fstatfs='$d_fstatfs'
23941 d_fstatvfs='$d_fstatvfs'
23943 d_ftello='$d_ftello'
23945 d_futimes='$d_futimes'
23946 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23947 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23948 d_getaddrinfo='$d_getaddrinfo'
23949 d_getcwd='$d_getcwd'
23950 d_getespwnam='$d_getespwnam'
23951 d_getfsstat='$d_getfsstat'
23952 d_getgrent='$d_getgrent'
23953 d_getgrent_r='$d_getgrent_r'
23954 d_getgrgid_r='$d_getgrgid_r'
23955 d_getgrnam_r='$d_getgrnam_r'
23956 d_getgrps='$d_getgrps'
23957 d_gethbyaddr='$d_gethbyaddr'
23958 d_gethbyname='$d_gethbyname'
23959 d_gethent='$d_gethent'
23960 d_gethname='$d_gethname'
23961 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23962 d_gethostbyname_r='$d_gethostbyname_r'
23963 d_gethostent_r='$d_gethostent_r'
23964 d_gethostprotos='$d_gethostprotos'
23965 d_getitimer='$d_getitimer'
23966 d_getlogin='$d_getlogin'
23967 d_getlogin_r='$d_getlogin_r'
23968 d_getmnt='$d_getmnt'
23969 d_getmntent='$d_getmntent'
23970 d_getnameinfo='$d_getnameinfo'
23971 d_getnbyaddr='$d_getnbyaddr'
23972 d_getnbyname='$d_getnbyname'
23973 d_getnent='$d_getnent'
23974 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23975 d_getnetbyname_r='$d_getnetbyname_r'
23976 d_getnetent_r='$d_getnetent_r'
23977 d_getnetprotos='$d_getnetprotos'
23978 d_getpagsz='$d_getpagsz'
23979 d_getpbyname='$d_getpbyname'
23980 d_getpbynumber='$d_getpbynumber'
23981 d_getpent='$d_getpent'
23982 d_getpgid='$d_getpgid'
23983 d_getpgrp2='$d_getpgrp2'
23984 d_getpgrp='$d_getpgrp'
23985 d_getppid='$d_getppid'
23986 d_getprior='$d_getprior'
23987 d_getprotobyname_r='$d_getprotobyname_r'
23988 d_getprotobynumber_r='$d_getprotobynumber_r'
23989 d_getprotoent_r='$d_getprotoent_r'
23990 d_getprotoprotos='$d_getprotoprotos'
23991 d_getprpwnam='$d_getprpwnam'
23992 d_getpwent='$d_getpwent'
23993 d_getpwent_r='$d_getpwent_r'
23994 d_getpwnam_r='$d_getpwnam_r'
23995 d_getpwuid_r='$d_getpwuid_r'
23996 d_getsbyname='$d_getsbyname'
23997 d_getsbyport='$d_getsbyport'
23998 d_getsent='$d_getsent'
23999 d_getservbyname_r='$d_getservbyname_r'
24000 d_getservbyport_r='$d_getservbyport_r'
24001 d_getservent_r='$d_getservent_r'
24002 d_getservprotos='$d_getservprotos'
24003 d_getspnam='$d_getspnam'
24004 d_getspnam_r='$d_getspnam_r'
24005 d_gettimeod='$d_gettimeod'
24006 d_gmtime64='$d_gmtime64'
24007 d_gmtime_r='$d_gmtime_r'
24008 d_gnulibc='$d_gnulibc'
24009 d_grpasswd='$d_grpasswd'
24010 d_hasmntopt='$d_hasmntopt'
24014 d_ilogbl='$d_ilogbl'
24015 d_inc_version_list='$d_inc_version_list'
24017 d_inetaton='$d_inetaton'
24018 d_inetntop='$d_inetntop'
24019 d_inetpton='$d_inetpton'
24020 d_int64_t='$d_int64_t'
24021 d_ip_mreq='$d_ip_mreq'
24022 d_ip_mreq_source='$d_ip_mreq_source'
24023 d_ipv6_mreq='$d_ipv6_mreq'
24024 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24025 d_isascii='$d_isascii'
24026 d_isblank='$d_isblank'
24027 d_isfinite='$d_isfinite'
24028 d_isfinitel='$d_isfinitel'
24030 d_isinfl='$d_isinfl'
24032 d_isnanl='$d_isnanl'
24033 d_isnormal='$d_isnormal'
24036 d_killpg='$d_killpg'
24037 d_lchown='$d_lchown'
24038 d_lc_monetary_2008='$d_lc_monetary_2008'
24039 d_ldbl_dig='$d_ldbl_dig'
24040 d_ldexpl='$d_ldexpl'
24041 d_lgamma='$d_lgamma'
24042 d_lgamma_r='$d_lgamma_r'
24043 d_libm_lib_version='$d_libm_lib_version'
24044 d_libname_unique='$d_libname_unique'
24046 d_llrint='$d_llrint'
24047 d_llround='$d_llround'
24048 d_localtime64='$d_localtime64'
24049 d_localtime_r='$d_localtime_r'
24050 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24051 d_locconv='$d_locconv'
24052 d_lgamma='$d_lgamma'
24057 d_longdbl='$d_longdbl'
24058 d_longlong='$d_longlong'
24060 d_lround='$d_lround'
24061 d_lseekproto='$d_lseekproto'
24063 d_madvise='$d_madvise'
24064 d_malloc_good_size='$d_malloc_good_size'
24065 d_malloc_size='$d_malloc_size'
24067 d_mbstowcs='$d_mbstowcs'
24068 d_mbtowc='$d_mbtowc'
24069 d_memchr='$d_memchr'
24070 d_memcmp='$d_memcmp'
24071 d_memcpy='$d_memcpy'
24072 d_memmove='$d_memmove'
24073 d_memset='$d_memset'
24075 d_mkdtemp='$d_mkdtemp'
24076 d_mkfifo='$d_mkfifo'
24077 d_mkstemp='$d_mkstemp'
24078 d_mkstemps='$d_mkstemps'
24079 d_mktime64='$d_mktime64'
24080 d_mktime='$d_mktime'
24083 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24084 d_modflproto='$d_modflproto'
24085 d_mprotect='$d_mprotect'
24087 d_msg_ctrunc='$d_msg_ctrunc'
24088 d_msg_dontroute='$d_msg_dontroute'
24089 d_msg_oob='$d_msg_oob'
24090 d_msg_peek='$d_msg_peek'
24091 d_msg_proxy='$d_msg_proxy'
24092 d_msgctl='$d_msgctl'
24093 d_msgget='$d_msgget'
24094 d_msghdr_s='$d_msghdr_s'
24095 d_msgrcv='$d_msgrcv'
24096 d_msgsnd='$d_msgsnd'
24098 d_munmap='$d_munmap'
24099 d_mymalloc='$d_mymalloc'
24102 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24103 d_nearbyint='$d_nearbyint'
24104 d_nextafter='$d_nextafter'
24105 d_nexttoward='$d_nexttoward'
24107 d_nl_langinfo='$d_nl_langinfo'
24108 d_nv_preserves_uv='$d_nv_preserves_uv'
24109 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24110 d_off64_t='$d_off64_t'
24111 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24112 d_oldpthreads='$d_oldpthreads'
24113 d_oldsock='$d_oldsock'
24115 d_pathconf='$d_pathconf'
24117 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24118 d_phostname='$d_phostname'
24121 d_portable='$d_portable'
24123 d_prctl_set_name='$d_prctl_set_name'
24124 d_printf_format_null='$d_printf_format_null'
24125 d_procselfexe='$d_procselfexe'
24126 d_pseudofork='$d_pseudofork'
24127 d_pthread_atfork='$d_pthread_atfork'
24128 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24129 d_pthread_yield='$d_pthread_yield'
24130 d_ptrdiff_t='$d_ptrdiff_t'
24132 d_pwchange='$d_pwchange'
24133 d_pwclass='$d_pwclass'
24134 d_pwcomment='$d_pwcomment'
24135 d_pwexpire='$d_pwexpire'
24136 d_pwgecos='$d_pwgecos'
24137 d_pwpasswd='$d_pwpasswd'
24138 d_pwquota='$d_pwquota'
24141 d_random_r='$d_random_r'
24142 d_readdir64_r='$d_readdir64_r'
24143 d_readdir='$d_readdir'
24144 d_readdir_r='$d_readdir_r'
24145 d_readlink='$d_readlink'
24147 d_recvmsg='$d_recvmsg'
24148 d_remainder='$d_remainder'
24149 d_remquo='$d_remquo'
24150 d_rename='$d_rename'
24151 d_rewinddir='$d_rewinddir'
24155 d_safebcpy='$d_safebcpy'
24156 d_safemcpy='$d_safemcpy'
24157 d_sanemcmp='$d_sanemcmp'
24158 d_sbrkproto='$d_sbrkproto'
24159 d_scalbn='$d_scalbn'
24160 d_scalbnl='$d_scalbnl'
24161 d_sched_yield='$d_sched_yield'
24162 d_scm_rights='$d_scm_rights'
24163 d_seekdir='$d_seekdir'
24164 d_select='$d_select'
24166 d_semctl='$d_semctl'
24167 d_semctl_semid_ds='$d_semctl_semid_ds'
24168 d_semctl_semun='$d_semctl_semun'
24169 d_semget='$d_semget'
24171 d_sendmsg='$d_sendmsg'
24172 d_setegid='$d_setegid'
24173 d_seteuid='$d_seteuid'
24174 d_setgrent='$d_setgrent'
24175 d_setgrent_r='$d_setgrent_r'
24176 d_setgrps='$d_setgrps'
24177 d_sethent='$d_sethent'
24178 d_sethostent_r='$d_sethostent_r'
24179 d_setitimer='$d_setitimer'
24180 d_setlinebuf='$d_setlinebuf'
24181 d_setlocale='$d_setlocale'
24182 d_setlocale_r='$d_setlocale_r'
24183 d_setnent='$d_setnent'
24184 d_setnetent_r='$d_setnetent_r'
24185 d_setpent='$d_setpent'
24186 d_setpgid='$d_setpgid'
24187 d_setpgrp2='$d_setpgrp2'
24188 d_setpgrp='$d_setpgrp'
24189 d_setprior='$d_setprior'
24190 d_setproctitle='$d_setproctitle'
24191 d_setprotoent_r='$d_setprotoent_r'
24192 d_setpwent='$d_setpwent'
24193 d_setpwent_r='$d_setpwent_r'
24194 d_setregid='$d_setregid'
24195 d_setresgid='$d_setresgid'
24196 d_setresuid='$d_setresuid'
24197 d_setreuid='$d_setreuid'
24198 d_setrgid='$d_setrgid'
24199 d_setruid='$d_setruid'
24200 d_setsent='$d_setsent'
24201 d_setservent_r='$d_setservent_r'
24202 d_setsid='$d_setsid'
24203 d_setvbuf='$d_setvbuf'
24206 d_shmatprototype='$d_shmatprototype'
24207 d_shmctl='$d_shmctl'
24209 d_shmget='$d_shmget'
24210 d_sigaction='$d_sigaction'
24211 d_signbit='$d_signbit'
24212 d_sigprocmask='$d_sigprocmask'
24213 d_sigsetjmp='$d_sigsetjmp'
24214 d_sin6_scope_id='$d_sin6_scope_id'
24215 d_sitearch='$d_sitearch'
24216 d_snprintf='$d_snprintf'
24217 d_sockaddr_in6='$d_sockaddr_in6'
24218 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24219 d_sockatmark='$d_sockatmark'
24220 d_sockatmarkproto='$d_sockatmarkproto'
24221 d_socket='$d_socket'
24222 d_socklen_t='$d_socklen_t'
24223 d_sockpair='$d_sockpair'
24224 d_socks5_init='$d_socks5_init'
24225 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24227 d_srand48_r='$d_srand48_r'
24228 d_srandom_r='$d_srandom_r'
24229 d_sresgproto='$d_sresgproto'
24230 d_sresuproto='$d_sresuproto'
24231 d_statblks='$d_statblks'
24232 d_statfs_f_flags='$d_statfs_f_flags'
24233 d_statfs_s='$d_statfs_s'
24234 d_static_inline='$d_static_inline'
24235 d_statvfs='$d_statvfs'
24236 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24237 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24238 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24239 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24240 d_stdio_stream_array='$d_stdio_stream_array'
24241 d_stdiobase='$d_stdiobase'
24242 d_stdstdio='$d_stdstdio'
24243 d_strchr='$d_strchr'
24244 d_strcoll='$d_strcoll'
24245 d_strctcpy='$d_strctcpy'
24246 d_strerrm='$d_strerrm'
24247 d_strerror='$d_strerror'
24248 d_strerror_r='$d_strerror_r'
24249 d_strftime='$d_strftime'
24250 d_strlcat='$d_strlcat'
24251 d_strlcpy='$d_strlcpy'
24252 d_strtod='$d_strtod'
24253 d_strtol='$d_strtol'
24254 d_strtold='$d_strtold'
24255 d_strtoll='$d_strtoll'
24256 d_strtoq='$d_strtoq'
24257 d_strtoul='$d_strtoul'
24258 d_strtoull='$d_strtoull'
24259 d_strtouq='$d_strtouq'
24260 d_strxfrm='$d_strxfrm'
24261 d_suidsafe='$d_suidsafe'
24262 d_symlink='$d_symlink'
24263 d_syscall='$d_syscall'
24264 d_syscallproto='$d_syscallproto'
24265 d_sysconf='$d_sysconf'
24266 d_sysernlst='$d_sysernlst'
24267 d_syserrlst='$d_syserrlst'
24268 d_system='$d_system'
24269 d_tcgetpgrp='$d_tcgetpgrp'
24270 d_tcsetpgrp='$d_tcsetpgrp'
24271 d_telldir='$d_telldir'
24272 d_telldirproto='$d_telldirproto'
24273 d_tgamma='$d_tgamma'
24275 d_timegm='$d_timegm'
24277 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24278 d_tm_tm_zone='$d_tm_tm_zone'
24279 d_tmpnam_r='$d_tmpnam_r'
24280 d_truncate='$d_truncate'
24282 d_truncl='$d_truncl'
24283 d_ttyname_r='$d_ttyname_r'
24284 d_tzname='$d_tzname'
24285 d_u32align='$d_u32align'
24286 d_ualarm='$d_ualarm'
24289 d_union_semun='$d_union_semun'
24290 d_unordered='$d_unordered'
24291 d_unsetenv='$d_unsetenv'
24292 d_usleep='$d_usleep'
24293 d_usleepproto='$d_usleepproto'
24295 d_vendorarch='$d_vendorarch'
24296 d_vendorbin='$d_vendorbin'
24297 d_vendorlib='$d_vendorlib'
24298 d_vendorscript='$d_vendorscript'
24300 d_void_closedir='$d_void_closedir'
24301 d_voidsig='$d_voidsig'
24302 d_voidtty='$d_voidtty'
24303 d_volatile='$d_volatile'
24304 d_vprintf='$d_vprintf'
24305 d_vsnprintf='$d_vsnprintf'
24307 d_waitpid='$d_waitpid'
24308 d_wcscmp='$d_wcscmp'
24309 d_wcstombs='$d_wcstombs'
24310 d_wcsxfrm='$d_wcsxfrm'
24311 d_wctomb='$d_wctomb'
24312 d_writev='$d_writev'
24315 db_hashtype='$db_hashtype'
24316 db_prefixtype='$db_prefixtype'
24317 db_version_major='$db_version_major'
24318 db_version_minor='$db_version_minor'
24319 db_version_patch='$db_version_patch'
24320 direntrytype='$direntrytype'
24323 doublekind='$doublekind'
24324 doublesize='$doublesize'
24326 drand48_r_proto='$drand48_r_proto'
24328 dynamic_ext='$dynamic_ext'
24334 endgrent_r_proto='$endgrent_r_proto'
24335 endhostent_r_proto='$endhostent_r_proto'
24336 endnetent_r_proto='$endnetent_r_proto'
24337 endprotoent_r_proto='$endprotoent_r_proto'
24338 endpwent_r_proto='$endpwent_r_proto'
24339 endservent_r_proto='$endservent_r_proto'
24340 eunicefix='$eunicefix'
24343 extensions='$extensions'
24344 extern_C='$extern_C'
24346 fflushNULL='$fflushNULL'
24347 fflushall='$fflushall'
24349 firstmakefile='$firstmakefile'
24351 fpossize='$fpossize'
24352 fpostype='$fpostype'
24353 freetype='$freetype'
24356 full_csh='$full_csh'
24357 full_sed='$full_sed'
24358 gccansipedantic='$gccansipedantic'
24359 gccosandvers='$gccosandvers'
24360 gccversion='$gccversion'
24361 getgrent_r_proto='$getgrent_r_proto'
24362 getgrgid_r_proto='$getgrgid_r_proto'
24363 getgrnam_r_proto='$getgrnam_r_proto'
24364 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24365 gethostbyname_r_proto='$gethostbyname_r_proto'
24366 gethostent_r_proto='$gethostent_r_proto'
24367 getlogin_r_proto='$getlogin_r_proto'
24368 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24369 getnetbyname_r_proto='$getnetbyname_r_proto'
24370 getnetent_r_proto='$getnetent_r_proto'
24371 getprotobyname_r_proto='$getprotobyname_r_proto'
24372 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24373 getprotoent_r_proto='$getprotoent_r_proto'
24374 getpwent_r_proto='$getpwent_r_proto'
24375 getpwnam_r_proto='$getpwnam_r_proto'
24376 getpwuid_r_proto='$getpwuid_r_proto'
24377 getservbyname_r_proto='$getservbyname_r_proto'
24378 getservbyport_r_proto='$getservbyport_r_proto'
24379 getservent_r_proto='$getservent_r_proto'
24380 getspnam_r_proto='$getspnam_r_proto'
24381 gidformat='$gidformat'
24387 gmtime_r_proto='$gmtime_r_proto'
24388 gnulibc_version='$gnulibc_version'
24390 groupcat='$groupcat'
24391 groupstype='$groupstype'
24394 h_sysfile='$h_sysfile'
24397 hostgenerate='$hostgenerate'
24398 hostosname='$hostosname'
24399 hostperl='$hostperl'
24400 html1dir='$html1dir'
24401 html1direxp='$html1direxp'
24402 html3dir='$html3dir'
24403 html3direxp='$html3direxp'
24412 i_arpainet='$i_arpainet'
24413 i_assert='$i_assert'
24415 i_bsdioctl='$i_bsdioctl'
24419 i_dirent='$i_dirent'
24421 i_execinfo='$i_execinfo'
24426 i_fp_class='$i_fp_class'
24428 i_gdbm_ndbm='$i_gdbm_ndbm'
24429 i_gdbmndbm='$i_gdbmndbm'
24431 i_ieeefp='$i_ieeefp'
24432 i_inttypes='$i_inttypes'
24433 i_langinfo='$i_langinfo'
24434 i_libutil='$i_libutil'
24435 i_limits='$i_limits'
24436 i_locale='$i_locale'
24437 i_machcthr='$i_machcthr'
24438 i_malloc='$i_malloc'
24439 i_mallocmalloc='$i_mallocmalloc'
24441 i_memory='$i_memory'
24442 i_mntent='$i_mntent'
24445 i_neterrno='$i_neterrno'
24446 i_netinettcp='$i_netinettcp'
24450 i_pthread='$i_pthread'
24452 i_quadmath='$i_quadmath'
24453 i_rpcsvcdbm='$i_rpcsvcdbm'
24455 i_shadow='$i_shadow'
24457 i_stdarg='$i_stdarg'
24458 i_stdbool='$i_stdbool'
24459 i_stddef='$i_stddef'
24460 i_stdint='$i_stdint'
24461 i_stdlib='$i_stdlib'
24462 i_string='$i_string'
24463 i_sunmath='$i_sunmath'
24464 i_sysaccess='$i_sysaccess'
24465 i_sysdir='$i_sysdir'
24466 i_sysfile='$i_sysfile'
24467 i_sysfilio='$i_sysfilio'
24469 i_sysioctl='$i_sysioctl'
24470 i_syslog='$i_syslog'
24471 i_sysmman='$i_sysmman'
24472 i_sysmode='$i_sysmode'
24473 i_sysmount='$i_sysmount'
24474 i_sysndir='$i_sysndir'
24475 i_sysparam='$i_sysparam'
24476 i_syspoll='$i_syspoll'
24477 i_sysresrc='$i_sysresrc'
24478 i_syssecrt='$i_syssecrt'
24479 i_sysselct='$i_sysselct'
24480 i_syssockio='$i_syssockio'
24481 i_sysstat='$i_sysstat'
24482 i_sysstatfs='$i_sysstatfs'
24483 i_sysstatvfs='$i_sysstatvfs'
24484 i_systime='$i_systime'
24485 i_systimek='$i_systimek'
24486 i_systimes='$i_systimes'
24487 i_systypes='$i_systypes'
24488 i_sysuio='$i_sysuio'
24490 i_sysutsname='$i_sysutsname'
24491 i_sysvfs='$i_sysvfs'
24492 i_syswait='$i_syswait'
24493 i_termio='$i_termio'
24494 i_termios='$i_termios'
24496 i_unistd='$i_unistd'
24499 i_values='$i_values'
24500 i_varargs='$i_varargs'
24501 i_varhdr='$i_varhdr'
24503 ignore_versioned_solibs='$ignore_versioned_solibs'
24504 inc_version_list='$inc_version_list'
24505 inc_version_list_init='$inc_version_list_init'
24509 initialinstalllocation='$initialinstalllocation'
24510 installarchlib='$installarchlib'
24511 installbin='$installbin'
24512 installhtml1dir='$installhtml1dir'
24513 installhtml3dir='$installhtml3dir'
24514 installman1dir='$installman1dir'
24515 installman3dir='$installman3dir'
24516 installprefix='$installprefix'
24517 installprefixexp='$installprefixexp'
24518 installprivlib='$installprivlib'
24519 installscript='$installscript'
24520 installsitearch='$installsitearch'
24521 installsitebin='$installsitebin'
24522 installsitehtml1dir='$installsitehtml1dir'
24523 installsitehtml3dir='$installsitehtml3dir'
24524 installsitelib='$installsitelib'
24525 installsiteman1dir='$installsiteman1dir'
24526 installsiteman3dir='$installsiteman3dir'
24527 installsitescript='$installsitescript'
24528 installstyle='$installstyle'
24529 installusrbinperl='$installusrbinperl'
24530 installvendorarch='$installvendorarch'
24531 installvendorbin='$installvendorbin'
24532 installvendorhtml1dir='$installvendorhtml1dir'
24533 installvendorhtml3dir='$installvendorhtml3dir'
24534 installvendorlib='$installvendorlib'
24535 installvendorman1dir='$installvendorman1dir'
24536 installvendorman3dir='$installvendorman3dir'
24537 installvendorscript='$installvendorscript'
24539 issymlink='$issymlink'
24540 ivdformat='$ivdformat'
24543 known_extensions='$known_extensions'
24546 ld_can_script='$ld_can_script'
24547 lddlflags='$lddlflags'
24549 ldflags_uselargefiles='$ldflags_uselargefiles'
24550 ldlibpthname='$ldlibpthname'
24557 libsdirs='$libsdirs'
24558 libsfiles='$libsfiles'
24559 libsfound='$libsfound'
24560 libspath='$libspath'
24561 libswanted='$libswanted'
24562 libswanted_uselargefiles='$libswanted_uselargefiles'
24568 localtime_r_proto='$localtime_r_proto'
24569 locincpth='$locincpth'
24570 loclibpth='$loclibpth'
24571 longdblkind='$longdblkind'
24572 longdblsize='$longdblsize'
24573 longlongsize='$longlongsize'
24574 longsize='$longsize'
24578 lseeksize='$lseeksize'
24579 lseektype='$lseektype'
24583 make_set_make='$make_set_make'
24584 mallocobj='$mallocobj'
24585 mallocsrc='$mallocsrc'
24586 malloctype='$malloctype'
24588 man1direxp='$man1direxp'
24591 man3direxp='$man3direxp'
24593 mips_type='$mips_type'
24594 mistrustnm='$mistrustnm'
24596 mmaptype='$mmaptype'
24597 modetype='$modetype'
24599 multiarch='$multiarch'
24601 myarchname='$myarchname'
24602 mydomain='$mydomain'
24603 myhostname='$myhostname'
24606 need_va_copy='$need_va_copy'
24607 netdb_hlen_type='$netdb_hlen_type'
24608 netdb_host_type='$netdb_host_type'
24609 netdb_name_type='$netdb_name_type'
24610 netdb_net_type='$netdb_net_type'
24613 nm_so_opt='$nm_so_opt'
24614 nonxs_ext='$nonxs_ext'
24616 nvEUformat='$nvEUformat'
24617 nvFUformat='$nvFUformat'
24618 nvGUformat='$nvGUformat'
24619 nv_overflows_integers_at='$nv_overflows_integers_at'
24620 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24621 nveformat='$nveformat'
24622 nvfformat='$nvfformat'
24623 nvgformat='$nvgformat'
24626 o_nonblock='$o_nonblock'
24628 old_pthread_create_joinable='$old_pthread_create_joinable'
24629 optimize='$optimize'
24630 orderlib='$orderlib'
24633 otherlibdirs='$otherlibdirs'
24637 patchlevel='$patchlevel'
24638 path_sep='$path_sep'
24641 perl_patchlevel='$perl_patchlevel'
24642 perl_static_inline='$perl_static_inline'
24643 perladmin='$perladmin'
24644 perllibs='$perllibs'
24645 perlpath='$perlpath'
24647 phostname='$phostname'
24653 prefixexp='$prefixexp'
24655 privlibexp='$privlibexp'
24656 procselfexe='$procselfexe'
24657 prototype='$prototype'
24659 quadkind='$quadkind'
24660 quadtype='$quadtype'
24661 randbits='$randbits'
24662 randfunc='$randfunc'
24663 random_r_proto='$random_r_proto'
24664 randseedtype='$randseedtype'
24666 rd_nodata='$rd_nodata'
24667 readdir64_r_proto='$readdir64_r_proto'
24668 readdir_r_proto='$readdir_r_proto'
24669 revision='$revision'
24675 sGMTIME_max='$sGMTIME_max'
24676 sGMTIME_min='$sGMTIME_min'
24677 sLOCALTIME_max='$sLOCALTIME_max'
24678 sLOCALTIME_min='$sLOCALTIME_min'
24679 sPRIEUldbl='$sPRIEUldbl'
24680 sPRIFUldbl='$sPRIFUldbl'
24681 sPRIGUldbl='$sPRIGUldbl'
24682 sPRIXU64='$sPRIXU64'
24684 sPRIeldbl='$sPRIeldbl'
24685 sPRIfldbl='$sPRIfldbl'
24686 sPRIgldbl='$sPRIgldbl'
24691 sSCNfldbl='$sSCNfldbl'
24692 sched_yield='$sched_yield'
24693 scriptdir='$scriptdir'
24694 scriptdirexp='$scriptdirexp'
24696 seedfunc='$seedfunc'
24697 selectminbits='$selectminbits'
24698 selecttype='$selecttype'
24699 sendmail='$sendmail'
24700 setgrent_r_proto='$setgrent_r_proto'
24701 sethostent_r_proto='$sethostent_r_proto'
24702 setlocale_r_proto='$setlocale_r_proto'
24703 setnetent_r_proto='$setnetent_r_proto'
24704 setprotoent_r_proto='$setprotoent_r_proto'
24705 setpwent_r_proto='$setpwent_r_proto'
24706 setservent_r_proto='$setservent_r_proto'
24709 sharpbang='$sharpbang'
24710 shmattype='$shmattype'
24711 shortsize='$shortsize'
24714 sig_count='$sig_count'
24715 sig_name='$sig_name'
24716 sig_name_init='$sig_name_init'
24718 sig_num_init='$sig_num_init'
24719 sig_size='$sig_size'
24720 signal_t='$signal_t'
24721 sitearch='$sitearch'
24722 sitearchexp='$sitearchexp'
24724 sitebinexp='$sitebinexp'
24725 sitehtml1dir='$sitehtml1dir'
24726 sitehtml1direxp='$sitehtml1direxp'
24727 sitehtml3dir='$sitehtml3dir'
24728 sitehtml3direxp='$sitehtml3direxp'
24730 sitelib_stem='$sitelib_stem'
24731 sitelibexp='$sitelibexp'
24732 siteman1dir='$siteman1dir'
24733 siteman1direxp='$siteman1direxp'
24734 siteman3dir='$siteman3dir'
24735 siteman3direxp='$siteman3direxp'
24736 siteprefix='$siteprefix'
24737 siteprefixexp='$siteprefixexp'
24738 sitescript='$sitescript'
24739 sitescriptexp='$sitescriptexp'
24740 sizesize='$sizesize'
24741 sizetype='$sizetype'
24745 sockethdr='$sockethdr'
24746 socketlib='$socketlib'
24747 socksizetype='$socksizetype'
24749 spackage='$spackage'
24750 spitshell='$spitshell'
24751 srand48_r_proto='$srand48_r_proto'
24752 srandom_r_proto='$srandom_r_proto'
24754 ssizetype='$ssizetype'
24755 st_ino_sign='$st_ino_sign'
24756 st_ino_size='$st_ino_size'
24757 startperl='$startperl'
24759 static_ext='$static_ext'
24761 stdio_base='$stdio_base'
24762 stdio_bufsiz='$stdio_bufsiz'
24763 stdio_cnt='$stdio_cnt'
24764 stdio_filbuf='$stdio_filbuf'
24765 stdio_ptr='$stdio_ptr'
24766 stdio_stream_array='$stdio_stream_array'
24767 strerror_r_proto='$strerror_r_proto'
24770 subversion='$subversion'
24775 targetarch='$targetarch'
24776 targetdir='$targetdir'
24777 targetenv='$targetenv'
24778 targethost='$targethost'
24779 targetmkdir='$targetmkdir'
24780 targetport='$targetport'
24781 targetsh='$targetsh'
24785 timeincl='$timeincl'
24786 timetype='$timetype'
24787 tmpnam_r_proto='$tmpnam_r_proto'
24793 ttyname_r_proto='$ttyname_r_proto'
24802 uidformat='$uidformat'
24808 uquadtype='$uquadtype'
24809 use5005threads='$use5005threads'
24810 use64bitall='$use64bitall'
24811 use64bitint='$use64bitint'
24812 usecbacktrace='$usecbacktrace'
24813 usecrosscompile='$usecrosscompile'
24814 usedevel='$usedevel'
24816 usedtrace='$usedtrace'
24817 usefaststdio='$usefaststdio'
24818 useithreads='$useithreads'
24819 usekernprocpathname='$usekernprocpathname'
24820 uselargefiles='$uselargefiles'
24821 uselongdouble='$uselongdouble'
24822 usemallocwrap='$usemallocwrap'
24823 usemorebits='$usemorebits'
24824 usemultiplicity='$usemultiplicity'
24825 usemymalloc='$usemymalloc'
24827 usensgetexecutablepath='$usensgetexecutablepath'
24828 useopcode='$useopcode'
24829 useperlio='$useperlio'
24830 useposix='$useposix'
24831 usequadmath='$usequadmath'
24832 usereentrant='$usereentrant'
24833 userelocatableinc='$userelocatableinc'
24834 useshrplib='$useshrplib'
24835 usesitecustomize='$usesitecustomize'
24836 usesocks='$usesocks'
24837 usethreads='$usethreads'
24838 usevendorprefix='$usevendorprefix'
24839 useversionedarchname='$useversionedarchname'
24840 usevfork='$usevfork'
24843 uvXUformat='$uvXUformat'
24844 uvoformat='$uvoformat'
24847 uvuformat='$uvuformat'
24848 uvxformat='$uvxformat'
24850 vendorarch='$vendorarch'
24851 vendorarchexp='$vendorarchexp'
24852 vendorbin='$vendorbin'
24853 vendorbinexp='$vendorbinexp'
24854 vendorhtml1dir='$vendorhtml1dir'
24855 vendorhtml1direxp='$vendorhtml1direxp'
24856 vendorhtml3dir='$vendorhtml3dir'
24857 vendorhtml3direxp='$vendorhtml3direxp'
24858 vendorlib='$vendorlib'
24859 vendorlib_stem='$vendorlib_stem'
24860 vendorlibexp='$vendorlibexp'
24861 vendorman1dir='$vendorman1dir'
24862 vendorman1direxp='$vendorman1direxp'
24863 vendorman3dir='$vendorman3dir'
24864 vendorman3direxp='$vendorman3direxp'
24865 vendorprefix='$vendorprefix'
24866 vendorprefixexp='$vendorprefixexp'
24867 vendorscript='$vendorscript'
24868 vendorscriptexp='$vendorscriptexp'
24870 version_patchlevel_string='$version_patchlevel_string'
24871 versiononly='$versiononly'
24875 yaccflags='$yaccflags'
24880 : add special variables
24881 $test -f $src/patchlevel.h && \
24882 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24883 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24884 echo "PERL_CONFIG_SH=true" >>config.sh
24886 : propagate old symbols
24887 if $test -f UU/config.sh; then
24888 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24889 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24890 config.sh config.sh UU/oldconfig.sh |\
24891 $sort | $uniq -u >UU/oldsyms
24892 set X `$cat UU/oldsyms`
24898 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24900 echo ": Variables propagated from previous config.sh file." >>config.sh
24901 for sym in `$cat UU/oldsyms`; do
24902 echo " Propagating $hint variable "'$'"$sym..."
24903 eval 'tmp="$'"${sym}"'"'
24905 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24911 : preserve RCS keywords in files with variable substitution, grrr
24914 : Finish up by extracting the .SH files
24918 echo "Extraction done."
24928 If you'd like to make any changes to the config.sh file before I begin
24929 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24932 rp="Press return or use a shell escape to edit config.sh:"
24937 *) : in case they cannot read
24938 sh 1>&4 -c "$ans";;
24943 : if this fails, just run all the .SH files by hand
24952 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24959 Now you need to generate make dependencies by running "$make depend".
24960 You might prefer to run it in background: "$make depend > makedepend.out &"
24961 It can take a while, so you might not want to run it right now.
24966 rp="Run $make depend now?"
24970 $make depend && echo "Now you must run '$make'."
24973 echo "You must run '$make depend' then '$make'."
24976 elif test -f [Mm]akefile; then
24978 echo "Now you must run a $make."
24980 echo "Configure done."
24983 if $test -f Policy.sh; then
24986 If you compile $package on a different machine or from a different object
24987 directory, copy the Policy.sh file from this object directory to the
24988 new one before you run Configure -- this will help you with most of
24989 the policy defaults.
24993 if $test -f config.msg; then
24994 echo "Hmm. I also noted the following information while running:"
24996 $cat config.msg >&4
24999 $rm -f kit*isdone ark*isdone