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=''
380 d_attribute_deprecated=''
381 d_attribute_format=''
382 d_attribute_malloc=''
383 d_attribute_nonnull=''
384 d_attribute_noreturn=''
386 d_attribute_unused=''
387 d_attribute_warn_unused_result=''
388 d_printf_format_null=''
392 d_builtin_choose_expr=''
395 d_c99_variadic_macros=''
443 endhostent_r_proto=''
449 endprotoent_r_proto=''
455 endservent_r_proto=''
512 gethostbyaddr_r_proto=''
514 gethostbyname_r_proto=''
516 gethostent_r_proto=''
529 getnetbyaddr_r_proto=''
531 getnetbyname_r_proto=''
545 d_getprotobyname_r=''
546 getprotobyname_r_proto=''
547 d_getprotobynumber_r=''
548 getprotobynumber_r_proto=''
550 getprotoent_r_proto=''
562 getservbyname_r_proto=''
564 getservbyport_r_proto=''
566 getservent_r_proto=''
597 d_libm_lib_version=''
600 d_localtime_r_needs_tzset=''
613 d_malloc_good_size=''
657 d_old_pthread_create_joinable=''
658 old_pthread_create_joinable=''
660 d_pthread_attr_setscope=''
700 sethostent_r_proto=''
717 setprotoent_r_proto=''
729 setservent_r_proto=''
751 d_ipv6_mreq_source=''
768 d_sprintf_returns_strlen=''
780 perl_static_inline=''
785 d_stdio_ptr_lval_nochange_cnt=''
786 d_stdio_ptr_lval_sets_cnt=''
936 d_gdbm_ndbm_h_uses_prototypes=''
937 d_gdbmndbm_h_uses_prototypes=''
939 d_ndbm_h_uses_prototypes=''
1014 d_inc_version_list=''
1016 inc_version_list_init=''
1020 installusrbinperl=''
1036 ignore_versioned_solibs=''
1096 d_perl_otherlibdirs=''
1104 api_versionstring=''
1110 version_patchlevel_string=''
1114 d_nv_preserves_uv=''
1115 d_nv_zero_is_allbits_zero=''
1126 nv_overflows_integers_at=''
1127 nv_preserves_uv_bits=''
1200 installsitehtml1dir=''
1203 installsitehtml3dir=''
1210 installsiteman1dir=''
1213 installsiteman3dir=''
1218 installsitescript=''
1236 d_stdio_stream_array=''
1237 stdio_stream_array=''
1255 usekernprocpathname=''
1256 ccflags_uselargefiles=''
1257 ldflags_uselargefiles=''
1258 libswanted_uselargefiles=''
1267 usensgetexecutablepath=''
1280 installvendorarch=''
1287 installvendorhtml1dir=''
1289 vendorhtml1direxp=''
1290 installvendorhtml3dir=''
1292 vendorhtml3direxp=''
1298 installvendorman1dir=''
1301 installvendorman3dir=''
1308 installvendorscript=''
1319 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1322 : We must find out about Eunice early
1324 if test -f /etc/unixtovms; then
1325 eunicefix=/etc/unixtovms
1327 if test -f /etc/unixtovms.exe; then
1328 eunicefix=/etc/unixtovms.exe
1331 : Set executable suffix now -- needed before hints available
1332 if test -f "/libs/version.library"; then
1335 elif test -f "/system/gnu_library/bin/ar.pm"; then
1338 elif test -n "$DJGPP"; then
1341 elif test -f /kern/cookiejar; then
1344 elif test -d c:/. -o -n "$is_os2" ; then
1351 : Trailing extension. Override this in a hint file, if needed.
1352 : Extra object files, if any, needed on this platform.
1355 : Possible local include directories to search.
1356 : Set locincpth to "" in a hint file to defeat local include searches.
1357 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1358 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1360 : no include file wanted by default
1363 : Enable -DEBUGGING and -DDEBUGGING from the command line
1368 : change the next line if compiling for Xenix/286 on Xenix/386
1369 xlibpth='/usr/lib/386 /lib/386'
1370 : Possible local library directories to search.
1371 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1372 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1374 : general looking path for locating libraries
1375 glibpth="/lib /usr/lib $xlibpth"
1376 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1377 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1378 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1379 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1381 : Private path used by Configure to find libraries. Its value
1382 : is prepended to libpth. This variable takes care of special
1383 : machines, like the mips. Usually, it should be empty.
1386 : default library list
1388 : some systems want to use only the non-versioned libso:s
1389 ignore_versioned_solibs=''
1390 : set usethreads on the Configure command line to enable threads.
1391 usereentrant='undef'
1395 : set useposix=false in your hint file to disable the POSIX extension.
1397 : set useopcode=false in your hint file to disable the Opcode extension.
1400 ccflags_uselargefiles=''
1401 ldflags_uselargefiles=''
1402 libswanted_uselargefiles=''
1403 : set usemultiplicity on the Configure command line to enable multiplicity.
1404 : set usesocks on the Configure command line to enable socks.
1405 : List of libraries we want.
1406 : If anyone needs extra -lxxx, put those in a hint file.
1407 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1408 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1409 : We probably want to search /usr/shlib before most other libraries.
1410 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1411 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1412 glibpth="/usr/shlib $glibpth"
1413 : Do not use vfork unless overridden by a hint file.
1416 : Find the basic shell for Bourne shell scripts
1420 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1423 if test -f "$xxx"; then
1426 : Build up a list and do a single loop so we can 'break' out.
1427 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1428 for xxx in sh bash ksh pdksh ash; do
1430 try="$try ${p}/${xxx}"
1434 if test -f "$xxx"; then
1437 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1440 elif test -f "$xxx.exe"; then
1451 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1453 Usually it's in /bin/sh. How did you even get this far?
1454 Please contact me (Perl Maintainers) at perlbug@perl.org and
1455 we'll try to straighten this all out.
1461 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1462 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1465 : see if sh knows # comments
1466 if `$sh -c '#' >/dev/null 2>&1`; then
1470 test -f $xcat$_exe || xcat=/usr/bin/cat
1471 if test ! -f $xcat$_exe; then
1472 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1473 if test -f $p/cat$_exe; then
1478 if test ! -f $xcat$_exe; then
1479 echo "Can't find cat anywhere!"
1483 echo "#!$xcat" >sharp
1486 ./sharp > today 2>/dev/null
1487 if test -s today; then
1490 echo "#! $xcat" > sharp
1493 ./sharp > today 2>/dev/null
1494 if test -s today; then
1502 echo "Your $sh doesn't grok # comments--I will strip them later on."
1505 echo "exec grep -v '^[ ]*#'" >spitshell
1507 $eunicefix spitshell
1508 spitshell=`pwd`/spitshell
1510 echo "I presume that if # doesn't work, #! won't work either!"
1515 : figure out how to guarantee sh startup
1517 '') startsh=${sharpbang}${sh} ;;
1529 : echo "Yup, it does."
1531 echo "Hmm... '$startsh' does not guarantee sh startup..."
1532 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1536 : Save command line options in file UU/cmdline.opt for later use in
1537 : generating config.sh.
1538 cat > cmdline.opt <<EOSH
1539 : Configure command line arguments.
1548 cat >>cmdline.opt <<EOSH
1549 config_arg$argn='$arg'
1551 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1554 arg_exp=`cat cmdl.opt`
1555 args_exp="$args_exp$args_sep'$arg_exp'"
1556 argn=`expr $argn + 1`
1561 : produce awk script to parse command line options
1562 cat >options.awk <<'EOF'
1564 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1566 len = length(optstr);
1567 for (i = 1; i <= len; i++) {
1568 c = substr(optstr, i, 1);
1569 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1580 if (substr(str, 1, 1) != "-") {
1581 printf("'%s'\n", str);
1585 for (i = 2; i <= len; i++) {
1586 c = substr(str, i, 1);
1588 printf("-%s\n", substr(str, i));
1594 printf("'%s'\n", substr(str, i + 1));
1607 : process the command line options
1608 set X `for arg in "$@"; do echo "X$arg"; done |
1609 sed -e s/X// | awk -f options.awk`
1614 : set up default values
1624 rm -f optdef.sh posthint.sh
1625 cat >optdef.sh <<EOS
1631 while test $# -gt 0; do
1633 -d) shift; fastread=yes;;
1634 -e) shift; alldone=cont;;
1638 if test -r "$1"; then
1641 echo "$me: cannot read config file $1." >&2
1647 -h) shift; error=true;;
1648 -r) shift; reuseval=true;;
1649 -s) shift; silent=true; realsilent=true;;
1650 -E) shift; alldone=exit;;
1651 -K) shift; knowitall=true;;
1652 -O) shift; override=true;;
1653 -S) shift; silent=true; extractsh=true;;
1658 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1659 echo "$me: ignoring -D $1" >&2
1662 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1663 *) echo "$1='define'" >> optdef.sh;;
1670 *=) echo "$1" >> optdef.sh;;
1672 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1673 echo "$me: ignoring -U $1" >&2
1675 *) echo "$1='undef'" >> optdef.sh;;
1686 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1690 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1691 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1697 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1698 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1699 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1700 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1701 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1702 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1708 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1710 echo "$yyy=''" >> posthint.sh ;;
1715 echo "$yyy='$zzz'" >> posthint.sh ;;
1717 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1719 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1724 echo "$yyy=$zzz" >> posthint.sh ;;
1725 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1729 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1732 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1740 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1741 [-U symbol] [-U symbol=] [-A command:symbol...]
1742 -d : use defaults for all answers.
1743 -e : go on without questioning past the production of config.sh.
1744 -f : specify an alternate default configuration file.
1745 -h : print this help message and exit (with an error status).
1746 -r : reuse C symbols value if possible (skips costly nm extraction).
1747 -s : silent mode, only echoes questions and essential information.
1748 -D : define symbol to have some value:
1749 -D symbol symbol gets the value 'define'
1750 -D symbol=value symbol gets the value 'value'
1751 common used examples (see INSTALL for more info):
1752 -Duse64bitint use 64bit integers
1753 -Duse64bitall use 64bit integers and pointers
1754 -Dusethreads use thread support
1755 -Dinc_version_list=none do not include older perl trees in @INC
1756 -DEBUGGING=none DEBUGGING options
1757 -Dcc=gcc choose your compiler
1758 -Dprefix=/opt/perl5 choose your destination
1759 -E : stop at the end of questions, after having produced config.sh.
1760 -K : do not use unless you know what you are doing.
1761 -O : let -D and -U override definitions from loaded configuration file.
1762 -S : perform variable substitutions on all .SH files (can mix with -f)
1763 -U : undefine symbol:
1764 -U symbol symbol gets the value 'undef'
1765 -U symbol= symbol gets completely empty
1767 -A : manipulate symbol after the platform specific hints have been applied:
1768 -A append:symbol=value append value to symbol
1769 -A symbol=value like append:, but with a separating space
1770 -A define:symbol=value define symbol to have value
1771 -A clear:symbol define symbol to be ''
1772 -A define:symbol define symbol to be 'define'
1773 -A eval:symbol=value define symbol to be eval of value
1774 -A prepend:symbol=value prepend value to symbol
1775 -A undef:symbol define symbol to be 'undef'
1776 -A undef:symbol= define symbol to be ''
1777 e.g.: -A prepend:libswanted='cl pthread '
1778 -A ccflags=-DSOME_MACRO
1779 -V : print version number and exit (with a zero status).
1786 case "$fastread$alldone" in
1789 case "$extractsh" in
1792 if test ! -t 0; then
1793 echo "Say 'sh Configure', not 'sh <Configure'"
1803 true) exec 1>/dev/null;;
1806 : run the defines and the undefines, if any, but leave the file out there...
1809 : create the posthint manipulation script and leave the file out there...
1814 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1815 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1816 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1817 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1818 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1821 : Some greps do not return status, grrr.
1822 echo "grimblepritz" >grimble
1823 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1825 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1831 : the following should work in any shell
1835 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1836 cat >contains <<'EOSS'
1837 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1842 : Find the path to the source tree
1845 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1849 *) src=`cd ../$src && pwd` ;;
1862 if test -f $rsrc/Configure && \
1863 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1865 : found it, so we are ok.
1868 for src in . .. ../.. ../../.. ../../../..; do
1869 if test -f ../$src/Configure && \
1870 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1881 Sorry, I can't seem to locate the source dir for $package. Please start
1882 Configure with an explicit path -- i.e. /some/path/Configure.
1890 echo "Sources for $package found in \"$src\"." >&4
1894 : script used to extract .SH files with variable substitutions
1895 cat >extract <<'EOS'
1897 echo "Doing variable substitutions on .SH files..."
1898 if test -f MANIFEST; then
1899 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1901 echo "(Looking for .SH files under the source directory.)"
1902 set x `(cd "$src"; find . -name "*.SH" -print)`
1906 0) set x `(cd "$src"; echo *.SH)`; shift;;
1908 if test ! -f "$src/$1"; then
1914 while test $name; do
1915 if test ! -d "$name"; then
1916 create="$name $create";
1917 name=`echo $name | sed -e "s|^[^/]*$||"`;
1918 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1923 for file in $create; do
1932 dir=`expr X$file : 'X\(.*\)/'`
1933 file=`expr X$file : 'X.*/\(.*\)'`
1934 (cd "$dir" && . ./$file)
1944 dir=`expr X$file : 'X\(.*\)/'`
1945 file=`expr X$file : 'X.*/\(.*\)'`
1946 (set x $dir; shift; eval $mkdir_p)
1947 sh <"$src/$dir/$file"
1956 if test -f "$src/config_h.SH"; then
1957 if test ! -f config.h; then
1958 : oops, they left it out of MANIFEST, probably, so do it anyway.
1959 . "$src/config_h.SH"
1964 : extract files and exit if asked to do so
1965 case "$extractsh" in
1967 case "$realsilent" in
1971 case "$config_sh" in
1972 '') config_sh='config.sh';;
1975 echo "Fetching answers from $config_sh..."
1978 test "$override" && . ./optdef.sh
1982 echo "Extraction done."
1987 : Eunice requires " " instead of "", can you believe it
1990 echo "Beginning of configuration questions for $package."
1992 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1994 : first determine how to suppress newline on echo command
1996 echo "Checking echo to see how to suppress newlines..."
1997 (echo "hi there\c" ; echo " ") >.echotmp
1998 if $contains c .echotmp >/dev/null 2>&1 ; then
2009 echo $n "The star should be here-->$c"
2013 : Now test for existence of everything in MANIFEST
2015 if test -f "$rsrc/MANIFEST"; then
2016 echo "First let's make sure your kit is complete. Checking..." >&4
2017 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2018 (split -l 50 2>/dev/null || split -50)
2021 for filelist in x??; do
2022 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2023 >/dev/null 2>>"$tmppwd/missing")
2025 if test -s missing; then
2029 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2031 You have the option of continuing the configuration process, despite the
2032 distinct possibility that your kit is damaged, by typing 'y'es. If you
2033 do, don't blame me if something goes wrong. I advise you to type 'n'o
2034 and contact the author (perlbug@perl.org).
2037 echo $n "Continue? [n] $c" >&4
2041 echo "Continuing..." >&4
2045 echo "ABORTING..." >&4
2050 echo "Looks good..."
2053 echo "There is no MANIFEST file. I hope your kit is complete !"
2057 : Find the appropriate value for a newline for tr
2059 if test -n "$DJGPP"; then
2062 if test X"$trnl" = X; then
2063 case "`echo foo|tr '\n' x 2>/dev/null`" in
2067 if test X"$trnl" = X; then
2068 case "`echo foo|tr '\012' x 2>/dev/null`" in
2069 foox) trnl='\012' ;;
2072 if test X"$trnl" = X; then
2073 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2074 fooxy) trnl='\n\r' ;;
2077 if test X"$trnl" = X; then
2080 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2086 : compute the number of columns on the terminal for proper question formatting
2091 : set up the echo used in my read
2092 myecho="case \"\$xxxm\" in
2093 '') echo $n \"\$rp $c\" >&4;;
2095 '') echo $n \"[\$xxxm] $c\";;
2097 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2099 echo $n \"[\$xxxm] $c\" >&4
2101 echo $n \"\$rp [\$xxxm] $c\" >&4
2107 : now set up to do reads with possible shell escape and default assignment
2113 case "\$fastread" in
2114 yes) case "\$dflt" in
2117 case "\$silent-\$rp" in
2122 *) case "\$silent" in
2123 true) case "\$rp" in
2128 while expr "X\$ans" : "X!" >/dev/null; do
2132 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2140 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2149 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2154 echo "(OK, I'll run with -d after this question.)" >&4
2157 echo "*** Sorry, \$1 not supported yet." >&4
2167 echo "*** Substitution done -- please confirm."
2169 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2174 echo "*** Error -- try again."
2181 case "\$ans\$xxxm\$nostick" in
2193 : create .config dir to save info across Configure sessions
2194 test -d ../.config || mkdir ../.config
2195 cat >../.config/README <<EOF
2196 This directory created by Configure to save information that should
2197 persist across sessions for $package.
2199 You may safely delete it if you wish.
2202 : See if we are using a devel version and want that
2203 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2206 usedevel="$define" ;;
2207 *) case "$xversion" in
2210 *** WHOA THERE!!! ***
2212 This is an UNSTABLE DEVELOPMENT release.
2213 The version of this $package distribution is $xversion, that is, odd,
2214 (as opposed to even) and that signifies a development release.
2215 If you want a maintenance release, you want an even-numbered version.
2217 Do ***NOT*** install this into production use.
2218 Data corruption and crashes are possible.
2220 It is most seriously suggested that you do not continue any further
2221 unless you want to help in developing and debugging Perl.
2223 If you *still* want to build perl, you can answer 'y' now,
2224 or pass -Dusedevel to Configure.
2227 rp='Do you really want to continue?'
2231 [yY]) echo >&4 "Okay, continuing."
2232 usedevel="$define" ;;
2233 *) echo >&4 "Okay, bye."
2244 case "$versiononly" in
2245 '') versiononly="$define" ;;
2247 case "$installusrbinperl" in
2248 '') installusrbinperl="$undef" ;;
2253 : general instructions
2256 user=`(logname) 2>/dev/null`
2258 '') user=`whoami 2>&1`;;
2260 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2263 rp='Would you like to see the instructions?'
2274 This installation shell script will examine your system and ask you questions
2275 to determine how the perl5 package should be installed. If you get
2276 stuck on a question, you may use a ! shell escape to start a subshell or
2277 execute a command. Many of the questions will have default answers in square
2278 brackets; typing carriage return will give you the default.
2280 On some of the questions which ask for file or directory names you are allowed
2281 to use the ~name construct to specify the login directory belonging to "name",
2282 even if you don't have a shell which knows about that. Questions where this is
2283 allowed will be marked "(~name ok)".
2287 dflt='Type carriage return to continue'
2291 The prompter used in this script allows you to use shell variables and
2292 backticks in your answers. You may use $1, $2, etc... to refer to the words
2293 in the default answer, as if the default line was a set of arguments given to a
2294 script shell. This means you may also use $* to repeat the whole default line,
2295 so you do not have to re-type everything to add something to the default.
2297 Every time there is a substitution, you will have to confirm. If there is an
2298 error (e.g. an unmatched backtick), the default answer will remain unchanged
2299 and you will be prompted again.
2301 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2302 the questions and use the computed defaults (or the previous answers if there
2303 was already a config.sh file). Type 'Configure -h' for a list of options.
2304 You may also start interactively and then answer '& -d' at any prompt to turn
2305 on the non-interactive behaviour for the remainder of the execution.
2311 Much effort has been expended to ensure that this shell script will run on any
2312 Unix system. If despite that it blows up on yours, your best bet is to edit
2313 Configure and run it again. If you can't run Configure for some reason,
2314 you'll have to generate a config.sh file by hand. Whatever problems you
2315 have, let me (perlbug@perl.org) know how I blew it.
2317 This installation script affects things in two ways:
2319 1) it may do direct variable substitutions on some of the files included
2321 2) it builds a config.h file for inclusion in C programs. You may edit
2322 any of these files as the need arises after running this script.
2324 If you make a mistake on a question, there is no easy way to back up to it
2325 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2326 files. Configure will offer to let you do this before it runs the SH files.
2329 dflt='Type carriage return to continue'
2331 case "$firsttime" in
2332 true) echo $user >>../.config/instruct;;
2336 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2337 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2338 if test "X$sysroot" = X; then
2343 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2344 # _sysroot is used in places where we need --sysroot=foo
2345 # but using the rest of the flags could cause issues.
2346 _sysroot="--sysroot=$sysroot";
2350 ccflags="$ccflags $_sysroot"
2355 ldflags="$ldflags $_sysroot"
2360 cppflags="$cppflags $_sysroot"
2362 # lddlflags updated below in lddlflags section;
2363 # same with cccdlflags
2367 # Adjust some defaults to also use $sysroot
2368 for var in xlibpth loclibpth locincpth glibpth; do
2371 for path in $xxx; do
2372 eval $var=\"\$$var $sysroot$path\"
2378 : find out where common programs are
2380 echo "Locating common programs..." >&4
2393 if test -d \$dir/\$thing; then
2399 for thisthing in \$dir/\$thing; do
2400 : just loop through to pick last item
2402 if test -f \$thisthing; then
2405 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2408 elif test -f \$dir/\$thing.exe; then
2409 if test -n "$DJGPP"; then
2410 echo \$dir/\$thing.exe
2411 elif test "$eunicefix" != ":"; then
2412 : on Eunice apparently
2465 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2466 pth="$pth $sysroot/lib $sysroot/usr/lib"
2467 for file in $loclist; do
2471 if test -f "$xxx"; then
2474 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2475 xxx=`./loc $file $file $pth`
2478 '') xxx=`./loc $file $file $pth`;;
2479 *) xxx=`./loc $xxx $xxx $pth`;;
2481 eval $file=$xxx$_exe
2485 echo $file is in $xxx.
2488 echo $file is in $xxx.
2491 echo "I don't know where '$file' is, and my life depends on it." >&4
2492 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2498 echo "Don't worry if any of the following aren't found..."
2500 for file in $trylist; do
2504 if test -f "$xxx"; then
2507 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2508 xxx=`./loc $file $file $pth`
2511 '') xxx=`./loc $file $file $pth`;;
2512 *) xxx=`./loc $xxx $xxx $pth`;;
2514 eval $file=$xxx$_exe
2518 echo $file is in $xxx.
2521 echo $file is in $xxx.
2524 echo "I don't see $file out there, $say."
2531 echo "Substituting grep for egrep."
2538 *) if $less -R </dev/null >/dev/null 2>&1; then
2539 echo "Substituting less -R for less."
2547 echo "Substituting cp for ln."
2556 echo "I can't find make or gmake, and my life depends on it." >&4
2557 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2565 *) # We can't have osname yet.
2566 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2567 # Assume that gmake, if found, is definitely GNU make
2568 # and prefer it over the system make.
2569 echo "Substituting gmake for make."
2577 echo "Hopefully test is built into your sh."
2580 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2581 echo "Using the test built into your sh."
2589 echo "Hopefully echo is built into your sh."
2594 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2595 $echo $n "hi there$c" >foo1
2596 echo $n "hi there$c" >foo2
2597 if cmp foo1 foo2 >/dev/null 2>&1; then
2598 echo "They are compatible. In fact, they may be identical."
2605 They are not compatible! You are probably running ksh on a non-USG system.
2606 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2607 have echo built in and we may have to run some Bourne shell scripts. That
2608 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2611 $echo $n "The star should be here-->$c"
2618 # This question was auctioned at YAPC::Europe-2007 in Vienna
2619 # I never promised you could answer it. I only auctioned the question.
2621 The following message is sponsored by
2623 Dresden.pm<--The stars should be here.
2625 Dear Perl user, system administrator or package
2626 maintainer, the Perl community sends greetings to
2627 you. Do you (emblematical) greet back [Y/n]? n
2631 : Check what type of C compiler we use
2635 cat <<'EOSC' >>trygcc
2640 int main(int argc, char *argv[]) {
2644 if $cc -o try $ccflags $ldflags try.c; then
2647 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2653 # Skip this test because it gives a false match on output like:
2654 # ./trygcc: line 23: cc: command not found
2655 # case "`$cc -v -c try.c 2>&1`" in
2656 # *gcc*) trygcc=no ;;
2658 if $test X"$trygcc" = Xyes; then
2659 if gcc -o try -c try.c; then
2661 echo "You seem to have a working gcc, though." >&4
2662 # Switching compilers may undo the work of hints files.
2663 # The most common problem is -D_REENTRANT for threads.
2664 # This heuristic catches that case, but gets false positives
2665 # if -Dusethreads was not actually specified. Better to
2666 # bail out here with a useful message than fail
2667 # mysteriously later. Should we perhaps just try to
2668 # re-invoke Configure -Dcc=gcc config_args ?
2669 if $test -f usethreads.cbu; then
2672 *** However, any setting of the C compiler flags (e.g. for thread support)
2673 *** will be lost. It may be necessary for you to restart Configure and
2674 *** add -Dcc=gcc to your Configure command line.
2677 rp="Would you like to go ahead and try gcc anyway?"
2680 rp="Would you like to use it?"
2683 if $test -f myread; then
2686 if $test -f UU/myread; then
2689 echo "Cannot find myread, sorry. Aborting." >&2
2694 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2707 cat <<'EOSC' >>checkcc
2712 int main(int argc, char *argv[]) {
2716 if $cc -o try $ccflags $ldflags try.c; then
2719 if $test X"$despair" = Xyes; then
2720 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2723 You need to find a working C compiler.
2724 Either (purchase and) install the C compiler supplied by your OS vendor,
2725 or for a free C compiler try http://gcc.gnu.org/
2726 I cannot continue any further, aborting.
2735 : determine whether symbolic links are supported
2738 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2739 echo "Symbolic links are supported." >&4
2742 echo "Symbolic links are NOT supported." >&4
2747 : determine whether symbolic links are supported
2751 echo "Checking how to test for symbolic links..." >&4
2753 if $test "X$issymlink" = X; then
2755 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2756 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2758 if test $? = 0; then
2761 echo "Your builtin 'test -h' may be broken." >&4
2764 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2767 if test -f "$p/$test"; then
2776 echo "Trying external '$test -h'." >&4
2777 issymlink="$test -h"
2778 if $test ! -h sym >/dev/null 2>&1; then
2779 echo "External '$test -h' is broken, too." >&4
2787 if $test "X$issymlink" = X; then
2788 if $test -L sym 2>/dev/null; then
2789 issymlink="$test -L"
2790 echo "The builtin '$test -L' worked." >&4
2793 if $test "X$issymlink" != X; then
2794 echo "You can test for symbolic links with '$issymlink'." >&4
2796 echo "I do not know how you can test for symbolic links." >&4
2800 *) echo "No symbolic links, so not testing for their testing..." >&4
2805 : Make symlinks util
2806 case "$mksymlinks" in
2809 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2812 *) case "$lns:$issymlink" in
2813 *"ln"*" -s:"*"test -"?)
2814 echo "Creating the symbolic links..." >&4
2815 echo "(First creating the subdirectories...)" >&4
2817 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2819 test -z "$directory" && break
2823 if test ! -d t/base; then
2824 echo "Failed to create the subdirectories. Aborting." >&4
2827 echo "(Then creating the symlinks...)" >&4
2828 awk '{print $1}' $src/MANIFEST | while true; do
2830 test -z "$filename" && break
2831 if test -f $filename; then
2832 if $issymlink $filename; then
2836 if test -f $filename; then
2837 echo "$filename already exists, not symlinking."
2839 ln -s $src/$filename $filename
2843 if test ! -f t/base/lex.t; then
2844 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2849 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2857 : Check for Cross-Compilation
2858 if $test "X$targethost" = "X"; then
2861 if $test "X$targetenv" = "X"; then
2864 case "$usecrosscompile" in
2866 $echo "Cross-compiling..."
2869 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2870 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2871 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2872 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2873 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2874 # leave out ld, choosing it is more complex
2875 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2876 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2877 # We are in a weird spot. Just before us, some values
2878 # were 'saved', to be restored after the hints are
2879 # run. This means that the changes we made to ar,
2880 # nm and ranlib will get reverted.
2881 # To avoid that, we hijack the saving mechanism and
2882 # have it save our new values.
2883 for file in ar nm ranlib; do
2885 eval $file=$xxx$_exe
2890 case "$targetarch" in
2891 '') echo "Targetarch not defined." >&4; croak=y ;;
2892 *) echo "Using targetarch $targetarch." >&4 ;;
2894 case "$targethost" in
2895 '') echo "Targethost not defined." >&4; croak=y ;;
2896 *) echo "Using targethost $targethost." >&4
2901 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2903 : compile a host miniperl and generate_uudmap, unless we got passed them
2904 if $test "X$hostperl" = X; then
2905 echo "Building host miniperl and generate_uudmap binaries" >&4
2913 $src/Configure -des -Dusedevel -Dmksymlinks
2915 case "$hostgenerate" in
2916 '') $make generate_uudmap
2917 hostgenerate=$src/host/generate_uudmap
2919 "$undef") hostgenerate=''
2922 hostperl=$src/host/miniperl
2925 hostosname=`$hostperl -le 'print $^O'`
2928 usecrosscompile="$undef"
2932 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2933 case "$targethost" in
2934 '') echo "Checking for cross-compile" >&4
2935 case "$usecrosscompile$multiarch" in
2936 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2937 if [ -f Makefile ]; then
2939 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2941 echo "Configure done."
2945 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2952 *) echo "Using targethost $targethost." >&4
2954 /*) run=$src/Cross/run
2955 targetmkdir=$src/Cross/mkdir
2957 from=$src/Cross/from
2959 *) pwd=`$test -f ../Configure & cd ..; pwd`
2961 targetmkdir=$pwd/Cross/mkdir
2963 from=$pwd/Cross/from
2966 case "$targetrun" in
2967 '') targetrun=ssh ;;
2972 case "$targetfrom" in
2973 '') targetfrom=scp ;;
2977 from=$from-$targetfrom
2978 case "$targetdir" in
2980 echo "Guessing targetdir $targetdir." >&4
2983 case "$targetuser" in
2985 echo "Guessing targetuser $targetuser." >&4
2988 case "$targetport" in
2990 echo "Guessing targetport $targetport." >&4
2993 case "$targetfrom" in
2997 case "$targetrun" in
3017 '') cwd=$targetdir ;;
3022 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3028 *) echo "Unknown targetrun '$targetrun'" >&4
3032 case "$targetmkdir" in
3034 cat >$targetmkdir <<EOF
3036 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3038 $chmod a+rx $targetmkdir
3040 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3052 $targetmkdir \`dirname \$f\`
3053 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3056 $targetmkdir $targetdir/\`dirname \$f\`
3057 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3070 $mkdir -p $targetdir/\`dirname \$f\`
3071 $cp \$f $targetdir/\$f || exit 1
3074 $targetmkdir $targetdir/\`dirname \$f\`
3075 $cp \$f $targetdir/\$f || exit 1
3082 *) echo "Unknown targetto '$targetto'" >&4
3086 case "$targetfrom" in
3093 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3098 cp) cat >$from <<EOF
3103 cp $targetdir/\$f . || exit 1
3108 *) echo "Unknown targetfrom '$targetfrom'" >&4
3112 if $test ! -f $run; then
3113 echo "Target 'run' script '$run' not found." >&4
3117 if $test ! -f $to; then
3118 echo "Target 'to' script '$to' not found." >&4
3122 if $test ! -f $from; then
3123 echo "Target 'from' script '$from' not found." >&4
3127 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3131 Using '$run' for remote execution,
3132 and '$from' and '$to'
3133 for remote file transfer.
3139 usecrosscompile="$undef"
3144 : see whether [:lower:] and [:upper:] are supported character classes
3146 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3148 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3152 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3153 # (0xd9 and 0xe2), therefore that is a nice testing point.
3154 if test "X$up" = X -o "X$low" = X; then
3155 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3161 if test "X$up" = X -o "X$low" = X; then
3162 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3168 if test "X$up" = X -o "X$low" = X; then
3169 case "`echo RS | od -x 2>/dev/null`" in
3171 echo "Hey, this might be EBCDIC." >&4
3172 if test "X$up" = X -o "X$low" = X; then
3173 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3174 rs) up='[A-IJ-RS-Z]'
3179 if test "X$up" = X -o "X$low" = X; then
3180 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3190 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3192 echo "Using $up and $low to convert case." >&4
3195 echo "I don't know how to translate letters from upper to lower case." >&4
3196 echo "Your tr is not acting any way I know of." >&4
3200 : set up the translation script tr, must be called with ./tr of course
3204 '[A-Z][a-z]') exec $tr '$up' '$low';;
3205 '[a-z][A-Z]') exec $tr '$low' '$up';;
3212 : Try to determine whether config.sh was made on this system
3213 case "$config_sh" in
3215 myuname=`$uname -a 2>/dev/null`
3216 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3217 # Downcase everything to avoid ambiguity.
3218 # Remove slashes and single quotes so we can use parts of this in
3219 # directory and file names.
3220 # Remove newlines so myuname is sane to use elsewhere.
3221 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3222 # because the A-Z/a-z are not consecutive.
3223 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3224 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3225 newmyuname="$myuname"
3227 case "$knowitall" in
3229 if test -f ../config.sh; then
3230 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3231 eval "`grep myuname= ../config.sh`"
3233 if test "X$myuname" = "X$newmyuname"; then
3241 : Get old answers from old config file if Configure was run on the
3242 : same system, otherwise use the hints.
3245 if test -f config.sh; then
3247 rp="I see a config.sh file. Shall I use it to set the defaults?"
3250 n*|N*) echo "OK, I'll ignore it."
3251 mv config.sh config.sh.old
3252 myuname="$newmyuname"
3254 *) echo "Fetching default answers from your old config.sh file..." >&4
3262 : Older versions did not always set $sh. Catch re-use of such
3272 if test ! -f config.sh; then
3275 First time through, eh? I have some defaults handy for some systems
3276 that need some extra help getting the Configure answers right:
3279 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3281 : Half the following guesses are probably wrong... If you have better
3282 : tests or hints, please send them to perlbug@perl.org
3283 : The metaconfig authors would also appreciate a copy...
3284 $test -f /irix && osname=irix
3285 $test -f /xenix && osname=sco_xenix
3286 $test -f /dynix && osname=dynix
3287 $test -f /dnix && osname=dnix
3288 $test -f /lynx.os && osname=lynxos
3289 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3290 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3291 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3292 $test -f /bin/mips && /bin/mips && osname=mips
3293 $test -d /usr/apollo/bin && osname=apollo
3294 $test -f /etc/saf/_sactab && osname=svr4
3295 $test -d /usr/include/minix && osname=minix
3296 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3297 if $test -d /MachTen -o -d /MachTen_Folder; then
3299 if $test -x /sbin/version; then
3300 osvers=`/sbin/version | $awk '{print $2}' |
3301 $sed -e 's/[A-Za-z]$//'`
3302 elif $test -x /usr/etc/version; then
3303 osvers=`/usr/etc/version | $awk '{print $2}' |
3304 $sed -e 's/[A-Za-z]$//'`
3310 $test -f /sys/posix.dll &&
3311 $test -f /usr/bin/what &&
3312 set X `/usr/bin/what /sys/posix.dll` &&
3313 $test "$3" = UWIN &&
3317 if $test -f $uname; then
3325 umips) osname=umips ;;
3328 [23]100) osname=mips ;;
3330 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3331 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3334 elif $test -f /etc/kconfig; then
3336 if test "$lns" = "$ln -s"; then
3338 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3340 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3347 if test -n "$DJGPP"; then
3356 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3358 # oslevel can fail with:
3359 # oslevel: Unable to acquire lock.
3360 *not\ found) osvers="$4"."$3" ;;
3361 '<3240'|'<>3240') osvers=3.2.0 ;;
3362 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3363 '=3250'|'>3250') osvers=3.2.5 ;;
3367 bitrig) osname=bitrig
3370 bsd386) osname=bsd386
3373 cygwin*) osname=cygwin
3376 *dc.osx) osname=dcosx
3382 domainos) osname=apollo
3388 dragonfly) osname=dragonfly
3391 dynixptx*) osname=dynixptx
3392 osvers=`echo "$4"|sed 's/^v//'`
3394 freebsd) osname=freebsd
3396 genix) osname=genix ;;
3400 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3413 $test -f /system/lib/libandroid.so && osname=linux-android
3417 netbsd*) osname=netbsd
3420 news-os) osvers="$3"
3422 4*) osname=newsos4 ;;
3426 nonstop-ux) osname=nonstopux ;;
3427 openbsd) osname=openbsd
3433 POSIX-BC | posix-bc ) osname=posix-bc
3436 powerux | power_ux | powermax_os | powermaxos | \
3437 powerunix | power_unix) osname=powerux
3443 solaris) osname=solaris
3445 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3452 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3456 titanos) osname=titanos
3465 ultrix) osname=ultrix
3468 osf1|mls+) case "$5" in
3471 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3474 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3477 hp*) osname=hp_osf1 ;;
3478 mips) osname=mips_osf1 ;;
3481 # UnixWare 7.1.2 is known as Open UNIX 8
3482 openunix|unixware) osname=svr5
3490 $2) case "$osname" in
3494 : svr4.x or possibly later
3504 if test -f /stand/boot ; then
3505 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3506 if test -n "$INITPROG" -a -f "$INITPROG"; then
3507 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3508 if test -n "$isesix"; then
3516 *) if test -f /etc/systemid; then
3518 set `echo $3 | $sed 's/\./ /g'` $4
3519 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3521 elif $test -f $src/hints/sco_$1_$2.sh; then
3523 elif $test -f $src/hints/sco_$1.sh; then
3528 '') : Still unknown. Probably a generic Sys V.
3537 *) case "$osname" in
3538 '') : Still unknown. Probably a generic BSD.
3546 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3547 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3548 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3551 $rm -f UU/kernel.what
3552 elif test -d c:/. -o -n "$is_os2" ; then
3559 case "$targetarch" in
3562 case "$targetarch" in
3564 # Will load qnx.sh, which should change osname to nto
3569 # Catch arm-linux-androideabi, mipsel-linux-android,
3570 # and i686-linux-android
3571 osname=linux-android
3575 # Something like arm-linux-gnueabihf is really just
3582 # XXX perhaps we should just assume
3583 # osvers to be 2, or maybe take the value
3584 # from targetarch. Using $run before the
3585 # hints are run is somewhat icky.
3586 set X `$run $uname -a 2>/dev/null`
3589 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3594 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3601 : Now look for a hint file osname_osvers, unless one has been
3602 : specified already.
3605 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3606 : Also try without trailing minor version numbers.
3607 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3608 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3609 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3610 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3613 *) case "$osvers" in
3616 *) if $test -f $src/hints/$file.sh ; then
3618 elif $test -f $src/hints/$xfile.sh ; then
3620 elif $test -f $src/hints/$xxfile.sh ; then
3622 elif $test -f $src/hints/$xxxfile.sh ; then
3624 elif $test -f $src/hints/$xxxxfile.sh ; then
3626 elif $test -f "$src/hints/${osname}.sh" ; then
3635 if $test -f Policy.sh ; then
3638 none) dflt="Policy" ;;
3639 *) dflt="Policy $dflt" ;;
3644 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3648 if $test -f Policy.sh ; then
3651 There's also a Policy hint file available, which should make the
3652 site-specific (policy) questions easier to answer.
3659 You may give one or more space-separated answers, or "none" if appropriate.
3660 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3661 previous run of Configure, you may specify it as well as or instead of
3662 OS-specific hints. If hints are provided for your OS, you should use them:
3663 although Perl can probably be built without hints on many platforms, using
3664 hints often improve performance and may enable features that Configure can't
3665 set up on its own. If there are no hints that match your OS, specify "none";
3666 DO NOT give a wrong version or a wrong OS.
3670 rp="Which of these apply, if any?"
3673 for file in $tans; do
3674 if $test X$file = XPolicy -a -f Policy.sh; then
3676 $cat Policy.sh >> UU/config.sh
3677 elif $test -f $src/hints/$file.sh; then
3678 . $src/hints/$file.sh
3679 $cat $src/hints/$file.sh >> UU/config.sh
3680 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3683 : Give one chance to correct a possible typo.
3684 echo "$file.sh does not exist"
3686 rp="hint to use instead?"
3688 for file in $ans; do
3689 if $test -f "$src/hints/$file.sh"; then
3690 . $src/hints/$file.sh
3691 $cat $src/hints/$file.sh >> UU/config.sh
3692 elif $test X$ans = X -o X$ans = Xnone ; then
3695 echo "$file.sh does not exist -- ignored."
3702 : Remember our hint file for later.
3703 if $test -f "$src/hints/$file.sh" ; then
3713 echo "Fetching default answers from $config_sh..." >&4
3717 cp $config_sh config.sh 2>/dev/null
3727 test "$override" && . ./optdef.sh
3729 : Restore computed paths
3730 for file in $loclist $trylist; do
3731 eval $file="\$_$file"
3736 Configure uses the operating system name and version to set some defaults.
3737 The default value is probably right if the name rings a bell. Otherwise,
3738 since spelling matters for me, either accept the default or answer "none"
3745 ''|' '|none) dflt=none ;;
3746 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3749 *) dflt="$osname" ;;
3751 rp="Operating system name?"
3755 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3761 ''|' '|none) dflt=none ;;
3762 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3763 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3765 ''|' ') dflt=none ;;
3770 *) dflt="$osvers" ;;
3772 rp="Operating system version?"
3782 : who configured the system
3783 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3786 cf_by=`(logname) 2>/dev/null`
3789 cf_by=`(whoami) 2>/dev/null`
3791 "") cf_by=unknown ;;
3796 : decide how portable to be. Allow command line overrides.
3797 case "$d_portable" in
3799 *) d_portable="$define" ;;
3802 : set up shell script to do ~ expansion
3808 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3811 if $test -f /bin/csh; then
3812 /bin/csh -f -c "glob \$1"
3817 name=\`$expr x\$1 : '..\([^/]*\)'\`
3818 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3819 if $test ! -d "\$dir"; then
3821 echo "\$me: can't locate home directory for: \$name" >&2
3826 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3842 : now set up to get a file name
3846 cat <<'EOSC' >>getfile
3862 : getfile will accept an answer from the comma-separated list
3863 : enclosed in parentheses even if it does not meet other criteria.
3864 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3865 fn=`echo $fn | sed 's/(.*)//'`
3871 loc_file=`expr $fn : '.*:\(.*\)'`
3872 fn=`expr $fn : '\(.*\):.*'`
3880 */*) fullpath=true;;
3889 *e*) exp_file=true;;
3892 *p*) nopath_ok=true;;
3897 *d*) type='Directory';;
3898 *l*) type='Locate';;
3903 Locate) what='File';;
3908 case "$d_portable" in
3916 while test "$type"; do
3921 true) rp="$rp (~name ok)";;
3924 if test -f UU/getfile.ok && \
3925 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3944 value=`UU/filexp $ans`
3947 if test "$ans" != "$value"; then
3948 echo "(That expands to $value on this system.)"
3962 /*) value="$ansexp" ;;
3963 [a-zA-Z]:/*) value="$ansexp" ;;
3968 echo "I shall only accept a full path name, as in /bin/ls." >&4
3969 echo "Use a ! shell escape if you wish to check pathnames." >&4
3972 echo "Please give a full path name, starting with slash." >&4
3975 echo "Note that using ~name is ok provided it expands well." >&4
3988 for fp in $gfpth; do
3989 if test "X$fp" = X.; then
3994 if test -f "$pf"; then
3996 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3998 echo "($value is not a plain file, but that's ok.)"
4001 if test X"$type" = X; then
4008 for fp in $gfpth; do
4009 if test "X$fp" = X.; then
4014 direxp="$fp/$ansexp"
4016 if test -d "$direxp"; then
4024 if test -d "$ansexp"; then
4025 echo "(Looking for $loc_file in directory $value.)"
4026 value="$value/$loc_file"
4027 ansexp="$ansexp/$loc_file"
4029 if test -f "$ansexp"; then
4032 case "$nopath_ok" in
4033 true) case "$value" in
4035 *) echo "Assuming $value will be in people's path."
4051 if test "$fastread" = yes; then
4056 rp="$what $value doesn't exist. Use that name anyway?"
4075 test "X$gfpthkeep" != Xy && gfpth=""
4078 : determine root of directory hierarchy where package will be installed.
4081 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4084 dflt=`echo "$prefix" | sed 's/.$//'`
4092 By default, $package will be installed in $dflt/bin, manual pages
4093 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4094 installation directories. Typically this is something like /usr/local.
4095 If you wish to have binaries under /usr/bin but other parts of the
4096 installation under /usr/local, that's ok: you will be prompted
4097 separately for each of the installation directories, the prefix being
4098 only used to set the defaults.
4102 rp='Installation prefix to use?'
4110 *) oldprefix="$prefix";;
4117 : allow them to override the AFS root
4120 *) afsroot=$afsroot ;;
4126 $define|true) afs=true ;;
4127 $undef|false) afs=false ;;
4128 *) if $test -d $afsroot; then
4136 echo "AFS may be running... I'll be extra cautious then..." >&4
4138 echo "AFS does not seem to be running..." >&4
4141 : determine installation prefix for where package is to be installed.
4145 Since you are running AFS, I need to distinguish the directory in which
4146 files will reside from the directory in which they are installed (and from
4147 which they are presumably copied to the former directory by occult means).
4150 case "$installprefix" in
4151 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4152 *) dflt="$installprefix";;
4157 In some special cases, particularly when building $package for distribution,
4158 it is convenient to distinguish the directory in which files should be
4159 installed from the directory ($prefix) in which they will
4160 eventually reside. For most users, these two directories are the same.
4163 case "$installprefix" in
4165 *) dflt=$installprefix;;
4169 rp='What installation prefix should I use for installing files?'
4171 installprefix="$ans"
4172 installprefixexp="$ansexp"
4174 : Perform the prefixexp/installprefixexp correction if necessary
4175 cat <<EOS >installprefix
4178 cat <<'EOSC' >>installprefix
4179 : Change installation prefix, if necessary.
4180 if $test X"$prefix" != X"$installprefix"; then
4181 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4183 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4186 chmod +x installprefix
4187 $eunicefix installprefix
4189 : Set variables such as privlib and privlibexp from the output of ./getfile
4190 : performing the prefixexp/installprefixexp correction if necessary.
4191 cat <<EOS >setprefixvar
4194 cat <<'EOSC' >>setprefixvar
4195 eval "${prefixvar}=\"\$ans\""
4196 eval "${prefixvar}exp=\"\$ansexp\""
4199 chmod +x setprefixvar
4200 $eunicefix setprefixvar
4202 : set up the script used to warn in case of inconsistency
4211 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4213 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4214 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4219 echo "*** WHOA THERE!!! ***" >&4
4220 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4223 rp=" Keep the $hint value?"
4226 y) td=$was; tu=$was;;
4230 : function used to set '$1' to '$val'
4231 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4233 $define$undef) . ./whoa; eval "$var=\$td";;
4234 $undef$define) . ./whoa; eval "$var=\$tu";;
4235 *) eval "$var=$val";;
4238 : get the patchlevel
4240 echo "Getting the current patchlevel..." >&4
4241 if $test -r $rsrc/patchlevel.h;then
4242 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4243 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4244 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4245 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4246 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4247 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4248 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4257 $echo "(You do not have patchlevel.h. Eek.)"
4259 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4260 version_patchlevel_string="version $patchlevel subversion $subversion"
4261 case "$perl_patchlevel" in
4263 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4264 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4268 $echo "(You have $package $version_patchlevel_string.)"
4272 : XXX Should be a Configure test for double-dots in filenames.
4273 version=`echo $revision $patchlevel $subversion | \
4274 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4275 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4276 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4279 version=`echo $revision $patchlevel $subversion | \
4280 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4281 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4282 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4285 : Special case the 5.005_xx maintenance series, which used 5.005
4286 : without any subversion label as a subdirectory in $sitelib
4287 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4288 api_versionstring='5.005'
4291 : Do we want threads support and if so, what type
4292 case "$usethreads" in
4293 $define|true|[yY]*) dflt='y';;
4294 *) # Catch case where user specified ithreads or 5005threads but
4295 # forgot -Dusethreads (A.D. 4/2002)
4296 case "$useithreads$use5005threads" in
4297 *$define*) dflt='y';;
4304 Perl can be built to offer a form of threading support on some systems
4305 To do so, Configure can be run with -Dusethreads.
4307 Note that Perl built with threading support runs slightly slower
4308 and uses slightly more memory than plain Perl.
4310 If this doesn't make any sense to you, just accept the default '$dflt'.
4312 rp='Build a threading Perl?'
4315 y|Y) val="$define" ;;
4321 if $test $patchlevel -lt 9; then
4322 case "$usethreads" in
4324 : Default to ithreads unless overridden on command line or with
4327 case "$use5005threads" in
4329 echo "5.005 threads are no longer supported"
4333 case "$useithreads" in
4334 $undef|false|[nN]*) dflt='n';;
4336 rp='Use the newer interpreter-based ithreads?'
4339 y|Y) val="$define" ;;
4344 : Now set use5005threads to the opposite value.
4345 case "$useithreads" in
4346 $define) val="$undef" ;;
4353 useithreads="$undef"
4354 use5005threads="$undef"
4358 case "$useithreads$use5005threads" in
4362 You cannot have both the ithreads and the 5.005 threads enabled
4363 at the same time. Disabling the 5.005 threads since they are
4364 much less stable than the ithreads.
4367 use5005threads="$undef"
4372 : perl-5.9.x and later
4374 if test X"$usethreads" = "X$define"; then
4375 case "$use5005threads" in
4379 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4386 use5005threads="$undef"
4387 useithreads="$usethreads"
4390 case "$d_oldpthreads" in
4391 '') : Configure tests would be welcome here. For now, assume undef.
4393 *) val="$d_oldpthreads" ;;
4399 : Look for a hint-file generated 'call-back-unit'. If the
4400 : user has specified that a threading perl is to be built,
4401 : we may need to set or change some other defaults.
4402 if $test -f usethreads.cbu; then
4403 echo "Your platform has some specific hints regarding threaded builds, using them..."
4406 case "$usethreads" in
4407 "$define"|true|[yY]*)
4409 (Your platform does not have any specific hints for threaded builds.
4410 Assuming POSIX threads, then.)
4416 : Check if multiplicity is required
4419 Perl can be built so that multiple Perl interpreters can coexist
4420 within the same Perl executable.
4423 case "$useithreads" in
4426 This multiple interpreter support is required for interpreter-based threads.
4430 *) case "$usemultiplicity" in
4431 $define|true|[yY]*) dflt='y';;
4435 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4436 rp='Build Perl for multiplicity?'
4439 y|Y) val="$define" ;;
4447 : Check if morebits is requested
4448 case "$usemorebits" in
4449 "$define"|true|[yY]*)
4450 use64bitint="$define"
4451 uselongdouble="$define"
4452 usemorebits="$define"
4454 *) usemorebits="$undef"
4458 : Determine the C compiler to be used
4464 rp="Use which C compiler?"
4468 : See whether they have no cc but they do have gcc
4470 if $test -f cc.cbu; then
4475 : make some quick guesses about what we are up against
4477 $echo $n "Hmm... $c"
4487 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4488 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4490 echo "Looks kind of like an OSF/1 system, but we'll see..."
4492 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4493 xxx=`./loc addbib blurfl $pth`
4494 if $test -f $xxx; then
4495 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4499 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4500 echo "Looks kind of like an extended USG system, but we'll see..."
4502 echo "Looks kind of like a USG system, but we'll see..."
4506 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4507 echo "Looks kind of like a BSD system, but we'll see..."
4511 echo "Looks kind of like a Version 7 system, but we'll see..."
4514 case "$eunicefix" in
4517 There is, however, a strange, musty smell in the air that reminds me of
4518 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4522 : it so happens the Eunice I know will not run shell scripts in Unix format
4526 echo "Congratulations. You aren't running Eunice."
4530 : Detect OS2. The p_ variable is set above in the Head.U unit.
4531 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4532 : semicolon as a patch separator
4537 I have the feeling something is not exactly right, however...don't tell me...
4538 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4539 (Or you may be running DOS with DJGPP.)
4544 if test -f /xenix; then
4545 echo "Actually, this looks more like a XENIX system..."
4550 echo "It's not Xenix..."
4555 if test -f /venix; then
4556 echo "Actually, this looks more like a VENIX system..."
4563 echo "Nor is it Venix..."
4566 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4567 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4570 : Check if we are using GNU gcc and what its version is
4572 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4576 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4578 printf("%s\n", __VERSION__);
4580 printf("%s\n", "1");
4586 if $cc -o try $ccflags $ldflags try.c; then
4587 gccversion=`$run ./try`
4588 case "$gccversion" in
4589 '') echo "You are not using GNU cc." ;;
4590 *) echo "You are using GNU cc $gccversion."
4596 echo "*** WHOA THERE!!! ***" >&4
4597 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4598 case "$knowitall" in
4600 echo " You'd better start hunting for one and let me know about it." >&4
4606 case "$gccversion" in
4607 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4609 case "$gccversion" in
4610 '') gccosandvers='' ;;
4611 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4612 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4614 case "$gccosandvers" in
4615 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4616 $osname$osvers) ;; # looking good
4617 $osname*) cat <<EOM >&4
4619 *** WHOA THERE!!! ***
4621 Your gcc has not been compiled for the exact release of
4622 your operating system ($gccosandvers versus $osname$osvers).
4624 In general it is a good idea to keep gcc synchronized with
4625 the operating system because otherwise serious problems
4626 may ensue when trying to compile software, like Perl.
4628 I'm trying to be optimistic here, though, and will continue.
4629 If later during the configuration and build icky compilation
4630 problems appear (headerfile conflicts being the most common
4631 manifestation), I suggest reinstalling the gcc to match
4632 your operating system release.
4636 *) gccosandvers='' ;; # failed to parse, better be silent
4644 # gcc 3.* complain about adding -Idirectories that they already know about,
4645 # so we will take those off from locincpth.
4646 case "$gccversion" in
4648 echo "main(){}">try.c
4649 for incdir in $locincpth; do
4650 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4651 grep '^c[cp]p*[01]: warning: changing search order '`
4652 if test "X$warn" != X; then
4653 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4659 # gcc 4.9 by default does some optimizations that break perl.
4660 # see ticket 121505.
4662 # The -fwrapv disables those optimizations (and probably others,) so
4663 # for gcc 4.9 (and later, since the optimizations probably won't go
4664 # away), add -fwrapv unless the user requests -fno-wrapv, which
4665 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4666 # which turns the overflows -fwrapv ignores into runtime errors.
4667 case "$gccversion" in
4668 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4670 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4671 *) ccflags="$ccflags -fwrapv" ;;
4675 : What should the include directory be ?
4676 : Use sysroot if set, so findhdr looks in the right place.
4678 $echo $n "Hmm... $c"
4679 dflt="$sysroot/usr/include"
4682 if $test -f /bin/mips && /bin/mips; then
4683 echo "Looks like a MIPS system..."
4684 $cat >usr.c <<'EOCP'
4685 #ifdef SYSTYPE_BSD43
4689 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4690 dflt='/bsd43/usr/include'
4694 mips_type='System V'
4696 $rm -f usr.c usr.out
4697 echo "and you're compiling with the $mips_type compiler and libraries."
4701 echo "Doesn't look like a MIPS system."
4711 case "$xxx_prompt" in
4714 rp='Where are the include files you want to use?'
4722 : see how we invoke the C preprocessor
4724 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4725 cat <<'EOT' >testcpp.c
4731 if test ! -f cppstdin; then
4732 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4733 # AIX cc -E doesn't show the absolute headerfile
4734 # locations but we'll cheat by using the -M flag.
4735 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
4737 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4740 echo "Keeping your $hint cppstdin wrapper."
4743 wrapper=`pwd`/cppstdin
4747 if $test "X$cppstdin" != "X" && \
4748 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4749 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4751 echo "You used to use $cppstdin $cppminus so we'll use that again."
4753 '') echo "But let's see if we can live without a wrapper..." ;;
4755 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4756 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4758 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4761 echo "(However, $cpprun $cpplast does not work, let's see...)"
4769 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4776 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4777 $cc -E <testcpp.c >testcpp.out 2>&1; \
4778 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4779 echo "Yup, it does."
4780 x_cpp="$cc $cppflags -E"
4782 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4783 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4784 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4785 echo "Yup, it does."
4786 x_cpp="$cc $cppflags -E"
4788 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4789 $cc -P <testcpp.c >testcpp.out 2>&1; \
4790 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4791 echo "Yipee, that works!"
4792 x_cpp="$cc $cppflags -P"
4794 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4795 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4796 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4797 echo "At long last!"
4798 x_cpp="$cc $cppflags -P"
4800 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4801 $cpp <testcpp.c >testcpp.out 2>&1; \
4802 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4804 x_cpp="$cpp $cppflags"
4806 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4807 $cpp - <testcpp.c >testcpp.out 2>&1; \
4808 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4809 echo "Hooray, it works! I was beginning to wonder."
4810 x_cpp="$cpp $cppflags"
4812 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4813 $wrapper <testcpp.c >testcpp.out 2>&1; \
4814 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4820 rp="No dice. I can't find a C preprocessor. Name one:"
4824 $x_cpp <testcpp.c >testcpp.out 2>&1
4825 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4826 echo "OK, that will do." >&4
4828 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4843 echo "Perhaps can we force $cc -E using a wrapper..."
4844 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4845 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4851 echo "Nope, we'll have to live without it..."
4865 "$wrapper"|'cppstdin') ;;
4866 *) $rm -f $wrapper;;
4868 $rm -f testcpp.c testcpp.out
4870 : Adjust cppfilter for path component separator
4872 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4873 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4877 : Use gcc to determine libpth and incpth
4878 # If using gcc or clang, we can get better values for libpth, incpth
4879 # and usrinc directly from the compiler.
4880 # Note that ccname for clang is also gcc.
4883 $echo 'extern int foo;' > try.c
4884 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4886 if $test $# -gt 0; then
4888 incpth="`$echo $incpth|$sed 's/^ //'`"
4890 j="`$echo $i|$sed 's,/include$,/lib,'`"
4891 if $test -d $j; then
4895 libpth="`$echo $libpth|$sed 's/^ //'`"
4896 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4897 if $test -d $xxx; then
4900 *) libpth="$libpth $xxx";;
4907 '') for i in $incpth; do
4908 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4916 case "$usecrosscompile" in
4919 '') echo "Incpth not defined." >&4; croak=y ;;
4920 *) echo "Using incpth '$incpth'." >&4 ;;
4923 '') echo "Libpth not defined." >&4; croak=y ;;
4924 *) echo "Using libpth '$libpth'." >&4 ;;
4927 '') echo "Usrinc not defined." >&4; croak=y ;;
4928 *) echo "Using usrinc $usrinc." >&4 ;;
4932 if test "X$sysroot" = X; then
4933 echo "Cannot continue, aborting." >&4; exit 1
4935 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4944 : Default value for incpth is just usrinc
4946 '') incpth="$usrinc";;
4949 : Set private lib path
4952 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4957 '') dlist="$loclibpth $plibpth $glibpth";;
4958 *) dlist="$libpth";;
4961 : Now check and see which directories actually exist, avoiding duplicates
4964 if $test -d $xxx; then
4967 *) libpth="$libpth $xxx";;
4973 Some systems have incompatible or broken versions of libraries. Among
4974 the directories listed in the question below, please remove any you
4975 know not to be holding relevant libraries, and add any that are needed.
4976 Say "none" for none.
4980 if test "X$sysroot" != X; then
4982 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4995 rp="Directories to use for library searches?"
5002 : compute shared library extension
5005 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5015 On some systems, shared libraries may be available. Answer 'none' if
5016 you want to suppress searching of shared libraries for the remainder
5017 of this configuration.
5020 rp='What is the file extension used for shared libraries?'
5024 : Does target system insist that shared library basenames are unique
5027 Some dynamic loaders assume that the *basename* of shared library filenames
5028 are globally unique. We'll default this to undef as we assume your system
5029 is not this weird. Set to defined if you're on one of them.
5034 rp='Make shared library basenames unique?'
5037 y|Y) val="$define" ;;
5040 set d_libname_unique
5043 : Define several unixisms.
5044 : Hints files or command line option can be used to override them.
5045 : The convoluted testing is in case hints files set either the old
5048 '') case "$exe_ext" in
5050 *) _exe="$exe_ext" ;;
5055 '') case "$lib_ext" in
5062 '') case "$obj_ext" in
5069 '') case "$path_sep" in
5080 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5082 : Which makefile gets called first. This is used by make depend.
5083 case "$firstmakefile" in
5084 '') firstmakefile='makefile';;
5087 : Check is we will use socks
5089 $define|true|[yY]*) dflt='y';;
5094 Perl can be built to use the SOCKS proxy protocol library. To do so,
5095 Configure must be run with -Dusesocks. If you use SOCKS you also need
5096 to use the PerlIO abstraction layer, this will be implicitly selected.
5098 If this doesn't make any sense to you, just accept the default '$dflt'.
5100 rp='Build Perl for SOCKS?'
5103 y|Y) val="$define" ;;
5109 : Check for uselongdouble support
5111 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5114 case "$uselongdouble" in
5115 $define|true|[yY]*) dflt='y';;
5120 Perl can be built to take advantage of long doubles which
5121 (if available) may give more accuracy and range for floating point numbers.
5123 If this doesn't make any sense to you, just accept the default '$dflt'.
5125 rp='Try to use long doubles if available?'
5128 y|Y) val="$define" ;;
5134 case "$uselongdouble" in
5135 true|[yY]*) uselongdouble="$define" ;;
5138 : Look for a hint-file generated 'call-back-unit'. If the
5139 : user has specified that long doubles should be used,
5140 : we may need to set or change some other defaults.
5141 if $test -f uselongdouble.cbu; then
5142 echo "Your platform has some specific hints regarding long doubles, using them..."
5143 . ./uselongdouble.cbu
5145 case "$uselongdouble" in
5148 (Your platform does not have any specific hints for long doubles.)
5154 : Looking for optional libraries
5156 echo "Checking for optional libraries..." >&4
5161 case "$libswanted" in
5162 '') libswanted='c_s';;
5165 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5167 case "$usecbacktrace" in
5168 "$define") libswanted="$libswanted bfd" ;;
5174 for thisdir in $libpth $xlibpth; do
5175 test -d $thisdir && libspath="$libspath $thisdir"
5177 for thislib in $libswanted; do
5178 for thisdir in $libspath; do
5180 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5181 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5182 $test -f "$xxx" && eval $libscheck
5183 $test -f "$xxx" && libstyle=shared
5184 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5185 $test -f "$xxx" && eval $libscheck
5186 $test -f "$xxx" && libstyle=shared
5188 if test ! -f "$xxx"; then
5189 xxx=$thisdir/lib$thislib.$so
5190 $test -f "$xxx" && eval $libscheck
5191 $test -f "$xxx" && libstyle=shared
5193 if test ! -f "$xxx"; then
5194 xxx=$thisdir/lib$thislib$_a
5195 $test -f "$xxx" && eval $libscheck
5196 $test -f "$xxx" && libstyle=static
5198 if test ! -f "$xxx"; then
5199 xxx=$thisdir/$thislib$_a
5200 $test -f "$xxx" && eval $libscheck
5201 $test -f "$xxx" && libstyle=static
5203 if test ! -f "$xxx"; then
5204 xxx=$thisdir/lib${thislib}_s$_a
5205 $test -f "$xxx" && eval $libscheck
5206 $test -f "$xxx" && libstyle=static
5207 $test -f "$xxx" && thislib=${thislib}_s
5209 if test ! -f "$xxx"; then
5210 xxx=$thisdir/Slib$thislib$_a
5211 $test -f "$xxx" && eval $libscheck
5212 $test -f "$xxx" && libstyle=static
5214 if $test -f "$xxx"; then
5216 shared) echo "Found -l$thislib (shared)." ;;
5217 static) echo "Found -l$thislib." ;;
5218 *) echo "Found -l$thislib ($libstyle)." ;;
5222 *) dflt="$dflt -l$thislib"
5223 libsfound="$libsfound $xxx"
5225 libsfiles="$libsfiles $yyy"
5226 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5227 case " $libsdirs " in
5229 *) libsdirs="$libsdirs $yyy" ;;
5236 if $test ! -f "$xxx"; then
5237 echo "No -l$thislib."
5248 ' '|'') dflt='none';;
5253 In order to compile $package on your machine, a number of libraries
5254 are usually needed. Include any other special libraries here as well.
5255 Say "none" for none. The default list is almost always right.
5259 rp="What libraries to use?"
5266 : determine optimization, if desired, or use for debug flag also
5268 ' '|$undef) dflt='none';;
5270 *) dflt="$optimize";;
5274 By default, $package compiles with the -O flag to use the optimizer.
5275 Alternately, you might want to use the symbolic debugger, which uses
5276 the -g flag (on traditional Unix systems). Either flag can be
5277 specified here. To use neither flag, specify the word "none".
5280 rp="What optimizer/debugger flag should be used?"
5284 'none') optimize=" ";;
5287 : Check what DEBUGGING is required from the command line
5288 : -DEBUGGING or -DDEBUGGING or
5289 : -DEBUGGING=both = -g + -DDEBUGGING
5290 : -DEBUGGING=-g or -Doptimize=-g = -g
5291 : -DEBUGGING=none or -UDEBUGGING =
5292 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5295 *) DEBUGGING=$EBUGGING ;;
5298 case "$DEBUGGING" in
5302 *) optimize="$optimize -g" ;;
5306 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5314 case "$DEBUGGING" in
5315 both|$define) dflt='-DDEBUGGING'
5318 : argument order is deliberate, as the flag will start with - which set could
5319 : think is an option
5320 checkccflag='check=$1; flag=$2; callback=$3;
5322 echo "Checking if your compiler accepts $flag" 2>&1;
5323 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5324 echo "int main(void) { return 0; }" > gcctest.c;
5325 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5326 echo "Yes, it does." 2>&1;
5327 if $test -s gcctest.out ; then
5328 echo "But your platform does not like it:";
5333 echo "Leaving current flags $ccflags alone." 2>&1
5335 *) dflt="$dflt $flag";
5341 echo "Nope, it does not, but that is ok." 2>&1;
5345 : We will not override a previous value, but we might want to
5346 : augment a hint file
5348 default|recommended)
5349 case "$gccversion" in
5350 1*) dflt="$dflt -fpcc-struct-return" ;;
5352 case "$optimize:$DEBUGGING" in
5353 *-g*:old) dflt="$dflt -DDEBUGGING";;
5355 case "$gccversion" in
5356 2*) if $test -d /etc/conf/kconfig.d &&
5357 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5359 # Interactive Systems (ISC) POSIX mode.
5364 case "$gccversion" in
5367 ?*) set strict-aliasing -fno-strict-aliasing
5371 # For gcc, adding -pipe speeds up compilations for some, but apparently
5372 # some assemblers can't read from stdin. (It also slows down compilations
5373 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5374 case "$gccversion" in
5380 # on x86_64 (at least) we require an extra library (libssp) in the
5381 # link command line. This library is not named, so I infer that it is
5382 # an implementation detail that may change. Hence the safest approach
5383 # is to add the flag to the flags passed to the compiler at link time,
5384 # as that way the compiler can do the right implementation dependant
5386 case "$gccversion" in
5387 ?*) set stack-protector-strong -fstack-protector-strong
5390 *-fstack-protector-strong*) ;; # It got added.
5391 *) # Try the plain/older -fstack-protector.
5392 set stack-protector -fstack-protector
5401 case "$mips_type" in
5402 *BSD*|'') inclwanted="$locincpth $usrinc";;
5403 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5405 for thisincl in $inclwanted; do
5406 if $test -d $thisincl; then
5407 if $test x$thisincl != x$usrinc; then
5409 *" -I$thisincl "*);;
5410 *) dflt="$dflt -I$thisincl ";;
5416 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5418 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5426 *) dflt="$dflt -D$2";;
5430 set signal.h LANGUAGE_C; eval $inctest
5434 ccflags="$ccflags -DSOCKS"
5439 default|recommended) dflt="$ccflags $dflt" ;;
5440 *) dflt="$ccflags";;
5449 Your C compiler may want other flags. For this question you should include
5450 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5451 but you should NOT include libraries or ld flags like -lwhatever. If you
5452 want $package to honor its debug switch, you should include -DDEBUGGING here.
5453 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5455 To use no flags, specify the word "none".
5461 rp="Any additional cc flags?"
5468 : the following weeds options from ccflags that are of no interest to cpp
5470 '') cppflags="$ccflags" ;;
5471 *) cppflags="$cppflags $ccflags" ;;
5473 case "$gccversion" in
5474 1*) cppflags="$cppflags -D__GNUC__"
5476 case "$mips_type" in
5478 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5484 echo "Let me guess what the preprocessor flags are..." >&4
5498 *) ftry="$previous $flag";;
5500 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5501 >cpp1.out 2>/dev/null && \
5502 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5503 >cpp2.out 2>/dev/null && \
5504 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5505 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5507 cppflags="$cppflags $ftry"
5517 *-*) echo "They appear to be: $cppflags";;
5519 $rm -f cpp.c cpp?.out
5523 : flags used in final linking phase
5525 '') if ./venix; then
5531 *-posix*) dflt="$dflt -posix" ;;
5534 *) dflt="$ldflags";;
5536 # See note above about -fstack-protector
5538 *-fstack-protector-strong*)
5540 *-fstack-protector-strong*) ;; # Don't add it again
5541 *) dflt="$dflt -fstack-protector-strong" ;;
5544 *-fstack-protector*)
5546 *-fstack-protector*) ;; # Don't add it again
5547 *) dflt="$dflt -fstack-protector" ;;
5552 : Try to guess additional flags to pick up local libraries.
5553 for thislibdir in $libpth; do
5554 case " $loclibpth " in
5557 *"-L$thislibdir "*) ;;
5558 *) dflt="$dflt -L$thislibdir" ;;
5570 Your C linker may need flags. For this question you should
5571 include -L/whatever and any other flags used by the C linker, but you
5572 should NOT include libraries like -lwhatever.
5574 Make sure you include the appropriate -L/path flags if your C linker
5575 does not normally search all of the directories you specified above,
5578 To use no flags, specify the word "none".
5582 rp="Any additional ld flags (NOT including libraries)?"
5588 rmlist="$rmlist pdp11"
5592 echo "Checking your choice of C compiler and flags for coherency..." >&4
5593 $cat > try.c <<'EOF'
5595 int main() { printf("Ok\n"); return(0); }
5597 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5599 $cat >try.msg <<'EOM'
5600 I've tried to compile and run the following simple program:
5603 $cat try.c >> try.msg
5605 $cat >> try.msg <<EOM
5612 and I got the following output:
5616 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5617 if $sh -c "$run ./try " >>try.msg 2>&1; then
5621 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5624 echo "The program compiled OK, but exited with status $?." >>try.msg
5625 rp="You have a problem. Shall I abort Configure"
5629 echo "I can't compile the test program." >>try.msg
5630 rp="You have a BIG problem. Shall I abort Configure"
5636 case "$knowitall" in
5638 echo "(The supplied flags or libraries might be incorrect.)"
5646 *) echo "Ok. Stopping Configure." >&4
5651 n) echo "OK, that should do.";;
5653 $rm_try gcctest gcctest.out
5655 : define a shorthand compile call
5659 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5660 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5664 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5665 : define a shorthand compile call for compilations that should be ok.
5669 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5671 : determine filename position in cpp output
5673 echo "Computing filename position in cpp output for #include directives..." >&4
5675 vos) testaccess=-e ;;
5678 echo '#include <stdio.h>' > foo.c
5681 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5682 $grep '^[ ]*#.*stdio\.h' | \
5683 while read cline; do
5686 while $test \$# -gt 0; do
5687 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5692 pos=\`expr \$pos + 1\`
5704 *) pos="${fieldn}th";;
5706 echo "Your cpp writes the filename in the $pos field of the line."
5708 : locate header file
5713 for usrincdir in $incpth
5715 if test -f \$usrincdir/\$wanted; then
5716 echo "\$usrincdir/\$wanted"
5720 awkprg='{ print \$$fieldn }'
5721 echo "#include <\$wanted>" > foo\$\$.c
5722 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5723 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5724 while read cline; do
5725 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5727 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5728 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5733 # status = 0: grep returned 0 lines, case statement not executed
5734 # status = 1: headerfile found
5735 # status = 2: while loop executed, no headerfile found
5739 if test \$status -eq 1; then
5746 : define an alternate in-header-list? function
5747 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5748 cont=true; xxf="echo \"<\$1> found.\" >&4";
5749 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5750 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5752 case $# in 4) instead=instead;; *) instead="at last";; esac;
5753 while $test "$cont"; do
5755 var=$2; eval "was=\$$2";
5756 if $test "$xxx" && $test -r "$xxx";
5758 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5761 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5762 set $yyy; shift; shift; yyy=$@;
5763 case $# in 0) cont="";;
5764 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5765 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5766 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5767 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5771 do set $yyy; var=$2; eval "was=\$$2";
5772 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5773 set $yyy; shift; shift; yyy=$@;
5776 : see if stdlib is available
5777 set stdlib.h i_stdlib
5780 : check for lengths of integral types
5784 echo "Checking to see how big your integers are..." >&4
5793 printf("intsize=%d;\n", (int)sizeof(int));
5794 printf("longsize=%d;\n", (int)sizeof(long));
5795 printf("shortsize=%d;\n", (int)sizeof(short));
5800 if eval $compile_ok && $run ./try > /dev/null; then
5802 echo "Your integers are $intsize bytes long."
5803 echo "Your long integers are $longsize bytes long."
5804 echo "Your short integers are $shortsize bytes long."
5808 Help! I can't compile and run the intsize test program: please enlighten me!
5809 (This is probably a misconfiguration in your system or libraries, and
5810 you really ought to fix it. Still, I'll try anyway.)
5814 rp="What is the size of an integer (in bytes)?"
5818 rp="What is the size of a long integer (in bytes)?"
5822 rp="What is the size of a short integer (in bytes)?"
5830 : check for long long
5832 echo "Checking to see if you have long long..." >&4
5833 echo 'int main() { long long x = 7; return 0; }' > try.c
5835 if eval $compile; then
5837 echo "You have long long."
5840 echo "You do not have long long."
5846 : check for length of long long
5847 case "${d_longlong}${longlongsize}" in
5850 echo "Checking to see how big your long longs are..." >&4
5851 $cat >try.c <<'EOCP'
5855 printf("%d\n", (int)sizeof(long long));
5860 if eval $compile_ok; then
5861 longlongsize=`$run ./try`
5862 echo "Your long longs are $longlongsize bytes long."
5866 echo "(I can't seem to compile the test program. Guessing...)"
5867 rp="What is the size of a long long (in bytes)?"
5871 if $test "X$longsize" = "X$longlongsize"; then
5872 echo "(That isn't any different from an ordinary long.)"
5878 : see if inttypes.h is available
5879 : we want a real compile instead of Inhdr because some systems
5880 : have an inttypes.h which includes non-existent headers
5883 #include <inttypes.h>
5885 static int32_t foo32 = 0x12345678;
5889 if eval $compile; then
5890 echo "<inttypes.h> found." >&4
5893 echo "<inttypes.h> NOT found." >&4
5902 echo "Checking to see if you have int64_t..." >&4
5904 #include <sys/types.h>
5905 #$i_inttypes I_INTTYPES
5907 #include <inttypes.h>
5909 int main() { int64_t x = 7; }
5912 if eval $compile; then
5914 echo "You have int64_t."
5917 echo "You do not have int64_t."
5923 : Check if 64bit ints have a quad type
5925 echo "Checking which 64-bit integer type we could use..." >&4
5931 val='"unsigned int"'
5936 *) case "$longsize" in
5940 val='"unsigned long"'
5945 *) case "$d_longlong:$longlongsize" in
5950 val='"unsigned long long"'
5955 *) case "$d_int64_t" in
5974 '') echo "Alas, no 64-bit integer types in sight." >&4
5977 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5982 : Do we want 64bit support
5983 case "$uselonglong" in
5984 "$define"|true|[yY]*)
5987 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5989 use64bitint="$define"
5992 case "$use64bits" in
5993 "$define"|true|[yY]*)
5996 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5998 use64bitint="$define"
6001 case "$use64bitints" in
6002 "$define"|true|[yY]*)
6005 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6007 use64bitint="$define"
6010 case "$use64bitsint" in
6011 "$define"|true|[yY]*)
6014 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6016 use64bitint="$define"
6019 case "$uselonglongs" in
6020 "$define"|true|[yY]*)
6023 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6025 use64bitint="$define"
6028 case "$use64bitsall" in
6029 "$define"|true|[yY]*)
6032 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6034 use64bitall="$define"
6039 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6041 case "$use64bitall" in
6042 "$define"|true|[yY]*) use64bitint="$define" ;;
6048 You have natively 64-bit long integers.
6052 *) case "$use64bitint" in
6053 "$define"|true|[yY]*) dflt='y';;
6062 Perl can be built to take advantage of 64-bit integer types
6063 on some systems. To do so, Configure can be run with -Duse64bitint.
6064 Choosing this option will most probably introduce binary incompatibilities.
6066 If this doesn't make any sense to you, just accept the default '$dflt'.
6067 (The default has been chosen based on your configuration.)
6069 rp='Try to use 64-bit integers, if available?'
6072 [yY]*) val="$define" ;;
6080 case "$use64bitall" in
6081 "$define"|true|[yY]*) dflt='y' ;;
6082 *) case "$longsize" in
6090 You may also choose to try maximal 64-bitness. It means using as much
6091 64-bitness as possible on the platform. This in turn means even more
6092 binary incompatibilities. On the other hand, your platform may not
6093 have any more 64-bitness available than what you already have chosen.
6095 If this doesn't make any sense to you, just accept the default '$dflt'.
6096 (The default has been chosen based on your configuration.)
6098 rp='Try to use maximal 64-bit support, if available?'
6101 [yY]*) val="$define" ;;
6106 case "$use64bitall" in
6108 case "$use64bitint" in
6112 Since you have chosen a maximally 64-bit build, I'm also turning on
6113 the use of 64-bit integers.
6115 use64bitint="$define" ;;
6120 : Look for a hint-file generated 'call-back-unit'. If the
6121 : user has specified that a 64-bit perl is to be built,
6122 : we may need to set or change some other defaults.
6123 if $test -f use64bitint.cbu; then
6124 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6127 case "$use64bitint" in
6128 "$define"|true|[yY]*)
6129 : This test was common to all the OpenBSD forks, and seems harmless for
6132 echo "Checking if your C library has broken 64-bit functions..." >&4
6135 typedef $uquadtype myULL;
6142 {4294967303.15, 4294967303ULL},
6143 {4294967294.2, 4294967294ULL},
6144 {4294967295.7, 4294967295ULL},
6147 for (p = test; p->u; p++) {
6148 myULL x = (myULL)p->d;
6159 if eval $compile_ok; then
6160 libcquad=`$run ./try`
6161 echo "Your C library's 64-bit functions are $libcquad."
6163 echo "(I can't seem to compile the test program.)"
6164 echo "Assuming that your C library's 64-bit functions are ok."
6173 *** You have a C library with broken 64-bit functions.
6174 *** 64-bit support does not work reliably in this configuration.
6175 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6176 *** Cannot continue, aborting.
6183 4) case "$archname64" in
6184 '') archname64=64int ;;
6191 : Look for a hint-file generated 'call-back-unit'. If the
6192 : user has specified that a maximally 64-bit perl is to be built,
6193 : we may need to set or change some other defaults.
6194 if $test -f use64bitall.cbu; then
6195 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6198 case "$use64bitall" in
6199 "$define"|true|[yY]*)
6201 4) case "$archname64" in
6202 ''|64int) archname64=64all ;;
6209 case "$d_quad:$use64bitint" in
6213 *** You have chosen to use 64-bit integers,
6214 *** but none can be found.
6215 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6216 *** Cannot continue, aborting.
6223 : Check if we are using the GNU C library
6225 echo "Checking for GNU C Library..." >&4
6227 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6228 alone are insufficient to distinguish different versions, such as
6229 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6230 libc version 2.1.0. A. Dougherty, June 3, 2002.
6236 # ifdef __GLIBC_MINOR__
6237 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6238 # include <gnu/libc-version.h>
6239 printf("%s\n", gnu_get_libc_version());
6241 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6244 printf("%d\n", __GLIBC__);
6253 if eval $compile_ok && $run ./try > glibc.ver; then
6255 gnulibc_version=`$cat glibc.ver`
6256 echo "You are using the GNU C Library version $gnulibc_version"
6260 echo "You are not using the GNU C Library"
6266 : see if nm is to be used to determine whether a symbol is defined or not
6270 case "$d_gnulibc" in
6273 echo "nm probably won't work on the GNU C Library." >&4
6279 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6281 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6282 echo "'nm' won't be sufficient on this system." >&4
6288 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6289 if $test $dflt -gt 20; then
6299 true|$define) dflt=y;;
6306 I can use $nm to extract the symbols from your C libraries. This
6307 is a time consuming task which may generate huge output on the disk (up
6308 to 3 megabytes) but that should make the symbols extraction faster. The
6309 alternative is to skip the 'nm' extraction part and to compile a small
6310 test program instead to determine whether each symbol is present. If
6311 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6312 this may be the best solution.
6314 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6317 rp="Shall I use $nm to extract C symbols from the libraries?"
6320 [Nn]*) usenm=false;;
6329 : nm options which may be necessary
6331 '') if $test -f /mach_boot; then
6333 elif $test -d /usr/ccs/lib; then
6334 nm_opt='-p' # Solaris (and SunOS?)
6335 elif $test -f /dgux; then
6337 elif $test -f /lib64/rld; then
6338 nm_opt='-p' # 64-bit Irix
6344 : nm options which may be necessary for shared libraries but illegal
6345 : for archive libraries. Thank you, Linux.
6346 case "$nm_so_opt" in
6347 '') case "$myuname" in
6349 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6350 nm_so_opt='--dynamic'
6357 : Figure out where the libc is located
6360 : get list of predefined functions in a handy place
6365 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6371 *) for thislib in $libs; do
6374 : Handle C library specially below.
6377 thislib=`echo $thislib | $sed -e 's/^-l//'`
6378 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6380 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6382 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6384 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6386 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6388 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6390 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6395 libnames="$libnames $try"
6397 *) libnames="$libnames $thislib" ;;
6406 for xxx in $libpth; do
6407 $test -r $1 || set $xxx/libc.$so
6408 : The messy sed command sorts on library version numbers.
6410 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6411 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6413 s/[0-9][0-9]*/0000&/g
6414 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6417 $sort | $sed -e 's/^.* //'`
6420 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6421 $test -r $1 || set $sysroot/lib/libsys_s$_a
6427 if $test -r "$1"; then
6428 echo "Your (shared) C library seems to be in $1."
6430 elif $test -r /lib/libc && $test -r /lib/clib; then
6431 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6433 libc='/lib/clib /lib/libc'
6434 if $test -r /lib/syslib; then
6435 echo "(Your math library is in /lib/syslib.)"
6436 libc="$libc /lib/syslib"
6438 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6439 echo "Your C library seems to be in $libc, as you said before."
6440 elif $test -r $incpath/usr/lib/libc$_a; then
6441 libc=$incpath/usr/lib/libc$_a;
6442 echo "Your C library seems to be in $libc. That's fine."
6443 elif $test -r /lib/libc$_a; then
6445 echo "Your C library seems to be in $libc. You're normal."
6447 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6449 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6450 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6451 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6453 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6455 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6458 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6460 if $test -r "$tans"; then
6461 echo "Your C library seems to be in $tans, of all places."
6467 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6471 If the guess above is wrong (which it might be if you're using a strange
6472 compiler, or your machine supports multiple models), you can override it here.
6477 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6479 I can't seem to find your C library. I've looked in the following places:
6482 $sed 's/^/ /' libpath
6485 None of these seems to contain your C library. I need to get its name...
6490 rp='Where is your C library?'
6495 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6496 set X `cat libnames`
6499 case $# in 1) xxx=file; esac
6500 echo "Extracting names from the following $xxx for later perusal:" >&4
6502 $sed 's/^/ /' libnames >&4
6504 $echo $n "This may take a while...$c" >&4
6508 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6509 *) $nm $nm_opt $file 2>/dev/null;;
6514 $grep fprintf libc.tmp > libc.ptf
6515 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6516 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6518 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6520 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6522 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6524 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6526 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6528 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6530 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6532 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6534 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6536 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6538 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6540 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6542 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6543 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6545 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6547 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6549 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6551 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6553 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6555 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6557 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6559 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6561 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6563 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6565 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6567 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6569 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6571 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6573 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6576 $nm -p $* 2>/dev/null >libc.tmp
6577 $grep fprintf libc.tmp > libc.ptf
6578 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6579 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6585 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6587 if $ar t $libc > libc.tmp && \
6588 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6590 for thisname in $libnames $libc; do
6591 $ar t $thisname >>libc.tmp
6593 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6595 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6596 for thisname in $libnames $libc; do
6597 $ar tv $thisname >>libc.tmp
6598 emximp -o tmp.imp $thisname \
6600 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6601 < tmp.imp >>libc.tmp
6604 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6607 echo "$ar didn't seem to work right." >&4
6608 echo "Maybe this is a Cray...trying bld instead..." >&4
6610 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6613 for thisname in $libnames; do
6615 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6616 $ar t $thisname >>libc.tmp
6620 echo "That didn't work either. Giving up." >&4
6630 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6631 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6633 *) if $test -f /lib/syscalls.exp; then
6635 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6636 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6637 /lib/syscalls.exp >>libc.list
6643 $rm -f libnames libpath
6645 : Check if we are using C++
6647 echo "Checking for C++..." >&4
6648 $cat >try.c <<'EOCP'
6660 if eval $compile_ok && $run ./try; then
6662 echo "You are using a C++ compiler."
6665 echo "You are not using a C++ compiler."
6671 : is a C symbol defined?
6674 -v) tf=libc.tmp; tdc="";;
6675 -a) tf=libc.tmp; tdc="[]";;
6676 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6678 case "$d_cplusplus" in
6679 $define) extern_C="extern \"C\"" ;;
6680 *) extern_C="extern" ;;
6683 case "$reuseval-$4" in
6685 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6690 if $test "$runnm" = true; then
6691 if $contains $tlook $tf >/dev/null 2>&1; then
6693 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6694 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;
6695 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6696 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6700 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;
6701 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6707 $define) tval=true;;
6714 : define an is-in-libc? function
6715 inlibc='echo " "; td=$define; tu=$undef;
6716 sym=$1; var=$2; eval "was=\$$2";
6718 case "$reuseval$was" in
6728 echo "$sym() found." >&4;
6729 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6731 echo "$sym() NOT found." >&4;
6732 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6736 $define) echo "$sym() found." >&4;;
6737 *) echo "$sym() NOT found." >&4;;
6741 : check for length of double
6743 case "$doublesize" in
6745 echo "Checking to see how big your double precision numbers are..." >&4
6754 printf("%d\n", (int)sizeof(double));
6759 if eval $compile_ok; then
6760 doublesize=`$run ./try`
6761 echo "Your double is $doublesize bytes long."
6764 echo "(I can't seem to compile the test program. Guessing...)"
6765 rp="What is the size of a double precision number (in bytes)?"
6773 : see if this is a float.h system
6777 : check for long doubles
6779 echo "Checking to see if you have long double..." >&4
6780 echo 'int main() { long double x = 7.0; }' > try.c
6782 if eval $compile; then
6784 echo "You have long double."
6787 echo "You do not have long double."
6793 : see if ldexpl exists
6797 : check for length of long double
6798 case "${d_longdbl}${longdblsize}" in
6801 echo "Checking to see how big your long doubles are..." >&4
6802 $cat >try.c <<'EOCP'
6806 printf("%d\n", sizeof(long double));
6811 if eval $compile; then
6812 longdblsize=`$run ./try`
6813 echo "Your long doubles are $longdblsize bytes long."
6817 echo "(I can't seem to compile the test program. Guessing...)" >&4
6818 rp="What is the size of a long double (in bytes)?"
6822 if $test "X$doublesize" = "X$longdblsize"; then
6823 echo "That isn't any different from an ordinary double."
6824 echo "I'll keep your setting anyway, but you may see some"
6825 echo "harmless compilation warnings."
6831 $echo "Checking the kind of long doubles you have..." >&4
6832 case "$d_longdbl" in
6837 #define LONGDBLSIZE $longdblsize
6845 static const long double d = -0.1L;
6847 unsigned const char* b = (unsigned const char*)(&d);
6848 #if LDBL_MANT_DIG == 113 && LONGDBLSIZE == 16
6849 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6850 /* IEEE 754 128-bit little-endian */
6854 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6855 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6860 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6861 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6862 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6863 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6864 * Also known as "extended precision". */
6868 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6869 /* is there ever big-endian 80-bit, really? */
6874 #if LDBL_MANT_DIG == 106 && LONGDBLSIZE == 16
6875 /* software "double double", the 106 is 53+53 */
6876 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6877 /* double double 128-bit little-endian,
6878 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6882 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6883 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6884 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6889 printf("-1\n"); /* unknown */
6894 if eval $compile; then
6895 longdblkind=`$run ./try`
6902 case "$longdblkind" in
6903 0) echo "Your long doubles are doubles." >&4 ;;
6904 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6905 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6906 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6907 *) echo "Cannot figure out your long double." >&4 ;;
6912 : determine the architecture name
6914 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6915 tarch=`arch`"-$osname"
6916 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6917 if uname -m > tmparch 2>&1 ; then
6918 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6919 -e 's/$/'"-$osname/" tmparch`
6927 case "$myarchname" in
6930 echo "(Your architecture name used to be $myarchname.)"
6934 case "$targetarch" in
6936 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6941 *) dflt="$archname";;
6943 rp='What is your architecture name'
6947 : optionally add API version to the architecture for versioned archlibs
6948 case "$useversionedarchname" in
6949 $define|true|[yY]*) dflt='y';;
6952 rp='Add the Perl API version to your archname?'
6955 y|Y) useversionedarchname="$define" ;;
6956 *) useversionedarchname="$undef" ;;
6958 case "$useversionedarchname" in
6961 *-$api_versionstring)
6962 echo "...and architecture name already has -$api_versionstring" >&4
6965 archname="$archname-$api_versionstring"
6966 echo "...setting architecture name to $archname." >&4
6972 case "$usethreads" in
6974 echo "Threads selected." >&4
6976 *-thread*) echo "...and architecture name already has -thread." >&4
6978 *) archname="$archname-thread"
6979 echo "...setting architecture name to $archname." >&4
6984 case "$usemultiplicity" in
6986 echo "Multiplicity selected." >&4
6988 *-multi*) echo "...and architecture name already has -multi." >&4
6990 *) archname="$archname-multi"
6991 echo "...setting architecture name to $archname." >&4
6996 case "$use64bitint$use64bitall" in
6998 case "$archname64" in
7000 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7003 case "$use64bitint" in
7004 "$define") echo "64 bit integers selected." >&4 ;;
7006 case "$use64bitall" in
7007 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7010 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7012 *) archname="$archname-$archname64"
7013 echo "...setting architecture name to $archname." >&4
7019 case "$uselongdouble" in
7021 echo "Long doubles selected." >&4
7022 case "$longdblsize" in
7024 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7028 *-ld*) echo "...and architecture name already has -ld." >&4
7030 *) archname="$archname-ld"
7031 echo "...setting architecture name to $archname." >&4
7038 if $test -f archname.cbu; then
7039 echo "Your platform has some specific hints for architecture name, using them..."
7043 : set the prefixit variable, to compute a suitable default value
7044 prefixit='case "$3" in
7046 case "$oldprefix" in
7047 "") eval "$1=\"\$$2\"";;
7054 ""|" ") eval "$1=\"\$$2\"";;
7060 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7062 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7063 /*-$oldprefix/*|\~*-$oldprefix/*)
7064 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7065 *) eval "$1=\"\$$2\"";;
7069 : determine installation style
7070 : For now, try to deduce it from prefix unless it is already set.
7071 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7072 case "$installstyle" in
7073 '') case "$prefix" in
7074 *perl*) dflt='lib';;
7075 *) dflt='lib/perl5' ;;
7078 *) dflt="$installstyle" ;;
7080 : Probably not worth prompting for this since we prompt for all
7081 : the directories individually, and the prompt would be too long and
7085 : determine where public executables go
7090 rp='Pathname where the public executables will reside?'
7092 if $test "X$ansexp" != "X$binexp"; then
7096 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7097 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7098 : this via initialinstalllocation
7101 case "$userelocatableinc" in
7102 $define|true|[yY]*) dflt='y' ;;
7107 Would you like to build Perl so that the installation is relocatable, so that
7108 library paths in @INC are determined relative to the path of the perl binary?
7109 This is not advised for system Perl installs, or if you need to run setid
7110 scripts or scripts under taint mode.
7112 If this doesn't make any sense to you, just accept the default '$dflt'.
7114 rp='Use relocatable @INC?'
7117 y|Y) val="$define" ;;
7120 set userelocatableinc
7123 initialinstalllocation="$binexp"
7124 : Default prefix is now "up one level from where the binaries are"
7125 case "$userelocatableinc" in
7131 installprefixexp=".../.."
7135 : determine where private library files go
7136 : Usual default is /usr/local/lib/perl5/$version.
7137 : Also allow things like /opt/perl/lib/$version, since
7138 : /opt/perl/lib/perl5... would be redundant.
7139 : The default "style" setting is made in installstyle.U
7140 case "$installstyle" in
7141 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7142 *) set dflt privlib lib/$version ;;
7147 There are some auxiliary files for $package that need to be put into a
7148 private library directory that is accessible by everyone.
7153 rp='Pathname where the private library files will reside?'
7158 : set the prefixup variable, to restore leading tilda escape
7159 prefixup='case "$prefixexp" in
7161 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7164 : determine where public architecture dependent libraries go
7167 : privlib default is /usr/local/lib/$package/$version
7168 : archlib default is /usr/local/lib/$package/$version/$archname
7169 : privlib may have an optional trailing /share.
7170 tdflt=`echo $privlib | $sed 's,/share$,,'`
7171 tdflt=$tdflt/$archname
7180 $spackage contains architecture-dependent library files. If you are
7181 sharing libraries in a heterogeneous environment, you might store
7182 these files in a separate location. Otherwise, you can just include
7183 them with the rest of the public library files.
7188 rp='Where do you want to put the public architecture-dependent libraries?'
7192 if $test X"$archlib" = X"$privlib"; then
7198 : see if setuid scripts can be secure
7201 Some kernels have a bug that prevents setuid #! scripts from being
7202 secure. Some sites have disabled setuid #! scripts because of this.
7204 First let's decide if your kernel supports secure setuid #! scripts.
7205 (If setuid #! scripts would be secure but have been disabled anyway,
7206 don't say that they are secure if asked.)
7211 if $test -d /dev/fd; then
7212 echo "#!$ls" >reflect
7213 chmod +x,u+s reflect
7214 ./reflect >flect 2>&1
7215 if $contains "/dev/fd" flect >/dev/null; then
7216 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7220 If you are not sure if they are secure, I can check but I'll need a
7221 username and password different from the one you are using right now.
7222 If you don't have such a username or don't want me to test, simply
7226 rp='Other username to test security of setuid scripts with?'
7231 case "$d_suidsafe" in
7232 '') echo "I'll assume setuid scripts are *not* secure." >&4
7235 echo "Well, the $hint value is *not* secure." >&4
7237 *) echo "Well, the $hint value *is* secure." >&4
7242 $rm -f reflect flect
7243 echo "#!$ls" >reflect
7244 chmod +x,u+s reflect
7247 echo '"su" will (probably) prompt you for '"$ans's password."
7248 su $ans -c './reflect >flect'
7249 if $contains "/dev/fd" flect >/dev/null; then
7250 echo "Okay, it looks like setuid scripts are secure." >&4
7253 echo "I don't think setuid scripts are secure." >&4
7258 rp='Does your kernel have *secure* setuid scripts?'
7261 [yY]*) val="$define";;
7266 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7267 echo "(That's for file descriptors, not floppy disks.)"
7273 $rm -f reflect flect
7275 : now see if they want to do setuid emulation
7276 if $test $patchlevel -lt 11; then
7279 case "$d_suidsafe" in
7282 echo "No need to emulate SUID scripts since they are secure here." >&4
7286 Some systems have disabled setuid scripts, especially systems where
7287 setuid scripts cannot be secure. On systems where setuid scripts have
7288 been disabled, the setuid/setgid bits on scripts are currently
7289 useless. It is possible for $package to detect those bits and emulate
7290 setuid/setgid in a secure fashion. This emulation will only work if
7291 setuid scripts have been disabled in your kernel.
7295 "$define") dflt=y ;;
7298 rp="Do you want to do setuid/setgid emulation?"
7301 [yY]*) val="$define";;
7313 SUID emulation has been removed for 5.12
7314 Please re-run Configure without -Dd_dosuid
7323 : Find perl5.005 or later.
7324 echo "Looking for a previously installed perl5.005 or later... "
7326 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7327 : Check if this perl is recent and can load a simple module
7328 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7331 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7341 '') echo "None found. That's ok.";;
7342 *) echo "Using $perl5." ;;
7345 : Set the siteprefix variables
7348 After $package is installed, you may wish to install various
7349 add-on modules and utilities. Typically, these add-ons will
7350 be installed under $prefix with the rest
7351 of this package. However, you may wish to install such add-ons
7352 elsewhere under a different prefix.
7354 If you do not wish to put everything under a single prefix, that's
7355 ok. You will be prompted for the individual locations; this siteprefix
7356 is only used to suggest the defaults.
7358 The default should be fine for most people.
7362 rp='Installation prefix to use for add-on modules and utilities?'
7363 : XXX Here might be another good place for an installstyle setting.
7364 case "$siteprefix" in
7366 *) dflt=$siteprefix ;;
7369 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7371 case "$siteprefix" in
7375 *) oldsiteprefix="$prefix";;
7380 siteprefixexp="$ansexp"
7382 : determine where site specific libraries go.
7383 : Usual default is /usr/local/lib/perl5/site_perl/$version
7384 : The default "style" setting is made in installstyle.U
7385 : XXX No longer works with Prefixit stuff.
7386 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7388 '') case "$installstyle" in
7389 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7390 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7398 The installation process will create a directory for
7399 site-specific extensions and modules. Most users find it convenient
7400 to place all site-specific files in this directory rather than in the
7401 main distribution directory.
7405 rp='Pathname for the site-specific library files?'
7409 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7411 : Determine list of previous versions to include in @INC
7412 $cat > getverlist <<EOPL
7415 \$api_versionstring = "$api_versionstring";
7416 \$version = "$version";
7417 \$stem = "$sitelib_stem";
7418 \$archname = "$archname";
7420 $cat >> getverlist <<'EOPL'
7421 # The list found is store twice for each entry: the original name, and
7422 # the binary broken down version as pack "sss", so sorting is easy and
7423 # unambiguous. This will work for all versions that have a maximum of
7424 # three digit groups, separate by '.'s or '_'s. Names are extended with
7425 # ".0.0" to ensure at least three elements for the pack.
7426 # -- H.Merijn Brand (m)'06 23-10-2006
7428 # Can't have leading @ because metaconfig interprets it as a command!
7429 ;@inc_version_list=();
7430 # XXX Redo to do opendir/readdir?
7433 ;@candidates = map {
7434 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7435 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7441 ($pversion, $aversion, $vsn5005) = map {
7442 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7443 foreach $d (@candidates) {
7444 if ($d->[1] lt $pversion) {
7445 if ($d->[1] ge $aversion) {
7446 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7448 elsif ($d->[1] ge $vsn5005) {
7449 unshift(@inc_version_list, grep { -d } $d->[0]);
7453 # Skip newer version. I.e. don't look in
7454 # 5.7.0 if we're installing 5.6.1.
7458 if (@inc_version_list) {
7459 print join(' ', @inc_version_list);
7462 # Blank space to preserve value for next Configure run.
7467 case "$inc_version_list" in
7468 '') if test -x "$perl5$exe_ext"; then
7469 dflt=`$perl5 getverlist`
7474 $undef) dflt='none' ;;
7475 *) eval dflt=\"$inc_version_list\" ;;
7478 ''|' ') dflt=none ;;
7485 In order to ease the process of upgrading, this version of perl
7486 can be configured to use modules built and installed with earlier
7487 versions of perl that were installed under $prefix. Specify here
7488 the list of earlier versions that this version of perl should check.
7489 If Configure detected no earlier versions of perl installed under
7490 $prefix, then the list will be empty. Answer 'none' to tell perl
7491 to not search earlier versions.
7493 The default should almost always be sensible, so if you're not sure,
7494 just accept the default.
7497 rp='List of earlier versions to include in @INC?'
7500 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7501 *) inc_version_list="$ans" ;;
7503 case "$inc_version_list" in
7505 inc_version_list_init='0'
7506 d_inc_version_list="$undef"
7508 *) inc_version_list_init=`echo $inc_version_list |
7509 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7510 d_inc_version_list="$define"
7515 : see if malloc/malloc.h has to be included
7516 set malloc/malloc.h i_mallocmalloc
7519 : see if this is a malloc.h system
7520 : we want a real compile instead of Inhdr because some systems have a
7521 : malloc.h that just gives a compile error saying to use stdlib.h instead
7526 #$i_mallocmalloc I_MALLOCMALLOC
7527 #ifdef I_MALLOCMALLOC
7528 # include <malloc/malloc.h>
7531 int main () { return 0; }
7534 if eval $compile; then
7535 echo "<malloc.h> found." >&4
7538 echo "<malloc.h> NOT found." >&4
7545 : check for length of pointer
7549 echo "Checking to see how big your pointers are..." >&4
7558 printf("%d\n", (int)sizeof(void *));
7563 if eval $compile_ok; then
7564 ptrsize=`$run ./try`
7565 echo "Your pointers are $ptrsize bytes long."
7568 echo "(I can't seem to compile the test program. Guessing...)" >&4
7569 rp="What is the size of a pointer (in bytes)?"
7576 case "$use64bitall" in
7577 "$define"|true|[yY]*)
7581 *** You have chosen a maximally 64-bit build,
7582 *** but your pointers are only 4 bytes wide.
7583 *** Please rerun Configure without -Duse64bitall.
7588 *** Since you have quads, you could possibly try with -Duse64bitint.
7593 *** Cannot continue, aborting.
7604 : determine whether to use malloc wrapping
7606 case "$usemallocwrap" in
7607 [yY]*|true|$define) dflt='y' ;;
7608 [nN]*|false|$undef) dflt='n' ;;
7609 *) case "$usedevel" in
7610 [yY]*|true|$define) dflt='y' ;;
7615 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7617 usemallocwrap="$ans"
7620 usemallocwrap="$define" ;;
7622 usemallocwrap="$undef" ;;
7625 : determine which malloc to compile in
7627 case "$usemymalloc" in
7628 [yY]*|true|$define) dflt='y' ;;
7629 [nN]*|false|$undef) dflt='n' ;;
7630 *) case "$ptrsize" in
7634 if test "$useithreads" = "$define"; then dflt='n'; fi
7637 rp="Do you wish to attempt to use the malloc that comes with $package?"
7643 mallocsrc='malloc.c'
7644 mallocobj="malloc$_o"
7645 d_mymalloc="$define"
7648 : Remove malloc from list of libraries to use
7649 echo "Removing unneeded -lmalloc from library list" >&4
7650 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7653 echo "libs = $libs" >&4
7665 : compute the return types of malloc and free
7667 $cat >malloc.c <<END
7671 #include <sys/types.h>
7685 case "$malloctype" in
7687 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7694 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7698 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7705 echo "Your system uses $freetype free(), it would seem." >&4
7707 : determine where site specific architecture-dependent libraries go.
7708 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7709 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7710 : sitelib may have an optional trailing /share.
7712 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7713 dflt="$dflt/$archname"
7718 set sitearch sitearch none
7722 The installation process will also create a directory for
7723 architecture-dependent site-specific extensions and modules.
7727 rp='Pathname for the site-specific architecture-dependent library files?'
7731 if $test X"$sitearch" = X"$sitelib"; then
7734 d_sitearch="$define"
7737 : Set the vendorprefix variables
7740 The installation process will also create a directory for
7741 vendor-supplied add-ons. Vendors who supply perl with their system
7742 may find it convenient to place all vendor-supplied files in this
7743 directory rather than in the main distribution directory. This will
7744 ease upgrades between binary-compatible maintenance versions of perl.
7746 Of course you may also use these directories in whatever way you see
7747 fit. For example, you might use them to access modules shared over a
7748 company-wide network.
7750 The default answer should be fine for most people.
7751 This causes further questions about vendor add-ons to be skipped
7752 and no vendor-specific directories will be configured for perl.
7755 rp='Do you want to configure vendor-specific add-on directories?'
7756 case "$usevendorprefix" in
7757 define|true|[yY]*) dflt=y ;;
7758 *) : User may have set vendorprefix directly on Configure command line.
7759 case "$vendorprefix" in
7768 rp='Installation prefix to use for vendor-supplied add-ons?'
7769 case "$vendorprefix" in
7770 '') dflt="$prefix" ;;
7771 *) dflt=$vendorprefix ;;
7774 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7776 case "$vendorprefix" in
7780 *) oldvendorprefix="$prefix";;
7784 usevendorprefix="$define"
7786 vendorprefixexp="$ansexp"
7788 *) usevendorprefix="$undef"
7794 : Set the vendorlib variables
7795 case "$vendorprefix" in
7796 '') d_vendorlib="$undef"
7800 *) d_vendorlib="$define"
7801 : determine where vendor-supplied modules go.
7802 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7803 case "$vendorlib" in
7805 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7806 case "$installstyle" in
7807 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7808 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7811 *) dflt="$vendorlib"
7815 rp='Pathname for the vendor-supplied library files?'
7818 vendorlibexp="$ansexp"
7821 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7825 : Set the vendorarch variables
7826 case "$vendorprefix" in
7827 '') d_vendorarch="$undef"
7831 *) d_vendorarch="$define"
7832 : determine where vendor-supplied architecture-dependent libraries go.
7833 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7834 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7835 : vendorlib may have an optional trailing /share.
7836 case "$vendorarch" in
7837 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7838 dflt="$dflt/$archname"
7840 *) dflt="$vendorarch" ;;
7843 rp='Pathname for vendor-supplied architecture-dependent files?'
7846 vendorarchexp="$ansexp"
7849 prefixvar=vendorarch
7851 if $test X"$vendorarch" = X"$vendorlib"; then
7852 d_vendorarch="$undef"
7854 d_vendorarch="$define"
7857 : Final catch-all directories to search
7860 Lastly, you can have perl look in other directories for extensions and
7861 modules in addition to those already specified.
7862 These directories will be searched after
7866 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7867 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7869 case "$otherlibdirs" in
7870 ''|' ') dflt='none' ;;
7871 *) dflt="$otherlibdirs" ;;
7874 Enter a colon-separated set of extra paths to include in perl's @INC
7875 search path, or enter 'none' for no extra paths.
7879 rp='Colon-separated list of additional directories for perl to search?'
7882 ' '|''|none) otherlibdirs=' ' ;;
7883 *) otherlibdirs="$ans" ;;
7885 case "$otherlibdirs" in
7889 set d_perl_otherlibdirs
7892 : Cruising for prototypes
7894 echo "Checking out function prototypes..." >&4
7895 $cat >prototype.c <<EOCP
7900 int main(int argc, char *argv[]) {
7903 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7904 echo "Your C compiler appears to support function prototypes."
7907 echo "Your C compiler doesn't seem to understand function prototypes."
7914 : Check if ansi2knr is required
7915 case "$prototype" in
7917 *) ansi2knr='ansi2knr'
7922 This version of $package can only be compiled by a compiler that
7923 understands function prototypes. Unfortunately, your C compiler
7925 doesn't seem to understand them. Sorry about that.
7927 If GNU cc is available for your system, perhaps you could try that instead.
7929 Eventually, we hope to support building Perl with pre-ANSI compilers.
7930 If you would like to help in that effort, please contact <perlbug@perl.org>.
7932 Aborting Configure now.
7939 dflt_dtrace='/usr/sbin/dtrace'
7940 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7944 Perl can be built to support DTrace on platforms that support it.
7945 DTrace is a diagnosis and performance analysis tool from Sun.
7947 If this doesn't make any sense to you, just accept the default '$dflt'.
7951 case "$usedtrace" in
7957 dflt_dtrace=$usedtrace
7964 rp='Support DTrace if available?'
7967 y|Y) val="$define" ;;
7973 test "X$usedtrace" != "X$define" && break
7976 rp='Where is the dtrace executable?'
7985 if $dtrace -h -s ../perldtrace.d \
7986 -o perldtrace.tmp >/dev/null 2>&1 \
7987 && rm -f perldtrace.tmp
7990 echo "Good: your $dtrace knows about the -h flag."
7994 *** $me: Fatal Error: $dtrace doesn't support -h flag
7996 *** Your installed dtrace doesn't support the -h switch to compile a D
7997 *** program into a C header. Can't continue.
8009 *** $me: Fatal Error: $dtrace not found.
8016 echo "*** $dtrace was not found."
8022 : See if we want extra modules installed
8029 Perl can be built with extra modules or bundles of modules which
8030 will be fetched from the CPAN and installed alongside Perl.
8032 Notice that you will need access to the CPAN; either via the Internet,
8033 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8034 be asked later to configure the CPAN.pm module which will in turn do
8035 the installation of the rest of the extra modules or bundles.)
8037 Notice also that if the modules require any external software such as
8038 libraries and headers (the libz library and the zlib.h header for the
8039 Compress::Zlib module, for example) you MUST have any such software
8040 already installed, this configuration process will NOT install such
8043 If this doesn't make any sense to you, just accept the default '$dflt'.
8045 rp='Install any extra modules (y or n)?'
8051 Please list any extra modules or bundles to be installed from CPAN,
8052 with spaces between the names. The names can be in any format the
8053 'install' command of CPAN.pm will understand. (Answer 'none',
8054 without the quotes, to install no extra modules or bundles.)
8064 $rm -f ../extras.lst
8066 *) echo "(Saving the list of extras for later...)"
8067 echo "$extras" > ../extras.lst
8075 : determine where html pages for programs go
8076 set html1dir html1dir none
8080 If you wish to install html files for programs in $spackage, indicate
8081 the appropriate directory here. To skip installing html files,
8085 ''|none|$undef|' ') dflt=none ;;
8086 *) dflt=$html1dir ;;
8089 rp="Directory for the main $spackage html pages?"
8093 : Use ' ' for none so value is preserved next time through Configure
8094 $test X"$html1dir" = "X" && html1dir=' '
8096 : determine where html pages for libraries and modules go
8097 set html3dir html3dir none
8101 If you wish to install html files for modules associated with $spackage,
8102 indicate the appropriate directory here. To skip installing html files,
8105 : There is no obvious default. If they have specified html1dir, then
8106 : try to key off that, possibly changing .../html1 into .../html3.
8108 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8109 *) dflt=$html3dir ;;
8112 rp="Directory for the $spackage module html pages?"
8116 : Use ' ' for none so value is preserved next time through Configure
8117 $test X"$html3dir" = "X" && html3dir=' '
8119 : determine whether to install perl also as /usr/bin/perl
8122 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8124 Many scripts expect perl to be installed as /usr/bin/perl.
8126 If you want to, I can install the perl you are about to compile
8127 as /usr/bin/perl (in addition to $bin/perl).
8129 if test -f /usr/bin/perl; then
8132 However, please note that because you already have a /usr/bin/perl,
8133 overwriting that with a new Perl would very probably cause problems.
8134 Therefore I'm assuming you don't want to do that (unless you insist).
8137 case "$installusrbinperl" in
8138 "$define"|[yY]*) dflt='y';;
8144 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8147 case "$installusrbinperl" in
8148 "$undef"|[nN]*) dflt='n';;
8152 rp="Do you want to install perl as /usr/bin/perl?"
8155 [yY]*) val="$define";;
8161 set installusrbinperl
8164 : see if dlopen exists
8166 xxx_ccflags="$ccflags"
8168 : with g++ one needs -shared to get is-in-libc to work for dlopen
8169 case "$gccversion" in
8171 *) case "$d_cplusplus" in
8172 "$define") ccflags="$ccflags -shared" ;;
8179 ccflags="$xxx_ccflags"
8181 : see if this is a unistd.h system
8182 set unistd.h i_unistd
8185 : determine which dynamic loading, if any, to compile in
8187 dldir="ext/DynaLoader"
8200 $define) dflt='y' ;;
8202 : Does a dl_xxx.xs file exist for this operating system
8203 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8206 rp="Do you wish to use dynamic loading?"
8213 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8214 dflt="$dldir/dl_${osname}.xs"
8215 elif $test "$d_dlopen" = "$define" ; then
8216 dflt="$dldir/dl_dlopen.xs"
8221 *) dflt="$dldir/$dlsrc"
8224 echo "The following dynamic loading files are available:"
8225 : Can not go over to $dldir because getfile has path hard-coded in.
8226 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8227 rp="Source file to use for dynamic loading"
8233 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8237 Some systems may require passing special flags to $cc -c to
8238 compile modules that will be used to create a shared library.
8239 To use no flags, say "none".
8242 case "$cccdlflags" in
8243 '') case "$gccversion" in
8244 '') case "$osname" in
8246 irix*) dflt='-KPIC' ;;
8247 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8248 sunos) dflt='-pic' ;;
8252 *) case "$osname" in
8253 darwin) dflt='none' ;;
8254 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8259 *) dflt="$cccdlflags" ;;
8266 # If -Dsysroot was specified, now's the time to add it
8268 if test "X$sysroot" != X; then
8269 case "$gccversion" in
8274 dflt="$dflt --sysroot=$sysroot" ;;
8284 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8287 none) cccdlflags=' ' ;;
8288 *) cccdlflags="$ans" ;;
8293 Some systems use ld to create libraries that can be dynamically loaded,
8294 while other systems (such as those using ELF) use $cc.
8298 : Determine if this is ELF
8300 /* Test for whether ELF binaries are produced */
8312 int i = open("a.out",O_RDONLY);
8315 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8316 exit(0); /* succeed (yes, it is ELF) */
8320 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8326 '') if $test $bin_ELF = "$define"; then
8328 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8332 echo "I'll use ld to build dynamic libraries."
8340 rp="What command should be used to create dynamic libraries?"
8346 Some systems may require passing special flags to $ld to create a
8347 library that can be dynamically loaded. If your ld flags include
8348 -L/other/path options to locate libraries outside your loader's normal
8349 search path, you may need to specify those -L options here as well. To
8350 use no flags, say "none".
8353 case "$lddlflags" in
8354 '') case "$osname" in
8355 haiku) dflt='-shared' ;;
8357 case "$gccversion" in
8358 '') dflt="$dflt +vnocompatwarnings" ;;
8361 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8362 solaris) # See [perl #66604].
8363 # On Solaris 11, gcc -m64 on amd64
8364 # appears not to understand -G. gcc versions at
8365 # least as old as 3.4.3 support -shared, so just
8366 # use that with Solaris 11 and later, but keep
8367 # the old behavior for older Solaris versions.
8368 case "$gccversion" in
8370 *) case "$osvers" in
8371 2.?|2.10) dflt='-G' ;;
8372 *) dflt='-shared' ;;
8377 sunos) dflt='-assert nodefinitions' ;;
8378 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8382 *) dflt="$lddlflags" ;;
8385 : Only do this for gcc, since, for example, qcc has no concept
8387 if $test "X$sysroot" != X; then
8388 case "$gccversion" in
8390 *) dflt="$dflt --sysroot $sysroot" ;;
8394 : Try to guess additional flags to pick up local libraries.
8395 : Be careful not to append to a plain 'none'
8399 for thisflag in $ldflags; do
8404 *) dflt="$dflt $thisflag" ;;
8411 ''|' ') dflt='none' ;;
8415 *-fstack-protector-strong*)
8417 *-fstack-protector-strong*) ;; # Don't add it again
8418 *) dflt="$dflt -fstack-protector-strong" ;;
8421 *-fstack-protector*)
8423 *-fstack-protector*) ;; # Don't add it again
8424 *) dflt="$dflt -fstack-protector" ;;
8429 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8432 none) lddlflags=' ' ;;
8433 *) lddlflags="$ans" ;;
8438 Some systems may require passing special flags to $cc to indicate that
8439 the resulting executable will use dynamic linking. To use no flags,
8443 case "$ccdlflags" in
8444 '') case "$osname" in
8445 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8446 sunos) dflt='none' ;;
8450 *) dflt="$ccdlflags" ;;
8452 rp="Any special flags to pass to $cc to use dynamic linking?"
8455 none) ccdlflags=' ' ;;
8456 *) ccdlflags="$ans" ;;
8468 ld_can_script="$undef"
8469 case "$bin_ELF$usedl" in
8471 # Abuse try.h and a.out names for neat cleanup
8483 if $cc $cccdlflags $ccdlflags $ccflags \
8484 $ldflags $lddlflags -o a.out try.c \
8485 -Wl,--version-script=try.h >/dev/null 2>&1 \
8486 && $test -s a.out ; then
8487 echo "ld supports scripting" >&4
8488 ld_can_script="$define"
8490 echo "ld does not support scripting" >&4
8496 : Do we want a shared libperl?
8500 # No dynamic loading being used, so don't bother even to prompt.
8503 *) case "$useshrplib" in
8504 '') case "$osname" in
8505 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8507 also='Building a shared libperl is required for dynamic loading to work on your system.'
8521 The perl executable is normally obtained by linking perlmain.c with
8522 libperl${_a}, any static extensions (usually just DynaLoader), and
8523 any other libraries needed on this system (such as -lm, etc.). Since
8524 your system supports dynamic loading, it is probably possible to build
8525 a shared libperl.$so. If you will have more than one executable linked
8526 to libperl.$so, this will significantly reduce the size of each
8527 executable, but it may have a noticeable effect on performance. The
8528 default is probably sensible for your system.
8532 rp="Build a shared libperl.$so (y/n)"
8536 useshrplib='true' ;;
8537 *) useshrplib='false' ;;
8542 case "$useshrplib" in
8544 case "$userelocatableinc" in
8546 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8547 echo "See INSTALL for an explanation why that won't work." >&4
8553 # Figure out a good name for libperl.so. Since it gets stored in
8554 # a version-specific architecture-dependent library, the version
8555 # number isn't really that important, except for making cc/ld happy.
8557 # A name such as libperl.so.10.1
8558 majmin="libperl.$so.$patchlevel.$subversion"
8559 # A name such as libperl.so.100
8560 majonly=`echo $patchlevel $subversion |
8561 $awk '{printf "%d%02d", $1, $2}'`
8562 majonly=libperl.$so.$majonly
8563 # I'd prefer to keep the os-specific stuff here to a minimum, and
8564 # rely on figuring it out from the naming of libc.
8565 case "${osname}${osvers}" in
8566 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8569 cygwin*) # ld links now against the dll directly
8570 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8571 majonly=`echo $patchlevel $subversion |
8572 $awk '{printf "%03d%03d", $1, $2}'`
8573 majonly=cygperl5.$majonly.$so
8576 *) # Try to guess based on whether libc has major.minor.
8578 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8579 *libc.$so.[0-9]*) dflt=$majonly ;;
8580 *) dflt=libperl.$so ;;
8590 I need to select a good name for the shared libperl. If your system uses
8591 library names with major and minor numbers, then you might want something
8592 like $majmin. Alternatively, if your system uses a single version
8593 number for shared libraries, then you might want to use $majonly.
8594 Or, your system might be quite happy with a simple libperl.$so.
8596 Since the shared libperl will get installed into a version-specific
8597 architecture-dependent directory, the version number of the shared perl
8598 library probably isn't important, so the default should be o.k.
8601 rp='What name do you want to give to the shared libperl?'
8604 echo "Ok, I'll use $libperl"
8607 libperl="libperl${_a}"
8611 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8615 WARNING: Use of the shrpdir variable for the installation location of
8616 the shared $libperl is not supported. It was never documented and
8617 will not work in this version. Let me (perlbug@perl.org)
8618 know of any problems this may cause.
8624 But your current setting of $shrpdir is
8625 the default anyway, so it's harmless.
8630 Further, your current attempted setting of $shrpdir
8631 conflicts with the value of $archlibexp/CORE
8632 that installperl will use.
8639 # How will the perl executable find the installed shared $libperl?
8640 # Add $xxx to ccdlflags.
8641 # If we can't figure out a command-line option, use $shrpenv to
8642 # set env LD_RUN_PATH. The main perl makefile uses this.
8643 shrpdir=$archlibexp/CORE
8646 if "$useshrplib"; then
8649 # We'll set it in Makefile.SH...
8654 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8655 xxx="-Wl,-R$shrpdir"
8657 bsdos|linux|irix*|dec_osf|gnu*)
8658 xxx="-Wl,-rpath,$shrpdir"
8661 # Haiku doesn't like the default, either.
8664 # hpux doesn't like the default, either.
8665 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8668 # cygwin needs only ldlibpth
8671 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8677 # Only add $xxx if it isn't already in ccdlflags.
8678 case " $ccdlflags " in
8680 *) ccdlflags="$ccdlflags $xxx"
8683 Adding $xxx to the flags
8684 passed to $ld so that the perl executable will find the
8685 installed shared $libperl.
8693 # Fix ccdlflags in AIX for building external extensions.
8694 # (For building Perl itself bare -bE:perl.exp is needed,
8695 # Makefile.SH takes care of this.)
8697 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8699 # Respect a hint or command-line value.
8701 '') shrpenv="$tmp_shrpenv" ;;
8703 case "$ldlibpthname" in
8704 '') ldlibpthname=LD_LIBRARY_PATH ;;
8705 none) ldlibpthname='' ;;
8708 : determine where manual pages are on this system
8712 syspath='/usr/share/man/man1 /usr/man/man1'
8713 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8714 syspath="$syspath /usr/man/u_man/man1"
8715 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8716 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8717 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8718 sysman=`./loc . /usr/man/man1 $syspath`
8721 if $test -d "$sysman"; then
8722 echo "System manual is in $sysman." >&4
8724 echo "Could not find manual pages in source form." >&4
8727 : determine where manual pages go
8728 set man1dir man1dir none
8732 $spackage has manual pages available in source form.
8736 echo "However, you don't have nroff, so they're probably useless to you."
8738 '') man1dir="none";;
8741 echo "If you don't want the manual sources installed, answer 'none'."
8746 lookpath="$prefixexp/share/man/man1"
8747 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8748 lookpath="$lookpath $prefixexp/man/p_man/man1"
8749 lookpath="$lookpath $prefixexp/man/u_man/man1"
8750 lookpath="$lookpath $prefixexp/man/man.1"
8752 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8753 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8763 rp="Where do the main $spackage manual pages (source) go?"
8765 if $test "X$man1direxp" != "X$ansexp"; then
8776 : What suffix to use on installed man pages
8783 rp="What suffix should be used for the main $spackage man pages?"
8785 '') case "$man1dir" in
8799 *) dflt="$man1ext";;
8806 : see if we can have long filenames
8808 first=123456789abcdef
8810 if (echo hi >$first) 2>/dev/null; then
8811 if $test -f 123456789abcde; then
8812 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8815 echo 'You can have filenames longer than 14 characters.'>&4
8820 You can't have filenames longer than 14 chars.
8821 You can't even think about them!
8827 $rm -rf 123456789abcde*
8829 : determine where library module manual pages go
8830 set man3dir man3dir none
8834 $spackage has manual pages for many of the library modules.
8840 However, you don't have nroff, so they're probably useless to you.
8843 '') man3dir="none";;
8847 case "$d_flexfnam" in
8850 However, your system can't handle the long file names like File::Basename.3.
8853 '') man3dir="none";;
8857 echo "If you don't want the manual sources installed, answer 'none'."
8858 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8860 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8861 if $test -d "$privlib/man/man3"; then
8864 WARNING: Previous versions of perl installed man3 pages into
8865 $privlib/man/man3. This version will suggest a
8866 new default of $dflt.
8870 rp='Do you wish to preserve the old behavior?(y/n)'
8873 y*) dflt="$privlib/man/man3" ;;
8878 *) dflt="$man3dir" ;;
8885 rp="Where do the $package library man pages (source) go?"
8895 : What suffix to use on installed man pages
8901 rp="What suffix should be used for the $package library man pages?"
8903 '') case "$man3dir" in
8917 *) dflt="$man3ext";;
8924 : see if we have to deal with yellow pages, now NIS.
8925 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8931 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8939 rp='Are you getting the hosts file via yellow pages?'
8942 y*) hostcat='ypcat hosts';;
8943 *) hostcat='cat /etc/hosts';;
8949 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8952 '') test -f /etc/group && groupcat='cat /etc/group';;
8955 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8958 : now get the host name
8960 echo "Figuring out host name..." >&4
8961 case "$myhostname" in
8963 echo 'Maybe "hostname" will work...'
8964 if tans=`sh -c hostname 2>&1` ; then
8972 if $test "$cont"; then
8974 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8975 if tans=`cat /etc/systemid 2>&1` ; then
8977 phostname='cat /etc/systemid'
8978 echo "Whadyaknow. Xenix always was a bit strange..."
8981 elif $test -r /etc/systemid; then
8982 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8985 if $test "$cont"; then
8986 echo 'No, maybe "uuname -l" will work...'
8987 if tans=`sh -c 'uuname -l' 2>&1` ; then
8989 phostname='uuname -l'
8991 echo 'Strange. Maybe "uname -n" will work...'
8992 if tans=`sh -c 'uname -n' 2>&1` ; then
8994 phostname='uname -n'
8996 echo 'Oh well, maybe I can mine it out of whoami.h...'
8997 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8998 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8999 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9001 case "$myhostname" in
9002 '') echo "Does this machine have an identity crisis or something?"
9005 echo "Well, you said $myhostname before..."
9006 phostname='echo $myhostname';;
9012 case "$myhostname" in
9013 '') myhostname=noname ;;
9015 : you do not want to know about this
9020 if $test "$myhostname" ; then
9022 rp='Your host name appears to be "'$myhostname'".'" Right?"
9030 : bad guess or no guess
9031 while $test "X$myhostname" = X ; do
9033 rp="Please type the (one word) name of your host:"
9038 : translate upper to lower if necessary
9039 case "$myhostname" in
9041 echo "(Normalizing case in your host name)"
9042 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9046 case "$myhostname" in
9048 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9049 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9050 echo "(Trimming domain name from host name--host name is now $myhostname)"
9052 *) case "$mydomain" in
9055 test "X$hostcat" = "Xypcat hosts" &&
9056 ypmatch "$myhostname" hosts 2>/dev/null |\
9057 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9060 test "X$hostcat" != "X" &&
9061 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9062 /[ ]$myhostname[ . ]/p" > hosts
9065 if $test -f hosts; then
9066 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9067 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9068 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9069 hosts | $sort | $uniq | \
9070 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9071 case `$echo X$dflt` in
9072 X*\ *) echo "(Several hosts in the database matched hostname)"
9075 X.) echo "(You do not have fully-qualified names in the hosts database)"
9079 echo "(I cannot locate a hosts database anywhere)"
9084 tans=`./loc resolv.conf X /etc /usr/etc`
9085 if $test -f "$tans"; then
9086 echo "(Attempting domain name extraction from $tans)"
9087 dflt=.`$sed -n -e 's/ / /g' \
9088 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9091 .) dflt=.`$sed -n -e 's/ / /g' \
9092 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9100 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9101 dflt=.`sh -c domainname 2>/dev/null`
9104 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9108 case "$dflt$osname" in
9109 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9110 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9114 .) echo "(Lost all hope -- silly guess then)"
9120 *) dflt="$mydomain";;
9124 rp="What is your domain name?"
9134 : translate upper to lower if necessary
9137 echo "(Normalizing case in your domain name)"
9138 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9142 : a little sanity check here
9143 case "$phostname" in
9146 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9147 $myhostname$mydomain|$myhostname) ;;
9149 case "$phostname" in
9151 echo "(That doesn't agree with your whoami.h file, by the way.)"
9154 echo "(That doesn't agree with your $phostname command, by the way.)"
9162 : determine the e-mail address of the user who is running us
9165 I need to get your e-mail address in Internet format if possible, i.e.
9166 something like user@host.domain. Please answer accurately since I have
9167 no easy means to double check it. The default value provided below
9168 is most probably close to reality but may not be valid from outside
9169 your organization...
9173 while test "$cont"; do
9174 case "$MAILDOMAIN" in
9176 if $test -s /etc/mailname; then
9177 maildomain=`$cat /etc/mailname`
9179 maildomain="$myhostname$mydomain"
9182 *) maildomain="$MAILDOMAIN";;
9185 '') dflt="$cf_by@$maildomain";;
9186 *) dflt="$cf_email";;
9188 rp='What is your e-mail address?'
9194 rp='Address does not look like an Internet one. Use it anyway?'
9208 : Ask e-mail of administrator
9211 If you or somebody else will be maintaining perl at your site, please
9212 fill in the correct e-mail address here so that they may be contacted
9213 if necessary. Currently, the "perlbug" program included with perl
9214 will send mail to this address in addition to perlbug@perl.org. You may
9215 enter "none" for no administrator.
9218 case "$perladmin" in
9219 '') dflt="$cf_email";;
9220 *) dflt="$perladmin";;
9222 rp='Perl administrator e-mail address'
9226 : determine whether to only install version-specific parts.
9229 Do you want to install only the version-specific parts of the perl
9230 distribution? Usually you do *not* want to do this.
9232 case "$versiononly" in
9233 "$define"|[Yy]*|true) dflt='y' ;;
9236 rp="Do you want to install only the version-specific parts of perl?"
9239 [yY]*) val="$define";;
9245 case "$versiononly" in
9246 "$define") inc_version_list=''
9247 inc_version_list_init=0
9251 : figure out how to guarantee perl startup
9252 : XXX Note that this currently takes advantage of the bug that binexp ignores
9253 : the Configure -Dinstallprefix setting, which in turn means that under
9254 : relocatable @INC, initialinstalllocation is what binexp started as.
9255 case "$startperl" in
9257 case "$sharpbang" in
9261 I can use the #! construct to start perl on your system. This will
9262 make startup of perl scripts faster, but may cause problems if you
9263 want to share those scripts and perl is not in a standard place
9264 ($initialinstalllocation/perl) on all your platforms. The alternative
9265 is to force a shell by starting the script with a single ':' character.
9268 case "$versiononly" in
9269 "$define") dflt="$initialinstalllocation/perl$version";;
9270 *) dflt="$initialinstalllocation/perl";;
9272 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9275 none) startperl=": # use perl";;
9276 *) startperl="#!$ans"
9277 if $test 30 -lt `echo "$ans" | wc -c`; then
9280 WARNING: Some systems limit the #! command to 32 characters.
9281 If you experience difficulty running Perl scripts with #!, try
9282 installing Perl in a directory with a shorter pathname.
9288 *) startperl=": # use perl"
9293 echo "I'll use $startperl to start perl scripts."
9295 : figure best path for perl in scripts
9298 case "$versiononly" in
9299 "$define") perlpath="$initialinstalllocation/perl$version";;
9300 *) perlpath="$initialinstalllocation/perl";;
9302 case "$startperl" in
9307 I will use the "eval 'exec'" idiom to start Perl on your system.
9308 I can use the full path of your Perl binary for this purpose, but
9309 doing so may cause problems if you want to share those scripts and
9310 Perl is not always in a standard place ($initialinstalllocation/perl).
9313 dflt="$initialinstalllocation/perl"
9314 rp="What path shall I use in \"eval 'exec'\"?"
9321 case "$startperl" in
9323 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9326 : determine where public executable scripts go
9327 set scriptdir scriptdir
9329 case "$scriptdir" in
9332 : guess some guesses
9333 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9334 $test -d /usr/share/bin && dflt=/usr/share/bin
9335 $test -d /usr/local/script && dflt=/usr/local/script
9336 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9337 $test -d $prefixexp/script && dflt=$prefixexp/script
9341 *) dflt="$scriptdir"
9346 Some installations have a separate directory just for executable scripts so
9347 that they can mount it across multiple architectures but keep the scripts in
9348 one spot. You might, for example, have a subdirectory of /usr/share for this.
9349 Or you might just lump your scripts in with all your other executables.
9353 rp='Where do you keep publicly executable scripts?'
9355 if $test "X$ansexp" != "X$scriptdirexp"; then
9361 : A little fix up for an irregularly named variable.
9362 installscript="$installscriptdir"
9364 : determine where add-on public executables go
9366 '') dflt=$siteprefix/bin ;;
9370 rp='Pathname where the add-on public executables should be installed?'
9375 : determine where add-on html pages go
9376 : There is no standard location, so try to copy the previously-selected
9377 : directory structure for the core html pages.
9378 case "$sitehtml1dir" in
9379 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9380 *) dflt=$sitehtml1dir ;;
9383 ''|' ') dflt=none ;;
9386 rp='Pathname where the site-specific html pages should be installed?'
9388 prefixvar=sitehtml1dir
9391 : determine where add-on library html pages go
9392 : There is no standard location, so try to copy the previously-selected
9393 : directory structure for the core html pages.
9394 case "$sitehtml3dir" in
9395 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9396 *) dflt=$sitehtml3dir ;;
9399 ''|' ') dflt=none ;;
9402 rp='Pathname where the site-specific library html pages should be installed?'
9404 prefixvar=sitehtml3dir
9407 : determine where add-on manual pages go
9408 case "$siteman1dir" in
9409 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9410 *) dflt=$siteman1dir ;;
9413 ''|' ') dflt=none ;;
9416 rp='Pathname where the site-specific manual pages should be installed?'
9418 prefixvar=siteman1dir
9421 : determine where add-on library man pages go
9422 case "$siteman3dir" in
9423 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9424 *) dflt=$siteman3dir ;;
9427 ''|' ') dflt=none ;;
9430 rp='Pathname where the site-specific library manual pages should be installed?'
9432 prefixvar=siteman3dir
9435 : determine where add-on public executable scripts go
9436 case "$sitescript" in
9437 '') dflt=$siteprefix/script
9438 $test -d $dflt || dflt=$sitebin ;;
9439 *) dflt="$sitescript" ;;
9442 rp='Pathname where add-on public executable scripts should be installed?'
9444 prefixvar=sitescript
9447 : see if backtrace exists
9448 set backtrace d_backtrace
9451 : add flags if using c backtrace
9452 case "$usecbacktrace" in
9453 "") usecbacktrace=$undef ;;
9455 case "$d_backtrace" in
9457 case " $ccflags " in
9458 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9459 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9463 echo "This system does not support backtrace" >&4
9464 usecbacktrace=$undef
9470 : Check if faststdio is requested and available
9471 case "$usefaststdio" in
9472 $define|true|[yY]*|'')
9473 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9483 Perl can be built to use 'fast stdio', which means using the stdio
9484 library but also directly manipulating the stdio buffers to enable
9485 faster I/O. Using stdio is better for backward compatibility (especially
9486 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9487 interface has been preferred instead of stdio.
9489 If this doesn't make any sense to you, just accept the default '$dflt'.
9491 rp='Use the "fast stdio" if available?'
9494 y|Y) val="$define" ;;
9501 : define an is-a-typedef? function
9502 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9504 "") inclist="sys/types.h";;
9506 eval "varval=\$$var";
9510 for inc in $inclist; do
9511 echo "#include <$inc>" >>temp.c;
9513 echo "#ifdef $type" >> temp.c;
9514 echo "printf(\"We have $type\");" >> temp.c;
9515 echo "#endif" >> temp.c;
9516 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9517 if $contains $type temp.E >/dev/null 2>&1; then
9523 *) eval "$var=\$varval";;
9526 : define an is-a-typedef? function that prompts if the type is not available.
9527 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9529 "") inclist="sys/types.h";;
9531 eval "varval=\$$var";
9535 for inc in $inclist; do
9536 echo "#include <$inc>" >>temp.c;
9538 echo "#ifdef $type" >> temp.c;
9539 echo "printf(\"We have $type\");" >> temp.c;
9540 echo "#endif" >> temp.c;
9541 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9543 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9544 if $contains $type temp.E >/dev/null 2>&1; then
9545 echo "$type found." >&4;
9548 echo "$type NOT found." >&4;
9554 *) eval "$var=\$varval";;
9557 : see what type lseek is declared as in the kernel
9558 rp="What is the type used for lseek's offset on this system?"
9559 set off_t lseektype long stdio.h sys/types.h
9563 echo "Checking to see how big your file offsets are..." >&4
9565 #include <sys/types.h>
9569 printf("%d\n", (int)sizeof($lseektype));
9574 if eval $compile_ok; then
9575 lseeksize=`$run ./try`
9576 echo "Your file offsets are $lseeksize bytes long."
9580 echo "(I can't seem to compile the test program. Guessing...)"
9581 rp="What is the size of your file offsets (in bytes)?"
9587 : see what type file positions are declared as in the library
9588 rp="What is the type for file position used by fsetpos()?"
9589 set fpos_t fpostype long stdio.h sys/types.h
9592 : Check size for Fpos_t
9595 *_t) zzz="$fpostype" ;;
9598 echo "Checking the size of $zzz..." >&4
9600 #include <sys/types.h>
9607 printf("%d\n", (int)sizeof($fpostype));
9612 if eval $compile_ok; then
9616 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9619 echo "Your $zzz is $fpossize bytes long."
9625 echo "(I can't compile the test program. Guessing...)" >&4
9626 rp="What is the size of your file positions (in bytes)?"
9631 : Check for large file support
9632 # Backward compatibility (uselfs is deprecated).
9634 "$define"|true|[yY]*)
9637 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9639 uselargefiles="$define"
9643 case "$lseeksize:$fpossize" in
9646 You can have files larger than 2 gigabytes.
9649 *) case "$uselargefiles" in
9650 "$undef"|false|[nN]*) dflt='n' ;;
9655 Perl can be built to understand large files (files larger than 2 gigabytes)
9656 on some systems. To do so, Configure can be run with -Duselargefiles.
9658 If this doesn't make any sense to you, just accept the default '$dflt'.
9660 rp='Try to understand large files, if available?'
9663 y|Y) val="$define" ;;
9670 : Look for a hint-file generated 'call-back-unit'. If the
9671 : user has specified that a large files perl is to be built,
9672 : we may need to set or change some other defaults.
9673 if $test -f uselargefiles.cbu; then
9674 echo "Your platform has some specific hints regarding large file builds, using them..."
9675 . ./uselargefiles.cbu
9677 case "$uselargefiles" in
9679 if $test -f uselargefiles.cbu; then
9681 echo "Rechecking to see how big your file offsets are..." >&4
9683 #include <sys/types.h>
9687 printf("%d\n", (int)sizeof($lseektype));
9692 if eval $compile_ok; then
9693 lseeksize=`$run ./try`
9694 $echo "Your file offsets are now $lseeksize bytes long."
9698 echo "(I can't seem to compile the test program. Guessing...)"
9699 rp="What is the size of your file offsets (in bytes)?"
9704 *_t) zzz="$fpostype" ;;
9707 $echo $n "Rechecking the size of $zzz...$c" >&4
9709 #include <sys/types.h>
9716 printf("%d\n", (int)sizeof($fpostype));
9721 if eval $compile_ok; then
9726 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9729 echo " $fpossize bytes." >&4
9735 echo "(I can't compile the test program. Guessing...)" >&4
9736 rp="What is the size of your file positions (in bytes)?"
9745 : Check if we want perlio
9748 : Set the vendorbin variables
9749 case "$vendorprefix" in
9750 '') d_vendorbin="$undef"
9754 *) d_vendorbin="$define"
9755 : determine where vendor-supplied executables go.
9756 case "$vendorbin" in
9757 '') dflt=$vendorprefix/bin ;;
9758 *) dflt="$vendorbin" ;;
9761 rp='Pathname for the vendor-supplied executables directory?'
9764 vendorbinexp="$ansexp"
9770 : Set the vendorhtml1dir variables
9771 case "$vendorprefix" in
9772 '') vendorhtml1dir=''
9773 vendorhtml1direxp=''
9775 *) : determine where vendor-supplied html pages go.
9776 : There is no standard location, so try to copy the previously-selected
9777 : directory structure for the core html pages.
9778 : XXX Better default suggestions would be welcome.
9779 case "$vendorhtml1dir" in
9780 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9781 *) dflt=$vendorhtml1dir ;;
9784 ''|' ') dflt=none ;;
9787 rp='Pathname for the vendor-supplied html pages?'
9789 vendorhtml1dir="$ans"
9790 vendorhtml1direxp="$ansexp"
9793 : Use ' ' for none so value is preserved next time through Configure
9794 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9795 prefixvar=vendorhtml1dir
9798 : Set the vendorhtml3dir variables
9799 case "$vendorprefix" in
9800 '') vendorhtml3dir=''
9801 vendorhtml3direxp=''
9803 *) : determine where vendor-supplied module html pages go.
9804 : There is no standard location, so try to copy the previously-selected
9805 : directory structure for the core html pages.
9806 : XXX Better default suggestions would be welcome.
9807 case "$vendorhtml3dir" in
9808 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9809 *) dflt=$vendorhtml3dir ;;
9812 ''|' ') dflt=none ;;
9815 rp='Pathname for the vendor-supplied html pages?'
9817 vendorhtml3dir="$ans"
9818 vendorhtml3direxp="$ansexp"
9821 : Use ' ' for none so value is preserved next time through Configure
9822 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9823 prefixvar=vendorhtml3dir
9826 : Set the vendorman1dir variables
9827 case "$vendorprefix" in
9828 '') vendorman1dir=''
9831 *) : determine where vendor-supplied manual pages go.
9832 case "$vendorman1dir" in
9833 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9834 *) dflt=$vendorman1dir ;;
9837 ''|' ') dflt=none ;;
9840 rp='Pathname for the vendor-supplied manual section 1 pages?'
9842 vendorman1dir="$ans"
9843 vendorman1direxp="$ansexp"
9846 : Use ' ' for none so value is preserved next time through Configure
9847 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9848 prefixvar=vendorman1dir
9851 : Set the vendorman3dir variables
9852 case "$vendorprefix" in
9853 '') vendorman3dir=''
9856 *) : determine where vendor-supplied module manual pages go.
9857 case "$vendorman3dir" in
9858 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9859 *) dflt=$vendorman3dir ;;
9862 ''|' ') dflt=none ;;
9865 rp='Pathname for the vendor-supplied manual section 3 pages?'
9867 vendorman3dir="$ans"
9868 vendorman3direxp="$ansexp"
9871 : Use ' ' for none so value is preserved next time through Configure
9872 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9873 prefixvar=vendorman3dir
9876 : Set the vendorscript variables
9877 case "$vendorprefix" in
9878 '') d_vendorscript="$undef"
9882 *) d_vendorscript="$define"
9883 : determine where vendor-supplied scripts go.
9884 case "$vendorscript" in
9885 '') dflt=$vendorprefix/script
9886 $test -d $dflt || dflt=$vendorbin ;;
9887 *) dflt="$vendorscript" ;;
9891 The installation process will create a directory for
9892 vendor-supplied scripts.
9896 rp='Pathname for the vendor-supplied scripts directory?'
9899 vendorscriptexp="$ansexp"
9902 prefixvar=vendorscript
9905 : script used to emit important warnings
9908 if test \$# -gt 0; then
9913 echo "*** WARNING:" >&4
9914 sed -e 's/^/*** /' <msg >&4
9916 cat msg >>config.msg
9917 echo " " >>config.msg
9923 : see which of string.h or strings.h is needed
9925 strings=`./findhdr string.h`
9926 if $test "$strings" && $test -r "$strings"; then
9927 echo "Using <string.h> instead of <strings.h>." >&4
9931 strings=`./findhdr strings.h`
9932 if $test "$strings" && $test -r "$strings"; then
9933 echo "Using <strings.h> instead of <string.h>." >&4
9935 ./warn "No string header found -- You'll surely have problems."
9941 "$undef") strings=`./findhdr strings.h`;;
9942 *) strings=`./findhdr string.h`;;
9945 : see if qgcvt exists
9949 : Check print/scan long double stuff
9952 if $test X"$d_longdbl" = X"$define"; then
9954 echo "Checking how to print long doubles..." >&4
9956 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9957 $cat >try.c <<'EOCP'
9958 #include <sys/types.h>
9962 printf("%.3f\n", d);
9966 if eval $compile; then
9970 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9971 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9972 echo "We will use %f."
9978 if $test X"$sPRIfldbl" = X; then
9979 $cat >try.c <<'EOCP'
9980 #include <sys/types.h>
9983 long double d = 123.456;
9984 printf("%.3Lf\n", d);
9988 if eval $compile; then
9992 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9993 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9994 echo "We will use %Lf."
10000 if $test X"$sPRIfldbl" = X; then
10001 $cat >try.c <<'EOCP'
10002 #include <sys/types.h>
10005 long double d = 123.456;
10006 printf("%.3llf\n", d);
10010 if eval $compile; then
10014 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10015 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10016 echo "We will use %llf."
10022 if $test X"$sPRIfldbl" = X; then
10023 $cat >try.c <<'EOCP'
10024 #include <sys/types.h>
10027 long double d = 123.456;
10028 printf("%.3lf\n", d);
10032 if eval $compile; then
10036 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10037 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10038 echo "We will use %lf."
10044 if $test X"$sPRIfldbl" = X; then
10045 echo "Cannot figure out how to print long doubles." >&4
10047 sSCNfldbl=$sPRIfldbl # expect consistency
10054 case "$sPRIfldbl" in
10055 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10056 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10057 d_SCNfldbl="$undef";
10059 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10060 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10061 d_SCNfldbl="$define";
10065 : Check how to convert floats to strings.
10067 if test "X$d_Gconvert" = X; then
10070 echo "Checking for an efficient way to convert floats to strings."
10072 case "$uselongdouble" in
10073 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10075 case "$d_longdbl" in
10076 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10078 case "$d_PRIgldbl" in
10079 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10082 #ifdef TRY_gconvert
10083 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10084 char *myname = "gconvert";
10087 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10088 char *myname = "gcvt";
10091 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10092 char *myname = "qgcvt";
10093 #define DOUBLETYPE long double
10096 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10097 #ifdef HAS_PRIgldbl
10098 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10100 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10103 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10105 char *myname = "sprintf";
10109 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10110 #define DOUBLETYPE long double
10112 #define DOUBLETYPE double
10118 #$i_stdlib I_STDLIB
10120 #include <stdlib.h>
10122 #$i_string I_STRING
10124 # include <string.h>
10126 # include <strings.h>
10129 int checkit(char *expect, char *got)
10131 if (strcmp(expect, got)) {
10132 printf("%s oddity: Expected %s, got %s\n",
10133 myname, expect, got);
10143 /* This must be 1st test on (which?) platform */
10144 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10145 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10146 checkit("0.1", buf);
10148 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10149 checkit("0.01", buf);
10151 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10152 checkit("0.001", buf);
10154 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10155 checkit("0.0001", buf);
10157 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10158 if (strlen(buf) > 5)
10159 checkit("9e-005", buf); /* for Microsoft ?? */
10161 checkit("9e-05", buf);
10163 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10166 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10167 checkit("1.1", buf);
10169 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10170 checkit("1.01", buf);
10172 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10173 checkit("1.001", buf);
10175 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10176 checkit("1.0001", buf);
10178 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10179 checkit("1.00001", buf);
10181 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10182 checkit("1.000001", buf);
10184 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10187 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10188 checkit("-1", buf);
10190 /* Some Linux gcvt's give 1.e+5 here. */
10191 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10192 checkit("100000", buf);
10194 /* Some Linux gcvt's give -1.e+5 here. */
10195 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10196 checkit("-100000", buf);
10198 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10199 checkit("123.456", buf);
10201 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10202 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10203 /* 34 should be enough to scare even long double
10204 * places into using the e notation. */
10205 if (strlen(buf) > 5)
10206 checkit("1e+034", buf); /* for Microsoft */
10208 checkit("1e+34", buf);
10210 /* For Perl, if you add additional tests here, also add them to
10211 * t/base/num.t for benefit of platforms not using Configure or
10212 * overriding d_Gconvert */
10217 : first add preferred functions to our list
10219 for xxx_convert in $gconvert_preference; do
10220 case $xxx_convert in
10221 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10222 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10225 : then add any others
10226 for xxx_convert in gconvert gcvt sprintf; do
10227 case "$xxx_list" in
10229 *) xxx_list="$xxx_list $xxx_convert" ;;
10233 case "$d_longdbl$uselongdouble" in
10235 : again, add preferred functions to our list first
10237 for xxx_convert in $gconvert_ld_preference; do
10238 case $xxx_convert in
10239 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10240 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10243 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10244 for xxx_convert in qgcvt sprintf $xxx_list; do
10245 case "$xxx_ld_list" in
10246 $xxx_convert*|*" $xxx_convert"*) ;;
10247 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10250 : if sprintf cannot do long doubles, move it to the end
10251 if test "$d_PRIgldbl" != "$define"; then
10252 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10254 : if no qgcvt, remove it
10255 if test "$d_qgcvt" != "$define"; then
10256 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10259 xxx_list="$xxx_ld_list"
10263 for xxx_convert in $xxx_list; do
10264 echo "Trying $xxx_convert..."
10265 $rm -f try try$_o core
10266 set try -DTRY_$xxx_convert
10267 if eval $compile; then
10268 echo "$xxx_convert() found." >&4
10269 if $run ./try; then
10270 echo "I'll use $xxx_convert to convert floats into a string." >&4
10273 echo "...But $xxx_convert didn't work as I expected."
10277 echo "$xxx_convert NOT found." >&4
10281 if test X$xxx_convert = X; then
10282 echo "*** WHOA THERE!!! ***" >&4
10283 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10284 xxx_convert=sprintf
10287 case "$xxx_convert" in
10288 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10289 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10290 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10291 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10292 "$define$define$define")
10293 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10294 "$define$define$undef")
10295 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10296 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10304 : see if _fwalk exists
10308 : Initialize h_fcntl
10311 : Initialize h_sysfile
10314 : access call always available on UNIX
10315 set access d_access
10318 : locate the flags for 'access()'
10319 case "$d_access" in
10322 $cat >access.c <<EOCP
10323 #include <sys/types.h>
10328 #include <sys/file.h>
10331 #include <unistd.h>
10333 #$i_stdlib I_STDLIB
10335 #include <stdlib.h>
10341 : check sys/file.h first, no particular reason here
10342 if $test `./findhdr sys/file.h` && \
10343 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10345 echo "<sys/file.h> defines the *_OK access constants." >&4
10346 elif $test `./findhdr fcntl.h` && \
10347 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10349 echo "<fcntl.h> defines the *_OK access constants." >&4
10350 elif $test `./findhdr unistd.h` && \
10351 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10352 echo "<unistd.h> defines the *_OK access constants." >&4
10354 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10360 : see if accessx exists
10361 set accessx d_accessx
10364 : see if acosh exists
10368 : see if aintl exists
10372 : see if alarm exists
10376 : see if 64bit time functions exists
10378 set ctime64 d_ctime64
10381 set localtime64 d_localtime64
10384 set gmtime64 d_gmtime64
10387 set mktime64 d_mktime64
10390 set difftime64 d_difftime64
10393 set asctime64 d_asctime64
10396 : see if POSIX threads are available
10397 set pthread.h i_pthread
10400 : define a function to check prototypes
10401 $cat > protochk <<EOSH
10404 optimize="$optimize"
10406 prototype="$prototype"
10409 usethreads=$usethreads
10410 i_pthread=$i_pthread
10411 pthread_h_first=$pthread_h_first
10414 $cat >> protochk <<'EOSH'
10419 while test $# -ge 2; do
10421 $define) echo "#include <$2>" >> try.c ;;
10422 literal) echo "$2" >> try.c ;;
10424 # Extra magic for the benefit of systems that need pthread.h
10425 # to be included early to correctly detect threadsafe functions.
10426 # Such functions must guarantee themselves, though, that the usethreads
10427 # and i_pthread have been defined, before calling protochk.
10428 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10429 echo "#include <pthread.h>" >> try.c
10434 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10435 cat >> try.c <<'EOCP'
10436 #ifdef CAN_PROTOTYPE
10437 #define _(args) args
10442 echo "$foo" >> try.c
10443 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10444 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10450 $eunicefix protochk
10452 : Define hasproto macro for Configure internal use
10453 hasproto='varname=$1; func=$2; shift; shift;
10454 while $test $# -ge 2; do
10456 $define) echo "#include <$2>";;
10460 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10461 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10462 echo "$func() prototype found.";
10465 echo "$func() prototype NOT found.";
10472 : see if sys/types.h has to be included
10473 set sys/types.h i_systypes
10476 : see if sys/select.h has to be included
10477 set sys/select.h i_sysselct
10480 : Define hasfield macro for Configure internal use
10481 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10482 while $test $# -ge 2; do
10484 $define) echo "#include <$2>";;
10488 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10490 if eval $compile; then
10499 : see if we should include time.h, sys/time.h, or both
10501 if test "X$timeincl" = X; then
10502 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10503 $echo $n "I'm now running the test program...$c"
10505 #include <sys/types.h>
10510 #ifdef SYSTIMEKERNEL
10513 #include <sys/time.h>
10516 #include <sys/select.h>
10518 #$i_stdlib I_STDLIB
10520 #include <stdlib.h>
10526 struct timeval bar;
10529 struct timezone tzp;
10531 if (foo.tm_sec == foo.tm_sec)
10534 if (bar.tv_sec == bar.tv_sec)
10541 for s_timezone in '-DS_TIMEZONE' ''; do
10543 for s_timeval in '-DS_TIMEVAL' ''; do
10544 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10545 for i_time in '' '-DI_TIME'; do
10546 for i_systime in '-DI_SYSTIME' ''; do
10549 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10550 if eval $compile; then
10551 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10555 $echo $n "Succeeded with $flags$c"
10567 *SYSTIMEKERNEL*) i_systimek="$define"
10568 timeincl=`./findhdr sys/time.h`
10569 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10570 *) i_systimek="$undef";;
10573 *I_TIME*) i_time="$define"
10574 timeincl=`./findhdr time.h`" $timeincl"
10575 echo "We'll include <time.h>." >&4;;
10576 *) i_time="$undef";;
10579 *I_SYSTIME*) i_systime="$define"
10580 timeincl=`./findhdr sys/time.h`" $timeincl"
10581 echo "We'll include <sys/time.h>." >&4;;
10582 *) i_systime="$undef";;
10586 : see if struct tm knows about tm_zone
10587 case "$i_systime$i_time" in
10590 echo "Checking to see if your struct tm has tm_zone field..." >&4
10591 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10599 case "$d_tm_tm_zone" in
10600 "$define") echo "Yes, it does." ;;
10601 *) echo "No, it doesn't." ;;
10603 : see if struct tm knows about tm_gmtoff
10604 case "$i_systime$i_time" in
10607 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10608 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10616 case "$d_tm_tm_gmtoff" in
10617 "$define") echo "Yes, it does." ;;
10618 *) echo "No, it doesn't." ;;
10621 : see if asctime_r exists
10622 set asctime_r d_asctime_r
10624 case "$d_asctime_r" in
10626 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10627 case "$d_asctime_r_proto:$usethreads" in
10628 ":define") d_asctime_r_proto=define
10629 set d_asctime_r_proto asctime_r $hdrs
10633 case "$d_asctime_r_proto" in
10635 case "$asctime_r_proto" in
10636 ''|0) try='char* asctime_r(const struct tm*, char*);'
10637 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10639 case "$asctime_r_proto" in
10640 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10641 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10643 case "$asctime_r_proto" in
10644 ''|0) try='int asctime_r(const struct tm*, char*);'
10645 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10647 case "$asctime_r_proto" in
10648 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10649 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10651 case "$asctime_r_proto" in
10652 ''|0) d_asctime_r=undef
10654 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10655 * ) case "$asctime_r_proto" in
10656 REENTRANT_PROTO*) ;;
10657 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10659 echo "Prototype: $try" ;;
10662 *) case "$usethreads" in
10663 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10670 *) asctime_r_proto=0
10674 : see if atolf exists
10678 : see if atoll exists
10682 : Look for GCC-style attribute format
10683 case "$d_attribute_format" in
10686 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10687 $cat >attrib.c <<'EOCP'
10689 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10691 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10692 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10693 echo "Your C compiler doesn't support __attribute__((format))."
10696 echo "Your C compiler supports __attribute__((format))."
10700 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10704 *) val="$d_attribute_format" ;;
10706 set d_attribute_format
10710 : Look for GCC-style attribute format with null format allowed
10711 case "$d_printf_format_null" in
10712 '') case "$d_attribute_format" in
10715 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10716 $cat >attrib.c <<EOCP
10718 #$i_stdlib I_STDLIB
10720 #include <stdlib.h>
10722 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10723 int null_printf (char* pat,...) { return (int)pat; }
10724 int main () { exit(null_printf(NULL)); }
10726 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10727 : run the executable in case it produces a run-time warning
10728 if $run ./attrib >>attrib.out 2>&1; then
10729 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10730 echo "Your C compiler doesn't allow __printf__ format to be null."
10733 echo "Your C compiler allows __printf__ format to be null."
10737 echo "Your C compiler executable failed with __printf__ format null."
10741 echo "Your C compiler fails with __printf__ format null."
10748 *) val="$d_printf_format_null" ;;
10750 set d_printf_format_null
10754 : Look for GCC-style attribute malloc
10755 case "$d_attribute_malloc" in
10758 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10759 $cat >attrib.c <<'EOCP'
10761 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10763 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10764 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10765 echo "Your C compiler doesn't support __attribute__((malloc))."
10768 echo "Your C compiler supports __attribute__((malloc))."
10772 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10776 *) val="$d_attribute_malloc" ;;
10778 set d_attribute_malloc
10782 : Look for GCC-style attribute nonnull
10783 case "$d_attribute_nonnull" in
10786 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10787 $cat >attrib.c <<'EOCP'
10789 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10791 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10792 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10793 echo "Your C compiler doesn't support __attribute__((nonnull))."
10796 echo "Your C compiler supports __attribute__((nonnull))."
10800 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10804 *) val="$d_attribute_nonnull" ;;
10806 set d_attribute_nonnull
10810 : Look for GCC-style attribute noreturn
10811 case "$d_attribute_noreturn" in
10814 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10815 $cat >attrib.c <<'EOCP'
10817 void fall_over_dead( void ) __attribute__((noreturn));
10819 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10820 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10821 echo "Your C compiler doesn't support __attribute__((noreturn))."
10824 echo "Your C compiler supports __attribute__((noreturn))."
10828 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10832 *) val="$d_attribute_noreturn" ;;
10834 set d_attribute_noreturn
10838 : Look for GCC-style attribute pure
10839 case "$d_attribute_pure" in
10842 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10843 $cat >attrib.c <<'EOCP'
10845 int square( int n ) __attribute__((pure));
10847 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10848 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10849 echo "Your C compiler doesn't support __attribute__((pure))."
10852 echo "Your C compiler supports __attribute__((pure))."
10856 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10860 *) val="$d_attribute_pure" ;;
10862 set d_attribute_pure
10866 : Look for GCC-style attribute unused
10867 case "$d_attribute_unused" in
10870 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10871 $cat >attrib.c <<'EOCP'
10873 int do_something( int dummy __attribute__((unused)), int n );
10875 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10876 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10877 echo "Your C compiler doesn't support __attribute__((unused))."
10880 echo "Your C compiler supports __attribute__((unused))."
10884 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10888 *) val="$d_attribute_unused" ;;
10890 set d_attribute_unused
10894 : Look for GCC-style attribute deprecated
10895 case "$d_attribute_deprecated" in
10898 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10899 $cat >attrib.c <<'EOCP'
10901 int I_am_deprecated(void) __attribute__((deprecated));
10903 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10904 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10905 echo "Your C compiler doesn't support __attribute__((deprecated))."
10908 echo "Your C compiler supports __attribute__((deprecated))."
10912 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10916 *) val="$d_attribute_deprecated" ;;
10918 set d_attribute_deprecated
10922 : Look for GCC-style attribute warn_unused_result
10923 case "$d_attribute_warn_unused_result" in
10926 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10927 $cat >attrib.c <<'EOCP'
10929 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10931 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10932 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10933 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10936 echo "Your C compiler supports __attribute__((warn_unused_result))."
10940 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10944 *) val="$d_attribute_warn_unused_result" ;;
10946 set d_attribute_warn_unused_result
10950 : see if bcmp exists
10954 : see if bcopy exists
10958 : see if getpgrp exists
10959 set getpgrp d_getpgrp
10962 case "$d_getpgrp" in
10965 echo "Checking to see which flavor of getpgrp is in use..."
10967 #$i_unistd I_UNISTD
10968 #include <sys/types.h>
10970 # include <unistd.h>
10972 #$i_stdlib I_STDLIB
10974 #include <stdlib.h>
10978 if (getuid() == 0) {
10979 printf("(I see you are running Configure as super-user...)\n");
10982 #ifdef TRY_BSD_PGRP
10983 if (getpgrp(1) == 0)
10992 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10993 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10995 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10996 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10999 echo "I can't seem to compile and run the test program."
11001 xxx="a USG one, i.e. you use getpgrp()."
11003 # SVR4 systems can appear rather BSD-ish.
11004 case "$i_unistd" in
11006 xxx="a BSD one, i.e. you use getpgrp(pid)."
11010 xxx="probably a USG one, i.e. you use getpgrp()."
11015 echo "Assuming your getpgrp is $xxx" >&4
11024 : see if setpgrp exists
11025 set setpgrp d_setpgrp
11028 case "$d_setpgrp" in
11031 echo "Checking to see which flavor of setpgrp is in use..."
11033 #$i_unistd I_UNISTD
11034 #include <sys/types.h>
11036 # include <unistd.h>
11038 #$i_stdlib I_STDLIB
11040 #include <stdlib.h>
11044 if (getuid() == 0) {
11045 printf("(I see you are running Configure as super-user...)\n");
11048 #ifdef TRY_BSD_PGRP
11049 if (-1 == setpgrp(1, 1))
11052 if (setpgrp() != -1)
11058 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11059 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11061 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11062 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11065 echo "(I can't seem to compile and run the test program.)"
11067 xxx="a USG one, i.e. you use setpgrp()."
11069 # SVR4 systems can appear rather BSD-ish.
11070 case "$i_unistd" in
11072 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11076 xxx="probably a USG one, i.e. you use setpgrp()."
11081 echo "Assuming your setpgrp is $xxx" >&4
11090 : Look for GCC-style __builtin_choose_expr
11091 case "$d_builtin_choose_expr" in
11094 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11095 $cat >try.c <<'EOCP'
11096 #include <assert.h>
11097 #include <stdlib.h>
11100 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11103 assert( SYRINX(1) == 2112 );
11104 assert( SYRINX(1) != 5150 );
11105 assert( SYRINX(0) == 5150 );
11106 assert( SYRINX(0) != 2112 );
11107 puts( "All good!" );
11113 if eval $compile && $run ./try; then
11114 echo "Your C compiler supports __builtin_choose_expr."
11117 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11121 *) val="$d_builtin_choose_expr" ;;
11124 set d_builtin_choose_expr
11128 : Look for GCC-style __builtin_expect
11129 case "$d_builtin_expect" in
11132 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11133 $cat >try.c <<'EOCP'
11136 if ( __builtin_expect(n, 0) ) n = 1;
11137 /* Remember shell exit code truth is 0, C truth is non-zero */
11142 if eval $compile && $run ./try; then
11143 echo "Your C compiler supports __builtin_expect."
11146 echo "Your C compiler doesn't seem to understand __builtin_expect."
11150 *) val="$d_builtin_expect" ;;
11153 set d_builtin_expect
11157 : see if bzero exists
11161 : see if stdarg is available
11163 if $test `./findhdr stdarg.h`; then
11164 echo "<stdarg.h> found." >&4
11167 echo "<stdarg.h> NOT found." >&4
11171 : see if varargs is available
11173 if $test `./findhdr varargs.h`; then
11174 echo "<varargs.h> found." >&4
11176 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11179 : set up the varargs testing programs
11180 $cat > varargs.c <<EOP
11182 #include <stdarg.h>
11185 #include <varargs.h>
11189 int f(char *p, ...)
11203 p = va_arg(ap, char *);
11209 $cat > varargs <<EOP
11211 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11220 : now check which varargs header should be included
11226 if `./varargs I_STDARG`; then
11228 elif `./varargs I_VARARGS`; then
11233 if `./varargs I_VARARGS`; then
11241 echo "*** WHOA THERE!!! ***" >&4
11242 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11243 case "$knowitall" in
11245 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11249 echo "I could not find the definition for va_dcl... You have problems..." >&4
11250 val="$undef"; set i_stdarg; eval $setvar
11251 val="$undef"; set i_varargs; eval $setvar
11256 case "$i_varhdr" in
11258 val="$define"; set i_stdarg; eval $setvar
11259 val="$undef"; set i_varargs; eval $setvar
11262 val="$undef"; set i_stdarg; eval $setvar
11263 val="$define"; set i_varargs; eval $setvar
11266 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11270 : see if the Compiler supports C99 variadic macros
11271 case "$i_stdarg$i_stdlib" in
11273 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11276 #include <stdarg.h>
11278 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11282 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11288 if eval $compile && $run ./try 2>&1 >/dev/null; then
11289 case "`$run ./try`" in
11291 echo "You have C99 variadic macros." >&4
11292 d_c99_variadic_macros="$define"
11295 echo "You don't have functional C99 variadic macros." >&4
11296 d_c99_variadic_macros="$undef"
11300 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11301 d_c99_variadic_macros="$undef"
11306 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11307 d_c99_variadic_macros="$undef"
11311 : see if signal is declared as pointer to function returning int or void
11313 xxx=`./findhdr signal.h`
11314 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11315 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11316 echo "You have int (*signal())() instead of void." >&4
11318 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11319 echo "You have void (*signal())()." >&4
11321 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11322 echo "You have int (*signal())() instead of void." >&4
11324 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11325 echo "You have void (*signal())()." >&4
11328 case "$d_voidsig" in
11330 echo "I can't determine whether signal handler returns void or int..." >&4
11332 rp="What type does your signal handler return?"
11335 v*) val="$define";;
11339 echo "As you already told me, signal handler returns void." >&4
11342 *) echo "As you already told me, signal handler returns int." >&4
11349 case "$d_voidsig" in
11350 "$define") signal_t="void";;
11351 *) signal_t="int";;
11355 : check for ability to cast large floats to 32-bit ints.
11357 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11358 if $test "$intsize" -ge 4; then
11365 #$i_stdlib I_STDLIB
11367 #include <stdlib.h>
11369 #include <sys/types.h>
11370 #include <signal.h>
11371 $signal_t blech(int s) { exit(3); }
11378 signal(SIGFPE, blech);
11380 /* Don't let compiler optimize the test away. Store the number
11381 in a writable string for gcc to pass to sscanf under HP-UX.
11383 sprintf(str, "2147483647");
11384 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11388 /* x86 processors will probably give 0x8000 0000, which is a
11389 sign change. We don't want that. We want to mimic SPARC
11390 behavior here, which is to preserve the sign and give
11393 if (i32 != ($xxx) f)
11399 if eval $compile_ok; then
11403 echo "(I can't seem to compile the test program--assuming it can't)"
11408 echo "Yup, it can."
11411 echo "Nope, it can't."
11418 : check for ability to cast negative floats to unsigned
11420 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11423 #$i_stdlib I_STDLIB
11425 #include <stdlib.h>
11427 #include <sys/types.h>
11428 #include <signal.h>
11429 $signal_t blech(int s) { exit(7); }
11430 $signal_t blech_in_list(int s) { exit(4); }
11431 unsigned long dummy_long(unsigned long p) { return p; }
11432 unsigned int dummy_int(unsigned int p) { return p; }
11433 unsigned short dummy_short(unsigned short p) { return p; }
11437 unsigned long along;
11439 unsigned short ashort;
11443 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11444 a direct f = -123. assignment. gcc-2.8.0 reportedly
11445 optimized the whole file away
11447 /* Store the number in a writable string for gcc to pass to
11448 sscanf under HP-UX.
11450 sprintf(str, "-123");
11451 sscanf(str, "%lf", &f); /* f = -123.; */
11453 signal(SIGFPE, blech);
11454 along = (unsigned long)f;
11455 aint = (unsigned int)f;
11456 ashort = (unsigned short)f;
11457 if (along != (unsigned long)-123)
11459 if (aint != (unsigned int)-123)
11461 if (ashort != (unsigned short)-123)
11463 sprintf(str, "1073741824.");
11464 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11467 along = (unsigned long)f;
11468 if (along != 0x80000000)
11472 along = (unsigned long)f;
11473 if (along != 0x7fffffff)
11477 along = (unsigned long)f;
11478 if (along != 0x80000001)
11482 signal(SIGFPE, blech_in_list);
11483 sprintf(str, "123.");
11484 sscanf(str, "%lf", &f); /* f = 123.; */
11485 along = dummy_long((unsigned long)f);
11486 aint = dummy_int((unsigned int)f);
11487 ashort = dummy_short((unsigned short)f);
11488 if (along != (unsigned long)123)
11490 if (aint != (unsigned int)123)
11492 if (ashort != (unsigned short)123)
11499 if eval $compile_ok; then
11503 echo "(I can't seem to compile the test program--assuming it can't)"
11506 case "$castflags" in
11508 echo "Yup, it can."
11511 echo "Nope, it can't."
11518 : see if vprintf exists
11520 if set vprintf val -f d_vprintf; eval $csym; $val; then
11521 echo 'vprintf() found.' >&4
11524 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11525 #$i_varargs I_VARARGS
11527 #$i_stdlib I_STDLIB
11528 #$i_unistd I_UNISTD
11531 # include <stdarg.h>
11532 #else /* I_VARARGS */
11533 # include <varargs.h>
11537 # include <unistd.h>
11541 # include <stdlib.h>
11544 #include <stdio.h> /* vsprintf prototype */
11547 void xxx(int n, ...)
11552 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11554 int main() { xxx(1, "foo"); }
11556 #else /* I_VARARGS */
11564 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11566 int main() { xxx("foo"); }
11572 if eval $compile_ok; then
11573 if $run ./try; then
11574 echo "Your vsprintf() returns (int)." >&4
11577 echo "Your vsprintf() returns (char*)." >&4
11581 echo 'I am unable to compile the vsprintf() test program.' >&4
11582 # We shouldn't get here. If we do, assume the standard signature,
11583 # not the old BSD one.
11584 echo 'Guessing that vsprintf() returns (int).' >&4
11588 echo 'vprintf() NOT found.' >&4
11599 : see if chown exists
11603 : see if chroot exists
11604 set chroot d_chroot
11607 : see if chsize exists
11608 set chsize d_chsize
11611 : see if class exists
11615 : see if clearenv exists
11616 set clearenv d_clearenv
11619 : Define hasstruct macro for Configure internal use
11620 hasstruct='varname=$1; struct=$2; shift; shift;
11621 while $test $# -ge 2; do
11623 $define) echo "#include <$2>";;
11627 echo "int main () { struct $struct foo; }" >> try.c;
11629 if eval $compile; then
11638 : see whether socket exists
11642 $echo $n "Hmm... $c" >&4
11643 if set socket val -f d_socket; eval $csym; $val; then
11644 echo "Looks like you have Berkeley networking support." >&4
11646 if set setsockopt val -f; eval $csym; $val; then
11649 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11650 d_oldsock="$define"
11653 if $contains socklib libc.list >/dev/null 2>&1; then
11654 echo "Looks like you have Berkeley networking support." >&4
11656 : we will have to assume that it supports the 4.2 BSD interface
11659 echo "You don't have Berkeley networking in libc$_a..." >&4
11660 if test "X$d_socket" = "X$define"; then
11661 echo "...but you seem to believe that you have sockets." >&4
11663 for net in net socket
11665 if test -f $sysroot/usr/lib/lib$net$_a; then
11666 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11667 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11668 if $contains socket libc.list >/dev/null 2>&1; then
11673 echo "...but the Wollongong group seems to have hacked it in." >&4
11674 sockethdr="-I$sysroot/usr/netinclude"
11677 echo "Found Berkeley sockets interface in lib$net." >&4
11678 if $contains setsockopt libc.list >/dev/null 2>&1; then
11681 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11682 d_oldsock="$define"
11688 if test "X$d_socket" != "X$define"; then
11689 echo "or anywhere else I see." >&4
11697 : see if socketpair exists
11698 set socketpair d_sockpair
11703 echo "Checking the availability sa_len in the sock struct ..." >&4
11705 #include <sys/types.h>
11706 #include <sys/socket.h>
11708 struct sockaddr sa;
11709 return (sa.sa_len);
11713 set try; if eval $compile; then
11716 set d_sockaddr_sa_len; eval $setvar
11720 echo "Checking the availability struct sockaddr_in6 ..." >&4
11722 #include <sys/types.h>
11723 #include <sys/socket.h>
11724 #include <netinet/in.h>
11726 struct sockaddr_in6 sin6;
11727 return (sin6.sin6_family);
11731 set try; if eval $compile; then
11734 set d_sockaddr_in6; eval $setvar
11738 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11740 #include <sys/types.h>
11741 #include <sys/socket.h>
11742 #include <netinet/in.h>
11744 struct sockaddr_in6 sin6;
11745 return (sin6.sin6_scope_id);
11749 set try; if eval $compile; then
11752 set d_sin6_scope_id; eval $setvar
11756 echo "Checking the availability struct ip_mreq ..." >&4
11758 #include <sys/types.h>
11759 #include <sys/socket.h>
11760 #include <netinet/in.h>
11762 struct ip_mreq mreq;
11763 return (mreq.imr_multiaddr.s_addr);
11767 set try; if eval $compile; then
11770 set d_ip_mreq; eval $setvar
11774 echo "Checking the availability struct ip_mreq_source ..." >&4
11776 #include <sys/types.h>
11777 #include <sys/socket.h>
11778 #include <netinet/in.h>
11780 struct ip_mreq_source mreq;
11781 return (mreq.imr_multiaddr.s_addr);
11785 set try; if eval $compile; then
11788 set d_ip_mreq_source; eval $setvar
11792 echo "Checking the availability struct ipv6_mreq ..." >&4
11794 #include <sys/types.h>
11795 #include <sys/socket.h>
11796 #include <netinet/in.h>
11798 struct ipv6_mreq mreq;
11799 return (mreq.ipv6mr_interface);
11803 set try; if eval $compile; then
11806 set d_ipv6_mreq; eval $setvar
11810 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11812 #include <sys/types.h>
11813 #include <sys/socket.h>
11814 #include <netinet/in.h>
11816 struct ipv6_mreq_source mreq;
11817 return (mreq.imr_multiaddr.s_addr);
11821 set try; if eval $compile; then
11824 set d_ipv6_mreq_source; eval $setvar
11828 echo "Checking the availability of certain socket constants..." >&4
11829 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11830 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11832 #include <sys/types.h>
11833 #include <sys/socket.h>
11839 set try; if eval $compile; then
11842 set d_${enum}; eval $setvar
11846 : see if this is a sys/uio.h system
11847 set sys/uio.h i_sysuio
11850 : Check for cmsghdr support
11852 echo "Checking to see if your system supports struct cmsghdr..." >&4
11853 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11855 case "$d_cmsghdr_s" in
11856 "$define") echo "Yes, it does." ;;
11857 *) echo "No, it doesn't." ;;
11861 : check for const keyword
11863 echo 'Checking to see if your C compiler knows about "const"...' >&4
11864 $cat >const.c <<'EOCP'
11865 typedef struct spug { int drokk; } spug;
11869 const spug y = { 0 };
11872 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11874 echo "Yup, it does."
11877 echo "Nope, it doesn't."
11882 : see if copysignl exists
11883 set copysignl d_copysignl
11886 : see if crypt exists
11891 $define) cryptlib='' ;;
11892 *) if set crypt val -f d_crypt; eval $csym; $val; then
11893 echo 'crypt() found.' >&4
11897 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11898 if $test -z "$cryptlib"; then
11899 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11903 if $test -z "$cryptlib"; then
11904 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11908 if $test -z "$cryptlib"; then
11909 cryptlib=`./loc libcrypt$_a "" $libpth`
11913 if $test -z "$cryptlib"; then
11914 echo 'crypt() NOT found.' >&4
11925 : see if this is a crypt.h system
11926 set crypt.h i_crypt
11929 : see if crypt_r exists
11930 set crypt_r d_crypt_r
11932 case "$d_crypt_r" in
11934 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11935 case "$d_crypt_r_proto:$usethreads" in
11936 ":define") d_crypt_r_proto=define
11937 set d_crypt_r_proto crypt_r $hdrs
11941 case "$d_crypt_r_proto" in
11943 case "$crypt_r_proto" in
11944 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11945 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11947 case "$crypt_r_proto" in
11948 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11949 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11951 case "$crypt_r_proto" in
11952 ''|0) d_crypt_r=undef
11954 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11955 * ) case "$crypt_r_proto" in
11956 REENTRANT_PROTO*) ;;
11957 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11959 echo "Prototype: $try" ;;
11962 *) case "$usethreads" in
11963 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11974 : get csh whereabouts
11976 'csh') val="$undef" ;;
11977 *) val="$define" ;;
11981 : Respect a hint or command line value for full_csh.
11982 case "$full_csh" in
11983 '') full_csh=$csh ;;
11986 : see if ctermid exists
11987 set ctermid d_ctermid
11990 : see if ctermid_r exists
11991 set ctermid_r d_ctermid_r
11993 case "$d_ctermid_r" in
11995 hdrs="$i_systypes sys/types.h define stdio.h "
11996 case "$d_ctermid_r_proto:$usethreads" in
11997 ":define") d_ctermid_r_proto=define
11998 set d_ctermid_r_proto ctermid_r $hdrs
12002 case "$d_ctermid_r_proto" in
12004 case "$ctermid_r_proto" in
12005 ''|0) try='char* ctermid_r(char*);'
12006 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12008 case "$ctermid_r_proto" in
12009 ''|0) d_ctermid_r=undef
12011 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12012 * ) case "$ctermid_r_proto" in
12013 REENTRANT_PROTO*) ;;
12014 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12016 echo "Prototype: $try" ;;
12019 *) case "$usethreads" in
12020 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12027 *) ctermid_r_proto=0
12031 : see if ctime_r exists
12032 set ctime_r d_ctime_r
12034 case "$d_ctime_r" in
12036 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12037 case "$d_ctime_r_proto:$usethreads" in
12038 ":define") d_ctime_r_proto=define
12039 set d_ctime_r_proto ctime_r $hdrs
12043 case "$d_ctime_r_proto" in
12045 case "$ctime_r_proto" in
12046 ''|0) try='char* ctime_r(const time_t*, char*);'
12047 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12049 case "$ctime_r_proto" in
12050 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12051 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12053 case "$ctime_r_proto" in
12054 ''|0) try='int ctime_r(const time_t*, char*);'
12055 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12057 case "$ctime_r_proto" in
12058 ''|0) try='int ctime_r(const time_t*, char*, int);'
12059 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12061 case "$ctime_r_proto" in
12062 ''|0) d_ctime_r=undef
12064 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12065 * ) case "$ctime_r_proto" in
12066 REENTRANT_PROTO*) ;;
12067 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12069 echo "Prototype: $try" ;;
12072 *) case "$usethreads" in
12073 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12084 : see if cuserid exists
12085 set cuserid d_cuserid
12088 : see if this is a limits.h system
12089 set limits.h i_limits
12092 : See if number of significant digits in a double precision number is known
12094 $cat >dbl_dig.c <<EOM
12095 #$i_limits I_LIMITS
12098 #include <limits.h>
12104 printf("Contains DBL_DIG");
12107 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12108 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12109 echo "DBL_DIG found." >&4
12112 echo "DBL_DIG NOT found." >&4
12119 : see if dbm.h is available
12120 : see if dbmclose exists
12121 set dbmclose d_dbmclose
12124 case "$d_dbmclose" in
12134 *) set rpcsvc/dbm.h i_rpcsvcdbm
12139 *) echo "We won't be including <dbm.h>"
12149 : see if prototype for dbminit is available
12151 set d_dbminitproto dbminit $i_dbm dbm.h
12154 : see if difftime exists
12155 set difftime d_difftime
12158 : see if this is a dirent system
12160 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12162 echo "<dirent.h> found." >&4
12165 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12166 echo "<sys/dir.h> found." >&4
12169 xinc=`./findhdr sys/ndir.h`
12171 echo "<dirent.h> NOT found." >&4
12176 : Look for type of directory structure.
12178 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12180 case "$direntrytype" in
12182 case "$i_dirent" in
12183 $define) guess1='struct dirent' ;;
12184 *) guess1='struct direct' ;;
12187 *) guess1="$direntrytype"
12192 'struct dirent') guess2='struct direct' ;;
12193 *) guess2='struct dirent' ;;
12196 if $contains "$guess1" try.c >/dev/null 2>&1; then
12197 direntrytype="$guess1"
12198 echo "Your directory entries are $direntrytype." >&4
12199 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12200 direntrytype="$guess2"
12201 echo "Your directory entries seem to be $direntrytype." >&4
12203 echo "I don't recognize your system's directory entries." >&4
12204 rp="What type is used for directory entries on this system?"
12207 direntrytype="$ans"
12211 : see if the directory entry stores field length
12213 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12214 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12215 echo "Good, your directory entry keeps length information in d_namlen." >&4
12218 echo "Your directory entry does not know about the d_namlen field." >&4
12225 : Look for DIR.dd_fd
12226 case "$i_dirent" in
12228 echo "Checking to see if DIR has a dd_fd member variable" >&4
12230 #$i_stdlib I_STDLIB
12232 #include <stdlib.h>
12234 #include <dirent.h>
12244 if eval $compile; then
12245 echo "Yes, it does."
12248 echo "No, it does not."
12253 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12261 : see if this is an sysdir system
12262 set sys/dir.h i_sysdir
12265 : see if this is an sysndir system
12266 set sys/ndir.h i_sysndir
12271 $cat >dirfd.c <<EOM
12273 #$i_stdlib I_STDLIB
12275 #include <stdlib.h>
12277 #$i_dirent I_DIRENT /**/
12278 #$i_sysdir I_SYS_DIR /**/
12279 #$i_sysndir I_SYS_NDIR /**/
12280 #$i_systypes I_SYS_TYPES /**/
12281 #if defined(I_SYS_TYPES)
12282 #include <sys/types.h>
12284 #if defined(I_DIRENT)
12285 #include <dirent.h>
12288 #include <sys/ndir.h>
12292 #include <ndir.h> /* may be wrong in the future */
12294 #include <sys/dir.h>
12300 DIR *dirp = opendir(".");
12301 if (dirfd(dirp) >= 0)
12309 if eval $compile; then
12313 $define) echo "dirfd() found." >&4 ;;
12314 *) echo "dirfd() NOT found." >&4 ;;
12320 : see if dladdr exists
12321 set dladdr d_dladdr
12324 : see if dlerror exists
12327 set dlerror d_dlerror
12331 : see if dlfcn is available
12332 set dlfcn.h i_dlfcn
12335 : Check what extension to use for shared libs
12340 On a few systems, the dynamically loaded modules that perl generates and uses
12341 will need a different extension than shared libs. The default will probably
12347 *) dflt="$dlext" ;;
12349 rp='What is the extension of dynamically loaded modules'
12358 : Check if dlsym need a leading underscore
12364 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12365 $cat >dyna.c <<'EOM'
12372 #$i_stdlib I_STDLIB
12374 #include <stdlib.h>
12378 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12380 #include <sys/types.h>
12385 extern int fred() ;
12394 int mode = RTLD_LAZY ;
12396 handle = dlopen("./dyna.$dlext", mode) ;
12397 if (handle == NULL) {
12402 symbol = dlsym(handle, "fred") ;
12403 if (symbol == NULL) {
12404 /* try putting a leading underscore */
12405 symbol = dlsym(handle, "_fred") ;
12406 if (symbol == NULL) {
12419 : Call the object file tmp-dyna.o in case dlext=o.
12420 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12421 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12422 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12423 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12426 1) echo "Test program failed using dlopen." >&4
12427 echo "Perhaps you should not use dynamic loading." >&4;;
12428 2) echo "Test program failed using dlsym." >&4
12429 echo "Perhaps you should not use dynamic loading." >&4;;
12430 3) echo "dlsym needs a leading underscore" >&4
12432 4) echo "dlsym doesn't need a leading underscore." >&4;;
12435 echo "I can't compile and run the test program." >&4
12436 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12441 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12446 : see if drand48_r exists
12447 set drand48_r d_drand48_r
12449 case "$d_drand48_r" in
12451 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12452 case "$d_drand48_r_proto:$usethreads" in
12453 ":define") d_drand48_r_proto=define
12454 set d_drand48_r_proto drand48_r $hdrs
12458 case "$d_drand48_r_proto" in
12460 case "$drand48_r_proto" in
12461 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12462 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12464 case "$drand48_r_proto" in
12465 ''|0) d_drand48_r=undef
12467 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12468 * ) case "$drand48_r_proto" in
12469 REENTRANT_PROTO*) ;;
12470 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12472 echo "Prototype: $try" ;;
12475 *) case "$usethreads" in
12476 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12483 *) drand48_r_proto=0
12487 : see if prototype for drand48 is available
12489 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12492 : see if dup2 exists
12496 : see if eaccess exists
12497 set eaccess d_eaccess
12500 : see if endgrent exists
12501 set endgrent d_endgrent
12504 : see if this is an grp system
12510 xxx=`./findhdr grp.h`
12511 $cppstdin $cppflags $cppminus < $xxx >$$.h
12513 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12525 set d_grpasswd; eval $setvar
12529 : see if endgrent_r exists
12530 set endgrent_r d_endgrent_r
12532 case "$d_endgrent_r" in
12534 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12535 case "$d_endgrent_r_proto:$usethreads" in
12536 ":define") d_endgrent_r_proto=define
12537 set d_endgrent_r_proto endgrent_r $hdrs
12541 case "$d_endgrent_r_proto" in
12543 case "$endgrent_r_proto" in
12544 ''|0) try='int endgrent_r(FILE**);'
12545 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12547 case "$endgrent_r_proto" in
12548 ''|0) try='void endgrent_r(FILE**);'
12549 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12551 case "$endgrent_r_proto" in
12552 ''|0) d_endgrent_r=undef
12554 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12555 * ) case "$endgrent_r_proto" in
12556 REENTRANT_PROTO*) ;;
12557 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12559 echo "Prototype: $try" ;;
12562 *) case "$usethreads" in
12563 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12570 *) endgrent_r_proto=0
12574 : see if endhostent exists
12575 set endhostent d_endhent
12578 : see if this is a netdb.h system
12579 set netdb.h i_netdb
12582 : see if endhostent_r exists
12583 set endhostent_r d_endhostent_r
12585 case "$d_endhostent_r" in
12587 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12588 case "$d_endhostent_r_proto:$usethreads" in
12589 ":define") d_endhostent_r_proto=define
12590 set d_endhostent_r_proto endhostent_r $hdrs
12594 case "$d_endhostent_r_proto" in
12596 case "$endhostent_r_proto" in
12597 ''|0) try='int endhostent_r(struct hostent_data*);'
12598 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12600 case "$endhostent_r_proto" in
12601 ''|0) try='void endhostent_r(struct hostent_data*);'
12602 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12604 case "$endhostent_r_proto" in
12605 ''|0) d_endhostent_r=undef
12606 endhostent_r_proto=0
12607 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12608 * ) case "$endhostent_r_proto" in
12609 REENTRANT_PROTO*) ;;
12610 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12612 echo "Prototype: $try" ;;
12615 *) case "$usethreads" in
12616 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12618 d_endhostent_r=undef
12619 endhostent_r_proto=0
12623 *) endhostent_r_proto=0
12627 : see if endnetent exists
12628 set endnetent d_endnent
12631 : see if endnetent_r exists
12632 set endnetent_r d_endnetent_r
12634 case "$d_endnetent_r" in
12636 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12637 case "$d_endnetent_r_proto:$usethreads" in
12638 ":define") d_endnetent_r_proto=define
12639 set d_endnetent_r_proto endnetent_r $hdrs
12643 case "$d_endnetent_r_proto" in
12645 case "$endnetent_r_proto" in
12646 ''|0) try='int endnetent_r(struct netent_data*);'
12647 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12649 case "$endnetent_r_proto" in
12650 ''|0) try='void endnetent_r(struct netent_data*);'
12651 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12653 case "$endnetent_r_proto" in
12654 ''|0) d_endnetent_r=undef
12655 endnetent_r_proto=0
12656 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12657 * ) case "$endnetent_r_proto" in
12658 REENTRANT_PROTO*) ;;
12659 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12661 echo "Prototype: $try" ;;
12664 *) case "$usethreads" in
12665 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12667 d_endnetent_r=undef
12668 endnetent_r_proto=0
12672 *) endnetent_r_proto=0
12676 : see if endprotoent exists
12677 set endprotoent d_endpent
12680 : see if endprotoent_r exists
12681 set endprotoent_r d_endprotoent_r
12683 case "$d_endprotoent_r" in
12685 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12686 case "$d_endprotoent_r_proto:$usethreads" in
12687 ":define") d_endprotoent_r_proto=define
12688 set d_endprotoent_r_proto endprotoent_r $hdrs
12692 case "$d_endprotoent_r_proto" in
12694 case "$endprotoent_r_proto" in
12695 ''|0) try='int endprotoent_r(struct protoent_data*);'
12696 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12698 case "$endprotoent_r_proto" in
12699 ''|0) try='void endprotoent_r(struct protoent_data*);'
12700 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12702 case "$endprotoent_r_proto" in
12703 ''|0) d_endprotoent_r=undef
12704 endprotoent_r_proto=0
12705 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12706 * ) case "$endprotoent_r_proto" in
12707 REENTRANT_PROTO*) ;;
12708 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12710 echo "Prototype: $try" ;;
12713 *) case "$usethreads" in
12714 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12716 d_endprotoent_r=undef
12717 endprotoent_r_proto=0
12721 *) endprotoent_r_proto=0
12725 : see if endpwent exists
12726 set endpwent d_endpwent
12729 : see if this is a pwd.h system
12735 xxx=`./findhdr pwd.h`
12736 $cppstdin $cppflags $cppminus < $xxx >$$.h
12738 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12746 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12754 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12762 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12770 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12778 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12786 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12794 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12806 set d_pwquota; eval $setvar
12807 set d_pwage; eval $setvar
12808 set d_pwchange; eval $setvar
12809 set d_pwclass; eval $setvar
12810 set d_pwexpire; eval $setvar
12811 set d_pwcomment; eval $setvar
12812 set d_pwgecos; eval $setvar
12813 set d_pwpasswd; eval $setvar
12817 : see if endpwent_r exists
12818 set endpwent_r d_endpwent_r
12820 case "$d_endpwent_r" in
12822 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12823 case "$d_endpwent_r_proto:$usethreads" in
12824 ":define") d_endpwent_r_proto=define
12825 set d_endpwent_r_proto endpwent_r $hdrs
12829 case "$d_endpwent_r_proto" in
12831 case "$endpwent_r_proto" in
12832 ''|0) try='int endpwent_r(FILE**);'
12833 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12835 case "$endpwent_r_proto" in
12836 ''|0) try='void endpwent_r(FILE**);'
12837 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12839 case "$endpwent_r_proto" in
12840 ''|0) d_endpwent_r=undef
12842 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12843 * ) case "$endpwent_r_proto" in
12844 REENTRANT_PROTO*) ;;
12845 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12847 echo "Prototype: $try" ;;
12850 *) case "$usethreads" in
12851 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12858 *) endpwent_r_proto=0
12862 : see if endservent exists
12863 set endservent d_endsent
12866 : see if endservent_r exists
12867 set endservent_r d_endservent_r
12869 case "$d_endservent_r" in
12871 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12872 case "$d_endservent_r_proto:$usethreads" in
12873 ":define") d_endservent_r_proto=define
12874 set d_endservent_r_proto endservent_r $hdrs
12878 case "$d_endservent_r_proto" in
12880 case "$endservent_r_proto" in
12881 ''|0) try='int endservent_r(struct servent_data*);'
12882 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12884 case "$endservent_r_proto" in
12885 ''|0) try='void endservent_r(struct servent_data*);'
12886 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12888 case "$endservent_r_proto" in
12889 ''|0) d_endservent_r=undef
12890 endservent_r_proto=0
12891 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12892 * ) case "$endservent_r_proto" in
12893 REENTRANT_PROTO*) ;;
12894 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12896 echo "Prototype: $try" ;;
12899 *) case "$usethreads" in
12900 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12902 d_endservent_r=undef
12903 endservent_r_proto=0
12907 *) endservent_r_proto=0
12911 : Locate the flags for 'open()'
12914 #include <sys/types.h>
12919 #include <sys/file.h>
12921 #$i_stdlib I_STDLIB
12923 #include <stdlib.h>
12934 : check sys/file.h first to get FREAD on Sun
12935 if $test `./findhdr sys/file.h` && \
12936 set try -DI_SYS_FILE && eval $compile; then
12938 echo "<sys/file.h> defines the O_* constants..." >&4
12939 if $run ./try; then
12940 echo "and you have the 3 argument form of open()." >&4
12943 echo "but not the 3 argument form of open(). Oh, well." >&4
12946 elif $test `./findhdr fcntl.h` && \
12947 set try -DI_FCNTL && eval $compile; then
12949 echo "<fcntl.h> defines the O_* constants..." >&4
12950 if $run ./try; then
12951 echo "and you have the 3 argument form of open()." >&4
12954 echo "but not the 3 argument form of open(). Oh, well." >&4
12959 echo "I can't find the O_* constant definitions! You got problems." >&4
12965 : see if this is a sys/file.h system
12970 : do we need to include sys/file.h ?
12974 if $h_sysfile; then
12976 echo "We'll be including <sys/file.h>." >&4
12979 echo "We won't be including <sys/file.h>." >&4
12989 : see if fcntl.h is there
12994 : see if we can include fcntl.h
13000 echo "We'll be including <fcntl.h>." >&4
13003 if $h_sysfile; then
13004 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13006 echo "We won't be including <fcntl.h>." >&4
13018 : see if fork exists
13022 : see if pipe exists
13026 : check for non-blocking I/O stuff
13027 case "$h_sysfile" in
13028 true) echo "#include <sys/file.h>" > head.c;;
13031 true) echo "#include <fcntl.h>" > head.c;;
13032 *) echo "#include <sys/fcntl.h>" > head.c;;
13037 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13038 case "$o_nonblock" in
13040 $cat head.c > try.c
13041 $cat >>try.c <<EOCP
13043 #$i_stdlib I_STDLIB
13045 #include <stdlib.h>
13053 printf("O_NONBLOCK\n");
13057 printf("O_NDELAY\n");
13061 printf("FNDELAY\n");
13068 if eval $compile_ok; then
13069 o_nonblock=`$run ./try`
13070 case "$o_nonblock" in
13071 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13072 *) echo "Seems like we can use $o_nonblock.";;
13075 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13078 *) echo "Using $hint value $o_nonblock.";;
13083 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13086 case "$d_fork:$d_pipe" in
13088 $cat head.c > try.c
13089 $cat >>try.c <<EOCP
13091 #include <sys/types.h>
13092 #include <signal.h>
13094 #$i_stdlib I_STDLIB
13096 #include <stdlib.h>
13102 #define MY_O_NONBLOCK $o_nonblock
13103 #ifndef errno /* XXX need better Configure test */
13106 #$i_unistd I_UNISTD
13108 #include <unistd.h>
13110 #$i_string I_STRING
13112 #include <string.h>
13114 #include <strings.h>
13116 $signal_t blech(int x) { exit(3); }
13118 $cat >> try.c <<'EOCP'
13127 ret = pipe(pd); /* Down: child -> parent */
13130 ret = pipe(pu); /* Up: parent -> child */
13134 close(pd[1]); /* Parent reads from pd[0] */
13135 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13137 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13142 signal(SIGALRM, blech);
13144 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13146 sprintf(string, "%d\n", ret);
13147 ret = write(2, string, strlen(string));
13148 if (ret != strlen(string))
13152 if (errno == EAGAIN) {
13153 printf("EAGAIN\n");
13158 if (errno == EWOULDBLOCK)
13159 printf("EWOULDBLOCK\n");
13162 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13165 sleep(2); /* Give it time to close our pipe */
13167 ret = read(pd[0], buf, 1); /* Should read EOF */
13169 sprintf(string, "%d\n", ret);
13170 ret = write(4, string, strlen(string));
13171 if (ret != strlen(string))
13176 close(pd[0]); /* We write to pd[1] */
13177 close(pu[1]); /* We read from pu[0] */
13178 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13181 close(pd[1]); /* Pipe pd is now fully closed! */
13182 exit(0); /* Bye bye, thank you for playing! */
13186 if eval $compile_ok; then
13187 echo "$startsh" >mtry
13188 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13190 $run ./mtry >/dev/null 2>&1
13192 0) eagain=`$cat try.out`;;
13193 1) echo "Could not perform non-blocking setting!";;
13194 2) echo "I did a successful read() for something that was not there!";;
13195 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13196 4) echo "Could not find F_SETFL!";;
13197 *) echo "Something terribly wrong happened during testing.";;
13199 rd_nodata=`$cat try.ret`
13200 echo "A read() system call with no data present returns $rd_nodata."
13201 case "$rd_nodata" in
13204 echo "(That's peculiar, fixing that to be -1.)"
13210 echo "Forcing errno EAGAIN on read() with no data available."
13214 echo "Your read() sets errno to $eagain when no data is available."
13217 status=`$cat try.err`
13219 0) echo "And it correctly returns 0 to signal EOF.";;
13220 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13221 *) echo "However, your read() returns '$status' on EOF??";;
13224 if test "$status" = "$rd_nodata"; then
13225 echo "WARNING: you can't distinguish between EOF and no data!"
13229 echo "I can't compile the test program--assuming errno EAGAIN will do."
13233 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13242 echo "Using $hint value $eagain."
13243 echo "Your read() returns $rd_nodata when no data is present."
13244 case "$d_eofnblk" in
13245 "$define") echo "And you can see EOF because read() returns 0.";;
13246 "$undef") echo "But you can't see EOF status from read() returned value.";;
13248 echo "(Assuming you can't see EOF status from read anyway.)"
13254 $rm_try head.c mtry
13256 : see if _ptr and _cnt from stdio act std
13259 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13260 echo "(Looks like you have stdio.h from BSD.)"
13261 case "$stdio_ptr" in
13262 '') stdio_ptr='((fp)->_p)'
13265 *) ptr_lval=$d_stdio_ptr_lval;;
13267 case "$stdio_cnt" in
13268 '') stdio_cnt='((fp)->_r)'
13271 *) cnt_lval=$d_stdio_cnt_lval;;
13273 case "$stdio_base" in
13274 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13276 case "$stdio_bufsiz" in
13277 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13279 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13280 echo "(Looks like you have stdio.h from Linux.)"
13281 case "$stdio_ptr" in
13282 '') stdio_ptr='((fp)->_IO_read_ptr)'
13285 *) ptr_lval=$d_stdio_ptr_lval;;
13287 case "$stdio_cnt" in
13288 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13291 *) cnt_lval=$d_stdio_cnt_lval;;
13293 case "$stdio_base" in
13294 '') stdio_base='((fp)->_IO_read_base)';;
13296 case "$stdio_bufsiz" in
13297 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13300 case "$stdio_ptr" in
13301 '') stdio_ptr='((fp)->_ptr)'
13304 *) ptr_lval=$d_stdio_ptr_lval;;
13306 case "$stdio_cnt" in
13307 '') stdio_cnt='((fp)->_cnt)'
13310 *) cnt_lval=$d_stdio_cnt_lval;;
13312 case "$stdio_base" in
13313 '') stdio_base='((fp)->_base)';;
13315 case "$stdio_bufsiz" in
13316 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13320 : test whether _ptr and _cnt really work
13321 echo "Checking how std your stdio is..." >&4
13324 #$i_stdlib I_STDLIB
13326 #include <stdlib.h>
13328 #define FILE_ptr(fp) $stdio_ptr
13329 #define FILE_cnt(fp) $stdio_cnt
13331 FILE *fp = fopen("try.c", "r");
13334 18 <= FILE_cnt(fp) &&
13335 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13343 if eval $compile && $to try.c; then
13344 if $run ./try; then
13345 echo "Your stdio acts pretty std."
13348 echo "Your stdio isn't very std."
13351 echo "Your stdio doesn't appear very std."
13355 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13356 # direct buffer manipulation no longer works. The Configure tests
13357 # should be changed to correctly detect this, but until then,
13358 # the following check should at least let perl compile and run.
13359 # (This quick fix should be updated before 5.8.1.)
13360 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13361 # A. Dougherty, June 3, 2002.
13362 case "$d_gnulibc" in
13364 case "$gnulibc_version" in
13368 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13377 : Can _ptr be used as an lvalue?
13378 case "$d_stdstdio$ptr_lval" in
13379 $define$define) val=$define ;;
13382 set d_stdio_ptr_lval
13385 : Can _cnt be used as an lvalue?
13386 case "$d_stdstdio$cnt_lval" in
13387 $define$define) val=$define ;;
13390 set d_stdio_cnt_lval
13394 : test whether setting _ptr sets _cnt as a side effect
13395 d_stdio_ptr_lval_sets_cnt="$undef"
13396 d_stdio_ptr_lval_nochange_cnt="$undef"
13397 case "$d_stdio_ptr_lval$d_stdstdio" in
13399 echo "Checking to see what happens if we set the stdio ptr..." >&4
13402 /* Can we scream? */
13403 /* Eat dust sed :-) */
13404 /* In the buffer space, no one can hear you scream. */
13405 #$i_stdlib I_STDLIB
13407 #include <stdlib.h>
13409 #define FILE_ptr(fp) $stdio_ptr
13410 #define FILE_cnt(fp) $stdio_cnt
13411 #include <sys/types.h>
13413 FILE *fp = fopen("try.c", "r");
13418 puts("Fail even to read");
13421 c = getc(fp); /* Read away the first # */
13423 puts("Fail even to read");
13427 18 <= FILE_cnt(fp) &&
13428 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13430 puts("Fail even to read");
13433 ptr = (char*) FILE_ptr(fp);
13434 cnt = (size_t)FILE_cnt(fp);
13436 FILE_ptr(fp) += 42;
13438 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13439 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13442 if (FILE_cnt(fp) <= 20) {
13443 printf ("Fail (<20 chars to test)");
13446 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13447 puts("Fail compare");
13450 if (cnt == FILE_cnt(fp)) {
13451 puts("Pass_unchanged");
13454 if (FILE_cnt(fp) == (cnt - 42)) {
13455 puts("Pass_changed");
13458 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13464 if eval $compile && $to try.c; then
13465 case `$run ./try` in
13467 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13468 d_stdio_ptr_lval_sets_cnt="$define" ;;
13470 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13471 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13473 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13475 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13478 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13484 : see if _base is also standard
13486 case "$d_stdstdio" in
13490 #$i_stdlib I_STDLIB
13492 #include <stdlib.h>
13494 #define FILE_base(fp) $stdio_base
13495 #define FILE_bufsiz(fp) $stdio_bufsiz
13497 FILE *fp = fopen("try.c", "r");
13500 19 <= FILE_bufsiz(fp) &&
13501 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13508 if eval $compile && $to try.c; then
13509 if $run ./try; then
13510 echo "And its _base field acts std."
13513 echo "But its _base field isn't std."
13516 echo "However, it seems to be lacking the _base field."
13524 : see if fast_stdio exists
13526 case "$d_stdstdio:$d_stdio_ptr_lval" in
13528 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13530 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13541 : see if fchdir exists
13542 set fchdir d_fchdir
13545 : see if fchmod exists
13546 set fchmod d_fchmod
13549 : see if fchown exists
13550 set fchown d_fchown
13553 : see if this is an fcntl system
13557 : See if fcntl-based locking works.
13560 #$i_stdlib I_STDLIB
13562 #include <stdlib.h>
13564 #include <unistd.h>
13566 #include <signal.h>
13567 $signal_t blech(int x) { exit(3); }
13569 #if defined(F_SETLK) && defined(F_SETLKW)
13570 struct flock flock;
13572 fd = open("try.c", O_RDONLY);
13573 flock.l_type = F_RDLCK;
13574 flock.l_whence = SEEK_SET;
13575 flock.l_start = flock.l_len = 0;
13576 signal(SIGALRM, blech);
13578 retval = fcntl(fd, F_SETLK, &flock);
13580 (retval < 0 ? exit(2) : exit(0));
13586 echo "Checking if fcntl-based file locking works... "
13590 if eval $compile_ok; then
13591 if $run ./try; then
13592 echo "Yes, it seems to work."
13595 echo "Nope, it didn't work."
13600 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13601 *** This is (almost) impossible.
13602 *** If your NFS lock daemons are not feeling well, something like
13603 *** this may happen, please investigate. Cannot continue, aborting.
13611 echo "I'm unable to compile the test program, so I'll assume not."
13616 echo "Nope, since you don't even have fcntl()."
13619 set d_fcntl_can_lock
13623 : check for fd_set items
13626 Checking to see how well your C compiler handles fd_set and friends ...
13629 #$i_stdlib I_STDLIB
13631 #include <stdlib.h>
13633 #$i_systime I_SYS_TIME
13634 #$i_sysselct I_SYS_SELECT
13635 #$d_socket HAS_SOCKET
13636 #include <sys/types.h>
13638 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13641 #include <sys/time.h>
13643 #ifdef I_SYS_SELECT
13644 #include <sys/select.h>
13653 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13661 if eval $compile; then
13662 d_fds_bits="$define"
13664 echo "Well, your system knows about the normal fd_set typedef..." >&4
13665 if $run ./try; then
13666 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13667 d_fd_macros="$define"
13670 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13672 d_fd_macros="$undef"
13676 Hmm, your compiler has some difficulty with fd_set. Checking further...
13679 if eval $compile; then
13680 d_fds_bits="$undef"
13682 echo "Well, your system has some sort of fd_set available..." >&4
13683 if $run ./try; then
13684 echo "and you have the normal fd_set macros." >&4
13685 d_fd_macros="$define"
13688 but not the normal fd_set macros! Gross! More work for me...
13690 d_fd_macros="$undef"
13693 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13695 d_fds_bits="$undef"
13696 d_fd_macros="$undef"
13701 : see if fegetround exists
13702 set fegetround d_fegetround
13705 : see if fgetpos exists
13706 set fgetpos d_fgetpos
13709 : see if finite exists
13710 set finite d_finite
13713 : see if finitel exists
13714 set finitel d_finitel
13717 : see if flock exists
13721 : see if prototype for flock is available
13723 set d_flockproto flock $i_sysfile sys/file.h
13726 : see if fp_class exists
13727 set fp_class d_fp_class
13730 : see if this is a math.h system
13734 : check for fpclassify
13735 echo "Checking to see if you have fpclassify..." >&4
13741 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13744 if eval $compile; then
13746 echo "You have fpclassify."
13749 echo "You do not have fpclassify."
13755 : see if fp_classify exists
13756 set fp_classify d_fp_classify
13759 : see if fp_classl exists
13760 set fp_classl d_fp_classl
13763 : see if pathconf exists
13764 set pathconf d_pathconf
13767 : see if fpathconf exists
13768 set fpathconf d_fpathconf
13771 : see if fpclass exists
13772 set fpclass d_fpclass
13775 : see if fpclassl exists
13776 set fpclassl d_fpclassl
13779 : see if fpgetround exists
13780 set fpgetround d_fpgetround
13783 : check for fpos64_t
13785 echo "Checking to see if you have fpos64_t..." >&4
13788 int main() { fpos64_t x = 7; }
13791 if eval $compile; then
13793 echo "You have fpos64_t."
13796 echo "You do not have fpos64_t."
13797 case "$fpossize" in
13798 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13805 : see if frexpl exists
13806 set frexpl d_frexpl
13809 : see if this is a sys/param system
13810 set sys/param.h i_sysparam
13813 : see if this is a sys/mount.h system
13814 set sys/mount.h i_sysmount
13817 : Check for fs_data_s
13819 echo "Checking to see if your system supports struct fs_data..." >&4
13820 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13822 case "$d_fs_data_s" in
13823 "$define") echo "Yes, it does." ;;
13824 *) echo "No, it doesn't." ;;
13827 : see if fseeko exists
13828 set fseeko d_fseeko
13830 case "$longsize" in
13831 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13834 : see if fsetpos exists
13835 set fsetpos d_fsetpos
13838 : see if fstatfs exists
13839 set fstatfs d_fstatfs
13842 : see if statvfs exists
13843 set statvfs d_statvfs
13846 : see if fstatvfs exists
13847 set fstatvfs d_fstatvfs
13851 : see if fsync exists
13855 : see if ftello exists
13856 set ftello d_ftello
13858 case "$longsize" in
13859 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13862 : check for a working futimes
13865 echo "Checking if you have a working futimes()" >&4
13868 #include <sys/time.h>
13875 fd = open ("try.c", O_RDWR);
13876 if (-1 == fd) exit (1);
13877 rv = futimes (fd, NULL);
13878 exit (rv == -1 ? errno : 0);
13882 if eval $compile; then
13886 0) echo "Yes, you have" >&4
13887 d_futimes="$define"
13889 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13893 echo "No, it does not (probably harmless)" >&4
13897 : see if ndbm.h is available
13900 : Compatibility location for RedHat 7.1
13901 set gdbm/ndbm.h i_gdbmndbm
13903 : Compatibility location for Debian 4.0
13904 set gdbm-ndbm.h i_gdbm_ndbm
13908 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13909 : see if dbm_open exists
13910 set dbm_open d_dbm_open
13912 case "$d_dbm_open" in
13915 i_gdbmndbm="$undef"
13916 i_gdbm_ndbm="$undef"
13917 echo "We won't be including <ndbm.h>"
13927 ndbm_hdr_protochk='name=$1; hdr=$2;
13928 eval "ihdr=\$""i_$name";
13930 if $test "$ihdr" = "$define"; then
13931 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13932 case "$d_cplusplus" in
13933 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13934 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13937 $define) $echo "Your <$hdr> seems to have prototypes";;
13938 *) $echo "Your <$hdr> does not seem to have prototypes";;
13941 set "d_${name}_h_uses_prototypes";
13945 eval $ndbm_hdr_protochk
13946 set gdbmndbm gdbm/ndbm.h
13947 eval $ndbm_hdr_protochk
13948 set gdbm_ndbm gdbm-ndbm.h
13949 eval $ndbm_hdr_protochk
13951 : see if getaddrinfo exists
13952 set getaddrinfo d_getaddrinfo
13955 : see if getcwd exists
13956 set getcwd d_getcwd
13959 : see if getespwnam exists
13960 set getespwnam d_getespwnam
13963 : see if getfsstat exists
13964 set getfsstat d_getfsstat
13967 : see if getgrent exists
13968 set getgrent d_getgrent
13971 : see if getgrent_r exists
13972 set getgrent_r d_getgrent_r
13974 case "$d_getgrent_r" in
13976 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13977 case "$d_getgrent_r_proto:$usethreads" in
13978 ":define") d_getgrent_r_proto=define
13979 set d_getgrent_r_proto getgrent_r $hdrs
13983 case "$d_getgrent_r_proto" in
13985 case "$getgrent_r_proto" in
13986 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13987 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13989 case "$getgrent_r_proto" in
13990 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13991 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13993 case "$getgrent_r_proto" in
13994 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13995 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13997 case "$getgrent_r_proto" in
13998 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13999 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14001 case "$getgrent_r_proto" in
14002 ''|0) try='int getgrent_r(struct group*, char*, int);'
14003 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14005 case "$getgrent_r_proto" in
14006 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14007 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14009 case "$getgrent_r_proto" in
14010 ''|0) d_getgrent_r=undef
14012 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14013 * ) case "$getgrent_r_proto" in
14014 REENTRANT_PROTO*) ;;
14015 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14017 echo "Prototype: $try" ;;
14020 *) case "$usethreads" in
14021 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14028 *) getgrent_r_proto=0
14032 : see if getgrgid_r exists
14033 set getgrgid_r d_getgrgid_r
14035 case "$d_getgrgid_r" in
14037 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14038 case "$d_getgrgid_r_proto:$usethreads" in
14039 ":define") d_getgrgid_r_proto=define
14040 set d_getgrgid_r_proto getgrgid_r $hdrs
14044 case "$d_getgrgid_r_proto" in
14046 case "$getgrgid_r_proto" in
14047 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14048 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14050 case "$getgrgid_r_proto" in
14051 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14052 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14054 case "$getgrgid_r_proto" in
14055 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14056 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14058 case "$getgrgid_r_proto" in
14059 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14060 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14062 case "$getgrgid_r_proto" in
14063 ''|0) d_getgrgid_r=undef
14065 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14066 * ) case "$getgrgid_r_proto" in
14067 REENTRANT_PROTO*) ;;
14068 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14070 echo "Prototype: $try" ;;
14073 *) case "$usethreads" in
14074 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14081 *) getgrgid_r_proto=0
14085 : see if getgrnam_r exists
14086 set getgrnam_r d_getgrnam_r
14088 case "$d_getgrnam_r" in
14090 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14091 case "$d_getgrnam_r_proto:$usethreads" in
14092 ":define") d_getgrnam_r_proto=define
14093 set d_getgrnam_r_proto getgrnam_r $hdrs
14097 case "$d_getgrnam_r_proto" in
14099 case "$getgrnam_r_proto" in
14100 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14101 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14103 case "$getgrnam_r_proto" in
14104 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14105 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14107 case "$getgrnam_r_proto" in
14108 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14109 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14111 case "$getgrnam_r_proto" in
14112 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14113 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14115 case "$getgrnam_r_proto" in
14116 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14117 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14119 case "$getgrnam_r_proto" in
14120 ''|0) d_getgrnam_r=undef
14122 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14123 * ) case "$getgrnam_r_proto" in
14124 REENTRANT_PROTO*) ;;
14125 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14127 echo "Prototype: $try" ;;
14130 *) case "$usethreads" in
14131 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14138 *) getgrnam_r_proto=0
14142 : see if gethostbyaddr exists
14143 set gethostbyaddr d_gethbyaddr
14146 : see if gethostbyname exists
14147 set gethostbyname d_gethbyname
14150 : see if gethostent exists
14151 set gethostent d_gethent
14154 : see how we will look up host name
14157 if set gethostname val -f d_gethname; eval $csym; $val; then
14158 echo 'gethostname() found.' >&4
14159 d_gethname="$define"
14162 if set uname val -f d_uname; eval $csym; $val; then
14165 uname() was found, but you're running xenix, and older versions of xenix
14166 have a broken uname(). If you don't really know whether your xenix is old
14167 enough to have a broken system call, use the default answer.
14172 "$define") dflt=n;;
14174 rp='Is your uname() broken?'
14177 n*) d_uname="$define"; call=uname;;
14180 echo 'uname() found.' >&4
14187 case "$d_gethname" in
14188 '') d_gethname="$undef";;
14191 '') d_uname="$undef";;
14193 case "$d_uname$d_gethname" in
14198 Every now and then someone has a $call() that lies about the hostname
14199 but can't be fixed for political or economic reasons. If you wish, I can
14200 pretend $call() isn't there and maybe compute hostname at run-time
14201 thanks to the '$phostname' command.
14204 rp="Shall I ignore $call() from now on?"
14207 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14210 case "$phostname" in
14211 '') aphostname='';;
14212 *) case "$aphostname" in
14214 *) set X $phostname
14218 file=`./loc $file $file $pth`
14219 aphostname=`echo $file $*`
14224 case "$d_uname$d_gethname" in
14227 case "$phostname" in
14229 echo "There will be no way for $package to get your hostname." >&4;;
14231 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14235 case "$d_phostname" in
14236 '') d_phostname="$undef";;
14239 : see if gethostbyaddr_r exists
14240 set gethostbyaddr_r d_gethostbyaddr_r
14242 case "$d_gethostbyaddr_r" in
14244 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14245 case "$d_gethostbyaddr_r_proto:$usethreads" in
14246 ":define") d_gethostbyaddr_r_proto=define
14247 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14251 case "$d_gethostbyaddr_r_proto" in
14253 case "$gethostbyaddr_r_proto" in
14254 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14255 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14257 case "$gethostbyaddr_r_proto" in
14258 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14259 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14261 case "$gethostbyaddr_r_proto" in
14262 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14263 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14265 case "$gethostbyaddr_r_proto" in
14266 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14267 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14269 case "$gethostbyaddr_r_proto" in
14270 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14271 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14273 case "$gethostbyaddr_r_proto" in
14274 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14275 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14277 case "$gethostbyaddr_r_proto" in
14278 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14279 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14281 case "$gethostbyaddr_r_proto" in
14282 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14283 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14285 case "$gethostbyaddr_r_proto" in
14286 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14287 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14289 case "$gethostbyaddr_r_proto" in
14290 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14291 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14293 case "$gethostbyaddr_r_proto" in
14294 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14295 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14297 case "$gethostbyaddr_r_proto" in
14298 ''|0) d_gethostbyaddr_r=undef
14299 gethostbyaddr_r_proto=0
14300 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14301 * ) case "$gethostbyaddr_r_proto" in
14302 REENTRANT_PROTO*) ;;
14303 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14305 echo "Prototype: $try" ;;
14308 *) case "$usethreads" in
14309 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14311 d_gethostbyaddr_r=undef
14312 gethostbyaddr_r_proto=0
14316 *) gethostbyaddr_r_proto=0
14320 : see if gethostbyname_r exists
14321 set gethostbyname_r d_gethostbyname_r
14323 case "$d_gethostbyname_r" in
14325 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14326 case "$d_gethostbyname_r_proto:$usethreads" in
14327 ":define") d_gethostbyname_r_proto=define
14328 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14332 case "$d_gethostbyname_r_proto" in
14334 case "$gethostbyname_r_proto" in
14335 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14336 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14338 case "$gethostbyname_r_proto" in
14339 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14340 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14342 case "$gethostbyname_r_proto" in
14343 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14344 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14346 case "$gethostbyname_r_proto" in
14347 ''|0) d_gethostbyname_r=undef
14348 gethostbyname_r_proto=0
14349 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14350 * ) case "$gethostbyname_r_proto" in
14351 REENTRANT_PROTO*) ;;
14352 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14354 echo "Prototype: $try" ;;
14357 *) case "$usethreads" in
14358 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14360 d_gethostbyname_r=undef
14361 gethostbyname_r_proto=0
14365 *) gethostbyname_r_proto=0
14369 : see if gethostent_r exists
14370 set gethostent_r d_gethostent_r
14372 case "$d_gethostent_r" in
14374 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14375 case "$d_gethostent_r_proto:$usethreads" in
14376 ":define") d_gethostent_r_proto=define
14377 set d_gethostent_r_proto gethostent_r $hdrs
14381 case "$d_gethostent_r_proto" in
14383 case "$gethostent_r_proto" in
14384 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14385 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14387 case "$gethostent_r_proto" in
14388 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14389 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14391 case "$gethostent_r_proto" in
14392 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14393 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14395 case "$gethostent_r_proto" in
14396 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14397 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14399 case "$gethostent_r_proto" in
14400 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14401 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14403 case "$gethostent_r_proto" in
14404 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14405 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14407 case "$gethostent_r_proto" in
14408 ''|0) d_gethostent_r=undef
14409 gethostent_r_proto=0
14410 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14411 * ) case "$gethostent_r_proto" in
14412 REENTRANT_PROTO*) ;;
14413 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14415 echo "Prototype: $try" ;;
14418 *) case "$usethreads" in
14419 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14421 d_gethostent_r=undef
14422 gethostent_r_proto=0
14426 *) gethostent_r_proto=0
14430 : see if prototypes for various gethostxxx netdb.h functions are available
14432 set d_gethostprotos gethostent $i_netdb netdb.h
14435 : see if getitimer exists
14436 set getitimer d_getitimer
14439 : see if getlogin exists
14440 set getlogin d_getlogin
14443 : see if getlogin_r exists
14444 set getlogin_r d_getlogin_r
14446 case "$d_getlogin_r" in
14448 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14449 case "$d_getlogin_r_proto:$usethreads" in
14450 ":define") d_getlogin_r_proto=define
14451 set d_getlogin_r_proto getlogin_r $hdrs
14455 case "$d_getlogin_r_proto" in
14457 case "$getlogin_r_proto" in
14458 ''|0) try='int getlogin_r(char*, size_t);'
14459 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14461 case "$getlogin_r_proto" in
14462 ''|0) try='int getlogin_r(char*, int);'
14463 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14465 case "$getlogin_r_proto" in
14466 ''|0) try='char* getlogin_r(char*, size_t);'
14467 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14469 case "$getlogin_r_proto" in
14470 ''|0) try='char* getlogin_r(char*, int);'
14471 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14473 case "$getlogin_r_proto" in
14474 ''|0) d_getlogin_r=undef
14476 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14477 * ) case "$getlogin_r_proto" in
14478 REENTRANT_PROTO*) ;;
14479 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14481 echo "Prototype: $try" ;;
14484 *) case "$usethreads" in
14485 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14492 *) getlogin_r_proto=0
14496 : see if getmnt exists
14497 set getmnt d_getmnt
14500 : see if getmntent exists
14501 set getmntent d_getmntent
14504 : see if getnameinfo exists
14505 set getnameinfo d_getnameinfo
14508 : see if getnetbyaddr exists
14509 set getnetbyaddr d_getnbyaddr
14512 : see if getnetbyname exists
14513 set getnetbyname d_getnbyname
14516 : see if getnetent exists
14517 set getnetent d_getnent
14520 : see if getnetbyaddr_r exists
14521 set getnetbyaddr_r d_getnetbyaddr_r
14523 case "$d_getnetbyaddr_r" in
14525 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14526 case "$d_getnetbyaddr_r_proto:$usethreads" in
14527 ":define") d_getnetbyaddr_r_proto=define
14528 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14532 case "$d_getnetbyaddr_r_proto" in
14534 case "$getnetbyaddr_r_proto" in
14535 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14536 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14538 case "$getnetbyaddr_r_proto" in
14539 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14540 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14542 case "$getnetbyaddr_r_proto" in
14543 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14544 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14546 case "$getnetbyaddr_r_proto" in
14547 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14548 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14550 case "$getnetbyaddr_r_proto" in
14551 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14552 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14554 case "$getnetbyaddr_r_proto" in
14555 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14556 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14558 case "$getnetbyaddr_r_proto" in
14559 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14560 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14562 case "$getnetbyaddr_r_proto" in
14563 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14564 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14566 case "$getnetbyaddr_r_proto" in
14567 ''|0) d_getnetbyaddr_r=undef
14568 getnetbyaddr_r_proto=0
14569 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14570 * ) case "$getnetbyaddr_r_proto" in
14571 REENTRANT_PROTO*) ;;
14572 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14574 echo "Prototype: $try" ;;
14577 *) case "$usethreads" in
14578 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14580 d_getnetbyaddr_r=undef
14581 getnetbyaddr_r_proto=0
14585 *) getnetbyaddr_r_proto=0
14589 : see if getnetbyname_r exists
14590 set getnetbyname_r d_getnetbyname_r
14592 case "$d_getnetbyname_r" in
14594 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14595 case "$d_getnetbyname_r_proto:$usethreads" in
14596 ":define") d_getnetbyname_r_proto=define
14597 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14601 case "$d_getnetbyname_r_proto" in
14603 case "$getnetbyname_r_proto" in
14604 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14605 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14607 case "$getnetbyname_r_proto" in
14608 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14609 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14611 case "$getnetbyname_r_proto" in
14612 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14613 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14615 case "$getnetbyname_r_proto" in
14616 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14617 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14619 case "$getnetbyname_r_proto" in
14620 ''|0) d_getnetbyname_r=undef
14621 getnetbyname_r_proto=0
14622 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14623 * ) case "$getnetbyname_r_proto" in
14624 REENTRANT_PROTO*) ;;
14625 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14627 echo "Prototype: $try" ;;
14630 *) case "$usethreads" in
14631 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14633 d_getnetbyname_r=undef
14634 getnetbyname_r_proto=0
14638 *) getnetbyname_r_proto=0
14642 : see if getnetent_r exists
14643 set getnetent_r d_getnetent_r
14645 case "$d_getnetent_r" in
14647 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14648 case "$d_getnetent_r_proto:$usethreads" in
14649 ":define") d_getnetent_r_proto=define
14650 set d_getnetent_r_proto getnetent_r $hdrs
14654 case "$d_getnetent_r_proto" in
14656 case "$getnetent_r_proto" in
14657 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14658 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14660 case "$getnetent_r_proto" in
14661 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14662 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14664 case "$getnetent_r_proto" in
14665 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14666 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14668 case "$getnetent_r_proto" in
14669 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14670 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14672 case "$getnetent_r_proto" in
14673 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14674 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14676 case "$getnetent_r_proto" in
14677 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14678 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14680 case "$getnetent_r_proto" in
14681 ''|0) d_getnetent_r=undef
14682 getnetent_r_proto=0
14683 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14684 * ) case "$getnetent_r_proto" in
14685 REENTRANT_PROTO*) ;;
14686 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14688 echo "Prototype: $try" ;;
14691 *) case "$usethreads" in
14692 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14694 d_getnetent_r=undef
14695 getnetent_r_proto=0
14699 *) getnetent_r_proto=0
14703 : see if prototypes for various getnetxxx netdb.h functions are available
14705 set d_getnetprotos getnetent $i_netdb netdb.h
14708 : see if getpagesize exists
14709 set getpagesize d_getpagsz
14712 : Optional checks for getprotobyname and getprotobynumber
14714 : see if getprotobyname exists
14715 set getprotobyname d_getpbyname
14718 : see if getprotobynumber exists
14719 set getprotobynumber d_getpbynumber
14722 : see if getprotoent exists
14723 set getprotoent d_getpent
14726 : see if getpgid exists
14727 set getpgid d_getpgid
14730 : see if getpgrp2 exists
14731 set getpgrp2 d_getpgrp2
14734 : see if getppid exists
14735 set getppid d_getppid
14738 : see if getpriority exists
14739 set getpriority d_getprior
14742 : see if getprotobyname_r exists
14743 set getprotobyname_r d_getprotobyname_r
14745 case "$d_getprotobyname_r" in
14747 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14748 case "$d_getprotobyname_r_proto:$usethreads" in
14749 ":define") d_getprotobyname_r_proto=define
14750 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14754 case "$d_getprotobyname_r_proto" in
14756 case "$getprotobyname_r_proto" in
14757 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14758 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14760 case "$getprotobyname_r_proto" in
14761 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14762 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14764 case "$getprotobyname_r_proto" in
14765 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14766 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14768 case "$getprotobyname_r_proto" in
14769 ''|0) d_getprotobyname_r=undef
14770 getprotobyname_r_proto=0
14771 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14772 * ) case "$getprotobyname_r_proto" in
14773 REENTRANT_PROTO*) ;;
14774 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14776 echo "Prototype: $try" ;;
14779 *) case "$usethreads" in
14780 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14782 d_getprotobyname_r=undef
14783 getprotobyname_r_proto=0
14787 *) getprotobyname_r_proto=0
14791 : see if getprotobynumber_r exists
14792 set getprotobynumber_r d_getprotobynumber_r
14794 case "$d_getprotobynumber_r" in
14796 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14797 case "$d_getprotobynumber_r_proto:$usethreads" in
14798 ":define") d_getprotobynumber_r_proto=define
14799 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14803 case "$d_getprotobynumber_r_proto" in
14805 case "$getprotobynumber_r_proto" in
14806 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14807 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14809 case "$getprotobynumber_r_proto" in
14810 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14811 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14813 case "$getprotobynumber_r_proto" in
14814 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14815 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14817 case "$getprotobynumber_r_proto" in
14818 ''|0) d_getprotobynumber_r=undef
14819 getprotobynumber_r_proto=0
14820 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14821 * ) case "$getprotobynumber_r_proto" in
14822 REENTRANT_PROTO*) ;;
14823 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14825 echo "Prototype: $try" ;;
14828 *) case "$usethreads" in
14829 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14831 d_getprotobynumber_r=undef
14832 getprotobynumber_r_proto=0
14836 *) getprotobynumber_r_proto=0
14840 : see if getprotoent_r exists
14841 set getprotoent_r d_getprotoent_r
14843 case "$d_getprotoent_r" in
14845 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14846 case "$d_getprotoent_r_proto:$usethreads" in
14847 ":define") d_getprotoent_r_proto=define
14848 set d_getprotoent_r_proto getprotoent_r $hdrs
14852 case "$d_getprotoent_r_proto" in
14854 case "$getprotoent_r_proto" in
14855 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14856 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14858 case "$getprotoent_r_proto" in
14859 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14860 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14862 case "$getprotoent_r_proto" in
14863 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14864 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14866 case "$getprotoent_r_proto" in
14867 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14868 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14870 case "$getprotoent_r_proto" in
14871 ''|0) d_getprotoent_r=undef
14872 getprotoent_r_proto=0
14873 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14874 * ) case "$getprotoent_r_proto" in
14875 REENTRANT_PROTO*) ;;
14876 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14878 echo "Prototype: $try" ;;
14881 *) case "$usethreads" in
14882 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14884 d_getprotoent_r=undef
14885 getprotoent_r_proto=0
14889 *) getprotoent_r_proto=0
14893 : see if prototypes for various getprotoxxx netdb.h functions are available
14895 set d_getprotoprotos getprotoent $i_netdb netdb.h
14898 : see if getprpwnam exists
14899 set getprpwnam d_getprpwnam
14902 : see if getpwent exists
14903 set getpwent d_getpwent
14906 : see if getpwent_r exists
14907 set getpwent_r d_getpwent_r
14909 case "$d_getpwent_r" in
14911 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14912 case "$d_getpwent_r_proto:$usethreads" in
14913 ":define") d_getpwent_r_proto=define
14914 set d_getpwent_r_proto getpwent_r $hdrs
14918 case "$d_getpwent_r_proto" in
14920 case "$getpwent_r_proto" in
14921 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14922 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14924 case "$getpwent_r_proto" in
14925 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14926 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14928 case "$getpwent_r_proto" in
14929 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14930 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14932 case "$getpwent_r_proto" in
14933 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14934 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14936 case "$getpwent_r_proto" in
14937 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14938 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14940 case "$getpwent_r_proto" in
14941 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14942 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14944 case "$getpwent_r_proto" in
14945 ''|0) d_getpwent_r=undef
14947 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14948 * ) case "$getpwent_r_proto" in
14949 REENTRANT_PROTO*) ;;
14950 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14952 echo "Prototype: $try" ;;
14955 *) case "$usethreads" in
14956 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14963 *) getpwent_r_proto=0
14967 : see if getpwnam_r exists
14968 set getpwnam_r d_getpwnam_r
14970 case "$d_getpwnam_r" in
14972 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14973 case "$d_getpwnam_r_proto:$usethreads" in
14974 ":define") d_getpwnam_r_proto=define
14975 set d_getpwnam_r_proto getpwnam_r $hdrs
14979 case "$d_getpwnam_r_proto" in
14981 case "$getpwnam_r_proto" in
14982 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14983 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14985 case "$getpwnam_r_proto" in
14986 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14987 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14989 case "$getpwnam_r_proto" in
14990 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14991 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14993 case "$getpwnam_r_proto" in
14994 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14995 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14997 case "$getpwnam_r_proto" in
14998 ''|0) d_getpwnam_r=undef
15000 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15001 * ) case "$getpwnam_r_proto" in
15002 REENTRANT_PROTO*) ;;
15003 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15005 echo "Prototype: $try" ;;
15008 *) case "$usethreads" in
15009 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15016 *) getpwnam_r_proto=0
15020 : see if getpwuid_r exists
15021 set getpwuid_r d_getpwuid_r
15023 case "$d_getpwuid_r" in
15025 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15026 case "$d_getpwuid_r_proto:$usethreads" in
15027 ":define") d_getpwuid_r_proto=define
15028 set d_getpwuid_r_proto getpwuid_r $hdrs
15032 case "$d_getpwuid_r_proto" in
15034 case "$getpwuid_r_proto" in
15035 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15036 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15038 case "$getpwuid_r_proto" in
15039 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15040 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15042 case "$getpwuid_r_proto" in
15043 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15044 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15046 case "$getpwuid_r_proto" in
15047 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15048 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15050 case "$getpwuid_r_proto" in
15051 ''|0) d_getpwuid_r=undef
15053 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15054 * ) case "$getpwuid_r_proto" in
15055 REENTRANT_PROTO*) ;;
15056 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15058 echo "Prototype: $try" ;;
15061 *) case "$usethreads" in
15062 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15069 *) getpwuid_r_proto=0
15073 : Optional checks for getsbyname and getsbyport
15075 : see if getservbyname exists
15076 set getservbyname d_getsbyname
15079 : see if getservbyport exists
15080 set getservbyport d_getsbyport
15083 : see if getservent exists
15084 set getservent d_getsent
15087 : see if getservbyname_r exists
15088 set getservbyname_r d_getservbyname_r
15090 case "$d_getservbyname_r" in
15092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15093 case "$d_getservbyname_r_proto:$usethreads" in
15094 ":define") d_getservbyname_r_proto=define
15095 set d_getservbyname_r_proto getservbyname_r $hdrs
15099 case "$d_getservbyname_r_proto" in
15101 case "$getservbyname_r_proto" in
15102 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15103 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15105 case "$getservbyname_r_proto" in
15106 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15107 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15109 case "$getservbyname_r_proto" in
15110 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15111 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15113 case "$getservbyname_r_proto" in
15114 ''|0) d_getservbyname_r=undef
15115 getservbyname_r_proto=0
15116 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15117 * ) case "$getservbyname_r_proto" in
15118 REENTRANT_PROTO*) ;;
15119 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15121 echo "Prototype: $try" ;;
15124 *) case "$usethreads" in
15125 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15127 d_getservbyname_r=undef
15128 getservbyname_r_proto=0
15132 *) getservbyname_r_proto=0
15136 : see if getservbyport_r exists
15137 set getservbyport_r d_getservbyport_r
15139 case "$d_getservbyport_r" in
15141 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15142 case "$d_getservbyport_r_proto:$usethreads" in
15143 ":define") d_getservbyport_r_proto=define
15144 set d_getservbyport_r_proto getservbyport_r $hdrs
15148 case "$d_getservbyport_r_proto" in
15150 case "$getservbyport_r_proto" in
15151 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15152 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15154 case "$getservbyport_r_proto" in
15155 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15156 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15158 case "$getservbyport_r_proto" in
15159 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15160 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15162 case "$getservbyport_r_proto" in
15163 ''|0) d_getservbyport_r=undef
15164 getservbyport_r_proto=0
15165 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15166 * ) case "$getservbyport_r_proto" in
15167 REENTRANT_PROTO*) ;;
15168 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15170 echo "Prototype: $try" ;;
15173 *) case "$usethreads" in
15174 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15176 d_getservbyport_r=undef
15177 getservbyport_r_proto=0
15181 *) getservbyport_r_proto=0
15185 : see if getservent_r exists
15186 set getservent_r d_getservent_r
15188 case "$d_getservent_r" in
15190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15191 case "$d_getservent_r_proto:$usethreads" in
15192 ":define") d_getservent_r_proto=define
15193 set d_getservent_r_proto getservent_r $hdrs
15197 case "$d_getservent_r_proto" in
15199 case "$getservent_r_proto" in
15200 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15201 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15203 case "$getservent_r_proto" in
15204 ''|0) try='int getservent_r(struct servent*, char*, int);'
15205 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15207 case "$getservent_r_proto" in
15208 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15209 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15211 case "$getservent_r_proto" in
15212 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15213 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15215 case "$getservent_r_proto" in
15216 ''|0) d_getservent_r=undef
15217 getservent_r_proto=0
15218 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15219 * ) case "$getservent_r_proto" in
15220 REENTRANT_PROTO*) ;;
15221 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15223 echo "Prototype: $try" ;;
15226 *) case "$usethreads" in
15227 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15229 d_getservent_r=undef
15230 getservent_r_proto=0
15234 *) getservent_r_proto=0
15238 : see if prototypes for various getservxxx netdb.h functions are available
15240 set d_getservprotos getservent $i_netdb netdb.h
15243 : see if getspnam exists
15244 set getspnam d_getspnam
15247 : see if this is a shadow.h system
15248 set shadow.h i_shadow
15251 : see if getspnam_r exists
15252 set getspnam_r d_getspnam_r
15254 case "$d_getspnam_r" in
15256 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15257 case "$d_getspnam_r_proto:$usethreads" in
15258 ":define") d_getspnam_r_proto=define
15259 set d_getspnam_r_proto getspnam_r $hdrs
15263 case "$d_getspnam_r_proto" in
15265 case "$getspnam_r_proto" in
15266 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15267 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15269 case "$getspnam_r_proto" in
15270 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15271 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15273 case "$getspnam_r_proto" in
15274 ''|0) d_getspnam_r=undef
15276 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15277 * ) case "$getspnam_r_proto" in
15278 REENTRANT_PROTO*) ;;
15279 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15281 echo "Prototype: $try" ;;
15284 *) case "$usethreads" in
15285 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15292 *) getspnam_r_proto=0
15296 : see if gettimeofday or ftime exists
15297 set gettimeofday d_gettimeod
15299 case "$d_gettimeod" in
15305 val="$undef"; set d_ftime; eval $setvar
15308 case "$d_gettimeod$d_ftime" in
15311 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15315 : see if gmtime_r exists
15316 set gmtime_r d_gmtime_r
15318 case "$d_gmtime_r" in
15320 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15321 case "$d_gmtime_r_proto:$usethreads" in
15322 ":define") d_gmtime_r_proto=define
15323 set d_gmtime_r_proto gmtime_r $hdrs
15327 case "$d_gmtime_r_proto" in
15329 case "$gmtime_r_proto" in
15330 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15331 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15333 case "$gmtime_r_proto" in
15334 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15335 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15337 case "$gmtime_r_proto" in
15338 ''|0) d_gmtime_r=undef
15340 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15341 * ) case "$gmtime_r_proto" in
15342 REENTRANT_PROTO*) ;;
15343 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15345 echo "Prototype: $try" ;;
15348 *) case "$usethreads" in
15349 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15356 *) gmtime_r_proto=0
15360 : see if hasmntopt exists
15361 set hasmntopt d_hasmntopt
15364 : see if this is a netinet/in.h or sys/in.h system
15365 set netinet/in.h i_niin sys/in.h i_sysin
15368 : see if arpa/inet.h has to be included
15369 set arpa/inet.h i_arpainet
15372 : see if htonl --and friends-- exists
15377 : Maybe they are macros.
15380 $cat >htonl.c <<EOM
15382 #include <sys/types.h>
15383 #$i_niin I_NETINET_IN
15385 #$i_arpainet I_ARPA_INET
15386 #ifdef I_NETINET_IN
15387 #include <netinet/in.h>
15390 #include <sys/in.h>
15393 #include <arpa/inet.h>
15396 printf("Defined as a macro.");
15399 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15400 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15402 echo "But it seems to be defined as a macro." >&4
15410 : see if ilogbl exists
15411 set ilogbl d_ilogbl
15416 if set index val -f; eval $csym; $val; then
15417 if set strchr val -f d_strchr; eval $csym; $val; then
15418 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15421 echo "strchr() found." >&4
15425 echo "index() found." >&4
15430 echo "index() found." >&4
15433 if set strchr val -f d_strchr; eval $csym; $val; then
15436 echo "strchr() found." >&4
15438 echo "No index() or strchr() found!" >&4
15443 set d_strchr; eval $setvar
15445 set d_index; eval $setvar
15447 : check whether inet_aton exists
15448 set inet_aton d_inetaton
15451 : see if inet_ntop exists
15452 set inet_ntop d_inetntop
15455 : see if inet_pton exists
15456 set inet_pton d_inetpton
15461 $cat >isascii.c <<EOCP
15464 #$i_stdlib I_STDLIB
15466 #include <stdlib.h>
15477 if eval $compile; then
15478 echo "isascii() found." >&4
15481 echo "isascii() NOT found." >&4
15490 $cat >isblank.c <<'EOCP'
15501 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15502 echo "isblank() found." >&4
15505 echo "isblank() NOT found." >&4
15512 : check for isfinite
15513 echo "Checking to see if you have isfinite..." >&4
15519 int main() { return isfinite(0.0); }
15522 if eval $compile; then
15524 echo "You have isfinite."
15527 echo "You do not have isfinite."
15533 : see if isfinitel exists
15534 set isfinitel d_isfinitel
15538 echo "Checking to see if you have isinf..." >&4
15544 int main() { return isinf(0.0); }
15547 if eval $compile; then
15549 echo "You have isinf."
15552 echo "You do not have isinf."
15558 : see if isinfl exists
15559 set isinfl d_isinfl
15563 echo "Checking to see if you have isnan..." >&4
15569 int main() { return isnan(0.0); }
15572 if eval $compile; then
15574 echo "You have isnan."
15577 echo "You do not have isnan."
15583 : see if isnanl exists
15584 set isnanl d_isnanl
15591 : see if j0l exists
15595 : see if killpg exists
15596 set killpg d_killpg
15599 : see if lchown exists
15601 $cat > try.c <<'EOCP'
15602 /* System header to define __stub macros and hopefully few prototypes,
15603 which can conflict with char lchown(); below. */
15604 #include <assert.h>
15605 /* Override any gcc2 internal prototype to avoid an error. */
15606 /* We use char because int might match the return type of a gcc2
15607 builtin and then its argument prototype would still apply. */
15610 /* The GNU C library defines this for functions which it implements
15611 to always fail with ENOSYS. Some functions are actually named
15612 something starting with __ and the normal name is an alias. */
15613 #if defined (__stub_lchown) || defined (__stub___lchown)
15621 if eval $compile; then
15622 $echo "lchown() found." >&4
15625 $echo "lchown() NOT found." >&4
15631 : See if number of significant digits in a double precision number is known
15633 $cat >ldbl_dig.c <<EOM
15634 #$i_limits I_LIMITS
15637 #include <limits.h>
15643 printf("Contains LDBL_DIG");
15646 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15647 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15648 echo "LDBL_DIG found." >&4
15651 echo "LDBL_DIG NOT found." >&4
15658 : check to see if math.h defines _LIB_VERSION
15659 d_libm_lib_version="$undef"
15663 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15665 #include <unistd.h>
15667 int main (int argc, char *argv[])
15669 printf ("%d\n", _LIB_VERSION);
15674 if eval $compile; then
15676 echo "Yes, it does ($foo)" >&4
15677 d_libm_lib_version="$define"
15679 echo "No, it does not (probably harmless)" >&4
15686 : see if link exists
15690 : see if localtime_r exists
15691 set localtime_r d_localtime_r
15693 case "$d_localtime_r" in
15695 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15696 case "$d_localtime_r_proto:$usethreads" in
15697 ":define") d_localtime_r_proto=define
15698 set d_localtime_r_proto localtime_r $hdrs
15702 case "$d_localtime_r_proto" in
15704 case "$localtime_r_proto" in
15705 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15706 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15708 case "$localtime_r_proto" in
15709 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15710 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15712 case "$localtime_r_proto" in
15713 ''|0) d_localtime_r=undef
15714 localtime_r_proto=0
15715 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15716 * ) case "$localtime_r_proto" in
15717 REENTRANT_PROTO*) ;;
15718 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15720 echo "Prototype: $try" ;;
15723 *) case "$usethreads" in
15724 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15726 d_localtime_r=undef
15727 localtime_r_proto=0
15731 *) localtime_r_proto=0
15735 : see if localtime_r calls tzset
15736 case "$localtime_r_proto" in
15739 /* Does our libc's localtime_r call tzset ?
15740 * return 0 if so, 1 otherwise.
15742 #$i_systypes I_SYS_TYPES
15743 #$i_unistd I_UNISTD
15745 #$i_stdlib I_STDLIB
15746 #$i_string I_STRING
15747 #$i_malloc I_MALLOC
15749 # include <sys/types.h>
15752 # include <unistd.h>
15758 #include <stdlib.h>
15761 # include <string.h>
15763 # include <strings.h>
15766 # include <malloc.h>
15770 time_t t = time(0L);
15771 char w_tz[]="TZ" "=GMT+5",
15772 e_tz[]="TZ" "=GMT-5",
15773 *tz_e = (char*)malloc(16),
15774 *tz_w = (char*)malloc(16);
15775 struct tm tm_e, tm_w;
15776 memset(&tm_e,'\0',sizeof(struct tm));
15777 memset(&tm_w,'\0',sizeof(struct tm));
15782 localtime_r(&t, &tm_e);
15785 localtime_r(&t, &tm_w);
15787 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15793 if eval $compile; then
15794 if $run ./try; then
15795 d_localtime_r_needs_tzset=undef;
15797 d_localtime_r_needs_tzset=define;
15800 d_localtime_r_needs_tzset=undef;
15804 d_localtime_r_needs_tzset=undef;
15809 : see if localeconv exists
15810 set localeconv d_locconv
15813 : see if lockf exists
15817 : see if prototype for lseek is available
15819 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15822 : see if lstat exists
15826 : see if madvise exists
15827 set madvise d_madvise
15830 : see if malloc_size exists
15831 set malloc_size d_malloc_size
15834 : see if malloc_size_good exists
15835 set malloc_good_size d_malloc_good_size
15838 : see if mblen exists
15842 : see if mbstowcs exists
15843 set mbstowcs d_mbstowcs
15846 : see if mbtowc exists
15847 set mbtowc d_mbtowc
15850 : see if memchr exists
15851 set memchr d_memchr
15854 : see if memcmp exists
15855 set memcmp d_memcmp
15858 : see if memcpy exists
15859 set memcpy d_memcpy
15862 : see if memmove exists
15863 set memmove d_memmove
15866 : see if memset exists
15867 set memset d_memset
15870 : see if mkdir exists
15874 : see if mkdtemp exists
15875 set mkdtemp d_mkdtemp
15878 : see if mkfifo exists
15879 set mkfifo d_mkfifo
15882 : see if mkstemp exists
15883 set mkstemp d_mkstemp
15886 : see if mkstemps exists
15887 set mkstemps d_mkstemps
15890 : see if mktime exists
15891 set mktime d_mktime
15894 : see if this is a sys/mman.h system
15895 set sys/mman.h i_sysmman
15898 : see if mmap exists
15901 : see what shmat returns
15902 : default to something harmless
15904 case "$i_sysmman$d_mmap" in
15906 $cat >mmap.c <<'END'
15907 #include <sys/mman.h>
15910 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15915 echo "and it returns ($mmaptype)." >&4
15921 : see if sqrtl exists
15925 : see if scalbnl exists
15926 set scalbnl d_scalbnl
15929 : see if truncl exists
15930 set truncl d_truncl
15933 : see if modfl exists
15937 : see if prototype for modfl is available
15939 set d_modflproto modfl $i_math math.h
15942 d_modfl_pow32_bug="$undef"
15944 case "$d_longdbl$d_modfl" in
15947 Checking to see whether your modfl() is okay for large values...
15953 if $test "X$d_modflproto" != "X$define"; then
15954 $cat >>try.c <<EOCP
15955 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15956 long double modfl (long double, long double *);
15959 $cat >>try.c <<EOCP
15961 long double nv = 4294967303.15;
15967 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15971 case "$osname:$gccversion" in
15972 aix:) saveccflags="$ccflags"
15973 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15976 if eval $compile; then
15979 *" 4294967303.150000 1.150000 4294967302.000000")
15980 echo >&4 "Your modfl() is broken for large values."
15981 d_modfl_pow32_bug="$define"
15983 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15987 *" 4294967303.150000 0.150000 4294967303.000000")
15988 echo >&4 "Your modfl() seems okay for large values."
15990 *) echo >&4 "I don't understand your modfl() at all."
15996 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15999 case "$osname:$gccversion" in
16000 aix:) ccflags="$saveccflags" ;; # restore
16005 if $test "$uselongdouble" = "$define"; then
16007 if $test "$d_sqrtl" != "$define"; then
16008 message="$message sqrtl"
16010 if $test "$d_modfl" != "$define"; then
16011 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16012 echo "You have both truncl and copysignl, so I can emulate modfl."
16014 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16015 echo "You have both aintl and copysignl, so I can emulate modfl."
16017 message="$message modfl"
16021 if $test "$d_frexpl" != "$define"; then
16022 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16023 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16025 message="$message frexpl"
16028 if $test "$d_ldexpl" != "$define"; then
16029 message="$message ldexpl"
16032 if $test "$message" != ""; then
16035 *** You requested the use of long doubles but you do not seem to have
16036 *** the following mathematical functions needed for long double support:
16038 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16039 *** Cannot continue, aborting.
16047 : see if mprotect exists
16048 set mprotect d_mprotect
16051 : see if msgctl exists
16052 set msgctl d_msgctl
16055 : see if msgget exists
16056 set msgget d_msgget
16059 : see if msgsnd exists
16060 set msgsnd d_msgsnd
16063 : see if msgrcv exists
16064 set msgrcv d_msgrcv
16067 : see how much of the 'msg*(2)' library is present.
16070 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16071 *"$undef"*) h_msg=false;;
16075 case "`ipcs 2>&1`" in
16076 "SVID messages"*"not configured"*)
16077 echo "Your $osname does not have the msg*(2) configured." >&4
16080 set msgctl d_msgctl
16082 set msgget d_msgget
16084 set msgsnd d_msgsnd
16086 set msgrcv d_msgrcv
16092 : we could also check for sys/ipc.h ...
16093 if $h_msg && $test `./findhdr sys/msg.h`; then
16094 echo "You have the full msg*(2) library." >&4
16097 echo "You don't have the full msg*(2) library." >&4
16103 : Check for msghdr_s
16105 echo "Checking to see if your system supports struct msghdr..." >&4
16106 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16108 case "$d_msghdr_s" in
16109 "$define") echo "Yes, it does." ;;
16110 *) echo "No, it doesn't." ;;
16114 : see if msync exists
16118 : see if munmap exists
16119 set munmap d_munmap
16122 : see if nice exists
16126 : see if this is a langinfo.h system
16127 set langinfo.h i_langinfo
16130 : see if nl_langinfo exists
16131 set nl_langinfo d_nl_langinfo
16134 : check for volatile keyword
16136 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16137 $cat >try.c <<'EOCP'
16140 typedef struct _goo_struct goo_struct;
16141 goo_struct * volatile goo = ((goo_struct *)0);
16142 struct _goo_struct {
16147 typedef unsigned short foo_t;
16148 char *volatile foo;
16150 volatile foo_t blech;
16154 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16156 echo "Yup, it does."
16159 echo "Nope, it doesn't."
16165 : Check basic sizes
16167 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16169 case "$use64bitint:$d_quad:$quadtype" in
16172 uvtype="$uquadtype"
16177 uvtype="unsigned long"
16183 case "$uselongdouble:$d_longdbl" in
16185 nvtype="long double"
16186 nvsize=$longdblsize
16193 $echo "(IV will be "$ivtype", $ivsize bytes)"
16194 $echo "(UV will be "$uvtype", $uvsize bytes)"
16195 $echo "(NV will be "$nvtype", $nvsize bytes)"
16198 #$i_inttypes I_INTTYPES
16200 #include <inttypes.h>
16205 int8_t i = INT8_MAX;
16206 uint8_t u = UINT8_MAX;
16207 printf("int8_t\n");
16210 int16_t i = INT16_MAX;
16211 uint16_t u = UINT16_MAX;
16212 printf("int16_t\n");
16215 int32_t i = INT32_MAX;
16216 uint32_t u = UINT32_MAX;
16217 printf("int32_t\n");
16222 i8type="signed char"
16223 u8type="unsigned char"
16228 '') case "$shortsize" in
16230 u16type="unsigned short"
16238 '') set try -DINT16
16239 if eval $compile; then
16240 case "`$run ./try`" in
16252 '') if $test $shortsize -ge 2; then
16254 u16type="unsigned short"
16262 '') case "$longsize" in
16264 u32type="unsigned long"
16268 *) case "$intsize" in
16270 u32type="unsigned int"
16280 '') set try -DINT32
16281 if eval $compile; then
16282 case "`$run ./try`" in
16294 '') if $test $intsize -ge 4; then
16296 u32type="unsigned int"
16304 '') case "$d_quad:$quadtype" in
16306 i64type="$quadtype"
16307 u64type="$uquadtype"
16315 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16316 : volatile so that the compiler has to store it out to memory.
16317 if test X"$d_volatile" = X"$define"; then
16322 #$i_stdlib I_STDLIB
16324 #include <stdlib.h>
16326 #include <sys/types.h>
16327 #include <signal.h>
16329 $volatile int bletched = 0;
16330 $signal_t blech(int s) { bletched = 1; }
16335 int n = 8 * $uvsize;
16338 signal(SIGFPE, blech);
16341 for (i = 0; i < n; i++) {
16342 u = u << 1 | ($uvtype)1;
16344 if (($uvtype)d != u)
16348 d = ($nvtype)(u - 1);
16349 if (($uvtype)d != (u - 1))
16356 printf("%d\n", ((i == n) ? -n : i));
16362 d_nv_preserves_uv="$undef"
16363 if eval $compile; then
16364 nv_preserves_uv_bits="`$run ./try`"
16366 case "$nv_preserves_uv_bits" in
16368 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16369 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16370 d_nv_preserves_uv="$define"
16372 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16373 d_nv_preserves_uv="$undef" ;;
16374 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16375 nv_preserves_uv_bits="0" ;;
16379 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16380 : volatile so that the compiler has to store it out to memory.
16381 if test X"$d_volatile" = X"$define"; then
16387 typedef $nvtype NV;
16394 while(count < 256) {
16395 $volatile NV up = value + 1.0;
16396 $volatile NV negated = -value;
16397 $volatile NV down = negated - 1.0;
16398 $volatile NV got_up = up - value;
16399 int up_good = got_up == 1.0;
16400 int got_down = down - negated;
16401 int down_good = got_down == -1.0;
16403 if (down_good != up_good) {
16405 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16406 up_good, (double) got_up, down_good, (double) got_down,
16407 count, (double) value);
16414 fputs("256.0", stdout);
16417 fputs("2.0", stdout);
16423 fputs("*", stdout);
16429 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16430 count, (double) value);
16436 nv_overflows_integers_at='0'
16437 if eval $compile; then
16443 The largest integer your NVs can preserve is equal to $xxx
16445 nv_overflows_integers_at="$xxx"
16448 Cannot determine the largest integer value your NVs can hold, unexpected output
16455 Cannot determine the largest integer value your NVs can hold
16462 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16463 : volatile so that the compiler has to store it out to memory.
16464 if test X"$d_volatile" = X"$define"; then
16469 #$i_stdlib I_STDLIB
16471 #include <stdlib.h>
16473 #$i_string I_STRING
16475 # include <string.h>
16477 # include <strings.h>
16479 #include <sys/types.h>
16480 #include <signal.h>
16482 $volatile int bletched = 0;
16483 $signal_t blech(int s) { bletched = 1; }
16486 int checkit($nvtype d, char *where) {
16487 unsigned char *p = (char *)&d;
16488 unsigned char *end = p + sizeof(d);
16498 printf("No - %s: 0x", where);
16500 printf ("%02X", *p++);
16505 int main(int argc, char **argv) {
16508 fail += checkit(d, "0.0");
16510 /* The compiler shouldn't be assuming that bletched is 0 */
16513 fail += checkit(d, "bleched");
16516 signal(SIGFPE, blech);
16519 /* Paranoia - the compiler should have no way of knowing that ANSI says
16520 that argv[argc] will always be NULL. Actually, if it did assume this it
16521 would be buggy, as this is C and main() can be called from elsewhere in
16523 d = argv[argc] ? 1 : 0;
16526 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16529 fail += checkit(d, "ternary");
16531 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16534 printf("No - memset doesn't give 0.0\n");
16535 /* This might just blow up: */
16536 printf("(gives %g)\n", d);
16542 printf("No - something bleched\n");
16547 printf("No - %d fail(s)\n", fail);
16556 d_nv_zero_is_allbits_zero="$undef"
16557 if eval $compile; then
16563 0.0 is represented as all bits zero in memory
16565 d_nv_zero_is_allbits_zero="$define"
16568 0.0 is not represented as all bits zero in memory
16570 d_nv_zero_is_allbits_zero="$undef"
16575 0.0 is not represented as all bits zero in memory
16577 d_nv_zero_is_allbits_zero="$undef"
16583 : check for off64_t
16585 echo "Checking to see if you have off64_t..." >&4
16587 #include <sys/types.h>
16588 #include <unistd.h>
16589 int main() { off64_t x = 7; }
16592 if eval $compile; then
16594 echo "You have off64_t."
16597 echo "You do not have off64_t."
16598 case "$lseeksize" in
16599 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16606 : how to create joinable pthreads
16607 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16609 echo "Checking what constant to use for creating joinable pthreads..." >&4
16610 $cat >try.c <<'EOCP'
16611 #include <pthread.h>
16613 int detachstate = JOINABLE;
16616 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16617 if eval $compile; then
16618 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16619 val="$undef" # Yes, undef.
16620 set d_old_pthread_create_joinable
16623 set old_pthread_create_joinable
16626 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16627 if eval $compile; then
16628 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16630 set d_old_pthread_create_joinable
16632 val=PTHREAD_CREATE_UNDETACHED
16633 set old_pthread_create_joinable
16636 set try -DJOINABLE=__UNDETACHED
16637 if eval $compile; then
16638 echo "You seem to use __UNDETACHED." >&4
16640 set d_old_pthread_create_joinable
16643 set old_pthread_create_joinable
16646 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16648 set d_old_pthread_create_joinable
16651 set old_pthread_create_joinable
16658 d_old_pthread_create_joinable="$undef"
16659 old_pthread_create_joinable=""
16662 : see if pause exists
16666 : see if poll exists
16670 : see if prctl exists
16674 : see if prctl supports PR_SET_NAME
16675 d_prctl_set_name=$undef
16680 #include <unistd.h>
16682 #include <sys/prctl.h>
16684 int main (int argc, char *argv[])
16686 return (prctl (PR_SET_NAME, "Test"));
16690 if eval $compile_ok && $run ./try; then
16691 echo "Your prctl (PR_SET_NAME, ...) works"
16692 d_prctl_set_name=$define
16698 : see if readlink exists
16699 set readlink d_readlink
16702 : Check if exe is symlink to abs path of executing program
16706 case "$d_readlink" in
16708 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16709 : more tidy to avoid an extra level of symlink
16710 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16711 while test $# -gt 0; do
16714 if $issymlink $try; then
16715 $ls -l $try > reflect
16716 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16717 echo "You have $type-like $try."
16718 procselfexe='"'$try'"'
16720 : This will break out of the loop
16731 : backward compatibility for d_hvfork
16732 if test X$d_hvfork != X; then
16733 d_vfork="$d_hvfork"
16736 : see if there is a vfork
16741 d_pseudofork=$undef
16743 : Ok, but do we want to use it. vfork is reportedly unreliable in
16744 : perl on Solaris 2.x, and probably elsewhere.
16748 case "$usevfork" in
16754 Perl can only use a vfork() that doesn't suffer from strict
16755 restrictions on calling functions or modifying global data in
16756 the child. For example, glibc-2.1 contains such a vfork()
16757 that is unsuitable. If your system provides a proper fork()
16758 call, chances are that you do NOT want perl to use vfork().
16761 rp="Do you still want to use vfork()?"
16766 echo "Ok, we won't use vfork()."
16775 $define) usevfork='true';;
16776 *) usevfork='false';;
16779 : see whether the pthread_atfork exists
16781 #include <pthread.h>
16784 #ifdef PTHREAD_ATFORK
16785 pthread_atfork(NULL,NULL,NULL);
16790 : see if pthread_atfork exists
16791 set try -DPTHREAD_ATFORK
16792 if eval $compile; then
16797 case "$usethreads" in
16800 $define) echo 'pthread_atfork found.' >&4 ;;
16801 *) echo 'pthread_atfork NOT found.' >&4 ;;
16804 set d_pthread_atfork
16807 : see if pthread_attr_setscope exists
16808 set pthread_attr_setscope d_pthread_attr_setscope
16811 : see whether the various POSIXish _yields exist
16813 #include <pthread.h>
16819 #ifdef PTHREAD_YIELD
16822 #ifdef PTHREAD_YIELD_NULL
16823 pthread_yield(NULL);
16829 : see if sched_yield exists
16830 set try -DSCHED_YIELD
16831 if eval $compile; then
16833 sched_yield='sched_yield()'
16837 case "$usethreads" in
16840 $define) echo 'sched_yield() found.' >&4 ;;
16841 *) echo 'sched_yield() NOT found.' >&4 ;;
16847 : see if pthread_yield exists
16848 set try -DPTHREAD_YIELD
16849 if eval $compile; then
16851 case "$sched_yield" in
16852 '') sched_yield='pthread_yield()' ;;
16855 set try -DPTHREAD_YIELD_NULL
16856 if eval $compile; then
16858 case "$sched_yield" in
16859 '') sched_yield='pthread_yield(NULL)' ;;
16865 case "$usethreads" in
16868 $define) echo 'pthread_yield() found.' >&4 ;;
16869 *) echo 'pthread_yield() NOT found.' >&4 ;;
16873 set d_pthread_yield
16875 case "$sched_yield" in
16876 '') sched_yield=undef ;;
16880 : check for ptrdiff_t
16882 echo "Checking to see if you have ptrdiff_t..." >&4
16884 #include <stddef.h>
16885 int main() { ptrdiff_t x = 7; }
16888 if eval $compile; then
16890 echo "You have ptrdiff_t."
16893 echo "You do not have ptrdiff_t."
16899 : see if random_r exists
16900 set random_r d_random_r
16902 case "$d_random_r" in
16904 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16905 case "$d_random_r_proto:$usethreads" in
16906 ":define") d_random_r_proto=define
16907 set d_random_r_proto random_r $hdrs
16911 case "$d_random_r_proto" in
16913 case "$random_r_proto" in
16914 ''|0) try='int random_r(int*, struct random_data*);'
16915 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16917 case "$random_r_proto" in
16918 ''|0) try='int random_r(long*, struct random_data*);'
16919 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16921 case "$random_r_proto" in
16922 ''|0) try='int random_r(struct random_data*, int32_t*);'
16923 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16925 case "$random_r_proto" in
16926 ''|0) d_random_r=undef
16928 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16929 * ) case "$random_r_proto" in
16930 REENTRANT_PROTO*) ;;
16931 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16933 echo "Prototype: $try" ;;
16936 *) case "$usethreads" in
16937 define) echo "random_r has no prototype, not using it." >&4 ;;
16944 *) random_r_proto=0
16948 : see if readdir and friends exist
16949 set readdir d_readdir
16951 set seekdir d_seekdir
16953 set telldir d_telldir
16955 set rewinddir d_rewinddir
16958 : see if readdir64_r exists
16959 set readdir64_r d_readdir64_r
16961 case "$d_readdir64_r" in
16963 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16964 case "$d_readdir64_r_proto:$usethreads" in
16965 ":define") d_readdir64_r_proto=define
16966 set d_readdir64_r_proto readdir64_r $hdrs
16970 case "$d_readdir64_r_proto" in
16972 case "$readdir64_r_proto" in
16973 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16974 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16976 case "$readdir64_r_proto" in
16977 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16978 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16980 case "$readdir64_r_proto" in
16981 ''|0) d_readdir64_r=undef
16982 readdir64_r_proto=0
16983 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16984 * ) case "$readdir64_r_proto" in
16985 REENTRANT_PROTO*) ;;
16986 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16988 echo "Prototype: $try" ;;
16991 *) case "$usethreads" in
16992 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16994 d_readdir64_r=undef
16995 readdir64_r_proto=0
16999 *) readdir64_r_proto=0
17003 : see if readdir_r exists
17004 set readdir_r d_readdir_r
17006 case "$d_readdir_r" in
17008 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17009 case "$d_readdir_r_proto:$usethreads" in
17010 ":define") d_readdir_r_proto=define
17011 set d_readdir_r_proto readdir_r $hdrs
17015 case "$d_readdir_r_proto" in
17017 case "$readdir_r_proto" in
17018 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17019 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17021 case "$readdir_r_proto" in
17022 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17023 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17025 case "$readdir_r_proto" in
17026 ''|0) d_readdir_r=undef
17028 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17029 * ) case "$readdir_r_proto" in
17030 REENTRANT_PROTO*) ;;
17031 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17033 echo "Prototype: $try" ;;
17036 *) case "$usethreads" in
17037 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17044 *) readdir_r_proto=0
17048 : see if readv exists
17052 : see if recvmsg exists
17053 set recvmsg d_recvmsg
17056 : see if rename exists
17057 set rename d_rename
17060 : see if rmdir exists
17064 : see if memory.h is available.
17069 : See if it conflicts with string.h
17075 $cppstdin $cppflags $cppminus < $strings > mem.h
17076 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17078 echo "We won't be including <memory.h>."
17088 : can bcopy handle overlapping blocks?
17091 case "$d_memmove" in
17092 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17093 *) case "$d_bcopy" in
17095 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17097 #$i_memory I_MEMORY
17098 #$i_stdlib I_STDLIB
17099 #$i_string I_STRING
17100 #$i_unistd I_UNISTD
17102 $cat >>try.c <<'EOCP'
17105 # include <memory.h>
17108 # include <stdlib.h>
17111 # include <string.h>
17113 # include <strings.h>
17116 # include <unistd.h> /* Needed for NetBSD */
17120 char buf[128], abc[128];
17126 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17127 try to store the string in read-only memory. */
17128 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17130 for (align = 7; align >= 0; align--) {
17131 for (len = 36; len; len--) {
17133 bcopy(abc, b, len);
17134 for (off = 1; off <= len; off++) {
17135 bcopy(b, b+off, len);
17136 bcopy(b+off, b, len);
17137 if (bcmp(b, abc, len))
17146 if eval $compile_ok; then
17147 if $run ./try 2>/dev/null; then
17148 echo "Yes, it can."
17151 echo "It can't, sorry."
17154 echo "(I can't compile the test program, so we'll assume not...)"
17164 : can memcpy handle overlapping blocks?
17167 case "$d_memmove" in
17168 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17169 *) case "$d_memcpy" in
17171 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17173 #$i_memory I_MEMORY
17174 #$i_stdlib I_STDLIB
17175 #$i_string I_STRING
17176 #$i_unistd I_UNISTD
17178 $cat >>try.c <<'EOCP'
17181 # include <memory.h>
17184 # include <stdlib.h>
17187 # include <string.h>
17189 # include <strings.h>
17192 # include <unistd.h> /* Needed for NetBSD */
17196 char buf[128], abc[128];
17202 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17203 try to store the string in read-only memory. */
17204 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17206 for (align = 7; align >= 0; align--) {
17207 for (len = 36; len; len--) {
17209 memcpy(b, abc, len);
17210 for (off = 1; off <= len; off++) {
17211 memcpy(b+off, b, len);
17212 memcpy(b, b+off, len);
17213 if (memcmp(b, abc, len))
17222 if eval $compile_ok; then
17223 if $run ./try 2>/dev/null; then
17224 echo "Yes, it can."
17227 echo "It can't, sorry."
17230 echo "(I can't compile the test program, so we'll assume not...)"
17240 : can memcmp be trusted to compare relative magnitude?
17242 case "$d_memcmp" in
17245 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17247 #$i_memory I_MEMORY
17248 #$i_stdlib I_STDLIB
17249 #$i_string I_STRING
17250 #$i_unistd I_UNISTD
17252 $cat >>try.c <<'EOCP'
17255 # include <memory.h>
17258 # include <stdlib.h>
17261 # include <string.h>
17263 # include <strings.h>
17266 # include <unistd.h> /* Needed for NetBSD */
17272 if ((a < b) && memcmp(&a, &b, 1) < 0)
17278 if eval $compile_ok; then
17279 if $run ./try 2>/dev/null; then
17280 echo "Yes, it can."
17283 echo "No, it can't (it uses signed chars)."
17286 echo "(I can't compile the test program, so we'll assume not...)"
17294 : see if prototype for sbrk is available
17296 set d_sbrkproto sbrk $i_unistd unistd.h
17299 : see if select exists
17300 set select d_select
17303 : see if semctl exists
17304 set semctl d_semctl
17307 : see if semget exists
17308 set semget d_semget
17311 : see if semop exists
17315 : see how much of the 'sem*(2)' library is present.
17318 case "$d_semctl$d_semget$d_semop" in
17319 *"$undef"*) h_sem=false;;
17323 case "`ipcs 2>&1`" in
17324 "SVID messages"*"not configured"*)
17325 echo "Your $osname does not have the sem*(2) configured." >&4
17328 set semctl d_semctl
17330 set semget d_semget
17338 : we could also check for sys/ipc.h ...
17339 if $h_sem && $test `./findhdr sys/sem.h`; then
17340 echo "You have the full sem*(2) library." >&4
17343 echo "You don't have the full sem*(2) library." >&4
17349 : see whether sys/sem.h defines union semun
17351 $cat > try.c <<'END'
17352 #include <sys/types.h>
17353 #include <sys/ipc.h>
17354 #include <sys/sem.h>
17355 int main () { union semun semun; semun.buf = 0; }
17358 if eval $compile; then
17359 echo "You have union semun in <sys/sem.h>." >&4
17362 echo "You do not have union semun in <sys/sem.h>." >&4
17369 : see how to do semctl IPC_STAT
17373 $cat > tryh.h <<END
17376 # define S_IRUSR S_IREAD
17377 # define S_IWUSR S_IWRITE
17378 # define S_IXUSR S_IEXEC
17380 # define S_IRUSR 0400
17381 # define S_IWUSR 0200
17382 # define S_IXUSR 0100
17384 # define S_IRGRP (S_IRUSR>>3)
17385 # define S_IWGRP (S_IWUSR>>3)
17386 # define S_IXGRP (S_IXUSR>>3)
17387 # define S_IROTH (S_IRUSR>>6)
17388 # define S_IWOTH (S_IWUSR>>6)
17389 # define S_IXOTH (S_IXUSR>>6)
17392 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17393 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17394 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17397 : see whether semctl IPC_STAT can use union semun
17398 case "$d_semctl_semun" in
17402 #include <sys/types.h>
17403 #include <sys/ipc.h>
17404 #include <sys/sem.h>
17405 #include <sys/stat.h>
17412 #$d_union_semun HAS_UNION_SEMUN
17415 #ifndef HAS_UNION_SEMUN
17418 struct semid_ds *buf;
17419 unsigned short *array;
17425 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17426 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17428 struct semid_ds argbuf;
17431 st = semctl(sem, 0, IPC_STAT, arg);
17435 # endif /* IPC_STAT */
17436 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17438 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17439 # endif /* IPC_RMID */
17440 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17442 #endif /* IPC_PRIVATE && ... */
17443 printf("semget failed: errno = %d\n", errno);
17448 if eval $compile; then
17451 semun) val="$define" ;;
17459 case "$d_semctl_semun" in
17461 echo "You can use union semun for semctl IPC_STAT." >&4
17464 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17469 : see whether semctl IPC_STAT can use struct semid_ds pointer
17470 case "$d_semctl_semid_ds" in
17473 $cat > try.c <<'END'
17474 #include <sys/types.h>
17475 #include <sys/ipc.h>
17476 #include <sys/sem.h>
17477 #include <sys/stat.h>
17485 struct semid_ds arg;
17488 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17489 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17492 st = semctl(sem, 0, IPC_STAT, &arg);
17494 printf("semid_ds\n");
17496 # endif /* IPC_STAT */
17497 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17499 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17500 # endif /* IPC_RMID */
17501 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17503 #endif /* IPC_PRIVATE && ... */
17504 printf("semget failed: errno = %d\n", errno);
17510 if eval $compile; then
17513 semid_ds) val="$define" ;;
17517 set d_semctl_semid_ds
17521 case "$d_semctl_semid_ds" in
17523 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17525 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17531 # We do not have the full sem*(2) library, so assume we can not
17537 set d_semctl_semid_ds
17543 : see if sendmsg exists
17544 set sendmsg d_sendmsg
17547 : see if setegid exists
17548 set setegid d_setegid
17551 : see if seteuid exists
17552 set seteuid d_seteuid
17555 : see if setgrent exists
17556 set setgrent d_setgrent
17559 : see if setgrent_r exists
17560 set setgrent_r d_setgrent_r
17562 case "$d_setgrent_r" in
17564 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17565 case "$d_setgrent_r_proto:$usethreads" in
17566 ":define") d_setgrent_r_proto=define
17567 set d_setgrent_r_proto setgrent_r $hdrs
17571 case "$d_setgrent_r_proto" in
17573 case "$setgrent_r_proto" in
17574 ''|0) try='int setgrent_r(FILE**);'
17575 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17577 case "$setgrent_r_proto" in
17578 ''|0) try='void setgrent_r(FILE**);'
17579 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17581 case "$setgrent_r_proto" in
17582 ''|0) d_setgrent_r=undef
17584 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17585 * ) case "$setgrent_r_proto" in
17586 REENTRANT_PROTO*) ;;
17587 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17589 echo "Prototype: $try" ;;
17592 *) case "$usethreads" in
17593 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17600 *) setgrent_r_proto=0
17604 : see if sethostent exists
17605 set sethostent d_sethent
17608 : see if sethostent_r exists
17609 set sethostent_r d_sethostent_r
17611 case "$d_sethostent_r" in
17613 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17614 case "$d_sethostent_r_proto:$usethreads" in
17615 ":define") d_sethostent_r_proto=define
17616 set d_sethostent_r_proto sethostent_r $hdrs
17620 case "$d_sethostent_r_proto" in
17622 case "$sethostent_r_proto" in
17623 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17624 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17626 case "$sethostent_r_proto" in
17627 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17628 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17630 case "$sethostent_r_proto" in
17631 ''|0) d_sethostent_r=undef
17632 sethostent_r_proto=0
17633 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17634 * ) case "$sethostent_r_proto" in
17635 REENTRANT_PROTO*) ;;
17636 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17638 echo "Prototype: $try" ;;
17641 *) case "$usethreads" in
17642 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17644 d_sethostent_r=undef
17645 sethostent_r_proto=0
17649 *) sethostent_r_proto=0
17653 : see if setitimer exists
17654 set setitimer d_setitimer
17657 : see if setlinebuf exists
17658 set setlinebuf d_setlinebuf
17661 : see if setlocale exists
17662 set setlocale d_setlocale
17665 : see if locale.h is available
17666 set locale.h i_locale
17669 : see if setlocale_r exists
17670 set setlocale_r d_setlocale_r
17672 case "$d_setlocale_r" in
17674 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17675 case "$d_setlocale_r_proto:$usethreads" in
17676 ":define") d_setlocale_r_proto=define
17677 set d_setlocale_r_proto setlocale_r $hdrs
17681 case "$d_setlocale_r_proto" in
17683 case "$setlocale_r_proto" in
17684 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17685 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17687 case "$setlocale_r_proto" in
17688 ''|0) d_setlocale_r=undef
17689 setlocale_r_proto=0
17690 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17691 * ) case "$setlocale_r_proto" in
17692 REENTRANT_PROTO*) ;;
17693 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17695 echo "Prototype: $try" ;;
17698 *) case "$usethreads" in
17699 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17701 d_setlocale_r=undef
17702 setlocale_r_proto=0
17706 *) setlocale_r_proto=0
17710 : see if setnetent exists
17711 set setnetent d_setnent
17714 : see if setnetent_r exists
17715 set setnetent_r d_setnetent_r
17717 case "$d_setnetent_r" in
17719 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17720 case "$d_setnetent_r_proto:$usethreads" in
17721 ":define") d_setnetent_r_proto=define
17722 set d_setnetent_r_proto setnetent_r $hdrs
17726 case "$d_setnetent_r_proto" in
17728 case "$setnetent_r_proto" in
17729 ''|0) try='int setnetent_r(int, struct netent_data*);'
17730 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17732 case "$setnetent_r_proto" in
17733 ''|0) try='void setnetent_r(int, struct netent_data*);'
17734 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17736 case "$setnetent_r_proto" in
17737 ''|0) d_setnetent_r=undef
17738 setnetent_r_proto=0
17739 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17740 * ) case "$setnetent_r_proto" in
17741 REENTRANT_PROTO*) ;;
17742 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17744 echo "Prototype: $try" ;;
17747 *) case "$usethreads" in
17748 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17750 d_setnetent_r=undef
17751 setnetent_r_proto=0
17755 *) setnetent_r_proto=0
17759 : see if setprotoent exists
17760 set setprotoent d_setpent
17763 : see if setpgid exists
17764 set setpgid d_setpgid
17767 : see if setpgrp2 exists
17768 set setpgrp2 d_setpgrp2
17771 : see if setpriority exists
17772 set setpriority d_setprior
17775 : see if setproctitle exists
17776 set setproctitle d_setproctitle
17779 : see if setprotoent_r exists
17780 set setprotoent_r d_setprotoent_r
17782 case "$d_setprotoent_r" in
17784 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17785 case "$d_setprotoent_r_proto:$usethreads" in
17786 ":define") d_setprotoent_r_proto=define
17787 set d_setprotoent_r_proto setprotoent_r $hdrs
17791 case "$d_setprotoent_r_proto" in
17793 case "$setprotoent_r_proto" in
17794 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17795 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17797 case "$setprotoent_r_proto" in
17798 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17799 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17801 case "$setprotoent_r_proto" in
17802 ''|0) d_setprotoent_r=undef
17803 setprotoent_r_proto=0
17804 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17805 * ) case "$setprotoent_r_proto" in
17806 REENTRANT_PROTO*) ;;
17807 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17809 echo "Prototype: $try" ;;
17812 *) case "$usethreads" in
17813 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17815 d_setprotoent_r=undef
17816 setprotoent_r_proto=0
17820 *) setprotoent_r_proto=0
17824 : see if setpwent exists
17825 set setpwent d_setpwent
17828 : see if setpwent_r exists
17829 set setpwent_r d_setpwent_r
17831 case "$d_setpwent_r" in
17833 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17834 case "$d_setpwent_r_proto:$usethreads" in
17835 ":define") d_setpwent_r_proto=define
17836 set d_setpwent_r_proto setpwent_r $hdrs
17840 case "$d_setpwent_r_proto" in
17842 case "$setpwent_r_proto" in
17843 ''|0) try='int setpwent_r(FILE**);'
17844 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17846 case "$setpwent_r_proto" in
17847 ''|0) try='void setpwent_r(FILE**);'
17848 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17850 case "$setpwent_r_proto" in
17851 ''|0) d_setpwent_r=undef
17853 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17854 * ) case "$setpwent_r_proto" in
17855 REENTRANT_PROTO*) ;;
17856 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17858 echo "Prototype: $try" ;;
17861 *) case "$usethreads" in
17862 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17869 *) setpwent_r_proto=0
17873 : see if setregid exists
17874 set setregid d_setregid
17876 set setresgid d_setresgid
17879 : see if setreuid exists
17880 set setreuid d_setreuid
17882 set setresuid d_setresuid
17885 : see if setrgid exists
17886 set setrgid d_setrgid
17889 : see if setruid exists
17890 set setruid d_setruid
17893 : see if setservent exists
17894 set setservent d_setsent
17897 : see if setservent_r exists
17898 set setservent_r d_setservent_r
17900 case "$d_setservent_r" in
17902 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17903 case "$d_setservent_r_proto:$usethreads" in
17904 ":define") d_setservent_r_proto=define
17905 set d_setservent_r_proto setservent_r $hdrs
17909 case "$d_setservent_r_proto" in
17911 case "$setservent_r_proto" in
17912 ''|0) try='int setservent_r(int, struct servent_data*);'
17913 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17915 case "$setservent_r_proto" in
17916 ''|0) try='void setservent_r(int, struct servent_data*);'
17917 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17919 case "$setservent_r_proto" in
17920 ''|0) d_setservent_r=undef
17921 setservent_r_proto=0
17922 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17923 * ) case "$setservent_r_proto" in
17924 REENTRANT_PROTO*) ;;
17925 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17927 echo "Prototype: $try" ;;
17930 *) case "$usethreads" in
17931 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17933 d_setservent_r=undef
17934 setservent_r_proto=0
17938 *) setservent_r_proto=0
17942 : see if setsid exists
17943 set setsid d_setsid
17946 : see if setvbuf exists
17947 set setvbuf d_setvbuf
17950 : see if shmctl exists
17951 set shmctl d_shmctl
17954 : see if shmget exists
17955 set shmget d_shmget
17958 : see if shmat exists
17961 : see what shmat returns
17964 $cat >shmat.c <<'END'
17965 #include <sys/shm.h>
17968 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17973 echo "and it returns ($shmattype)." >&4
17974 : see if a prototype for shmat is available
17975 xxx=`./findhdr sys/shm.h`
17976 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17977 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17988 set d_shmatprototype
17991 : see if shmdt exists
17995 : see how much of the 'shm*(2)' library is present.
17998 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17999 *"$undef"*) h_shm=false;;
18003 case "`ipcs 2>&1`" in
18004 "SVID shared memory"*"not configured"*)
18005 echo "Your $osname does not have the shm*(2) configured." >&4
18008 set shmctl d_shmctl
18010 set shmget d_shmget
18020 : we could also check for sys/ipc.h ...
18021 if $h_shm && $test `./findhdr sys/shm.h`; then
18022 echo "You have the full shm*(2) library." >&4
18025 echo "You don't have the full shm*(2) library." >&4
18031 : see if we have sigaction
18033 if set sigaction val -f d_sigaction; eval $csym; $val; then
18034 echo 'sigaction() found.' >&4
18037 #include <sys/types.h>
18038 #include <signal.h>
18039 #$i_stdlib I_STDLIB
18041 #include <stdlib.h>
18045 struct sigaction act, oact;
18047 oact.sa_handler = 0;
18048 /* so that act and oact are used */
18049 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18053 if eval $compile_ok; then
18056 echo "But you don't seem to have a usable struct sigaction." >&4
18060 echo 'sigaction NOT found.' >&4
18063 set d_sigaction; eval $setvar
18066 : see if this is a sunmath.h system
18067 set sunmath.h i_sunmath
18070 : see if signbit exists
18071 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18074 #$i_sunmath I_SUNMATH
18078 #ifdef I_SUNMATH /* Solaris special math library */
18079 # include <sunmath.h>
18082 int main(int argc, char **argv)
18086 if ((signbit(x) == 0) && (signbit(y) != 0))
18094 if eval $compile; then
18095 if $run ./try; then
18099 $echo "Signbit seems to be available, but doesn't work as I expected."
18100 $echo "I won't use it." >&4
18111 : see if sigprocmask exists
18112 set sigprocmask d_sigprocmask
18115 : see if sigsetjmp exists
18117 case "$d_sigsetjmp" in
18120 #include <setjmp.h>
18121 #$i_stdlib I_STDLIB
18123 #include <stdlib.h>
18129 if (sigsetjmp(env,1))
18132 siglongjmp(env, 1);
18137 if eval $compile; then
18138 if $run ./try >/dev/null 2>&1; then
18139 echo "POSIX sigsetjmp found." >&4
18143 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18149 echo "sigsetjmp not found." >&4
18153 *) val="$d_sigsetjmp"
18154 case "$d_sigsetjmp" in
18155 $define) echo "POSIX sigsetjmp found." >&4;;
18156 $undef) echo "sigsetjmp not found." >&4;;
18164 : see if snprintf exists
18165 set snprintf d_snprintf
18168 : see if vsnprintf exists
18169 set vsnprintf d_vsnprintf
18172 case "$d_snprintf-$d_vsnprintf" in
18175 Checking whether your snprintf() and vsnprintf() work okay...
18177 $cat >try.c <<'EOCP'
18178 /* v?snprintf testing logic courtesy of Russ Allbery.
18179 * According to C99:
18180 * - if the buffer is too short it still must be \0-terminated
18181 * - if the buffer is too short the potentially required length
18182 * must be returned and not -1
18183 * - if the buffer is NULL the potentially required length
18184 * must be returned and not -1 or core dump
18187 #include <stdarg.h>
18191 int test (char *format, ...)
18196 va_start (args, format);
18197 count = vsnprintf (buf, sizeof buf, format, args);
18204 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18205 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18209 if eval $compile; then
18212 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18214 Your snprintf() and snprintf() don't seem to be working okay.
18216 d_snprintf="$undef"
18217 d_vsnprintf="$undef"
18221 echo "(I can't seem to compile the test program--assuming they don't)"
18222 d_snprintf="$undef"
18223 d_vsnprintf="$undef"
18229 : see if sockatmark exists
18230 set sockatmark d_sockatmark
18233 : see if prototype for sockatmark is available
18235 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18238 : see if socks5_init exists
18239 set socks5_init d_socks5_init
18242 : see if sprintf returns the length of the string in the buffer as per ANSI
18243 $echo "Checking whether sprintf returns the length of the string..." >&4
18246 #$i_stdlib I_STDLIB
18248 #include <stdlib.h>
18250 #$i_string I_STRING
18252 # include <string.h>
18254 # include <strings.h>
18263 int check (size_t expect, int test) {
18264 size_t got = strlen(buffer);
18268 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18273 int main(int argc, char **argv) {
18276 check(sprintf(buffer, ""), ++test);
18277 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18278 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18285 if eval $compile; then
18289 sprintf returns the length of the string (as ANSI says it should)
18291 d_sprintf_returns_strlen="$define"
18294 sprintf does not return the length of the string (how old is this system?)
18296 d_sprintf_returns_strlen="$undef"
18300 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18301 d_sprintf_returns_strlen="$undef"
18305 : see if srand48_r exists
18306 set srand48_r d_srand48_r
18308 case "$d_srand48_r" in
18310 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18311 case "$d_srand48_r_proto:$usethreads" in
18312 ":define") d_srand48_r_proto=define
18313 set d_srand48_r_proto srand48_r $hdrs
18317 case "$d_srand48_r_proto" in
18319 case "$srand48_r_proto" in
18320 ''|0) try='int srand48_r(long, struct drand48_data*);'
18321 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18323 case "$srand48_r_proto" in
18324 ''|0) d_srand48_r=undef
18326 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18327 * ) case "$srand48_r_proto" in
18328 REENTRANT_PROTO*) ;;
18329 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18331 echo "Prototype: $try" ;;
18334 *) case "$usethreads" in
18335 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18342 *) srand48_r_proto=0
18346 : see if srandom_r exists
18347 set srandom_r d_srandom_r
18349 case "$d_srandom_r" in
18351 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18352 case "$d_srandom_r_proto:$usethreads" in
18353 ":define") d_srandom_r_proto=define
18354 set d_srandom_r_proto srandom_r $hdrs
18358 case "$d_srandom_r_proto" in
18360 case "$srandom_r_proto" in
18361 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18362 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18364 case "$srandom_r_proto" in
18365 ''|0) d_srandom_r=undef
18367 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18368 * ) case "$srandom_r_proto" in
18369 REENTRANT_PROTO*) ;;
18370 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18372 echo "Prototype: $try" ;;
18375 *) case "$usethreads" in
18376 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18383 *) srandom_r_proto=0
18387 : see if prototype for setresgid is available
18389 set d_sresgproto setresgid $i_unistd unistd.h
18392 : see if prototype for setresuid is available
18394 set d_sresuproto setresuid $i_unistd unistd.h
18397 : see if sys/stat.h is available
18398 set sys/stat.h i_sysstat
18401 : see if stat knows about block sizes
18403 echo "Checking to see if your struct stat has st_blocks field..." >&4
18404 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18407 : see if this is a sys/vfs.h system
18408 set sys/vfs.h i_sysvfs
18411 : see if this is a sys/statfs.h system
18412 set sys/statfs.h i_sysstatfs
18415 : Check for statfs_s
18417 echo "Checking to see if your system supports struct statfs..." >&4
18418 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
18420 case "$d_statfs_s" in
18421 "$define") echo "Yes, it does." ;;
18422 *) echo "No, it doesn't." ;;
18426 : see if struct statfs knows about f_flags
18427 case "$d_statfs_s" in
18430 echo "Checking to see if your struct statfs has f_flags field..." >&4
18431 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
18435 set d_statfs_f_flags
18439 case "$d_statfs_f_flags" in
18440 "$define") echo "Yes, it does." ;;
18441 *) echo "No, it doesn't." ;;
18444 : see what flavor, if any, of static inline is supported
18446 echo "Checking to see if your system supports static inline..."
18447 $cat > try.c <<'EOCP'
18448 #include <stdlib.h>
18449 extern int f_via_a(int x);
18450 extern int f_via_b(int x);
18451 int main(int argc, char **argv)
18460 return EXIT_SUCCESS;
18463 return EXIT_FAILURE;
18467 $cat > a.c <<'EOCP'
18468 static INLINE int f(int x) {
18479 $cat > b.c <<'EOCP'
18480 extern int f(int x);
18488 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18489 case "$perl_static_inline" in
18490 '') # Check the various possibilities, and break out on success.
18491 # For gcc, prefer __inline__, which will still permit
18492 # cflags.SH to add in -ansi.
18493 case "$gccversion" in
18494 '') xxx="inline __inline__ __inline _inline";;
18495 *) xxx="__inline__ inline __inline _inline";;
18497 for inline in $xxx; do
18498 set try -DINLINE=$inline a.c
18499 if eval $compile && $run ./try; then
18500 # Now make sure there is no external linkage of static
18502 set try -DINLINE=$inline -DUSE_B a.c b.c
18503 if eval $compile && $run ./try; then
18504 $echo "Your compiler supports static $inline, " >&4
18505 $echo "but it also creates an external definition," >&4
18506 $echo "so I won't use it." >&4
18509 $echo "Your compiler supports static $inline." >&4
18511 perl_static_inline="static $inline";
18515 $echo "Your compiler does NOT support static $inline." >&4
18520 *inline*) # Some variant of inline exists.
18521 echo "Keeping your $hint value of $perl_static_inline."
18524 static) # No inline capabilities
18525 echo "Keeping your $hint value of $perl_static_inline."
18528 *) # Unrecognized previous value -- blindly trust the supplied
18529 # value and hope it makes sense. Use old value for
18530 # d_static_inline, if there is one.
18531 echo "Keeping your $hint value of $perl_static_inline."
18532 case "$d_static_inline" in
18534 *) val=$d_static_inline ;;
18538 # Fallback to plain 'static' if nothing worked.
18539 case "$perl_static_inline" in
18541 perl_static_inline="static"
18545 set d_static_inline
18547 $rm -f a.[co] b.[co]
18550 : Check stream access
18552 Checking how to access stdio streams by file descriptor number...
18554 case "$stdio_stream_array" in
18555 '') $cat >try.c <<EOCP
18558 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18562 for s in _iob __iob __sF
18564 set try -DSTDIO_STREAM_ARRAY=$s
18565 if eval $compile; then
18566 case "`$run ./try`" in
18567 yes) stdio_stream_array=$s; break ;;
18573 case "$stdio_stream_array" in
18575 I can't figure out how to access stdio streams by file descriptor number.
18577 d_stdio_stream_array="$undef"
18580 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18582 d_stdio_stream_array="$define"
18586 : see if strcoll exists
18587 set strcoll d_strcoll
18590 : check for structure copying
18592 echo "Checking to see if your C compiler can copy structs..." >&4
18593 $cat >try.c <<'EOCP'
18603 if $cc -c try.c >/dev/null 2>&1 ; then
18605 echo "Yup, it can."
18608 echo "Nope, it can't."
18614 : see if strerror and/or sys_errlist[] exist
18616 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18617 if set strerror val -f d_strerror; eval $csym; $val; then
18618 echo 'strerror() found.' >&4
18619 d_strerror="$define"
18620 d_strerrm='strerror(e)'
18621 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18622 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18623 d_syserrlst="$define"
18625 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18626 d_syserrlst="$undef"
18628 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18629 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18630 echo 'strerror() found in string header.' >&4
18631 d_strerror="$define"
18632 d_strerrm='strerror(e)'
18633 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18634 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18635 d_syserrlst="$define"
18637 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18638 d_syserrlst="$undef"
18640 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18641 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18642 d_strerror="$undef"
18643 d_syserrlst="$define"
18644 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18646 echo 'strerror() and sys_errlist[] NOT found.' >&4
18647 d_strerror="$undef"
18648 d_syserrlst="$undef"
18649 d_strerrm='"unknown"'
18653 : see if strerror_r exists
18654 set strerror_r d_strerror_r
18656 case "$d_strerror_r" in
18658 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18659 case "$d_strerror_r_proto:$usethreads" in
18660 ":define") d_strerror_r_proto=define
18661 set d_strerror_r_proto strerror_r $hdrs
18665 case "$d_strerror_r_proto" in
18667 case "$strerror_r_proto" in
18668 ''|0) try='int strerror_r(int, char*, size_t);'
18669 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18671 case "$strerror_r_proto" in
18672 ''|0) try='int strerror_r(int, char*, int);'
18673 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18675 case "$strerror_r_proto" in
18676 ''|0) try='char* strerror_r(int, char*, size_t);'
18677 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18679 case "$strerror_r_proto" in
18680 ''|0) d_strerror_r=undef
18682 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18683 * ) case "$strerror_r_proto" in
18684 REENTRANT_PROTO*) ;;
18685 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18687 echo "Prototype: $try" ;;
18690 *) case "$usethreads" in
18691 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18698 *) strerror_r_proto=0
18702 : see if strftime exists
18703 set strftime d_strftime
18706 : see if strlcat exists
18707 set strlcat d_strlcat
18710 : see if strlcpy exists
18711 set strlcpy d_strlcpy
18714 : see if strtod exists
18715 set strtod d_strtod
18718 : see if strtol exists
18719 set strtol d_strtol
18722 : see if strtold exists
18723 set strtold d_strtold
18726 : see if strtoll exists
18727 set strtoll d_strtoll
18730 case "$d_longlong-$d_strtoll" in
18733 Checking whether your strtoll() works okay...
18735 $cat >try.c <<'EOCP'
18738 #define strtoll __strtoll
18741 #define strtoll _strtoll
18744 extern long long int strtoll(char *s, char **, int);
18745 static int bad = 0;
18746 int check(char *s, long long ell, int een) {
18749 gll = strtoll(s, 0, 10);
18750 if (!((gll == ell) && (errno == een)))
18754 check(" 1", 1LL, 0);
18755 check(" 0", 0LL, 0);
18756 check("-1", -1LL, 0);
18757 check("-9223372036854775808", -9223372036854775808LL, 0);
18758 check("-9223372036854775808", -9223372036854775808LL, 0);
18759 check(" 9223372036854775807", 9223372036854775807LL, 0);
18760 check("-9223372036854775808", -9223372036854775808LL, 0);
18761 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18762 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18768 if eval $compile; then
18771 ok) echo "Your strtoll() seems to be working okay." ;;
18773 Your strtoll() doesn't seem to be working okay.
18779 echo "(I can't seem to compile the test program--assuming it doesn't)"
18785 : see if strtoq exists
18786 set strtoq d_strtoq
18789 : see if strtoul exists
18790 set strtoul d_strtoul
18793 case "$d_strtoul" in
18796 Checking whether your strtoul() works okay...
18798 $cat >try.c <<'EOCP'
18801 extern unsigned long int strtoul(char *s, char **, int);
18802 static int bad = 0;
18803 void check(char *s, unsigned long eul, int een) {
18806 gul = strtoul(s, 0, 10);
18807 if (!((gul == eul) && (errno == een)))
18811 check(" 1", 1L, 0);
18812 check(" 0", 0L, 0);
18814 case "$longsize" in
18816 $cat >>try.c <<'EOCP'
18817 check("18446744073709551615", 18446744073709551615UL, 0);
18818 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18819 #if 0 /* strtoul() for /^-/ strings is undefined. */
18820 check("-1", 18446744073709551615UL, 0);
18821 check("-18446744073709551614", 2, 0);
18822 check("-18446744073709551615", 1, 0);
18823 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18824 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18829 $cat >>try.c <<'EOCP'
18830 check("4294967295", 4294967295UL, 0);
18831 check("4294967296", 4294967295UL, ERANGE);
18832 #if 0 /* strtoul() for /^-/ strings is undefined. */
18833 check("-1", 4294967295UL, 0);
18834 check("-4294967294", 2, 0);
18835 check("-4294967295", 1, 0);
18836 check("-4294967296", 4294967295UL, ERANGE);
18837 check("-4294967297", 4294967295UL, ERANGE);
18842 : Should we write these tests to be more portable by sprintf-ing
18843 : ~0 and then manipulating that char string as input for strtol?
18846 $cat >>try.c <<'EOCP'
18853 if eval $compile; then
18854 case "`$run ./try`" in
18855 ok) echo "Your strtoul() seems to be working okay." ;;
18857 Your strtoul() doesn't seem to be working okay.
18863 echo "(I can't seem to compile the test program--assuming it doesn't)"
18869 : see if strtoull exists
18870 set strtoull d_strtoull
18873 case "$d_longlong-$d_strtoull" in
18876 Checking whether your strtoull() works okay...
18878 $cat >try.c <<'EOCP'
18881 #define strtoull __strtoull
18884 extern unsigned long long int strtoull(char *s, char **, int);
18885 static int bad = 0;
18886 int check(char *s, long long eull, int een) {
18889 gull = strtoull(s, 0, 10);
18890 if (!((gull == eull) && (errno == een)))
18894 check(" 1", 1LL, 0);
18895 check(" 0", 0LL, 0);
18896 check("18446744073709551615", 18446744073709551615ULL, 0);
18897 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18898 #if 0 /* strtoull() for /^-/ strings is undefined. */
18899 check("-1", 18446744073709551615ULL, 0);
18900 check("-18446744073709551614", 2LL, 0);
18901 check("-18446744073709551615", 1LL, 0);
18902 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18903 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18910 if eval $compile; then
18911 case "`$run ./try`" in
18912 ok) echo "Your strtoull() seems to be working okay." ;;
18914 Your strtoull() doesn't seem to be working okay.
18916 d_strtoull="$undef"
18920 echo "(I can't seem to compile the test program--assuming it doesn't)"
18921 d_strtoull="$undef"
18926 : see if strtouq exists
18927 set strtouq d_strtouq
18930 case "$d_strtouq" in
18933 Checking whether your strtouq() works okay...
18935 $cat >try.c <<'EOCP'
18938 extern unsigned long long int strtouq(char *s, char **, int);
18939 static int bad = 0;
18940 void check(char *s, unsigned long long eull, int een) {
18941 unsigned long long gull;
18943 gull = strtouq(s, 0, 10);
18944 if (!((gull == eull) && (errno == een)))
18948 check(" 1", 1LL, 0);
18949 check(" 0", 0LL, 0);
18950 check("18446744073709551615", 18446744073709551615ULL, 0);
18951 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18952 #if 0 /* strtouq() for /^-/ strings is undefined. */
18953 check("-1", 18446744073709551615ULL, 0);
18954 check("-18446744073709551614", 2LL, 0);
18955 check("-18446744073709551615", 1LL, 0);
18956 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18957 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18965 if eval $compile; then
18966 case "`$run ./try`" in
18967 ok) echo "Your strtouq() seems to be working okay." ;;
18969 Your strtouq() doesn't seem to be working okay.
18975 echo "(I can't seem to compile the test program--assuming it doesn't)"
18981 : see if strxfrm exists
18982 set strxfrm d_strxfrm
18985 : see if symlink exists
18986 set symlink d_symlink
18989 : see if syscall exists
18990 set syscall d_syscall
18993 : see if prototype for syscall is available
18995 set d_syscallproto syscall $i_unistd unistd.h
18998 : see if sysconf exists
18999 set sysconf d_sysconf
19002 : see if system exists
19003 set system d_system
19006 : see if tcgetpgrp exists
19007 set tcgetpgrp d_tcgetpgrp
19010 : see if tcsetpgrp exists
19011 set tcsetpgrp d_tcsetpgrp
19014 : see if prototype for telldir is available
19016 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19019 : see if time exists
19021 if test "X$d_time" = X -o X"$timetype" = X; then
19022 if set time val -f d_time; eval $csym; $val; then
19023 echo 'time() found.' >&4
19025 rp="What is the type returned by time() on this system?"
19026 set time_t timetype long stdio.h sys/types.h
19029 echo 'time() not found, hope that will do.' >&4
19037 : see if timegm exists
19038 set timegm d_timegm
19041 : see if this is a sys/times.h system
19042 set sys/times.h i_systimes
19045 : see if times exists
19047 if set times val -f d_times; eval $csym; $val; then
19048 echo 'times() found.' >&4
19051 case "$i_systimes" in
19052 "$define") inc='sys/times.h';;
19054 rp="What is the type returned by times() on this system?"
19055 set clock_t clocktype long stdio.h sys/types.h $inc
19058 echo 'times() NOT found, hope that will do.' >&4
19063 : see if tmpnam_r exists
19064 set tmpnam_r d_tmpnam_r
19066 case "$d_tmpnam_r" in
19068 hdrs="$i_systypes sys/types.h define stdio.h "
19069 case "$d_tmpnam_r_proto:$usethreads" in
19070 ":define") d_tmpnam_r_proto=define
19071 set d_tmpnam_r_proto tmpnam_r $hdrs
19075 case "$d_tmpnam_r_proto" in
19077 case "$tmpnam_r_proto" in
19078 ''|0) try='char* tmpnam_r(char*);'
19079 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19081 case "$tmpnam_r_proto" in
19082 ''|0) d_tmpnam_r=undef
19084 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19085 * ) case "$tmpnam_r_proto" in
19086 REENTRANT_PROTO*) ;;
19087 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19089 echo "Prototype: $try" ;;
19092 *) case "$usethreads" in
19093 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19100 *) tmpnam_r_proto=0
19104 : see if truncate exists
19105 set truncate d_truncate
19108 : see if ttyname_r exists
19109 set ttyname_r d_ttyname_r
19111 case "$d_ttyname_r" in
19113 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19114 case "$d_ttyname_r_proto:$usethreads" in
19115 ":define") d_ttyname_r_proto=define
19116 set d_ttyname_r_proto ttyname_r $hdrs
19120 case "$d_ttyname_r_proto" in
19122 case "$ttyname_r_proto" in
19123 ''|0) try='int ttyname_r(int, char*, size_t);'
19124 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19126 case "$ttyname_r_proto" in
19127 ''|0) try='int ttyname_r(int, char*, int);'
19128 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19130 case "$ttyname_r_proto" in
19131 ''|0) try='char* ttyname_r(int, char*, int);'
19132 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19134 case "$ttyname_r_proto" in
19135 ''|0) d_ttyname_r=undef
19137 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19138 * ) case "$ttyname_r_proto" in
19139 REENTRANT_PROTO*) ;;
19140 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19142 echo "Prototype: $try" ;;
19145 *) case "$usethreads" in
19146 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19153 *) ttyname_r_proto=0
19157 : see if tzname[] exists
19159 if set tzname val -a d_tzname; eval $csym; $val; then
19161 echo 'tzname[] found.' >&4
19164 echo 'tzname[] NOT found.' >&4
19169 : Check if is a multiplatform env
19171 darwin) multiarch="$define" ;;
19173 case "$multiarch" in
19174 ''|[nN]*) multiarch="$undef" ;;
19177 : check for ordering of bytes in a UV
19179 case "$multiarch" in
19182 You seem to be doing a multiarchitecture build,
19183 skipping the byteorder check.
19189 case "$byteorder" in
19192 In the following, larger digits indicate more significance. A big-endian
19193 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19194 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19195 machines may have weird orders like 3412. A Cray will report 87654321,
19196 an Alpha will report 12345678. If the test program works the default is
19198 I'm now running the test program...
19202 #$i_stdlib I_STDLIB
19204 #include <stdlib.h>
19206 #include <sys/types.h>
19207 typedef $uvtype UV;
19217 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19219 u.l = (UV)0x04030201;
19220 for (i = 0; i < $uvsize; i++)
19221 printf("%c", u.c[i]+'0');
19228 if eval $compile && $run ./try > /dev/null; then
19231 [1-4][1-4][1-4][1-4]|12345678|87654321)
19232 echo "(The test program ran ok.)"
19233 echo "byteorder=$dflt"
19236 ????|????????) echo "(The test program ran ok.)" ;;
19237 *) echo "(The test program didn't run right for some reason.)" ;;
19242 (I can't seem to compile the test program. Guessing big-endian...)
19245 case "$xxx_prompt" in
19247 rp="What is the order of bytes in $uvtype?"
19260 : Checking 32bit alignedness
19263 Checking to see whether you can access character data unalignedly...
19265 case "$d_u32align" in
19266 '') $cat >try.c <<EOCP
19268 #$i_stdlib I_STDLIB
19270 #include <stdlib.h>
19272 #define U32 $u32type
19273 #define BYTEORDER 0x$byteorder
19275 #include <signal.h>
19277 $signal_t bletch(int s) { exit(4); }
19280 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19281 volatile U8 buf[8];
19285 if (sizeof(U32) != 4) {
19286 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19293 signal(SIGBUS, bletch);
19305 for (i = 0; i < 4; i++) {
19306 up = (U32*)(buf + i);
19307 if (! ((*up == 1 << (8*i)) || /* big-endian */
19308 (*up == 1 << (8*(3-i))) /* little-endian */
19312 printf("read failed (%x)\n", *up);
19318 for (i = 0; i < 4; i++) {
19319 up = (U32*)(buf + i);
19321 if (*up != 0xBeef) {
19322 printf("write failed (%x)\n", *up);
19336 if eval $compile_ok; then
19337 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19338 $run ./try 2>&1 >/dev/null
19341 You can access character data pretty unalignedly.
19343 d_u32align="$undef"
19346 It seems that you must access character data in an aligned manner.
19348 d_u32align="$define"
19352 rp='Can you access character data at unaligned addresses?'
19356 [yY]*) d_u32align="$undef" ;;
19357 *) d_u32align="$define" ;;
19364 : see if ualarm exists
19365 set ualarm d_ualarm
19368 : see if umask exists
19372 : see if unordered exists
19373 set unordered d_unordered
19376 : see if unsetenv exists
19377 set unsetenv d_unsetenv
19380 : see if usleep exists
19381 set usleep d_usleep
19384 : see if prototype for usleep is available
19386 set d_usleepproto usleep $i_unistd unistd.h
19389 : see if ustat exists
19393 : see if closedir exists
19394 set closedir d_closedir
19397 case "$d_closedir" in
19400 echo "Checking whether closedir() returns a status..." >&4
19402 #$i_dirent I_DIRENT /**/
19403 #$i_sysdir I_SYS_DIR /**/
19404 #$i_sysndir I_SYS_NDIR /**/
19405 #$i_systypes I_SYS_TYPES /**/
19407 #if defined(I_SYS_TYPES)
19408 #include <sys/types.h>
19410 #if defined(I_DIRENT)
19411 #include <dirent.h>
19414 #include <sys/ndir.h>
19418 #include <ndir.h> /* may be wrong in the future */
19420 #include <sys/dir.h>
19425 int main() { return closedir(opendir(".")); }
19428 if eval $compile_ok; then
19429 if $run ./try > /dev/null 2>&1 ; then
19430 echo "Yes, it does."
19433 echo "No, it doesn't."
19437 echo "(I can't seem to compile the test program--assuming it doesn't)"
19445 set d_void_closedir
19449 : see if there is a wait4
19453 : see if waitpid exists
19454 set waitpid d_waitpid
19459 $cat >try.c <<'EOCP'
19465 return (wcscmp (s, s) ? 1 : 0);
19470 if eval $compile; then
19473 0) echo "A working wcscmp() found." >&4
19475 *) echo "wcscmp() found, but it doesn't work" >&4
19479 echo "wcscmp() NOT found." >&4
19485 : see if wcstombs exists
19486 set wcstombs d_wcstombs
19491 $cat >try.c <<'EOCP'
19496 wchar_t dst[4], *src = L" ";
19498 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19503 if eval $compile; then
19506 0) echo "A working wcsxfrm() found." >&4
19508 *) echo "wcsxfrm() found, but it doesn't work" >&4
19512 echo "wcsxfrm() NOT found." >&4
19518 : see if wctomb exists
19519 set wctomb d_wctomb
19522 : see if writev exists
19523 set writev d_writev
19526 : check for alignment requirements
19528 case "$alignbytes" in
19529 '') echo "Checking alignment constraints..." >&4
19530 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19531 $cat >try.c <<'EOCP'
19532 typedef long double NV;
19535 $cat >try.c <<'EOCP'
19539 $cat >>try.c <<'EOCP'
19547 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19552 if eval $compile_ok; then
19556 echo "(I can't seem to compile the test program...)"
19558 case "$multiarch" in
19560 : The usual safe value is 8, but Darwin with -Duselongdouble
19561 : needs 16. Hence, we will take 8 as a minimum, but allow
19562 : Configure to pick a larger value if needed.
19563 if $test "$dflt" -lt 8; then
19565 echo "Setting alignment to 8 for multiarch support.">&4
19570 *) dflt="$alignbytes"
19573 rp="Doubles must be aligned on a how-many-byte boundary?"
19578 : set the base revision
19581 : length of character in bytes. Is always 1, otherwise it is not C
19582 : This used to be a test using sizeof
19585 : Check for the number of bits in a character
19586 case "$charbits" in
19587 '') echo "Checking how long a character is (in bits)..." >&4
19594 for (c = 1, n = 0; c; c <<= 1, n++) ;
19595 printf ("%d\n", n);
19600 if eval $compile_ok; then
19604 echo "(I can't seem to compile the test program. Guessing...)"
19611 rp="What is the length of a character (in bits)?"
19615 case "$charbits" in
19618 Your system has an unsigned character size of $charbits bits, which
19619 is rather unusual (normally it is 8 bits). Perl likely will not work
19620 correctly on your system, with subtle bugs in various places.
19622 rp='Do you really want to continue?'
19626 [yY]) echo >&4 "Okay, continuing." ;;
19631 : how do we concatenate cpp tokens here?
19633 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19634 $cat >cpp_stuff.c <<'EOCP'
19635 #define RCAT(a,b)a/**/b
19636 #define ACAT(a,b)a ## b
19640 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19641 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19642 echo "Oh! Smells like ANSI's been here." >&4
19643 echo "We can catify or stringify, separately or together!"
19645 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19646 echo "Ah, yes! The good old days!" >&4
19647 echo "However, in the good old days we don't know how to stringify and"
19648 echo "catify at the same time."
19652 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19653 You're going to have to edit the values of CAT[2-5] in config.h...
19655 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19659 : see if this is a db.h system
19665 : Check db version.
19667 echo "Checking Berkeley DB version ..." >&4
19673 #include <sys/types.h>
19675 #$i_stdlib I_STDLIB
19677 #include <stdlib.h>
19680 int main(int argc, char *argv[])
19682 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19683 int Major, Minor, Patch ;
19684 unsigned long Version ;
19685 (void)db_version(&Major, &Minor, &Patch) ;
19687 printf("%d %d %d %d %d %d\n",
19688 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19689 Major, Minor, Patch);
19692 printf("You have Berkeley DB Version 2 or greater.\n");
19694 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19695 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19696 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19697 Major, Minor, Patch) ;
19699 /* check that db.h & libdb are compatible */
19700 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19701 printf("db.h and libdb are incompatible.\n") ;
19705 printf("db.h and libdb are compatible.\n") ;
19707 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19708 + DB_VERSION_PATCH ;
19710 /* needs to be >= 2.3.4 */
19711 if (Version < 2003004) {
19712 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19713 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19719 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19724 printf("You have Berkeley DB Version 1.\n");
19725 exit(0); /* DB version < 2: the coast is clear. */
19727 exit(1); /* <db.h> not Berkeley DB? */
19733 if eval $compile_ok && $run ./try; then
19734 echo 'Looks OK.' >&4
19736 db_version_major=$1
19737 db_version_minor=$2
19738 db_version_patch=$3
19740 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19744 : Remove db from list of libraries to use
19745 echo "Removing unusable -ldb from library list" >&4
19746 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19749 echo "libs = $libs" >&4
19759 : Check the return type needed for hash
19761 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19767 #include <sys/types.h>
19770 #ifndef DB_VERSION_MAJOR
19771 u_int32_t hash_cb (const void* ptr, size_t size)
19777 info.hash = hash_cb;
19781 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19782 if $contains warning try.out >>/dev/null 2>&1 ; then
19785 db_hashtype='u_int32_t'
19788 : XXX Maybe we should just give up here.
19789 db_hashtype=u_int32_t
19791 echo "Help: I can't seem to compile the db test program." >&4
19792 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19795 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19797 *) db_hashtype=u_int32_t
19802 : Check the return type needed for prefix
19804 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19810 #include <sys/types.h>
19813 #ifndef DB_VERSION_MAJOR
19814 size_t prefix_cb (const DBT *key1, const DBT *key2)
19820 info.prefix = prefix_cb;
19824 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19825 if $contains warning try.out >>/dev/null 2>&1 ; then
19826 db_prefixtype='int'
19828 db_prefixtype='size_t'
19831 db_prefixtype='size_t'
19832 : XXX Maybe we should just give up here.
19834 echo "Help: I can't seem to compile the db test program." >&4
19835 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19838 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19840 *) db_prefixtype='size_t'
19844 : How can we generate normalized random numbers ?
19846 echo "Using our internal random number implementation..." >&4
19849 *-Dmy_rand=*|*-Dmy_srand=*)
19850 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19851 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19852 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19853 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19857 randfunc=Perl_drand48
19858 drand01="Perl_drand48()"
19859 seedfunc="Perl_drand48_init"
19863 : Determine if this is an EBCDIC system
19865 echo "Determining whether or not we are on an EBCDIC system..." >&4
19866 $cat >try.c <<'EOM'
19869 if ('M'==0xd4) return 0;
19876 if eval $compile_ok; then
19877 if $run ./try; then
19878 echo "You seem to speak EBCDIC." >&4
19881 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19884 echo "I'm unable to compile the test program." >&4
19885 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19891 : Check how to flush
19894 Checking how to flush all pending stdio output...
19896 # I only know how to find the first 32 possibly open files on SunOS.
19897 # See also hints/sunos_4_1.sh and util.c --AD
19899 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19901 $cat >>try.c <<EOCP
19903 #$i_stdlib I_STDLIB
19905 #include <stdlib.h>
19907 #$i_unistd I_UNISTD
19909 # include <unistd.h>
19911 #$d_sysconf HAS_SYSCONF
19912 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19913 #ifdef HAS_STDIO_STREAM_ARRAY
19914 # define STDIO_STREAM_ARRAY $stdio_stream_array
19919 p = fopen("try.out", "w");
19923 # ifdef TRY_FPRINTF
19927 #ifdef TRY_FFLUSH_NULL
19930 #ifdef TRY_FFLUSH_ALL
19932 long open_max = -1;
19933 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19934 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19936 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19937 open_max = sysconf(_SC_OPEN_MAX);
19940 open_max = FOPEN_MAX;
19943 open_max = OPEN_MAX;
19952 # ifdef HAS_STDIO_STREAM_ARRAY
19953 if (open_max > 0) {
19955 for (i = 0; i < open_max; i++)
19956 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19957 STDIO_STREAM_ARRAY[i]._file < open_max &&
19958 STDIO_STREAM_ARRAY[i]._flag)
19959 fflush(&STDIO_STREAM_ARRAY[i]);
19967 : first we have to find out how _not_ to flush
19969 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19971 set try -DTRY_FPUTC
19972 if eval $compile; then
19973 $run ./try 2>/dev/null
19976 if $test ! -s try.out -a "X$code" = X42; then
19982 set try -DTRY_FPRINTF
19983 if eval $compile; then
19984 $run ./try 2>/dev/null
19987 if $test ! -s try.out -a "X$code" = X42; then
19988 output=-DTRY_FPRINTF
19994 : check for fflush NULL behavior
19995 case "$fflushNULL" in
19996 '') set try -DTRY_FFLUSH_NULL $output
19997 if eval $compile; then
19998 $run ./try 2>/dev/null
20001 if $test -s try.out -a "X$code" = X42; then
20002 fflushNULL="`$cat try.out`"
20004 if $test "X$code" != X42; then
20006 (If this test failed, don't worry, we'll try another method shortly.)
20011 $rm -f core try.core core.try.*
20012 case "$fflushNULL" in
20014 Your fflush(NULL) works okay for output streams.
20015 Let's see if it clobbers input pipes...
20017 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20018 # bug that improperly flushes the input end of pipes. So we avoid the
20019 # autoflush on fork/system/exec support for now. :-(
20020 $cat >tryp.c <<EOCP
20023 main(int argc, char **argv)
20029 while ((i = getc(stdin)) != -1
20030 && (*bp++ = i) != '\n'
20031 && bp < &buf[1024])
20034 fprintf(stdout, "%s", buf);
20042 fflushNULL="$define"
20044 if eval $compile; then
20046 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20047 if $test "X$targethost" != X; then
20050 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20052 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20054 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20056 fflush(NULL) seems to behave okay with input streams.
20058 fflushNULL="$define"
20061 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20063 fflushNULL="$undef"
20066 $rm -f core tryp.c tryp.core core.tryp.*
20069 Your fflush(NULL) isn't working (contrary to ANSI C).
20071 fflushNULL="$undef"
20074 Cannot figure out whether your fflush(NULL) works or not.
20075 I'm assuming it doesn't (contrary to ANSI C).
20077 fflushNULL="$undef"
20081 $define|true|[yY]*)
20082 fflushNULL="$define"
20085 fflushNULL="$undef"
20088 : check explicit looping only if NULL did not work, and if the pipe
20089 : bug does not show up on an explicit flush too
20090 case "$fflushNULL" in
20092 $cat >tryp.c <<EOCP
20095 main(int argc, char **argv)
20101 while ((i = getc(stdin)) != -1
20102 && (*bp++ = i) != '\n'
20103 && bp < &buf[1024])
20106 fprintf(stdout, "%s", buf);
20115 if eval $compile; then
20117 if $test "X$targethost" != X; then
20120 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20122 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20124 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20126 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20128 : now check for fflushall behaviour
20129 case "$fflushall" in
20130 '') set try -DTRY_FFLUSH_ALL $output
20131 if eval $compile; then
20133 (Now testing the other method--but note that this also may fail.)
20135 $run ./try 2>/dev/null
20138 if $test -s try.out -a "X$code" = X42; then
20139 fflushall="`$cat try.out`"
20143 case "$fflushall" in
20145 Whew. Flushing explicitly all the stdio streams works.
20147 fflushall="$define"
20150 Sigh. Flushing explicitly all the stdio streams doesn't work.
20155 Cannot figure out whether flushing stdio streams explicitly works or not.
20156 I'm assuming it doesn't.
20162 "$define"|true|[yY]*)
20163 fflushall="$define"
20171 All is futile. Even fflush(stdin) clobbers input pipes!
20178 $rm -f core tryp.c tryp.core core.tryp.*
20180 *) fflushall="$undef"
20184 case "$fflushNULL$fflushall" in
20187 OK, I give up. I cannot figure out how to flush pending stdio output.
20188 We won't be flushing handles at all before fork/exec/popen.
20194 : Store the full pathname to the ar program for use in the C program
20195 : Respect a hint or command line value for full_ar.
20200 : Store the full pathname to the sed program for use in the C program
20203 : see what type gids are declared as in the kernel
20205 echo "Looking for the type for group ids returned by getgid()."
20206 set gid_t gidtype xxx stdio.h sys/types.h
20210 xxx=`./findhdr sys/user.h`
20211 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20213 unsigned) dflt="$1 $2" ;;
20217 *) dflt="$gidtype";;
20220 gid_t) echo "gid_t found." ;;
20221 *) rp="What is the type for group ids returned by getgid()?"
20227 : Check the size of GID
20230 *_t) zzz="$gidtype" ;;
20233 echo "Checking the size of $zzz..." >&4
20235 #include <sys/types.h>
20237 #$i_stdlib I_STDLIB
20239 #include <stdlib.h>
20242 printf("%d\n", (int)sizeof($gidtype));
20247 if eval $compile_ok; then
20251 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20254 echo "Your $zzz is $gidsize bytes long."
20259 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20263 : Check if GID is signed
20266 *_t) zzz="$gidtype" ;;
20269 echo "Checking the sign of $zzz..." >&4
20271 #include <sys/types.h>
20282 if eval $compile; then
20286 echo "(I can't execute the test program--guessing unsigned.)" >&4
20290 1) echo "Your $zzz is unsigned." ;;
20291 -1) echo "Your $zzz is signed." ;;
20297 echo "(I can't compile the test program--guessing unsigned.)" >&4
20301 : Check 64bit sizes
20304 if $test X"$quadtype" != X; then
20306 echo "Checking how to print 64-bit integers..." >&4
20308 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20309 $cat >try.c <<'EOCP'
20310 #include <sys/types.h>
20313 int q = 12345678901;
20314 printf("%ld\n", q);
20318 if eval $compile; then
20322 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20323 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20324 echo "We will use %d."
20330 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20331 $cat >try.c <<'EOCP'
20332 #include <sys/types.h>
20335 long q = 12345678901;
20336 printf("%ld\n", q);
20340 if eval $compile; then
20344 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20345 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20346 echo "We will use %ld."
20352 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20353 $cat >try.c <<'EOCP'
20354 #include <sys/types.h>
20355 #include <inttypes.h>
20358 int64_t q = 12345678901;
20359 printf("%" PRId64 "\n", q);
20363 if eval $compile; then
20367 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20368 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20369 echo "We will use the C9X style."
20375 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20377 #include <sys/types.h>
20380 $quadtype q = 12345678901;
20381 printf("%Ld\n", q);
20385 if eval $compile; then
20389 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20390 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20391 echo "We will use %Ld."
20397 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20398 $cat >try.c <<'EOCP'
20399 #include <sys/types.h>
20402 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20403 printf("%lld\n", q);
20407 if eval $compile; then
20411 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20412 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20413 echo "We will use the %lld style."
20419 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20421 #include <sys/types.h>
20424 $quadtype q = 12345678901;
20425 printf("%qd\n", q);
20429 if eval $compile; then
20433 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20434 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20435 echo "We will use %qd."
20441 if $test X"$sPRId64" = X; then
20442 echo "Cannot figure out how to print 64-bit integers." >&4
20449 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20450 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20452 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20453 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20457 : Check format strings for internal types
20459 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20461 if $test X"$ivsize" = X8; then
20462 ivdformat="$sPRId64"
20463 uvuformat="$sPRIu64"
20464 uvoformat="$sPRIo64"
20465 uvxformat="$sPRIx64"
20466 uvXUformat="$sPRIXU64"
20468 if $test X"$ivsize" = X"$longsize"; then
20475 if $test X"$ivsize" = X"$intsize"; then
20483 if $test X"$ivsize" = X"$shortsize"; then
20494 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20495 nveformat="$sPRIeldbl"
20496 nvfformat="$sPRIfldbl"
20497 nvgformat="$sPRIgldbl"
20498 nvEUformat="$sPRIEUldbl"
20499 nvFUformat="$sPRIFUldbl"
20500 nvGUformat="$sPRIGUldbl"
20510 case "$ivdformat" in
20511 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20516 : Check format string for GID
20519 $echo "Checking the format string to be used for gids..." >&4
20522 -1) if $test X"$gidsize" = X"$ivsize"; then
20523 gidformat="$ivdformat"
20525 if $test X"$gidsize" = X"$longsize"; then
20528 if $test X"$gidsize" = X"$intsize"; then
20531 if $test X"$gidsize" = X"$shortsize"; then
20538 *) if $test X"$gidsize" = X"$uvsize"; then
20539 gidformat="$uvuformat"
20541 if $test X"$gidsize" = X"$longsize"; then
20544 if $test X"$gidsize" = X"$intsize"; then
20547 if $test X"$gidsize" = X"$shortsize"; then
20556 : see if getgroups exists
20557 set getgroups d_getgrps
20560 : see if setgroups exists
20561 set setgroups d_setgrps
20564 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20566 case "$d_getgrps$d_setgrps" in
20568 case "$groupstype" in
20569 '') dflt="$gidtype" ;;
20570 *) dflt="$groupstype" ;;
20573 What type of pointer is the second argument to getgroups() and setgroups()?
20574 Usually this is the same as group ids, $gidtype, but not always.
20577 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20581 *) groupstype="$gidtype";;
20584 : check whether make sets MAKE
20586 echo "Checking if your $make program sets \$(MAKE)..." >&4
20587 case "$make_set_make" in
20589 $sed 's/^X //' > testmake.mak << 'EOF'
20591 X @echo 'maketemp="$(MAKE)"'
20593 case "`$make -f testmake.mak 2>/dev/null`" in
20594 *maketemp=*) make_set_make='#' ;;
20595 *) make_set_make="MAKE=$make" ;;
20597 $rm -f testmake.mak
20600 case "$make_set_make" in
20601 '#') echo "Yup, it does.";;
20602 *) echo "Nope, it doesn't.";;
20605 : see what type is used for mode_t
20606 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20607 set mode_t modetype int stdio.h sys/types.h
20610 : see if we need va_copy
20612 case "$i_stdarg" in
20615 #include <stdarg.h>
20617 #$i_stdlib I_STDLIB
20619 #include <stdlib.h>
20621 #include <signal.h>
20624 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20626 return vfprintf(f, fmt, *valp);
20630 myvfprintf(FILE *f, const char *fmt, va_list val)
20632 return ivfprintf(f, fmt, &val);
20636 myprintf(char *fmt, ...)
20639 va_start(val, fmt);
20640 return myvfprintf(stdout, fmt, val);
20644 main(int ac, char **av)
20646 signal(SIGSEGV, exit);
20648 myprintf("%s%cs all right, then\n", "that", '\'');
20653 if eval $compile && $run ./try 2>&1 >/dev/null; then
20654 case "`$run ./try`" in
20655 "that's all right, then")
20661 yes) echo "It seems that you don't need va_copy()." >&4
20662 need_va_copy="$undef"
20664 *) echo "It seems that va_copy() or similar will be needed." >&4
20665 need_va_copy="$define"
20670 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20671 need_va_copy="$undef"
20675 : see what type is used for size_t
20676 rp="What is the type used for the length parameter for string functions?"
20677 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20680 : check for type of arguments to gethostbyaddr.
20681 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20682 case "$d_gethbyaddr" in
20686 Checking to see what type of arguments are accepted by gethostbyaddr().
20688 hdrs="$define sys/types.h
20689 $d_socket sys/socket.h
20690 $i_niin netinet/in.h
20692 $i_unistd unistd.h"
20693 : The first arg can 'char *' or 'void *'
20694 : The second arg is some of integral type
20695 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20696 for yyy in size_t long int; do
20697 case "$netdb_host_type" in
20698 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20699 if ./protochk "$try" $hdrs; then
20700 echo "Your system accepts $xxx for the first arg."
20701 echo "...and $yyy for the second arg."
20702 netdb_host_type="$xxx"
20703 netdb_hlen_type="$yyy"
20709 : In case none of those worked, prompt the user.
20710 case "$netdb_host_type" in
20711 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20714 netdb_host_type=$ans
20715 rp='What is the type for the 2nd argument to gethostbyaddr?'
20718 netdb_hlen_type=$ans
20722 *) : no gethostbyaddr, so pick harmless defaults
20723 netdb_host_type='char *'
20724 netdb_hlen_type="$sizetype"
20727 # Remove the "const" if needed. -- but then we'll have a
20729 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20732 : check for type of argument to gethostbyname.
20733 if test "X$netdb_name_type" = X ; then
20734 case "$d_gethbyname" in
20738 Checking to see what type of argument is accepted by gethostbyname().
20740 hdrs="$define sys/types.h
20741 $d_socket sys/socket.h
20742 $i_niin netinet/in.h
20744 $i_unistd unistd.h"
20745 for xxx in "const char *" "char *"; do
20746 case "$netdb_name_type" in
20747 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20748 if ./protochk "$try" $hdrs; then
20749 echo "Your system accepts $xxx."
20750 netdb_name_type="$xxx"
20755 : In case none of those worked, prompt the user.
20756 case "$netdb_name_type" in
20757 '') rp='What is the type for the 1st argument to gethostbyname?'
20760 netdb_name_type=$ans
20764 *) : no gethostbyname, so pick harmless default
20765 netdb_name_type='char *'
20770 : check for type of 1st argument to getnetbyaddr.
20771 if test "X$netdb_net_type" = X ; then
20772 case "$d_getnbyaddr" in
20776 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20778 hdrs="$define sys/types.h
20779 $d_socket sys/socket.h
20780 $i_niin netinet/in.h
20782 $i_unistd unistd.h"
20783 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20784 case "$netdb_net_type" in
20785 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20786 if ./protochk "$try" $hdrs; then
20787 echo "Your system accepts $xxx."
20788 netdb_net_type="$xxx"
20793 : In case none of those worked, prompt the user.
20794 case "$netdb_net_type" in
20795 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20798 netdb_net_type=$ans
20802 *) : no getnetbyaddr, so pick harmless default
20803 netdb_net_type='long'
20807 : locate the preferred pager for this system
20814 [a-zA-Z]:/*) dflt=$pg;;
20818 [a-zA-Z]:/*) dflt=$more;;
20822 [a-zA-Z]:/*) dflt=$less;;
20825 '') dflt=/usr/ucb/more;;
20833 rp='What pager is used on your system?'
20837 : see what type pids are declared as in the kernel
20838 rp="What is the type of process ids on this system?"
20839 set pid_t pidtype int stdio.h sys/types.h
20842 : see if ar generates random libraries by itself
20844 echo "Checking how to generate random libraries on your machine..." >&4
20845 echo 'int bar1() { return bar2(); }' > bar1.c
20846 echo 'int bar2() { return 2; }' > bar2.c
20848 #$i_stdlib I_STDLIB
20850 #include <stdlib.h>
20852 int main() { printf("%d\n", bar1()); exit(0); }
20854 $cc $ccflags -c bar1.c >/dev/null 2>&1
20855 $cc $ccflags -c bar2.c >/dev/null 2>&1
20856 $cc $ccflags -c foo.c >/dev/null 2>&1
20857 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20858 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20859 $run ./foobar >/dev/null 2>&1; then
20860 echo "$ar appears to generate random libraries itself."
20862 if [ "X$ranlib" = "X" ]; then
20865 elif $ar s bar$_a >/dev/null 2>&1 &&
20866 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20867 $run ./foobar >/dev/null 2>&1; then
20868 echo "a table of contents needs to be added with '$ar s'."
20871 elif $ar ts bar$_a >/dev/null 2>&1 &&
20872 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20873 $run ./foobar >/dev/null 2>&1; then
20874 echo "a table of contents needs to be added with '$ar ts'."
20881 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20882 $test -f $ranlib || ranlib=''
20885 if $test -n "$ranlib"; then
20886 echo "your system has '$ranlib'; we'll use that."
20889 echo "your system doesn't seem to support random libraries"
20890 echo "so we'll use lorder and tsort to order the libraries."
20897 : see if this is a values.h system
20898 set values.h i_values
20901 : Check the max offset that gmtime and localtime accept
20902 echo "Checking max offsets that gmtime () accepts"
20905 define) yyy="#include <values.h>" ;;
20909 case "$sGMTIME_min/$sGMTIME_max" in
20912 #include <sys/types.h>
20921 void gm_check (time_t t, int min_year, int max_year)
20924 if ( tmp == NULL ||
20925 /* Check tm_year overflow */
20926 tmp->tm_year < min_year || tmp->tm_year > max_year)
20937 gm_check (MAXLONG, 69, 0x7fffffff);
20939 if (tmp == NULL || tmp->tm_year < 0) {
20940 for (i = 63; i >= 0; i--) {
20941 time_t x = pt | ((time_t)1 << i);
20942 if (x < 0 || x < pt) continue;
20943 gm_check (x, 69, 0x7fffffff);
20946 printf ("sGMTIME_max=%ld\n", pt);
20955 gm_check (MINLONG, -1900, 70);
20958 for (i = 36; i >= 0; i--) {
20959 time_t x = pt - ((time_t)1 << i);
20960 if (x > 0) continue;
20961 gm_check (x, -1900, 70);
20964 printf ("sGMTIME_min=%ld\n", pt);
20968 int main (int argc, char *argv[])
20970 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20977 if eval $compile; then
20980 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20986 echo "Checking max offsets that localtime () accepts"
20988 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20991 #include <sys/types.h>
21000 void local_check (time_t t, int min_year, int max_year)
21002 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21005 tmp = localtime (&t);
21006 if ( tmp == NULL ||
21007 /* Check tm_year overflow */
21008 tmp->tm_year < min_year || tmp->tm_year > max_year)
21012 } /* local_check */
21019 local_check (MAXLONG, 69, 0x7fffffff);
21021 if (tmp == NULL || tmp->tm_year < 0) {
21022 for (i = 63; i >= 0; i--) {
21023 time_t x = pt | ((time_t)1 << i);
21024 if (x < 0 || x < pt) continue;
21025 local_check (x, 69, 0x7fffffff);
21028 printf ("sLOCALTIME_max=%ld\n", pt);
21037 local_check (MINLONG, -1900, 70);
21040 for (i = 36; i >= 0; i--) {
21041 time_t x = pt - ((time_t)1 << i);
21042 if (x > 0) continue;
21043 local_check (x, -1900, 70);
21046 printf ("sLOCALTIME_min=%ld\n", pt);
21050 int main (int argc, char *argv[])
21058 if eval $compile; then
21061 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21067 : check for type of arguments to select.
21068 case "$selecttype" in
21069 '') case "$d_select" in
21073 Checking to see what type of arguments are accepted by select().
21075 hdrs="$define sys/types.h
21076 $i_systime sys/time.h
21077 $i_sysselct sys/select.h
21078 $d_socket sys/socket.h"
21079 : The first arg can be int, unsigned, or size_t
21080 : The last arg may or may not be 'const'
21082 : void pointer has been seen but using that
21083 : breaks the selectminbits test
21084 for xxx in 'fd_set *' 'int *'; do
21085 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21086 for tmo in 'struct timeval *' 'const struct timeval *'; do
21088 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21089 if ./protochk "$try" $hdrs; then
21090 echo "Your system accepts $xxx."
21099 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21100 case "$d_fd_set" in
21101 $define) dflt="fd_set *" ;;
21110 *) : no select, so pick a harmless default
21117 : check for the select 'width'
21118 case "$selectminbits" in
21119 '') safebits=`expr $ptrsize \* 8`
21120 case "$d_select" in
21124 Checking to see on how many bits at a time your select() operates...
21127 #include <sys/types.h>
21129 #$i_systime I_SYS_TIME
21130 #$i_systimek I_SYS_TIME_KERNEL
21135 # ifdef I_SYS_TIME_KERNEL
21138 # include <sys/time.h>
21139 # ifdef I_SYS_TIME_KERNEL
21143 #$i_sysselct I_SYS_SELECT
21144 #ifdef I_SYS_SELECT
21145 #include <sys/select.h>
21147 #$d_socket HAS_SOCKET
21149 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21152 #$i_stdlib I_STDLIB
21154 #include <stdlib.h>
21157 #define S sizeof(*(b))
21159 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21160 #define NBITS (NBYTES * 8)
21162 char *s = (char *)malloc(NBYTES);
21171 fp = fopen("try.c", "r");
21177 b = ($selecttype)s;
21178 for (i = 0; i < NBITS; i++)
21182 select(fd + 1, b, 0, 0, &t);
21183 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21185 printf("%d\n", i + 1);
21190 if eval $compile_ok; then
21191 selectminbits=`$run ./try`
21192 case "$selectminbits" in
21194 Cannot figure out on how many bits at a time your select() operates.
21195 I'll play safe and guess it is $safebits bits.
21197 selectminbits=$safebits
21198 bits="$safebits bits"
21201 *) bits="$selectminbits bits" ;;
21203 echo "Your select() operates on $bits at a time." >&4
21205 rp='What is the minimum number of bits your select() operates on?'
21206 case "$byteorder" in
21207 12345678) dflt=64 ;;
21213 selectminbits="$val"
21217 *) : no select, so pick a harmless default
21218 selectminbits=$safebits
21224 : Trace out the files included by signal.h, then look for SIGxxx names.
21225 if [ "X$fieldn" = X ]; then
21226 : Just make some guesses. We check them later.
21227 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21229 xxx=`echo '#include <signal.h>' |
21230 $cppstdin $cppminus $cppflags 2>/dev/null |
21231 $grep '^[ ]*#.*include' |
21232 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21233 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21236 for xx in $xxx /dev/null ; do
21237 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21239 case "$xxxfiles" in
21240 '') xxxfiles=`./findhdr signal.h` ;;
21243 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21244 print substr($2, 4, 20)
21246 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21247 print substr($3, 4, 20)
21249 : Append some common names just in case the awk scan failed.
21250 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21251 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21252 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21253 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21254 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21256 : generate a few handy files for later
21257 $cat > signal.c <<EOCP
21258 #include <sys/types.h>
21259 #include <signal.h>
21260 #$i_stdlib I_STDLIB
21262 #include <stdlib.h>
21267 /* Strange style to avoid deeply-nested #if/#else/#endif */
21270 # define NSIG (_NSIG)
21276 # define NSIG (SIGMAX+1)
21282 # define NSIG (SIG_MAX+1)
21288 # define NSIG (_SIG_MAX+1)
21294 # define NSIG (MAXSIG+1)
21300 # define NSIG (MAX_SIG+1)
21305 # ifdef SIGARRAYSIZE
21306 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21312 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21316 /* Default to some arbitrary number that's big enough to get most
21317 of the common signals.
21323 printf("NSIG %d\n", NSIG);
21329 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21331 printf "#ifdef SIG"; printf $1; printf "\n"
21332 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21333 printf $1; printf ");\n"
21337 printf "#endif /* JUST_NSIG */\n";
21338 printf "exit(0);\n}\n";
21341 $cat >signal.awk <<'EOP'
21342 BEGIN { ndups = 0 }
21343 $1 ~ /^NSIG$/ { nsig = $2 }
21344 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21345 if ($2 > maxsig) { maxsig = $2 }
21346 if (sig_name[$2]) {
21347 dup_name[ndups] = $1
21348 dup_num[ndups] = $2
21360 printf("NSIG %d\n", nsig);
21361 for (n = 1; n < nsig; n++) {
21363 printf("%s %d\n", sig_name[n], sig_num[n])
21366 printf("NUM%d %d\n", n, n)
21369 for (n = 0; n < ndups; n++) {
21370 printf("%s %d\n", dup_name[n], dup_num[n])
21374 $cat >signal_cmd <<EOS
21376 if $test -s signal.lst; then
21377 echo "Using your existing signal.lst file"
21382 $cat >>signal_cmd <<'EOS'
21385 if eval $compile_ok; then
21386 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21387 $uniq | $awk -f signal.awk >signal.lst
21389 echo "(I can't seem be able to compile the whole test program)" >&4
21390 echo "(I'll try it in little pieces.)" >&4
21391 set signal -DJUST_NSIG
21392 if eval $compile_ok; then
21393 $run ./signal$_exe > signal.nsg
21396 echo "I can't seem to figure out how many signals you have." >&4
21397 echo "Guessing 50." >&4
21398 echo 'NSIG 50' > signal.nsg
21400 : Now look at all the signal names, one at a time.
21401 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21402 $cat > signal.c <<EOCP
21403 #include <sys/types.h>
21404 #include <signal.h>
21407 printf("$xx %d\n", SIG${xx});
21412 if eval $compile; then
21413 echo "SIG${xx} found."
21414 $run ./signal$_exe >> signal.ls1
21416 echo "SIG${xx} NOT found."
21419 if $test -s signal.ls1; then
21420 $cat signal.nsg signal.ls1 |
21421 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21425 if $test -s signal.lst; then
21428 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21429 echo 'kill -l' >signal
21430 set X `csh -f <signal`
21434 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21436 echo $@ | $tr ' ' $trnl | \
21437 $awk '{ printf "%s %d\n", $1, ++s; }
21438 END { printf "NSIG %d\n", ++s }' >signal.lst
21440 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21442 chmod a+x signal_cmd
21443 $eunicefix signal_cmd
21445 : generate list of signal names
21447 case "$sig_name_init" in
21449 *) case "$sig_num_init" in
21450 ''|*,*) doinit=yes ;;
21455 echo "Generating a list of signal names and numbers..." >&4
21457 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21458 sig_name=`$awk 'BEGIN { printf "ZERO " }
21459 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21460 sig_num=`$awk 'BEGIN { printf "0 " }
21461 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21462 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21463 !/^NSIG/ { printf "\"%s\", ", $1 }
21464 END { printf "0\n" }' signal.lst`
21465 sig_num_init=`$awk 'BEGIN { printf "0, " }
21466 !/^NSIG/ { printf "%d, ", $2}
21467 END { printf "0\n"}' signal.lst`
21470 echo "The following $sig_count signals are available:"
21472 echo $sig_name | $awk \
21473 'BEGIN { linelen = 0 }
21475 for (i = 1; i <= NF; i++) {
21476 name = "SIG" $i " "
21477 linelen = linelen + length(name)
21478 if (linelen > 70) {
21480 linelen = length(name)
21486 sig_size=`echo $sig_name | awk '{print NF}'`
21487 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21489 : Check size of size
21491 case "$sizetype" in
21492 *_t) zzz="$sizetype" ;;
21493 *) zzz="filesize" ;;
21495 echo "Checking the size of $zzz..." >&4
21497 #include <sys/types.h>
21499 #$i_stdlib I_STDLIB
21501 #include <stdlib.h>
21504 printf("%d\n", (int)sizeof($sizetype));
21509 if eval $compile_ok; then
21513 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21516 echo "Your $zzz size is $sizesize bytes."
21521 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21525 : check for socklen_t
21527 echo "Checking to see if you have socklen_t..." >&4
21529 #include <sys/types.h>
21530 #$d_socket HAS_SOCKET
21532 #include <sys/socket.h>
21534 int main() { socklen_t x = 16; }
21537 if eval $compile; then
21539 echo "You have socklen_t."
21542 echo "You do not have socklen_t."
21543 case "$sizetype" in
21544 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21551 : see if this is a socks.h system
21552 set socks.h i_socks
21555 : check for type of the size argument to socket calls
21556 case "$d_socket" in
21560 Checking to see what type is the last argument of accept().
21563 case "$d_socklen_t" in
21564 "$define") yyy="$yyy socklen_t"
21566 yyy="$yyy $sizetype int long unsigned"
21567 for xxx in $yyy; do
21568 case "$socksizetype" in
21569 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21570 case "$usesocks" in
21572 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21573 echo "Your system accepts '$xxx *' for the last argument of accept()."
21574 socksizetype="$xxx"
21577 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21578 echo "Your system accepts '$xxx *' for the last argument of accept()."
21579 socksizetype="$xxx"
21586 : In case none of those worked, prompt the user.
21587 case "$socksizetype" in
21588 '') rp='What is the type for socket address structure sizes?'
21595 *) : no sockets, so pick relatively harmless default
21600 : see what type is used for signed size_t
21601 set ssize_t ssizetype int stdio.h sys/types.h
21606 #$i_stdlib I_STDLIB
21608 #include <stdlib.h>
21610 #include <sys/types.h>
21611 #define Size_t $sizetype
21612 #define SSize_t $dflt
21615 if (sizeof(Size_t) == sizeof(SSize_t))
21617 else if (sizeof(Size_t) == sizeof(int))
21626 if eval $compile_ok && $run ./try > /dev/null; then
21627 ssizetype=`$run ./try`
21628 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21631 Help! I can't compile and run the ssize_t test program: please enlighten me!
21632 (This is probably a misconfiguration in your system or libraries, and
21633 you really ought to fix it. Still, I'll try anyway.)
21635 I need a type that is the same size as $sizetype, but is guaranteed to
21636 be signed. Common values are ssize_t, int and long.
21639 rp="What signed type is the same size as $sizetype?"
21645 : Check the size of st_ino
21647 $echo "Checking the size of st_ino..." >&4
21648 $cat > try.c <<EOCP
21649 #include <sys/stat.h>
21651 #$i_stdlib I_STDLIB
21653 #include <stdlib.h>
21657 printf("%d\n", (int)sizeof(st.st_ino));
21662 if eval $compile_ok; then
21666 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21668 *) st_ino_size=$val
21669 $echo "Your st_ino is $st_ino_size bytes long."
21674 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21678 : Check if st_ino is signed
21680 $echo "Checking the sign of st_ino..." >&4
21681 $cat > try.c <<EOCP
21682 #include <sys/stat.h>
21687 if (foo.st_ino < 0)
21694 if eval $compile; then
21698 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21700 *) st_ino_sign=$val
21701 case "$st_ino_sign" in
21702 1) $echo "Your st_ino is unsigned." ;;
21703 -1) $echo "Your st_ino is signed." ;;
21709 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21713 : see what type of char stdio uses.
21715 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21716 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21717 echo "Your stdio uses unsigned chars." >&4
21718 stdchar="unsigned char"
21720 echo "Your stdio uses signed chars." >&4
21725 : see what type uids are declared as in the kernel
21727 echo "Looking for the type for user ids returned by getuid()."
21728 set uid_t uidtype xxx stdio.h sys/types.h
21732 xxx=`./findhdr sys/user.h`
21733 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21735 unsigned) dflt="$1 $2" ;;
21739 *) dflt="$uidtype";;
21742 uid_t) echo "uid_t found." ;;
21743 *) rp="What is the type for user ids returned by getuid()?"
21749 : Check size of UID
21752 *_t) zzz="$uidtype" ;;
21755 echo "Checking the size of $zzz..." >&4
21757 #include <sys/types.h>
21759 #$i_stdlib I_STDLIB
21761 #include <stdlib.h>
21764 printf("%d\n", (int)sizeof($uidtype));
21769 if eval $compile_ok; then
21773 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21776 echo "Your $zzz is $uidsize bytes long."
21781 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21784 : Check if UID is signed
21787 *_t) zzz="$uidtype" ;;
21790 echo "Checking the sign of $zzz..." >&4
21792 #include <sys/types.h>
21803 if eval $compile; then
21807 echo "(I can't execute the test program--guessing unsigned.)" >&4
21811 1) echo "Your $zzz is unsigned." ;;
21812 -1) echo "Your $zzz is signed." ;;
21818 echo "(I can't compile the test program--guessing unsigned.)" >&4
21822 : Check format string for UID
21824 $echo "Checking the format string to be used for uids..." >&4
21827 -1) if $test X"$uidsize" = X"$ivsize"; then
21828 uidformat="$ivdformat"
21830 if $test X"$uidsize" = X"$longsize"; then
21833 if $test X"$uidsize" = X"$intsize"; then
21836 if $test X"$uidsize" = X"$shortsize"; then
21843 *) if $test X"$uidsize" = X"$uvsize"; then
21844 uidformat="$uvuformat"
21846 if $test X"$uidsize" = X"$longsize"; then
21849 if $test X"$uidsize" = X"$intsize"; then
21852 if $test X"$uidsize" = X"$shortsize"; then
21861 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21863 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21864 $cat >try.c <<'EOM'
21865 /* Intentionally a long probe as I'd like to sanity check that the exact
21866 approach is going to work, as thinking it will work, but only having it
21867 part working at runtime is worse than not having it. */
21869 #include <sys/types.h>
21870 #include <sys/sysctl.h>
21871 #include <sys/param.h>
21873 #include <string.h>
21874 #include <stdlib.h>
21875 #include <unistd.h>
21878 main(int argc, char **argv) {
21880 char *argv_leaf = strrchr(argv[0], '/');
21886 mib[1] = KERN_PROC;
21887 mib[2] = KERN_PROC_PATHNAME;
21891 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21895 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21900 if (size < strlen(argv_leaf) + 1) {
21901 fprintf(stderr, "size %lu is too short for a path\n",
21902 (unsigned long) size);
21906 if (size > MAXPATHLEN * MAXPATHLEN) {
21907 fprintf(stderr, "size %lu is too long for a path\n",
21908 (unsigned long) size);
21912 buffer = malloc(size);
21918 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21923 if (strlen(buffer) + 1 != size) {
21924 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21925 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21930 if (*buffer != '/') {
21931 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21935 if (strstr(buffer, "/./")) {
21936 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21940 if (strstr(buffer, "/../")) {
21941 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21945 buffer_leaf = strrchr(buffer, '/');
21946 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21947 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21959 if eval $compile; then
21960 if $run ./try; then
21961 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21964 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21968 echo "I'm unable to compile the test program." >&4
21969 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21973 set usekernprocpathname
21976 : Determine if we can use _NSGetExecutablePath to find executing program
21978 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21979 $cat >try.c <<'EOM'
21980 /* Intentionally a long probe as I'd like to sanity check that the exact
21981 approach is going to work, as thinking it will work, but only having it
21982 part working at runtime is worse than not having it. */
21983 #include <mach-o/dyld.h>
21985 #include <stdlib.h>
21986 #include <sys/param.h>
21987 #include <string.h>
21990 main(int argc, char **argv) {
21992 uint32_t size = sizeof(buf);
21996 char *argv_leaf = strrchr(argv[0], '/');
22000 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22004 _NSGetExecutablePath(buf, &size);
22005 if (size > MAXPATHLEN * MAXPATHLEN) {
22006 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22007 (unsigned int) size);
22011 buffer = malloc(size);
22017 result = _NSGetExecutablePath(buffer, &size);
22019 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22020 result, (unsigned int) size);
22024 tidied = realpath(buffer, NULL);
22026 perror("realpath");
22032 if (*tidied != '/') {
22033 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22037 if (strstr(tidied, "/./")) {
22038 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22042 if (strstr(tidied, "/../")) {
22043 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22047 tidied_leaf = strrchr(tidied, '/');
22048 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22049 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22061 if eval $compile; then
22062 if $run ./try; then
22063 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22066 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22069 echo "I'm unable to compile the test program." >&4
22070 echo "I'll assume no _NSGetExecutablePath here." >&4
22073 set usensgetexecutablepath
22076 : Check if site customization support was requested
22077 case "$usesitecustomize" in
22078 $define|true|[Yy]*)
22079 usesitecustomize="$define"
22082 usesitecustomize="$undef"
22086 : see if prototypes support variable argument declarations
22088 case "$prototype$i_stdarg" in
22090 echo "It appears we'll be able to prototype varargs functions." >&4
22094 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22101 : determine compiler compiler
22110 if $test -f "$byacc$_exe"; then
22112 comp="byacc or $comp"
22114 if $test -f "$bison$_exe"; then
22115 comp="$comp or bison -y"
22117 rp="Which compiler compiler ($comp) shall I use?"
22126 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22132 : see if this is a assert.h system
22133 set assert.h i_assert
22136 : see if this is a bfd.h system
22140 : see if this is an execinfo.h system
22141 set execinfo.h i_execinfo
22144 : see if this is a fenv.h system
22148 : see if this is a fp.h system
22152 : see if this is a fp_class.h system
22153 set fp_class.h i_fp_class
22156 : see if gdbm.h is available
22161 : see if gdbm_open exists
22162 set gdbm_open d_gdbm_open
22164 case "$d_gdbm_open" in
22167 echo "We won't be including <gdbm.h>"
22176 : see if this is a ieeefp.h system
22177 case "$i_ieeefp" in
22178 '' ) set ieeefp.h i_ieeefp
22183 : see if this is a libutil.h system
22184 set libutil.h i_libutil
22187 : see if mach cthreads are available
22188 if test "X$usethreads" = "X$define"; then
22189 set mach/cthreads.h i_machcthr
22192 i_machcthr="$undef"
22195 : see if this is a mntent.h system
22196 set mntent.h i_mntent
22199 : see if net/errno.h is available
22201 set net/errno.h val
22204 : Unfortunately, it causes problems on some systems. Arrgh.
22207 cat > try.c <<'EOM'
22210 #include <net/errno.h>
22216 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22217 echo "We'll be including <net/errno.h>." >&4
22219 echo "We won't be including <net/errno.h>." >&4
22228 : see if netinet/tcp.h is available
22229 set netinet/tcp.h i_netinettcp
22232 : see if this is a poll.h system
22236 : see if this is a prot.h system
22240 : Preprocessor symbols
22242 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22243 $cat <<'EOSH' > Cppsym.know
22244 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22245 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22246 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22247 arch_pwr ardent ARM ARM32 atarist att386 att3b
22248 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22249 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22250 byteorder byte_order
22251 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22252 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22253 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22254 ELF encore EPI EXTENSIONS
22255 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22256 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22257 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22258 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22259 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22260 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22261 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22262 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22263 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22265 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22266 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22267 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22269 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22270 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22271 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22272 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22273 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22274 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22275 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22276 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22277 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22278 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22279 ns32000 ns32016 ns32332 ns32k nsc32000
22280 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22281 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22282 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22283 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22285 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22286 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22287 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22288 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22289 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22290 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22291 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22292 SYSV4 SYSV5 sysV68 sysV88
22293 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22294 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22295 tower32_800 tower32_850 tss
22296 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22297 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22298 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22299 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22300 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22301 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22303 vax venix VMESA vms
22304 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22305 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22308 # Maybe put other stuff here too.
22309 ./tr '-' '_' <<EOSH >>Cppsym.know
22312 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22313 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22314 $cat Cppsym.know > Cppsym.c
22315 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22316 $rm -f Cppsym.a Cppsym.b Cppsym.c
22317 cat <<EOSH > Cppsym
22319 if $test \$# -gt 0; then
22320 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22321 if $test -s Cppsym.got; then
22328 $tr " " "$trnl" | ./Cppsym.try
22334 cat <<EOSH > Cppsym.try
22336 cat <<'EOCP' > try.c
22339 #define STRINGIFY(a) "a"
22341 #if cpp_stuff == 42
22342 #define StGiFy(a) #a
22343 #define STRINGIFY(a) StGiFy(a)
22345 #if $cpp_stuff != 1 && $cpp_stuff != 42
22346 # include "Bletch: How does this C preprocessor stringify macros?"
22352 cat <<'EOSH' >> Cppsym.try
22354 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22355 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22356 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22357 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22359 echo 'return 0;}' >> try.c
22361 cat <<EOSH >> Cppsym.try
22363 case "$osname-$gccversion" in
22364 irix-) ccflags="\$ccflags -woff 1178" ;;
22365 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22367 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22369 chmod +x Cppsym.try
22370 $eunicefix Cppsym.try
22371 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22372 : Add in any Linux cpp "predefined macros":
22373 case "$osname::$gccversion" in
22374 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22376 rm -f $tHdrH'.h' $tHdrH
22378 # Filter out macro arguments, such as Linux's __INT8_C(c)
22379 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22380 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22381 if [ -s $tHdrH'_cppsym.real' ]; then
22382 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22385 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22388 : now check the C compiler for additional symbols
22389 postprocess_cc_v=''
22391 aix) postprocess_cc_v="|$tr , ' '" ;;
22398 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22401 -D*) echo "\$i" | $sed 's/^-D//';;
22402 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22407 postprocess_cc_v=''
22410 ./ccsym > ccsym1.raw
22411 if $test -s ccsym1.raw; then
22412 $sort ccsym1.raw | $uniq >ccsym.raw
22414 mv ccsym1.raw ccsym.raw
22417 $awk '/\=/ { print $0; next }
22418 { print $0"=1" }' ccsym.raw >ccsym.list
22419 $comm -13 Cppsym.true ccsym.list >ccsym.own
22420 $comm -12 Cppsym.true ccsym.list >ccsym.com
22421 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22423 if $test -z ccsym.raw; then
22424 echo "Your C compiler doesn't seem to define any symbols!" >&4
22426 echo "However, your C preprocessor defines the following symbols:"
22429 cppsymbols=`$cat Cppsym.true`
22430 cppsymbols=`echo $cppsymbols`
22431 cppccsymbols="$cppsymbols"
22433 if $test -s ccsym.com; then
22434 echo "Your C compiler and pre-processor define these symbols:"
22435 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22438 cppccsymbols=`$cat ccsym.com`
22439 cppccsymbols=`echo $cppccsymbols`
22440 $test "$silent" || sleep 1
22442 if $test -s ccsym.cpp; then
22443 $test "$also" && echo " "
22444 echo "Your C pre-processor ${also}defines the following symbols:"
22445 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22447 cppsymbols=`$cat ccsym.cpp`
22448 cppsymbols=`echo $cppsymbols`
22449 $test "$silent" || sleep 1
22451 if $test -s ccsym.own; then
22452 $test "$also" && echo " "
22453 echo "Your C compiler ${also}defines the following cpp symbols:"
22454 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22455 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22456 ccsymbols=`$cat ccsym.own`
22457 ccsymbols=`echo $ccsymbols`
22458 $test "$silent" || sleep 1
22462 : add -D_FORTIFY_SOURCE if feasible and not already there
22463 case "$gccversion" in
22464 4.*) case "$optimize$ccflags" in
22465 *-O*) case "$ccflags$cppsymbols" in
22466 *_FORTIFY_SOURCE=*) # Don't add it again.
22467 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22469 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22470 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22474 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22478 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22482 : see if this is a termio system
22486 if $test `./findhdr termios.h`; then
22487 set tcsetattr i_termios
22493 "$define") echo "You have POSIX termios.h... good!" >&4;;
22494 *) if ./Cppsym pyr; then
22495 case "`$run /bin/universe`" in
22496 ucb) if $test `./findhdr sgtty.h`; then
22498 echo "<sgtty.h> found." >&4
22500 echo "System is pyramid with BSD universe."
22501 ./warn "<sgtty.h> not found--you could have problems."
22503 *) if $test `./findhdr termio.h`; then
22505 echo "<termio.h> found." >&4
22507 echo "System is pyramid with USG universe."
22508 ./warn "<termio.h> not found--you could have problems."
22512 if $test `./findhdr termio.h`; then
22513 echo "<termio.h> found." >&4
22515 elif $test `./findhdr sgtty.h`; then
22516 echo "<sgtty.h> found." >&4
22519 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22522 if $test `./findhdr sgtty.h`; then
22523 echo "<sgtty.h> found." >&4
22525 elif $test `./findhdr termio.h`; then
22526 echo "<termio.h> found." >&4
22529 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22533 set i_termio; eval $setvar
22534 val=$val2; set i_sgtty; eval $setvar
22535 val=$val3; set i_termios; eval $setvar
22537 : see if stdbool is available
22538 : we want a real compile instead of Inhdr because some Solaris systems
22539 : have stdbool.h, but it can only be used if the compiler indicates it
22540 : is sufficiently c99-compliant.
22544 #include <stdbool.h>
22549 int main(int argc, char **argv)
22555 if eval $compile; then
22556 echo "<stdbool.h> found." >&4
22559 echo "<stdbool.h> NOT found." >&4
22566 : see if stddef is available
22567 set stddef.h i_stddef
22570 : see if stdint is available
22571 set stdint.h i_stdint
22574 : see if sys/access.h is available
22575 set sys/access.h i_sysaccess
22578 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22579 set sys/filio.h i_sysfilio
22582 if $test `./findhdr sys/ioctl.h`; then
22584 echo '<sys/ioctl.h> found.' >&4
22587 if $test $i_sysfilio = "$define"; then
22588 echo '<sys/ioctl.h> NOT found.' >&4
22590 $test $i_sgtty = "$define" && xxx="sgtty.h"
22591 $test $i_termio = "$define" && xxx="termio.h"
22592 $test $i_termios = "$define" && xxx="termios.h"
22593 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22599 : see if socket ioctl defs are in sys/sockio.h
22601 xxx=`./findhdr sys/sockio.h`
22602 if $test "$xxx"; then
22603 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22605 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22608 echo "No socket ioctls found in <sys/sockio.h>." >&4
22613 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22619 : see if this is a syslog.h system
22620 set syslog.h i_syslog
22623 : see if this is a sys/mode.h system
22624 set sys/mode.h i_sysmode
22627 : see if there is a sys/poll.h file
22628 set sys/poll.h i_syspoll
22631 : see if sys/resource.h has to be included
22632 set sys/resource.h i_sysresrc
22635 : see if sys/security.h is available
22636 set sys/security.h i_syssecrt
22639 : see if this is a sys/statvfs.h system
22640 set sys/statvfs.h i_sysstatvfs
22643 : see if this is a sys/un.h system
22644 set sys/un.h i_sysun
22647 : see if this is a sys/utsname.h system
22648 set sys/utsname.h i_sysutsname
22651 : see if this is a syswait system
22652 set sys/wait.h i_syswait
22655 : see if this is a ustat.h system
22656 set ustat.h i_ustat
22659 : see if this is an utime system
22660 set utime.h i_utime
22663 : see if this is a vfork system
22666 set vfork.h i_vfork
22676 echo "Looking for extensions..." >&4
22677 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22678 : contain old or inaccurate or duplicate values.
22679 nonxs_extensions=''
22681 : We do not use find because it might not be available.
22682 : We do not just use MANIFEST because the user may have dropped
22683 : some additional extensions into the source tree and expect them
22686 : Function to recursively find available extensions, ignoring DynaLoader
22687 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22688 : In 5.10.1 and later, extensions are stored in directories
22689 : like File-Glob instead of the older File/Glob/.
22693 DynaLoader|dynaload) ;;
22695 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22696 case "$this_ext" in
22697 Scalar/List/Utils) this_ext="List/Util" ;;
22698 PathTools) this_ext="Cwd" ;;
22700 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22701 if $contains " $this_ext " $tdir/$$.tmp; then
22703 echo "Duplicate directories detected for extension $xxx" >&4;
22704 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22705 case "$knowitall" in
22713 echo "Ok. Stopping Configure." >&4;
22714 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22717 echo "Ok. You will need to correct config.sh before running make." >&4;
22719 $ls -1 $xxx > $tdir/$$.tmp;
22720 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22721 xs_extensions="$xs_extensions $this_ext";
22722 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22723 xs_extensions="$xs_extensions $this_ext";
22724 elif $test -d $xxx; then
22725 nonxs_extensions="$nonxs_extensions $this_ext";
22727 $rm -f $tdir/$$.tmp;
22735 eval $find_extensions
22739 eval $find_extensions
22743 eval $find_extensions
22744 set X $xs_extensions
22746 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22747 set X $nonxs_extensions
22749 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22751 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22753 : Now see which are supported on this system.
22755 for xxx in $xs_extensions ; do
22759 $define) avail_ext="$avail_ext $xxx" ;;
22762 GDBM_File|gdbm_fil)
22764 $define) avail_ext="$avail_ext $xxx" ;;
22767 I18N/Langinfo|i18n_lan)
22768 case "$i_langinfo$d_nl_langinfo" in
22769 $define$define) avail_ext="$avail_ext $xxx" ;;
22773 : XXX Do we need a useipcsysv variable here
22774 case "${d_msg}${d_sem}${d_shm}" in
22775 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22778 NDBM_File|ndbm_fil)
22781 case "$osname-$use64bitint" in
22784 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22787 *) avail_ext="$avail_ext $xxx" ;;
22792 ODBM_File|odbm_fil)
22793 case "${i_dbm}${i_rpcsvcdbm}" in
22795 case "$d_cplusplus" in
22796 define) ;; # delete as a function name will not work
22797 *) case "$osname-$use64bitint" in
22800 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22803 *) avail_ext="$avail_ext $xxx" ;;
22811 case "$useopcode" in
22812 true|define|y) avail_ext="$avail_ext $xxx" ;;
22816 case "$useposix" in
22817 true|define|y) avail_ext="$avail_ext $xxx" ;;
22821 case "$d_socket" in
22822 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22825 Sys/Syslog|sys/syslog)
22826 : XXX syslog requires socket
22827 case "$d_socket" in
22828 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22832 case "$usethreads" in
22834 case "$use5005threads" in
22835 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22839 threads|threads/shared)
22840 # threads and threads::shared are special cases.
22841 # To stop people from asking "Perl 5.8.0 was supposed
22842 # to have this new fancy threads implementation but my
22843 # perl doesn't have it" and from people trying to
22844 # (re)install the threads module using CPAN.pm and
22845 # CPAN.pm then offering to reinstall Perl 5.8.0,
22846 # the threads.pm and threads/shared.pm will always be
22847 # there, croaking informatively ("you need to rebuild
22848 # all of Perl with threads, sorry") when threads haven't
22849 # been compiled in.
22851 avail_ext="$avail_ext $xxx"
22857 cygwin) avail_ext="$avail_ext $xxx" ;;
22860 XS/APItest|xs/apitest)
22861 # This is just for testing. Skip it unless we have dynamic loading.
22864 $define) avail_ext="$avail_ext $xxx" ;;
22867 XS/Typemap|xs/typemap)
22868 # This is just for testing. Skip it unless we have dynamic loading.
22870 $define) avail_ext="$avail_ext $xxx" ;;
22873 *) avail_ext="$avail_ext $xxx"
22882 case "$onlyextensions" in
22884 *) keepextensions=''
22885 echo "You have requested that only certain extensions be included..." >&4
22886 for i in $onlyextensions; do
22887 case " $avail_ext " in
22889 echo "Keeping extension $i."
22890 keepextensions="$keepextensions $i"
22892 *) echo "Ignoring extension $i." ;;
22895 avail_ext="$keepextensions"
22899 case "$noextensions" in
22901 *) keepextensions=''
22902 echo "You have requested that certain extensions be ignored..." >&4
22903 for i in $avail_ext; do
22904 case " $noextensions " in
22905 *" $i "*) echo "Ignoring extension $i." ;;
22906 *) echo "Keeping extension $i.";
22907 keepextensions="$keepextensions $i"
22911 avail_ext="$keepextensions"
22915 : Now see which nonxs extensions are supported on this system.
22916 : For now assume all are.
22918 for xxx in $nonxs_extensions ; do
22922 *) nonxs_ext="$nonxs_ext $xxx"
22934 A number of extensions are supplied with $package. You may choose to
22935 compile these extensions for dynamic loading (the default), compile
22936 them into the $package executable (static loading), or not include
22937 them at all. Answer "none" to include no extensions.
22938 Note that DynaLoader is always built and need not be mentioned here.
22941 case "$dynamic_ext" in
22943 : Exclude those listed in static_ext
22945 for xxx in $avail_ext; do
22946 case " $static_ext " in
22948 *) dflt="$dflt $xxx" ;;
22955 *) dflt="$dynamic_ext"
22956 # Perhaps we are reusing an old out-of-date config.sh.
22959 if test X"$dynamic_ext" != X"$avail_ext"; then
22961 NOTICE: Your previous config.sh list may be incorrect.
22962 The extensions now available to you are
22964 but the default list from your previous config.sh is
22976 rp="What extensions do you wish to load dynamically?"
22979 none) dynamic_ext=' ' ;;
22980 *) dynamic_ext="$ans" ;;
22983 case "$static_ext" in
22985 : Exclude those already listed in dynamic linking
22987 for xxx in $avail_ext; do
22988 case " $dynamic_ext " in
22990 *) dflt="$dflt $xxx" ;;
22997 *) dflt="$static_ext"
23004 rp="What extensions do you wish to load statically?"
23007 none) static_ext=' ' ;;
23008 *) static_ext="$ans" ;;
23013 A number of extensions are supplied with $package. Answer "none"
23014 to include no extensions.
23015 Note that DynaLoader is always built and need not be mentioned here.
23018 case "$static_ext" in
23019 '') dflt="$avail_ext" ;;
23020 *) dflt="$static_ext"
23021 # Perhaps we are reusing an old out-of-date config.sh.
23024 if test X"$static_ext" != X"$avail_ext"; then
23026 NOTICE: Your previous config.sh list may be incorrect.
23027 The extensions now available to you are
23029 but the default list from your previous config.sh is
23038 : Exclude those that are not xs extensions
23042 rp="What extensions do you wish to include?"
23045 none) static_ext=' ' ;;
23046 *) static_ext="$ans" ;;
23051 # Encode is a special case. If we are building Encode as a static
23052 # extension, we need to explicitly list its subextensions as well.
23053 # For other nested extensions, this is handled automatically by
23054 # the appropriate Makefile.PL.
23055 case " $static_ext " in
23056 *" Encode "*) # Add the subextensions of Encode
23058 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23059 static_ext="$static_ext Encode/$xxx"
23060 known_extensions="$known_extensions Encode/$xxx"
23066 set X $dynamic_ext $static_ext $nonxs_ext
23070 # Sanity check: We require an extension suitable for use with
23071 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23072 # should show up as failures in the test suite, but it's helpful to
23073 # catch them now.) The 'extensions' list is normally sorted
23074 # alphabetically, so we need to accept either
23075 # DB_File ... Fcntl ... IO ....
23076 # or something like
23077 # Fcntl ... NDBM_File ... IO ....
23078 case " $extensions" in
23079 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23080 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23081 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23082 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23083 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23087 : Remove libraries needed only for extensions
23088 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23089 : The exception is SunOS 4.x, which needs them.
23090 case "${osname}X${osvers}" in
23094 *) case "$usedl" in
23095 $define|true|[yY]*)
23096 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23100 *) perllibs="$libs"
23106 : Remove build directory name from cppstdin so it can be used from
23107 : either the present location or the final installed location.
23109 : Get out of the UU directory to get correct path name.
23111 case "$cppstdin" in
23113 echo "Stripping down cppstdin path name"
23119 : end of configuration questions
23121 echo "End of configuration questions."
23124 : back to where it started
23125 if test -d ../UU; then
23129 : configuration may be unconditionally patched via a 'config.arch' file
23130 if $test -f config.arch; then
23131 echo "I see a config.arch file, loading it." >&4
23135 : configuration may be patched via a 'config.over' file
23136 if $test -f config.over; then
23139 rp='I see a config.over file. Do you wish to load it?'
23142 n*) echo "OK, I'll ignore it.";;
23144 echo "Configuration override changes have been loaded."
23149 : in case they want portability, strip down executable paths
23150 case "$d_portable" in
23153 echo "Stripping down executable paths..." >&4
23154 for file in $loclist $trylist; do
23156 eval $file=`basename $temp`
23161 : create config.sh file
23163 echo "Creating config.sh..." >&4
23164 $spitshell <<EOT >config.sh
23167 # This file was produced by running the Configure script. It holds all the
23168 # definitions figured out by Configure. Should you modify one of these values,
23169 # do not forget to propagate your changes by running "Configure -der". You may
23170 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23173 # Package name : $package
23174 # Source directory : $src
23175 # Configuration time: $cf_time
23176 # Configured by : $cf_by
23177 # Target system : $myuname
23180 : Add in command line options if available
23181 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23183 $spitshell <<EOT >>config.sh
23192 Revision='$Revision'
23200 alignbytes='$alignbytes'
23201 ansi2knr='$ansi2knr'
23202 aphostname='$aphostname'
23203 api_revision='$api_revision'
23204 api_subversion='$api_subversion'
23205 api_version='$api_version'
23206 api_versionstring='$api_versionstring'
23209 archlibexp='$archlibexp'
23210 archname64='$archname64'
23211 archname='$archname'
23212 archobjs='$archobjs'
23213 asctime_r_proto='$asctime_r_proto'
23222 byteorder='$byteorder'
23224 castflags='$castflags'
23227 cccdlflags='$cccdlflags'
23228 ccdlflags='$ccdlflags'
23230 ccflags_uselargefiles='$ccflags_uselargefiles'
23232 ccsymbols='$ccsymbols'
23233 ccversion='$ccversion'
23235 cf_email='$cf_email'
23237 charbits='$charbits'
23238 charsize='$charsize'
23242 clocktype='$clocktype'
23244 compress='$compress'
23245 contains='$contains'
23249 cpp_stuff='$cpp_stuff'
23250 cppccsymbols='$cppccsymbols'
23251 cppflags='$cppflags'
23253 cppminus='$cppminus'
23255 cppstdin='$cppstdin'
23256 cppsymbols='$cppsymbols'
23257 crypt_r_proto='$crypt_r_proto'
23258 cryptlib='$cryptlib'
23260 ctermid_r_proto='$ctermid_r_proto'
23261 ctime_r_proto='$ctime_r_proto'
23262 d_Gconvert='$d_Gconvert'
23263 d_PRIEUldbl='$d_PRIEUldbl'
23264 d_PRIFUldbl='$d_PRIFUldbl'
23265 d_PRIGUldbl='$d_PRIGUldbl'
23266 d_PRIXU64='$d_PRIXU64'
23267 d_PRId64='$d_PRId64'
23268 d_PRIeldbl='$d_PRIeldbl'
23269 d_PRIfldbl='$d_PRIfldbl'
23270 d_PRIgldbl='$d_PRIgldbl'
23271 d_PRIi64='$d_PRIi64'
23272 d_PRIo64='$d_PRIo64'
23273 d_PRIu64='$d_PRIu64'
23274 d_PRIx64='$d_PRIx64'
23275 d_SCNfldbl='$d_SCNfldbl'
23276 d__fwalk='$d__fwalk'
23277 d_access='$d_access'
23278 d_accessx='$d_accessx'
23282 d_archlib='$d_archlib'
23283 d_asctime64='$d_asctime64'
23284 d_asctime_r='$d_asctime_r'
23287 d_attribute_deprecated='$d_attribute_deprecated'
23288 d_attribute_format='$d_attribute_format'
23289 d_attribute_malloc='$d_attribute_malloc'
23290 d_attribute_nonnull='$d_attribute_nonnull'
23291 d_attribute_noreturn='$d_attribute_noreturn'
23292 d_attribute_pure='$d_attribute_pure'
23293 d_attribute_unused='$d_attribute_unused'
23294 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23295 d_backtrace='$d_backtrace'
23299 d_bsdgetpgrp='$d_bsdgetpgrp'
23300 d_bsdsetpgrp='$d_bsdsetpgrp'
23301 d_builtin_choose_expr='$d_builtin_choose_expr'
23302 d_builtin_expect='$d_builtin_expect'
23304 d_c99_variadic_macros='$d_c99_variadic_macros'
23305 d_casti32='$d_casti32'
23306 d_castneg='$d_castneg'
23307 d_charvspr='$d_charvspr'
23309 d_chroot='$d_chroot'
23310 d_chsize='$d_chsize'
23312 d_clearenv='$d_clearenv'
23313 d_closedir='$d_closedir'
23314 d_cmsghdr_s='$d_cmsghdr_s'
23316 d_copysignl='$d_copysignl'
23317 d_cplusplus='$d_cplusplus'
23319 d_crypt_r='$d_crypt_r'
23321 d_ctermid='$d_ctermid'
23322 d_ctermid_r='$d_ctermid_r'
23323 d_ctime64='$d_ctime64'
23324 d_ctime_r='$d_ctime_r'
23325 d_cuserid='$d_cuserid'
23326 d_dbl_dig='$d_dbl_dig'
23327 d_dbminitproto='$d_dbminitproto'
23328 d_difftime64='$d_difftime64'
23329 d_difftime='$d_difftime'
23330 d_dir_dd_fd='$d_dir_dd_fd'
23332 d_dirnamlen='$d_dirnamlen'
23333 d_dladdr='$d_dladdr'
23334 d_dlerror='$d_dlerror'
23335 d_dlopen='$d_dlopen'
23336 d_dlsymun='$d_dlsymun'
23337 d_dosuid='$d_dosuid'
23338 d_drand48_r='$d_drand48_r'
23339 d_drand48proto='$d_drand48proto'
23341 d_eaccess='$d_eaccess'
23342 d_endgrent='$d_endgrent'
23343 d_endgrent_r='$d_endgrent_r'
23344 d_endhent='$d_endhent'
23345 d_endhostent_r='$d_endhostent_r'
23346 d_endnent='$d_endnent'
23347 d_endnetent_r='$d_endnetent_r'
23348 d_endpent='$d_endpent'
23349 d_endprotoent_r='$d_endprotoent_r'
23350 d_endpwent='$d_endpwent'
23351 d_endpwent_r='$d_endpwent_r'
23352 d_endsent='$d_endsent'
23353 d_endservent_r='$d_endservent_r'
23354 d_eofnblk='$d_eofnblk'
23355 d_eunice='$d_eunice'
23356 d_faststdio='$d_faststdio'
23357 d_fchdir='$d_fchdir'
23358 d_fchmod='$d_fchmod'
23359 d_fchown='$d_fchown'
23361 d_fcntl_can_lock='$d_fcntl_can_lock'
23362 d_fd_macros='$d_fd_macros'
23363 d_fd_set='$d_fd_set'
23364 d_fds_bits='$d_fds_bits'
23365 d_fegetround='$d_fegetround'
23366 d_fgetpos='$d_fgetpos'
23367 d_finite='$d_finite'
23368 d_finitel='$d_finitel'
23369 d_flexfnam='$d_flexfnam'
23371 d_flockproto='$d_flockproto'
23373 d_fp_class='$d_fp_class'
23374 d_fp_classify='$d_fp_classify'
23375 d_fp_classl='$d_fp_classl'
23376 d_fpathconf='$d_fpathconf'
23377 d_fpclass='$d_fpclass'
23378 d_fpclassify='$d_fpclassify'
23379 d_fpclassl='$d_fpclassl'
23380 d_fpgetround='$d_fpgetround'
23381 d_fpos64_t='$d_fpos64_t'
23382 d_frexpl='$d_frexpl'
23383 d_fs_data_s='$d_fs_data_s'
23384 d_fseeko='$d_fseeko'
23385 d_fsetpos='$d_fsetpos'
23386 d_fstatfs='$d_fstatfs'
23387 d_fstatvfs='$d_fstatvfs'
23389 d_ftello='$d_ftello'
23391 d_futimes='$d_futimes'
23392 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23393 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23394 d_getaddrinfo='$d_getaddrinfo'
23395 d_getcwd='$d_getcwd'
23396 d_getespwnam='$d_getespwnam'
23397 d_getfsstat='$d_getfsstat'
23398 d_getgrent='$d_getgrent'
23399 d_getgrent_r='$d_getgrent_r'
23400 d_getgrgid_r='$d_getgrgid_r'
23401 d_getgrnam_r='$d_getgrnam_r'
23402 d_getgrps='$d_getgrps'
23403 d_gethbyaddr='$d_gethbyaddr'
23404 d_gethbyname='$d_gethbyname'
23405 d_gethent='$d_gethent'
23406 d_gethname='$d_gethname'
23407 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23408 d_gethostbyname_r='$d_gethostbyname_r'
23409 d_gethostent_r='$d_gethostent_r'
23410 d_gethostprotos='$d_gethostprotos'
23411 d_getitimer='$d_getitimer'
23412 d_getlogin='$d_getlogin'
23413 d_getlogin_r='$d_getlogin_r'
23414 d_getmnt='$d_getmnt'
23415 d_getmntent='$d_getmntent'
23416 d_getnameinfo='$d_getnameinfo'
23417 d_getnbyaddr='$d_getnbyaddr'
23418 d_getnbyname='$d_getnbyname'
23419 d_getnent='$d_getnent'
23420 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23421 d_getnetbyname_r='$d_getnetbyname_r'
23422 d_getnetent_r='$d_getnetent_r'
23423 d_getnetprotos='$d_getnetprotos'
23424 d_getpagsz='$d_getpagsz'
23425 d_getpbyname='$d_getpbyname'
23426 d_getpbynumber='$d_getpbynumber'
23427 d_getpent='$d_getpent'
23428 d_getpgid='$d_getpgid'
23429 d_getpgrp2='$d_getpgrp2'
23430 d_getpgrp='$d_getpgrp'
23431 d_getppid='$d_getppid'
23432 d_getprior='$d_getprior'
23433 d_getprotobyname_r='$d_getprotobyname_r'
23434 d_getprotobynumber_r='$d_getprotobynumber_r'
23435 d_getprotoent_r='$d_getprotoent_r'
23436 d_getprotoprotos='$d_getprotoprotos'
23437 d_getprpwnam='$d_getprpwnam'
23438 d_getpwent='$d_getpwent'
23439 d_getpwent_r='$d_getpwent_r'
23440 d_getpwnam_r='$d_getpwnam_r'
23441 d_getpwuid_r='$d_getpwuid_r'
23442 d_getsbyname='$d_getsbyname'
23443 d_getsbyport='$d_getsbyport'
23444 d_getsent='$d_getsent'
23445 d_getservbyname_r='$d_getservbyname_r'
23446 d_getservbyport_r='$d_getservbyport_r'
23447 d_getservent_r='$d_getservent_r'
23448 d_getservprotos='$d_getservprotos'
23449 d_getspnam='$d_getspnam'
23450 d_getspnam_r='$d_getspnam_r'
23451 d_gettimeod='$d_gettimeod'
23452 d_gmtime64='$d_gmtime64'
23453 d_gmtime_r='$d_gmtime_r'
23454 d_gnulibc='$d_gnulibc'
23455 d_grpasswd='$d_grpasswd'
23456 d_hasmntopt='$d_hasmntopt'
23458 d_ilogbl='$d_ilogbl'
23459 d_inc_version_list='$d_inc_version_list'
23461 d_inetaton='$d_inetaton'
23462 d_inetntop='$d_inetntop'
23463 d_inetpton='$d_inetpton'
23464 d_int64_t='$d_int64_t'
23465 d_ip_mreq='$d_ip_mreq'
23466 d_ip_mreq_source='$d_ip_mreq_source'
23467 d_ipv6_mreq='$d_ipv6_mreq'
23468 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23469 d_isascii='$d_isascii'
23470 d_isblank='$d_isblank'
23471 d_isfinite='$d_isfinite'
23472 d_isfinitel='$d_isfinitel'
23474 d_isinfl='$d_isinfl'
23476 d_isnanl='$d_isnanl'
23479 d_killpg='$d_killpg'
23480 d_lchown='$d_lchown'
23481 d_ldbl_dig='$d_ldbl_dig'
23482 d_ldexpl='$d_ldexpl'
23483 d_libm_lib_version='$d_libm_lib_version'
23484 d_libname_unique='$d_libname_unique'
23486 d_localtime64='$d_localtime64'
23487 d_localtime_r='$d_localtime_r'
23488 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23489 d_locconv='$d_locconv'
23491 d_longdbl='$d_longdbl'
23492 d_longlong='$d_longlong'
23493 d_lseekproto='$d_lseekproto'
23495 d_madvise='$d_madvise'
23496 d_malloc_good_size='$d_malloc_good_size'
23497 d_malloc_size='$d_malloc_size'
23499 d_mbstowcs='$d_mbstowcs'
23500 d_mbtowc='$d_mbtowc'
23501 d_memchr='$d_memchr'
23502 d_memcmp='$d_memcmp'
23503 d_memcpy='$d_memcpy'
23504 d_memmove='$d_memmove'
23505 d_memset='$d_memset'
23507 d_mkdtemp='$d_mkdtemp'
23508 d_mkfifo='$d_mkfifo'
23509 d_mkstemp='$d_mkstemp'
23510 d_mkstemps='$d_mkstemps'
23511 d_mktime64='$d_mktime64'
23512 d_mktime='$d_mktime'
23515 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23516 d_modflproto='$d_modflproto'
23517 d_mprotect='$d_mprotect'
23519 d_msg_ctrunc='$d_msg_ctrunc'
23520 d_msg_dontroute='$d_msg_dontroute'
23521 d_msg_oob='$d_msg_oob'
23522 d_msg_peek='$d_msg_peek'
23523 d_msg_proxy='$d_msg_proxy'
23524 d_msgctl='$d_msgctl'
23525 d_msgget='$d_msgget'
23526 d_msghdr_s='$d_msghdr_s'
23527 d_msgrcv='$d_msgrcv'
23528 d_msgsnd='$d_msgsnd'
23530 d_munmap='$d_munmap'
23531 d_mymalloc='$d_mymalloc'
23533 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23535 d_nl_langinfo='$d_nl_langinfo'
23536 d_nv_preserves_uv='$d_nv_preserves_uv'
23537 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23538 d_off64_t='$d_off64_t'
23539 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23540 d_oldpthreads='$d_oldpthreads'
23541 d_oldsock='$d_oldsock'
23543 d_pathconf='$d_pathconf'
23545 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23546 d_phostname='$d_phostname'
23549 d_portable='$d_portable'
23551 d_prctl_set_name='$d_prctl_set_name'
23552 d_printf_format_null='$d_printf_format_null'
23553 d_procselfexe='$d_procselfexe'
23554 d_pseudofork='$d_pseudofork'
23555 d_pthread_atfork='$d_pthread_atfork'
23556 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23557 d_pthread_yield='$d_pthread_yield'
23558 d_ptrdiff_t='$d_ptrdiff_t'
23560 d_pwchange='$d_pwchange'
23561 d_pwclass='$d_pwclass'
23562 d_pwcomment='$d_pwcomment'
23563 d_pwexpire='$d_pwexpire'
23564 d_pwgecos='$d_pwgecos'
23565 d_pwpasswd='$d_pwpasswd'
23566 d_pwquota='$d_pwquota'
23569 d_random_r='$d_random_r'
23570 d_readdir64_r='$d_readdir64_r'
23571 d_readdir='$d_readdir'
23572 d_readdir_r='$d_readdir_r'
23573 d_readlink='$d_readlink'
23575 d_recvmsg='$d_recvmsg'
23576 d_rename='$d_rename'
23577 d_rewinddir='$d_rewinddir'
23579 d_safebcpy='$d_safebcpy'
23580 d_safemcpy='$d_safemcpy'
23581 d_sanemcmp='$d_sanemcmp'
23582 d_sbrkproto='$d_sbrkproto'
23583 d_scalbnl='$d_scalbnl'
23584 d_sched_yield='$d_sched_yield'
23585 d_scm_rights='$d_scm_rights'
23586 d_seekdir='$d_seekdir'
23587 d_select='$d_select'
23589 d_semctl='$d_semctl'
23590 d_semctl_semid_ds='$d_semctl_semid_ds'
23591 d_semctl_semun='$d_semctl_semun'
23592 d_semget='$d_semget'
23594 d_sendmsg='$d_sendmsg'
23595 d_setegid='$d_setegid'
23596 d_seteuid='$d_seteuid'
23597 d_setgrent='$d_setgrent'
23598 d_setgrent_r='$d_setgrent_r'
23599 d_setgrps='$d_setgrps'
23600 d_sethent='$d_sethent'
23601 d_sethostent_r='$d_sethostent_r'
23602 d_setitimer='$d_setitimer'
23603 d_setlinebuf='$d_setlinebuf'
23604 d_setlocale='$d_setlocale'
23605 d_setlocale_r='$d_setlocale_r'
23606 d_setnent='$d_setnent'
23607 d_setnetent_r='$d_setnetent_r'
23608 d_setpent='$d_setpent'
23609 d_setpgid='$d_setpgid'
23610 d_setpgrp2='$d_setpgrp2'
23611 d_setpgrp='$d_setpgrp'
23612 d_setprior='$d_setprior'
23613 d_setproctitle='$d_setproctitle'
23614 d_setprotoent_r='$d_setprotoent_r'
23615 d_setpwent='$d_setpwent'
23616 d_setpwent_r='$d_setpwent_r'
23617 d_setregid='$d_setregid'
23618 d_setresgid='$d_setresgid'
23619 d_setresuid='$d_setresuid'
23620 d_setreuid='$d_setreuid'
23621 d_setrgid='$d_setrgid'
23622 d_setruid='$d_setruid'
23623 d_setsent='$d_setsent'
23624 d_setservent_r='$d_setservent_r'
23625 d_setsid='$d_setsid'
23626 d_setvbuf='$d_setvbuf'
23629 d_shmatprototype='$d_shmatprototype'
23630 d_shmctl='$d_shmctl'
23632 d_shmget='$d_shmget'
23633 d_sigaction='$d_sigaction'
23634 d_signbit='$d_signbit'
23635 d_sigprocmask='$d_sigprocmask'
23636 d_sigsetjmp='$d_sigsetjmp'
23637 d_sin6_scope_id='$d_sin6_scope_id'
23638 d_sitearch='$d_sitearch'
23639 d_snprintf='$d_snprintf'
23640 d_sockaddr_in6='$d_sockaddr_in6'
23641 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23642 d_sockatmark='$d_sockatmark'
23643 d_sockatmarkproto='$d_sockatmarkproto'
23644 d_socket='$d_socket'
23645 d_socklen_t='$d_socklen_t'
23646 d_sockpair='$d_sockpair'
23647 d_socks5_init='$d_socks5_init'
23648 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23650 d_srand48_r='$d_srand48_r'
23651 d_srandom_r='$d_srandom_r'
23652 d_sresgproto='$d_sresgproto'
23653 d_sresuproto='$d_sresuproto'
23654 d_statblks='$d_statblks'
23655 d_statfs_f_flags='$d_statfs_f_flags'
23656 d_statfs_s='$d_statfs_s'
23657 d_static_inline='$d_static_inline'
23658 d_statvfs='$d_statvfs'
23659 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23660 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23661 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23662 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23663 d_stdio_stream_array='$d_stdio_stream_array'
23664 d_stdiobase='$d_stdiobase'
23665 d_stdstdio='$d_stdstdio'
23666 d_strchr='$d_strchr'
23667 d_strcoll='$d_strcoll'
23668 d_strctcpy='$d_strctcpy'
23669 d_strerrm='$d_strerrm'
23670 d_strerror='$d_strerror'
23671 d_strerror_r='$d_strerror_r'
23672 d_strftime='$d_strftime'
23673 d_strlcat='$d_strlcat'
23674 d_strlcpy='$d_strlcpy'
23675 d_strtod='$d_strtod'
23676 d_strtol='$d_strtol'
23677 d_strtold='$d_strtold'
23678 d_strtoll='$d_strtoll'
23679 d_strtoq='$d_strtoq'
23680 d_strtoul='$d_strtoul'
23681 d_strtoull='$d_strtoull'
23682 d_strtouq='$d_strtouq'
23683 d_strxfrm='$d_strxfrm'
23684 d_suidsafe='$d_suidsafe'
23685 d_symlink='$d_symlink'
23686 d_syscall='$d_syscall'
23687 d_syscallproto='$d_syscallproto'
23688 d_sysconf='$d_sysconf'
23689 d_sysernlst='$d_sysernlst'
23690 d_syserrlst='$d_syserrlst'
23691 d_system='$d_system'
23692 d_tcgetpgrp='$d_tcgetpgrp'
23693 d_tcsetpgrp='$d_tcsetpgrp'
23694 d_telldir='$d_telldir'
23695 d_telldirproto='$d_telldirproto'
23697 d_timegm='$d_timegm'
23699 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23700 d_tm_tm_zone='$d_tm_tm_zone'
23701 d_tmpnam_r='$d_tmpnam_r'
23702 d_truncate='$d_truncate'
23703 d_truncl='$d_truncl'
23704 d_ttyname_r='$d_ttyname_r'
23705 d_tzname='$d_tzname'
23706 d_u32align='$d_u32align'
23707 d_ualarm='$d_ualarm'
23710 d_union_semun='$d_union_semun'
23711 d_unordered='$d_unordered'
23712 d_unsetenv='$d_unsetenv'
23713 d_usleep='$d_usleep'
23714 d_usleepproto='$d_usleepproto'
23716 d_vendorarch='$d_vendorarch'
23717 d_vendorbin='$d_vendorbin'
23718 d_vendorlib='$d_vendorlib'
23719 d_vendorscript='$d_vendorscript'
23721 d_void_closedir='$d_void_closedir'
23722 d_voidsig='$d_voidsig'
23723 d_voidtty='$d_voidtty'
23724 d_volatile='$d_volatile'
23725 d_vprintf='$d_vprintf'
23726 d_vsnprintf='$d_vsnprintf'
23728 d_waitpid='$d_waitpid'
23729 d_wcscmp='$d_wcscmp'
23730 d_wcstombs='$d_wcstombs'
23731 d_wcsxfrm='$d_wcsxfrm'
23732 d_wctomb='$d_wctomb'
23733 d_writev='$d_writev'
23736 db_hashtype='$db_hashtype'
23737 db_prefixtype='$db_prefixtype'
23738 db_version_major='$db_version_major'
23739 db_version_minor='$db_version_minor'
23740 db_version_patch='$db_version_patch'
23741 direntrytype='$direntrytype'
23744 doublesize='$doublesize'
23746 drand48_r_proto='$drand48_r_proto'
23748 dynamic_ext='$dynamic_ext'
23754 endgrent_r_proto='$endgrent_r_proto'
23755 endhostent_r_proto='$endhostent_r_proto'
23756 endnetent_r_proto='$endnetent_r_proto'
23757 endprotoent_r_proto='$endprotoent_r_proto'
23758 endpwent_r_proto='$endpwent_r_proto'
23759 endservent_r_proto='$endservent_r_proto'
23760 eunicefix='$eunicefix'
23763 extensions='$extensions'
23764 extern_C='$extern_C'
23766 fflushNULL='$fflushNULL'
23767 fflushall='$fflushall'
23769 firstmakefile='$firstmakefile'
23771 fpossize='$fpossize'
23772 fpostype='$fpostype'
23773 freetype='$freetype'
23776 full_csh='$full_csh'
23777 full_sed='$full_sed'
23778 gccansipedantic='$gccansipedantic'
23779 gccosandvers='$gccosandvers'
23780 gccversion='$gccversion'
23781 getgrent_r_proto='$getgrent_r_proto'
23782 getgrgid_r_proto='$getgrgid_r_proto'
23783 getgrnam_r_proto='$getgrnam_r_proto'
23784 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23785 gethostbyname_r_proto='$gethostbyname_r_proto'
23786 gethostent_r_proto='$gethostent_r_proto'
23787 getlogin_r_proto='$getlogin_r_proto'
23788 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23789 getnetbyname_r_proto='$getnetbyname_r_proto'
23790 getnetent_r_proto='$getnetent_r_proto'
23791 getprotobyname_r_proto='$getprotobyname_r_proto'
23792 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23793 getprotoent_r_proto='$getprotoent_r_proto'
23794 getpwent_r_proto='$getpwent_r_proto'
23795 getpwnam_r_proto='$getpwnam_r_proto'
23796 getpwuid_r_proto='$getpwuid_r_proto'
23797 getservbyname_r_proto='$getservbyname_r_proto'
23798 getservbyport_r_proto='$getservbyport_r_proto'
23799 getservent_r_proto='$getservent_r_proto'
23800 getspnam_r_proto='$getspnam_r_proto'
23801 gidformat='$gidformat'
23807 gmtime_r_proto='$gmtime_r_proto'
23808 gnulibc_version='$gnulibc_version'
23810 groupcat='$groupcat'
23811 groupstype='$groupstype'
23814 h_sysfile='$h_sysfile'
23817 hostgenerate='$hostgenerate'
23818 hostosname='$hostosname'
23819 hostperl='$hostperl'
23820 html1dir='$html1dir'
23821 html1direxp='$html1direxp'
23822 html3dir='$html3dir'
23823 html3direxp='$html3direxp'
23832 i_arpainet='$i_arpainet'
23833 i_assert='$i_assert'
23835 i_bsdioctl='$i_bsdioctl'
23839 i_dirent='$i_dirent'
23841 i_execinfo='$i_execinfo'
23846 i_fp_class='$i_fp_class'
23848 i_gdbm_ndbm='$i_gdbm_ndbm'
23849 i_gdbmndbm='$i_gdbmndbm'
23851 i_ieeefp='$i_ieeefp'
23852 i_inttypes='$i_inttypes'
23853 i_langinfo='$i_langinfo'
23854 i_libutil='$i_libutil'
23855 i_limits='$i_limits'
23856 i_locale='$i_locale'
23857 i_machcthr='$i_machcthr'
23858 i_malloc='$i_malloc'
23859 i_mallocmalloc='$i_mallocmalloc'
23861 i_memory='$i_memory'
23862 i_mntent='$i_mntent'
23865 i_neterrno='$i_neterrno'
23866 i_netinettcp='$i_netinettcp'
23870 i_pthread='$i_pthread'
23872 i_rpcsvcdbm='$i_rpcsvcdbm'
23874 i_shadow='$i_shadow'
23876 i_stdarg='$i_stdarg'
23877 i_stdbool='$i_stdbool'
23878 i_stddef='$i_stddef'
23879 i_stdint='$i_stdint'
23880 i_stdlib='$i_stdlib'
23881 i_string='$i_string'
23882 i_sunmath='$i_sunmath'
23883 i_sysaccess='$i_sysaccess'
23884 i_sysdir='$i_sysdir'
23885 i_sysfile='$i_sysfile'
23886 i_sysfilio='$i_sysfilio'
23888 i_sysioctl='$i_sysioctl'
23889 i_syslog='$i_syslog'
23890 i_sysmman='$i_sysmman'
23891 i_sysmode='$i_sysmode'
23892 i_sysmount='$i_sysmount'
23893 i_sysndir='$i_sysndir'
23894 i_sysparam='$i_sysparam'
23895 i_syspoll='$i_syspoll'
23896 i_sysresrc='$i_sysresrc'
23897 i_syssecrt='$i_syssecrt'
23898 i_sysselct='$i_sysselct'
23899 i_syssockio='$i_syssockio'
23900 i_sysstat='$i_sysstat'
23901 i_sysstatfs='$i_sysstatfs'
23902 i_sysstatvfs='$i_sysstatvfs'
23903 i_systime='$i_systime'
23904 i_systimek='$i_systimek'
23905 i_systimes='$i_systimes'
23906 i_systypes='$i_systypes'
23907 i_sysuio='$i_sysuio'
23909 i_sysutsname='$i_sysutsname'
23910 i_sysvfs='$i_sysvfs'
23911 i_syswait='$i_syswait'
23912 i_termio='$i_termio'
23913 i_termios='$i_termios'
23915 i_unistd='$i_unistd'
23918 i_values='$i_values'
23919 i_varargs='$i_varargs'
23920 i_varhdr='$i_varhdr'
23922 ignore_versioned_solibs='$ignore_versioned_solibs'
23923 inc_version_list='$inc_version_list'
23924 inc_version_list_init='$inc_version_list_init'
23928 initialinstalllocation='$initialinstalllocation'
23929 installarchlib='$installarchlib'
23930 installbin='$installbin'
23931 installhtml1dir='$installhtml1dir'
23932 installhtml3dir='$installhtml3dir'
23933 installman1dir='$installman1dir'
23934 installman3dir='$installman3dir'
23935 installprefix='$installprefix'
23936 installprefixexp='$installprefixexp'
23937 installprivlib='$installprivlib'
23938 installscript='$installscript'
23939 installsitearch='$installsitearch'
23940 installsitebin='$installsitebin'
23941 installsitehtml1dir='$installsitehtml1dir'
23942 installsitehtml3dir='$installsitehtml3dir'
23943 installsitelib='$installsitelib'
23944 installsiteman1dir='$installsiteman1dir'
23945 installsiteman3dir='$installsiteman3dir'
23946 installsitescript='$installsitescript'
23947 installstyle='$installstyle'
23948 installusrbinperl='$installusrbinperl'
23949 installvendorarch='$installvendorarch'
23950 installvendorbin='$installvendorbin'
23951 installvendorhtml1dir='$installvendorhtml1dir'
23952 installvendorhtml3dir='$installvendorhtml3dir'
23953 installvendorlib='$installvendorlib'
23954 installvendorman1dir='$installvendorman1dir'
23955 installvendorman3dir='$installvendorman3dir'
23956 installvendorscript='$installvendorscript'
23958 issymlink='$issymlink'
23959 ivdformat='$ivdformat'
23962 known_extensions='$known_extensions'
23965 ld_can_script='$ld_can_script'
23966 lddlflags='$lddlflags'
23968 ldflags_uselargefiles='$ldflags_uselargefiles'
23969 ldlibpthname='$ldlibpthname'
23976 libsdirs='$libsdirs'
23977 libsfiles='$libsfiles'
23978 libsfound='$libsfound'
23979 libspath='$libspath'
23980 libswanted='$libswanted'
23981 libswanted_uselargefiles='$libswanted_uselargefiles'
23987 localtime_r_proto='$localtime_r_proto'
23988 locincpth='$locincpth'
23989 loclibpth='$loclibpth'
23990 longdblkind='$longdblkind'
23991 longdblsize='$longdblsize'
23992 longlongsize='$longlongsize'
23993 longsize='$longsize'
23997 lseeksize='$lseeksize'
23998 lseektype='$lseektype'
24002 make_set_make='$make_set_make'
24003 mallocobj='$mallocobj'
24004 mallocsrc='$mallocsrc'
24005 malloctype='$malloctype'
24007 man1direxp='$man1direxp'
24010 man3direxp='$man3direxp'
24012 mips_type='$mips_type'
24013 mistrustnm='$mistrustnm'
24015 mmaptype='$mmaptype'
24016 modetype='$modetype'
24018 multiarch='$multiarch'
24020 myarchname='$myarchname'
24021 mydomain='$mydomain'
24022 myhostname='$myhostname'
24025 need_va_copy='$need_va_copy'
24026 netdb_hlen_type='$netdb_hlen_type'
24027 netdb_host_type='$netdb_host_type'
24028 netdb_name_type='$netdb_name_type'
24029 netdb_net_type='$netdb_net_type'
24032 nm_so_opt='$nm_so_opt'
24033 nonxs_ext='$nonxs_ext'
24035 nvEUformat='$nvEUformat'
24036 nvFUformat='$nvFUformat'
24037 nvGUformat='$nvGUformat'
24038 nv_overflows_integers_at='$nv_overflows_integers_at'
24039 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24040 nveformat='$nveformat'
24041 nvfformat='$nvfformat'
24042 nvgformat='$nvgformat'
24045 o_nonblock='$o_nonblock'
24047 old_pthread_create_joinable='$old_pthread_create_joinable'
24048 optimize='$optimize'
24049 orderlib='$orderlib'
24052 otherlibdirs='$otherlibdirs'
24056 patchlevel='$patchlevel'
24057 path_sep='$path_sep'
24060 perl_patchlevel='$perl_patchlevel'
24061 perl_static_inline='$perl_static_inline'
24062 perladmin='$perladmin'
24063 perllibs='$perllibs'
24064 perlpath='$perlpath'
24066 phostname='$phostname'
24072 prefixexp='$prefixexp'
24074 privlibexp='$privlibexp'
24075 procselfexe='$procselfexe'
24076 prototype='$prototype'
24078 quadkind='$quadkind'
24079 quadtype='$quadtype'
24080 randbits='$randbits'
24081 randfunc='$randfunc'
24082 random_r_proto='$random_r_proto'
24083 randseedtype='$randseedtype'
24085 rd_nodata='$rd_nodata'
24086 readdir64_r_proto='$readdir64_r_proto'
24087 readdir_r_proto='$readdir_r_proto'
24088 revision='$revision'
24094 sGMTIME_max='$sGMTIME_max'
24095 sGMTIME_min='$sGMTIME_min'
24096 sLOCALTIME_max='$sLOCALTIME_max'
24097 sLOCALTIME_min='$sLOCALTIME_min'
24098 sPRIEUldbl='$sPRIEUldbl'
24099 sPRIFUldbl='$sPRIFUldbl'
24100 sPRIGUldbl='$sPRIGUldbl'
24101 sPRIXU64='$sPRIXU64'
24103 sPRIeldbl='$sPRIeldbl'
24104 sPRIfldbl='$sPRIfldbl'
24105 sPRIgldbl='$sPRIgldbl'
24110 sSCNfldbl='$sSCNfldbl'
24111 sched_yield='$sched_yield'
24112 scriptdir='$scriptdir'
24113 scriptdirexp='$scriptdirexp'
24115 seedfunc='$seedfunc'
24116 selectminbits='$selectminbits'
24117 selecttype='$selecttype'
24118 sendmail='$sendmail'
24119 setgrent_r_proto='$setgrent_r_proto'
24120 sethostent_r_proto='$sethostent_r_proto'
24121 setlocale_r_proto='$setlocale_r_proto'
24122 setnetent_r_proto='$setnetent_r_proto'
24123 setprotoent_r_proto='$setprotoent_r_proto'
24124 setpwent_r_proto='$setpwent_r_proto'
24125 setservent_r_proto='$setservent_r_proto'
24128 sharpbang='$sharpbang'
24129 shmattype='$shmattype'
24130 shortsize='$shortsize'
24133 sig_count='$sig_count'
24134 sig_name='$sig_name'
24135 sig_name_init='$sig_name_init'
24137 sig_num_init='$sig_num_init'
24138 sig_size='$sig_size'
24139 signal_t='$signal_t'
24140 sitearch='$sitearch'
24141 sitearchexp='$sitearchexp'
24143 sitebinexp='$sitebinexp'
24144 sitehtml1dir='$sitehtml1dir'
24145 sitehtml1direxp='$sitehtml1direxp'
24146 sitehtml3dir='$sitehtml3dir'
24147 sitehtml3direxp='$sitehtml3direxp'
24149 sitelib_stem='$sitelib_stem'
24150 sitelibexp='$sitelibexp'
24151 siteman1dir='$siteman1dir'
24152 siteman1direxp='$siteman1direxp'
24153 siteman3dir='$siteman3dir'
24154 siteman3direxp='$siteman3direxp'
24155 siteprefix='$siteprefix'
24156 siteprefixexp='$siteprefixexp'
24157 sitescript='$sitescript'
24158 sitescriptexp='$sitescriptexp'
24159 sizesize='$sizesize'
24160 sizetype='$sizetype'
24164 sockethdr='$sockethdr'
24165 socketlib='$socketlib'
24166 socksizetype='$socksizetype'
24168 spackage='$spackage'
24169 spitshell='$spitshell'
24170 srand48_r_proto='$srand48_r_proto'
24171 srandom_r_proto='$srandom_r_proto'
24173 ssizetype='$ssizetype'
24174 st_ino_sign='$st_ino_sign'
24175 st_ino_size='$st_ino_size'
24176 startperl='$startperl'
24178 static_ext='$static_ext'
24180 stdio_base='$stdio_base'
24181 stdio_bufsiz='$stdio_bufsiz'
24182 stdio_cnt='$stdio_cnt'
24183 stdio_filbuf='$stdio_filbuf'
24184 stdio_ptr='$stdio_ptr'
24185 stdio_stream_array='$stdio_stream_array'
24186 strerror_r_proto='$strerror_r_proto'
24189 subversion='$subversion'
24194 targetarch='$targetarch'
24195 targetdir='$targetdir'
24196 targetenv='$targetenv'
24197 targethost='$targethost'
24198 targetmkdir='$targetmkdir'
24199 targetport='$targetport'
24200 targetsh='$targetsh'
24204 timeincl='$timeincl'
24205 timetype='$timetype'
24206 tmpnam_r_proto='$tmpnam_r_proto'
24212 ttyname_r_proto='$ttyname_r_proto'
24221 uidformat='$uidformat'
24227 uquadtype='$uquadtype'
24228 use5005threads='$use5005threads'
24229 use64bitall='$use64bitall'
24230 use64bitint='$use64bitint'
24231 usecbacktrace='$usecbacktrace'
24232 usecrosscompile='$usecrosscompile'
24233 usedevel='$usedevel'
24235 usedtrace='$usedtrace'
24236 usefaststdio='$usefaststdio'
24237 useithreads='$useithreads'
24238 usekernprocpathname='$usekernprocpathname'
24239 uselargefiles='$uselargefiles'
24240 uselongdouble='$uselongdouble'
24241 usemallocwrap='$usemallocwrap'
24242 usemorebits='$usemorebits'
24243 usemultiplicity='$usemultiplicity'
24244 usemymalloc='$usemymalloc'
24246 usensgetexecutablepath='$usensgetexecutablepath'
24247 useopcode='$useopcode'
24248 useperlio='$useperlio'
24249 useposix='$useposix'
24250 usereentrant='$usereentrant'
24251 userelocatableinc='$userelocatableinc'
24252 useshrplib='$useshrplib'
24253 usesitecustomize='$usesitecustomize'
24254 usesocks='$usesocks'
24255 usethreads='$usethreads'
24256 usevendorprefix='$usevendorprefix'
24257 useversionedarchname='$useversionedarchname'
24258 usevfork='$usevfork'
24261 uvXUformat='$uvXUformat'
24262 uvoformat='$uvoformat'
24265 uvuformat='$uvuformat'
24266 uvxformat='$uvxformat'
24268 vendorarch='$vendorarch'
24269 vendorarchexp='$vendorarchexp'
24270 vendorbin='$vendorbin'
24271 vendorbinexp='$vendorbinexp'
24272 vendorhtml1dir='$vendorhtml1dir'
24273 vendorhtml1direxp='$vendorhtml1direxp'
24274 vendorhtml3dir='$vendorhtml3dir'
24275 vendorhtml3direxp='$vendorhtml3direxp'
24276 vendorlib='$vendorlib'
24277 vendorlib_stem='$vendorlib_stem'
24278 vendorlibexp='$vendorlibexp'
24279 vendorman1dir='$vendorman1dir'
24280 vendorman1direxp='$vendorman1direxp'
24281 vendorman3dir='$vendorman3dir'
24282 vendorman3direxp='$vendorman3direxp'
24283 vendorprefix='$vendorprefix'
24284 vendorprefixexp='$vendorprefixexp'
24285 vendorscript='$vendorscript'
24286 vendorscriptexp='$vendorscriptexp'
24288 version_patchlevel_string='$version_patchlevel_string'
24289 versiononly='$versiononly'
24293 yaccflags='$yaccflags'
24298 : add special variables
24299 $test -f $src/patchlevel.h && \
24300 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24301 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24302 echo "PERL_CONFIG_SH=true" >>config.sh
24304 : propagate old symbols
24305 if $test -f UU/config.sh; then
24306 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24307 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24308 config.sh config.sh UU/oldconfig.sh |\
24309 $sort | $uniq -u >UU/oldsyms
24310 set X `$cat UU/oldsyms`
24316 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24318 echo ": Variables propagated from previous config.sh file." >>config.sh
24319 for sym in `$cat UU/oldsyms`; do
24320 echo " Propagating $hint variable "'$'"$sym..."
24321 eval 'tmp="$'"${sym}"'"'
24323 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24329 : preserve RCS keywords in files with variable substitution, grrr
24332 : Finish up by extracting the .SH files
24336 echo "Extraction done."
24346 If you'd like to make any changes to the config.sh file before I begin
24347 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24350 rp="Press return or use a shell escape to edit config.sh:"
24355 *) : in case they cannot read
24356 sh 1>&4 -c "$ans";;
24361 : if this fails, just run all the .SH files by hand
24370 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24377 Now you need to generate make dependencies by running "$make depend".
24378 You might prefer to run it in background: "$make depend > makedepend.out &"
24379 It can take a while, so you might not want to run it right now.
24384 rp="Run $make depend now?"
24388 $make depend && echo "Now you must run '$make'."
24391 echo "You must run '$make depend' then '$make'."
24394 elif test -f [Mm]akefile; then
24396 echo "Now you must run a $make."
24398 echo "Configure done."
24401 if $test -f Policy.sh; then
24404 If you compile $package on a different machine or from a different object
24405 directory, copy the Policy.sh file from this object directory to the
24406 new one before you run Configure -- this will help you with most of
24407 the policy defaults.
24411 if $test -f config.msg; then
24412 echo "Hmm. I also noted the following information while running:"
24414 $cat config.msg >&4
24417 $rm -f kit*isdone ark*isdone