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 on Thu Aug 29 09:37:19 CEST 2013 [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 >/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
335 useversionedarchname=''
341 initialinstalllocation=''
370 d_attribute_deprecated=''
371 d_attribute_format=''
372 d_attribute_malloc=''
373 d_attribute_nonnull=''
374 d_attribute_noreturn=''
376 d_attribute_unused=''
377 d_attribute_warn_unused_result=''
378 d_printf_format_null=''
381 d_builtin_choose_expr=''
384 d_c99_variadic_macros=''
431 endhostent_r_proto=''
437 endprotoent_r_proto=''
443 endservent_r_proto=''
496 gethostbyaddr_r_proto=''
498 gethostbyname_r_proto=''
500 gethostent_r_proto=''
513 getnetbyaddr_r_proto=''
515 getnetbyname_r_proto=''
529 d_getprotobyname_r=''
530 getprotobyname_r_proto=''
531 d_getprotobynumber_r=''
532 getprotobynumber_r_proto=''
534 getprotoent_r_proto=''
546 getservbyname_r_proto=''
548 getservbyport_r_proto=''
550 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
730 d_ipv6_mreq_source=''
747 d_sprintf_returns_strlen=''
759 perl_static_inline=''
764 d_stdio_ptr_lval_nochange_cnt=''
765 d_stdio_ptr_lval_sets_cnt=''
911 d_gdbm_ndbm_h_uses_prototypes=''
912 d_gdbmndbm_h_uses_prototypes=''
914 d_ndbm_h_uses_prototypes=''
989 d_inc_version_list=''
991 inc_version_list_init=''
1010 ignore_versioned_solibs=''
1074 d_perl_otherlibdirs=''
1082 api_versionstring=''
1088 version_patchlevel_string=''
1092 d_nv_preserves_uv=''
1093 d_nv_zero_is_allbits_zero=''
1104 nv_overflows_integers_at=''
1105 nv_preserves_uv_bits=''
1177 installsitehtml1dir=''
1180 installsitehtml3dir=''
1187 installsiteman1dir=''
1190 installsiteman3dir=''
1195 installsitescript=''
1212 d_stdio_stream_array=''
1213 stdio_stream_array=''
1230 usekernprocpathname=''
1231 ccflags_uselargefiles=''
1232 ldflags_uselargefiles=''
1233 libswanted_uselargefiles=''
1242 usensgetexecutablepath=''
1255 installvendorarch=''
1262 installvendorhtml1dir=''
1264 vendorhtml1direxp=''
1265 installvendorhtml3dir=''
1267 vendorhtml3direxp=''
1273 installvendorman1dir=''
1276 installvendorman3dir=''
1283 installvendorscript=''
1296 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1299 : We must find out about Eunice early
1301 if test -f /etc/unixtovms; then
1302 eunicefix=/etc/unixtovms
1304 if test -f /etc/unixtovms.exe; then
1305 eunicefix=/etc/unixtovms.exe
1308 : Set executable suffix now -- needed before hints available
1309 if test -f "/libs/version.library"; then
1312 elif test -f "/system/gnu_library/bin/ar.pm"; then
1315 elif test -n "$DJGPP"; then
1318 elif test -d c:/. -o -n "$is_os2" ; then
1325 : Trailing extension. Override this in a hint file, if needed.
1326 : Extra object files, if any, needed on this platform.
1329 : Possible local include directories to search.
1330 : Set locincpth to "" in a hint file to defeat local include searches.
1331 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1332 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1334 : no include file wanted by default
1337 : Enable -DEBUGGING and -DDEBUGGING from the command line
1342 : change the next line if compiling for Xenix/286 on Xenix/386
1343 xlibpth='/usr/lib/386 /lib/386'
1344 : Possible local library directories to search.
1345 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1346 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1348 : general looking path for locating libraries
1349 glibpth="/lib /usr/lib $xlibpth"
1350 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1351 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1352 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1353 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1355 : Private path used by Configure to find libraries. Its value
1356 : is prepended to libpth. This variable takes care of special
1357 : machines, like the mips. Usually, it should be empty.
1360 : default library list
1362 : some systems want to use only the non-versioned libso:s
1363 ignore_versioned_solibs=''
1364 : set usethreads on the Configure command line to enable threads.
1365 usereentrant='undef'
1366 : full support for void wanted by default
1372 : set useposix=false in your hint file to disable the POSIX extension.
1374 : set useopcode=false in your hint file to disable the Opcode extension.
1377 ccflags_uselargefiles=''
1378 ldflags_uselargefiles=''
1379 libswanted_uselargefiles=''
1380 : set usemultiplicity on the Configure command line to enable multiplicity.
1381 : set usesocks on the Configure command line to enable socks.
1382 : List of libraries we want.
1383 : If anyone needs extra -lxxx, put those in a hint file.
1384 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1385 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1386 : We probably want to search /usr/shlib before most other libraries.
1387 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1388 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1389 glibpth="/usr/shlib $glibpth"
1390 : Do not use vfork unless overridden by a hint file.
1393 : Find the basic shell for Bourne shell scripts
1397 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1400 if test -f "$xxx"; then
1403 : Build up a list and do a single loop so we can 'break' out.
1404 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1405 for xxx in sh bash ksh pdksh ash; do
1407 try="$try ${p}/${xxx}"
1411 if test -f "$xxx"; then
1414 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1417 elif test -f "$xxx.exe"; then
1428 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1430 Usually it's in /bin/sh. How did you even get this far?
1431 Please contact me (Perl Maintainers) at perlbug@perl.org and
1432 we'll try to straighten this all out.
1438 : see if sh knows # comments
1439 if `$sh -c '#' >/dev/null 2>&1`; then
1443 test -f $xcat$_exe || xcat=/usr/bin/cat
1444 if test ! -f $xcat$_exe; then
1445 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1446 if test -f $p/cat$_exe; then
1451 if test ! -f $xcat$_exe; then
1452 echo "Can't find cat anywhere!"
1456 echo "#!$xcat" >sharp
1459 ./sharp > today 2>/dev/null
1460 if test -s today; then
1463 echo "#! $xcat" > sharp
1466 ./sharp > today 2>/dev/null
1467 if test -s today; then
1475 echo "Your $sh doesn't grok # comments--I will strip them later on."
1478 echo "exec grep -v '^[ ]*#'" >spitshell
1480 $eunicefix spitshell
1481 spitshell=`pwd`/spitshell
1483 echo "I presume that if # doesn't work, #! won't work either!"
1488 : figure out how to guarantee sh startup
1490 '') startsh=${sharpbang}${sh} ;;
1502 : echo "Yup, it does."
1504 echo "Hmm... '$startsh' does not guarantee sh startup..."
1505 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1509 : Save command line options in file UU/cmdline.opt for later use in
1510 : generating config.sh.
1511 cat > cmdline.opt <<EOSH
1512 : Configure command line arguments.
1521 cat >>cmdline.opt <<EOSH
1522 config_arg$argn='$arg'
1524 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1527 arg_exp=`cat cmdl.opt`
1528 args_exp="$args_exp$args_sep'$arg_exp'"
1529 argn=`expr $argn + 1`
1534 : produce awk script to parse command line options
1535 cat >options.awk <<'EOF'
1537 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1539 len = length(optstr);
1540 for (i = 1; i <= len; i++) {
1541 c = substr(optstr, i, 1);
1542 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1553 if (substr(str, 1, 1) != "-") {
1554 printf("'%s'\n", str);
1558 for (i = 2; i <= len; i++) {
1559 c = substr(str, i, 1);
1561 printf("-%s\n", substr(str, i));
1567 printf("'%s'\n", substr(str, i + 1));
1580 : process the command line options
1581 set X `for arg in "$@"; do echo "X$arg"; done |
1582 sed -e s/X// | awk -f options.awk`
1587 : set up default values
1597 rm -f optdef.sh posthint.sh
1598 cat >optdef.sh <<EOS
1604 while test $# -gt 0; do
1606 -d) shift; fastread=yes;;
1607 -e) shift; alldone=cont;;
1611 if test -r "$1"; then
1614 echo "$me: cannot read config file $1." >&2
1620 -h) shift; error=true;;
1621 -r) shift; reuseval=true;;
1622 -s) shift; silent=true; realsilent=true;;
1623 -E) shift; alldone=exit;;
1624 -K) shift; knowitall=true;;
1625 -O) shift; override=true;;
1626 -S) shift; silent=true; extractsh=true;;
1631 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1632 echo "$me: ignoring -D $1" >&2
1635 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1636 *) echo "$1='define'" >> optdef.sh;;
1643 *=) echo "$1" >> optdef.sh;;
1645 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1646 echo "$me: ignoring -U $1" >&2
1648 *) echo "$1='undef'" >> optdef.sh;;
1659 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1663 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1664 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1670 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1671 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1672 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1673 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1674 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1675 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1681 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1683 echo "$yyy=''" >> posthint.sh ;;
1688 echo "$yyy='$zzz'" >> posthint.sh ;;
1690 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1692 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1697 echo "$yyy=$zzz" >> posthint.sh ;;
1698 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1702 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1705 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1713 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1714 [-U symbol] [-U symbol=] [-A command:symbol...]
1715 -d : use defaults for all answers.
1716 -e : go on without questioning past the production of config.sh.
1717 -f : specify an alternate default configuration file.
1718 -h : print this help message and exit (with an error status).
1719 -r : reuse C symbols value if possible (skips costly nm extraction).
1720 -s : silent mode, only echoes questions and essential information.
1721 -D : define symbol to have some value:
1722 -D symbol symbol gets the value 'define'
1723 -D symbol=value symbol gets the value 'value'
1724 common used examples (see INSTALL for more info):
1725 -Duse64bitint use 64bit integers
1726 -Duse64bitall use 64bit integers and pointers
1727 -Dusethreads use thread support
1728 -Dinc_version_list=none do not include older perl trees in @INC
1729 -DEBUGGING=none DEBUGGING options
1730 -Dcc=gcc choose your compiler
1731 -Dprefix=/opt/perl5 choose your destination
1732 -E : stop at the end of questions, after having produced config.sh.
1733 -K : do not use unless you know what you are doing.
1734 -O : let -D and -U override definitions from loaded configuration file.
1735 -S : perform variable substitutions on all .SH files (can mix with -f)
1736 -U : undefine symbol:
1737 -U symbol symbol gets the value 'undef'
1738 -U symbol= symbol gets completely empty
1740 -A : manipulate symbol after the platform specific hints have been applied:
1741 -A append:symbol=value append value to symbol
1742 -A symbol=value like append:, but with a separating space
1743 -A define:symbol=value define symbol to have value
1744 -A clear:symbol define symbol to be ''
1745 -A define:symbol define symbol to be 'define'
1746 -A eval:symbol=value define symbol to be eval of value
1747 -A prepend:symbol=value prepend value to symbol
1748 -A undef:symbol define symbol to be 'undef'
1749 -A undef:symbol= define symbol to be ''
1750 e.g.: -A prepend:libswanted='cl pthread '
1751 -A ccflags=-DSOME_MACRO
1752 -V : print version number and exit (with a zero status).
1759 case "$fastread$alldone" in
1762 case "$extractsh" in
1765 if test ! -t 0; then
1766 echo "Say 'sh Configure', not 'sh <Configure'"
1776 true) exec 1>/dev/null;;
1779 : run the defines and the undefines, if any, but leave the file out there...
1782 : create the posthint manipulation script and leave the file out there...
1787 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1788 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1789 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1790 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1791 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1794 : Some greps do not return status, grrr.
1795 echo "grimblepritz" >grimble
1796 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1798 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1804 : the following should work in any shell
1808 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1809 cat >contains <<'EOSS'
1810 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1815 : Find the path to the source tree
1818 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1822 *) src=`cd ../$src && pwd` ;;
1835 if test -f $rsrc/Configure && \
1836 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1838 : found it, so we are ok.
1841 for src in . .. ../.. ../../.. ../../../..; do
1842 if test -f ../$src/Configure && \
1843 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1854 Sorry, I can't seem to locate the source dir for $package. Please start
1855 Configure with an explicit path -- i.e. /some/path/Configure.
1863 echo "Sources for $package found in \"$src\"." >&4
1867 : script used to extract .SH files with variable substitutions
1868 cat >extract <<'EOS'
1870 echo "Doing variable substitutions on .SH files..."
1871 if test -f MANIFEST; then
1872 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1874 echo "(Looking for .SH files under the source directory.)"
1875 set x `(cd "$src"; find . -name "*.SH" -print)`
1879 0) set x `(cd "$src"; echo *.SH)`; shift;;
1881 if test ! -f "$src/$1"; then
1887 while test $name; do
1888 if test ! -d "$name"; then
1889 create="$name $create";
1890 name=`echo $name | sed -e "s|^[^/]*$||"`;
1891 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1896 for file in $create; do
1905 dir=`expr X$file : 'X\(.*\)/'`
1906 file=`expr X$file : 'X.*/\(.*\)'`
1907 (cd "$dir" && . ./$file)
1917 dir=`expr X$file : 'X\(.*\)/'`
1918 file=`expr X$file : 'X.*/\(.*\)'`
1919 (set x $dir; shift; eval $mkdir_p)
1920 sh <"$src/$dir/$file"
1929 if test -f "$src/config_h.SH"; then
1930 if test ! -f config.h; then
1931 : oops, they left it out of MANIFEST, probably, so do it anyway.
1932 . "$src/config_h.SH"
1937 : extract files and exit if asked to do so
1938 case "$extractsh" in
1940 case "$realsilent" in
1944 case "$config_sh" in
1945 '') config_sh='config.sh';;
1948 echo "Fetching answers from $config_sh..."
1951 test "$override" && . ./optdef.sh
1955 echo "Extraction done."
1960 : Eunice requires " " instead of "", can you believe it
1963 echo "Beginning of configuration questions for $package."
1965 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1967 : first determine how to suppress newline on echo command
1969 echo "Checking echo to see how to suppress newlines..."
1970 (echo "hi there\c" ; echo " ") >.echotmp
1971 if $contains c .echotmp >/dev/null 2>&1 ; then
1982 echo $n "The star should be here-->$c"
1986 : Now test for existence of everything in MANIFEST
1988 if test -f "$rsrc/MANIFEST"; then
1989 echo "First let's make sure your kit is complete. Checking..." >&4
1990 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1991 (split -l 50 2>/dev/null || split -50)
1994 for filelist in x??; do
1995 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1996 >/dev/null 2>>"$tmppwd/missing")
1998 if test -s missing; then
2002 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2004 You have the option of continuing the configuration process, despite the
2005 distinct possibility that your kit is damaged, by typing 'y'es. If you
2006 do, don't blame me if something goes wrong. I advise you to type 'n'o
2007 and contact the author (perlbug@perl.org).
2010 echo $n "Continue? [n] $c" >&4
2014 echo "Continuing..." >&4
2018 echo "ABORTING..." >&4
2023 echo "Looks good..."
2026 echo "There is no MANIFEST file. I hope your kit is complete !"
2030 : Find the appropriate value for a newline for tr
2032 if test -n "$DJGPP"; then
2035 if test X"$trnl" = X; then
2036 case "`echo foo|tr '\n' x 2>/dev/null`" in
2040 if test X"$trnl" = X; then
2041 case "`echo foo|tr '\012' x 2>/dev/null`" in
2042 foox) trnl='\012' ;;
2045 if test X"$trnl" = X; then
2046 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2047 fooxy) trnl='\n\r' ;;
2050 if test X"$trnl" = X; then
2053 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2059 : compute the number of columns on the terminal for proper question formatting
2064 : set up the echo used in my read
2065 myecho="case \"\$xxxm\" in
2066 '') echo $n \"\$rp $c\" >&4;;
2068 '') echo $n \"[\$xxxm] $c\";;
2070 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2072 echo $n \"[\$xxxm] $c\" >&4
2074 echo $n \"\$rp [\$xxxm] $c\" >&4
2080 : now set up to do reads with possible shell escape and default assignment
2086 case "\$fastread" in
2087 yes) case "\$dflt" in
2090 case "\$silent-\$rp" in
2095 *) case "\$silent" in
2096 true) case "\$rp" in
2101 while expr "X\$ans" : "X!" >/dev/null; do
2105 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2113 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2122 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2127 echo "(OK, I'll run with -d after this question.)" >&4
2130 echo "*** Sorry, \$1 not supported yet." >&4
2140 echo "*** Substitution done -- please confirm."
2142 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2147 echo "*** Error -- try again."
2154 case "\$ans\$xxxm\$nostick" in
2166 : create .config dir to save info across Configure sessions
2167 test -d ../.config || mkdir ../.config
2168 cat >../.config/README <<EOF
2169 This directory created by Configure to save information that should
2170 persist across sessions for $package.
2172 You may safely delete it if you wish.
2175 : See if we are using a devel version and want that
2176 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2179 usedevel="$define" ;;
2180 *) case "$xversion" in
2183 *** WHOA THERE!!! ***
2185 This is an UNSTABLE DEVELOPMENT release.
2186 The version of this $package distribution is $xversion, that is, odd,
2187 (as opposed to even) and that signifies a development release.
2188 If you want a maintenance release, you want an even-numbered version.
2190 Do ***NOT*** install this into production use.
2191 Data corruption and crashes are possible.
2193 It is most seriously suggested that you do not continue any further
2194 unless you want to help in developing and debugging Perl.
2196 If you *still* want to build perl, you can answer 'y' now,
2197 or pass -Dusedevel to Configure.
2200 rp='Do you really want to continue?'
2204 [yY]) echo >&4 "Okay, continuing."
2205 usedevel="$define" ;;
2206 *) echo >&4 "Okay, bye."
2217 case "$versiononly" in
2218 '') versiononly="$define" ;;
2220 case "$installusrbinperl" in
2221 '') installusrbinperl="$undef" ;;
2226 : general instructions
2229 user=`(logname) 2>/dev/null`
2231 '') user=`whoami 2>&1`;;
2233 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2236 rp='Would you like to see the instructions?'
2247 This installation shell script will examine your system and ask you questions
2248 to determine how the perl5 package should be installed. If you get
2249 stuck on a question, you may use a ! shell escape to start a subshell or
2250 execute a command. Many of the questions will have default answers in square
2251 brackets; typing carriage return will give you the default.
2253 On some of the questions which ask for file or directory names you are allowed
2254 to use the ~name construct to specify the login directory belonging to "name",
2255 even if you don't have a shell which knows about that. Questions where this is
2256 allowed will be marked "(~name ok)".
2260 dflt='Type carriage return to continue'
2264 The prompter used in this script allows you to use shell variables and
2265 backticks in your answers. You may use $1, $2, etc... to refer to the words
2266 in the default answer, as if the default line was a set of arguments given to a
2267 script shell. This means you may also use $* to repeat the whole default line,
2268 so you do not have to re-type everything to add something to the default.
2270 Every time there is a substitution, you will have to confirm. If there is an
2271 error (e.g. an unmatched backtick), the default answer will remain unchanged
2272 and you will be prompted again.
2274 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2275 the questions and use the computed defaults (or the previous answers if there
2276 was already a config.sh file). Type 'Configure -h' for a list of options.
2277 You may also start interactively and then answer '& -d' at any prompt to turn
2278 on the non-interactive behaviour for the remainder of the execution.
2284 Much effort has been expended to ensure that this shell script will run on any
2285 Unix system. If despite that it blows up on yours, your best bet is to edit
2286 Configure and run it again. If you can't run Configure for some reason,
2287 you'll have to generate a config.sh file by hand. Whatever problems you
2288 have, let me (perlbug@perl.org) know how I blew it.
2290 This installation script affects things in two ways:
2292 1) it may do direct variable substitutions on some of the files included
2294 2) it builds a config.h file for inclusion in C programs. You may edit
2295 any of these files as the need arises after running this script.
2297 If you make a mistake on a question, there is no easy way to back up to it
2298 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2299 files. Configure will offer to let you do this before it runs the SH files.
2302 dflt='Type carriage return to continue'
2304 case "$firsttime" in
2305 true) echo $user >>../.config/instruct;;
2309 : find out where common programs are
2311 echo "Locating common programs..." >&4
2324 if test -d \$dir/\$thing; then
2330 for thisthing in \$dir/\$thing; do
2331 : just loop through to pick last item
2333 if test -f \$thisthing; then
2336 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2339 elif test -f \$dir/\$thing.exe; then
2340 if test -n "$DJGPP"; then
2341 echo \$dir/\$thing.exe
2342 elif test "$eunicefix" != ":"; then
2343 : on Eunice apparently
2396 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2397 pth="$pth /lib /usr/lib"
2398 for file in $loclist; do
2402 if test -f "$xxx"; then
2405 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2406 xxx=`./loc $file $file $pth`
2409 '') xxx=`./loc $file $file $pth`;;
2410 *) xxx=`./loc $xxx $xxx $pth`;;
2412 eval $file=$xxx$_exe
2416 echo $file is in $xxx.
2419 echo $file is in $xxx.
2422 echo "I don't know where '$file' is, and my life depends on it." >&4
2423 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2429 echo "Don't worry if any of the following aren't found..."
2431 for file in $trylist; do
2435 if test -f "$xxx"; then
2438 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2439 xxx=`./loc $file $file $pth`
2442 '') xxx=`./loc $file $file $pth`;;
2443 *) xxx=`./loc $xxx $xxx $pth`;;
2445 eval $file=$xxx$_exe
2449 echo $file is in $xxx.
2452 echo $file is in $xxx.
2455 echo "I don't see $file out there, $say."
2462 echo "Substituting grep for egrep."
2469 *) if $less -R </dev/null >/dev/null; then
2470 echo "Substituting less -R for less."
2478 echo "Substituting cp for ln."
2487 echo "I can't find make or gmake, and my life depends on it." >&4
2488 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2496 *) # We can't have osname yet.
2497 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2498 # Assume that gmake, if found, is definitely GNU make
2499 # and prefer it over the system make.
2500 echo "Substituting gmake for make."
2508 echo "Hopefully test is built into your sh."
2511 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2512 echo "Using the test built into your sh."
2520 echo "Hopefully echo is built into your sh."
2525 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2526 $echo $n "hi there$c" >foo1
2527 echo $n "hi there$c" >foo2
2528 if cmp foo1 foo2 >/dev/null 2>&1; then
2529 echo "They are compatible. In fact, they may be identical."
2536 They are not compatible! You are probably running ksh on a non-USG system.
2537 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2538 have echo built in and we may have to run some Bourne shell scripts. That
2539 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2542 $echo $n "The star should be here-->$c"
2549 # This question was auctioned at YAPC::Europe-2007 in Vienna
2550 # I never promised you could answer it. I only auctioned the question.
2552 The following message is sponsored by
2554 Dresden.pm<--The stars should be here.
2556 Dear Perl user, system administrator or package
2557 maintainer, the Perl community sends greetings to
2558 you. Do you (emblematical) greet back [Y/n]? n
2562 : Check what type of C compiler we use
2566 cat <<'EOSC' >>trygcc
2571 int main(int argc, char *argv[]) {
2575 if $cc -o try $ccflags $ldflags try.c; then
2578 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2584 # Skip this test because it gives a false match on output like:
2585 # ./trygcc: line 23: cc: command not found
2586 # case "`$cc -v -c try.c 2>&1`" in
2587 # *gcc*) trygcc=no ;;
2589 if $test X"$trygcc" = Xyes; then
2590 if gcc -o try -c try.c; then
2592 echo "You seem to have a working gcc, though." >&4
2593 # Switching compilers may undo the work of hints files.
2594 # The most common problem is -D_REENTRANT for threads.
2595 # This heuristic catches that case, but gets false positives
2596 # if -Dusethreads was not actually specified. Better to
2597 # bail out here with a useful message than fail
2598 # mysteriously later. Should we perhaps just try to
2599 # re-invoke Configure -Dcc=gcc config_args ?
2600 if $test -f usethreads.cbu; then
2603 *** However, any setting of the C compiler flags (e.g. for thread support)
2604 *** will be lost. It may be necessary for you to restart Configure and
2605 *** add -Dcc=gcc to your Configure command line.
2608 rp="Would you like to go ahead and try gcc anyway?"
2611 rp="Would you like to use it?"
2614 if $test -f myread; then
2617 if $test -f UU/myread; then
2620 echo "Cannot find myread, sorry. Aborting." >&2
2625 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2638 cat <<'EOSC' >>checkcc
2643 int main(int argc, char *argv[]) {
2647 if $cc -o try $ccflags $ldflags try.c; then
2650 if $test X"$despair" = Xyes; then
2651 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2654 You need to find a working C compiler.
2655 Either (purchase and) install the C compiler supplied by your OS vendor,
2656 or for a free C compiler try http://gcc.gnu.org/
2657 I cannot continue any further, aborting.
2666 : determine whether symbolic links are supported
2669 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2670 echo "Symbolic links are supported." >&4
2673 echo "Symbolic links are NOT supported." >&4
2678 : determine whether symbolic links are supported
2682 echo "Checking how to test for symbolic links..." >&4
2684 if $test "X$issymlink" = X; then
2686 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2687 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2689 if test $? = 0; then
2692 echo "Your builtin 'test -h' may be broken." >&4
2695 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2698 if test -f "$p/$test"; then
2707 echo "Trying external '$test -h'." >&4
2708 issymlink="$test -h"
2709 if $test ! -h sym >/dev/null 2>&1; then
2710 echo "External '$test -h' is broken, too." >&4
2718 if $test "X$issymlink" = X; then
2719 if $test -L sym 2>/dev/null; then
2720 issymlink="$test -L"
2721 echo "The builtin '$test -L' worked." >&4
2724 if $test "X$issymlink" != X; then
2725 echo "You can test for symbolic links with '$issymlink'." >&4
2727 echo "I do not know how you can test for symbolic links." >&4
2731 *) echo "No symbolic links, so not testing for their testing..." >&4
2736 : Make symlinks util
2737 case "$mksymlinks" in
2740 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2743 *) case "$lns:$issymlink" in
2744 *"ln"*" -s:"*"test -"?)
2745 echo "Creating the symbolic links..." >&4
2746 echo "(First creating the subdirectories...)" >&4
2748 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2750 test -z "$directory" && break
2754 if test ! -d t/base; then
2755 echo "Failed to create the subdirectories. Aborting." >&4
2758 echo "(Then creating the symlinks...)" >&4
2759 awk '{print $1}' $src/MANIFEST | while true; do
2761 test -z "$filename" && break
2762 if test -f $filename; then
2763 if $issymlink $filename; then
2767 if test -f $filename; then
2768 echo "$filename already exists, not symlinking."
2770 ln -s $src/$filename $filename
2774 if test ! -f t/base/lex.t; then
2775 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2780 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2788 : Check for Cross-Compilation
2789 case "$usecrosscompile" in
2791 $echo "Cross-compiling..."
2794 *-*-gcc) # A cross-compiling gcc, probably.
2795 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2797 # leave out ld, choosing it is more complex
2799 ranlib=$targetarch-ranlib
2800 $echo 'extern int foo;' > try.c
2801 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2803 if $test $# -gt 0; then
2805 incpth="`$echo $incpth|$sed 's/^ //'`"
2806 echo "Guessing incpth '$incpth'." >&4
2808 j="`$echo $i|$sed 's,/include$,/lib,'`"
2809 if $test -d $j; then
2813 libpth="`$echo $libpth|$sed 's/^ //'`"
2814 echo "Guessing libpth '$libpth'." >&4
2819 case "$targetarch" in
2820 '') echo "Targetarch not defined." >&4; croak=y ;;
2821 *) echo "Using targetarch $targetarch." >&4 ;;
2824 '') echo "Incpth not defined." >&4; croak=y ;;
2825 *) echo "Using incpth '$incpth'." >&4 ;;
2828 '') echo "Libpth not defined." >&4; croak=y ;;
2829 *) echo "Using libpth '$libpth'." >&4 ;;
2832 '') for i in $incpth; do
2833 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2835 echo "Guessing usrinc $usrinc." >&4
2840 '') echo "Usrinc not defined." >&4; croak=y ;;
2843 *) echo "Using usrinc $usrinc." >&4 ;;
2845 case "$targethost" in
2846 '') echo "Targethost not defined." >&4; croak=y ;;
2847 *) echo "Using targethost $targethost." >&4
2852 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2855 /*) run=$src/Cross/run
2856 targetmkdir=$src/Cross/mkdir
2858 from=$src/Cross/from
2860 *) pwd=`$test -f ../Configure & cd ..; pwd`
2862 targetmkdir=$pwd/Cross/mkdir
2864 from=$pwd/Cross/from
2867 case "$targetrun" in
2868 '') targetrun=ssh ;;
2873 case "$targetfrom" in
2874 '') targetfrom=scp ;;
2878 from=$from-$targetfrom
2879 case "$targetdir" in
2881 echo "Guessing targetdir $targetdir." >&4
2884 case "$targetuser" in
2886 echo "Guessing targetuser $targetuser." >&4
2889 case "$targetfrom" in
2893 case "$targetrun" in
2905 '') cwd=$targetdir ;;
2909 if $test ! -f \$exe.xok; then
2913 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2916 *) echo "Unknown targetrun '$targetrun'" >&4
2920 case "$targetmkdir" in
2922 cat >$targetmkdir <<EOF
2924 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2926 $chmod a+rx $targetmkdir
2928 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2940 $targetmkdir \`dirname \$f\`
2941 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2944 $targetmkdir $targetdir/\`dirname \$f\`
2945 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2958 $mkdir -p $targetdir/\`dirname \$f\`
2959 $cp \$f $targetdir/\$f || exit 1
2962 $targetmkdir $targetdir/\`dirname \$f\`
2963 $cp \$f $targetdir/\$f || exit 1
2970 *) echo "Unknown targetto '$targetto'" >&4
2974 case "$targetfrom" in
2981 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2986 cp) cat >$from <<EOF
2991 cp $targetdir/\$f . || exit 1
2996 *) echo "Unknown targetfrom '$targetfrom'" >&4
3000 if $test ! -f $run; then
3001 echo "Target 'run' script '$run' not found." >&4
3005 if $test ! -f $to; then
3006 echo "Target 'to' script '$to' not found." >&4
3010 if $test ! -f $from; then
3011 echo "Target 'from' script '$from' not found." >&4
3015 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3019 Using '$run' for remote execution,
3020 and '$from' and '$to'
3021 for remote file transfer.
3027 usecrosscompile='undef'
3032 : see whether [:lower:] and [:upper:] are supported character classes
3034 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3036 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3040 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3041 # (0xd9 and 0xe2), therefore that is a nice testing point.
3042 if test "X$up" = X -o "X$low" = X; then
3043 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3049 if test "X$up" = X -o "X$low" = X; then
3050 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3056 if test "X$up" = X -o "X$low" = X; then
3057 case "`echo RS | od -x 2>/dev/null`" in
3059 echo "Hey, this might be EBCDIC." >&4
3060 if test "X$up" = X -o "X$low" = X; then
3061 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3062 rs) up='[A-IJ-RS-Z]'
3067 if test "X$up" = X -o "X$low" = X; then
3068 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3078 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3080 echo "Using $up and $low to convert case." >&4
3083 echo "I don't know how to translate letters from upper to lower case." >&4
3084 echo "Your tr is not acting any way I know of." >&4
3088 : set up the translation script tr, must be called with ./tr of course
3092 '[A-Z][a-z]') exec $tr '$up' '$low';;
3093 '[a-z][A-Z]') exec $tr '$low' '$up';;
3100 : Try to determine whether config.sh was made on this system
3101 case "$config_sh" in
3103 myuname=`$uname -a 2>/dev/null`
3104 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3105 # Downcase everything to avoid ambiguity.
3106 # Remove slashes and single quotes so we can use parts of this in
3107 # directory and file names.
3108 # Remove newlines so myuname is sane to use elsewhere.
3109 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3110 # because the A-Z/a-z are not consecutive.
3111 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3112 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3113 newmyuname="$myuname"
3115 case "$knowitall" in
3117 if test -f ../config.sh; then
3118 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3119 eval "`grep myuname= ../config.sh`"
3121 if test "X$myuname" = "X$newmyuname"; then
3129 : Get old answers from old config file if Configure was run on the
3130 : same system, otherwise use the hints.
3133 if test -f config.sh; then
3135 rp="I see a config.sh file. Shall I use it to set the defaults?"
3138 n*|N*) echo "OK, I'll ignore it."
3139 mv config.sh config.sh.old
3140 myuname="$newmyuname"
3142 *) echo "Fetching default answers from your old config.sh file..." >&4
3150 : Older versions did not always set $sh. Catch re-use of such
3160 if test ! -f config.sh; then
3163 First time through, eh? I have some defaults handy for some systems
3164 that need some extra help getting the Configure answers right:
3167 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3169 : Half the following guesses are probably wrong... If you have better
3170 : tests or hints, please send them to perlbug@perl.org
3171 : The metaconfig authors would also appreciate a copy...
3172 $test -f /irix && osname=irix
3173 $test -f /xenix && osname=sco_xenix
3174 $test -f /dynix && osname=dynix
3175 $test -f /dnix && osname=dnix
3176 $test -f /lynx.os && osname=lynxos
3177 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3178 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3179 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3180 $test -f /bin/mips && /bin/mips && osname=mips
3181 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3182 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3183 $test -d /usr/apollo/bin && osname=apollo
3184 $test -f /etc/saf/_sactab && osname=svr4
3185 $test -d /usr/include/minix && osname=minix
3186 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3187 if $test -d /MachTen -o -d /MachTen_Folder; then
3189 if $test -x /sbin/version; then
3190 osvers=`/sbin/version | $awk '{print $2}' |
3191 $sed -e 's/[A-Za-z]$//'`
3192 elif $test -x /usr/etc/version; then
3193 osvers=`/usr/etc/version | $awk '{print $2}' |
3194 $sed -e 's/[A-Za-z]$//'`
3200 $test -f /sys/posix.dll &&
3201 $test -f /usr/bin/what &&
3202 set X `/usr/bin/what /sys/posix.dll` &&
3203 $test "$3" = UWIN &&
3207 if $test -f $uname; then
3215 umips) osname=umips ;;
3218 [23]100) osname=mips ;;
3219 next*) osname=next ;;
3221 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3222 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3225 elif $test -f /etc/kconfig; then
3227 if test "$lns" = "$ln -s"; then
3229 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3231 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3238 if test -n "$DJGPP"; then
3247 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3249 # oslevel can fail with:
3250 # oslevel: Unable to acquire lock.
3251 *not\ found) osvers="$4"."$3" ;;
3252 '<3240'|'<>3240') osvers=3.2.0 ;;
3253 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3254 '=3250'|'>3250') osvers=3.2.5 ;;
3258 bitrig) osname=bitrig
3261 bsd386) osname=bsd386
3264 cygwin*) osname=cygwin
3267 *dc.osx) osname=dcosx
3273 domainos) osname=apollo
3279 dragonfly) osname=dragonfly
3282 dynixptx*) osname=dynixptx
3283 osvers=`echo "$4"|sed 's/^v//'`
3285 freebsd) osname=freebsd
3287 genix) osname=genix ;;
3291 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3307 netbsd*) osname=netbsd
3310 news-os) osvers="$3"
3312 4*) osname=newsos4 ;;
3316 next*) osname=next ;;
3317 nonstop-ux) osname=nonstopux ;;
3318 openbsd) osname=openbsd
3324 POSIX-BC | posix-bc ) osname=posix-bc
3327 powerux | power_ux | powermax_os | powermaxos | \
3328 powerunix | power_unix) osname=powerux
3334 solaris) osname=solaris
3336 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3343 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3347 titanos) osname=titanos
3356 ultrix) osname=ultrix
3359 osf1|mls+) case "$5" in
3362 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3365 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3368 hp*) osname=hp_osf1 ;;
3369 mips) osname=mips_osf1 ;;
3372 # UnixWare 7.1.2 is known as Open UNIX 8
3373 openunix|unixware) osname=svr5
3381 $2) case "$osname" in
3385 : svr4.x or possibly later
3395 if test -f /stand/boot ; then
3396 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3397 if test -n "$INITPROG" -a -f "$INITPROG"; then
3398 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3399 if test -n "$isesix"; then
3407 *) if test -f /etc/systemid; then
3409 set `echo $3 | $sed 's/\./ /g'` $4
3410 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3412 elif $test -f $src/hints/sco_$1_$2.sh; then
3414 elif $test -f $src/hints/sco_$1.sh; then
3419 '') : Still unknown. Probably a generic Sys V.
3428 *) case "$osname" in
3429 '') : Still unknown. Probably a generic BSD.
3437 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3438 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3439 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3442 $rm -f UU/kernel.what
3443 elif test -d c:/. -o -n "$is_os2" ; then
3450 case "$targetarch" in
3453 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3458 : Now look for a hint file osname_osvers, unless one has been
3459 : specified already.
3462 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3463 : Also try without trailing minor version numbers.
3464 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3465 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3466 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3467 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3470 *) case "$osvers" in
3473 *) if $test -f $src/hints/$file.sh ; then
3475 elif $test -f $src/hints/$xfile.sh ; then
3477 elif $test -f $src/hints/$xxfile.sh ; then
3479 elif $test -f $src/hints/$xxxfile.sh ; then
3481 elif $test -f $src/hints/$xxxxfile.sh ; then
3483 elif $test -f "$src/hints/${osname}.sh" ; then
3492 if $test -f Policy.sh ; then
3495 none) dflt="Policy" ;;
3496 *) dflt="Policy $dflt" ;;
3501 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3505 if $test -f Policy.sh ; then
3508 There's also a Policy hint file available, which should make the
3509 site-specific (policy) questions easier to answer.
3516 You may give one or more space-separated answers, or "none" if appropriate.
3517 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3518 previous run of Configure, you may specify it as well as or instead of
3519 OS-specific hints. If hints are provided for your OS, you should use them:
3520 although Perl can probably be built without hints on many platforms, using
3521 hints often improve performance and may enable features that Configure can't
3522 set up on its own. If there are no hints that match your OS, specify "none";
3523 DO NOT give a wrong version or a wrong OS.
3527 rp="Which of these apply, if any?"
3530 for file in $tans; do
3531 if $test X$file = XPolicy -a -f Policy.sh; then
3533 $cat Policy.sh >> UU/config.sh
3534 elif $test -f $src/hints/$file.sh; then
3535 . $src/hints/$file.sh
3536 $cat $src/hints/$file.sh >> UU/config.sh
3537 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3540 : Give one chance to correct a possible typo.
3541 echo "$file.sh does not exist"
3543 rp="hint to use instead?"
3545 for file in $ans; do
3546 if $test -f "$src/hints/$file.sh"; then
3547 . $src/hints/$file.sh
3548 $cat $src/hints/$file.sh >> UU/config.sh
3549 elif $test X$ans = X -o X$ans = Xnone ; then
3552 echo "$file.sh does not exist -- ignored."
3559 : Remember our hint file for later.
3560 if $test -f "$src/hints/$file.sh" ; then
3570 echo "Fetching default answers from $config_sh..." >&4
3574 cp $config_sh config.sh 2>/dev/null
3584 test "$override" && . ./optdef.sh
3586 : Restore computed paths
3587 for file in $loclist $trylist; do
3588 eval $file="\$_$file"
3593 Configure uses the operating system name and version to set some defaults.
3594 The default value is probably right if the name rings a bell. Otherwise,
3595 since spelling matters for me, either accept the default or answer "none"
3602 ''|' '|none) dflt=none ;;
3603 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3606 *) dflt="$osname" ;;
3608 rp="Operating system name?"
3612 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3618 ''|' '|none) dflt=none ;;
3619 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3620 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3622 ''|' ') dflt=none ;;
3627 *) dflt="$osvers" ;;
3629 rp="Operating system version?"
3639 : who configured the system
3640 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3643 cf_by=`(logname) 2>/dev/null`
3646 cf_by=`(whoami) 2>/dev/null`
3648 "") cf_by=unknown ;;
3653 : decide how portable to be. Allow command line overrides.
3654 case "$d_portable" in
3656 *) d_portable="$define" ;;
3659 : set up shell script to do ~ expansion
3665 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3668 if $test -f /bin/csh; then
3669 /bin/csh -f -c "glob \$1"
3674 name=\`$expr x\$1 : '..\([^/]*\)'\`
3675 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3676 if $test ! -d "\$dir"; then
3678 echo "\$me: can't locate home directory for: \$name" >&2
3683 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3699 : now set up to get a file name
3703 cat <<'EOSC' >>getfile
3719 : getfile will accept an answer from the comma-separated list
3720 : enclosed in parentheses even if it does not meet other criteria.
3721 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3722 fn=`echo $fn | sed 's/(.*)//'`
3728 loc_file=`expr $fn : '.*:\(.*\)'`
3729 fn=`expr $fn : '\(.*\):.*'`
3737 */*) fullpath=true;;
3746 *e*) exp_file=true;;
3749 *p*) nopath_ok=true;;
3754 *d*) type='Directory';;
3755 *l*) type='Locate';;
3760 Locate) what='File';;
3765 case "$d_portable" in
3773 while test "$type"; do
3778 true) rp="$rp (~name ok)";;
3781 if test -f UU/getfile.ok && \
3782 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3801 value=`UU/filexp $ans`
3804 if test "$ans" != "$value"; then
3805 echo "(That expands to $value on this system.)"
3819 /*) value="$ansexp" ;;
3820 [a-zA-Z]:/*) value="$ansexp" ;;
3825 echo "I shall only accept a full path name, as in /bin/ls." >&4
3826 echo "Use a ! shell escape if you wish to check pathnames." >&4
3829 echo "Please give a full path name, starting with slash." >&4
3832 echo "Note that using ~name is ok provided it expands well." >&4
3845 for fp in $gfpth; do
3846 if test "X$fp" = X.; then
3851 if test -f "$pf"; then
3853 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3855 echo "($value is not a plain file, but that's ok.)"
3858 if test X"$type" = X; then
3865 for fp in $gfpth; do
3866 if test "X$fp" = X.; then
3871 direxp="$fp/$ansexp"
3873 if test -d "$direxp"; then
3881 if test -d "$ansexp"; then
3882 echo "(Looking for $loc_file in directory $value.)"
3883 value="$value/$loc_file"
3884 ansexp="$ansexp/$loc_file"
3886 if test -f "$ansexp"; then
3889 case "$nopath_ok" in
3890 true) case "$value" in
3892 *) echo "Assuming $value will be in people's path."
3908 if test "$fastread" = yes; then
3913 rp="$what $value doesn't exist. Use that name anyway?"
3932 test "X$gfpthkeep" != Xy && gfpth=""
3935 : determine root of directory hierarchy where package will be installed.
3938 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3941 dflt=`echo "$prefix" | sed 's/.$//'`
3949 By default, $package will be installed in $dflt/bin, manual pages
3950 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3951 installation directories. Typically this is something like /usr/local.
3952 If you wish to have binaries under /usr/bin but other parts of the
3953 installation under /usr/local, that's ok: you will be prompted
3954 separately for each of the installation directories, the prefix being
3955 only used to set the defaults.
3959 rp='Installation prefix to use?'
3967 *) oldprefix="$prefix";;
3974 : allow them to override the AFS root
3977 *) afsroot=$afsroot ;;
3983 $define|true) afs=true ;;
3984 $undef|false) afs=false ;;
3985 *) if $test -d $afsroot; then
3993 echo "AFS may be running... I'll be extra cautious then..." >&4
3995 echo "AFS does not seem to be running..." >&4
3998 : determine installation prefix for where package is to be installed.
4002 Since you are running AFS, I need to distinguish the directory in which
4003 files will reside from the directory in which they are installed (and from
4004 which they are presumably copied to the former directory by occult means).
4007 case "$installprefix" in
4008 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4009 *) dflt="$installprefix";;
4014 In some special cases, particularly when building $package for distribution,
4015 it is convenient to distinguish the directory in which files should be
4016 installed from the directory ($prefix) in which they will
4017 eventually reside. For most users, these two directories are the same.
4020 case "$installprefix" in
4022 *) dflt=$installprefix;;
4026 rp='What installation prefix should I use for installing files?'
4028 installprefix="$ans"
4029 installprefixexp="$ansexp"
4031 : Perform the prefixexp/installprefixexp correction if necessary
4032 cat <<EOS >installprefix
4035 cat <<'EOSC' >>installprefix
4036 : Change installation prefix, if necessary.
4037 if $test X"$prefix" != X"$installprefix"; then
4038 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4040 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4043 chmod +x installprefix
4044 $eunicefix installprefix
4046 : Set variables such as privlib and privlibexp from the output of ./getfile
4047 : performing the prefixexp/installprefixexp correction if necessary.
4048 cat <<EOS >setprefixvar
4051 cat <<'EOSC' >>setprefixvar
4052 eval "${prefixvar}=\"\$ans\""
4053 eval "${prefixvar}exp=\"\$ansexp\""
4056 chmod +x setprefixvar
4057 $eunicefix setprefixvar
4059 : set up the script used to warn in case of inconsistency
4068 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4070 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4071 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4076 echo "*** WHOA THERE!!! ***" >&4
4077 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4080 rp=" Keep the $hint value?"
4083 y) td=$was; tu=$was;;
4087 : function used to set '$1' to '$val'
4088 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4090 $define$undef) . ./whoa; eval "$var=\$td";;
4091 $undef$define) . ./whoa; eval "$var=\$tu";;
4092 *) eval "$var=$val";;
4095 : get the patchlevel
4097 echo "Getting the current patchlevel..." >&4
4098 if $test -r $rsrc/patchlevel.h;then
4099 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4100 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4101 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4102 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4103 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4104 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4105 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4114 $echo "(You do not have patchlevel.h. Eek.)"
4116 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4117 version_patchlevel_string="version $patchlevel subversion $subversion"
4118 case "$perl_patchlevel" in
4120 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4121 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4125 $echo "(You have $package $version_patchlevel_string.)"
4129 : XXX Should be a Configure test for double-dots in filenames.
4130 version=`echo $revision $patchlevel $subversion | \
4131 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4132 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4133 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4136 version=`echo $revision $patchlevel $subversion | \
4137 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4138 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4139 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4142 : Special case the 5.005_xx maintenance series, which used 5.005
4143 : without any subversion label as a subdirectory in $sitelib
4144 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4145 api_versionstring='5.005'
4148 : Do we want threads support and if so, what type
4149 case "$usethreads" in
4150 $define|true|[yY]*) dflt='y';;
4151 *) # Catch case where user specified ithreads or 5005threads but
4152 # forgot -Dusethreads (A.D. 4/2002)
4153 case "$useithreads$use5005threads" in
4154 *$define*) dflt='y';;
4161 Perl can be built to offer a form of threading support on some systems
4162 To do so, Configure can be run with -Dusethreads.
4164 Note that Perl built with threading support runs slightly slower
4165 and uses slightly more memory than plain Perl.
4167 If this doesn't make any sense to you, just accept the default '$dflt'.
4169 rp='Build a threading Perl?'
4172 y|Y) val="$define" ;;
4178 if $test $patchlevel -lt 9; then
4179 case "$usethreads" in
4181 : Default to ithreads unless overridden on command line or with
4184 case "$use5005threads" in
4186 echo "5.005 threads are no longer supported"
4190 case "$useithreads" in
4191 $undef|false|[nN]*) dflt='n';;
4193 rp='Use the newer interpreter-based ithreads?'
4196 y|Y) val="$define" ;;
4201 : Now set use5005threads to the opposite value.
4202 case "$useithreads" in
4203 $define) val="$undef" ;;
4210 useithreads="$undef"
4211 use5005threads="$undef"
4215 case "$useithreads$use5005threads" in
4219 You cannot have both the ithreads and the 5.005 threads enabled
4220 at the same time. Disabling the 5.005 threads since they are
4221 much less stable than the ithreads.
4224 use5005threads="$undef"
4229 : perl-5.9.x and later
4231 if test X"$usethreads" = "X$define"; then
4232 case "$use5005threads" in
4236 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4243 use5005threads="$undef"
4244 useithreads="$usethreads"
4247 case "$d_oldpthreads" in
4248 '') : Configure tests would be welcome here. For now, assume undef.
4250 *) val="$d_oldpthreads" ;;
4256 : Look for a hint-file generated 'call-back-unit'. If the
4257 : user has specified that a threading perl is to be built,
4258 : we may need to set or change some other defaults.
4259 if $test -f usethreads.cbu; then
4260 echo "Your platform has some specific hints regarding threaded builds, using them..."
4263 case "$usethreads" in
4264 "$define"|true|[yY]*)
4266 (Your platform does not have any specific hints for threaded builds.
4267 Assuming POSIX threads, then.)
4273 : Check if multiplicity is required
4276 Perl can be built so that multiple Perl interpreters can coexist
4277 within the same Perl executable.
4280 case "$useithreads" in
4283 This multiple interpreter support is required for interpreter-based threads.
4287 *) case "$usemultiplicity" in
4288 $define|true|[yY]*) dflt='y';;
4292 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4293 rp='Build Perl for multiplicity?'
4296 y|Y) val="$define" ;;
4304 : Check if morebits is requested
4305 case "$usemorebits" in
4306 "$define"|true|[yY]*)
4307 use64bitint="$define"
4308 uselongdouble="$define"
4309 usemorebits="$define"
4311 *) usemorebits="$undef"
4315 : Determine the C compiler to be used
4321 rp="Use which C compiler?"
4325 : See whether they have no cc but they do have gcc
4327 if $test -f cc.cbu; then
4332 : make some quick guesses about what we are up against
4334 $echo $n "Hmm... $c"
4344 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4345 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4347 echo "Looks kind of like an OSF/1 system, but we'll see..."
4349 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4350 xxx=`./loc addbib blurfl $pth`
4351 if $test -f $xxx; then
4352 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4356 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4357 echo "Looks kind of like an extended USG system, but we'll see..."
4359 echo "Looks kind of like a USG system, but we'll see..."
4363 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4364 echo "Looks kind of like a BSD system, but we'll see..."
4368 echo "Looks kind of like a Version 7 system, but we'll see..."
4371 case "$eunicefix" in
4374 There is, however, a strange, musty smell in the air that reminds me of
4375 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4379 : it so happens the Eunice I know will not run shell scripts in Unix format
4383 echo "Congratulations. You aren't running Eunice."
4387 : Detect OS2. The p_ variable is set above in the Head.U unit.
4388 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4389 : semicolon as a patch separator
4394 I have the feeling something is not exactly right, however...don't tell me...
4395 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4396 (Or you may be running DOS with DJGPP.)
4401 if test -f /xenix; then
4402 echo "Actually, this looks more like a XENIX system..."
4407 echo "It's not Xenix..."
4412 if test -f /venix; then
4413 echo "Actually, this looks more like a VENIX system..."
4420 echo "Nor is it Venix..."
4423 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4424 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4427 : Check if we are using GNU gcc and what its version is
4429 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4433 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4435 printf("%s\n", __VERSION__);
4437 printf("%s\n", "1");
4443 if $cc -o try $ccflags $ldflags try.c; then
4444 gccversion=`$run ./try`
4445 case "$gccversion" in
4446 '') echo "You are not using GNU cc." ;;
4447 *) echo "You are using GNU cc $gccversion."
4453 echo "*** WHOA THERE!!! ***" >&4
4454 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4455 case "$knowitall" in
4457 echo " You'd better start hunting for one and let me know about it." >&4
4463 case "$gccversion" in
4464 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4466 case "$gccversion" in
4467 '') gccosandvers='' ;;
4468 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4469 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4471 case "$gccosandvers" in
4472 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4473 $osname$osvers) ;; # looking good
4474 $osname*) cat <<EOM >&4
4476 *** WHOA THERE!!! ***
4478 Your gcc has not been compiled for the exact release of
4479 your operating system ($gccosandvers versus $osname$osvers).
4481 In general it is a good idea to keep gcc synchronized with
4482 the operating system because otherwise serious problems
4483 may ensue when trying to compile software, like Perl.
4485 I'm trying to be optimistic here, though, and will continue.
4486 If later during the configuration and build icky compilation
4487 problems appear (headerfile conflicts being the most common
4488 manifestation), I suggest reinstalling the gcc to match
4489 your operating system release.
4493 *) gccosandvers='' ;; # failed to parse, better be silent
4501 # gcc 3.* complain about adding -Idirectories that they already know about,
4502 # so we will take those off from locincpth.
4503 case "$gccversion" in
4505 echo "main(){}">try.c
4506 for incdir in $locincpth; do
4507 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4508 grep '^c[cp]p*[01]: warning: changing search order '`
4509 if test "X$warn" != X; then
4510 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4516 : What should the include directory be ?
4518 $echo $n "Hmm... $c"
4522 if $test -f /bin/mips && /bin/mips; then
4523 echo "Looks like a MIPS system..."
4524 $cat >usr.c <<'EOCP'
4525 #ifdef SYSTYPE_BSD43
4529 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4530 dflt='/bsd43/usr/include'
4534 mips_type='System V'
4536 $rm -f usr.c usr.out
4537 echo "and you're compiling with the $mips_type compiler and libraries."
4541 echo "Doesn't look like a MIPS system."
4551 case "$xxx_prompt" in
4554 rp='Where are the include files you want to use?'
4562 : see how we invoke the C preprocessor
4564 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4565 cat <<'EOT' >testcpp.c
4571 if test ! -f cppstdin; then
4572 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4573 # AIX cc -E doesn't show the absolute headerfile
4574 # locations but we'll cheat by using the -M flag.
4575 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
4577 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4580 echo "Keeping your $hint cppstdin wrapper."
4583 wrapper=`pwd`/cppstdin
4587 if $test "X$cppstdin" != "X" && \
4588 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4589 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4591 echo "You used to use $cppstdin $cppminus so we'll use that again."
4593 '') echo "But let's see if we can live without a wrapper..." ;;
4595 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4596 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4598 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4601 echo "(However, $cpprun $cpplast does not work, let's see...)"
4609 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4616 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4617 $cc -E <testcpp.c >testcpp.out 2>&1; \
4618 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4619 echo "Yup, it does."
4622 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4623 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4625 echo "Yup, it does."
4628 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4629 $cc -P <testcpp.c >testcpp.out 2>&1; \
4630 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4631 echo "Yipee, that works!"
4634 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4635 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4636 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4637 echo "At long last!"
4640 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4641 $cpp <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4646 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4647 $cpp - <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4649 echo "Hooray, it works! I was beginning to wonder."
4652 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4653 $wrapper <testcpp.c >testcpp.out 2>&1; \
4654 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 rp="No dice. I can't find a C preprocessor. Name one:"
4664 $x_cpp <testcpp.c >testcpp.out 2>&1
4665 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4666 echo "OK, that will do." >&4
4668 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4683 echo "Perhaps can we force $cc -E using a wrapper..."
4684 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4685 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4691 echo "Nope, we'll have to live without it..."
4705 "$wrapper"|'cppstdin') ;;
4706 *) $rm -f $wrapper;;
4708 $rm -f testcpp.c testcpp.out
4710 : Set private lib path
4713 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4718 '') dlist="$loclibpth $plibpth $glibpth";;
4719 *) dlist="$libpth";;
4722 : Now check and see which directories actually exist, avoiding duplicates
4726 if $test -d $xxx; then
4729 *) libpth="$libpth $xxx";;
4735 Some systems have incompatible or broken versions of libraries. Among
4736 the directories listed in the question below, please remove any you
4737 know not to be holding relevant libraries, and add any that are needed.
4738 Say "none" for none.
4749 rp="Directories to use for library searches?"
4756 : compute shared library extension
4759 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4769 On some systems, shared libraries may be available. Answer 'none' if
4770 you want to suppress searching of shared libraries for the remainder
4771 of this configuration.
4774 rp='What is the file extension used for shared libraries?'
4778 : Define several unixisms.
4779 : Hints files or command line option can be used to override them.
4780 : The convoluted testing is in case hints files set either the old
4783 '') case "$exe_ext" in
4785 *) _exe="$exe_ext" ;;
4790 '') case "$lib_ext" in
4797 '') case "$obj_ext" in
4804 '') case "$path_sep" in
4815 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4817 : Which makefile gets called first. This is used by make depend.
4818 case "$firstmakefile" in
4819 '') firstmakefile='makefile';;
4822 : Check is we will use socks
4824 $define|true|[yY]*) dflt='y';;
4829 Perl can be built to use the SOCKS proxy protocol library. To do so,
4830 Configure must be run with -Dusesocks. If you use SOCKS you also need
4831 to use the PerlIO abstraction layer, this will be implicitly selected.
4833 If this doesn't make any sense to you, just accept the default '$dflt'.
4835 rp='Build Perl for SOCKS?'
4838 y|Y) val="$define" ;;
4844 : Check for uselongdouble support
4846 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4849 case "$uselongdouble" in
4850 $define|true|[yY]*) dflt='y';;
4855 Perl can be built to take advantage of long doubles which
4856 (if available) may give more accuracy and range for floating point numbers.
4858 If this doesn't make any sense to you, just accept the default '$dflt'.
4860 rp='Try to use long doubles if available?'
4863 y|Y) val="$define" ;;
4869 case "$uselongdouble" in
4870 true|[yY]*) uselongdouble="$define" ;;
4873 : Look for a hint-file generated 'call-back-unit'. If the
4874 : user has specified that long doubles should be used,
4875 : we may need to set or change some other defaults.
4876 if $test -f uselongdouble.cbu; then
4877 echo "Your platform has some specific hints regarding long doubles, using them..."
4878 . ./uselongdouble.cbu
4880 case "$uselongdouble" in
4883 (Your platform does not have any specific hints for long doubles.)
4889 : Looking for optional libraries
4891 echo "Checking for optional libraries..." >&4
4896 case "$libswanted" in
4897 '') libswanted='c_s';;
4900 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4906 for thisdir in $libpth $xlibpth; do
4907 test -d $thisdir && libspath="$libspath $thisdir"
4909 for thislib in $libswanted; do
4910 for thisdir in $libspath; do
4912 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4913 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4914 $test -f "$xxx" && eval $libscheck
4915 $test -f "$xxx" && libstyle=shared
4917 if test ! -f "$xxx"; then
4918 xxx=$thisdir/lib$thislib.$so
4919 $test -f "$xxx" && eval $libscheck
4920 $test -f "$xxx" && libstyle=shared
4922 if test ! -f "$xxx"; then
4923 xxx=$thisdir/lib$thislib$_a
4924 $test -f "$xxx" && eval $libscheck
4925 $test -f "$xxx" && libstyle=static
4927 if test ! -f "$xxx"; then
4928 xxx=$thisdir/$thislib$_a
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=static
4932 if test ! -f "$xxx"; then
4933 xxx=$thisdir/lib${thislib}_s$_a
4934 $test -f "$xxx" && eval $libscheck
4935 $test -f "$xxx" && libstyle=static
4936 $test -f "$xxx" && thislib=${thislib}_s
4938 if test ! -f "$xxx"; then
4939 xxx=$thisdir/Slib$thislib$_a
4940 $test -f "$xxx" && eval $libscheck
4941 $test -f "$xxx" && libstyle=static
4943 if $test -f "$xxx"; then
4945 shared) echo "Found -l$thislib (shared)." ;;
4946 static) echo "Found -l$thislib." ;;
4947 *) echo "Found -l$thislib ($libstyle)." ;;
4951 *) dflt="$dflt -l$thislib"
4952 libsfound="$libsfound $xxx"
4954 libsfiles="$libsfiles $yyy"
4955 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4956 case " $libsdirs " in
4958 *) libsdirs="$libsdirs $yyy" ;;
4965 if $test ! -f "$xxx"; then
4966 echo "No -l$thislib."
4977 ' '|'') dflt='none';;
4982 In order to compile $package on your machine, a number of libraries
4983 are usually needed. Include any other special libraries here as well.
4984 Say "none" for none. The default list is almost always right.
4988 rp="What libraries to use?"
4995 : determine optimization, if desired, or use for debug flag also
4997 ' '|$undef) dflt='none';;
4999 *) dflt="$optimize";;
5003 By default, $package compiles with the -O flag to use the optimizer.
5004 Alternately, you might want to use the symbolic debugger, which uses
5005 the -g flag (on traditional Unix systems). Either flag can be
5006 specified here. To use neither flag, specify the word "none".
5009 rp="What optimizer/debugger flag should be used?"
5013 'none') optimize=" ";;
5016 : Check what DEBUGGING is required from the command line
5017 : -DEBUGGING or -DDEBUGGING or
5018 : -DEBUGGING=both = -g + -DDEBUGGING
5019 : -DEBUGGING=-g or -Doptimize=-g = -g
5020 : -DEBUGGING=none or -UDEBUGGING =
5021 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5024 *) DEBUGGING=$EBUGGING ;;
5027 case "$DEBUGGING" in
5031 *) optimize="$optimize -g" ;;
5035 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5043 case "$DEBUGGING" in
5044 both|$define) dflt='-DDEBUGGING'
5047 : argument order is deliberate, as the flag will start with - which set could
5048 : think is an option
5049 checkccflag='check=$1; flag=$2; callback=$3;
5051 echo "Checking if your compiler accepts $flag" 2>&1;
5052 echo "int main(void) { return 0; }" > gcctest.c;
5053 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5054 echo "Yes, it does." 2>&1;
5055 if $test -s gcctest.out ; then
5056 echo "But your platform does not like it:";
5061 echo "Leaving current flags $ccflags alone." 2>&1
5063 *) dflt="$dflt $flag";
5069 echo "Nope, it does not, but that is ok." 2>&1;
5073 : We will not override a previous value, but we might want to
5074 : augment a hint file
5076 default|recommended)
5077 case "$gccversion" in
5078 1*) dflt="$dflt -fpcc-struct-return" ;;
5080 case "$optimize:$DEBUGGING" in
5081 *-g*:old) dflt="$dflt -DDEBUGGING";;
5083 case "$gccversion" in
5084 2*) if $test -d /etc/conf/kconfig.d &&
5085 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5087 # Interactive Systems (ISC) POSIX mode.
5092 case "$gccversion" in
5095 ?*) set strict-aliasing -fno-strict-aliasing
5099 # For gcc, adding -pipe speeds up compilations for some, but apparently
5100 # some assemblers can't read from stdin. (It also slows down compilations
5101 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5102 case "$gccversion" in
5108 # on x86_64 (at least) we require an extra library (libssp) in the
5109 # link command line. This library is not named, so I infer that it is
5110 # an implementation detail that may change. Hence the safest approach
5111 # is to add the flag to the flags passed to the compiler at link time,
5112 # as that way the compiler can do the right implementation dependant
5114 case "$gccversion" in
5115 ?*) set stack-protector -fstack-protector
5122 case "$mips_type" in
5123 *BSD*|'') inclwanted="$locincpth $usrinc";;
5124 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5126 for thisincl in $inclwanted; do
5127 if $test -d $thisincl; then
5128 if $test x$thisincl != x$usrinc; then
5130 *" -I$thisincl "*);;
5131 *) dflt="$dflt -I$thisincl ";;
5137 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5139 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5147 *) dflt="$dflt -D$2";;
5151 set signal.h LANGUAGE_C; eval $inctest
5155 ccflags="$ccflags -DSOCKS"
5160 default|recommended) dflt="$ccflags $dflt" ;;
5161 *) dflt="$ccflags";;
5170 Your C compiler may want other flags. For this question you should include
5171 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5172 but you should NOT include libraries or ld flags like -lwhatever. If you
5173 want $package to honor its debug switch, you should include -DDEBUGGING here.
5174 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5176 To use no flags, specify the word "none".
5182 rp="Any additional cc flags?"
5189 : the following weeds options from ccflags that are of no interest to cpp
5191 '') cppflags="$ccflags" ;;
5192 *) cppflags="$cppflags $ccflags" ;;
5194 case "$gccversion" in
5195 1*) cppflags="$cppflags -D__GNUC__"
5197 case "$mips_type" in
5199 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5205 echo "Let me guess what the preprocessor flags are..." >&4
5219 *) ftry="$previous $flag";;
5221 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5222 >cpp1.out 2>/dev/null && \
5223 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5224 >cpp2.out 2>/dev/null && \
5225 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5226 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5228 cppflags="$cppflags $ftry"
5238 *-*) echo "They appear to be: $cppflags";;
5240 $rm -f cpp.c cpp?.out
5244 : flags used in final linking phase
5246 '') if ./venix; then
5252 *-posix*) dflt="$dflt -posix" ;;
5255 *) dflt="$ldflags";;
5257 # See note above about -fstack-protector
5259 *-fstack-protector*)
5261 *-fstack-protector*) ;; # Don't add it again
5262 *) dflt="$dflt -fstack-protector" ;;
5267 : Try to guess additional flags to pick up local libraries.
5268 for thislibdir in $libpth; do
5269 case " $loclibpth " in
5272 *"-L$thislibdir "*) ;;
5273 *) dflt="$dflt -L$thislibdir" ;;
5285 Your C linker may need flags. For this question you should
5286 include -L/whatever and any other flags used by the C linker, but you
5287 should NOT include libraries like -lwhatever.
5289 Make sure you include the appropriate -L/path flags if your C linker
5290 does not normally search all of the directories you specified above,
5293 To use no flags, specify the word "none".
5297 rp="Any additional ld flags (NOT including libraries)?"
5303 rmlist="$rmlist pdp11"
5307 echo "Checking your choice of C compiler and flags for coherency..." >&4
5308 $cat > try.c <<'EOF'
5310 int main() { printf("Ok\n"); return(0); }
5312 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5314 $cat >try.msg <<'EOM'
5315 I've tried to compile and run the following simple program:
5318 $cat try.c >> try.msg
5320 $cat >> try.msg <<EOM
5327 and I got the following output:
5331 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5332 if $sh -c "$run ./try " >>try.msg 2>&1; then
5336 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5339 cat >> try.msg <<'EOQS'
5340 If $libs contains -lsfio, and sfio is mis-configured, then it
5341 sometimes (apparently) runs and exits with a 0 status, but with no
5342 output! It may have to do with sfio's use of _exit vs. exit.
5345 rp="You have a big problem. Shall I abort Configure"
5352 echo "The program compiled OK, but exited with status $?." >>try.msg
5353 rp="You have a problem. Shall I abort Configure"
5357 echo "I can't compile the test program." >>try.msg
5358 rp="You have a BIG problem. Shall I abort Configure"
5364 case "$knowitall" in
5366 echo "(The supplied flags or libraries might be incorrect.)"
5374 *) echo "Ok. Stopping Configure." >&4
5379 n) echo "OK, that should do.";;
5381 $rm_try gcctest gcctest.out
5383 : define a shorthand compile call
5387 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5388 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5392 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5393 : define a shorthand compile call for compilations that should be ok.
5397 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5399 : determine filename position in cpp output
5401 echo "Computing filename position in cpp output for #include directives..." >&4
5403 vos) testaccess=-e ;;
5406 echo '#include <stdio.h>' > foo.c
5409 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5410 $grep '^[ ]*#.*stdio\.h' | \
5411 while read cline; do
5414 while $test \$# -gt 0; do
5415 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5420 pos=\`expr \$pos + 1\`
5432 *) pos="${fieldn}th";;
5434 echo "Your cpp writes the filename in the $pos field of the line."
5437 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5438 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5441 : locate header file
5446 for usrincdir in $usrinc
5448 if test -f \$usrincdir/\$wanted; then
5449 echo "\$usrincdir/\$wanted"
5453 awkprg='{ print \$$fieldn }'
5454 echo "#include <\$wanted>" > foo\$\$.c
5455 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5456 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5457 while read cline; do
5458 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5460 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5461 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5466 # status = 0: grep returned 0 lines, case statement not executed
5467 # status = 1: headerfile found
5468 # status = 2: while loop executed, no headerfile found
5472 if test \$status -eq 1; then
5479 : define an alternate in-header-list? function
5480 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5481 cont=true; xxf="echo \"<\$1> found.\" >&4";
5482 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5483 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5485 case $# in 4) instead=instead;; *) instead="at last";; esac;
5486 while $test "$cont"; do
5488 var=$2; eval "was=\$$2";
5489 if $test "$xxx" && $test -r "$xxx";
5491 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5494 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5495 set $yyy; shift; shift; yyy=$@;
5496 case $# in 0) cont="";;
5497 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5498 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5499 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5500 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5504 do set $yyy; var=$2; eval "was=\$$2";
5505 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5506 set $yyy; shift; shift; yyy=$@;
5509 : see if stdlib is available
5510 set stdlib.h i_stdlib
5513 : check for lengths of integral types
5517 echo "Checking to see how big your integers are..." >&4
5526 printf("intsize=%d;\n", (int)sizeof(int));
5527 printf("longsize=%d;\n", (int)sizeof(long));
5528 printf("shortsize=%d;\n", (int)sizeof(short));
5533 if eval $compile_ok && $run ./try > /dev/null; then
5535 echo "Your integers are $intsize bytes long."
5536 echo "Your long integers are $longsize bytes long."
5537 echo "Your short integers are $shortsize bytes long."
5541 Help! I can't compile and run the intsize test program: please enlighten me!
5542 (This is probably a misconfiguration in your system or libraries, and
5543 you really ought to fix it. Still, I'll try anyway.)
5547 rp="What is the size of an integer (in bytes)?"
5551 rp="What is the size of a long integer (in bytes)?"
5555 rp="What is the size of a short integer (in bytes)?"
5563 : check for long long
5565 echo "Checking to see if you have long long..." >&4
5566 echo 'int main() { long long x = 7; return 0; }' > try.c
5568 if eval $compile; then
5570 echo "You have long long."
5573 echo "You do not have long long."
5579 : check for length of long long
5580 case "${d_longlong}${longlongsize}" in
5583 echo "Checking to see how big your long longs are..." >&4
5584 $cat >try.c <<'EOCP'
5588 printf("%d\n", (int)sizeof(long long));
5593 if eval $compile_ok; then
5594 longlongsize=`$run ./try`
5595 echo "Your long longs are $longlongsize bytes long."
5599 echo "(I can't seem to compile the test program. Guessing...)"
5600 rp="What is the size of a long long (in bytes)?"
5604 if $test "X$longsize" = "X$longlongsize"; then
5605 echo "(That isn't any different from an ordinary long.)"
5611 : see if inttypes.h is available
5612 : we want a real compile instead of Inhdr because some systems
5613 : have an inttypes.h which includes non-existent headers
5616 #include <inttypes.h>
5618 static int32_t foo32 = 0x12345678;
5622 if eval $compile; then
5623 echo "<inttypes.h> found." >&4
5626 echo "<inttypes.h> NOT found." >&4
5635 echo "Checking to see if you have int64_t..." >&4
5637 #include <sys/types.h>
5638 #$i_inttypes I_INTTYPES
5640 #include <inttypes.h>
5642 int main() { int64_t x = 7; }
5645 if eval $compile; then
5647 echo "You have int64_t."
5650 echo "You do not have int64_t."
5656 : Check if 64bit ints have a quad type
5658 echo "Checking which 64-bit integer type we could use..." >&4
5664 val='"unsigned int"'
5669 *) case "$longsize" in
5673 val='"unsigned long"'
5678 *) case "$d_longlong:$longlongsize" in
5683 val='"unsigned long long"'
5688 *) case "$d_int64_t" in
5707 '') echo "Alas, no 64-bit integer types in sight." >&4
5710 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5715 : Do we want 64bit support
5716 case "$uselonglong" in
5717 "$define"|true|[yY]*)
5720 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5722 use64bitint="$define"
5725 case "$use64bits" in
5726 "$define"|true|[yY]*)
5729 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5731 use64bitint="$define"
5734 case "$use64bitints" in
5735 "$define"|true|[yY]*)
5738 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5740 use64bitint="$define"
5743 case "$use64bitsint" in
5744 "$define"|true|[yY]*)
5747 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5749 use64bitint="$define"
5752 case "$uselonglongs" in
5753 "$define"|true|[yY]*)
5756 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5758 use64bitint="$define"
5761 case "$use64bitsall" in
5762 "$define"|true|[yY]*)
5765 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5767 use64bitall="$define"
5772 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5774 case "$use64bitall" in
5775 "$define"|true|[yY]*) use64bitint="$define" ;;
5781 You have natively 64-bit long integers.
5785 *) case "$use64bitint" in
5786 "$define"|true|[yY]*) dflt='y';;
5795 Perl can be built to take advantage of 64-bit integer types
5796 on some systems. To do so, Configure can be run with -Duse64bitint.
5797 Choosing this option will most probably introduce binary incompatibilities.
5799 If this doesn't make any sense to you, just accept the default '$dflt'.
5800 (The default has been chosen based on your configuration.)
5802 rp='Try to use 64-bit integers, if available?'
5805 [yY]*) val="$define" ;;
5813 case "$use64bitall" in
5814 "$define"|true|[yY]*) dflt='y' ;;
5815 *) case "$longsize" in
5823 You may also choose to try maximal 64-bitness. It means using as much
5824 64-bitness as possible on the platform. This in turn means even more
5825 binary incompatibilities. On the other hand, your platform may not
5826 have any more 64-bitness available than what you already have chosen.
5828 If this doesn't make any sense to you, just accept the default '$dflt'.
5829 (The default has been chosen based on your configuration.)
5831 rp='Try to use maximal 64-bit support, if available?'
5834 [yY]*) val="$define" ;;
5839 case "$use64bitall" in
5841 case "$use64bitint" in
5845 Since you have chosen a maximally 64-bit build, I'm also turning on
5846 the use of 64-bit integers.
5848 use64bitint="$define" ;;
5853 : Look for a hint-file generated 'call-back-unit'. If the
5854 : user has specified that a 64-bit perl is to be built,
5855 : we may need to set or change some other defaults.
5856 if $test -f use64bitint.cbu; then
5857 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5860 case "$use64bitint" in
5861 "$define"|true|[yY]*)
5862 : This test was common to all the OpenBSD forks, and seems harmless for
5865 echo "Checking if your C library has broken 64-bit functions..." >&4
5868 typedef $uquadtype myULL;
5875 {4294967303.15, 4294967303ULL},
5876 {4294967294.2, 4294967294ULL},
5877 {4294967295.7, 4294967295ULL},
5880 for (p = test; p->u; p++) {
5881 myULL x = (myULL)p->d;
5892 if eval $compile_ok; then
5894 echo "Your C library's 64-bit functions are $libcquad."
5896 echo "(I can't seem to compile the test program.)"
5897 echo "Assuming that your C library's 64-bit functions are ok."
5906 *** You have a C library with broken 64-bit functions.
5907 *** 64-bit support does not work reliably in this configuration.
5908 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5909 *** Cannot continue, aborting.
5916 4) case "$archname64" in
5917 '') archname64=64int ;;
5924 : Look for a hint-file generated 'call-back-unit'. If the
5925 : user has specified that a maximally 64-bit perl is to be built,
5926 : we may need to set or change some other defaults.
5927 if $test -f use64bitall.cbu; then
5928 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5931 case "$use64bitall" in
5932 "$define"|true|[yY]*)
5934 4) case "$archname64" in
5935 ''|64int) archname64=64all ;;
5942 case "$d_quad:$use64bitint" in
5946 *** You have chosen to use 64-bit integers,
5947 *** but none can be found.
5948 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5949 *** Cannot continue, aborting.
5956 : check for length of double
5958 case "$doublesize" in
5960 echo "Checking to see how big your double precision numbers are..." >&4
5969 printf("%d\n", (int)sizeof(double));
5974 if eval $compile_ok; then
5975 doublesize=`$run ./try`
5976 echo "Your double is $doublesize bytes long."
5979 echo "(I can't seem to compile the test program. Guessing...)"
5980 rp="What is the size of a double precision number (in bytes)?"
5988 : check for long doubles
5990 echo "Checking to see if you have long double..." >&4
5991 echo 'int main() { long double x = 7.0; }' > try.c
5993 if eval $compile; then
5995 echo "You have long double."
5998 echo "You do not have long double."
6004 : check for length of long double
6005 case "${d_longdbl}${longdblsize}" in
6008 echo "Checking to see how big your long doubles are..." >&4
6009 $cat >try.c <<'EOCP'
6013 printf("%d\n", sizeof(long double));
6018 if eval $compile; then
6019 longdblsize=`$run ./try`
6020 echo "Your long doubles are $longdblsize bytes long."
6024 echo "(I can't seem to compile the test program. Guessing...)" >&4
6025 rp="What is the size of a long double (in bytes)?"
6029 if $test "X$doublesize" = "X$longdblsize"; then
6030 echo "That isn't any different from an ordinary double."
6031 echo "I'll keep your setting anyway, but you may see some"
6032 echo "harmless compilation warnings."
6038 : determine the architecture name
6040 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6041 tarch=`arch`"-$osname"
6042 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6043 if uname -m > tmparch 2>&1 ; then
6044 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6045 -e 's/$/'"-$osname/" tmparch`
6053 case "$myarchname" in
6056 echo "(Your architecture name used to be $myarchname.)"
6060 case "$targetarch" in
6062 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6067 *) dflt="$archname";;
6069 rp='What is your architecture name'
6073 : optionally add API version to the architecture for versioned archlibs
6074 case "$useversionedarchname" in
6075 $define|true|[yY]*) dflt='y';;
6078 rp='Add the Perl API version to your archname?'
6081 y|Y) useversionedarchname="$define" ;;
6082 *) useversionedarchname="$undef" ;;
6084 case "$useversionedarchname" in
6087 *-$api_versionstring)
6088 echo "...and architecture name already has -$api_versionstring" >&4
6091 archname="$archname-$api_versionstring"
6092 echo "...setting architecture name to $archname." >&4
6098 case "$usethreads" in
6100 echo "Threads selected." >&4
6102 *-thread*) echo "...and architecture name already has -thread." >&4
6104 *) archname="$archname-thread"
6105 echo "...setting architecture name to $archname." >&4
6110 case "$usemultiplicity" in
6112 echo "Multiplicity selected." >&4
6114 *-multi*) echo "...and architecture name already has -multi." >&4
6116 *) archname="$archname-multi"
6117 echo "...setting architecture name to $archname." >&4
6122 case "$use64bitint$use64bitall" in
6124 case "$archname64" in
6126 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6129 case "$use64bitint" in
6130 "$define") echo "64 bit integers selected." >&4 ;;
6132 case "$use64bitall" in
6133 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6136 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6138 *) archname="$archname-$archname64"
6139 echo "...setting architecture name to $archname." >&4
6145 case "$uselongdouble" in
6147 echo "Long doubles selected." >&4
6148 case "$longdblsize" in
6150 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6154 *-ld*) echo "...and architecture name already has -ld." >&4
6156 *) archname="$archname-ld"
6157 echo "...setting architecture name to $archname." >&4
6164 if $test -f archname.cbu; then
6165 echo "Your platform has some specific hints for architecture name, using them..."
6169 : set the prefixit variable, to compute a suitable default value
6170 prefixit='case "$3" in
6172 case "$oldprefix" in
6173 "") eval "$1=\"\$$2\"";;
6180 ""|" ") eval "$1=\"\$$2\"";;
6186 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6188 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6189 /*-$oldprefix/*|\~*-$oldprefix/*)
6190 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6191 *) eval "$1=\"\$$2\"";;
6195 : determine installation style
6196 : For now, try to deduce it from prefix unless it is already set.
6197 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6198 case "$installstyle" in
6199 '') case "$prefix" in
6200 *perl*) dflt='lib';;
6201 *) dflt='lib/perl5' ;;
6204 *) dflt="$installstyle" ;;
6206 : Probably not worth prompting for this since we prompt for all
6207 : the directories individually, and the prompt would be too long and
6211 : determine where public executables go
6216 rp='Pathname where the public executables will reside?'
6218 if $test "X$ansexp" != "X$binexp"; then
6222 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6223 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6224 : this via initialinstalllocation
6227 case "$userelocatableinc" in
6228 $define|true|[yY]*) dflt='y' ;;
6233 Would you like to build Perl so that the installation is relocatable, so that
6234 library paths in @INC are determined relative to the path of the perl binary?
6235 This is not advised for system Perl installs, or if you need to run setid
6236 scripts or scripts under taint mode.
6238 If this doesn't make any sense to you, just accept the default '$dflt'.
6240 rp='Use relocatable @INC?'
6243 y|Y) val="$define" ;;
6246 set userelocatableinc
6249 initialinstalllocation="$binexp"
6250 : Default prefix is now "up one level from where the binaries are"
6251 case "$userelocatableinc" in
6257 installprefixexp=".../.."
6261 : determine where private library files go
6262 : Usual default is /usr/local/lib/perl5/$version.
6263 : Also allow things like /opt/perl/lib/$version, since
6264 : /opt/perl/lib/perl5... would be redundant.
6265 : The default "style" setting is made in installstyle.U
6266 case "$installstyle" in
6267 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6268 *) set dflt privlib lib/$version ;;
6273 There are some auxiliary files for $package that need to be put into a
6274 private library directory that is accessible by everyone.
6279 rp='Pathname where the private library files will reside?'
6284 : set the prefixup variable, to restore leading tilda escape
6285 prefixup='case "$prefixexp" in
6287 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6290 : determine where public architecture dependent libraries go
6293 : privlib default is /usr/local/lib/$package/$version
6294 : archlib default is /usr/local/lib/$package/$version/$archname
6295 : privlib may have an optional trailing /share.
6296 tdflt=`echo $privlib | $sed 's,/share$,,'`
6297 tdflt=$tdflt/$archname
6306 $spackage contains architecture-dependent library files. If you are
6307 sharing libraries in a heterogeneous environment, you might store
6308 these files in a separate location. Otherwise, you can just include
6309 them with the rest of the public library files.
6314 rp='Where do you want to put the public architecture-dependent libraries?'
6318 if $test X"$archlib" = X"$privlib"; then
6324 : see if setuid scripts can be secure
6327 Some kernels have a bug that prevents setuid #! scripts from being
6328 secure. Some sites have disabled setuid #! scripts because of this.
6330 First let's decide if your kernel supports secure setuid #! scripts.
6331 (If setuid #! scripts would be secure but have been disabled anyway,
6332 don't say that they are secure if asked.)
6337 if $test -d /dev/fd; then
6338 echo "#!$ls" >reflect
6339 chmod +x,u+s reflect
6340 ./reflect >flect 2>&1
6341 if $contains "/dev/fd" flect >/dev/null; then
6342 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6346 If you are not sure if they are secure, I can check but I'll need a
6347 username and password different from the one you are using right now.
6348 If you don't have such a username or don't want me to test, simply
6352 rp='Other username to test security of setuid scripts with?'
6357 case "$d_suidsafe" in
6358 '') echo "I'll assume setuid scripts are *not* secure." >&4
6361 echo "Well, the $hint value is *not* secure." >&4
6363 *) echo "Well, the $hint value *is* secure." >&4
6368 $rm -f reflect flect
6369 echo "#!$ls" >reflect
6370 chmod +x,u+s reflect
6373 echo '"su" will (probably) prompt you for '"$ans's password."
6374 su $ans -c './reflect >flect'
6375 if $contains "/dev/fd" flect >/dev/null; then
6376 echo "Okay, it looks like setuid scripts are secure." >&4
6379 echo "I don't think setuid scripts are secure." >&4
6384 rp='Does your kernel have *secure* setuid scripts?'
6387 [yY]*) val="$define";;
6392 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6393 echo "(That's for file descriptors, not floppy disks.)"
6399 $rm -f reflect flect
6401 : now see if they want to do setuid emulation
6402 if $test $patchlevel -lt 11; then
6405 case "$d_suidsafe" in
6408 echo "No need to emulate SUID scripts since they are secure here." >&4
6412 Some systems have disabled setuid scripts, especially systems where
6413 setuid scripts cannot be secure. On systems where setuid scripts have
6414 been disabled, the setuid/setgid bits on scripts are currently
6415 useless. It is possible for $package to detect those bits and emulate
6416 setuid/setgid in a secure fashion. This emulation will only work if
6417 setuid scripts have been disabled in your kernel.
6421 "$define") dflt=y ;;
6424 rp="Do you want to do setuid/setgid emulation?"
6427 [yY]*) val="$define";;
6439 SUID emulation has been removed for 5.12
6440 Please re-run Configure without -Dd_dosuid
6449 : Find perl5.005 or later.
6450 echo "Looking for a previously installed perl5.005 or later... "
6452 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6453 : Check if this perl is recent and can load a simple module
6454 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6457 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6467 '') echo "None found. That's ok.";;
6468 *) echo "Using $perl5." ;;
6471 : Set the siteprefix variables
6474 After $package is installed, you may wish to install various
6475 add-on modules and utilities. Typically, these add-ons will
6476 be installed under $prefix with the rest
6477 of this package. However, you may wish to install such add-ons
6478 elsewhere under a different prefix.
6480 If you do not wish to put everything under a single prefix, that's
6481 ok. You will be prompted for the individual locations; this siteprefix
6482 is only used to suggest the defaults.
6484 The default should be fine for most people.
6488 rp='Installation prefix to use for add-on modules and utilities?'
6489 : XXX Here might be another good place for an installstyle setting.
6490 case "$siteprefix" in
6492 *) dflt=$siteprefix ;;
6495 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6497 case "$siteprefix" in
6501 *) oldsiteprefix="$prefix";;
6506 siteprefixexp="$ansexp"
6508 : determine where site specific libraries go.
6509 : Usual default is /usr/local/lib/perl5/site_perl/$version
6510 : The default "style" setting is made in installstyle.U
6511 : XXX No longer works with Prefixit stuff.
6512 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6514 '') case "$installstyle" in
6515 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6516 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6524 The installation process will create a directory for
6525 site-specific extensions and modules. Most users find it convenient
6526 to place all site-specific files in this directory rather than in the
6527 main distribution directory.
6531 rp='Pathname for the site-specific library files?'
6535 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6537 : Determine list of previous versions to include in @INC
6538 $cat > getverlist <<EOPL
6541 \$api_versionstring = "$api_versionstring";
6542 \$version = "$version";
6543 \$stem = "$sitelib_stem";
6544 \$archname = "$archname";
6546 $cat >> getverlist <<'EOPL'
6547 # The list found is store twice for each entry: the original name, and
6548 # the binary broken down version as pack "sss", so sorting is easy and
6549 # unambiguous. This will work for all versions that have a maximum of
6550 # three digit groups, separate by '.'s or '_'s. Names are extended with
6551 # ".0.0" to ensure at least three elements for the pack.
6552 # -- H.Merijn Brand (m)'06 23-10-2006
6554 # Can't have leading @ because metaconfig interprets it as a command!
6555 ;@inc_version_list=();
6556 # XXX Redo to do opendir/readdir?
6559 ;@candidates = map {
6560 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6561 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6567 ($pversion, $aversion, $vsn5005) = map {
6568 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6569 foreach $d (@candidates) {
6570 if ($d->[1] lt $pversion) {
6571 if ($d->[1] ge $aversion) {
6572 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6574 elsif ($d->[1] ge $vsn5005) {
6575 unshift(@inc_version_list, grep { -d } $d->[0]);
6579 # Skip newer version. I.e. don't look in
6580 # 5.7.0 if we're installing 5.6.1.
6584 if (@inc_version_list) {
6585 print join(' ', @inc_version_list);
6588 # Blank space to preserve value for next Configure run.
6593 case "$inc_version_list" in
6594 '') if test -x "$perl5$exe_ext"; then
6595 dflt=`$perl5 getverlist`
6600 $undef) dflt='none' ;;
6601 *) eval dflt=\"$inc_version_list\" ;;
6604 ''|' ') dflt=none ;;
6611 In order to ease the process of upgrading, this version of perl
6612 can be configured to use modules built and installed with earlier
6613 versions of perl that were installed under $prefix. Specify here
6614 the list of earlier versions that this version of perl should check.
6615 If Configure detected no earlier versions of perl installed under
6616 $prefix, then the list will be empty. Answer 'none' to tell perl
6617 to not search earlier versions.
6619 The default should almost always be sensible, so if you're not sure,
6620 just accept the default.
6623 rp='List of earlier versions to include in @INC?'
6626 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6627 *) inc_version_list="$ans" ;;
6629 case "$inc_version_list" in
6631 inc_version_list_init='0'
6632 d_inc_version_list="$undef"
6634 *) inc_version_list_init=`echo $inc_version_list |
6635 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6636 d_inc_version_list="$define"
6641 : see if malloc/malloc.h has to be included
6642 set malloc/malloc.h i_mallocmalloc
6645 : see if this is a malloc.h system
6646 : we want a real compile instead of Inhdr because some systems have a
6647 : malloc.h that just gives a compile error saying to use stdlib.h instead
6652 #$i_mallocmalloc I_MALLOCMALLOC
6653 #ifdef I_MALLOCMALLOC
6654 # include <malloc/malloc.h>
6657 int main () { return 0; }
6660 if eval $compile; then
6661 echo "<malloc.h> found." >&4
6664 echo "<malloc.h> NOT found." >&4
6671 : check for void type
6673 echo "Checking to see how well your C compiler groks the void type..." >&4
6674 case "$voidflags" in
6686 extern void moo(); /* function returning void */
6687 void (*goo)(); /* ptr to func returning void */
6689 void *hue; /* generic ptr */
6702 int main() { sub(); }
6704 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6705 voidflags=$defvoidused
6706 echo "Good. It appears to support void to the level $package wants.">&4
6707 if $contains warning .out >/dev/null 2>&1; then
6708 echo "However, you might get some warnings that look like this:"
6712 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6713 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6714 echo "It supports 1..."
6715 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6716 echo "It also supports 2..."
6717 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6719 echo "And it supports 4 but not 8 definitely."
6721 echo "It doesn't support 4..."
6722 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6724 echo "But it supports 8."
6727 echo "Neither does it support 8."
6731 echo "It does not support 2..."
6732 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6734 echo "But it supports 4 and 8."
6736 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6738 echo "And it supports 4 but has not heard about 8."
6740 echo "However it supports 8 but not 4."
6745 echo "There is no support at all for void."
6750 case "$voidflags" in
6753 Support flag bits are:
6754 1: basic void declarations.
6755 2: arrays of pointers to functions returning void.
6756 4: operations between pointers to and addresses of void functions.
6757 8: generic void pointers.
6760 rp="Your void support flags add up to what?"
6767 : check for length of pointer
6771 echo "Checking to see how big your pointers are..." >&4
6772 if test "$voidflags" -gt 7; then
6773 echo '#define VOID_PTR char *' > try.c
6775 echo '#define VOID_PTR void *' > try.c
6785 printf("%d\n", (int)sizeof(VOID_PTR));
6790 if eval $compile_ok; then
6791 ptrsize=`$run ./try`
6792 echo "Your pointers are $ptrsize bytes long."
6795 echo "(I can't seem to compile the test program. Guessing...)" >&4
6796 rp="What is the size of a pointer (in bytes)?"
6803 case "$use64bitall" in
6804 "$define"|true|[yY]*)
6808 *** You have chosen a maximally 64-bit build,
6809 *** but your pointers are only 4 bytes wide.
6810 *** Please rerun Configure without -Duse64bitall.
6815 *** Since you have quads, you could possibly try with -Duse64bitint.
6820 *** Cannot continue, aborting.
6831 : determine whether to use malloc wrapping
6833 case "$usemallocwrap" in
6834 [yY]*|true|$define) dflt='y' ;;
6835 [nN]*|false|$undef) dflt='n' ;;
6836 *) case "$usedevel" in
6837 [yY]*|true|$define) dflt='y' ;;
6842 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6844 usemallocwrap="$ans"
6847 usemallocwrap="$define" ;;
6849 usemallocwrap="$undef" ;;
6852 : determine which malloc to compile in
6854 case "$usemymalloc" in
6855 [yY]*|true|$define) dflt='y' ;;
6856 [nN]*|false|$undef) dflt='n' ;;
6857 *) case "$ptrsize" in
6861 if test "$useithreads" = "$define"; then dflt='n'; fi
6864 rp="Do you wish to attempt to use the malloc that comes with $package?"
6870 mallocsrc='malloc.c'
6871 mallocobj="malloc$_o"
6872 d_mymalloc="$define"
6875 : Remove malloc from list of libraries to use
6876 echo "Removing unneeded -lmalloc from library list" >&4
6877 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6880 echo "libs = $libs" >&4
6892 : compute the return types of malloc and free
6894 $cat >malloc.c <<END
6898 #include <sys/types.h>
6912 case "$malloctype" in
6914 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6921 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6925 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6932 echo "Your system uses $freetype free(), it would seem." >&4
6934 : determine where site specific architecture-dependent libraries go.
6935 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6936 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6937 : sitelib may have an optional trailing /share.
6939 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6940 dflt="$dflt/$archname"
6945 set sitearch sitearch none
6949 The installation process will also create a directory for
6950 architecture-dependent site-specific extensions and modules.
6954 rp='Pathname for the site-specific architecture-dependent library files?'
6958 if $test X"$sitearch" = X"$sitelib"; then
6961 d_sitearch="$define"
6964 : Set the vendorprefix variables
6967 The installation process will also create a directory for
6968 vendor-supplied add-ons. Vendors who supply perl with their system
6969 may find it convenient to place all vendor-supplied files in this
6970 directory rather than in the main distribution directory. This will
6971 ease upgrades between binary-compatible maintenance versions of perl.
6973 Of course you may also use these directories in whatever way you see
6974 fit. For example, you might use them to access modules shared over a
6975 company-wide network.
6977 The default answer should be fine for most people.
6978 This causes further questions about vendor add-ons to be skipped
6979 and no vendor-specific directories will be configured for perl.
6982 rp='Do you want to configure vendor-specific add-on directories?'
6983 case "$usevendorprefix" in
6984 define|true|[yY]*) dflt=y ;;
6985 *) : User may have set vendorprefix directly on Configure command line.
6986 case "$vendorprefix" in
6995 rp='Installation prefix to use for vendor-supplied add-ons?'
6996 case "$vendorprefix" in
6997 '') dflt="$prefix" ;;
6998 *) dflt=$vendorprefix ;;
7001 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7003 case "$vendorprefix" in
7007 *) oldvendorprefix="$prefix";;
7011 usevendorprefix="$define"
7013 vendorprefixexp="$ansexp"
7015 *) usevendorprefix="$undef"
7021 : Set the vendorlib variables
7022 case "$vendorprefix" in
7023 '') d_vendorlib="$undef"
7027 *) d_vendorlib="$define"
7028 : determine where vendor-supplied modules go.
7029 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7030 case "$vendorlib" in
7032 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7033 case "$installstyle" in
7034 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7035 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7038 *) dflt="$vendorlib"
7042 rp='Pathname for the vendor-supplied library files?'
7045 vendorlibexp="$ansexp"
7048 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7052 : Set the vendorarch variables
7053 case "$vendorprefix" in
7054 '') d_vendorarch="$undef"
7058 *) d_vendorarch="$define"
7059 : determine where vendor-supplied architecture-dependent libraries go.
7060 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7061 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7062 : vendorlib may have an optional trailing /share.
7063 case "$vendorarch" in
7064 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7065 dflt="$dflt/$archname"
7067 *) dflt="$vendorarch" ;;
7070 rp='Pathname for vendor-supplied architecture-dependent files?'
7073 vendorarchexp="$ansexp"
7076 prefixvar=vendorarch
7078 if $test X"$vendorarch" = X"$vendorlib"; then
7079 d_vendorarch="$undef"
7081 d_vendorarch="$define"
7084 : Final catch-all directories to search
7087 Lastly, you can have perl look in other directories for extensions and
7088 modules in addition to those already specified.
7089 These directories will be searched after
7093 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7094 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7096 case "$otherlibdirs" in
7097 ''|' ') dflt='none' ;;
7098 *) dflt="$otherlibdirs" ;;
7101 Enter a colon-separated set of extra paths to include in perl's @INC
7102 search path, or enter 'none' for no extra paths.
7106 rp='Colon-separated list of additional directories for perl to search?'
7109 ' '|''|none) otherlibdirs=' ' ;;
7110 *) otherlibdirs="$ans" ;;
7112 case "$otherlibdirs" in
7116 set d_perl_otherlibdirs
7119 : Cruising for prototypes
7121 echo "Checking out function prototypes..." >&4
7122 $cat >prototype.c <<EOCP
7127 int main(int argc, char *argv[]) {
7130 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7131 echo "Your C compiler appears to support function prototypes."
7134 echo "Your C compiler doesn't seem to understand function prototypes."
7141 : Check if ansi2knr is required
7142 case "$prototype" in
7144 *) ansi2knr='ansi2knr'
7149 This version of $package can only be compiled by a compiler that
7150 understands function prototypes. Unfortunately, your C compiler
7152 doesn't seem to understand them. Sorry about that.
7154 If GNU cc is available for your system, perhaps you could try that instead.
7156 Eventually, we hope to support building Perl with pre-ANSI compilers.
7157 If you would like to help in that effort, please contact <perlbug@perl.org>.
7159 Aborting Configure now.
7166 dflt_dtrace='/usr/sbin/dtrace'
7167 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7171 Perl can be built to support DTrace on platforms that support it.
7172 DTrace is a diagnosis and performance analysis tool from Sun.
7174 If this doesn't make any sense to you, just accept the default '$dflt'.
7178 case "$usedtrace" in
7184 dflt_dtrace=$usedtrace
7191 rp='Support DTrace if available?'
7194 y|Y) val="$define" ;;
7200 test "X$usedtrace" != "X$define" && break
7203 rp='Where is the dtrace executable?'
7212 if $dtrace -h -s ../perldtrace.d \
7213 -o perldtrace.tmp >/dev/null 2>&1 \
7214 && rm -f perldtrace.tmp
7217 echo "Good: your $dtrace knows about the -h flag."
7221 *** $me: Fatal Error: $dtrace doesn't support -h flag
7223 *** Your installed dtrace doesn't support the -h switch to compile a D
7224 *** program into a C header. Can't continue.
7236 *** $me: Fatal Error: $dtrace not found.
7243 echo "*** $dtrace was not found."
7249 : See if we want extra modules installed
7256 Perl can be built with extra modules or bundles of modules which
7257 will be fetched from the CPAN and installed alongside Perl.
7259 Notice that you will need access to the CPAN; either via the Internet,
7260 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7261 be asked later to configure the CPAN.pm module which will in turn do
7262 the installation of the rest of the extra modules or bundles.)
7264 Notice also that if the modules require any external software such as
7265 libraries and headers (the libz library and the zlib.h header for the
7266 Compress::Zlib module, for example) you MUST have any such software
7267 already installed, this configuration process will NOT install such
7270 If this doesn't make any sense to you, just accept the default '$dflt'.
7272 rp='Install any extra modules (y or n)?'
7278 Please list any extra modules or bundles to be installed from CPAN,
7279 with spaces between the names. The names can be in any format the
7280 'install' command of CPAN.pm will understand. (Answer 'none',
7281 without the quotes, to install no extra modules or bundles.)
7291 $rm -f ../extras.lst
7293 *) echo "(Saving the list of extras for later...)"
7294 echo "$extras" > ../extras.lst
7302 : determine where html pages for programs go
7303 set html1dir html1dir none
7307 If you wish to install html files for programs in $spackage, indicate
7308 the appropriate directory here. To skip installing html files,
7312 ''|none|$undef|' ') dflt=none ;;
7313 *) dflt=$html1dir ;;
7316 rp="Directory for the main $spackage html pages?"
7320 : Use ' ' for none so value is preserved next time through Configure
7321 $test X"$html1dir" = "X" && html1dir=' '
7323 : determine where html pages for libraries and modules go
7324 set html3dir html3dir none
7328 If you wish to install html files for modules associated with $spackage,
7329 indicate the appropriate directory here. To skip installing html files,
7332 : There is no obvious default. If they have specified html1dir, then
7333 : try to key off that, possibly changing .../html1 into .../html3.
7335 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7336 *) dflt=$html3dir ;;
7339 rp="Directory for the $spackage module html pages?"
7343 : Use ' ' for none so value is preserved next time through Configure
7344 $test X"$html3dir" = "X" && html3dir=' '
7346 : determine whether to install perl also as /usr/bin/perl
7349 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7351 Many scripts expect perl to be installed as /usr/bin/perl.
7353 If you want to, I can install the perl you are about to compile
7354 as /usr/bin/perl (in addition to $bin/perl).
7356 if test -f /usr/bin/perl; then
7359 However, please note that because you already have a /usr/bin/perl,
7360 overwriting that with a new Perl would very probably cause problems.
7361 Therefore I'm assuming you don't want to do that (unless you insist).
7364 case "$installusrbinperl" in
7365 "$define"|[yY]*) dflt='y';;
7371 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7374 case "$installusrbinperl" in
7375 "$undef"|[nN]*) dflt='n';;
7379 rp="Do you want to install perl as /usr/bin/perl?"
7382 [yY]*) val="$define";;
7388 set installusrbinperl
7391 : Check if we are using the GNU C library
7393 echo "Checking for GNU C Library..." >&4
7395 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7396 alone are insufficient to distinguish different versions, such as
7397 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7398 libc version 2.1.0. A. Dougherty, June 3, 2002.
7404 # ifdef __GLIBC_MINOR__
7405 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7406 # include <gnu/libc-version.h>
7407 printf("%s\n", gnu_get_libc_version());
7409 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7412 printf("%d\n", __GLIBC__);
7421 if eval $compile_ok && $run ./try > glibc.ver; then
7423 gnulibc_version=`$cat glibc.ver`
7424 echo "You are using the GNU C Library version $gnulibc_version"
7428 echo "You are not using the GNU C Library"
7434 : see if nm is to be used to determine whether a symbol is defined or not
7438 case "$d_gnulibc" in
7441 echo "nm probably won't work on the GNU C Library." >&4
7447 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7449 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7450 echo "'nm' won't be sufficient on this system." >&4
7456 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7457 if $test $dflt -gt 20; then
7467 true|$define) dflt=y;;
7474 I can use $nm to extract the symbols from your C libraries. This
7475 is a time consuming task which may generate huge output on the disk (up
7476 to 3 megabytes) but that should make the symbols extraction faster. The
7477 alternative is to skip the 'nm' extraction part and to compile a small
7478 test program instead to determine whether each symbol is present. If
7479 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7480 this may be the best solution.
7482 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7485 rp="Shall I use $nm to extract C symbols from the libraries?"
7488 [Nn]*) usenm=false;;
7497 : nm options which may be necessary
7499 '') if $test -f /mach_boot; then
7501 elif $test -d /usr/ccs/lib; then
7502 nm_opt='-p' # Solaris (and SunOS?)
7503 elif $test -f /dgux; then
7505 elif $test -f /lib64/rld; then
7506 nm_opt='-p' # 64-bit Irix
7512 : nm options which may be necessary for shared libraries but illegal
7513 : for archive libraries. Thank you, Linux.
7514 case "$nm_so_opt" in
7515 '') case "$myuname" in
7517 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7518 nm_so_opt='--dynamic'
7525 : Figure out where the libc is located
7528 : get list of predefined functions in a handy place
7533 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7539 *) for thislib in $libs; do
7542 : Handle C library specially below.
7545 thislib=`echo $thislib | $sed -e 's/^-l//'`
7546 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7548 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7550 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7552 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7554 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7556 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7558 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7563 libnames="$libnames $try"
7565 *) libnames="$libnames $thislib" ;;
7574 for xxx in $libpth; do
7575 $test -r $1 || set $xxx/libc.$so
7576 : The messy sed command sorts on library version numbers.
7578 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7579 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7581 s/[0-9][0-9]*/0000&/g
7582 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7585 $sort | $sed -e 's/^.* //'`
7588 $test -r $1 || set /usr/ccs/lib/libc.$so
7589 $test -r $1 || set /lib/libsys_s$_a
7595 if $test -r "$1"; then
7596 echo "Your (shared) C library seems to be in $1."
7598 elif $test -r /lib/libc && $test -r /lib/clib; then
7599 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7601 libc='/lib/clib /lib/libc'
7602 if $test -r /lib/syslib; then
7603 echo "(Your math library is in /lib/syslib.)"
7604 libc="$libc /lib/syslib"
7606 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7607 echo "Your C library seems to be in $libc, as you said before."
7608 elif $test -r $incpath/usr/lib/libc$_a; then
7609 libc=$incpath/usr/lib/libc$_a;
7610 echo "Your C library seems to be in $libc. That's fine."
7611 elif $test -r /lib/libc$_a; then
7613 echo "Your C library seems to be in $libc. You're normal."
7615 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7617 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7618 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7619 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7621 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7623 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7626 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7628 if $test -r "$tans"; then
7629 echo "Your C library seems to be in $tans, of all places."
7635 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7639 If the guess above is wrong (which it might be if you're using a strange
7640 compiler, or your machine supports multiple models), you can override it here.
7645 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7647 I can't seem to find your C library. I've looked in the following places:
7650 $sed 's/^/ /' libpath
7653 None of these seems to contain your C library. I need to get its name...
7658 rp='Where is your C library?'
7663 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7664 set X `cat libnames`
7667 case $# in 1) xxx=file; esac
7668 echo "Extracting names from the following $xxx for later perusal:" >&4
7670 $sed 's/^/ /' libnames >&4
7672 $echo $n "This may take a while...$c" >&4
7676 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7677 *) $nm $nm_opt $file 2>/dev/null;;
7682 $grep fprintf libc.tmp > libc.ptf
7683 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7684 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7686 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7690 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7694 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7702 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7706 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7710 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7711 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7713 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7715 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7717 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7719 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7721 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7723 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7725 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7727 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7729 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7731 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7733 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7735 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7737 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7739 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7741 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7744 $nm -p $* 2>/dev/null >libc.tmp
7745 $grep fprintf libc.tmp > libc.ptf
7746 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7747 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7753 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7755 if $ar t $libc > libc.tmp && \
7756 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7758 for thisname in $libnames $libc; do
7759 $ar t $thisname >>libc.tmp
7761 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7763 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7764 for thisname in $libnames $libc; do
7765 $ar tv $thisname >>libc.tmp
7766 emximp -o tmp.imp $thisname \
7768 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7769 < tmp.imp >>libc.tmp
7772 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7775 echo "$ar didn't seem to work right." >&4
7776 echo "Maybe this is a Cray...trying bld instead..." >&4
7778 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7781 for thisname in $libnames; do
7783 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7784 $ar t $thisname >>libc.tmp
7788 echo "That didn't work either. Giving up." >&4
7798 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7799 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7801 *) if $test -f /lib/syscalls.exp; then
7803 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7804 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7805 /lib/syscalls.exp >>libc.list
7811 $rm -f libnames libpath
7813 : see if dld is available
7817 : Check if we are using C++
7819 echo "Checking for C++..." >&4
7820 $cat >try.c <<'EOCP'
7832 if eval $compile_ok && $run ./try; then
7834 echo "You are using a C++ compiler."
7837 echo "You are not using a C++ compiler."
7843 : is a C symbol defined?
7846 -v) tf=libc.tmp; tdc="";;
7847 -a) tf=libc.tmp; tdc="[]";;
7848 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7850 case "$d_cplusplus" in
7851 $define) extern_C="extern \"C\"" ;;
7852 *) extern_C="extern" ;;
7855 case "$reuseval-$4" in
7857 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7862 if $test "$runnm" = true; then
7863 if $contains $tlook $tf >/dev/null 2>&1; then
7865 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7866 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7867 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7868 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7872 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7873 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7879 $define) tval=true;;
7886 : define an is-in-libc? function
7887 inlibc='echo " "; td=$define; tu=$undef;
7888 sym=$1; var=$2; eval "was=\$$2";
7890 case "$reuseval$was" in
7900 echo "$sym() found." >&4;
7901 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7903 echo "$sym() NOT found." >&4;
7904 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7908 $define) echo "$sym() found." >&4;;
7909 *) echo "$sym() NOT found." >&4;;
7913 : see if dlopen exists
7915 xxx_ccflags="$ccflags"
7917 : with g++ one needs -shared to get is-in-libc to work for dlopen
7918 case "$gccversion" in
7920 *) case "$d_cplusplus" in
7921 "$define") ccflags="$ccflags -shared" ;;
7928 ccflags="$xxx_ccflags"
7930 : see if this is a unistd.h system
7931 set unistd.h i_unistd
7934 : determine which dynamic loading, if any, to compile in
7936 dldir="ext/DynaLoader"
7949 $define) dflt='y' ;;
7952 $define) dflt='y' ;;
7954 : Does a dl_xxx.xs file exist for this operating system
7955 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7958 rp="Do you wish to use dynamic loading?"
7966 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7967 dflt="$dldir/dl_${osname}.xs"
7968 elif $test "$d_dlopen" = "$define" ; then
7969 dflt="$dldir/dl_dlopen.xs"
7970 elif $test "$i_dld" = "$define" ; then
7971 dflt="$dldir/dl_dld.xs"
7976 *) dflt="$dldir/$dlsrc"
7979 echo "The following dynamic loading files are available:"
7980 : Can not go over to $dldir because getfile has path hard-coded in.
7981 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7982 rp="Source file to use for dynamic loading"
7988 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7992 Some systems may require passing special flags to $cc -c to
7993 compile modules that will be used to create a shared library.
7994 To use no flags, say "none".
7997 case "$cccdlflags" in
7998 '') case "$gccversion" in
7999 '') case "$osname" in
8001 next) dflt='none' ;;
8002 irix*) dflt='-KPIC' ;;
8003 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8004 sunos) dflt='-pic' ;;
8008 *) case "$osname" in
8009 darwin) dflt='none' ;;
8010 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8015 *) dflt="$cccdlflags" ;;
8017 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8020 none) cccdlflags=' ' ;;
8021 *) cccdlflags="$ans" ;;
8026 Some systems use ld to create libraries that can be dynamically loaded,
8027 while other systems (such as those using ELF) use $cc.
8031 : Determine if this is ELF
8033 /* Test for whether ELF binaries are produced */
8045 int i = open("a.out",O_RDONLY);
8048 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8049 exit(0); /* succeed (yes, it is ELF) */
8054 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8060 '') if $test $bin_ELF = "$define"; then
8062 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8066 echo "I'll use ld to build dynamic libraries."
8074 rp="What command should be used to create dynamic libraries?"
8080 Some systems may require passing special flags to $ld to create a
8081 library that can be dynamically loaded. If your ld flags include
8082 -L/other/path options to locate libraries outside your loader's normal
8083 search path, you may need to specify those -L options here as well. To
8084 use no flags, say "none".
8087 case "$lddlflags" in
8088 '') case "$osname" in
8089 haiku) dflt='-shared' ;;
8091 case "$gccversion" in
8092 '') dflt="$dflt +vnocompatwarnings" ;;
8095 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8096 next) dflt='none' ;;
8097 solaris) # See [perl #66604].
8098 # On Solaris 11, gcc -m64 on amd64
8099 # appears not to understand -G. gcc versions at
8100 # least as old as 3.4.3 support -shared, so just
8101 # use that with Solaris 11 and later, but keep
8102 # the old behavior for older Solaris versions.
8103 case "$gccversion" in
8105 *) case "$osvers" in
8106 2.?|2.10) dflt='-G' ;;
8107 *) dflt='-shared' ;;
8112 sunos) dflt='-assert nodefinitions' ;;
8113 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8117 *) dflt="$lddlflags" ;;
8120 : Try to guess additional flags to pick up local libraries.
8121 : Be careful not to append to a plain 'none'
8125 for thisflag in $ldflags; do
8130 *) dflt="$dflt $thisflag" ;;
8137 ''|' ') dflt='none' ;;
8141 *-fstack-protector*)
8143 *-fstack-protector*) ;; # Don't add it again
8144 *) dflt="$dflt -fstack-protector" ;;
8150 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8153 none) lddlflags=' ' ;;
8154 *) lddlflags="$ans" ;;
8159 Some systems may require passing special flags to $cc to indicate that
8160 the resulting executable will use dynamic linking. To use no flags,
8164 case "$ccdlflags" in
8165 '') case "$osname" in
8166 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8167 next|sunos) dflt='none' ;;
8171 *) dflt="$ccdlflags" ;;
8173 rp="Any special flags to pass to $cc to use dynamic linking?"
8176 none) ccdlflags=' ' ;;
8177 *) ccdlflags="$ans" ;;
8188 ld_can_script="$undef"
8189 case "$bin_ELF$usedl" in
8191 # Abuse try.h and a.out names for neat cleanup
8203 if $cc $cccdlflags $ccdlflags $ccflags \
8204 $ldflags $lddlflags -o a.out try.c \
8205 -Wl,--version-script=try.h >/dev/null 2>&1 \
8206 && $test -s a.out ; then
8207 echo "ld supports scripting" >&4
8208 ld_can_script="$define"
8210 echo "ld does not support scripting" >&4
8216 : Do we want a shared libperl?
8220 # No dynamic loading being used, so don't bother even to prompt.
8223 *) case "$useshrplib" in
8224 '') case "$osname" in
8225 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8227 also='Building a shared libperl is required for dynamic loading to work on your system.'
8232 also='Building a shared libperl is needed for MAB support.'
8250 The perl executable is normally obtained by linking perlmain.c with
8251 libperl${_a}, any static extensions (usually just DynaLoader), and
8252 any other libraries needed on this system (such as -lm, etc.). Since
8253 your system supports dynamic loading, it is probably possible to build
8254 a shared libperl.$so. If you will have more than one executable linked
8255 to libperl.$so, this will significantly reduce the size of each
8256 executable, but it may have a noticeable effect on performance. The
8257 default is probably sensible for your system.
8261 rp="Build a shared libperl.$so (y/n)"
8265 useshrplib='true' ;;
8266 *) useshrplib='false' ;;
8271 case "$useshrplib" in
8273 case "$userelocatableinc" in
8275 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8276 echo "See INSTALL for an explanation why that won't work." >&4
8282 # Figure out a good name for libperl.so. Since it gets stored in
8283 # a version-specific architecture-dependent library, the version
8284 # number isn't really that important, except for making cc/ld happy.
8286 # A name such as libperl.so.10.1
8287 majmin="libperl.$so.$patchlevel.$subversion"
8288 # A name such as libperl.so.100
8289 majonly=`echo $patchlevel $subversion |
8290 $awk '{printf "%d%02d", $1, $2}'`
8291 majonly=libperl.$so.$majonly
8292 # I'd prefer to keep the os-specific stuff here to a minimum, and
8293 # rely on figuring it out from the naming of libc.
8294 case "${osname}${osvers}" in
8297 # XXX How handle the --version stuff for MAB?
8299 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8302 cygwin*) # ld links now against the dll directly
8303 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8304 majonly=`echo $patchlevel $subversion |
8305 $awk '{printf "%03d%03d", $1, $2}'`
8306 majonly=cygperl5.$majonly.$so
8309 *) # Try to guess based on whether libc has major.minor.
8311 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8312 *libc.$so.[0-9]*) dflt=$majonly ;;
8313 *) dflt=libperl.$so ;;
8323 I need to select a good name for the shared libperl. If your system uses
8324 library names with major and minor numbers, then you might want something
8325 like $majmin. Alternatively, if your system uses a single version
8326 number for shared libraries, then you might want to use $majonly.
8327 Or, your system might be quite happy with a simple libperl.$so.
8329 Since the shared libperl will get installed into a version-specific
8330 architecture-dependent directory, the version number of the shared perl
8331 library probably isn't important, so the default should be o.k.
8334 rp='What name do you want to give to the shared libperl?'
8337 echo "Ok, I'll use $libperl"
8340 libperl="libperl${_a}"
8344 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8348 WARNING: Use of the shrpdir variable for the installation location of
8349 the shared $libperl is not supported. It was never documented and
8350 will not work in this version. Let me (perlbug@perl.org)
8351 know of any problems this may cause.
8357 But your current setting of $shrpdir is
8358 the default anyway, so it's harmless.
8363 Further, your current attempted setting of $shrpdir
8364 conflicts with the value of $archlibexp/CORE
8365 that installperl will use.
8372 # How will the perl executable find the installed shared $libperl?
8373 # Add $xxx to ccdlflags.
8374 # If we can't figure out a command-line option, use $shrpenv to
8375 # set env LD_RUN_PATH. The main perl makefile uses this.
8376 shrpdir=$archlibexp/CORE
8379 if "$useshrplib"; then
8382 # We'll set it in Makefile.SH...
8387 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8388 xxx="-Wl,-R$shrpdir"
8390 bsdos|linux|irix*|dec_osf|gnu*)
8391 xxx="-Wl,-rpath,$shrpdir"
8394 # next doesn't like the default...
8397 # Haiku doesn't like the default, either.
8400 # hpux doesn't like the default, either.
8401 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8404 # cygwin needs only ldlibpth
8407 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8413 # Only add $xxx if it isn't already in ccdlflags.
8414 case " $ccdlflags " in
8416 *) ccdlflags="$ccdlflags $xxx"
8419 Adding $xxx to the flags
8420 passed to $ld so that the perl executable will find the
8421 installed shared $libperl.
8429 # Fix ccdlflags in AIX for building external extensions.
8430 # (For building Perl itself bare -bE:perl.exp is needed,
8431 # Makefile.SH takes care of this.)
8433 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8435 # Respect a hint or command-line value.
8437 '') shrpenv="$tmp_shrpenv" ;;
8439 case "$ldlibpthname" in
8440 '') ldlibpthname=LD_LIBRARY_PATH ;;
8441 none) ldlibpthname='' ;;
8444 : determine where manual pages are on this system
8448 syspath='/usr/share/man/man1 /usr/man/man1'
8449 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8450 syspath="$syspath /usr/man/u_man/man1"
8451 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8452 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8453 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8454 sysman=`./loc . /usr/man/man1 $syspath`
8457 if $test -d "$sysman"; then
8458 echo "System manual is in $sysman." >&4
8460 echo "Could not find manual pages in source form." >&4
8463 : determine where manual pages go
8464 set man1dir man1dir none
8468 $spackage has manual pages available in source form.
8472 echo "However, you don't have nroff, so they're probably useless to you."
8474 '') man1dir="none";;
8477 echo "If you don't want the manual sources installed, answer 'none'."
8482 lookpath="$prefixexp/share/man/man1"
8483 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8484 lookpath="$lookpath $prefixexp/man/p_man/man1"
8485 lookpath="$lookpath $prefixexp/man/u_man/man1"
8486 lookpath="$lookpath $prefixexp/man/man.1"
8488 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8489 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8499 rp="Where do the main $spackage manual pages (source) go?"
8501 if $test "X$man1direxp" != "X$ansexp"; then
8512 : What suffix to use on installed man pages
8519 rp="What suffix should be used for the main $spackage man pages?"
8521 '') case "$man1dir" in
8535 *) dflt="$man1ext";;
8542 : see if we can have long filenames
8544 first=123456789abcdef
8546 if (echo hi >$first) 2>/dev/null; then
8547 if $test -f 123456789abcde; then
8548 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8551 echo 'You can have filenames longer than 14 characters.'>&4
8556 You can't have filenames longer than 14 chars.
8557 You can't even think about them!
8563 $rm -rf 123456789abcde*
8565 : determine where library module manual pages go
8566 set man3dir man3dir none
8570 $spackage has manual pages for many of the library modules.
8576 However, you don't have nroff, so they're probably useless to you.
8579 '') man3dir="none";;
8583 case "$d_flexfnam" in
8586 However, your system can't handle the long file names like File::Basename.3.
8589 '') man3dir="none";;
8593 echo "If you don't want the manual sources installed, answer 'none'."
8594 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8596 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8597 if $test -d "$privlib/man/man3"; then
8600 WARNING: Previous versions of perl installed man3 pages into
8601 $privlib/man/man3. This version will suggest a
8602 new default of $dflt.
8606 rp='Do you wish to preserve the old behavior?(y/n)'
8609 y*) dflt="$privlib/man/man3" ;;
8614 *) dflt="$man3dir" ;;
8621 rp="Where do the $package library man pages (source) go?"
8631 : What suffix to use on installed man pages
8637 rp="What suffix should be used for the $package library man pages?"
8639 '') case "$man3dir" in
8653 *) dflt="$man3ext";;
8660 : see if we have to deal with yellow pages, now NIS.
8661 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8662 if $test -f /usr/etc/nibindd; then
8664 echo "I'm fairly confident you're on a NeXT."
8666 rp='Do you get the hosts file via NetInfo?'
8675 y*) hostcat='nidump hosts .';;
8676 *) case "$hostcat" in
8677 nidump*) hostcat='';;
8687 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8695 rp='Are you getting the hosts file via yellow pages?'
8698 y*) hostcat='ypcat hosts';;
8699 *) hostcat='cat /etc/hosts';;
8705 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8708 '') test -f /etc/group && groupcat='cat /etc/group';;
8711 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8714 : now get the host name
8716 echo "Figuring out host name..." >&4
8717 case "$myhostname" in
8719 echo 'Maybe "hostname" will work...'
8720 if tans=`sh -c hostname 2>&1` ; then
8728 if $test "$cont"; then
8730 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8731 if tans=`cat /etc/systemid 2>&1` ; then
8733 phostname='cat /etc/systemid'
8734 echo "Whadyaknow. Xenix always was a bit strange..."
8737 elif $test -r /etc/systemid; then
8738 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8741 if $test "$cont"; then
8742 echo 'No, maybe "uuname -l" will work...'
8743 if tans=`sh -c 'uuname -l' 2>&1` ; then
8745 phostname='uuname -l'
8747 echo 'Strange. Maybe "uname -n" will work...'
8748 if tans=`sh -c 'uname -n' 2>&1` ; then
8750 phostname='uname -n'
8752 echo 'Oh well, maybe I can mine it out of whoami.h...'
8753 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8754 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8755 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8757 case "$myhostname" in
8758 '') echo "Does this machine have an identity crisis or something?"
8761 echo "Well, you said $myhostname before..."
8762 phostname='echo $myhostname';;
8768 case "$myhostname" in
8769 '') myhostname=noname ;;
8771 : you do not want to know about this
8776 if $test "$myhostname" ; then
8778 rp='Your host name appears to be "'$myhostname'".'" Right?"
8786 : bad guess or no guess
8787 while $test "X$myhostname" = X ; do
8789 rp="Please type the (one word) name of your host:"
8794 : translate upper to lower if necessary
8795 case "$myhostname" in
8797 echo "(Normalizing case in your host name)"
8798 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8802 case "$myhostname" in
8804 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8805 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8806 echo "(Trimming domain name from host name--host name is now $myhostname)"
8808 *) case "$mydomain" in
8811 test "X$hostcat" = "Xypcat hosts" &&
8812 ypmatch "$myhostname" hosts 2>/dev/null |\
8813 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8816 test "X$hostcat" != "X" &&
8817 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8818 /[ ]$myhostname[ . ]/p" > hosts
8821 if $test -f hosts; then
8822 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8823 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8824 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8825 hosts | $sort | $uniq | \
8826 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8827 case `$echo X$dflt` in
8828 X*\ *) echo "(Several hosts in the database matched hostname)"
8831 X.) echo "(You do not have fully-qualified names in the hosts database)"
8835 echo "(I cannot locate a hosts database anywhere)"
8840 tans=`./loc resolv.conf X /etc /usr/etc`
8841 if $test -f "$tans"; then
8842 echo "(Attempting domain name extraction from $tans)"
8843 dflt=.`$sed -n -e 's/ / /g' \
8844 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8847 .) dflt=.`$sed -n -e 's/ / /g' \
8848 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8856 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8857 dflt=.`sh -c domainname 2>/dev/null`
8860 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8864 case "$dflt$osname" in
8865 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8866 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8870 .) echo "(Lost all hope -- silly guess then)"
8876 *) dflt="$mydomain";;
8880 rp="What is your domain name?"
8890 : translate upper to lower if necessary
8893 echo "(Normalizing case in your domain name)"
8894 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8898 : a little sanity check here
8899 case "$phostname" in
8902 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8903 $myhostname$mydomain|$myhostname) ;;
8905 case "$phostname" in
8907 echo "(That doesn't agree with your whoami.h file, by the way.)"
8910 echo "(That doesn't agree with your $phostname command, by the way.)"
8918 : determine the e-mail address of the user who is running us
8921 I need to get your e-mail address in Internet format if possible, i.e.
8922 something like user@host.domain. Please answer accurately since I have
8923 no easy means to double check it. The default value provided below
8924 is most probably close to reality but may not be valid from outside
8925 your organization...
8929 while test "$cont"; do
8930 case "$MAILDOMAIN" in
8932 if $test -s /etc/mailname; then
8933 maildomain=`$cat /etc/mailname`
8935 maildomain="$myhostname$mydomain"
8938 *) maildomain="$MAILDOMAIN";;
8941 '') dflt="$cf_by@$maildomain";;
8942 *) dflt="$cf_email";;
8944 rp='What is your e-mail address?'
8950 rp='Address does not look like an Internet one. Use it anyway?'
8964 : Ask e-mail of administrator
8967 If you or somebody else will be maintaining perl at your site, please
8968 fill in the correct e-mail address here so that they may be contacted
8969 if necessary. Currently, the "perlbug" program included with perl
8970 will send mail to this address in addition to perlbug@perl.org. You may
8971 enter "none" for no administrator.
8974 case "$perladmin" in
8975 '') dflt="$cf_email";;
8976 *) dflt="$perladmin";;
8978 rp='Perl administrator e-mail address'
8982 : determine whether to only install version-specific parts.
8985 Do you want to install only the version-specific parts of the perl
8986 distribution? Usually you do *not* want to do this.
8988 case "$versiononly" in
8989 "$define"|[Yy]*|true) dflt='y' ;;
8992 rp="Do you want to install only the version-specific parts of perl?"
8995 [yY]*) val="$define";;
9001 case "$versiononly" in
9002 "$define") inc_version_list=''
9003 inc_version_list_init=0
9007 : figure out how to guarantee perl startup
9008 : XXX Note that this currently takes advantage of the bug that binexp ignores
9009 : the Configure -Dinstallprefix setting, which in turn means that under
9010 : relocatable @INC, initialinstalllocation is what binexp started as.
9011 case "$startperl" in
9013 case "$sharpbang" in
9017 I can use the #! construct to start perl on your system. This will
9018 make startup of perl scripts faster, but may cause problems if you
9019 want to share those scripts and perl is not in a standard place
9020 ($initialinstalllocation/perl) on all your platforms. The alternative
9021 is to force a shell by starting the script with a single ':' character.
9024 case "$versiononly" in
9025 "$define") dflt="$initialinstalllocation/perl$version";;
9026 *) dflt="$initialinstalllocation/perl";;
9028 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9031 none) startperl=": # use perl";;
9032 *) startperl="#!$ans"
9033 if $test 30 -lt `echo "$ans" | wc -c`; then
9036 WARNING: Some systems limit the #! command to 32 characters.
9037 If you experience difficulty running Perl scripts with #!, try
9038 installing Perl in a directory with a shorter pathname.
9044 *) startperl=": # use perl"
9049 echo "I'll use $startperl to start perl scripts."
9051 : figure best path for perl in scripts
9054 case "$versiononly" in
9055 "$define") perlpath="$initialinstalllocation/perl$version";;
9056 *) perlpath="$initialinstalllocation/perl";;
9058 case "$startperl" in
9063 I will use the "eval 'exec'" idiom to start Perl on your system.
9064 I can use the full path of your Perl binary for this purpose, but
9065 doing so may cause problems if you want to share those scripts and
9066 Perl is not always in a standard place ($initialinstalllocation/perl).
9069 dflt="$initialinstalllocation/perl"
9070 rp="What path shall I use in \"eval 'exec'\"?"
9077 case "$startperl" in
9079 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9082 : determine where public executable scripts go
9083 set scriptdir scriptdir
9085 case "$scriptdir" in
9088 : guess some guesses
9089 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9090 $test -d /usr/share/bin && dflt=/usr/share/bin
9091 $test -d /usr/local/script && dflt=/usr/local/script
9092 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9093 $test -d $prefixexp/script && dflt=$prefixexp/script
9097 *) dflt="$scriptdir"
9102 Some installations have a separate directory just for executable scripts so
9103 that they can mount it across multiple architectures but keep the scripts in
9104 one spot. You might, for example, have a subdirectory of /usr/share for this.
9105 Or you might just lump your scripts in with all your other executables.
9109 rp='Where do you keep publicly executable scripts?'
9111 if $test "X$ansexp" != "X$scriptdirexp"; then
9117 : A little fix up for an irregularly named variable.
9118 installscript="$installscriptdir"
9120 : determine where add-on public executables go
9122 '') dflt=$siteprefix/bin ;;
9126 rp='Pathname where the add-on public executables should be installed?'
9131 : determine where add-on html pages go
9132 : There is no standard location, so try to copy the previously-selected
9133 : directory structure for the core html pages.
9134 case "$sitehtml1dir" in
9135 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9136 *) dflt=$sitehtml1dir ;;
9139 ''|' ') dflt=none ;;
9142 rp='Pathname where the site-specific html pages should be installed?'
9144 prefixvar=sitehtml1dir
9147 : determine where add-on library html pages go
9148 : There is no standard location, so try to copy the previously-selected
9149 : directory structure for the core html pages.
9150 case "$sitehtml3dir" in
9151 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9152 *) dflt=$sitehtml3dir ;;
9155 ''|' ') dflt=none ;;
9158 rp='Pathname where the site-specific library html pages should be installed?'
9160 prefixvar=sitehtml3dir
9163 : determine where add-on manual pages go
9164 case "$siteman1dir" in
9165 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9166 *) dflt=$siteman1dir ;;
9169 ''|' ') dflt=none ;;
9172 rp='Pathname where the site-specific manual pages should be installed?'
9174 prefixvar=siteman1dir
9177 : determine where add-on library man pages go
9178 case "$siteman3dir" in
9179 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9180 *) dflt=$siteman3dir ;;
9183 ''|' ') dflt=none ;;
9186 rp='Pathname where the site-specific library manual pages should be installed?'
9188 prefixvar=siteman3dir
9191 : determine where add-on public executable scripts go
9192 case "$sitescript" in
9193 '') dflt=$siteprefix/script
9194 $test -d $dflt || dflt=$sitebin ;;
9195 *) dflt="$sitescript" ;;
9198 rp='Pathname where add-on public executable scripts should be installed?'
9200 prefixvar=sitescript
9203 : Check if faststdio is requested and available
9204 case "$usefaststdio" in
9205 $define|true|[yY]*|'')
9206 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9216 Perl can be built to use 'fast stdio', which means using the stdio
9217 library but also directly manipulating the stdio buffers to enable
9218 faster I/O. Using stdio is better for backward compatibility (especially
9219 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9220 interface has been preferred instead of stdio.
9222 If this doesn't make any sense to you, just accept the default '$dflt'.
9224 rp='Use the "fast stdio" if available?'
9227 y|Y) val="$define" ;;
9234 : define an is-a-typedef? function
9235 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9237 "") inclist="sys/types.h";;
9239 eval "varval=\$$var";
9243 for inc in $inclist; do
9244 echo "#include <$inc>" >>temp.c;
9246 echo "#ifdef $type" >> temp.c;
9247 echo "printf(\"We have $type\");" >> temp.c;
9248 echo "#endif" >> temp.c;
9249 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9250 if $contains $type temp.E >/dev/null 2>&1; then
9256 *) eval "$var=\$varval";;
9259 : define an is-a-typedef? function that prompts if the type is not available.
9260 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9262 "") inclist="sys/types.h";;
9264 eval "varval=\$$var";
9268 for inc in $inclist; do
9269 echo "#include <$inc>" >>temp.c;
9271 echo "#ifdef $type" >> temp.c;
9272 echo "printf(\"We have $type\");" >> temp.c;
9273 echo "#endif" >> temp.c;
9274 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9276 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9277 if $contains $type temp.E >/dev/null 2>&1; then
9278 echo "$type found." >&4;
9281 echo "$type NOT found." >&4;
9287 *) eval "$var=\$varval";;
9290 : see what type lseek is declared as in the kernel
9291 rp="What is the type used for lseek's offset on this system?"
9292 set off_t lseektype long stdio.h sys/types.h
9296 echo "Checking to see how big your file offsets are..." >&4
9298 #include <sys/types.h>
9302 printf("%d\n", (int)sizeof($lseektype));
9307 if eval $compile_ok; then
9308 lseeksize=`$run ./try`
9309 echo "Your file offsets are $lseeksize bytes long."
9313 echo "(I can't seem to compile the test program. Guessing...)"
9314 rp="What is the size of your file offsets (in bytes)?"
9320 : see what type file positions are declared as in the library
9321 rp="What is the type for file position used by fsetpos()?"
9322 set fpos_t fpostype long stdio.h sys/types.h
9325 : Check size for Fpos_t
9328 *_t) zzz="$fpostype" ;;
9331 echo "Checking the size of $zzz..." >&4
9333 #include <sys/types.h>
9340 printf("%d\n", (int)sizeof($fpostype));
9345 if eval $compile_ok; then
9349 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9352 echo "Your $zzz is $fpossize bytes long."
9358 echo "(I can't compile the test program. Guessing...)" >&4
9359 rp="What is the size of your file positions (in bytes)?"
9364 : Check for large file support
9365 # Backward compatibility (uselfs is deprecated).
9367 "$define"|true|[yY]*)
9370 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9372 uselargefiles="$define"
9376 case "$lseeksize:$fpossize" in
9379 You can have files larger than 2 gigabytes.
9382 *) case "$uselargefiles" in
9383 "$undef"|false|[nN]*) dflt='n' ;;
9388 Perl can be built to understand large files (files larger than 2 gigabytes)
9389 on some systems. To do so, Configure can be run with -Duselargefiles.
9391 If this doesn't make any sense to you, just accept the default '$dflt'.
9393 rp='Try to understand large files, if available?'
9396 y|Y) val="$define" ;;
9403 : Look for a hint-file generated 'call-back-unit'. If the
9404 : user has specified that a large files perl is to be built,
9405 : we may need to set or change some other defaults.
9406 if $test -f uselargefiles.cbu; then
9407 echo "Your platform has some specific hints regarding large file builds, using them..."
9408 . ./uselargefiles.cbu
9410 case "$uselargefiles" in
9412 if $test -f uselargefiles.cbu; then
9414 echo "Rechecking to see how big your file offsets are..." >&4
9416 #include <sys/types.h>
9420 printf("%d\n", (int)sizeof($lseektype));
9425 if eval $compile_ok; then
9426 lseeksize=`$run ./try`
9427 $echo "Your file offsets are now $lseeksize bytes long."
9431 echo "(I can't seem to compile the test program. Guessing...)"
9432 rp="What is the size of your file offsets (in bytes)?"
9437 *_t) zzz="$fpostype" ;;
9440 $echo $n "Rechecking the size of $zzz...$c" >&4
9442 #include <sys/types.h>
9449 printf("%d\n", (int)sizeof($fpostype));
9454 if eval $compile_ok; then
9459 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9462 echo " $fpossize bytes." >&4
9468 echo "(I can't compile the test program. Guessing...)" >&4
9469 rp="What is the size of your file positions (in bytes)?"
9478 : Check if we want perlio
9481 : Set the vendorbin variables
9482 case "$vendorprefix" in
9483 '') d_vendorbin="$undef"
9487 *) d_vendorbin="$define"
9488 : determine where vendor-supplied executables go.
9489 case "$vendorbin" in
9490 '') dflt=$vendorprefix/bin ;;
9491 *) dflt="$vendorbin" ;;
9494 rp='Pathname for the vendor-supplied executables directory?'
9497 vendorbinexp="$ansexp"
9503 : Set the vendorhtml1dir variables
9504 case "$vendorprefix" in
9505 '') vendorhtml1dir=''
9506 vendorhtml1direxp=''
9508 *) : determine where vendor-supplied html pages go.
9509 : There is no standard location, so try to copy the previously-selected
9510 : directory structure for the core html pages.
9511 : XXX Better default suggestions would be welcome.
9512 case "$vendorhtml1dir" in
9513 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9514 *) dflt=$vendorhtml1dir ;;
9517 ''|' ') dflt=none ;;
9520 rp='Pathname for the vendor-supplied html pages?'
9522 vendorhtml1dir="$ans"
9523 vendorhtml1direxp="$ansexp"
9526 : Use ' ' for none so value is preserved next time through Configure
9527 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9528 prefixvar=vendorhtml1dir
9531 : Set the vendorhtml3dir variables
9532 case "$vendorprefix" in
9533 '') vendorhtml3dir=''
9534 vendorhtml3direxp=''
9536 *) : determine where vendor-supplied module html pages go.
9537 : There is no standard location, so try to copy the previously-selected
9538 : directory structure for the core html pages.
9539 : XXX Better default suggestions would be welcome.
9540 case "$vendorhtml3dir" in
9541 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9542 *) dflt=$vendorhtml3dir ;;
9545 ''|' ') dflt=none ;;
9548 rp='Pathname for the vendor-supplied html pages?'
9550 vendorhtml3dir="$ans"
9551 vendorhtml3direxp="$ansexp"
9554 : Use ' ' for none so value is preserved next time through Configure
9555 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9556 prefixvar=vendorhtml3dir
9559 : Set the vendorman1dir variables
9560 case "$vendorprefix" in
9561 '') vendorman1dir=''
9564 *) : determine where vendor-supplied manual pages go.
9565 case "$vendorman1dir" in
9566 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9567 *) dflt=$vendorman1dir ;;
9570 ''|' ') dflt=none ;;
9573 rp='Pathname for the vendor-supplied manual section 1 pages?'
9575 vendorman1dir="$ans"
9576 vendorman1direxp="$ansexp"
9579 : Use ' ' for none so value is preserved next time through Configure
9580 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9581 prefixvar=vendorman1dir
9584 : Set the vendorman3dir variables
9585 case "$vendorprefix" in
9586 '') vendorman3dir=''
9589 *) : determine where vendor-supplied module manual pages go.
9590 case "$vendorman3dir" in
9591 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9592 *) dflt=$vendorman3dir ;;
9595 ''|' ') dflt=none ;;
9598 rp='Pathname for the vendor-supplied manual section 3 pages?'
9600 vendorman3dir="$ans"
9601 vendorman3direxp="$ansexp"
9604 : Use ' ' for none so value is preserved next time through Configure
9605 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9606 prefixvar=vendorman3dir
9609 : Set the vendorscript variables
9610 case "$vendorprefix" in
9611 '') d_vendorscript="$undef"
9615 *) d_vendorscript="$define"
9616 : determine where vendor-supplied scripts go.
9617 case "$vendorscript" in
9618 '') dflt=$vendorprefix/script
9619 $test -d $dflt || dflt=$vendorbin ;;
9620 *) dflt="$vendorscript" ;;
9624 The installation process will create a directory for
9625 vendor-supplied scripts.
9629 rp='Pathname for the vendor-supplied scripts directory?'
9632 vendorscriptexp="$ansexp"
9635 prefixvar=vendorscript
9638 : script used to emit important warnings
9641 if test \$# -gt 0; then
9646 echo "*** WARNING:" >&4
9647 sed -e 's/^/*** /' <msg >&4
9649 cat msg >>config.msg
9650 echo " " >>config.msg
9656 : see which of string.h or strings.h is needed
9658 strings=`./findhdr string.h`
9659 if $test "$strings" && $test -r "$strings"; then
9660 echo "Using <string.h> instead of <strings.h>." >&4
9664 strings=`./findhdr strings.h`
9665 if $test "$strings" && $test -r "$strings"; then
9666 echo "Using <strings.h> instead of <string.h>." >&4
9668 ./warn "No string header found -- You'll surely have problems."
9674 "$undef") strings=`./findhdr strings.h`;;
9675 *) strings=`./findhdr string.h`;;
9678 : see if qgcvt exists
9682 : Check print/scan long double stuff
9685 if $test X"$d_longdbl" = X"$define"; then
9687 echo "Checking how to print long doubles..." >&4
9689 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9690 $cat >try.c <<'EOCP'
9691 #include <sys/types.h>
9695 printf("%.3f\n", d);
9699 if eval $compile; then
9703 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9704 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9705 echo "We will use %f."
9711 if $test X"$sPRIfldbl" = X; then
9712 $cat >try.c <<'EOCP'
9713 #include <sys/types.h>
9716 long double d = 123.456;
9717 printf("%.3Lf\n", d);
9721 if eval $compile; then
9725 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9726 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9727 echo "We will use %Lf."
9733 if $test X"$sPRIfldbl" = X; then
9734 $cat >try.c <<'EOCP'
9735 #include <sys/types.h>
9738 long double d = 123.456;
9739 printf("%.3llf\n", d);
9743 if eval $compile; then
9747 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9748 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9749 echo "We will use %llf."
9755 if $test X"$sPRIfldbl" = X; then
9756 $cat >try.c <<'EOCP'
9757 #include <sys/types.h>
9760 long double d = 123.456;
9761 printf("%.3lf\n", d);
9765 if eval $compile; then
9769 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9770 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9771 echo "We will use %lf."
9777 if $test X"$sPRIfldbl" = X; then
9778 echo "Cannot figure out how to print long doubles." >&4
9780 sSCNfldbl=$sPRIfldbl # expect consistency
9787 case "$sPRIfldbl" in
9788 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9789 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9790 d_SCNfldbl="$undef";
9792 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9793 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9794 d_SCNfldbl="$define";
9798 : Check how to convert floats to strings.
9800 if test "X$d_Gconvert" = X; then
9803 echo "Checking for an efficient way to convert floats to strings."
9805 case "$uselongdouble" in
9806 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9808 case "$d_longdbl" in
9809 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9811 case "$d_PRIgldbl" in
9812 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9816 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9817 char *myname = "gconvert";
9820 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9821 char *myname = "gcvt";
9824 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9825 char *myname = "qgcvt";
9826 #define DOUBLETYPE long double
9829 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9831 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9833 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9836 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9838 char *myname = "sprintf";
9842 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9843 #define DOUBLETYPE long double
9845 #define DOUBLETYPE double
9857 # include <string.h>
9859 # include <strings.h>
9862 int checkit(char *expect, char *got)
9864 if (strcmp(expect, got)) {
9865 printf("%s oddity: Expected %s, got %s\n",
9866 myname, expect, got);
9876 /* This must be 1st test on (which?) platform */
9877 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9878 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9879 checkit("0.1", buf);
9881 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9882 checkit("0.01", buf);
9884 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9885 checkit("0.001", buf);
9887 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9888 checkit("0.0001", buf);
9890 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9891 if (strlen(buf) > 5)
9892 checkit("9e-005", buf); /* for Microsoft ?? */
9894 checkit("9e-05", buf);
9896 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9899 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9900 checkit("1.1", buf);
9902 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9903 checkit("1.01", buf);
9905 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9906 checkit("1.001", buf);
9908 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9909 checkit("1.0001", buf);
9911 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9912 checkit("1.00001", buf);
9914 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9915 checkit("1.000001", buf);
9917 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9920 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9923 /* Some Linux gcvt's give 1.e+5 here. */
9924 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9925 checkit("100000", buf);
9927 /* Some Linux gcvt's give -1.e+5 here. */
9928 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9929 checkit("-100000", buf);
9931 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9932 checkit("123.456", buf);
9934 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9935 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9936 /* 34 should be enough to scare even long double
9937 * places into using the e notation. */
9938 if (strlen(buf) > 5)
9939 checkit("1e+034", buf); /* for Microsoft */
9941 checkit("1e+34", buf);
9943 /* For Perl, if you add additional tests here, also add them to
9944 * t/base/num.t for benefit of platforms not using Configure or
9945 * overriding d_Gconvert */
9950 : first add preferred functions to our list
9952 for xxx_convert in $gconvert_preference; do
9953 case $xxx_convert in
9954 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9955 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9958 : then add any others
9959 for xxx_convert in gconvert gcvt sprintf; do
9962 *) xxx_list="$xxx_list $xxx_convert" ;;
9966 case "$d_longdbl$uselongdouble" in
9968 : again, add preferred functions to our list first
9970 for xxx_convert in $gconvert_ld_preference; do
9971 case $xxx_convert in
9972 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9973 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9976 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9977 for xxx_convert in qgcvt sprintf $xxx_list; do
9978 case "$xxx_ld_list" in
9979 $xxx_convert*|*" $xxx_convert"*) ;;
9980 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9983 : if sprintf cannot do long doubles, move it to the end
9984 if test "$d_PRIgldbl" != "$define"; then
9985 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9987 : if no qgcvt, remove it
9988 if test "$d_qgcvt" != "$define"; then
9989 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9992 xxx_list="$xxx_ld_list"
9996 for xxx_convert in $xxx_list; do
9997 echo "Trying $xxx_convert..."
9998 $rm -f try try$_o core
9999 set try -DTRY_$xxx_convert
10000 if eval $compile; then
10001 echo "$xxx_convert() found." >&4
10002 if $run ./try; then
10003 echo "I'll use $xxx_convert to convert floats into a string." >&4
10006 echo "...But $xxx_convert didn't work as I expected."
10010 echo "$xxx_convert NOT found." >&4
10014 if test X$xxx_convert = X; then
10015 echo "*** WHOA THERE!!! ***" >&4
10016 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10017 xxx_convert=sprintf
10020 case "$xxx_convert" in
10021 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10022 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10023 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10024 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10025 "$define$define$define")
10026 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10027 "$define$define$undef")
10028 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10029 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10037 : see if _fwalk exists
10041 : Initialize h_fcntl
10044 : Initialize h_sysfile
10047 : access call always available on UNIX
10048 set access d_access
10051 : locate the flags for 'access()'
10052 case "$d_access" in
10055 $cat >access.c <<EOCP
10056 #include <sys/types.h>
10061 #include <sys/file.h>
10064 #include <unistd.h>
10066 #$i_stdlib I_STDLIB
10068 #include <stdlib.h>
10074 : check sys/file.h first, no particular reason here
10075 if $test `./findhdr sys/file.h` && \
10076 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10078 echo "<sys/file.h> defines the *_OK access constants." >&4
10079 elif $test `./findhdr fcntl.h` && \
10080 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10082 echo "<fcntl.h> defines the *_OK access constants." >&4
10083 elif $test `./findhdr unistd.h` && \
10084 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10085 echo "<unistd.h> defines the *_OK access constants." >&4
10087 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10093 : see if accessx exists
10094 set accessx d_accessx
10097 : see if aintl exists
10101 : see if alarm exists
10105 : see if 64bit time functions exists
10107 set ctime64 d_ctime64
10110 set localtime64 d_localtime64
10113 set gmtime64 d_gmtime64
10116 set mktime64 d_mktime64
10119 set difftime64 d_difftime64
10122 set asctime64 d_asctime64
10125 : see if POSIX threads are available
10126 set pthread.h i_pthread
10129 : define a function to check prototypes
10130 $cat > protochk <<EOSH
10133 optimize="$optimize"
10135 prototype="$prototype"
10138 usethreads=$usethreads
10139 i_pthread=$i_pthread
10140 pthread_h_first=$pthread_h_first
10143 $cat >> protochk <<'EOSH'
10148 while test $# -ge 2; do
10150 $define) echo "#include <$2>" >> try.c ;;
10151 literal) echo "$2" >> try.c ;;
10153 # Extra magic for the benefit of systems that need pthread.h
10154 # to be included early to correctly detect threadsafe functions.
10155 # Such functions must guarantee themselves, though, that the usethreads
10156 # and i_pthread have been defined, before calling protochk.
10157 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10158 echo "#include <pthread.h>" >> try.c
10163 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10164 cat >> try.c <<'EOCP'
10165 #ifdef CAN_PROTOTYPE
10166 #define _(args) args
10171 echo "$foo" >> try.c
10172 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10173 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10179 $eunicefix protochk
10181 : Define hasproto macro for Configure internal use
10182 hasproto='varname=$1; func=$2; shift; shift;
10183 while $test $# -ge 2; do
10185 $define) echo "#include <$2>";;
10189 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10190 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10191 echo "$func() prototype found.";
10194 echo "$func() prototype NOT found.";
10201 : see if sys/types.h has to be included
10202 set sys/types.h i_systypes
10205 : see if sys/select.h has to be included
10206 set sys/select.h i_sysselct
10209 : Define hasfield macro for Configure internal use
10210 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10211 while $test $# -ge 2; do
10213 $define) echo "#include <$2>";;
10217 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10219 if eval $compile; then
10228 : see if we should include time.h, sys/time.h, or both
10230 if test "X$timeincl" = X; then
10231 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10232 $echo $n "I'm now running the test program...$c"
10234 #include <sys/types.h>
10239 #ifdef SYSTIMEKERNEL
10242 #include <sys/time.h>
10245 #include <sys/select.h>
10247 #$i_stdlib I_STDLIB
10249 #include <stdlib.h>
10255 struct timeval bar;
10258 struct timezone tzp;
10260 if (foo.tm_sec == foo.tm_sec)
10263 if (bar.tv_sec == bar.tv_sec)
10270 for s_timezone in '-DS_TIMEZONE' ''; do
10272 for s_timeval in '-DS_TIMEVAL' ''; do
10273 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10274 for i_time in '' '-DI_TIME'; do
10275 for i_systime in '-DI_SYSTIME' ''; do
10278 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10279 if eval $compile; then
10280 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10284 $echo $n "Succeeded with $flags$c"
10296 *SYSTIMEKERNEL*) i_systimek="$define"
10297 timeincl=`./findhdr sys/time.h`
10298 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10299 *) i_systimek="$undef";;
10302 *I_TIME*) i_time="$define"
10303 timeincl=`./findhdr time.h`" $timeincl"
10304 echo "We'll include <time.h>." >&4;;
10305 *) i_time="$undef";;
10308 *I_SYSTIME*) i_systime="$define"
10309 timeincl=`./findhdr sys/time.h`" $timeincl"
10310 echo "We'll include <sys/time.h>." >&4;;
10311 *) i_systime="$undef";;
10315 : see if struct tm knows about tm_zone
10316 case "$i_systime$i_time" in
10319 echo "Checking to see if your struct tm has tm_zone field..." >&4
10320 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10328 case "$d_tm_tm_zone" in
10329 "$define") echo "Yes, it does." ;;
10330 *) echo "No, it doesn't." ;;
10332 : see if struct tm knows about tm_gmtoff
10333 case "$i_systime$i_time" in
10336 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10337 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10345 case "$d_tm_tm_gmtoff" in
10346 "$define") echo "Yes, it does." ;;
10347 *) echo "No, it doesn't." ;;
10350 : see if asctime_r exists
10351 set asctime_r d_asctime_r
10353 case "$d_asctime_r" in
10355 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10356 case "$d_asctime_r_proto:$usethreads" in
10357 ":define") d_asctime_r_proto=define
10358 set d_asctime_r_proto asctime_r $hdrs
10362 case "$d_asctime_r_proto" in
10364 case "$asctime_r_proto" in
10365 ''|0) try='char* asctime_r(const struct tm*, char*);'
10366 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10368 case "$asctime_r_proto" in
10369 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10370 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10372 case "$asctime_r_proto" in
10373 ''|0) try='int asctime_r(const struct tm*, char*);'
10374 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10376 case "$asctime_r_proto" in
10377 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10378 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10380 case "$asctime_r_proto" in
10381 ''|0) d_asctime_r=undef
10383 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10384 * ) case "$asctime_r_proto" in
10385 REENTRANT_PROTO*) ;;
10386 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10388 echo "Prototype: $try" ;;
10391 *) case "$usethreads" in
10392 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10399 *) asctime_r_proto=0
10403 : see if atolf exists
10407 : see if atoll exists
10411 : Look for GCC-style attribute format
10412 case "$d_attribute_format" in
10415 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10416 $cat >attrib.c <<'EOCP'
10418 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10420 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10421 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10422 echo "Your C compiler doesn't support __attribute__((format))."
10425 echo "Your C compiler supports __attribute__((format))."
10429 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10433 *) val="$d_attribute_format" ;;
10435 set d_attribute_format
10439 : Look for GCC-style attribute format with null format allowed
10440 case "$d_printf_format_null" in
10441 '') case "$d_attribute_format" in
10444 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10445 $cat >attrib.c <<EOCP
10447 #$i_stdlib I_STDLIB
10449 #include <stdlib.h>
10451 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10452 int null_printf (char* pat,...) { return (int)pat; }
10453 int main () { exit(null_printf(NULL)); }
10455 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10456 : run the executable in case it produces a run-time warning
10457 if $run ./attrib >>attrib.out 2>&1; then
10458 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10459 echo "Your C compiler doesn't allow __printf__ format to be null."
10462 echo "Your C compiler allows __printf__ format to be null."
10466 echo "Your C compiler executable failed with __printf__ format null."
10470 echo "Your C compiler fails with __printf__ format null."
10477 *) val="$d_printf_format_null" ;;
10479 set d_printf_format_null
10483 : Look for GCC-style attribute malloc
10484 case "$d_attribute_malloc" in
10487 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10488 $cat >attrib.c <<'EOCP'
10490 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10492 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10493 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10494 echo "Your C compiler doesn't support __attribute__((malloc))."
10497 echo "Your C compiler supports __attribute__((malloc))."
10501 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10505 *) val="$d_attribute_malloc" ;;
10507 set d_attribute_malloc
10511 : Look for GCC-style attribute nonnull
10512 case "$d_attribute_nonnull" in
10515 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10516 $cat >attrib.c <<'EOCP'
10518 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10520 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10521 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10522 echo "Your C compiler doesn't support __attribute__((nonnull))."
10525 echo "Your C compiler supports __attribute__((nonnull))."
10529 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10533 *) val="$d_attribute_nonnull" ;;
10535 set d_attribute_nonnull
10539 : Look for GCC-style attribute noreturn
10540 case "$d_attribute_noreturn" in
10543 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10544 $cat >attrib.c <<'EOCP'
10546 void fall_over_dead( void ) __attribute__((noreturn));
10548 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10549 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10550 echo "Your C compiler doesn't support __attribute__((noreturn))."
10553 echo "Your C compiler supports __attribute__((noreturn))."
10557 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10561 *) val="$d_attribute_noreturn" ;;
10563 set d_attribute_noreturn
10567 : Look for GCC-style attribute pure
10568 case "$d_attribute_pure" in
10571 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10572 $cat >attrib.c <<'EOCP'
10574 int square( int n ) __attribute__((pure));
10576 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10577 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10578 echo "Your C compiler doesn't support __attribute__((pure))."
10581 echo "Your C compiler supports __attribute__((pure))."
10585 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10589 *) val="$d_attribute_pure" ;;
10591 set d_attribute_pure
10595 : Look for GCC-style attribute unused
10596 case "$d_attribute_unused" in
10599 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10600 $cat >attrib.c <<'EOCP'
10602 int do_something( int dummy __attribute__((unused)), int n );
10604 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10605 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10606 echo "Your C compiler doesn't support __attribute__((unused))."
10609 echo "Your C compiler supports __attribute__((unused))."
10613 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10617 *) val="$d_attribute_unused" ;;
10619 set d_attribute_unused
10623 : Look for GCC-style attribute deprecated
10624 case "$d_attribute_deprecated" in
10627 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10628 $cat >attrib.c <<'EOCP'
10630 int I_am_deprecated(void) __attribute__((deprecated));
10632 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10633 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10634 echo "Your C compiler doesn't support __attribute__((deprecated))."
10637 echo "Your C compiler supports __attribute__((deprecated))."
10641 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10645 *) val="$d_attribute_deprecated" ;;
10647 set d_attribute_deprecated
10651 : Look for GCC-style attribute warn_unused_result
10652 case "$d_attribute_warn_unused_result" in
10655 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10656 $cat >attrib.c <<'EOCP'
10658 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10660 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10661 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10662 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10665 echo "Your C compiler supports __attribute__((warn_unused_result))."
10669 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10673 *) val="$d_attribute_warn_unused_result" ;;
10675 set d_attribute_warn_unused_result
10679 : see if bcmp exists
10683 : see if bcopy exists
10687 : see if getpgrp exists
10688 set getpgrp d_getpgrp
10691 case "$d_getpgrp" in
10694 echo "Checking to see which flavor of getpgrp is in use..."
10696 #$i_unistd I_UNISTD
10697 #include <sys/types.h>
10699 # include <unistd.h>
10701 #$i_stdlib I_STDLIB
10703 #include <stdlib.h>
10707 if (getuid() == 0) {
10708 printf("(I see you are running Configure as super-user...)\n");
10711 #ifdef TRY_BSD_PGRP
10712 if (getpgrp(1) == 0)
10721 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10722 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10724 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10725 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10728 echo "I can't seem to compile and run the test program."
10730 xxx="a USG one, i.e. you use getpgrp()."
10732 # SVR4 systems can appear rather BSD-ish.
10733 case "$i_unistd" in
10735 xxx="a BSD one, i.e. you use getpgrp(pid)."
10739 xxx="probably a USG one, i.e. you use getpgrp()."
10744 echo "Assuming your getpgrp is $xxx" >&4
10753 : see if setpgrp exists
10754 set setpgrp d_setpgrp
10757 case "$d_setpgrp" in
10760 echo "Checking to see which flavor of setpgrp is in use..."
10762 #$i_unistd I_UNISTD
10763 #include <sys/types.h>
10765 # include <unistd.h>
10767 #$i_stdlib I_STDLIB
10769 #include <stdlib.h>
10773 if (getuid() == 0) {
10774 printf("(I see you are running Configure as super-user...)\n");
10777 #ifdef TRY_BSD_PGRP
10778 if (-1 == setpgrp(1, 1))
10781 if (setpgrp() != -1)
10787 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10788 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10790 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10791 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10794 echo "(I can't seem to compile and run the test program.)"
10796 xxx="a USG one, i.e. you use setpgrp()."
10798 # SVR4 systems can appear rather BSD-ish.
10799 case "$i_unistd" in
10801 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10805 xxx="probably a USG one, i.e. you use setpgrp()."
10810 echo "Assuming your setpgrp is $xxx" >&4
10819 : Look for GCC-style __builtin_choose_expr
10820 case "$d_builtin_choose_expr" in
10823 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10824 $cat >try.c <<'EOCP'
10825 #include <assert.h>
10826 #include <stdlib.h>
10829 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10832 assert( SYRINX(1) == 2112 );
10833 assert( SYRINX(1) != 5150 );
10834 assert( SYRINX(0) == 5150 );
10835 assert( SYRINX(0) != 2112 );
10836 puts( "All good!" );
10842 if eval $compile && $run ./try; then
10843 echo "Your C compiler supports __builtin_choose_expr."
10846 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10850 *) val="$d_builtin_choose_expr" ;;
10853 set d_builtin_choose_expr
10857 : Look for GCC-style __builtin_expect
10858 case "$d_builtin_expect" in
10861 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10862 $cat >try.c <<'EOCP'
10865 if ( __builtin_expect(n, 0) ) n = 1;
10866 /* Remember shell exit code truth is 0, C truth is non-zero */
10871 if eval $compile && $run ./try; then
10872 echo "Your C compiler supports __builtin_expect."
10875 echo "Your C compiler doesn't seem to understand __builtin_expect."
10879 *) val="$d_builtin_expect" ;;
10882 set d_builtin_expect
10886 : see if bzero exists
10890 : see if stdarg is available
10892 if $test `./findhdr stdarg.h`; then
10893 echo "<stdarg.h> found." >&4
10896 echo "<stdarg.h> NOT found." >&4
10900 : see if varargs is available
10902 if $test `./findhdr varargs.h`; then
10903 echo "<varargs.h> found." >&4
10905 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10908 : set up the varargs testing programs
10909 $cat > varargs.c <<EOP
10911 #include <stdarg.h>
10914 #include <varargs.h>
10918 int f(char *p, ...)
10932 p = va_arg(ap, char *);
10938 $cat > varargs <<EOP
10940 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10949 : now check which varargs header should be included
10955 if `./varargs I_STDARG`; then
10957 elif `./varargs I_VARARGS`; then
10962 if `./varargs I_VARARGS`; then
10970 echo "*** WHOA THERE!!! ***" >&4
10971 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10972 case "$knowitall" in
10974 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10978 echo "I could not find the definition for va_dcl... You have problems..." >&4
10979 val="$undef"; set i_stdarg; eval $setvar
10980 val="$undef"; set i_varargs; eval $setvar
10985 case "$i_varhdr" in
10987 val="$define"; set i_stdarg; eval $setvar
10988 val="$undef"; set i_varargs; eval $setvar
10991 val="$undef"; set i_stdarg; eval $setvar
10992 val="$define"; set i_varargs; eval $setvar
10995 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10999 : see if the Compiler supports C99 variadic macros
11000 case "$i_stdarg$i_stdlib" in
11002 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11005 #include <stdarg.h>
11007 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11011 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11017 if eval $compile && $run ./try 2>&1 >/dev/null; then
11018 case "`$run ./try`" in
11020 echo "You have C99 variadic macros." >&4
11021 d_c99_variadic_macros="$define"
11024 echo "You don't have functional C99 variadic macros." >&4
11025 d_c99_variadic_macros="$undef"
11029 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11030 d_c99_variadic_macros="$undef"
11035 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11036 d_c99_variadic_macros="$undef"
11040 : see if signal is declared as pointer to function returning int or void
11042 xxx=`./findhdr signal.h`
11043 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11044 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11045 echo "You have int (*signal())() instead of void." >&4
11047 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11048 echo "You have void (*signal())()." >&4
11050 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11051 echo "You have int (*signal())() instead of void." >&4
11053 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11054 echo "You have void (*signal())()." >&4
11057 case "$d_voidsig" in
11059 echo "I can't determine whether signal handler returns void or int..." >&4
11061 rp="What type does your signal handler return?"
11064 v*) val="$define";;
11068 echo "As you already told me, signal handler returns void." >&4
11071 *) echo "As you already told me, signal handler returns int." >&4
11078 case "$d_voidsig" in
11079 "$define") signal_t="void";;
11080 *) signal_t="int";;
11084 : check for ability to cast large floats to 32-bit ints.
11086 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11087 if $test "$intsize" -ge 4; then
11094 #$i_stdlib I_STDLIB
11096 #include <stdlib.h>
11098 #include <sys/types.h>
11099 #include <signal.h>
11100 $signal_t blech(int s) { exit(3); }
11107 signal(SIGFPE, blech);
11109 /* Don't let compiler optimize the test away. Store the number
11110 in a writable string for gcc to pass to sscanf under HP-UX.
11112 sprintf(str, "2147483647");
11113 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11117 /* x86 processors will probably give 0x8000 0000, which is a
11118 sign change. We don't want that. We want to mimic SPARC
11119 behavior here, which is to preserve the sign and give
11122 if (i32 != ($xxx) f)
11128 if eval $compile_ok; then
11132 echo "(I can't seem to compile the test program--assuming it can't)"
11137 echo "Yup, it can."
11140 echo "Nope, it can't."
11147 : check for ability to cast negative floats to unsigned
11149 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11152 #$i_stdlib I_STDLIB
11154 #include <stdlib.h>
11156 #include <sys/types.h>
11157 #include <signal.h>
11158 $signal_t blech(int s) { exit(7); }
11159 $signal_t blech_in_list(int s) { exit(4); }
11160 unsigned long dummy_long(unsigned long p) { return p; }
11161 unsigned int dummy_int(unsigned int p) { return p; }
11162 unsigned short dummy_short(unsigned short p) { return p; }
11166 unsigned long along;
11168 unsigned short ashort;
11172 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11173 a direct f = -123. assignment. gcc-2.8.0 reportedly
11174 optimized the whole file away
11176 /* Store the number in a writable string for gcc to pass to
11177 sscanf under HP-UX.
11179 sprintf(str, "-123");
11180 sscanf(str, "%lf", &f); /* f = -123.; */
11182 signal(SIGFPE, blech);
11183 along = (unsigned long)f;
11184 aint = (unsigned int)f;
11185 ashort = (unsigned short)f;
11186 if (along != (unsigned long)-123)
11188 if (aint != (unsigned int)-123)
11190 if (ashort != (unsigned short)-123)
11192 sprintf(str, "1073741824.");
11193 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11196 along = (unsigned long)f;
11197 if (along != 0x80000000)
11201 along = (unsigned long)f;
11202 if (along != 0x7fffffff)
11206 along = (unsigned long)f;
11207 if (along != 0x80000001)
11211 signal(SIGFPE, blech_in_list);
11212 sprintf(str, "123.");
11213 sscanf(str, "%lf", &f); /* f = 123.; */
11214 along = dummy_long((unsigned long)f);
11215 aint = dummy_int((unsigned int)f);
11216 ashort = dummy_short((unsigned short)f);
11217 if (along != (unsigned long)123)
11219 if (aint != (unsigned int)123)
11221 if (ashort != (unsigned short)123)
11228 if eval $compile_ok; then
11232 echo "(I can't seem to compile the test program--assuming it can't)"
11235 case "$castflags" in
11237 echo "Yup, it can."
11240 echo "Nope, it can't."
11247 : see if vprintf exists
11249 if set vprintf val -f d_vprintf; eval $csym; $val; then
11250 echo 'vprintf() found.' >&4
11253 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11254 #$i_varargs I_VARARGS
11256 #$i_stdlib I_STDLIB
11257 #$i_unistd I_UNISTD
11260 # include <stdarg.h>
11261 #else /* I_VARARGS */
11262 # include <varargs.h>
11266 # include <unistd.h>
11270 # include <stdlib.h>
11273 #include <stdio.h> /* vsprintf prototype */
11276 void xxx(int n, ...)
11281 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11283 int main() { xxx(1, "foo"); }
11285 #else /* I_VARARGS */
11293 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11295 int main() { xxx("foo"); }
11301 if eval $compile_ok; then
11302 if $run ./try; then
11303 echo "Your vsprintf() returns (int)." >&4
11306 echo "Your vsprintf() returns (char*)." >&4
11310 echo 'I am unable to compile the vsprintf() test program.' >&4
11311 # We shouldn't get here. If we do, assume the standard signature,
11312 # not the old BSD one.
11313 echo 'Guessing that vsprintf() returns (int).' >&4
11317 echo 'vprintf() NOT found.' >&4
11328 : see if chown exists
11332 : see if chroot exists
11333 set chroot d_chroot
11336 : see if chsize exists
11337 set chsize d_chsize
11340 : see if class exists
11344 : see if clearenv exists
11345 set clearenv d_clearenv
11348 : Define hasstruct macro for Configure internal use
11349 hasstruct='varname=$1; struct=$2; shift; shift;
11350 while $test $# -ge 2; do
11352 $define) echo "#include <$2>";;
11356 echo "int main () { struct $struct foo; }" >> try.c;
11358 if eval $compile; then
11367 : see whether socket exists
11371 $echo $n "Hmm... $c" >&4
11372 if set socket val -f d_socket; eval $csym; $val; then
11373 echo "Looks like you have Berkeley networking support." >&4
11375 if set setsockopt val -f; eval $csym; $val; then
11378 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11379 d_oldsock="$define"
11382 if $contains socklib libc.list >/dev/null 2>&1; then
11383 echo "Looks like you have Berkeley networking support." >&4
11385 : we will have to assume that it supports the 4.2 BSD interface
11388 echo "You don't have Berkeley networking in libc$_a..." >&4
11389 if test "X$d_socket" = "X$define"; then
11390 echo "...but you seem to believe that you have sockets." >&4
11392 for net in net socket
11394 if test -f /usr/lib/lib$net$_a; then
11395 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11396 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11397 if $contains socket libc.list >/dev/null 2>&1; then
11402 echo "...but the Wollongong group seems to have hacked it in." >&4
11403 sockethdr="-I/usr/netinclude"
11406 echo "Found Berkeley sockets interface in lib$net." >&4
11407 if $contains setsockopt libc.list >/dev/null 2>&1; then
11410 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11411 d_oldsock="$define"
11417 if test "X$d_socket" != "X$define"; then
11418 echo "or anywhere else I see." >&4
11426 : see if socketpair exists
11427 set socketpair d_sockpair
11432 echo "Checking the availability sa_len in the sock struct ..." >&4
11434 #include <sys/types.h>
11435 #include <sys/socket.h>
11437 struct sockaddr sa;
11438 return (sa.sa_len);
11442 set try; if eval $compile; then
11445 set d_sockaddr_sa_len; eval $setvar
11449 echo "Checking the availability struct sockaddr_in6 ..." >&4
11451 #include <sys/types.h>
11452 #include <sys/socket.h>
11453 #include <netinet/in.h>
11455 struct sockaddr_in6 sin6;
11456 return (sin6.sin6_family);
11460 set try; if eval $compile; then
11463 set d_sockaddr_in6; eval $setvar
11467 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11469 #include <sys/types.h>
11470 #include <sys/socket.h>
11471 #include <netinet/in.h>
11473 struct sockaddr_in6 sin6;
11474 return (sin6.sin6_scope_id);
11478 set try; if eval $compile; then
11481 set d_sin6_scope_id; eval $setvar
11485 echo "Checking the availability struct ip_mreq ..." >&4
11487 #include <sys/types.h>
11488 #include <sys/socket.h>
11489 #include <netinet/in.h>
11491 struct ip_mreq mreq;
11492 return (mreq.imr_multiaddr.s_addr);
11496 set try; if eval $compile; then
11499 set d_ip_mreq; eval $setvar
11503 echo "Checking the availability struct ip_mreq_source ..." >&4
11505 #include <sys/types.h>
11506 #include <sys/socket.h>
11507 #include <netinet/in.h>
11509 struct ip_mreq_source mreq;
11510 return (mreq.imr_multiaddr.s_addr);
11514 set try; if eval $compile; then
11517 set d_ip_mreq_source; eval $setvar
11521 echo "Checking the availability struct ipv6_mreq ..." >&4
11523 #include <sys/types.h>
11524 #include <sys/socket.h>
11525 #include <netinet/in.h>
11527 struct ipv6_mreq mreq;
11528 return (mreq.ipv6mr_interface);
11532 set try; if eval $compile; then
11535 set d_ipv6_mreq; eval $setvar
11539 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11541 #include <sys/types.h>
11542 #include <sys/socket.h>
11543 #include <netinet/in.h>
11545 struct ipv6_mreq_source mreq;
11546 return (mreq.imr_multiaddr.s_addr);
11550 set try; if eval $compile; then
11553 set d_ipv6_mreq_source; eval $setvar
11557 echo "Checking the availability of certain socket constants..." >&4
11558 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11559 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11561 #include <sys/types.h>
11562 #include <sys/socket.h>
11568 set try; if eval $compile; then
11571 set d_${enum}; eval $setvar
11575 : see if this is a sys/uio.h system
11576 set sys/uio.h i_sysuio
11579 : Check for cmsghdr support
11581 echo "Checking to see if your system supports struct cmsghdr..." >&4
11582 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11584 case "$d_cmsghdr_s" in
11585 "$define") echo "Yes, it does." ;;
11586 *) echo "No, it doesn't." ;;
11590 : check for const keyword
11592 echo 'Checking to see if your C compiler knows about "const"...' >&4
11593 $cat >const.c <<'EOCP'
11594 typedef struct spug { int drokk; } spug;
11598 const spug y = { 0 };
11601 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11603 echo "Yup, it does."
11606 echo "Nope, it doesn't."
11611 : see if copysignl exists
11612 set copysignl d_copysignl
11615 : see if crypt exists
11620 $define) cryptlib='' ;;
11621 *) if set crypt val -f d_crypt; eval $csym; $val; then
11622 echo 'crypt() found.' >&4
11626 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11627 if $test -z "$cryptlib"; then
11628 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11632 if $test -z "$cryptlib"; then
11633 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11637 if $test -z "$cryptlib"; then
11638 cryptlib=`./loc libcrypt$_a "" $libpth`
11642 if $test -z "$cryptlib"; then
11643 echo 'crypt() NOT found.' >&4
11654 : see if this is a crypt.h system
11655 set crypt.h i_crypt
11658 : see if crypt_r exists
11659 set crypt_r d_crypt_r
11661 case "$d_crypt_r" in
11663 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11664 case "$d_crypt_r_proto:$usethreads" in
11665 ":define") d_crypt_r_proto=define
11666 set d_crypt_r_proto crypt_r $hdrs
11670 case "$d_crypt_r_proto" in
11672 case "$crypt_r_proto" in
11673 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11674 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11676 case "$crypt_r_proto" in
11677 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11678 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11680 case "$crypt_r_proto" in
11681 ''|0) d_crypt_r=undef
11683 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11684 * ) case "$crypt_r_proto" in
11685 REENTRANT_PROTO*) ;;
11686 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11688 echo "Prototype: $try" ;;
11691 *) case "$usethreads" in
11692 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11703 : get csh whereabouts
11705 'csh') val="$undef" ;;
11706 *) val="$define" ;;
11710 : Respect a hint or command line value for full_csh.
11711 case "$full_csh" in
11712 '') full_csh=$csh ;;
11715 : see if ctermid exists
11716 set ctermid d_ctermid
11719 : see if ctermid_r exists
11720 set ctermid_r d_ctermid_r
11722 case "$d_ctermid_r" in
11724 hdrs="$i_systypes sys/types.h define stdio.h "
11725 case "$d_ctermid_r_proto:$usethreads" in
11726 ":define") d_ctermid_r_proto=define
11727 set d_ctermid_r_proto ctermid_r $hdrs
11731 case "$d_ctermid_r_proto" in
11733 case "$ctermid_r_proto" in
11734 ''|0) try='char* ctermid_r(char*);'
11735 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11737 case "$ctermid_r_proto" in
11738 ''|0) d_ctermid_r=undef
11740 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11741 * ) case "$ctermid_r_proto" in
11742 REENTRANT_PROTO*) ;;
11743 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11745 echo "Prototype: $try" ;;
11748 *) case "$usethreads" in
11749 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11756 *) ctermid_r_proto=0
11760 : see if ctime_r exists
11761 set ctime_r d_ctime_r
11763 case "$d_ctime_r" in
11765 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11766 case "$d_ctime_r_proto:$usethreads" in
11767 ":define") d_ctime_r_proto=define
11768 set d_ctime_r_proto ctime_r $hdrs
11772 case "$d_ctime_r_proto" in
11774 case "$ctime_r_proto" in
11775 ''|0) try='char* ctime_r(const time_t*, char*);'
11776 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11778 case "$ctime_r_proto" in
11779 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11780 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11782 case "$ctime_r_proto" in
11783 ''|0) try='int ctime_r(const time_t*, char*);'
11784 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11786 case "$ctime_r_proto" in
11787 ''|0) try='int ctime_r(const time_t*, char*, int);'
11788 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11790 case "$ctime_r_proto" in
11791 ''|0) d_ctime_r=undef
11793 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11794 * ) case "$ctime_r_proto" in
11795 REENTRANT_PROTO*) ;;
11796 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11798 echo "Prototype: $try" ;;
11801 *) case "$usethreads" in
11802 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11813 : see if cuserid exists
11814 set cuserid d_cuserid
11817 : see if this is a limits.h system
11818 set limits.h i_limits
11821 : see if this is a float.h system
11822 set float.h i_float
11825 : See if number of significant digits in a double precision number is known
11827 $cat >dbl_dig.c <<EOM
11828 #$i_limits I_LIMITS
11831 #include <limits.h>
11837 printf("Contains DBL_DIG");
11840 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11841 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11842 echo "DBL_DIG found." >&4
11845 echo "DBL_DIG NOT found." >&4
11852 : see if dbm.h is available
11853 : see if dbmclose exists
11854 set dbmclose d_dbmclose
11857 case "$d_dbmclose" in
11867 *) set rpcsvc/dbm.h i_rpcsvcdbm
11872 *) echo "We won't be including <dbm.h>"
11882 : see if prototype for dbminit is available
11884 set d_dbminitproto dbminit $i_dbm dbm.h
11887 : see if difftime exists
11888 set difftime d_difftime
11891 : see if this is a dirent system
11893 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11895 echo "<dirent.h> found." >&4
11898 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11899 echo "<sys/dir.h> found." >&4
11902 xinc=`./findhdr sys/ndir.h`
11904 echo "<dirent.h> NOT found." >&4
11909 : Look for type of directory structure.
11911 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11913 case "$direntrytype" in
11915 case "$i_dirent" in
11916 $define) guess1='struct dirent' ;;
11917 *) guess1='struct direct' ;;
11920 *) guess1="$direntrytype"
11925 'struct dirent') guess2='struct direct' ;;
11926 *) guess2='struct dirent' ;;
11929 if $contains "$guess1" try.c >/dev/null 2>&1; then
11930 direntrytype="$guess1"
11931 echo "Your directory entries are $direntrytype." >&4
11932 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11933 direntrytype="$guess2"
11934 echo "Your directory entries seem to be $direntrytype." >&4
11936 echo "I don't recognize your system's directory entries." >&4
11937 rp="What type is used for directory entries on this system?"
11940 direntrytype="$ans"
11944 : see if the directory entry stores field length
11946 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11947 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11948 echo "Good, your directory entry keeps length information in d_namlen." >&4
11951 echo "Your directory entry does not know about the d_namlen field." >&4
11958 : Look for DIR.dd_fd
11959 case "$i_dirent" in
11961 echo "Checking to see if DIR has a dd_fd member variable" >&4
11963 #$i_stdlib I_STDLIB
11965 #include <stdlib.h>
11967 #include <dirent.h>
11977 if eval $compile; then
11978 echo "Yes, it does."
11981 echo "No, it does not."
11986 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11994 : see if this is an sysdir system
11995 set sys/dir.h i_sysdir
11998 : see if this is an sysndir system
11999 set sys/ndir.h i_sysndir
12004 $cat >dirfd.c <<EOM
12006 #$i_stdlib I_STDLIB
12008 #include <stdlib.h>
12010 #$i_dirent I_DIRENT /**/
12011 #$i_sysdir I_SYS_DIR /**/
12012 #$i_sysndir I_SYS_NDIR /**/
12013 #$i_systypes I_SYS_TYPES /**/
12014 #if defined(I_SYS_TYPES)
12015 #include <sys/types.h>
12017 #if defined(I_DIRENT)
12018 #include <dirent.h>
12019 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12020 #include <sys/dir.h>
12024 #include <sys/ndir.h>
12028 #include <ndir.h> /* may be wrong in the future */
12030 #include <sys/dir.h>
12036 DIR *dirp = opendir(".");
12037 if (dirfd(dirp) >= 0)
12045 if eval $compile; then
12049 $define) echo "dirfd() found." >&4 ;;
12050 *) echo "dirfd() NOT found." >&4 ;;
12056 : see if dlerror exists
12059 set dlerror d_dlerror
12063 : see if dlfcn is available
12064 set dlfcn.h i_dlfcn
12067 : Check what extension to use for shared libs
12072 On a few systems, the dynamically loaded modules that perl generates and uses
12073 will need a different extension than shared libs. The default will probably
12079 *) dflt="$dlext" ;;
12081 rp='What is the extension of dynamically loaded modules'
12090 : Check if dlsym need a leading underscore
12096 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12097 $cat >dyna.c <<'EOM'
12104 #$i_stdlib I_STDLIB
12106 #include <stdlib.h>
12110 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12112 #include <sys/types.h>
12117 extern int fred() ;
12126 int mode = RTLD_LAZY ;
12128 handle = dlopen("./dyna.$dlext", mode) ;
12129 if (handle == NULL) {
12134 symbol = dlsym(handle, "fred") ;
12135 if (symbol == NULL) {
12136 /* try putting a leading underscore */
12137 symbol = dlsym(handle, "_fred") ;
12138 if (symbol == NULL) {
12151 : Call the object file tmp-dyna.o in case dlext=o.
12152 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12153 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12154 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12155 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12158 1) echo "Test program failed using dlopen." >&4
12159 echo "Perhaps you should not use dynamic loading." >&4;;
12160 2) echo "Test program failed using dlsym." >&4
12161 echo "Perhaps you should not use dynamic loading." >&4;;
12162 3) echo "dlsym needs a leading underscore" >&4
12164 4) echo "dlsym doesn't need a leading underscore." >&4;;
12167 echo "I can't compile and run the test program." >&4
12168 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12173 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12178 : see if drand48_r exists
12179 set drand48_r d_drand48_r
12181 case "$d_drand48_r" in
12183 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12184 case "$d_drand48_r_proto:$usethreads" in
12185 ":define") d_drand48_r_proto=define
12186 set d_drand48_r_proto drand48_r $hdrs
12190 case "$d_drand48_r_proto" in
12192 case "$drand48_r_proto" in
12193 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12194 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12196 case "$drand48_r_proto" in
12197 ''|0) d_drand48_r=undef
12199 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12200 * ) case "$drand48_r_proto" in
12201 REENTRANT_PROTO*) ;;
12202 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12204 echo "Prototype: $try" ;;
12207 *) case "$usethreads" in
12208 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12215 *) drand48_r_proto=0
12219 : see if prototype for drand48 is available
12221 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12224 : see if dup2 exists
12228 : see if eaccess exists
12229 set eaccess d_eaccess
12232 : see if endgrent exists
12233 set endgrent d_endgrent
12236 : see if this is an grp system
12242 xxx=`./findhdr grp.h`
12243 $cppstdin $cppflags $cppminus < $xxx >$$.h
12245 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12257 set d_grpasswd; eval $setvar
12261 : see if endgrent_r exists
12262 set endgrent_r d_endgrent_r
12264 case "$d_endgrent_r" in
12266 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12267 case "$d_endgrent_r_proto:$usethreads" in
12268 ":define") d_endgrent_r_proto=define
12269 set d_endgrent_r_proto endgrent_r $hdrs
12273 case "$d_endgrent_r_proto" in
12275 case "$endgrent_r_proto" in
12276 ''|0) try='int endgrent_r(FILE**);'
12277 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12279 case "$endgrent_r_proto" in
12280 ''|0) try='void endgrent_r(FILE**);'
12281 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12283 case "$endgrent_r_proto" in
12284 ''|0) d_endgrent_r=undef
12286 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12287 * ) case "$endgrent_r_proto" in
12288 REENTRANT_PROTO*) ;;
12289 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12291 echo "Prototype: $try" ;;
12294 *) case "$usethreads" in
12295 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12302 *) endgrent_r_proto=0
12306 : see if endhostent exists
12307 set endhostent d_endhent
12310 : see if this is a netdb.h system
12311 set netdb.h i_netdb
12314 : see if endhostent_r exists
12315 set endhostent_r d_endhostent_r
12317 case "$d_endhostent_r" in
12319 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12320 case "$d_endhostent_r_proto:$usethreads" in
12321 ":define") d_endhostent_r_proto=define
12322 set d_endhostent_r_proto endhostent_r $hdrs
12326 case "$d_endhostent_r_proto" in
12328 case "$endhostent_r_proto" in
12329 ''|0) try='int endhostent_r(struct hostent_data*);'
12330 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12332 case "$endhostent_r_proto" in
12333 ''|0) try='void endhostent_r(struct hostent_data*);'
12334 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12336 case "$endhostent_r_proto" in
12337 ''|0) d_endhostent_r=undef
12338 endhostent_r_proto=0
12339 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12340 * ) case "$endhostent_r_proto" in
12341 REENTRANT_PROTO*) ;;
12342 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12344 echo "Prototype: $try" ;;
12347 *) case "$usethreads" in
12348 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12350 d_endhostent_r=undef
12351 endhostent_r_proto=0
12355 *) endhostent_r_proto=0
12359 : see if endnetent exists
12360 set endnetent d_endnent
12363 : see if endnetent_r exists
12364 set endnetent_r d_endnetent_r
12366 case "$d_endnetent_r" in
12368 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12369 case "$d_endnetent_r_proto:$usethreads" in
12370 ":define") d_endnetent_r_proto=define
12371 set d_endnetent_r_proto endnetent_r $hdrs
12375 case "$d_endnetent_r_proto" in
12377 case "$endnetent_r_proto" in
12378 ''|0) try='int endnetent_r(struct netent_data*);'
12379 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12381 case "$endnetent_r_proto" in
12382 ''|0) try='void endnetent_r(struct netent_data*);'
12383 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12385 case "$endnetent_r_proto" in
12386 ''|0) d_endnetent_r=undef
12387 endnetent_r_proto=0
12388 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12389 * ) case "$endnetent_r_proto" in
12390 REENTRANT_PROTO*) ;;
12391 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12393 echo "Prototype: $try" ;;
12396 *) case "$usethreads" in
12397 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12399 d_endnetent_r=undef
12400 endnetent_r_proto=0
12404 *) endnetent_r_proto=0
12408 : see if endprotoent exists
12409 set endprotoent d_endpent
12412 : see if endprotoent_r exists
12413 set endprotoent_r d_endprotoent_r
12415 case "$d_endprotoent_r" in
12417 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12418 case "$d_endprotoent_r_proto:$usethreads" in
12419 ":define") d_endprotoent_r_proto=define
12420 set d_endprotoent_r_proto endprotoent_r $hdrs
12424 case "$d_endprotoent_r_proto" in
12426 case "$endprotoent_r_proto" in
12427 ''|0) try='int endprotoent_r(struct protoent_data*);'
12428 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12430 case "$endprotoent_r_proto" in
12431 ''|0) try='void endprotoent_r(struct protoent_data*);'
12432 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12434 case "$endprotoent_r_proto" in
12435 ''|0) d_endprotoent_r=undef
12436 endprotoent_r_proto=0
12437 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12438 * ) case "$endprotoent_r_proto" in
12439 REENTRANT_PROTO*) ;;
12440 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12442 echo "Prototype: $try" ;;
12445 *) case "$usethreads" in
12446 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12448 d_endprotoent_r=undef
12449 endprotoent_r_proto=0
12453 *) endprotoent_r_proto=0
12457 : see if endpwent exists
12458 set endpwent d_endpwent
12461 : see if this is a pwd.h system
12467 xxx=`./findhdr pwd.h`
12468 $cppstdin $cppflags $cppminus < $xxx >$$.h
12470 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12478 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12486 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12494 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12502 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12510 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12518 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12526 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12538 set d_pwquota; eval $setvar
12539 set d_pwage; eval $setvar
12540 set d_pwchange; eval $setvar
12541 set d_pwclass; eval $setvar
12542 set d_pwexpire; eval $setvar
12543 set d_pwcomment; eval $setvar
12544 set d_pwgecos; eval $setvar
12545 set d_pwpasswd; eval $setvar
12549 : see if endpwent_r exists
12550 set endpwent_r d_endpwent_r
12552 case "$d_endpwent_r" in
12554 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12555 case "$d_endpwent_r_proto:$usethreads" in
12556 ":define") d_endpwent_r_proto=define
12557 set d_endpwent_r_proto endpwent_r $hdrs
12561 case "$d_endpwent_r_proto" in
12563 case "$endpwent_r_proto" in
12564 ''|0) try='int endpwent_r(FILE**);'
12565 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12567 case "$endpwent_r_proto" in
12568 ''|0) try='void endpwent_r(FILE**);'
12569 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12571 case "$endpwent_r_proto" in
12572 ''|0) d_endpwent_r=undef
12574 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12575 * ) case "$endpwent_r_proto" in
12576 REENTRANT_PROTO*) ;;
12577 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12579 echo "Prototype: $try" ;;
12582 *) case "$usethreads" in
12583 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12590 *) endpwent_r_proto=0
12594 : see if endservent exists
12595 set endservent d_endsent
12598 : see if endservent_r exists
12599 set endservent_r d_endservent_r
12601 case "$d_endservent_r" in
12603 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12604 case "$d_endservent_r_proto:$usethreads" in
12605 ":define") d_endservent_r_proto=define
12606 set d_endservent_r_proto endservent_r $hdrs
12610 case "$d_endservent_r_proto" in
12612 case "$endservent_r_proto" in
12613 ''|0) try='int endservent_r(struct servent_data*);'
12614 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12616 case "$endservent_r_proto" in
12617 ''|0) try='void endservent_r(struct servent_data*);'
12618 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12620 case "$endservent_r_proto" in
12621 ''|0) d_endservent_r=undef
12622 endservent_r_proto=0
12623 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12624 * ) case "$endservent_r_proto" in
12625 REENTRANT_PROTO*) ;;
12626 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12628 echo "Prototype: $try" ;;
12631 *) case "$usethreads" in
12632 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12634 d_endservent_r=undef
12635 endservent_r_proto=0
12639 *) endservent_r_proto=0
12643 : Locate the flags for 'open()'
12646 #include <sys/types.h>
12651 #include <sys/file.h>
12653 #$i_stdlib I_STDLIB
12655 #include <stdlib.h>
12666 : check sys/file.h first to get FREAD on Sun
12667 if $test `./findhdr sys/file.h` && \
12668 set try -DI_SYS_FILE && eval $compile; then
12670 echo "<sys/file.h> defines the O_* constants..." >&4
12671 if $run ./try; then
12672 echo "and you have the 3 argument form of open()." >&4
12675 echo "but not the 3 argument form of open(). Oh, well." >&4
12678 elif $test `./findhdr fcntl.h` && \
12679 set try -DI_FCNTL && eval $compile; then
12681 echo "<fcntl.h> defines the O_* constants..." >&4
12682 if $run ./try; then
12683 echo "and you have the 3 argument form of open()." >&4
12686 echo "but not the 3 argument form of open(). Oh, well." >&4
12691 echo "I can't find the O_* constant definitions! You got problems." >&4
12697 : see if this is a sys/file.h system
12702 : do we need to include sys/file.h ?
12706 if $h_sysfile; then
12708 echo "We'll be including <sys/file.h>." >&4
12711 echo "We won't be including <sys/file.h>." >&4
12721 : see if fcntl.h is there
12726 : see if we can include fcntl.h
12732 echo "We'll be including <fcntl.h>." >&4
12735 if $h_sysfile; then
12736 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12738 echo "We won't be including <fcntl.h>." >&4
12750 : see if fork exists
12754 : see if pipe exists
12758 : check for non-blocking I/O stuff
12759 case "$h_sysfile" in
12760 true) echo "#include <sys/file.h>" > head.c;;
12763 true) echo "#include <fcntl.h>" > head.c;;
12764 *) echo "#include <sys/fcntl.h>" > head.c;;
12769 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12770 case "$o_nonblock" in
12772 $cat head.c > try.c
12773 $cat >>try.c <<EOCP
12775 #$i_stdlib I_STDLIB
12777 #include <stdlib.h>
12785 printf("O_NONBLOCK\n");
12789 printf("O_NDELAY\n");
12793 printf("FNDELAY\n");
12800 if eval $compile_ok; then
12801 o_nonblock=`$run ./try`
12802 case "$o_nonblock" in
12803 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12804 *) echo "Seems like we can use $o_nonblock.";;
12807 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12810 *) echo "Using $hint value $o_nonblock.";;
12815 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12818 case "$d_fork:$d_pipe" in
12820 $cat head.c > try.c
12821 $cat >>try.c <<EOCP
12823 #include <sys/types.h>
12824 #include <signal.h>
12826 #$i_stdlib I_STDLIB
12828 #include <stdlib.h>
12834 #define MY_O_NONBLOCK $o_nonblock
12835 #ifndef errno /* XXX need better Configure test */
12838 #$i_unistd I_UNISTD
12840 #include <unistd.h>
12842 #$i_string I_STRING
12844 #include <string.h>
12846 #include <strings.h>
12848 $signal_t blech(int x) { exit(3); }
12850 $cat >> try.c <<'EOCP'
12858 pipe(pd); /* Down: child -> parent */
12859 pipe(pu); /* Up: parent -> child */
12862 close(pd[1]); /* Parent reads from pd[0] */
12863 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12865 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12870 signal(SIGALRM, blech);
12872 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12874 sprintf(string, "%d\n", ret);
12875 write(2, string, strlen(string));
12878 if (errno == EAGAIN) {
12879 printf("EAGAIN\n");
12884 if (errno == EWOULDBLOCK)
12885 printf("EWOULDBLOCK\n");
12888 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12889 sleep(2); /* Give it time to close our pipe */
12891 ret = read(pd[0], buf, 1); /* Should read EOF */
12893 sprintf(string, "%d\n", ret);
12894 write(4, string, strlen(string));
12898 close(pd[0]); /* We write to pd[1] */
12899 close(pu[1]); /* We read from pu[0] */
12900 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12901 close(pd[1]); /* Pipe pd is now fully closed! */
12902 exit(0); /* Bye bye, thank you for playing! */
12906 if eval $compile_ok; then
12907 echo "$startsh" >mtry
12908 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12910 ./mtry >/dev/null 2>&1
12912 0) eagain=`$cat try.out`;;
12913 1) echo "Could not perform non-blocking setting!";;
12914 2) echo "I did a successful read() for something that was not there!";;
12915 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12916 4) echo "Could not find F_SETFL!";;
12917 *) echo "Something terribly wrong happened during testing.";;
12919 rd_nodata=`$cat try.ret`
12920 echo "A read() system call with no data present returns $rd_nodata."
12921 case "$rd_nodata" in
12924 echo "(That's peculiar, fixing that to be -1.)"
12930 echo "Forcing errno EAGAIN on read() with no data available."
12934 echo "Your read() sets errno to $eagain when no data is available."
12937 status=`$cat try.err`
12939 0) echo "And it correctly returns 0 to signal EOF.";;
12940 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12941 *) echo "However, your read() returns '$status' on EOF??";;
12944 if test "$status" = "$rd_nodata"; then
12945 echo "WARNING: you can't distinguish between EOF and no data!"
12949 echo "I can't compile the test program--assuming errno EAGAIN will do."
12953 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12962 echo "Using $hint value $eagain."
12963 echo "Your read() returns $rd_nodata when no data is present."
12964 case "$d_eofnblk" in
12965 "$define") echo "And you can see EOF because read() returns 0.";;
12966 "$undef") echo "But you can't see EOF status from read() returned value.";;
12968 echo "(Assuming you can't see EOF status from read anyway.)"
12974 $rm_try head.c mtry
12976 : see if _ptr and _cnt from stdio act std
12979 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12980 echo "(Looks like you have stdio.h from BSD.)"
12981 case "$stdio_ptr" in
12982 '') stdio_ptr='((fp)->_p)'
12985 *) ptr_lval=$d_stdio_ptr_lval;;
12987 case "$stdio_cnt" in
12988 '') stdio_cnt='((fp)->_r)'
12991 *) cnt_lval=$d_stdio_cnt_lval;;
12993 case "$stdio_base" in
12994 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12996 case "$stdio_bufsiz" in
12997 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12999 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13000 echo "(Looks like you have stdio.h from Linux.)"
13001 case "$stdio_ptr" in
13002 '') stdio_ptr='((fp)->_IO_read_ptr)'
13005 *) ptr_lval=$d_stdio_ptr_lval;;
13007 case "$stdio_cnt" in
13008 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13011 *) cnt_lval=$d_stdio_cnt_lval;;
13013 case "$stdio_base" in
13014 '') stdio_base='((fp)->_IO_read_base)';;
13016 case "$stdio_bufsiz" in
13017 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13020 case "$stdio_ptr" in
13021 '') stdio_ptr='((fp)->_ptr)'
13024 *) ptr_lval=$d_stdio_ptr_lval;;
13026 case "$stdio_cnt" in
13027 '') stdio_cnt='((fp)->_cnt)'
13030 *) cnt_lval=$d_stdio_cnt_lval;;
13032 case "$stdio_base" in
13033 '') stdio_base='((fp)->_base)';;
13035 case "$stdio_bufsiz" in
13036 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13040 : test whether _ptr and _cnt really work
13041 echo "Checking how std your stdio is..." >&4
13044 #$i_stdlib I_STDLIB
13046 #include <stdlib.h>
13048 #define FILE_ptr(fp) $stdio_ptr
13049 #define FILE_cnt(fp) $stdio_cnt
13051 FILE *fp = fopen("try.c", "r");
13054 18 <= FILE_cnt(fp) &&
13055 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13063 if eval $compile && $to try.c; then
13064 if $run ./try; then
13065 echo "Your stdio acts pretty std."
13068 echo "Your stdio isn't very std."
13071 echo "Your stdio doesn't appear very std."
13075 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13076 # direct buffer manipulation no longer works. The Configure tests
13077 # should be changed to correctly detect this, but until then,
13078 # the following check should at least let perl compile and run.
13079 # (This quick fix should be updated before 5.8.1.)
13080 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13081 # A. Dougherty, June 3, 2002.
13082 case "$d_gnulibc" in
13084 case "$gnulibc_version" in
13088 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13097 : Can _ptr be used as an lvalue?
13098 case "$d_stdstdio$ptr_lval" in
13099 $define$define) val=$define ;;
13102 set d_stdio_ptr_lval
13105 : Can _cnt be used as an lvalue?
13106 case "$d_stdstdio$cnt_lval" in
13107 $define$define) val=$define ;;
13110 set d_stdio_cnt_lval
13114 : test whether setting _ptr sets _cnt as a side effect
13115 d_stdio_ptr_lval_sets_cnt="$undef"
13116 d_stdio_ptr_lval_nochange_cnt="$undef"
13117 case "$d_stdio_ptr_lval$d_stdstdio" in
13119 echo "Checking to see what happens if we set the stdio ptr..." >&4
13122 /* Can we scream? */
13123 /* Eat dust sed :-) */
13124 /* In the buffer space, no one can hear you scream. */
13125 #$i_stdlib I_STDLIB
13127 #include <stdlib.h>
13129 #define FILE_ptr(fp) $stdio_ptr
13130 #define FILE_cnt(fp) $stdio_cnt
13131 #include <sys/types.h>
13133 FILE *fp = fopen("try.c", "r");
13138 puts("Fail even to read");
13141 c = getc(fp); /* Read away the first # */
13143 puts("Fail even to read");
13147 18 <= FILE_cnt(fp) &&
13148 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13150 puts("Fail even to read");
13153 ptr = (char*) FILE_ptr(fp);
13154 cnt = (size_t)FILE_cnt(fp);
13156 FILE_ptr(fp) += 42;
13158 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13159 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13162 if (FILE_cnt(fp) <= 20) {
13163 printf ("Fail (<20 chars to test)");
13166 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13167 puts("Fail compare");
13170 if (cnt == FILE_cnt(fp)) {
13171 puts("Pass_unchanged");
13174 if (FILE_cnt(fp) == (cnt - 42)) {
13175 puts("Pass_changed");
13178 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13184 if eval $compile && $to try.c; then
13185 case `$run ./try` in
13187 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13188 d_stdio_ptr_lval_sets_cnt="$define" ;;
13190 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13191 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13193 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13195 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13198 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13204 : see if _base is also standard
13206 case "$d_stdstdio" in
13210 #$i_stdlib I_STDLIB
13212 #include <stdlib.h>
13214 #define FILE_base(fp) $stdio_base
13215 #define FILE_bufsiz(fp) $stdio_bufsiz
13217 FILE *fp = fopen("try.c", "r");
13220 19 <= FILE_bufsiz(fp) &&
13221 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13228 if eval $compile && $to try.c; then
13229 if $run ./try; then
13230 echo "And its _base field acts std."
13233 echo "But its _base field isn't std."
13236 echo "However, it seems to be lacking the _base field."
13244 : see if fast_stdio exists
13246 case "$d_stdstdio:$d_stdio_ptr_lval" in
13248 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13250 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13261 : see if fchdir exists
13262 set fchdir d_fchdir
13265 : see if fchmod exists
13266 set fchmod d_fchmod
13269 : see if fchown exists
13270 set fchown d_fchown
13273 : see if this is an fcntl system
13277 : See if fcntl-based locking works.
13280 #$i_stdlib I_STDLIB
13282 #include <stdlib.h>
13284 #include <unistd.h>
13286 #include <signal.h>
13287 $signal_t blech(int x) { exit(3); }
13289 #if defined(F_SETLK) && defined(F_SETLKW)
13290 struct flock flock;
13292 fd = open("try.c", O_RDONLY);
13293 flock.l_type = F_RDLCK;
13294 flock.l_whence = SEEK_SET;
13295 flock.l_start = flock.l_len = 0;
13296 signal(SIGALRM, blech);
13298 retval = fcntl(fd, F_SETLK, &flock);
13300 (retval < 0 ? exit(2) : exit(0));
13306 echo "Checking if fcntl-based file locking works... "
13310 if eval $compile_ok; then
13311 if $run ./try; then
13312 echo "Yes, it seems to work."
13315 echo "Nope, it didn't work."
13320 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13321 *** This is (almost) impossible.
13322 *** If your NFS lock daemons are not feeling well, something like
13323 *** this may happen, please investigate. Cannot continue, aborting.
13331 echo "I'm unable to compile the test program, so I'll assume not."
13336 echo "Nope, since you don't even have fcntl()."
13339 set d_fcntl_can_lock
13343 : check for fd_set items
13346 Checking to see how well your C compiler handles fd_set and friends ...
13349 #$i_stdlib I_STDLIB
13351 #include <stdlib.h>
13353 #$i_systime I_SYS_TIME
13354 #$i_sysselct I_SYS_SELECT
13355 #$d_socket HAS_SOCKET
13356 #include <sys/types.h>
13358 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13361 #include <sys/time.h>
13363 #ifdef I_SYS_SELECT
13364 #include <sys/select.h>
13373 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13381 if eval $compile; then
13382 d_fds_bits="$define"
13384 echo "Well, your system knows about the normal fd_set typedef..." >&4
13385 if $run ./try; then
13386 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13387 d_fd_macros="$define"
13390 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13392 d_fd_macros="$undef"
13396 Hmm, your compiler has some difficulty with fd_set. Checking further...
13399 if eval $compile; then
13400 d_fds_bits="$undef"
13402 echo "Well, your system has some sort of fd_set available..." >&4
13403 if $run ./try; then
13404 echo "and you have the normal fd_set macros." >&4
13405 d_fd_macros="$define"
13408 but not the normal fd_set macros! Gross! More work for me...
13410 d_fd_macros="$undef"
13413 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13415 d_fds_bits="$undef"
13416 d_fd_macros="$undef"
13421 : see if fgetpos exists
13422 set fgetpos d_fgetpos
13425 : see if finite exists
13426 set finite d_finite
13429 : see if finitel exists
13430 set finitel d_finitel
13433 : see if flock exists
13437 : see if prototype for flock is available
13439 set d_flockproto flock $i_sysfile sys/file.h
13442 : see if fp_class exists
13443 set fp_class d_fp_class
13446 : see if pathconf exists
13447 set pathconf d_pathconf
13450 : see if fpathconf exists
13451 set fpathconf d_fpathconf
13454 : see if fpclass exists
13455 set fpclass d_fpclass
13458 : see if fpclassify exists
13459 set fpclassify d_fpclassify
13462 : see if fpclassl exists
13463 set fpclassl d_fpclassl
13466 : check for fpos64_t
13468 echo "Checking to see if you have fpos64_t..." >&4
13471 int main() { fpos64_t x = 7; }
13474 if eval $compile; then
13476 echo "You have fpos64_t."
13479 echo "You do not have fpos64_t."
13480 case "$fpossize" in
13481 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13488 : see if frexpl exists
13489 set frexpl d_frexpl
13492 : see if this is a sys/param system
13493 set sys/param.h i_sysparam
13496 : see if this is a sys/mount.h system
13497 set sys/mount.h i_sysmount
13500 : Check for fs_data_s
13502 echo "Checking to see if your system supports struct fs_data..." >&4
13503 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13505 case "$d_fs_data_s" in
13506 "$define") echo "Yes, it does." ;;
13507 *) echo "No, it doesn't." ;;
13510 : see if fseeko exists
13511 set fseeko d_fseeko
13513 case "$longsize" in
13514 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13517 : see if fsetpos exists
13518 set fsetpos d_fsetpos
13521 : see if fstatfs exists
13522 set fstatfs d_fstatfs
13525 : see if statvfs exists
13526 set statvfs d_statvfs
13529 : see if fstatvfs exists
13530 set fstatvfs d_fstatvfs
13534 : see if fsync exists
13538 : see if ftello exists
13539 set ftello d_ftello
13541 case "$longsize" in
13542 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13545 : check for a working futimes
13548 echo "Checking if you have a working futimes()" >&4
13551 #include <sys/time.h>
13558 fd = open ("try.c", O_RDWR);
13559 if (-1 == fd) exit (1);
13560 rv = futimes (fd, NULL);
13561 exit (rv == -1 ? errno : 0);
13565 if eval $compile; then
13569 0) echo "Yes, you have" >&4
13570 d_futimes="$define"
13572 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13576 echo "No, it does not (probably harmless)" >&4
13580 : see if ndbm.h is available
13583 : Compatibility location for RedHat 7.1
13584 set gdbm/ndbm.h i_gdbmndbm
13586 : Compatibility location for Debian 4.0
13587 set gdbm-ndbm.h i_gdbm_ndbm
13591 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13592 : see if dbm_open exists
13593 set dbm_open d_dbm_open
13595 case "$d_dbm_open" in
13598 i_gdbmndbm="$undef"
13599 i_gdbm_ndbm="$undef"
13600 echo "We won't be including <ndbm.h>"
13610 ndbm_hdr_protochk='name=$1; hdr=$2;
13611 eval "ihdr=\$""i_$name";
13613 if $test "$ihdr" = "$define"; then
13614 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13615 case "$d_cplusplus" in
13616 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13617 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13620 $define) $echo "Your <$hdr> seems to have prototypes";;
13621 *) $echo "Your <$hdr> does not seem to have prototypes";;
13624 set "d_${name}_h_uses_prototypes";
13628 eval $ndbm_hdr_protochk
13629 set gdbmndbm gdbm/ndbm.h
13630 eval $ndbm_hdr_protochk
13631 set gdbm_ndbm gdbm-ndbm.h
13632 eval $ndbm_hdr_protochk
13634 : see if getaddrinfo exists
13635 set getaddrinfo d_getaddrinfo
13638 : see if getcwd exists
13639 set getcwd d_getcwd
13642 : see if getespwnam exists
13643 set getespwnam d_getespwnam
13646 : see if getfsstat exists
13647 set getfsstat d_getfsstat
13650 : see if getgrent exists
13651 set getgrent d_getgrent
13654 : see if getgrent_r exists
13655 set getgrent_r d_getgrent_r
13657 case "$d_getgrent_r" in
13659 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13660 case "$d_getgrent_r_proto:$usethreads" in
13661 ":define") d_getgrent_r_proto=define
13662 set d_getgrent_r_proto getgrent_r $hdrs
13666 case "$d_getgrent_r_proto" in
13668 case "$getgrent_r_proto" in
13669 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13670 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13672 case "$getgrent_r_proto" in
13673 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13674 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13676 case "$getgrent_r_proto" in
13677 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13678 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13680 case "$getgrent_r_proto" in
13681 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13682 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13684 case "$getgrent_r_proto" in
13685 ''|0) try='int getgrent_r(struct group*, char*, int);'
13686 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13688 case "$getgrent_r_proto" in
13689 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13690 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13692 case "$getgrent_r_proto" in
13693 ''|0) d_getgrent_r=undef
13695 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13696 * ) case "$getgrent_r_proto" in
13697 REENTRANT_PROTO*) ;;
13698 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13700 echo "Prototype: $try" ;;
13703 *) case "$usethreads" in
13704 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13711 *) getgrent_r_proto=0
13715 : see if getgrgid_r exists
13716 set getgrgid_r d_getgrgid_r
13718 case "$d_getgrgid_r" in
13720 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13721 case "$d_getgrgid_r_proto:$usethreads" in
13722 ":define") d_getgrgid_r_proto=define
13723 set d_getgrgid_r_proto getgrgid_r $hdrs
13727 case "$d_getgrgid_r_proto" in
13729 case "$getgrgid_r_proto" in
13730 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13731 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13733 case "$getgrgid_r_proto" in
13734 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13735 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13737 case "$getgrgid_r_proto" in
13738 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13739 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13741 case "$getgrgid_r_proto" in
13742 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13743 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13745 case "$getgrgid_r_proto" in
13746 ''|0) d_getgrgid_r=undef
13748 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13749 * ) case "$getgrgid_r_proto" in
13750 REENTRANT_PROTO*) ;;
13751 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13753 echo "Prototype: $try" ;;
13756 *) case "$usethreads" in
13757 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13764 *) getgrgid_r_proto=0
13768 : see if getgrnam_r exists
13769 set getgrnam_r d_getgrnam_r
13771 case "$d_getgrnam_r" in
13773 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13774 case "$d_getgrnam_r_proto:$usethreads" in
13775 ":define") d_getgrnam_r_proto=define
13776 set d_getgrnam_r_proto getgrnam_r $hdrs
13780 case "$d_getgrnam_r_proto" in
13782 case "$getgrnam_r_proto" in
13783 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13784 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13786 case "$getgrnam_r_proto" in
13787 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13788 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13790 case "$getgrnam_r_proto" in
13791 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13792 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13794 case "$getgrnam_r_proto" in
13795 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13796 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13798 case "$getgrnam_r_proto" in
13799 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13800 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13802 case "$getgrnam_r_proto" in
13803 ''|0) d_getgrnam_r=undef
13805 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13806 * ) case "$getgrnam_r_proto" in
13807 REENTRANT_PROTO*) ;;
13808 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13810 echo "Prototype: $try" ;;
13813 *) case "$usethreads" in
13814 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13821 *) getgrnam_r_proto=0
13825 : see if gethostbyaddr exists
13826 set gethostbyaddr d_gethbyaddr
13829 : see if gethostbyname exists
13830 set gethostbyname d_gethbyname
13833 : see if gethostent exists
13834 set gethostent d_gethent
13837 : see how we will look up host name
13840 if set gethostname val -f d_gethname; eval $csym; $val; then
13841 echo 'gethostname() found.' >&4
13842 d_gethname="$define"
13845 if set uname val -f d_uname; eval $csym; $val; then
13848 uname() was found, but you're running xenix, and older versions of xenix
13849 have a broken uname(). If you don't really know whether your xenix is old
13850 enough to have a broken system call, use the default answer.
13855 "$define") dflt=n;;
13857 rp='Is your uname() broken?'
13860 n*) d_uname="$define"; call=uname;;
13863 echo 'uname() found.' >&4
13870 case "$d_gethname" in
13871 '') d_gethname="$undef";;
13874 '') d_uname="$undef";;
13876 case "$d_uname$d_gethname" in
13881 Every now and then someone has a $call() that lies about the hostname
13882 but can't be fixed for political or economic reasons. If you wish, I can
13883 pretend $call() isn't there and maybe compute hostname at run-time
13884 thanks to the '$phostname' command.
13887 rp="Shall I ignore $call() from now on?"
13890 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13893 case "$phostname" in
13894 '') aphostname='';;
13895 *) case "$aphostname" in
13897 *) set X $phostname
13901 file=`./loc $file $file $pth`
13902 aphostname=`echo $file $*`
13907 case "$d_uname$d_gethname" in
13910 case "$phostname" in
13912 echo "There will be no way for $package to get your hostname." >&4;;
13914 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13918 case "$d_phostname" in
13919 '') d_phostname="$undef";;
13922 : see if gethostbyaddr_r exists
13923 set gethostbyaddr_r d_gethostbyaddr_r
13925 case "$d_gethostbyaddr_r" in
13927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13928 case "$d_gethostbyaddr_r_proto:$usethreads" in
13929 ":define") d_gethostbyaddr_r_proto=define
13930 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13934 case "$d_gethostbyaddr_r_proto" in
13936 case "$gethostbyaddr_r_proto" in
13937 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13938 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13940 case "$gethostbyaddr_r_proto" in
13941 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13942 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13944 case "$gethostbyaddr_r_proto" in
13945 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13946 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13948 case "$gethostbyaddr_r_proto" in
13949 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13950 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13952 case "$gethostbyaddr_r_proto" in
13953 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13954 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13956 case "$gethostbyaddr_r_proto" in
13957 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13958 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13960 case "$gethostbyaddr_r_proto" in
13961 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13962 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13964 case "$gethostbyaddr_r_proto" in
13965 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13966 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13968 case "$gethostbyaddr_r_proto" in
13969 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13970 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13972 case "$gethostbyaddr_r_proto" in
13973 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13974 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13976 case "$gethostbyaddr_r_proto" in
13977 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13978 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13980 case "$gethostbyaddr_r_proto" in
13981 ''|0) d_gethostbyaddr_r=undef
13982 gethostbyaddr_r_proto=0
13983 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13984 * ) case "$gethostbyaddr_r_proto" in
13985 REENTRANT_PROTO*) ;;
13986 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13988 echo "Prototype: $try" ;;
13991 *) case "$usethreads" in
13992 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13994 d_gethostbyaddr_r=undef
13995 gethostbyaddr_r_proto=0
13999 *) gethostbyaddr_r_proto=0
14003 : see if gethostbyname_r exists
14004 set gethostbyname_r d_gethostbyname_r
14006 case "$d_gethostbyname_r" in
14008 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14009 case "$d_gethostbyname_r_proto:$usethreads" in
14010 ":define") d_gethostbyname_r_proto=define
14011 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14015 case "$d_gethostbyname_r_proto" in
14017 case "$gethostbyname_r_proto" in
14018 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14019 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14021 case "$gethostbyname_r_proto" in
14022 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14023 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14025 case "$gethostbyname_r_proto" in
14026 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14027 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14029 case "$gethostbyname_r_proto" in
14030 ''|0) d_gethostbyname_r=undef
14031 gethostbyname_r_proto=0
14032 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14033 * ) case "$gethostbyname_r_proto" in
14034 REENTRANT_PROTO*) ;;
14035 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14037 echo "Prototype: $try" ;;
14040 *) case "$usethreads" in
14041 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14043 d_gethostbyname_r=undef
14044 gethostbyname_r_proto=0
14048 *) gethostbyname_r_proto=0
14052 : see if gethostent_r exists
14053 set gethostent_r d_gethostent_r
14055 case "$d_gethostent_r" in
14057 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14058 case "$d_gethostent_r_proto:$usethreads" in
14059 ":define") d_gethostent_r_proto=define
14060 set d_gethostent_r_proto gethostent_r $hdrs
14064 case "$d_gethostent_r_proto" in
14066 case "$gethostent_r_proto" in
14067 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14068 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14070 case "$gethostent_r_proto" in
14071 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14072 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14074 case "$gethostent_r_proto" in
14075 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14076 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14078 case "$gethostent_r_proto" in
14079 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14080 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14082 case "$gethostent_r_proto" in
14083 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14084 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14086 case "$gethostent_r_proto" in
14087 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14088 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14090 case "$gethostent_r_proto" in
14091 ''|0) d_gethostent_r=undef
14092 gethostent_r_proto=0
14093 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14094 * ) case "$gethostent_r_proto" in
14095 REENTRANT_PROTO*) ;;
14096 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14098 echo "Prototype: $try" ;;
14101 *) case "$usethreads" in
14102 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14104 d_gethostent_r=undef
14105 gethostent_r_proto=0
14109 *) gethostent_r_proto=0
14113 : see if prototypes for various gethostxxx netdb.h functions are available
14115 set d_gethostprotos gethostent $i_netdb netdb.h
14118 : see if getitimer exists
14119 set getitimer d_getitimer
14122 : see if getlogin exists
14123 set getlogin d_getlogin
14126 : see if getlogin_r exists
14127 set getlogin_r d_getlogin_r
14129 case "$d_getlogin_r" in
14131 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14132 case "$d_getlogin_r_proto:$usethreads" in
14133 ":define") d_getlogin_r_proto=define
14134 set d_getlogin_r_proto getlogin_r $hdrs
14138 case "$d_getlogin_r_proto" in
14140 case "$getlogin_r_proto" in
14141 ''|0) try='int getlogin_r(char*, size_t);'
14142 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14144 case "$getlogin_r_proto" in
14145 ''|0) try='int getlogin_r(char*, int);'
14146 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14148 case "$getlogin_r_proto" in
14149 ''|0) try='char* getlogin_r(char*, size_t);'
14150 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14152 case "$getlogin_r_proto" in
14153 ''|0) try='char* getlogin_r(char*, int);'
14154 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14156 case "$getlogin_r_proto" in
14157 ''|0) d_getlogin_r=undef
14159 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14160 * ) case "$getlogin_r_proto" in
14161 REENTRANT_PROTO*) ;;
14162 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14164 echo "Prototype: $try" ;;
14167 *) case "$usethreads" in
14168 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14175 *) getlogin_r_proto=0
14179 : see if getmnt exists
14180 set getmnt d_getmnt
14183 : see if getmntent exists
14184 set getmntent d_getmntent
14187 : see if getnameinfo exists
14188 set getnameinfo d_getnameinfo
14191 : see if getnetbyaddr exists
14192 set getnetbyaddr d_getnbyaddr
14195 : see if getnetbyname exists
14196 set getnetbyname d_getnbyname
14199 : see if getnetent exists
14200 set getnetent d_getnent
14203 : see if getnetbyaddr_r exists
14204 set getnetbyaddr_r d_getnetbyaddr_r
14206 case "$d_getnetbyaddr_r" in
14208 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14209 case "$d_getnetbyaddr_r_proto:$usethreads" in
14210 ":define") d_getnetbyaddr_r_proto=define
14211 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14215 case "$d_getnetbyaddr_r_proto" in
14217 case "$getnetbyaddr_r_proto" in
14218 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14219 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14221 case "$getnetbyaddr_r_proto" in
14222 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14223 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14225 case "$getnetbyaddr_r_proto" in
14226 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14227 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14229 case "$getnetbyaddr_r_proto" in
14230 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14231 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14233 case "$getnetbyaddr_r_proto" in
14234 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14235 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14237 case "$getnetbyaddr_r_proto" in
14238 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14239 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14241 case "$getnetbyaddr_r_proto" in
14242 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14243 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14245 case "$getnetbyaddr_r_proto" in
14246 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14247 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14249 case "$getnetbyaddr_r_proto" in
14250 ''|0) d_getnetbyaddr_r=undef
14251 getnetbyaddr_r_proto=0
14252 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14253 * ) case "$getnetbyaddr_r_proto" in
14254 REENTRANT_PROTO*) ;;
14255 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14257 echo "Prototype: $try" ;;
14260 *) case "$usethreads" in
14261 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14263 d_getnetbyaddr_r=undef
14264 getnetbyaddr_r_proto=0
14268 *) getnetbyaddr_r_proto=0
14272 : see if getnetbyname_r exists
14273 set getnetbyname_r d_getnetbyname_r
14275 case "$d_getnetbyname_r" in
14277 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14278 case "$d_getnetbyname_r_proto:$usethreads" in
14279 ":define") d_getnetbyname_r_proto=define
14280 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14284 case "$d_getnetbyname_r_proto" in
14286 case "$getnetbyname_r_proto" in
14287 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14288 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14290 case "$getnetbyname_r_proto" in
14291 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14292 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14294 case "$getnetbyname_r_proto" in
14295 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14296 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14298 case "$getnetbyname_r_proto" in
14299 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14300 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14302 case "$getnetbyname_r_proto" in
14303 ''|0) d_getnetbyname_r=undef
14304 getnetbyname_r_proto=0
14305 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14306 * ) case "$getnetbyname_r_proto" in
14307 REENTRANT_PROTO*) ;;
14308 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14310 echo "Prototype: $try" ;;
14313 *) case "$usethreads" in
14314 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14316 d_getnetbyname_r=undef
14317 getnetbyname_r_proto=0
14321 *) getnetbyname_r_proto=0
14325 : see if getnetent_r exists
14326 set getnetent_r d_getnetent_r
14328 case "$d_getnetent_r" in
14330 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14331 case "$d_getnetent_r_proto:$usethreads" in
14332 ":define") d_getnetent_r_proto=define
14333 set d_getnetent_r_proto getnetent_r $hdrs
14337 case "$d_getnetent_r_proto" in
14339 case "$getnetent_r_proto" in
14340 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14341 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14343 case "$getnetent_r_proto" in
14344 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14345 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14347 case "$getnetent_r_proto" in
14348 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14349 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14351 case "$getnetent_r_proto" in
14352 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14353 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14355 case "$getnetent_r_proto" in
14356 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14357 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14359 case "$getnetent_r_proto" in
14360 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14361 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14363 case "$getnetent_r_proto" in
14364 ''|0) d_getnetent_r=undef
14365 getnetent_r_proto=0
14366 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14367 * ) case "$getnetent_r_proto" in
14368 REENTRANT_PROTO*) ;;
14369 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14371 echo "Prototype: $try" ;;
14374 *) case "$usethreads" in
14375 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14377 d_getnetent_r=undef
14378 getnetent_r_proto=0
14382 *) getnetent_r_proto=0
14386 : see if prototypes for various getnetxxx netdb.h functions are available
14388 set d_getnetprotos getnetent $i_netdb netdb.h
14391 : see if getpagesize exists
14392 set getpagesize d_getpagsz
14395 : Optional checks for getprotobyname and getprotobynumber
14397 : see if getprotobyname exists
14398 set getprotobyname d_getpbyname
14401 : see if getprotobynumber exists
14402 set getprotobynumber d_getpbynumber
14405 : see if getprotoent exists
14406 set getprotoent d_getpent
14409 : see if getpgid exists
14410 set getpgid d_getpgid
14413 : see if getpgrp2 exists
14414 set getpgrp2 d_getpgrp2
14417 : see if getppid exists
14418 set getppid d_getppid
14421 : see if getpriority exists
14422 set getpriority d_getprior
14425 : see if getprotobyname_r exists
14426 set getprotobyname_r d_getprotobyname_r
14428 case "$d_getprotobyname_r" in
14430 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14431 case "$d_getprotobyname_r_proto:$usethreads" in
14432 ":define") d_getprotobyname_r_proto=define
14433 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14437 case "$d_getprotobyname_r_proto" in
14439 case "$getprotobyname_r_proto" in
14440 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14441 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14443 case "$getprotobyname_r_proto" in
14444 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14445 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14447 case "$getprotobyname_r_proto" in
14448 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14449 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14451 case "$getprotobyname_r_proto" in
14452 ''|0) d_getprotobyname_r=undef
14453 getprotobyname_r_proto=0
14454 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14455 * ) case "$getprotobyname_r_proto" in
14456 REENTRANT_PROTO*) ;;
14457 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14459 echo "Prototype: $try" ;;
14462 *) case "$usethreads" in
14463 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14465 d_getprotobyname_r=undef
14466 getprotobyname_r_proto=0
14470 *) getprotobyname_r_proto=0
14474 : see if getprotobynumber_r exists
14475 set getprotobynumber_r d_getprotobynumber_r
14477 case "$d_getprotobynumber_r" in
14479 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14480 case "$d_getprotobynumber_r_proto:$usethreads" in
14481 ":define") d_getprotobynumber_r_proto=define
14482 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14486 case "$d_getprotobynumber_r_proto" in
14488 case "$getprotobynumber_r_proto" in
14489 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14490 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14492 case "$getprotobynumber_r_proto" in
14493 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14494 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14496 case "$getprotobynumber_r_proto" in
14497 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14498 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14500 case "$getprotobynumber_r_proto" in
14501 ''|0) d_getprotobynumber_r=undef
14502 getprotobynumber_r_proto=0
14503 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14504 * ) case "$getprotobynumber_r_proto" in
14505 REENTRANT_PROTO*) ;;
14506 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14508 echo "Prototype: $try" ;;
14511 *) case "$usethreads" in
14512 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14514 d_getprotobynumber_r=undef
14515 getprotobynumber_r_proto=0
14519 *) getprotobynumber_r_proto=0
14523 : see if getprotoent_r exists
14524 set getprotoent_r d_getprotoent_r
14526 case "$d_getprotoent_r" in
14528 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14529 case "$d_getprotoent_r_proto:$usethreads" in
14530 ":define") d_getprotoent_r_proto=define
14531 set d_getprotoent_r_proto getprotoent_r $hdrs
14535 case "$d_getprotoent_r_proto" in
14537 case "$getprotoent_r_proto" in
14538 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14539 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14541 case "$getprotoent_r_proto" in
14542 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14543 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14545 case "$getprotoent_r_proto" in
14546 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14547 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14549 case "$getprotoent_r_proto" in
14550 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14551 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14553 case "$getprotoent_r_proto" in
14554 ''|0) d_getprotoent_r=undef
14555 getprotoent_r_proto=0
14556 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14557 * ) case "$getprotoent_r_proto" in
14558 REENTRANT_PROTO*) ;;
14559 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14561 echo "Prototype: $try" ;;
14564 *) case "$usethreads" in
14565 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14567 d_getprotoent_r=undef
14568 getprotoent_r_proto=0
14572 *) getprotoent_r_proto=0
14576 : see if prototypes for various getprotoxxx netdb.h functions are available
14578 set d_getprotoprotos getprotoent $i_netdb netdb.h
14581 : see if getprpwnam exists
14582 set getprpwnam d_getprpwnam
14585 : see if getpwent exists
14586 set getpwent d_getpwent
14589 : see if getpwent_r exists
14590 set getpwent_r d_getpwent_r
14592 case "$d_getpwent_r" in
14594 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14595 case "$d_getpwent_r_proto:$usethreads" in
14596 ":define") d_getpwent_r_proto=define
14597 set d_getpwent_r_proto getpwent_r $hdrs
14601 case "$d_getpwent_r_proto" in
14603 case "$getpwent_r_proto" in
14604 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14605 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14607 case "$getpwent_r_proto" in
14608 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14609 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14611 case "$getpwent_r_proto" in
14612 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14613 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14615 case "$getpwent_r_proto" in
14616 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14617 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14619 case "$getpwent_r_proto" in
14620 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14621 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14623 case "$getpwent_r_proto" in
14624 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14625 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14627 case "$getpwent_r_proto" in
14628 ''|0) d_getpwent_r=undef
14630 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14631 * ) case "$getpwent_r_proto" in
14632 REENTRANT_PROTO*) ;;
14633 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14635 echo "Prototype: $try" ;;
14638 *) case "$usethreads" in
14639 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14646 *) getpwent_r_proto=0
14650 : see if getpwnam_r exists
14651 set getpwnam_r d_getpwnam_r
14653 case "$d_getpwnam_r" in
14655 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14656 case "$d_getpwnam_r_proto:$usethreads" in
14657 ":define") d_getpwnam_r_proto=define
14658 set d_getpwnam_r_proto getpwnam_r $hdrs
14662 case "$d_getpwnam_r_proto" in
14664 case "$getpwnam_r_proto" in
14665 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14666 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14668 case "$getpwnam_r_proto" in
14669 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14670 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14672 case "$getpwnam_r_proto" in
14673 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14674 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14676 case "$getpwnam_r_proto" in
14677 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14678 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14680 case "$getpwnam_r_proto" in
14681 ''|0) d_getpwnam_r=undef
14683 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14684 * ) case "$getpwnam_r_proto" in
14685 REENTRANT_PROTO*) ;;
14686 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14688 echo "Prototype: $try" ;;
14691 *) case "$usethreads" in
14692 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14699 *) getpwnam_r_proto=0
14703 : see if getpwuid_r exists
14704 set getpwuid_r d_getpwuid_r
14706 case "$d_getpwuid_r" in
14708 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14709 case "$d_getpwuid_r_proto:$usethreads" in
14710 ":define") d_getpwuid_r_proto=define
14711 set d_getpwuid_r_proto getpwuid_r $hdrs
14715 case "$d_getpwuid_r_proto" in
14717 case "$getpwuid_r_proto" in
14718 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14719 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14721 case "$getpwuid_r_proto" in
14722 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14723 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14725 case "$getpwuid_r_proto" in
14726 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14727 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14729 case "$getpwuid_r_proto" in
14730 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14731 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14733 case "$getpwuid_r_proto" in
14734 ''|0) d_getpwuid_r=undef
14736 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14737 * ) case "$getpwuid_r_proto" in
14738 REENTRANT_PROTO*) ;;
14739 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14741 echo "Prototype: $try" ;;
14744 *) case "$usethreads" in
14745 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14752 *) getpwuid_r_proto=0
14756 : Optional checks for getsbyname and getsbyport
14758 : see if getservbyname exists
14759 set getservbyname d_getsbyname
14762 : see if getservbyport exists
14763 set getservbyport d_getsbyport
14766 : see if getservent exists
14767 set getservent d_getsent
14770 : see if getservbyname_r exists
14771 set getservbyname_r d_getservbyname_r
14773 case "$d_getservbyname_r" in
14775 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14776 case "$d_getservbyname_r_proto:$usethreads" in
14777 ":define") d_getservbyname_r_proto=define
14778 set d_getservbyname_r_proto getservbyname_r $hdrs
14782 case "$d_getservbyname_r_proto" in
14784 case "$getservbyname_r_proto" in
14785 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14786 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14788 case "$getservbyname_r_proto" in
14789 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14790 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14792 case "$getservbyname_r_proto" in
14793 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14794 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14796 case "$getservbyname_r_proto" in
14797 ''|0) d_getservbyname_r=undef
14798 getservbyname_r_proto=0
14799 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14800 * ) case "$getservbyname_r_proto" in
14801 REENTRANT_PROTO*) ;;
14802 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14804 echo "Prototype: $try" ;;
14807 *) case "$usethreads" in
14808 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14810 d_getservbyname_r=undef
14811 getservbyname_r_proto=0
14815 *) getservbyname_r_proto=0
14819 : see if getservbyport_r exists
14820 set getservbyport_r d_getservbyport_r
14822 case "$d_getservbyport_r" in
14824 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14825 case "$d_getservbyport_r_proto:$usethreads" in
14826 ":define") d_getservbyport_r_proto=define
14827 set d_getservbyport_r_proto getservbyport_r $hdrs
14831 case "$d_getservbyport_r_proto" in
14833 case "$getservbyport_r_proto" in
14834 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14835 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14837 case "$getservbyport_r_proto" in
14838 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14839 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14841 case "$getservbyport_r_proto" in
14842 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14843 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14845 case "$getservbyport_r_proto" in
14846 ''|0) d_getservbyport_r=undef
14847 getservbyport_r_proto=0
14848 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14849 * ) case "$getservbyport_r_proto" in
14850 REENTRANT_PROTO*) ;;
14851 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14853 echo "Prototype: $try" ;;
14856 *) case "$usethreads" in
14857 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14859 d_getservbyport_r=undef
14860 getservbyport_r_proto=0
14864 *) getservbyport_r_proto=0
14868 : see if getservent_r exists
14869 set getservent_r d_getservent_r
14871 case "$d_getservent_r" in
14873 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14874 case "$d_getservent_r_proto:$usethreads" in
14875 ":define") d_getservent_r_proto=define
14876 set d_getservent_r_proto getservent_r $hdrs
14880 case "$d_getservent_r_proto" in
14882 case "$getservent_r_proto" in
14883 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14884 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14886 case "$getservent_r_proto" in
14887 ''|0) try='int getservent_r(struct servent*, char*, int);'
14888 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14890 case "$getservent_r_proto" in
14891 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14892 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14894 case "$getservent_r_proto" in
14895 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14896 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14898 case "$getservent_r_proto" in
14899 ''|0) d_getservent_r=undef
14900 getservent_r_proto=0
14901 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14902 * ) case "$getservent_r_proto" in
14903 REENTRANT_PROTO*) ;;
14904 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14906 echo "Prototype: $try" ;;
14909 *) case "$usethreads" in
14910 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14912 d_getservent_r=undef
14913 getservent_r_proto=0
14917 *) getservent_r_proto=0
14921 : see if prototypes for various getservxxx netdb.h functions are available
14923 set d_getservprotos getservent $i_netdb netdb.h
14926 : see if getspnam exists
14927 set getspnam d_getspnam
14930 : see if this is a shadow.h system
14931 set shadow.h i_shadow
14934 : see if getspnam_r exists
14935 set getspnam_r d_getspnam_r
14937 case "$d_getspnam_r" in
14939 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14940 case "$d_getspnam_r_proto:$usethreads" in
14941 ":define") d_getspnam_r_proto=define
14942 set d_getspnam_r_proto getspnam_r $hdrs
14946 case "$d_getspnam_r_proto" in
14948 case "$getspnam_r_proto" in
14949 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14950 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14952 case "$getspnam_r_proto" in
14953 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14954 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14956 case "$getspnam_r_proto" in
14957 ''|0) d_getspnam_r=undef
14959 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14960 * ) case "$getspnam_r_proto" in
14961 REENTRANT_PROTO*) ;;
14962 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14964 echo "Prototype: $try" ;;
14967 *) case "$usethreads" in
14968 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14975 *) getspnam_r_proto=0
14979 : see if gettimeofday or ftime exists
14980 set gettimeofday d_gettimeod
14982 case "$d_gettimeod" in
14988 val="$undef"; set d_ftime; eval $setvar
14991 case "$d_gettimeod$d_ftime" in
14994 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14998 : see if gmtime_r exists
14999 set gmtime_r d_gmtime_r
15001 case "$d_gmtime_r" in
15003 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15004 case "$d_gmtime_r_proto:$usethreads" in
15005 ":define") d_gmtime_r_proto=define
15006 set d_gmtime_r_proto gmtime_r $hdrs
15010 case "$d_gmtime_r_proto" in
15012 case "$gmtime_r_proto" in
15013 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15014 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15016 case "$gmtime_r_proto" in
15017 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15018 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15020 case "$gmtime_r_proto" in
15021 ''|0) d_gmtime_r=undef
15023 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15024 * ) case "$gmtime_r_proto" in
15025 REENTRANT_PROTO*) ;;
15026 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15028 echo "Prototype: $try" ;;
15031 *) case "$usethreads" in
15032 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15039 *) gmtime_r_proto=0
15043 : see if hasmntopt exists
15044 set hasmntopt d_hasmntopt
15047 : see if this is a netinet/in.h or sys/in.h system
15048 set netinet/in.h i_niin sys/in.h i_sysin
15051 : see if arpa/inet.h has to be included
15052 set arpa/inet.h i_arpainet
15055 : see if htonl --and friends-- exists
15060 : Maybe they are macros.
15063 $cat >htonl.c <<EOM
15065 #include <sys/types.h>
15066 #$i_niin I_NETINET_IN
15068 #$i_arpainet I_ARPA_INET
15069 #ifdef I_NETINET_IN
15070 #include <netinet/in.h>
15073 #include <sys/in.h>
15076 #include <arpa/inet.h>
15079 printf("Defined as a macro.");
15082 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15083 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15085 echo "But it seems to be defined as a macro." >&4
15093 : see if ilogbl exists
15094 set ilogbl d_ilogbl
15099 if set index val -f; eval $csym; $val; then
15100 if set strchr val -f d_strchr; eval $csym; $val; then
15101 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15104 echo "strchr() found." >&4
15108 echo "index() found." >&4
15113 echo "index() found." >&4
15116 if set strchr val -f d_strchr; eval $csym; $val; then
15119 echo "strchr() found." >&4
15121 echo "No index() or strchr() found!" >&4
15126 set d_strchr; eval $setvar
15128 set d_index; eval $setvar
15130 : check whether inet_aton exists
15131 set inet_aton d_inetaton
15134 : see if inet_ntop exists
15135 set inet_ntop d_inetntop
15138 : see if inet_pton exists
15139 set inet_pton d_inetpton
15144 $cat >isascii.c <<EOCP
15147 #$i_stdlib I_STDLIB
15149 #include <stdlib.h>
15160 if eval $compile; then
15161 echo "isascii() found." >&4
15164 echo "isascii() NOT found." >&4
15173 $cat >isblank.c <<'EOCP'
15184 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15185 echo "isblank() found." >&4
15188 echo "isblank() NOT found." >&4
15195 : see if isfinite exists
15196 set isfinite d_isfinite
15199 : see if isinf exists
15203 : see if isnan exists
15207 : see if isnanl exists
15208 set isnanl d_isnanl
15211 : see if killpg exists
15212 set killpg d_killpg
15215 : see if lchown exists
15217 $cat > try.c <<'EOCP'
15218 /* System header to define __stub macros and hopefully few prototypes,
15219 which can conflict with char lchown(); below. */
15220 #include <assert.h>
15221 /* Override any gcc2 internal prototype to avoid an error. */
15222 /* We use char because int might match the return type of a gcc2
15223 builtin and then its argument prototype would still apply. */
15226 /* The GNU C library defines this for functions which it implements
15227 to always fail with ENOSYS. Some functions are actually named
15228 something starting with __ and the normal name is an alias. */
15229 #if defined (__stub_lchown) || defined (__stub___lchown)
15237 if eval $compile; then
15238 $echo "lchown() found." >&4
15241 $echo "lchown() NOT found." >&4
15247 : See if number of significant digits in a double precision number is known
15249 $cat >ldbl_dig.c <<EOM
15250 #$i_limits I_LIMITS
15253 #include <limits.h>
15259 printf("Contains LDBL_DIG");
15262 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15263 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15264 echo "LDBL_DIG found." >&4
15267 echo "LDBL_DIG NOT found." >&4
15274 : see if this is a math.h system
15278 : check to see if math.h defines _LIB_VERSION
15279 d_libm_lib_version="$undef"
15283 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15285 #include <unistd.h>
15287 int main (int argc, char *argv[])
15289 printf ("%d\n", _LIB_VERSION);
15294 if eval $compile; then
15296 echo "Yes, it does ($foo)" >&4
15297 d_libm_lib_version="$define"
15299 echo "No, it does not (probably harmless)" >&4
15306 : see if link exists
15310 : see if localtime_r exists
15311 set localtime_r d_localtime_r
15313 case "$d_localtime_r" in
15315 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15316 case "$d_localtime_r_proto:$usethreads" in
15317 ":define") d_localtime_r_proto=define
15318 set d_localtime_r_proto localtime_r $hdrs
15322 case "$d_localtime_r_proto" in
15324 case "$localtime_r_proto" in
15325 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15326 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15328 case "$localtime_r_proto" in
15329 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15330 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15332 case "$localtime_r_proto" in
15333 ''|0) d_localtime_r=undef
15334 localtime_r_proto=0
15335 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15336 * ) case "$localtime_r_proto" in
15337 REENTRANT_PROTO*) ;;
15338 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15340 echo "Prototype: $try" ;;
15343 *) case "$usethreads" in
15344 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15346 d_localtime_r=undef
15347 localtime_r_proto=0
15351 *) localtime_r_proto=0
15355 : see if localtime_r calls tzset
15356 case "$localtime_r_proto" in
15359 /* Does our libc's localtime_r call tzset ?
15360 * return 0 if so, 1 otherwise.
15362 #$i_systypes I_SYS_TYPES
15363 #$i_unistd I_UNISTD
15365 #$i_stdlib I_STDLIB
15366 #$i_string I_STRING
15367 #$i_malloc I_MALLOC
15369 # include <sys/types.h>
15372 # include <unistd.h>
15378 #include <stdlib.h>
15381 # include <string.h>
15383 # include <strings.h>
15386 # include <malloc.h>
15390 time_t t = time(0L);
15391 char w_tz[]="TZ" "=GMT+5",
15392 e_tz[]="TZ" "=GMT-5",
15393 *tz_e = (char*)malloc(16),
15394 *tz_w = (char*)malloc(16);
15395 struct tm tm_e, tm_w;
15396 memset(&tm_e,'\0',sizeof(struct tm));
15397 memset(&tm_w,'\0',sizeof(struct tm));
15402 localtime_r(&t, &tm_e);
15405 localtime_r(&t, &tm_w);
15407 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15413 if eval $compile; then
15414 if $run ./try; then
15415 d_localtime_r_needs_tzset=undef;
15417 d_localtime_r_needs_tzset=define;
15420 d_localtime_r_needs_tzset=undef;
15424 d_localtime_r_needs_tzset=undef;
15429 : see if localeconv exists
15430 set localeconv d_locconv
15433 : see if lockf exists
15437 : see if prototype for lseek is available
15439 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15442 : see if lstat exists
15446 : see if madvise exists
15447 set madvise d_madvise
15450 : see if malloc_size exists
15451 set malloc_size d_malloc_size
15454 : see if malloc_size_good exists
15455 set malloc_good_size d_malloc_good_size
15458 : see if mblen exists
15462 : see if mbstowcs exists
15463 set mbstowcs d_mbstowcs
15466 : see if mbtowc exists
15467 set mbtowc d_mbtowc
15470 : see if memchr exists
15471 set memchr d_memchr
15474 : see if memcmp exists
15475 set memcmp d_memcmp
15478 : see if memcpy exists
15479 set memcpy d_memcpy
15482 : see if memmove exists
15483 set memmove d_memmove
15486 : see if memset exists
15487 set memset d_memset
15490 : see if mkdir exists
15494 : see if mkdtemp exists
15495 set mkdtemp d_mkdtemp
15498 : see if mkfifo exists
15499 set mkfifo d_mkfifo
15502 : see if mkstemp exists
15503 set mkstemp d_mkstemp
15506 : see if mkstemps exists
15507 set mkstemps d_mkstemps
15510 : see if mktime exists
15511 set mktime d_mktime
15514 : see if this is a sys/mman.h system
15515 set sys/mman.h i_sysmman
15518 : see if mmap exists
15521 : see what shmat returns
15522 : default to something harmless
15524 case "$i_sysmman$d_mmap" in
15526 $cat >mmap.c <<'END'
15527 #include <sys/mman.h>
15530 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15535 echo "and it returns ($mmaptype)." >&4
15541 : see if sqrtl exists
15545 : see if scalbnl exists
15546 set scalbnl d_scalbnl
15549 : see if modfl exists
15553 : see if prototype for modfl is available
15555 set d_modflproto modfl $i_math math.h
15558 d_modfl_pow32_bug="$undef"
15560 case "$d_longdbl$d_modfl" in
15563 Checking to see whether your modfl() is okay for large values...
15569 if $test "X$d_modflproto" != "X$define"; then
15570 $cat >>try.c <<EOCP
15571 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15572 long double modfl (long double, long double *);
15575 $cat >>try.c <<EOCP
15577 long double nv = 4294967303.15;
15583 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15587 case "$osname:$gccversion" in
15588 aix:) saveccflags="$ccflags"
15589 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15592 if eval $compile; then
15595 *" 4294967303.150000 1.150000 4294967302.000000")
15596 echo >&4 "Your modfl() is broken for large values."
15597 d_modfl_pow32_bug="$define"
15599 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15603 *" 4294967303.150000 0.150000 4294967303.000000")
15604 echo >&4 "Your modfl() seems okay for large values."
15606 *) echo >&4 "I don't understand your modfl() at all."
15612 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15615 case "$osname:$gccversion" in
15616 aix:) ccflags="$saveccflags" ;; # restore
15621 if $test "$uselongdouble" = "$define"; then
15623 if $test "$d_sqrtl" != "$define"; then
15624 message="$message sqrtl"
15626 if $test "$d_modfl" != "$define"; then
15627 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15628 echo "You have both aintl and copysignl, so I can emulate modfl."
15630 message="$message modfl"
15633 if $test "$d_frexpl" != "$define"; then
15634 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15635 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15637 message="$message frexpl"
15641 if $test "$message" != ""; then
15644 *** You requested the use of long doubles but you do not seem to have
15645 *** the following mathematical functions needed for long double support:
15647 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15648 *** Cannot continue, aborting.
15656 : see if mprotect exists
15657 set mprotect d_mprotect
15660 : see if msgctl exists
15661 set msgctl d_msgctl
15664 : see if msgget exists
15665 set msgget d_msgget
15668 : see if msgsnd exists
15669 set msgsnd d_msgsnd
15672 : see if msgrcv exists
15673 set msgrcv d_msgrcv
15676 : see how much of the 'msg*(2)' library is present.
15679 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15680 *"$undef"*) h_msg=false;;
15684 case "`ipcs 2>&1`" in
15685 "SVID messages"*"not configured"*)
15686 echo "Your $osname does not have the msg*(2) configured." >&4
15689 set msgctl d_msgctl
15691 set msgget d_msgget
15693 set msgsnd d_msgsnd
15695 set msgrcv d_msgrcv
15701 : we could also check for sys/ipc.h ...
15702 if $h_msg && $test `./findhdr sys/msg.h`; then
15703 echo "You have the full msg*(2) library." >&4
15706 echo "You don't have the full msg*(2) library." >&4
15712 : Check for msghdr_s
15714 echo "Checking to see if your system supports struct msghdr..." >&4
15715 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15717 case "$d_msghdr_s" in
15718 "$define") echo "Yes, it does." ;;
15719 *) echo "No, it doesn't." ;;
15723 : see if msync exists
15727 : see if munmap exists
15728 set munmap d_munmap
15731 : see if nice exists
15735 : see if this is a langinfo.h system
15736 set langinfo.h i_langinfo
15739 : see if nl_langinfo exists
15740 set nl_langinfo d_nl_langinfo
15743 : check for volatile keyword
15745 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15746 $cat >try.c <<'EOCP'
15749 typedef struct _goo_struct goo_struct;
15750 goo_struct * volatile goo = ((goo_struct *)0);
15751 struct _goo_struct {
15756 typedef unsigned short foo_t;
15757 char *volatile foo;
15759 volatile foo_t blech;
15763 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15765 echo "Yup, it does."
15768 echo "Nope, it doesn't."
15774 : Check basic sizes
15776 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15778 case "$use64bitint:$d_quad:$quadtype" in
15781 uvtype="$uquadtype"
15786 uvtype="unsigned long"
15792 case "$uselongdouble:$d_longdbl" in
15794 nvtype="long double"
15795 nvsize=$longdblsize
15802 $echo "(IV will be "$ivtype", $ivsize bytes)"
15803 $echo "(UV will be "$uvtype", $uvsize bytes)"
15804 $echo "(NV will be "$nvtype", $nvsize bytes)"
15807 #$i_inttypes I_INTTYPES
15809 #include <inttypes.h>
15814 int8_t i = INT8_MAX;
15815 uint8_t u = UINT8_MAX;
15816 printf("int8_t\n");
15819 int16_t i = INT16_MAX;
15820 uint16_t u = UINT16_MAX;
15821 printf("int16_t\n");
15824 int32_t i = INT32_MAX;
15825 uint32_t u = UINT32_MAX;
15826 printf("int32_t\n");
15831 i8type="signed char"
15832 u8type="unsigned char"
15837 '') case "$shortsize" in
15839 u16type="unsigned short"
15847 '') set try -DINT16
15848 if eval $compile; then
15849 case "`$run ./try`" in
15861 '') if $test $shortsize -ge 2; then
15863 u16type="unsigned short"
15871 '') case "$longsize" in
15873 u32type="unsigned long"
15877 *) case "$intsize" in
15879 u32type="unsigned int"
15889 '') set try -DINT32
15890 if eval $compile; then
15891 case "`$run ./try`" in
15903 '') if $test $intsize -ge 4; then
15905 u32type="unsigned int"
15913 '') case "$d_quad:$quadtype" in
15915 i64type="$quadtype"
15916 u64type="$uquadtype"
15924 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15925 : volatile so that the compiler has to store it out to memory.
15926 if test X"$d_volatile" = X"$define"; then
15931 #$i_stdlib I_STDLIB
15933 #include <stdlib.h>
15935 #include <sys/types.h>
15936 #include <signal.h>
15938 $volatile int bletched = 0;
15939 $signal_t blech(int s) { bletched = 1; }
15944 int n = 8 * $uvsize;
15947 signal(SIGFPE, blech);
15950 for (i = 0; i < n; i++) {
15951 u = u << 1 | ($uvtype)1;
15953 if (($uvtype)d != u)
15957 d = ($nvtype)(u - 1);
15958 if (($uvtype)d != (u - 1))
15965 printf("%d\n", ((i == n) ? -n : i));
15971 d_nv_preserves_uv="$undef"
15972 if eval $compile; then
15973 nv_preserves_uv_bits="`$run ./try`"
15975 case "$nv_preserves_uv_bits" in
15977 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15978 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15979 d_nv_preserves_uv="$define"
15981 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15982 d_nv_preserves_uv="$undef" ;;
15983 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15984 nv_preserves_uv_bits="0" ;;
15988 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15989 : volatile so that the compiler has to store it out to memory.
15990 if test X"$d_volatile" = X"$define"; then
15996 typedef $nvtype NV;
16003 while(count < 256) {
16004 $volatile NV up = value + 1.0;
16005 $volatile NV negated = -value;
16006 $volatile NV down = negated - 1.0;
16007 $volatile NV got_up = up - value;
16008 int up_good = got_up == 1.0;
16009 int got_down = down - negated;
16010 int down_good = got_down == -1.0;
16012 if (down_good != up_good) {
16014 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16015 up_good, (double) got_up, down_good, (double) got_down,
16016 count, (double) value);
16023 fputs("256.0", stdout);
16026 fputs("2.0", stdout);
16032 fputs("*", stdout);
16038 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16039 count, (double) value);
16045 nv_overflows_integers_at='0'
16046 if eval $compile; then
16052 The largest integer your NVs can preserve is equal to $xxx
16054 nv_overflows_integers_at="$xxx"
16057 Cannot determine the largest integer value your NVs can hold, unexpected output
16064 Cannot determine the largest integer value your NVs can hold
16071 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16072 : volatile so that the compiler has to store it out to memory.
16073 if test X"$d_volatile" = X"$define"; then
16078 #$i_stdlib I_STDLIB
16080 #include <stdlib.h>
16082 #$i_string I_STRING
16084 # include <string.h>
16086 # include <strings.h>
16088 #include <sys/types.h>
16089 #include <signal.h>
16091 $volatile int bletched = 0;
16092 $signal_t blech(int s) { bletched = 1; }
16095 int checkit($nvtype d, char *where) {
16096 unsigned char *p = (char *)&d;
16097 unsigned char *end = p + sizeof(d);
16107 printf("No - %s: 0x", where);
16109 printf ("%02X", *p++);
16114 int main(int argc, char **argv) {
16117 fail += checkit(d, "0.0");
16119 /* The compiler shouldn't be assuming that bletched is 0 */
16122 fail += checkit(d, "bleched");
16125 signal(SIGFPE, blech);
16128 /* Paranoia - the compiler should have no way of knowing that ANSI says
16129 that argv[argc] will always be NULL. Actually, if it did assume this it
16130 would be buggy, as this is C and main() can be called from elsewhere in
16132 d = argv[argc] ? 1 : 0;
16135 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16138 fail += checkit(d, "ternary");
16140 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16143 printf("No - memset doesn't give 0.0\n");
16144 /* This might just blow up: */
16145 printf("(gives %g)\n", d);
16151 printf("No - something bleched\n");
16156 printf("No - %d fail(s)\n", fail);
16165 d_nv_zero_is_allbits_zero="$undef"
16166 if eval $compile; then
16172 0.0 is represented as all bits zero in memory
16174 d_nv_zero_is_allbits_zero="$define"
16177 0.0 is not represented as all bits zero in memory
16179 d_nv_zero_is_allbits_zero="$undef"
16184 0.0 is not represented as all bits zero in memory
16186 d_nv_zero_is_allbits_zero="$undef"
16192 : check for off64_t
16194 echo "Checking to see if you have off64_t..." >&4
16196 #include <sys/types.h>
16197 #include <unistd.h>
16198 int main() { off64_t x = 7; }
16201 if eval $compile; then
16203 echo "You have off64_t."
16206 echo "You do not have off64_t."
16207 case "$lseeksize" in
16208 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16215 : how to create joinable pthreads
16216 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16218 echo "Checking what constant to use for creating joinable pthreads..." >&4
16219 $cat >try.c <<'EOCP'
16220 #include <pthread.h>
16222 int detachstate = JOINABLE;
16225 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16226 if eval $compile; then
16227 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16228 val="$undef" # Yes, undef.
16229 set d_old_pthread_create_joinable
16232 set old_pthread_create_joinable
16235 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16236 if eval $compile; then
16237 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16239 set d_old_pthread_create_joinable
16241 val=PTHREAD_CREATE_UNDETACHED
16242 set old_pthread_create_joinable
16245 set try -DJOINABLE=__UNDETACHED
16246 if eval $compile; then
16247 echo "You seem to use __UNDETACHED." >&4
16249 set d_old_pthread_create_joinable
16252 set old_pthread_create_joinable
16255 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16257 set d_old_pthread_create_joinable
16260 set old_pthread_create_joinable
16267 d_old_pthread_create_joinable="$undef"
16268 old_pthread_create_joinable=""
16271 : see if pause exists
16275 : see if poll exists
16279 : see if prctl exists
16283 : see if prctl supports PR_SET_NAME
16284 d_prctl_set_name=$undef
16288 #include <sys/prctl.h>
16290 int main (int argc, char *argv[])
16292 return (prctl (PR_SET_NAME, "Test"));
16296 if eval $compile_ok && $run ./try; then
16297 echo "Your prctl (PR_SET_NAME, ...) works"
16298 d_prctl_set_name=$define
16304 : see if readlink exists
16305 set readlink d_readlink
16308 : Check if exe is symlink to abs path of executing program
16312 case "$d_readlink" in
16314 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16315 : more tidy to avoid an extra level of symlink
16316 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16317 while test $# -gt 0; do
16320 if $issymlink $try; then
16321 $ls -l $try > reflect
16322 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16323 echo "You have $type-like $try."
16324 procselfexe='"'$try'"'
16326 : This will break out of the loop
16337 : backward compatibility for d_hvfork
16338 if test X$d_hvfork != X; then
16339 d_vfork="$d_hvfork"
16342 : see if there is a vfork
16347 d_pseudofork=$undef
16349 : Ok, but do we want to use it. vfork is reportedly unreliable in
16350 : perl on Solaris 2.x, and probably elsewhere.
16354 case "$usevfork" in
16360 Perl can only use a vfork() that doesn't suffer from strict
16361 restrictions on calling functions or modifying global data in
16362 the child. For example, glibc-2.1 contains such a vfork()
16363 that is unsuitable. If your system provides a proper fork()
16364 call, chances are that you do NOT want perl to use vfork().
16367 rp="Do you still want to use vfork()?"
16372 echo "Ok, we won't use vfork()."
16381 $define) usevfork='true';;
16382 *) usevfork='false';;
16385 : see whether the pthread_atfork exists
16387 #include <pthread.h>
16390 #ifdef PTHREAD_ATFORK
16391 pthread_atfork(NULL,NULL,NULL);
16396 : see if pthread_atfork exists
16397 set try -DPTHREAD_ATFORK
16398 if eval $compile; then
16403 case "$usethreads" in
16406 $define) echo 'pthread_atfork found.' >&4 ;;
16407 *) echo 'pthread_atfork NOT found.' >&4 ;;
16410 set d_pthread_atfork
16413 : see if pthread_attr_setscope exists
16414 set pthread_attr_setscope d_pthread_attr_setscope
16417 : see whether the various POSIXish _yields exist
16419 #include <pthread.h>
16425 #ifdef PTHREAD_YIELD
16428 #ifdef PTHREAD_YIELD_NULL
16429 pthread_yield(NULL);
16435 : see if sched_yield exists
16436 set try -DSCHED_YIELD
16437 if eval $compile; then
16439 sched_yield='sched_yield()'
16443 case "$usethreads" in
16446 $define) echo 'sched_yield() found.' >&4 ;;
16447 *) echo 'sched_yield() NOT found.' >&4 ;;
16453 : see if pthread_yield exists
16454 set try -DPTHREAD_YIELD
16455 if eval $compile; then
16457 case "$sched_yield" in
16458 '') sched_yield='pthread_yield()' ;;
16461 set try -DPTHREAD_YIELD_NULL
16462 if eval $compile; then
16464 case "$sched_yield" in
16465 '') sched_yield='pthread_yield(NULL)' ;;
16471 case "$usethreads" in
16474 $define) echo 'pthread_yield() found.' >&4 ;;
16475 *) echo 'pthread_yield() NOT found.' >&4 ;;
16479 set d_pthread_yield
16481 case "$sched_yield" in
16482 '') sched_yield=undef ;;
16486 : see if random_r exists
16487 set random_r d_random_r
16489 case "$d_random_r" in
16491 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16492 case "$d_random_r_proto:$usethreads" in
16493 ":define") d_random_r_proto=define
16494 set d_random_r_proto random_r $hdrs
16498 case "$d_random_r_proto" in
16500 case "$random_r_proto" in
16501 ''|0) try='int random_r(int*, struct random_data*);'
16502 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16504 case "$random_r_proto" in
16505 ''|0) try='int random_r(long*, struct random_data*);'
16506 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16508 case "$random_r_proto" in
16509 ''|0) try='int random_r(struct random_data*, int32_t*);'
16510 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16512 case "$random_r_proto" in
16513 ''|0) d_random_r=undef
16515 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16516 * ) case "$random_r_proto" in
16517 REENTRANT_PROTO*) ;;
16518 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16520 echo "Prototype: $try" ;;
16523 *) case "$usethreads" in
16524 define) echo "random_r has no prototype, not using it." >&4 ;;
16531 *) random_r_proto=0
16535 : see if readdir and friends exist
16536 set readdir d_readdir
16538 set seekdir d_seekdir
16540 set telldir d_telldir
16542 set rewinddir d_rewinddir
16545 : see if readdir64_r exists
16546 set readdir64_r d_readdir64_r
16548 case "$d_readdir64_r" in
16550 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16551 case "$d_readdir64_r_proto:$usethreads" in
16552 ":define") d_readdir64_r_proto=define
16553 set d_readdir64_r_proto readdir64_r $hdrs
16557 case "$d_readdir64_r_proto" in
16559 case "$readdir64_r_proto" in
16560 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16561 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16563 case "$readdir64_r_proto" in
16564 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16565 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16567 case "$readdir64_r_proto" in
16568 ''|0) d_readdir64_r=undef
16569 readdir64_r_proto=0
16570 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16571 * ) case "$readdir64_r_proto" in
16572 REENTRANT_PROTO*) ;;
16573 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16575 echo "Prototype: $try" ;;
16578 *) case "$usethreads" in
16579 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16581 d_readdir64_r=undef
16582 readdir64_r_proto=0
16586 *) readdir64_r_proto=0
16590 : see if readdir_r exists
16591 set readdir_r d_readdir_r
16593 case "$d_readdir_r" in
16595 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16596 case "$d_readdir_r_proto:$usethreads" in
16597 ":define") d_readdir_r_proto=define
16598 set d_readdir_r_proto readdir_r $hdrs
16602 case "$d_readdir_r_proto" in
16604 case "$readdir_r_proto" in
16605 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16606 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16608 case "$readdir_r_proto" in
16609 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16610 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16612 case "$readdir_r_proto" in
16613 ''|0) d_readdir_r=undef
16615 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16616 * ) case "$readdir_r_proto" in
16617 REENTRANT_PROTO*) ;;
16618 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16620 echo "Prototype: $try" ;;
16623 *) case "$usethreads" in
16624 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16631 *) readdir_r_proto=0
16635 : see if readv exists
16639 : see if recvmsg exists
16640 set recvmsg d_recvmsg
16643 : see if rename exists
16644 set rename d_rename
16647 : see if rmdir exists
16651 : see if memory.h is available.
16656 : See if it conflicts with string.h
16662 $cppstdin $cppflags $cppminus < $strings > mem.h
16663 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16665 echo "We won't be including <memory.h>."
16675 : can bcopy handle overlapping blocks?
16678 case "$d_memmove" in
16679 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16680 *) case "$d_bcopy" in
16682 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16684 #$i_memory I_MEMORY
16685 #$i_stdlib I_STDLIB
16686 #$i_string I_STRING
16687 #$i_unistd I_UNISTD
16689 $cat >>try.c <<'EOCP'
16692 # include <memory.h>
16695 # include <stdlib.h>
16698 # include <string.h>
16700 # include <strings.h>
16703 # include <unistd.h> /* Needed for NetBSD */
16707 char buf[128], abc[128];
16713 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16714 try to store the string in read-only memory. */
16715 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16717 for (align = 7; align >= 0; align--) {
16718 for (len = 36; len; len--) {
16720 bcopy(abc, b, len);
16721 for (off = 1; off <= len; off++) {
16722 bcopy(b, b+off, len);
16723 bcopy(b+off, b, len);
16724 if (bcmp(b, abc, len))
16733 if eval $compile_ok; then
16734 if $run ./try 2>/dev/null; then
16735 echo "Yes, it can."
16738 echo "It can't, sorry."
16741 echo "(I can't compile the test program, so we'll assume not...)"
16751 : can memcpy handle overlapping blocks?
16754 case "$d_memmove" in
16755 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16756 *) case "$d_memcpy" in
16758 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16760 #$i_memory I_MEMORY
16761 #$i_stdlib I_STDLIB
16762 #$i_string I_STRING
16763 #$i_unistd I_UNISTD
16765 $cat >>try.c <<'EOCP'
16768 # include <memory.h>
16771 # include <stdlib.h>
16774 # include <string.h>
16776 # include <strings.h>
16779 # include <unistd.h> /* Needed for NetBSD */
16783 char buf[128], abc[128];
16789 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16790 try to store the string in read-only memory. */
16791 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16793 for (align = 7; align >= 0; align--) {
16794 for (len = 36; len; len--) {
16796 memcpy(b, abc, len);
16797 for (off = 1; off <= len; off++) {
16798 memcpy(b+off, b, len);
16799 memcpy(b, b+off, len);
16800 if (memcmp(b, abc, len))
16809 if eval $compile_ok; then
16810 if $run ./try 2>/dev/null; then
16811 echo "Yes, it can."
16814 echo "It can't, sorry."
16817 echo "(I can't compile the test program, so we'll assume not...)"
16827 : can memcmp be trusted to compare relative magnitude?
16829 case "$d_memcmp" in
16832 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16834 #$i_memory I_MEMORY
16835 #$i_stdlib I_STDLIB
16836 #$i_string I_STRING
16837 #$i_unistd I_UNISTD
16839 $cat >>try.c <<'EOCP'
16842 # include <memory.h>
16845 # include <stdlib.h>
16848 # include <string.h>
16850 # include <strings.h>
16853 # include <unistd.h> /* Needed for NetBSD */
16859 if ((a < b) && memcmp(&a, &b, 1) < 0)
16865 if eval $compile_ok; then
16866 if $run ./try 2>/dev/null; then
16867 echo "Yes, it can."
16870 echo "No, it can't (it uses signed chars)."
16873 echo "(I can't compile the test program, so we'll assume not...)"
16881 : see if prototype for sbrk is available
16883 set d_sbrkproto sbrk $i_unistd unistd.h
16886 : see if select exists
16887 set select d_select
16890 : see if semctl exists
16891 set semctl d_semctl
16894 : see if semget exists
16895 set semget d_semget
16898 : see if semop exists
16902 : see how much of the 'sem*(2)' library is present.
16905 case "$d_semctl$d_semget$d_semop" in
16906 *"$undef"*) h_sem=false;;
16910 case "`ipcs 2>&1`" in
16911 "SVID messages"*"not configured"*)
16912 echo "Your $osname does not have the sem*(2) configured." >&4
16915 set semctl d_semctl
16917 set semget d_semget
16925 : we could also check for sys/ipc.h ...
16926 if $h_sem && $test `./findhdr sys/sem.h`; then
16927 echo "You have the full sem*(2) library." >&4
16930 echo "You don't have the full sem*(2) library." >&4
16936 : see whether sys/sem.h defines union semun
16938 $cat > try.c <<'END'
16939 #include <sys/types.h>
16940 #include <sys/ipc.h>
16941 #include <sys/sem.h>
16942 int main () { union semun semun; semun.buf = 0; }
16945 if eval $compile; then
16946 echo "You have union semun in <sys/sem.h>." >&4
16949 echo "You do not have union semun in <sys/sem.h>." >&4
16956 : see how to do semctl IPC_STAT
16960 $cat > tryh.h <<END
16963 # define S_IRUSR S_IREAD
16964 # define S_IWUSR S_IWRITE
16965 # define S_IXUSR S_IEXEC
16967 # define S_IRUSR 0400
16968 # define S_IWUSR 0200
16969 # define S_IXUSR 0100
16971 # define S_IRGRP (S_IRUSR>>3)
16972 # define S_IWGRP (S_IWUSR>>3)
16973 # define S_IXGRP (S_IXUSR>>3)
16974 # define S_IROTH (S_IRUSR>>6)
16975 # define S_IWOTH (S_IWUSR>>6)
16976 # define S_IXOTH (S_IXUSR>>6)
16979 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16980 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16981 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16984 : see whether semctl IPC_STAT can use union semun
16985 case "$d_semctl_semun" in
16989 #include <sys/types.h>
16990 #include <sys/ipc.h>
16991 #include <sys/sem.h>
16992 #include <sys/stat.h>
16999 #$d_union_semun HAS_UNION_SEMUN
17002 #ifndef HAS_UNION_SEMUN
17005 struct semid_ds *buf;
17006 unsigned short *array;
17012 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17013 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17015 struct semid_ds argbuf;
17018 st = semctl(sem, 0, IPC_STAT, arg);
17022 # endif /* IPC_STAT */
17023 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17025 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17026 # endif /* IPC_RMID */
17027 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17029 #endif /* IPC_PRIVATE && ... */
17030 printf("semget failed: errno = %d\n", errno);
17035 if eval $compile; then
17038 semun) val="$define" ;;
17046 case "$d_semctl_semun" in
17048 echo "You can use union semun for semctl IPC_STAT." >&4
17051 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17056 : see whether semctl IPC_STAT can use struct semid_ds pointer
17057 case "$d_semctl_semid_ds" in
17060 $cat > try.c <<'END'
17061 #include <sys/types.h>
17062 #include <sys/ipc.h>
17063 #include <sys/sem.h>
17064 #include <sys/stat.h>
17072 struct semid_ds arg;
17075 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17076 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17079 st = semctl(sem, 0, IPC_STAT, &arg);
17081 printf("semid_ds\n");
17083 # endif /* IPC_STAT */
17084 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17086 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17087 # endif /* IPC_RMID */
17088 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17090 #endif /* IPC_PRIVATE && ... */
17091 printf("semget failed: errno = %d\n", errno);
17097 if eval $compile; then
17100 semid_ds) val="$define" ;;
17104 set d_semctl_semid_ds
17108 case "$d_semctl_semid_ds" in
17110 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17112 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17118 # We do not have the full sem*(2) library, so assume we can not
17124 set d_semctl_semid_ds
17130 : see if sendmsg exists
17131 set sendmsg d_sendmsg
17134 : see if setegid exists
17135 set setegid d_setegid
17138 : see if seteuid exists
17139 set seteuid d_seteuid
17142 : see if setgrent exists
17143 set setgrent d_setgrent
17146 : see if setgrent_r exists
17147 set setgrent_r d_setgrent_r
17149 case "$d_setgrent_r" in
17151 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17152 case "$d_setgrent_r_proto:$usethreads" in
17153 ":define") d_setgrent_r_proto=define
17154 set d_setgrent_r_proto setgrent_r $hdrs
17158 case "$d_setgrent_r_proto" in
17160 case "$setgrent_r_proto" in
17161 ''|0) try='int setgrent_r(FILE**);'
17162 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17164 case "$setgrent_r_proto" in
17165 ''|0) try='void setgrent_r(FILE**);'
17166 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17168 case "$setgrent_r_proto" in
17169 ''|0) d_setgrent_r=undef
17171 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17172 * ) case "$setgrent_r_proto" in
17173 REENTRANT_PROTO*) ;;
17174 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17176 echo "Prototype: $try" ;;
17179 *) case "$usethreads" in
17180 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17187 *) setgrent_r_proto=0
17191 : see if sethostent exists
17192 set sethostent d_sethent
17195 : see if sethostent_r exists
17196 set sethostent_r d_sethostent_r
17198 case "$d_sethostent_r" in
17200 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17201 case "$d_sethostent_r_proto:$usethreads" in
17202 ":define") d_sethostent_r_proto=define
17203 set d_sethostent_r_proto sethostent_r $hdrs
17207 case "$d_sethostent_r_proto" in
17209 case "$sethostent_r_proto" in
17210 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17211 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17213 case "$sethostent_r_proto" in
17214 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17215 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17217 case "$sethostent_r_proto" in
17218 ''|0) d_sethostent_r=undef
17219 sethostent_r_proto=0
17220 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17221 * ) case "$sethostent_r_proto" in
17222 REENTRANT_PROTO*) ;;
17223 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17225 echo "Prototype: $try" ;;
17228 *) case "$usethreads" in
17229 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17231 d_sethostent_r=undef
17232 sethostent_r_proto=0
17236 *) sethostent_r_proto=0
17240 : see if setitimer exists
17241 set setitimer d_setitimer
17244 : see if setlinebuf exists
17245 set setlinebuf d_setlinebuf
17248 : see if setlocale exists
17249 set setlocale d_setlocale
17252 : see if locale.h is available
17253 set locale.h i_locale
17256 : see if setlocale_r exists
17257 set setlocale_r d_setlocale_r
17259 case "$d_setlocale_r" in
17261 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17262 case "$d_setlocale_r_proto:$usethreads" in
17263 ":define") d_setlocale_r_proto=define
17264 set d_setlocale_r_proto setlocale_r $hdrs
17268 case "$d_setlocale_r_proto" in
17270 case "$setlocale_r_proto" in
17271 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17272 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17274 case "$setlocale_r_proto" in
17275 ''|0) d_setlocale_r=undef
17276 setlocale_r_proto=0
17277 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17278 * ) case "$setlocale_r_proto" in
17279 REENTRANT_PROTO*) ;;
17280 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17282 echo "Prototype: $try" ;;
17285 *) case "$usethreads" in
17286 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17288 d_setlocale_r=undef
17289 setlocale_r_proto=0
17293 *) setlocale_r_proto=0
17297 : see if setnetent exists
17298 set setnetent d_setnent
17301 : see if setnetent_r exists
17302 set setnetent_r d_setnetent_r
17304 case "$d_setnetent_r" in
17306 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17307 case "$d_setnetent_r_proto:$usethreads" in
17308 ":define") d_setnetent_r_proto=define
17309 set d_setnetent_r_proto setnetent_r $hdrs
17313 case "$d_setnetent_r_proto" in
17315 case "$setnetent_r_proto" in
17316 ''|0) try='int setnetent_r(int, struct netent_data*);'
17317 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17319 case "$setnetent_r_proto" in
17320 ''|0) try='void setnetent_r(int, struct netent_data*);'
17321 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17323 case "$setnetent_r_proto" in
17324 ''|0) d_setnetent_r=undef
17325 setnetent_r_proto=0
17326 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17327 * ) case "$setnetent_r_proto" in
17328 REENTRANT_PROTO*) ;;
17329 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17331 echo "Prototype: $try" ;;
17334 *) case "$usethreads" in
17335 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17337 d_setnetent_r=undef
17338 setnetent_r_proto=0
17342 *) setnetent_r_proto=0
17346 : see if setprotoent exists
17347 set setprotoent d_setpent
17350 : see if setpgid exists
17351 set setpgid d_setpgid
17354 : see if setpgrp2 exists
17355 set setpgrp2 d_setpgrp2
17358 : see if setpriority exists
17359 set setpriority d_setprior
17362 : see if setproctitle exists
17363 set setproctitle d_setproctitle
17366 : see if setprotoent_r exists
17367 set setprotoent_r d_setprotoent_r
17369 case "$d_setprotoent_r" in
17371 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17372 case "$d_setprotoent_r_proto:$usethreads" in
17373 ":define") d_setprotoent_r_proto=define
17374 set d_setprotoent_r_proto setprotoent_r $hdrs
17378 case "$d_setprotoent_r_proto" in
17380 case "$setprotoent_r_proto" in
17381 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17382 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17384 case "$setprotoent_r_proto" in
17385 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17386 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17388 case "$setprotoent_r_proto" in
17389 ''|0) d_setprotoent_r=undef
17390 setprotoent_r_proto=0
17391 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17392 * ) case "$setprotoent_r_proto" in
17393 REENTRANT_PROTO*) ;;
17394 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17396 echo "Prototype: $try" ;;
17399 *) case "$usethreads" in
17400 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17402 d_setprotoent_r=undef
17403 setprotoent_r_proto=0
17407 *) setprotoent_r_proto=0
17411 : see if setpwent exists
17412 set setpwent d_setpwent
17415 : see if setpwent_r exists
17416 set setpwent_r d_setpwent_r
17418 case "$d_setpwent_r" in
17420 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17421 case "$d_setpwent_r_proto:$usethreads" in
17422 ":define") d_setpwent_r_proto=define
17423 set d_setpwent_r_proto setpwent_r $hdrs
17427 case "$d_setpwent_r_proto" in
17429 case "$setpwent_r_proto" in
17430 ''|0) try='int setpwent_r(FILE**);'
17431 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17433 case "$setpwent_r_proto" in
17434 ''|0) try='void setpwent_r(FILE**);'
17435 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17437 case "$setpwent_r_proto" in
17438 ''|0) d_setpwent_r=undef
17440 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17441 * ) case "$setpwent_r_proto" in
17442 REENTRANT_PROTO*) ;;
17443 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17445 echo "Prototype: $try" ;;
17448 *) case "$usethreads" in
17449 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17456 *) setpwent_r_proto=0
17460 : see if setregid exists
17461 set setregid d_setregid
17463 set setresgid d_setresgid
17466 : see if setreuid exists
17467 set setreuid d_setreuid
17469 set setresuid d_setresuid
17472 : see if setrgid exists
17473 set setrgid d_setrgid
17476 : see if setruid exists
17477 set setruid d_setruid
17480 : see if setservent exists
17481 set setservent d_setsent
17484 : see if setservent_r exists
17485 set setservent_r d_setservent_r
17487 case "$d_setservent_r" in
17489 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17490 case "$d_setservent_r_proto:$usethreads" in
17491 ":define") d_setservent_r_proto=define
17492 set d_setservent_r_proto setservent_r $hdrs
17496 case "$d_setservent_r_proto" in
17498 case "$setservent_r_proto" in
17499 ''|0) try='int setservent_r(int, struct servent_data*);'
17500 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17502 case "$setservent_r_proto" in
17503 ''|0) try='void setservent_r(int, struct servent_data*);'
17504 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17506 case "$setservent_r_proto" in
17507 ''|0) d_setservent_r=undef
17508 setservent_r_proto=0
17509 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17510 * ) case "$setservent_r_proto" in
17511 REENTRANT_PROTO*) ;;
17512 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17514 echo "Prototype: $try" ;;
17517 *) case "$usethreads" in
17518 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17520 d_setservent_r=undef
17521 setservent_r_proto=0
17525 *) setservent_r_proto=0
17529 : see if setsid exists
17530 set setsid d_setsid
17533 : see if setvbuf exists
17534 set setvbuf d_setvbuf
17537 : see if sfio.h is available
17541 : see if sfio library is available
17552 : Ok, but do we want to use it.
17556 true|$define|[yY]*) dflt='y';;
17559 echo "$package can use the sfio library, but it is experimental."
17560 rp="You seem to have sfio available, do you want to try using it?"
17563 y|Y) echo "Ok, turning on sfio then."
17566 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17571 *) case "$usesfio" in
17572 true|$define|[yY]*)
17573 echo "Sorry, cannot find sfio on this machine." >&4
17574 echo "Ignoring your setting of usesfio=$usesfio." >&4
17583 $define) usesfio='true';;
17584 *) usesfio='false';;
17588 *) : Remove sfio from list of libraries to use
17591 echo "Removing unneeded -lsfio from library list" >&4
17592 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17595 echo "libs = $libs" >&4
17602 : see if shmctl exists
17603 set shmctl d_shmctl
17606 : see if shmget exists
17607 set shmget d_shmget
17610 : see if shmat exists
17613 : see what shmat returns
17616 $cat >shmat.c <<'END'
17617 #include <sys/shm.h>
17620 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17625 echo "and it returns ($shmattype)." >&4
17626 : see if a prototype for shmat is available
17627 xxx=`./findhdr sys/shm.h`
17628 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17629 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17640 set d_shmatprototype
17643 : see if shmdt exists
17647 : see how much of the 'shm*(2)' library is present.
17650 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17651 *"$undef"*) h_shm=false;;
17655 case "`ipcs 2>&1`" in
17656 "SVID shared memory"*"not configured"*)
17657 echo "Your $osname does not have the shm*(2) configured." >&4
17660 set shmctl d_shmctl
17662 set shmget d_shmget
17672 : we could also check for sys/ipc.h ...
17673 if $h_shm && $test `./findhdr sys/shm.h`; then
17674 echo "You have the full shm*(2) library." >&4
17677 echo "You don't have the full shm*(2) library." >&4
17683 : see if we have sigaction
17685 if set sigaction val -f d_sigaction; eval $csym; $val; then
17686 echo 'sigaction() found.' >&4
17689 #include <sys/types.h>
17690 #include <signal.h>
17691 #$i_stdlib I_STDLIB
17693 #include <stdlib.h>
17697 struct sigaction act, oact;
17699 oact.sa_handler = 0;
17700 /* so that act and oact are used */
17701 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17705 if eval $compile_ok; then
17708 echo "But you don't seem to have a usable struct sigaction." >&4
17712 echo 'sigaction NOT found.' >&4
17715 set d_sigaction; eval $setvar
17718 : see if this is a sunmath.h system
17719 set sunmath.h i_sunmath
17722 : see if signbit exists
17723 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17726 #$i_sunmath I_SUNMATH
17730 #ifdef I_SUNMATH /* Solaris special math library */
17731 # include <sunmath.h>
17734 int main(int argc, char **argv)
17738 if ((signbit(x) == 0) && (signbit(y) != 0))
17746 if eval $compile; then
17747 if $run ./try; then
17751 $echo "Signbit seems to be available, but doesn't work as I expected."
17752 $echo "I won't use it." >&4
17763 : see if sigprocmask exists
17764 set sigprocmask d_sigprocmask
17767 : see if sigsetjmp exists
17769 case "$d_sigsetjmp" in
17772 #include <setjmp.h>
17773 #$i_stdlib I_STDLIB
17775 #include <stdlib.h>
17781 if (sigsetjmp(env,1))
17784 siglongjmp(env, 1);
17789 if eval $compile; then
17790 if $run ./try >/dev/null 2>&1; then
17791 echo "POSIX sigsetjmp found." >&4
17795 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17801 echo "sigsetjmp not found." >&4
17805 *) val="$d_sigsetjmp"
17806 case "$d_sigsetjmp" in
17807 $define) echo "POSIX sigsetjmp found." >&4;;
17808 $undef) echo "sigsetjmp not found." >&4;;
17816 : see if snprintf exists
17817 set snprintf d_snprintf
17820 : see if vsnprintf exists
17821 set vsnprintf d_vsnprintf
17824 case "$d_snprintf-$d_vsnprintf" in
17827 Checking whether your snprintf() and vsnprintf() work okay...
17829 $cat >try.c <<'EOCP'
17830 /* v?snprintf testing logic courtesy of Russ Allbery.
17831 * According to C99:
17832 * - if the buffer is too short it still must be \0-terminated
17833 * - if the buffer is too short the potentially required length
17834 * must be returned and not -1
17835 * - if the buffer is NULL the potentially required length
17836 * must be returned and not -1 or core dump
17839 #include <stdarg.h>
17843 int test (char *format, ...)
17848 va_start (args, format);
17849 count = vsnprintf (buf, sizeof buf, format, args);
17856 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17857 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17861 if eval $compile; then
17864 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17866 Your snprintf() and snprintf() don't seem to be working okay.
17868 d_snprintf="$undef"
17869 d_vsnprintf="$undef"
17873 echo "(I can't seem to compile the test program--assuming they don't)"
17874 d_snprintf="$undef"
17875 d_vsnprintf="$undef"
17881 : see if sockatmark exists
17882 set sockatmark d_sockatmark
17885 : see if prototype for sockatmark is available
17887 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17890 : see if socks5_init exists
17891 set socks5_init d_socks5_init
17894 : see if sprintf returns the length of the string in the buffer as per ANSI
17895 $echo "Checking whether sprintf returns the length of the string..." >&4
17898 #$i_stdlib I_STDLIB
17900 #include <stdlib.h>
17902 #$i_string I_STRING
17904 # include <string.h>
17906 # include <strings.h>
17915 int check (size_t expect, int test) {
17916 size_t got = strlen(buffer);
17920 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17925 int main(int argc, char **argv) {
17928 check(sprintf(buffer, ""), ++test);
17929 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17930 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17937 if eval $compile; then
17941 sprintf returns the length of the string (as ANSI says it should)
17943 d_sprintf_returns_strlen="$define"
17946 sprintf does not return the length of the string (how old is this system?)
17948 d_sprintf_returns_strlen="$undef"
17952 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17953 d_sprintf_returns_strlen="$undef"
17957 : see if srand48_r exists
17958 set srand48_r d_srand48_r
17960 case "$d_srand48_r" in
17962 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17963 case "$d_srand48_r_proto:$usethreads" in
17964 ":define") d_srand48_r_proto=define
17965 set d_srand48_r_proto srand48_r $hdrs
17969 case "$d_srand48_r_proto" in
17971 case "$srand48_r_proto" in
17972 ''|0) try='int srand48_r(long, struct drand48_data*);'
17973 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17975 case "$srand48_r_proto" in
17976 ''|0) d_srand48_r=undef
17978 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17979 * ) case "$srand48_r_proto" in
17980 REENTRANT_PROTO*) ;;
17981 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17983 echo "Prototype: $try" ;;
17986 *) case "$usethreads" in
17987 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17994 *) srand48_r_proto=0
17998 : see if srandom_r exists
17999 set srandom_r d_srandom_r
18001 case "$d_srandom_r" in
18003 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18004 case "$d_srandom_r_proto:$usethreads" in
18005 ":define") d_srandom_r_proto=define
18006 set d_srandom_r_proto srandom_r $hdrs
18010 case "$d_srandom_r_proto" in
18012 case "$srandom_r_proto" in
18013 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18014 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18016 case "$srandom_r_proto" in
18017 ''|0) d_srandom_r=undef
18019 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18020 * ) case "$srandom_r_proto" in
18021 REENTRANT_PROTO*) ;;
18022 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18024 echo "Prototype: $try" ;;
18027 *) case "$usethreads" in
18028 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18035 *) srandom_r_proto=0
18039 : see if prototype for setresgid is available
18041 set d_sresgproto setresgid $i_unistd unistd.h
18044 : see if prototype for setresuid is available
18046 set d_sresuproto setresuid $i_unistd unistd.h
18049 : see if sys/stat.h is available
18050 set sys/stat.h i_sysstat
18053 : see if stat knows about block sizes
18055 echo "Checking to see if your struct stat has st_blocks field..." >&4
18056 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18059 : see if this is a sys/vfs.h system
18060 set sys/vfs.h i_sysvfs
18063 : see if this is a sys/statfs.h system
18064 set sys/statfs.h i_sysstatfs
18067 : Check for statfs_s
18069 echo "Checking to see if your system supports struct statfs..." >&4
18070 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
18072 case "$d_statfs_s" in
18073 "$define") echo "Yes, it does." ;;
18074 *) echo "No, it doesn't." ;;
18078 : see if struct statfs knows about f_flags
18079 case "$d_statfs_s" in
18082 echo "Checking to see if your struct statfs has f_flags field..." >&4
18083 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
18087 set d_statfs_f_flags
18091 case "$d_statfs_f_flags" in
18092 "$define") echo "Yes, it does." ;;
18093 *) echo "No, it doesn't." ;;
18096 : see what flavor, if any, of static inline is supported
18098 echo "Checking to see if your system supports static inline..."
18099 $cat > try.c <<'EOCP'
18100 #include <stdlib.h>
18101 extern int f_via_a(int x);
18102 extern int f_via_b(int x);
18103 int main(int argc, char **argv)
18112 return EXIT_SUCCESS;
18115 return EXIT_FAILURE;
18119 $cat > a.c <<'EOCP'
18120 static INLINE int f(int x) {
18131 $cat > b.c <<'EOCP'
18132 extern int f(int x);
18140 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18141 case "$perl_static_inline" in
18142 '') # Check the various possibilities, and break out on success.
18143 # For gcc, prefer __inline__, which will still permit
18144 # cflags.SH to add in -ansi.
18145 case "$gccversion" in
18146 '') xxx="inline __inline__ __inline _inline";;
18147 *) xxx="__inline__ inline __inline _inline";;
18149 for inline in $xxx; do
18150 set try -DINLINE=$inline a.c
18151 if eval $compile && $run ./try; then
18152 # Now make sure there is no external linkage of static
18154 set try -DINLINE=$inline -DUSE_B a.c b.c
18155 if eval $compile && $run ./try; then
18156 $echo "Your compiler supports static $inline, " >&4
18157 $echo "but it also creates an external definition," >&4
18158 $echo "so I won't use it." >&4
18161 $echo "Your compiler supports static $inline." >&4
18163 perl_static_inline="static $inline";
18167 $echo "Your compiler does NOT support static $inline." >&4
18172 *inline*) # Some variant of inline exists.
18173 echo "Keeping your $hint value of $perl_static_inline."
18176 static) # No inline capabilities
18177 echo "Keeping your $hint value of $perl_static_inline."
18180 *) # Unrecognized previous value -- blindly trust the supplied
18181 # value and hope it makes sense. Use old value for
18182 # d_static_inline, if there is one.
18183 echo "Keeping your $hint value of $perl_static_inline."
18184 case "$d_static_inline" in
18186 *) val=$d_static_inline ;;
18190 # Fallback to plain 'static' if nothing worked.
18191 case "$perl_static_inline" in
18193 perl_static_inline="static"
18197 set d_static_inline
18199 $rm -f a.[co] b.[co]
18202 : Check stream access
18204 Checking how to access stdio streams by file descriptor number...
18206 case "$stdio_stream_array" in
18207 '') $cat >try.c <<EOCP
18210 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18214 for s in _iob __iob __sF
18216 set try -DSTDIO_STREAM_ARRAY=$s
18217 if eval $compile; then
18218 case "`$run ./try`" in
18219 yes) stdio_stream_array=$s; break ;;
18225 case "$stdio_stream_array" in
18227 I can't figure out how to access stdio streams by file descriptor number.
18229 d_stdio_stream_array="$undef"
18232 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18234 d_stdio_stream_array="$define"
18238 : see if strcoll exists
18239 set strcoll d_strcoll
18242 : check for structure copying
18244 echo "Checking to see if your C compiler can copy structs..." >&4
18245 $cat >try.c <<'EOCP'
18255 if $cc -c try.c >/dev/null 2>&1 ; then
18257 echo "Yup, it can."
18260 echo "Nope, it can't."
18266 : see if strerror and/or sys_errlist[] exist
18268 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18269 if set strerror val -f d_strerror; eval $csym; $val; then
18270 echo 'strerror() found.' >&4
18271 d_strerror="$define"
18272 d_strerrm='strerror(e)'
18273 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18274 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18275 d_syserrlst="$define"
18277 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18278 d_syserrlst="$undef"
18280 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18281 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18282 echo 'strerror() found in string header.' >&4
18283 d_strerror="$define"
18284 d_strerrm='strerror(e)'
18285 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18286 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18287 d_syserrlst="$define"
18289 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18290 d_syserrlst="$undef"
18292 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18293 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18294 d_strerror="$undef"
18295 d_syserrlst="$define"
18296 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18298 echo 'strerror() and sys_errlist[] NOT found.' >&4
18299 d_strerror="$undef"
18300 d_syserrlst="$undef"
18301 d_strerrm='"unknown"'
18305 : see if strerror_r exists
18306 set strerror_r d_strerror_r
18308 case "$d_strerror_r" in
18310 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18311 case "$d_strerror_r_proto:$usethreads" in
18312 ":define") d_strerror_r_proto=define
18313 set d_strerror_r_proto strerror_r $hdrs
18317 case "$d_strerror_r_proto" in
18319 case "$strerror_r_proto" in
18320 ''|0) try='int strerror_r(int, char*, size_t);'
18321 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18323 case "$strerror_r_proto" in
18324 ''|0) try='int strerror_r(int, char*, int);'
18325 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18327 case "$strerror_r_proto" in
18328 ''|0) try='char* strerror_r(int, char*, size_t);'
18329 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18331 case "$strerror_r_proto" in
18332 ''|0) d_strerror_r=undef
18334 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18335 * ) case "$strerror_r_proto" in
18336 REENTRANT_PROTO*) ;;
18337 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18339 echo "Prototype: $try" ;;
18342 *) case "$usethreads" in
18343 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18350 *) strerror_r_proto=0
18354 : see if strftime exists
18355 set strftime d_strftime
18358 : see if strlcat exists
18359 set strlcat d_strlcat
18362 : see if strlcpy exists
18363 set strlcpy d_strlcpy
18366 : see if strtod exists
18367 set strtod d_strtod
18370 : see if strtol exists
18371 set strtol d_strtol
18374 : see if strtold exists
18375 set strtold d_strtold
18378 : see if strtoll exists
18379 set strtoll d_strtoll
18382 case "$d_longlong-$d_strtoll" in
18385 Checking whether your strtoll() works okay...
18387 $cat >try.c <<'EOCP'
18390 #define strtoll __strtoll
18393 #define strtoll _strtoll
18396 extern long long int strtoll(char *s, char **, int);
18397 static int bad = 0;
18398 int check(char *s, long long ell, int een) {
18401 gll = strtoll(s, 0, 10);
18402 if (!((gll == ell) && (errno == een)))
18406 check(" 1", 1LL, 0);
18407 check(" 0", 0LL, 0);
18408 check("-1", -1LL, 0);
18409 check("-9223372036854775808", -9223372036854775808LL, 0);
18410 check("-9223372036854775808", -9223372036854775808LL, 0);
18411 check(" 9223372036854775807", 9223372036854775807LL, 0);
18412 check("-9223372036854775808", -9223372036854775808LL, 0);
18413 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18414 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18420 if eval $compile; then
18423 ok) echo "Your strtoll() seems to be working okay." ;;
18425 Your strtoll() doesn't seem to be working okay.
18431 echo "(I can't seem to compile the test program--assuming it doesn't)"
18437 : see if strtoq exists
18438 set strtoq d_strtoq
18441 : see if strtoul exists
18442 set strtoul d_strtoul
18445 case "$d_strtoul" in
18448 Checking whether your strtoul() works okay...
18450 $cat >try.c <<'EOCP'
18453 extern unsigned long int strtoul(char *s, char **, int);
18454 static int bad = 0;
18455 void check(char *s, unsigned long eul, int een) {
18458 gul = strtoul(s, 0, 10);
18459 if (!((gul == eul) && (errno == een)))
18463 check(" 1", 1L, 0);
18464 check(" 0", 0L, 0);
18466 case "$longsize" in
18468 $cat >>try.c <<'EOCP'
18469 check("18446744073709551615", 18446744073709551615UL, 0);
18470 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18471 #if 0 /* strtoul() for /^-/ strings is undefined. */
18472 check("-1", 18446744073709551615UL, 0);
18473 check("-18446744073709551614", 2, 0);
18474 check("-18446744073709551615", 1, 0);
18475 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18476 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18481 $cat >>try.c <<'EOCP'
18482 check("4294967295", 4294967295UL, 0);
18483 check("4294967296", 4294967295UL, ERANGE);
18484 #if 0 /* strtoul() for /^-/ strings is undefined. */
18485 check("-1", 4294967295UL, 0);
18486 check("-4294967294", 2, 0);
18487 check("-4294967295", 1, 0);
18488 check("-4294967296", 4294967295UL, ERANGE);
18489 check("-4294967297", 4294967295UL, ERANGE);
18494 : Should we write these tests to be more portable by sprintf-ing
18495 : ~0 and then manipulating that char string as input for strtol?
18498 $cat >>try.c <<'EOCP'
18505 if eval $compile; then
18506 case "`$run ./try`" in
18507 ok) echo "Your strtoul() seems to be working okay." ;;
18509 Your strtoul() doesn't seem to be working okay.
18515 echo "(I can't seem to compile the test program--assuming it doesn't)"
18521 : see if strtoull exists
18522 set strtoull d_strtoull
18525 case "$d_longlong-$d_strtoull" in
18528 Checking whether your strtoull() works okay...
18530 $cat >try.c <<'EOCP'
18533 #define strtoull __strtoull
18536 extern unsigned long long int strtoull(char *s, char **, int);
18537 static int bad = 0;
18538 int check(char *s, long long eull, int een) {
18541 gull = strtoull(s, 0, 10);
18542 if (!((gull == eull) && (errno == een)))
18546 check(" 1", 1LL, 0);
18547 check(" 0", 0LL, 0);
18548 check("18446744073709551615", 18446744073709551615ULL, 0);
18549 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18550 #if 0 /* strtoull() for /^-/ strings is undefined. */
18551 check("-1", 18446744073709551615ULL, 0);
18552 check("-18446744073709551614", 2LL, 0);
18553 check("-18446744073709551615", 1LL, 0);
18554 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18555 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18562 if eval $compile; then
18563 case "`$run ./try`" in
18564 ok) echo "Your strtoull() seems to be working okay." ;;
18566 Your strtoull() doesn't seem to be working okay.
18568 d_strtoull="$undef"
18572 echo "(I can't seem to compile the test program--assuming it doesn't)"
18573 d_strtoull="$undef"
18578 : see if strtouq exists
18579 set strtouq d_strtouq
18582 case "$d_strtouq" in
18585 Checking whether your strtouq() works okay...
18587 $cat >try.c <<'EOCP'
18590 extern unsigned long long int strtouq(char *s, char **, int);
18591 static int bad = 0;
18592 void check(char *s, unsigned long long eull, int een) {
18593 unsigned long long gull;
18595 gull = strtouq(s, 0, 10);
18596 if (!((gull == eull) && (errno == een)))
18600 check(" 1", 1LL, 0);
18601 check(" 0", 0LL, 0);
18602 check("18446744073709551615", 18446744073709551615ULL, 0);
18603 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18604 #if 0 /* strtouq() for /^-/ strings is undefined. */
18605 check("-1", 18446744073709551615ULL, 0);
18606 check("-18446744073709551614", 2LL, 0);
18607 check("-18446744073709551615", 1LL, 0);
18608 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18609 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18617 if eval $compile; then
18618 case "`$run ./try`" in
18619 ok) echo "Your strtouq() seems to be working okay." ;;
18621 Your strtouq() doesn't seem to be working okay.
18627 echo "(I can't seem to compile the test program--assuming it doesn't)"
18633 : see if strxfrm exists
18634 set strxfrm d_strxfrm
18637 : see if symlink exists
18638 set symlink d_symlink
18641 : see if syscall exists
18642 set syscall d_syscall
18645 : see if prototype for syscall is available
18647 set d_syscallproto syscall $i_unistd unistd.h
18650 : see if sysconf exists
18651 set sysconf d_sysconf
18654 : see if system exists
18655 set system d_system
18658 : see if tcgetpgrp exists
18659 set tcgetpgrp d_tcgetpgrp
18662 : see if tcsetpgrp exists
18663 set tcsetpgrp d_tcsetpgrp
18666 : see if prototype for telldir is available
18668 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18671 : see if time exists
18673 if test "X$d_time" = X -o X"$timetype" = X; then
18674 if set time val -f d_time; eval $csym; $val; then
18675 echo 'time() found.' >&4
18677 rp="What is the type returned by time() on this system?"
18678 set time_t timetype long stdio.h sys/types.h
18681 echo 'time() not found, hope that will do.' >&4
18689 : see if timegm exists
18690 set timegm d_timegm
18693 : see if this is a sys/times.h system
18694 set sys/times.h i_systimes
18697 : see if times exists
18699 if set times val -f d_times; eval $csym; $val; then
18700 echo 'times() found.' >&4
18703 case "$i_systimes" in
18704 "$define") inc='sys/times.h';;
18706 rp="What is the type returned by times() on this system?"
18707 set clock_t clocktype long stdio.h sys/types.h $inc
18710 echo 'times() NOT found, hope that will do.' >&4
18715 : see if tmpnam_r exists
18716 set tmpnam_r d_tmpnam_r
18718 case "$d_tmpnam_r" in
18720 hdrs="$i_systypes sys/types.h define stdio.h "
18721 case "$d_tmpnam_r_proto:$usethreads" in
18722 ":define") d_tmpnam_r_proto=define
18723 set d_tmpnam_r_proto tmpnam_r $hdrs
18727 case "$d_tmpnam_r_proto" in
18729 case "$tmpnam_r_proto" in
18730 ''|0) try='char* tmpnam_r(char*);'
18731 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18733 case "$tmpnam_r_proto" in
18734 ''|0) d_tmpnam_r=undef
18736 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18737 * ) case "$tmpnam_r_proto" in
18738 REENTRANT_PROTO*) ;;
18739 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18741 echo "Prototype: $try" ;;
18744 *) case "$usethreads" in
18745 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18752 *) tmpnam_r_proto=0
18756 : see if truncate exists
18757 set truncate d_truncate
18760 : see if ttyname_r exists
18761 set ttyname_r d_ttyname_r
18763 case "$d_ttyname_r" in
18765 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18766 case "$d_ttyname_r_proto:$usethreads" in
18767 ":define") d_ttyname_r_proto=define
18768 set d_ttyname_r_proto ttyname_r $hdrs
18772 case "$d_ttyname_r_proto" in
18774 case "$ttyname_r_proto" in
18775 ''|0) try='int ttyname_r(int, char*, size_t);'
18776 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18778 case "$ttyname_r_proto" in
18779 ''|0) try='int ttyname_r(int, char*, int);'
18780 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18782 case "$ttyname_r_proto" in
18783 ''|0) try='char* ttyname_r(int, char*, int);'
18784 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18786 case "$ttyname_r_proto" in
18787 ''|0) d_ttyname_r=undef
18789 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18790 * ) case "$ttyname_r_proto" in
18791 REENTRANT_PROTO*) ;;
18792 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18794 echo "Prototype: $try" ;;
18797 *) case "$usethreads" in
18798 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18805 *) ttyname_r_proto=0
18809 : see if tzname[] exists
18811 if set tzname val -a d_tzname; eval $csym; $val; then
18813 echo 'tzname[] found.' >&4
18816 echo 'tzname[] NOT found.' >&4
18821 : Check if is a multiplatform env
18823 next|darwin) multiarch="$define" ;;
18825 case "$multiarch" in
18826 ''|[nN]*) multiarch="$undef" ;;
18829 : check for ordering of bytes in a UV
18831 case "$usecrosscompile$multiarch" in
18834 You seem to be either cross-compiling or doing a multiarchitecture build,
18835 skipping the byteorder check.
18841 case "$byteorder" in
18844 In the following, larger digits indicate more significance. A big-endian
18845 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18846 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18847 machines may have weird orders like 3412. A Cray will report 87654321,
18848 an Alpha will report 12345678. If the test program works the default is
18850 I'm now running the test program...
18854 #$i_stdlib I_STDLIB
18856 #include <stdlib.h>
18858 #include <sys/types.h>
18859 typedef $uvtype UV;
18869 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18871 u.l = (UV)0x04030201;
18872 for (i = 0; i < $uvsize; i++)
18873 printf("%c", u.c[i]+'0');
18880 if eval $compile && $run ./try > /dev/null; then
18883 [1-4][1-4][1-4][1-4]|12345678|87654321)
18884 echo "(The test program ran ok.)"
18885 echo "byteorder=$dflt"
18888 ????|????????) echo "(The test program ran ok.)" ;;
18889 *) echo "(The test program didn't run right for some reason.)" ;;
18894 (I can't seem to compile the test program. Guessing big-endian...)
18897 case "$xxx_prompt" in
18899 rp="What is the order of bytes in $uvtype?"
18912 : Checking 32bit alignedness
18915 Checking to see whether you can access character data unalignedly...
18917 case "$d_u32align" in
18918 '') $cat >try.c <<EOCP
18920 #$i_stdlib I_STDLIB
18922 #include <stdlib.h>
18924 #define U32 $u32type
18925 #define BYTEORDER 0x$byteorder
18927 #include <signal.h>
18929 $signal_t bletch(int s) { exit(4); }
18932 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18933 volatile U8 buf[8];
18937 if (sizeof(U32) != 4) {
18938 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18945 signal(SIGBUS, bletch);
18957 for (i = 0; i < 4; i++) {
18958 up = (U32*)(buf + i);
18959 if (! ((*up == 1 << (8*i)) || /* big-endian */
18960 (*up == 1 << (8*(3-i))) /* little-endian */
18964 printf("read failed (%x)\n", *up);
18970 for (i = 0; i < 4; i++) {
18971 up = (U32*)(buf + i);
18973 if (*up != 0xBeef) {
18974 printf("write failed (%x)\n", *up);
18988 if eval $compile_ok; then
18989 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18990 $run ./try 2>&1 >/dev/null
18993 You can access character data pretty unalignedly.
18995 d_u32align="$undef"
18998 It seems that you must access character data in an aligned manner.
19000 d_u32align="$define"
19004 rp='Can you access character data at unaligned addresses?'
19008 [yY]*) d_u32align="$undef" ;;
19009 *) d_u32align="$define" ;;
19016 : see if ualarm exists
19017 set ualarm d_ualarm
19020 : see if umask exists
19024 : see if unordered exists
19025 set unordered d_unordered
19028 : see if unsetenv exists
19029 set unsetenv d_unsetenv
19032 : see if usleep exists
19033 set usleep d_usleep
19036 : see if prototype for usleep is available
19038 set d_usleepproto usleep $i_unistd unistd.h
19041 : see if ustat exists
19045 : see if closedir exists
19046 set closedir d_closedir
19049 case "$d_closedir" in
19052 echo "Checking whether closedir() returns a status..." >&4
19054 #$i_dirent I_DIRENT /**/
19055 #$i_sysdir I_SYS_DIR /**/
19056 #$i_sysndir I_SYS_NDIR /**/
19057 #$i_systypes I_SYS_TYPES /**/
19059 #if defined(I_SYS_TYPES)
19060 #include <sys/types.h>
19062 #if defined(I_DIRENT)
19063 #include <dirent.h>
19064 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19065 #include <sys/dir.h>
19069 #include <sys/ndir.h>
19073 #include <ndir.h> /* may be wrong in the future */
19075 #include <sys/dir.h>
19080 int main() { return closedir(opendir(".")); }
19083 if eval $compile_ok; then
19084 if $run ./try > /dev/null 2>&1 ; then
19085 echo "Yes, it does."
19088 echo "No, it doesn't."
19092 echo "(I can't seem to compile the test program--assuming it doesn't)"
19100 set d_void_closedir
19104 : see if there is a wait4
19108 : see if waitpid exists
19109 set waitpid d_waitpid
19112 : see if wcstombs exists
19113 set wcstombs d_wcstombs
19116 : see if wctomb exists
19117 set wctomb d_wctomb
19120 : see if writev exists
19121 set writev d_writev
19124 : preserve RCS keywords in files with variable substitution, grrr
19129 Revision='$Revision'
19131 : check for alignment requirements
19133 case "$usecrosscompile" in
19136 You seem to be cross-compiling. Skipping the memory alignment check.
19139 case "$alignbytes" in
19140 '') alignbytes=8 ;;
19144 case "$alignbytes" in
19145 '') echo "Checking alignment constraints..." >&4
19146 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19147 $cat >try.c <<'EOCP'
19148 typedef long double NV;
19151 $cat >try.c <<'EOCP'
19155 $cat >>try.c <<'EOCP'
19163 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19168 if eval $compile_ok; then
19172 echo "(I can't seem to compile the test program...)"
19174 case "$multiarch" in
19176 : The usual safe value is 8, but Darwin with -Duselongdouble
19177 : needs 16. Hence, we will take 8 as a minimum, but allow
19178 : Configure to pick a larger value if needed.
19179 if $test "$dflt" -lt 8; then
19181 echo "Setting alignment to 8 for multiarch support.">&4
19186 *) dflt="$alignbytes"
19189 rp="Doubles must be aligned on a how-many-byte boundary?"
19197 : set the base revision
19200 : Determine if this is an EBCDIC system
19202 echo "Determining whether or not we are on an EBCDIC system..." >&4
19203 $cat >try.c <<'EOM'
19206 if ('M'==0xd4) return 0;
19211 case "$BOOTSTRAP_CHARSET" in
19212 Y|y|define) bootstrap_charset=$define ;;
19213 *) bootstrap_charset=$undef ;;
19218 if eval $compile_ok; then
19219 if $run ./try; then
19220 echo "You seem to speak EBCDIC." >&4
19223 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19226 echo "I'm unable to compile the test program." >&4
19227 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19233 : length of character in bytes. Is always 1, otherwise it is not C
19234 : This used to be a test using sizeof
19237 : Check for the number of bits in a character
19238 case "$charbits" in
19239 '') echo "Checking how long a character is (in bits)..." >&4
19246 for (c = 1, n = 0; c; c <<= 1, n++) ;
19247 printf ("%d\n", n);
19252 if eval $compile_ok; then
19256 echo "(I can't seem to compile the test program. Guessing...)"
19263 rp="What is the length of a character (in bits)?"
19267 case "$charbits" in
19270 Your system has an unsigned character size of $charbits bits, which
19271 is rather unusual (normally it is 8 bits). Perl likely will not work
19272 correctly on your system, with subtle bugs in various places.
19274 rp='Do you really want to continue?'
19278 [yY]) echo >&4 "Okay, continuing." ;;
19283 : how do we concatenate cpp tokens here?
19285 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19286 $cat >cpp_stuff.c <<'EOCP'
19287 #define RCAT(a,b)a/**/b
19288 #define ACAT(a,b)a ## b
19292 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19293 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19294 echo "Oh! Smells like ANSI's been here." >&4
19295 echo "We can catify or stringify, separately or together!"
19297 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19298 echo "Ah, yes! The good old days!" >&4
19299 echo "However, in the good old days we don't know how to stringify and"
19300 echo "catify at the same time."
19304 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19305 You're going to have to edit the values of CAT[2-5] in config.h...
19307 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19311 : see if this is a db.h system
19317 : Check db version.
19319 echo "Checking Berkeley DB version ..." >&4
19325 #include <sys/types.h>
19327 #$i_stdlib I_STDLIB
19329 #include <stdlib.h>
19332 int main(int argc, char *argv[])
19334 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19335 int Major, Minor, Patch ;
19336 unsigned long Version ;
19337 (void)db_version(&Major, &Minor, &Patch) ;
19339 printf("%d %d %d %d %d %d\n",
19340 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19341 Major, Minor, Patch);
19344 printf("You have Berkeley DB Version 2 or greater.\n");
19346 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19347 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19348 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19349 Major, Minor, Patch) ;
19351 /* check that db.h & libdb are compatible */
19352 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19353 printf("db.h and libdb are incompatible.\n") ;
19357 printf("db.h and libdb are compatible.\n") ;
19359 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19360 + DB_VERSION_PATCH ;
19362 /* needs to be >= 2.3.4 */
19363 if (Version < 2003004) {
19364 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19365 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19371 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19376 printf("You have Berkeley DB Version 1.\n");
19377 exit(0); /* DB version < 2: the coast is clear. */
19379 exit(1); /* <db.h> not Berkeley DB? */
19385 if eval $compile_ok && $run ./try; then
19386 echo 'Looks OK.' >&4
19388 db_version_major=$1
19389 db_version_minor=$2
19390 db_version_patch=$3
19392 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19396 : Remove db from list of libraries to use
19397 echo "Removing unusable -ldb from library list" >&4
19398 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19401 echo "libs = $libs" >&4
19411 : Check the return type needed for hash
19413 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19419 #include <sys/types.h>
19422 #ifndef DB_VERSION_MAJOR
19423 u_int32_t hash_cb (ptr, size)
19431 info.hash = hash_cb;
19435 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19436 if $contains warning try.out >>/dev/null 2>&1 ; then
19439 db_hashtype='u_int32_t'
19442 : XXX Maybe we should just give up here.
19443 db_hashtype=u_int32_t
19445 echo "Help: I can't seem to compile the db test program." >&4
19446 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19449 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19451 *) db_hashtype=u_int32_t
19456 : Check the return type needed for prefix
19458 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19464 #include <sys/types.h>
19467 #ifndef DB_VERSION_MAJOR
19468 size_t prefix_cb (key1, key2)
19476 info.prefix = prefix_cb;
19480 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19481 if $contains warning try.out >>/dev/null 2>&1 ; then
19482 db_prefixtype='int'
19484 db_prefixtype='size_t'
19487 db_prefixtype='size_t'
19488 : XXX Maybe we should just give up here.
19490 echo "Help: I can't seem to compile the db test program." >&4
19491 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19494 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19496 *) db_prefixtype='size_t'
19500 : How can we generate normalized random numbers ?
19502 echo "Looking for a random number function..." >&4
19503 case "$randfunc" in
19505 if set drand48 val -f; eval $csym; $val; then
19507 echo "Good, found drand48()." >&4
19508 elif set random val -f; eval $csym; $val; then
19510 echo "OK, found random()." >&4
19513 echo "Yuck, looks like I have to use rand()." >&4
19524 *-Dmy_rand=*|*-Dmy_srand=*)
19525 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19526 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19527 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19528 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19532 while $test "$cont"; do
19533 rp="Use which function to generate random numbers?"
19535 if $test "$ans" = "$dflt"; then
19541 if set $ans val -f; eval $csym; $val; then
19545 rp="I cannot find function $ans. Use that name anyway?"
19554 case "$randfunc" in
19556 drand01="drand48()"
19562 case "$randbits" in
19564 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19566 #$i_unistd I_UNISTD
19567 #$i_stdlib I_STDLIB
19570 # include <unistd.h>
19573 # include <stdlib.h>
19579 unsigned long max = 0L;
19581 for (i = 1000; i; i--) {
19582 tmp = (unsigned long) $randfunc();
19583 if (tmp > max) max = tmp;
19585 for (i = 0; max; i++)
19591 if eval $compile_ok; then
19595 echo "(I can't seem to compile the test program...)"
19602 rp="How many bits does your $randfunc() function produce?"
19606 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19607 seedfunc="s$randfunc"
19608 randseedtype=unsigned
19612 rp="How many bits does your $randfunc() function produce?"
19615 seedfunc="s$randfunc"
19616 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19617 if set $seedfunc val -f; eval $csym; $val; then
19618 echo "(Using $seedfunc() to seed random generator)"
19620 echo "(Warning: no $seedfunc() to seed random generator)"
19623 randseedtype=unsigned
19630 : Check how to flush
19633 Checking how to flush all pending stdio output...
19635 # I only know how to find the first 32 possibly open files on SunOS.
19636 # See also hints/sunos_4_1.sh and util.c --AD
19638 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19640 $cat >>try.c <<EOCP
19642 #$i_stdlib I_STDLIB
19644 #include <stdlib.h>
19646 #$i_unistd I_UNISTD
19648 # include <unistd.h>
19650 #$d_sysconf HAS_SYSCONF
19651 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19652 #ifdef HAS_STDIO_STREAM_ARRAY
19653 # define STDIO_STREAM_ARRAY $stdio_stream_array
19658 p = fopen("try.out", "w");
19662 # ifdef TRY_FPRINTF
19666 #ifdef TRY_FFLUSH_NULL
19669 #ifdef TRY_FFLUSH_ALL
19671 long open_max = -1;
19672 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19673 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19675 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19676 open_max = sysconf(_SC_OPEN_MAX);
19679 open_max = FOPEN_MAX;
19682 open_max = OPEN_MAX;
19691 # ifdef HAS_STDIO_STREAM_ARRAY
19692 if (open_max > 0) {
19694 for (i = 0; i < open_max; i++)
19695 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19696 STDIO_STREAM_ARRAY[i]._file < open_max &&
19697 STDIO_STREAM_ARRAY[i]._flag)
19698 fflush(&STDIO_STREAM_ARRAY[i]);
19706 : first we have to find out how _not_ to flush
19708 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19710 set try -DTRY_FPUTC
19711 if eval $compile; then
19712 $run ./try 2>/dev/null
19715 if $test ! -s try.out -a "X$code" = X42; then
19721 set try -DTRY_FPRINTF
19722 if eval $compile; then
19723 $run ./try 2>/dev/null
19726 if $test ! -s try.out -a "X$code" = X42; then
19727 output=-DTRY_FPRINTF
19733 : check for fflush NULL behavior
19734 case "$fflushNULL" in
19735 '') set try -DTRY_FFLUSH_NULL $output
19736 if eval $compile; then
19737 $run ./try 2>/dev/null
19740 if $test -s try.out -a "X$code" = X42; then
19741 fflushNULL="`$cat try.out`"
19743 if $test "X$code" != X42; then
19745 (If this test failed, don't worry, we'll try another method shortly.)
19750 $rm -f core try.core core.try.*
19751 case "$fflushNULL" in
19753 Your fflush(NULL) works okay for output streams.
19754 Let's see if it clobbers input pipes...
19756 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19757 # bug that improperly flushes the input end of pipes. So we avoid the
19758 # autoflush on fork/system/exec support for now. :-(
19759 $cat >tryp.c <<EOCP
19762 main(int argc, char **argv)
19768 while ((i = getc(stdin)) != -1
19769 && (*bp++ = i) != '\n'
19770 && bp < &buf[1024])
19773 fprintf(stdout, "%s", buf);
19781 fflushNULL="$define"
19783 if eval $compile; then
19785 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19786 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19788 fflush(NULL) seems to behave okay with input streams.
19790 fflushNULL="$define"
19793 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19795 fflushNULL="$undef"
19798 $rm -f core tryp.c tryp.core core.tryp.*
19801 Your fflush(NULL) isn't working (contrary to ANSI C).
19803 fflushNULL="$undef"
19806 Cannot figure out whether your fflush(NULL) works or not.
19807 I'm assuming it doesn't (contrary to ANSI C).
19809 fflushNULL="$undef"
19813 $define|true|[yY]*)
19814 fflushNULL="$define"
19817 fflushNULL="$undef"
19820 : check explicit looping only if NULL did not work, and if the pipe
19821 : bug does not show up on an explicit flush too
19822 case "$fflushNULL" in
19824 $cat >tryp.c <<EOCP
19827 main(int argc, char **argv)
19833 while ((i = getc(stdin)) != -1
19834 && (*bp++ = i) != '\n'
19835 && bp < &buf[1024])
19838 fprintf(stdout, "%s", buf);
19847 if eval $compile; then
19849 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19850 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19852 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19854 : now check for fflushall behaviour
19855 case "$fflushall" in
19856 '') set try -DTRY_FFLUSH_ALL $output
19857 if eval $compile; then
19859 (Now testing the other method--but note that this also may fail.)
19861 $run ./try 2>/dev/null
19864 if $test -s try.out -a "X$code" = X42; then
19865 fflushall="`$cat try.out`"
19869 case "$fflushall" in
19871 Whew. Flushing explicitly all the stdio streams works.
19873 fflushall="$define"
19876 Sigh. Flushing explicitly all the stdio streams doesn't work.
19881 Cannot figure out whether flushing stdio streams explicitly works or not.
19882 I'm assuming it doesn't.
19888 "$define"|true|[yY]*)
19889 fflushall="$define"
19897 All is futile. Even fflush(stdin) clobbers input pipes!
19904 $rm -f core tryp.c tryp.core core.tryp.*
19906 *) fflushall="$undef"
19910 case "$fflushNULL$fflushall" in
19913 OK, I give up. I cannot figure out how to flush pending stdio output.
19914 We won't be flushing handles at all before fork/exec/popen.
19920 : Store the full pathname to the ar program for use in the C program
19921 : Respect a hint or command line value for full_ar.
19926 : Store the full pathname to the sed program for use in the C program
19929 : see what type gids are declared as in the kernel
19931 echo "Looking for the type for group ids returned by getgid()."
19932 set gid_t gidtype xxx stdio.h sys/types.h
19936 xxx=`./findhdr sys/user.h`
19937 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19939 unsigned) dflt="$1 $2" ;;
19943 *) dflt="$gidtype";;
19946 gid_t) echo "gid_t found." ;;
19947 *) rp="What is the type for group ids returned by getgid()?"
19953 : Check the size of GID
19956 *_t) zzz="$gidtype" ;;
19959 echo "Checking the size of $zzz..." >&4
19961 #include <sys/types.h>
19963 #$i_stdlib I_STDLIB
19965 #include <stdlib.h>
19968 printf("%d\n", (int)sizeof($gidtype));
19973 if eval $compile_ok; then
19977 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19980 echo "Your $zzz is $gidsize bytes long."
19985 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19989 : Check if GID is signed
19992 *_t) zzz="$gidtype" ;;
19995 echo "Checking the sign of $zzz..." >&4
19997 #include <sys/types.h>
20008 if eval $compile; then
20012 echo "(I can't execute the test program--guessing unsigned.)" >&4
20016 1) echo "Your $zzz is unsigned." ;;
20017 -1) echo "Your $zzz is signed." ;;
20023 echo "(I can't compile the test program--guessing unsigned.)" >&4
20027 : Check 64bit sizes
20030 if $test X"$quadtype" != X; then
20032 echo "Checking how to print 64-bit integers..." >&4
20034 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20035 $cat >try.c <<'EOCP'
20036 #include <sys/types.h>
20039 int q = 12345678901;
20040 printf("%ld\n", q);
20044 if eval $compile; then
20048 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20049 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20050 echo "We will use %d."
20056 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20057 $cat >try.c <<'EOCP'
20058 #include <sys/types.h>
20061 long q = 12345678901;
20062 printf("%ld\n", q);
20066 if eval $compile; then
20070 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20071 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20072 echo "We will use %ld."
20078 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20079 $cat >try.c <<'EOCP'
20080 #include <sys/types.h>
20081 #include <inttypes.h>
20084 int64_t q = 12345678901;
20085 printf("%" PRId64 "\n", q);
20089 if eval $compile; then
20093 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20094 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20095 echo "We will use the C9X style."
20101 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20103 #include <sys/types.h>
20106 $quadtype q = 12345678901;
20107 printf("%Ld\n", q);
20111 if eval $compile; then
20115 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20116 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20117 echo "We will use %Ld."
20123 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20124 $cat >try.c <<'EOCP'
20125 #include <sys/types.h>
20128 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20129 printf("%lld\n", q);
20133 if eval $compile; then
20137 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20138 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20139 echo "We will use the %lld style."
20145 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20147 #include <sys/types.h>
20150 $quadtype q = 12345678901;
20151 printf("%qd\n", q);
20155 if eval $compile; then
20159 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20160 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20161 echo "We will use %qd."
20167 if $test X"$sPRId64" = X; then
20168 echo "Cannot figure out how to print 64-bit integers." >&4
20175 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20176 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20178 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20179 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20183 : Check format strings for internal types
20185 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20187 if $test X"$ivsize" = X8; then
20188 ivdformat="$sPRId64"
20189 uvuformat="$sPRIu64"
20190 uvoformat="$sPRIo64"
20191 uvxformat="$sPRIx64"
20192 uvXUformat="$sPRIXU64"
20194 if $test X"$ivsize" = X"$longsize"; then
20201 if $test X"$ivsize" = X"$intsize"; then
20209 if $test X"$ivsize" = X"$shortsize"; then
20220 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20221 nveformat="$sPRIeldbl"
20222 nvfformat="$sPRIfldbl"
20223 nvgformat="$sPRIgldbl"
20224 nvEUformat="$sPRIEUldbl"
20225 nvFUformat="$sPRIFUldbl"
20226 nvGUformat="$sPRIGUldbl"
20236 case "$ivdformat" in
20237 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20242 : Check format string for GID
20245 $echo "Checking the format string to be used for gids..." >&4
20248 -1) if $test X"$gidsize" = X"$ivsize"; then
20249 gidformat="$ivdformat"
20251 if $test X"$gidsize" = X"$longsize"; then
20254 if $test X"$gidsize" = X"$intsize"; then
20257 if $test X"$gidsize" = X"$shortsize"; then
20264 *) if $test X"$gidsize" = X"$uvsize"; then
20265 gidformat="$uvuformat"
20267 if $test X"$gidsize" = X"$longsize"; then
20270 if $test X"$gidsize" = X"$intsize"; then
20273 if $test X"$gidsize" = X"$shortsize"; then
20282 : see if getgroups exists
20283 set getgroups d_getgrps
20286 : see if setgroups exists
20287 set setgroups d_setgrps
20290 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20292 case "$d_getgrps$d_setgrps" in
20294 case "$groupstype" in
20295 '') dflt="$gidtype" ;;
20296 *) dflt="$groupstype" ;;
20299 What type of pointer is the second argument to getgroups() and setgroups()?
20300 Usually this is the same as group ids, $gidtype, but not always.
20303 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20307 *) groupstype="$gidtype";;
20310 : MAD = Misc Attribute Definition
20312 if $test $patchlevel -lt 9; then
20313 : MAD is not available in 5.8.x or earlier.
20317 $define|true|[yY]*) dflt='y' ;;
20322 Would you like to build with Misc Attribute Decoration? This is development
20323 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20324 overhead on the interpreter.
20326 If this doesn't make any sense to you, just accept the default '$dflt'.
20328 rp='Build Perl with MAD?'
20333 madlyh='madly.h madly.act madly.tab'
20335 madlyobj="madly$_o" ;;
20344 : check whether make sets MAKE
20346 echo "Checking if your $make program sets \$(MAKE)..." >&4
20347 case "$make_set_make" in
20349 $sed 's/^X //' > testmake.mak << 'EOF'
20351 X @echo 'maketemp="$(MAKE)"'
20353 case "`$make -f testmake.mak 2>/dev/null`" in
20354 *maketemp=*) make_set_make='#' ;;
20355 *) make_set_make="MAKE=$make" ;;
20357 $rm -f testmake.mak
20360 case "$make_set_make" in
20361 '#') echo "Yup, it does.";;
20362 *) echo "Nope, it doesn't.";;
20365 : see what type is used for mode_t
20366 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20367 set mode_t modetype int stdio.h sys/types.h
20370 : see if we need va_copy
20372 case "$i_stdarg" in
20375 #include <stdarg.h>
20377 #$i_stdlib I_STDLIB
20379 #include <stdlib.h>
20381 #include <signal.h>
20384 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20386 return vfprintf(f, fmt, *valp);
20390 myvfprintf(FILE *f, const char *fmt, va_list val)
20392 return ivfprintf(f, fmt, &val);
20396 myprintf(char *fmt, ...)
20399 va_start(val, fmt);
20400 return myvfprintf(stdout, fmt, val);
20404 main(int ac, char **av)
20406 signal(SIGSEGV, exit);
20408 myprintf("%s%cs all right, then\n", "that", '\'');
20413 if eval $compile && $run ./try 2>&1 >/dev/null; then
20414 case "`$run ./try`" in
20415 "that's all right, then")
20421 yes) echo "It seems that you don't need va_copy()." >&4
20422 need_va_copy="$undef"
20424 *) echo "It seems that va_copy() or similar will be needed." >&4
20425 need_va_copy="$define"
20430 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20431 need_va_copy="$undef"
20435 : see what type is used for size_t
20436 rp="What is the type used for the length parameter for string functions?"
20437 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20440 : check for type of arguments to gethostbyaddr.
20441 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20442 case "$d_gethbyaddr" in
20446 Checking to see what type of arguments are accepted by gethostbyaddr().
20448 hdrs="$define sys/types.h
20449 $d_socket sys/socket.h
20450 $i_niin netinet/in.h
20452 $i_unistd unistd.h"
20453 : The first arg can 'char *' or 'void *'
20454 : The second arg is some of integral type
20455 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20456 for yyy in size_t long int; do
20457 case "$netdb_host_type" in
20458 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20459 if ./protochk "$try" $hdrs; then
20460 echo "Your system accepts $xxx for the first arg."
20461 echo "...and $yyy for the second arg."
20462 netdb_host_type="$xxx"
20463 netdb_hlen_type="$yyy"
20469 : In case none of those worked, prompt the user.
20470 case "$netdb_host_type" in
20471 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20474 netdb_host_type=$ans
20475 rp='What is the type for the 2nd argument to gethostbyaddr?'
20478 netdb_hlen_type=$ans
20482 *) : no gethostbyaddr, so pick harmless defaults
20483 netdb_host_type='char *'
20484 netdb_hlen_type="$sizetype"
20487 # Remove the "const" if needed. -- but then we'll have a
20489 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20492 : check for type of argument to gethostbyname.
20493 if test "X$netdb_name_type" = X ; then
20494 case "$d_gethbyname" in
20498 Checking to see what type of argument is accepted by gethostbyname().
20500 hdrs="$define sys/types.h
20501 $d_socket sys/socket.h
20502 $i_niin netinet/in.h
20504 $i_unistd unistd.h"
20505 for xxx in "const char *" "char *"; do
20506 case "$netdb_name_type" in
20507 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20508 if ./protochk "$try" $hdrs; then
20509 echo "Your system accepts $xxx."
20510 netdb_name_type="$xxx"
20515 : In case none of those worked, prompt the user.
20516 case "$netdb_name_type" in
20517 '') rp='What is the type for the 1st argument to gethostbyname?'
20520 netdb_name_type=$ans
20524 *) : no gethostbyname, so pick harmless default
20525 netdb_name_type='char *'
20530 : check for type of 1st argument to getnetbyaddr.
20531 if test "X$netdb_net_type" = X ; then
20532 case "$d_getnbyaddr" in
20536 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20538 hdrs="$define sys/types.h
20539 $d_socket sys/socket.h
20540 $i_niin netinet/in.h
20542 $i_unistd unistd.h"
20543 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20544 case "$netdb_net_type" in
20545 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20546 if ./protochk "$try" $hdrs; then
20547 echo "Your system accepts $xxx."
20548 netdb_net_type="$xxx"
20553 : In case none of those worked, prompt the user.
20554 case "$netdb_net_type" in
20555 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20558 netdb_net_type=$ans
20562 *) : no getnetbyaddr, so pick harmless default
20563 netdb_net_type='long'
20567 : locate the preferred pager for this system
20574 [a-zA-Z]:/*) dflt=$pg;;
20578 [a-zA-Z]:/*) dflt=$more;;
20582 [a-zA-Z]:/*) dflt=$less;;
20585 '') dflt=/usr/ucb/more;;
20593 rp='What pager is used on your system?'
20597 : see what type pids are declared as in the kernel
20598 rp="What is the type of process ids on this system?"
20599 set pid_t pidtype int stdio.h sys/types.h
20602 : see if ar generates random libraries by itself
20604 echo "Checking how to generate random libraries on your machine..." >&4
20605 echo 'int bar1() { return bar2(); }' > bar1.c
20606 echo 'int bar2() { return 2; }' > bar2.c
20608 #$i_stdlib I_STDLIB
20610 #include <stdlib.h>
20612 int main() { printf("%d\n", bar1()); exit(0); }
20614 $cc $ccflags -c bar1.c >/dev/null 2>&1
20615 $cc $ccflags -c bar2.c >/dev/null 2>&1
20616 $cc $ccflags -c foo.c >/dev/null 2>&1
20617 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20618 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20619 $run ./foobar >/dev/null 2>&1; then
20620 echo "$ar appears to generate random libraries itself."
20622 if [ "X$ranlib" = "X" ]; then
20625 elif $ar s bar$_a >/dev/null 2>&1 &&
20626 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20627 $run ./foobar >/dev/null 2>&1; then
20628 echo "a table of contents needs to be added with '$ar s'."
20631 elif $ar ts bar$_a >/dev/null 2>&1 &&
20632 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20633 $run ./foobar >/dev/null 2>&1; then
20634 echo "a table of contents needs to be added with '$ar ts'."
20641 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20642 $test -f $ranlib || ranlib=''
20645 if $test -n "$ranlib"; then
20646 echo "your system has '$ranlib'; we'll use that."
20649 echo "your system doesn't seem to support random libraries"
20650 echo "so we'll use lorder and tsort to order the libraries."
20657 : see if this is a values.h system
20658 set values.h i_values
20661 : Check the max offset that gmtime and localtime accept
20662 echo "Checking max offsets that gmtime () accepts"
20665 define) yyy="#include <values.h>" ;;
20669 case "$sGMTIME_min/$sGMTIME_max" in
20672 #include <sys/types.h>
20681 void gm_check (time_t t, int min_year, int max_year)
20684 if ( tmp == NULL ||
20685 /* Check tm_year overflow */
20686 tmp->tm_year < min_year || tmp->tm_year > max_year)
20697 gm_check (MAXLONG, 69, 0x7fffffff);
20699 if (tmp == NULL || tmp->tm_year < 0) {
20700 for (i = 63; i >= 0; i--) {
20701 time_t x = pt | ((time_t)1 << i);
20702 if (x < 0 || x < pt) continue;
20703 gm_check (x, 69, 0x7fffffff);
20706 printf ("sGMTIME_max=%ld\n", pt);
20715 gm_check (MINLONG, -1900, 70);
20718 for (i = 36; i >= 0; i--) {
20719 time_t x = pt - ((time_t)1 << i);
20720 if (x > 0) continue;
20721 gm_check (x, -1900, 70);
20724 printf ("sGMTIME_min=%ld\n", pt);
20728 int main (int argc, char *argv[])
20730 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20737 if eval $compile; then
20740 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20746 echo "Checking max offsets that localtime () accepts"
20748 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20751 #include <sys/types.h>
20760 void local_check (time_t t, int min_year, int max_year)
20762 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20765 tmp = localtime (&t);
20766 if ( tmp == NULL ||
20767 /* Check tm_year overflow */
20768 tmp->tm_year < min_year || tmp->tm_year > max_year)
20772 } /* local_check */
20779 local_check (MAXLONG, 69, 0x7fffffff);
20781 if (tmp == NULL || tmp->tm_year < 0) {
20782 for (i = 63; i >= 0; i--) {
20783 time_t x = pt | ((time_t)1 << i);
20784 if (x < 0 || x < pt) continue;
20785 local_check (x, 69, 0x7fffffff);
20788 printf ("sLOCALTIME_max=%ld\n", pt);
20797 local_check (MINLONG, -1900, 70);
20800 for (i = 36; i >= 0; i--) {
20801 time_t x = pt - ((time_t)1 << i);
20802 if (x > 0) continue;
20803 local_check (x, -1900, 70);
20806 printf ("sLOCALTIME_min=%ld\n", pt);
20810 int main (int argc, char *argv[])
20818 if eval $compile; then
20821 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20827 : check for type of arguments to select.
20828 case "$selecttype" in
20829 '') case "$d_select" in
20833 Checking to see what type of arguments are accepted by select().
20835 hdrs="$define sys/types.h
20836 $i_systime sys/time.h
20837 $i_sysselct sys/select.h
20838 $d_socket sys/socket.h"
20839 : The first arg can be int, unsigned, or size_t
20840 : The last arg may or may not be 'const'
20842 : void pointer has been seen but using that
20843 : breaks the selectminbits test
20844 for xxx in 'fd_set *' 'int *'; do
20845 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20846 for tmo in 'struct timeval *' 'const struct timeval *'; do
20848 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20849 if ./protochk "$try" $hdrs; then
20850 echo "Your system accepts $xxx."
20859 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20860 case "$d_fd_set" in
20861 $define) dflt="fd_set *" ;;
20870 *) : no select, so pick a harmless default
20877 : check for the select 'width'
20878 case "$selectminbits" in
20879 '') safebits=`expr $ptrsize \* 8`
20880 case "$d_select" in
20884 Checking to see on how many bits at a time your select() operates...
20887 #include <sys/types.h>
20889 #$i_systime I_SYS_TIME
20890 #$i_systimek I_SYS_TIME_KERNEL
20895 # ifdef I_SYS_TIME_KERNEL
20898 # include <sys/time.h>
20899 # ifdef I_SYS_TIME_KERNEL
20903 #$i_sysselct I_SYS_SELECT
20904 #ifdef I_SYS_SELECT
20905 #include <sys/select.h>
20907 #$d_socket HAS_SOCKET
20909 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20912 #$i_stdlib I_STDLIB
20914 #include <stdlib.h>
20917 #define S sizeof(*(b))
20919 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20920 #define NBITS (NBYTES * 8)
20922 char *s = (char *)malloc(NBYTES);
20931 fp = fopen("try.c", "r");
20937 b = ($selecttype)s;
20938 for (i = 0; i < NBITS; i++)
20942 select(fd + 1, b, 0, 0, &t);
20943 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20945 printf("%d\n", i + 1);
20950 if eval $compile_ok; then
20951 selectminbits=`$run ./try`
20952 case "$selectminbits" in
20954 Cannot figure out on how many bits at a time your select() operates.
20955 I'll play safe and guess it is $safebits bits.
20957 selectminbits=$safebits
20958 bits="$safebits bits"
20961 *) bits="$selectminbits bits" ;;
20963 echo "Your select() operates on $bits at a time." >&4
20965 rp='What is the minimum number of bits your select() operates on?'
20966 case "$byteorder" in
20967 12345678) dflt=64 ;;
20973 selectminbits="$val"
20977 *) : no select, so pick a harmless default
20978 selectminbits=$safebits
20984 : Trace out the files included by signal.h, then look for SIGxxx names.
20985 if [ "X$fieldn" = X ]; then
20986 : Just make some guesses. We check them later.
20987 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20989 xxx=`echo '#include <signal.h>' |
20990 $cppstdin $cppminus $cppflags 2>/dev/null |
20991 $grep '^[ ]*#.*include' |
20992 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20993 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20996 for xx in $xxx /dev/null ; do
20997 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20999 case "$xxxfiles" in
21000 '') xxxfiles=`./findhdr signal.h` ;;
21003 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21004 print substr($2, 4, 20)
21006 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21007 print substr($3, 4, 20)
21009 : Append some common names just in case the awk scan failed.
21010 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21011 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21012 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21013 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21014 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21016 : generate a few handy files for later
21017 $cat > signal.c <<EOCP
21018 #include <sys/types.h>
21019 #include <signal.h>
21020 #$i_stdlib I_STDLIB
21022 #include <stdlib.h>
21027 /* Strange style to avoid deeply-nested #if/#else/#endif */
21030 # define NSIG (_NSIG)
21036 # define NSIG (SIGMAX+1)
21042 # define NSIG (SIG_MAX+1)
21048 # define NSIG (_SIG_MAX+1)
21054 # define NSIG (MAXSIG+1)
21060 # define NSIG (MAX_SIG+1)
21065 # ifdef SIGARRAYSIZE
21066 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21072 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21076 /* Default to some arbitrary number that's big enough to get most
21077 of the common signals.
21083 printf("NSIG %d\n", NSIG);
21089 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21091 printf "#ifdef SIG"; printf $1; printf "\n"
21092 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21093 printf $1; printf ");\n"
21097 printf "#endif /* JUST_NSIG */\n";
21098 printf "exit(0);\n}\n";
21101 $cat >signal.awk <<'EOP'
21102 BEGIN { ndups = 0 }
21103 $1 ~ /^NSIG$/ { nsig = $2 }
21104 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21105 if ($2 > maxsig) { maxsig = $2 }
21106 if (sig_name[$2]) {
21107 dup_name[ndups] = $1
21108 dup_num[ndups] = $2
21120 printf("NSIG %d\n", nsig);
21121 for (n = 1; n < nsig; n++) {
21123 printf("%s %d\n", sig_name[n], sig_num[n])
21126 printf("NUM%d %d\n", n, n)
21129 for (n = 0; n < ndups; n++) {
21130 printf("%s %d\n", dup_name[n], dup_num[n])
21134 $cat >signal_cmd <<EOS
21136 if $test -s signal.lst; then
21137 echo "Using your existing signal.lst file"
21142 $cat >>signal_cmd <<'EOS'
21145 if eval $compile_ok; then
21146 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21147 $uniq | $awk -f signal.awk >signal.lst
21149 echo "(I can't seem be able to compile the whole test program)" >&4
21150 echo "(I'll try it in little pieces.)" >&4
21151 set signal -DJUST_NSIG
21152 if eval $compile_ok; then
21153 $run ./signal$_exe > signal.nsg
21156 echo "I can't seem to figure out how many signals you have." >&4
21157 echo "Guessing 50." >&4
21158 echo 'NSIG 50' > signal.nsg
21160 : Now look at all the signal names, one at a time.
21161 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21162 $cat > signal.c <<EOCP
21163 #include <sys/types.h>
21164 #include <signal.h>
21167 printf("$xx %d\n", SIG${xx});
21172 if eval $compile; then
21173 echo "SIG${xx} found."
21174 $run ./signal$_exe >> signal.ls1
21176 echo "SIG${xx} NOT found."
21179 if $test -s signal.ls1; then
21180 $cat signal.nsg signal.ls1 |
21181 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21185 if $test -s signal.lst; then
21188 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21189 echo 'kill -l' >signal
21190 set X `csh -f <signal`
21194 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21196 echo $@ | $tr ' ' $trnl | \
21197 $awk '{ printf "%s %d\n", $1, ++s; }
21198 END { printf "NSIG %d\n", ++s }' >signal.lst
21200 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21202 chmod a+x signal_cmd
21203 $eunicefix signal_cmd
21205 : generate list of signal names
21207 case "$sig_name_init" in
21209 *) case "$sig_num_init" in
21210 ''|*,*) doinit=yes ;;
21215 echo "Generating a list of signal names and numbers..." >&4
21217 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21218 sig_name=`$awk 'BEGIN { printf "ZERO " }
21219 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21220 sig_num=`$awk 'BEGIN { printf "0 " }
21221 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21222 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21223 !/^NSIG/ { printf "\"%s\", ", $1 }
21224 END { printf "0\n" }' signal.lst`
21225 sig_num_init=`$awk 'BEGIN { printf "0, " }
21226 !/^NSIG/ { printf "%d, ", $2}
21227 END { printf "0\n"}' signal.lst`
21230 echo "The following $sig_count signals are available:"
21232 echo $sig_name | $awk \
21233 'BEGIN { linelen = 0 }
21235 for (i = 1; i <= NF; i++) {
21236 name = "SIG" $i " "
21237 linelen = linelen + length(name)
21238 if (linelen > 70) {
21240 linelen = length(name)
21246 sig_size=`echo $sig_name | awk '{print NF}'`
21247 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21249 : Check size of size
21251 case "$sizetype" in
21252 *_t) zzz="$sizetype" ;;
21253 *) zzz="filesize" ;;
21255 echo "Checking the size of $zzz..." >&4
21257 #include <sys/types.h>
21259 #$i_stdlib I_STDLIB
21261 #include <stdlib.h>
21264 printf("%d\n", (int)sizeof($sizetype));
21269 if eval $compile_ok; then
21273 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21276 echo "Your $zzz size is $sizesize bytes."
21281 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21285 : check for socklen_t
21287 echo "Checking to see if you have socklen_t..." >&4
21289 #include <sys/types.h>
21290 #$d_socket HAS_SOCKET
21292 #include <sys/socket.h>
21294 int main() { socklen_t x = 16; }
21297 if eval $compile; then
21299 echo "You have socklen_t."
21302 echo "You do not have socklen_t."
21303 case "$sizetype" in
21304 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21311 : see if this is a socks.h system
21312 set socks.h i_socks
21315 : check for type of the size argument to socket calls
21316 case "$d_socket" in
21320 Checking to see what type is the last argument of accept().
21323 case "$d_socklen_t" in
21324 "$define") yyy="$yyy socklen_t"
21326 yyy="$yyy $sizetype int long unsigned"
21327 for xxx in $yyy; do
21328 case "$socksizetype" in
21329 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21330 case "$usesocks" in
21332 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21333 echo "Your system accepts '$xxx *' for the last argument of accept()."
21334 socksizetype="$xxx"
21337 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21338 echo "Your system accepts '$xxx *' for the last argument of accept()."
21339 socksizetype="$xxx"
21346 : In case none of those worked, prompt the user.
21347 case "$socksizetype" in
21348 '') rp='What is the type for socket address structure sizes?'
21355 *) : no sockets, so pick relatively harmless default
21360 : see what type is used for signed size_t
21361 set ssize_t ssizetype int stdio.h sys/types.h
21366 #$i_stdlib I_STDLIB
21368 #include <stdlib.h>
21370 #include <sys/types.h>
21371 #define Size_t $sizetype
21372 #define SSize_t $dflt
21375 if (sizeof(Size_t) == sizeof(SSize_t))
21377 else if (sizeof(Size_t) == sizeof(int))
21386 if eval $compile_ok && $run ./try > /dev/null; then
21387 ssizetype=`$run ./try`
21388 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21391 Help! I can't compile and run the ssize_t test program: please enlighten me!
21392 (This is probably a misconfiguration in your system or libraries, and
21393 you really ought to fix it. Still, I'll try anyway.)
21395 I need a type that is the same size as $sizetype, but is guaranteed to
21396 be signed. Common values are ssize_t, int and long.
21399 rp="What signed type is the same size as $sizetype?"
21405 : Check the size of st_ino
21407 $echo "Checking the size of st_ino..." >&4
21408 $cat > try.c <<EOCP
21409 #include <sys/stat.h>
21411 #$i_stdlib I_STDLIB
21413 #include <stdlib.h>
21417 printf("%d\n", (int)sizeof(st.st_ino));
21422 if eval $compile_ok; then
21426 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21428 *) st_ino_size=$val
21429 $echo "Your st_ino is $st_ino_size bytes long."
21434 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21438 : Check if st_ino is signed
21440 $echo "Checking the sign of st_ino..." >&4
21441 $cat > try.c <<EOCP
21442 #include <sys/stat.h>
21447 if (foo.st_ino < 0)
21454 if eval $compile; then
21458 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21460 *) st_ino_sign=$val
21461 case "$st_ino_sign" in
21462 1) $echo "Your st_ino is unsigned." ;;
21463 -1) $echo "Your st_ino is signed." ;;
21469 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21473 : see what type of char stdio uses.
21475 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21476 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21477 echo "Your stdio uses unsigned chars." >&4
21478 stdchar="unsigned char"
21480 echo "Your stdio uses signed chars." >&4
21485 : see what type uids are declared as in the kernel
21487 echo "Looking for the type for user ids returned by getuid()."
21488 set uid_t uidtype xxx stdio.h sys/types.h
21492 xxx=`./findhdr sys/user.h`
21493 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21495 unsigned) dflt="$1 $2" ;;
21499 *) dflt="$uidtype";;
21502 uid_t) echo "uid_t found." ;;
21503 *) rp="What is the type for user ids returned by getuid()?"
21509 : Check size of UID
21512 *_t) zzz="$uidtype" ;;
21515 echo "Checking the size of $zzz..." >&4
21517 #include <sys/types.h>
21519 #$i_stdlib I_STDLIB
21521 #include <stdlib.h>
21524 printf("%d\n", (int)sizeof($uidtype));
21529 if eval $compile_ok; then
21533 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21536 echo "Your $zzz is $uidsize bytes long."
21541 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21544 : Check if UID is signed
21547 *_t) zzz="$uidtype" ;;
21550 echo "Checking the sign of $zzz..." >&4
21552 #include <sys/types.h>
21563 if eval $compile; then
21567 echo "(I can't execute the test program--guessing unsigned.)" >&4
21571 1) echo "Your $zzz is unsigned." ;;
21572 -1) echo "Your $zzz is signed." ;;
21578 echo "(I can't compile the test program--guessing unsigned.)" >&4
21582 : Check format string for UID
21584 $echo "Checking the format string to be used for uids..." >&4
21587 -1) if $test X"$uidsize" = X"$ivsize"; then
21588 uidformat="$ivdformat"
21590 if $test X"$uidsize" = X"$longsize"; then
21593 if $test X"$uidsize" = X"$intsize"; then
21596 if $test X"$uidsize" = X"$shortsize"; then
21603 *) if $test X"$uidsize" = X"$uvsize"; then
21604 uidformat="$uvuformat"
21606 if $test X"$uidsize" = X"$longsize"; then
21609 if $test X"$uidsize" = X"$intsize"; then
21612 if $test X"$uidsize" = X"$shortsize"; then
21621 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21623 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21624 $cat >try.c <<'EOM'
21625 /* Intentionally a long probe as I'd like to sanity check that the exact
21626 approach is going to work, as thinking it will work, but only having it
21627 part working at runtime is worse than not having it. */
21629 #include <sys/types.h>
21630 #include <sys/sysctl.h>
21631 #include <sys/param.h>
21633 #include <string.h>
21634 #include <stdlib.h>
21635 #include <unistd.h>
21638 main(int argc, char **argv) {
21640 char *argv_leaf = strrchr(argv[0], '/');
21646 mib[1] = KERN_PROC;
21647 mib[2] = KERN_PROC_PATHNAME;
21651 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21655 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21660 if (size < strlen(argv_leaf) + 1) {
21661 fprintf(stderr, "size %lu is too short for a path\n",
21662 (unsigned long) size);
21666 if (size > MAXPATHLEN * MAXPATHLEN) {
21667 fprintf(stderr, "size %lu is too long for a path\n",
21668 (unsigned long) size);
21672 buffer = malloc(size);
21678 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21683 if (strlen(buffer) + 1 != size) {
21684 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21685 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21690 if (*buffer != '/') {
21691 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21695 if (strstr(buffer, "/./")) {
21696 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21700 if (strstr(buffer, "/../")) {
21701 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21705 buffer_leaf = strrchr(buffer, '/');
21706 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21707 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21719 if eval $compile; then
21720 if $run ./try; then
21721 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21724 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21728 echo "I'm unable to compile the test program." >&4
21729 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21733 set usekernprocpathname
21736 : Determine if we can use _NSGetExecutablePath to find executing program
21738 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21739 $cat >try.c <<'EOM'
21740 /* Intentionally a long probe as I'd like to sanity check that the exact
21741 approach is going to work, as thinking it will work, but only having it
21742 part working at runtime is worse than not having it. */
21743 #include <mach-o/dyld.h>
21745 #include <stdlib.h>
21746 #include <sys/param.h>
21747 #include <string.h>
21750 main(int argc, char **argv) {
21752 uint32_t size = sizeof(buf);
21756 char *argv_leaf = strrchr(argv[0], '/');
21760 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21764 _NSGetExecutablePath(buf, &size);
21765 if (size > MAXPATHLEN * MAXPATHLEN) {
21766 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21767 (unsigned int) size);
21771 buffer = malloc(size);
21777 result = _NSGetExecutablePath(buffer, &size);
21779 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21780 result, (unsigned int) size);
21784 tidied = realpath(buffer, NULL);
21786 perror("realpath");
21792 if (*tidied != '/') {
21793 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21797 if (strstr(tidied, "/./")) {
21798 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21802 if (strstr(tidied, "/../")) {
21803 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21807 tidied_leaf = strrchr(tidied, '/');
21808 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21809 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21821 if eval $compile; then
21822 if $run ./try; then
21823 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21826 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21829 echo "I'm unable to compile the test program." >&4
21830 echo "I'll assume no _NSGetExecutablePath here." >&4
21833 set usensgetexecutablepath
21836 : Check if site customization support was requested
21837 case "$usesitecustomize" in
21838 $define|true|[Yy]*)
21839 usesitecustomize="$define"
21842 usesitecustomize="$undef"
21846 : see if prototypes support variable argument declarations
21848 case "$prototype$i_stdarg" in
21850 echo "It appears we'll be able to prototype varargs functions." >&4
21854 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21861 : determine compiler compiler
21870 if $test -f "$byacc$_exe"; then
21872 comp="byacc or $comp"
21874 if $test -f "$bison$_exe"; then
21875 comp="$comp or bison -y"
21877 rp="Which compiler compiler ($comp) shall I use?"
21886 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21892 : see if this is a assert.h system
21893 set assert.h i_assert
21896 : see if this is a fp.h system
21900 : see if this is a fp_class.h system
21901 set fp_class.h i_fp_class
21904 : see if gdbm.h is available
21909 : see if gdbm_open exists
21910 set gdbm_open d_gdbm_open
21912 case "$d_gdbm_open" in
21915 echo "We won't be including <gdbm.h>"
21924 : see if this is a ieeefp.h system
21925 case "$i_ieeefp" in
21926 '' ) set ieeefp.h i_ieeefp
21931 : see if this is a libutil.h system
21932 set libutil.h i_libutil
21935 : see if mach cthreads are available
21936 if test "X$usethreads" = "X$define"; then
21937 set mach/cthreads.h i_machcthr
21940 i_machcthr="$undef"
21943 : see if this is a mntent.h system
21944 set mntent.h i_mntent
21947 : see if net/errno.h is available
21949 set net/errno.h val
21952 : Unfortunately, it causes problems on some systems. Arrgh.
21955 cat > try.c <<'EOM'
21958 #include <net/errno.h>
21964 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21965 echo "We'll be including <net/errno.h>." >&4
21967 echo "We won't be including <net/errno.h>." >&4
21976 : see if netinet/tcp.h is available
21977 set netinet/tcp.h i_netinettcp
21980 : see if this is a poll.h system
21984 : see if this is a prot.h system
21988 : Preprocessor symbols
21990 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21991 $cat <<'EOSH' > Cppsym.know
21992 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21993 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21994 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21995 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21996 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21997 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21998 bull c cadmus clipper CMU COFF COMPILER_VERSION
21999 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
22000 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
22001 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
22002 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
22004 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
22005 H3050R H3050RX hbullx20 hcx host_mips
22006 hp200 hp300 hp700 HP700 hp800 hp9000
22007 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22008 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
22009 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
22010 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22011 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
22012 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
22013 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
22014 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
22015 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
22016 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
22017 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
22018 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
22019 MATH_HAS_NO_SIDE_EFFECTS
22020 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
22021 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
22022 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
22023 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
22024 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
22025 NetBSD news1500 news1700 news1800 news1900 news3700
22026 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
22027 ns32016 ns32332 ns32k nsc32000
22028 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22029 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
22030 pc532 pdp11 PGC PIC plexus PORTAR posix
22031 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22032 POSIX_C_SOURCE POSIX_SOURCE POWER
22033 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
22034 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
22035 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
22036 sony sony_news sonyrisc sparc sparclite spectrum
22037 stardent stdc STDC_EXT stratos sun sun3 sun386
22038 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
22039 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
22040 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
22041 sysV68 sysV88 Tek4132 Tek4300 titan
22042 TM3200 TM5400 TM5600
22043 tower tower32 tower32_200 tower32_600 tower32_700
22044 tower32_800 tower32_850 tss
22045 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22046 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22047 unix UNIX95 UNIX99 unixpc unos
22048 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22049 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22050 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22052 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22053 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22054 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22057 # Maybe put other stuff here too.
22058 cat <<EOSH >>Cppsym.know
22061 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22062 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22063 $cat Cppsym.know > Cppsym.c
22064 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22065 $rm -f Cppsym.a Cppsym.b Cppsym.c
22066 cat <<EOSH > Cppsym
22068 if $test \$# -gt 0; then
22069 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22070 if $test -s Cppsym.got; then
22077 $tr " " "$trnl" | ./Cppsym.try
22083 cat <<EOSH > Cppsym.try
22085 cat <<'EOCP' > try.c
22088 #define STRINGIFY(a) "a"
22090 #if cpp_stuff == 42
22091 #define StGiFy(a) #a
22092 #define STRINGIFY(a) StGiFy(a)
22094 #if $cpp_stuff != 1 && $cpp_stuff != 42
22095 # include "Bletch: How does this C preprocessor stringify macros?"
22101 cat <<'EOSH' >> Cppsym.try
22103 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22104 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22105 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22106 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22108 echo 'return 0;}' >> try.c
22110 cat <<EOSH >> Cppsym.try
22112 case "$osname-$gccversion" in
22113 irix-) ccflags="\$ccflags -woff 1178" ;;
22114 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22116 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22118 chmod +x Cppsym.try
22119 $eunicefix Cppsym.try
22120 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22121 : Add in any Linux cpp "predefined macros":
22122 case "$osname::$gccversion" in
22123 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22125 rm -f $tHdrH'.h' $tHdrH
22127 # Filter out macro arguments, such as Linux's __INT8_C(c)
22128 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22129 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22130 if [ -s $tHdrH'_cppsym.real' ]; then
22131 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22134 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22137 : now check the C compiler for additional symbols
22138 postprocess_cc_v=''
22140 aix) postprocess_cc_v="|$tr , ' '" ;;
22147 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22150 -D*) echo "\$i" | $sed 's/^-D//';;
22151 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22156 postprocess_cc_v=''
22159 ./ccsym > ccsym1.raw
22160 if $test -s ccsym1.raw; then
22161 $sort ccsym1.raw | $uniq >ccsym.raw
22163 mv ccsym1.raw ccsym.raw
22166 $awk '/\=/ { print $0; next }
22167 { print $0"=1" }' ccsym.raw >ccsym.list
22168 $comm -13 Cppsym.true ccsym.list >ccsym.own
22169 $comm -12 Cppsym.true ccsym.list >ccsym.com
22170 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22172 if $test -z ccsym.raw; then
22173 echo "Your C compiler doesn't seem to define any symbols!" >&4
22175 echo "However, your C preprocessor defines the following symbols:"
22178 cppsymbols=`$cat Cppsym.true`
22179 cppsymbols=`echo $cppsymbols`
22180 cppccsymbols="$cppsymbols"
22182 if $test -s ccsym.com; then
22183 echo "Your C compiler and pre-processor define these symbols:"
22184 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22187 cppccsymbols=`$cat ccsym.com`
22188 cppccsymbols=`echo $cppccsymbols`
22189 $test "$silent" || sleep 1
22191 if $test -s ccsym.cpp; then
22192 $test "$also" && echo " "
22193 echo "Your C pre-processor ${also}defines the following symbols:"
22194 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22196 cppsymbols=`$cat ccsym.cpp`
22197 cppsymbols=`echo $cppsymbols`
22198 $test "$silent" || sleep 1
22200 if $test -s ccsym.own; then
22201 $test "$also" && echo " "
22202 echo "Your C compiler ${also}defines the following cpp symbols:"
22203 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22204 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22205 ccsymbols=`$cat ccsym.own`
22206 ccsymbols=`echo $ccsymbols`
22207 $test "$silent" || sleep 1
22211 : see if this is a termio system
22215 if $test `./findhdr termios.h`; then
22216 set tcsetattr i_termios
22222 "$define") echo "You have POSIX termios.h... good!" >&4;;
22223 *) if ./Cppsym pyr; then
22224 case "`/bin/universe`" in
22225 ucb) if $test `./findhdr sgtty.h`; then
22227 echo "<sgtty.h> found." >&4
22229 echo "System is pyramid with BSD universe."
22230 ./warn "<sgtty.h> not found--you could have problems."
22232 *) if $test `./findhdr termio.h`; then
22234 echo "<termio.h> found." >&4
22236 echo "System is pyramid with USG universe."
22237 ./warn "<termio.h> not found--you could have problems."
22241 if $test `./findhdr termio.h`; then
22242 echo "<termio.h> found." >&4
22244 elif $test `./findhdr sgtty.h`; then
22245 echo "<sgtty.h> found." >&4
22248 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22251 if $test `./findhdr sgtty.h`; then
22252 echo "<sgtty.h> found." >&4
22254 elif $test `./findhdr termio.h`; then
22255 echo "<termio.h> found." >&4
22258 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22262 set i_termio; eval $setvar
22263 val=$val2; set i_sgtty; eval $setvar
22264 val=$val3; set i_termios; eval $setvar
22266 : see if stdbool is available
22267 : we want a real compile instead of Inhdr because some Solaris systems
22268 : have stdbool.h, but it can only be used if the compiler indicates it
22269 : is sufficiently c99-compliant.
22273 #include <stdbool.h>
22278 int main(int argc, char **argv)
22284 if eval $compile; then
22285 echo "<stdbool.h> found." >&4
22288 echo "<stdbool.h> NOT found." >&4
22295 : see if stddef is available
22296 set stddef.h i_stddef
22299 : see if sys/access.h is available
22300 set sys/access.h i_sysaccess
22303 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22304 set sys/filio.h i_sysfilio
22307 if $test `./findhdr sys/ioctl.h`; then
22309 echo '<sys/ioctl.h> found.' >&4
22312 if $test $i_sysfilio = "$define"; then
22313 echo '<sys/ioctl.h> NOT found.' >&4
22315 $test $i_sgtty = "$define" && xxx="sgtty.h"
22316 $test $i_termio = "$define" && xxx="termio.h"
22317 $test $i_termios = "$define" && xxx="termios.h"
22318 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22324 : see if socket ioctl defs are in sys/sockio.h
22326 xxx=`./findhdr sys/sockio.h`
22327 if $test "$xxx"; then
22328 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22330 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22333 echo "No socket ioctls found in <sys/sockio.h>." >&4
22338 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22344 : see if this is a syslog.h system
22345 set syslog.h i_syslog
22348 : see if this is a sys/mode.h system
22349 set sys/mode.h i_sysmode
22352 : see if there is a sys/poll.h file
22353 set sys/poll.h i_syspoll
22356 : see if sys/resource.h has to be included
22357 set sys/resource.h i_sysresrc
22360 : see if sys/security.h is available
22361 set sys/security.h i_syssecrt
22364 : see if this is a sys/statvfs.h system
22365 set sys/statvfs.h i_sysstatvfs
22368 : see if this is a sys/un.h system
22369 set sys/un.h i_sysun
22372 : see if this is a sys/utsname.h system
22373 set sys/utsname.h i_sysutsname
22376 : see if this is a syswait system
22377 set sys/wait.h i_syswait
22380 : see if this is a ustat.h system
22381 set ustat.h i_ustat
22384 : see if this is an utime system
22385 set utime.h i_utime
22388 : see if this is a vfork system
22391 set vfork.h i_vfork
22401 echo "Looking for extensions..." >&4
22402 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22403 : contain old or inaccurate or duplicate values.
22404 nonxs_extensions=''
22406 : We do not use find because it might not be available.
22407 : We do not just use MANIFEST because the user may have dropped
22408 : some additional extensions into the source tree and expect them
22411 : Function to recursively find available extensions, ignoring DynaLoader
22412 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22413 : In 5.10.1 and later, extensions are stored in directories
22414 : like File-Glob instead of the older File/Glob/.
22418 DynaLoader|dynaload) ;;
22420 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22421 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22422 if $contains " $this_ext " $$.tmp; then
22424 echo "Duplicate directories detected for extension $xxx" >&4;
22425 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22426 case "$knowitall" in
22434 echo "Ok. Stopping Configure." >&4;
22435 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22438 echo "Ok. You will need to correct config.sh before running make." >&4;
22440 $ls -1 $xxx > $$.tmp;
22441 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22442 xs_extensions="$xs_extensions $this_ext";
22443 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22444 xs_extensions="$xs_extensions $this_ext";
22445 elif $test -d $xxx; then
22446 nonxs_extensions="$nonxs_extensions $this_ext";
22456 eval $find_extensions
22460 eval $find_extensions
22464 eval $find_extensions
22465 set X $xs_extensions
22467 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22468 set X $nonxs_extensions
22470 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22472 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22474 : Now see which are supported on this system.
22476 for xxx in $xs_extensions ; do
22480 $define) avail_ext="$avail_ext $xxx" ;;
22483 GDBM_File|gdbm_fil)
22485 $define) avail_ext="$avail_ext $xxx" ;;
22488 I18N/Langinfo|i18n_lan)
22489 case "$i_langinfo$d_nl_langinfo" in
22490 $define$define) avail_ext="$avail_ext $xxx" ;;
22494 : XXX Do we need a useipcsysv variable here
22495 case "${d_msg}${d_sem}${d_shm}" in
22496 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22499 NDBM_File|ndbm_fil)
22502 case "$osname-$use64bitint" in
22505 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22508 *) avail_ext="$avail_ext $xxx" ;;
22513 ODBM_File|odbm_fil)
22514 case "${i_dbm}${i_rpcsvcdbm}" in
22516 case "$d_cplusplus" in
22517 define) ;; # delete as a function name will not work
22518 *) case "$osname-$use64bitint" in
22521 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22524 *) avail_ext="$avail_ext $xxx" ;;
22532 case "$useopcode" in
22533 true|define|y) avail_ext="$avail_ext $xxx" ;;
22537 case "$useposix" in
22538 true|define|y) avail_ext="$avail_ext $xxx" ;;
22542 case "$d_socket" in
22543 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22546 Sys/Syslog|sys/syslog)
22547 : XXX syslog requires socket
22548 case "$d_socket" in
22549 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22553 case "$usethreads" in
22555 case "$use5005threads" in
22556 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22560 threads|threads/shared)
22561 # threads and threads::shared are special cases.
22562 # To stop people from asking "Perl 5.8.0 was supposed
22563 # to have this new fancy threads implementation but my
22564 # perl doesn't have it" and from people trying to
22565 # (re)install the threads module using CPAN.pm and
22566 # CPAN.pm then offering to reinstall Perl 5.8.0,
22567 # the threads.pm and threads/shared.pm will always be
22568 # there, croaking informatively ("you need to rebuild
22569 # all of Perl with threads, sorry") when threads haven't
22570 # been compiled in.
22572 avail_ext="$avail_ext $xxx"
22578 cygwin) avail_ext="$avail_ext $xxx" ;;
22581 XS/APItest|xs/apitest)
22582 # This is just for testing. Skip it unless we have dynamic loading.
22585 $define) avail_ext="$avail_ext $xxx" ;;
22588 XS/Typemap|xs/typemap)
22589 # This is just for testing. Skip it unless we have dynamic loading.
22591 $define) avail_ext="$avail_ext $xxx" ;;
22594 *) avail_ext="$avail_ext $xxx"
22603 case "$onlyextensions" in
22605 *) keepextensions=''
22606 echo "You have requested that only certain extensions be included..." >&4
22607 for i in $onlyextensions; do
22608 case " $avail_ext " in
22610 echo "Keeping extension $i."
22611 keepextensions="$keepextensions $i"
22613 *) echo "Ignoring extension $i." ;;
22616 avail_ext="$keepextensions"
22620 case "$noextensions" in
22622 *) keepextensions=''
22623 echo "You have requested that certain extensions be ignored..." >&4
22624 for i in $avail_ext; do
22625 case " $noextensions " in
22626 *" $i "*) echo "Ignoring extension $i." ;;
22627 *) echo "Keeping extension $i.";
22628 keepextensions="$keepextensions $i"
22632 avail_ext="$keepextensions"
22636 : Now see which nonxs extensions are supported on this system.
22637 : For now assume all are.
22639 for xxx in $nonxs_extensions ; do
22643 *) nonxs_ext="$nonxs_ext $xxx"
22655 A number of extensions are supplied with $package. You may choose to
22656 compile these extensions for dynamic loading (the default), compile
22657 them into the $package executable (static loading), or not include
22658 them at all. Answer "none" to include no extensions.
22659 Note that DynaLoader is always built and need not be mentioned here.
22662 case "$dynamic_ext" in
22664 : Exclude those listed in static_ext
22666 for xxx in $avail_ext; do
22667 case " $static_ext " in
22669 *) dflt="$dflt $xxx" ;;
22676 *) dflt="$dynamic_ext"
22677 # Perhaps we are reusing an old out-of-date config.sh.
22680 if test X"$dynamic_ext" != X"$avail_ext"; then
22682 NOTICE: Your previous config.sh list may be incorrect.
22683 The extensions now available to you are
22685 but the default list from your previous config.sh is
22697 rp="What extensions do you wish to load dynamically?"
22700 none) dynamic_ext=' ' ;;
22701 *) dynamic_ext="$ans" ;;
22704 case "$static_ext" in
22706 : Exclude those already listed in dynamic linking
22708 for xxx in $avail_ext; do
22709 case " $dynamic_ext " in
22711 *) dflt="$dflt $xxx" ;;
22718 *) dflt="$static_ext"
22725 rp="What extensions do you wish to load statically?"
22728 none) static_ext=' ' ;;
22729 *) static_ext="$ans" ;;
22734 A number of extensions are supplied with $package. Answer "none"
22735 to include no extensions.
22736 Note that DynaLoader is always built and need not be mentioned here.
22739 case "$static_ext" in
22740 '') dflt="$avail_ext" ;;
22741 *) dflt="$static_ext"
22742 # Perhaps we are reusing an old out-of-date config.sh.
22745 if test X"$static_ext" != X"$avail_ext"; then
22747 NOTICE: Your previous config.sh list may be incorrect.
22748 The extensions now available to you are
22750 but the default list from your previous config.sh is
22759 : Exclude those that are not xs extensions
22763 rp="What extensions do you wish to include?"
22766 none) static_ext=' ' ;;
22767 *) static_ext="$ans" ;;
22772 # Encode is a special case. If we are building Encode as a static
22773 # extension, we need to explicitly list its subextensions as well.
22774 # For other nested extensions, this is handled automatically by
22775 # the appropriate Makefile.PL.
22776 case " $static_ext " in
22777 *" Encode "*) # Add the subextensions of Encode
22779 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22780 static_ext="$static_ext Encode/$xxx"
22781 known_extensions="$known_extensions Encode/$xxx"
22787 set X $dynamic_ext $static_ext $nonxs_ext
22791 # Sanity check: We require an extension suitable for use with
22792 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22793 # should show up as failures in the test suite, but it's helpful to
22794 # catch them now.) The 'extensions' list is normally sorted
22795 # alphabetically, so we need to accept either
22796 # DB_File ... Fcntl ... IO ....
22797 # or something like
22798 # Fcntl ... NDBM_File ... IO ....
22799 case " $extensions" in
22800 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22801 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22802 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22803 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22804 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22808 : Remove libraries needed only for extensions
22809 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22810 : The exception is SunOS 4.x, which needs them.
22811 case "${osname}X${osvers}" in
22815 *) case "$usedl" in
22816 $define|true|[yY]*)
22817 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22821 *) perllibs="$libs"
22827 : Remove build directory name from cppstdin so it can be used from
22828 : either the present location or the final installed location.
22830 : Get out of the UU directory to get correct path name.
22832 case "$cppstdin" in
22834 echo "Stripping down cppstdin path name"
22840 : end of configuration questions
22842 echo "End of configuration questions."
22845 : back to where it started
22846 if test -d ../UU; then
22850 : configuration may be unconditionally patched via a 'config.arch' file
22851 if $test -f config.arch; then
22852 echo "I see a config.arch file, loading it." >&4
22856 : configuration may be patched via a 'config.over' file
22857 if $test -f config.over; then
22860 rp='I see a config.over file. Do you wish to load it?'
22863 n*) echo "OK, I'll ignore it.";;
22865 echo "Configuration override changes have been loaded."
22870 : in case they want portability, strip down executable paths
22871 case "$d_portable" in
22874 echo "Stripping down executable paths..." >&4
22875 for file in $loclist $trylist; do
22877 eval $file=`basename $temp`
22882 : create config.sh file
22884 echo "Creating config.sh..." >&4
22885 $spitshell <<EOT >config.sh
22888 # This file was produced by running the Configure script. It holds all the
22889 # definitions figured out by Configure. Should you modify one of these values,
22890 # do not forget to propagate your changes by running "Configure -der". You may
22891 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22894 # Package name : $package
22895 # Source directory : $src
22896 # Configuration time: $cf_time
22897 # Configured by : $cf_by
22898 # Target system : $myuname
22901 : Add in command line options if available
22902 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22904 $spitshell <<EOT >>config.sh
22913 Revision='$Revision'
22921 alignbytes='$alignbytes'
22922 ansi2knr='$ansi2knr'
22923 aphostname='$aphostname'
22924 api_revision='$api_revision'
22925 api_subversion='$api_subversion'
22926 api_version='$api_version'
22927 api_versionstring='$api_versionstring'
22930 archlibexp='$archlibexp'
22931 archname64='$archname64'
22932 archname='$archname'
22933 archobjs='$archobjs'
22934 asctime_r_proto='$asctime_r_proto'
22942 bootstrap_charset='$bootstrap_charset'
22944 byteorder='$byteorder'
22946 castflags='$castflags'
22949 cccdlflags='$cccdlflags'
22950 ccdlflags='$ccdlflags'
22952 ccflags_uselargefiles='$ccflags_uselargefiles'
22954 ccsymbols='$ccsymbols'
22955 ccversion='$ccversion'
22957 cf_email='$cf_email'
22959 charbits='$charbits'
22960 charsize='$charsize'
22964 clocktype='$clocktype'
22966 compress='$compress'
22967 contains='$contains'
22971 cpp_stuff='$cpp_stuff'
22972 cppccsymbols='$cppccsymbols'
22973 cppflags='$cppflags'
22975 cppminus='$cppminus'
22977 cppstdin='$cppstdin'
22978 cppsymbols='$cppsymbols'
22979 crypt_r_proto='$crypt_r_proto'
22980 cryptlib='$cryptlib'
22982 ctermid_r_proto='$ctermid_r_proto'
22983 ctime_r_proto='$ctime_r_proto'
22984 d_Gconvert='$d_Gconvert'
22985 d_PRIEUldbl='$d_PRIEUldbl'
22986 d_PRIFUldbl='$d_PRIFUldbl'
22987 d_PRIGUldbl='$d_PRIGUldbl'
22988 d_PRIXU64='$d_PRIXU64'
22989 d_PRId64='$d_PRId64'
22990 d_PRIeldbl='$d_PRIeldbl'
22991 d_PRIfldbl='$d_PRIfldbl'
22992 d_PRIgldbl='$d_PRIgldbl'
22993 d_PRIi64='$d_PRIi64'
22994 d_PRIo64='$d_PRIo64'
22995 d_PRIu64='$d_PRIu64'
22996 d_PRIx64='$d_PRIx64'
22997 d_SCNfldbl='$d_SCNfldbl'
22998 d__fwalk='$d__fwalk'
22999 d_access='$d_access'
23000 d_accessx='$d_accessx'
23003 d_archlib='$d_archlib'
23004 d_asctime64='$d_asctime64'
23005 d_asctime_r='$d_asctime_r'
23008 d_attribute_deprecated='$d_attribute_deprecated'
23009 d_attribute_format='$d_attribute_format'
23010 d_attribute_malloc='$d_attribute_malloc'
23011 d_attribute_nonnull='$d_attribute_nonnull'
23012 d_attribute_noreturn='$d_attribute_noreturn'
23013 d_attribute_pure='$d_attribute_pure'
23014 d_attribute_unused='$d_attribute_unused'
23015 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23019 d_bsdgetpgrp='$d_bsdgetpgrp'
23020 d_bsdsetpgrp='$d_bsdsetpgrp'
23021 d_builtin_choose_expr='$d_builtin_choose_expr'
23022 d_builtin_expect='$d_builtin_expect'
23024 d_c99_variadic_macros='$d_c99_variadic_macros'
23025 d_casti32='$d_casti32'
23026 d_castneg='$d_castneg'
23027 d_charvspr='$d_charvspr'
23029 d_chroot='$d_chroot'
23030 d_chsize='$d_chsize'
23032 d_clearenv='$d_clearenv'
23033 d_closedir='$d_closedir'
23034 d_cmsghdr_s='$d_cmsghdr_s'
23036 d_copysignl='$d_copysignl'
23037 d_cplusplus='$d_cplusplus'
23039 d_crypt_r='$d_crypt_r'
23041 d_ctermid='$d_ctermid'
23042 d_ctermid_r='$d_ctermid_r'
23043 d_ctime64='$d_ctime64'
23044 d_ctime_r='$d_ctime_r'
23045 d_cuserid='$d_cuserid'
23046 d_dbl_dig='$d_dbl_dig'
23047 d_dbminitproto='$d_dbminitproto'
23048 d_difftime64='$d_difftime64'
23049 d_difftime='$d_difftime'
23050 d_dir_dd_fd='$d_dir_dd_fd'
23052 d_dirnamlen='$d_dirnamlen'
23053 d_dlerror='$d_dlerror'
23054 d_dlopen='$d_dlopen'
23055 d_dlsymun='$d_dlsymun'
23056 d_dosuid='$d_dosuid'
23057 d_drand48_r='$d_drand48_r'
23058 d_drand48proto='$d_drand48proto'
23060 d_eaccess='$d_eaccess'
23061 d_endgrent='$d_endgrent'
23062 d_endgrent_r='$d_endgrent_r'
23063 d_endhent='$d_endhent'
23064 d_endhostent_r='$d_endhostent_r'
23065 d_endnent='$d_endnent'
23066 d_endnetent_r='$d_endnetent_r'
23067 d_endpent='$d_endpent'
23068 d_endprotoent_r='$d_endprotoent_r'
23069 d_endpwent='$d_endpwent'
23070 d_endpwent_r='$d_endpwent_r'
23071 d_endsent='$d_endsent'
23072 d_endservent_r='$d_endservent_r'
23073 d_eofnblk='$d_eofnblk'
23074 d_eunice='$d_eunice'
23075 d_faststdio='$d_faststdio'
23076 d_fchdir='$d_fchdir'
23077 d_fchmod='$d_fchmod'
23078 d_fchown='$d_fchown'
23080 d_fcntl_can_lock='$d_fcntl_can_lock'
23081 d_fd_macros='$d_fd_macros'
23082 d_fd_set='$d_fd_set'
23083 d_fds_bits='$d_fds_bits'
23084 d_fgetpos='$d_fgetpos'
23085 d_finite='$d_finite'
23086 d_finitel='$d_finitel'
23087 d_flexfnam='$d_flexfnam'
23089 d_flockproto='$d_flockproto'
23091 d_fp_class='$d_fp_class'
23092 d_fpathconf='$d_fpathconf'
23093 d_fpclass='$d_fpclass'
23094 d_fpclassify='$d_fpclassify'
23095 d_fpclassl='$d_fpclassl'
23096 d_fpos64_t='$d_fpos64_t'
23097 d_frexpl='$d_frexpl'
23098 d_fs_data_s='$d_fs_data_s'
23099 d_fseeko='$d_fseeko'
23100 d_fsetpos='$d_fsetpos'
23101 d_fstatfs='$d_fstatfs'
23102 d_fstatvfs='$d_fstatvfs'
23104 d_ftello='$d_ftello'
23106 d_futimes='$d_futimes'
23107 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23108 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23109 d_getaddrinfo='$d_getaddrinfo'
23110 d_getcwd='$d_getcwd'
23111 d_getespwnam='$d_getespwnam'
23112 d_getfsstat='$d_getfsstat'
23113 d_getgrent='$d_getgrent'
23114 d_getgrent_r='$d_getgrent_r'
23115 d_getgrgid_r='$d_getgrgid_r'
23116 d_getgrnam_r='$d_getgrnam_r'
23117 d_getgrps='$d_getgrps'
23118 d_gethbyaddr='$d_gethbyaddr'
23119 d_gethbyname='$d_gethbyname'
23120 d_gethent='$d_gethent'
23121 d_gethname='$d_gethname'
23122 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23123 d_gethostbyname_r='$d_gethostbyname_r'
23124 d_gethostent_r='$d_gethostent_r'
23125 d_gethostprotos='$d_gethostprotos'
23126 d_getitimer='$d_getitimer'
23127 d_getlogin='$d_getlogin'
23128 d_getlogin_r='$d_getlogin_r'
23129 d_getmnt='$d_getmnt'
23130 d_getmntent='$d_getmntent'
23131 d_getnameinfo='$d_getnameinfo'
23132 d_getnbyaddr='$d_getnbyaddr'
23133 d_getnbyname='$d_getnbyname'
23134 d_getnent='$d_getnent'
23135 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23136 d_getnetbyname_r='$d_getnetbyname_r'
23137 d_getnetent_r='$d_getnetent_r'
23138 d_getnetprotos='$d_getnetprotos'
23139 d_getpagsz='$d_getpagsz'
23140 d_getpbyname='$d_getpbyname'
23141 d_getpbynumber='$d_getpbynumber'
23142 d_getpent='$d_getpent'
23143 d_getpgid='$d_getpgid'
23144 d_getpgrp2='$d_getpgrp2'
23145 d_getpgrp='$d_getpgrp'
23146 d_getppid='$d_getppid'
23147 d_getprior='$d_getprior'
23148 d_getprotobyname_r='$d_getprotobyname_r'
23149 d_getprotobynumber_r='$d_getprotobynumber_r'
23150 d_getprotoent_r='$d_getprotoent_r'
23151 d_getprotoprotos='$d_getprotoprotos'
23152 d_getprpwnam='$d_getprpwnam'
23153 d_getpwent='$d_getpwent'
23154 d_getpwent_r='$d_getpwent_r'
23155 d_getpwnam_r='$d_getpwnam_r'
23156 d_getpwuid_r='$d_getpwuid_r'
23157 d_getsbyname='$d_getsbyname'
23158 d_getsbyport='$d_getsbyport'
23159 d_getsent='$d_getsent'
23160 d_getservbyname_r='$d_getservbyname_r'
23161 d_getservbyport_r='$d_getservbyport_r'
23162 d_getservent_r='$d_getservent_r'
23163 d_getservprotos='$d_getservprotos'
23164 d_getspnam='$d_getspnam'
23165 d_getspnam_r='$d_getspnam_r'
23166 d_gettimeod='$d_gettimeod'
23167 d_gmtime64='$d_gmtime64'
23168 d_gmtime_r='$d_gmtime_r'
23169 d_gnulibc='$d_gnulibc'
23170 d_grpasswd='$d_grpasswd'
23171 d_hasmntopt='$d_hasmntopt'
23173 d_ilogbl='$d_ilogbl'
23174 d_inc_version_list='$d_inc_version_list'
23176 d_inetaton='$d_inetaton'
23177 d_inetntop='$d_inetntop'
23178 d_inetpton='$d_inetpton'
23179 d_int64_t='$d_int64_t'
23180 d_ip_mreq='$d_ip_mreq'
23181 d_ip_mreq_source='$d_ip_mreq_source'
23182 d_ipv6_mreq='$d_ipv6_mreq'
23183 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23184 d_isascii='$d_isascii'
23185 d_isblank='$d_isblank'
23186 d_isfinite='$d_isfinite'
23189 d_isnanl='$d_isnanl'
23190 d_killpg='$d_killpg'
23191 d_lchown='$d_lchown'
23192 d_ldbl_dig='$d_ldbl_dig'
23193 d_libm_lib_version='$d_libm_lib_version'
23195 d_localtime64='$d_localtime64'
23196 d_localtime_r='$d_localtime_r'
23197 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23198 d_locconv='$d_locconv'
23200 d_longdbl='$d_longdbl'
23201 d_longlong='$d_longlong'
23202 d_lseekproto='$d_lseekproto'
23204 d_madvise='$d_madvise'
23205 d_malloc_good_size='$d_malloc_good_size'
23206 d_malloc_size='$d_malloc_size'
23208 d_mbstowcs='$d_mbstowcs'
23209 d_mbtowc='$d_mbtowc'
23210 d_memchr='$d_memchr'
23211 d_memcmp='$d_memcmp'
23212 d_memcpy='$d_memcpy'
23213 d_memmove='$d_memmove'
23214 d_memset='$d_memset'
23216 d_mkdtemp='$d_mkdtemp'
23217 d_mkfifo='$d_mkfifo'
23218 d_mkstemp='$d_mkstemp'
23219 d_mkstemps='$d_mkstemps'
23220 d_mktime64='$d_mktime64'
23221 d_mktime='$d_mktime'
23224 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23225 d_modflproto='$d_modflproto'
23226 d_mprotect='$d_mprotect'
23228 d_msg_ctrunc='$d_msg_ctrunc'
23229 d_msg_dontroute='$d_msg_dontroute'
23230 d_msg_oob='$d_msg_oob'
23231 d_msg_peek='$d_msg_peek'
23232 d_msg_proxy='$d_msg_proxy'
23233 d_msgctl='$d_msgctl'
23234 d_msgget='$d_msgget'
23235 d_msghdr_s='$d_msghdr_s'
23236 d_msgrcv='$d_msgrcv'
23237 d_msgsnd='$d_msgsnd'
23239 d_munmap='$d_munmap'
23240 d_mymalloc='$d_mymalloc'
23242 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23244 d_nl_langinfo='$d_nl_langinfo'
23245 d_nv_preserves_uv='$d_nv_preserves_uv'
23246 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23247 d_off64_t='$d_off64_t'
23248 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23249 d_oldpthreads='$d_oldpthreads'
23250 d_oldsock='$d_oldsock'
23252 d_pathconf='$d_pathconf'
23254 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23255 d_phostname='$d_phostname'
23258 d_portable='$d_portable'
23260 d_prctl_set_name='$d_prctl_set_name'
23261 d_printf_format_null='$d_printf_format_null'
23262 d_procselfexe='$d_procselfexe'
23263 d_pseudofork='$d_pseudofork'
23264 d_pthread_atfork='$d_pthread_atfork'
23265 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23266 d_pthread_yield='$d_pthread_yield'
23268 d_pwchange='$d_pwchange'
23269 d_pwclass='$d_pwclass'
23270 d_pwcomment='$d_pwcomment'
23271 d_pwexpire='$d_pwexpire'
23272 d_pwgecos='$d_pwgecos'
23273 d_pwpasswd='$d_pwpasswd'
23274 d_pwquota='$d_pwquota'
23277 d_random_r='$d_random_r'
23278 d_readdir64_r='$d_readdir64_r'
23279 d_readdir='$d_readdir'
23280 d_readdir_r='$d_readdir_r'
23281 d_readlink='$d_readlink'
23283 d_recvmsg='$d_recvmsg'
23284 d_rename='$d_rename'
23285 d_rewinddir='$d_rewinddir'
23287 d_safebcpy='$d_safebcpy'
23288 d_safemcpy='$d_safemcpy'
23289 d_sanemcmp='$d_sanemcmp'
23290 d_sbrkproto='$d_sbrkproto'
23291 d_scalbnl='$d_scalbnl'
23292 d_sched_yield='$d_sched_yield'
23293 d_scm_rights='$d_scm_rights'
23294 d_seekdir='$d_seekdir'
23295 d_select='$d_select'
23297 d_semctl='$d_semctl'
23298 d_semctl_semid_ds='$d_semctl_semid_ds'
23299 d_semctl_semun='$d_semctl_semun'
23300 d_semget='$d_semget'
23302 d_sendmsg='$d_sendmsg'
23303 d_setegid='$d_setegid'
23304 d_seteuid='$d_seteuid'
23305 d_setgrent='$d_setgrent'
23306 d_setgrent_r='$d_setgrent_r'
23307 d_setgrps='$d_setgrps'
23308 d_sethent='$d_sethent'
23309 d_sethostent_r='$d_sethostent_r'
23310 d_setitimer='$d_setitimer'
23311 d_setlinebuf='$d_setlinebuf'
23312 d_setlocale='$d_setlocale'
23313 d_setlocale_r='$d_setlocale_r'
23314 d_setnent='$d_setnent'
23315 d_setnetent_r='$d_setnetent_r'
23316 d_setpent='$d_setpent'
23317 d_setpgid='$d_setpgid'
23318 d_setpgrp2='$d_setpgrp2'
23319 d_setpgrp='$d_setpgrp'
23320 d_setprior='$d_setprior'
23321 d_setproctitle='$d_setproctitle'
23322 d_setprotoent_r='$d_setprotoent_r'
23323 d_setpwent='$d_setpwent'
23324 d_setpwent_r='$d_setpwent_r'
23325 d_setregid='$d_setregid'
23326 d_setresgid='$d_setresgid'
23327 d_setresuid='$d_setresuid'
23328 d_setreuid='$d_setreuid'
23329 d_setrgid='$d_setrgid'
23330 d_setruid='$d_setruid'
23331 d_setsent='$d_setsent'
23332 d_setservent_r='$d_setservent_r'
23333 d_setsid='$d_setsid'
23334 d_setvbuf='$d_setvbuf'
23338 d_shmatprototype='$d_shmatprototype'
23339 d_shmctl='$d_shmctl'
23341 d_shmget='$d_shmget'
23342 d_sigaction='$d_sigaction'
23343 d_signbit='$d_signbit'
23344 d_sigprocmask='$d_sigprocmask'
23345 d_sigsetjmp='$d_sigsetjmp'
23346 d_sin6_scope_id='$d_sin6_scope_id'
23347 d_sitearch='$d_sitearch'
23348 d_snprintf='$d_snprintf'
23349 d_sockaddr_in6='$d_sockaddr_in6'
23350 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23351 d_sockatmark='$d_sockatmark'
23352 d_sockatmarkproto='$d_sockatmarkproto'
23353 d_socket='$d_socket'
23354 d_socklen_t='$d_socklen_t'
23355 d_sockpair='$d_sockpair'
23356 d_socks5_init='$d_socks5_init'
23357 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23359 d_srand48_r='$d_srand48_r'
23360 d_srandom_r='$d_srandom_r'
23361 d_sresgproto='$d_sresgproto'
23362 d_sresuproto='$d_sresuproto'
23363 d_statblks='$d_statblks'
23364 d_statfs_f_flags='$d_statfs_f_flags'
23365 d_statfs_s='$d_statfs_s'
23366 d_static_inline='$d_static_inline'
23367 d_statvfs='$d_statvfs'
23368 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23369 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23370 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23371 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23372 d_stdio_stream_array='$d_stdio_stream_array'
23373 d_stdiobase='$d_stdiobase'
23374 d_stdstdio='$d_stdstdio'
23375 d_strchr='$d_strchr'
23376 d_strcoll='$d_strcoll'
23377 d_strctcpy='$d_strctcpy'
23378 d_strerrm='$d_strerrm'
23379 d_strerror='$d_strerror'
23380 d_strerror_r='$d_strerror_r'
23381 d_strftime='$d_strftime'
23382 d_strlcat='$d_strlcat'
23383 d_strlcpy='$d_strlcpy'
23384 d_strtod='$d_strtod'
23385 d_strtol='$d_strtol'
23386 d_strtold='$d_strtold'
23387 d_strtoll='$d_strtoll'
23388 d_strtoq='$d_strtoq'
23389 d_strtoul='$d_strtoul'
23390 d_strtoull='$d_strtoull'
23391 d_strtouq='$d_strtouq'
23392 d_strxfrm='$d_strxfrm'
23393 d_suidsafe='$d_suidsafe'
23394 d_symlink='$d_symlink'
23395 d_syscall='$d_syscall'
23396 d_syscallproto='$d_syscallproto'
23397 d_sysconf='$d_sysconf'
23398 d_sysernlst='$d_sysernlst'
23399 d_syserrlst='$d_syserrlst'
23400 d_system='$d_system'
23401 d_tcgetpgrp='$d_tcgetpgrp'
23402 d_tcsetpgrp='$d_tcsetpgrp'
23403 d_telldir='$d_telldir'
23404 d_telldirproto='$d_telldirproto'
23406 d_timegm='$d_timegm'
23408 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23409 d_tm_tm_zone='$d_tm_tm_zone'
23410 d_tmpnam_r='$d_tmpnam_r'
23411 d_truncate='$d_truncate'
23412 d_ttyname_r='$d_ttyname_r'
23413 d_tzname='$d_tzname'
23414 d_u32align='$d_u32align'
23415 d_ualarm='$d_ualarm'
23418 d_union_semun='$d_union_semun'
23419 d_unordered='$d_unordered'
23420 d_unsetenv='$d_unsetenv'
23421 d_usleep='$d_usleep'
23422 d_usleepproto='$d_usleepproto'
23424 d_vendorarch='$d_vendorarch'
23425 d_vendorbin='$d_vendorbin'
23426 d_vendorlib='$d_vendorlib'
23427 d_vendorscript='$d_vendorscript'
23429 d_void_closedir='$d_void_closedir'
23430 d_voidsig='$d_voidsig'
23431 d_voidtty='$d_voidtty'
23432 d_volatile='$d_volatile'
23433 d_vprintf='$d_vprintf'
23434 d_vsnprintf='$d_vsnprintf'
23436 d_waitpid='$d_waitpid'
23437 d_wcstombs='$d_wcstombs'
23438 d_wctomb='$d_wctomb'
23439 d_writev='$d_writev'
23442 db_hashtype='$db_hashtype'
23443 db_prefixtype='$db_prefixtype'
23444 db_version_major='$db_version_major'
23445 db_version_minor='$db_version_minor'
23446 db_version_patch='$db_version_patch'
23447 defvoidused='$defvoidused'
23448 direntrytype='$direntrytype'
23451 doublesize='$doublesize'
23453 drand48_r_proto='$drand48_r_proto'
23455 dynamic_ext='$dynamic_ext'
23461 endgrent_r_proto='$endgrent_r_proto'
23462 endhostent_r_proto='$endhostent_r_proto'
23463 endnetent_r_proto='$endnetent_r_proto'
23464 endprotoent_r_proto='$endprotoent_r_proto'
23465 endpwent_r_proto='$endpwent_r_proto'
23466 endservent_r_proto='$endservent_r_proto'
23467 eunicefix='$eunicefix'
23470 extensions='$extensions'
23471 extern_C='$extern_C'
23473 fflushNULL='$fflushNULL'
23474 fflushall='$fflushall'
23476 firstmakefile='$firstmakefile'
23478 fpossize='$fpossize'
23479 fpostype='$fpostype'
23480 freetype='$freetype'
23483 full_csh='$full_csh'
23484 full_sed='$full_sed'
23485 gccansipedantic='$gccansipedantic'
23486 gccosandvers='$gccosandvers'
23487 gccversion='$gccversion'
23488 getgrent_r_proto='$getgrent_r_proto'
23489 getgrgid_r_proto='$getgrgid_r_proto'
23490 getgrnam_r_proto='$getgrnam_r_proto'
23491 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23492 gethostbyname_r_proto='$gethostbyname_r_proto'
23493 gethostent_r_proto='$gethostent_r_proto'
23494 getlogin_r_proto='$getlogin_r_proto'
23495 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23496 getnetbyname_r_proto='$getnetbyname_r_proto'
23497 getnetent_r_proto='$getnetent_r_proto'
23498 getprotobyname_r_proto='$getprotobyname_r_proto'
23499 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23500 getprotoent_r_proto='$getprotoent_r_proto'
23501 getpwent_r_proto='$getpwent_r_proto'
23502 getpwnam_r_proto='$getpwnam_r_proto'
23503 getpwuid_r_proto='$getpwuid_r_proto'
23504 getservbyname_r_proto='$getservbyname_r_proto'
23505 getservbyport_r_proto='$getservbyport_r_proto'
23506 getservent_r_proto='$getservent_r_proto'
23507 getspnam_r_proto='$getspnam_r_proto'
23508 gidformat='$gidformat'
23514 gmtime_r_proto='$gmtime_r_proto'
23515 gnulibc_version='$gnulibc_version'
23517 groupcat='$groupcat'
23518 groupstype='$groupstype'
23521 h_sysfile='$h_sysfile'
23524 html1dir='$html1dir'
23525 html1direxp='$html1direxp'
23526 html3dir='$html3dir'
23527 html3direxp='$html3direxp'
23536 i_arpainet='$i_arpainet'
23537 i_assert='$i_assert'
23538 i_bsdioctl='$i_bsdioctl'
23542 i_dirent='$i_dirent'
23548 i_fp_class='$i_fp_class'
23550 i_gdbm_ndbm='$i_gdbm_ndbm'
23551 i_gdbmndbm='$i_gdbmndbm'
23553 i_ieeefp='$i_ieeefp'
23554 i_inttypes='$i_inttypes'
23555 i_langinfo='$i_langinfo'
23556 i_libutil='$i_libutil'
23557 i_limits='$i_limits'
23558 i_locale='$i_locale'
23559 i_machcthr='$i_machcthr'
23560 i_malloc='$i_malloc'
23561 i_mallocmalloc='$i_mallocmalloc'
23563 i_memory='$i_memory'
23564 i_mntent='$i_mntent'
23567 i_neterrno='$i_neterrno'
23568 i_netinettcp='$i_netinettcp'
23572 i_pthread='$i_pthread'
23574 i_rpcsvcdbm='$i_rpcsvcdbm'
23577 i_shadow='$i_shadow'
23579 i_stdarg='$i_stdarg'
23580 i_stdbool='$i_stdbool'
23581 i_stddef='$i_stddef'
23582 i_stdlib='$i_stdlib'
23583 i_string='$i_string'
23584 i_sunmath='$i_sunmath'
23585 i_sysaccess='$i_sysaccess'
23586 i_sysdir='$i_sysdir'
23587 i_sysfile='$i_sysfile'
23588 i_sysfilio='$i_sysfilio'
23590 i_sysioctl='$i_sysioctl'
23591 i_syslog='$i_syslog'
23592 i_sysmman='$i_sysmman'
23593 i_sysmode='$i_sysmode'
23594 i_sysmount='$i_sysmount'
23595 i_sysndir='$i_sysndir'
23596 i_sysparam='$i_sysparam'
23597 i_syspoll='$i_syspoll'
23598 i_sysresrc='$i_sysresrc'
23599 i_syssecrt='$i_syssecrt'
23600 i_sysselct='$i_sysselct'
23601 i_syssockio='$i_syssockio'
23602 i_sysstat='$i_sysstat'
23603 i_sysstatfs='$i_sysstatfs'
23604 i_sysstatvfs='$i_sysstatvfs'
23605 i_systime='$i_systime'
23606 i_systimek='$i_systimek'
23607 i_systimes='$i_systimes'
23608 i_systypes='$i_systypes'
23609 i_sysuio='$i_sysuio'
23611 i_sysutsname='$i_sysutsname'
23612 i_sysvfs='$i_sysvfs'
23613 i_syswait='$i_syswait'
23614 i_termio='$i_termio'
23615 i_termios='$i_termios'
23617 i_unistd='$i_unistd'
23620 i_values='$i_values'
23621 i_varargs='$i_varargs'
23622 i_varhdr='$i_varhdr'
23624 ignore_versioned_solibs='$ignore_versioned_solibs'
23625 inc_version_list='$inc_version_list'
23626 inc_version_list_init='$inc_version_list_init'
23629 initialinstalllocation='$initialinstalllocation'
23630 installarchlib='$installarchlib'
23631 installbin='$installbin'
23632 installhtml1dir='$installhtml1dir'
23633 installhtml3dir='$installhtml3dir'
23634 installman1dir='$installman1dir'
23635 installman3dir='$installman3dir'
23636 installprefix='$installprefix'
23637 installprefixexp='$installprefixexp'
23638 installprivlib='$installprivlib'
23639 installscript='$installscript'
23640 installsitearch='$installsitearch'
23641 installsitebin='$installsitebin'
23642 installsitehtml1dir='$installsitehtml1dir'
23643 installsitehtml3dir='$installsitehtml3dir'
23644 installsitelib='$installsitelib'
23645 installsiteman1dir='$installsiteman1dir'
23646 installsiteman3dir='$installsiteman3dir'
23647 installsitescript='$installsitescript'
23648 installstyle='$installstyle'
23649 installusrbinperl='$installusrbinperl'
23650 installvendorarch='$installvendorarch'
23651 installvendorbin='$installvendorbin'
23652 installvendorhtml1dir='$installvendorhtml1dir'
23653 installvendorhtml3dir='$installvendorhtml3dir'
23654 installvendorlib='$installvendorlib'
23655 installvendorman1dir='$installvendorman1dir'
23656 installvendorman3dir='$installvendorman3dir'
23657 installvendorscript='$installvendorscript'
23659 issymlink='$issymlink'
23660 ivdformat='$ivdformat'
23663 known_extensions='$known_extensions'
23666 ld_can_script='$ld_can_script'
23667 lddlflags='$lddlflags'
23669 ldflags_uselargefiles='$ldflags_uselargefiles'
23670 ldlibpthname='$ldlibpthname'
23677 libsdirs='$libsdirs'
23678 libsfiles='$libsfiles'
23679 libsfound='$libsfound'
23680 libspath='$libspath'
23681 libswanted='$libswanted'
23682 libswanted_uselargefiles='$libswanted_uselargefiles'
23688 localtime_r_proto='$localtime_r_proto'
23689 locincpth='$locincpth'
23690 loclibpth='$loclibpth'
23691 longdblsize='$longdblsize'
23692 longlongsize='$longlongsize'
23693 longsize='$longsize'
23697 lseeksize='$lseeksize'
23698 lseektype='$lseektype'
23701 madlyobj='$madlyobj'
23702 madlysrc='$madlysrc'
23706 make_set_make='$make_set_make'
23707 mallocobj='$mallocobj'
23708 mallocsrc='$mallocsrc'
23709 malloctype='$malloctype'
23711 man1direxp='$man1direxp'
23714 man3direxp='$man3direxp'
23716 mips_type='$mips_type'
23717 mistrustnm='$mistrustnm'
23719 mmaptype='$mmaptype'
23720 modetype='$modetype'
23722 multiarch='$multiarch'
23724 myarchname='$myarchname'
23725 mydomain='$mydomain'
23726 myhostname='$myhostname'
23729 need_va_copy='$need_va_copy'
23730 netdb_hlen_type='$netdb_hlen_type'
23731 netdb_host_type='$netdb_host_type'
23732 netdb_name_type='$netdb_name_type'
23733 netdb_net_type='$netdb_net_type'
23736 nm_so_opt='$nm_so_opt'
23737 nonxs_ext='$nonxs_ext'
23739 nvEUformat='$nvEUformat'
23740 nvFUformat='$nvFUformat'
23741 nvGUformat='$nvGUformat'
23742 nv_overflows_integers_at='$nv_overflows_integers_at'
23743 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23744 nveformat='$nveformat'
23745 nvfformat='$nvfformat'
23746 nvgformat='$nvgformat'
23749 o_nonblock='$o_nonblock'
23751 old_pthread_create_joinable='$old_pthread_create_joinable'
23752 optimize='$optimize'
23753 orderlib='$orderlib'
23756 otherlibdirs='$otherlibdirs'
23760 patchlevel='$patchlevel'
23761 path_sep='$path_sep'
23764 perl_patchlevel='$perl_patchlevel'
23765 perl_static_inline='$perl_static_inline'
23766 perladmin='$perladmin'
23767 perllibs='$perllibs'
23768 perlpath='$perlpath'
23770 phostname='$phostname'
23776 prefixexp='$prefixexp'
23778 privlibexp='$privlibexp'
23779 procselfexe='$procselfexe'
23780 prototype='$prototype'
23782 quadkind='$quadkind'
23783 quadtype='$quadtype'
23784 randbits='$randbits'
23785 randfunc='$randfunc'
23786 random_r_proto='$random_r_proto'
23787 randseedtype='$randseedtype'
23789 rd_nodata='$rd_nodata'
23790 readdir64_r_proto='$readdir64_r_proto'
23791 readdir_r_proto='$readdir_r_proto'
23792 revision='$revision'
23798 sGMTIME_max='$sGMTIME_max'
23799 sGMTIME_min='$sGMTIME_min'
23800 sLOCALTIME_max='$sLOCALTIME_max'
23801 sLOCALTIME_min='$sLOCALTIME_min'
23802 sPRIEUldbl='$sPRIEUldbl'
23803 sPRIFUldbl='$sPRIFUldbl'
23804 sPRIGUldbl='$sPRIGUldbl'
23805 sPRIXU64='$sPRIXU64'
23807 sPRIeldbl='$sPRIeldbl'
23808 sPRIfldbl='$sPRIfldbl'
23809 sPRIgldbl='$sPRIgldbl'
23814 sSCNfldbl='$sSCNfldbl'
23815 sched_yield='$sched_yield'
23816 scriptdir='$scriptdir'
23817 scriptdirexp='$scriptdirexp'
23819 seedfunc='$seedfunc'
23820 selectminbits='$selectminbits'
23821 selecttype='$selecttype'
23822 sendmail='$sendmail'
23823 setgrent_r_proto='$setgrent_r_proto'
23824 sethostent_r_proto='$sethostent_r_proto'
23825 setlocale_r_proto='$setlocale_r_proto'
23826 setnetent_r_proto='$setnetent_r_proto'
23827 setprotoent_r_proto='$setprotoent_r_proto'
23828 setpwent_r_proto='$setpwent_r_proto'
23829 setservent_r_proto='$setservent_r_proto'
23832 sharpbang='$sharpbang'
23833 shmattype='$shmattype'
23834 shortsize='$shortsize'
23837 sig_count='$sig_count'
23838 sig_name='$sig_name'
23839 sig_name_init='$sig_name_init'
23841 sig_num_init='$sig_num_init'
23842 sig_size='$sig_size'
23843 signal_t='$signal_t'
23844 sitearch='$sitearch'
23845 sitearchexp='$sitearchexp'
23847 sitebinexp='$sitebinexp'
23848 sitehtml1dir='$sitehtml1dir'
23849 sitehtml1direxp='$sitehtml1direxp'
23850 sitehtml3dir='$sitehtml3dir'
23851 sitehtml3direxp='$sitehtml3direxp'
23853 sitelib_stem='$sitelib_stem'
23854 sitelibexp='$sitelibexp'
23855 siteman1dir='$siteman1dir'
23856 siteman1direxp='$siteman1direxp'
23857 siteman3dir='$siteman3dir'
23858 siteman3direxp='$siteman3direxp'
23859 siteprefix='$siteprefix'
23860 siteprefixexp='$siteprefixexp'
23861 sitescript='$sitescript'
23862 sitescriptexp='$sitescriptexp'
23863 sizesize='$sizesize'
23864 sizetype='$sizetype'
23868 sockethdr='$sockethdr'
23869 socketlib='$socketlib'
23870 socksizetype='$socksizetype'
23872 spackage='$spackage'
23873 spitshell='$spitshell'
23874 srand48_r_proto='$srand48_r_proto'
23875 srandom_r_proto='$srandom_r_proto'
23877 ssizetype='$ssizetype'
23878 st_ino_sign='$st_ino_sign'
23879 st_ino_size='$st_ino_size'
23880 startperl='$startperl'
23882 static_ext='$static_ext'
23884 stdio_base='$stdio_base'
23885 stdio_bufsiz='$stdio_bufsiz'
23886 stdio_cnt='$stdio_cnt'
23887 stdio_filbuf='$stdio_filbuf'
23888 stdio_ptr='$stdio_ptr'
23889 stdio_stream_array='$stdio_stream_array'
23890 strerror_r_proto='$strerror_r_proto'
23893 subversion='$subversion'
23897 targetarch='$targetarch'
23901 timeincl='$timeincl'
23902 timetype='$timetype'
23903 tmpnam_r_proto='$tmpnam_r_proto'
23909 ttyname_r_proto='$ttyname_r_proto'
23918 uidformat='$uidformat'
23924 uquadtype='$uquadtype'
23925 use5005threads='$use5005threads'
23926 use64bitall='$use64bitall'
23927 use64bitint='$use64bitint'
23928 usecrosscompile='$usecrosscompile'
23929 usedevel='$usedevel'
23931 usedtrace='$usedtrace'
23932 usefaststdio='$usefaststdio'
23933 useithreads='$useithreads'
23934 usekernprocpathname='$usekernprocpathname'
23935 uselargefiles='$uselargefiles'
23936 uselongdouble='$uselongdouble'
23937 usemallocwrap='$usemallocwrap'
23938 usemorebits='$usemorebits'
23939 usemultiplicity='$usemultiplicity'
23940 usemymalloc='$usemymalloc'
23942 usensgetexecutablepath='$usensgetexecutablepath'
23943 useopcode='$useopcode'
23944 useperlio='$useperlio'
23945 useposix='$useposix'
23946 usereentrant='$usereentrant'
23947 userelocatableinc='$userelocatableinc'
23949 useshrplib='$useshrplib'
23950 usesitecustomize='$usesitecustomize'
23951 usesocks='$usesocks'
23952 usethreads='$usethreads'
23953 usevendorprefix='$usevendorprefix'
23954 useversionedarchname='$useversionedarchname'
23955 usevfork='$usevfork'
23958 uvXUformat='$uvXUformat'
23959 uvoformat='$uvoformat'
23962 uvuformat='$uvuformat'
23963 uvxformat='$uvxformat'
23965 vendorarch='$vendorarch'
23966 vendorarchexp='$vendorarchexp'
23967 vendorbin='$vendorbin'
23968 vendorbinexp='$vendorbinexp'
23969 vendorhtml1dir='$vendorhtml1dir'
23970 vendorhtml1direxp='$vendorhtml1direxp'
23971 vendorhtml3dir='$vendorhtml3dir'
23972 vendorhtml3direxp='$vendorhtml3direxp'
23973 vendorlib='$vendorlib'
23974 vendorlib_stem='$vendorlib_stem'
23975 vendorlibexp='$vendorlibexp'
23976 vendorman1dir='$vendorman1dir'
23977 vendorman1direxp='$vendorman1direxp'
23978 vendorman3dir='$vendorman3dir'
23979 vendorman3direxp='$vendorman3direxp'
23980 vendorprefix='$vendorprefix'
23981 vendorprefixexp='$vendorprefixexp'
23982 vendorscript='$vendorscript'
23983 vendorscriptexp='$vendorscriptexp'
23985 version_patchlevel_string='$version_patchlevel_string'
23986 versiononly='$versiononly'
23988 voidflags='$voidflags'
23991 yaccflags='$yaccflags'
23996 : add special variables
23997 $test -f $src/patchlevel.h && \
23998 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23999 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24000 echo "PERL_CONFIG_SH=true" >>config.sh
24002 : propagate old symbols
24003 if $test -f UU/config.sh; then
24004 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24005 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24006 config.sh config.sh UU/oldconfig.sh |\
24007 $sort | $uniq -u >UU/oldsyms
24008 set X `$cat UU/oldsyms`
24014 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24016 echo ": Variables propagated from previous config.sh file." >>config.sh
24017 for sym in `$cat UU/oldsyms`; do
24018 echo " Propagating $hint variable "'$'"$sym..."
24019 eval 'tmp="$'"${sym}"'"'
24021 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24027 : Finish up by extracting the .SH files
24031 echo "Extraction done."
24041 If you'd like to make any changes to the config.sh file before I begin
24042 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24045 rp="Press return or use a shell escape to edit config.sh:"
24050 *) : in case they cannot read
24051 sh 1>&4 -c "$ans";;
24056 : if this fails, just run all the .SH files by hand
24065 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24072 Now you need to generate make dependencies by running "$make depend".
24073 You might prefer to run it in background: "$make depend > makedepend.out &"
24074 It can take a while, so you might not want to run it right now.
24079 rp="Run $make depend now?"
24083 $make depend && echo "Now you must run '$make'."
24086 echo "You must run '$make depend' then '$make'."
24089 elif test -f [Mm]akefile; then
24091 echo "Now you must run a $make."
24093 echo "Configure done."
24096 if $test -f Policy.sh; then
24099 If you compile $package on a different machine or from a different object
24100 directory, copy the Policy.sh file from this object directory to the
24101 new one before you run Configure -- this will help you with most of
24102 the policy defaults.
24106 if $test -f config.msg; then
24107 echo "Hmm. I also noted the following information while running:"
24109 $cat config.msg >&4
24112 $rm -f kit*isdone ark*isdone