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=''
935 d_gdbm_ndbm_h_uses_prototypes=''
936 d_gdbmndbm_h_uses_prototypes=''
938 d_ndbm_h_uses_prototypes=''
1013 d_inc_version_list=''
1015 inc_version_list_init=''
1019 installusrbinperl=''
1035 ignore_versioned_solibs=''
1095 d_perl_otherlibdirs=''
1103 api_versionstring=''
1109 version_patchlevel_string=''
1113 d_nv_preserves_uv=''
1114 d_nv_zero_is_allbits_zero=''
1125 nv_overflows_integers_at=''
1126 nv_preserves_uv_bits=''
1199 installsitehtml1dir=''
1202 installsitehtml3dir=''
1209 installsiteman1dir=''
1212 installsiteman3dir=''
1217 installsitescript=''
1235 d_stdio_stream_array=''
1236 stdio_stream_array=''
1254 usekernprocpathname=''
1255 ccflags_uselargefiles=''
1256 ldflags_uselargefiles=''
1257 libswanted_uselargefiles=''
1266 usensgetexecutablepath=''
1279 installvendorarch=''
1286 installvendorhtml1dir=''
1288 vendorhtml1direxp=''
1289 installvendorhtml3dir=''
1291 vendorhtml3direxp=''
1297 installvendorman1dir=''
1300 installvendorman3dir=''
1307 installvendorscript=''
1318 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1321 : We must find out about Eunice early
1323 if test -f /etc/unixtovms; then
1324 eunicefix=/etc/unixtovms
1326 if test -f /etc/unixtovms.exe; then
1327 eunicefix=/etc/unixtovms.exe
1330 : Set executable suffix now -- needed before hints available
1331 if test -f "/libs/version.library"; then
1334 elif test -f "/system/gnu_library/bin/ar.pm"; then
1337 elif test -n "$DJGPP"; then
1340 elif test -f /kern/cookiejar; then
1343 elif test -d c:/. -o -n "$is_os2" ; then
1350 : Trailing extension. Override this in a hint file, if needed.
1351 : Extra object files, if any, needed on this platform.
1354 : Possible local include directories to search.
1355 : Set locincpth to "" in a hint file to defeat local include searches.
1356 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1357 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1359 : no include file wanted by default
1362 : Enable -DEBUGGING and -DDEBUGGING from the command line
1367 : change the next line if compiling for Xenix/286 on Xenix/386
1368 xlibpth='/usr/lib/386 /lib/386'
1369 : Possible local library directories to search.
1370 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1371 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1373 : general looking path for locating libraries
1374 glibpth="/lib /usr/lib $xlibpth"
1375 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1376 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1377 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1378 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1380 : Private path used by Configure to find libraries. Its value
1381 : is prepended to libpth. This variable takes care of special
1382 : machines, like the mips. Usually, it should be empty.
1385 : default library list
1387 : some systems want to use only the non-versioned libso:s
1388 ignore_versioned_solibs=''
1389 : set usethreads on the Configure command line to enable threads.
1390 usereentrant='undef'
1394 : set useposix=false in your hint file to disable the POSIX extension.
1396 : set useopcode=false in your hint file to disable the Opcode extension.
1399 ccflags_uselargefiles=''
1400 ldflags_uselargefiles=''
1401 libswanted_uselargefiles=''
1402 : set usemultiplicity on the Configure command line to enable multiplicity.
1403 : set usesocks on the Configure command line to enable socks.
1404 : List of libraries we want.
1405 : If anyone needs extra -lxxx, put those in a hint file.
1406 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1407 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1408 : We probably want to search /usr/shlib before most other libraries.
1409 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1410 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1411 glibpth="/usr/shlib $glibpth"
1412 : Do not use vfork unless overridden by a hint file.
1415 : Find the basic shell for Bourne shell scripts
1419 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1422 if test -f "$xxx"; then
1425 : Build up a list and do a single loop so we can 'break' out.
1426 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1427 for xxx in sh bash ksh pdksh ash; do
1429 try="$try ${p}/${xxx}"
1433 if test -f "$xxx"; then
1436 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1439 elif test -f "$xxx.exe"; then
1450 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1452 Usually it's in /bin/sh. How did you even get this far?
1453 Please contact me (Perl Maintainers) at perlbug@perl.org and
1454 we'll try to straighten this all out.
1460 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1461 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1464 : see if sh knows # comments
1465 if `$sh -c '#' >/dev/null 2>&1`; then
1469 test -f $xcat$_exe || xcat=/usr/bin/cat
1470 if test ! -f $xcat$_exe; then
1471 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1472 if test -f $p/cat$_exe; then
1477 if test ! -f $xcat$_exe; then
1478 echo "Can't find cat anywhere!"
1482 echo "#!$xcat" >sharp
1485 ./sharp > today 2>/dev/null
1486 if test -s today; then
1489 echo "#! $xcat" > sharp
1492 ./sharp > today 2>/dev/null
1493 if test -s today; then
1501 echo "Your $sh doesn't grok # comments--I will strip them later on."
1504 echo "exec grep -v '^[ ]*#'" >spitshell
1506 $eunicefix spitshell
1507 spitshell=`pwd`/spitshell
1509 echo "I presume that if # doesn't work, #! won't work either!"
1514 : figure out how to guarantee sh startup
1516 '') startsh=${sharpbang}${sh} ;;
1528 : echo "Yup, it does."
1530 echo "Hmm... '$startsh' does not guarantee sh startup..."
1531 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1535 : Save command line options in file UU/cmdline.opt for later use in
1536 : generating config.sh.
1537 cat > cmdline.opt <<EOSH
1538 : Configure command line arguments.
1547 cat >>cmdline.opt <<EOSH
1548 config_arg$argn='$arg'
1550 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1553 arg_exp=`cat cmdl.opt`
1554 args_exp="$args_exp$args_sep'$arg_exp'"
1555 argn=`expr $argn + 1`
1560 : produce awk script to parse command line options
1561 cat >options.awk <<'EOF'
1563 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1565 len = length(optstr);
1566 for (i = 1; i <= len; i++) {
1567 c = substr(optstr, i, 1);
1568 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1579 if (substr(str, 1, 1) != "-") {
1580 printf("'%s'\n", str);
1584 for (i = 2; i <= len; i++) {
1585 c = substr(str, i, 1);
1587 printf("-%s\n", substr(str, i));
1593 printf("'%s'\n", substr(str, i + 1));
1606 : process the command line options
1607 set X `for arg in "$@"; do echo "X$arg"; done |
1608 sed -e s/X// | awk -f options.awk`
1613 : set up default values
1623 rm -f optdef.sh posthint.sh
1624 cat >optdef.sh <<EOS
1630 while test $# -gt 0; do
1632 -d) shift; fastread=yes;;
1633 -e) shift; alldone=cont;;
1637 if test -r "$1"; then
1640 echo "$me: cannot read config file $1." >&2
1646 -h) shift; error=true;;
1647 -r) shift; reuseval=true;;
1648 -s) shift; silent=true; realsilent=true;;
1649 -E) shift; alldone=exit;;
1650 -K) shift; knowitall=true;;
1651 -O) shift; override=true;;
1652 -S) shift; silent=true; extractsh=true;;
1657 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1658 echo "$me: ignoring -D $1" >&2
1661 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1662 *) echo "$1='define'" >> optdef.sh;;
1669 *=) echo "$1" >> optdef.sh;;
1671 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1672 echo "$me: ignoring -U $1" >&2
1674 *) echo "$1='undef'" >> optdef.sh;;
1685 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1689 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1690 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1696 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1697 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1698 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1699 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1700 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1701 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1707 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1709 echo "$yyy=''" >> posthint.sh ;;
1714 echo "$yyy='$zzz'" >> posthint.sh ;;
1716 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1718 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1723 echo "$yyy=$zzz" >> posthint.sh ;;
1724 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1728 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1731 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1739 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1740 [-U symbol] [-U symbol=] [-A command:symbol...]
1741 -d : use defaults for all answers.
1742 -e : go on without questioning past the production of config.sh.
1743 -f : specify an alternate default configuration file.
1744 -h : print this help message and exit (with an error status).
1745 -r : reuse C symbols value if possible (skips costly nm extraction).
1746 -s : silent mode, only echoes questions and essential information.
1747 -D : define symbol to have some value:
1748 -D symbol symbol gets the value 'define'
1749 -D symbol=value symbol gets the value 'value'
1750 common used examples (see INSTALL for more info):
1751 -Duse64bitint use 64bit integers
1752 -Duse64bitall use 64bit integers and pointers
1753 -Dusethreads use thread support
1754 -Dinc_version_list=none do not include older perl trees in @INC
1755 -DEBUGGING=none DEBUGGING options
1756 -Dcc=gcc choose your compiler
1757 -Dprefix=/opt/perl5 choose your destination
1758 -E : stop at the end of questions, after having produced config.sh.
1759 -K : do not use unless you know what you are doing.
1760 -O : let -D and -U override definitions from loaded configuration file.
1761 -S : perform variable substitutions on all .SH files (can mix with -f)
1762 -U : undefine symbol:
1763 -U symbol symbol gets the value 'undef'
1764 -U symbol= symbol gets completely empty
1766 -A : manipulate symbol after the platform specific hints have been applied:
1767 -A append:symbol=value append value to symbol
1768 -A symbol=value like append:, but with a separating space
1769 -A define:symbol=value define symbol to have value
1770 -A clear:symbol define symbol to be ''
1771 -A define:symbol define symbol to be 'define'
1772 -A eval:symbol=value define symbol to be eval of value
1773 -A prepend:symbol=value prepend value to symbol
1774 -A undef:symbol define symbol to be 'undef'
1775 -A undef:symbol= define symbol to be ''
1776 e.g.: -A prepend:libswanted='cl pthread '
1777 -A ccflags=-DSOME_MACRO
1778 -V : print version number and exit (with a zero status).
1785 case "$fastread$alldone" in
1788 case "$extractsh" in
1791 if test ! -t 0; then
1792 echo "Say 'sh Configure', not 'sh <Configure'"
1802 true) exec 1>/dev/null;;
1805 : run the defines and the undefines, if any, but leave the file out there...
1808 : create the posthint manipulation script and leave the file out there...
1813 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1814 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1815 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1816 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1817 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1820 : Some greps do not return status, grrr.
1821 echo "grimblepritz" >grimble
1822 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1824 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1830 : the following should work in any shell
1834 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1835 cat >contains <<'EOSS'
1836 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1841 : Find the path to the source tree
1844 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1848 *) src=`cd ../$src && pwd` ;;
1861 if test -f $rsrc/Configure && \
1862 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1864 : found it, so we are ok.
1867 for src in . .. ../.. ../../.. ../../../..; do
1868 if test -f ../$src/Configure && \
1869 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1880 Sorry, I can't seem to locate the source dir for $package. Please start
1881 Configure with an explicit path -- i.e. /some/path/Configure.
1889 echo "Sources for $package found in \"$src\"." >&4
1893 : script used to extract .SH files with variable substitutions
1894 cat >extract <<'EOS'
1896 echo "Doing variable substitutions on .SH files..."
1897 if test -f MANIFEST; then
1898 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1900 echo "(Looking for .SH files under the source directory.)"
1901 set x `(cd "$src"; find . -name "*.SH" -print)`
1905 0) set x `(cd "$src"; echo *.SH)`; shift;;
1907 if test ! -f "$src/$1"; then
1913 while test $name; do
1914 if test ! -d "$name"; then
1915 create="$name $create";
1916 name=`echo $name | sed -e "s|^[^/]*$||"`;
1917 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1922 for file in $create; do
1931 dir=`expr X$file : 'X\(.*\)/'`
1932 file=`expr X$file : 'X.*/\(.*\)'`
1933 (cd "$dir" && . ./$file)
1943 dir=`expr X$file : 'X\(.*\)/'`
1944 file=`expr X$file : 'X.*/\(.*\)'`
1945 (set x $dir; shift; eval $mkdir_p)
1946 sh <"$src/$dir/$file"
1955 if test -f "$src/config_h.SH"; then
1956 if test ! -f config.h; then
1957 : oops, they left it out of MANIFEST, probably, so do it anyway.
1958 . "$src/config_h.SH"
1963 : extract files and exit if asked to do so
1964 case "$extractsh" in
1966 case "$realsilent" in
1970 case "$config_sh" in
1971 '') config_sh='config.sh';;
1974 echo "Fetching answers from $config_sh..."
1977 test "$override" && . ./optdef.sh
1981 echo "Extraction done."
1986 : Eunice requires " " instead of "", can you believe it
1989 echo "Beginning of configuration questions for $package."
1991 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1993 : first determine how to suppress newline on echo command
1995 echo "Checking echo to see how to suppress newlines..."
1996 (echo "hi there\c" ; echo " ") >.echotmp
1997 if $contains c .echotmp >/dev/null 2>&1 ; then
2008 echo $n "The star should be here-->$c"
2012 : Now test for existence of everything in MANIFEST
2014 if test -f "$rsrc/MANIFEST"; then
2015 echo "First let's make sure your kit is complete. Checking..." >&4
2016 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2017 (split -l 50 2>/dev/null || split -50)
2020 for filelist in x??; do
2021 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2022 >/dev/null 2>>"$tmppwd/missing")
2024 if test -s missing; then
2028 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2030 You have the option of continuing the configuration process, despite the
2031 distinct possibility that your kit is damaged, by typing 'y'es. If you
2032 do, don't blame me if something goes wrong. I advise you to type 'n'o
2033 and contact the author (perlbug@perl.org).
2036 echo $n "Continue? [n] $c" >&4
2040 echo "Continuing..." >&4
2044 echo "ABORTING..." >&4
2049 echo "Looks good..."
2052 echo "There is no MANIFEST file. I hope your kit is complete !"
2056 : Find the appropriate value for a newline for tr
2058 if test -n "$DJGPP"; then
2061 if test X"$trnl" = X; then
2062 case "`echo foo|tr '\n' x 2>/dev/null`" in
2066 if test X"$trnl" = X; then
2067 case "`echo foo|tr '\012' x 2>/dev/null`" in
2068 foox) trnl='\012' ;;
2071 if test X"$trnl" = X; then
2072 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2073 fooxy) trnl='\n\r' ;;
2076 if test X"$trnl" = X; then
2079 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2085 : compute the number of columns on the terminal for proper question formatting
2090 : set up the echo used in my read
2091 myecho="case \"\$xxxm\" in
2092 '') echo $n \"\$rp $c\" >&4;;
2094 '') echo $n \"[\$xxxm] $c\";;
2096 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2098 echo $n \"[\$xxxm] $c\" >&4
2100 echo $n \"\$rp [\$xxxm] $c\" >&4
2106 : now set up to do reads with possible shell escape and default assignment
2112 case "\$fastread" in
2113 yes) case "\$dflt" in
2116 case "\$silent-\$rp" in
2121 *) case "\$silent" in
2122 true) case "\$rp" in
2127 while expr "X\$ans" : "X!" >/dev/null; do
2131 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2139 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2148 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2153 echo "(OK, I'll run with -d after this question.)" >&4
2156 echo "*** Sorry, \$1 not supported yet." >&4
2166 echo "*** Substitution done -- please confirm."
2168 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2173 echo "*** Error -- try again."
2180 case "\$ans\$xxxm\$nostick" in
2192 : create .config dir to save info across Configure sessions
2193 test -d ../.config || mkdir ../.config
2194 cat >../.config/README <<EOF
2195 This directory created by Configure to save information that should
2196 persist across sessions for $package.
2198 You may safely delete it if you wish.
2201 : See if we are using a devel version and want that
2202 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2205 usedevel="$define" ;;
2206 *) case "$xversion" in
2209 *** WHOA THERE!!! ***
2211 This is an UNSTABLE DEVELOPMENT release.
2212 The version of this $package distribution is $xversion, that is, odd,
2213 (as opposed to even) and that signifies a development release.
2214 If you want a maintenance release, you want an even-numbered version.
2216 Do ***NOT*** install this into production use.
2217 Data corruption and crashes are possible.
2219 It is most seriously suggested that you do not continue any further
2220 unless you want to help in developing and debugging Perl.
2222 If you *still* want to build perl, you can answer 'y' now,
2223 or pass -Dusedevel to Configure.
2226 rp='Do you really want to continue?'
2230 [yY]) echo >&4 "Okay, continuing."
2231 usedevel="$define" ;;
2232 *) echo >&4 "Okay, bye."
2243 case "$versiononly" in
2244 '') versiononly="$define" ;;
2246 case "$installusrbinperl" in
2247 '') installusrbinperl="$undef" ;;
2252 : general instructions
2255 user=`(logname) 2>/dev/null`
2257 '') user=`whoami 2>&1`;;
2259 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2262 rp='Would you like to see the instructions?'
2273 This installation shell script will examine your system and ask you questions
2274 to determine how the perl5 package should be installed. If you get
2275 stuck on a question, you may use a ! shell escape to start a subshell or
2276 execute a command. Many of the questions will have default answers in square
2277 brackets; typing carriage return will give you the default.
2279 On some of the questions which ask for file or directory names you are allowed
2280 to use the ~name construct to specify the login directory belonging to "name",
2281 even if you don't have a shell which knows about that. Questions where this is
2282 allowed will be marked "(~name ok)".
2286 dflt='Type carriage return to continue'
2290 The prompter used in this script allows you to use shell variables and
2291 backticks in your answers. You may use $1, $2, etc... to refer to the words
2292 in the default answer, as if the default line was a set of arguments given to a
2293 script shell. This means you may also use $* to repeat the whole default line,
2294 so you do not have to re-type everything to add something to the default.
2296 Every time there is a substitution, you will have to confirm. If there is an
2297 error (e.g. an unmatched backtick), the default answer will remain unchanged
2298 and you will be prompted again.
2300 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2301 the questions and use the computed defaults (or the previous answers if there
2302 was already a config.sh file). Type 'Configure -h' for a list of options.
2303 You may also start interactively and then answer '& -d' at any prompt to turn
2304 on the non-interactive behaviour for the remainder of the execution.
2310 Much effort has been expended to ensure that this shell script will run on any
2311 Unix system. If despite that it blows up on yours, your best bet is to edit
2312 Configure and run it again. If you can't run Configure for some reason,
2313 you'll have to generate a config.sh file by hand. Whatever problems you
2314 have, let me (perlbug@perl.org) know how I blew it.
2316 This installation script affects things in two ways:
2318 1) it may do direct variable substitutions on some of the files included
2320 2) it builds a config.h file for inclusion in C programs. You may edit
2321 any of these files as the need arises after running this script.
2323 If you make a mistake on a question, there is no easy way to back up to it
2324 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2325 files. Configure will offer to let you do this before it runs the SH files.
2328 dflt='Type carriage return to continue'
2330 case "$firsttime" in
2331 true) echo $user >>../.config/instruct;;
2335 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2336 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2337 if test "X$sysroot" = X; then
2342 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2343 # _sysroot is used in places where we need --sysroot=foo
2344 # but using the rest of the flags could cause issues.
2345 _sysroot="--sysroot=$sysroot";
2349 ccflags="$ccflags $_sysroot"
2354 ldflags="$ldflags $_sysroot"
2359 cppflags="$cppflags $_sysroot"
2361 # lddlflags updated below in lddlflags section;
2362 # same with cccdlflags
2366 # Adjust some defaults to also use $sysroot
2367 for var in xlibpth loclibpth locincpth glibpth; do
2370 for path in $xxx; do
2371 eval $var=\"\$$var $sysroot$path\"
2377 : find out where common programs are
2379 echo "Locating common programs..." >&4
2392 if test -d \$dir/\$thing; then
2398 for thisthing in \$dir/\$thing; do
2399 : just loop through to pick last item
2401 if test -f \$thisthing; then
2404 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2407 elif test -f \$dir/\$thing.exe; then
2408 if test -n "$DJGPP"; then
2409 echo \$dir/\$thing.exe
2410 elif test "$eunicefix" != ":"; then
2411 : on Eunice apparently
2464 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2465 pth="$pth $sysroot/lib $sysroot/usr/lib"
2466 for file in $loclist; do
2470 if test -f "$xxx"; then
2473 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2474 xxx=`./loc $file $file $pth`
2477 '') xxx=`./loc $file $file $pth`;;
2478 *) xxx=`./loc $xxx $xxx $pth`;;
2480 eval $file=$xxx$_exe
2484 echo $file is in $xxx.
2487 echo $file is in $xxx.
2490 echo "I don't know where '$file' is, and my life depends on it." >&4
2491 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2497 echo "Don't worry if any of the following aren't found..."
2499 for file in $trylist; do
2503 if test -f "$xxx"; then
2506 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2507 xxx=`./loc $file $file $pth`
2510 '') xxx=`./loc $file $file $pth`;;
2511 *) xxx=`./loc $xxx $xxx $pth`;;
2513 eval $file=$xxx$_exe
2517 echo $file is in $xxx.
2520 echo $file is in $xxx.
2523 echo "I don't see $file out there, $say."
2530 echo "Substituting grep for egrep."
2537 *) if $less -R </dev/null >/dev/null 2>&1; then
2538 echo "Substituting less -R for less."
2546 echo "Substituting cp for ln."
2555 echo "I can't find make or gmake, and my life depends on it." >&4
2556 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2564 *) # We can't have osname yet.
2565 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2566 # Assume that gmake, if found, is definitely GNU make
2567 # and prefer it over the system make.
2568 echo "Substituting gmake for make."
2576 echo "Hopefully test is built into your sh."
2579 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2580 echo "Using the test built into your sh."
2588 echo "Hopefully echo is built into your sh."
2593 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2594 $echo $n "hi there$c" >foo1
2595 echo $n "hi there$c" >foo2
2596 if cmp foo1 foo2 >/dev/null 2>&1; then
2597 echo "They are compatible. In fact, they may be identical."
2604 They are not compatible! You are probably running ksh on a non-USG system.
2605 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2606 have echo built in and we may have to run some Bourne shell scripts. That
2607 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2610 $echo $n "The star should be here-->$c"
2617 # This question was auctioned at YAPC::Europe-2007 in Vienna
2618 # I never promised you could answer it. I only auctioned the question.
2620 The following message is sponsored by
2622 Dresden.pm<--The stars should be here.
2624 Dear Perl user, system administrator or package
2625 maintainer, the Perl community sends greetings to
2626 you. Do you (emblematical) greet back [Y/n]? n
2630 : Check what type of C compiler we use
2634 cat <<'EOSC' >>trygcc
2639 int main(int argc, char *argv[]) {
2643 if $cc -o try $ccflags $ldflags try.c; then
2646 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2652 # Skip this test because it gives a false match on output like:
2653 # ./trygcc: line 23: cc: command not found
2654 # case "`$cc -v -c try.c 2>&1`" in
2655 # *gcc*) trygcc=no ;;
2657 if $test X"$trygcc" = Xyes; then
2658 if gcc -o try -c try.c; then
2660 echo "You seem to have a working gcc, though." >&4
2661 # Switching compilers may undo the work of hints files.
2662 # The most common problem is -D_REENTRANT for threads.
2663 # This heuristic catches that case, but gets false positives
2664 # if -Dusethreads was not actually specified. Better to
2665 # bail out here with a useful message than fail
2666 # mysteriously later. Should we perhaps just try to
2667 # re-invoke Configure -Dcc=gcc config_args ?
2668 if $test -f usethreads.cbu; then
2671 *** However, any setting of the C compiler flags (e.g. for thread support)
2672 *** will be lost. It may be necessary for you to restart Configure and
2673 *** add -Dcc=gcc to your Configure command line.
2676 rp="Would you like to go ahead and try gcc anyway?"
2679 rp="Would you like to use it?"
2682 if $test -f myread; then
2685 if $test -f UU/myread; then
2688 echo "Cannot find myread, sorry. Aborting." >&2
2693 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2706 cat <<'EOSC' >>checkcc
2711 int main(int argc, char *argv[]) {
2715 if $cc -o try $ccflags $ldflags try.c; then
2718 if $test X"$despair" = Xyes; then
2719 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2722 You need to find a working C compiler.
2723 Either (purchase and) install the C compiler supplied by your OS vendor,
2724 or for a free C compiler try http://gcc.gnu.org/
2725 I cannot continue any further, aborting.
2734 : determine whether symbolic links are supported
2737 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2738 echo "Symbolic links are supported." >&4
2741 echo "Symbolic links are NOT supported." >&4
2746 : determine whether symbolic links are supported
2750 echo "Checking how to test for symbolic links..." >&4
2752 if $test "X$issymlink" = X; then
2754 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2755 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2757 if test $? = 0; then
2760 echo "Your builtin 'test -h' may be broken." >&4
2763 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2766 if test -f "$p/$test"; then
2775 echo "Trying external '$test -h'." >&4
2776 issymlink="$test -h"
2777 if $test ! -h sym >/dev/null 2>&1; then
2778 echo "External '$test -h' is broken, too." >&4
2786 if $test "X$issymlink" = X; then
2787 if $test -L sym 2>/dev/null; then
2788 issymlink="$test -L"
2789 echo "The builtin '$test -L' worked." >&4
2792 if $test "X$issymlink" != X; then
2793 echo "You can test for symbolic links with '$issymlink'." >&4
2795 echo "I do not know how you can test for symbolic links." >&4
2799 *) echo "No symbolic links, so not testing for their testing..." >&4
2804 : Make symlinks util
2805 case "$mksymlinks" in
2808 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2811 *) case "$lns:$issymlink" in
2812 *"ln"*" -s:"*"test -"?)
2813 echo "Creating the symbolic links..." >&4
2814 echo "(First creating the subdirectories...)" >&4
2816 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2818 test -z "$directory" && break
2822 if test ! -d t/base; then
2823 echo "Failed to create the subdirectories. Aborting." >&4
2826 echo "(Then creating the symlinks...)" >&4
2827 awk '{print $1}' $src/MANIFEST | while true; do
2829 test -z "$filename" && break
2830 if test -f $filename; then
2831 if $issymlink $filename; then
2835 if test -f $filename; then
2836 echo "$filename already exists, not symlinking."
2838 ln -s $src/$filename $filename
2842 if test ! -f t/base/lex.t; then
2843 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2848 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2856 : Check for Cross-Compilation
2857 if $test "X$targethost" = "X"; then
2860 if $test "X$targetenv" = "X"; then
2863 case "$usecrosscompile" in
2865 $echo "Cross-compiling..."
2868 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2869 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2870 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2871 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2872 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2873 # leave out ld, choosing it is more complex
2874 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2875 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2876 # We are in a weird spot. Just before us, some values
2877 # were 'saved', to be restored after the hints are
2878 # run. This means that the changes we made to ar,
2879 # nm and ranlib will get reverted.
2880 # To avoid that, we hijack the saving mechanism and
2881 # have it save our new values.
2882 for file in ar nm ranlib; do
2884 eval $file=$xxx$_exe
2889 case "$targetarch" in
2890 '') echo "Targetarch not defined." >&4; croak=y ;;
2891 *) echo "Using targetarch $targetarch." >&4 ;;
2893 case "$targethost" in
2894 '') echo "Targethost not defined." >&4; croak=y ;;
2895 *) echo "Using targethost $targethost." >&4
2900 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2902 : compile a host miniperl and generate_uudmap, unless we got passed them
2903 if $test "X$hostperl" = X; then
2904 echo "Building host miniperl and generate_uudmap binaries" >&4
2912 $src/Configure -des -Dusedevel -Dmksymlinks
2914 case "$hostgenerate" in
2915 '') $make generate_uudmap
2916 hostgenerate=$src/host/generate_uudmap
2918 "$undef") hostgenerate=''
2921 hostperl=$src/host/miniperl
2924 hostosname=`$hostperl -le 'print $^O'`
2927 usecrosscompile="$undef"
2931 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2932 case "$targethost" in
2933 '') echo "Checking for cross-compile" >&4
2934 case "$usecrosscompile$multiarch" in
2935 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2936 if [ -f Makefile ]; then
2938 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2940 echo "Configure done."
2944 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2951 *) echo "Using targethost $targethost." >&4
2953 /*) run=$src/Cross/run
2954 targetmkdir=$src/Cross/mkdir
2956 from=$src/Cross/from
2958 *) pwd=`$test -f ../Configure & cd ..; pwd`
2960 targetmkdir=$pwd/Cross/mkdir
2962 from=$pwd/Cross/from
2965 case "$targetrun" in
2966 '') targetrun=ssh ;;
2971 case "$targetfrom" in
2972 '') targetfrom=scp ;;
2976 from=$from-$targetfrom
2977 case "$targetdir" in
2979 echo "Guessing targetdir $targetdir." >&4
2982 case "$targetuser" in
2984 echo "Guessing targetuser $targetuser." >&4
2987 case "$targetport" in
2989 echo "Guessing targetport $targetport." >&4
2992 case "$targetfrom" in
2996 case "$targetrun" in
3016 '') cwd=$targetdir ;;
3021 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3027 *) echo "Unknown targetrun '$targetrun'" >&4
3031 case "$targetmkdir" in
3033 cat >$targetmkdir <<EOF
3035 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3037 $chmod a+rx $targetmkdir
3039 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3051 $targetmkdir \`dirname \$f\`
3052 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3055 $targetmkdir $targetdir/\`dirname \$f\`
3056 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3069 $mkdir -p $targetdir/\`dirname \$f\`
3070 $cp \$f $targetdir/\$f || exit 1
3073 $targetmkdir $targetdir/\`dirname \$f\`
3074 $cp \$f $targetdir/\$f || exit 1
3081 *) echo "Unknown targetto '$targetto'" >&4
3085 case "$targetfrom" in
3092 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3097 cp) cat >$from <<EOF
3102 cp $targetdir/\$f . || exit 1
3107 *) echo "Unknown targetfrom '$targetfrom'" >&4
3111 if $test ! -f $run; then
3112 echo "Target 'run' script '$run' not found." >&4
3116 if $test ! -f $to; then
3117 echo "Target 'to' script '$to' not found." >&4
3121 if $test ! -f $from; then
3122 echo "Target 'from' script '$from' not found." >&4
3126 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3130 Using '$run' for remote execution,
3131 and '$from' and '$to'
3132 for remote file transfer.
3138 usecrosscompile="$undef"
3143 : see whether [:lower:] and [:upper:] are supported character classes
3145 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3147 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3151 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3152 # (0xd9 and 0xe2), therefore that is a nice testing point.
3153 if test "X$up" = X -o "X$low" = X; then
3154 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3160 if test "X$up" = X -o "X$low" = X; then
3161 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3167 if test "X$up" = X -o "X$low" = X; then
3168 case "`echo RS | od -x 2>/dev/null`" in
3170 echo "Hey, this might be EBCDIC." >&4
3171 if test "X$up" = X -o "X$low" = X; then
3172 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3173 rs) up='[A-IJ-RS-Z]'
3178 if test "X$up" = X -o "X$low" = X; then
3179 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3189 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3191 echo "Using $up and $low to convert case." >&4
3194 echo "I don't know how to translate letters from upper to lower case." >&4
3195 echo "Your tr is not acting any way I know of." >&4
3199 : set up the translation script tr, must be called with ./tr of course
3203 '[A-Z][a-z]') exec $tr '$up' '$low';;
3204 '[a-z][A-Z]') exec $tr '$low' '$up';;
3211 : Try to determine whether config.sh was made on this system
3212 case "$config_sh" in
3214 myuname=`$uname -a 2>/dev/null`
3215 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3216 # Downcase everything to avoid ambiguity.
3217 # Remove slashes and single quotes so we can use parts of this in
3218 # directory and file names.
3219 # Remove newlines so myuname is sane to use elsewhere.
3220 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3221 # because the A-Z/a-z are not consecutive.
3222 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3223 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3224 newmyuname="$myuname"
3226 case "$knowitall" in
3228 if test -f ../config.sh; then
3229 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3230 eval "`grep myuname= ../config.sh`"
3232 if test "X$myuname" = "X$newmyuname"; then
3240 : Get old answers from old config file if Configure was run on the
3241 : same system, otherwise use the hints.
3244 if test -f config.sh; then
3246 rp="I see a config.sh file. Shall I use it to set the defaults?"
3249 n*|N*) echo "OK, I'll ignore it."
3250 mv config.sh config.sh.old
3251 myuname="$newmyuname"
3253 *) echo "Fetching default answers from your old config.sh file..." >&4
3261 : Older versions did not always set $sh. Catch re-use of such
3271 if test ! -f config.sh; then
3274 First time through, eh? I have some defaults handy for some systems
3275 that need some extra help getting the Configure answers right:
3278 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3280 : Half the following guesses are probably wrong... If you have better
3281 : tests or hints, please send them to perlbug@perl.org
3282 : The metaconfig authors would also appreciate a copy...
3283 $test -f /irix && osname=irix
3284 $test -f /xenix && osname=sco_xenix
3285 $test -f /dynix && osname=dynix
3286 $test -f /dnix && osname=dnix
3287 $test -f /lynx.os && osname=lynxos
3288 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3289 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3290 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3291 $test -f /bin/mips && /bin/mips && osname=mips
3292 $test -d /usr/apollo/bin && osname=apollo
3293 $test -f /etc/saf/_sactab && osname=svr4
3294 $test -d /usr/include/minix && osname=minix
3295 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3296 if $test -d /MachTen -o -d /MachTen_Folder; then
3298 if $test -x /sbin/version; then
3299 osvers=`/sbin/version | $awk '{print $2}' |
3300 $sed -e 's/[A-Za-z]$//'`
3301 elif $test -x /usr/etc/version; then
3302 osvers=`/usr/etc/version | $awk '{print $2}' |
3303 $sed -e 's/[A-Za-z]$//'`
3309 $test -f /sys/posix.dll &&
3310 $test -f /usr/bin/what &&
3311 set X `/usr/bin/what /sys/posix.dll` &&
3312 $test "$3" = UWIN &&
3316 if $test -f $uname; then
3324 umips) osname=umips ;;
3327 [23]100) osname=mips ;;
3329 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3330 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3333 elif $test -f /etc/kconfig; then
3335 if test "$lns" = "$ln -s"; then
3337 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3339 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3346 if test -n "$DJGPP"; then
3355 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3357 # oslevel can fail with:
3358 # oslevel: Unable to acquire lock.
3359 *not\ found) osvers="$4"."$3" ;;
3360 '<3240'|'<>3240') osvers=3.2.0 ;;
3361 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3362 '=3250'|'>3250') osvers=3.2.5 ;;
3366 bitrig) osname=bitrig
3369 bsd386) osname=bsd386
3372 cygwin*) osname=cygwin
3375 *dc.osx) osname=dcosx
3381 domainos) osname=apollo
3387 dragonfly) osname=dragonfly
3390 dynixptx*) osname=dynixptx
3391 osvers=`echo "$4"|sed 's/^v//'`
3393 freebsd) osname=freebsd
3395 genix) osname=genix ;;
3399 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3412 $test -f /system/lib/libandroid.so && osname=linux-android
3416 netbsd*) osname=netbsd
3419 news-os) osvers="$3"
3421 4*) osname=newsos4 ;;
3425 nonstop-ux) osname=nonstopux ;;
3426 openbsd) osname=openbsd
3432 POSIX-BC | posix-bc ) osname=posix-bc
3435 powerux | power_ux | powermax_os | powermaxos | \
3436 powerunix | power_unix) osname=powerux
3442 solaris) osname=solaris
3444 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3451 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3455 titanos) osname=titanos
3464 ultrix) osname=ultrix
3467 osf1|mls+) case "$5" in
3470 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3473 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3476 hp*) osname=hp_osf1 ;;
3477 mips) osname=mips_osf1 ;;
3480 # UnixWare 7.1.2 is known as Open UNIX 8
3481 openunix|unixware) osname=svr5
3489 $2) case "$osname" in
3493 : svr4.x or possibly later
3503 if test -f /stand/boot ; then
3504 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3505 if test -n "$INITPROG" -a -f "$INITPROG"; then
3506 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3507 if test -n "$isesix"; then
3515 *) if test -f /etc/systemid; then
3517 set `echo $3 | $sed 's/\./ /g'` $4
3518 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3520 elif $test -f $src/hints/sco_$1_$2.sh; then
3522 elif $test -f $src/hints/sco_$1.sh; then
3527 '') : Still unknown. Probably a generic Sys V.
3536 *) case "$osname" in
3537 '') : Still unknown. Probably a generic BSD.
3545 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3546 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3547 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3550 $rm -f UU/kernel.what
3551 elif test -d c:/. -o -n "$is_os2" ; then
3558 case "$targetarch" in
3561 case "$targetarch" in
3563 # Will load qnx.sh, which should change osname to nto
3568 # Catch arm-linux-androideabi, mipsel-linux-android,
3569 # and i686-linux-android
3570 osname=linux-android
3574 # Something like arm-linux-gnueabihf is really just
3581 # XXX perhaps we should just assume
3582 # osvers to be 2, or maybe take the value
3583 # from targetarch. Using $run before the
3584 # hints are run is somewhat icky.
3585 set X `$run $uname -a 2>/dev/null`
3588 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3593 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3600 : Now look for a hint file osname_osvers, unless one has been
3601 : specified already.
3604 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3605 : Also try without trailing minor version numbers.
3606 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3607 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3608 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3609 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3612 *) case "$osvers" in
3615 *) if $test -f $src/hints/$file.sh ; then
3617 elif $test -f $src/hints/$xfile.sh ; then
3619 elif $test -f $src/hints/$xxfile.sh ; then
3621 elif $test -f $src/hints/$xxxfile.sh ; then
3623 elif $test -f $src/hints/$xxxxfile.sh ; then
3625 elif $test -f "$src/hints/${osname}.sh" ; then
3634 if $test -f Policy.sh ; then
3637 none) dflt="Policy" ;;
3638 *) dflt="Policy $dflt" ;;
3643 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3647 if $test -f Policy.sh ; then
3650 There's also a Policy hint file available, which should make the
3651 site-specific (policy) questions easier to answer.
3658 You may give one or more space-separated answers, or "none" if appropriate.
3659 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3660 previous run of Configure, you may specify it as well as or instead of
3661 OS-specific hints. If hints are provided for your OS, you should use them:
3662 although Perl can probably be built without hints on many platforms, using
3663 hints often improve performance and may enable features that Configure can't
3664 set up on its own. If there are no hints that match your OS, specify "none";
3665 DO NOT give a wrong version or a wrong OS.
3669 rp="Which of these apply, if any?"
3672 for file in $tans; do
3673 if $test X$file = XPolicy -a -f Policy.sh; then
3675 $cat Policy.sh >> UU/config.sh
3676 elif $test -f $src/hints/$file.sh; then
3677 . $src/hints/$file.sh
3678 $cat $src/hints/$file.sh >> UU/config.sh
3679 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3682 : Give one chance to correct a possible typo.
3683 echo "$file.sh does not exist"
3685 rp="hint to use instead?"
3687 for file in $ans; do
3688 if $test -f "$src/hints/$file.sh"; then
3689 . $src/hints/$file.sh
3690 $cat $src/hints/$file.sh >> UU/config.sh
3691 elif $test X$ans = X -o X$ans = Xnone ; then
3694 echo "$file.sh does not exist -- ignored."
3701 : Remember our hint file for later.
3702 if $test -f "$src/hints/$file.sh" ; then
3712 echo "Fetching default answers from $config_sh..." >&4
3716 cp $config_sh config.sh 2>/dev/null
3726 test "$override" && . ./optdef.sh
3728 : Restore computed paths
3729 for file in $loclist $trylist; do
3730 eval $file="\$_$file"
3735 Configure uses the operating system name and version to set some defaults.
3736 The default value is probably right if the name rings a bell. Otherwise,
3737 since spelling matters for me, either accept the default or answer "none"
3744 ''|' '|none) dflt=none ;;
3745 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3748 *) dflt="$osname" ;;
3750 rp="Operating system name?"
3754 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3760 ''|' '|none) dflt=none ;;
3761 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3762 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3764 ''|' ') dflt=none ;;
3769 *) dflt="$osvers" ;;
3771 rp="Operating system version?"
3781 : who configured the system
3782 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3785 cf_by=`(logname) 2>/dev/null`
3788 cf_by=`(whoami) 2>/dev/null`
3790 "") cf_by=unknown ;;
3795 : decide how portable to be. Allow command line overrides.
3796 case "$d_portable" in
3798 *) d_portable="$define" ;;
3801 : set up shell script to do ~ expansion
3807 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3810 if $test -f /bin/csh; then
3811 /bin/csh -f -c "glob \$1"
3816 name=\`$expr x\$1 : '..\([^/]*\)'\`
3817 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3818 if $test ! -d "\$dir"; then
3820 echo "\$me: can't locate home directory for: \$name" >&2
3825 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3841 : now set up to get a file name
3845 cat <<'EOSC' >>getfile
3861 : getfile will accept an answer from the comma-separated list
3862 : enclosed in parentheses even if it does not meet other criteria.
3863 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3864 fn=`echo $fn | sed 's/(.*)//'`
3870 loc_file=`expr $fn : '.*:\(.*\)'`
3871 fn=`expr $fn : '\(.*\):.*'`
3879 */*) fullpath=true;;
3888 *e*) exp_file=true;;
3891 *p*) nopath_ok=true;;
3896 *d*) type='Directory';;
3897 *l*) type='Locate';;
3902 Locate) what='File';;
3907 case "$d_portable" in
3915 while test "$type"; do
3920 true) rp="$rp (~name ok)";;
3923 if test -f UU/getfile.ok && \
3924 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3943 value=`UU/filexp $ans`
3946 if test "$ans" != "$value"; then
3947 echo "(That expands to $value on this system.)"
3961 /*) value="$ansexp" ;;
3962 [a-zA-Z]:/*) value="$ansexp" ;;
3967 echo "I shall only accept a full path name, as in /bin/ls." >&4
3968 echo "Use a ! shell escape if you wish to check pathnames." >&4
3971 echo "Please give a full path name, starting with slash." >&4
3974 echo "Note that using ~name is ok provided it expands well." >&4
3987 for fp in $gfpth; do
3988 if test "X$fp" = X.; then
3993 if test -f "$pf"; then
3995 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3997 echo "($value is not a plain file, but that's ok.)"
4000 if test X"$type" = X; then
4007 for fp in $gfpth; do
4008 if test "X$fp" = X.; then
4013 direxp="$fp/$ansexp"
4015 if test -d "$direxp"; then
4023 if test -d "$ansexp"; then
4024 echo "(Looking for $loc_file in directory $value.)"
4025 value="$value/$loc_file"
4026 ansexp="$ansexp/$loc_file"
4028 if test -f "$ansexp"; then
4031 case "$nopath_ok" in
4032 true) case "$value" in
4034 *) echo "Assuming $value will be in people's path."
4050 if test "$fastread" = yes; then
4055 rp="$what $value doesn't exist. Use that name anyway?"
4074 test "X$gfpthkeep" != Xy && gfpth=""
4077 : determine root of directory hierarchy where package will be installed.
4080 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4083 dflt=`echo "$prefix" | sed 's/.$//'`
4091 By default, $package will be installed in $dflt/bin, manual pages
4092 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4093 installation directories. Typically this is something like /usr/local.
4094 If you wish to have binaries under /usr/bin but other parts of the
4095 installation under /usr/local, that's ok: you will be prompted
4096 separately for each of the installation directories, the prefix being
4097 only used to set the defaults.
4101 rp='Installation prefix to use?'
4109 *) oldprefix="$prefix";;
4116 : allow them to override the AFS root
4119 *) afsroot=$afsroot ;;
4125 $define|true) afs=true ;;
4126 $undef|false) afs=false ;;
4127 *) if $test -d $afsroot; then
4135 echo "AFS may be running... I'll be extra cautious then..." >&4
4137 echo "AFS does not seem to be running..." >&4
4140 : determine installation prefix for where package is to be installed.
4144 Since you are running AFS, I need to distinguish the directory in which
4145 files will reside from the directory in which they are installed (and from
4146 which they are presumably copied to the former directory by occult means).
4149 case "$installprefix" in
4150 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4151 *) dflt="$installprefix";;
4156 In some special cases, particularly when building $package for distribution,
4157 it is convenient to distinguish the directory in which files should be
4158 installed from the directory ($prefix) in which they will
4159 eventually reside. For most users, these two directories are the same.
4162 case "$installprefix" in
4164 *) dflt=$installprefix;;
4168 rp='What installation prefix should I use for installing files?'
4170 installprefix="$ans"
4171 installprefixexp="$ansexp"
4173 : Perform the prefixexp/installprefixexp correction if necessary
4174 cat <<EOS >installprefix
4177 cat <<'EOSC' >>installprefix
4178 : Change installation prefix, if necessary.
4179 if $test X"$prefix" != X"$installprefix"; then
4180 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4182 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4185 chmod +x installprefix
4186 $eunicefix installprefix
4188 : Set variables such as privlib and privlibexp from the output of ./getfile
4189 : performing the prefixexp/installprefixexp correction if necessary.
4190 cat <<EOS >setprefixvar
4193 cat <<'EOSC' >>setprefixvar
4194 eval "${prefixvar}=\"\$ans\""
4195 eval "${prefixvar}exp=\"\$ansexp\""
4198 chmod +x setprefixvar
4199 $eunicefix setprefixvar
4201 : set up the script used to warn in case of inconsistency
4210 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4212 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4213 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4218 echo "*** WHOA THERE!!! ***" >&4
4219 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4222 rp=" Keep the $hint value?"
4225 y) td=$was; tu=$was;;
4229 : function used to set '$1' to '$val'
4230 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4232 $define$undef) . ./whoa; eval "$var=\$td";;
4233 $undef$define) . ./whoa; eval "$var=\$tu";;
4234 *) eval "$var=$val";;
4237 : get the patchlevel
4239 echo "Getting the current patchlevel..." >&4
4240 if $test -r $rsrc/patchlevel.h;then
4241 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4242 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4243 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4244 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4245 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4246 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4247 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4256 $echo "(You do not have patchlevel.h. Eek.)"
4258 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4259 version_patchlevel_string="version $patchlevel subversion $subversion"
4260 case "$perl_patchlevel" in
4262 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4263 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4267 $echo "(You have $package $version_patchlevel_string.)"
4271 : XXX Should be a Configure test for double-dots in filenames.
4272 version=`echo $revision $patchlevel $subversion | \
4273 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4274 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4275 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4278 version=`echo $revision $patchlevel $subversion | \
4279 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4280 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4281 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4284 : Special case the 5.005_xx maintenance series, which used 5.005
4285 : without any subversion label as a subdirectory in $sitelib
4286 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4287 api_versionstring='5.005'
4290 : Do we want threads support and if so, what type
4291 case "$usethreads" in
4292 $define|true|[yY]*) dflt='y';;
4293 *) # Catch case where user specified ithreads or 5005threads but
4294 # forgot -Dusethreads (A.D. 4/2002)
4295 case "$useithreads$use5005threads" in
4296 *$define*) dflt='y';;
4303 Perl can be built to offer a form of threading support on some systems
4304 To do so, Configure can be run with -Dusethreads.
4306 Note that Perl built with threading support runs slightly slower
4307 and uses slightly more memory than plain Perl.
4309 If this doesn't make any sense to you, just accept the default '$dflt'.
4311 rp='Build a threading Perl?'
4314 y|Y) val="$define" ;;
4320 if $test $patchlevel -lt 9; then
4321 case "$usethreads" in
4323 : Default to ithreads unless overridden on command line or with
4326 case "$use5005threads" in
4328 echo "5.005 threads are no longer supported"
4332 case "$useithreads" in
4333 $undef|false|[nN]*) dflt='n';;
4335 rp='Use the newer interpreter-based ithreads?'
4338 y|Y) val="$define" ;;
4343 : Now set use5005threads to the opposite value.
4344 case "$useithreads" in
4345 $define) val="$undef" ;;
4352 useithreads="$undef"
4353 use5005threads="$undef"
4357 case "$useithreads$use5005threads" in
4361 You cannot have both the ithreads and the 5.005 threads enabled
4362 at the same time. Disabling the 5.005 threads since they are
4363 much less stable than the ithreads.
4366 use5005threads="$undef"
4371 : perl-5.9.x and later
4373 if test X"$usethreads" = "X$define"; then
4374 case "$use5005threads" in
4378 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4385 use5005threads="$undef"
4386 useithreads="$usethreads"
4389 case "$d_oldpthreads" in
4390 '') : Configure tests would be welcome here. For now, assume undef.
4392 *) val="$d_oldpthreads" ;;
4398 : Look for a hint-file generated 'call-back-unit'. If the
4399 : user has specified that a threading perl is to be built,
4400 : we may need to set or change some other defaults.
4401 if $test -f usethreads.cbu; then
4402 echo "Your platform has some specific hints regarding threaded builds, using them..."
4405 case "$usethreads" in
4406 "$define"|true|[yY]*)
4408 (Your platform does not have any specific hints for threaded builds.
4409 Assuming POSIX threads, then.)
4415 : Check if multiplicity is required
4418 Perl can be built so that multiple Perl interpreters can coexist
4419 within the same Perl executable.
4422 case "$useithreads" in
4425 This multiple interpreter support is required for interpreter-based threads.
4429 *) case "$usemultiplicity" in
4430 $define|true|[yY]*) dflt='y';;
4434 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4435 rp='Build Perl for multiplicity?'
4438 y|Y) val="$define" ;;
4446 : Check if morebits is requested
4447 case "$usemorebits" in
4448 "$define"|true|[yY]*)
4449 use64bitint="$define"
4450 uselongdouble="$define"
4451 usemorebits="$define"
4453 *) usemorebits="$undef"
4457 : Determine the C compiler to be used
4463 rp="Use which C compiler?"
4467 : See whether they have no cc but they do have gcc
4469 if $test -f cc.cbu; then
4474 : make some quick guesses about what we are up against
4476 $echo $n "Hmm... $c"
4486 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4487 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4489 echo "Looks kind of like an OSF/1 system, but we'll see..."
4491 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4492 xxx=`./loc addbib blurfl $pth`
4493 if $test -f $xxx; then
4494 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4498 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4499 echo "Looks kind of like an extended USG system, but we'll see..."
4501 echo "Looks kind of like a USG system, but we'll see..."
4505 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4506 echo "Looks kind of like a BSD system, but we'll see..."
4510 echo "Looks kind of like a Version 7 system, but we'll see..."
4513 case "$eunicefix" in
4516 There is, however, a strange, musty smell in the air that reminds me of
4517 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4521 : it so happens the Eunice I know will not run shell scripts in Unix format
4525 echo "Congratulations. You aren't running Eunice."
4529 : Detect OS2. The p_ variable is set above in the Head.U unit.
4530 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4531 : semicolon as a patch separator
4536 I have the feeling something is not exactly right, however...don't tell me...
4537 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4538 (Or you may be running DOS with DJGPP.)
4543 if test -f /xenix; then
4544 echo "Actually, this looks more like a XENIX system..."
4549 echo "It's not Xenix..."
4554 if test -f /venix; then
4555 echo "Actually, this looks more like a VENIX system..."
4562 echo "Nor is it Venix..."
4565 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4566 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4569 : Check if we are using GNU gcc and what its version is
4571 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4575 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4577 printf("%s\n", __VERSION__);
4579 printf("%s\n", "1");
4585 if $cc -o try $ccflags $ldflags try.c; then
4586 gccversion=`$run ./try`
4587 case "$gccversion" in
4588 '') echo "You are not using GNU cc." ;;
4589 *) echo "You are using GNU cc $gccversion."
4595 echo "*** WHOA THERE!!! ***" >&4
4596 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4597 case "$knowitall" in
4599 echo " You'd better start hunting for one and let me know about it." >&4
4605 case "$gccversion" in
4606 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4608 case "$gccversion" in
4609 '') gccosandvers='' ;;
4610 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4611 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4613 case "$gccosandvers" in
4614 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4615 $osname$osvers) ;; # looking good
4616 $osname*) cat <<EOM >&4
4618 *** WHOA THERE!!! ***
4620 Your gcc has not been compiled for the exact release of
4621 your operating system ($gccosandvers versus $osname$osvers).
4623 In general it is a good idea to keep gcc synchronized with
4624 the operating system because otherwise serious problems
4625 may ensue when trying to compile software, like Perl.
4627 I'm trying to be optimistic here, though, and will continue.
4628 If later during the configuration and build icky compilation
4629 problems appear (headerfile conflicts being the most common
4630 manifestation), I suggest reinstalling the gcc to match
4631 your operating system release.
4635 *) gccosandvers='' ;; # failed to parse, better be silent
4643 # gcc 3.* complain about adding -Idirectories that they already know about,
4644 # so we will take those off from locincpth.
4645 case "$gccversion" in
4647 echo "main(){}">try.c
4648 for incdir in $locincpth; do
4649 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4650 grep '^c[cp]p*[01]: warning: changing search order '`
4651 if test "X$warn" != X; then
4652 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4658 # gcc 4.9 by default does some optimizations that break perl.
4659 # see ticket 121505.
4661 # The -fwrapv disables those optimizations (and probably others,) so
4662 # for gcc 4.9 (and later, since the optimizations probably won't go
4663 # away), add -fwrapv unless the user requests -fno-wrapv, which
4664 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4665 # which turns the overflows -fwrapv ignores into runtime errors.
4666 case "$gccversion" in
4667 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4669 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4670 *) ccflags="$ccflags -fwrapv" ;;
4674 : What should the include directory be ?
4675 : Use sysroot if set, so findhdr looks in the right place.
4677 $echo $n "Hmm... $c"
4678 dflt="$sysroot/usr/include"
4681 if $test -f /bin/mips && /bin/mips; then
4682 echo "Looks like a MIPS system..."
4683 $cat >usr.c <<'EOCP'
4684 #ifdef SYSTYPE_BSD43
4688 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4689 dflt='/bsd43/usr/include'
4693 mips_type='System V'
4695 $rm -f usr.c usr.out
4696 echo "and you're compiling with the $mips_type compiler and libraries."
4700 echo "Doesn't look like a MIPS system."
4710 case "$xxx_prompt" in
4713 rp='Where are the include files you want to use?'
4721 : see how we invoke the C preprocessor
4723 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4724 cat <<'EOT' >testcpp.c
4730 if test ! -f cppstdin; then
4731 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4732 # AIX cc -E doesn't show the absolute headerfile
4733 # locations but we'll cheat by using the -M flag.
4734 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
4736 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4739 echo "Keeping your $hint cppstdin wrapper."
4742 wrapper=`pwd`/cppstdin
4746 if $test "X$cppstdin" != "X" && \
4747 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4748 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4750 echo "You used to use $cppstdin $cppminus so we'll use that again."
4752 '') echo "But let's see if we can live without a wrapper..." ;;
4754 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4755 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4757 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4760 echo "(However, $cpprun $cpplast does not work, let's see...)"
4768 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4775 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4776 $cc -E <testcpp.c >testcpp.out 2>&1; \
4777 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4778 echo "Yup, it does."
4779 x_cpp="$cc $cppflags -E"
4781 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4782 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4783 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4784 echo "Yup, it does."
4785 x_cpp="$cc $cppflags -E"
4787 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4788 $cc -P <testcpp.c >testcpp.out 2>&1; \
4789 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4790 echo "Yipee, that works!"
4791 x_cpp="$cc $cppflags -P"
4793 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4794 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4795 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4796 echo "At long last!"
4797 x_cpp="$cc $cppflags -P"
4799 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4800 $cpp <testcpp.c >testcpp.out 2>&1; \
4801 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4803 x_cpp="$cpp $cppflags"
4805 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4806 $cpp - <testcpp.c >testcpp.out 2>&1; \
4807 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4808 echo "Hooray, it works! I was beginning to wonder."
4809 x_cpp="$cpp $cppflags"
4811 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4812 $wrapper <testcpp.c >testcpp.out 2>&1; \
4813 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4819 rp="No dice. I can't find a C preprocessor. Name one:"
4823 $x_cpp <testcpp.c >testcpp.out 2>&1
4824 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4825 echo "OK, that will do." >&4
4827 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4842 echo "Perhaps can we force $cc -E using a wrapper..."
4843 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4844 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4850 echo "Nope, we'll have to live without it..."
4864 "$wrapper"|'cppstdin') ;;
4865 *) $rm -f $wrapper;;
4867 $rm -f testcpp.c testcpp.out
4869 : Adjust cppfilter for path component separator
4871 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4872 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4876 : Use gcc to determine libpth and incpth
4877 # If using gcc or clang, we can get better values for libpth, incpth
4878 # and usrinc directly from the compiler.
4879 # Note that ccname for clang is also gcc.
4882 $echo 'extern int foo;' > try.c
4883 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4885 if $test $# -gt 0; then
4887 incpth="`$echo $incpth|$sed 's/^ //'`"
4889 j="`$echo $i|$sed 's,/include$,/lib,'`"
4890 if $test -d $j; then
4894 libpth="`$echo $libpth|$sed 's/^ //'`"
4895 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4896 if $test -d $xxx; then
4899 *) libpth="$libpth $xxx";;
4906 '') for i in $incpth; do
4907 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4915 case "$usecrosscompile" in
4918 '') echo "Incpth not defined." >&4; croak=y ;;
4919 *) echo "Using incpth '$incpth'." >&4 ;;
4922 '') echo "Libpth not defined." >&4; croak=y ;;
4923 *) echo "Using libpth '$libpth'." >&4 ;;
4926 '') echo "Usrinc not defined." >&4; croak=y ;;
4927 *) echo "Using usrinc $usrinc." >&4 ;;
4931 if test "X$sysroot" = X; then
4932 echo "Cannot continue, aborting." >&4; exit 1
4934 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4943 : Default value for incpth is just usrinc
4945 '') incpth="$usrinc";;
4948 : Set private lib path
4951 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4956 '') dlist="$loclibpth $plibpth $glibpth";;
4957 *) dlist="$libpth";;
4960 : Now check and see which directories actually exist, avoiding duplicates
4963 if $test -d $xxx; then
4966 *) libpth="$libpth $xxx";;
4972 Some systems have incompatible or broken versions of libraries. Among
4973 the directories listed in the question below, please remove any you
4974 know not to be holding relevant libraries, and add any that are needed.
4975 Say "none" for none.
4979 if test "X$sysroot" != X; then
4981 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4994 rp="Directories to use for library searches?"
5001 : compute shared library extension
5004 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5014 On some systems, shared libraries may be available. Answer 'none' if
5015 you want to suppress searching of shared libraries for the remainder
5016 of this configuration.
5019 rp='What is the file extension used for shared libraries?'
5023 : Does target system insist that shared library basenames are unique
5026 Some dynamic loaders assume that the *basename* of shared library filenames
5027 are globally unique. We'll default this to undef as we assume your system
5028 is not this weird. Set to defined if you're on one of them.
5033 rp='Make shared library basenames unique?'
5036 y|Y) val="$define" ;;
5039 set d_libname_unique
5042 : Define several unixisms.
5043 : Hints files or command line option can be used to override them.
5044 : The convoluted testing is in case hints files set either the old
5047 '') case "$exe_ext" in
5049 *) _exe="$exe_ext" ;;
5054 '') case "$lib_ext" in
5061 '') case "$obj_ext" in
5068 '') case "$path_sep" in
5079 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5081 : Which makefile gets called first. This is used by make depend.
5082 case "$firstmakefile" in
5083 '') firstmakefile='makefile';;
5086 : Check is we will use socks
5088 $define|true|[yY]*) dflt='y';;
5093 Perl can be built to use the SOCKS proxy protocol library. To do so,
5094 Configure must be run with -Dusesocks. If you use SOCKS you also need
5095 to use the PerlIO abstraction layer, this will be implicitly selected.
5097 If this doesn't make any sense to you, just accept the default '$dflt'.
5099 rp='Build Perl for SOCKS?'
5102 y|Y) val="$define" ;;
5108 : Check for uselongdouble support
5110 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5113 case "$uselongdouble" in
5114 $define|true|[yY]*) dflt='y';;
5119 Perl can be built to take advantage of long doubles which
5120 (if available) may give more accuracy and range for floating point numbers.
5122 If this doesn't make any sense to you, just accept the default '$dflt'.
5124 rp='Try to use long doubles if available?'
5127 y|Y) val="$define" ;;
5133 case "$uselongdouble" in
5134 true|[yY]*) uselongdouble="$define" ;;
5137 : Look for a hint-file generated 'call-back-unit'. If the
5138 : user has specified that long doubles should be used,
5139 : we may need to set or change some other defaults.
5140 if $test -f uselongdouble.cbu; then
5141 echo "Your platform has some specific hints regarding long doubles, using them..."
5142 . ./uselongdouble.cbu
5144 case "$uselongdouble" in
5147 (Your platform does not have any specific hints for long doubles.)
5153 : Looking for optional libraries
5155 echo "Checking for optional libraries..." >&4
5160 case "$libswanted" in
5161 '') libswanted='c_s';;
5164 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5166 case "$usecbacktrace" in
5167 "$define") libswanted="$libswanted bfd" ;;
5173 for thisdir in $libpth $xlibpth; do
5174 test -d $thisdir && libspath="$libspath $thisdir"
5176 for thislib in $libswanted; do
5177 for thisdir in $libspath; do
5179 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5180 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5181 $test -f "$xxx" && eval $libscheck
5182 $test -f "$xxx" && libstyle=shared
5183 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5184 $test -f "$xxx" && eval $libscheck
5185 $test -f "$xxx" && libstyle=shared
5187 if test ! -f "$xxx"; then
5188 xxx=$thisdir/lib$thislib.$so
5189 $test -f "$xxx" && eval $libscheck
5190 $test -f "$xxx" && libstyle=shared
5192 if test ! -f "$xxx"; then
5193 xxx=$thisdir/lib$thislib$_a
5194 $test -f "$xxx" && eval $libscheck
5195 $test -f "$xxx" && libstyle=static
5197 if test ! -f "$xxx"; then
5198 xxx=$thisdir/$thislib$_a
5199 $test -f "$xxx" && eval $libscheck
5200 $test -f "$xxx" && libstyle=static
5202 if test ! -f "$xxx"; then
5203 xxx=$thisdir/lib${thislib}_s$_a
5204 $test -f "$xxx" && eval $libscheck
5205 $test -f "$xxx" && libstyle=static
5206 $test -f "$xxx" && thislib=${thislib}_s
5208 if test ! -f "$xxx"; then
5209 xxx=$thisdir/Slib$thislib$_a
5210 $test -f "$xxx" && eval $libscheck
5211 $test -f "$xxx" && libstyle=static
5213 if $test -f "$xxx"; then
5215 shared) echo "Found -l$thislib (shared)." ;;
5216 static) echo "Found -l$thislib." ;;
5217 *) echo "Found -l$thislib ($libstyle)." ;;
5221 *) dflt="$dflt -l$thislib"
5222 libsfound="$libsfound $xxx"
5224 libsfiles="$libsfiles $yyy"
5225 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5226 case " $libsdirs " in
5228 *) libsdirs="$libsdirs $yyy" ;;
5235 if $test ! -f "$xxx"; then
5236 echo "No -l$thislib."
5247 ' '|'') dflt='none';;
5252 In order to compile $package on your machine, a number of libraries
5253 are usually needed. Include any other special libraries here as well.
5254 Say "none" for none. The default list is almost always right.
5258 rp="What libraries to use?"
5265 : determine optimization, if desired, or use for debug flag also
5267 ' '|$undef) dflt='none';;
5269 *) dflt="$optimize";;
5273 By default, $package compiles with the -O flag to use the optimizer.
5274 Alternately, you might want to use the symbolic debugger, which uses
5275 the -g flag (on traditional Unix systems). Either flag can be
5276 specified here. To use neither flag, specify the word "none".
5279 rp="What optimizer/debugger flag should be used?"
5283 'none') optimize=" ";;
5286 : Check what DEBUGGING is required from the command line
5287 : -DEBUGGING or -DDEBUGGING or
5288 : -DEBUGGING=both = -g + -DDEBUGGING
5289 : -DEBUGGING=-g or -Doptimize=-g = -g
5290 : -DEBUGGING=none or -UDEBUGGING =
5291 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5294 *) DEBUGGING=$EBUGGING ;;
5297 case "$DEBUGGING" in
5301 *) optimize="$optimize -g" ;;
5305 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5313 case "$DEBUGGING" in
5314 both|$define) dflt='-DDEBUGGING'
5317 : argument order is deliberate, as the flag will start with - which set could
5318 : think is an option
5319 checkccflag='check=$1; flag=$2; callback=$3;
5321 echo "Checking if your compiler accepts $flag" 2>&1;
5322 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5323 echo "int main(void) { return 0; }" > gcctest.c;
5324 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5325 echo "Yes, it does." 2>&1;
5326 if $test -s gcctest.out ; then
5327 echo "But your platform does not like it:";
5332 echo "Leaving current flags $ccflags alone." 2>&1
5334 *) dflt="$dflt $flag";
5340 echo "Nope, it does not, but that is ok." 2>&1;
5344 : We will not override a previous value, but we might want to
5345 : augment a hint file
5347 default|recommended)
5348 case "$gccversion" in
5349 1*) dflt="$dflt -fpcc-struct-return" ;;
5351 case "$optimize:$DEBUGGING" in
5352 *-g*:old) dflt="$dflt -DDEBUGGING";;
5354 case "$gccversion" in
5355 2*) if $test -d /etc/conf/kconfig.d &&
5356 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5358 # Interactive Systems (ISC) POSIX mode.
5363 case "$gccversion" in
5366 ?*) set strict-aliasing -fno-strict-aliasing
5370 # For gcc, adding -pipe speeds up compilations for some, but apparently
5371 # some assemblers can't read from stdin. (It also slows down compilations
5372 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5373 case "$gccversion" in
5379 # on x86_64 (at least) we require an extra library (libssp) in the
5380 # link command line. This library is not named, so I infer that it is
5381 # an implementation detail that may change. Hence the safest approach
5382 # is to add the flag to the flags passed to the compiler at link time,
5383 # as that way the compiler can do the right implementation dependant
5385 case "$gccversion" in
5386 ?*) set stack-protector -fstack-protector
5393 case "$mips_type" in
5394 *BSD*|'') inclwanted="$locincpth $usrinc";;
5395 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5397 for thisincl in $inclwanted; do
5398 if $test -d $thisincl; then
5399 if $test x$thisincl != x$usrinc; then
5401 *" -I$thisincl "*);;
5402 *) dflt="$dflt -I$thisincl ";;
5408 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5410 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5418 *) dflt="$dflt -D$2";;
5422 set signal.h LANGUAGE_C; eval $inctest
5426 ccflags="$ccflags -DSOCKS"
5431 default|recommended) dflt="$ccflags $dflt" ;;
5432 *) dflt="$ccflags";;
5441 Your C compiler may want other flags. For this question you should include
5442 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5443 but you should NOT include libraries or ld flags like -lwhatever. If you
5444 want $package to honor its debug switch, you should include -DDEBUGGING here.
5445 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5447 To use no flags, specify the word "none".
5453 rp="Any additional cc flags?"
5460 : the following weeds options from ccflags that are of no interest to cpp
5462 '') cppflags="$ccflags" ;;
5463 *) cppflags="$cppflags $ccflags" ;;
5465 case "$gccversion" in
5466 1*) cppflags="$cppflags -D__GNUC__"
5468 case "$mips_type" in
5470 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5476 echo "Let me guess what the preprocessor flags are..." >&4
5490 *) ftry="$previous $flag";;
5492 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5493 >cpp1.out 2>/dev/null && \
5494 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5495 >cpp2.out 2>/dev/null && \
5496 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5497 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5499 cppflags="$cppflags $ftry"
5509 *-*) echo "They appear to be: $cppflags";;
5511 $rm -f cpp.c cpp?.out
5515 : flags used in final linking phase
5517 '') if ./venix; then
5523 *-posix*) dflt="$dflt -posix" ;;
5526 *) dflt="$ldflags";;
5528 # See note above about -fstack-protector
5530 *-fstack-protector*)
5532 *-fstack-protector*) ;; # Don't add it again
5533 *) dflt="$dflt -fstack-protector" ;;
5538 : Try to guess additional flags to pick up local libraries.
5539 for thislibdir in $libpth; do
5540 case " $loclibpth " in
5543 *"-L$thislibdir "*) ;;
5544 *) dflt="$dflt -L$thislibdir" ;;
5556 Your C linker may need flags. For this question you should
5557 include -L/whatever and any other flags used by the C linker, but you
5558 should NOT include libraries like -lwhatever.
5560 Make sure you include the appropriate -L/path flags if your C linker
5561 does not normally search all of the directories you specified above,
5564 To use no flags, specify the word "none".
5568 rp="Any additional ld flags (NOT including libraries)?"
5574 rmlist="$rmlist pdp11"
5578 echo "Checking your choice of C compiler and flags for coherency..." >&4
5579 $cat > try.c <<'EOF'
5581 int main() { printf("Ok\n"); return(0); }
5583 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5585 $cat >try.msg <<'EOM'
5586 I've tried to compile and run the following simple program:
5589 $cat try.c >> try.msg
5591 $cat >> try.msg <<EOM
5598 and I got the following output:
5602 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5603 if $sh -c "$run ./try " >>try.msg 2>&1; then
5607 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5610 echo "The program compiled OK, but exited with status $?." >>try.msg
5611 rp="You have a problem. Shall I abort Configure"
5615 echo "I can't compile the test program." >>try.msg
5616 rp="You have a BIG problem. Shall I abort Configure"
5622 case "$knowitall" in
5624 echo "(The supplied flags or libraries might be incorrect.)"
5632 *) echo "Ok. Stopping Configure." >&4
5637 n) echo "OK, that should do.";;
5639 $rm_try gcctest gcctest.out
5641 : define a shorthand compile call
5645 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5646 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5650 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5651 : define a shorthand compile call for compilations that should be ok.
5655 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5657 : determine filename position in cpp output
5659 echo "Computing filename position in cpp output for #include directives..." >&4
5661 vos) testaccess=-e ;;
5664 echo '#include <stdio.h>' > foo.c
5667 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5668 $grep '^[ ]*#.*stdio\.h' | \
5669 while read cline; do
5672 while $test \$# -gt 0; do
5673 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5678 pos=\`expr \$pos + 1\`
5690 *) pos="${fieldn}th";;
5692 echo "Your cpp writes the filename in the $pos field of the line."
5694 : locate header file
5699 for usrincdir in $incpth
5701 if test -f \$usrincdir/\$wanted; then
5702 echo "\$usrincdir/\$wanted"
5706 awkprg='{ print \$$fieldn }'
5707 echo "#include <\$wanted>" > foo\$\$.c
5708 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5709 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5710 while read cline; do
5711 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5713 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5714 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5719 # status = 0: grep returned 0 lines, case statement not executed
5720 # status = 1: headerfile found
5721 # status = 2: while loop executed, no headerfile found
5725 if test \$status -eq 1; then
5732 : define an alternate in-header-list? function
5733 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5734 cont=true; xxf="echo \"<\$1> found.\" >&4";
5735 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5736 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5738 case $# in 4) instead=instead;; *) instead="at last";; esac;
5739 while $test "$cont"; do
5741 var=$2; eval "was=\$$2";
5742 if $test "$xxx" && $test -r "$xxx";
5744 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5747 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5748 set $yyy; shift; shift; yyy=$@;
5749 case $# in 0) cont="";;
5750 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5751 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5752 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5753 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5757 do set $yyy; var=$2; eval "was=\$$2";
5758 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5759 set $yyy; shift; shift; yyy=$@;
5762 : see if stdlib is available
5763 set stdlib.h i_stdlib
5766 : check for lengths of integral types
5770 echo "Checking to see how big your integers are..." >&4
5779 printf("intsize=%d;\n", (int)sizeof(int));
5780 printf("longsize=%d;\n", (int)sizeof(long));
5781 printf("shortsize=%d;\n", (int)sizeof(short));
5786 if eval $compile_ok && $run ./try > /dev/null; then
5788 echo "Your integers are $intsize bytes long."
5789 echo "Your long integers are $longsize bytes long."
5790 echo "Your short integers are $shortsize bytes long."
5794 Help! I can't compile and run the intsize test program: please enlighten me!
5795 (This is probably a misconfiguration in your system or libraries, and
5796 you really ought to fix it. Still, I'll try anyway.)
5800 rp="What is the size of an integer (in bytes)?"
5804 rp="What is the size of a long integer (in bytes)?"
5808 rp="What is the size of a short integer (in bytes)?"
5816 : check for long long
5818 echo "Checking to see if you have long long..." >&4
5819 echo 'int main() { long long x = 7; return 0; }' > try.c
5821 if eval $compile; then
5823 echo "You have long long."
5826 echo "You do not have long long."
5832 : check for length of long long
5833 case "${d_longlong}${longlongsize}" in
5836 echo "Checking to see how big your long longs are..." >&4
5837 $cat >try.c <<'EOCP'
5841 printf("%d\n", (int)sizeof(long long));
5846 if eval $compile_ok; then
5847 longlongsize=`$run ./try`
5848 echo "Your long longs are $longlongsize bytes long."
5852 echo "(I can't seem to compile the test program. Guessing...)"
5853 rp="What is the size of a long long (in bytes)?"
5857 if $test "X$longsize" = "X$longlongsize"; then
5858 echo "(That isn't any different from an ordinary long.)"
5864 : see if inttypes.h is available
5865 : we want a real compile instead of Inhdr because some systems
5866 : have an inttypes.h which includes non-existent headers
5869 #include <inttypes.h>
5871 static int32_t foo32 = 0x12345678;
5875 if eval $compile; then
5876 echo "<inttypes.h> found." >&4
5879 echo "<inttypes.h> NOT found." >&4
5888 echo "Checking to see if you have int64_t..." >&4
5890 #include <sys/types.h>
5891 #$i_inttypes I_INTTYPES
5893 #include <inttypes.h>
5895 int main() { int64_t x = 7; }
5898 if eval $compile; then
5900 echo "You have int64_t."
5903 echo "You do not have int64_t."
5909 : Check if 64bit ints have a quad type
5911 echo "Checking which 64-bit integer type we could use..." >&4
5917 val='"unsigned int"'
5922 *) case "$longsize" in
5926 val='"unsigned long"'
5931 *) case "$d_longlong:$longlongsize" in
5936 val='"unsigned long long"'
5941 *) case "$d_int64_t" in
5960 '') echo "Alas, no 64-bit integer types in sight." >&4
5963 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5968 : Do we want 64bit support
5969 case "$uselonglong" in
5970 "$define"|true|[yY]*)
5973 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5975 use64bitint="$define"
5978 case "$use64bits" in
5979 "$define"|true|[yY]*)
5982 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5984 use64bitint="$define"
5987 case "$use64bitints" in
5988 "$define"|true|[yY]*)
5991 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5993 use64bitint="$define"
5996 case "$use64bitsint" in
5997 "$define"|true|[yY]*)
6000 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6002 use64bitint="$define"
6005 case "$uselonglongs" in
6006 "$define"|true|[yY]*)
6009 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6011 use64bitint="$define"
6014 case "$use64bitsall" in
6015 "$define"|true|[yY]*)
6018 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6020 use64bitall="$define"
6025 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6027 case "$use64bitall" in
6028 "$define"|true|[yY]*) use64bitint="$define" ;;
6034 You have natively 64-bit long integers.
6038 *) case "$use64bitint" in
6039 "$define"|true|[yY]*) dflt='y';;
6048 Perl can be built to take advantage of 64-bit integer types
6049 on some systems. To do so, Configure can be run with -Duse64bitint.
6050 Choosing this option will most probably introduce binary incompatibilities.
6052 If this doesn't make any sense to you, just accept the default '$dflt'.
6053 (The default has been chosen based on your configuration.)
6055 rp='Try to use 64-bit integers, if available?'
6058 [yY]*) val="$define" ;;
6066 case "$use64bitall" in
6067 "$define"|true|[yY]*) dflt='y' ;;
6068 *) case "$longsize" in
6076 You may also choose to try maximal 64-bitness. It means using as much
6077 64-bitness as possible on the platform. This in turn means even more
6078 binary incompatibilities. On the other hand, your platform may not
6079 have any more 64-bitness available than what you already have chosen.
6081 If this doesn't make any sense to you, just accept the default '$dflt'.
6082 (The default has been chosen based on your configuration.)
6084 rp='Try to use maximal 64-bit support, if available?'
6087 [yY]*) val="$define" ;;
6092 case "$use64bitall" in
6094 case "$use64bitint" in
6098 Since you have chosen a maximally 64-bit build, I'm also turning on
6099 the use of 64-bit integers.
6101 use64bitint="$define" ;;
6106 : Look for a hint-file generated 'call-back-unit'. If the
6107 : user has specified that a 64-bit perl is to be built,
6108 : we may need to set or change some other defaults.
6109 if $test -f use64bitint.cbu; then
6110 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6113 case "$use64bitint" in
6114 "$define"|true|[yY]*)
6115 : This test was common to all the OpenBSD forks, and seems harmless for
6118 echo "Checking if your C library has broken 64-bit functions..." >&4
6121 typedef $uquadtype myULL;
6128 {4294967303.15, 4294967303ULL},
6129 {4294967294.2, 4294967294ULL},
6130 {4294967295.7, 4294967295ULL},
6133 for (p = test; p->u; p++) {
6134 myULL x = (myULL)p->d;
6145 if eval $compile_ok; then
6146 libcquad=`$run ./try`
6147 echo "Your C library's 64-bit functions are $libcquad."
6149 echo "(I can't seem to compile the test program.)"
6150 echo "Assuming that your C library's 64-bit functions are ok."
6159 *** You have a C library with broken 64-bit functions.
6160 *** 64-bit support does not work reliably in this configuration.
6161 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6162 *** Cannot continue, aborting.
6169 4) case "$archname64" in
6170 '') archname64=64int ;;
6177 : Look for a hint-file generated 'call-back-unit'. If the
6178 : user has specified that a maximally 64-bit perl is to be built,
6179 : we may need to set or change some other defaults.
6180 if $test -f use64bitall.cbu; then
6181 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6184 case "$use64bitall" in
6185 "$define"|true|[yY]*)
6187 4) case "$archname64" in
6188 ''|64int) archname64=64all ;;
6195 case "$d_quad:$use64bitint" in
6199 *** You have chosen to use 64-bit integers,
6200 *** but none can be found.
6201 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6202 *** Cannot continue, aborting.
6209 : Check if we are using the GNU C library
6211 echo "Checking for GNU C Library..." >&4
6213 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6214 alone are insufficient to distinguish different versions, such as
6215 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6216 libc version 2.1.0. A. Dougherty, June 3, 2002.
6222 # ifdef __GLIBC_MINOR__
6223 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6224 # include <gnu/libc-version.h>
6225 printf("%s\n", gnu_get_libc_version());
6227 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6230 printf("%d\n", __GLIBC__);
6239 if eval $compile_ok && $run ./try > glibc.ver; then
6241 gnulibc_version=`$cat glibc.ver`
6242 echo "You are using the GNU C Library version $gnulibc_version"
6246 echo "You are not using the GNU C Library"
6252 : see if nm is to be used to determine whether a symbol is defined or not
6256 case "$d_gnulibc" in
6259 echo "nm probably won't work on the GNU C Library." >&4
6265 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6267 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6268 echo "'nm' won't be sufficient on this system." >&4
6274 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6275 if $test $dflt -gt 20; then
6285 true|$define) dflt=y;;
6292 I can use $nm to extract the symbols from your C libraries. This
6293 is a time consuming task which may generate huge output on the disk (up
6294 to 3 megabytes) but that should make the symbols extraction faster. The
6295 alternative is to skip the 'nm' extraction part and to compile a small
6296 test program instead to determine whether each symbol is present. If
6297 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6298 this may be the best solution.
6300 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6303 rp="Shall I use $nm to extract C symbols from the libraries?"
6306 [Nn]*) usenm=false;;
6315 : nm options which may be necessary
6317 '') if $test -f /mach_boot; then
6319 elif $test -d /usr/ccs/lib; then
6320 nm_opt='-p' # Solaris (and SunOS?)
6321 elif $test -f /dgux; then
6323 elif $test -f /lib64/rld; then
6324 nm_opt='-p' # 64-bit Irix
6330 : nm options which may be necessary for shared libraries but illegal
6331 : for archive libraries. Thank you, Linux.
6332 case "$nm_so_opt" in
6333 '') case "$myuname" in
6335 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6336 nm_so_opt='--dynamic'
6343 : Figure out where the libc is located
6346 : get list of predefined functions in a handy place
6351 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6357 *) for thislib in $libs; do
6360 : Handle C library specially below.
6363 thislib=`echo $thislib | $sed -e 's/^-l//'`
6364 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6366 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6368 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6370 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6372 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6374 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6376 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6381 libnames="$libnames $try"
6383 *) libnames="$libnames $thislib" ;;
6392 for xxx in $libpth; do
6393 $test -r $1 || set $xxx/libc.$so
6394 : The messy sed command sorts on library version numbers.
6396 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6397 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6399 s/[0-9][0-9]*/0000&/g
6400 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6403 $sort | $sed -e 's/^.* //'`
6406 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6407 $test -r $1 || set $sysroot/lib/libsys_s$_a
6413 if $test -r "$1"; then
6414 echo "Your (shared) C library seems to be in $1."
6416 elif $test -r /lib/libc && $test -r /lib/clib; then
6417 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6419 libc='/lib/clib /lib/libc'
6420 if $test -r /lib/syslib; then
6421 echo "(Your math library is in /lib/syslib.)"
6422 libc="$libc /lib/syslib"
6424 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6425 echo "Your C library seems to be in $libc, as you said before."
6426 elif $test -r $incpath/usr/lib/libc$_a; then
6427 libc=$incpath/usr/lib/libc$_a;
6428 echo "Your C library seems to be in $libc. That's fine."
6429 elif $test -r /lib/libc$_a; then
6431 echo "Your C library seems to be in $libc. You're normal."
6433 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6435 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6436 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6437 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6439 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6441 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6444 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6446 if $test -r "$tans"; then
6447 echo "Your C library seems to be in $tans, of all places."
6453 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6457 If the guess above is wrong (which it might be if you're using a strange
6458 compiler, or your machine supports multiple models), you can override it here.
6463 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6465 I can't seem to find your C library. I've looked in the following places:
6468 $sed 's/^/ /' libpath
6471 None of these seems to contain your C library. I need to get its name...
6476 rp='Where is your C library?'
6481 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6482 set X `cat libnames`
6485 case $# in 1) xxx=file; esac
6486 echo "Extracting names from the following $xxx for later perusal:" >&4
6488 $sed 's/^/ /' libnames >&4
6490 $echo $n "This may take a while...$c" >&4
6494 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6495 *) $nm $nm_opt $file 2>/dev/null;;
6500 $grep fprintf libc.tmp > libc.ptf
6501 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6502 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6504 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6506 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6508 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6510 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6512 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6514 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6516 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6518 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6520 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6522 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6524 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6526 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6528 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6529 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6531 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6533 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6535 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6537 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6539 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6541 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6543 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6545 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6547 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6549 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6551 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6553 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6555 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6557 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6559 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6562 $nm -p $* 2>/dev/null >libc.tmp
6563 $grep fprintf libc.tmp > libc.ptf
6564 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6565 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6571 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6573 if $ar t $libc > libc.tmp && \
6574 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6576 for thisname in $libnames $libc; do
6577 $ar t $thisname >>libc.tmp
6579 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6581 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6582 for thisname in $libnames $libc; do
6583 $ar tv $thisname >>libc.tmp
6584 emximp -o tmp.imp $thisname \
6586 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6587 < tmp.imp >>libc.tmp
6590 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6593 echo "$ar didn't seem to work right." >&4
6594 echo "Maybe this is a Cray...trying bld instead..." >&4
6596 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6599 for thisname in $libnames; do
6601 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6602 $ar t $thisname >>libc.tmp
6606 echo "That didn't work either. Giving up." >&4
6616 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6617 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6619 *) if $test -f /lib/syscalls.exp; then
6621 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6622 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6623 /lib/syscalls.exp >>libc.list
6629 $rm -f libnames libpath
6631 : Check if we are using C++
6633 echo "Checking for C++..." >&4
6634 $cat >try.c <<'EOCP'
6646 if eval $compile_ok && $run ./try; then
6648 echo "You are using a C++ compiler."
6651 echo "You are not using a C++ compiler."
6657 : is a C symbol defined?
6660 -v) tf=libc.tmp; tdc="";;
6661 -a) tf=libc.tmp; tdc="[]";;
6662 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6664 case "$d_cplusplus" in
6665 $define) extern_C="extern \"C\"" ;;
6666 *) extern_C="extern" ;;
6669 case "$reuseval-$4" in
6671 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6676 if $test "$runnm" = true; then
6677 if $contains $tlook $tf >/dev/null 2>&1; then
6679 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6680 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;
6681 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6682 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6686 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;
6687 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6693 $define) tval=true;;
6700 : define an is-in-libc? function
6701 inlibc='echo " "; td=$define; tu=$undef;
6702 sym=$1; var=$2; eval "was=\$$2";
6704 case "$reuseval$was" in
6714 echo "$sym() found." >&4;
6715 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6717 echo "$sym() NOT found." >&4;
6718 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6722 $define) echo "$sym() found." >&4;;
6723 *) echo "$sym() NOT found." >&4;;
6727 : check for length of double
6729 case "$doublesize" in
6731 echo "Checking to see how big your double precision numbers are..." >&4
6740 printf("%d\n", (int)sizeof(double));
6745 if eval $compile_ok; then
6746 doublesize=`$run ./try`
6747 echo "Your double is $doublesize bytes long."
6750 echo "(I can't seem to compile the test program. Guessing...)"
6751 rp="What is the size of a double precision number (in bytes)?"
6759 : see if this is a float.h system
6763 : check for long doubles
6765 echo "Checking to see if you have long double..." >&4
6766 echo 'int main() { long double x = 7.0; }' > try.c
6768 if eval $compile; then
6770 echo "You have long double."
6773 echo "You do not have long double."
6779 : see if ldexpl exists
6783 : check for length of long double
6784 case "${d_longdbl}${longdblsize}" in
6787 echo "Checking to see how big your long doubles are..." >&4
6788 $cat >try.c <<'EOCP'
6792 printf("%d\n", sizeof(long double));
6797 if eval $compile; then
6798 longdblsize=`$run ./try`
6799 echo "Your long doubles are $longdblsize bytes long."
6803 echo "(I can't seem to compile the test program. Guessing...)" >&4
6804 rp="What is the size of a long double (in bytes)?"
6808 if $test "X$doublesize" = "X$longdblsize"; then
6809 echo "That isn't any different from an ordinary double."
6810 echo "I'll keep your setting anyway, but you may see some"
6811 echo "harmless compilation warnings."
6817 $echo "Checking the kind of long doubles you have..." >&4
6818 case "$d_longdbl" in
6823 #define LONGDBLSIZE $longdblsize
6831 static const long double d = -0.1L;
6833 unsigned const char* b = (unsigned const char*)(&d);
6834 #if LDBL_MANT_DIG == 113 && LONGDBLSIZE == 16
6835 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6836 /* IEEE 754 128-bit little-endian */
6840 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6841 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6846 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6847 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6848 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6849 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6850 * Also known as "extended precision". */
6854 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6855 /* is there ever big-endian 80-bit, really? */
6860 #if LDBL_MANT_DIG == 106 && LONGDBLSIZE == 16
6861 /* software "double double", the 106 is 53+53 */
6862 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6863 /* double double 128-bit little-endian,
6864 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6868 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6869 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6870 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6875 printf("-1\n"); /* unknown */
6880 if eval $compile; then
6881 longdblkind=`$run ./try`
6888 case "$longdblkind" in
6889 0) echo "Your long doubles are doubles." >&4 ;;
6890 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6891 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6892 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6893 *) echo "Cannot figure out your long double." >&4 ;;
6898 : determine the architecture name
6900 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6901 tarch=`arch`"-$osname"
6902 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6903 if uname -m > tmparch 2>&1 ; then
6904 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6905 -e 's/$/'"-$osname/" tmparch`
6913 case "$myarchname" in
6916 echo "(Your architecture name used to be $myarchname.)"
6920 case "$targetarch" in
6922 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6927 *) dflt="$archname";;
6929 rp='What is your architecture name'
6933 : optionally add API version to the architecture for versioned archlibs
6934 case "$useversionedarchname" in
6935 $define|true|[yY]*) dflt='y';;
6938 rp='Add the Perl API version to your archname?'
6941 y|Y) useversionedarchname="$define" ;;
6942 *) useversionedarchname="$undef" ;;
6944 case "$useversionedarchname" in
6947 *-$api_versionstring)
6948 echo "...and architecture name already has -$api_versionstring" >&4
6951 archname="$archname-$api_versionstring"
6952 echo "...setting architecture name to $archname." >&4
6958 case "$usethreads" in
6960 echo "Threads selected." >&4
6962 *-thread*) echo "...and architecture name already has -thread." >&4
6964 *) archname="$archname-thread"
6965 echo "...setting architecture name to $archname." >&4
6970 case "$usemultiplicity" in
6972 echo "Multiplicity selected." >&4
6974 *-multi*) echo "...and architecture name already has -multi." >&4
6976 *) archname="$archname-multi"
6977 echo "...setting architecture name to $archname." >&4
6982 case "$use64bitint$use64bitall" in
6984 case "$archname64" in
6986 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6989 case "$use64bitint" in
6990 "$define") echo "64 bit integers selected." >&4 ;;
6992 case "$use64bitall" in
6993 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6996 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6998 *) archname="$archname-$archname64"
6999 echo "...setting architecture name to $archname." >&4
7005 case "$uselongdouble" in
7007 echo "Long doubles selected." >&4
7008 case "$longdblsize" in
7010 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7014 *-ld*) echo "...and architecture name already has -ld." >&4
7016 *) archname="$archname-ld"
7017 echo "...setting architecture name to $archname." >&4
7024 if $test -f archname.cbu; then
7025 echo "Your platform has some specific hints for architecture name, using them..."
7029 : set the prefixit variable, to compute a suitable default value
7030 prefixit='case "$3" in
7032 case "$oldprefix" in
7033 "") eval "$1=\"\$$2\"";;
7040 ""|" ") eval "$1=\"\$$2\"";;
7046 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7048 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7049 /*-$oldprefix/*|\~*-$oldprefix/*)
7050 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7051 *) eval "$1=\"\$$2\"";;
7055 : determine installation style
7056 : For now, try to deduce it from prefix unless it is already set.
7057 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7058 case "$installstyle" in
7059 '') case "$prefix" in
7060 *perl*) dflt='lib';;
7061 *) dflt='lib/perl5' ;;
7064 *) dflt="$installstyle" ;;
7066 : Probably not worth prompting for this since we prompt for all
7067 : the directories individually, and the prompt would be too long and
7071 : determine where public executables go
7076 rp='Pathname where the public executables will reside?'
7078 if $test "X$ansexp" != "X$binexp"; then
7082 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7083 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7084 : this via initialinstalllocation
7087 case "$userelocatableinc" in
7088 $define|true|[yY]*) dflt='y' ;;
7093 Would you like to build Perl so that the installation is relocatable, so that
7094 library paths in @INC are determined relative to the path of the perl binary?
7095 This is not advised for system Perl installs, or if you need to run setid
7096 scripts or scripts under taint mode.
7098 If this doesn't make any sense to you, just accept the default '$dflt'.
7100 rp='Use relocatable @INC?'
7103 y|Y) val="$define" ;;
7106 set userelocatableinc
7109 initialinstalllocation="$binexp"
7110 : Default prefix is now "up one level from where the binaries are"
7111 case "$userelocatableinc" in
7117 installprefixexp=".../.."
7121 : determine where private library files go
7122 : Usual default is /usr/local/lib/perl5/$version.
7123 : Also allow things like /opt/perl/lib/$version, since
7124 : /opt/perl/lib/perl5... would be redundant.
7125 : The default "style" setting is made in installstyle.U
7126 case "$installstyle" in
7127 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7128 *) set dflt privlib lib/$version ;;
7133 There are some auxiliary files for $package that need to be put into a
7134 private library directory that is accessible by everyone.
7139 rp='Pathname where the private library files will reside?'
7144 : set the prefixup variable, to restore leading tilda escape
7145 prefixup='case "$prefixexp" in
7147 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7150 : determine where public architecture dependent libraries go
7153 : privlib default is /usr/local/lib/$package/$version
7154 : archlib default is /usr/local/lib/$package/$version/$archname
7155 : privlib may have an optional trailing /share.
7156 tdflt=`echo $privlib | $sed 's,/share$,,'`
7157 tdflt=$tdflt/$archname
7166 $spackage contains architecture-dependent library files. If you are
7167 sharing libraries in a heterogeneous environment, you might store
7168 these files in a separate location. Otherwise, you can just include
7169 them with the rest of the public library files.
7174 rp='Where do you want to put the public architecture-dependent libraries?'
7178 if $test X"$archlib" = X"$privlib"; then
7184 : see if setuid scripts can be secure
7187 Some kernels have a bug that prevents setuid #! scripts from being
7188 secure. Some sites have disabled setuid #! scripts because of this.
7190 First let's decide if your kernel supports secure setuid #! scripts.
7191 (If setuid #! scripts would be secure but have been disabled anyway,
7192 don't say that they are secure if asked.)
7197 if $test -d /dev/fd; then
7198 echo "#!$ls" >reflect
7199 chmod +x,u+s reflect
7200 ./reflect >flect 2>&1
7201 if $contains "/dev/fd" flect >/dev/null; then
7202 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7206 If you are not sure if they are secure, I can check but I'll need a
7207 username and password different from the one you are using right now.
7208 If you don't have such a username or don't want me to test, simply
7212 rp='Other username to test security of setuid scripts with?'
7217 case "$d_suidsafe" in
7218 '') echo "I'll assume setuid scripts are *not* secure." >&4
7221 echo "Well, the $hint value is *not* secure." >&4
7223 *) echo "Well, the $hint value *is* secure." >&4
7228 $rm -f reflect flect
7229 echo "#!$ls" >reflect
7230 chmod +x,u+s reflect
7233 echo '"su" will (probably) prompt you for '"$ans's password."
7234 su $ans -c './reflect >flect'
7235 if $contains "/dev/fd" flect >/dev/null; then
7236 echo "Okay, it looks like setuid scripts are secure." >&4
7239 echo "I don't think setuid scripts are secure." >&4
7244 rp='Does your kernel have *secure* setuid scripts?'
7247 [yY]*) val="$define";;
7252 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7253 echo "(That's for file descriptors, not floppy disks.)"
7259 $rm -f reflect flect
7261 : now see if they want to do setuid emulation
7262 if $test $patchlevel -lt 11; then
7265 case "$d_suidsafe" in
7268 echo "No need to emulate SUID scripts since they are secure here." >&4
7272 Some systems have disabled setuid scripts, especially systems where
7273 setuid scripts cannot be secure. On systems where setuid scripts have
7274 been disabled, the setuid/setgid bits on scripts are currently
7275 useless. It is possible for $package to detect those bits and emulate
7276 setuid/setgid in a secure fashion. This emulation will only work if
7277 setuid scripts have been disabled in your kernel.
7281 "$define") dflt=y ;;
7284 rp="Do you want to do setuid/setgid emulation?"
7287 [yY]*) val="$define";;
7299 SUID emulation has been removed for 5.12
7300 Please re-run Configure without -Dd_dosuid
7309 : Find perl5.005 or later.
7310 echo "Looking for a previously installed perl5.005 or later... "
7312 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7313 : Check if this perl is recent and can load a simple module
7314 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7317 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7327 '') echo "None found. That's ok.";;
7328 *) echo "Using $perl5." ;;
7331 : Set the siteprefix variables
7334 After $package is installed, you may wish to install various
7335 add-on modules and utilities. Typically, these add-ons will
7336 be installed under $prefix with the rest
7337 of this package. However, you may wish to install such add-ons
7338 elsewhere under a different prefix.
7340 If you do not wish to put everything under a single prefix, that's
7341 ok. You will be prompted for the individual locations; this siteprefix
7342 is only used to suggest the defaults.
7344 The default should be fine for most people.
7348 rp='Installation prefix to use for add-on modules and utilities?'
7349 : XXX Here might be another good place for an installstyle setting.
7350 case "$siteprefix" in
7352 *) dflt=$siteprefix ;;
7355 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7357 case "$siteprefix" in
7361 *) oldsiteprefix="$prefix";;
7366 siteprefixexp="$ansexp"
7368 : determine where site specific libraries go.
7369 : Usual default is /usr/local/lib/perl5/site_perl/$version
7370 : The default "style" setting is made in installstyle.U
7371 : XXX No longer works with Prefixit stuff.
7372 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7374 '') case "$installstyle" in
7375 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7376 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7384 The installation process will create a directory for
7385 site-specific extensions and modules. Most users find it convenient
7386 to place all site-specific files in this directory rather than in the
7387 main distribution directory.
7391 rp='Pathname for the site-specific library files?'
7395 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7397 : Determine list of previous versions to include in @INC
7398 $cat > getverlist <<EOPL
7401 \$api_versionstring = "$api_versionstring";
7402 \$version = "$version";
7403 \$stem = "$sitelib_stem";
7404 \$archname = "$archname";
7406 $cat >> getverlist <<'EOPL'
7407 # The list found is store twice for each entry: the original name, and
7408 # the binary broken down version as pack "sss", so sorting is easy and
7409 # unambiguous. This will work for all versions that have a maximum of
7410 # three digit groups, separate by '.'s or '_'s. Names are extended with
7411 # ".0.0" to ensure at least three elements for the pack.
7412 # -- H.Merijn Brand (m)'06 23-10-2006
7414 # Can't have leading @ because metaconfig interprets it as a command!
7415 ;@inc_version_list=();
7416 # XXX Redo to do opendir/readdir?
7419 ;@candidates = map {
7420 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7421 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7427 ($pversion, $aversion, $vsn5005) = map {
7428 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7429 foreach $d (@candidates) {
7430 if ($d->[1] lt $pversion) {
7431 if ($d->[1] ge $aversion) {
7432 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7434 elsif ($d->[1] ge $vsn5005) {
7435 unshift(@inc_version_list, grep { -d } $d->[0]);
7439 # Skip newer version. I.e. don't look in
7440 # 5.7.0 if we're installing 5.6.1.
7444 if (@inc_version_list) {
7445 print join(' ', @inc_version_list);
7448 # Blank space to preserve value for next Configure run.
7453 case "$inc_version_list" in
7454 '') if test -x "$perl5$exe_ext"; then
7455 dflt=`$perl5 getverlist`
7460 $undef) dflt='none' ;;
7461 *) eval dflt=\"$inc_version_list\" ;;
7464 ''|' ') dflt=none ;;
7471 In order to ease the process of upgrading, this version of perl
7472 can be configured to use modules built and installed with earlier
7473 versions of perl that were installed under $prefix. Specify here
7474 the list of earlier versions that this version of perl should check.
7475 If Configure detected no earlier versions of perl installed under
7476 $prefix, then the list will be empty. Answer 'none' to tell perl
7477 to not search earlier versions.
7479 The default should almost always be sensible, so if you're not sure,
7480 just accept the default.
7483 rp='List of earlier versions to include in @INC?'
7486 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7487 *) inc_version_list="$ans" ;;
7489 case "$inc_version_list" in
7491 inc_version_list_init='0'
7492 d_inc_version_list="$undef"
7494 *) inc_version_list_init=`echo $inc_version_list |
7495 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7496 d_inc_version_list="$define"
7501 : see if malloc/malloc.h has to be included
7502 set malloc/malloc.h i_mallocmalloc
7505 : see if this is a malloc.h system
7506 : we want a real compile instead of Inhdr because some systems have a
7507 : malloc.h that just gives a compile error saying to use stdlib.h instead
7512 #$i_mallocmalloc I_MALLOCMALLOC
7513 #ifdef I_MALLOCMALLOC
7514 # include <malloc/malloc.h>
7517 int main () { return 0; }
7520 if eval $compile; then
7521 echo "<malloc.h> found." >&4
7524 echo "<malloc.h> NOT found." >&4
7531 : check for length of pointer
7535 echo "Checking to see how big your pointers are..." >&4
7544 printf("%d\n", (int)sizeof(void *));
7549 if eval $compile_ok; then
7550 ptrsize=`$run ./try`
7551 echo "Your pointers are $ptrsize bytes long."
7554 echo "(I can't seem to compile the test program. Guessing...)" >&4
7555 rp="What is the size of a pointer (in bytes)?"
7562 case "$use64bitall" in
7563 "$define"|true|[yY]*)
7567 *** You have chosen a maximally 64-bit build,
7568 *** but your pointers are only 4 bytes wide.
7569 *** Please rerun Configure without -Duse64bitall.
7574 *** Since you have quads, you could possibly try with -Duse64bitint.
7579 *** Cannot continue, aborting.
7590 : determine whether to use malloc wrapping
7592 case "$usemallocwrap" in
7593 [yY]*|true|$define) dflt='y' ;;
7594 [nN]*|false|$undef) dflt='n' ;;
7595 *) case "$usedevel" in
7596 [yY]*|true|$define) dflt='y' ;;
7601 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7603 usemallocwrap="$ans"
7606 usemallocwrap="$define" ;;
7608 usemallocwrap="$undef" ;;
7611 : determine which malloc to compile in
7613 case "$usemymalloc" in
7614 [yY]*|true|$define) dflt='y' ;;
7615 [nN]*|false|$undef) dflt='n' ;;
7616 *) case "$ptrsize" in
7620 if test "$useithreads" = "$define"; then dflt='n'; fi
7623 rp="Do you wish to attempt to use the malloc that comes with $package?"
7629 mallocsrc='malloc.c'
7630 mallocobj="malloc$_o"
7631 d_mymalloc="$define"
7634 : Remove malloc from list of libraries to use
7635 echo "Removing unneeded -lmalloc from library list" >&4
7636 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7639 echo "libs = $libs" >&4
7651 : compute the return types of malloc and free
7653 $cat >malloc.c <<END
7657 #include <sys/types.h>
7671 case "$malloctype" in
7673 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7680 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7684 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7691 echo "Your system uses $freetype free(), it would seem." >&4
7693 : determine where site specific architecture-dependent libraries go.
7694 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7695 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7696 : sitelib may have an optional trailing /share.
7698 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7699 dflt="$dflt/$archname"
7704 set sitearch sitearch none
7708 The installation process will also create a directory for
7709 architecture-dependent site-specific extensions and modules.
7713 rp='Pathname for the site-specific architecture-dependent library files?'
7717 if $test X"$sitearch" = X"$sitelib"; then
7720 d_sitearch="$define"
7723 : Set the vendorprefix variables
7726 The installation process will also create a directory for
7727 vendor-supplied add-ons. Vendors who supply perl with their system
7728 may find it convenient to place all vendor-supplied files in this
7729 directory rather than in the main distribution directory. This will
7730 ease upgrades between binary-compatible maintenance versions of perl.
7732 Of course you may also use these directories in whatever way you see
7733 fit. For example, you might use them to access modules shared over a
7734 company-wide network.
7736 The default answer should be fine for most people.
7737 This causes further questions about vendor add-ons to be skipped
7738 and no vendor-specific directories will be configured for perl.
7741 rp='Do you want to configure vendor-specific add-on directories?'
7742 case "$usevendorprefix" in
7743 define|true|[yY]*) dflt=y ;;
7744 *) : User may have set vendorprefix directly on Configure command line.
7745 case "$vendorprefix" in
7754 rp='Installation prefix to use for vendor-supplied add-ons?'
7755 case "$vendorprefix" in
7756 '') dflt="$prefix" ;;
7757 *) dflt=$vendorprefix ;;
7760 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7762 case "$vendorprefix" in
7766 *) oldvendorprefix="$prefix";;
7770 usevendorprefix="$define"
7772 vendorprefixexp="$ansexp"
7774 *) usevendorprefix="$undef"
7780 : Set the vendorlib variables
7781 case "$vendorprefix" in
7782 '') d_vendorlib="$undef"
7786 *) d_vendorlib="$define"
7787 : determine where vendor-supplied modules go.
7788 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7789 case "$vendorlib" in
7791 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7792 case "$installstyle" in
7793 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7794 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7797 *) dflt="$vendorlib"
7801 rp='Pathname for the vendor-supplied library files?'
7804 vendorlibexp="$ansexp"
7807 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7811 : Set the vendorarch variables
7812 case "$vendorprefix" in
7813 '') d_vendorarch="$undef"
7817 *) d_vendorarch="$define"
7818 : determine where vendor-supplied architecture-dependent libraries go.
7819 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7820 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7821 : vendorlib may have an optional trailing /share.
7822 case "$vendorarch" in
7823 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7824 dflt="$dflt/$archname"
7826 *) dflt="$vendorarch" ;;
7829 rp='Pathname for vendor-supplied architecture-dependent files?'
7832 vendorarchexp="$ansexp"
7835 prefixvar=vendorarch
7837 if $test X"$vendorarch" = X"$vendorlib"; then
7838 d_vendorarch="$undef"
7840 d_vendorarch="$define"
7843 : Final catch-all directories to search
7846 Lastly, you can have perl look in other directories for extensions and
7847 modules in addition to those already specified.
7848 These directories will be searched after
7852 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7853 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7855 case "$otherlibdirs" in
7856 ''|' ') dflt='none' ;;
7857 *) dflt="$otherlibdirs" ;;
7860 Enter a colon-separated set of extra paths to include in perl's @INC
7861 search path, or enter 'none' for no extra paths.
7865 rp='Colon-separated list of additional directories for perl to search?'
7868 ' '|''|none) otherlibdirs=' ' ;;
7869 *) otherlibdirs="$ans" ;;
7871 case "$otherlibdirs" in
7875 set d_perl_otherlibdirs
7878 : Cruising for prototypes
7880 echo "Checking out function prototypes..." >&4
7881 $cat >prototype.c <<EOCP
7886 int main(int argc, char *argv[]) {
7889 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7890 echo "Your C compiler appears to support function prototypes."
7893 echo "Your C compiler doesn't seem to understand function prototypes."
7900 : Check if ansi2knr is required
7901 case "$prototype" in
7903 *) ansi2knr='ansi2knr'
7908 This version of $package can only be compiled by a compiler that
7909 understands function prototypes. Unfortunately, your C compiler
7911 doesn't seem to understand them. Sorry about that.
7913 If GNU cc is available for your system, perhaps you could try that instead.
7915 Eventually, we hope to support building Perl with pre-ANSI compilers.
7916 If you would like to help in that effort, please contact <perlbug@perl.org>.
7918 Aborting Configure now.
7925 dflt_dtrace='/usr/sbin/dtrace'
7926 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7930 Perl can be built to support DTrace on platforms that support it.
7931 DTrace is a diagnosis and performance analysis tool from Sun.
7933 If this doesn't make any sense to you, just accept the default '$dflt'.
7937 case "$usedtrace" in
7943 dflt_dtrace=$usedtrace
7950 rp='Support DTrace if available?'
7953 y|Y) val="$define" ;;
7959 test "X$usedtrace" != "X$define" && break
7962 rp='Where is the dtrace executable?'
7971 if $dtrace -h -s ../perldtrace.d \
7972 -o perldtrace.tmp >/dev/null 2>&1 \
7973 && rm -f perldtrace.tmp
7976 echo "Good: your $dtrace knows about the -h flag."
7980 *** $me: Fatal Error: $dtrace doesn't support -h flag
7982 *** Your installed dtrace doesn't support the -h switch to compile a D
7983 *** program into a C header. Can't continue.
7995 *** $me: Fatal Error: $dtrace not found.
8002 echo "*** $dtrace was not found."
8008 : See if we want extra modules installed
8015 Perl can be built with extra modules or bundles of modules which
8016 will be fetched from the CPAN and installed alongside Perl.
8018 Notice that you will need access to the CPAN; either via the Internet,
8019 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8020 be asked later to configure the CPAN.pm module which will in turn do
8021 the installation of the rest of the extra modules or bundles.)
8023 Notice also that if the modules require any external software such as
8024 libraries and headers (the libz library and the zlib.h header for the
8025 Compress::Zlib module, for example) you MUST have any such software
8026 already installed, this configuration process will NOT install such
8029 If this doesn't make any sense to you, just accept the default '$dflt'.
8031 rp='Install any extra modules (y or n)?'
8037 Please list any extra modules or bundles to be installed from CPAN,
8038 with spaces between the names. The names can be in any format the
8039 'install' command of CPAN.pm will understand. (Answer 'none',
8040 without the quotes, to install no extra modules or bundles.)
8050 $rm -f ../extras.lst
8052 *) echo "(Saving the list of extras for later...)"
8053 echo "$extras" > ../extras.lst
8061 : determine where html pages for programs go
8062 set html1dir html1dir none
8066 If you wish to install html files for programs in $spackage, indicate
8067 the appropriate directory here. To skip installing html files,
8071 ''|none|$undef|' ') dflt=none ;;
8072 *) dflt=$html1dir ;;
8075 rp="Directory for the main $spackage html pages?"
8079 : Use ' ' for none so value is preserved next time through Configure
8080 $test X"$html1dir" = "X" && html1dir=' '
8082 : determine where html pages for libraries and modules go
8083 set html3dir html3dir none
8087 If you wish to install html files for modules associated with $spackage,
8088 indicate the appropriate directory here. To skip installing html files,
8091 : There is no obvious default. If they have specified html1dir, then
8092 : try to key off that, possibly changing .../html1 into .../html3.
8094 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8095 *) dflt=$html3dir ;;
8098 rp="Directory for the $spackage module html pages?"
8102 : Use ' ' for none so value is preserved next time through Configure
8103 $test X"$html3dir" = "X" && html3dir=' '
8105 : determine whether to install perl also as /usr/bin/perl
8108 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8110 Many scripts expect perl to be installed as /usr/bin/perl.
8112 If you want to, I can install the perl you are about to compile
8113 as /usr/bin/perl (in addition to $bin/perl).
8115 if test -f /usr/bin/perl; then
8118 However, please note that because you already have a /usr/bin/perl,
8119 overwriting that with a new Perl would very probably cause problems.
8120 Therefore I'm assuming you don't want to do that (unless you insist).
8123 case "$installusrbinperl" in
8124 "$define"|[yY]*) dflt='y';;
8130 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8133 case "$installusrbinperl" in
8134 "$undef"|[nN]*) dflt='n';;
8138 rp="Do you want to install perl as /usr/bin/perl?"
8141 [yY]*) val="$define";;
8147 set installusrbinperl
8150 : see if dlopen exists
8152 xxx_ccflags="$ccflags"
8154 : with g++ one needs -shared to get is-in-libc to work for dlopen
8155 case "$gccversion" in
8157 *) case "$d_cplusplus" in
8158 "$define") ccflags="$ccflags -shared" ;;
8165 ccflags="$xxx_ccflags"
8167 : see if this is a unistd.h system
8168 set unistd.h i_unistd
8171 : determine which dynamic loading, if any, to compile in
8173 dldir="ext/DynaLoader"
8186 $define) dflt='y' ;;
8188 : Does a dl_xxx.xs file exist for this operating system
8189 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8192 rp="Do you wish to use dynamic loading?"
8199 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8200 dflt="$dldir/dl_${osname}.xs"
8201 elif $test "$d_dlopen" = "$define" ; then
8202 dflt="$dldir/dl_dlopen.xs"
8207 *) dflt="$dldir/$dlsrc"
8210 echo "The following dynamic loading files are available:"
8211 : Can not go over to $dldir because getfile has path hard-coded in.
8212 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8213 rp="Source file to use for dynamic loading"
8219 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8223 Some systems may require passing special flags to $cc -c to
8224 compile modules that will be used to create a shared library.
8225 To use no flags, say "none".
8228 case "$cccdlflags" in
8229 '') case "$gccversion" in
8230 '') case "$osname" in
8232 irix*) dflt='-KPIC' ;;
8233 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8234 sunos) dflt='-pic' ;;
8238 *) case "$osname" in
8239 darwin) dflt='none' ;;
8240 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8245 *) dflt="$cccdlflags" ;;
8252 # If -Dsysroot was specified, now's the time to add it
8254 if test "X$sysroot" != X; then
8255 case "$gccversion" in
8260 dflt="$dflt --sysroot=$sysroot" ;;
8270 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8273 none) cccdlflags=' ' ;;
8274 *) cccdlflags="$ans" ;;
8279 Some systems use ld to create libraries that can be dynamically loaded,
8280 while other systems (such as those using ELF) use $cc.
8284 : Determine if this is ELF
8286 /* Test for whether ELF binaries are produced */
8298 int i = open("a.out",O_RDONLY);
8301 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8302 exit(0); /* succeed (yes, it is ELF) */
8306 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8312 '') if $test $bin_ELF = "$define"; then
8314 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8318 echo "I'll use ld to build dynamic libraries."
8326 rp="What command should be used to create dynamic libraries?"
8332 Some systems may require passing special flags to $ld to create a
8333 library that can be dynamically loaded. If your ld flags include
8334 -L/other/path options to locate libraries outside your loader's normal
8335 search path, you may need to specify those -L options here as well. To
8336 use no flags, say "none".
8339 case "$lddlflags" in
8340 '') case "$osname" in
8341 haiku) dflt='-shared' ;;
8343 case "$gccversion" in
8344 '') dflt="$dflt +vnocompatwarnings" ;;
8347 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8348 solaris) # See [perl #66604].
8349 # On Solaris 11, gcc -m64 on amd64
8350 # appears not to understand -G. gcc versions at
8351 # least as old as 3.4.3 support -shared, so just
8352 # use that with Solaris 11 and later, but keep
8353 # the old behavior for older Solaris versions.
8354 case "$gccversion" in
8356 *) case "$osvers" in
8357 2.?|2.10) dflt='-G' ;;
8358 *) dflt='-shared' ;;
8363 sunos) dflt='-assert nodefinitions' ;;
8364 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8368 *) dflt="$lddlflags" ;;
8371 : Only do this for gcc, since, for example, qcc has no concept
8373 if $test "X$sysroot" != X; then
8374 case "$gccversion" in
8376 *) dflt="$dflt --sysroot $sysroot" ;;
8380 : Try to guess additional flags to pick up local libraries.
8381 : Be careful not to append to a plain 'none'
8385 for thisflag in $ldflags; do
8390 *) dflt="$dflt $thisflag" ;;
8397 ''|' ') dflt='none' ;;
8401 *-fstack-protector*)
8403 *-fstack-protector*) ;; # Don't add it again
8404 *) dflt="$dflt -fstack-protector" ;;
8409 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8412 none) lddlflags=' ' ;;
8413 *) lddlflags="$ans" ;;
8418 Some systems may require passing special flags to $cc to indicate that
8419 the resulting executable will use dynamic linking. To use no flags,
8423 case "$ccdlflags" in
8424 '') case "$osname" in
8425 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8426 sunos) dflt='none' ;;
8430 *) dflt="$ccdlflags" ;;
8432 rp="Any special flags to pass to $cc to use dynamic linking?"
8435 none) ccdlflags=' ' ;;
8436 *) ccdlflags="$ans" ;;
8448 ld_can_script="$undef"
8449 case "$bin_ELF$usedl" in
8451 # Abuse try.h and a.out names for neat cleanup
8463 if $cc $cccdlflags $ccdlflags $ccflags \
8464 $ldflags $lddlflags -o a.out try.c \
8465 -Wl,--version-script=try.h >/dev/null 2>&1 \
8466 && $test -s a.out ; then
8467 echo "ld supports scripting" >&4
8468 ld_can_script="$define"
8470 echo "ld does not support scripting" >&4
8476 : Do we want a shared libperl?
8480 # No dynamic loading being used, so don't bother even to prompt.
8483 *) case "$useshrplib" in
8484 '') case "$osname" in
8485 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8487 also='Building a shared libperl is required for dynamic loading to work on your system.'
8501 The perl executable is normally obtained by linking perlmain.c with
8502 libperl${_a}, any static extensions (usually just DynaLoader), and
8503 any other libraries needed on this system (such as -lm, etc.). Since
8504 your system supports dynamic loading, it is probably possible to build
8505 a shared libperl.$so. If you will have more than one executable linked
8506 to libperl.$so, this will significantly reduce the size of each
8507 executable, but it may have a noticeable effect on performance. The
8508 default is probably sensible for your system.
8512 rp="Build a shared libperl.$so (y/n)"
8516 useshrplib='true' ;;
8517 *) useshrplib='false' ;;
8522 case "$useshrplib" in
8524 case "$userelocatableinc" in
8526 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8527 echo "See INSTALL for an explanation why that won't work." >&4
8533 # Figure out a good name for libperl.so. Since it gets stored in
8534 # a version-specific architecture-dependent library, the version
8535 # number isn't really that important, except for making cc/ld happy.
8537 # A name such as libperl.so.10.1
8538 majmin="libperl.$so.$patchlevel.$subversion"
8539 # A name such as libperl.so.100
8540 majonly=`echo $patchlevel $subversion |
8541 $awk '{printf "%d%02d", $1, $2}'`
8542 majonly=libperl.$so.$majonly
8543 # I'd prefer to keep the os-specific stuff here to a minimum, and
8544 # rely on figuring it out from the naming of libc.
8545 case "${osname}${osvers}" in
8546 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8549 cygwin*) # ld links now against the dll directly
8550 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8551 majonly=`echo $patchlevel $subversion |
8552 $awk '{printf "%03d%03d", $1, $2}'`
8553 majonly=cygperl5.$majonly.$so
8556 *) # Try to guess based on whether libc has major.minor.
8558 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8559 *libc.$so.[0-9]*) dflt=$majonly ;;
8560 *) dflt=libperl.$so ;;
8570 I need to select a good name for the shared libperl. If your system uses
8571 library names with major and minor numbers, then you might want something
8572 like $majmin. Alternatively, if your system uses a single version
8573 number for shared libraries, then you might want to use $majonly.
8574 Or, your system might be quite happy with a simple libperl.$so.
8576 Since the shared libperl will get installed into a version-specific
8577 architecture-dependent directory, the version number of the shared perl
8578 library probably isn't important, so the default should be o.k.
8581 rp='What name do you want to give to the shared libperl?'
8584 echo "Ok, I'll use $libperl"
8587 libperl="libperl${_a}"
8591 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8595 WARNING: Use of the shrpdir variable for the installation location of
8596 the shared $libperl is not supported. It was never documented and
8597 will not work in this version. Let me (perlbug@perl.org)
8598 know of any problems this may cause.
8604 But your current setting of $shrpdir is
8605 the default anyway, so it's harmless.
8610 Further, your current attempted setting of $shrpdir
8611 conflicts with the value of $archlibexp/CORE
8612 that installperl will use.
8619 # How will the perl executable find the installed shared $libperl?
8620 # Add $xxx to ccdlflags.
8621 # If we can't figure out a command-line option, use $shrpenv to
8622 # set env LD_RUN_PATH. The main perl makefile uses this.
8623 shrpdir=$archlibexp/CORE
8626 if "$useshrplib"; then
8629 # We'll set it in Makefile.SH...
8634 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8635 xxx="-Wl,-R$shrpdir"
8637 bsdos|linux|irix*|dec_osf|gnu*)
8638 xxx="-Wl,-rpath,$shrpdir"
8641 # Haiku doesn't like the default, either.
8644 # hpux doesn't like the default, either.
8645 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8648 # cygwin needs only ldlibpth
8651 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8657 # Only add $xxx if it isn't already in ccdlflags.
8658 case " $ccdlflags " in
8660 *) ccdlflags="$ccdlflags $xxx"
8663 Adding $xxx to the flags
8664 passed to $ld so that the perl executable will find the
8665 installed shared $libperl.
8673 # Fix ccdlflags in AIX for building external extensions.
8674 # (For building Perl itself bare -bE:perl.exp is needed,
8675 # Makefile.SH takes care of this.)
8677 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8679 # Respect a hint or command-line value.
8681 '') shrpenv="$tmp_shrpenv" ;;
8683 case "$ldlibpthname" in
8684 '') ldlibpthname=LD_LIBRARY_PATH ;;
8685 none) ldlibpthname='' ;;
8688 : determine where manual pages are on this system
8692 syspath='/usr/share/man/man1 /usr/man/man1'
8693 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8694 syspath="$syspath /usr/man/u_man/man1"
8695 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8696 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8697 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8698 sysman=`./loc . /usr/man/man1 $syspath`
8701 if $test -d "$sysman"; then
8702 echo "System manual is in $sysman." >&4
8704 echo "Could not find manual pages in source form." >&4
8707 : determine where manual pages go
8708 set man1dir man1dir none
8712 $spackage has manual pages available in source form.
8716 echo "However, you don't have nroff, so they're probably useless to you."
8718 '') man1dir="none";;
8721 echo "If you don't want the manual sources installed, answer 'none'."
8726 lookpath="$prefixexp/share/man/man1"
8727 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8728 lookpath="$lookpath $prefixexp/man/p_man/man1"
8729 lookpath="$lookpath $prefixexp/man/u_man/man1"
8730 lookpath="$lookpath $prefixexp/man/man.1"
8732 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8733 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8743 rp="Where do the main $spackage manual pages (source) go?"
8745 if $test "X$man1direxp" != "X$ansexp"; then
8756 : What suffix to use on installed man pages
8763 rp="What suffix should be used for the main $spackage man pages?"
8765 '') case "$man1dir" in
8779 *) dflt="$man1ext";;
8786 : see if we can have long filenames
8788 first=123456789abcdef
8790 if (echo hi >$first) 2>/dev/null; then
8791 if $test -f 123456789abcde; then
8792 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8795 echo 'You can have filenames longer than 14 characters.'>&4
8800 You can't have filenames longer than 14 chars.
8801 You can't even think about them!
8807 $rm -rf 123456789abcde*
8809 : determine where library module manual pages go
8810 set man3dir man3dir none
8814 $spackage has manual pages for many of the library modules.
8820 However, you don't have nroff, so they're probably useless to you.
8823 '') man3dir="none";;
8827 case "$d_flexfnam" in
8830 However, your system can't handle the long file names like File::Basename.3.
8833 '') man3dir="none";;
8837 echo "If you don't want the manual sources installed, answer 'none'."
8838 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8840 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8841 if $test -d "$privlib/man/man3"; then
8844 WARNING: Previous versions of perl installed man3 pages into
8845 $privlib/man/man3. This version will suggest a
8846 new default of $dflt.
8850 rp='Do you wish to preserve the old behavior?(y/n)'
8853 y*) dflt="$privlib/man/man3" ;;
8858 *) dflt="$man3dir" ;;
8865 rp="Where do the $package library man pages (source) go?"
8875 : What suffix to use on installed man pages
8881 rp="What suffix should be used for the $package library man pages?"
8883 '') case "$man3dir" in
8897 *) dflt="$man3ext";;
8904 : see if we have to deal with yellow pages, now NIS.
8905 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8911 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8919 rp='Are you getting the hosts file via yellow pages?'
8922 y*) hostcat='ypcat hosts';;
8923 *) hostcat='cat /etc/hosts';;
8929 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8932 '') test -f /etc/group && groupcat='cat /etc/group';;
8935 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8938 : now get the host name
8940 echo "Figuring out host name..." >&4
8941 case "$myhostname" in
8943 echo 'Maybe "hostname" will work...'
8944 if tans=`sh -c hostname 2>&1` ; then
8952 if $test "$cont"; then
8954 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8955 if tans=`cat /etc/systemid 2>&1` ; then
8957 phostname='cat /etc/systemid'
8958 echo "Whadyaknow. Xenix always was a bit strange..."
8961 elif $test -r /etc/systemid; then
8962 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8965 if $test "$cont"; then
8966 echo 'No, maybe "uuname -l" will work...'
8967 if tans=`sh -c 'uuname -l' 2>&1` ; then
8969 phostname='uuname -l'
8971 echo 'Strange. Maybe "uname -n" will work...'
8972 if tans=`sh -c 'uname -n' 2>&1` ; then
8974 phostname='uname -n'
8976 echo 'Oh well, maybe I can mine it out of whoami.h...'
8977 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8978 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8979 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8981 case "$myhostname" in
8982 '') echo "Does this machine have an identity crisis or something?"
8985 echo "Well, you said $myhostname before..."
8986 phostname='echo $myhostname';;
8992 case "$myhostname" in
8993 '') myhostname=noname ;;
8995 : you do not want to know about this
9000 if $test "$myhostname" ; then
9002 rp='Your host name appears to be "'$myhostname'".'" Right?"
9010 : bad guess or no guess
9011 while $test "X$myhostname" = X ; do
9013 rp="Please type the (one word) name of your host:"
9018 : translate upper to lower if necessary
9019 case "$myhostname" in
9021 echo "(Normalizing case in your host name)"
9022 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9026 case "$myhostname" in
9028 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9029 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9030 echo "(Trimming domain name from host name--host name is now $myhostname)"
9032 *) case "$mydomain" in
9035 test "X$hostcat" = "Xypcat hosts" &&
9036 ypmatch "$myhostname" hosts 2>/dev/null |\
9037 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9040 test "X$hostcat" != "X" &&
9041 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9042 /[ ]$myhostname[ . ]/p" > hosts
9045 if $test -f hosts; then
9046 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9047 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9048 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9049 hosts | $sort | $uniq | \
9050 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9051 case `$echo X$dflt` in
9052 X*\ *) echo "(Several hosts in the database matched hostname)"
9055 X.) echo "(You do not have fully-qualified names in the hosts database)"
9059 echo "(I cannot locate a hosts database anywhere)"
9064 tans=`./loc resolv.conf X /etc /usr/etc`
9065 if $test -f "$tans"; then
9066 echo "(Attempting domain name extraction from $tans)"
9067 dflt=.`$sed -n -e 's/ / /g' \
9068 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9071 .) dflt=.`$sed -n -e 's/ / /g' \
9072 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9080 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9081 dflt=.`sh -c domainname 2>/dev/null`
9084 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9088 case "$dflt$osname" in
9089 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9090 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9094 .) echo "(Lost all hope -- silly guess then)"
9100 *) dflt="$mydomain";;
9104 rp="What is your domain name?"
9114 : translate upper to lower if necessary
9117 echo "(Normalizing case in your domain name)"
9118 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9122 : a little sanity check here
9123 case "$phostname" in
9126 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9127 $myhostname$mydomain|$myhostname) ;;
9129 case "$phostname" in
9131 echo "(That doesn't agree with your whoami.h file, by the way.)"
9134 echo "(That doesn't agree with your $phostname command, by the way.)"
9142 : determine the e-mail address of the user who is running us
9145 I need to get your e-mail address in Internet format if possible, i.e.
9146 something like user@host.domain. Please answer accurately since I have
9147 no easy means to double check it. The default value provided below
9148 is most probably close to reality but may not be valid from outside
9149 your organization...
9153 while test "$cont"; do
9154 case "$MAILDOMAIN" in
9156 if $test -s /etc/mailname; then
9157 maildomain=`$cat /etc/mailname`
9159 maildomain="$myhostname$mydomain"
9162 *) maildomain="$MAILDOMAIN";;
9165 '') dflt="$cf_by@$maildomain";;
9166 *) dflt="$cf_email";;
9168 rp='What is your e-mail address?'
9174 rp='Address does not look like an Internet one. Use it anyway?'
9188 : Ask e-mail of administrator
9191 If you or somebody else will be maintaining perl at your site, please
9192 fill in the correct e-mail address here so that they may be contacted
9193 if necessary. Currently, the "perlbug" program included with perl
9194 will send mail to this address in addition to perlbug@perl.org. You may
9195 enter "none" for no administrator.
9198 case "$perladmin" in
9199 '') dflt="$cf_email";;
9200 *) dflt="$perladmin";;
9202 rp='Perl administrator e-mail address'
9206 : determine whether to only install version-specific parts.
9209 Do you want to install only the version-specific parts of the perl
9210 distribution? Usually you do *not* want to do this.
9212 case "$versiononly" in
9213 "$define"|[Yy]*|true) dflt='y' ;;
9216 rp="Do you want to install only the version-specific parts of perl?"
9219 [yY]*) val="$define";;
9225 case "$versiononly" in
9226 "$define") inc_version_list=''
9227 inc_version_list_init=0
9231 : figure out how to guarantee perl startup
9232 : XXX Note that this currently takes advantage of the bug that binexp ignores
9233 : the Configure -Dinstallprefix setting, which in turn means that under
9234 : relocatable @INC, initialinstalllocation is what binexp started as.
9235 case "$startperl" in
9237 case "$sharpbang" in
9241 I can use the #! construct to start perl on your system. This will
9242 make startup of perl scripts faster, but may cause problems if you
9243 want to share those scripts and perl is not in a standard place
9244 ($initialinstalllocation/perl) on all your platforms. The alternative
9245 is to force a shell by starting the script with a single ':' character.
9248 case "$versiononly" in
9249 "$define") dflt="$initialinstalllocation/perl$version";;
9250 *) dflt="$initialinstalllocation/perl";;
9252 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9255 none) startperl=": # use perl";;
9256 *) startperl="#!$ans"
9257 if $test 30 -lt `echo "$ans" | wc -c`; then
9260 WARNING: Some systems limit the #! command to 32 characters.
9261 If you experience difficulty running Perl scripts with #!, try
9262 installing Perl in a directory with a shorter pathname.
9268 *) startperl=": # use perl"
9273 echo "I'll use $startperl to start perl scripts."
9275 : figure best path for perl in scripts
9278 case "$versiononly" in
9279 "$define") perlpath="$initialinstalllocation/perl$version";;
9280 *) perlpath="$initialinstalllocation/perl";;
9282 case "$startperl" in
9287 I will use the "eval 'exec'" idiom to start Perl on your system.
9288 I can use the full path of your Perl binary for this purpose, but
9289 doing so may cause problems if you want to share those scripts and
9290 Perl is not always in a standard place ($initialinstalllocation/perl).
9293 dflt="$initialinstalllocation/perl"
9294 rp="What path shall I use in \"eval 'exec'\"?"
9301 case "$startperl" in
9303 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9306 : determine where public executable scripts go
9307 set scriptdir scriptdir
9309 case "$scriptdir" in
9312 : guess some guesses
9313 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9314 $test -d /usr/share/bin && dflt=/usr/share/bin
9315 $test -d /usr/local/script && dflt=/usr/local/script
9316 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9317 $test -d $prefixexp/script && dflt=$prefixexp/script
9321 *) dflt="$scriptdir"
9326 Some installations have a separate directory just for executable scripts so
9327 that they can mount it across multiple architectures but keep the scripts in
9328 one spot. You might, for example, have a subdirectory of /usr/share for this.
9329 Or you might just lump your scripts in with all your other executables.
9333 rp='Where do you keep publicly executable scripts?'
9335 if $test "X$ansexp" != "X$scriptdirexp"; then
9341 : A little fix up for an irregularly named variable.
9342 installscript="$installscriptdir"
9344 : determine where add-on public executables go
9346 '') dflt=$siteprefix/bin ;;
9350 rp='Pathname where the add-on public executables should be installed?'
9355 : determine where add-on html pages go
9356 : There is no standard location, so try to copy the previously-selected
9357 : directory structure for the core html pages.
9358 case "$sitehtml1dir" in
9359 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9360 *) dflt=$sitehtml1dir ;;
9363 ''|' ') dflt=none ;;
9366 rp='Pathname where the site-specific html pages should be installed?'
9368 prefixvar=sitehtml1dir
9371 : determine where add-on library html pages go
9372 : There is no standard location, so try to copy the previously-selected
9373 : directory structure for the core html pages.
9374 case "$sitehtml3dir" in
9375 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9376 *) dflt=$sitehtml3dir ;;
9379 ''|' ') dflt=none ;;
9382 rp='Pathname where the site-specific library html pages should be installed?'
9384 prefixvar=sitehtml3dir
9387 : determine where add-on manual pages go
9388 case "$siteman1dir" in
9389 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9390 *) dflt=$siteman1dir ;;
9393 ''|' ') dflt=none ;;
9396 rp='Pathname where the site-specific manual pages should be installed?'
9398 prefixvar=siteman1dir
9401 : determine where add-on library man pages go
9402 case "$siteman3dir" in
9403 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9404 *) dflt=$siteman3dir ;;
9407 ''|' ') dflt=none ;;
9410 rp='Pathname where the site-specific library manual pages should be installed?'
9412 prefixvar=siteman3dir
9415 : determine where add-on public executable scripts go
9416 case "$sitescript" in
9417 '') dflt=$siteprefix/script
9418 $test -d $dflt || dflt=$sitebin ;;
9419 *) dflt="$sitescript" ;;
9422 rp='Pathname where add-on public executable scripts should be installed?'
9424 prefixvar=sitescript
9427 : see if backtrace exists
9428 set backtrace d_backtrace
9431 : add flags if using c backtrace
9432 case "$usecbacktrace" in
9433 "") usecbacktrace=$undef ;;
9435 case "$d_backtrace" in
9437 case " $ccflags " in
9438 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9439 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9443 echo "This system does not support backtrace" >&4
9444 usecbacktrace=$undef
9450 : Check if faststdio is requested and available
9451 case "$usefaststdio" in
9452 $define|true|[yY]*|'')
9453 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9463 Perl can be built to use 'fast stdio', which means using the stdio
9464 library but also directly manipulating the stdio buffers to enable
9465 faster I/O. Using stdio is better for backward compatibility (especially
9466 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9467 interface has been preferred instead of stdio.
9469 If this doesn't make any sense to you, just accept the default '$dflt'.
9471 rp='Use the "fast stdio" if available?'
9474 y|Y) val="$define" ;;
9481 : define an is-a-typedef? function
9482 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9484 "") inclist="sys/types.h";;
9486 eval "varval=\$$var";
9490 for inc in $inclist; do
9491 echo "#include <$inc>" >>temp.c;
9493 echo "#ifdef $type" >> temp.c;
9494 echo "printf(\"We have $type\");" >> temp.c;
9495 echo "#endif" >> temp.c;
9496 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9497 if $contains $type temp.E >/dev/null 2>&1; then
9503 *) eval "$var=\$varval";;
9506 : define an is-a-typedef? function that prompts if the type is not available.
9507 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9509 "") inclist="sys/types.h";;
9511 eval "varval=\$$var";
9515 for inc in $inclist; do
9516 echo "#include <$inc>" >>temp.c;
9518 echo "#ifdef $type" >> temp.c;
9519 echo "printf(\"We have $type\");" >> temp.c;
9520 echo "#endif" >> temp.c;
9521 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9523 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9524 if $contains $type temp.E >/dev/null 2>&1; then
9525 echo "$type found." >&4;
9528 echo "$type NOT found." >&4;
9534 *) eval "$var=\$varval";;
9537 : see what type lseek is declared as in the kernel
9538 rp="What is the type used for lseek's offset on this system?"
9539 set off_t lseektype long stdio.h sys/types.h
9543 echo "Checking to see how big your file offsets are..." >&4
9545 #include <sys/types.h>
9549 printf("%d\n", (int)sizeof($lseektype));
9554 if eval $compile_ok; then
9555 lseeksize=`$run ./try`
9556 echo "Your file offsets are $lseeksize bytes long."
9560 echo "(I can't seem to compile the test program. Guessing...)"
9561 rp="What is the size of your file offsets (in bytes)?"
9567 : see what type file positions are declared as in the library
9568 rp="What is the type for file position used by fsetpos()?"
9569 set fpos_t fpostype long stdio.h sys/types.h
9572 : Check size for Fpos_t
9575 *_t) zzz="$fpostype" ;;
9578 echo "Checking the size of $zzz..." >&4
9580 #include <sys/types.h>
9587 printf("%d\n", (int)sizeof($fpostype));
9592 if eval $compile_ok; then
9596 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9599 echo "Your $zzz is $fpossize bytes long."
9605 echo "(I can't compile the test program. Guessing...)" >&4
9606 rp="What is the size of your file positions (in bytes)?"
9611 : Check for large file support
9612 # Backward compatibility (uselfs is deprecated).
9614 "$define"|true|[yY]*)
9617 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9619 uselargefiles="$define"
9623 case "$lseeksize:$fpossize" in
9626 You can have files larger than 2 gigabytes.
9629 *) case "$uselargefiles" in
9630 "$undef"|false|[nN]*) dflt='n' ;;
9635 Perl can be built to understand large files (files larger than 2 gigabytes)
9636 on some systems. To do so, Configure can be run with -Duselargefiles.
9638 If this doesn't make any sense to you, just accept the default '$dflt'.
9640 rp='Try to understand large files, if available?'
9643 y|Y) val="$define" ;;
9650 : Look for a hint-file generated 'call-back-unit'. If the
9651 : user has specified that a large files perl is to be built,
9652 : we may need to set or change some other defaults.
9653 if $test -f uselargefiles.cbu; then
9654 echo "Your platform has some specific hints regarding large file builds, using them..."
9655 . ./uselargefiles.cbu
9657 case "$uselargefiles" in
9659 if $test -f uselargefiles.cbu; then
9661 echo "Rechecking to see how big your file offsets are..." >&4
9663 #include <sys/types.h>
9667 printf("%d\n", (int)sizeof($lseektype));
9672 if eval $compile_ok; then
9673 lseeksize=`$run ./try`
9674 $echo "Your file offsets are now $lseeksize bytes long."
9678 echo "(I can't seem to compile the test program. Guessing...)"
9679 rp="What is the size of your file offsets (in bytes)?"
9684 *_t) zzz="$fpostype" ;;
9687 $echo $n "Rechecking the size of $zzz...$c" >&4
9689 #include <sys/types.h>
9696 printf("%d\n", (int)sizeof($fpostype));
9701 if eval $compile_ok; then
9706 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9709 echo " $fpossize bytes." >&4
9715 echo "(I can't compile the test program. Guessing...)" >&4
9716 rp="What is the size of your file positions (in bytes)?"
9725 : Check if we want perlio
9728 : Set the vendorbin variables
9729 case "$vendorprefix" in
9730 '') d_vendorbin="$undef"
9734 *) d_vendorbin="$define"
9735 : determine where vendor-supplied executables go.
9736 case "$vendorbin" in
9737 '') dflt=$vendorprefix/bin ;;
9738 *) dflt="$vendorbin" ;;
9741 rp='Pathname for the vendor-supplied executables directory?'
9744 vendorbinexp="$ansexp"
9750 : Set the vendorhtml1dir variables
9751 case "$vendorprefix" in
9752 '') vendorhtml1dir=''
9753 vendorhtml1direxp=''
9755 *) : determine where vendor-supplied html pages go.
9756 : There is no standard location, so try to copy the previously-selected
9757 : directory structure for the core html pages.
9758 : XXX Better default suggestions would be welcome.
9759 case "$vendorhtml1dir" in
9760 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9761 *) dflt=$vendorhtml1dir ;;
9764 ''|' ') dflt=none ;;
9767 rp='Pathname for the vendor-supplied html pages?'
9769 vendorhtml1dir="$ans"
9770 vendorhtml1direxp="$ansexp"
9773 : Use ' ' for none so value is preserved next time through Configure
9774 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9775 prefixvar=vendorhtml1dir
9778 : Set the vendorhtml3dir variables
9779 case "$vendorprefix" in
9780 '') vendorhtml3dir=''
9781 vendorhtml3direxp=''
9783 *) : determine where vendor-supplied module html pages go.
9784 : There is no standard location, so try to copy the previously-selected
9785 : directory structure for the core html pages.
9786 : XXX Better default suggestions would be welcome.
9787 case "$vendorhtml3dir" in
9788 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9789 *) dflt=$vendorhtml3dir ;;
9792 ''|' ') dflt=none ;;
9795 rp='Pathname for the vendor-supplied html pages?'
9797 vendorhtml3dir="$ans"
9798 vendorhtml3direxp="$ansexp"
9801 : Use ' ' for none so value is preserved next time through Configure
9802 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9803 prefixvar=vendorhtml3dir
9806 : Set the vendorman1dir variables
9807 case "$vendorprefix" in
9808 '') vendorman1dir=''
9811 *) : determine where vendor-supplied manual pages go.
9812 case "$vendorman1dir" in
9813 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9814 *) dflt=$vendorman1dir ;;
9817 ''|' ') dflt=none ;;
9820 rp='Pathname for the vendor-supplied manual section 1 pages?'
9822 vendorman1dir="$ans"
9823 vendorman1direxp="$ansexp"
9826 : Use ' ' for none so value is preserved next time through Configure
9827 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9828 prefixvar=vendorman1dir
9831 : Set the vendorman3dir variables
9832 case "$vendorprefix" in
9833 '') vendorman3dir=''
9836 *) : determine where vendor-supplied module manual pages go.
9837 case "$vendorman3dir" in
9838 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9839 *) dflt=$vendorman3dir ;;
9842 ''|' ') dflt=none ;;
9845 rp='Pathname for the vendor-supplied manual section 3 pages?'
9847 vendorman3dir="$ans"
9848 vendorman3direxp="$ansexp"
9851 : Use ' ' for none so value is preserved next time through Configure
9852 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9853 prefixvar=vendorman3dir
9856 : Set the vendorscript variables
9857 case "$vendorprefix" in
9858 '') d_vendorscript="$undef"
9862 *) d_vendorscript="$define"
9863 : determine where vendor-supplied scripts go.
9864 case "$vendorscript" in
9865 '') dflt=$vendorprefix/script
9866 $test -d $dflt || dflt=$vendorbin ;;
9867 *) dflt="$vendorscript" ;;
9871 The installation process will create a directory for
9872 vendor-supplied scripts.
9876 rp='Pathname for the vendor-supplied scripts directory?'
9879 vendorscriptexp="$ansexp"
9882 prefixvar=vendorscript
9885 : script used to emit important warnings
9888 if test \$# -gt 0; then
9893 echo "*** WARNING:" >&4
9894 sed -e 's/^/*** /' <msg >&4
9896 cat msg >>config.msg
9897 echo " " >>config.msg
9903 : see which of string.h or strings.h is needed
9905 strings=`./findhdr string.h`
9906 if $test "$strings" && $test -r "$strings"; then
9907 echo "Using <string.h> instead of <strings.h>." >&4
9911 strings=`./findhdr strings.h`
9912 if $test "$strings" && $test -r "$strings"; then
9913 echo "Using <strings.h> instead of <string.h>." >&4
9915 ./warn "No string header found -- You'll surely have problems."
9921 "$undef") strings=`./findhdr strings.h`;;
9922 *) strings=`./findhdr string.h`;;
9925 : see if qgcvt exists
9929 : Check print/scan long double stuff
9932 if $test X"$d_longdbl" = X"$define"; then
9934 echo "Checking how to print long doubles..." >&4
9936 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9937 $cat >try.c <<'EOCP'
9938 #include <sys/types.h>
9942 printf("%.3f\n", d);
9946 if eval $compile; then
9950 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9951 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9952 echo "We will use %f."
9958 if $test X"$sPRIfldbl" = X; then
9959 $cat >try.c <<'EOCP'
9960 #include <sys/types.h>
9963 long double d = 123.456;
9964 printf("%.3Lf\n", d);
9968 if eval $compile; then
9972 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9973 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9974 echo "We will use %Lf."
9980 if $test X"$sPRIfldbl" = X; then
9981 $cat >try.c <<'EOCP'
9982 #include <sys/types.h>
9985 long double d = 123.456;
9986 printf("%.3llf\n", d);
9990 if eval $compile; then
9994 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9995 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9996 echo "We will use %llf."
10002 if $test X"$sPRIfldbl" = X; then
10003 $cat >try.c <<'EOCP'
10004 #include <sys/types.h>
10007 long double d = 123.456;
10008 printf("%.3lf\n", d);
10012 if eval $compile; then
10016 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10017 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10018 echo "We will use %lf."
10024 if $test X"$sPRIfldbl" = X; then
10025 echo "Cannot figure out how to print long doubles." >&4
10027 sSCNfldbl=$sPRIfldbl # expect consistency
10034 case "$sPRIfldbl" in
10035 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10036 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10037 d_SCNfldbl="$undef";
10039 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10040 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10041 d_SCNfldbl="$define";
10045 : Check how to convert floats to strings.
10047 if test "X$d_Gconvert" = X; then
10050 echo "Checking for an efficient way to convert floats to strings."
10052 case "$uselongdouble" in
10053 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10055 case "$d_longdbl" in
10056 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10058 case "$d_PRIgldbl" in
10059 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10062 #ifdef TRY_gconvert
10063 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10064 char *myname = "gconvert";
10067 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10068 char *myname = "gcvt";
10071 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10072 char *myname = "qgcvt";
10073 #define DOUBLETYPE long double
10076 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10077 #ifdef HAS_PRIgldbl
10078 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10080 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10083 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10085 char *myname = "sprintf";
10089 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10090 #define DOUBLETYPE long double
10092 #define DOUBLETYPE double
10098 #$i_stdlib I_STDLIB
10100 #include <stdlib.h>
10102 #$i_string I_STRING
10104 # include <string.h>
10106 # include <strings.h>
10109 int checkit(char *expect, char *got)
10111 if (strcmp(expect, got)) {
10112 printf("%s oddity: Expected %s, got %s\n",
10113 myname, expect, got);
10123 /* This must be 1st test on (which?) platform */
10124 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10125 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10126 checkit("0.1", buf);
10128 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10129 checkit("0.01", buf);
10131 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10132 checkit("0.001", buf);
10134 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10135 checkit("0.0001", buf);
10137 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10138 if (strlen(buf) > 5)
10139 checkit("9e-005", buf); /* for Microsoft ?? */
10141 checkit("9e-05", buf);
10143 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10146 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10147 checkit("1.1", buf);
10149 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10150 checkit("1.01", buf);
10152 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10153 checkit("1.001", buf);
10155 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10156 checkit("1.0001", buf);
10158 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10159 checkit("1.00001", buf);
10161 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10162 checkit("1.000001", buf);
10164 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10167 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10168 checkit("-1", buf);
10170 /* Some Linux gcvt's give 1.e+5 here. */
10171 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10172 checkit("100000", buf);
10174 /* Some Linux gcvt's give -1.e+5 here. */
10175 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10176 checkit("-100000", buf);
10178 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10179 checkit("123.456", buf);
10181 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10182 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10183 /* 34 should be enough to scare even long double
10184 * places into using the e notation. */
10185 if (strlen(buf) > 5)
10186 checkit("1e+034", buf); /* for Microsoft */
10188 checkit("1e+34", buf);
10190 /* For Perl, if you add additional tests here, also add them to
10191 * t/base/num.t for benefit of platforms not using Configure or
10192 * overriding d_Gconvert */
10197 : first add preferred functions to our list
10199 for xxx_convert in $gconvert_preference; do
10200 case $xxx_convert in
10201 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10202 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10205 : then add any others
10206 for xxx_convert in gconvert gcvt sprintf; do
10207 case "$xxx_list" in
10209 *) xxx_list="$xxx_list $xxx_convert" ;;
10213 case "$d_longdbl$uselongdouble" in
10215 : again, add preferred functions to our list first
10217 for xxx_convert in $gconvert_ld_preference; do
10218 case $xxx_convert in
10219 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10220 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10223 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10224 for xxx_convert in qgcvt sprintf $xxx_list; do
10225 case "$xxx_ld_list" in
10226 $xxx_convert*|*" $xxx_convert"*) ;;
10227 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10230 : if sprintf cannot do long doubles, move it to the end
10231 if test "$d_PRIgldbl" != "$define"; then
10232 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10234 : if no qgcvt, remove it
10235 if test "$d_qgcvt" != "$define"; then
10236 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10239 xxx_list="$xxx_ld_list"
10243 for xxx_convert in $xxx_list; do
10244 echo "Trying $xxx_convert..."
10245 $rm -f try try$_o core
10246 set try -DTRY_$xxx_convert
10247 if eval $compile; then
10248 echo "$xxx_convert() found." >&4
10249 if $run ./try; then
10250 echo "I'll use $xxx_convert to convert floats into a string." >&4
10253 echo "...But $xxx_convert didn't work as I expected."
10257 echo "$xxx_convert NOT found." >&4
10261 if test X$xxx_convert = X; then
10262 echo "*** WHOA THERE!!! ***" >&4
10263 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10264 xxx_convert=sprintf
10267 case "$xxx_convert" in
10268 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10269 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10270 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10271 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10272 "$define$define$define")
10273 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10274 "$define$define$undef")
10275 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10276 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10284 : see if _fwalk exists
10288 : Initialize h_fcntl
10291 : Initialize h_sysfile
10294 : access call always available on UNIX
10295 set access d_access
10298 : locate the flags for 'access()'
10299 case "$d_access" in
10302 $cat >access.c <<EOCP
10303 #include <sys/types.h>
10308 #include <sys/file.h>
10311 #include <unistd.h>
10313 #$i_stdlib I_STDLIB
10315 #include <stdlib.h>
10321 : check sys/file.h first, no particular reason here
10322 if $test `./findhdr sys/file.h` && \
10323 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10325 echo "<sys/file.h> defines the *_OK access constants." >&4
10326 elif $test `./findhdr fcntl.h` && \
10327 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10329 echo "<fcntl.h> defines the *_OK access constants." >&4
10330 elif $test `./findhdr unistd.h` && \
10331 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10332 echo "<unistd.h> defines the *_OK access constants." >&4
10334 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10340 : see if accessx exists
10341 set accessx d_accessx
10344 : see if acosh exists
10348 : see if aintl exists
10352 : see if alarm exists
10356 : see if 64bit time functions exists
10358 set ctime64 d_ctime64
10361 set localtime64 d_localtime64
10364 set gmtime64 d_gmtime64
10367 set mktime64 d_mktime64
10370 set difftime64 d_difftime64
10373 set asctime64 d_asctime64
10376 : see if POSIX threads are available
10377 set pthread.h i_pthread
10380 : define a function to check prototypes
10381 $cat > protochk <<EOSH
10384 optimize="$optimize"
10386 prototype="$prototype"
10389 usethreads=$usethreads
10390 i_pthread=$i_pthread
10391 pthread_h_first=$pthread_h_first
10394 $cat >> protochk <<'EOSH'
10399 while test $# -ge 2; do
10401 $define) echo "#include <$2>" >> try.c ;;
10402 literal) echo "$2" >> try.c ;;
10404 # Extra magic for the benefit of systems that need pthread.h
10405 # to be included early to correctly detect threadsafe functions.
10406 # Such functions must guarantee themselves, though, that the usethreads
10407 # and i_pthread have been defined, before calling protochk.
10408 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10409 echo "#include <pthread.h>" >> try.c
10414 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10415 cat >> try.c <<'EOCP'
10416 #ifdef CAN_PROTOTYPE
10417 #define _(args) args
10422 echo "$foo" >> try.c
10423 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10424 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10430 $eunicefix protochk
10432 : Define hasproto macro for Configure internal use
10433 hasproto='varname=$1; func=$2; shift; shift;
10434 while $test $# -ge 2; do
10436 $define) echo "#include <$2>";;
10440 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10441 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10442 echo "$func() prototype found.";
10445 echo "$func() prototype NOT found.";
10452 : see if sys/types.h has to be included
10453 set sys/types.h i_systypes
10456 : see if sys/select.h has to be included
10457 set sys/select.h i_sysselct
10460 : Define hasfield macro for Configure internal use
10461 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10462 while $test $# -ge 2; do
10464 $define) echo "#include <$2>";;
10468 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10470 if eval $compile; then
10479 : see if we should include time.h, sys/time.h, or both
10481 if test "X$timeincl" = X; then
10482 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10483 $echo $n "I'm now running the test program...$c"
10485 #include <sys/types.h>
10490 #ifdef SYSTIMEKERNEL
10493 #include <sys/time.h>
10496 #include <sys/select.h>
10498 #$i_stdlib I_STDLIB
10500 #include <stdlib.h>
10506 struct timeval bar;
10509 struct timezone tzp;
10511 if (foo.tm_sec == foo.tm_sec)
10514 if (bar.tv_sec == bar.tv_sec)
10521 for s_timezone in '-DS_TIMEZONE' ''; do
10523 for s_timeval in '-DS_TIMEVAL' ''; do
10524 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10525 for i_time in '' '-DI_TIME'; do
10526 for i_systime in '-DI_SYSTIME' ''; do
10529 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10530 if eval $compile; then
10531 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10535 $echo $n "Succeeded with $flags$c"
10547 *SYSTIMEKERNEL*) i_systimek="$define"
10548 timeincl=`./findhdr sys/time.h`
10549 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10550 *) i_systimek="$undef";;
10553 *I_TIME*) i_time="$define"
10554 timeincl=`./findhdr time.h`" $timeincl"
10555 echo "We'll include <time.h>." >&4;;
10556 *) i_time="$undef";;
10559 *I_SYSTIME*) i_systime="$define"
10560 timeincl=`./findhdr sys/time.h`" $timeincl"
10561 echo "We'll include <sys/time.h>." >&4;;
10562 *) i_systime="$undef";;
10566 : see if struct tm knows about tm_zone
10567 case "$i_systime$i_time" in
10570 echo "Checking to see if your struct tm has tm_zone field..." >&4
10571 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10579 case "$d_tm_tm_zone" in
10580 "$define") echo "Yes, it does." ;;
10581 *) echo "No, it doesn't." ;;
10583 : see if struct tm knows about tm_gmtoff
10584 case "$i_systime$i_time" in
10587 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10588 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10596 case "$d_tm_tm_gmtoff" in
10597 "$define") echo "Yes, it does." ;;
10598 *) echo "No, it doesn't." ;;
10601 : see if asctime_r exists
10602 set asctime_r d_asctime_r
10604 case "$d_asctime_r" in
10606 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10607 case "$d_asctime_r_proto:$usethreads" in
10608 ":define") d_asctime_r_proto=define
10609 set d_asctime_r_proto asctime_r $hdrs
10613 case "$d_asctime_r_proto" in
10615 case "$asctime_r_proto" in
10616 ''|0) try='char* asctime_r(const struct tm*, char*);'
10617 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10619 case "$asctime_r_proto" in
10620 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10621 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10623 case "$asctime_r_proto" in
10624 ''|0) try='int asctime_r(const struct tm*, char*);'
10625 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10627 case "$asctime_r_proto" in
10628 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10629 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10631 case "$asctime_r_proto" in
10632 ''|0) d_asctime_r=undef
10634 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10635 * ) case "$asctime_r_proto" in
10636 REENTRANT_PROTO*) ;;
10637 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10639 echo "Prototype: $try" ;;
10642 *) case "$usethreads" in
10643 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10650 *) asctime_r_proto=0
10654 : see if atolf exists
10658 : see if atoll exists
10662 : Look for GCC-style attribute format
10663 case "$d_attribute_format" in
10666 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10667 $cat >attrib.c <<'EOCP'
10669 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10671 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10672 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10673 echo "Your C compiler doesn't support __attribute__((format))."
10676 echo "Your C compiler supports __attribute__((format))."
10680 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10684 *) val="$d_attribute_format" ;;
10686 set d_attribute_format
10690 : Look for GCC-style attribute format with null format allowed
10691 case "$d_printf_format_null" in
10692 '') case "$d_attribute_format" in
10695 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10696 $cat >attrib.c <<EOCP
10698 #$i_stdlib I_STDLIB
10700 #include <stdlib.h>
10702 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10703 int null_printf (char* pat,...) { return (int)pat; }
10704 int main () { exit(null_printf(NULL)); }
10706 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10707 : run the executable in case it produces a run-time warning
10708 if $run ./attrib >>attrib.out 2>&1; then
10709 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10710 echo "Your C compiler doesn't allow __printf__ format to be null."
10713 echo "Your C compiler allows __printf__ format to be null."
10717 echo "Your C compiler executable failed with __printf__ format null."
10721 echo "Your C compiler fails with __printf__ format null."
10728 *) val="$d_printf_format_null" ;;
10730 set d_printf_format_null
10734 : Look for GCC-style attribute malloc
10735 case "$d_attribute_malloc" in
10738 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10739 $cat >attrib.c <<'EOCP'
10741 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10743 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10744 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10745 echo "Your C compiler doesn't support __attribute__((malloc))."
10748 echo "Your C compiler supports __attribute__((malloc))."
10752 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10756 *) val="$d_attribute_malloc" ;;
10758 set d_attribute_malloc
10762 : Look for GCC-style attribute nonnull
10763 case "$d_attribute_nonnull" in
10766 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10767 $cat >attrib.c <<'EOCP'
10769 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10771 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10772 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10773 echo "Your C compiler doesn't support __attribute__((nonnull))."
10776 echo "Your C compiler supports __attribute__((nonnull))."
10780 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10784 *) val="$d_attribute_nonnull" ;;
10786 set d_attribute_nonnull
10790 : Look for GCC-style attribute noreturn
10791 case "$d_attribute_noreturn" in
10794 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10795 $cat >attrib.c <<'EOCP'
10797 void fall_over_dead( void ) __attribute__((noreturn));
10799 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10800 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10801 echo "Your C compiler doesn't support __attribute__((noreturn))."
10804 echo "Your C compiler supports __attribute__((noreturn))."
10808 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10812 *) val="$d_attribute_noreturn" ;;
10814 set d_attribute_noreturn
10818 : Look for GCC-style attribute pure
10819 case "$d_attribute_pure" in
10822 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10823 $cat >attrib.c <<'EOCP'
10825 int square( int n ) __attribute__((pure));
10827 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10828 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10829 echo "Your C compiler doesn't support __attribute__((pure))."
10832 echo "Your C compiler supports __attribute__((pure))."
10836 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10840 *) val="$d_attribute_pure" ;;
10842 set d_attribute_pure
10846 : Look for GCC-style attribute unused
10847 case "$d_attribute_unused" in
10850 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10851 $cat >attrib.c <<'EOCP'
10853 int do_something( int dummy __attribute__((unused)), int n );
10855 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10856 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10857 echo "Your C compiler doesn't support __attribute__((unused))."
10860 echo "Your C compiler supports __attribute__((unused))."
10864 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10868 *) val="$d_attribute_unused" ;;
10870 set d_attribute_unused
10874 : Look for GCC-style attribute deprecated
10875 case "$d_attribute_deprecated" in
10878 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10879 $cat >attrib.c <<'EOCP'
10881 int I_am_deprecated(void) __attribute__((deprecated));
10883 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10884 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10885 echo "Your C compiler doesn't support __attribute__((deprecated))."
10888 echo "Your C compiler supports __attribute__((deprecated))."
10892 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10896 *) val="$d_attribute_deprecated" ;;
10898 set d_attribute_deprecated
10902 : Look for GCC-style attribute warn_unused_result
10903 case "$d_attribute_warn_unused_result" in
10906 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10907 $cat >attrib.c <<'EOCP'
10909 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10911 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10912 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10913 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10916 echo "Your C compiler supports __attribute__((warn_unused_result))."
10920 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10924 *) val="$d_attribute_warn_unused_result" ;;
10926 set d_attribute_warn_unused_result
10930 : see if bcmp exists
10934 : see if bcopy exists
10938 : see if getpgrp exists
10939 set getpgrp d_getpgrp
10942 case "$d_getpgrp" in
10945 echo "Checking to see which flavor of getpgrp is in use..."
10947 #$i_unistd I_UNISTD
10948 #include <sys/types.h>
10950 # include <unistd.h>
10952 #$i_stdlib I_STDLIB
10954 #include <stdlib.h>
10958 if (getuid() == 0) {
10959 printf("(I see you are running Configure as super-user...)\n");
10962 #ifdef TRY_BSD_PGRP
10963 if (getpgrp(1) == 0)
10972 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10973 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10975 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10976 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10979 echo "I can't seem to compile and run the test program."
10981 xxx="a USG one, i.e. you use getpgrp()."
10983 # SVR4 systems can appear rather BSD-ish.
10984 case "$i_unistd" in
10986 xxx="a BSD one, i.e. you use getpgrp(pid)."
10990 xxx="probably a USG one, i.e. you use getpgrp()."
10995 echo "Assuming your getpgrp is $xxx" >&4
11004 : see if setpgrp exists
11005 set setpgrp d_setpgrp
11008 case "$d_setpgrp" in
11011 echo "Checking to see which flavor of setpgrp is in use..."
11013 #$i_unistd I_UNISTD
11014 #include <sys/types.h>
11016 # include <unistd.h>
11018 #$i_stdlib I_STDLIB
11020 #include <stdlib.h>
11024 if (getuid() == 0) {
11025 printf("(I see you are running Configure as super-user...)\n");
11028 #ifdef TRY_BSD_PGRP
11029 if (-1 == setpgrp(1, 1))
11032 if (setpgrp() != -1)
11038 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11039 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11041 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11042 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11045 echo "(I can't seem to compile and run the test program.)"
11047 xxx="a USG one, i.e. you use setpgrp()."
11049 # SVR4 systems can appear rather BSD-ish.
11050 case "$i_unistd" in
11052 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11056 xxx="probably a USG one, i.e. you use setpgrp()."
11061 echo "Assuming your setpgrp is $xxx" >&4
11070 : Look for GCC-style __builtin_choose_expr
11071 case "$d_builtin_choose_expr" in
11074 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11075 $cat >try.c <<'EOCP'
11076 #include <assert.h>
11077 #include <stdlib.h>
11080 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11083 assert( SYRINX(1) == 2112 );
11084 assert( SYRINX(1) != 5150 );
11085 assert( SYRINX(0) == 5150 );
11086 assert( SYRINX(0) != 2112 );
11087 puts( "All good!" );
11093 if eval $compile && $run ./try; then
11094 echo "Your C compiler supports __builtin_choose_expr."
11097 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11101 *) val="$d_builtin_choose_expr" ;;
11104 set d_builtin_choose_expr
11108 : Look for GCC-style __builtin_expect
11109 case "$d_builtin_expect" in
11112 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11113 $cat >try.c <<'EOCP'
11116 if ( __builtin_expect(n, 0) ) n = 1;
11117 /* Remember shell exit code truth is 0, C truth is non-zero */
11122 if eval $compile && $run ./try; then
11123 echo "Your C compiler supports __builtin_expect."
11126 echo "Your C compiler doesn't seem to understand __builtin_expect."
11130 *) val="$d_builtin_expect" ;;
11133 set d_builtin_expect
11137 : see if bzero exists
11141 : see if stdarg is available
11143 if $test `./findhdr stdarg.h`; then
11144 echo "<stdarg.h> found." >&4
11147 echo "<stdarg.h> NOT found." >&4
11151 : see if varargs is available
11153 if $test `./findhdr varargs.h`; then
11154 echo "<varargs.h> found." >&4
11156 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11159 : set up the varargs testing programs
11160 $cat > varargs.c <<EOP
11162 #include <stdarg.h>
11165 #include <varargs.h>
11169 int f(char *p, ...)
11183 p = va_arg(ap, char *);
11189 $cat > varargs <<EOP
11191 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11200 : now check which varargs header should be included
11206 if `./varargs I_STDARG`; then
11208 elif `./varargs I_VARARGS`; then
11213 if `./varargs I_VARARGS`; then
11221 echo "*** WHOA THERE!!! ***" >&4
11222 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11223 case "$knowitall" in
11225 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11229 echo "I could not find the definition for va_dcl... You have problems..." >&4
11230 val="$undef"; set i_stdarg; eval $setvar
11231 val="$undef"; set i_varargs; eval $setvar
11236 case "$i_varhdr" in
11238 val="$define"; set i_stdarg; eval $setvar
11239 val="$undef"; set i_varargs; eval $setvar
11242 val="$undef"; set i_stdarg; eval $setvar
11243 val="$define"; set i_varargs; eval $setvar
11246 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11250 : see if the Compiler supports C99 variadic macros
11251 case "$i_stdarg$i_stdlib" in
11253 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11256 #include <stdarg.h>
11258 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11262 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11268 if eval $compile && $run ./try 2>&1 >/dev/null; then
11269 case "`$run ./try`" in
11271 echo "You have C99 variadic macros." >&4
11272 d_c99_variadic_macros="$define"
11275 echo "You don't have functional C99 variadic macros." >&4
11276 d_c99_variadic_macros="$undef"
11280 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11281 d_c99_variadic_macros="$undef"
11286 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11287 d_c99_variadic_macros="$undef"
11291 : see if signal is declared as pointer to function returning int or void
11293 xxx=`./findhdr signal.h`
11294 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11295 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11296 echo "You have int (*signal())() instead of void." >&4
11298 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11299 echo "You have void (*signal())()." >&4
11301 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11302 echo "You have int (*signal())() instead of void." >&4
11304 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11305 echo "You have void (*signal())()." >&4
11308 case "$d_voidsig" in
11310 echo "I can't determine whether signal handler returns void or int..." >&4
11312 rp="What type does your signal handler return?"
11315 v*) val="$define";;
11319 echo "As you already told me, signal handler returns void." >&4
11322 *) echo "As you already told me, signal handler returns int." >&4
11329 case "$d_voidsig" in
11330 "$define") signal_t="void";;
11331 *) signal_t="int";;
11335 : check for ability to cast large floats to 32-bit ints.
11337 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11338 if $test "$intsize" -ge 4; then
11345 #$i_stdlib I_STDLIB
11347 #include <stdlib.h>
11349 #include <sys/types.h>
11350 #include <signal.h>
11351 $signal_t blech(int s) { exit(3); }
11358 signal(SIGFPE, blech);
11360 /* Don't let compiler optimize the test away. Store the number
11361 in a writable string for gcc to pass to sscanf under HP-UX.
11363 sprintf(str, "2147483647");
11364 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11368 /* x86 processors will probably give 0x8000 0000, which is a
11369 sign change. We don't want that. We want to mimic SPARC
11370 behavior here, which is to preserve the sign and give
11373 if (i32 != ($xxx) f)
11379 if eval $compile_ok; then
11383 echo "(I can't seem to compile the test program--assuming it can't)"
11388 echo "Yup, it can."
11391 echo "Nope, it can't."
11398 : check for ability to cast negative floats to unsigned
11400 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11403 #$i_stdlib I_STDLIB
11405 #include <stdlib.h>
11407 #include <sys/types.h>
11408 #include <signal.h>
11409 $signal_t blech(int s) { exit(7); }
11410 $signal_t blech_in_list(int s) { exit(4); }
11411 unsigned long dummy_long(unsigned long p) { return p; }
11412 unsigned int dummy_int(unsigned int p) { return p; }
11413 unsigned short dummy_short(unsigned short p) { return p; }
11417 unsigned long along;
11419 unsigned short ashort;
11423 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11424 a direct f = -123. assignment. gcc-2.8.0 reportedly
11425 optimized the whole file away
11427 /* Store the number in a writable string for gcc to pass to
11428 sscanf under HP-UX.
11430 sprintf(str, "-123");
11431 sscanf(str, "%lf", &f); /* f = -123.; */
11433 signal(SIGFPE, blech);
11434 along = (unsigned long)f;
11435 aint = (unsigned int)f;
11436 ashort = (unsigned short)f;
11437 if (along != (unsigned long)-123)
11439 if (aint != (unsigned int)-123)
11441 if (ashort != (unsigned short)-123)
11443 sprintf(str, "1073741824.");
11444 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11447 along = (unsigned long)f;
11448 if (along != 0x80000000)
11452 along = (unsigned long)f;
11453 if (along != 0x7fffffff)
11457 along = (unsigned long)f;
11458 if (along != 0x80000001)
11462 signal(SIGFPE, blech_in_list);
11463 sprintf(str, "123.");
11464 sscanf(str, "%lf", &f); /* f = 123.; */
11465 along = dummy_long((unsigned long)f);
11466 aint = dummy_int((unsigned int)f);
11467 ashort = dummy_short((unsigned short)f);
11468 if (along != (unsigned long)123)
11470 if (aint != (unsigned int)123)
11472 if (ashort != (unsigned short)123)
11479 if eval $compile_ok; then
11483 echo "(I can't seem to compile the test program--assuming it can't)"
11486 case "$castflags" in
11488 echo "Yup, it can."
11491 echo "Nope, it can't."
11498 : see if vprintf exists
11500 if set vprintf val -f d_vprintf; eval $csym; $val; then
11501 echo 'vprintf() found.' >&4
11504 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11505 #$i_varargs I_VARARGS
11507 #$i_stdlib I_STDLIB
11508 #$i_unistd I_UNISTD
11511 # include <stdarg.h>
11512 #else /* I_VARARGS */
11513 # include <varargs.h>
11517 # include <unistd.h>
11521 # include <stdlib.h>
11524 #include <stdio.h> /* vsprintf prototype */
11527 void xxx(int n, ...)
11532 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11534 int main() { xxx(1, "foo"); }
11536 #else /* I_VARARGS */
11544 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11546 int main() { xxx("foo"); }
11552 if eval $compile_ok; then
11553 if $run ./try; then
11554 echo "Your vsprintf() returns (int)." >&4
11557 echo "Your vsprintf() returns (char*)." >&4
11561 echo 'I am unable to compile the vsprintf() test program.' >&4
11562 # We shouldn't get here. If we do, assume the standard signature,
11563 # not the old BSD one.
11564 echo 'Guessing that vsprintf() returns (int).' >&4
11568 echo 'vprintf() NOT found.' >&4
11579 : see if chown exists
11583 : see if chroot exists
11584 set chroot d_chroot
11587 : see if chsize exists
11588 set chsize d_chsize
11591 : see if class exists
11595 : see if clearenv exists
11596 set clearenv d_clearenv
11599 : Define hasstruct macro for Configure internal use
11600 hasstruct='varname=$1; struct=$2; shift; shift;
11601 while $test $# -ge 2; do
11603 $define) echo "#include <$2>";;
11607 echo "int main () { struct $struct foo; }" >> try.c;
11609 if eval $compile; then
11618 : see whether socket exists
11622 $echo $n "Hmm... $c" >&4
11623 if set socket val -f d_socket; eval $csym; $val; then
11624 echo "Looks like you have Berkeley networking support." >&4
11626 if set setsockopt val -f; eval $csym; $val; then
11629 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11630 d_oldsock="$define"
11633 if $contains socklib libc.list >/dev/null 2>&1; then
11634 echo "Looks like you have Berkeley networking support." >&4
11636 : we will have to assume that it supports the 4.2 BSD interface
11639 echo "You don't have Berkeley networking in libc$_a..." >&4
11640 if test "X$d_socket" = "X$define"; then
11641 echo "...but you seem to believe that you have sockets." >&4
11643 for net in net socket
11645 if test -f $sysroot/usr/lib/lib$net$_a; then
11646 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11647 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11648 if $contains socket libc.list >/dev/null 2>&1; then
11653 echo "...but the Wollongong group seems to have hacked it in." >&4
11654 sockethdr="-I$sysroot/usr/netinclude"
11657 echo "Found Berkeley sockets interface in lib$net." >&4
11658 if $contains setsockopt libc.list >/dev/null 2>&1; then
11661 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11662 d_oldsock="$define"
11668 if test "X$d_socket" != "X$define"; then
11669 echo "or anywhere else I see." >&4
11677 : see if socketpair exists
11678 set socketpair d_sockpair
11683 echo "Checking the availability sa_len in the sock struct ..." >&4
11685 #include <sys/types.h>
11686 #include <sys/socket.h>
11688 struct sockaddr sa;
11689 return (sa.sa_len);
11693 set try; if eval $compile; then
11696 set d_sockaddr_sa_len; eval $setvar
11700 echo "Checking the availability struct sockaddr_in6 ..." >&4
11702 #include <sys/types.h>
11703 #include <sys/socket.h>
11704 #include <netinet/in.h>
11706 struct sockaddr_in6 sin6;
11707 return (sin6.sin6_family);
11711 set try; if eval $compile; then
11714 set d_sockaddr_in6; eval $setvar
11718 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11720 #include <sys/types.h>
11721 #include <sys/socket.h>
11722 #include <netinet/in.h>
11724 struct sockaddr_in6 sin6;
11725 return (sin6.sin6_scope_id);
11729 set try; if eval $compile; then
11732 set d_sin6_scope_id; eval $setvar
11736 echo "Checking the availability struct ip_mreq ..." >&4
11738 #include <sys/types.h>
11739 #include <sys/socket.h>
11740 #include <netinet/in.h>
11742 struct ip_mreq mreq;
11743 return (mreq.imr_multiaddr.s_addr);
11747 set try; if eval $compile; then
11750 set d_ip_mreq; eval $setvar
11754 echo "Checking the availability struct ip_mreq_source ..." >&4
11756 #include <sys/types.h>
11757 #include <sys/socket.h>
11758 #include <netinet/in.h>
11760 struct ip_mreq_source mreq;
11761 return (mreq.imr_multiaddr.s_addr);
11765 set try; if eval $compile; then
11768 set d_ip_mreq_source; eval $setvar
11772 echo "Checking the availability struct ipv6_mreq ..." >&4
11774 #include <sys/types.h>
11775 #include <sys/socket.h>
11776 #include <netinet/in.h>
11778 struct ipv6_mreq mreq;
11779 return (mreq.ipv6mr_interface);
11783 set try; if eval $compile; then
11786 set d_ipv6_mreq; eval $setvar
11790 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11792 #include <sys/types.h>
11793 #include <sys/socket.h>
11794 #include <netinet/in.h>
11796 struct ipv6_mreq_source mreq;
11797 return (mreq.imr_multiaddr.s_addr);
11801 set try; if eval $compile; then
11804 set d_ipv6_mreq_source; eval $setvar
11808 echo "Checking the availability of certain socket constants..." >&4
11809 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11810 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11812 #include <sys/types.h>
11813 #include <sys/socket.h>
11819 set try; if eval $compile; then
11822 set d_${enum}; eval $setvar
11826 : see if this is a sys/uio.h system
11827 set sys/uio.h i_sysuio
11830 : Check for cmsghdr support
11832 echo "Checking to see if your system supports struct cmsghdr..." >&4
11833 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11835 case "$d_cmsghdr_s" in
11836 "$define") echo "Yes, it does." ;;
11837 *) echo "No, it doesn't." ;;
11841 : check for const keyword
11843 echo 'Checking to see if your C compiler knows about "const"...' >&4
11844 $cat >const.c <<'EOCP'
11845 typedef struct spug { int drokk; } spug;
11849 const spug y = { 0 };
11852 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11854 echo "Yup, it does."
11857 echo "Nope, it doesn't."
11862 : see if copysignl exists
11863 set copysignl d_copysignl
11866 : see if crypt exists
11871 $define) cryptlib='' ;;
11872 *) if set crypt val -f d_crypt; eval $csym; $val; then
11873 echo 'crypt() found.' >&4
11877 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11878 if $test -z "$cryptlib"; then
11879 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11883 if $test -z "$cryptlib"; then
11884 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11888 if $test -z "$cryptlib"; then
11889 cryptlib=`./loc libcrypt$_a "" $libpth`
11893 if $test -z "$cryptlib"; then
11894 echo 'crypt() NOT found.' >&4
11905 : see if this is a crypt.h system
11906 set crypt.h i_crypt
11909 : see if crypt_r exists
11910 set crypt_r d_crypt_r
11912 case "$d_crypt_r" in
11914 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11915 case "$d_crypt_r_proto:$usethreads" in
11916 ":define") d_crypt_r_proto=define
11917 set d_crypt_r_proto crypt_r $hdrs
11921 case "$d_crypt_r_proto" in
11923 case "$crypt_r_proto" in
11924 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11925 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11927 case "$crypt_r_proto" in
11928 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11929 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11931 case "$crypt_r_proto" in
11932 ''|0) d_crypt_r=undef
11934 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11935 * ) case "$crypt_r_proto" in
11936 REENTRANT_PROTO*) ;;
11937 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11939 echo "Prototype: $try" ;;
11942 *) case "$usethreads" in
11943 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11954 : get csh whereabouts
11956 'csh') val="$undef" ;;
11957 *) val="$define" ;;
11961 : Respect a hint or command line value for full_csh.
11962 case "$full_csh" in
11963 '') full_csh=$csh ;;
11966 : see if ctermid exists
11967 set ctermid d_ctermid
11970 : see if ctermid_r exists
11971 set ctermid_r d_ctermid_r
11973 case "$d_ctermid_r" in
11975 hdrs="$i_systypes sys/types.h define stdio.h "
11976 case "$d_ctermid_r_proto:$usethreads" in
11977 ":define") d_ctermid_r_proto=define
11978 set d_ctermid_r_proto ctermid_r $hdrs
11982 case "$d_ctermid_r_proto" in
11984 case "$ctermid_r_proto" in
11985 ''|0) try='char* ctermid_r(char*);'
11986 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11988 case "$ctermid_r_proto" in
11989 ''|0) d_ctermid_r=undef
11991 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11992 * ) case "$ctermid_r_proto" in
11993 REENTRANT_PROTO*) ;;
11994 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11996 echo "Prototype: $try" ;;
11999 *) case "$usethreads" in
12000 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12007 *) ctermid_r_proto=0
12011 : see if ctime_r exists
12012 set ctime_r d_ctime_r
12014 case "$d_ctime_r" in
12016 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12017 case "$d_ctime_r_proto:$usethreads" in
12018 ":define") d_ctime_r_proto=define
12019 set d_ctime_r_proto ctime_r $hdrs
12023 case "$d_ctime_r_proto" in
12025 case "$ctime_r_proto" in
12026 ''|0) try='char* ctime_r(const time_t*, char*);'
12027 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12029 case "$ctime_r_proto" in
12030 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12031 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12033 case "$ctime_r_proto" in
12034 ''|0) try='int ctime_r(const time_t*, char*);'
12035 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12037 case "$ctime_r_proto" in
12038 ''|0) try='int ctime_r(const time_t*, char*, int);'
12039 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12041 case "$ctime_r_proto" in
12042 ''|0) d_ctime_r=undef
12044 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12045 * ) case "$ctime_r_proto" in
12046 REENTRANT_PROTO*) ;;
12047 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12049 echo "Prototype: $try" ;;
12052 *) case "$usethreads" in
12053 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12064 : see if cuserid exists
12065 set cuserid d_cuserid
12068 : see if this is a limits.h system
12069 set limits.h i_limits
12072 : See if number of significant digits in a double precision number is known
12074 $cat >dbl_dig.c <<EOM
12075 #$i_limits I_LIMITS
12078 #include <limits.h>
12084 printf("Contains DBL_DIG");
12087 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12088 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12089 echo "DBL_DIG found." >&4
12092 echo "DBL_DIG NOT found." >&4
12099 : see if dbm.h is available
12100 : see if dbmclose exists
12101 set dbmclose d_dbmclose
12104 case "$d_dbmclose" in
12114 *) set rpcsvc/dbm.h i_rpcsvcdbm
12119 *) echo "We won't be including <dbm.h>"
12129 : see if prototype for dbminit is available
12131 set d_dbminitproto dbminit $i_dbm dbm.h
12134 : see if difftime exists
12135 set difftime d_difftime
12138 : see if this is a dirent system
12140 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12142 echo "<dirent.h> found." >&4
12145 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12146 echo "<sys/dir.h> found." >&4
12149 xinc=`./findhdr sys/ndir.h`
12151 echo "<dirent.h> NOT found." >&4
12156 : Look for type of directory structure.
12158 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12160 case "$direntrytype" in
12162 case "$i_dirent" in
12163 $define) guess1='struct dirent' ;;
12164 *) guess1='struct direct' ;;
12167 *) guess1="$direntrytype"
12172 'struct dirent') guess2='struct direct' ;;
12173 *) guess2='struct dirent' ;;
12176 if $contains "$guess1" try.c >/dev/null 2>&1; then
12177 direntrytype="$guess1"
12178 echo "Your directory entries are $direntrytype." >&4
12179 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12180 direntrytype="$guess2"
12181 echo "Your directory entries seem to be $direntrytype." >&4
12183 echo "I don't recognize your system's directory entries." >&4
12184 rp="What type is used for directory entries on this system?"
12187 direntrytype="$ans"
12191 : see if the directory entry stores field length
12193 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12194 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12195 echo "Good, your directory entry keeps length information in d_namlen." >&4
12198 echo "Your directory entry does not know about the d_namlen field." >&4
12205 : Look for DIR.dd_fd
12206 case "$i_dirent" in
12208 echo "Checking to see if DIR has a dd_fd member variable" >&4
12210 #$i_stdlib I_STDLIB
12212 #include <stdlib.h>
12214 #include <dirent.h>
12224 if eval $compile; then
12225 echo "Yes, it does."
12228 echo "No, it does not."
12233 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12241 : see if this is an sysdir system
12242 set sys/dir.h i_sysdir
12245 : see if this is an sysndir system
12246 set sys/ndir.h i_sysndir
12251 $cat >dirfd.c <<EOM
12253 #$i_stdlib I_STDLIB
12255 #include <stdlib.h>
12257 #$i_dirent I_DIRENT /**/
12258 #$i_sysdir I_SYS_DIR /**/
12259 #$i_sysndir I_SYS_NDIR /**/
12260 #$i_systypes I_SYS_TYPES /**/
12261 #if defined(I_SYS_TYPES)
12262 #include <sys/types.h>
12264 #if defined(I_DIRENT)
12265 #include <dirent.h>
12268 #include <sys/ndir.h>
12272 #include <ndir.h> /* may be wrong in the future */
12274 #include <sys/dir.h>
12280 DIR *dirp = opendir(".");
12281 if (dirfd(dirp) >= 0)
12289 if eval $compile; then
12293 $define) echo "dirfd() found." >&4 ;;
12294 *) echo "dirfd() NOT found." >&4 ;;
12300 : see if dladdr exists
12301 set dladdr d_dladdr
12304 : see if dlerror exists
12307 set dlerror d_dlerror
12311 : see if dlfcn is available
12312 set dlfcn.h i_dlfcn
12315 : Check what extension to use for shared libs
12320 On a few systems, the dynamically loaded modules that perl generates and uses
12321 will need a different extension than shared libs. The default will probably
12327 *) dflt="$dlext" ;;
12329 rp='What is the extension of dynamically loaded modules'
12338 : Check if dlsym need a leading underscore
12344 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12345 $cat >dyna.c <<'EOM'
12352 #$i_stdlib I_STDLIB
12354 #include <stdlib.h>
12358 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12360 #include <sys/types.h>
12365 extern int fred() ;
12374 int mode = RTLD_LAZY ;
12376 handle = dlopen("./dyna.$dlext", mode) ;
12377 if (handle == NULL) {
12382 symbol = dlsym(handle, "fred") ;
12383 if (symbol == NULL) {
12384 /* try putting a leading underscore */
12385 symbol = dlsym(handle, "_fred") ;
12386 if (symbol == NULL) {
12399 : Call the object file tmp-dyna.o in case dlext=o.
12400 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12401 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12402 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12403 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12406 1) echo "Test program failed using dlopen." >&4
12407 echo "Perhaps you should not use dynamic loading." >&4;;
12408 2) echo "Test program failed using dlsym." >&4
12409 echo "Perhaps you should not use dynamic loading." >&4;;
12410 3) echo "dlsym needs a leading underscore" >&4
12412 4) echo "dlsym doesn't need a leading underscore." >&4;;
12415 echo "I can't compile and run the test program." >&4
12416 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12421 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12426 : see if drand48_r exists
12427 set drand48_r d_drand48_r
12429 case "$d_drand48_r" in
12431 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12432 case "$d_drand48_r_proto:$usethreads" in
12433 ":define") d_drand48_r_proto=define
12434 set d_drand48_r_proto drand48_r $hdrs
12438 case "$d_drand48_r_proto" in
12440 case "$drand48_r_proto" in
12441 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12442 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12444 case "$drand48_r_proto" in
12445 ''|0) d_drand48_r=undef
12447 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12448 * ) case "$drand48_r_proto" in
12449 REENTRANT_PROTO*) ;;
12450 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12452 echo "Prototype: $try" ;;
12455 *) case "$usethreads" in
12456 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12463 *) drand48_r_proto=0
12467 : see if prototype for drand48 is available
12469 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12472 : see if dup2 exists
12476 : see if eaccess exists
12477 set eaccess d_eaccess
12480 : see if endgrent exists
12481 set endgrent d_endgrent
12484 : see if this is an grp system
12490 xxx=`./findhdr grp.h`
12491 $cppstdin $cppflags $cppminus < $xxx >$$.h
12493 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12505 set d_grpasswd; eval $setvar
12509 : see if endgrent_r exists
12510 set endgrent_r d_endgrent_r
12512 case "$d_endgrent_r" in
12514 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12515 case "$d_endgrent_r_proto:$usethreads" in
12516 ":define") d_endgrent_r_proto=define
12517 set d_endgrent_r_proto endgrent_r $hdrs
12521 case "$d_endgrent_r_proto" in
12523 case "$endgrent_r_proto" in
12524 ''|0) try='int endgrent_r(FILE**);'
12525 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12527 case "$endgrent_r_proto" in
12528 ''|0) try='void endgrent_r(FILE**);'
12529 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12531 case "$endgrent_r_proto" in
12532 ''|0) d_endgrent_r=undef
12534 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12535 * ) case "$endgrent_r_proto" in
12536 REENTRANT_PROTO*) ;;
12537 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12539 echo "Prototype: $try" ;;
12542 *) case "$usethreads" in
12543 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12550 *) endgrent_r_proto=0
12554 : see if endhostent exists
12555 set endhostent d_endhent
12558 : see if this is a netdb.h system
12559 set netdb.h i_netdb
12562 : see if endhostent_r exists
12563 set endhostent_r d_endhostent_r
12565 case "$d_endhostent_r" in
12567 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12568 case "$d_endhostent_r_proto:$usethreads" in
12569 ":define") d_endhostent_r_proto=define
12570 set d_endhostent_r_proto endhostent_r $hdrs
12574 case "$d_endhostent_r_proto" in
12576 case "$endhostent_r_proto" in
12577 ''|0) try='int endhostent_r(struct hostent_data*);'
12578 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12580 case "$endhostent_r_proto" in
12581 ''|0) try='void endhostent_r(struct hostent_data*);'
12582 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12584 case "$endhostent_r_proto" in
12585 ''|0) d_endhostent_r=undef
12586 endhostent_r_proto=0
12587 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12588 * ) case "$endhostent_r_proto" in
12589 REENTRANT_PROTO*) ;;
12590 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12592 echo "Prototype: $try" ;;
12595 *) case "$usethreads" in
12596 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12598 d_endhostent_r=undef
12599 endhostent_r_proto=0
12603 *) endhostent_r_proto=0
12607 : see if endnetent exists
12608 set endnetent d_endnent
12611 : see if endnetent_r exists
12612 set endnetent_r d_endnetent_r
12614 case "$d_endnetent_r" in
12616 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12617 case "$d_endnetent_r_proto:$usethreads" in
12618 ":define") d_endnetent_r_proto=define
12619 set d_endnetent_r_proto endnetent_r $hdrs
12623 case "$d_endnetent_r_proto" in
12625 case "$endnetent_r_proto" in
12626 ''|0) try='int endnetent_r(struct netent_data*);'
12627 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12629 case "$endnetent_r_proto" in
12630 ''|0) try='void endnetent_r(struct netent_data*);'
12631 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12633 case "$endnetent_r_proto" in
12634 ''|0) d_endnetent_r=undef
12635 endnetent_r_proto=0
12636 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12637 * ) case "$endnetent_r_proto" in
12638 REENTRANT_PROTO*) ;;
12639 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12641 echo "Prototype: $try" ;;
12644 *) case "$usethreads" in
12645 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12647 d_endnetent_r=undef
12648 endnetent_r_proto=0
12652 *) endnetent_r_proto=0
12656 : see if endprotoent exists
12657 set endprotoent d_endpent
12660 : see if endprotoent_r exists
12661 set endprotoent_r d_endprotoent_r
12663 case "$d_endprotoent_r" in
12665 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12666 case "$d_endprotoent_r_proto:$usethreads" in
12667 ":define") d_endprotoent_r_proto=define
12668 set d_endprotoent_r_proto endprotoent_r $hdrs
12672 case "$d_endprotoent_r_proto" in
12674 case "$endprotoent_r_proto" in
12675 ''|0) try='int endprotoent_r(struct protoent_data*);'
12676 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12678 case "$endprotoent_r_proto" in
12679 ''|0) try='void endprotoent_r(struct protoent_data*);'
12680 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12682 case "$endprotoent_r_proto" in
12683 ''|0) d_endprotoent_r=undef
12684 endprotoent_r_proto=0
12685 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12686 * ) case "$endprotoent_r_proto" in
12687 REENTRANT_PROTO*) ;;
12688 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12690 echo "Prototype: $try" ;;
12693 *) case "$usethreads" in
12694 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12696 d_endprotoent_r=undef
12697 endprotoent_r_proto=0
12701 *) endprotoent_r_proto=0
12705 : see if endpwent exists
12706 set endpwent d_endpwent
12709 : see if this is a pwd.h system
12715 xxx=`./findhdr pwd.h`
12716 $cppstdin $cppflags $cppminus < $xxx >$$.h
12718 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12726 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12734 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12742 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12750 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12758 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12766 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12774 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12786 set d_pwquota; eval $setvar
12787 set d_pwage; eval $setvar
12788 set d_pwchange; eval $setvar
12789 set d_pwclass; eval $setvar
12790 set d_pwexpire; eval $setvar
12791 set d_pwcomment; eval $setvar
12792 set d_pwgecos; eval $setvar
12793 set d_pwpasswd; eval $setvar
12797 : see if endpwent_r exists
12798 set endpwent_r d_endpwent_r
12800 case "$d_endpwent_r" in
12802 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12803 case "$d_endpwent_r_proto:$usethreads" in
12804 ":define") d_endpwent_r_proto=define
12805 set d_endpwent_r_proto endpwent_r $hdrs
12809 case "$d_endpwent_r_proto" in
12811 case "$endpwent_r_proto" in
12812 ''|0) try='int endpwent_r(FILE**);'
12813 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12815 case "$endpwent_r_proto" in
12816 ''|0) try='void endpwent_r(FILE**);'
12817 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12819 case "$endpwent_r_proto" in
12820 ''|0) d_endpwent_r=undef
12822 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12823 * ) case "$endpwent_r_proto" in
12824 REENTRANT_PROTO*) ;;
12825 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12827 echo "Prototype: $try" ;;
12830 *) case "$usethreads" in
12831 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12838 *) endpwent_r_proto=0
12842 : see if endservent exists
12843 set endservent d_endsent
12846 : see if endservent_r exists
12847 set endservent_r d_endservent_r
12849 case "$d_endservent_r" in
12851 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12852 case "$d_endservent_r_proto:$usethreads" in
12853 ":define") d_endservent_r_proto=define
12854 set d_endservent_r_proto endservent_r $hdrs
12858 case "$d_endservent_r_proto" in
12860 case "$endservent_r_proto" in
12861 ''|0) try='int endservent_r(struct servent_data*);'
12862 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12864 case "$endservent_r_proto" in
12865 ''|0) try='void endservent_r(struct servent_data*);'
12866 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12868 case "$endservent_r_proto" in
12869 ''|0) d_endservent_r=undef
12870 endservent_r_proto=0
12871 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12872 * ) case "$endservent_r_proto" in
12873 REENTRANT_PROTO*) ;;
12874 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12876 echo "Prototype: $try" ;;
12879 *) case "$usethreads" in
12880 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12882 d_endservent_r=undef
12883 endservent_r_proto=0
12887 *) endservent_r_proto=0
12891 : Locate the flags for 'open()'
12894 #include <sys/types.h>
12899 #include <sys/file.h>
12901 #$i_stdlib I_STDLIB
12903 #include <stdlib.h>
12914 : check sys/file.h first to get FREAD on Sun
12915 if $test `./findhdr sys/file.h` && \
12916 set try -DI_SYS_FILE && eval $compile; then
12918 echo "<sys/file.h> defines the O_* constants..." >&4
12919 if $run ./try; then
12920 echo "and you have the 3 argument form of open()." >&4
12923 echo "but not the 3 argument form of open(). Oh, well." >&4
12926 elif $test `./findhdr fcntl.h` && \
12927 set try -DI_FCNTL && eval $compile; then
12929 echo "<fcntl.h> defines the O_* constants..." >&4
12930 if $run ./try; then
12931 echo "and you have the 3 argument form of open()." >&4
12934 echo "but not the 3 argument form of open(). Oh, well." >&4
12939 echo "I can't find the O_* constant definitions! You got problems." >&4
12945 : see if this is a sys/file.h system
12950 : do we need to include sys/file.h ?
12954 if $h_sysfile; then
12956 echo "We'll be including <sys/file.h>." >&4
12959 echo "We won't be including <sys/file.h>." >&4
12969 : see if fcntl.h is there
12974 : see if we can include fcntl.h
12980 echo "We'll be including <fcntl.h>." >&4
12983 if $h_sysfile; then
12984 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12986 echo "We won't be including <fcntl.h>." >&4
12998 : see if fork exists
13002 : see if pipe exists
13006 : check for non-blocking I/O stuff
13007 case "$h_sysfile" in
13008 true) echo "#include <sys/file.h>" > head.c;;
13011 true) echo "#include <fcntl.h>" > head.c;;
13012 *) echo "#include <sys/fcntl.h>" > head.c;;
13017 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13018 case "$o_nonblock" in
13020 $cat head.c > try.c
13021 $cat >>try.c <<EOCP
13023 #$i_stdlib I_STDLIB
13025 #include <stdlib.h>
13033 printf("O_NONBLOCK\n");
13037 printf("O_NDELAY\n");
13041 printf("FNDELAY\n");
13048 if eval $compile_ok; then
13049 o_nonblock=`$run ./try`
13050 case "$o_nonblock" in
13051 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13052 *) echo "Seems like we can use $o_nonblock.";;
13055 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13058 *) echo "Using $hint value $o_nonblock.";;
13063 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13066 case "$d_fork:$d_pipe" in
13068 $cat head.c > try.c
13069 $cat >>try.c <<EOCP
13071 #include <sys/types.h>
13072 #include <signal.h>
13074 #$i_stdlib I_STDLIB
13076 #include <stdlib.h>
13082 #define MY_O_NONBLOCK $o_nonblock
13083 #ifndef errno /* XXX need better Configure test */
13086 #$i_unistd I_UNISTD
13088 #include <unistd.h>
13090 #$i_string I_STRING
13092 #include <string.h>
13094 #include <strings.h>
13096 $signal_t blech(int x) { exit(3); }
13098 $cat >> try.c <<'EOCP'
13107 ret = pipe(pd); /* Down: child -> parent */
13110 ret = pipe(pu); /* Up: parent -> child */
13114 close(pd[1]); /* Parent reads from pd[0] */
13115 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13117 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13122 signal(SIGALRM, blech);
13124 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13126 sprintf(string, "%d\n", ret);
13127 ret = write(2, string, strlen(string));
13128 if (ret != strlen(string))
13132 if (errno == EAGAIN) {
13133 printf("EAGAIN\n");
13138 if (errno == EWOULDBLOCK)
13139 printf("EWOULDBLOCK\n");
13142 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13145 sleep(2); /* Give it time to close our pipe */
13147 ret = read(pd[0], buf, 1); /* Should read EOF */
13149 sprintf(string, "%d\n", ret);
13150 ret = write(4, string, strlen(string));
13151 if (ret != strlen(string))
13156 close(pd[0]); /* We write to pd[1] */
13157 close(pu[1]); /* We read from pu[0] */
13158 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13161 close(pd[1]); /* Pipe pd is now fully closed! */
13162 exit(0); /* Bye bye, thank you for playing! */
13166 if eval $compile_ok; then
13167 echo "$startsh" >mtry
13168 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13170 $run ./mtry >/dev/null 2>&1
13172 0) eagain=`$cat try.out`;;
13173 1) echo "Could not perform non-blocking setting!";;
13174 2) echo "I did a successful read() for something that was not there!";;
13175 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13176 4) echo "Could not find F_SETFL!";;
13177 *) echo "Something terribly wrong happened during testing.";;
13179 rd_nodata=`$cat try.ret`
13180 echo "A read() system call with no data present returns $rd_nodata."
13181 case "$rd_nodata" in
13184 echo "(That's peculiar, fixing that to be -1.)"
13190 echo "Forcing errno EAGAIN on read() with no data available."
13194 echo "Your read() sets errno to $eagain when no data is available."
13197 status=`$cat try.err`
13199 0) echo "And it correctly returns 0 to signal EOF.";;
13200 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13201 *) echo "However, your read() returns '$status' on EOF??";;
13204 if test "$status" = "$rd_nodata"; then
13205 echo "WARNING: you can't distinguish between EOF and no data!"
13209 echo "I can't compile the test program--assuming errno EAGAIN will do."
13213 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13222 echo "Using $hint value $eagain."
13223 echo "Your read() returns $rd_nodata when no data is present."
13224 case "$d_eofnblk" in
13225 "$define") echo "And you can see EOF because read() returns 0.";;
13226 "$undef") echo "But you can't see EOF status from read() returned value.";;
13228 echo "(Assuming you can't see EOF status from read anyway.)"
13234 $rm_try head.c mtry
13236 : see if _ptr and _cnt from stdio act std
13239 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13240 echo "(Looks like you have stdio.h from BSD.)"
13241 case "$stdio_ptr" in
13242 '') stdio_ptr='((fp)->_p)'
13245 *) ptr_lval=$d_stdio_ptr_lval;;
13247 case "$stdio_cnt" in
13248 '') stdio_cnt='((fp)->_r)'
13251 *) cnt_lval=$d_stdio_cnt_lval;;
13253 case "$stdio_base" in
13254 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13256 case "$stdio_bufsiz" in
13257 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13259 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13260 echo "(Looks like you have stdio.h from Linux.)"
13261 case "$stdio_ptr" in
13262 '') stdio_ptr='((fp)->_IO_read_ptr)'
13265 *) ptr_lval=$d_stdio_ptr_lval;;
13267 case "$stdio_cnt" in
13268 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13271 *) cnt_lval=$d_stdio_cnt_lval;;
13273 case "$stdio_base" in
13274 '') stdio_base='((fp)->_IO_read_base)';;
13276 case "$stdio_bufsiz" in
13277 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13280 case "$stdio_ptr" in
13281 '') stdio_ptr='((fp)->_ptr)'
13284 *) ptr_lval=$d_stdio_ptr_lval;;
13286 case "$stdio_cnt" in
13287 '') stdio_cnt='((fp)->_cnt)'
13290 *) cnt_lval=$d_stdio_cnt_lval;;
13292 case "$stdio_base" in
13293 '') stdio_base='((fp)->_base)';;
13295 case "$stdio_bufsiz" in
13296 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13300 : test whether _ptr and _cnt really work
13301 echo "Checking how std your stdio is..." >&4
13304 #$i_stdlib I_STDLIB
13306 #include <stdlib.h>
13308 #define FILE_ptr(fp) $stdio_ptr
13309 #define FILE_cnt(fp) $stdio_cnt
13311 FILE *fp = fopen("try.c", "r");
13314 18 <= FILE_cnt(fp) &&
13315 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13323 if eval $compile && $to try.c; then
13324 if $run ./try; then
13325 echo "Your stdio acts pretty std."
13328 echo "Your stdio isn't very std."
13331 echo "Your stdio doesn't appear very std."
13335 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13336 # direct buffer manipulation no longer works. The Configure tests
13337 # should be changed to correctly detect this, but until then,
13338 # the following check should at least let perl compile and run.
13339 # (This quick fix should be updated before 5.8.1.)
13340 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13341 # A. Dougherty, June 3, 2002.
13342 case "$d_gnulibc" in
13344 case "$gnulibc_version" in
13348 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13357 : Can _ptr be used as an lvalue?
13358 case "$d_stdstdio$ptr_lval" in
13359 $define$define) val=$define ;;
13362 set d_stdio_ptr_lval
13365 : Can _cnt be used as an lvalue?
13366 case "$d_stdstdio$cnt_lval" in
13367 $define$define) val=$define ;;
13370 set d_stdio_cnt_lval
13374 : test whether setting _ptr sets _cnt as a side effect
13375 d_stdio_ptr_lval_sets_cnt="$undef"
13376 d_stdio_ptr_lval_nochange_cnt="$undef"
13377 case "$d_stdio_ptr_lval$d_stdstdio" in
13379 echo "Checking to see what happens if we set the stdio ptr..." >&4
13382 /* Can we scream? */
13383 /* Eat dust sed :-) */
13384 /* In the buffer space, no one can hear you scream. */
13385 #$i_stdlib I_STDLIB
13387 #include <stdlib.h>
13389 #define FILE_ptr(fp) $stdio_ptr
13390 #define FILE_cnt(fp) $stdio_cnt
13391 #include <sys/types.h>
13393 FILE *fp = fopen("try.c", "r");
13398 puts("Fail even to read");
13401 c = getc(fp); /* Read away the first # */
13403 puts("Fail even to read");
13407 18 <= FILE_cnt(fp) &&
13408 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13410 puts("Fail even to read");
13413 ptr = (char*) FILE_ptr(fp);
13414 cnt = (size_t)FILE_cnt(fp);
13416 FILE_ptr(fp) += 42;
13418 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13419 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13422 if (FILE_cnt(fp) <= 20) {
13423 printf ("Fail (<20 chars to test)");
13426 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13427 puts("Fail compare");
13430 if (cnt == FILE_cnt(fp)) {
13431 puts("Pass_unchanged");
13434 if (FILE_cnt(fp) == (cnt - 42)) {
13435 puts("Pass_changed");
13438 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13444 if eval $compile && $to try.c; then
13445 case `$run ./try` in
13447 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13448 d_stdio_ptr_lval_sets_cnt="$define" ;;
13450 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13451 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13453 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13455 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13458 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13464 : see if _base is also standard
13466 case "$d_stdstdio" in
13470 #$i_stdlib I_STDLIB
13472 #include <stdlib.h>
13474 #define FILE_base(fp) $stdio_base
13475 #define FILE_bufsiz(fp) $stdio_bufsiz
13477 FILE *fp = fopen("try.c", "r");
13480 19 <= FILE_bufsiz(fp) &&
13481 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13488 if eval $compile && $to try.c; then
13489 if $run ./try; then
13490 echo "And its _base field acts std."
13493 echo "But its _base field isn't std."
13496 echo "However, it seems to be lacking the _base field."
13504 : see if fast_stdio exists
13506 case "$d_stdstdio:$d_stdio_ptr_lval" in
13508 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13510 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13521 : see if fchdir exists
13522 set fchdir d_fchdir
13525 : see if fchmod exists
13526 set fchmod d_fchmod
13529 : see if fchown exists
13530 set fchown d_fchown
13533 : see if this is an fcntl system
13537 : See if fcntl-based locking works.
13540 #$i_stdlib I_STDLIB
13542 #include <stdlib.h>
13544 #include <unistd.h>
13546 #include <signal.h>
13547 $signal_t blech(int x) { exit(3); }
13549 #if defined(F_SETLK) && defined(F_SETLKW)
13550 struct flock flock;
13552 fd = open("try.c", O_RDONLY);
13553 flock.l_type = F_RDLCK;
13554 flock.l_whence = SEEK_SET;
13555 flock.l_start = flock.l_len = 0;
13556 signal(SIGALRM, blech);
13558 retval = fcntl(fd, F_SETLK, &flock);
13560 (retval < 0 ? exit(2) : exit(0));
13566 echo "Checking if fcntl-based file locking works... "
13570 if eval $compile_ok; then
13571 if $run ./try; then
13572 echo "Yes, it seems to work."
13575 echo "Nope, it didn't work."
13580 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13581 *** This is (almost) impossible.
13582 *** If your NFS lock daemons are not feeling well, something like
13583 *** this may happen, please investigate. Cannot continue, aborting.
13591 echo "I'm unable to compile the test program, so I'll assume not."
13596 echo "Nope, since you don't even have fcntl()."
13599 set d_fcntl_can_lock
13603 : check for fd_set items
13606 Checking to see how well your C compiler handles fd_set and friends ...
13609 #$i_stdlib I_STDLIB
13611 #include <stdlib.h>
13613 #$i_systime I_SYS_TIME
13614 #$i_sysselct I_SYS_SELECT
13615 #$d_socket HAS_SOCKET
13616 #include <sys/types.h>
13618 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13621 #include <sys/time.h>
13623 #ifdef I_SYS_SELECT
13624 #include <sys/select.h>
13633 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13641 if eval $compile; then
13642 d_fds_bits="$define"
13644 echo "Well, your system knows about the normal fd_set typedef..." >&4
13645 if $run ./try; then
13646 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13647 d_fd_macros="$define"
13650 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13652 d_fd_macros="$undef"
13656 Hmm, your compiler has some difficulty with fd_set. Checking further...
13659 if eval $compile; then
13660 d_fds_bits="$undef"
13662 echo "Well, your system has some sort of fd_set available..." >&4
13663 if $run ./try; then
13664 echo "and you have the normal fd_set macros." >&4
13665 d_fd_macros="$define"
13668 but not the normal fd_set macros! Gross! More work for me...
13670 d_fd_macros="$undef"
13673 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13675 d_fds_bits="$undef"
13676 d_fd_macros="$undef"
13681 : see if fegetround exists
13682 set fegetround d_fegetround
13685 : see if fgetpos exists
13686 set fgetpos d_fgetpos
13689 : see if finite exists
13690 set finite d_finite
13693 : see if finitel exists
13694 set finitel d_finitel
13697 : see if flock exists
13701 : see if prototype for flock is available
13703 set d_flockproto flock $i_sysfile sys/file.h
13706 : see if fp_class exists
13707 set fp_class d_fp_class
13710 : see if this is a math.h system
13714 : check for fpclassify
13715 echo "Checking to see if you have fpclassify..." >&4
13721 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13724 if eval $compile; then
13726 echo "You have fpclassify."
13729 echo "You do not have fpclassify."
13735 : see if fp_classify exists
13736 set fp_classify d_fp_classify
13739 : see if fp_classl exists
13740 set fp_classl d_fp_classl
13743 : see if pathconf exists
13744 set pathconf d_pathconf
13747 : see if fpathconf exists
13748 set fpathconf d_fpathconf
13751 : see if fpclass exists
13752 set fpclass d_fpclass
13755 : see if fpclassl exists
13756 set fpclassl d_fpclassl
13759 : see if fpgetround exists
13760 set fpgetround d_fpgetround
13763 : check for fpos64_t
13765 echo "Checking to see if you have fpos64_t..." >&4
13768 int main() { fpos64_t x = 7; }
13771 if eval $compile; then
13773 echo "You have fpos64_t."
13776 echo "You do not have fpos64_t."
13777 case "$fpossize" in
13778 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13785 : see if frexpl exists
13786 set frexpl d_frexpl
13789 : see if this is a sys/param system
13790 set sys/param.h i_sysparam
13793 : see if this is a sys/mount.h system
13794 set sys/mount.h i_sysmount
13797 : Check for fs_data_s
13799 echo "Checking to see if your system supports struct fs_data..." >&4
13800 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13802 case "$d_fs_data_s" in
13803 "$define") echo "Yes, it does." ;;
13804 *) echo "No, it doesn't." ;;
13807 : see if fseeko exists
13808 set fseeko d_fseeko
13810 case "$longsize" in
13811 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13814 : see if fsetpos exists
13815 set fsetpos d_fsetpos
13818 : see if fstatfs exists
13819 set fstatfs d_fstatfs
13822 : see if statvfs exists
13823 set statvfs d_statvfs
13826 : see if fstatvfs exists
13827 set fstatvfs d_fstatvfs
13831 : see if fsync exists
13835 : see if ftello exists
13836 set ftello d_ftello
13838 case "$longsize" in
13839 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13842 : check for a working futimes
13845 echo "Checking if you have a working futimes()" >&4
13848 #include <sys/time.h>
13855 fd = open ("try.c", O_RDWR);
13856 if (-1 == fd) exit (1);
13857 rv = futimes (fd, NULL);
13858 exit (rv == -1 ? errno : 0);
13862 if eval $compile; then
13866 0) echo "Yes, you have" >&4
13867 d_futimes="$define"
13869 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13873 echo "No, it does not (probably harmless)" >&4
13877 : see if ndbm.h is available
13880 : Compatibility location for RedHat 7.1
13881 set gdbm/ndbm.h i_gdbmndbm
13883 : Compatibility location for Debian 4.0
13884 set gdbm-ndbm.h i_gdbm_ndbm
13888 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13889 : see if dbm_open exists
13890 set dbm_open d_dbm_open
13892 case "$d_dbm_open" in
13895 i_gdbmndbm="$undef"
13896 i_gdbm_ndbm="$undef"
13897 echo "We won't be including <ndbm.h>"
13907 ndbm_hdr_protochk='name=$1; hdr=$2;
13908 eval "ihdr=\$""i_$name";
13910 if $test "$ihdr" = "$define"; then
13911 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13912 case "$d_cplusplus" in
13913 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13914 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13917 $define) $echo "Your <$hdr> seems to have prototypes";;
13918 *) $echo "Your <$hdr> does not seem to have prototypes";;
13921 set "d_${name}_h_uses_prototypes";
13925 eval $ndbm_hdr_protochk
13926 set gdbmndbm gdbm/ndbm.h
13927 eval $ndbm_hdr_protochk
13928 set gdbm_ndbm gdbm-ndbm.h
13929 eval $ndbm_hdr_protochk
13931 : see if getaddrinfo exists
13932 set getaddrinfo d_getaddrinfo
13935 : see if getcwd exists
13936 set getcwd d_getcwd
13939 : see if getespwnam exists
13940 set getespwnam d_getespwnam
13943 : see if getfsstat exists
13944 set getfsstat d_getfsstat
13947 : see if getgrent exists
13948 set getgrent d_getgrent
13951 : see if getgrent_r exists
13952 set getgrent_r d_getgrent_r
13954 case "$d_getgrent_r" in
13956 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13957 case "$d_getgrent_r_proto:$usethreads" in
13958 ":define") d_getgrent_r_proto=define
13959 set d_getgrent_r_proto getgrent_r $hdrs
13963 case "$d_getgrent_r_proto" in
13965 case "$getgrent_r_proto" in
13966 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13967 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13969 case "$getgrent_r_proto" in
13970 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13971 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13973 case "$getgrent_r_proto" in
13974 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13975 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13977 case "$getgrent_r_proto" in
13978 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13979 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13981 case "$getgrent_r_proto" in
13982 ''|0) try='int getgrent_r(struct group*, char*, int);'
13983 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13985 case "$getgrent_r_proto" in
13986 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13987 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13989 case "$getgrent_r_proto" in
13990 ''|0) d_getgrent_r=undef
13992 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13993 * ) case "$getgrent_r_proto" in
13994 REENTRANT_PROTO*) ;;
13995 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13997 echo "Prototype: $try" ;;
14000 *) case "$usethreads" in
14001 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14008 *) getgrent_r_proto=0
14012 : see if getgrgid_r exists
14013 set getgrgid_r d_getgrgid_r
14015 case "$d_getgrgid_r" in
14017 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14018 case "$d_getgrgid_r_proto:$usethreads" in
14019 ":define") d_getgrgid_r_proto=define
14020 set d_getgrgid_r_proto getgrgid_r $hdrs
14024 case "$d_getgrgid_r_proto" in
14026 case "$getgrgid_r_proto" in
14027 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14028 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14030 case "$getgrgid_r_proto" in
14031 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14032 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14034 case "$getgrgid_r_proto" in
14035 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14036 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14038 case "$getgrgid_r_proto" in
14039 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14040 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14042 case "$getgrgid_r_proto" in
14043 ''|0) d_getgrgid_r=undef
14045 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14046 * ) case "$getgrgid_r_proto" in
14047 REENTRANT_PROTO*) ;;
14048 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14050 echo "Prototype: $try" ;;
14053 *) case "$usethreads" in
14054 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14061 *) getgrgid_r_proto=0
14065 : see if getgrnam_r exists
14066 set getgrnam_r d_getgrnam_r
14068 case "$d_getgrnam_r" in
14070 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14071 case "$d_getgrnam_r_proto:$usethreads" in
14072 ":define") d_getgrnam_r_proto=define
14073 set d_getgrnam_r_proto getgrnam_r $hdrs
14077 case "$d_getgrnam_r_proto" in
14079 case "$getgrnam_r_proto" in
14080 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14081 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14083 case "$getgrnam_r_proto" in
14084 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14085 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14087 case "$getgrnam_r_proto" in
14088 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14089 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14091 case "$getgrnam_r_proto" in
14092 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14093 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14095 case "$getgrnam_r_proto" in
14096 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14097 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14099 case "$getgrnam_r_proto" in
14100 ''|0) d_getgrnam_r=undef
14102 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14103 * ) case "$getgrnam_r_proto" in
14104 REENTRANT_PROTO*) ;;
14105 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14107 echo "Prototype: $try" ;;
14110 *) case "$usethreads" in
14111 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14118 *) getgrnam_r_proto=0
14122 : see if gethostbyaddr exists
14123 set gethostbyaddr d_gethbyaddr
14126 : see if gethostbyname exists
14127 set gethostbyname d_gethbyname
14130 : see if gethostent exists
14131 set gethostent d_gethent
14134 : see how we will look up host name
14137 if set gethostname val -f d_gethname; eval $csym; $val; then
14138 echo 'gethostname() found.' >&4
14139 d_gethname="$define"
14142 if set uname val -f d_uname; eval $csym; $val; then
14145 uname() was found, but you're running xenix, and older versions of xenix
14146 have a broken uname(). If you don't really know whether your xenix is old
14147 enough to have a broken system call, use the default answer.
14152 "$define") dflt=n;;
14154 rp='Is your uname() broken?'
14157 n*) d_uname="$define"; call=uname;;
14160 echo 'uname() found.' >&4
14167 case "$d_gethname" in
14168 '') d_gethname="$undef";;
14171 '') d_uname="$undef";;
14173 case "$d_uname$d_gethname" in
14178 Every now and then someone has a $call() that lies about the hostname
14179 but can't be fixed for political or economic reasons. If you wish, I can
14180 pretend $call() isn't there and maybe compute hostname at run-time
14181 thanks to the '$phostname' command.
14184 rp="Shall I ignore $call() from now on?"
14187 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14190 case "$phostname" in
14191 '') aphostname='';;
14192 *) case "$aphostname" in
14194 *) set X $phostname
14198 file=`./loc $file $file $pth`
14199 aphostname=`echo $file $*`
14204 case "$d_uname$d_gethname" in
14207 case "$phostname" in
14209 echo "There will be no way for $package to get your hostname." >&4;;
14211 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14215 case "$d_phostname" in
14216 '') d_phostname="$undef";;
14219 : see if gethostbyaddr_r exists
14220 set gethostbyaddr_r d_gethostbyaddr_r
14222 case "$d_gethostbyaddr_r" in
14224 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14225 case "$d_gethostbyaddr_r_proto:$usethreads" in
14226 ":define") d_gethostbyaddr_r_proto=define
14227 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14231 case "$d_gethostbyaddr_r_proto" in
14233 case "$gethostbyaddr_r_proto" in
14234 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14235 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14237 case "$gethostbyaddr_r_proto" in
14238 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14239 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14241 case "$gethostbyaddr_r_proto" in
14242 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14243 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14245 case "$gethostbyaddr_r_proto" in
14246 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14247 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14249 case "$gethostbyaddr_r_proto" in
14250 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14251 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14253 case "$gethostbyaddr_r_proto" in
14254 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14255 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14257 case "$gethostbyaddr_r_proto" in
14258 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14259 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14261 case "$gethostbyaddr_r_proto" in
14262 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14263 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14265 case "$gethostbyaddr_r_proto" in
14266 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14267 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14269 case "$gethostbyaddr_r_proto" in
14270 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14271 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14273 case "$gethostbyaddr_r_proto" in
14274 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14275 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14277 case "$gethostbyaddr_r_proto" in
14278 ''|0) d_gethostbyaddr_r=undef
14279 gethostbyaddr_r_proto=0
14280 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14281 * ) case "$gethostbyaddr_r_proto" in
14282 REENTRANT_PROTO*) ;;
14283 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14285 echo "Prototype: $try" ;;
14288 *) case "$usethreads" in
14289 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14291 d_gethostbyaddr_r=undef
14292 gethostbyaddr_r_proto=0
14296 *) gethostbyaddr_r_proto=0
14300 : see if gethostbyname_r exists
14301 set gethostbyname_r d_gethostbyname_r
14303 case "$d_gethostbyname_r" in
14305 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14306 case "$d_gethostbyname_r_proto:$usethreads" in
14307 ":define") d_gethostbyname_r_proto=define
14308 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14312 case "$d_gethostbyname_r_proto" in
14314 case "$gethostbyname_r_proto" in
14315 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14316 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14318 case "$gethostbyname_r_proto" in
14319 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14320 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14322 case "$gethostbyname_r_proto" in
14323 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14324 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14326 case "$gethostbyname_r_proto" in
14327 ''|0) d_gethostbyname_r=undef
14328 gethostbyname_r_proto=0
14329 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14330 * ) case "$gethostbyname_r_proto" in
14331 REENTRANT_PROTO*) ;;
14332 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14334 echo "Prototype: $try" ;;
14337 *) case "$usethreads" in
14338 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14340 d_gethostbyname_r=undef
14341 gethostbyname_r_proto=0
14345 *) gethostbyname_r_proto=0
14349 : see if gethostent_r exists
14350 set gethostent_r d_gethostent_r
14352 case "$d_gethostent_r" in
14354 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14355 case "$d_gethostent_r_proto:$usethreads" in
14356 ":define") d_gethostent_r_proto=define
14357 set d_gethostent_r_proto gethostent_r $hdrs
14361 case "$d_gethostent_r_proto" in
14363 case "$gethostent_r_proto" in
14364 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14365 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14367 case "$gethostent_r_proto" in
14368 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14369 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14371 case "$gethostent_r_proto" in
14372 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14373 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14375 case "$gethostent_r_proto" in
14376 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14377 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14379 case "$gethostent_r_proto" in
14380 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14381 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14383 case "$gethostent_r_proto" in
14384 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14385 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14387 case "$gethostent_r_proto" in
14388 ''|0) d_gethostent_r=undef
14389 gethostent_r_proto=0
14390 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14391 * ) case "$gethostent_r_proto" in
14392 REENTRANT_PROTO*) ;;
14393 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14395 echo "Prototype: $try" ;;
14398 *) case "$usethreads" in
14399 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14401 d_gethostent_r=undef
14402 gethostent_r_proto=0
14406 *) gethostent_r_proto=0
14410 : see if prototypes for various gethostxxx netdb.h functions are available
14412 set d_gethostprotos gethostent $i_netdb netdb.h
14415 : see if getitimer exists
14416 set getitimer d_getitimer
14419 : see if getlogin exists
14420 set getlogin d_getlogin
14423 : see if getlogin_r exists
14424 set getlogin_r d_getlogin_r
14426 case "$d_getlogin_r" in
14428 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14429 case "$d_getlogin_r_proto:$usethreads" in
14430 ":define") d_getlogin_r_proto=define
14431 set d_getlogin_r_proto getlogin_r $hdrs
14435 case "$d_getlogin_r_proto" in
14437 case "$getlogin_r_proto" in
14438 ''|0) try='int getlogin_r(char*, size_t);'
14439 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14441 case "$getlogin_r_proto" in
14442 ''|0) try='int getlogin_r(char*, int);'
14443 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14445 case "$getlogin_r_proto" in
14446 ''|0) try='char* getlogin_r(char*, size_t);'
14447 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14449 case "$getlogin_r_proto" in
14450 ''|0) try='char* getlogin_r(char*, int);'
14451 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14453 case "$getlogin_r_proto" in
14454 ''|0) d_getlogin_r=undef
14456 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14457 * ) case "$getlogin_r_proto" in
14458 REENTRANT_PROTO*) ;;
14459 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14461 echo "Prototype: $try" ;;
14464 *) case "$usethreads" in
14465 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14472 *) getlogin_r_proto=0
14476 : see if getmnt exists
14477 set getmnt d_getmnt
14480 : see if getmntent exists
14481 set getmntent d_getmntent
14484 : see if getnameinfo exists
14485 set getnameinfo d_getnameinfo
14488 : see if getnetbyaddr exists
14489 set getnetbyaddr d_getnbyaddr
14492 : see if getnetbyname exists
14493 set getnetbyname d_getnbyname
14496 : see if getnetent exists
14497 set getnetent d_getnent
14500 : see if getnetbyaddr_r exists
14501 set getnetbyaddr_r d_getnetbyaddr_r
14503 case "$d_getnetbyaddr_r" in
14505 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14506 case "$d_getnetbyaddr_r_proto:$usethreads" in
14507 ":define") d_getnetbyaddr_r_proto=define
14508 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14512 case "$d_getnetbyaddr_r_proto" in
14514 case "$getnetbyaddr_r_proto" in
14515 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14516 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14518 case "$getnetbyaddr_r_proto" in
14519 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14520 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14522 case "$getnetbyaddr_r_proto" in
14523 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14524 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14526 case "$getnetbyaddr_r_proto" in
14527 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14528 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14530 case "$getnetbyaddr_r_proto" in
14531 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14532 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14534 case "$getnetbyaddr_r_proto" in
14535 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14536 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14538 case "$getnetbyaddr_r_proto" in
14539 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14540 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14542 case "$getnetbyaddr_r_proto" in
14543 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14544 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14546 case "$getnetbyaddr_r_proto" in
14547 ''|0) d_getnetbyaddr_r=undef
14548 getnetbyaddr_r_proto=0
14549 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14550 * ) case "$getnetbyaddr_r_proto" in
14551 REENTRANT_PROTO*) ;;
14552 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14554 echo "Prototype: $try" ;;
14557 *) case "$usethreads" in
14558 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14560 d_getnetbyaddr_r=undef
14561 getnetbyaddr_r_proto=0
14565 *) getnetbyaddr_r_proto=0
14569 : see if getnetbyname_r exists
14570 set getnetbyname_r d_getnetbyname_r
14572 case "$d_getnetbyname_r" in
14574 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14575 case "$d_getnetbyname_r_proto:$usethreads" in
14576 ":define") d_getnetbyname_r_proto=define
14577 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14581 case "$d_getnetbyname_r_proto" in
14583 case "$getnetbyname_r_proto" in
14584 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14585 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14587 case "$getnetbyname_r_proto" in
14588 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14589 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14591 case "$getnetbyname_r_proto" in
14592 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14593 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14595 case "$getnetbyname_r_proto" in
14596 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14597 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14599 case "$getnetbyname_r_proto" in
14600 ''|0) d_getnetbyname_r=undef
14601 getnetbyname_r_proto=0
14602 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14603 * ) case "$getnetbyname_r_proto" in
14604 REENTRANT_PROTO*) ;;
14605 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14607 echo "Prototype: $try" ;;
14610 *) case "$usethreads" in
14611 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14613 d_getnetbyname_r=undef
14614 getnetbyname_r_proto=0
14618 *) getnetbyname_r_proto=0
14622 : see if getnetent_r exists
14623 set getnetent_r d_getnetent_r
14625 case "$d_getnetent_r" in
14627 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14628 case "$d_getnetent_r_proto:$usethreads" in
14629 ":define") d_getnetent_r_proto=define
14630 set d_getnetent_r_proto getnetent_r $hdrs
14634 case "$d_getnetent_r_proto" in
14636 case "$getnetent_r_proto" in
14637 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14638 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14640 case "$getnetent_r_proto" in
14641 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14642 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14644 case "$getnetent_r_proto" in
14645 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14646 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14648 case "$getnetent_r_proto" in
14649 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14650 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14652 case "$getnetent_r_proto" in
14653 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14654 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14656 case "$getnetent_r_proto" in
14657 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14658 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14660 case "$getnetent_r_proto" in
14661 ''|0) d_getnetent_r=undef
14662 getnetent_r_proto=0
14663 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14664 * ) case "$getnetent_r_proto" in
14665 REENTRANT_PROTO*) ;;
14666 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14668 echo "Prototype: $try" ;;
14671 *) case "$usethreads" in
14672 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14674 d_getnetent_r=undef
14675 getnetent_r_proto=0
14679 *) getnetent_r_proto=0
14683 : see if prototypes for various getnetxxx netdb.h functions are available
14685 set d_getnetprotos getnetent $i_netdb netdb.h
14688 : see if getpagesize exists
14689 set getpagesize d_getpagsz
14692 : Optional checks for getprotobyname and getprotobynumber
14694 : see if getprotobyname exists
14695 set getprotobyname d_getpbyname
14698 : see if getprotobynumber exists
14699 set getprotobynumber d_getpbynumber
14702 : see if getprotoent exists
14703 set getprotoent d_getpent
14706 : see if getpgid exists
14707 set getpgid d_getpgid
14710 : see if getpgrp2 exists
14711 set getpgrp2 d_getpgrp2
14714 : see if getppid exists
14715 set getppid d_getppid
14718 : see if getpriority exists
14719 set getpriority d_getprior
14722 : see if getprotobyname_r exists
14723 set getprotobyname_r d_getprotobyname_r
14725 case "$d_getprotobyname_r" in
14727 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14728 case "$d_getprotobyname_r_proto:$usethreads" in
14729 ":define") d_getprotobyname_r_proto=define
14730 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14734 case "$d_getprotobyname_r_proto" in
14736 case "$getprotobyname_r_proto" in
14737 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14738 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14740 case "$getprotobyname_r_proto" in
14741 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14742 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14744 case "$getprotobyname_r_proto" in
14745 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14746 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14748 case "$getprotobyname_r_proto" in
14749 ''|0) d_getprotobyname_r=undef
14750 getprotobyname_r_proto=0
14751 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14752 * ) case "$getprotobyname_r_proto" in
14753 REENTRANT_PROTO*) ;;
14754 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14756 echo "Prototype: $try" ;;
14759 *) case "$usethreads" in
14760 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14762 d_getprotobyname_r=undef
14763 getprotobyname_r_proto=0
14767 *) getprotobyname_r_proto=0
14771 : see if getprotobynumber_r exists
14772 set getprotobynumber_r d_getprotobynumber_r
14774 case "$d_getprotobynumber_r" in
14776 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14777 case "$d_getprotobynumber_r_proto:$usethreads" in
14778 ":define") d_getprotobynumber_r_proto=define
14779 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14783 case "$d_getprotobynumber_r_proto" in
14785 case "$getprotobynumber_r_proto" in
14786 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14787 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14789 case "$getprotobynumber_r_proto" in
14790 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14791 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14793 case "$getprotobynumber_r_proto" in
14794 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14795 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14797 case "$getprotobynumber_r_proto" in
14798 ''|0) d_getprotobynumber_r=undef
14799 getprotobynumber_r_proto=0
14800 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14801 * ) case "$getprotobynumber_r_proto" in
14802 REENTRANT_PROTO*) ;;
14803 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14805 echo "Prototype: $try" ;;
14808 *) case "$usethreads" in
14809 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14811 d_getprotobynumber_r=undef
14812 getprotobynumber_r_proto=0
14816 *) getprotobynumber_r_proto=0
14820 : see if getprotoent_r exists
14821 set getprotoent_r d_getprotoent_r
14823 case "$d_getprotoent_r" in
14825 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14826 case "$d_getprotoent_r_proto:$usethreads" in
14827 ":define") d_getprotoent_r_proto=define
14828 set d_getprotoent_r_proto getprotoent_r $hdrs
14832 case "$d_getprotoent_r_proto" in
14834 case "$getprotoent_r_proto" in
14835 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14836 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14838 case "$getprotoent_r_proto" in
14839 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14840 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14842 case "$getprotoent_r_proto" in
14843 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14844 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14846 case "$getprotoent_r_proto" in
14847 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14848 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14850 case "$getprotoent_r_proto" in
14851 ''|0) d_getprotoent_r=undef
14852 getprotoent_r_proto=0
14853 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14854 * ) case "$getprotoent_r_proto" in
14855 REENTRANT_PROTO*) ;;
14856 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14858 echo "Prototype: $try" ;;
14861 *) case "$usethreads" in
14862 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14864 d_getprotoent_r=undef
14865 getprotoent_r_proto=0
14869 *) getprotoent_r_proto=0
14873 : see if prototypes for various getprotoxxx netdb.h functions are available
14875 set d_getprotoprotos getprotoent $i_netdb netdb.h
14878 : see if getprpwnam exists
14879 set getprpwnam d_getprpwnam
14882 : see if getpwent exists
14883 set getpwent d_getpwent
14886 : see if getpwent_r exists
14887 set getpwent_r d_getpwent_r
14889 case "$d_getpwent_r" in
14891 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14892 case "$d_getpwent_r_proto:$usethreads" in
14893 ":define") d_getpwent_r_proto=define
14894 set d_getpwent_r_proto getpwent_r $hdrs
14898 case "$d_getpwent_r_proto" in
14900 case "$getpwent_r_proto" in
14901 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14902 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14904 case "$getpwent_r_proto" in
14905 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14906 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14908 case "$getpwent_r_proto" in
14909 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14910 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14912 case "$getpwent_r_proto" in
14913 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14914 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14916 case "$getpwent_r_proto" in
14917 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14918 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14920 case "$getpwent_r_proto" in
14921 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14922 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14924 case "$getpwent_r_proto" in
14925 ''|0) d_getpwent_r=undef
14927 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14928 * ) case "$getpwent_r_proto" in
14929 REENTRANT_PROTO*) ;;
14930 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14932 echo "Prototype: $try" ;;
14935 *) case "$usethreads" in
14936 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14943 *) getpwent_r_proto=0
14947 : see if getpwnam_r exists
14948 set getpwnam_r d_getpwnam_r
14950 case "$d_getpwnam_r" in
14952 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14953 case "$d_getpwnam_r_proto:$usethreads" in
14954 ":define") d_getpwnam_r_proto=define
14955 set d_getpwnam_r_proto getpwnam_r $hdrs
14959 case "$d_getpwnam_r_proto" in
14961 case "$getpwnam_r_proto" in
14962 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14963 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14965 case "$getpwnam_r_proto" in
14966 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14967 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14969 case "$getpwnam_r_proto" in
14970 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14971 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14973 case "$getpwnam_r_proto" in
14974 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14975 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14977 case "$getpwnam_r_proto" in
14978 ''|0) d_getpwnam_r=undef
14980 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14981 * ) case "$getpwnam_r_proto" in
14982 REENTRANT_PROTO*) ;;
14983 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14985 echo "Prototype: $try" ;;
14988 *) case "$usethreads" in
14989 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14996 *) getpwnam_r_proto=0
15000 : see if getpwuid_r exists
15001 set getpwuid_r d_getpwuid_r
15003 case "$d_getpwuid_r" in
15005 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15006 case "$d_getpwuid_r_proto:$usethreads" in
15007 ":define") d_getpwuid_r_proto=define
15008 set d_getpwuid_r_proto getpwuid_r $hdrs
15012 case "$d_getpwuid_r_proto" in
15014 case "$getpwuid_r_proto" in
15015 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15016 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15018 case "$getpwuid_r_proto" in
15019 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15020 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15022 case "$getpwuid_r_proto" in
15023 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15024 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15026 case "$getpwuid_r_proto" in
15027 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15028 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15030 case "$getpwuid_r_proto" in
15031 ''|0) d_getpwuid_r=undef
15033 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15034 * ) case "$getpwuid_r_proto" in
15035 REENTRANT_PROTO*) ;;
15036 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15038 echo "Prototype: $try" ;;
15041 *) case "$usethreads" in
15042 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15049 *) getpwuid_r_proto=0
15053 : Optional checks for getsbyname and getsbyport
15055 : see if getservbyname exists
15056 set getservbyname d_getsbyname
15059 : see if getservbyport exists
15060 set getservbyport d_getsbyport
15063 : see if getservent exists
15064 set getservent d_getsent
15067 : see if getservbyname_r exists
15068 set getservbyname_r d_getservbyname_r
15070 case "$d_getservbyname_r" in
15072 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15073 case "$d_getservbyname_r_proto:$usethreads" in
15074 ":define") d_getservbyname_r_proto=define
15075 set d_getservbyname_r_proto getservbyname_r $hdrs
15079 case "$d_getservbyname_r_proto" in
15081 case "$getservbyname_r_proto" in
15082 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15083 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15085 case "$getservbyname_r_proto" in
15086 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15087 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15089 case "$getservbyname_r_proto" in
15090 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15091 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15093 case "$getservbyname_r_proto" in
15094 ''|0) d_getservbyname_r=undef
15095 getservbyname_r_proto=0
15096 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15097 * ) case "$getservbyname_r_proto" in
15098 REENTRANT_PROTO*) ;;
15099 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15101 echo "Prototype: $try" ;;
15104 *) case "$usethreads" in
15105 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15107 d_getservbyname_r=undef
15108 getservbyname_r_proto=0
15112 *) getservbyname_r_proto=0
15116 : see if getservbyport_r exists
15117 set getservbyport_r d_getservbyport_r
15119 case "$d_getservbyport_r" in
15121 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15122 case "$d_getservbyport_r_proto:$usethreads" in
15123 ":define") d_getservbyport_r_proto=define
15124 set d_getservbyport_r_proto getservbyport_r $hdrs
15128 case "$d_getservbyport_r_proto" in
15130 case "$getservbyport_r_proto" in
15131 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15132 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15134 case "$getservbyport_r_proto" in
15135 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15136 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15138 case "$getservbyport_r_proto" in
15139 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15140 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15142 case "$getservbyport_r_proto" in
15143 ''|0) d_getservbyport_r=undef
15144 getservbyport_r_proto=0
15145 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15146 * ) case "$getservbyport_r_proto" in
15147 REENTRANT_PROTO*) ;;
15148 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15150 echo "Prototype: $try" ;;
15153 *) case "$usethreads" in
15154 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15156 d_getservbyport_r=undef
15157 getservbyport_r_proto=0
15161 *) getservbyport_r_proto=0
15165 : see if getservent_r exists
15166 set getservent_r d_getservent_r
15168 case "$d_getservent_r" in
15170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15171 case "$d_getservent_r_proto:$usethreads" in
15172 ":define") d_getservent_r_proto=define
15173 set d_getservent_r_proto getservent_r $hdrs
15177 case "$d_getservent_r_proto" in
15179 case "$getservent_r_proto" in
15180 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15181 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15183 case "$getservent_r_proto" in
15184 ''|0) try='int getservent_r(struct servent*, char*, int);'
15185 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15187 case "$getservent_r_proto" in
15188 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15189 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15191 case "$getservent_r_proto" in
15192 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15193 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15195 case "$getservent_r_proto" in
15196 ''|0) d_getservent_r=undef
15197 getservent_r_proto=0
15198 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15199 * ) case "$getservent_r_proto" in
15200 REENTRANT_PROTO*) ;;
15201 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15203 echo "Prototype: $try" ;;
15206 *) case "$usethreads" in
15207 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15209 d_getservent_r=undef
15210 getservent_r_proto=0
15214 *) getservent_r_proto=0
15218 : see if prototypes for various getservxxx netdb.h functions are available
15220 set d_getservprotos getservent $i_netdb netdb.h
15223 : see if getspnam exists
15224 set getspnam d_getspnam
15227 : see if this is a shadow.h system
15228 set shadow.h i_shadow
15231 : see if getspnam_r exists
15232 set getspnam_r d_getspnam_r
15234 case "$d_getspnam_r" in
15236 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15237 case "$d_getspnam_r_proto:$usethreads" in
15238 ":define") d_getspnam_r_proto=define
15239 set d_getspnam_r_proto getspnam_r $hdrs
15243 case "$d_getspnam_r_proto" in
15245 case "$getspnam_r_proto" in
15246 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15247 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15249 case "$getspnam_r_proto" in
15250 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15251 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15253 case "$getspnam_r_proto" in
15254 ''|0) d_getspnam_r=undef
15256 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15257 * ) case "$getspnam_r_proto" in
15258 REENTRANT_PROTO*) ;;
15259 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15261 echo "Prototype: $try" ;;
15264 *) case "$usethreads" in
15265 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15272 *) getspnam_r_proto=0
15276 : see if gettimeofday or ftime exists
15277 set gettimeofday d_gettimeod
15279 case "$d_gettimeod" in
15285 val="$undef"; set d_ftime; eval $setvar
15288 case "$d_gettimeod$d_ftime" in
15291 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15295 : see if gmtime_r exists
15296 set gmtime_r d_gmtime_r
15298 case "$d_gmtime_r" in
15300 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15301 case "$d_gmtime_r_proto:$usethreads" in
15302 ":define") d_gmtime_r_proto=define
15303 set d_gmtime_r_proto gmtime_r $hdrs
15307 case "$d_gmtime_r_proto" in
15309 case "$gmtime_r_proto" in
15310 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15311 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15313 case "$gmtime_r_proto" in
15314 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15315 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15317 case "$gmtime_r_proto" in
15318 ''|0) d_gmtime_r=undef
15320 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15321 * ) case "$gmtime_r_proto" in
15322 REENTRANT_PROTO*) ;;
15323 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15325 echo "Prototype: $try" ;;
15328 *) case "$usethreads" in
15329 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15336 *) gmtime_r_proto=0
15340 : see if hasmntopt exists
15341 set hasmntopt d_hasmntopt
15344 : see if this is a netinet/in.h or sys/in.h system
15345 set netinet/in.h i_niin sys/in.h i_sysin
15348 : see if arpa/inet.h has to be included
15349 set arpa/inet.h i_arpainet
15352 : see if htonl --and friends-- exists
15357 : Maybe they are macros.
15360 $cat >htonl.c <<EOM
15362 #include <sys/types.h>
15363 #$i_niin I_NETINET_IN
15365 #$i_arpainet I_ARPA_INET
15366 #ifdef I_NETINET_IN
15367 #include <netinet/in.h>
15370 #include <sys/in.h>
15373 #include <arpa/inet.h>
15376 printf("Defined as a macro.");
15379 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15380 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15382 echo "But it seems to be defined as a macro." >&4
15390 : see if ilogbl exists
15391 set ilogbl d_ilogbl
15396 if set index val -f; eval $csym; $val; then
15397 if set strchr val -f d_strchr; eval $csym; $val; then
15398 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15401 echo "strchr() found." >&4
15405 echo "index() found." >&4
15410 echo "index() found." >&4
15413 if set strchr val -f d_strchr; eval $csym; $val; then
15416 echo "strchr() found." >&4
15418 echo "No index() or strchr() found!" >&4
15423 set d_strchr; eval $setvar
15425 set d_index; eval $setvar
15427 : check whether inet_aton exists
15428 set inet_aton d_inetaton
15431 : see if inet_ntop exists
15432 set inet_ntop d_inetntop
15435 : see if inet_pton exists
15436 set inet_pton d_inetpton
15441 $cat >isascii.c <<EOCP
15444 #$i_stdlib I_STDLIB
15446 #include <stdlib.h>
15457 if eval $compile; then
15458 echo "isascii() found." >&4
15461 echo "isascii() NOT found." >&4
15470 $cat >isblank.c <<'EOCP'
15481 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15482 echo "isblank() found." >&4
15485 echo "isblank() NOT found." >&4
15492 : check for isfinite
15493 echo "Checking to see if you have isfinite..." >&4
15499 int main() { return isfinite(0.0); }
15502 if eval $compile; then
15504 echo "You have isfinite."
15507 echo "You do not have isfinite."
15513 : see if isfinitel exists
15514 set isfinitel d_isfinitel
15518 echo "Checking to see if you have isinf..." >&4
15524 int main() { return isinf(0.0); }
15527 if eval $compile; then
15529 echo "You have isinf."
15532 echo "You do not have isinf."
15538 : see if isinfl exists
15539 set isinfl d_isinfl
15543 echo "Checking to see if you have isnan..." >&4
15549 int main() { return isnan(0.0); }
15552 if eval $compile; then
15554 echo "You have isnan."
15557 echo "You do not have isnan."
15563 : see if isnanl exists
15564 set isnanl d_isnanl
15571 : see if j0l exists
15575 : see if killpg exists
15576 set killpg d_killpg
15579 : see if lchown exists
15581 $cat > try.c <<'EOCP'
15582 /* System header to define __stub macros and hopefully few prototypes,
15583 which can conflict with char lchown(); below. */
15584 #include <assert.h>
15585 /* Override any gcc2 internal prototype to avoid an error. */
15586 /* We use char because int might match the return type of a gcc2
15587 builtin and then its argument prototype would still apply. */
15590 /* The GNU C library defines this for functions which it implements
15591 to always fail with ENOSYS. Some functions are actually named
15592 something starting with __ and the normal name is an alias. */
15593 #if defined (__stub_lchown) || defined (__stub___lchown)
15601 if eval $compile; then
15602 $echo "lchown() found." >&4
15605 $echo "lchown() NOT found." >&4
15611 : See if number of significant digits in a double precision number is known
15613 $cat >ldbl_dig.c <<EOM
15614 #$i_limits I_LIMITS
15617 #include <limits.h>
15623 printf("Contains LDBL_DIG");
15626 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15627 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15628 echo "LDBL_DIG found." >&4
15631 echo "LDBL_DIG NOT found." >&4
15638 : check to see if math.h defines _LIB_VERSION
15639 d_libm_lib_version="$undef"
15643 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15645 #include <unistd.h>
15647 int main (int argc, char *argv[])
15649 printf ("%d\n", _LIB_VERSION);
15654 if eval $compile; then
15656 echo "Yes, it does ($foo)" >&4
15657 d_libm_lib_version="$define"
15659 echo "No, it does not (probably harmless)" >&4
15666 : see if link exists
15670 : see if localtime_r exists
15671 set localtime_r d_localtime_r
15673 case "$d_localtime_r" in
15675 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15676 case "$d_localtime_r_proto:$usethreads" in
15677 ":define") d_localtime_r_proto=define
15678 set d_localtime_r_proto localtime_r $hdrs
15682 case "$d_localtime_r_proto" in
15684 case "$localtime_r_proto" in
15685 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15686 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15688 case "$localtime_r_proto" in
15689 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15690 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15692 case "$localtime_r_proto" in
15693 ''|0) d_localtime_r=undef
15694 localtime_r_proto=0
15695 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15696 * ) case "$localtime_r_proto" in
15697 REENTRANT_PROTO*) ;;
15698 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15700 echo "Prototype: $try" ;;
15703 *) case "$usethreads" in
15704 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15706 d_localtime_r=undef
15707 localtime_r_proto=0
15711 *) localtime_r_proto=0
15715 : see if localtime_r calls tzset
15716 case "$localtime_r_proto" in
15719 /* Does our libc's localtime_r call tzset ?
15720 * return 0 if so, 1 otherwise.
15722 #$i_systypes I_SYS_TYPES
15723 #$i_unistd I_UNISTD
15725 #$i_stdlib I_STDLIB
15726 #$i_string I_STRING
15727 #$i_malloc I_MALLOC
15729 # include <sys/types.h>
15732 # include <unistd.h>
15738 #include <stdlib.h>
15741 # include <string.h>
15743 # include <strings.h>
15746 # include <malloc.h>
15750 time_t t = time(0L);
15751 char w_tz[]="TZ" "=GMT+5",
15752 e_tz[]="TZ" "=GMT-5",
15753 *tz_e = (char*)malloc(16),
15754 *tz_w = (char*)malloc(16);
15755 struct tm tm_e, tm_w;
15756 memset(&tm_e,'\0',sizeof(struct tm));
15757 memset(&tm_w,'\0',sizeof(struct tm));
15762 localtime_r(&t, &tm_e);
15765 localtime_r(&t, &tm_w);
15767 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15773 if eval $compile; then
15774 if $run ./try; then
15775 d_localtime_r_needs_tzset=undef;
15777 d_localtime_r_needs_tzset=define;
15780 d_localtime_r_needs_tzset=undef;
15784 d_localtime_r_needs_tzset=undef;
15789 : see if localeconv exists
15790 set localeconv d_locconv
15793 : see if lockf exists
15797 : see if prototype for lseek is available
15799 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15802 : see if lstat exists
15806 : see if madvise exists
15807 set madvise d_madvise
15810 : see if malloc_size exists
15811 set malloc_size d_malloc_size
15814 : see if malloc_size_good exists
15815 set malloc_good_size d_malloc_good_size
15818 : see if mblen exists
15822 : see if mbstowcs exists
15823 set mbstowcs d_mbstowcs
15826 : see if mbtowc exists
15827 set mbtowc d_mbtowc
15830 : see if memchr exists
15831 set memchr d_memchr
15834 : see if memcmp exists
15835 set memcmp d_memcmp
15838 : see if memcpy exists
15839 set memcpy d_memcpy
15842 : see if memmove exists
15843 set memmove d_memmove
15846 : see if memset exists
15847 set memset d_memset
15850 : see if mkdir exists
15854 : see if mkdtemp exists
15855 set mkdtemp d_mkdtemp
15858 : see if mkfifo exists
15859 set mkfifo d_mkfifo
15862 : see if mkstemp exists
15863 set mkstemp d_mkstemp
15866 : see if mkstemps exists
15867 set mkstemps d_mkstemps
15870 : see if mktime exists
15871 set mktime d_mktime
15874 : see if this is a sys/mman.h system
15875 set sys/mman.h i_sysmman
15878 : see if mmap exists
15881 : see what shmat returns
15882 : default to something harmless
15884 case "$i_sysmman$d_mmap" in
15886 $cat >mmap.c <<'END'
15887 #include <sys/mman.h>
15890 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15895 echo "and it returns ($mmaptype)." >&4
15901 : see if sqrtl exists
15905 : see if scalbnl exists
15906 set scalbnl d_scalbnl
15909 : see if modfl exists
15913 : see if prototype for modfl is available
15915 set d_modflproto modfl $i_math math.h
15918 d_modfl_pow32_bug="$undef"
15920 case "$d_longdbl$d_modfl" in
15923 Checking to see whether your modfl() is okay for large values...
15929 if $test "X$d_modflproto" != "X$define"; then
15930 $cat >>try.c <<EOCP
15931 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15932 long double modfl (long double, long double *);
15935 $cat >>try.c <<EOCP
15937 long double nv = 4294967303.15;
15943 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15947 case "$osname:$gccversion" in
15948 aix:) saveccflags="$ccflags"
15949 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15952 if eval $compile; then
15955 *" 4294967303.150000 1.150000 4294967302.000000")
15956 echo >&4 "Your modfl() is broken for large values."
15957 d_modfl_pow32_bug="$define"
15959 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15963 *" 4294967303.150000 0.150000 4294967303.000000")
15964 echo >&4 "Your modfl() seems okay for large values."
15966 *) echo >&4 "I don't understand your modfl() at all."
15972 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15975 case "$osname:$gccversion" in
15976 aix:) ccflags="$saveccflags" ;; # restore
15981 if $test "$uselongdouble" = "$define"; then
15983 if $test "$d_sqrtl" != "$define"; then
15984 message="$message sqrtl"
15986 if $test "$d_modfl" != "$define"; then
15987 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15988 echo "You have both aintl and copysignl, so I can emulate modfl."
15990 message="$message modfl"
15993 if $test "$d_frexpl" != "$define"; then
15994 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15995 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15997 message="$message frexpl"
16000 if $test "$d_ldexpl" != "$define"; then
16001 message="$message ldexpl"
16004 if $test "$message" != ""; then
16007 *** You requested the use of long doubles but you do not seem to have
16008 *** the following mathematical functions needed for long double support:
16010 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16011 *** Cannot continue, aborting.
16019 : see if mprotect exists
16020 set mprotect d_mprotect
16023 : see if msgctl exists
16024 set msgctl d_msgctl
16027 : see if msgget exists
16028 set msgget d_msgget
16031 : see if msgsnd exists
16032 set msgsnd d_msgsnd
16035 : see if msgrcv exists
16036 set msgrcv d_msgrcv
16039 : see how much of the 'msg*(2)' library is present.
16042 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16043 *"$undef"*) h_msg=false;;
16047 case "`ipcs 2>&1`" in
16048 "SVID messages"*"not configured"*)
16049 echo "Your $osname does not have the msg*(2) configured." >&4
16052 set msgctl d_msgctl
16054 set msgget d_msgget
16056 set msgsnd d_msgsnd
16058 set msgrcv d_msgrcv
16064 : we could also check for sys/ipc.h ...
16065 if $h_msg && $test `./findhdr sys/msg.h`; then
16066 echo "You have the full msg*(2) library." >&4
16069 echo "You don't have the full msg*(2) library." >&4
16075 : Check for msghdr_s
16077 echo "Checking to see if your system supports struct msghdr..." >&4
16078 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16080 case "$d_msghdr_s" in
16081 "$define") echo "Yes, it does." ;;
16082 *) echo "No, it doesn't." ;;
16086 : see if msync exists
16090 : see if munmap exists
16091 set munmap d_munmap
16094 : see if nice exists
16098 : see if this is a langinfo.h system
16099 set langinfo.h i_langinfo
16102 : see if nl_langinfo exists
16103 set nl_langinfo d_nl_langinfo
16106 : check for volatile keyword
16108 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16109 $cat >try.c <<'EOCP'
16112 typedef struct _goo_struct goo_struct;
16113 goo_struct * volatile goo = ((goo_struct *)0);
16114 struct _goo_struct {
16119 typedef unsigned short foo_t;
16120 char *volatile foo;
16122 volatile foo_t blech;
16126 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16128 echo "Yup, it does."
16131 echo "Nope, it doesn't."
16137 : Check basic sizes
16139 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16141 case "$use64bitint:$d_quad:$quadtype" in
16144 uvtype="$uquadtype"
16149 uvtype="unsigned long"
16155 case "$uselongdouble:$d_longdbl" in
16157 nvtype="long double"
16158 nvsize=$longdblsize
16165 $echo "(IV will be "$ivtype", $ivsize bytes)"
16166 $echo "(UV will be "$uvtype", $uvsize bytes)"
16167 $echo "(NV will be "$nvtype", $nvsize bytes)"
16170 #$i_inttypes I_INTTYPES
16172 #include <inttypes.h>
16177 int8_t i = INT8_MAX;
16178 uint8_t u = UINT8_MAX;
16179 printf("int8_t\n");
16182 int16_t i = INT16_MAX;
16183 uint16_t u = UINT16_MAX;
16184 printf("int16_t\n");
16187 int32_t i = INT32_MAX;
16188 uint32_t u = UINT32_MAX;
16189 printf("int32_t\n");
16194 i8type="signed char"
16195 u8type="unsigned char"
16200 '') case "$shortsize" in
16202 u16type="unsigned short"
16210 '') set try -DINT16
16211 if eval $compile; then
16212 case "`$run ./try`" in
16224 '') if $test $shortsize -ge 2; then
16226 u16type="unsigned short"
16234 '') case "$longsize" in
16236 u32type="unsigned long"
16240 *) case "$intsize" in
16242 u32type="unsigned int"
16252 '') set try -DINT32
16253 if eval $compile; then
16254 case "`$run ./try`" in
16266 '') if $test $intsize -ge 4; then
16268 u32type="unsigned int"
16276 '') case "$d_quad:$quadtype" in
16278 i64type="$quadtype"
16279 u64type="$uquadtype"
16287 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16288 : volatile so that the compiler has to store it out to memory.
16289 if test X"$d_volatile" = X"$define"; then
16294 #$i_stdlib I_STDLIB
16296 #include <stdlib.h>
16298 #include <sys/types.h>
16299 #include <signal.h>
16301 $volatile int bletched = 0;
16302 $signal_t blech(int s) { bletched = 1; }
16307 int n = 8 * $uvsize;
16310 signal(SIGFPE, blech);
16313 for (i = 0; i < n; i++) {
16314 u = u << 1 | ($uvtype)1;
16316 if (($uvtype)d != u)
16320 d = ($nvtype)(u - 1);
16321 if (($uvtype)d != (u - 1))
16328 printf("%d\n", ((i == n) ? -n : i));
16334 d_nv_preserves_uv="$undef"
16335 if eval $compile; then
16336 nv_preserves_uv_bits="`$run ./try`"
16338 case "$nv_preserves_uv_bits" in
16340 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16341 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16342 d_nv_preserves_uv="$define"
16344 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16345 d_nv_preserves_uv="$undef" ;;
16346 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16347 nv_preserves_uv_bits="0" ;;
16351 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16352 : volatile so that the compiler has to store it out to memory.
16353 if test X"$d_volatile" = X"$define"; then
16359 typedef $nvtype NV;
16366 while(count < 256) {
16367 $volatile NV up = value + 1.0;
16368 $volatile NV negated = -value;
16369 $volatile NV down = negated - 1.0;
16370 $volatile NV got_up = up - value;
16371 int up_good = got_up == 1.0;
16372 int got_down = down - negated;
16373 int down_good = got_down == -1.0;
16375 if (down_good != up_good) {
16377 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16378 up_good, (double) got_up, down_good, (double) got_down,
16379 count, (double) value);
16386 fputs("256.0", stdout);
16389 fputs("2.0", stdout);
16395 fputs("*", stdout);
16401 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16402 count, (double) value);
16408 nv_overflows_integers_at='0'
16409 if eval $compile; then
16415 The largest integer your NVs can preserve is equal to $xxx
16417 nv_overflows_integers_at="$xxx"
16420 Cannot determine the largest integer value your NVs can hold, unexpected output
16427 Cannot determine the largest integer value your NVs can hold
16434 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16435 : volatile so that the compiler has to store it out to memory.
16436 if test X"$d_volatile" = X"$define"; then
16441 #$i_stdlib I_STDLIB
16443 #include <stdlib.h>
16445 #$i_string I_STRING
16447 # include <string.h>
16449 # include <strings.h>
16451 #include <sys/types.h>
16452 #include <signal.h>
16454 $volatile int bletched = 0;
16455 $signal_t blech(int s) { bletched = 1; }
16458 int checkit($nvtype d, char *where) {
16459 unsigned char *p = (char *)&d;
16460 unsigned char *end = p + sizeof(d);
16470 printf("No - %s: 0x", where);
16472 printf ("%02X", *p++);
16477 int main(int argc, char **argv) {
16480 fail += checkit(d, "0.0");
16482 /* The compiler shouldn't be assuming that bletched is 0 */
16485 fail += checkit(d, "bleched");
16488 signal(SIGFPE, blech);
16491 /* Paranoia - the compiler should have no way of knowing that ANSI says
16492 that argv[argc] will always be NULL. Actually, if it did assume this it
16493 would be buggy, as this is C and main() can be called from elsewhere in
16495 d = argv[argc] ? 1 : 0;
16498 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16501 fail += checkit(d, "ternary");
16503 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16506 printf("No - memset doesn't give 0.0\n");
16507 /* This might just blow up: */
16508 printf("(gives %g)\n", d);
16514 printf("No - something bleched\n");
16519 printf("No - %d fail(s)\n", fail);
16528 d_nv_zero_is_allbits_zero="$undef"
16529 if eval $compile; then
16535 0.0 is represented as all bits zero in memory
16537 d_nv_zero_is_allbits_zero="$define"
16540 0.0 is not represented as all bits zero in memory
16542 d_nv_zero_is_allbits_zero="$undef"
16547 0.0 is not represented as all bits zero in memory
16549 d_nv_zero_is_allbits_zero="$undef"
16555 : check for off64_t
16557 echo "Checking to see if you have off64_t..." >&4
16559 #include <sys/types.h>
16560 #include <unistd.h>
16561 int main() { off64_t x = 7; }
16564 if eval $compile; then
16566 echo "You have off64_t."
16569 echo "You do not have off64_t."
16570 case "$lseeksize" in
16571 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16578 : how to create joinable pthreads
16579 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16581 echo "Checking what constant to use for creating joinable pthreads..." >&4
16582 $cat >try.c <<'EOCP'
16583 #include <pthread.h>
16585 int detachstate = JOINABLE;
16588 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16589 if eval $compile; then
16590 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16591 val="$undef" # Yes, undef.
16592 set d_old_pthread_create_joinable
16595 set old_pthread_create_joinable
16598 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16599 if eval $compile; then
16600 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16602 set d_old_pthread_create_joinable
16604 val=PTHREAD_CREATE_UNDETACHED
16605 set old_pthread_create_joinable
16608 set try -DJOINABLE=__UNDETACHED
16609 if eval $compile; then
16610 echo "You seem to use __UNDETACHED." >&4
16612 set d_old_pthread_create_joinable
16615 set old_pthread_create_joinable
16618 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16620 set d_old_pthread_create_joinable
16623 set old_pthread_create_joinable
16630 d_old_pthread_create_joinable="$undef"
16631 old_pthread_create_joinable=""
16634 : see if pause exists
16638 : see if poll exists
16642 : see if prctl exists
16646 : see if prctl supports PR_SET_NAME
16647 d_prctl_set_name=$undef
16652 #include <unistd.h>
16654 #include <sys/prctl.h>
16656 int main (int argc, char *argv[])
16658 return (prctl (PR_SET_NAME, "Test"));
16662 if eval $compile_ok && $run ./try; then
16663 echo "Your prctl (PR_SET_NAME, ...) works"
16664 d_prctl_set_name=$define
16670 : see if readlink exists
16671 set readlink d_readlink
16674 : Check if exe is symlink to abs path of executing program
16678 case "$d_readlink" in
16680 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16681 : more tidy to avoid an extra level of symlink
16682 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16683 while test $# -gt 0; do
16686 if $issymlink $try; then
16687 $ls -l $try > reflect
16688 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16689 echo "You have $type-like $try."
16690 procselfexe='"'$try'"'
16692 : This will break out of the loop
16703 : backward compatibility for d_hvfork
16704 if test X$d_hvfork != X; then
16705 d_vfork="$d_hvfork"
16708 : see if there is a vfork
16713 d_pseudofork=$undef
16715 : Ok, but do we want to use it. vfork is reportedly unreliable in
16716 : perl on Solaris 2.x, and probably elsewhere.
16720 case "$usevfork" in
16726 Perl can only use a vfork() that doesn't suffer from strict
16727 restrictions on calling functions or modifying global data in
16728 the child. For example, glibc-2.1 contains such a vfork()
16729 that is unsuitable. If your system provides a proper fork()
16730 call, chances are that you do NOT want perl to use vfork().
16733 rp="Do you still want to use vfork()?"
16738 echo "Ok, we won't use vfork()."
16747 $define) usevfork='true';;
16748 *) usevfork='false';;
16751 : see whether the pthread_atfork exists
16753 #include <pthread.h>
16756 #ifdef PTHREAD_ATFORK
16757 pthread_atfork(NULL,NULL,NULL);
16762 : see if pthread_atfork exists
16763 set try -DPTHREAD_ATFORK
16764 if eval $compile; then
16769 case "$usethreads" in
16772 $define) echo 'pthread_atfork found.' >&4 ;;
16773 *) echo 'pthread_atfork NOT found.' >&4 ;;
16776 set d_pthread_atfork
16779 : see if pthread_attr_setscope exists
16780 set pthread_attr_setscope d_pthread_attr_setscope
16783 : see whether the various POSIXish _yields exist
16785 #include <pthread.h>
16791 #ifdef PTHREAD_YIELD
16794 #ifdef PTHREAD_YIELD_NULL
16795 pthread_yield(NULL);
16801 : see if sched_yield exists
16802 set try -DSCHED_YIELD
16803 if eval $compile; then
16805 sched_yield='sched_yield()'
16809 case "$usethreads" in
16812 $define) echo 'sched_yield() found.' >&4 ;;
16813 *) echo 'sched_yield() NOT found.' >&4 ;;
16819 : see if pthread_yield exists
16820 set try -DPTHREAD_YIELD
16821 if eval $compile; then
16823 case "$sched_yield" in
16824 '') sched_yield='pthread_yield()' ;;
16827 set try -DPTHREAD_YIELD_NULL
16828 if eval $compile; then
16830 case "$sched_yield" in
16831 '') sched_yield='pthread_yield(NULL)' ;;
16837 case "$usethreads" in
16840 $define) echo 'pthread_yield() found.' >&4 ;;
16841 *) echo 'pthread_yield() NOT found.' >&4 ;;
16845 set d_pthread_yield
16847 case "$sched_yield" in
16848 '') sched_yield=undef ;;
16852 : check for ptrdiff_t
16854 echo "Checking to see if you have ptrdiff_t..." >&4
16856 #include <stddef.h>
16857 int main() { ptrdiff_t x = 7; }
16860 if eval $compile; then
16862 echo "You have ptrdiff_t."
16865 echo "You do not have ptrdiff_t."
16871 : see if random_r exists
16872 set random_r d_random_r
16874 case "$d_random_r" in
16876 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16877 case "$d_random_r_proto:$usethreads" in
16878 ":define") d_random_r_proto=define
16879 set d_random_r_proto random_r $hdrs
16883 case "$d_random_r_proto" in
16885 case "$random_r_proto" in
16886 ''|0) try='int random_r(int*, struct random_data*);'
16887 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16889 case "$random_r_proto" in
16890 ''|0) try='int random_r(long*, struct random_data*);'
16891 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16893 case "$random_r_proto" in
16894 ''|0) try='int random_r(struct random_data*, int32_t*);'
16895 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16897 case "$random_r_proto" in
16898 ''|0) d_random_r=undef
16900 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16901 * ) case "$random_r_proto" in
16902 REENTRANT_PROTO*) ;;
16903 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16905 echo "Prototype: $try" ;;
16908 *) case "$usethreads" in
16909 define) echo "random_r has no prototype, not using it." >&4 ;;
16916 *) random_r_proto=0
16920 : see if readdir and friends exist
16921 set readdir d_readdir
16923 set seekdir d_seekdir
16925 set telldir d_telldir
16927 set rewinddir d_rewinddir
16930 : see if readdir64_r exists
16931 set readdir64_r d_readdir64_r
16933 case "$d_readdir64_r" in
16935 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16936 case "$d_readdir64_r_proto:$usethreads" in
16937 ":define") d_readdir64_r_proto=define
16938 set d_readdir64_r_proto readdir64_r $hdrs
16942 case "$d_readdir64_r_proto" in
16944 case "$readdir64_r_proto" in
16945 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16946 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16948 case "$readdir64_r_proto" in
16949 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16950 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16952 case "$readdir64_r_proto" in
16953 ''|0) d_readdir64_r=undef
16954 readdir64_r_proto=0
16955 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16956 * ) case "$readdir64_r_proto" in
16957 REENTRANT_PROTO*) ;;
16958 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16960 echo "Prototype: $try" ;;
16963 *) case "$usethreads" in
16964 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16966 d_readdir64_r=undef
16967 readdir64_r_proto=0
16971 *) readdir64_r_proto=0
16975 : see if readdir_r exists
16976 set readdir_r d_readdir_r
16978 case "$d_readdir_r" in
16980 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16981 case "$d_readdir_r_proto:$usethreads" in
16982 ":define") d_readdir_r_proto=define
16983 set d_readdir_r_proto readdir_r $hdrs
16987 case "$d_readdir_r_proto" in
16989 case "$readdir_r_proto" in
16990 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16991 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16993 case "$readdir_r_proto" in
16994 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16995 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16997 case "$readdir_r_proto" in
16998 ''|0) d_readdir_r=undef
17000 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17001 * ) case "$readdir_r_proto" in
17002 REENTRANT_PROTO*) ;;
17003 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17005 echo "Prototype: $try" ;;
17008 *) case "$usethreads" in
17009 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17016 *) readdir_r_proto=0
17020 : see if readv exists
17024 : see if recvmsg exists
17025 set recvmsg d_recvmsg
17028 : see if rename exists
17029 set rename d_rename
17032 : see if rmdir exists
17036 : see if memory.h is available.
17041 : See if it conflicts with string.h
17047 $cppstdin $cppflags $cppminus < $strings > mem.h
17048 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17050 echo "We won't be including <memory.h>."
17060 : can bcopy handle overlapping blocks?
17063 case "$d_memmove" in
17064 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17065 *) case "$d_bcopy" in
17067 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17069 #$i_memory I_MEMORY
17070 #$i_stdlib I_STDLIB
17071 #$i_string I_STRING
17072 #$i_unistd I_UNISTD
17074 $cat >>try.c <<'EOCP'
17077 # include <memory.h>
17080 # include <stdlib.h>
17083 # include <string.h>
17085 # include <strings.h>
17088 # include <unistd.h> /* Needed for NetBSD */
17092 char buf[128], abc[128];
17098 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17099 try to store the string in read-only memory. */
17100 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17102 for (align = 7; align >= 0; align--) {
17103 for (len = 36; len; len--) {
17105 bcopy(abc, b, len);
17106 for (off = 1; off <= len; off++) {
17107 bcopy(b, b+off, len);
17108 bcopy(b+off, b, len);
17109 if (bcmp(b, abc, len))
17118 if eval $compile_ok; then
17119 if $run ./try 2>/dev/null; then
17120 echo "Yes, it can."
17123 echo "It can't, sorry."
17126 echo "(I can't compile the test program, so we'll assume not...)"
17136 : can memcpy handle overlapping blocks?
17139 case "$d_memmove" in
17140 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17141 *) case "$d_memcpy" in
17143 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17145 #$i_memory I_MEMORY
17146 #$i_stdlib I_STDLIB
17147 #$i_string I_STRING
17148 #$i_unistd I_UNISTD
17150 $cat >>try.c <<'EOCP'
17153 # include <memory.h>
17156 # include <stdlib.h>
17159 # include <string.h>
17161 # include <strings.h>
17164 # include <unistd.h> /* Needed for NetBSD */
17168 char buf[128], abc[128];
17174 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17175 try to store the string in read-only memory. */
17176 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17178 for (align = 7; align >= 0; align--) {
17179 for (len = 36; len; len--) {
17181 memcpy(b, abc, len);
17182 for (off = 1; off <= len; off++) {
17183 memcpy(b+off, b, len);
17184 memcpy(b, b+off, len);
17185 if (memcmp(b, abc, len))
17194 if eval $compile_ok; then
17195 if $run ./try 2>/dev/null; then
17196 echo "Yes, it can."
17199 echo "It can't, sorry."
17202 echo "(I can't compile the test program, so we'll assume not...)"
17212 : can memcmp be trusted to compare relative magnitude?
17214 case "$d_memcmp" in
17217 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17219 #$i_memory I_MEMORY
17220 #$i_stdlib I_STDLIB
17221 #$i_string I_STRING
17222 #$i_unistd I_UNISTD
17224 $cat >>try.c <<'EOCP'
17227 # include <memory.h>
17230 # include <stdlib.h>
17233 # include <string.h>
17235 # include <strings.h>
17238 # include <unistd.h> /* Needed for NetBSD */
17244 if ((a < b) && memcmp(&a, &b, 1) < 0)
17250 if eval $compile_ok; then
17251 if $run ./try 2>/dev/null; then
17252 echo "Yes, it can."
17255 echo "No, it can't (it uses signed chars)."
17258 echo "(I can't compile the test program, so we'll assume not...)"
17266 : see if prototype for sbrk is available
17268 set d_sbrkproto sbrk $i_unistd unistd.h
17271 : see if select exists
17272 set select d_select
17275 : see if semctl exists
17276 set semctl d_semctl
17279 : see if semget exists
17280 set semget d_semget
17283 : see if semop exists
17287 : see how much of the 'sem*(2)' library is present.
17290 case "$d_semctl$d_semget$d_semop" in
17291 *"$undef"*) h_sem=false;;
17295 case "`ipcs 2>&1`" in
17296 "SVID messages"*"not configured"*)
17297 echo "Your $osname does not have the sem*(2) configured." >&4
17300 set semctl d_semctl
17302 set semget d_semget
17310 : we could also check for sys/ipc.h ...
17311 if $h_sem && $test `./findhdr sys/sem.h`; then
17312 echo "You have the full sem*(2) library." >&4
17315 echo "You don't have the full sem*(2) library." >&4
17321 : see whether sys/sem.h defines union semun
17323 $cat > try.c <<'END'
17324 #include <sys/types.h>
17325 #include <sys/ipc.h>
17326 #include <sys/sem.h>
17327 int main () { union semun semun; semun.buf = 0; }
17330 if eval $compile; then
17331 echo "You have union semun in <sys/sem.h>." >&4
17334 echo "You do not have union semun in <sys/sem.h>." >&4
17341 : see how to do semctl IPC_STAT
17345 $cat > tryh.h <<END
17348 # define S_IRUSR S_IREAD
17349 # define S_IWUSR S_IWRITE
17350 # define S_IXUSR S_IEXEC
17352 # define S_IRUSR 0400
17353 # define S_IWUSR 0200
17354 # define S_IXUSR 0100
17356 # define S_IRGRP (S_IRUSR>>3)
17357 # define S_IWGRP (S_IWUSR>>3)
17358 # define S_IXGRP (S_IXUSR>>3)
17359 # define S_IROTH (S_IRUSR>>6)
17360 # define S_IWOTH (S_IWUSR>>6)
17361 # define S_IXOTH (S_IXUSR>>6)
17364 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17365 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17366 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17369 : see whether semctl IPC_STAT can use union semun
17370 case "$d_semctl_semun" in
17374 #include <sys/types.h>
17375 #include <sys/ipc.h>
17376 #include <sys/sem.h>
17377 #include <sys/stat.h>
17384 #$d_union_semun HAS_UNION_SEMUN
17387 #ifndef HAS_UNION_SEMUN
17390 struct semid_ds *buf;
17391 unsigned short *array;
17397 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17398 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17400 struct semid_ds argbuf;
17403 st = semctl(sem, 0, IPC_STAT, arg);
17407 # endif /* IPC_STAT */
17408 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17410 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17411 # endif /* IPC_RMID */
17412 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17414 #endif /* IPC_PRIVATE && ... */
17415 printf("semget failed: errno = %d\n", errno);
17420 if eval $compile; then
17423 semun) val="$define" ;;
17431 case "$d_semctl_semun" in
17433 echo "You can use union semun for semctl IPC_STAT." >&4
17436 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17441 : see whether semctl IPC_STAT can use struct semid_ds pointer
17442 case "$d_semctl_semid_ds" in
17445 $cat > try.c <<'END'
17446 #include <sys/types.h>
17447 #include <sys/ipc.h>
17448 #include <sys/sem.h>
17449 #include <sys/stat.h>
17457 struct semid_ds arg;
17460 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17461 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17464 st = semctl(sem, 0, IPC_STAT, &arg);
17466 printf("semid_ds\n");
17468 # endif /* IPC_STAT */
17469 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17471 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17472 # endif /* IPC_RMID */
17473 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17475 #endif /* IPC_PRIVATE && ... */
17476 printf("semget failed: errno = %d\n", errno);
17482 if eval $compile; then
17485 semid_ds) val="$define" ;;
17489 set d_semctl_semid_ds
17493 case "$d_semctl_semid_ds" in
17495 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17497 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17503 # We do not have the full sem*(2) library, so assume we can not
17509 set d_semctl_semid_ds
17515 : see if sendmsg exists
17516 set sendmsg d_sendmsg
17519 : see if setegid exists
17520 set setegid d_setegid
17523 : see if seteuid exists
17524 set seteuid d_seteuid
17527 : see if setgrent exists
17528 set setgrent d_setgrent
17531 : see if setgrent_r exists
17532 set setgrent_r d_setgrent_r
17534 case "$d_setgrent_r" in
17536 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17537 case "$d_setgrent_r_proto:$usethreads" in
17538 ":define") d_setgrent_r_proto=define
17539 set d_setgrent_r_proto setgrent_r $hdrs
17543 case "$d_setgrent_r_proto" in
17545 case "$setgrent_r_proto" in
17546 ''|0) try='int setgrent_r(FILE**);'
17547 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17549 case "$setgrent_r_proto" in
17550 ''|0) try='void setgrent_r(FILE**);'
17551 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17553 case "$setgrent_r_proto" in
17554 ''|0) d_setgrent_r=undef
17556 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17557 * ) case "$setgrent_r_proto" in
17558 REENTRANT_PROTO*) ;;
17559 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17561 echo "Prototype: $try" ;;
17564 *) case "$usethreads" in
17565 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17572 *) setgrent_r_proto=0
17576 : see if sethostent exists
17577 set sethostent d_sethent
17580 : see if sethostent_r exists
17581 set sethostent_r d_sethostent_r
17583 case "$d_sethostent_r" in
17585 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17586 case "$d_sethostent_r_proto:$usethreads" in
17587 ":define") d_sethostent_r_proto=define
17588 set d_sethostent_r_proto sethostent_r $hdrs
17592 case "$d_sethostent_r_proto" in
17594 case "$sethostent_r_proto" in
17595 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17596 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17598 case "$sethostent_r_proto" in
17599 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17600 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17602 case "$sethostent_r_proto" in
17603 ''|0) d_sethostent_r=undef
17604 sethostent_r_proto=0
17605 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17606 * ) case "$sethostent_r_proto" in
17607 REENTRANT_PROTO*) ;;
17608 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17610 echo "Prototype: $try" ;;
17613 *) case "$usethreads" in
17614 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17616 d_sethostent_r=undef
17617 sethostent_r_proto=0
17621 *) sethostent_r_proto=0
17625 : see if setitimer exists
17626 set setitimer d_setitimer
17629 : see if setlinebuf exists
17630 set setlinebuf d_setlinebuf
17633 : see if setlocale exists
17634 set setlocale d_setlocale
17637 : see if locale.h is available
17638 set locale.h i_locale
17641 : see if setlocale_r exists
17642 set setlocale_r d_setlocale_r
17644 case "$d_setlocale_r" in
17646 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17647 case "$d_setlocale_r_proto:$usethreads" in
17648 ":define") d_setlocale_r_proto=define
17649 set d_setlocale_r_proto setlocale_r $hdrs
17653 case "$d_setlocale_r_proto" in
17655 case "$setlocale_r_proto" in
17656 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17657 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17659 case "$setlocale_r_proto" in
17660 ''|0) d_setlocale_r=undef
17661 setlocale_r_proto=0
17662 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17663 * ) case "$setlocale_r_proto" in
17664 REENTRANT_PROTO*) ;;
17665 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17667 echo "Prototype: $try" ;;
17670 *) case "$usethreads" in
17671 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17673 d_setlocale_r=undef
17674 setlocale_r_proto=0
17678 *) setlocale_r_proto=0
17682 : see if setnetent exists
17683 set setnetent d_setnent
17686 : see if setnetent_r exists
17687 set setnetent_r d_setnetent_r
17689 case "$d_setnetent_r" in
17691 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17692 case "$d_setnetent_r_proto:$usethreads" in
17693 ":define") d_setnetent_r_proto=define
17694 set d_setnetent_r_proto setnetent_r $hdrs
17698 case "$d_setnetent_r_proto" in
17700 case "$setnetent_r_proto" in
17701 ''|0) try='int setnetent_r(int, struct netent_data*);'
17702 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17704 case "$setnetent_r_proto" in
17705 ''|0) try='void setnetent_r(int, struct netent_data*);'
17706 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17708 case "$setnetent_r_proto" in
17709 ''|0) d_setnetent_r=undef
17710 setnetent_r_proto=0
17711 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17712 * ) case "$setnetent_r_proto" in
17713 REENTRANT_PROTO*) ;;
17714 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17716 echo "Prototype: $try" ;;
17719 *) case "$usethreads" in
17720 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17722 d_setnetent_r=undef
17723 setnetent_r_proto=0
17727 *) setnetent_r_proto=0
17731 : see if setprotoent exists
17732 set setprotoent d_setpent
17735 : see if setpgid exists
17736 set setpgid d_setpgid
17739 : see if setpgrp2 exists
17740 set setpgrp2 d_setpgrp2
17743 : see if setpriority exists
17744 set setpriority d_setprior
17747 : see if setproctitle exists
17748 set setproctitle d_setproctitle
17751 : see if setprotoent_r exists
17752 set setprotoent_r d_setprotoent_r
17754 case "$d_setprotoent_r" in
17756 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17757 case "$d_setprotoent_r_proto:$usethreads" in
17758 ":define") d_setprotoent_r_proto=define
17759 set d_setprotoent_r_proto setprotoent_r $hdrs
17763 case "$d_setprotoent_r_proto" in
17765 case "$setprotoent_r_proto" in
17766 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17767 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17769 case "$setprotoent_r_proto" in
17770 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17771 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17773 case "$setprotoent_r_proto" in
17774 ''|0) d_setprotoent_r=undef
17775 setprotoent_r_proto=0
17776 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17777 * ) case "$setprotoent_r_proto" in
17778 REENTRANT_PROTO*) ;;
17779 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17781 echo "Prototype: $try" ;;
17784 *) case "$usethreads" in
17785 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17787 d_setprotoent_r=undef
17788 setprotoent_r_proto=0
17792 *) setprotoent_r_proto=0
17796 : see if setpwent exists
17797 set setpwent d_setpwent
17800 : see if setpwent_r exists
17801 set setpwent_r d_setpwent_r
17803 case "$d_setpwent_r" in
17805 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17806 case "$d_setpwent_r_proto:$usethreads" in
17807 ":define") d_setpwent_r_proto=define
17808 set d_setpwent_r_proto setpwent_r $hdrs
17812 case "$d_setpwent_r_proto" in
17814 case "$setpwent_r_proto" in
17815 ''|0) try='int setpwent_r(FILE**);'
17816 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17818 case "$setpwent_r_proto" in
17819 ''|0) try='void setpwent_r(FILE**);'
17820 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17822 case "$setpwent_r_proto" in
17823 ''|0) d_setpwent_r=undef
17825 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17826 * ) case "$setpwent_r_proto" in
17827 REENTRANT_PROTO*) ;;
17828 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17830 echo "Prototype: $try" ;;
17833 *) case "$usethreads" in
17834 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17841 *) setpwent_r_proto=0
17845 : see if setregid exists
17846 set setregid d_setregid
17848 set setresgid d_setresgid
17851 : see if setreuid exists
17852 set setreuid d_setreuid
17854 set setresuid d_setresuid
17857 : see if setrgid exists
17858 set setrgid d_setrgid
17861 : see if setruid exists
17862 set setruid d_setruid
17865 : see if setservent exists
17866 set setservent d_setsent
17869 : see if setservent_r exists
17870 set setservent_r d_setservent_r
17872 case "$d_setservent_r" in
17874 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17875 case "$d_setservent_r_proto:$usethreads" in
17876 ":define") d_setservent_r_proto=define
17877 set d_setservent_r_proto setservent_r $hdrs
17881 case "$d_setservent_r_proto" in
17883 case "$setservent_r_proto" in
17884 ''|0) try='int setservent_r(int, struct servent_data*);'
17885 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17887 case "$setservent_r_proto" in
17888 ''|0) try='void setservent_r(int, struct servent_data*);'
17889 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17891 case "$setservent_r_proto" in
17892 ''|0) d_setservent_r=undef
17893 setservent_r_proto=0
17894 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17895 * ) case "$setservent_r_proto" in
17896 REENTRANT_PROTO*) ;;
17897 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17899 echo "Prototype: $try" ;;
17902 *) case "$usethreads" in
17903 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17905 d_setservent_r=undef
17906 setservent_r_proto=0
17910 *) setservent_r_proto=0
17914 : see if setsid exists
17915 set setsid d_setsid
17918 : see if setvbuf exists
17919 set setvbuf d_setvbuf
17922 : see if shmctl exists
17923 set shmctl d_shmctl
17926 : see if shmget exists
17927 set shmget d_shmget
17930 : see if shmat exists
17933 : see what shmat returns
17936 $cat >shmat.c <<'END'
17937 #include <sys/shm.h>
17940 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17945 echo "and it returns ($shmattype)." >&4
17946 : see if a prototype for shmat is available
17947 xxx=`./findhdr sys/shm.h`
17948 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17949 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17960 set d_shmatprototype
17963 : see if shmdt exists
17967 : see how much of the 'shm*(2)' library is present.
17970 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17971 *"$undef"*) h_shm=false;;
17975 case "`ipcs 2>&1`" in
17976 "SVID shared memory"*"not configured"*)
17977 echo "Your $osname does not have the shm*(2) configured." >&4
17980 set shmctl d_shmctl
17982 set shmget d_shmget
17992 : we could also check for sys/ipc.h ...
17993 if $h_shm && $test `./findhdr sys/shm.h`; then
17994 echo "You have the full shm*(2) library." >&4
17997 echo "You don't have the full shm*(2) library." >&4
18003 : see if we have sigaction
18005 if set sigaction val -f d_sigaction; eval $csym; $val; then
18006 echo 'sigaction() found.' >&4
18009 #include <sys/types.h>
18010 #include <signal.h>
18011 #$i_stdlib I_STDLIB
18013 #include <stdlib.h>
18017 struct sigaction act, oact;
18019 oact.sa_handler = 0;
18020 /* so that act and oact are used */
18021 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18025 if eval $compile_ok; then
18028 echo "But you don't seem to have a usable struct sigaction." >&4
18032 echo 'sigaction NOT found.' >&4
18035 set d_sigaction; eval $setvar
18038 : see if this is a sunmath.h system
18039 set sunmath.h i_sunmath
18042 : see if signbit exists
18043 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18046 #$i_sunmath I_SUNMATH
18050 #ifdef I_SUNMATH /* Solaris special math library */
18051 # include <sunmath.h>
18054 int main(int argc, char **argv)
18058 if ((signbit(x) == 0) && (signbit(y) != 0))
18066 if eval $compile; then
18067 if $run ./try; then
18071 $echo "Signbit seems to be available, but doesn't work as I expected."
18072 $echo "I won't use it." >&4
18083 : see if sigprocmask exists
18084 set sigprocmask d_sigprocmask
18087 : see if sigsetjmp exists
18089 case "$d_sigsetjmp" in
18092 #include <setjmp.h>
18093 #$i_stdlib I_STDLIB
18095 #include <stdlib.h>
18101 if (sigsetjmp(env,1))
18104 siglongjmp(env, 1);
18109 if eval $compile; then
18110 if $run ./try >/dev/null 2>&1; then
18111 echo "POSIX sigsetjmp found." >&4
18115 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18121 echo "sigsetjmp not found." >&4
18125 *) val="$d_sigsetjmp"
18126 case "$d_sigsetjmp" in
18127 $define) echo "POSIX sigsetjmp found." >&4;;
18128 $undef) echo "sigsetjmp not found." >&4;;
18136 : see if snprintf exists
18137 set snprintf d_snprintf
18140 : see if vsnprintf exists
18141 set vsnprintf d_vsnprintf
18144 case "$d_snprintf-$d_vsnprintf" in
18147 Checking whether your snprintf() and vsnprintf() work okay...
18149 $cat >try.c <<'EOCP'
18150 /* v?snprintf testing logic courtesy of Russ Allbery.
18151 * According to C99:
18152 * - if the buffer is too short it still must be \0-terminated
18153 * - if the buffer is too short the potentially required length
18154 * must be returned and not -1
18155 * - if the buffer is NULL the potentially required length
18156 * must be returned and not -1 or core dump
18159 #include <stdarg.h>
18163 int test (char *format, ...)
18168 va_start (args, format);
18169 count = vsnprintf (buf, sizeof buf, format, args);
18176 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18177 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18181 if eval $compile; then
18184 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18186 Your snprintf() and snprintf() don't seem to be working okay.
18188 d_snprintf="$undef"
18189 d_vsnprintf="$undef"
18193 echo "(I can't seem to compile the test program--assuming they don't)"
18194 d_snprintf="$undef"
18195 d_vsnprintf="$undef"
18201 : see if sockatmark exists
18202 set sockatmark d_sockatmark
18205 : see if prototype for sockatmark is available
18207 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18210 : see if socks5_init exists
18211 set socks5_init d_socks5_init
18214 : see if sprintf returns the length of the string in the buffer as per ANSI
18215 $echo "Checking whether sprintf returns the length of the string..." >&4
18218 #$i_stdlib I_STDLIB
18220 #include <stdlib.h>
18222 #$i_string I_STRING
18224 # include <string.h>
18226 # include <strings.h>
18235 int check (size_t expect, int test) {
18236 size_t got = strlen(buffer);
18240 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18245 int main(int argc, char **argv) {
18248 check(sprintf(buffer, ""), ++test);
18249 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18250 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18257 if eval $compile; then
18261 sprintf returns the length of the string (as ANSI says it should)
18263 d_sprintf_returns_strlen="$define"
18266 sprintf does not return the length of the string (how old is this system?)
18268 d_sprintf_returns_strlen="$undef"
18272 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18273 d_sprintf_returns_strlen="$undef"
18277 : see if srand48_r exists
18278 set srand48_r d_srand48_r
18280 case "$d_srand48_r" in
18282 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18283 case "$d_srand48_r_proto:$usethreads" in
18284 ":define") d_srand48_r_proto=define
18285 set d_srand48_r_proto srand48_r $hdrs
18289 case "$d_srand48_r_proto" in
18291 case "$srand48_r_proto" in
18292 ''|0) try='int srand48_r(long, struct drand48_data*);'
18293 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18295 case "$srand48_r_proto" in
18296 ''|0) d_srand48_r=undef
18298 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18299 * ) case "$srand48_r_proto" in
18300 REENTRANT_PROTO*) ;;
18301 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18303 echo "Prototype: $try" ;;
18306 *) case "$usethreads" in
18307 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18314 *) srand48_r_proto=0
18318 : see if srandom_r exists
18319 set srandom_r d_srandom_r
18321 case "$d_srandom_r" in
18323 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18324 case "$d_srandom_r_proto:$usethreads" in
18325 ":define") d_srandom_r_proto=define
18326 set d_srandom_r_proto srandom_r $hdrs
18330 case "$d_srandom_r_proto" in
18332 case "$srandom_r_proto" in
18333 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18334 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18336 case "$srandom_r_proto" in
18337 ''|0) d_srandom_r=undef
18339 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18340 * ) case "$srandom_r_proto" in
18341 REENTRANT_PROTO*) ;;
18342 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18344 echo "Prototype: $try" ;;
18347 *) case "$usethreads" in
18348 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18355 *) srandom_r_proto=0
18359 : see if prototype for setresgid is available
18361 set d_sresgproto setresgid $i_unistd unistd.h
18364 : see if prototype for setresuid is available
18366 set d_sresuproto setresuid $i_unistd unistd.h
18369 : see if sys/stat.h is available
18370 set sys/stat.h i_sysstat
18373 : see if stat knows about block sizes
18375 echo "Checking to see if your struct stat has st_blocks field..." >&4
18376 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18379 : see if this is a sys/vfs.h system
18380 set sys/vfs.h i_sysvfs
18383 : see if this is a sys/statfs.h system
18384 set sys/statfs.h i_sysstatfs
18387 : Check for statfs_s
18389 echo "Checking to see if your system supports struct statfs..." >&4
18390 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
18392 case "$d_statfs_s" in
18393 "$define") echo "Yes, it does." ;;
18394 *) echo "No, it doesn't." ;;
18398 : see if struct statfs knows about f_flags
18399 case "$d_statfs_s" in
18402 echo "Checking to see if your struct statfs has f_flags field..." >&4
18403 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
18407 set d_statfs_f_flags
18411 case "$d_statfs_f_flags" in
18412 "$define") echo "Yes, it does." ;;
18413 *) echo "No, it doesn't." ;;
18416 : see what flavor, if any, of static inline is supported
18418 echo "Checking to see if your system supports static inline..."
18419 $cat > try.c <<'EOCP'
18420 #include <stdlib.h>
18421 extern int f_via_a(int x);
18422 extern int f_via_b(int x);
18423 int main(int argc, char **argv)
18432 return EXIT_SUCCESS;
18435 return EXIT_FAILURE;
18439 $cat > a.c <<'EOCP'
18440 static INLINE int f(int x) {
18451 $cat > b.c <<'EOCP'
18452 extern int f(int x);
18460 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18461 case "$perl_static_inline" in
18462 '') # Check the various possibilities, and break out on success.
18463 # For gcc, prefer __inline__, which will still permit
18464 # cflags.SH to add in -ansi.
18465 case "$gccversion" in
18466 '') xxx="inline __inline__ __inline _inline";;
18467 *) xxx="__inline__ inline __inline _inline";;
18469 for inline in $xxx; do
18470 set try -DINLINE=$inline a.c
18471 if eval $compile && $run ./try; then
18472 # Now make sure there is no external linkage of static
18474 set try -DINLINE=$inline -DUSE_B a.c b.c
18475 if eval $compile && $run ./try; then
18476 $echo "Your compiler supports static $inline, " >&4
18477 $echo "but it also creates an external definition," >&4
18478 $echo "so I won't use it." >&4
18481 $echo "Your compiler supports static $inline." >&4
18483 perl_static_inline="static $inline";
18487 $echo "Your compiler does NOT support static $inline." >&4
18492 *inline*) # Some variant of inline exists.
18493 echo "Keeping your $hint value of $perl_static_inline."
18496 static) # No inline capabilities
18497 echo "Keeping your $hint value of $perl_static_inline."
18500 *) # Unrecognized previous value -- blindly trust the supplied
18501 # value and hope it makes sense. Use old value for
18502 # d_static_inline, if there is one.
18503 echo "Keeping your $hint value of $perl_static_inline."
18504 case "$d_static_inline" in
18506 *) val=$d_static_inline ;;
18510 # Fallback to plain 'static' if nothing worked.
18511 case "$perl_static_inline" in
18513 perl_static_inline="static"
18517 set d_static_inline
18519 $rm -f a.[co] b.[co]
18522 : Check stream access
18524 Checking how to access stdio streams by file descriptor number...
18526 case "$stdio_stream_array" in
18527 '') $cat >try.c <<EOCP
18530 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18534 for s in _iob __iob __sF
18536 set try -DSTDIO_STREAM_ARRAY=$s
18537 if eval $compile; then
18538 case "`$run ./try`" in
18539 yes) stdio_stream_array=$s; break ;;
18545 case "$stdio_stream_array" in
18547 I can't figure out how to access stdio streams by file descriptor number.
18549 d_stdio_stream_array="$undef"
18552 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18554 d_stdio_stream_array="$define"
18558 : see if strcoll exists
18559 set strcoll d_strcoll
18562 : check for structure copying
18564 echo "Checking to see if your C compiler can copy structs..." >&4
18565 $cat >try.c <<'EOCP'
18575 if $cc -c try.c >/dev/null 2>&1 ; then
18577 echo "Yup, it can."
18580 echo "Nope, it can't."
18586 : see if strerror and/or sys_errlist[] exist
18588 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18589 if set strerror val -f d_strerror; eval $csym; $val; then
18590 echo 'strerror() found.' >&4
18591 d_strerror="$define"
18592 d_strerrm='strerror(e)'
18593 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18594 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18595 d_syserrlst="$define"
18597 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18598 d_syserrlst="$undef"
18600 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18601 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18602 echo 'strerror() found in string header.' >&4
18603 d_strerror="$define"
18604 d_strerrm='strerror(e)'
18605 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18606 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18607 d_syserrlst="$define"
18609 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18610 d_syserrlst="$undef"
18612 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18613 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18614 d_strerror="$undef"
18615 d_syserrlst="$define"
18616 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18618 echo 'strerror() and sys_errlist[] NOT found.' >&4
18619 d_strerror="$undef"
18620 d_syserrlst="$undef"
18621 d_strerrm='"unknown"'
18625 : see if strerror_r exists
18626 set strerror_r d_strerror_r
18628 case "$d_strerror_r" in
18630 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18631 case "$d_strerror_r_proto:$usethreads" in
18632 ":define") d_strerror_r_proto=define
18633 set d_strerror_r_proto strerror_r $hdrs
18637 case "$d_strerror_r_proto" in
18639 case "$strerror_r_proto" in
18640 ''|0) try='int strerror_r(int, char*, size_t);'
18641 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18643 case "$strerror_r_proto" in
18644 ''|0) try='int strerror_r(int, char*, int);'
18645 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18647 case "$strerror_r_proto" in
18648 ''|0) try='char* strerror_r(int, char*, size_t);'
18649 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18651 case "$strerror_r_proto" in
18652 ''|0) d_strerror_r=undef
18654 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18655 * ) case "$strerror_r_proto" in
18656 REENTRANT_PROTO*) ;;
18657 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18659 echo "Prototype: $try" ;;
18662 *) case "$usethreads" in
18663 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18670 *) strerror_r_proto=0
18674 : see if strftime exists
18675 set strftime d_strftime
18678 : see if strlcat exists
18679 set strlcat d_strlcat
18682 : see if strlcpy exists
18683 set strlcpy d_strlcpy
18686 : see if strtod exists
18687 set strtod d_strtod
18690 : see if strtol exists
18691 set strtol d_strtol
18694 : see if strtold exists
18695 set strtold d_strtold
18698 : see if strtoll exists
18699 set strtoll d_strtoll
18702 case "$d_longlong-$d_strtoll" in
18705 Checking whether your strtoll() works okay...
18707 $cat >try.c <<'EOCP'
18710 #define strtoll __strtoll
18713 #define strtoll _strtoll
18716 extern long long int strtoll(char *s, char **, int);
18717 static int bad = 0;
18718 int check(char *s, long long ell, int een) {
18721 gll = strtoll(s, 0, 10);
18722 if (!((gll == ell) && (errno == een)))
18726 check(" 1", 1LL, 0);
18727 check(" 0", 0LL, 0);
18728 check("-1", -1LL, 0);
18729 check("-9223372036854775808", -9223372036854775808LL, 0);
18730 check("-9223372036854775808", -9223372036854775808LL, 0);
18731 check(" 9223372036854775807", 9223372036854775807LL, 0);
18732 check("-9223372036854775808", -9223372036854775808LL, 0);
18733 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18734 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18740 if eval $compile; then
18743 ok) echo "Your strtoll() seems to be working okay." ;;
18745 Your strtoll() doesn't seem to be working okay.
18751 echo "(I can't seem to compile the test program--assuming it doesn't)"
18757 : see if strtoq exists
18758 set strtoq d_strtoq
18761 : see if strtoul exists
18762 set strtoul d_strtoul
18765 case "$d_strtoul" in
18768 Checking whether your strtoul() works okay...
18770 $cat >try.c <<'EOCP'
18773 extern unsigned long int strtoul(char *s, char **, int);
18774 static int bad = 0;
18775 void check(char *s, unsigned long eul, int een) {
18778 gul = strtoul(s, 0, 10);
18779 if (!((gul == eul) && (errno == een)))
18783 check(" 1", 1L, 0);
18784 check(" 0", 0L, 0);
18786 case "$longsize" in
18788 $cat >>try.c <<'EOCP'
18789 check("18446744073709551615", 18446744073709551615UL, 0);
18790 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18791 #if 0 /* strtoul() for /^-/ strings is undefined. */
18792 check("-1", 18446744073709551615UL, 0);
18793 check("-18446744073709551614", 2, 0);
18794 check("-18446744073709551615", 1, 0);
18795 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18796 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18801 $cat >>try.c <<'EOCP'
18802 check("4294967295", 4294967295UL, 0);
18803 check("4294967296", 4294967295UL, ERANGE);
18804 #if 0 /* strtoul() for /^-/ strings is undefined. */
18805 check("-1", 4294967295UL, 0);
18806 check("-4294967294", 2, 0);
18807 check("-4294967295", 1, 0);
18808 check("-4294967296", 4294967295UL, ERANGE);
18809 check("-4294967297", 4294967295UL, ERANGE);
18814 : Should we write these tests to be more portable by sprintf-ing
18815 : ~0 and then manipulating that char string as input for strtol?
18818 $cat >>try.c <<'EOCP'
18825 if eval $compile; then
18826 case "`$run ./try`" in
18827 ok) echo "Your strtoul() seems to be working okay." ;;
18829 Your strtoul() doesn't seem to be working okay.
18835 echo "(I can't seem to compile the test program--assuming it doesn't)"
18841 : see if strtoull exists
18842 set strtoull d_strtoull
18845 case "$d_longlong-$d_strtoull" in
18848 Checking whether your strtoull() works okay...
18850 $cat >try.c <<'EOCP'
18853 #define strtoull __strtoull
18856 extern unsigned long long int strtoull(char *s, char **, int);
18857 static int bad = 0;
18858 int check(char *s, long long eull, int een) {
18861 gull = strtoull(s, 0, 10);
18862 if (!((gull == eull) && (errno == een)))
18866 check(" 1", 1LL, 0);
18867 check(" 0", 0LL, 0);
18868 check("18446744073709551615", 18446744073709551615ULL, 0);
18869 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18870 #if 0 /* strtoull() for /^-/ strings is undefined. */
18871 check("-1", 18446744073709551615ULL, 0);
18872 check("-18446744073709551614", 2LL, 0);
18873 check("-18446744073709551615", 1LL, 0);
18874 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18875 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18882 if eval $compile; then
18883 case "`$run ./try`" in
18884 ok) echo "Your strtoull() seems to be working okay." ;;
18886 Your strtoull() doesn't seem to be working okay.
18888 d_strtoull="$undef"
18892 echo "(I can't seem to compile the test program--assuming it doesn't)"
18893 d_strtoull="$undef"
18898 : see if strtouq exists
18899 set strtouq d_strtouq
18902 case "$d_strtouq" in
18905 Checking whether your strtouq() works okay...
18907 $cat >try.c <<'EOCP'
18910 extern unsigned long long int strtouq(char *s, char **, int);
18911 static int bad = 0;
18912 void check(char *s, unsigned long long eull, int een) {
18913 unsigned long long gull;
18915 gull = strtouq(s, 0, 10);
18916 if (!((gull == eull) && (errno == een)))
18920 check(" 1", 1LL, 0);
18921 check(" 0", 0LL, 0);
18922 check("18446744073709551615", 18446744073709551615ULL, 0);
18923 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18924 #if 0 /* strtouq() for /^-/ strings is undefined. */
18925 check("-1", 18446744073709551615ULL, 0);
18926 check("-18446744073709551614", 2LL, 0);
18927 check("-18446744073709551615", 1LL, 0);
18928 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18929 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18937 if eval $compile; then
18938 case "`$run ./try`" in
18939 ok) echo "Your strtouq() seems to be working okay." ;;
18941 Your strtouq() doesn't seem to be working okay.
18947 echo "(I can't seem to compile the test program--assuming it doesn't)"
18953 : see if strxfrm exists
18954 set strxfrm d_strxfrm
18957 : see if symlink exists
18958 set symlink d_symlink
18961 : see if syscall exists
18962 set syscall d_syscall
18965 : see if prototype for syscall is available
18967 set d_syscallproto syscall $i_unistd unistd.h
18970 : see if sysconf exists
18971 set sysconf d_sysconf
18974 : see if system exists
18975 set system d_system
18978 : see if tcgetpgrp exists
18979 set tcgetpgrp d_tcgetpgrp
18982 : see if tcsetpgrp exists
18983 set tcsetpgrp d_tcsetpgrp
18986 : see if prototype for telldir is available
18988 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18991 : see if time exists
18993 if test "X$d_time" = X -o X"$timetype" = X; then
18994 if set time val -f d_time; eval $csym; $val; then
18995 echo 'time() found.' >&4
18997 rp="What is the type returned by time() on this system?"
18998 set time_t timetype long stdio.h sys/types.h
19001 echo 'time() not found, hope that will do.' >&4
19009 : see if timegm exists
19010 set timegm d_timegm
19013 : see if this is a sys/times.h system
19014 set sys/times.h i_systimes
19017 : see if times exists
19019 if set times val -f d_times; eval $csym; $val; then
19020 echo 'times() found.' >&4
19023 case "$i_systimes" in
19024 "$define") inc='sys/times.h';;
19026 rp="What is the type returned by times() on this system?"
19027 set clock_t clocktype long stdio.h sys/types.h $inc
19030 echo 'times() NOT found, hope that will do.' >&4
19035 : see if tmpnam_r exists
19036 set tmpnam_r d_tmpnam_r
19038 case "$d_tmpnam_r" in
19040 hdrs="$i_systypes sys/types.h define stdio.h "
19041 case "$d_tmpnam_r_proto:$usethreads" in
19042 ":define") d_tmpnam_r_proto=define
19043 set d_tmpnam_r_proto tmpnam_r $hdrs
19047 case "$d_tmpnam_r_proto" in
19049 case "$tmpnam_r_proto" in
19050 ''|0) try='char* tmpnam_r(char*);'
19051 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19053 case "$tmpnam_r_proto" in
19054 ''|0) d_tmpnam_r=undef
19056 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19057 * ) case "$tmpnam_r_proto" in
19058 REENTRANT_PROTO*) ;;
19059 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19061 echo "Prototype: $try" ;;
19064 *) case "$usethreads" in
19065 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19072 *) tmpnam_r_proto=0
19076 : see if truncate exists
19077 set truncate d_truncate
19080 : see if ttyname_r exists
19081 set ttyname_r d_ttyname_r
19083 case "$d_ttyname_r" in
19085 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19086 case "$d_ttyname_r_proto:$usethreads" in
19087 ":define") d_ttyname_r_proto=define
19088 set d_ttyname_r_proto ttyname_r $hdrs
19092 case "$d_ttyname_r_proto" in
19094 case "$ttyname_r_proto" in
19095 ''|0) try='int ttyname_r(int, char*, size_t);'
19096 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19098 case "$ttyname_r_proto" in
19099 ''|0) try='int ttyname_r(int, char*, int);'
19100 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19102 case "$ttyname_r_proto" in
19103 ''|0) try='char* ttyname_r(int, char*, int);'
19104 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19106 case "$ttyname_r_proto" in
19107 ''|0) d_ttyname_r=undef
19109 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19110 * ) case "$ttyname_r_proto" in
19111 REENTRANT_PROTO*) ;;
19112 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19114 echo "Prototype: $try" ;;
19117 *) case "$usethreads" in
19118 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19125 *) ttyname_r_proto=0
19129 : see if tzname[] exists
19131 if set tzname val -a d_tzname; eval $csym; $val; then
19133 echo 'tzname[] found.' >&4
19136 echo 'tzname[] NOT found.' >&4
19141 : Check if is a multiplatform env
19143 darwin) multiarch="$define" ;;
19145 case "$multiarch" in
19146 ''|[nN]*) multiarch="$undef" ;;
19149 : check for ordering of bytes in a UV
19151 case "$multiarch" in
19154 You seem to be doing a multiarchitecture build,
19155 skipping the byteorder check.
19161 case "$byteorder" in
19164 In the following, larger digits indicate more significance. A big-endian
19165 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19166 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19167 machines may have weird orders like 3412. A Cray will report 87654321,
19168 an Alpha will report 12345678. If the test program works the default is
19170 I'm now running the test program...
19174 #$i_stdlib I_STDLIB
19176 #include <stdlib.h>
19178 #include <sys/types.h>
19179 typedef $uvtype UV;
19189 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19191 u.l = (UV)0x04030201;
19192 for (i = 0; i < $uvsize; i++)
19193 printf("%c", u.c[i]+'0');
19200 if eval $compile && $run ./try > /dev/null; then
19203 [1-4][1-4][1-4][1-4]|12345678|87654321)
19204 echo "(The test program ran ok.)"
19205 echo "byteorder=$dflt"
19208 ????|????????) echo "(The test program ran ok.)" ;;
19209 *) echo "(The test program didn't run right for some reason.)" ;;
19214 (I can't seem to compile the test program. Guessing big-endian...)
19217 case "$xxx_prompt" in
19219 rp="What is the order of bytes in $uvtype?"
19232 : Checking 32bit alignedness
19235 Checking to see whether you can access character data unalignedly...
19237 case "$d_u32align" in
19238 '') $cat >try.c <<EOCP
19240 #$i_stdlib I_STDLIB
19242 #include <stdlib.h>
19244 #define U32 $u32type
19245 #define BYTEORDER 0x$byteorder
19247 #include <signal.h>
19249 $signal_t bletch(int s) { exit(4); }
19252 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19253 volatile U8 buf[8];
19257 if (sizeof(U32) != 4) {
19258 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19265 signal(SIGBUS, bletch);
19277 for (i = 0; i < 4; i++) {
19278 up = (U32*)(buf + i);
19279 if (! ((*up == 1 << (8*i)) || /* big-endian */
19280 (*up == 1 << (8*(3-i))) /* little-endian */
19284 printf("read failed (%x)\n", *up);
19290 for (i = 0; i < 4; i++) {
19291 up = (U32*)(buf + i);
19293 if (*up != 0xBeef) {
19294 printf("write failed (%x)\n", *up);
19308 if eval $compile_ok; then
19309 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19310 $run ./try 2>&1 >/dev/null
19313 You can access character data pretty unalignedly.
19315 d_u32align="$undef"
19318 It seems that you must access character data in an aligned manner.
19320 d_u32align="$define"
19324 rp='Can you access character data at unaligned addresses?'
19328 [yY]*) d_u32align="$undef" ;;
19329 *) d_u32align="$define" ;;
19336 : see if ualarm exists
19337 set ualarm d_ualarm
19340 : see if umask exists
19344 : see if unordered exists
19345 set unordered d_unordered
19348 : see if unsetenv exists
19349 set unsetenv d_unsetenv
19352 : see if usleep exists
19353 set usleep d_usleep
19356 : see if prototype for usleep is available
19358 set d_usleepproto usleep $i_unistd unistd.h
19361 : see if ustat exists
19365 : see if closedir exists
19366 set closedir d_closedir
19369 case "$d_closedir" in
19372 echo "Checking whether closedir() returns a status..." >&4
19374 #$i_dirent I_DIRENT /**/
19375 #$i_sysdir I_SYS_DIR /**/
19376 #$i_sysndir I_SYS_NDIR /**/
19377 #$i_systypes I_SYS_TYPES /**/
19379 #if defined(I_SYS_TYPES)
19380 #include <sys/types.h>
19382 #if defined(I_DIRENT)
19383 #include <dirent.h>
19386 #include <sys/ndir.h>
19390 #include <ndir.h> /* may be wrong in the future */
19392 #include <sys/dir.h>
19397 int main() { return closedir(opendir(".")); }
19400 if eval $compile_ok; then
19401 if $run ./try > /dev/null 2>&1 ; then
19402 echo "Yes, it does."
19405 echo "No, it doesn't."
19409 echo "(I can't seem to compile the test program--assuming it doesn't)"
19417 set d_void_closedir
19421 : see if there is a wait4
19425 : see if waitpid exists
19426 set waitpid d_waitpid
19431 $cat >try.c <<'EOCP'
19437 return (wcscmp (s, s) ? 1 : 0);
19442 if eval $compile; then
19445 0) echo "A working wcscmp() found." >&4
19447 *) echo "wcscmp() found, but it doesn't work" >&4
19451 echo "wcscmp() NOT found." >&4
19457 : see if wcstombs exists
19458 set wcstombs d_wcstombs
19463 $cat >try.c <<'EOCP'
19468 wchar_t dst[4], *src = L" ";
19470 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19475 if eval $compile; then
19478 0) echo "A working wcsxfrm() found." >&4
19480 *) echo "wcsxfrm() found, but it doesn't work" >&4
19484 echo "wcsxfrm() NOT found." >&4
19490 : see if wctomb exists
19491 set wctomb d_wctomb
19494 : see if writev exists
19495 set writev d_writev
19498 : check for alignment requirements
19500 case "$alignbytes" in
19501 '') echo "Checking alignment constraints..." >&4
19502 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19503 $cat >try.c <<'EOCP'
19504 typedef long double NV;
19507 $cat >try.c <<'EOCP'
19511 $cat >>try.c <<'EOCP'
19519 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19524 if eval $compile_ok; then
19528 echo "(I can't seem to compile the test program...)"
19530 case "$multiarch" in
19532 : The usual safe value is 8, but Darwin with -Duselongdouble
19533 : needs 16. Hence, we will take 8 as a minimum, but allow
19534 : Configure to pick a larger value if needed.
19535 if $test "$dflt" -lt 8; then
19537 echo "Setting alignment to 8 for multiarch support.">&4
19542 *) dflt="$alignbytes"
19545 rp="Doubles must be aligned on a how-many-byte boundary?"
19550 : set the base revision
19553 : length of character in bytes. Is always 1, otherwise it is not C
19554 : This used to be a test using sizeof
19557 : Check for the number of bits in a character
19558 case "$charbits" in
19559 '') echo "Checking how long a character is (in bits)..." >&4
19566 for (c = 1, n = 0; c; c <<= 1, n++) ;
19567 printf ("%d\n", n);
19572 if eval $compile_ok; then
19576 echo "(I can't seem to compile the test program. Guessing...)"
19583 rp="What is the length of a character (in bits)?"
19587 case "$charbits" in
19590 Your system has an unsigned character size of $charbits bits, which
19591 is rather unusual (normally it is 8 bits). Perl likely will not work
19592 correctly on your system, with subtle bugs in various places.
19594 rp='Do you really want to continue?'
19598 [yY]) echo >&4 "Okay, continuing." ;;
19603 : how do we concatenate cpp tokens here?
19605 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19606 $cat >cpp_stuff.c <<'EOCP'
19607 #define RCAT(a,b)a/**/b
19608 #define ACAT(a,b)a ## b
19612 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19613 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19614 echo "Oh! Smells like ANSI's been here." >&4
19615 echo "We can catify or stringify, separately or together!"
19617 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19618 echo "Ah, yes! The good old days!" >&4
19619 echo "However, in the good old days we don't know how to stringify and"
19620 echo "catify at the same time."
19624 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19625 You're going to have to edit the values of CAT[2-5] in config.h...
19627 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19631 : see if this is a db.h system
19637 : Check db version.
19639 echo "Checking Berkeley DB version ..." >&4
19645 #include <sys/types.h>
19647 #$i_stdlib I_STDLIB
19649 #include <stdlib.h>
19652 int main(int argc, char *argv[])
19654 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19655 int Major, Minor, Patch ;
19656 unsigned long Version ;
19657 (void)db_version(&Major, &Minor, &Patch) ;
19659 printf("%d %d %d %d %d %d\n",
19660 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19661 Major, Minor, Patch);
19664 printf("You have Berkeley DB Version 2 or greater.\n");
19666 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19667 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19668 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19669 Major, Minor, Patch) ;
19671 /* check that db.h & libdb are compatible */
19672 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19673 printf("db.h and libdb are incompatible.\n") ;
19677 printf("db.h and libdb are compatible.\n") ;
19679 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19680 + DB_VERSION_PATCH ;
19682 /* needs to be >= 2.3.4 */
19683 if (Version < 2003004) {
19684 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19685 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19691 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19696 printf("You have Berkeley DB Version 1.\n");
19697 exit(0); /* DB version < 2: the coast is clear. */
19699 exit(1); /* <db.h> not Berkeley DB? */
19705 if eval $compile_ok && $run ./try; then
19706 echo 'Looks OK.' >&4
19708 db_version_major=$1
19709 db_version_minor=$2
19710 db_version_patch=$3
19712 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19716 : Remove db from list of libraries to use
19717 echo "Removing unusable -ldb from library list" >&4
19718 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19721 echo "libs = $libs" >&4
19731 : Check the return type needed for hash
19733 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19739 #include <sys/types.h>
19742 #ifndef DB_VERSION_MAJOR
19743 u_int32_t hash_cb (const void* ptr, size_t size)
19749 info.hash = hash_cb;
19753 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19754 if $contains warning try.out >>/dev/null 2>&1 ; then
19757 db_hashtype='u_int32_t'
19760 : XXX Maybe we should just give up here.
19761 db_hashtype=u_int32_t
19763 echo "Help: I can't seem to compile the db test program." >&4
19764 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19767 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19769 *) db_hashtype=u_int32_t
19774 : Check the return type needed for prefix
19776 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19782 #include <sys/types.h>
19785 #ifndef DB_VERSION_MAJOR
19786 size_t prefix_cb (const DBT *key1, const DBT *key2)
19792 info.prefix = prefix_cb;
19796 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19797 if $contains warning try.out >>/dev/null 2>&1 ; then
19798 db_prefixtype='int'
19800 db_prefixtype='size_t'
19803 db_prefixtype='size_t'
19804 : XXX Maybe we should just give up here.
19806 echo "Help: I can't seem to compile the db test program." >&4
19807 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19810 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19812 *) db_prefixtype='size_t'
19816 : How can we generate normalized random numbers ?
19818 echo "Using our internal random number implementation..." >&4
19821 *-Dmy_rand=*|*-Dmy_srand=*)
19822 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19823 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19824 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19825 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19829 randfunc=Perl_drand48
19830 drand01="Perl_drand48()"
19831 seedfunc="Perl_drand48_init"
19835 : Determine if this is an EBCDIC system
19837 echo "Determining whether or not we are on an EBCDIC system..." >&4
19838 $cat >try.c <<'EOM'
19841 if ('M'==0xd4) return 0;
19848 if eval $compile_ok; then
19849 if $run ./try; then
19850 echo "You seem to speak EBCDIC." >&4
19853 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19856 echo "I'm unable to compile the test program." >&4
19857 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19863 : Check how to flush
19866 Checking how to flush all pending stdio output...
19868 # I only know how to find the first 32 possibly open files on SunOS.
19869 # See also hints/sunos_4_1.sh and util.c --AD
19871 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19873 $cat >>try.c <<EOCP
19875 #$i_stdlib I_STDLIB
19877 #include <stdlib.h>
19879 #$i_unistd I_UNISTD
19881 # include <unistd.h>
19883 #$d_sysconf HAS_SYSCONF
19884 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19885 #ifdef HAS_STDIO_STREAM_ARRAY
19886 # define STDIO_STREAM_ARRAY $stdio_stream_array
19891 p = fopen("try.out", "w");
19895 # ifdef TRY_FPRINTF
19899 #ifdef TRY_FFLUSH_NULL
19902 #ifdef TRY_FFLUSH_ALL
19904 long open_max = -1;
19905 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19906 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19908 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19909 open_max = sysconf(_SC_OPEN_MAX);
19912 open_max = FOPEN_MAX;
19915 open_max = OPEN_MAX;
19924 # ifdef HAS_STDIO_STREAM_ARRAY
19925 if (open_max > 0) {
19927 for (i = 0; i < open_max; i++)
19928 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19929 STDIO_STREAM_ARRAY[i]._file < open_max &&
19930 STDIO_STREAM_ARRAY[i]._flag)
19931 fflush(&STDIO_STREAM_ARRAY[i]);
19939 : first we have to find out how _not_ to flush
19941 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19943 set try -DTRY_FPUTC
19944 if eval $compile; then
19945 $run ./try 2>/dev/null
19948 if $test ! -s try.out -a "X$code" = X42; then
19954 set try -DTRY_FPRINTF
19955 if eval $compile; then
19956 $run ./try 2>/dev/null
19959 if $test ! -s try.out -a "X$code" = X42; then
19960 output=-DTRY_FPRINTF
19966 : check for fflush NULL behavior
19967 case "$fflushNULL" in
19968 '') set try -DTRY_FFLUSH_NULL $output
19969 if eval $compile; then
19970 $run ./try 2>/dev/null
19973 if $test -s try.out -a "X$code" = X42; then
19974 fflushNULL="`$cat try.out`"
19976 if $test "X$code" != X42; then
19978 (If this test failed, don't worry, we'll try another method shortly.)
19983 $rm -f core try.core core.try.*
19984 case "$fflushNULL" in
19986 Your fflush(NULL) works okay for output streams.
19987 Let's see if it clobbers input pipes...
19989 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19990 # bug that improperly flushes the input end of pipes. So we avoid the
19991 # autoflush on fork/system/exec support for now. :-(
19992 $cat >tryp.c <<EOCP
19995 main(int argc, char **argv)
20001 while ((i = getc(stdin)) != -1
20002 && (*bp++ = i) != '\n'
20003 && bp < &buf[1024])
20006 fprintf(stdout, "%s", buf);
20014 fflushNULL="$define"
20016 if eval $compile; then
20018 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20019 if $test "X$targethost" != X; then
20022 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20024 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20026 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20028 fflush(NULL) seems to behave okay with input streams.
20030 fflushNULL="$define"
20033 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20035 fflushNULL="$undef"
20038 $rm -f core tryp.c tryp.core core.tryp.*
20041 Your fflush(NULL) isn't working (contrary to ANSI C).
20043 fflushNULL="$undef"
20046 Cannot figure out whether your fflush(NULL) works or not.
20047 I'm assuming it doesn't (contrary to ANSI C).
20049 fflushNULL="$undef"
20053 $define|true|[yY]*)
20054 fflushNULL="$define"
20057 fflushNULL="$undef"
20060 : check explicit looping only if NULL did not work, and if the pipe
20061 : bug does not show up on an explicit flush too
20062 case "$fflushNULL" in
20064 $cat >tryp.c <<EOCP
20067 main(int argc, char **argv)
20073 while ((i = getc(stdin)) != -1
20074 && (*bp++ = i) != '\n'
20075 && bp < &buf[1024])
20078 fprintf(stdout, "%s", buf);
20087 if eval $compile; then
20089 if $test "X$targethost" != X; then
20092 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20094 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20096 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20098 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20100 : now check for fflushall behaviour
20101 case "$fflushall" in
20102 '') set try -DTRY_FFLUSH_ALL $output
20103 if eval $compile; then
20105 (Now testing the other method--but note that this also may fail.)
20107 $run ./try 2>/dev/null
20110 if $test -s try.out -a "X$code" = X42; then
20111 fflushall="`$cat try.out`"
20115 case "$fflushall" in
20117 Whew. Flushing explicitly all the stdio streams works.
20119 fflushall="$define"
20122 Sigh. Flushing explicitly all the stdio streams doesn't work.
20127 Cannot figure out whether flushing stdio streams explicitly works or not.
20128 I'm assuming it doesn't.
20134 "$define"|true|[yY]*)
20135 fflushall="$define"
20143 All is futile. Even fflush(stdin) clobbers input pipes!
20150 $rm -f core tryp.c tryp.core core.tryp.*
20152 *) fflushall="$undef"
20156 case "$fflushNULL$fflushall" in
20159 OK, I give up. I cannot figure out how to flush pending stdio output.
20160 We won't be flushing handles at all before fork/exec/popen.
20166 : Store the full pathname to the ar program for use in the C program
20167 : Respect a hint or command line value for full_ar.
20172 : Store the full pathname to the sed program for use in the C program
20175 : see what type gids are declared as in the kernel
20177 echo "Looking for the type for group ids returned by getgid()."
20178 set gid_t gidtype xxx stdio.h sys/types.h
20182 xxx=`./findhdr sys/user.h`
20183 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20185 unsigned) dflt="$1 $2" ;;
20189 *) dflt="$gidtype";;
20192 gid_t) echo "gid_t found." ;;
20193 *) rp="What is the type for group ids returned by getgid()?"
20199 : Check the size of GID
20202 *_t) zzz="$gidtype" ;;
20205 echo "Checking the size of $zzz..." >&4
20207 #include <sys/types.h>
20209 #$i_stdlib I_STDLIB
20211 #include <stdlib.h>
20214 printf("%d\n", (int)sizeof($gidtype));
20219 if eval $compile_ok; then
20223 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20226 echo "Your $zzz is $gidsize bytes long."
20231 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20235 : Check if GID is signed
20238 *_t) zzz="$gidtype" ;;
20241 echo "Checking the sign of $zzz..." >&4
20243 #include <sys/types.h>
20254 if eval $compile; then
20258 echo "(I can't execute the test program--guessing unsigned.)" >&4
20262 1) echo "Your $zzz is unsigned." ;;
20263 -1) echo "Your $zzz is signed." ;;
20269 echo "(I can't compile the test program--guessing unsigned.)" >&4
20273 : Check 64bit sizes
20276 if $test X"$quadtype" != X; then
20278 echo "Checking how to print 64-bit integers..." >&4
20280 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20281 $cat >try.c <<'EOCP'
20282 #include <sys/types.h>
20285 int q = 12345678901;
20286 printf("%ld\n", q);
20290 if eval $compile; then
20294 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20295 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20296 echo "We will use %d."
20302 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20303 $cat >try.c <<'EOCP'
20304 #include <sys/types.h>
20307 long q = 12345678901;
20308 printf("%ld\n", q);
20312 if eval $compile; then
20316 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20317 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20318 echo "We will use %ld."
20324 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20325 $cat >try.c <<'EOCP'
20326 #include <sys/types.h>
20327 #include <inttypes.h>
20330 int64_t q = 12345678901;
20331 printf("%" PRId64 "\n", q);
20335 if eval $compile; then
20339 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20340 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20341 echo "We will use the C9X style."
20347 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20349 #include <sys/types.h>
20352 $quadtype q = 12345678901;
20353 printf("%Ld\n", q);
20357 if eval $compile; then
20361 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20362 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20363 echo "We will use %Ld."
20369 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20370 $cat >try.c <<'EOCP'
20371 #include <sys/types.h>
20374 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20375 printf("%lld\n", q);
20379 if eval $compile; then
20383 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20384 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20385 echo "We will use the %lld style."
20391 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20393 #include <sys/types.h>
20396 $quadtype q = 12345678901;
20397 printf("%qd\n", q);
20401 if eval $compile; then
20405 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20406 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20407 echo "We will use %qd."
20413 if $test X"$sPRId64" = X; then
20414 echo "Cannot figure out how to print 64-bit integers." >&4
20421 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20422 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20424 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20425 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20429 : Check format strings for internal types
20431 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20433 if $test X"$ivsize" = X8; then
20434 ivdformat="$sPRId64"
20435 uvuformat="$sPRIu64"
20436 uvoformat="$sPRIo64"
20437 uvxformat="$sPRIx64"
20438 uvXUformat="$sPRIXU64"
20440 if $test X"$ivsize" = X"$longsize"; then
20447 if $test X"$ivsize" = X"$intsize"; then
20455 if $test X"$ivsize" = X"$shortsize"; then
20466 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20467 nveformat="$sPRIeldbl"
20468 nvfformat="$sPRIfldbl"
20469 nvgformat="$sPRIgldbl"
20470 nvEUformat="$sPRIEUldbl"
20471 nvFUformat="$sPRIFUldbl"
20472 nvGUformat="$sPRIGUldbl"
20482 case "$ivdformat" in
20483 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20488 : Check format string for GID
20491 $echo "Checking the format string to be used for gids..." >&4
20494 -1) if $test X"$gidsize" = X"$ivsize"; then
20495 gidformat="$ivdformat"
20497 if $test X"$gidsize" = X"$longsize"; then
20500 if $test X"$gidsize" = X"$intsize"; then
20503 if $test X"$gidsize" = X"$shortsize"; then
20510 *) if $test X"$gidsize" = X"$uvsize"; then
20511 gidformat="$uvuformat"
20513 if $test X"$gidsize" = X"$longsize"; then
20516 if $test X"$gidsize" = X"$intsize"; then
20519 if $test X"$gidsize" = X"$shortsize"; then
20528 : see if getgroups exists
20529 set getgroups d_getgrps
20532 : see if setgroups exists
20533 set setgroups d_setgrps
20536 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20538 case "$d_getgrps$d_setgrps" in
20540 case "$groupstype" in
20541 '') dflt="$gidtype" ;;
20542 *) dflt="$groupstype" ;;
20545 What type of pointer is the second argument to getgroups() and setgroups()?
20546 Usually this is the same as group ids, $gidtype, but not always.
20549 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20553 *) groupstype="$gidtype";;
20556 : check whether make sets MAKE
20558 echo "Checking if your $make program sets \$(MAKE)..." >&4
20559 case "$make_set_make" in
20561 $sed 's/^X //' > testmake.mak << 'EOF'
20563 X @echo 'maketemp="$(MAKE)"'
20565 case "`$make -f testmake.mak 2>/dev/null`" in
20566 *maketemp=*) make_set_make='#' ;;
20567 *) make_set_make="MAKE=$make" ;;
20569 $rm -f testmake.mak
20572 case "$make_set_make" in
20573 '#') echo "Yup, it does.";;
20574 *) echo "Nope, it doesn't.";;
20577 : see what type is used for mode_t
20578 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20579 set mode_t modetype int stdio.h sys/types.h
20582 : see if we need va_copy
20584 case "$i_stdarg" in
20587 #include <stdarg.h>
20589 #$i_stdlib I_STDLIB
20591 #include <stdlib.h>
20593 #include <signal.h>
20596 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20598 return vfprintf(f, fmt, *valp);
20602 myvfprintf(FILE *f, const char *fmt, va_list val)
20604 return ivfprintf(f, fmt, &val);
20608 myprintf(char *fmt, ...)
20611 va_start(val, fmt);
20612 return myvfprintf(stdout, fmt, val);
20616 main(int ac, char **av)
20618 signal(SIGSEGV, exit);
20620 myprintf("%s%cs all right, then\n", "that", '\'');
20625 if eval $compile && $run ./try 2>&1 >/dev/null; then
20626 case "`$run ./try`" in
20627 "that's all right, then")
20633 yes) echo "It seems that you don't need va_copy()." >&4
20634 need_va_copy="$undef"
20636 *) echo "It seems that va_copy() or similar will be needed." >&4
20637 need_va_copy="$define"
20642 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20643 need_va_copy="$undef"
20647 : see what type is used for size_t
20648 rp="What is the type used for the length parameter for string functions?"
20649 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20652 : check for type of arguments to gethostbyaddr.
20653 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20654 case "$d_gethbyaddr" in
20658 Checking to see what type of arguments are accepted by gethostbyaddr().
20660 hdrs="$define sys/types.h
20661 $d_socket sys/socket.h
20662 $i_niin netinet/in.h
20664 $i_unistd unistd.h"
20665 : The first arg can 'char *' or 'void *'
20666 : The second arg is some of integral type
20667 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20668 for yyy in size_t long int; do
20669 case "$netdb_host_type" in
20670 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20671 if ./protochk "$try" $hdrs; then
20672 echo "Your system accepts $xxx for the first arg."
20673 echo "...and $yyy for the second arg."
20674 netdb_host_type="$xxx"
20675 netdb_hlen_type="$yyy"
20681 : In case none of those worked, prompt the user.
20682 case "$netdb_host_type" in
20683 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20686 netdb_host_type=$ans
20687 rp='What is the type for the 2nd argument to gethostbyaddr?'
20690 netdb_hlen_type=$ans
20694 *) : no gethostbyaddr, so pick harmless defaults
20695 netdb_host_type='char *'
20696 netdb_hlen_type="$sizetype"
20699 # Remove the "const" if needed. -- but then we'll have a
20701 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20704 : check for type of argument to gethostbyname.
20705 if test "X$netdb_name_type" = X ; then
20706 case "$d_gethbyname" in
20710 Checking to see what type of argument is accepted by gethostbyname().
20712 hdrs="$define sys/types.h
20713 $d_socket sys/socket.h
20714 $i_niin netinet/in.h
20716 $i_unistd unistd.h"
20717 for xxx in "const char *" "char *"; do
20718 case "$netdb_name_type" in
20719 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20720 if ./protochk "$try" $hdrs; then
20721 echo "Your system accepts $xxx."
20722 netdb_name_type="$xxx"
20727 : In case none of those worked, prompt the user.
20728 case "$netdb_name_type" in
20729 '') rp='What is the type for the 1st argument to gethostbyname?'
20732 netdb_name_type=$ans
20736 *) : no gethostbyname, so pick harmless default
20737 netdb_name_type='char *'
20742 : check for type of 1st argument to getnetbyaddr.
20743 if test "X$netdb_net_type" = X ; then
20744 case "$d_getnbyaddr" in
20748 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20750 hdrs="$define sys/types.h
20751 $d_socket sys/socket.h
20752 $i_niin netinet/in.h
20754 $i_unistd unistd.h"
20755 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20756 case "$netdb_net_type" in
20757 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20758 if ./protochk "$try" $hdrs; then
20759 echo "Your system accepts $xxx."
20760 netdb_net_type="$xxx"
20765 : In case none of those worked, prompt the user.
20766 case "$netdb_net_type" in
20767 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20770 netdb_net_type=$ans
20774 *) : no getnetbyaddr, so pick harmless default
20775 netdb_net_type='long'
20779 : locate the preferred pager for this system
20786 [a-zA-Z]:/*) dflt=$pg;;
20790 [a-zA-Z]:/*) dflt=$more;;
20794 [a-zA-Z]:/*) dflt=$less;;
20797 '') dflt=/usr/ucb/more;;
20805 rp='What pager is used on your system?'
20809 : see what type pids are declared as in the kernel
20810 rp="What is the type of process ids on this system?"
20811 set pid_t pidtype int stdio.h sys/types.h
20814 : see if ar generates random libraries by itself
20816 echo "Checking how to generate random libraries on your machine..." >&4
20817 echo 'int bar1() { return bar2(); }' > bar1.c
20818 echo 'int bar2() { return 2; }' > bar2.c
20820 #$i_stdlib I_STDLIB
20822 #include <stdlib.h>
20824 int main() { printf("%d\n", bar1()); exit(0); }
20826 $cc $ccflags -c bar1.c >/dev/null 2>&1
20827 $cc $ccflags -c bar2.c >/dev/null 2>&1
20828 $cc $ccflags -c foo.c >/dev/null 2>&1
20829 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20830 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20831 $run ./foobar >/dev/null 2>&1; then
20832 echo "$ar appears to generate random libraries itself."
20834 if [ "X$ranlib" = "X" ]; then
20837 elif $ar s bar$_a >/dev/null 2>&1 &&
20838 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20839 $run ./foobar >/dev/null 2>&1; then
20840 echo "a table of contents needs to be added with '$ar s'."
20843 elif $ar ts bar$_a >/dev/null 2>&1 &&
20844 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20845 $run ./foobar >/dev/null 2>&1; then
20846 echo "a table of contents needs to be added with '$ar ts'."
20853 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20854 $test -f $ranlib || ranlib=''
20857 if $test -n "$ranlib"; then
20858 echo "your system has '$ranlib'; we'll use that."
20861 echo "your system doesn't seem to support random libraries"
20862 echo "so we'll use lorder and tsort to order the libraries."
20869 : see if this is a values.h system
20870 set values.h i_values
20873 : Check the max offset that gmtime and localtime accept
20874 echo "Checking max offsets that gmtime () accepts"
20877 define) yyy="#include <values.h>" ;;
20881 case "$sGMTIME_min/$sGMTIME_max" in
20884 #include <sys/types.h>
20893 void gm_check (time_t t, int min_year, int max_year)
20896 if ( tmp == NULL ||
20897 /* Check tm_year overflow */
20898 tmp->tm_year < min_year || tmp->tm_year > max_year)
20909 gm_check (MAXLONG, 69, 0x7fffffff);
20911 if (tmp == NULL || tmp->tm_year < 0) {
20912 for (i = 63; i >= 0; i--) {
20913 time_t x = pt | ((time_t)1 << i);
20914 if (x < 0 || x < pt) continue;
20915 gm_check (x, 69, 0x7fffffff);
20918 printf ("sGMTIME_max=%ld\n", pt);
20927 gm_check (MINLONG, -1900, 70);
20930 for (i = 36; i >= 0; i--) {
20931 time_t x = pt - ((time_t)1 << i);
20932 if (x > 0) continue;
20933 gm_check (x, -1900, 70);
20936 printf ("sGMTIME_min=%ld\n", pt);
20940 int main (int argc, char *argv[])
20942 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20949 if eval $compile; then
20952 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20958 echo "Checking max offsets that localtime () accepts"
20960 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20963 #include <sys/types.h>
20972 void local_check (time_t t, int min_year, int max_year)
20974 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20977 tmp = localtime (&t);
20978 if ( tmp == NULL ||
20979 /* Check tm_year overflow */
20980 tmp->tm_year < min_year || tmp->tm_year > max_year)
20984 } /* local_check */
20991 local_check (MAXLONG, 69, 0x7fffffff);
20993 if (tmp == NULL || tmp->tm_year < 0) {
20994 for (i = 63; i >= 0; i--) {
20995 time_t x = pt | ((time_t)1 << i);
20996 if (x < 0 || x < pt) continue;
20997 local_check (x, 69, 0x7fffffff);
21000 printf ("sLOCALTIME_max=%ld\n", pt);
21009 local_check (MINLONG, -1900, 70);
21012 for (i = 36; i >= 0; i--) {
21013 time_t x = pt - ((time_t)1 << i);
21014 if (x > 0) continue;
21015 local_check (x, -1900, 70);
21018 printf ("sLOCALTIME_min=%ld\n", pt);
21022 int main (int argc, char *argv[])
21030 if eval $compile; then
21033 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21039 : check for type of arguments to select.
21040 case "$selecttype" in
21041 '') case "$d_select" in
21045 Checking to see what type of arguments are accepted by select().
21047 hdrs="$define sys/types.h
21048 $i_systime sys/time.h
21049 $i_sysselct sys/select.h
21050 $d_socket sys/socket.h"
21051 : The first arg can be int, unsigned, or size_t
21052 : The last arg may or may not be 'const'
21054 : void pointer has been seen but using that
21055 : breaks the selectminbits test
21056 for xxx in 'fd_set *' 'int *'; do
21057 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21058 for tmo in 'struct timeval *' 'const struct timeval *'; do
21060 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21061 if ./protochk "$try" $hdrs; then
21062 echo "Your system accepts $xxx."
21071 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21072 case "$d_fd_set" in
21073 $define) dflt="fd_set *" ;;
21082 *) : no select, so pick a harmless default
21089 : check for the select 'width'
21090 case "$selectminbits" in
21091 '') safebits=`expr $ptrsize \* 8`
21092 case "$d_select" in
21096 Checking to see on how many bits at a time your select() operates...
21099 #include <sys/types.h>
21101 #$i_systime I_SYS_TIME
21102 #$i_systimek I_SYS_TIME_KERNEL
21107 # ifdef I_SYS_TIME_KERNEL
21110 # include <sys/time.h>
21111 # ifdef I_SYS_TIME_KERNEL
21115 #$i_sysselct I_SYS_SELECT
21116 #ifdef I_SYS_SELECT
21117 #include <sys/select.h>
21119 #$d_socket HAS_SOCKET
21121 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21124 #$i_stdlib I_STDLIB
21126 #include <stdlib.h>
21129 #define S sizeof(*(b))
21131 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21132 #define NBITS (NBYTES * 8)
21134 char *s = (char *)malloc(NBYTES);
21143 fp = fopen("try.c", "r");
21149 b = ($selecttype)s;
21150 for (i = 0; i < NBITS; i++)
21154 select(fd + 1, b, 0, 0, &t);
21155 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21157 printf("%d\n", i + 1);
21162 if eval $compile_ok; then
21163 selectminbits=`$run ./try`
21164 case "$selectminbits" in
21166 Cannot figure out on how many bits at a time your select() operates.
21167 I'll play safe and guess it is $safebits bits.
21169 selectminbits=$safebits
21170 bits="$safebits bits"
21173 *) bits="$selectminbits bits" ;;
21175 echo "Your select() operates on $bits at a time." >&4
21177 rp='What is the minimum number of bits your select() operates on?'
21178 case "$byteorder" in
21179 12345678) dflt=64 ;;
21185 selectminbits="$val"
21189 *) : no select, so pick a harmless default
21190 selectminbits=$safebits
21196 : Trace out the files included by signal.h, then look for SIGxxx names.
21197 if [ "X$fieldn" = X ]; then
21198 : Just make some guesses. We check them later.
21199 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21201 xxx=`echo '#include <signal.h>' |
21202 $cppstdin $cppminus $cppflags 2>/dev/null |
21203 $grep '^[ ]*#.*include' |
21204 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21205 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21208 for xx in $xxx /dev/null ; do
21209 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21211 case "$xxxfiles" in
21212 '') xxxfiles=`./findhdr signal.h` ;;
21215 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21216 print substr($2, 4, 20)
21218 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21219 print substr($3, 4, 20)
21221 : Append some common names just in case the awk scan failed.
21222 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21223 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21224 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21225 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21226 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21228 : generate a few handy files for later
21229 $cat > signal.c <<EOCP
21230 #include <sys/types.h>
21231 #include <signal.h>
21232 #$i_stdlib I_STDLIB
21234 #include <stdlib.h>
21239 /* Strange style to avoid deeply-nested #if/#else/#endif */
21242 # define NSIG (_NSIG)
21248 # define NSIG (SIGMAX+1)
21254 # define NSIG (SIG_MAX+1)
21260 # define NSIG (_SIG_MAX+1)
21266 # define NSIG (MAXSIG+1)
21272 # define NSIG (MAX_SIG+1)
21277 # ifdef SIGARRAYSIZE
21278 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21284 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21288 /* Default to some arbitrary number that's big enough to get most
21289 of the common signals.
21295 printf("NSIG %d\n", NSIG);
21301 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21303 printf "#ifdef SIG"; printf $1; printf "\n"
21304 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21305 printf $1; printf ");\n"
21309 printf "#endif /* JUST_NSIG */\n";
21310 printf "exit(0);\n}\n";
21313 $cat >signal.awk <<'EOP'
21314 BEGIN { ndups = 0 }
21315 $1 ~ /^NSIG$/ { nsig = $2 }
21316 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21317 if ($2 > maxsig) { maxsig = $2 }
21318 if (sig_name[$2]) {
21319 dup_name[ndups] = $1
21320 dup_num[ndups] = $2
21332 printf("NSIG %d\n", nsig);
21333 for (n = 1; n < nsig; n++) {
21335 printf("%s %d\n", sig_name[n], sig_num[n])
21338 printf("NUM%d %d\n", n, n)
21341 for (n = 0; n < ndups; n++) {
21342 printf("%s %d\n", dup_name[n], dup_num[n])
21346 $cat >signal_cmd <<EOS
21348 if $test -s signal.lst; then
21349 echo "Using your existing signal.lst file"
21354 $cat >>signal_cmd <<'EOS'
21357 if eval $compile_ok; then
21358 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21359 $uniq | $awk -f signal.awk >signal.lst
21361 echo "(I can't seem be able to compile the whole test program)" >&4
21362 echo "(I'll try it in little pieces.)" >&4
21363 set signal -DJUST_NSIG
21364 if eval $compile_ok; then
21365 $run ./signal$_exe > signal.nsg
21368 echo "I can't seem to figure out how many signals you have." >&4
21369 echo "Guessing 50." >&4
21370 echo 'NSIG 50' > signal.nsg
21372 : Now look at all the signal names, one at a time.
21373 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21374 $cat > signal.c <<EOCP
21375 #include <sys/types.h>
21376 #include <signal.h>
21379 printf("$xx %d\n", SIG${xx});
21384 if eval $compile; then
21385 echo "SIG${xx} found."
21386 $run ./signal$_exe >> signal.ls1
21388 echo "SIG${xx} NOT found."
21391 if $test -s signal.ls1; then
21392 $cat signal.nsg signal.ls1 |
21393 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21397 if $test -s signal.lst; then
21400 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21401 echo 'kill -l' >signal
21402 set X `csh -f <signal`
21406 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21408 echo $@ | $tr ' ' $trnl | \
21409 $awk '{ printf "%s %d\n", $1, ++s; }
21410 END { printf "NSIG %d\n", ++s }' >signal.lst
21412 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21414 chmod a+x signal_cmd
21415 $eunicefix signal_cmd
21417 : generate list of signal names
21419 case "$sig_name_init" in
21421 *) case "$sig_num_init" in
21422 ''|*,*) doinit=yes ;;
21427 echo "Generating a list of signal names and numbers..." >&4
21429 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21430 sig_name=`$awk 'BEGIN { printf "ZERO " }
21431 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21432 sig_num=`$awk 'BEGIN { printf "0 " }
21433 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21434 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21435 !/^NSIG/ { printf "\"%s\", ", $1 }
21436 END { printf "0\n" }' signal.lst`
21437 sig_num_init=`$awk 'BEGIN { printf "0, " }
21438 !/^NSIG/ { printf "%d, ", $2}
21439 END { printf "0\n"}' signal.lst`
21442 echo "The following $sig_count signals are available:"
21444 echo $sig_name | $awk \
21445 'BEGIN { linelen = 0 }
21447 for (i = 1; i <= NF; i++) {
21448 name = "SIG" $i " "
21449 linelen = linelen + length(name)
21450 if (linelen > 70) {
21452 linelen = length(name)
21458 sig_size=`echo $sig_name | awk '{print NF}'`
21459 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21461 : Check size of size
21463 case "$sizetype" in
21464 *_t) zzz="$sizetype" ;;
21465 *) zzz="filesize" ;;
21467 echo "Checking the size of $zzz..." >&4
21469 #include <sys/types.h>
21471 #$i_stdlib I_STDLIB
21473 #include <stdlib.h>
21476 printf("%d\n", (int)sizeof($sizetype));
21481 if eval $compile_ok; then
21485 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21488 echo "Your $zzz size is $sizesize bytes."
21493 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21497 : check for socklen_t
21499 echo "Checking to see if you have socklen_t..." >&4
21501 #include <sys/types.h>
21502 #$d_socket HAS_SOCKET
21504 #include <sys/socket.h>
21506 int main() { socklen_t x = 16; }
21509 if eval $compile; then
21511 echo "You have socklen_t."
21514 echo "You do not have socklen_t."
21515 case "$sizetype" in
21516 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21523 : see if this is a socks.h system
21524 set socks.h i_socks
21527 : check for type of the size argument to socket calls
21528 case "$d_socket" in
21532 Checking to see what type is the last argument of accept().
21535 case "$d_socklen_t" in
21536 "$define") yyy="$yyy socklen_t"
21538 yyy="$yyy $sizetype int long unsigned"
21539 for xxx in $yyy; do
21540 case "$socksizetype" in
21541 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21542 case "$usesocks" in
21544 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21545 echo "Your system accepts '$xxx *' for the last argument of accept()."
21546 socksizetype="$xxx"
21549 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21550 echo "Your system accepts '$xxx *' for the last argument of accept()."
21551 socksizetype="$xxx"
21558 : In case none of those worked, prompt the user.
21559 case "$socksizetype" in
21560 '') rp='What is the type for socket address structure sizes?'
21567 *) : no sockets, so pick relatively harmless default
21572 : see what type is used for signed size_t
21573 set ssize_t ssizetype int stdio.h sys/types.h
21578 #$i_stdlib I_STDLIB
21580 #include <stdlib.h>
21582 #include <sys/types.h>
21583 #define Size_t $sizetype
21584 #define SSize_t $dflt
21587 if (sizeof(Size_t) == sizeof(SSize_t))
21589 else if (sizeof(Size_t) == sizeof(int))
21598 if eval $compile_ok && $run ./try > /dev/null; then
21599 ssizetype=`$run ./try`
21600 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21603 Help! I can't compile and run the ssize_t test program: please enlighten me!
21604 (This is probably a misconfiguration in your system or libraries, and
21605 you really ought to fix it. Still, I'll try anyway.)
21607 I need a type that is the same size as $sizetype, but is guaranteed to
21608 be signed. Common values are ssize_t, int and long.
21611 rp="What signed type is the same size as $sizetype?"
21617 : Check the size of st_ino
21619 $echo "Checking the size of st_ino..." >&4
21620 $cat > try.c <<EOCP
21621 #include <sys/stat.h>
21623 #$i_stdlib I_STDLIB
21625 #include <stdlib.h>
21629 printf("%d\n", (int)sizeof(st.st_ino));
21634 if eval $compile_ok; then
21638 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21640 *) st_ino_size=$val
21641 $echo "Your st_ino is $st_ino_size bytes long."
21646 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21650 : Check if st_ino is signed
21652 $echo "Checking the sign of st_ino..." >&4
21653 $cat > try.c <<EOCP
21654 #include <sys/stat.h>
21659 if (foo.st_ino < 0)
21666 if eval $compile; then
21670 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21672 *) st_ino_sign=$val
21673 case "$st_ino_sign" in
21674 1) $echo "Your st_ino is unsigned." ;;
21675 -1) $echo "Your st_ino is signed." ;;
21681 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21685 : see what type of char stdio uses.
21687 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21688 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21689 echo "Your stdio uses unsigned chars." >&4
21690 stdchar="unsigned char"
21692 echo "Your stdio uses signed chars." >&4
21697 : see what type uids are declared as in the kernel
21699 echo "Looking for the type for user ids returned by getuid()."
21700 set uid_t uidtype xxx stdio.h sys/types.h
21704 xxx=`./findhdr sys/user.h`
21705 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21707 unsigned) dflt="$1 $2" ;;
21711 *) dflt="$uidtype";;
21714 uid_t) echo "uid_t found." ;;
21715 *) rp="What is the type for user ids returned by getuid()?"
21721 : Check size of UID
21724 *_t) zzz="$uidtype" ;;
21727 echo "Checking the size of $zzz..." >&4
21729 #include <sys/types.h>
21731 #$i_stdlib I_STDLIB
21733 #include <stdlib.h>
21736 printf("%d\n", (int)sizeof($uidtype));
21741 if eval $compile_ok; then
21745 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21748 echo "Your $zzz is $uidsize bytes long."
21753 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21756 : Check if UID is signed
21759 *_t) zzz="$uidtype" ;;
21762 echo "Checking the sign of $zzz..." >&4
21764 #include <sys/types.h>
21775 if eval $compile; then
21779 echo "(I can't execute the test program--guessing unsigned.)" >&4
21783 1) echo "Your $zzz is unsigned." ;;
21784 -1) echo "Your $zzz is signed." ;;
21790 echo "(I can't compile the test program--guessing unsigned.)" >&4
21794 : Check format string for UID
21796 $echo "Checking the format string to be used for uids..." >&4
21799 -1) if $test X"$uidsize" = X"$ivsize"; then
21800 uidformat="$ivdformat"
21802 if $test X"$uidsize" = X"$longsize"; then
21805 if $test X"$uidsize" = X"$intsize"; then
21808 if $test X"$uidsize" = X"$shortsize"; then
21815 *) if $test X"$uidsize" = X"$uvsize"; then
21816 uidformat="$uvuformat"
21818 if $test X"$uidsize" = X"$longsize"; then
21821 if $test X"$uidsize" = X"$intsize"; then
21824 if $test X"$uidsize" = X"$shortsize"; then
21833 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21835 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21836 $cat >try.c <<'EOM'
21837 /* Intentionally a long probe as I'd like to sanity check that the exact
21838 approach is going to work, as thinking it will work, but only having it
21839 part working at runtime is worse than not having it. */
21841 #include <sys/types.h>
21842 #include <sys/sysctl.h>
21843 #include <sys/param.h>
21845 #include <string.h>
21846 #include <stdlib.h>
21847 #include <unistd.h>
21850 main(int argc, char **argv) {
21852 char *argv_leaf = strrchr(argv[0], '/');
21858 mib[1] = KERN_PROC;
21859 mib[2] = KERN_PROC_PATHNAME;
21863 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21867 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21872 if (size < strlen(argv_leaf) + 1) {
21873 fprintf(stderr, "size %lu is too short for a path\n",
21874 (unsigned long) size);
21878 if (size > MAXPATHLEN * MAXPATHLEN) {
21879 fprintf(stderr, "size %lu is too long for a path\n",
21880 (unsigned long) size);
21884 buffer = malloc(size);
21890 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21895 if (strlen(buffer) + 1 != size) {
21896 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21897 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21902 if (*buffer != '/') {
21903 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21907 if (strstr(buffer, "/./")) {
21908 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21912 if (strstr(buffer, "/../")) {
21913 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21917 buffer_leaf = strrchr(buffer, '/');
21918 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21919 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21931 if eval $compile; then
21932 if $run ./try; then
21933 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21936 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21940 echo "I'm unable to compile the test program." >&4
21941 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21945 set usekernprocpathname
21948 : Determine if we can use _NSGetExecutablePath to find executing program
21950 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21951 $cat >try.c <<'EOM'
21952 /* Intentionally a long probe as I'd like to sanity check that the exact
21953 approach is going to work, as thinking it will work, but only having it
21954 part working at runtime is worse than not having it. */
21955 #include <mach-o/dyld.h>
21957 #include <stdlib.h>
21958 #include <sys/param.h>
21959 #include <string.h>
21962 main(int argc, char **argv) {
21964 uint32_t size = sizeof(buf);
21968 char *argv_leaf = strrchr(argv[0], '/');
21972 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21976 _NSGetExecutablePath(buf, &size);
21977 if (size > MAXPATHLEN * MAXPATHLEN) {
21978 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21979 (unsigned int) size);
21983 buffer = malloc(size);
21989 result = _NSGetExecutablePath(buffer, &size);
21991 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21992 result, (unsigned int) size);
21996 tidied = realpath(buffer, NULL);
21998 perror("realpath");
22004 if (*tidied != '/') {
22005 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22009 if (strstr(tidied, "/./")) {
22010 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22014 if (strstr(tidied, "/../")) {
22015 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22019 tidied_leaf = strrchr(tidied, '/');
22020 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22021 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22033 if eval $compile; then
22034 if $run ./try; then
22035 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22038 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22041 echo "I'm unable to compile the test program." >&4
22042 echo "I'll assume no _NSGetExecutablePath here." >&4
22045 set usensgetexecutablepath
22048 : Check if site customization support was requested
22049 case "$usesitecustomize" in
22050 $define|true|[Yy]*)
22051 usesitecustomize="$define"
22054 usesitecustomize="$undef"
22058 : see if prototypes support variable argument declarations
22060 case "$prototype$i_stdarg" in
22062 echo "It appears we'll be able to prototype varargs functions." >&4
22066 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22073 : determine compiler compiler
22082 if $test -f "$byacc$_exe"; then
22084 comp="byacc or $comp"
22086 if $test -f "$bison$_exe"; then
22087 comp="$comp or bison -y"
22089 rp="Which compiler compiler ($comp) shall I use?"
22098 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22104 : see if this is a assert.h system
22105 set assert.h i_assert
22108 : see if this is a bfd.h system
22112 : see if this is an execinfo.h system
22113 set execinfo.h i_execinfo
22116 : see if this is a fenv.h system
22120 : see if this is a fp.h system
22124 : see if this is a fp_class.h system
22125 set fp_class.h i_fp_class
22128 : see if gdbm.h is available
22133 : see if gdbm_open exists
22134 set gdbm_open d_gdbm_open
22136 case "$d_gdbm_open" in
22139 echo "We won't be including <gdbm.h>"
22148 : see if this is a ieeefp.h system
22149 case "$i_ieeefp" in
22150 '' ) set ieeefp.h i_ieeefp
22155 : see if this is a libutil.h system
22156 set libutil.h i_libutil
22159 : see if mach cthreads are available
22160 if test "X$usethreads" = "X$define"; then
22161 set mach/cthreads.h i_machcthr
22164 i_machcthr="$undef"
22167 : see if this is a mntent.h system
22168 set mntent.h i_mntent
22171 : see if net/errno.h is available
22173 set net/errno.h val
22176 : Unfortunately, it causes problems on some systems. Arrgh.
22179 cat > try.c <<'EOM'
22182 #include <net/errno.h>
22188 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22189 echo "We'll be including <net/errno.h>." >&4
22191 echo "We won't be including <net/errno.h>." >&4
22200 : see if netinet/tcp.h is available
22201 set netinet/tcp.h i_netinettcp
22204 : see if this is a poll.h system
22208 : see if this is a prot.h system
22212 : Preprocessor symbols
22214 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22215 $cat <<'EOSH' > Cppsym.know
22216 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22217 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22218 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22219 arch_pwr ardent ARM ARM32 atarist att386 att3b
22220 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22221 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22222 byteorder byte_order
22223 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22224 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22225 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22226 ELF encore EPI EXTENSIONS
22227 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22228 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22229 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22230 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22231 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22232 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22233 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22234 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22235 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22237 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22238 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22239 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22241 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22242 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22243 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22244 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22245 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22246 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22247 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22248 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22249 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22250 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22251 ns32000 ns32016 ns32332 ns32k nsc32000
22252 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22253 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22254 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22255 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22257 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22258 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22259 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22260 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22261 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22262 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22263 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22264 SYSV4 SYSV5 sysV68 sysV88
22265 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22266 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22267 tower32_800 tower32_850 tss
22268 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22269 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22270 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22271 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22272 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22273 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22275 vax venix VMESA vms
22276 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22277 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22280 # Maybe put other stuff here too.
22281 ./tr '-' '_' <<EOSH >>Cppsym.know
22284 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22285 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22286 $cat Cppsym.know > Cppsym.c
22287 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22288 $rm -f Cppsym.a Cppsym.b Cppsym.c
22289 cat <<EOSH > Cppsym
22291 if $test \$# -gt 0; then
22292 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22293 if $test -s Cppsym.got; then
22300 $tr " " "$trnl" | ./Cppsym.try
22306 cat <<EOSH > Cppsym.try
22308 cat <<'EOCP' > try.c
22311 #define STRINGIFY(a) "a"
22313 #if cpp_stuff == 42
22314 #define StGiFy(a) #a
22315 #define STRINGIFY(a) StGiFy(a)
22317 #if $cpp_stuff != 1 && $cpp_stuff != 42
22318 # include "Bletch: How does this C preprocessor stringify macros?"
22324 cat <<'EOSH' >> Cppsym.try
22326 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22327 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22328 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22329 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22331 echo 'return 0;}' >> try.c
22333 cat <<EOSH >> Cppsym.try
22335 case "$osname-$gccversion" in
22336 irix-) ccflags="\$ccflags -woff 1178" ;;
22337 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22339 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22341 chmod +x Cppsym.try
22342 $eunicefix Cppsym.try
22343 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22344 : Add in any Linux cpp "predefined macros":
22345 case "$osname::$gccversion" in
22346 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22348 rm -f $tHdrH'.h' $tHdrH
22350 # Filter out macro arguments, such as Linux's __INT8_C(c)
22351 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22352 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22353 if [ -s $tHdrH'_cppsym.real' ]; then
22354 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22357 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22360 : now check the C compiler for additional symbols
22361 postprocess_cc_v=''
22363 aix) postprocess_cc_v="|$tr , ' '" ;;
22370 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22373 -D*) echo "\$i" | $sed 's/^-D//';;
22374 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22379 postprocess_cc_v=''
22382 ./ccsym > ccsym1.raw
22383 if $test -s ccsym1.raw; then
22384 $sort ccsym1.raw | $uniq >ccsym.raw
22386 mv ccsym1.raw ccsym.raw
22389 $awk '/\=/ { print $0; next }
22390 { print $0"=1" }' ccsym.raw >ccsym.list
22391 $comm -13 Cppsym.true ccsym.list >ccsym.own
22392 $comm -12 Cppsym.true ccsym.list >ccsym.com
22393 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22395 if $test -z ccsym.raw; then
22396 echo "Your C compiler doesn't seem to define any symbols!" >&4
22398 echo "However, your C preprocessor defines the following symbols:"
22401 cppsymbols=`$cat Cppsym.true`
22402 cppsymbols=`echo $cppsymbols`
22403 cppccsymbols="$cppsymbols"
22405 if $test -s ccsym.com; then
22406 echo "Your C compiler and pre-processor define these symbols:"
22407 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22410 cppccsymbols=`$cat ccsym.com`
22411 cppccsymbols=`echo $cppccsymbols`
22412 $test "$silent" || sleep 1
22414 if $test -s ccsym.cpp; then
22415 $test "$also" && echo " "
22416 echo "Your C pre-processor ${also}defines the following symbols:"
22417 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22419 cppsymbols=`$cat ccsym.cpp`
22420 cppsymbols=`echo $cppsymbols`
22421 $test "$silent" || sleep 1
22423 if $test -s ccsym.own; then
22424 $test "$also" && echo " "
22425 echo "Your C compiler ${also}defines the following cpp symbols:"
22426 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22427 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22428 ccsymbols=`$cat ccsym.own`
22429 ccsymbols=`echo $ccsymbols`
22430 $test "$silent" || sleep 1
22434 : add -D_FORTIFY_SOURCE if feasible and not already there
22435 case "$gccversion" in
22436 4.*) case "$optimize$ccflags" in
22437 *-O*) case "$ccflags$cppsymbols" in
22438 *_FORTIFY_SOURCE=*) # Don't add it again.
22439 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22441 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22442 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22446 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22450 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22454 : see if this is a termio system
22458 if $test `./findhdr termios.h`; then
22459 set tcsetattr i_termios
22465 "$define") echo "You have POSIX termios.h... good!" >&4;;
22466 *) if ./Cppsym pyr; then
22467 case "`$run /bin/universe`" in
22468 ucb) if $test `./findhdr sgtty.h`; then
22470 echo "<sgtty.h> found." >&4
22472 echo "System is pyramid with BSD universe."
22473 ./warn "<sgtty.h> not found--you could have problems."
22475 *) if $test `./findhdr termio.h`; then
22477 echo "<termio.h> found." >&4
22479 echo "System is pyramid with USG universe."
22480 ./warn "<termio.h> not found--you could have problems."
22484 if $test `./findhdr termio.h`; then
22485 echo "<termio.h> found." >&4
22487 elif $test `./findhdr sgtty.h`; then
22488 echo "<sgtty.h> found." >&4
22491 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22494 if $test `./findhdr sgtty.h`; then
22495 echo "<sgtty.h> found." >&4
22497 elif $test `./findhdr termio.h`; then
22498 echo "<termio.h> found." >&4
22501 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22505 set i_termio; eval $setvar
22506 val=$val2; set i_sgtty; eval $setvar
22507 val=$val3; set i_termios; eval $setvar
22509 : see if stdbool is available
22510 : we want a real compile instead of Inhdr because some Solaris systems
22511 : have stdbool.h, but it can only be used if the compiler indicates it
22512 : is sufficiently c99-compliant.
22516 #include <stdbool.h>
22521 int main(int argc, char **argv)
22527 if eval $compile; then
22528 echo "<stdbool.h> found." >&4
22531 echo "<stdbool.h> NOT found." >&4
22538 : see if stddef is available
22539 set stddef.h i_stddef
22542 : see if stdint is available
22543 set stdint.h i_stdint
22546 : see if sys/access.h is available
22547 set sys/access.h i_sysaccess
22550 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22551 set sys/filio.h i_sysfilio
22554 if $test `./findhdr sys/ioctl.h`; then
22556 echo '<sys/ioctl.h> found.' >&4
22559 if $test $i_sysfilio = "$define"; then
22560 echo '<sys/ioctl.h> NOT found.' >&4
22562 $test $i_sgtty = "$define" && xxx="sgtty.h"
22563 $test $i_termio = "$define" && xxx="termio.h"
22564 $test $i_termios = "$define" && xxx="termios.h"
22565 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22571 : see if socket ioctl defs are in sys/sockio.h
22573 xxx=`./findhdr sys/sockio.h`
22574 if $test "$xxx"; then
22575 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22577 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22580 echo "No socket ioctls found in <sys/sockio.h>." >&4
22585 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22591 : see if this is a syslog.h system
22592 set syslog.h i_syslog
22595 : see if this is a sys/mode.h system
22596 set sys/mode.h i_sysmode
22599 : see if there is a sys/poll.h file
22600 set sys/poll.h i_syspoll
22603 : see if sys/resource.h has to be included
22604 set sys/resource.h i_sysresrc
22607 : see if sys/security.h is available
22608 set sys/security.h i_syssecrt
22611 : see if this is a sys/statvfs.h system
22612 set sys/statvfs.h i_sysstatvfs
22615 : see if this is a sys/un.h system
22616 set sys/un.h i_sysun
22619 : see if this is a sys/utsname.h system
22620 set sys/utsname.h i_sysutsname
22623 : see if this is a syswait system
22624 set sys/wait.h i_syswait
22627 : see if this is a ustat.h system
22628 set ustat.h i_ustat
22631 : see if this is an utime system
22632 set utime.h i_utime
22635 : see if this is a vfork system
22638 set vfork.h i_vfork
22648 echo "Looking for extensions..." >&4
22649 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22650 : contain old or inaccurate or duplicate values.
22651 nonxs_extensions=''
22653 : We do not use find because it might not be available.
22654 : We do not just use MANIFEST because the user may have dropped
22655 : some additional extensions into the source tree and expect them
22658 : Function to recursively find available extensions, ignoring DynaLoader
22659 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22660 : In 5.10.1 and later, extensions are stored in directories
22661 : like File-Glob instead of the older File/Glob/.
22665 DynaLoader|dynaload) ;;
22667 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22668 case "$this_ext" in
22669 Scalar/List/Utils) this_ext="List/Util" ;;
22670 PathTools) this_ext="Cwd" ;;
22672 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22673 if $contains " $this_ext " $tdir/$$.tmp; then
22675 echo "Duplicate directories detected for extension $xxx" >&4;
22676 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22677 case "$knowitall" in
22685 echo "Ok. Stopping Configure." >&4;
22686 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22689 echo "Ok. You will need to correct config.sh before running make." >&4;
22691 $ls -1 $xxx > $tdir/$$.tmp;
22692 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22693 xs_extensions="$xs_extensions $this_ext";
22694 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22695 xs_extensions="$xs_extensions $this_ext";
22696 elif $test -d $xxx; then
22697 nonxs_extensions="$nonxs_extensions $this_ext";
22699 $rm -f $tdir/$$.tmp;
22707 eval $find_extensions
22711 eval $find_extensions
22715 eval $find_extensions
22716 set X $xs_extensions
22718 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22719 set X $nonxs_extensions
22721 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22723 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22725 : Now see which are supported on this system.
22727 for xxx in $xs_extensions ; do
22731 $define) avail_ext="$avail_ext $xxx" ;;
22734 GDBM_File|gdbm_fil)
22736 $define) avail_ext="$avail_ext $xxx" ;;
22739 I18N/Langinfo|i18n_lan)
22740 case "$i_langinfo$d_nl_langinfo" in
22741 $define$define) avail_ext="$avail_ext $xxx" ;;
22745 : XXX Do we need a useipcsysv variable here
22746 case "${d_msg}${d_sem}${d_shm}" in
22747 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22750 NDBM_File|ndbm_fil)
22753 case "$osname-$use64bitint" in
22756 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22759 *) avail_ext="$avail_ext $xxx" ;;
22764 ODBM_File|odbm_fil)
22765 case "${i_dbm}${i_rpcsvcdbm}" in
22767 case "$d_cplusplus" in
22768 define) ;; # delete as a function name will not work
22769 *) case "$osname-$use64bitint" in
22772 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22775 *) avail_ext="$avail_ext $xxx" ;;
22783 case "$useopcode" in
22784 true|define|y) avail_ext="$avail_ext $xxx" ;;
22788 case "$useposix" in
22789 true|define|y) avail_ext="$avail_ext $xxx" ;;
22793 case "$d_socket" in
22794 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22797 Sys/Syslog|sys/syslog)
22798 : XXX syslog requires socket
22799 case "$d_socket" in
22800 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22804 case "$usethreads" in
22806 case "$use5005threads" in
22807 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22811 threads|threads/shared)
22812 # threads and threads::shared are special cases.
22813 # To stop people from asking "Perl 5.8.0 was supposed
22814 # to have this new fancy threads implementation but my
22815 # perl doesn't have it" and from people trying to
22816 # (re)install the threads module using CPAN.pm and
22817 # CPAN.pm then offering to reinstall Perl 5.8.0,
22818 # the threads.pm and threads/shared.pm will always be
22819 # there, croaking informatively ("you need to rebuild
22820 # all of Perl with threads, sorry") when threads haven't
22821 # been compiled in.
22823 avail_ext="$avail_ext $xxx"
22829 cygwin) avail_ext="$avail_ext $xxx" ;;
22832 XS/APItest|xs/apitest)
22833 # This is just for testing. Skip it unless we have dynamic loading.
22836 $define) avail_ext="$avail_ext $xxx" ;;
22839 XS/Typemap|xs/typemap)
22840 # This is just for testing. Skip it unless we have dynamic loading.
22842 $define) avail_ext="$avail_ext $xxx" ;;
22845 *) avail_ext="$avail_ext $xxx"
22854 case "$onlyextensions" in
22856 *) keepextensions=''
22857 echo "You have requested that only certain extensions be included..." >&4
22858 for i in $onlyextensions; do
22859 case " $avail_ext " in
22861 echo "Keeping extension $i."
22862 keepextensions="$keepextensions $i"
22864 *) echo "Ignoring extension $i." ;;
22867 avail_ext="$keepextensions"
22871 case "$noextensions" in
22873 *) keepextensions=''
22874 echo "You have requested that certain extensions be ignored..." >&4
22875 for i in $avail_ext; do
22876 case " $noextensions " in
22877 *" $i "*) echo "Ignoring extension $i." ;;
22878 *) echo "Keeping extension $i.";
22879 keepextensions="$keepextensions $i"
22883 avail_ext="$keepextensions"
22887 : Now see which nonxs extensions are supported on this system.
22888 : For now assume all are.
22890 for xxx in $nonxs_extensions ; do
22894 *) nonxs_ext="$nonxs_ext $xxx"
22906 A number of extensions are supplied with $package. You may choose to
22907 compile these extensions for dynamic loading (the default), compile
22908 them into the $package executable (static loading), or not include
22909 them at all. Answer "none" to include no extensions.
22910 Note that DynaLoader is always built and need not be mentioned here.
22913 case "$dynamic_ext" in
22915 : Exclude those listed in static_ext
22917 for xxx in $avail_ext; do
22918 case " $static_ext " in
22920 *) dflt="$dflt $xxx" ;;
22927 *) dflt="$dynamic_ext"
22928 # Perhaps we are reusing an old out-of-date config.sh.
22931 if test X"$dynamic_ext" != X"$avail_ext"; then
22933 NOTICE: Your previous config.sh list may be incorrect.
22934 The extensions now available to you are
22936 but the default list from your previous config.sh is
22948 rp="What extensions do you wish to load dynamically?"
22951 none) dynamic_ext=' ' ;;
22952 *) dynamic_ext="$ans" ;;
22955 case "$static_ext" in
22957 : Exclude those already listed in dynamic linking
22959 for xxx in $avail_ext; do
22960 case " $dynamic_ext " in
22962 *) dflt="$dflt $xxx" ;;
22969 *) dflt="$static_ext"
22976 rp="What extensions do you wish to load statically?"
22979 none) static_ext=' ' ;;
22980 *) static_ext="$ans" ;;
22985 A number of extensions are supplied with $package. Answer "none"
22986 to include no extensions.
22987 Note that DynaLoader is always built and need not be mentioned here.
22990 case "$static_ext" in
22991 '') dflt="$avail_ext" ;;
22992 *) dflt="$static_ext"
22993 # Perhaps we are reusing an old out-of-date config.sh.
22996 if test X"$static_ext" != X"$avail_ext"; then
22998 NOTICE: Your previous config.sh list may be incorrect.
22999 The extensions now available to you are
23001 but the default list from your previous config.sh is
23010 : Exclude those that are not xs extensions
23014 rp="What extensions do you wish to include?"
23017 none) static_ext=' ' ;;
23018 *) static_ext="$ans" ;;
23023 # Encode is a special case. If we are building Encode as a static
23024 # extension, we need to explicitly list its subextensions as well.
23025 # For other nested extensions, this is handled automatically by
23026 # the appropriate Makefile.PL.
23027 case " $static_ext " in
23028 *" Encode "*) # Add the subextensions of Encode
23030 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23031 static_ext="$static_ext Encode/$xxx"
23032 known_extensions="$known_extensions Encode/$xxx"
23038 set X $dynamic_ext $static_ext $nonxs_ext
23042 # Sanity check: We require an extension suitable for use with
23043 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23044 # should show up as failures in the test suite, but it's helpful to
23045 # catch them now.) The 'extensions' list is normally sorted
23046 # alphabetically, so we need to accept either
23047 # DB_File ... Fcntl ... IO ....
23048 # or something like
23049 # Fcntl ... NDBM_File ... IO ....
23050 case " $extensions" in
23051 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23052 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23053 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23054 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23055 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23059 : Remove libraries needed only for extensions
23060 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23061 : The exception is SunOS 4.x, which needs them.
23062 case "${osname}X${osvers}" in
23066 *) case "$usedl" in
23067 $define|true|[yY]*)
23068 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23072 *) perllibs="$libs"
23078 : Remove build directory name from cppstdin so it can be used from
23079 : either the present location or the final installed location.
23081 : Get out of the UU directory to get correct path name.
23083 case "$cppstdin" in
23085 echo "Stripping down cppstdin path name"
23091 : end of configuration questions
23093 echo "End of configuration questions."
23096 : back to where it started
23097 if test -d ../UU; then
23101 : configuration may be unconditionally patched via a 'config.arch' file
23102 if $test -f config.arch; then
23103 echo "I see a config.arch file, loading it." >&4
23107 : configuration may be patched via a 'config.over' file
23108 if $test -f config.over; then
23111 rp='I see a config.over file. Do you wish to load it?'
23114 n*) echo "OK, I'll ignore it.";;
23116 echo "Configuration override changes have been loaded."
23121 : in case they want portability, strip down executable paths
23122 case "$d_portable" in
23125 echo "Stripping down executable paths..." >&4
23126 for file in $loclist $trylist; do
23128 eval $file=`basename $temp`
23133 : create config.sh file
23135 echo "Creating config.sh..." >&4
23136 $spitshell <<EOT >config.sh
23139 # This file was produced by running the Configure script. It holds all the
23140 # definitions figured out by Configure. Should you modify one of these values,
23141 # do not forget to propagate your changes by running "Configure -der". You may
23142 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23145 # Package name : $package
23146 # Source directory : $src
23147 # Configuration time: $cf_time
23148 # Configured by : $cf_by
23149 # Target system : $myuname
23152 : Add in command line options if available
23153 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23155 $spitshell <<EOT >>config.sh
23164 Revision='$Revision'
23172 alignbytes='$alignbytes'
23173 ansi2knr='$ansi2knr'
23174 aphostname='$aphostname'
23175 api_revision='$api_revision'
23176 api_subversion='$api_subversion'
23177 api_version='$api_version'
23178 api_versionstring='$api_versionstring'
23181 archlibexp='$archlibexp'
23182 archname64='$archname64'
23183 archname='$archname'
23184 archobjs='$archobjs'
23185 asctime_r_proto='$asctime_r_proto'
23194 byteorder='$byteorder'
23196 castflags='$castflags'
23199 cccdlflags='$cccdlflags'
23200 ccdlflags='$ccdlflags'
23202 ccflags_uselargefiles='$ccflags_uselargefiles'
23204 ccsymbols='$ccsymbols'
23205 ccversion='$ccversion'
23207 cf_email='$cf_email'
23209 charbits='$charbits'
23210 charsize='$charsize'
23214 clocktype='$clocktype'
23216 compress='$compress'
23217 contains='$contains'
23221 cpp_stuff='$cpp_stuff'
23222 cppccsymbols='$cppccsymbols'
23223 cppflags='$cppflags'
23225 cppminus='$cppminus'
23227 cppstdin='$cppstdin'
23228 cppsymbols='$cppsymbols'
23229 crypt_r_proto='$crypt_r_proto'
23230 cryptlib='$cryptlib'
23232 ctermid_r_proto='$ctermid_r_proto'
23233 ctime_r_proto='$ctime_r_proto'
23234 d_Gconvert='$d_Gconvert'
23235 d_PRIEUldbl='$d_PRIEUldbl'
23236 d_PRIFUldbl='$d_PRIFUldbl'
23237 d_PRIGUldbl='$d_PRIGUldbl'
23238 d_PRIXU64='$d_PRIXU64'
23239 d_PRId64='$d_PRId64'
23240 d_PRIeldbl='$d_PRIeldbl'
23241 d_PRIfldbl='$d_PRIfldbl'
23242 d_PRIgldbl='$d_PRIgldbl'
23243 d_PRIi64='$d_PRIi64'
23244 d_PRIo64='$d_PRIo64'
23245 d_PRIu64='$d_PRIu64'
23246 d_PRIx64='$d_PRIx64'
23247 d_SCNfldbl='$d_SCNfldbl'
23248 d__fwalk='$d__fwalk'
23249 d_access='$d_access'
23250 d_accessx='$d_accessx'
23254 d_archlib='$d_archlib'
23255 d_asctime64='$d_asctime64'
23256 d_asctime_r='$d_asctime_r'
23259 d_attribute_deprecated='$d_attribute_deprecated'
23260 d_attribute_format='$d_attribute_format'
23261 d_attribute_malloc='$d_attribute_malloc'
23262 d_attribute_nonnull='$d_attribute_nonnull'
23263 d_attribute_noreturn='$d_attribute_noreturn'
23264 d_attribute_pure='$d_attribute_pure'
23265 d_attribute_unused='$d_attribute_unused'
23266 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23267 d_backtrace='$d_backtrace'
23271 d_bsdgetpgrp='$d_bsdgetpgrp'
23272 d_bsdsetpgrp='$d_bsdsetpgrp'
23273 d_builtin_choose_expr='$d_builtin_choose_expr'
23274 d_builtin_expect='$d_builtin_expect'
23276 d_c99_variadic_macros='$d_c99_variadic_macros'
23277 d_casti32='$d_casti32'
23278 d_castneg='$d_castneg'
23279 d_charvspr='$d_charvspr'
23281 d_chroot='$d_chroot'
23282 d_chsize='$d_chsize'
23284 d_clearenv='$d_clearenv'
23285 d_closedir='$d_closedir'
23286 d_cmsghdr_s='$d_cmsghdr_s'
23288 d_copysignl='$d_copysignl'
23289 d_cplusplus='$d_cplusplus'
23291 d_crypt_r='$d_crypt_r'
23293 d_ctermid='$d_ctermid'
23294 d_ctermid_r='$d_ctermid_r'
23295 d_ctime64='$d_ctime64'
23296 d_ctime_r='$d_ctime_r'
23297 d_cuserid='$d_cuserid'
23298 d_dbl_dig='$d_dbl_dig'
23299 d_dbminitproto='$d_dbminitproto'
23300 d_difftime64='$d_difftime64'
23301 d_difftime='$d_difftime'
23302 d_dir_dd_fd='$d_dir_dd_fd'
23304 d_dirnamlen='$d_dirnamlen'
23305 d_dladdr='$d_dladdr'
23306 d_dlerror='$d_dlerror'
23307 d_dlopen='$d_dlopen'
23308 d_dlsymun='$d_dlsymun'
23309 d_dosuid='$d_dosuid'
23310 d_drand48_r='$d_drand48_r'
23311 d_drand48proto='$d_drand48proto'
23313 d_eaccess='$d_eaccess'
23314 d_endgrent='$d_endgrent'
23315 d_endgrent_r='$d_endgrent_r'
23316 d_endhent='$d_endhent'
23317 d_endhostent_r='$d_endhostent_r'
23318 d_endnent='$d_endnent'
23319 d_endnetent_r='$d_endnetent_r'
23320 d_endpent='$d_endpent'
23321 d_endprotoent_r='$d_endprotoent_r'
23322 d_endpwent='$d_endpwent'
23323 d_endpwent_r='$d_endpwent_r'
23324 d_endsent='$d_endsent'
23325 d_endservent_r='$d_endservent_r'
23326 d_eofnblk='$d_eofnblk'
23327 d_eunice='$d_eunice'
23328 d_faststdio='$d_faststdio'
23329 d_fchdir='$d_fchdir'
23330 d_fchmod='$d_fchmod'
23331 d_fchown='$d_fchown'
23333 d_fcntl_can_lock='$d_fcntl_can_lock'
23334 d_fd_macros='$d_fd_macros'
23335 d_fd_set='$d_fd_set'
23336 d_fds_bits='$d_fds_bits'
23337 d_fegetround='$d_fegetround'
23338 d_fgetpos='$d_fgetpos'
23339 d_finite='$d_finite'
23340 d_finitel='$d_finitel'
23341 d_flexfnam='$d_flexfnam'
23343 d_flockproto='$d_flockproto'
23345 d_fp_class='$d_fp_class'
23346 d_fp_classify='$d_fp_classify'
23347 d_fp_classl='$d_fp_classl'
23348 d_fpathconf='$d_fpathconf'
23349 d_fpclass='$d_fpclass'
23350 d_fpclassify='$d_fpclassify'
23351 d_fpclassl='$d_fpclassl'
23352 d_fpgetround='$d_fpgetround'
23353 d_fpos64_t='$d_fpos64_t'
23354 d_frexpl='$d_frexpl'
23355 d_fs_data_s='$d_fs_data_s'
23356 d_fseeko='$d_fseeko'
23357 d_fsetpos='$d_fsetpos'
23358 d_fstatfs='$d_fstatfs'
23359 d_fstatvfs='$d_fstatvfs'
23361 d_ftello='$d_ftello'
23363 d_futimes='$d_futimes'
23364 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23365 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23366 d_getaddrinfo='$d_getaddrinfo'
23367 d_getcwd='$d_getcwd'
23368 d_getespwnam='$d_getespwnam'
23369 d_getfsstat='$d_getfsstat'
23370 d_getgrent='$d_getgrent'
23371 d_getgrent_r='$d_getgrent_r'
23372 d_getgrgid_r='$d_getgrgid_r'
23373 d_getgrnam_r='$d_getgrnam_r'
23374 d_getgrps='$d_getgrps'
23375 d_gethbyaddr='$d_gethbyaddr'
23376 d_gethbyname='$d_gethbyname'
23377 d_gethent='$d_gethent'
23378 d_gethname='$d_gethname'
23379 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23380 d_gethostbyname_r='$d_gethostbyname_r'
23381 d_gethostent_r='$d_gethostent_r'
23382 d_gethostprotos='$d_gethostprotos'
23383 d_getitimer='$d_getitimer'
23384 d_getlogin='$d_getlogin'
23385 d_getlogin_r='$d_getlogin_r'
23386 d_getmnt='$d_getmnt'
23387 d_getmntent='$d_getmntent'
23388 d_getnameinfo='$d_getnameinfo'
23389 d_getnbyaddr='$d_getnbyaddr'
23390 d_getnbyname='$d_getnbyname'
23391 d_getnent='$d_getnent'
23392 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23393 d_getnetbyname_r='$d_getnetbyname_r'
23394 d_getnetent_r='$d_getnetent_r'
23395 d_getnetprotos='$d_getnetprotos'
23396 d_getpagsz='$d_getpagsz'
23397 d_getpbyname='$d_getpbyname'
23398 d_getpbynumber='$d_getpbynumber'
23399 d_getpent='$d_getpent'
23400 d_getpgid='$d_getpgid'
23401 d_getpgrp2='$d_getpgrp2'
23402 d_getpgrp='$d_getpgrp'
23403 d_getppid='$d_getppid'
23404 d_getprior='$d_getprior'
23405 d_getprotobyname_r='$d_getprotobyname_r'
23406 d_getprotobynumber_r='$d_getprotobynumber_r'
23407 d_getprotoent_r='$d_getprotoent_r'
23408 d_getprotoprotos='$d_getprotoprotos'
23409 d_getprpwnam='$d_getprpwnam'
23410 d_getpwent='$d_getpwent'
23411 d_getpwent_r='$d_getpwent_r'
23412 d_getpwnam_r='$d_getpwnam_r'
23413 d_getpwuid_r='$d_getpwuid_r'
23414 d_getsbyname='$d_getsbyname'
23415 d_getsbyport='$d_getsbyport'
23416 d_getsent='$d_getsent'
23417 d_getservbyname_r='$d_getservbyname_r'
23418 d_getservbyport_r='$d_getservbyport_r'
23419 d_getservent_r='$d_getservent_r'
23420 d_getservprotos='$d_getservprotos'
23421 d_getspnam='$d_getspnam'
23422 d_getspnam_r='$d_getspnam_r'
23423 d_gettimeod='$d_gettimeod'
23424 d_gmtime64='$d_gmtime64'
23425 d_gmtime_r='$d_gmtime_r'
23426 d_gnulibc='$d_gnulibc'
23427 d_grpasswd='$d_grpasswd'
23428 d_hasmntopt='$d_hasmntopt'
23430 d_ilogbl='$d_ilogbl'
23431 d_inc_version_list='$d_inc_version_list'
23433 d_inetaton='$d_inetaton'
23434 d_inetntop='$d_inetntop'
23435 d_inetpton='$d_inetpton'
23436 d_int64_t='$d_int64_t'
23437 d_ip_mreq='$d_ip_mreq'
23438 d_ip_mreq_source='$d_ip_mreq_source'
23439 d_ipv6_mreq='$d_ipv6_mreq'
23440 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23441 d_isascii='$d_isascii'
23442 d_isblank='$d_isblank'
23443 d_isfinite='$d_isfinite'
23444 d_isfinitel='$d_isfinitel'
23446 d_isinfl='$d_isinfl'
23448 d_isnanl='$d_isnanl'
23451 d_killpg='$d_killpg'
23452 d_lchown='$d_lchown'
23453 d_ldbl_dig='$d_ldbl_dig'
23454 d_ldexpl='$d_ldexpl'
23455 d_libm_lib_version='$d_libm_lib_version'
23456 d_libname_unique='$d_libname_unique'
23458 d_localtime64='$d_localtime64'
23459 d_localtime_r='$d_localtime_r'
23460 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23461 d_locconv='$d_locconv'
23463 d_longdbl='$d_longdbl'
23464 d_longlong='$d_longlong'
23465 d_lseekproto='$d_lseekproto'
23467 d_madvise='$d_madvise'
23468 d_malloc_good_size='$d_malloc_good_size'
23469 d_malloc_size='$d_malloc_size'
23471 d_mbstowcs='$d_mbstowcs'
23472 d_mbtowc='$d_mbtowc'
23473 d_memchr='$d_memchr'
23474 d_memcmp='$d_memcmp'
23475 d_memcpy='$d_memcpy'
23476 d_memmove='$d_memmove'
23477 d_memset='$d_memset'
23479 d_mkdtemp='$d_mkdtemp'
23480 d_mkfifo='$d_mkfifo'
23481 d_mkstemp='$d_mkstemp'
23482 d_mkstemps='$d_mkstemps'
23483 d_mktime64='$d_mktime64'
23484 d_mktime='$d_mktime'
23487 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23488 d_modflproto='$d_modflproto'
23489 d_mprotect='$d_mprotect'
23491 d_msg_ctrunc='$d_msg_ctrunc'
23492 d_msg_dontroute='$d_msg_dontroute'
23493 d_msg_oob='$d_msg_oob'
23494 d_msg_peek='$d_msg_peek'
23495 d_msg_proxy='$d_msg_proxy'
23496 d_msgctl='$d_msgctl'
23497 d_msgget='$d_msgget'
23498 d_msghdr_s='$d_msghdr_s'
23499 d_msgrcv='$d_msgrcv'
23500 d_msgsnd='$d_msgsnd'
23502 d_munmap='$d_munmap'
23503 d_mymalloc='$d_mymalloc'
23505 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23507 d_nl_langinfo='$d_nl_langinfo'
23508 d_nv_preserves_uv='$d_nv_preserves_uv'
23509 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23510 d_off64_t='$d_off64_t'
23511 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23512 d_oldpthreads='$d_oldpthreads'
23513 d_oldsock='$d_oldsock'
23515 d_pathconf='$d_pathconf'
23517 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23518 d_phostname='$d_phostname'
23521 d_portable='$d_portable'
23523 d_prctl_set_name='$d_prctl_set_name'
23524 d_printf_format_null='$d_printf_format_null'
23525 d_procselfexe='$d_procselfexe'
23526 d_pseudofork='$d_pseudofork'
23527 d_pthread_atfork='$d_pthread_atfork'
23528 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23529 d_pthread_yield='$d_pthread_yield'
23530 d_ptrdiff_t='$d_ptrdiff_t'
23532 d_pwchange='$d_pwchange'
23533 d_pwclass='$d_pwclass'
23534 d_pwcomment='$d_pwcomment'
23535 d_pwexpire='$d_pwexpire'
23536 d_pwgecos='$d_pwgecos'
23537 d_pwpasswd='$d_pwpasswd'
23538 d_pwquota='$d_pwquota'
23541 d_random_r='$d_random_r'
23542 d_readdir64_r='$d_readdir64_r'
23543 d_readdir='$d_readdir'
23544 d_readdir_r='$d_readdir_r'
23545 d_readlink='$d_readlink'
23547 d_recvmsg='$d_recvmsg'
23548 d_rename='$d_rename'
23549 d_rewinddir='$d_rewinddir'
23551 d_safebcpy='$d_safebcpy'
23552 d_safemcpy='$d_safemcpy'
23553 d_sanemcmp='$d_sanemcmp'
23554 d_sbrkproto='$d_sbrkproto'
23555 d_scalbnl='$d_scalbnl'
23556 d_sched_yield='$d_sched_yield'
23557 d_scm_rights='$d_scm_rights'
23558 d_seekdir='$d_seekdir'
23559 d_select='$d_select'
23561 d_semctl='$d_semctl'
23562 d_semctl_semid_ds='$d_semctl_semid_ds'
23563 d_semctl_semun='$d_semctl_semun'
23564 d_semget='$d_semget'
23566 d_sendmsg='$d_sendmsg'
23567 d_setegid='$d_setegid'
23568 d_seteuid='$d_seteuid'
23569 d_setgrent='$d_setgrent'
23570 d_setgrent_r='$d_setgrent_r'
23571 d_setgrps='$d_setgrps'
23572 d_sethent='$d_sethent'
23573 d_sethostent_r='$d_sethostent_r'
23574 d_setitimer='$d_setitimer'
23575 d_setlinebuf='$d_setlinebuf'
23576 d_setlocale='$d_setlocale'
23577 d_setlocale_r='$d_setlocale_r'
23578 d_setnent='$d_setnent'
23579 d_setnetent_r='$d_setnetent_r'
23580 d_setpent='$d_setpent'
23581 d_setpgid='$d_setpgid'
23582 d_setpgrp2='$d_setpgrp2'
23583 d_setpgrp='$d_setpgrp'
23584 d_setprior='$d_setprior'
23585 d_setproctitle='$d_setproctitle'
23586 d_setprotoent_r='$d_setprotoent_r'
23587 d_setpwent='$d_setpwent'
23588 d_setpwent_r='$d_setpwent_r'
23589 d_setregid='$d_setregid'
23590 d_setresgid='$d_setresgid'
23591 d_setresuid='$d_setresuid'
23592 d_setreuid='$d_setreuid'
23593 d_setrgid='$d_setrgid'
23594 d_setruid='$d_setruid'
23595 d_setsent='$d_setsent'
23596 d_setservent_r='$d_setservent_r'
23597 d_setsid='$d_setsid'
23598 d_setvbuf='$d_setvbuf'
23601 d_shmatprototype='$d_shmatprototype'
23602 d_shmctl='$d_shmctl'
23604 d_shmget='$d_shmget'
23605 d_sigaction='$d_sigaction'
23606 d_signbit='$d_signbit'
23607 d_sigprocmask='$d_sigprocmask'
23608 d_sigsetjmp='$d_sigsetjmp'
23609 d_sin6_scope_id='$d_sin6_scope_id'
23610 d_sitearch='$d_sitearch'
23611 d_snprintf='$d_snprintf'
23612 d_sockaddr_in6='$d_sockaddr_in6'
23613 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23614 d_sockatmark='$d_sockatmark'
23615 d_sockatmarkproto='$d_sockatmarkproto'
23616 d_socket='$d_socket'
23617 d_socklen_t='$d_socklen_t'
23618 d_sockpair='$d_sockpair'
23619 d_socks5_init='$d_socks5_init'
23620 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23622 d_srand48_r='$d_srand48_r'
23623 d_srandom_r='$d_srandom_r'
23624 d_sresgproto='$d_sresgproto'
23625 d_sresuproto='$d_sresuproto'
23626 d_statblks='$d_statblks'
23627 d_statfs_f_flags='$d_statfs_f_flags'
23628 d_statfs_s='$d_statfs_s'
23629 d_static_inline='$d_static_inline'
23630 d_statvfs='$d_statvfs'
23631 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23632 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23633 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23634 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23635 d_stdio_stream_array='$d_stdio_stream_array'
23636 d_stdiobase='$d_stdiobase'
23637 d_stdstdio='$d_stdstdio'
23638 d_strchr='$d_strchr'
23639 d_strcoll='$d_strcoll'
23640 d_strctcpy='$d_strctcpy'
23641 d_strerrm='$d_strerrm'
23642 d_strerror='$d_strerror'
23643 d_strerror_r='$d_strerror_r'
23644 d_strftime='$d_strftime'
23645 d_strlcat='$d_strlcat'
23646 d_strlcpy='$d_strlcpy'
23647 d_strtod='$d_strtod'
23648 d_strtol='$d_strtol'
23649 d_strtold='$d_strtold'
23650 d_strtoll='$d_strtoll'
23651 d_strtoq='$d_strtoq'
23652 d_strtoul='$d_strtoul'
23653 d_strtoull='$d_strtoull'
23654 d_strtouq='$d_strtouq'
23655 d_strxfrm='$d_strxfrm'
23656 d_suidsafe='$d_suidsafe'
23657 d_symlink='$d_symlink'
23658 d_syscall='$d_syscall'
23659 d_syscallproto='$d_syscallproto'
23660 d_sysconf='$d_sysconf'
23661 d_sysernlst='$d_sysernlst'
23662 d_syserrlst='$d_syserrlst'
23663 d_system='$d_system'
23664 d_tcgetpgrp='$d_tcgetpgrp'
23665 d_tcsetpgrp='$d_tcsetpgrp'
23666 d_telldir='$d_telldir'
23667 d_telldirproto='$d_telldirproto'
23669 d_timegm='$d_timegm'
23671 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23672 d_tm_tm_zone='$d_tm_tm_zone'
23673 d_tmpnam_r='$d_tmpnam_r'
23674 d_truncate='$d_truncate'
23675 d_ttyname_r='$d_ttyname_r'
23676 d_tzname='$d_tzname'
23677 d_u32align='$d_u32align'
23678 d_ualarm='$d_ualarm'
23681 d_union_semun='$d_union_semun'
23682 d_unordered='$d_unordered'
23683 d_unsetenv='$d_unsetenv'
23684 d_usleep='$d_usleep'
23685 d_usleepproto='$d_usleepproto'
23687 d_vendorarch='$d_vendorarch'
23688 d_vendorbin='$d_vendorbin'
23689 d_vendorlib='$d_vendorlib'
23690 d_vendorscript='$d_vendorscript'
23692 d_void_closedir='$d_void_closedir'
23693 d_voidsig='$d_voidsig'
23694 d_voidtty='$d_voidtty'
23695 d_volatile='$d_volatile'
23696 d_vprintf='$d_vprintf'
23697 d_vsnprintf='$d_vsnprintf'
23699 d_waitpid='$d_waitpid'
23700 d_wcscmp='$d_wcscmp'
23701 d_wcstombs='$d_wcstombs'
23702 d_wcsxfrm='$d_wcsxfrm'
23703 d_wctomb='$d_wctomb'
23704 d_writev='$d_writev'
23707 db_hashtype='$db_hashtype'
23708 db_prefixtype='$db_prefixtype'
23709 db_version_major='$db_version_major'
23710 db_version_minor='$db_version_minor'
23711 db_version_patch='$db_version_patch'
23712 direntrytype='$direntrytype'
23715 doublesize='$doublesize'
23717 drand48_r_proto='$drand48_r_proto'
23719 dynamic_ext='$dynamic_ext'
23725 endgrent_r_proto='$endgrent_r_proto'
23726 endhostent_r_proto='$endhostent_r_proto'
23727 endnetent_r_proto='$endnetent_r_proto'
23728 endprotoent_r_proto='$endprotoent_r_proto'
23729 endpwent_r_proto='$endpwent_r_proto'
23730 endservent_r_proto='$endservent_r_proto'
23731 eunicefix='$eunicefix'
23734 extensions='$extensions'
23735 extern_C='$extern_C'
23737 fflushNULL='$fflushNULL'
23738 fflushall='$fflushall'
23740 firstmakefile='$firstmakefile'
23742 fpossize='$fpossize'
23743 fpostype='$fpostype'
23744 freetype='$freetype'
23747 full_csh='$full_csh'
23748 full_sed='$full_sed'
23749 gccansipedantic='$gccansipedantic'
23750 gccosandvers='$gccosandvers'
23751 gccversion='$gccversion'
23752 getgrent_r_proto='$getgrent_r_proto'
23753 getgrgid_r_proto='$getgrgid_r_proto'
23754 getgrnam_r_proto='$getgrnam_r_proto'
23755 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23756 gethostbyname_r_proto='$gethostbyname_r_proto'
23757 gethostent_r_proto='$gethostent_r_proto'
23758 getlogin_r_proto='$getlogin_r_proto'
23759 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23760 getnetbyname_r_proto='$getnetbyname_r_proto'
23761 getnetent_r_proto='$getnetent_r_proto'
23762 getprotobyname_r_proto='$getprotobyname_r_proto'
23763 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23764 getprotoent_r_proto='$getprotoent_r_proto'
23765 getpwent_r_proto='$getpwent_r_proto'
23766 getpwnam_r_proto='$getpwnam_r_proto'
23767 getpwuid_r_proto='$getpwuid_r_proto'
23768 getservbyname_r_proto='$getservbyname_r_proto'
23769 getservbyport_r_proto='$getservbyport_r_proto'
23770 getservent_r_proto='$getservent_r_proto'
23771 getspnam_r_proto='$getspnam_r_proto'
23772 gidformat='$gidformat'
23778 gmtime_r_proto='$gmtime_r_proto'
23779 gnulibc_version='$gnulibc_version'
23781 groupcat='$groupcat'
23782 groupstype='$groupstype'
23785 h_sysfile='$h_sysfile'
23788 hostgenerate='$hostgenerate'
23789 hostosname='$hostosname'
23790 hostperl='$hostperl'
23791 html1dir='$html1dir'
23792 html1direxp='$html1direxp'
23793 html3dir='$html3dir'
23794 html3direxp='$html3direxp'
23803 i_arpainet='$i_arpainet'
23804 i_assert='$i_assert'
23806 i_bsdioctl='$i_bsdioctl'
23810 i_dirent='$i_dirent'
23812 i_execinfo='$i_execinfo'
23817 i_fp_class='$i_fp_class'
23819 i_gdbm_ndbm='$i_gdbm_ndbm'
23820 i_gdbmndbm='$i_gdbmndbm'
23822 i_ieeefp='$i_ieeefp'
23823 i_inttypes='$i_inttypes'
23824 i_langinfo='$i_langinfo'
23825 i_libutil='$i_libutil'
23826 i_limits='$i_limits'
23827 i_locale='$i_locale'
23828 i_machcthr='$i_machcthr'
23829 i_malloc='$i_malloc'
23830 i_mallocmalloc='$i_mallocmalloc'
23832 i_memory='$i_memory'
23833 i_mntent='$i_mntent'
23836 i_neterrno='$i_neterrno'
23837 i_netinettcp='$i_netinettcp'
23841 i_pthread='$i_pthread'
23843 i_rpcsvcdbm='$i_rpcsvcdbm'
23845 i_shadow='$i_shadow'
23847 i_stdarg='$i_stdarg'
23848 i_stdbool='$i_stdbool'
23849 i_stddef='$i_stddef'
23850 i_stdint='$i_stdint'
23851 i_stdlib='$i_stdlib'
23852 i_string='$i_string'
23853 i_sunmath='$i_sunmath'
23854 i_sysaccess='$i_sysaccess'
23855 i_sysdir='$i_sysdir'
23856 i_sysfile='$i_sysfile'
23857 i_sysfilio='$i_sysfilio'
23859 i_sysioctl='$i_sysioctl'
23860 i_syslog='$i_syslog'
23861 i_sysmman='$i_sysmman'
23862 i_sysmode='$i_sysmode'
23863 i_sysmount='$i_sysmount'
23864 i_sysndir='$i_sysndir'
23865 i_sysparam='$i_sysparam'
23866 i_syspoll='$i_syspoll'
23867 i_sysresrc='$i_sysresrc'
23868 i_syssecrt='$i_syssecrt'
23869 i_sysselct='$i_sysselct'
23870 i_syssockio='$i_syssockio'
23871 i_sysstat='$i_sysstat'
23872 i_sysstatfs='$i_sysstatfs'
23873 i_sysstatvfs='$i_sysstatvfs'
23874 i_systime='$i_systime'
23875 i_systimek='$i_systimek'
23876 i_systimes='$i_systimes'
23877 i_systypes='$i_systypes'
23878 i_sysuio='$i_sysuio'
23880 i_sysutsname='$i_sysutsname'
23881 i_sysvfs='$i_sysvfs'
23882 i_syswait='$i_syswait'
23883 i_termio='$i_termio'
23884 i_termios='$i_termios'
23886 i_unistd='$i_unistd'
23889 i_values='$i_values'
23890 i_varargs='$i_varargs'
23891 i_varhdr='$i_varhdr'
23893 ignore_versioned_solibs='$ignore_versioned_solibs'
23894 inc_version_list='$inc_version_list'
23895 inc_version_list_init='$inc_version_list_init'
23899 initialinstalllocation='$initialinstalllocation'
23900 installarchlib='$installarchlib'
23901 installbin='$installbin'
23902 installhtml1dir='$installhtml1dir'
23903 installhtml3dir='$installhtml3dir'
23904 installman1dir='$installman1dir'
23905 installman3dir='$installman3dir'
23906 installprefix='$installprefix'
23907 installprefixexp='$installprefixexp'
23908 installprivlib='$installprivlib'
23909 installscript='$installscript'
23910 installsitearch='$installsitearch'
23911 installsitebin='$installsitebin'
23912 installsitehtml1dir='$installsitehtml1dir'
23913 installsitehtml3dir='$installsitehtml3dir'
23914 installsitelib='$installsitelib'
23915 installsiteman1dir='$installsiteman1dir'
23916 installsiteman3dir='$installsiteman3dir'
23917 installsitescript='$installsitescript'
23918 installstyle='$installstyle'
23919 installusrbinperl='$installusrbinperl'
23920 installvendorarch='$installvendorarch'
23921 installvendorbin='$installvendorbin'
23922 installvendorhtml1dir='$installvendorhtml1dir'
23923 installvendorhtml3dir='$installvendorhtml3dir'
23924 installvendorlib='$installvendorlib'
23925 installvendorman1dir='$installvendorman1dir'
23926 installvendorman3dir='$installvendorman3dir'
23927 installvendorscript='$installvendorscript'
23929 issymlink='$issymlink'
23930 ivdformat='$ivdformat'
23933 known_extensions='$known_extensions'
23936 ld_can_script='$ld_can_script'
23937 lddlflags='$lddlflags'
23939 ldflags_uselargefiles='$ldflags_uselargefiles'
23940 ldlibpthname='$ldlibpthname'
23947 libsdirs='$libsdirs'
23948 libsfiles='$libsfiles'
23949 libsfound='$libsfound'
23950 libspath='$libspath'
23951 libswanted='$libswanted'
23952 libswanted_uselargefiles='$libswanted_uselargefiles'
23958 localtime_r_proto='$localtime_r_proto'
23959 locincpth='$locincpth'
23960 loclibpth='$loclibpth'
23961 longdblkind='$longdblkind'
23962 longdblsize='$longdblsize'
23963 longlongsize='$longlongsize'
23964 longsize='$longsize'
23968 lseeksize='$lseeksize'
23969 lseektype='$lseektype'
23973 make_set_make='$make_set_make'
23974 mallocobj='$mallocobj'
23975 mallocsrc='$mallocsrc'
23976 malloctype='$malloctype'
23978 man1direxp='$man1direxp'
23981 man3direxp='$man3direxp'
23983 mips_type='$mips_type'
23984 mistrustnm='$mistrustnm'
23986 mmaptype='$mmaptype'
23987 modetype='$modetype'
23989 multiarch='$multiarch'
23991 myarchname='$myarchname'
23992 mydomain='$mydomain'
23993 myhostname='$myhostname'
23996 need_va_copy='$need_va_copy'
23997 netdb_hlen_type='$netdb_hlen_type'
23998 netdb_host_type='$netdb_host_type'
23999 netdb_name_type='$netdb_name_type'
24000 netdb_net_type='$netdb_net_type'
24003 nm_so_opt='$nm_so_opt'
24004 nonxs_ext='$nonxs_ext'
24006 nvEUformat='$nvEUformat'
24007 nvFUformat='$nvFUformat'
24008 nvGUformat='$nvGUformat'
24009 nv_overflows_integers_at='$nv_overflows_integers_at'
24010 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24011 nveformat='$nveformat'
24012 nvfformat='$nvfformat'
24013 nvgformat='$nvgformat'
24016 o_nonblock='$o_nonblock'
24018 old_pthread_create_joinable='$old_pthread_create_joinable'
24019 optimize='$optimize'
24020 orderlib='$orderlib'
24023 otherlibdirs='$otherlibdirs'
24027 patchlevel='$patchlevel'
24028 path_sep='$path_sep'
24031 perl_patchlevel='$perl_patchlevel'
24032 perl_static_inline='$perl_static_inline'
24033 perladmin='$perladmin'
24034 perllibs='$perllibs'
24035 perlpath='$perlpath'
24037 phostname='$phostname'
24043 prefixexp='$prefixexp'
24045 privlibexp='$privlibexp'
24046 procselfexe='$procselfexe'
24047 prototype='$prototype'
24049 quadkind='$quadkind'
24050 quadtype='$quadtype'
24051 randbits='$randbits'
24052 randfunc='$randfunc'
24053 random_r_proto='$random_r_proto'
24054 randseedtype='$randseedtype'
24056 rd_nodata='$rd_nodata'
24057 readdir64_r_proto='$readdir64_r_proto'
24058 readdir_r_proto='$readdir_r_proto'
24059 revision='$revision'
24065 sGMTIME_max='$sGMTIME_max'
24066 sGMTIME_min='$sGMTIME_min'
24067 sLOCALTIME_max='$sLOCALTIME_max'
24068 sLOCALTIME_min='$sLOCALTIME_min'
24069 sPRIEUldbl='$sPRIEUldbl'
24070 sPRIFUldbl='$sPRIFUldbl'
24071 sPRIGUldbl='$sPRIGUldbl'
24072 sPRIXU64='$sPRIXU64'
24074 sPRIeldbl='$sPRIeldbl'
24075 sPRIfldbl='$sPRIfldbl'
24076 sPRIgldbl='$sPRIgldbl'
24081 sSCNfldbl='$sSCNfldbl'
24082 sched_yield='$sched_yield'
24083 scriptdir='$scriptdir'
24084 scriptdirexp='$scriptdirexp'
24086 seedfunc='$seedfunc'
24087 selectminbits='$selectminbits'
24088 selecttype='$selecttype'
24089 sendmail='$sendmail'
24090 setgrent_r_proto='$setgrent_r_proto'
24091 sethostent_r_proto='$sethostent_r_proto'
24092 setlocale_r_proto='$setlocale_r_proto'
24093 setnetent_r_proto='$setnetent_r_proto'
24094 setprotoent_r_proto='$setprotoent_r_proto'
24095 setpwent_r_proto='$setpwent_r_proto'
24096 setservent_r_proto='$setservent_r_proto'
24099 sharpbang='$sharpbang'
24100 shmattype='$shmattype'
24101 shortsize='$shortsize'
24104 sig_count='$sig_count'
24105 sig_name='$sig_name'
24106 sig_name_init='$sig_name_init'
24108 sig_num_init='$sig_num_init'
24109 sig_size='$sig_size'
24110 signal_t='$signal_t'
24111 sitearch='$sitearch'
24112 sitearchexp='$sitearchexp'
24114 sitebinexp='$sitebinexp'
24115 sitehtml1dir='$sitehtml1dir'
24116 sitehtml1direxp='$sitehtml1direxp'
24117 sitehtml3dir='$sitehtml3dir'
24118 sitehtml3direxp='$sitehtml3direxp'
24120 sitelib_stem='$sitelib_stem'
24121 sitelibexp='$sitelibexp'
24122 siteman1dir='$siteman1dir'
24123 siteman1direxp='$siteman1direxp'
24124 siteman3dir='$siteman3dir'
24125 siteman3direxp='$siteman3direxp'
24126 siteprefix='$siteprefix'
24127 siteprefixexp='$siteprefixexp'
24128 sitescript='$sitescript'
24129 sitescriptexp='$sitescriptexp'
24130 sizesize='$sizesize'
24131 sizetype='$sizetype'
24135 sockethdr='$sockethdr'
24136 socketlib='$socketlib'
24137 socksizetype='$socksizetype'
24139 spackage='$spackage'
24140 spitshell='$spitshell'
24141 srand48_r_proto='$srand48_r_proto'
24142 srandom_r_proto='$srandom_r_proto'
24144 ssizetype='$ssizetype'
24145 st_ino_sign='$st_ino_sign'
24146 st_ino_size='$st_ino_size'
24147 startperl='$startperl'
24149 static_ext='$static_ext'
24151 stdio_base='$stdio_base'
24152 stdio_bufsiz='$stdio_bufsiz'
24153 stdio_cnt='$stdio_cnt'
24154 stdio_filbuf='$stdio_filbuf'
24155 stdio_ptr='$stdio_ptr'
24156 stdio_stream_array='$stdio_stream_array'
24157 strerror_r_proto='$strerror_r_proto'
24160 subversion='$subversion'
24165 targetarch='$targetarch'
24166 targetdir='$targetdir'
24167 targetenv='$targetenv'
24168 targethost='$targethost'
24169 targetmkdir='$targetmkdir'
24170 targetport='$targetport'
24171 targetsh='$targetsh'
24175 timeincl='$timeincl'
24176 timetype='$timetype'
24177 tmpnam_r_proto='$tmpnam_r_proto'
24183 ttyname_r_proto='$ttyname_r_proto'
24192 uidformat='$uidformat'
24198 uquadtype='$uquadtype'
24199 use5005threads='$use5005threads'
24200 use64bitall='$use64bitall'
24201 use64bitint='$use64bitint'
24202 usecbacktrace='$usecbacktrace'
24203 usecrosscompile='$usecrosscompile'
24204 usedevel='$usedevel'
24206 usedtrace='$usedtrace'
24207 usefaststdio='$usefaststdio'
24208 useithreads='$useithreads'
24209 usekernprocpathname='$usekernprocpathname'
24210 uselargefiles='$uselargefiles'
24211 uselongdouble='$uselongdouble'
24212 usemallocwrap='$usemallocwrap'
24213 usemorebits='$usemorebits'
24214 usemultiplicity='$usemultiplicity'
24215 usemymalloc='$usemymalloc'
24217 usensgetexecutablepath='$usensgetexecutablepath'
24218 useopcode='$useopcode'
24219 useperlio='$useperlio'
24220 useposix='$useposix'
24221 usereentrant='$usereentrant'
24222 userelocatableinc='$userelocatableinc'
24223 useshrplib='$useshrplib'
24224 usesitecustomize='$usesitecustomize'
24225 usesocks='$usesocks'
24226 usethreads='$usethreads'
24227 usevendorprefix='$usevendorprefix'
24228 useversionedarchname='$useversionedarchname'
24229 usevfork='$usevfork'
24232 uvXUformat='$uvXUformat'
24233 uvoformat='$uvoformat'
24236 uvuformat='$uvuformat'
24237 uvxformat='$uvxformat'
24239 vendorarch='$vendorarch'
24240 vendorarchexp='$vendorarchexp'
24241 vendorbin='$vendorbin'
24242 vendorbinexp='$vendorbinexp'
24243 vendorhtml1dir='$vendorhtml1dir'
24244 vendorhtml1direxp='$vendorhtml1direxp'
24245 vendorhtml3dir='$vendorhtml3dir'
24246 vendorhtml3direxp='$vendorhtml3direxp'
24247 vendorlib='$vendorlib'
24248 vendorlib_stem='$vendorlib_stem'
24249 vendorlibexp='$vendorlibexp'
24250 vendorman1dir='$vendorman1dir'
24251 vendorman1direxp='$vendorman1direxp'
24252 vendorman3dir='$vendorman3dir'
24253 vendorman3direxp='$vendorman3direxp'
24254 vendorprefix='$vendorprefix'
24255 vendorprefixexp='$vendorprefixexp'
24256 vendorscript='$vendorscript'
24257 vendorscriptexp='$vendorscriptexp'
24259 version_patchlevel_string='$version_patchlevel_string'
24260 versiononly='$versiononly'
24264 yaccflags='$yaccflags'
24269 : add special variables
24270 $test -f $src/patchlevel.h && \
24271 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24272 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24273 echo "PERL_CONFIG_SH=true" >>config.sh
24275 : propagate old symbols
24276 if $test -f UU/config.sh; then
24277 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24278 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24279 config.sh config.sh UU/oldconfig.sh |\
24280 $sort | $uniq -u >UU/oldsyms
24281 set X `$cat UU/oldsyms`
24287 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24289 echo ": Variables propagated from previous config.sh file." >>config.sh
24290 for sym in `$cat UU/oldsyms`; do
24291 echo " Propagating $hint variable "'$'"$sym..."
24292 eval 'tmp="$'"${sym}"'"'
24294 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24300 : preserve RCS keywords in files with variable substitution, grrr
24303 : Finish up by extracting the .SH files
24307 echo "Extraction done."
24317 If you'd like to make any changes to the config.sh file before I begin
24318 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24321 rp="Press return or use a shell escape to edit config.sh:"
24326 *) : in case they cannot read
24327 sh 1>&4 -c "$ans";;
24332 : if this fails, just run all the .SH files by hand
24341 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24348 Now you need to generate make dependencies by running "$make depend".
24349 You might prefer to run it in background: "$make depend > makedepend.out &"
24350 It can take a while, so you might not want to run it right now.
24355 rp="Run $make depend now?"
24359 $make depend && echo "Now you must run '$make'."
24362 echo "You must run '$make depend' then '$make'."
24365 elif test -f [Mm]akefile; then
24367 echo "Now you must run a $make."
24369 echo "Configure done."
24372 if $test -f Policy.sh; then
24375 If you compile $package on a different machine or from a different object
24376 directory, copy the Policy.sh file from this object directory to the
24377 new one before you run Configure -- this will help you with most of
24378 the policy defaults.
24382 if $test -f config.msg; then
24383 echo "Hmm. I also noted the following information while running:"
24385 $cat config.msg >&4
24388 $rm -f kit*isdone ark*isdone