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 Wed Apr 9 12:24:24 CEST 2014 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
344 useversionedarchname=''
350 initialinstalllocation=''
379 d_attribute_deprecated=''
380 d_attribute_format=''
381 d_attribute_malloc=''
382 d_attribute_nonnull=''
383 d_attribute_noreturn=''
385 d_attribute_unused=''
386 d_attribute_warn_unused_result=''
387 d_printf_format_null=''
390 d_builtin_choose_expr=''
393 d_c99_variadic_macros=''
440 endhostent_r_proto=''
446 endprotoent_r_proto=''
452 endservent_r_proto=''
505 gethostbyaddr_r_proto=''
507 gethostbyname_r_proto=''
509 gethostent_r_proto=''
522 getnetbyaddr_r_proto=''
524 getnetbyname_r_proto=''
538 d_getprotobyname_r=''
539 getprotobyname_r_proto=''
540 d_getprotobynumber_r=''
541 getprotobynumber_r_proto=''
543 getprotoent_r_proto=''
555 getservbyname_r_proto=''
557 getservbyport_r_proto=''
559 getservent_r_proto=''
586 d_libm_lib_version=''
589 d_localtime_r_needs_tzset=''
600 d_malloc_good_size=''
644 d_old_pthread_create_joinable=''
645 old_pthread_create_joinable=''
647 d_pthread_attr_setscope=''
686 sethostent_r_proto=''
703 setprotoent_r_proto=''
715 setservent_r_proto=''
737 d_ipv6_mreq_source=''
754 d_sprintf_returns_strlen=''
766 perl_static_inline=''
771 d_stdio_ptr_lval_nochange_cnt=''
772 d_stdio_ptr_lval_sets_cnt=''
917 d_gdbm_ndbm_h_uses_prototypes=''
918 d_gdbmndbm_h_uses_prototypes=''
920 d_ndbm_h_uses_prototypes=''
994 d_inc_version_list=''
996 inc_version_list_init=''
1000 installusrbinperl=''
1016 ignore_versioned_solibs=''
1080 d_perl_otherlibdirs=''
1088 api_versionstring=''
1094 version_patchlevel_string=''
1098 d_nv_preserves_uv=''
1099 d_nv_zero_is_allbits_zero=''
1110 nv_overflows_integers_at=''
1111 nv_preserves_uv_bits=''
1184 installsitehtml1dir=''
1187 installsitehtml3dir=''
1194 installsiteman1dir=''
1197 installsiteman3dir=''
1202 installsitescript=''
1220 d_stdio_stream_array=''
1221 stdio_stream_array=''
1238 usekernprocpathname=''
1239 ccflags_uselargefiles=''
1240 ldflags_uselargefiles=''
1241 libswanted_uselargefiles=''
1250 usensgetexecutablepath=''
1263 installvendorarch=''
1270 installvendorhtml1dir=''
1272 vendorhtml1direxp=''
1273 installvendorhtml3dir=''
1275 vendorhtml3direxp=''
1281 installvendorman1dir=''
1284 installvendorman3dir=''
1291 installvendorscript=''
1302 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1305 : We must find out about Eunice early
1307 if test -f /etc/unixtovms; then
1308 eunicefix=/etc/unixtovms
1310 if test -f /etc/unixtovms.exe; then
1311 eunicefix=/etc/unixtovms.exe
1314 : Set executable suffix now -- needed before hints available
1315 if test -f "/libs/version.library"; then
1318 elif test -f "/system/gnu_library/bin/ar.pm"; then
1321 elif test -n "$DJGPP"; then
1324 elif test -f /kern/cookiejar; then
1327 elif test -d c:/. -o -n "$is_os2" ; then
1334 : Trailing extension. Override this in a hint file, if needed.
1335 : Extra object files, if any, needed on this platform.
1338 : Possible local include directories to search.
1339 : Set locincpth to "" in a hint file to defeat local include searches.
1340 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1341 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1343 : no include file wanted by default
1346 : Enable -DEBUGGING and -DDEBUGGING from the command line
1351 : change the next line if compiling for Xenix/286 on Xenix/386
1352 xlibpth='/usr/lib/386 /lib/386'
1353 : Possible local library directories to search.
1354 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1355 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1357 : general looking path for locating libraries
1358 glibpth="/lib /usr/lib $xlibpth"
1359 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1360 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1361 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1362 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1364 : Private path used by Configure to find libraries. Its value
1365 : is prepended to libpth. This variable takes care of special
1366 : machines, like the mips. Usually, it should be empty.
1369 : default library list
1371 : some systems want to use only the non-versioned libso:s
1372 ignore_versioned_solibs=''
1373 : set usethreads on the Configure command line to enable threads.
1374 usereentrant='undef'
1378 : set useposix=false in your hint file to disable the POSIX extension.
1380 : set useopcode=false in your hint file to disable the Opcode extension.
1383 ccflags_uselargefiles=''
1384 ldflags_uselargefiles=''
1385 libswanted_uselargefiles=''
1386 : set usemultiplicity on the Configure command line to enable multiplicity.
1387 : set usesocks on the Configure command line to enable socks.
1388 : List of libraries we want.
1389 : If anyone needs extra -lxxx, put those in a hint file.
1390 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1391 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1392 : We probably want to search /usr/shlib before most other libraries.
1393 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1394 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1395 glibpth="/usr/shlib $glibpth"
1396 : Do not use vfork unless overridden by a hint file.
1399 : Find the basic shell for Bourne shell scripts
1403 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1406 if test -f "$xxx"; then
1409 : Build up a list and do a single loop so we can 'break' out.
1410 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1411 for xxx in sh bash ksh pdksh ash; do
1413 try="$try ${p}/${xxx}"
1417 if test -f "$xxx"; then
1420 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1423 elif test -f "$xxx.exe"; then
1434 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1436 Usually it's in /bin/sh. How did you even get this far?
1437 Please contact me (Perl Maintainers) at perlbug@perl.org and
1438 we'll try to straighten this all out.
1444 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1445 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1448 : see if sh knows # comments
1449 if `$sh -c '#' >/dev/null 2>&1`; then
1453 test -f $xcat$_exe || xcat=/usr/bin/cat
1454 if test ! -f $xcat$_exe; then
1455 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1456 if test -f $p/cat$_exe; then
1461 if test ! -f $xcat$_exe; then
1462 echo "Can't find cat anywhere!"
1466 echo "#!$xcat" >sharp
1469 ./sharp > today 2>/dev/null
1470 if test -s today; then
1473 echo "#! $xcat" > sharp
1476 ./sharp > today 2>/dev/null
1477 if test -s today; then
1485 echo "Your $sh doesn't grok # comments--I will strip them later on."
1488 echo "exec grep -v '^[ ]*#'" >spitshell
1490 $eunicefix spitshell
1491 spitshell=`pwd`/spitshell
1493 echo "I presume that if # doesn't work, #! won't work either!"
1498 : figure out how to guarantee sh startup
1500 '') startsh=${sharpbang}${sh} ;;
1512 : echo "Yup, it does."
1514 echo "Hmm... '$startsh' does not guarantee sh startup..."
1515 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1519 : Save command line options in file UU/cmdline.opt for later use in
1520 : generating config.sh.
1521 cat > cmdline.opt <<EOSH
1522 : Configure command line arguments.
1531 cat >>cmdline.opt <<EOSH
1532 config_arg$argn='$arg'
1534 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1537 arg_exp=`cat cmdl.opt`
1538 args_exp="$args_exp$args_sep'$arg_exp'"
1539 argn=`expr $argn + 1`
1544 : produce awk script to parse command line options
1545 cat >options.awk <<'EOF'
1547 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1549 len = length(optstr);
1550 for (i = 1; i <= len; i++) {
1551 c = substr(optstr, i, 1);
1552 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1563 if (substr(str, 1, 1) != "-") {
1564 printf("'%s'\n", str);
1568 for (i = 2; i <= len; i++) {
1569 c = substr(str, i, 1);
1571 printf("-%s\n", substr(str, i));
1577 printf("'%s'\n", substr(str, i + 1));
1590 : process the command line options
1591 set X `for arg in "$@"; do echo "X$arg"; done |
1592 sed -e s/X// | awk -f options.awk`
1597 : set up default values
1607 rm -f optdef.sh posthint.sh
1608 cat >optdef.sh <<EOS
1614 while test $# -gt 0; do
1616 -d) shift; fastread=yes;;
1617 -e) shift; alldone=cont;;
1621 if test -r "$1"; then
1624 echo "$me: cannot read config file $1." >&2
1630 -h) shift; error=true;;
1631 -r) shift; reuseval=true;;
1632 -s) shift; silent=true; realsilent=true;;
1633 -E) shift; alldone=exit;;
1634 -K) shift; knowitall=true;;
1635 -O) shift; override=true;;
1636 -S) shift; silent=true; extractsh=true;;
1641 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1642 echo "$me: ignoring -D $1" >&2
1645 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1646 *) echo "$1='define'" >> optdef.sh;;
1653 *=) echo "$1" >> optdef.sh;;
1655 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1656 echo "$me: ignoring -U $1" >&2
1658 *) echo "$1='undef'" >> optdef.sh;;
1669 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1673 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1674 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1680 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1681 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1682 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1683 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1684 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1685 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1691 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1693 echo "$yyy=''" >> posthint.sh ;;
1698 echo "$yyy='$zzz'" >> posthint.sh ;;
1700 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1702 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1707 echo "$yyy=$zzz" >> posthint.sh ;;
1708 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1712 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1715 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1723 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1724 [-U symbol] [-U symbol=] [-A command:symbol...]
1725 -d : use defaults for all answers.
1726 -e : go on without questioning past the production of config.sh.
1727 -f : specify an alternate default configuration file.
1728 -h : print this help message and exit (with an error status).
1729 -r : reuse C symbols value if possible (skips costly nm extraction).
1730 -s : silent mode, only echoes questions and essential information.
1731 -D : define symbol to have some value:
1732 -D symbol symbol gets the value 'define'
1733 -D symbol=value symbol gets the value 'value'
1734 common used examples (see INSTALL for more info):
1735 -Duse64bitint use 64bit integers
1736 -Duse64bitall use 64bit integers and pointers
1737 -Dusethreads use thread support
1738 -Dinc_version_list=none do not include older perl trees in @INC
1739 -DEBUGGING=none DEBUGGING options
1740 -Dcc=gcc choose your compiler
1741 -Dprefix=/opt/perl5 choose your destination
1742 -E : stop at the end of questions, after having produced config.sh.
1743 -K : do not use unless you know what you are doing.
1744 -O : let -D and -U override definitions from loaded configuration file.
1745 -S : perform variable substitutions on all .SH files (can mix with -f)
1746 -U : undefine symbol:
1747 -U symbol symbol gets the value 'undef'
1748 -U symbol= symbol gets completely empty
1750 -A : manipulate symbol after the platform specific hints have been applied:
1751 -A append:symbol=value append value to symbol
1752 -A symbol=value like append:, but with a separating space
1753 -A define:symbol=value define symbol to have value
1754 -A clear:symbol define symbol to be ''
1755 -A define:symbol define symbol to be 'define'
1756 -A eval:symbol=value define symbol to be eval of value
1757 -A prepend:symbol=value prepend value to symbol
1758 -A undef:symbol define symbol to be 'undef'
1759 -A undef:symbol= define symbol to be ''
1760 e.g.: -A prepend:libswanted='cl pthread '
1761 -A ccflags=-DSOME_MACRO
1762 -V : print version number and exit (with a zero status).
1769 case "$fastread$alldone" in
1772 case "$extractsh" in
1775 if test ! -t 0; then
1776 echo "Say 'sh Configure', not 'sh <Configure'"
1786 true) exec 1>/dev/null;;
1789 : run the defines and the undefines, if any, but leave the file out there...
1792 : create the posthint manipulation script and leave the file out there...
1797 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1798 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1799 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1800 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1801 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1804 : Some greps do not return status, grrr.
1805 echo "grimblepritz" >grimble
1806 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1808 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1814 : the following should work in any shell
1818 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1819 cat >contains <<'EOSS'
1820 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1825 : Find the path to the source tree
1828 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1832 *) src=`cd ../$src && pwd` ;;
1845 if test -f $rsrc/Configure && \
1846 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1848 : found it, so we are ok.
1851 for src in . .. ../.. ../../.. ../../../..; do
1852 if test -f ../$src/Configure && \
1853 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1864 Sorry, I can't seem to locate the source dir for $package. Please start
1865 Configure with an explicit path -- i.e. /some/path/Configure.
1873 echo "Sources for $package found in \"$src\"." >&4
1877 : script used to extract .SH files with variable substitutions
1878 cat >extract <<'EOS'
1880 echo "Doing variable substitutions on .SH files..."
1881 if test -f MANIFEST; then
1882 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1884 echo "(Looking for .SH files under the source directory.)"
1885 set x `(cd "$src"; find . -name "*.SH" -print)`
1889 0) set x `(cd "$src"; echo *.SH)`; shift;;
1891 if test ! -f "$src/$1"; then
1897 while test $name; do
1898 if test ! -d "$name"; then
1899 create="$name $create";
1900 name=`echo $name | sed -e "s|^[^/]*$||"`;
1901 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1906 for file in $create; do
1915 dir=`expr X$file : 'X\(.*\)/'`
1916 file=`expr X$file : 'X.*/\(.*\)'`
1917 (cd "$dir" && . ./$file)
1927 dir=`expr X$file : 'X\(.*\)/'`
1928 file=`expr X$file : 'X.*/\(.*\)'`
1929 (set x $dir; shift; eval $mkdir_p)
1930 sh <"$src/$dir/$file"
1939 if test -f "$src/config_h.SH"; then
1940 if test ! -f config.h; then
1941 : oops, they left it out of MANIFEST, probably, so do it anyway.
1942 . "$src/config_h.SH"
1947 : extract files and exit if asked to do so
1948 case "$extractsh" in
1950 case "$realsilent" in
1954 case "$config_sh" in
1955 '') config_sh='config.sh';;
1958 echo "Fetching answers from $config_sh..."
1961 test "$override" && . ./optdef.sh
1965 echo "Extraction done."
1970 : Eunice requires " " instead of "", can you believe it
1973 echo "Beginning of configuration questions for $package."
1975 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1977 : first determine how to suppress newline on echo command
1979 echo "Checking echo to see how to suppress newlines..."
1980 (echo "hi there\c" ; echo " ") >.echotmp
1981 if $contains c .echotmp >/dev/null 2>&1 ; then
1992 echo $n "The star should be here-->$c"
1996 : Now test for existence of everything in MANIFEST
1998 if test -f "$rsrc/MANIFEST"; then
1999 echo "First let's make sure your kit is complete. Checking..." >&4
2000 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2001 (split -l 50 2>/dev/null || split -50)
2004 for filelist in x??; do
2005 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2006 >/dev/null 2>>"$tmppwd/missing")
2008 if test -s missing; then
2012 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2014 You have the option of continuing the configuration process, despite the
2015 distinct possibility that your kit is damaged, by typing 'y'es. If you
2016 do, don't blame me if something goes wrong. I advise you to type 'n'o
2017 and contact the author (perlbug@perl.org).
2020 echo $n "Continue? [n] $c" >&4
2024 echo "Continuing..." >&4
2028 echo "ABORTING..." >&4
2033 echo "Looks good..."
2036 echo "There is no MANIFEST file. I hope your kit is complete !"
2040 : Find the appropriate value for a newline for tr
2042 if test -n "$DJGPP"; then
2045 if test X"$trnl" = X; then
2046 case "`echo foo|tr '\n' x 2>/dev/null`" in
2050 if test X"$trnl" = X; then
2051 case "`echo foo|tr '\012' x 2>/dev/null`" in
2052 foox) trnl='\012' ;;
2055 if test X"$trnl" = X; then
2056 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2057 fooxy) trnl='\n\r' ;;
2060 if test X"$trnl" = X; then
2063 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2069 : compute the number of columns on the terminal for proper question formatting
2074 : set up the echo used in my read
2075 myecho="case \"\$xxxm\" in
2076 '') echo $n \"\$rp $c\" >&4;;
2078 '') echo $n \"[\$xxxm] $c\";;
2080 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2082 echo $n \"[\$xxxm] $c\" >&4
2084 echo $n \"\$rp [\$xxxm] $c\" >&4
2090 : now set up to do reads with possible shell escape and default assignment
2096 case "\$fastread" in
2097 yes) case "\$dflt" in
2100 case "\$silent-\$rp" in
2105 *) case "\$silent" in
2106 true) case "\$rp" in
2111 while expr "X\$ans" : "X!" >/dev/null; do
2115 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2123 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2132 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2137 echo "(OK, I'll run with -d after this question.)" >&4
2140 echo "*** Sorry, \$1 not supported yet." >&4
2150 echo "*** Substitution done -- please confirm."
2152 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2157 echo "*** Error -- try again."
2164 case "\$ans\$xxxm\$nostick" in
2176 : create .config dir to save info across Configure sessions
2177 test -d ../.config || mkdir ../.config
2178 cat >../.config/README <<EOF
2179 This directory created by Configure to save information that should
2180 persist across sessions for $package.
2182 You may safely delete it if you wish.
2185 : See if we are using a devel version and want that
2186 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2189 usedevel="$define" ;;
2190 *) case "$xversion" in
2193 *** WHOA THERE!!! ***
2195 This is an UNSTABLE DEVELOPMENT release.
2196 The version of this $package distribution is $xversion, that is, odd,
2197 (as opposed to even) and that signifies a development release.
2198 If you want a maintenance release, you want an even-numbered version.
2200 Do ***NOT*** install this into production use.
2201 Data corruption and crashes are possible.
2203 It is most seriously suggested that you do not continue any further
2204 unless you want to help in developing and debugging Perl.
2206 If you *still* want to build perl, you can answer 'y' now,
2207 or pass -Dusedevel to Configure.
2210 rp='Do you really want to continue?'
2214 [yY]) echo >&4 "Okay, continuing."
2215 usedevel="$define" ;;
2216 *) echo >&4 "Okay, bye."
2227 case "$versiononly" in
2228 '') versiononly="$define" ;;
2230 case "$installusrbinperl" in
2231 '') installusrbinperl="$undef" ;;
2236 : general instructions
2239 user=`(logname) 2>/dev/null`
2241 '') user=`whoami 2>&1`;;
2243 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2246 rp='Would you like to see the instructions?'
2257 This installation shell script will examine your system and ask you questions
2258 to determine how the perl5 package should be installed. If you get
2259 stuck on a question, you may use a ! shell escape to start a subshell or
2260 execute a command. Many of the questions will have default answers in square
2261 brackets; typing carriage return will give you the default.
2263 On some of the questions which ask for file or directory names you are allowed
2264 to use the ~name construct to specify the login directory belonging to "name",
2265 even if you don't have a shell which knows about that. Questions where this is
2266 allowed will be marked "(~name ok)".
2270 dflt='Type carriage return to continue'
2274 The prompter used in this script allows you to use shell variables and
2275 backticks in your answers. You may use $1, $2, etc... to refer to the words
2276 in the default answer, as if the default line was a set of arguments given to a
2277 script shell. This means you may also use $* to repeat the whole default line,
2278 so you do not have to re-type everything to add something to the default.
2280 Every time there is a substitution, you will have to confirm. If there is an
2281 error (e.g. an unmatched backtick), the default answer will remain unchanged
2282 and you will be prompted again.
2284 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2285 the questions and use the computed defaults (or the previous answers if there
2286 was already a config.sh file). Type 'Configure -h' for a list of options.
2287 You may also start interactively and then answer '& -d' at any prompt to turn
2288 on the non-interactive behaviour for the remainder of the execution.
2294 Much effort has been expended to ensure that this shell script will run on any
2295 Unix system. If despite that it blows up on yours, your best bet is to edit
2296 Configure and run it again. If you can't run Configure for some reason,
2297 you'll have to generate a config.sh file by hand. Whatever problems you
2298 have, let me (perlbug@perl.org) know how I blew it.
2300 This installation script affects things in two ways:
2302 1) it may do direct variable substitutions on some of the files included
2304 2) it builds a config.h file for inclusion in C programs. You may edit
2305 any of these files as the need arises after running this script.
2307 If you make a mistake on a question, there is no easy way to back up to it
2308 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2309 files. Configure will offer to let you do this before it runs the SH files.
2312 dflt='Type carriage return to continue'
2314 case "$firsttime" in
2315 true) echo $user >>../.config/instruct;;
2319 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2320 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2321 if test "X$sysroot" = X; then
2326 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2327 # _sysroot is used in places where we need --sysroot=foo
2328 # but using the rest of the flags could cause issues.
2329 _sysroot="--sysroot=$sysroot";
2333 ccflags="$ccflags $_sysroot"
2338 ldflags="$ldflags $_sysroot"
2343 cppflags="$cppflags $_sysroot"
2345 # lddlflags updated below in lddlflags section;
2346 # same with cccdlflags
2350 # Adjust some defaults to also use $sysroot
2351 for var in xlibpth loclibpth locincpth glibpth; do
2354 for path in $xxx; do
2355 eval $var=\"\$$var $sysroot$path\"
2361 : find out where common programs are
2363 echo "Locating common programs..." >&4
2376 if test -d \$dir/\$thing; then
2382 for thisthing in \$dir/\$thing; do
2383 : just loop through to pick last item
2385 if test -f \$thisthing; then
2388 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2391 elif test -f \$dir/\$thing.exe; then
2392 if test -n "$DJGPP"; then
2393 echo \$dir/\$thing.exe
2394 elif test "$eunicefix" != ":"; then
2395 : on Eunice apparently
2448 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2449 pth="$pth $sysroot/lib $sysroot/usr/lib"
2450 for file in $loclist; do
2454 if test -f "$xxx"; then
2457 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2458 xxx=`./loc $file $file $pth`
2461 '') xxx=`./loc $file $file $pth`;;
2462 *) xxx=`./loc $xxx $xxx $pth`;;
2464 eval $file=$xxx$_exe
2468 echo $file is in $xxx.
2471 echo $file is in $xxx.
2474 echo "I don't know where '$file' is, and my life depends on it." >&4
2475 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2481 echo "Don't worry if any of the following aren't found..."
2483 for file in $trylist; do
2487 if test -f "$xxx"; then
2490 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2491 xxx=`./loc $file $file $pth`
2494 '') xxx=`./loc $file $file $pth`;;
2495 *) xxx=`./loc $xxx $xxx $pth`;;
2497 eval $file=$xxx$_exe
2501 echo $file is in $xxx.
2504 echo $file is in $xxx.
2507 echo "I don't see $file out there, $say."
2514 echo "Substituting grep for egrep."
2521 *) if $less -R </dev/null >/dev/null; then
2522 echo "Substituting less -R for less."
2530 echo "Substituting cp for ln."
2539 echo "I can't find make or gmake, and my life depends on it." >&4
2540 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2548 *) # We can't have osname yet.
2549 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2550 # Assume that gmake, if found, is definitely GNU make
2551 # and prefer it over the system make.
2552 echo "Substituting gmake for make."
2560 echo "Hopefully test is built into your sh."
2563 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2564 echo "Using the test built into your sh."
2572 echo "Hopefully echo is built into your sh."
2577 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2578 $echo $n "hi there$c" >foo1
2579 echo $n "hi there$c" >foo2
2580 if cmp foo1 foo2 >/dev/null 2>&1; then
2581 echo "They are compatible. In fact, they may be identical."
2588 They are not compatible! You are probably running ksh on a non-USG system.
2589 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2590 have echo built in and we may have to run some Bourne shell scripts. That
2591 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2594 $echo $n "The star should be here-->$c"
2601 # This question was auctioned at YAPC::Europe-2007 in Vienna
2602 # I never promised you could answer it. I only auctioned the question.
2604 The following message is sponsored by
2606 Dresden.pm<--The stars should be here.
2608 Dear Perl user, system administrator or package
2609 maintainer, the Perl community sends greetings to
2610 you. Do you (emblematical) greet back [Y/n]? n
2614 : Check what type of C compiler we use
2618 cat <<'EOSC' >>trygcc
2623 int main(int argc, char *argv[]) {
2627 if $cc -o try $ccflags $ldflags try.c; then
2630 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2636 # Skip this test because it gives a false match on output like:
2637 # ./trygcc: line 23: cc: command not found
2638 # case "`$cc -v -c try.c 2>&1`" in
2639 # *gcc*) trygcc=no ;;
2641 if $test X"$trygcc" = Xyes; then
2642 if gcc -o try -c try.c; then
2644 echo "You seem to have a working gcc, though." >&4
2645 # Switching compilers may undo the work of hints files.
2646 # The most common problem is -D_REENTRANT for threads.
2647 # This heuristic catches that case, but gets false positives
2648 # if -Dusethreads was not actually specified. Better to
2649 # bail out here with a useful message than fail
2650 # mysteriously later. Should we perhaps just try to
2651 # re-invoke Configure -Dcc=gcc config_args ?
2652 if $test -f usethreads.cbu; then
2655 *** However, any setting of the C compiler flags (e.g. for thread support)
2656 *** will be lost. It may be necessary for you to restart Configure and
2657 *** add -Dcc=gcc to your Configure command line.
2660 rp="Would you like to go ahead and try gcc anyway?"
2663 rp="Would you like to use it?"
2666 if $test -f myread; then
2669 if $test -f UU/myread; then
2672 echo "Cannot find myread, sorry. Aborting." >&2
2677 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2690 cat <<'EOSC' >>checkcc
2695 int main(int argc, char *argv[]) {
2699 if $cc -o try $ccflags $ldflags try.c; then
2702 if $test X"$despair" = Xyes; then
2703 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2706 You need to find a working C compiler.
2707 Either (purchase and) install the C compiler supplied by your OS vendor,
2708 or for a free C compiler try http://gcc.gnu.org/
2709 I cannot continue any further, aborting.
2718 : determine whether symbolic links are supported
2721 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2722 echo "Symbolic links are supported." >&4
2725 echo "Symbolic links are NOT supported." >&4
2730 : determine whether symbolic links are supported
2734 echo "Checking how to test for symbolic links..." >&4
2736 if $test "X$issymlink" = X; then
2738 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2739 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2741 if test $? = 0; then
2744 echo "Your builtin 'test -h' may be broken." >&4
2747 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2750 if test -f "$p/$test"; then
2759 echo "Trying external '$test -h'." >&4
2760 issymlink="$test -h"
2761 if $test ! -h sym >/dev/null 2>&1; then
2762 echo "External '$test -h' is broken, too." >&4
2770 if $test "X$issymlink" = X; then
2771 if $test -L sym 2>/dev/null; then
2772 issymlink="$test -L"
2773 echo "The builtin '$test -L' worked." >&4
2776 if $test "X$issymlink" != X; then
2777 echo "You can test for symbolic links with '$issymlink'." >&4
2779 echo "I do not know how you can test for symbolic links." >&4
2783 *) echo "No symbolic links, so not testing for their testing..." >&4
2788 : Make symlinks util
2789 case "$mksymlinks" in
2792 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2795 *) case "$lns:$issymlink" in
2796 *"ln"*" -s:"*"test -"?)
2797 echo "Creating the symbolic links..." >&4
2798 echo "(First creating the subdirectories...)" >&4
2800 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2802 test -z "$directory" && break
2806 if test ! -d t/base; then
2807 echo "Failed to create the subdirectories. Aborting." >&4
2810 echo "(Then creating the symlinks...)" >&4
2811 awk '{print $1}' $src/MANIFEST | while true; do
2813 test -z "$filename" && break
2814 if test -f $filename; then
2815 if $issymlink $filename; then
2819 if test -f $filename; then
2820 echo "$filename already exists, not symlinking."
2822 ln -s $src/$filename $filename
2826 if test ! -f t/base/lex.t; then
2827 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2832 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2840 : Check for Cross-Compilation
2841 if $test "X$targethost" = "X"; then
2844 if $test "X$targetenv" = "X"; then
2847 case "$usecrosscompile" in
2849 $echo "Cross-compiling..."
2852 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2853 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2854 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2855 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2856 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2857 # leave out ld, choosing it is more complex
2858 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2859 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2860 # We are in a weird spot. Just before us, some values
2861 # were 'saved', to be restored after the hints are
2862 # run. This means that the changes we made to ar,
2863 # nm and ranlib will get reverted.
2864 # To avoid that, we hijack the saving mechanism and
2865 # have it save our new values.
2866 for file in ar nm ranlib; do
2868 eval $file=$xxx$_exe
2873 case "$targetarch" in
2874 '') echo "Targetarch not defined." >&4; croak=y ;;
2875 *) echo "Using targetarch $targetarch." >&4 ;;
2877 case "$targethost" in
2878 '') echo "Targethost not defined." >&4; croak=y ;;
2879 *) echo "Using targethost $targethost." >&4
2884 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2886 : compile a host miniperl and generate_uudmap, unless we got passed them
2887 if $test "X$hostperl" = X; then
2888 echo "Building host miniperl and generate_uudmap binaries" >&4
2896 $src/Configure -des -Dusedevel -Dmksymlinks
2898 case "$hostgenerate" in
2899 '') $make generate_uudmap
2900 hostgenerate=$src/host/generate_uudmap
2902 "$undef") hostgenerate=''
2905 hostperl=$src/host/miniperl
2908 hostosname=`$hostperl -le 'print $^O'`
2911 usecrosscompile="$undef"
2915 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2916 case "$targethost" in
2917 '') echo "Checking for cross-compile" >&4
2918 case "$usecrosscompile$multiarch" in
2919 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2920 if [ -f Makefile ]; then
2922 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2924 echo "Configure done."
2928 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2935 *) echo "Using targethost $targethost." >&4
2937 /*) run=$src/Cross/run
2938 targetmkdir=$src/Cross/mkdir
2940 from=$src/Cross/from
2942 *) pwd=`$test -f ../Configure & cd ..; pwd`
2944 targetmkdir=$pwd/Cross/mkdir
2946 from=$pwd/Cross/from
2949 case "$targetrun" in
2950 '') targetrun=ssh ;;
2955 case "$targetfrom" in
2956 '') targetfrom=scp ;;
2960 from=$from-$targetfrom
2961 case "$targetdir" in
2963 echo "Guessing targetdir $targetdir." >&4
2966 case "$targetuser" in
2968 echo "Guessing targetuser $targetuser." >&4
2971 case "$targetport" in
2973 echo "Guessing targetport $targetport." >&4
2976 case "$targetfrom" in
2980 case "$targetrun" in
3000 '') cwd=$targetdir ;;
3005 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3011 *) echo "Unknown targetrun '$targetrun'" >&4
3015 case "$targetmkdir" in
3017 cat >$targetmkdir <<EOF
3019 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3021 $chmod a+rx $targetmkdir
3023 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3035 $targetmkdir \`dirname \$f\`
3036 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3039 $targetmkdir $targetdir/\`dirname \$f\`
3040 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3053 $mkdir -p $targetdir/\`dirname \$f\`
3054 $cp \$f $targetdir/\$f || exit 1
3057 $targetmkdir $targetdir/\`dirname \$f\`
3058 $cp \$f $targetdir/\$f || exit 1
3065 *) echo "Unknown targetto '$targetto'" >&4
3069 case "$targetfrom" in
3076 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3081 cp) cat >$from <<EOF
3086 cp $targetdir/\$f . || exit 1
3091 *) echo "Unknown targetfrom '$targetfrom'" >&4
3095 if $test ! -f $run; then
3096 echo "Target 'run' script '$run' not found." >&4
3100 if $test ! -f $to; then
3101 echo "Target 'to' script '$to' not found." >&4
3105 if $test ! -f $from; then
3106 echo "Target 'from' script '$from' not found." >&4
3110 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3114 Using '$run' for remote execution,
3115 and '$from' and '$to'
3116 for remote file transfer.
3122 usecrosscompile="$undef"
3127 : see whether [:lower:] and [:upper:] are supported character classes
3129 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3131 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3135 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3136 # (0xd9 and 0xe2), therefore that is a nice testing point.
3137 if test "X$up" = X -o "X$low" = X; then
3138 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3144 if test "X$up" = X -o "X$low" = X; then
3145 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3151 if test "X$up" = X -o "X$low" = X; then
3152 case "`echo RS | od -x 2>/dev/null`" in
3154 echo "Hey, this might be EBCDIC." >&4
3155 if test "X$up" = X -o "X$low" = X; then
3156 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3157 rs) up='[A-IJ-RS-Z]'
3162 if test "X$up" = X -o "X$low" = X; then
3163 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3173 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3175 echo "Using $up and $low to convert case." >&4
3178 echo "I don't know how to translate letters from upper to lower case." >&4
3179 echo "Your tr is not acting any way I know of." >&4
3183 : set up the translation script tr, must be called with ./tr of course
3187 '[A-Z][a-z]') exec $tr '$up' '$low';;
3188 '[a-z][A-Z]') exec $tr '$low' '$up';;
3195 : Try to determine whether config.sh was made on this system
3196 case "$config_sh" in
3198 myuname=`$uname -a 2>/dev/null`
3199 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3200 # Downcase everything to avoid ambiguity.
3201 # Remove slashes and single quotes so we can use parts of this in
3202 # directory and file names.
3203 # Remove newlines so myuname is sane to use elsewhere.
3204 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3205 # because the A-Z/a-z are not consecutive.
3206 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3207 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3208 newmyuname="$myuname"
3210 case "$knowitall" in
3212 if test -f ../config.sh; then
3213 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3214 eval "`grep myuname= ../config.sh`"
3216 if test "X$myuname" = "X$newmyuname"; then
3224 : Get old answers from old config file if Configure was run on the
3225 : same system, otherwise use the hints.
3228 if test -f config.sh; then
3230 rp="I see a config.sh file. Shall I use it to set the defaults?"
3233 n*|N*) echo "OK, I'll ignore it."
3234 mv config.sh config.sh.old
3235 myuname="$newmyuname"
3237 *) echo "Fetching default answers from your old config.sh file..." >&4
3245 : Older versions did not always set $sh. Catch re-use of such
3255 if test ! -f config.sh; then
3258 First time through, eh? I have some defaults handy for some systems
3259 that need some extra help getting the Configure answers right:
3262 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3264 : Half the following guesses are probably wrong... If you have better
3265 : tests or hints, please send them to perlbug@perl.org
3266 : The metaconfig authors would also appreciate a copy...
3267 $test -f /irix && osname=irix
3268 $test -f /xenix && osname=sco_xenix
3269 $test -f /dynix && osname=dynix
3270 $test -f /dnix && osname=dnix
3271 $test -f /lynx.os && osname=lynxos
3272 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3273 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3274 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3275 $test -f /bin/mips && /bin/mips && osname=mips
3276 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3277 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3278 $test -d /usr/apollo/bin && osname=apollo
3279 $test -f /etc/saf/_sactab && osname=svr4
3280 $test -d /usr/include/minix && osname=minix
3281 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3282 if $test -d /MachTen -o -d /MachTen_Folder; then
3284 if $test -x /sbin/version; then
3285 osvers=`/sbin/version | $awk '{print $2}' |
3286 $sed -e 's/[A-Za-z]$//'`
3287 elif $test -x /usr/etc/version; then
3288 osvers=`/usr/etc/version | $awk '{print $2}' |
3289 $sed -e 's/[A-Za-z]$//'`
3295 $test -f /sys/posix.dll &&
3296 $test -f /usr/bin/what &&
3297 set X `/usr/bin/what /sys/posix.dll` &&
3298 $test "$3" = UWIN &&
3302 if $test -f $uname; then
3310 umips) osname=umips ;;
3313 [23]100) osname=mips ;;
3314 next*) osname=next ;;
3316 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3317 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3320 elif $test -f /etc/kconfig; then
3322 if test "$lns" = "$ln -s"; then
3324 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3326 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3333 if test -n "$DJGPP"; then
3342 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3344 # oslevel can fail with:
3345 # oslevel: Unable to acquire lock.
3346 *not\ found) osvers="$4"."$3" ;;
3347 '<3240'|'<>3240') osvers=3.2.0 ;;
3348 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3349 '=3250'|'>3250') osvers=3.2.5 ;;
3353 bitrig) osname=bitrig
3356 bsd386) osname=bsd386
3359 cygwin*) osname=cygwin
3362 *dc.osx) osname=dcosx
3368 domainos) osname=apollo
3374 dragonfly) osname=dragonfly
3377 dynixptx*) osname=dynixptx
3378 osvers=`echo "$4"|sed 's/^v//'`
3380 freebsd) osname=freebsd
3382 genix) osname=genix ;;
3386 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3399 $test -f /system/lib/libandroid.so && osname=linux-android
3403 netbsd*) osname=netbsd
3406 news-os) osvers="$3"
3408 4*) osname=newsos4 ;;
3412 next*) osname=next ;;
3413 nonstop-ux) osname=nonstopux ;;
3414 openbsd) osname=openbsd
3420 POSIX-BC | posix-bc ) osname=posix-bc
3423 powerux | power_ux | powermax_os | powermaxos | \
3424 powerunix | power_unix) osname=powerux
3430 solaris) osname=solaris
3432 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3439 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3443 titanos) osname=titanos
3452 ultrix) osname=ultrix
3455 osf1|mls+) case "$5" in
3458 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3461 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3464 hp*) osname=hp_osf1 ;;
3465 mips) osname=mips_osf1 ;;
3468 # UnixWare 7.1.2 is known as Open UNIX 8
3469 openunix|unixware) osname=svr5
3477 $2) case "$osname" in
3481 : svr4.x or possibly later
3491 if test -f /stand/boot ; then
3492 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3493 if test -n "$INITPROG" -a -f "$INITPROG"; then
3494 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3495 if test -n "$isesix"; then
3503 *) if test -f /etc/systemid; then
3505 set `echo $3 | $sed 's/\./ /g'` $4
3506 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3508 elif $test -f $src/hints/sco_$1_$2.sh; then
3510 elif $test -f $src/hints/sco_$1.sh; then
3515 '') : Still unknown. Probably a generic Sys V.
3524 *) case "$osname" in
3525 '') : Still unknown. Probably a generic BSD.
3533 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3534 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3535 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3538 $rm -f UU/kernel.what
3539 elif test -d c:/. -o -n "$is_os2" ; then
3546 case "$targetarch" in
3549 case "$targetarch" in
3551 # Will load qnx.sh, which should change osname to nto
3556 # Catch arm-linux-androideabi, mipsel-linux-android,
3557 # and i686-linux-android
3558 osname=linux-android
3562 # Something like arm-linux-gnueabihf is really just
3569 # XXX perhaps we should just assume
3570 # osvers to be 2, or maybe take the value
3571 # from targetarch. Using $run before the
3572 # hints are run is somewhat icky.
3573 set X `$run $uname -a 2>/dev/null`
3576 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3581 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3588 : Now look for a hint file osname_osvers, unless one has been
3589 : specified already.
3592 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3593 : Also try without trailing minor version numbers.
3594 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3595 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3596 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3597 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3600 *) case "$osvers" in
3603 *) if $test -f $src/hints/$file.sh ; then
3605 elif $test -f $src/hints/$xfile.sh ; then
3607 elif $test -f $src/hints/$xxfile.sh ; then
3609 elif $test -f $src/hints/$xxxfile.sh ; then
3611 elif $test -f $src/hints/$xxxxfile.sh ; then
3613 elif $test -f "$src/hints/${osname}.sh" ; then
3622 if $test -f Policy.sh ; then
3625 none) dflt="Policy" ;;
3626 *) dflt="Policy $dflt" ;;
3631 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3635 if $test -f Policy.sh ; then
3638 There's also a Policy hint file available, which should make the
3639 site-specific (policy) questions easier to answer.
3646 You may give one or more space-separated answers, or "none" if appropriate.
3647 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3648 previous run of Configure, you may specify it as well as or instead of
3649 OS-specific hints. If hints are provided for your OS, you should use them:
3650 although Perl can probably be built without hints on many platforms, using
3651 hints often improve performance and may enable features that Configure can't
3652 set up on its own. If there are no hints that match your OS, specify "none";
3653 DO NOT give a wrong version or a wrong OS.
3657 rp="Which of these apply, if any?"
3660 for file in $tans; do
3661 if $test X$file = XPolicy -a -f Policy.sh; then
3663 $cat Policy.sh >> UU/config.sh
3664 elif $test -f $src/hints/$file.sh; then
3665 . $src/hints/$file.sh
3666 $cat $src/hints/$file.sh >> UU/config.sh
3667 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3670 : Give one chance to correct a possible typo.
3671 echo "$file.sh does not exist"
3673 rp="hint to use instead?"
3675 for file in $ans; do
3676 if $test -f "$src/hints/$file.sh"; then
3677 . $src/hints/$file.sh
3678 $cat $src/hints/$file.sh >> UU/config.sh
3679 elif $test X$ans = X -o X$ans = Xnone ; then
3682 echo "$file.sh does not exist -- ignored."
3689 : Remember our hint file for later.
3690 if $test -f "$src/hints/$file.sh" ; then
3700 echo "Fetching default answers from $config_sh..." >&4
3704 cp $config_sh config.sh 2>/dev/null
3714 test "$override" && . ./optdef.sh
3716 : Restore computed paths
3717 for file in $loclist $trylist; do
3718 eval $file="\$_$file"
3723 Configure uses the operating system name and version to set some defaults.
3724 The default value is probably right if the name rings a bell. Otherwise,
3725 since spelling matters for me, either accept the default or answer "none"
3732 ''|' '|none) dflt=none ;;
3733 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3736 *) dflt="$osname" ;;
3738 rp="Operating system name?"
3742 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3748 ''|' '|none) dflt=none ;;
3749 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3750 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3752 ''|' ') dflt=none ;;
3757 *) dflt="$osvers" ;;
3759 rp="Operating system version?"
3769 : who configured the system
3770 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3773 cf_by=`(logname) 2>/dev/null`
3776 cf_by=`(whoami) 2>/dev/null`
3778 "") cf_by=unknown ;;
3783 : decide how portable to be. Allow command line overrides.
3784 case "$d_portable" in
3786 *) d_portable="$define" ;;
3789 : set up shell script to do ~ expansion
3795 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3798 if $test -f /bin/csh; then
3799 /bin/csh -f -c "glob \$1"
3804 name=\`$expr x\$1 : '..\([^/]*\)'\`
3805 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3806 if $test ! -d "\$dir"; then
3808 echo "\$me: can't locate home directory for: \$name" >&2
3813 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3829 : now set up to get a file name
3833 cat <<'EOSC' >>getfile
3849 : getfile will accept an answer from the comma-separated list
3850 : enclosed in parentheses even if it does not meet other criteria.
3851 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3852 fn=`echo $fn | sed 's/(.*)//'`
3858 loc_file=`expr $fn : '.*:\(.*\)'`
3859 fn=`expr $fn : '\(.*\):.*'`
3867 */*) fullpath=true;;
3876 *e*) exp_file=true;;
3879 *p*) nopath_ok=true;;
3884 *d*) type='Directory';;
3885 *l*) type='Locate';;
3890 Locate) what='File';;
3895 case "$d_portable" in
3903 while test "$type"; do
3908 true) rp="$rp (~name ok)";;
3911 if test -f UU/getfile.ok && \
3912 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3931 value=`UU/filexp $ans`
3934 if test "$ans" != "$value"; then
3935 echo "(That expands to $value on this system.)"
3949 /*) value="$ansexp" ;;
3950 [a-zA-Z]:/*) value="$ansexp" ;;
3955 echo "I shall only accept a full path name, as in /bin/ls." >&4
3956 echo "Use a ! shell escape if you wish to check pathnames." >&4
3959 echo "Please give a full path name, starting with slash." >&4
3962 echo "Note that using ~name is ok provided it expands well." >&4
3975 for fp in $gfpth; do
3976 if test "X$fp" = X.; then
3981 if test -f "$pf"; then
3983 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3985 echo "($value is not a plain file, but that's ok.)"
3988 if test X"$type" = X; then
3995 for fp in $gfpth; do
3996 if test "X$fp" = X.; then
4001 direxp="$fp/$ansexp"
4003 if test -d "$direxp"; then
4011 if test -d "$ansexp"; then
4012 echo "(Looking for $loc_file in directory $value.)"
4013 value="$value/$loc_file"
4014 ansexp="$ansexp/$loc_file"
4016 if test -f "$ansexp"; then
4019 case "$nopath_ok" in
4020 true) case "$value" in
4022 *) echo "Assuming $value will be in people's path."
4038 if test "$fastread" = yes; then
4043 rp="$what $value doesn't exist. Use that name anyway?"
4062 test "X$gfpthkeep" != Xy && gfpth=""
4065 : determine root of directory hierarchy where package will be installed.
4068 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4071 dflt=`echo "$prefix" | sed 's/.$//'`
4079 By default, $package will be installed in $dflt/bin, manual pages
4080 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4081 installation directories. Typically this is something like /usr/local.
4082 If you wish to have binaries under /usr/bin but other parts of the
4083 installation under /usr/local, that's ok: you will be prompted
4084 separately for each of the installation directories, the prefix being
4085 only used to set the defaults.
4089 rp='Installation prefix to use?'
4097 *) oldprefix="$prefix";;
4104 : allow them to override the AFS root
4107 *) afsroot=$afsroot ;;
4113 $define|true) afs=true ;;
4114 $undef|false) afs=false ;;
4115 *) if $test -d $afsroot; then
4123 echo "AFS may be running... I'll be extra cautious then..." >&4
4125 echo "AFS does not seem to be running..." >&4
4128 : determine installation prefix for where package is to be installed.
4132 Since you are running AFS, I need to distinguish the directory in which
4133 files will reside from the directory in which they are installed (and from
4134 which they are presumably copied to the former directory by occult means).
4137 case "$installprefix" in
4138 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4139 *) dflt="$installprefix";;
4144 In some special cases, particularly when building $package for distribution,
4145 it is convenient to distinguish the directory in which files should be
4146 installed from the directory ($prefix) in which they will
4147 eventually reside. For most users, these two directories are the same.
4150 case "$installprefix" in
4152 *) dflt=$installprefix;;
4156 rp='What installation prefix should I use for installing files?'
4158 installprefix="$ans"
4159 installprefixexp="$ansexp"
4161 : Perform the prefixexp/installprefixexp correction if necessary
4162 cat <<EOS >installprefix
4165 cat <<'EOSC' >>installprefix
4166 : Change installation prefix, if necessary.
4167 if $test X"$prefix" != X"$installprefix"; then
4168 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4170 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4173 chmod +x installprefix
4174 $eunicefix installprefix
4176 : Set variables such as privlib and privlibexp from the output of ./getfile
4177 : performing the prefixexp/installprefixexp correction if necessary.
4178 cat <<EOS >setprefixvar
4181 cat <<'EOSC' >>setprefixvar
4182 eval "${prefixvar}=\"\$ans\""
4183 eval "${prefixvar}exp=\"\$ansexp\""
4186 chmod +x setprefixvar
4187 $eunicefix setprefixvar
4189 : set up the script used to warn in case of inconsistency
4198 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4200 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4201 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4206 echo "*** WHOA THERE!!! ***" >&4
4207 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4210 rp=" Keep the $hint value?"
4213 y) td=$was; tu=$was;;
4217 : function used to set '$1' to '$val'
4218 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4220 $define$undef) . ./whoa; eval "$var=\$td";;
4221 $undef$define) . ./whoa; eval "$var=\$tu";;
4222 *) eval "$var=$val";;
4225 : get the patchlevel
4227 echo "Getting the current patchlevel..." >&4
4228 if $test -r $rsrc/patchlevel.h;then
4229 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4230 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4231 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4232 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4233 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4234 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4235 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4244 $echo "(You do not have patchlevel.h. Eek.)"
4246 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4247 version_patchlevel_string="version $patchlevel subversion $subversion"
4248 case "$perl_patchlevel" in
4250 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4251 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4255 $echo "(You have $package $version_patchlevel_string.)"
4259 : XXX Should be a Configure test for double-dots in filenames.
4260 version=`echo $revision $patchlevel $subversion | \
4261 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4262 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4263 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4266 version=`echo $revision $patchlevel $subversion | \
4267 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4268 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4269 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4272 : Special case the 5.005_xx maintenance series, which used 5.005
4273 : without any subversion label as a subdirectory in $sitelib
4274 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4275 api_versionstring='5.005'
4278 : Do we want threads support and if so, what type
4279 case "$usethreads" in
4280 $define|true|[yY]*) dflt='y';;
4281 *) # Catch case where user specified ithreads or 5005threads but
4282 # forgot -Dusethreads (A.D. 4/2002)
4283 case "$useithreads$use5005threads" in
4284 *$define*) dflt='y';;
4291 Perl can be built to offer a form of threading support on some systems
4292 To do so, Configure can be run with -Dusethreads.
4294 Note that Perl built with threading support runs slightly slower
4295 and uses slightly more memory than plain Perl.
4297 If this doesn't make any sense to you, just accept the default '$dflt'.
4299 rp='Build a threading Perl?'
4302 y|Y) val="$define" ;;
4308 if $test $patchlevel -lt 9; then
4309 case "$usethreads" in
4311 : Default to ithreads unless overridden on command line or with
4314 case "$use5005threads" in
4316 echo "5.005 threads are no longer supported"
4320 case "$useithreads" in
4321 $undef|false|[nN]*) dflt='n';;
4323 rp='Use the newer interpreter-based ithreads?'
4326 y|Y) val="$define" ;;
4331 : Now set use5005threads to the opposite value.
4332 case "$useithreads" in
4333 $define) val="$undef" ;;
4340 useithreads="$undef"
4341 use5005threads="$undef"
4345 case "$useithreads$use5005threads" in
4349 You cannot have both the ithreads and the 5.005 threads enabled
4350 at the same time. Disabling the 5.005 threads since they are
4351 much less stable than the ithreads.
4354 use5005threads="$undef"
4359 : perl-5.9.x and later
4361 if test X"$usethreads" = "X$define"; then
4362 case "$use5005threads" in
4366 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4373 use5005threads="$undef"
4374 useithreads="$usethreads"
4377 case "$d_oldpthreads" in
4378 '') : Configure tests would be welcome here. For now, assume undef.
4380 *) val="$d_oldpthreads" ;;
4386 : Look for a hint-file generated 'call-back-unit'. If the
4387 : user has specified that a threading perl is to be built,
4388 : we may need to set or change some other defaults.
4389 if $test -f usethreads.cbu; then
4390 echo "Your platform has some specific hints regarding threaded builds, using them..."
4393 case "$usethreads" in
4394 "$define"|true|[yY]*)
4396 (Your platform does not have any specific hints for threaded builds.
4397 Assuming POSIX threads, then.)
4403 : Check if multiplicity is required
4406 Perl can be built so that multiple Perl interpreters can coexist
4407 within the same Perl executable.
4410 case "$useithreads" in
4413 This multiple interpreter support is required for interpreter-based threads.
4417 *) case "$usemultiplicity" in
4418 $define|true|[yY]*) dflt='y';;
4422 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4423 rp='Build Perl for multiplicity?'
4426 y|Y) val="$define" ;;
4434 : Check if morebits is requested
4435 case "$usemorebits" in
4436 "$define"|true|[yY]*)
4437 use64bitint="$define"
4438 uselongdouble="$define"
4439 usemorebits="$define"
4441 *) usemorebits="$undef"
4445 : Determine the C compiler to be used
4451 rp="Use which C compiler?"
4455 : See whether they have no cc but they do have gcc
4457 if $test -f cc.cbu; then
4462 : make some quick guesses about what we are up against
4464 $echo $n "Hmm... $c"
4474 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4475 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4477 echo "Looks kind of like an OSF/1 system, but we'll see..."
4479 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4480 xxx=`./loc addbib blurfl $pth`
4481 if $test -f $xxx; then
4482 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4486 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4487 echo "Looks kind of like an extended USG system, but we'll see..."
4489 echo "Looks kind of like a USG system, but we'll see..."
4493 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4494 echo "Looks kind of like a BSD system, but we'll see..."
4498 echo "Looks kind of like a Version 7 system, but we'll see..."
4501 case "$eunicefix" in
4504 There is, however, a strange, musty smell in the air that reminds me of
4505 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4509 : it so happens the Eunice I know will not run shell scripts in Unix format
4513 echo "Congratulations. You aren't running Eunice."
4517 : Detect OS2. The p_ variable is set above in the Head.U unit.
4518 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4519 : semicolon as a patch separator
4524 I have the feeling something is not exactly right, however...don't tell me...
4525 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4526 (Or you may be running DOS with DJGPP.)
4531 if test -f /xenix; then
4532 echo "Actually, this looks more like a XENIX system..."
4537 echo "It's not Xenix..."
4542 if test -f /venix; then
4543 echo "Actually, this looks more like a VENIX system..."
4550 echo "Nor is it Venix..."
4553 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4554 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4557 : Check if we are using GNU gcc and what its version is
4559 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4563 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4565 printf("%s\n", __VERSION__);
4567 printf("%s\n", "1");
4573 if $cc -o try $ccflags $ldflags try.c; then
4574 gccversion=`$run ./try`
4575 case "$gccversion" in
4576 '') echo "You are not using GNU cc." ;;
4577 *) echo "You are using GNU cc $gccversion."
4583 echo "*** WHOA THERE!!! ***" >&4
4584 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4585 case "$knowitall" in
4587 echo " You'd better start hunting for one and let me know about it." >&4
4593 case "$gccversion" in
4594 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4596 case "$gccversion" in
4597 '') gccosandvers='' ;;
4598 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4599 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4601 case "$gccosandvers" in
4602 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4603 $osname$osvers) ;; # looking good
4604 $osname*) cat <<EOM >&4
4606 *** WHOA THERE!!! ***
4608 Your gcc has not been compiled for the exact release of
4609 your operating system ($gccosandvers versus $osname$osvers).
4611 In general it is a good idea to keep gcc synchronized with
4612 the operating system because otherwise serious problems
4613 may ensue when trying to compile software, like Perl.
4615 I'm trying to be optimistic here, though, and will continue.
4616 If later during the configuration and build icky compilation
4617 problems appear (headerfile conflicts being the most common
4618 manifestation), I suggest reinstalling the gcc to match
4619 your operating system release.
4623 *) gccosandvers='' ;; # failed to parse, better be silent
4631 # gcc 3.* complain about adding -Idirectories that they already know about,
4632 # so we will take those off from locincpth.
4633 case "$gccversion" in
4635 echo "main(){}">try.c
4636 for incdir in $locincpth; do
4637 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4638 grep '^c[cp]p*[01]: warning: changing search order '`
4639 if test "X$warn" != X; then
4640 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4646 # gcc 4.9 by default does some optimizations that break perl.
4647 # see ticket 121505.
4649 # The -fwrapv disables those optimizations (and probably others,) so
4650 # for gcc 4.9 (and later, since the optimizations probably won't go
4651 # away), add -fwrapv unless the user requests -fno-wrapv, which
4652 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4653 # which turns the overflows -fwrapv ignores into runtime errors.
4654 case "$gccversion" in
4655 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4657 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4658 *) ccflags="$ccflags -fwrapv" ;;
4662 : What should the include directory be ?
4663 : Use sysroot if set, so findhdr looks in the right place.
4665 $echo $n "Hmm... $c"
4666 dflt="$sysroot/usr/include"
4669 if $test -f /bin/mips && /bin/mips; then
4670 echo "Looks like a MIPS system..."
4671 $cat >usr.c <<'EOCP'
4672 #ifdef SYSTYPE_BSD43
4676 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4677 dflt='/bsd43/usr/include'
4681 mips_type='System V'
4683 $rm -f usr.c usr.out
4684 echo "and you're compiling with the $mips_type compiler and libraries."
4688 echo "Doesn't look like a MIPS system."
4698 case "$xxx_prompt" in
4701 rp='Where are the include files you want to use?'
4709 : see how we invoke the C preprocessor
4711 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4712 cat <<'EOT' >testcpp.c
4718 if test ! -f cppstdin; then
4719 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4720 # AIX cc -E doesn't show the absolute headerfile
4721 # locations but we'll cheat by using the -M flag.
4722 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
4724 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4727 echo "Keeping your $hint cppstdin wrapper."
4730 wrapper=`pwd`/cppstdin
4734 if $test "X$cppstdin" != "X" && \
4735 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4736 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4738 echo "You used to use $cppstdin $cppminus so we'll use that again."
4740 '') echo "But let's see if we can live without a wrapper..." ;;
4742 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4743 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4745 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4748 echo "(However, $cpprun $cpplast does not work, let's see...)"
4756 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4763 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4764 $cc -E <testcpp.c >testcpp.out 2>&1; \
4765 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4766 echo "Yup, it does."
4767 x_cpp="$cc $cppflags -E"
4769 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4770 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4771 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4772 echo "Yup, it does."
4773 x_cpp="$cc $cppflags -E"
4775 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4776 $cc -P <testcpp.c >testcpp.out 2>&1; \
4777 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4778 echo "Yipee, that works!"
4779 x_cpp="$cc $cppflags -P"
4781 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4782 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4783 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4784 echo "At long last!"
4785 x_cpp="$cc $cppflags -P"
4787 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4788 $cpp <testcpp.c >testcpp.out 2>&1; \
4789 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4791 x_cpp="$cpp $cppflags"
4793 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4794 $cpp - <testcpp.c >testcpp.out 2>&1; \
4795 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4796 echo "Hooray, it works! I was beginning to wonder."
4797 x_cpp="$cpp $cppflags"
4799 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4800 $wrapper <testcpp.c >testcpp.out 2>&1; \
4801 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4807 rp="No dice. I can't find a C preprocessor. Name one:"
4811 $x_cpp <testcpp.c >testcpp.out 2>&1
4812 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4813 echo "OK, that will do." >&4
4815 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4830 echo "Perhaps can we force $cc -E using a wrapper..."
4831 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4832 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4838 echo "Nope, we'll have to live without it..."
4852 "$wrapper"|'cppstdin') ;;
4853 *) $rm -f $wrapper;;
4855 $rm -f testcpp.c testcpp.out
4857 : Adjust cppfilter for path component separator
4859 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4860 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4864 : Use gcc to determine libpth and incpth
4865 # If using gcc or clang, we can get better values for libpth, incpth
4866 # and usrinc directly from the compiler.
4867 # Note that ccname for clang is also gcc.
4870 $echo 'extern int foo;' > try.c
4871 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4873 if $test $# -gt 0; then
4875 incpth="`$echo $incpth|$sed 's/^ //'`"
4877 j="`$echo $i|$sed 's,/include$,/lib,'`"
4878 if $test -d $j; then
4882 libpth="`$echo $libpth|$sed 's/^ //'`"
4883 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4884 if $test -d $xxx; then
4887 *) libpth="$libpth $xxx";;
4894 '') for i in $incpth; do
4895 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4903 case "$usecrosscompile" in
4906 '') echo "Incpth not defined." >&4; croak=y ;;
4907 *) echo "Using incpth '$incpth'." >&4 ;;
4910 '') echo "Libpth not defined." >&4; croak=y ;;
4911 *) echo "Using libpth '$libpth'." >&4 ;;
4914 '') echo "Usrinc not defined." >&4; croak=y ;;
4915 *) echo "Using usrinc $usrinc." >&4 ;;
4919 if test "X$sysroot" = X; then
4920 echo "Cannot continue, aborting." >&4; exit 1
4922 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4931 : Default value for incpth is just usrinc
4933 '') incpth="$usrinc";;
4936 : Set private lib path
4939 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4944 '') dlist="$loclibpth $plibpth $glibpth";;
4945 *) dlist="$libpth";;
4948 : Now check and see which directories actually exist, avoiding duplicates
4951 if $test -d $xxx; then
4954 *) libpth="$libpth $xxx";;
4960 Some systems have incompatible or broken versions of libraries. Among
4961 the directories listed in the question below, please remove any you
4962 know not to be holding relevant libraries, and add any that are needed.
4963 Say "none" for none.
4967 if test "X$sysroot" != X; then
4969 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4982 rp="Directories to use for library searches?"
4989 : compute shared library extension
4992 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5002 On some systems, shared libraries may be available. Answer 'none' if
5003 you want to suppress searching of shared libraries for the remainder
5004 of this configuration.
5007 rp='What is the file extension used for shared libraries?'
5011 : Does target system insist that shared library basenames are unique
5014 Some dynamic loaders assume that the *basename* of shared library filenames
5015 are globally unique. We'll default this to undef as we assume your system
5016 is not this weird. Set to defined if you're on one of them.
5021 rp='Make shared library basenames unique?'
5024 y|Y) val="$define" ;;
5027 set d_libname_unique
5030 : Define several unixisms.
5031 : Hints files or command line option can be used to override them.
5032 : The convoluted testing is in case hints files set either the old
5035 '') case "$exe_ext" in
5037 *) _exe="$exe_ext" ;;
5042 '') case "$lib_ext" in
5049 '') case "$obj_ext" in
5056 '') case "$path_sep" in
5067 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5069 : Which makefile gets called first. This is used by make depend.
5070 case "$firstmakefile" in
5071 '') firstmakefile='makefile';;
5074 : Check is we will use socks
5076 $define|true|[yY]*) dflt='y';;
5081 Perl can be built to use the SOCKS proxy protocol library. To do so,
5082 Configure must be run with -Dusesocks. If you use SOCKS you also need
5083 to use the PerlIO abstraction layer, this will be implicitly selected.
5085 If this doesn't make any sense to you, just accept the default '$dflt'.
5087 rp='Build Perl for SOCKS?'
5090 y|Y) val="$define" ;;
5096 : Check for uselongdouble support
5098 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5101 case "$uselongdouble" in
5102 $define|true|[yY]*) dflt='y';;
5107 Perl can be built to take advantage of long doubles which
5108 (if available) may give more accuracy and range for floating point numbers.
5110 If this doesn't make any sense to you, just accept the default '$dflt'.
5112 rp='Try to use long doubles if available?'
5115 y|Y) val="$define" ;;
5121 case "$uselongdouble" in
5122 true|[yY]*) uselongdouble="$define" ;;
5125 : Look for a hint-file generated 'call-back-unit'. If the
5126 : user has specified that long doubles should be used,
5127 : we may need to set or change some other defaults.
5128 if $test -f uselongdouble.cbu; then
5129 echo "Your platform has some specific hints regarding long doubles, using them..."
5130 . ./uselongdouble.cbu
5132 case "$uselongdouble" in
5135 (Your platform does not have any specific hints for long doubles.)
5141 : Looking for optional libraries
5143 echo "Checking for optional libraries..." >&4
5148 case "$libswanted" in
5149 '') libswanted='c_s';;
5152 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5158 for thisdir in $libpth $xlibpth; do
5159 test -d $thisdir && libspath="$libspath $thisdir"
5161 for thislib in $libswanted; do
5162 for thisdir in $libspath; do
5164 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5165 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5166 $test -f "$xxx" && eval $libscheck
5167 $test -f "$xxx" && libstyle=shared
5169 if test ! -f "$xxx"; then
5170 xxx=$thisdir/lib$thislib.$so
5171 $test -f "$xxx" && eval $libscheck
5172 $test -f "$xxx" && libstyle=shared
5174 if test ! -f "$xxx"; then
5175 xxx=$thisdir/lib$thislib$_a
5176 $test -f "$xxx" && eval $libscheck
5177 $test -f "$xxx" && libstyle=static
5179 if test ! -f "$xxx"; then
5180 xxx=$thisdir/$thislib$_a
5181 $test -f "$xxx" && eval $libscheck
5182 $test -f "$xxx" && libstyle=static
5184 if test ! -f "$xxx"; then
5185 xxx=$thisdir/lib${thislib}_s$_a
5186 $test -f "$xxx" && eval $libscheck
5187 $test -f "$xxx" && libstyle=static
5188 $test -f "$xxx" && thislib=${thislib}_s
5190 if test ! -f "$xxx"; then
5191 xxx=$thisdir/Slib$thislib$_a
5192 $test -f "$xxx" && eval $libscheck
5193 $test -f "$xxx" && libstyle=static
5195 if $test -f "$xxx"; then
5197 shared) echo "Found -l$thislib (shared)." ;;
5198 static) echo "Found -l$thislib." ;;
5199 *) echo "Found -l$thislib ($libstyle)." ;;
5203 *) dflt="$dflt -l$thislib"
5204 libsfound="$libsfound $xxx"
5206 libsfiles="$libsfiles $yyy"
5207 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5208 case " $libsdirs " in
5210 *) libsdirs="$libsdirs $yyy" ;;
5217 if $test ! -f "$xxx"; then
5218 echo "No -l$thislib."
5229 ' '|'') dflt='none';;
5234 In order to compile $package on your machine, a number of libraries
5235 are usually needed. Include any other special libraries here as well.
5236 Say "none" for none. The default list is almost always right.
5240 rp="What libraries to use?"
5247 : determine optimization, if desired, or use for debug flag also
5249 ' '|$undef) dflt='none';;
5251 *) dflt="$optimize";;
5255 By default, $package compiles with the -O flag to use the optimizer.
5256 Alternately, you might want to use the symbolic debugger, which uses
5257 the -g flag (on traditional Unix systems). Either flag can be
5258 specified here. To use neither flag, specify the word "none".
5261 rp="What optimizer/debugger flag should be used?"
5265 'none') optimize=" ";;
5268 : Check what DEBUGGING is required from the command line
5269 : -DEBUGGING or -DDEBUGGING or
5270 : -DEBUGGING=both = -g + -DDEBUGGING
5271 : -DEBUGGING=-g or -Doptimize=-g = -g
5272 : -DEBUGGING=none or -UDEBUGGING =
5273 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5276 *) DEBUGGING=$EBUGGING ;;
5279 case "$DEBUGGING" in
5283 *) optimize="$optimize -g" ;;
5287 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5295 case "$DEBUGGING" in
5296 both|$define) dflt='-DDEBUGGING'
5299 : argument order is deliberate, as the flag will start with - which set could
5300 : think is an option
5301 checkccflag='check=$1; flag=$2; callback=$3;
5303 echo "Checking if your compiler accepts $flag" 2>&1;
5304 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5305 echo "int main(void) { return 0; }" > gcctest.c;
5306 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5307 echo "Yes, it does." 2>&1;
5308 if $test -s gcctest.out ; then
5309 echo "But your platform does not like it:";
5314 echo "Leaving current flags $ccflags alone." 2>&1
5316 *) dflt="$dflt $flag";
5322 echo "Nope, it does not, but that is ok." 2>&1;
5326 : We will not override a previous value, but we might want to
5327 : augment a hint file
5329 default|recommended)
5330 case "$gccversion" in
5331 1*) dflt="$dflt -fpcc-struct-return" ;;
5333 case "$optimize:$DEBUGGING" in
5334 *-g*:old) dflt="$dflt -DDEBUGGING";;
5336 case "$gccversion" in
5337 2*) if $test -d /etc/conf/kconfig.d &&
5338 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5340 # Interactive Systems (ISC) POSIX mode.
5345 case "$gccversion" in
5348 ?*) set strict-aliasing -fno-strict-aliasing
5352 # For gcc, adding -pipe speeds up compilations for some, but apparently
5353 # some assemblers can't read from stdin. (It also slows down compilations
5354 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5355 case "$gccversion" in
5361 # on x86_64 (at least) we require an extra library (libssp) in the
5362 # link command line. This library is not named, so I infer that it is
5363 # an implementation detail that may change. Hence the safest approach
5364 # is to add the flag to the flags passed to the compiler at link time,
5365 # as that way the compiler can do the right implementation dependant
5367 case "$gccversion" in
5368 ?*) set stack-protector -fstack-protector
5375 case "$mips_type" in
5376 *BSD*|'') inclwanted="$locincpth $usrinc";;
5377 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5379 for thisincl in $inclwanted; do
5380 if $test -d $thisincl; then
5381 if $test x$thisincl != x$usrinc; then
5383 *" -I$thisincl "*);;
5384 *) dflt="$dflt -I$thisincl ";;
5390 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5392 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5400 *) dflt="$dflt -D$2";;
5404 set signal.h LANGUAGE_C; eval $inctest
5408 ccflags="$ccflags -DSOCKS"
5413 default|recommended) dflt="$ccflags $dflt" ;;
5414 *) dflt="$ccflags";;
5423 Your C compiler may want other flags. For this question you should include
5424 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5425 but you should NOT include libraries or ld flags like -lwhatever. If you
5426 want $package to honor its debug switch, you should include -DDEBUGGING here.
5427 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5429 To use no flags, specify the word "none".
5435 rp="Any additional cc flags?"
5442 : the following weeds options from ccflags that are of no interest to cpp
5444 '') cppflags="$ccflags" ;;
5445 *) cppflags="$cppflags $ccflags" ;;
5447 case "$gccversion" in
5448 1*) cppflags="$cppflags -D__GNUC__"
5450 case "$mips_type" in
5452 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5458 echo "Let me guess what the preprocessor flags are..." >&4
5472 *) ftry="$previous $flag";;
5474 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5475 >cpp1.out 2>/dev/null && \
5476 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5477 >cpp2.out 2>/dev/null && \
5478 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5479 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5481 cppflags="$cppflags $ftry"
5491 *-*) echo "They appear to be: $cppflags";;
5493 $rm -f cpp.c cpp?.out
5497 : flags used in final linking phase
5499 '') if ./venix; then
5505 *-posix*) dflt="$dflt -posix" ;;
5508 *) dflt="$ldflags";;
5510 # See note above about -fstack-protector
5512 *-fstack-protector*)
5514 *-fstack-protector*) ;; # Don't add it again
5515 *) dflt="$dflt -fstack-protector" ;;
5520 : Try to guess additional flags to pick up local libraries.
5521 for thislibdir in $libpth; do
5522 case " $loclibpth " in
5525 *"-L$thislibdir "*) ;;
5526 *) dflt="$dflt -L$thislibdir" ;;
5538 Your C linker may need flags. For this question you should
5539 include -L/whatever and any other flags used by the C linker, but you
5540 should NOT include libraries like -lwhatever.
5542 Make sure you include the appropriate -L/path flags if your C linker
5543 does not normally search all of the directories you specified above,
5546 To use no flags, specify the word "none".
5550 rp="Any additional ld flags (NOT including libraries)?"
5556 rmlist="$rmlist pdp11"
5560 echo "Checking your choice of C compiler and flags for coherency..." >&4
5561 $cat > try.c <<'EOF'
5563 int main() { printf("Ok\n"); return(0); }
5565 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5567 $cat >try.msg <<'EOM'
5568 I've tried to compile and run the following simple program:
5571 $cat try.c >> try.msg
5573 $cat >> try.msg <<EOM
5580 and I got the following output:
5584 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5585 if $sh -c "$run ./try " >>try.msg 2>&1; then
5589 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5592 echo "The program compiled OK, but exited with status $?." >>try.msg
5593 rp="You have a problem. Shall I abort Configure"
5597 echo "I can't compile the test program." >>try.msg
5598 rp="You have a BIG problem. Shall I abort Configure"
5604 case "$knowitall" in
5606 echo "(The supplied flags or libraries might be incorrect.)"
5614 *) echo "Ok. Stopping Configure." >&4
5619 n) echo "OK, that should do.";;
5621 $rm_try gcctest gcctest.out
5623 : define a shorthand compile call
5627 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5628 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5632 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5633 : define a shorthand compile call for compilations that should be ok.
5637 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5639 : determine filename position in cpp output
5641 echo "Computing filename position in cpp output for #include directives..." >&4
5643 vos) testaccess=-e ;;
5646 echo '#include <stdio.h>' > foo.c
5649 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5650 $grep '^[ ]*#.*stdio\.h' | \
5651 while read cline; do
5654 while $test \$# -gt 0; do
5655 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5660 pos=\`expr \$pos + 1\`
5672 *) pos="${fieldn}th";;
5674 echo "Your cpp writes the filename in the $pos field of the line."
5676 : locate header file
5681 for usrincdir in $incpth
5683 if test -f \$usrincdir/\$wanted; then
5684 echo "\$usrincdir/\$wanted"
5688 awkprg='{ print \$$fieldn }'
5689 echo "#include <\$wanted>" > foo\$\$.c
5690 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5691 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5692 while read cline; do
5693 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5695 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5696 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5701 # status = 0: grep returned 0 lines, case statement not executed
5702 # status = 1: headerfile found
5703 # status = 2: while loop executed, no headerfile found
5707 if test \$status -eq 1; then
5714 : define an alternate in-header-list? function
5715 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5716 cont=true; xxf="echo \"<\$1> found.\" >&4";
5717 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5718 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5720 case $# in 4) instead=instead;; *) instead="at last";; esac;
5721 while $test "$cont"; do
5723 var=$2; eval "was=\$$2";
5724 if $test "$xxx" && $test -r "$xxx";
5726 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5729 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5730 set $yyy; shift; shift; yyy=$@;
5731 case $# in 0) cont="";;
5732 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5733 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5734 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5735 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5739 do set $yyy; var=$2; eval "was=\$$2";
5740 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5741 set $yyy; shift; shift; yyy=$@;
5744 : see if stdlib is available
5745 set stdlib.h i_stdlib
5748 : check for lengths of integral types
5752 echo "Checking to see how big your integers are..." >&4
5761 printf("intsize=%d;\n", (int)sizeof(int));
5762 printf("longsize=%d;\n", (int)sizeof(long));
5763 printf("shortsize=%d;\n", (int)sizeof(short));
5768 if eval $compile_ok && $run ./try > /dev/null; then
5770 echo "Your integers are $intsize bytes long."
5771 echo "Your long integers are $longsize bytes long."
5772 echo "Your short integers are $shortsize bytes long."
5776 Help! I can't compile and run the intsize test program: please enlighten me!
5777 (This is probably a misconfiguration in your system or libraries, and
5778 you really ought to fix it. Still, I'll try anyway.)
5782 rp="What is the size of an integer (in bytes)?"
5786 rp="What is the size of a long integer (in bytes)?"
5790 rp="What is the size of a short integer (in bytes)?"
5798 : check for long long
5800 echo "Checking to see if you have long long..." >&4
5801 echo 'int main() { long long x = 7; return 0; }' > try.c
5803 if eval $compile; then
5805 echo "You have long long."
5808 echo "You do not have long long."
5814 : check for length of long long
5815 case "${d_longlong}${longlongsize}" in
5818 echo "Checking to see how big your long longs are..." >&4
5819 $cat >try.c <<'EOCP'
5823 printf("%d\n", (int)sizeof(long long));
5828 if eval $compile_ok; then
5829 longlongsize=`$run ./try`
5830 echo "Your long longs are $longlongsize bytes long."
5834 echo "(I can't seem to compile the test program. Guessing...)"
5835 rp="What is the size of a long long (in bytes)?"
5839 if $test "X$longsize" = "X$longlongsize"; then
5840 echo "(That isn't any different from an ordinary long.)"
5846 : see if inttypes.h is available
5847 : we want a real compile instead of Inhdr because some systems
5848 : have an inttypes.h which includes non-existent headers
5851 #include <inttypes.h>
5853 static int32_t foo32 = 0x12345678;
5857 if eval $compile; then
5858 echo "<inttypes.h> found." >&4
5861 echo "<inttypes.h> NOT found." >&4
5870 echo "Checking to see if you have int64_t..." >&4
5872 #include <sys/types.h>
5873 #$i_inttypes I_INTTYPES
5875 #include <inttypes.h>
5877 int main() { int64_t x = 7; }
5880 if eval $compile; then
5882 echo "You have int64_t."
5885 echo "You do not have int64_t."
5891 : Check if 64bit ints have a quad type
5893 echo "Checking which 64-bit integer type we could use..." >&4
5899 val='"unsigned int"'
5904 *) case "$longsize" in
5908 val='"unsigned long"'
5913 *) case "$d_longlong:$longlongsize" in
5918 val='"unsigned long long"'
5923 *) case "$d_int64_t" in
5942 '') echo "Alas, no 64-bit integer types in sight." >&4
5945 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5950 : Do we want 64bit support
5951 case "$uselonglong" in
5952 "$define"|true|[yY]*)
5955 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5957 use64bitint="$define"
5960 case "$use64bits" in
5961 "$define"|true|[yY]*)
5964 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5966 use64bitint="$define"
5969 case "$use64bitints" in
5970 "$define"|true|[yY]*)
5973 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5975 use64bitint="$define"
5978 case "$use64bitsint" in
5979 "$define"|true|[yY]*)
5982 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5984 use64bitint="$define"
5987 case "$uselonglongs" in
5988 "$define"|true|[yY]*)
5991 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5993 use64bitint="$define"
5996 case "$use64bitsall" in
5997 "$define"|true|[yY]*)
6000 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6002 use64bitall="$define"
6007 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6009 case "$use64bitall" in
6010 "$define"|true|[yY]*) use64bitint="$define" ;;
6016 You have natively 64-bit long integers.
6020 *) case "$use64bitint" in
6021 "$define"|true|[yY]*) dflt='y';;
6030 Perl can be built to take advantage of 64-bit integer types
6031 on some systems. To do so, Configure can be run with -Duse64bitint.
6032 Choosing this option will most probably introduce binary incompatibilities.
6034 If this doesn't make any sense to you, just accept the default '$dflt'.
6035 (The default has been chosen based on your configuration.)
6037 rp='Try to use 64-bit integers, if available?'
6040 [yY]*) val="$define" ;;
6048 case "$use64bitall" in
6049 "$define"|true|[yY]*) dflt='y' ;;
6050 *) case "$longsize" in
6058 You may also choose to try maximal 64-bitness. It means using as much
6059 64-bitness as possible on the platform. This in turn means even more
6060 binary incompatibilities. On the other hand, your platform may not
6061 have any more 64-bitness available than what you already have chosen.
6063 If this doesn't make any sense to you, just accept the default '$dflt'.
6064 (The default has been chosen based on your configuration.)
6066 rp='Try to use maximal 64-bit support, if available?'
6069 [yY]*) val="$define" ;;
6074 case "$use64bitall" in
6076 case "$use64bitint" in
6080 Since you have chosen a maximally 64-bit build, I'm also turning on
6081 the use of 64-bit integers.
6083 use64bitint="$define" ;;
6088 : Look for a hint-file generated 'call-back-unit'. If the
6089 : user has specified that a 64-bit perl is to be built,
6090 : we may need to set or change some other defaults.
6091 if $test -f use64bitint.cbu; then
6092 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6095 case "$use64bitint" in
6096 "$define"|true|[yY]*)
6097 : This test was common to all the OpenBSD forks, and seems harmless for
6100 echo "Checking if your C library has broken 64-bit functions..." >&4
6103 typedef $uquadtype myULL;
6110 {4294967303.15, 4294967303ULL},
6111 {4294967294.2, 4294967294ULL},
6112 {4294967295.7, 4294967295ULL},
6115 for (p = test; p->u; p++) {
6116 myULL x = (myULL)p->d;
6127 if eval $compile_ok; then
6128 libcquad=`$run ./try`
6129 echo "Your C library's 64-bit functions are $libcquad."
6131 echo "(I can't seem to compile the test program.)"
6132 echo "Assuming that your C library's 64-bit functions are ok."
6141 *** You have a C library with broken 64-bit functions.
6142 *** 64-bit support does not work reliably in this configuration.
6143 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6144 *** Cannot continue, aborting.
6151 4) case "$archname64" in
6152 '') archname64=64int ;;
6159 : Look for a hint-file generated 'call-back-unit'. If the
6160 : user has specified that a maximally 64-bit perl is to be built,
6161 : we may need to set or change some other defaults.
6162 if $test -f use64bitall.cbu; then
6163 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6166 case "$use64bitall" in
6167 "$define"|true|[yY]*)
6169 4) case "$archname64" in
6170 ''|64int) archname64=64all ;;
6177 case "$d_quad:$use64bitint" in
6181 *** You have chosen to use 64-bit integers,
6182 *** but none can be found.
6183 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6184 *** Cannot continue, aborting.
6191 : check for length of double
6193 case "$doublesize" in
6195 echo "Checking to see how big your double precision numbers are..." >&4
6204 printf("%d\n", (int)sizeof(double));
6209 if eval $compile_ok; then
6210 doublesize=`$run ./try`
6211 echo "Your double is $doublesize bytes long."
6214 echo "(I can't seem to compile the test program. Guessing...)"
6215 rp="What is the size of a double precision number (in bytes)?"
6223 : check for long doubles
6225 echo "Checking to see if you have long double..." >&4
6226 echo 'int main() { long double x = 7.0; }' > try.c
6228 if eval $compile; then
6230 echo "You have long double."
6233 echo "You do not have long double."
6239 : check for length of long double
6240 case "${d_longdbl}${longdblsize}" in
6243 echo "Checking to see how big your long doubles are..." >&4
6244 $cat >try.c <<'EOCP'
6248 printf("%d\n", sizeof(long double));
6253 if eval $compile; then
6254 longdblsize=`$run ./try`
6255 echo "Your long doubles are $longdblsize bytes long."
6259 echo "(I can't seem to compile the test program. Guessing...)" >&4
6260 rp="What is the size of a long double (in bytes)?"
6264 if $test "X$doublesize" = "X$longdblsize"; then
6265 echo "That isn't any different from an ordinary double."
6266 echo "I'll keep your setting anyway, but you may see some"
6267 echo "harmless compilation warnings."
6273 : determine the architecture name
6275 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6276 tarch=`arch`"-$osname"
6277 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6278 if uname -m > tmparch 2>&1 ; then
6279 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6280 -e 's/$/'"-$osname/" tmparch`
6288 case "$myarchname" in
6291 echo "(Your architecture name used to be $myarchname.)"
6295 case "$targetarch" in
6297 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6302 *) dflt="$archname";;
6304 rp='What is your architecture name'
6308 : optionally add API version to the architecture for versioned archlibs
6309 case "$useversionedarchname" in
6310 $define|true|[yY]*) dflt='y';;
6313 rp='Add the Perl API version to your archname?'
6316 y|Y) useversionedarchname="$define" ;;
6317 *) useversionedarchname="$undef" ;;
6319 case "$useversionedarchname" in
6322 *-$api_versionstring)
6323 echo "...and architecture name already has -$api_versionstring" >&4
6326 archname="$archname-$api_versionstring"
6327 echo "...setting architecture name to $archname." >&4
6333 case "$usethreads" in
6335 echo "Threads selected." >&4
6337 *-thread*) echo "...and architecture name already has -thread." >&4
6339 *) archname="$archname-thread"
6340 echo "...setting architecture name to $archname." >&4
6345 case "$usemultiplicity" in
6347 echo "Multiplicity selected." >&4
6349 *-multi*) echo "...and architecture name already has -multi." >&4
6351 *) archname="$archname-multi"
6352 echo "...setting architecture name to $archname." >&4
6357 case "$use64bitint$use64bitall" in
6359 case "$archname64" in
6361 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6364 case "$use64bitint" in
6365 "$define") echo "64 bit integers selected." >&4 ;;
6367 case "$use64bitall" in
6368 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6371 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6373 *) archname="$archname-$archname64"
6374 echo "...setting architecture name to $archname." >&4
6380 case "$uselongdouble" in
6382 echo "Long doubles selected." >&4
6383 case "$longdblsize" in
6385 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6389 *-ld*) echo "...and architecture name already has -ld." >&4
6391 *) archname="$archname-ld"
6392 echo "...setting architecture name to $archname." >&4
6399 if $test -f archname.cbu; then
6400 echo "Your platform has some specific hints for architecture name, using them..."
6404 : set the prefixit variable, to compute a suitable default value
6405 prefixit='case "$3" in
6407 case "$oldprefix" in
6408 "") eval "$1=\"\$$2\"";;
6415 ""|" ") eval "$1=\"\$$2\"";;
6421 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6423 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6424 /*-$oldprefix/*|\~*-$oldprefix/*)
6425 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6426 *) eval "$1=\"\$$2\"";;
6430 : determine installation style
6431 : For now, try to deduce it from prefix unless it is already set.
6432 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6433 case "$installstyle" in
6434 '') case "$prefix" in
6435 *perl*) dflt='lib';;
6436 *) dflt='lib/perl5' ;;
6439 *) dflt="$installstyle" ;;
6441 : Probably not worth prompting for this since we prompt for all
6442 : the directories individually, and the prompt would be too long and
6446 : determine where public executables go
6451 rp='Pathname where the public executables will reside?'
6453 if $test "X$ansexp" != "X$binexp"; then
6457 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6458 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6459 : this via initialinstalllocation
6462 case "$userelocatableinc" in
6463 $define|true|[yY]*) dflt='y' ;;
6468 Would you like to build Perl so that the installation is relocatable, so that
6469 library paths in @INC are determined relative to the path of the perl binary?
6470 This is not advised for system Perl installs, or if you need to run setid
6471 scripts or scripts under taint mode.
6473 If this doesn't make any sense to you, just accept the default '$dflt'.
6475 rp='Use relocatable @INC?'
6478 y|Y) val="$define" ;;
6481 set userelocatableinc
6484 initialinstalllocation="$binexp"
6485 : Default prefix is now "up one level from where the binaries are"
6486 case "$userelocatableinc" in
6492 installprefixexp=".../.."
6496 : determine where private library files go
6497 : Usual default is /usr/local/lib/perl5/$version.
6498 : Also allow things like /opt/perl/lib/$version, since
6499 : /opt/perl/lib/perl5... would be redundant.
6500 : The default "style" setting is made in installstyle.U
6501 case "$installstyle" in
6502 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6503 *) set dflt privlib lib/$version ;;
6508 There are some auxiliary files for $package that need to be put into a
6509 private library directory that is accessible by everyone.
6514 rp='Pathname where the private library files will reside?'
6519 : set the prefixup variable, to restore leading tilda escape
6520 prefixup='case "$prefixexp" in
6522 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6525 : determine where public architecture dependent libraries go
6528 : privlib default is /usr/local/lib/$package/$version
6529 : archlib default is /usr/local/lib/$package/$version/$archname
6530 : privlib may have an optional trailing /share.
6531 tdflt=`echo $privlib | $sed 's,/share$,,'`
6532 tdflt=$tdflt/$archname
6541 $spackage contains architecture-dependent library files. If you are
6542 sharing libraries in a heterogeneous environment, you might store
6543 these files in a separate location. Otherwise, you can just include
6544 them with the rest of the public library files.
6549 rp='Where do you want to put the public architecture-dependent libraries?'
6553 if $test X"$archlib" = X"$privlib"; then
6559 : see if setuid scripts can be secure
6562 Some kernels have a bug that prevents setuid #! scripts from being
6563 secure. Some sites have disabled setuid #! scripts because of this.
6565 First let's decide if your kernel supports secure setuid #! scripts.
6566 (If setuid #! scripts would be secure but have been disabled anyway,
6567 don't say that they are secure if asked.)
6572 if $test -d /dev/fd; then
6573 echo "#!$ls" >reflect
6574 chmod +x,u+s reflect
6575 ./reflect >flect 2>&1
6576 if $contains "/dev/fd" flect >/dev/null; then
6577 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6581 If you are not sure if they are secure, I can check but I'll need a
6582 username and password different from the one you are using right now.
6583 If you don't have such a username or don't want me to test, simply
6587 rp='Other username to test security of setuid scripts with?'
6592 case "$d_suidsafe" in
6593 '') echo "I'll assume setuid scripts are *not* secure." >&4
6596 echo "Well, the $hint value is *not* secure." >&4
6598 *) echo "Well, the $hint value *is* secure." >&4
6603 $rm -f reflect flect
6604 echo "#!$ls" >reflect
6605 chmod +x,u+s reflect
6608 echo '"su" will (probably) prompt you for '"$ans's password."
6609 su $ans -c './reflect >flect'
6610 if $contains "/dev/fd" flect >/dev/null; then
6611 echo "Okay, it looks like setuid scripts are secure." >&4
6614 echo "I don't think setuid scripts are secure." >&4
6619 rp='Does your kernel have *secure* setuid scripts?'
6622 [yY]*) val="$define";;
6627 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6628 echo "(That's for file descriptors, not floppy disks.)"
6634 $rm -f reflect flect
6636 : now see if they want to do setuid emulation
6637 if $test $patchlevel -lt 11; then
6640 case "$d_suidsafe" in
6643 echo "No need to emulate SUID scripts since they are secure here." >&4
6647 Some systems have disabled setuid scripts, especially systems where
6648 setuid scripts cannot be secure. On systems where setuid scripts have
6649 been disabled, the setuid/setgid bits on scripts are currently
6650 useless. It is possible for $package to detect those bits and emulate
6651 setuid/setgid in a secure fashion. This emulation will only work if
6652 setuid scripts have been disabled in your kernel.
6656 "$define") dflt=y ;;
6659 rp="Do you want to do setuid/setgid emulation?"
6662 [yY]*) val="$define";;
6674 SUID emulation has been removed for 5.12
6675 Please re-run Configure without -Dd_dosuid
6684 : Find perl5.005 or later.
6685 echo "Looking for a previously installed perl5.005 or later... "
6687 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6688 : Check if this perl is recent and can load a simple module
6689 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6692 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6702 '') echo "None found. That's ok.";;
6703 *) echo "Using $perl5." ;;
6706 : Set the siteprefix variables
6709 After $package is installed, you may wish to install various
6710 add-on modules and utilities. Typically, these add-ons will
6711 be installed under $prefix with the rest
6712 of this package. However, you may wish to install such add-ons
6713 elsewhere under a different prefix.
6715 If you do not wish to put everything under a single prefix, that's
6716 ok. You will be prompted for the individual locations; this siteprefix
6717 is only used to suggest the defaults.
6719 The default should be fine for most people.
6723 rp='Installation prefix to use for add-on modules and utilities?'
6724 : XXX Here might be another good place for an installstyle setting.
6725 case "$siteprefix" in
6727 *) dflt=$siteprefix ;;
6730 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6732 case "$siteprefix" in
6736 *) oldsiteprefix="$prefix";;
6741 siteprefixexp="$ansexp"
6743 : determine where site specific libraries go.
6744 : Usual default is /usr/local/lib/perl5/site_perl/$version
6745 : The default "style" setting is made in installstyle.U
6746 : XXX No longer works with Prefixit stuff.
6747 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6749 '') case "$installstyle" in
6750 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6751 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6759 The installation process will create a directory for
6760 site-specific extensions and modules. Most users find it convenient
6761 to place all site-specific files in this directory rather than in the
6762 main distribution directory.
6766 rp='Pathname for the site-specific library files?'
6770 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6772 : Determine list of previous versions to include in @INC
6773 $cat > getverlist <<EOPL
6776 \$api_versionstring = "$api_versionstring";
6777 \$version = "$version";
6778 \$stem = "$sitelib_stem";
6779 \$archname = "$archname";
6781 $cat >> getverlist <<'EOPL'
6782 # The list found is store twice for each entry: the original name, and
6783 # the binary broken down version as pack "sss", so sorting is easy and
6784 # unambiguous. This will work for all versions that have a maximum of
6785 # three digit groups, separate by '.'s or '_'s. Names are extended with
6786 # ".0.0" to ensure at least three elements for the pack.
6787 # -- H.Merijn Brand (m)'06 23-10-2006
6789 # Can't have leading @ because metaconfig interprets it as a command!
6790 ;@inc_version_list=();
6791 # XXX Redo to do opendir/readdir?
6794 ;@candidates = map {
6795 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6796 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6802 ($pversion, $aversion, $vsn5005) = map {
6803 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6804 foreach $d (@candidates) {
6805 if ($d->[1] lt $pversion) {
6806 if ($d->[1] ge $aversion) {
6807 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6809 elsif ($d->[1] ge $vsn5005) {
6810 unshift(@inc_version_list, grep { -d } $d->[0]);
6814 # Skip newer version. I.e. don't look in
6815 # 5.7.0 if we're installing 5.6.1.
6819 if (@inc_version_list) {
6820 print join(' ', @inc_version_list);
6823 # Blank space to preserve value for next Configure run.
6828 case "$inc_version_list" in
6829 '') if test -x "$perl5$exe_ext"; then
6830 dflt=`$perl5 getverlist`
6835 $undef) dflt='none' ;;
6836 *) eval dflt=\"$inc_version_list\" ;;
6839 ''|' ') dflt=none ;;
6846 In order to ease the process of upgrading, this version of perl
6847 can be configured to use modules built and installed with earlier
6848 versions of perl that were installed under $prefix. Specify here
6849 the list of earlier versions that this version of perl should check.
6850 If Configure detected no earlier versions of perl installed under
6851 $prefix, then the list will be empty. Answer 'none' to tell perl
6852 to not search earlier versions.
6854 The default should almost always be sensible, so if you're not sure,
6855 just accept the default.
6858 rp='List of earlier versions to include in @INC?'
6861 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6862 *) inc_version_list="$ans" ;;
6864 case "$inc_version_list" in
6866 inc_version_list_init='0'
6867 d_inc_version_list="$undef"
6869 *) inc_version_list_init=`echo $inc_version_list |
6870 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6871 d_inc_version_list="$define"
6876 : see if malloc/malloc.h has to be included
6877 set malloc/malloc.h i_mallocmalloc
6880 : see if this is a malloc.h system
6881 : we want a real compile instead of Inhdr because some systems have a
6882 : malloc.h that just gives a compile error saying to use stdlib.h instead
6887 #$i_mallocmalloc I_MALLOCMALLOC
6888 #ifdef I_MALLOCMALLOC
6889 # include <malloc/malloc.h>
6892 int main () { return 0; }
6895 if eval $compile; then
6896 echo "<malloc.h> found." >&4
6899 echo "<malloc.h> NOT found." >&4
6906 : check for length of pointer
6910 echo "Checking to see how big your pointers are..." >&4
6919 printf("%d\n", (int)sizeof(void *));
6924 if eval $compile_ok; then
6925 ptrsize=`$run ./try`
6926 echo "Your pointers are $ptrsize bytes long."
6929 echo "(I can't seem to compile the test program. Guessing...)" >&4
6930 rp="What is the size of a pointer (in bytes)?"
6937 case "$use64bitall" in
6938 "$define"|true|[yY]*)
6942 *** You have chosen a maximally 64-bit build,
6943 *** but your pointers are only 4 bytes wide.
6944 *** Please rerun Configure without -Duse64bitall.
6949 *** Since you have quads, you could possibly try with -Duse64bitint.
6954 *** Cannot continue, aborting.
6965 : determine whether to use malloc wrapping
6967 case "$usemallocwrap" in
6968 [yY]*|true|$define) dflt='y' ;;
6969 [nN]*|false|$undef) dflt='n' ;;
6970 *) case "$usedevel" in
6971 [yY]*|true|$define) dflt='y' ;;
6976 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6978 usemallocwrap="$ans"
6981 usemallocwrap="$define" ;;
6983 usemallocwrap="$undef" ;;
6986 : determine which malloc to compile in
6988 case "$usemymalloc" in
6989 [yY]*|true|$define) dflt='y' ;;
6990 [nN]*|false|$undef) dflt='n' ;;
6991 *) case "$ptrsize" in
6995 if test "$useithreads" = "$define"; then dflt='n'; fi
6998 rp="Do you wish to attempt to use the malloc that comes with $package?"
7004 mallocsrc='malloc.c'
7005 mallocobj="malloc$_o"
7006 d_mymalloc="$define"
7009 : Remove malloc from list of libraries to use
7010 echo "Removing unneeded -lmalloc from library list" >&4
7011 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7014 echo "libs = $libs" >&4
7026 : compute the return types of malloc and free
7028 $cat >malloc.c <<END
7032 #include <sys/types.h>
7046 case "$malloctype" in
7048 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7055 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7059 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7066 echo "Your system uses $freetype free(), it would seem." >&4
7068 : determine where site specific architecture-dependent libraries go.
7069 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7070 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7071 : sitelib may have an optional trailing /share.
7073 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7074 dflt="$dflt/$archname"
7079 set sitearch sitearch none
7083 The installation process will also create a directory for
7084 architecture-dependent site-specific extensions and modules.
7088 rp='Pathname for the site-specific architecture-dependent library files?'
7092 if $test X"$sitearch" = X"$sitelib"; then
7095 d_sitearch="$define"
7098 : Set the vendorprefix variables
7101 The installation process will also create a directory for
7102 vendor-supplied add-ons. Vendors who supply perl with their system
7103 may find it convenient to place all vendor-supplied files in this
7104 directory rather than in the main distribution directory. This will
7105 ease upgrades between binary-compatible maintenance versions of perl.
7107 Of course you may also use these directories in whatever way you see
7108 fit. For example, you might use them to access modules shared over a
7109 company-wide network.
7111 The default answer should be fine for most people.
7112 This causes further questions about vendor add-ons to be skipped
7113 and no vendor-specific directories will be configured for perl.
7116 rp='Do you want to configure vendor-specific add-on directories?'
7117 case "$usevendorprefix" in
7118 define|true|[yY]*) dflt=y ;;
7119 *) : User may have set vendorprefix directly on Configure command line.
7120 case "$vendorprefix" in
7129 rp='Installation prefix to use for vendor-supplied add-ons?'
7130 case "$vendorprefix" in
7131 '') dflt="$prefix" ;;
7132 *) dflt=$vendorprefix ;;
7135 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7137 case "$vendorprefix" in
7141 *) oldvendorprefix="$prefix";;
7145 usevendorprefix="$define"
7147 vendorprefixexp="$ansexp"
7149 *) usevendorprefix="$undef"
7155 : Set the vendorlib variables
7156 case "$vendorprefix" in
7157 '') d_vendorlib="$undef"
7161 *) d_vendorlib="$define"
7162 : determine where vendor-supplied modules go.
7163 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7164 case "$vendorlib" in
7166 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7167 case "$installstyle" in
7168 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7169 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7172 *) dflt="$vendorlib"
7176 rp='Pathname for the vendor-supplied library files?'
7179 vendorlibexp="$ansexp"
7182 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7186 : Set the vendorarch variables
7187 case "$vendorprefix" in
7188 '') d_vendorarch="$undef"
7192 *) d_vendorarch="$define"
7193 : determine where vendor-supplied architecture-dependent libraries go.
7194 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7195 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7196 : vendorlib may have an optional trailing /share.
7197 case "$vendorarch" in
7198 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7199 dflt="$dflt/$archname"
7201 *) dflt="$vendorarch" ;;
7204 rp='Pathname for vendor-supplied architecture-dependent files?'
7207 vendorarchexp="$ansexp"
7210 prefixvar=vendorarch
7212 if $test X"$vendorarch" = X"$vendorlib"; then
7213 d_vendorarch="$undef"
7215 d_vendorarch="$define"
7218 : Final catch-all directories to search
7221 Lastly, you can have perl look in other directories for extensions and
7222 modules in addition to those already specified.
7223 These directories will be searched after
7227 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7228 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7230 case "$otherlibdirs" in
7231 ''|' ') dflt='none' ;;
7232 *) dflt="$otherlibdirs" ;;
7235 Enter a colon-separated set of extra paths to include in perl's @INC
7236 search path, or enter 'none' for no extra paths.
7240 rp='Colon-separated list of additional directories for perl to search?'
7243 ' '|''|none) otherlibdirs=' ' ;;
7244 *) otherlibdirs="$ans" ;;
7246 case "$otherlibdirs" in
7250 set d_perl_otherlibdirs
7253 : Cruising for prototypes
7255 echo "Checking out function prototypes..." >&4
7256 $cat >prototype.c <<EOCP
7261 int main(int argc, char *argv[]) {
7264 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7265 echo "Your C compiler appears to support function prototypes."
7268 echo "Your C compiler doesn't seem to understand function prototypes."
7275 : Check if ansi2knr is required
7276 case "$prototype" in
7278 *) ansi2knr='ansi2knr'
7283 This version of $package can only be compiled by a compiler that
7284 understands function prototypes. Unfortunately, your C compiler
7286 doesn't seem to understand them. Sorry about that.
7288 If GNU cc is available for your system, perhaps you could try that instead.
7290 Eventually, we hope to support building Perl with pre-ANSI compilers.
7291 If you would like to help in that effort, please contact <perlbug@perl.org>.
7293 Aborting Configure now.
7300 dflt_dtrace='/usr/sbin/dtrace'
7301 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7305 Perl can be built to support DTrace on platforms that support it.
7306 DTrace is a diagnosis and performance analysis tool from Sun.
7308 If this doesn't make any sense to you, just accept the default '$dflt'.
7312 case "$usedtrace" in
7318 dflt_dtrace=$usedtrace
7325 rp='Support DTrace if available?'
7328 y|Y) val="$define" ;;
7334 test "X$usedtrace" != "X$define" && break
7337 rp='Where is the dtrace executable?'
7346 if $dtrace -h -s ../perldtrace.d \
7347 -o perldtrace.tmp >/dev/null 2>&1 \
7348 && rm -f perldtrace.tmp
7351 echo "Good: your $dtrace knows about the -h flag."
7355 *** $me: Fatal Error: $dtrace doesn't support -h flag
7357 *** Your installed dtrace doesn't support the -h switch to compile a D
7358 *** program into a C header. Can't continue.
7370 *** $me: Fatal Error: $dtrace not found.
7377 echo "*** $dtrace was not found."
7383 : See if we want extra modules installed
7390 Perl can be built with extra modules or bundles of modules which
7391 will be fetched from the CPAN and installed alongside Perl.
7393 Notice that you will need access to the CPAN; either via the Internet,
7394 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7395 be asked later to configure the CPAN.pm module which will in turn do
7396 the installation of the rest of the extra modules or bundles.)
7398 Notice also that if the modules require any external software such as
7399 libraries and headers (the libz library and the zlib.h header for the
7400 Compress::Zlib module, for example) you MUST have any such software
7401 already installed, this configuration process will NOT install such
7404 If this doesn't make any sense to you, just accept the default '$dflt'.
7406 rp='Install any extra modules (y or n)?'
7412 Please list any extra modules or bundles to be installed from CPAN,
7413 with spaces between the names. The names can be in any format the
7414 'install' command of CPAN.pm will understand. (Answer 'none',
7415 without the quotes, to install no extra modules or bundles.)
7425 $rm -f ../extras.lst
7427 *) echo "(Saving the list of extras for later...)"
7428 echo "$extras" > ../extras.lst
7436 : determine where html pages for programs go
7437 set html1dir html1dir none
7441 If you wish to install html files for programs in $spackage, indicate
7442 the appropriate directory here. To skip installing html files,
7446 ''|none|$undef|' ') dflt=none ;;
7447 *) dflt=$html1dir ;;
7450 rp="Directory for the main $spackage html pages?"
7454 : Use ' ' for none so value is preserved next time through Configure
7455 $test X"$html1dir" = "X" && html1dir=' '
7457 : determine where html pages for libraries and modules go
7458 set html3dir html3dir none
7462 If you wish to install html files for modules associated with $spackage,
7463 indicate the appropriate directory here. To skip installing html files,
7466 : There is no obvious default. If they have specified html1dir, then
7467 : try to key off that, possibly changing .../html1 into .../html3.
7469 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7470 *) dflt=$html3dir ;;
7473 rp="Directory for the $spackage module html pages?"
7477 : Use ' ' for none so value is preserved next time through Configure
7478 $test X"$html3dir" = "X" && html3dir=' '
7480 : determine whether to install perl also as /usr/bin/perl
7483 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7485 Many scripts expect perl to be installed as /usr/bin/perl.
7487 If you want to, I can install the perl you are about to compile
7488 as /usr/bin/perl (in addition to $bin/perl).
7490 if test -f /usr/bin/perl; then
7493 However, please note that because you already have a /usr/bin/perl,
7494 overwriting that with a new Perl would very probably cause problems.
7495 Therefore I'm assuming you don't want to do that (unless you insist).
7498 case "$installusrbinperl" in
7499 "$define"|[yY]*) dflt='y';;
7505 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7508 case "$installusrbinperl" in
7509 "$undef"|[nN]*) dflt='n';;
7513 rp="Do you want to install perl as /usr/bin/perl?"
7516 [yY]*) val="$define";;
7522 set installusrbinperl
7525 : Check if we are using the GNU C library
7527 echo "Checking for GNU C Library..." >&4
7529 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7530 alone are insufficient to distinguish different versions, such as
7531 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7532 libc version 2.1.0. A. Dougherty, June 3, 2002.
7538 # ifdef __GLIBC_MINOR__
7539 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7540 # include <gnu/libc-version.h>
7541 printf("%s\n", gnu_get_libc_version());
7543 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7546 printf("%d\n", __GLIBC__);
7555 if eval $compile_ok && $run ./try > glibc.ver; then
7557 gnulibc_version=`$cat glibc.ver`
7558 echo "You are using the GNU C Library version $gnulibc_version"
7562 echo "You are not using the GNU C Library"
7568 : see if nm is to be used to determine whether a symbol is defined or not
7572 case "$d_gnulibc" in
7575 echo "nm probably won't work on the GNU C Library." >&4
7581 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7583 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7584 echo "'nm' won't be sufficient on this system." >&4
7590 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7591 if $test $dflt -gt 20; then
7601 true|$define) dflt=y;;
7608 I can use $nm to extract the symbols from your C libraries. This
7609 is a time consuming task which may generate huge output on the disk (up
7610 to 3 megabytes) but that should make the symbols extraction faster. The
7611 alternative is to skip the 'nm' extraction part and to compile a small
7612 test program instead to determine whether each symbol is present. If
7613 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7614 this may be the best solution.
7616 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7619 rp="Shall I use $nm to extract C symbols from the libraries?"
7622 [Nn]*) usenm=false;;
7631 : nm options which may be necessary
7633 '') if $test -f /mach_boot; then
7635 elif $test -d /usr/ccs/lib; then
7636 nm_opt='-p' # Solaris (and SunOS?)
7637 elif $test -f /dgux; then
7639 elif $test -f /lib64/rld; then
7640 nm_opt='-p' # 64-bit Irix
7646 : nm options which may be necessary for shared libraries but illegal
7647 : for archive libraries. Thank you, Linux.
7648 case "$nm_so_opt" in
7649 '') case "$myuname" in
7651 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7652 nm_so_opt='--dynamic'
7659 : Figure out where the libc is located
7662 : get list of predefined functions in a handy place
7667 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7673 *) for thislib in $libs; do
7676 : Handle C library specially below.
7679 thislib=`echo $thislib | $sed -e 's/^-l//'`
7680 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7682 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7684 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7686 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7688 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7690 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7692 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7697 libnames="$libnames $try"
7699 *) libnames="$libnames $thislib" ;;
7708 for xxx in $libpth; do
7709 $test -r $1 || set $xxx/libc.$so
7710 : The messy sed command sorts on library version numbers.
7712 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7713 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7715 s/[0-9][0-9]*/0000&/g
7716 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7719 $sort | $sed -e 's/^.* //'`
7722 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7723 $test -r $1 || set $sysroot/lib/libsys_s$_a
7729 if $test -r "$1"; then
7730 echo "Your (shared) C library seems to be in $1."
7732 elif $test -r /lib/libc && $test -r /lib/clib; then
7733 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7735 libc='/lib/clib /lib/libc'
7736 if $test -r /lib/syslib; then
7737 echo "(Your math library is in /lib/syslib.)"
7738 libc="$libc /lib/syslib"
7740 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7741 echo "Your C library seems to be in $libc, as you said before."
7742 elif $test -r $incpath/usr/lib/libc$_a; then
7743 libc=$incpath/usr/lib/libc$_a;
7744 echo "Your C library seems to be in $libc. That's fine."
7745 elif $test -r /lib/libc$_a; then
7747 echo "Your C library seems to be in $libc. You're normal."
7749 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7751 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7752 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7753 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7755 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7757 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7760 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7762 if $test -r "$tans"; then
7763 echo "Your C library seems to be in $tans, of all places."
7769 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7773 If the guess above is wrong (which it might be if you're using a strange
7774 compiler, or your machine supports multiple models), you can override it here.
7779 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7781 I can't seem to find your C library. I've looked in the following places:
7784 $sed 's/^/ /' libpath
7787 None of these seems to contain your C library. I need to get its name...
7792 rp='Where is your C library?'
7797 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7798 set X `cat libnames`
7801 case $# in 1) xxx=file; esac
7802 echo "Extracting names from the following $xxx for later perusal:" >&4
7804 $sed 's/^/ /' libnames >&4
7806 $echo $n "This may take a while...$c" >&4
7810 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7811 *) $nm $nm_opt $file 2>/dev/null;;
7816 $grep fprintf libc.tmp > libc.ptf
7817 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7818 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7820 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7822 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7824 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7826 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7828 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7830 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7832 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7834 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7836 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7838 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7840 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7842 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7844 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7845 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7847 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7849 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7851 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7853 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7855 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7857 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7859 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7861 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7863 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7865 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7867 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7869 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7871 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7873 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7875 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7878 $nm -p $* 2>/dev/null >libc.tmp
7879 $grep fprintf libc.tmp > libc.ptf
7880 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7881 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7887 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7889 if $ar t $libc > libc.tmp && \
7890 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7892 for thisname in $libnames $libc; do
7893 $ar t $thisname >>libc.tmp
7895 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7897 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7898 for thisname in $libnames $libc; do
7899 $ar tv $thisname >>libc.tmp
7900 emximp -o tmp.imp $thisname \
7902 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7903 < tmp.imp >>libc.tmp
7906 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7909 echo "$ar didn't seem to work right." >&4
7910 echo "Maybe this is a Cray...trying bld instead..." >&4
7912 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7915 for thisname in $libnames; do
7917 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7918 $ar t $thisname >>libc.tmp
7922 echo "That didn't work either. Giving up." >&4
7932 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7933 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7935 *) if $test -f /lib/syscalls.exp; then
7937 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7938 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7939 /lib/syscalls.exp >>libc.list
7945 $rm -f libnames libpath
7947 : Check if we are using C++
7949 echo "Checking for C++..." >&4
7950 $cat >try.c <<'EOCP'
7962 if eval $compile_ok && $run ./try; then
7964 echo "You are using a C++ compiler."
7967 echo "You are not using a C++ compiler."
7973 : is a C symbol defined?
7976 -v) tf=libc.tmp; tdc="";;
7977 -a) tf=libc.tmp; tdc="[]";;
7978 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7980 case "$d_cplusplus" in
7981 $define) extern_C="extern \"C\"" ;;
7982 *) extern_C="extern" ;;
7985 case "$reuseval-$4" in
7987 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7992 if $test "$runnm" = true; then
7993 if $contains $tlook $tf >/dev/null 2>&1; then
7995 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7996 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
7997 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7998 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
8002 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
8003 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
8009 $define) tval=true;;
8016 : define an is-in-libc? function
8017 inlibc='echo " "; td=$define; tu=$undef;
8018 sym=$1; var=$2; eval "was=\$$2";
8020 case "$reuseval$was" in
8030 echo "$sym() found." >&4;
8031 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
8033 echo "$sym() NOT found." >&4;
8034 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
8038 $define) echo "$sym() found." >&4;;
8039 *) echo "$sym() NOT found." >&4;;
8043 : see if dlopen exists
8045 xxx_ccflags="$ccflags"
8047 : with g++ one needs -shared to get is-in-libc to work for dlopen
8048 case "$gccversion" in
8050 *) case "$d_cplusplus" in
8051 "$define") ccflags="$ccflags -shared" ;;
8058 ccflags="$xxx_ccflags"
8060 : see if this is a unistd.h system
8061 set unistd.h i_unistd
8064 : determine which dynamic loading, if any, to compile in
8066 dldir="ext/DynaLoader"
8079 $define) dflt='y' ;;
8081 : Does a dl_xxx.xs file exist for this operating system
8082 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8085 rp="Do you wish to use dynamic loading?"
8092 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8093 dflt="$dldir/dl_${osname}.xs"
8094 elif $test "$d_dlopen" = "$define" ; then
8095 dflt="$dldir/dl_dlopen.xs"
8100 *) dflt="$dldir/$dlsrc"
8103 echo "The following dynamic loading files are available:"
8104 : Can not go over to $dldir because getfile has path hard-coded in.
8105 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8106 rp="Source file to use for dynamic loading"
8112 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8116 Some systems may require passing special flags to $cc -c to
8117 compile modules that will be used to create a shared library.
8118 To use no flags, say "none".
8121 case "$cccdlflags" in
8122 '') case "$gccversion" in
8123 '') case "$osname" in
8125 next) dflt='none' ;;
8126 irix*) dflt='-KPIC' ;;
8127 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8128 sunos) dflt='-pic' ;;
8132 *) case "$osname" in
8133 darwin) dflt='none' ;;
8134 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8139 *) dflt="$cccdlflags" ;;
8146 # If -Dsysroot was specified, now's the time to add it
8148 if test "X$sysroot" != X; then
8149 case "$gccversion" in
8154 dflt="$dflt --sysroot=$sysroot" ;;
8164 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8167 none) cccdlflags=' ' ;;
8168 *) cccdlflags="$ans" ;;
8173 Some systems use ld to create libraries that can be dynamically loaded,
8174 while other systems (such as those using ELF) use $cc.
8178 : Determine if this is ELF
8180 /* Test for whether ELF binaries are produced */
8192 int i = open("a.out",O_RDONLY);
8195 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8196 exit(0); /* succeed (yes, it is ELF) */
8200 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8206 '') if $test $bin_ELF = "$define"; then
8208 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8212 echo "I'll use ld to build dynamic libraries."
8220 rp="What command should be used to create dynamic libraries?"
8226 Some systems may require passing special flags to $ld to create a
8227 library that can be dynamically loaded. If your ld flags include
8228 -L/other/path options to locate libraries outside your loader's normal
8229 search path, you may need to specify those -L options here as well. To
8230 use no flags, say "none".
8233 case "$lddlflags" in
8234 '') case "$osname" in
8235 haiku) dflt='-shared' ;;
8237 case "$gccversion" in
8238 '') dflt="$dflt +vnocompatwarnings" ;;
8241 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8242 next) dflt='none' ;;
8243 solaris) # See [perl #66604].
8244 # On Solaris 11, gcc -m64 on amd64
8245 # appears not to understand -G. gcc versions at
8246 # least as old as 3.4.3 support -shared, so just
8247 # use that with Solaris 11 and later, but keep
8248 # the old behavior for older Solaris versions.
8249 case "$gccversion" in
8251 *) case "$osvers" in
8252 2.?|2.10) dflt='-G' ;;
8253 *) dflt='-shared' ;;
8258 sunos) dflt='-assert nodefinitions' ;;
8259 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8263 *) dflt="$lddlflags" ;;
8266 : Only do this for gcc, since, for example, qcc has no concept
8268 if $test "X$sysroot" != X; then
8269 case "$gccversion" in
8271 *) dflt="$dflt --sysroot $sysroot" ;;
8275 : Try to guess additional flags to pick up local libraries.
8276 : Be careful not to append to a plain 'none'
8280 for thisflag in $ldflags; do
8285 *) dflt="$dflt $thisflag" ;;
8292 ''|' ') dflt='none' ;;
8296 *-fstack-protector*)
8298 *-fstack-protector*) ;; # Don't add it again
8299 *) dflt="$dflt -fstack-protector" ;;
8304 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8307 none) lddlflags=' ' ;;
8308 *) lddlflags="$ans" ;;
8313 Some systems may require passing special flags to $cc to indicate that
8314 the resulting executable will use dynamic linking. To use no flags,
8318 case "$ccdlflags" in
8319 '') case "$osname" in
8320 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8321 next|sunos) dflt='none' ;;
8325 *) dflt="$ccdlflags" ;;
8327 rp="Any special flags to pass to $cc to use dynamic linking?"
8330 none) ccdlflags=' ' ;;
8331 *) ccdlflags="$ans" ;;
8343 ld_can_script="$undef"
8344 case "$bin_ELF$usedl" in
8346 # Abuse try.h and a.out names for neat cleanup
8358 if $cc $cccdlflags $ccdlflags $ccflags \
8359 $ldflags $lddlflags -o a.out try.c \
8360 -Wl,--version-script=try.h >/dev/null 2>&1 \
8361 && $test -s a.out ; then
8362 echo "ld supports scripting" >&4
8363 ld_can_script="$define"
8365 echo "ld does not support scripting" >&4
8371 : Do we want a shared libperl?
8375 # No dynamic loading being used, so don't bother even to prompt.
8378 *) case "$useshrplib" in
8379 '') case "$osname" in
8380 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8382 also='Building a shared libperl is required for dynamic loading to work on your system.'
8387 also='Building a shared libperl is needed for MAB support.'
8405 The perl executable is normally obtained by linking perlmain.c with
8406 libperl${_a}, any static extensions (usually just DynaLoader), and
8407 any other libraries needed on this system (such as -lm, etc.). Since
8408 your system supports dynamic loading, it is probably possible to build
8409 a shared libperl.$so. If you will have more than one executable linked
8410 to libperl.$so, this will significantly reduce the size of each
8411 executable, but it may have a noticeable effect on performance. The
8412 default is probably sensible for your system.
8416 rp="Build a shared libperl.$so (y/n)"
8420 useshrplib='true' ;;
8421 *) useshrplib='false' ;;
8426 case "$useshrplib" in
8428 case "$userelocatableinc" in
8430 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8431 echo "See INSTALL for an explanation why that won't work." >&4
8437 # Figure out a good name for libperl.so. Since it gets stored in
8438 # a version-specific architecture-dependent library, the version
8439 # number isn't really that important, except for making cc/ld happy.
8441 # A name such as libperl.so.10.1
8442 majmin="libperl.$so.$patchlevel.$subversion"
8443 # A name such as libperl.so.100
8444 majonly=`echo $patchlevel $subversion |
8445 $awk '{printf "%d%02d", $1, $2}'`
8446 majonly=libperl.$so.$majonly
8447 # I'd prefer to keep the os-specific stuff here to a minimum, and
8448 # rely on figuring it out from the naming of libc.
8449 case "${osname}${osvers}" in
8452 # XXX How handle the --version stuff for MAB?
8454 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8457 cygwin*) # ld links now against the dll directly
8458 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8459 majonly=`echo $patchlevel $subversion |
8460 $awk '{printf "%03d%03d", $1, $2}'`
8461 majonly=cygperl5.$majonly.$so
8464 *) # Try to guess based on whether libc has major.minor.
8466 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8467 *libc.$so.[0-9]*) dflt=$majonly ;;
8468 *) dflt=libperl.$so ;;
8478 I need to select a good name for the shared libperl. If your system uses
8479 library names with major and minor numbers, then you might want something
8480 like $majmin. Alternatively, if your system uses a single version
8481 number for shared libraries, then you might want to use $majonly.
8482 Or, your system might be quite happy with a simple libperl.$so.
8484 Since the shared libperl will get installed into a version-specific
8485 architecture-dependent directory, the version number of the shared perl
8486 library probably isn't important, so the default should be o.k.
8489 rp='What name do you want to give to the shared libperl?'
8492 echo "Ok, I'll use $libperl"
8495 libperl="libperl${_a}"
8499 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8503 WARNING: Use of the shrpdir variable for the installation location of
8504 the shared $libperl is not supported. It was never documented and
8505 will not work in this version. Let me (perlbug@perl.org)
8506 know of any problems this may cause.
8512 But your current setting of $shrpdir is
8513 the default anyway, so it's harmless.
8518 Further, your current attempted setting of $shrpdir
8519 conflicts with the value of $archlibexp/CORE
8520 that installperl will use.
8527 # How will the perl executable find the installed shared $libperl?
8528 # Add $xxx to ccdlflags.
8529 # If we can't figure out a command-line option, use $shrpenv to
8530 # set env LD_RUN_PATH. The main perl makefile uses this.
8531 shrpdir=$archlibexp/CORE
8534 if "$useshrplib"; then
8537 # We'll set it in Makefile.SH...
8542 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8543 xxx="-Wl,-R$shrpdir"
8545 bsdos|linux|irix*|dec_osf|gnu*)
8546 xxx="-Wl,-rpath,$shrpdir"
8549 # next doesn't like the default...
8552 # Haiku doesn't like the default, either.
8555 # hpux doesn't like the default, either.
8556 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8559 # cygwin needs only ldlibpth
8562 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8568 # Only add $xxx if it isn't already in ccdlflags.
8569 case " $ccdlflags " in
8571 *) ccdlflags="$ccdlflags $xxx"
8574 Adding $xxx to the flags
8575 passed to $ld so that the perl executable will find the
8576 installed shared $libperl.
8584 # Fix ccdlflags in AIX for building external extensions.
8585 # (For building Perl itself bare -bE:perl.exp is needed,
8586 # Makefile.SH takes care of this.)
8588 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8590 # Respect a hint or command-line value.
8592 '') shrpenv="$tmp_shrpenv" ;;
8594 case "$ldlibpthname" in
8595 '') ldlibpthname=LD_LIBRARY_PATH ;;
8596 none) ldlibpthname='' ;;
8599 : determine where manual pages are on this system
8603 syspath='/usr/share/man/man1 /usr/man/man1'
8604 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8605 syspath="$syspath /usr/man/u_man/man1"
8606 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8607 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8608 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8609 sysman=`./loc . /usr/man/man1 $syspath`
8612 if $test -d "$sysman"; then
8613 echo "System manual is in $sysman." >&4
8615 echo "Could not find manual pages in source form." >&4
8618 : determine where manual pages go
8619 set man1dir man1dir none
8623 $spackage has manual pages available in source form.
8627 echo "However, you don't have nroff, so they're probably useless to you."
8629 '') man1dir="none";;
8632 echo "If you don't want the manual sources installed, answer 'none'."
8637 lookpath="$prefixexp/share/man/man1"
8638 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8639 lookpath="$lookpath $prefixexp/man/p_man/man1"
8640 lookpath="$lookpath $prefixexp/man/u_man/man1"
8641 lookpath="$lookpath $prefixexp/man/man.1"
8643 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8644 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8654 rp="Where do the main $spackage manual pages (source) go?"
8656 if $test "X$man1direxp" != "X$ansexp"; then
8667 : What suffix to use on installed man pages
8674 rp="What suffix should be used for the main $spackage man pages?"
8676 '') case "$man1dir" in
8690 *) dflt="$man1ext";;
8697 : see if we can have long filenames
8699 first=123456789abcdef
8701 if (echo hi >$first) 2>/dev/null; then
8702 if $test -f 123456789abcde; then
8703 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8706 echo 'You can have filenames longer than 14 characters.'>&4
8711 You can't have filenames longer than 14 chars.
8712 You can't even think about them!
8718 $rm -rf 123456789abcde*
8720 : determine where library module manual pages go
8721 set man3dir man3dir none
8725 $spackage has manual pages for many of the library modules.
8731 However, you don't have nroff, so they're probably useless to you.
8734 '') man3dir="none";;
8738 case "$d_flexfnam" in
8741 However, your system can't handle the long file names like File::Basename.3.
8744 '') man3dir="none";;
8748 echo "If you don't want the manual sources installed, answer 'none'."
8749 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8751 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8752 if $test -d "$privlib/man/man3"; then
8755 WARNING: Previous versions of perl installed man3 pages into
8756 $privlib/man/man3. This version will suggest a
8757 new default of $dflt.
8761 rp='Do you wish to preserve the old behavior?(y/n)'
8764 y*) dflt="$privlib/man/man3" ;;
8769 *) dflt="$man3dir" ;;
8776 rp="Where do the $package library man pages (source) go?"
8786 : What suffix to use on installed man pages
8792 rp="What suffix should be used for the $package library man pages?"
8794 '') case "$man3dir" in
8808 *) dflt="$man3ext";;
8815 : see if we have to deal with yellow pages, now NIS.
8816 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8817 if $test -f /usr/etc/nibindd; then
8819 echo "I'm fairly confident you're on a NeXT."
8821 rp='Do you get the hosts file via NetInfo?'
8830 y*) hostcat='nidump hosts .';;
8831 *) case "$hostcat" in
8832 nidump*) hostcat='';;
8842 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8850 rp='Are you getting the hosts file via yellow pages?'
8853 y*) hostcat='ypcat hosts';;
8854 *) hostcat='cat /etc/hosts';;
8860 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8863 '') test -f /etc/group && groupcat='cat /etc/group';;
8866 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8869 : now get the host name
8871 echo "Figuring out host name..." >&4
8872 case "$myhostname" in
8874 echo 'Maybe "hostname" will work...'
8875 if tans=`sh -c hostname 2>&1` ; then
8883 if $test "$cont"; then
8885 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8886 if tans=`cat /etc/systemid 2>&1` ; then
8888 phostname='cat /etc/systemid'
8889 echo "Whadyaknow. Xenix always was a bit strange..."
8892 elif $test -r /etc/systemid; then
8893 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8896 if $test "$cont"; then
8897 echo 'No, maybe "uuname -l" will work...'
8898 if tans=`sh -c 'uuname -l' 2>&1` ; then
8900 phostname='uuname -l'
8902 echo 'Strange. Maybe "uname -n" will work...'
8903 if tans=`sh -c 'uname -n' 2>&1` ; then
8905 phostname='uname -n'
8907 echo 'Oh well, maybe I can mine it out of whoami.h...'
8908 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8909 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8910 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8912 case "$myhostname" in
8913 '') echo "Does this machine have an identity crisis or something?"
8916 echo "Well, you said $myhostname before..."
8917 phostname='echo $myhostname';;
8923 case "$myhostname" in
8924 '') myhostname=noname ;;
8926 : you do not want to know about this
8931 if $test "$myhostname" ; then
8933 rp='Your host name appears to be "'$myhostname'".'" Right?"
8941 : bad guess or no guess
8942 while $test "X$myhostname" = X ; do
8944 rp="Please type the (one word) name of your host:"
8949 : translate upper to lower if necessary
8950 case "$myhostname" in
8952 echo "(Normalizing case in your host name)"
8953 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8957 case "$myhostname" in
8959 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8960 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8961 echo "(Trimming domain name from host name--host name is now $myhostname)"
8963 *) case "$mydomain" in
8966 test "X$hostcat" = "Xypcat hosts" &&
8967 ypmatch "$myhostname" hosts 2>/dev/null |\
8968 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8971 test "X$hostcat" != "X" &&
8972 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8973 /[ ]$myhostname[ . ]/p" > hosts
8976 if $test -f hosts; then
8977 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8978 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8979 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8980 hosts | $sort | $uniq | \
8981 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8982 case `$echo X$dflt` in
8983 X*\ *) echo "(Several hosts in the database matched hostname)"
8986 X.) echo "(You do not have fully-qualified names in the hosts database)"
8990 echo "(I cannot locate a hosts database anywhere)"
8995 tans=`./loc resolv.conf X /etc /usr/etc`
8996 if $test -f "$tans"; then
8997 echo "(Attempting domain name extraction from $tans)"
8998 dflt=.`$sed -n -e 's/ / /g' \
8999 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9002 .) dflt=.`$sed -n -e 's/ / /g' \
9003 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9011 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9012 dflt=.`sh -c domainname 2>/dev/null`
9015 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9019 case "$dflt$osname" in
9020 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9021 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9025 .) echo "(Lost all hope -- silly guess then)"
9031 *) dflt="$mydomain";;
9035 rp="What is your domain name?"
9045 : translate upper to lower if necessary
9048 echo "(Normalizing case in your domain name)"
9049 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9053 : a little sanity check here
9054 case "$phostname" in
9057 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9058 $myhostname$mydomain|$myhostname) ;;
9060 case "$phostname" in
9062 echo "(That doesn't agree with your whoami.h file, by the way.)"
9065 echo "(That doesn't agree with your $phostname command, by the way.)"
9073 : determine the e-mail address of the user who is running us
9076 I need to get your e-mail address in Internet format if possible, i.e.
9077 something like user@host.domain. Please answer accurately since I have
9078 no easy means to double check it. The default value provided below
9079 is most probably close to reality but may not be valid from outside
9080 your organization...
9084 while test "$cont"; do
9085 case "$MAILDOMAIN" in
9087 if $test -s /etc/mailname; then
9088 maildomain=`$cat /etc/mailname`
9090 maildomain="$myhostname$mydomain"
9093 *) maildomain="$MAILDOMAIN";;
9096 '') dflt="$cf_by@$maildomain";;
9097 *) dflt="$cf_email";;
9099 rp='What is your e-mail address?'
9105 rp='Address does not look like an Internet one. Use it anyway?'
9119 : Ask e-mail of administrator
9122 If you or somebody else will be maintaining perl at your site, please
9123 fill in the correct e-mail address here so that they may be contacted
9124 if necessary. Currently, the "perlbug" program included with perl
9125 will send mail to this address in addition to perlbug@perl.org. You may
9126 enter "none" for no administrator.
9129 case "$perladmin" in
9130 '') dflt="$cf_email";;
9131 *) dflt="$perladmin";;
9133 rp='Perl administrator e-mail address'
9137 : determine whether to only install version-specific parts.
9140 Do you want to install only the version-specific parts of the perl
9141 distribution? Usually you do *not* want to do this.
9143 case "$versiononly" in
9144 "$define"|[Yy]*|true) dflt='y' ;;
9147 rp="Do you want to install only the version-specific parts of perl?"
9150 [yY]*) val="$define";;
9156 case "$versiononly" in
9157 "$define") inc_version_list=''
9158 inc_version_list_init=0
9162 : figure out how to guarantee perl startup
9163 : XXX Note that this currently takes advantage of the bug that binexp ignores
9164 : the Configure -Dinstallprefix setting, which in turn means that under
9165 : relocatable @INC, initialinstalllocation is what binexp started as.
9166 case "$startperl" in
9168 case "$sharpbang" in
9172 I can use the #! construct to start perl on your system. This will
9173 make startup of perl scripts faster, but may cause problems if you
9174 want to share those scripts and perl is not in a standard place
9175 ($initialinstalllocation/perl) on all your platforms. The alternative
9176 is to force a shell by starting the script with a single ':' character.
9179 case "$versiononly" in
9180 "$define") dflt="$initialinstalllocation/perl$version";;
9181 *) dflt="$initialinstalllocation/perl";;
9183 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9186 none) startperl=": # use perl";;
9187 *) startperl="#!$ans"
9188 if $test 30 -lt `echo "$ans" | wc -c`; then
9191 WARNING: Some systems limit the #! command to 32 characters.
9192 If you experience difficulty running Perl scripts with #!, try
9193 installing Perl in a directory with a shorter pathname.
9199 *) startperl=": # use perl"
9204 echo "I'll use $startperl to start perl scripts."
9206 : figure best path for perl in scripts
9209 case "$versiononly" in
9210 "$define") perlpath="$initialinstalllocation/perl$version";;
9211 *) perlpath="$initialinstalllocation/perl";;
9213 case "$startperl" in
9218 I will use the "eval 'exec'" idiom to start Perl on your system.
9219 I can use the full path of your Perl binary for this purpose, but
9220 doing so may cause problems if you want to share those scripts and
9221 Perl is not always in a standard place ($initialinstalllocation/perl).
9224 dflt="$initialinstalllocation/perl"
9225 rp="What path shall I use in \"eval 'exec'\"?"
9232 case "$startperl" in
9234 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9237 : determine where public executable scripts go
9238 set scriptdir scriptdir
9240 case "$scriptdir" in
9243 : guess some guesses
9244 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9245 $test -d /usr/share/bin && dflt=/usr/share/bin
9246 $test -d /usr/local/script && dflt=/usr/local/script
9247 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9248 $test -d $prefixexp/script && dflt=$prefixexp/script
9252 *) dflt="$scriptdir"
9257 Some installations have a separate directory just for executable scripts so
9258 that they can mount it across multiple architectures but keep the scripts in
9259 one spot. You might, for example, have a subdirectory of /usr/share for this.
9260 Or you might just lump your scripts in with all your other executables.
9264 rp='Where do you keep publicly executable scripts?'
9266 if $test "X$ansexp" != "X$scriptdirexp"; then
9272 : A little fix up for an irregularly named variable.
9273 installscript="$installscriptdir"
9275 : determine where add-on public executables go
9277 '') dflt=$siteprefix/bin ;;
9281 rp='Pathname where the add-on public executables should be installed?'
9286 : determine where add-on html pages go
9287 : There is no standard location, so try to copy the previously-selected
9288 : directory structure for the core html pages.
9289 case "$sitehtml1dir" in
9290 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9291 *) dflt=$sitehtml1dir ;;
9294 ''|' ') dflt=none ;;
9297 rp='Pathname where the site-specific html pages should be installed?'
9299 prefixvar=sitehtml1dir
9302 : determine where add-on library html pages go
9303 : There is no standard location, so try to copy the previously-selected
9304 : directory structure for the core html pages.
9305 case "$sitehtml3dir" in
9306 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9307 *) dflt=$sitehtml3dir ;;
9310 ''|' ') dflt=none ;;
9313 rp='Pathname where the site-specific library html pages should be installed?'
9315 prefixvar=sitehtml3dir
9318 : determine where add-on manual pages go
9319 case "$siteman1dir" in
9320 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9321 *) dflt=$siteman1dir ;;
9324 ''|' ') dflt=none ;;
9327 rp='Pathname where the site-specific manual pages should be installed?'
9329 prefixvar=siteman1dir
9332 : determine where add-on library man pages go
9333 case "$siteman3dir" in
9334 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9335 *) dflt=$siteman3dir ;;
9338 ''|' ') dflt=none ;;
9341 rp='Pathname where the site-specific library manual pages should be installed?'
9343 prefixvar=siteman3dir
9346 : determine where add-on public executable scripts go
9347 case "$sitescript" in
9348 '') dflt=$siteprefix/script
9349 $test -d $dflt || dflt=$sitebin ;;
9350 *) dflt="$sitescript" ;;
9353 rp='Pathname where add-on public executable scripts should be installed?'
9355 prefixvar=sitescript
9358 : Check if faststdio is requested and available
9359 case "$usefaststdio" in
9360 $define|true|[yY]*|'')
9361 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9371 Perl can be built to use 'fast stdio', which means using the stdio
9372 library but also directly manipulating the stdio buffers to enable
9373 faster I/O. Using stdio is better for backward compatibility (especially
9374 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9375 interface has been preferred instead of stdio.
9377 If this doesn't make any sense to you, just accept the default '$dflt'.
9379 rp='Use the "fast stdio" if available?'
9382 y|Y) val="$define" ;;
9389 : define an is-a-typedef? function
9390 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9392 "") inclist="sys/types.h";;
9394 eval "varval=\$$var";
9398 for inc in $inclist; do
9399 echo "#include <$inc>" >>temp.c;
9401 echo "#ifdef $type" >> temp.c;
9402 echo "printf(\"We have $type\");" >> temp.c;
9403 echo "#endif" >> temp.c;
9404 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9405 if $contains $type temp.E >/dev/null 2>&1; then
9411 *) eval "$var=\$varval";;
9414 : define an is-a-typedef? function that prompts if the type is not available.
9415 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9417 "") inclist="sys/types.h";;
9419 eval "varval=\$$var";
9423 for inc in $inclist; do
9424 echo "#include <$inc>" >>temp.c;
9426 echo "#ifdef $type" >> temp.c;
9427 echo "printf(\"We have $type\");" >> temp.c;
9428 echo "#endif" >> temp.c;
9429 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9431 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9432 if $contains $type temp.E >/dev/null 2>&1; then
9433 echo "$type found." >&4;
9436 echo "$type NOT found." >&4;
9442 *) eval "$var=\$varval";;
9445 : see what type lseek is declared as in the kernel
9446 rp="What is the type used for lseek's offset on this system?"
9447 set off_t lseektype long stdio.h sys/types.h
9451 echo "Checking to see how big your file offsets are..." >&4
9453 #include <sys/types.h>
9457 printf("%d\n", (int)sizeof($lseektype));
9462 if eval $compile_ok; then
9463 lseeksize=`$run ./try`
9464 echo "Your file offsets are $lseeksize bytes long."
9468 echo "(I can't seem to compile the test program. Guessing...)"
9469 rp="What is the size of your file offsets (in bytes)?"
9475 : see what type file positions are declared as in the library
9476 rp="What is the type for file position used by fsetpos()?"
9477 set fpos_t fpostype long stdio.h sys/types.h
9480 : Check size for Fpos_t
9483 *_t) zzz="$fpostype" ;;
9486 echo "Checking the size of $zzz..." >&4
9488 #include <sys/types.h>
9495 printf("%d\n", (int)sizeof($fpostype));
9500 if eval $compile_ok; then
9504 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9507 echo "Your $zzz is $fpossize bytes long."
9513 echo "(I can't compile the test program. Guessing...)" >&4
9514 rp="What is the size of your file positions (in bytes)?"
9519 : Check for large file support
9520 # Backward compatibility (uselfs is deprecated).
9522 "$define"|true|[yY]*)
9525 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9527 uselargefiles="$define"
9531 case "$lseeksize:$fpossize" in
9534 You can have files larger than 2 gigabytes.
9537 *) case "$uselargefiles" in
9538 "$undef"|false|[nN]*) dflt='n' ;;
9543 Perl can be built to understand large files (files larger than 2 gigabytes)
9544 on some systems. To do so, Configure can be run with -Duselargefiles.
9546 If this doesn't make any sense to you, just accept the default '$dflt'.
9548 rp='Try to understand large files, if available?'
9551 y|Y) val="$define" ;;
9558 : Look for a hint-file generated 'call-back-unit'. If the
9559 : user has specified that a large files perl is to be built,
9560 : we may need to set or change some other defaults.
9561 if $test -f uselargefiles.cbu; then
9562 echo "Your platform has some specific hints regarding large file builds, using them..."
9563 . ./uselargefiles.cbu
9565 case "$uselargefiles" in
9567 if $test -f uselargefiles.cbu; then
9569 echo "Rechecking to see how big your file offsets are..." >&4
9571 #include <sys/types.h>
9575 printf("%d\n", (int)sizeof($lseektype));
9580 if eval $compile_ok; then
9581 lseeksize=`$run ./try`
9582 $echo "Your file offsets are now $lseeksize bytes long."
9586 echo "(I can't seem to compile the test program. Guessing...)"
9587 rp="What is the size of your file offsets (in bytes)?"
9592 *_t) zzz="$fpostype" ;;
9595 $echo $n "Rechecking the size of $zzz...$c" >&4
9597 #include <sys/types.h>
9604 printf("%d\n", (int)sizeof($fpostype));
9609 if eval $compile_ok; then
9614 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9617 echo " $fpossize bytes." >&4
9623 echo "(I can't compile the test program. Guessing...)" >&4
9624 rp="What is the size of your file positions (in bytes)?"
9633 : Check if we want perlio
9636 : Set the vendorbin variables
9637 case "$vendorprefix" in
9638 '') d_vendorbin="$undef"
9642 *) d_vendorbin="$define"
9643 : determine where vendor-supplied executables go.
9644 case "$vendorbin" in
9645 '') dflt=$vendorprefix/bin ;;
9646 *) dflt="$vendorbin" ;;
9649 rp='Pathname for the vendor-supplied executables directory?'
9652 vendorbinexp="$ansexp"
9658 : Set the vendorhtml1dir variables
9659 case "$vendorprefix" in
9660 '') vendorhtml1dir=''
9661 vendorhtml1direxp=''
9663 *) : determine where vendor-supplied html pages go.
9664 : There is no standard location, so try to copy the previously-selected
9665 : directory structure for the core html pages.
9666 : XXX Better default suggestions would be welcome.
9667 case "$vendorhtml1dir" in
9668 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9669 *) dflt=$vendorhtml1dir ;;
9672 ''|' ') dflt=none ;;
9675 rp='Pathname for the vendor-supplied html pages?'
9677 vendorhtml1dir="$ans"
9678 vendorhtml1direxp="$ansexp"
9681 : Use ' ' for none so value is preserved next time through Configure
9682 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9683 prefixvar=vendorhtml1dir
9686 : Set the vendorhtml3dir variables
9687 case "$vendorprefix" in
9688 '') vendorhtml3dir=''
9689 vendorhtml3direxp=''
9691 *) : determine where vendor-supplied module html pages go.
9692 : There is no standard location, so try to copy the previously-selected
9693 : directory structure for the core html pages.
9694 : XXX Better default suggestions would be welcome.
9695 case "$vendorhtml3dir" in
9696 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9697 *) dflt=$vendorhtml3dir ;;
9700 ''|' ') dflt=none ;;
9703 rp='Pathname for the vendor-supplied html pages?'
9705 vendorhtml3dir="$ans"
9706 vendorhtml3direxp="$ansexp"
9709 : Use ' ' for none so value is preserved next time through Configure
9710 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9711 prefixvar=vendorhtml3dir
9714 : Set the vendorman1dir variables
9715 case "$vendorprefix" in
9716 '') vendorman1dir=''
9719 *) : determine where vendor-supplied manual pages go.
9720 case "$vendorman1dir" in
9721 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9722 *) dflt=$vendorman1dir ;;
9725 ''|' ') dflt=none ;;
9728 rp='Pathname for the vendor-supplied manual section 1 pages?'
9730 vendorman1dir="$ans"
9731 vendorman1direxp="$ansexp"
9734 : Use ' ' for none so value is preserved next time through Configure
9735 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9736 prefixvar=vendorman1dir
9739 : Set the vendorman3dir variables
9740 case "$vendorprefix" in
9741 '') vendorman3dir=''
9744 *) : determine where vendor-supplied module manual pages go.
9745 case "$vendorman3dir" in
9746 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9747 *) dflt=$vendorman3dir ;;
9750 ''|' ') dflt=none ;;
9753 rp='Pathname for the vendor-supplied manual section 3 pages?'
9755 vendorman3dir="$ans"
9756 vendorman3direxp="$ansexp"
9759 : Use ' ' for none so value is preserved next time through Configure
9760 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9761 prefixvar=vendorman3dir
9764 : Set the vendorscript variables
9765 case "$vendorprefix" in
9766 '') d_vendorscript="$undef"
9770 *) d_vendorscript="$define"
9771 : determine where vendor-supplied scripts go.
9772 case "$vendorscript" in
9773 '') dflt=$vendorprefix/script
9774 $test -d $dflt || dflt=$vendorbin ;;
9775 *) dflt="$vendorscript" ;;
9779 The installation process will create a directory for
9780 vendor-supplied scripts.
9784 rp='Pathname for the vendor-supplied scripts directory?'
9787 vendorscriptexp="$ansexp"
9790 prefixvar=vendorscript
9793 : script used to emit important warnings
9796 if test \$# -gt 0; then
9801 echo "*** WARNING:" >&4
9802 sed -e 's/^/*** /' <msg >&4
9804 cat msg >>config.msg
9805 echo " " >>config.msg
9811 : see which of string.h or strings.h is needed
9813 strings=`./findhdr string.h`
9814 if $test "$strings" && $test -r "$strings"; then
9815 echo "Using <string.h> instead of <strings.h>." >&4
9819 strings=`./findhdr strings.h`
9820 if $test "$strings" && $test -r "$strings"; then
9821 echo "Using <strings.h> instead of <string.h>." >&4
9823 ./warn "No string header found -- You'll surely have problems."
9829 "$undef") strings=`./findhdr strings.h`;;
9830 *) strings=`./findhdr string.h`;;
9833 : see if qgcvt exists
9837 : Check print/scan long double stuff
9840 if $test X"$d_longdbl" = X"$define"; then
9842 echo "Checking how to print long doubles..." >&4
9844 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9845 $cat >try.c <<'EOCP'
9846 #include <sys/types.h>
9850 printf("%.3f\n", d);
9854 if eval $compile; then
9858 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9859 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9860 echo "We will use %f."
9866 if $test X"$sPRIfldbl" = X; then
9867 $cat >try.c <<'EOCP'
9868 #include <sys/types.h>
9871 long double d = 123.456;
9872 printf("%.3Lf\n", d);
9876 if eval $compile; then
9880 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9881 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9882 echo "We will use %Lf."
9888 if $test X"$sPRIfldbl" = X; then
9889 $cat >try.c <<'EOCP'
9890 #include <sys/types.h>
9893 long double d = 123.456;
9894 printf("%.3llf\n", d);
9898 if eval $compile; then
9902 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9903 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9904 echo "We will use %llf."
9910 if $test X"$sPRIfldbl" = X; then
9911 $cat >try.c <<'EOCP'
9912 #include <sys/types.h>
9915 long double d = 123.456;
9916 printf("%.3lf\n", d);
9920 if eval $compile; then
9924 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9925 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9926 echo "We will use %lf."
9932 if $test X"$sPRIfldbl" = X; then
9933 echo "Cannot figure out how to print long doubles." >&4
9935 sSCNfldbl=$sPRIfldbl # expect consistency
9942 case "$sPRIfldbl" in
9943 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9944 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9945 d_SCNfldbl="$undef";
9947 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9948 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9949 d_SCNfldbl="$define";
9953 : Check how to convert floats to strings.
9955 if test "X$d_Gconvert" = X; then
9958 echo "Checking for an efficient way to convert floats to strings."
9960 case "$uselongdouble" in
9961 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9963 case "$d_longdbl" in
9964 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9966 case "$d_PRIgldbl" in
9967 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9971 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9972 char *myname = "gconvert";
9975 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9976 char *myname = "gcvt";
9979 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9980 char *myname = "qgcvt";
9981 #define DOUBLETYPE long double
9984 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9986 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9988 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9991 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9993 char *myname = "sprintf";
9997 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9998 #define DOUBLETYPE long double
10000 #define DOUBLETYPE double
10006 #$i_stdlib I_STDLIB
10008 #include <stdlib.h>
10010 #$i_string I_STRING
10012 # include <string.h>
10014 # include <strings.h>
10017 int checkit(char *expect, char *got)
10019 if (strcmp(expect, got)) {
10020 printf("%s oddity: Expected %s, got %s\n",
10021 myname, expect, got);
10031 /* This must be 1st test on (which?) platform */
10032 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10033 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10034 checkit("0.1", buf);
10036 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10037 checkit("0.01", buf);
10039 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10040 checkit("0.001", buf);
10042 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10043 checkit("0.0001", buf);
10045 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10046 if (strlen(buf) > 5)
10047 checkit("9e-005", buf); /* for Microsoft ?? */
10049 checkit("9e-05", buf);
10051 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10054 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10055 checkit("1.1", buf);
10057 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10058 checkit("1.01", buf);
10060 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10061 checkit("1.001", buf);
10063 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10064 checkit("1.0001", buf);
10066 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10067 checkit("1.00001", buf);
10069 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10070 checkit("1.000001", buf);
10072 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10075 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10076 checkit("-1", buf);
10078 /* Some Linux gcvt's give 1.e+5 here. */
10079 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10080 checkit("100000", buf);
10082 /* Some Linux gcvt's give -1.e+5 here. */
10083 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10084 checkit("-100000", buf);
10086 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10087 checkit("123.456", buf);
10089 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10090 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10091 /* 34 should be enough to scare even long double
10092 * places into using the e notation. */
10093 if (strlen(buf) > 5)
10094 checkit("1e+034", buf); /* for Microsoft */
10096 checkit("1e+34", buf);
10098 /* For Perl, if you add additional tests here, also add them to
10099 * t/base/num.t for benefit of platforms not using Configure or
10100 * overriding d_Gconvert */
10105 : first add preferred functions to our list
10107 for xxx_convert in $gconvert_preference; do
10108 case $xxx_convert in
10109 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10110 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10113 : then add any others
10114 for xxx_convert in gconvert gcvt sprintf; do
10115 case "$xxx_list" in
10117 *) xxx_list="$xxx_list $xxx_convert" ;;
10121 case "$d_longdbl$uselongdouble" in
10123 : again, add preferred functions to our list first
10125 for xxx_convert in $gconvert_ld_preference; do
10126 case $xxx_convert in
10127 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10128 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10131 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10132 for xxx_convert in qgcvt sprintf $xxx_list; do
10133 case "$xxx_ld_list" in
10134 $xxx_convert*|*" $xxx_convert"*) ;;
10135 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10138 : if sprintf cannot do long doubles, move it to the end
10139 if test "$d_PRIgldbl" != "$define"; then
10140 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10142 : if no qgcvt, remove it
10143 if test "$d_qgcvt" != "$define"; then
10144 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10147 xxx_list="$xxx_ld_list"
10151 for xxx_convert in $xxx_list; do
10152 echo "Trying $xxx_convert..."
10153 $rm -f try try$_o core
10154 set try -DTRY_$xxx_convert
10155 if eval $compile; then
10156 echo "$xxx_convert() found." >&4
10157 if $run ./try; then
10158 echo "I'll use $xxx_convert to convert floats into a string." >&4
10161 echo "...But $xxx_convert didn't work as I expected."
10165 echo "$xxx_convert NOT found." >&4
10169 if test X$xxx_convert = X; then
10170 echo "*** WHOA THERE!!! ***" >&4
10171 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10172 xxx_convert=sprintf
10175 case "$xxx_convert" in
10176 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10177 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10178 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10179 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10180 "$define$define$define")
10181 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10182 "$define$define$undef")
10183 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10184 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10192 : see if _fwalk exists
10196 : Initialize h_fcntl
10199 : Initialize h_sysfile
10202 : access call always available on UNIX
10203 set access d_access
10206 : locate the flags for 'access()'
10207 case "$d_access" in
10210 $cat >access.c <<EOCP
10211 #include <sys/types.h>
10216 #include <sys/file.h>
10219 #include <unistd.h>
10221 #$i_stdlib I_STDLIB
10223 #include <stdlib.h>
10229 : check sys/file.h first, no particular reason here
10230 if $test `./findhdr sys/file.h` && \
10231 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10233 echo "<sys/file.h> defines the *_OK access constants." >&4
10234 elif $test `./findhdr fcntl.h` && \
10235 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10237 echo "<fcntl.h> defines the *_OK access constants." >&4
10238 elif $test `./findhdr unistd.h` && \
10239 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10240 echo "<unistd.h> defines the *_OK access constants." >&4
10242 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10248 : see if accessx exists
10249 set accessx d_accessx
10252 : see if aintl exists
10256 : see if alarm exists
10260 : see if 64bit time functions exists
10262 set ctime64 d_ctime64
10265 set localtime64 d_localtime64
10268 set gmtime64 d_gmtime64
10271 set mktime64 d_mktime64
10274 set difftime64 d_difftime64
10277 set asctime64 d_asctime64
10280 : see if POSIX threads are available
10281 set pthread.h i_pthread
10284 : define a function to check prototypes
10285 $cat > protochk <<EOSH
10288 optimize="$optimize"
10290 prototype="$prototype"
10293 usethreads=$usethreads
10294 i_pthread=$i_pthread
10295 pthread_h_first=$pthread_h_first
10298 $cat >> protochk <<'EOSH'
10303 while test $# -ge 2; do
10305 $define) echo "#include <$2>" >> try.c ;;
10306 literal) echo "$2" >> try.c ;;
10308 # Extra magic for the benefit of systems that need pthread.h
10309 # to be included early to correctly detect threadsafe functions.
10310 # Such functions must guarantee themselves, though, that the usethreads
10311 # and i_pthread have been defined, before calling protochk.
10312 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10313 echo "#include <pthread.h>" >> try.c
10318 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10319 cat >> try.c <<'EOCP'
10320 #ifdef CAN_PROTOTYPE
10321 #define _(args) args
10326 echo "$foo" >> try.c
10327 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10328 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10334 $eunicefix protochk
10336 : Define hasproto macro for Configure internal use
10337 hasproto='varname=$1; func=$2; shift; shift;
10338 while $test $# -ge 2; do
10340 $define) echo "#include <$2>";;
10344 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10345 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10346 echo "$func() prototype found.";
10349 echo "$func() prototype NOT found.";
10356 : see if sys/types.h has to be included
10357 set sys/types.h i_systypes
10360 : see if sys/select.h has to be included
10361 set sys/select.h i_sysselct
10364 : Define hasfield macro for Configure internal use
10365 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10366 while $test $# -ge 2; do
10368 $define) echo "#include <$2>";;
10372 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10374 if eval $compile; then
10383 : see if we should include time.h, sys/time.h, or both
10385 if test "X$timeincl" = X; then
10386 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10387 $echo $n "I'm now running the test program...$c"
10389 #include <sys/types.h>
10394 #ifdef SYSTIMEKERNEL
10397 #include <sys/time.h>
10400 #include <sys/select.h>
10402 #$i_stdlib I_STDLIB
10404 #include <stdlib.h>
10410 struct timeval bar;
10413 struct timezone tzp;
10415 if (foo.tm_sec == foo.tm_sec)
10418 if (bar.tv_sec == bar.tv_sec)
10425 for s_timezone in '-DS_TIMEZONE' ''; do
10427 for s_timeval in '-DS_TIMEVAL' ''; do
10428 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10429 for i_time in '' '-DI_TIME'; do
10430 for i_systime in '-DI_SYSTIME' ''; do
10433 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10434 if eval $compile; then
10435 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10439 $echo $n "Succeeded with $flags$c"
10451 *SYSTIMEKERNEL*) i_systimek="$define"
10452 timeincl=`./findhdr sys/time.h`
10453 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10454 *) i_systimek="$undef";;
10457 *I_TIME*) i_time="$define"
10458 timeincl=`./findhdr time.h`" $timeincl"
10459 echo "We'll include <time.h>." >&4;;
10460 *) i_time="$undef";;
10463 *I_SYSTIME*) i_systime="$define"
10464 timeincl=`./findhdr sys/time.h`" $timeincl"
10465 echo "We'll include <sys/time.h>." >&4;;
10466 *) i_systime="$undef";;
10470 : see if struct tm knows about tm_zone
10471 case "$i_systime$i_time" in
10474 echo "Checking to see if your struct tm has tm_zone field..." >&4
10475 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10483 case "$d_tm_tm_zone" in
10484 "$define") echo "Yes, it does." ;;
10485 *) echo "No, it doesn't." ;;
10487 : see if struct tm knows about tm_gmtoff
10488 case "$i_systime$i_time" in
10491 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10492 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10500 case "$d_tm_tm_gmtoff" in
10501 "$define") echo "Yes, it does." ;;
10502 *) echo "No, it doesn't." ;;
10505 : see if asctime_r exists
10506 set asctime_r d_asctime_r
10508 case "$d_asctime_r" in
10510 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10511 case "$d_asctime_r_proto:$usethreads" in
10512 ":define") d_asctime_r_proto=define
10513 set d_asctime_r_proto asctime_r $hdrs
10517 case "$d_asctime_r_proto" in
10519 case "$asctime_r_proto" in
10520 ''|0) try='char* asctime_r(const struct tm*, char*);'
10521 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10523 case "$asctime_r_proto" in
10524 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10525 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10527 case "$asctime_r_proto" in
10528 ''|0) try='int asctime_r(const struct tm*, char*);'
10529 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10531 case "$asctime_r_proto" in
10532 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10533 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10535 case "$asctime_r_proto" in
10536 ''|0) d_asctime_r=undef
10538 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10539 * ) case "$asctime_r_proto" in
10540 REENTRANT_PROTO*) ;;
10541 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10543 echo "Prototype: $try" ;;
10546 *) case "$usethreads" in
10547 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10554 *) asctime_r_proto=0
10558 : see if atolf exists
10562 : see if atoll exists
10566 : Look for GCC-style attribute format
10567 case "$d_attribute_format" in
10570 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10571 $cat >attrib.c <<'EOCP'
10573 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10575 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10576 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10577 echo "Your C compiler doesn't support __attribute__((format))."
10580 echo "Your C compiler supports __attribute__((format))."
10584 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10588 *) val="$d_attribute_format" ;;
10590 set d_attribute_format
10594 : Look for GCC-style attribute format with null format allowed
10595 case "$d_printf_format_null" in
10596 '') case "$d_attribute_format" in
10599 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10600 $cat >attrib.c <<EOCP
10602 #$i_stdlib I_STDLIB
10604 #include <stdlib.h>
10606 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10607 int null_printf (char* pat,...) { return (int)pat; }
10608 int main () { exit(null_printf(NULL)); }
10610 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10611 : run the executable in case it produces a run-time warning
10612 if $run ./attrib >>attrib.out 2>&1; then
10613 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10614 echo "Your C compiler doesn't allow __printf__ format to be null."
10617 echo "Your C compiler allows __printf__ format to be null."
10621 echo "Your C compiler executable failed with __printf__ format null."
10625 echo "Your C compiler fails with __printf__ format null."
10632 *) val="$d_printf_format_null" ;;
10634 set d_printf_format_null
10638 : Look for GCC-style attribute malloc
10639 case "$d_attribute_malloc" in
10642 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10643 $cat >attrib.c <<'EOCP'
10645 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10647 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10648 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10649 echo "Your C compiler doesn't support __attribute__((malloc))."
10652 echo "Your C compiler supports __attribute__((malloc))."
10656 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10660 *) val="$d_attribute_malloc" ;;
10662 set d_attribute_malloc
10666 : Look for GCC-style attribute nonnull
10667 case "$d_attribute_nonnull" in
10670 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10671 $cat >attrib.c <<'EOCP'
10673 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10675 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10676 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10677 echo "Your C compiler doesn't support __attribute__((nonnull))."
10680 echo "Your C compiler supports __attribute__((nonnull))."
10684 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10688 *) val="$d_attribute_nonnull" ;;
10690 set d_attribute_nonnull
10694 : Look for GCC-style attribute noreturn
10695 case "$d_attribute_noreturn" in
10698 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10699 $cat >attrib.c <<'EOCP'
10701 void fall_over_dead( void ) __attribute__((noreturn));
10703 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10704 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10705 echo "Your C compiler doesn't support __attribute__((noreturn))."
10708 echo "Your C compiler supports __attribute__((noreturn))."
10712 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10716 *) val="$d_attribute_noreturn" ;;
10718 set d_attribute_noreturn
10722 : Look for GCC-style attribute pure
10723 case "$d_attribute_pure" in
10726 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10727 $cat >attrib.c <<'EOCP'
10729 int square( int n ) __attribute__((pure));
10731 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10732 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10733 echo "Your C compiler doesn't support __attribute__((pure))."
10736 echo "Your C compiler supports __attribute__((pure))."
10740 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10744 *) val="$d_attribute_pure" ;;
10746 set d_attribute_pure
10750 : Look for GCC-style attribute unused
10751 case "$d_attribute_unused" in
10754 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10755 $cat >attrib.c <<'EOCP'
10757 int do_something( int dummy __attribute__((unused)), int n );
10759 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10760 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10761 echo "Your C compiler doesn't support __attribute__((unused))."
10764 echo "Your C compiler supports __attribute__((unused))."
10768 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10772 *) val="$d_attribute_unused" ;;
10774 set d_attribute_unused
10778 : Look for GCC-style attribute deprecated
10779 case "$d_attribute_deprecated" in
10782 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10783 $cat >attrib.c <<'EOCP'
10785 int I_am_deprecated(void) __attribute__((deprecated));
10787 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10788 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10789 echo "Your C compiler doesn't support __attribute__((deprecated))."
10792 echo "Your C compiler supports __attribute__((deprecated))."
10796 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10800 *) val="$d_attribute_deprecated" ;;
10802 set d_attribute_deprecated
10806 : Look for GCC-style attribute warn_unused_result
10807 case "$d_attribute_warn_unused_result" in
10810 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10811 $cat >attrib.c <<'EOCP'
10813 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10815 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10816 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10817 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10820 echo "Your C compiler supports __attribute__((warn_unused_result))."
10824 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10828 *) val="$d_attribute_warn_unused_result" ;;
10830 set d_attribute_warn_unused_result
10834 : see if bcmp exists
10838 : see if bcopy exists
10842 : see if getpgrp exists
10843 set getpgrp d_getpgrp
10846 case "$d_getpgrp" in
10849 echo "Checking to see which flavor of getpgrp is in use..."
10851 #$i_unistd I_UNISTD
10852 #include <sys/types.h>
10854 # include <unistd.h>
10856 #$i_stdlib I_STDLIB
10858 #include <stdlib.h>
10862 if (getuid() == 0) {
10863 printf("(I see you are running Configure as super-user...)\n");
10866 #ifdef TRY_BSD_PGRP
10867 if (getpgrp(1) == 0)
10876 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10877 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10879 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10880 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10883 echo "I can't seem to compile and run the test program."
10885 xxx="a USG one, i.e. you use getpgrp()."
10887 # SVR4 systems can appear rather BSD-ish.
10888 case "$i_unistd" in
10890 xxx="a BSD one, i.e. you use getpgrp(pid)."
10894 xxx="probably a USG one, i.e. you use getpgrp()."
10899 echo "Assuming your getpgrp is $xxx" >&4
10908 : see if setpgrp exists
10909 set setpgrp d_setpgrp
10912 case "$d_setpgrp" in
10915 echo "Checking to see which flavor of setpgrp is in use..."
10917 #$i_unistd I_UNISTD
10918 #include <sys/types.h>
10920 # include <unistd.h>
10922 #$i_stdlib I_STDLIB
10924 #include <stdlib.h>
10928 if (getuid() == 0) {
10929 printf("(I see you are running Configure as super-user...)\n");
10932 #ifdef TRY_BSD_PGRP
10933 if (-1 == setpgrp(1, 1))
10936 if (setpgrp() != -1)
10942 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10943 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10945 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10946 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10949 echo "(I can't seem to compile and run the test program.)"
10951 xxx="a USG one, i.e. you use setpgrp()."
10953 # SVR4 systems can appear rather BSD-ish.
10954 case "$i_unistd" in
10956 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10960 xxx="probably a USG one, i.e. you use setpgrp()."
10965 echo "Assuming your setpgrp is $xxx" >&4
10974 : Look for GCC-style __builtin_choose_expr
10975 case "$d_builtin_choose_expr" in
10978 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10979 $cat >try.c <<'EOCP'
10980 #include <assert.h>
10981 #include <stdlib.h>
10984 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10987 assert( SYRINX(1) == 2112 );
10988 assert( SYRINX(1) != 5150 );
10989 assert( SYRINX(0) == 5150 );
10990 assert( SYRINX(0) != 2112 );
10991 puts( "All good!" );
10997 if eval $compile && $run ./try; then
10998 echo "Your C compiler supports __builtin_choose_expr."
11001 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11005 *) val="$d_builtin_choose_expr" ;;
11008 set d_builtin_choose_expr
11012 : Look for GCC-style __builtin_expect
11013 case "$d_builtin_expect" in
11016 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11017 $cat >try.c <<'EOCP'
11020 if ( __builtin_expect(n, 0) ) n = 1;
11021 /* Remember shell exit code truth is 0, C truth is non-zero */
11026 if eval $compile && $run ./try; then
11027 echo "Your C compiler supports __builtin_expect."
11030 echo "Your C compiler doesn't seem to understand __builtin_expect."
11034 *) val="$d_builtin_expect" ;;
11037 set d_builtin_expect
11041 : see if bzero exists
11045 : see if stdarg is available
11047 if $test `./findhdr stdarg.h`; then
11048 echo "<stdarg.h> found." >&4
11051 echo "<stdarg.h> NOT found." >&4
11055 : see if varargs is available
11057 if $test `./findhdr varargs.h`; then
11058 echo "<varargs.h> found." >&4
11060 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11063 : set up the varargs testing programs
11064 $cat > varargs.c <<EOP
11066 #include <stdarg.h>
11069 #include <varargs.h>
11073 int f(char *p, ...)
11087 p = va_arg(ap, char *);
11093 $cat > varargs <<EOP
11095 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11104 : now check which varargs header should be included
11110 if `./varargs I_STDARG`; then
11112 elif `./varargs I_VARARGS`; then
11117 if `./varargs I_VARARGS`; then
11125 echo "*** WHOA THERE!!! ***" >&4
11126 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11127 case "$knowitall" in
11129 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11133 echo "I could not find the definition for va_dcl... You have problems..." >&4
11134 val="$undef"; set i_stdarg; eval $setvar
11135 val="$undef"; set i_varargs; eval $setvar
11140 case "$i_varhdr" in
11142 val="$define"; set i_stdarg; eval $setvar
11143 val="$undef"; set i_varargs; eval $setvar
11146 val="$undef"; set i_stdarg; eval $setvar
11147 val="$define"; set i_varargs; eval $setvar
11150 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11154 : see if the Compiler supports C99 variadic macros
11155 case "$i_stdarg$i_stdlib" in
11157 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11160 #include <stdarg.h>
11162 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11166 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11172 if eval $compile && $run ./try 2>&1 >/dev/null; then
11173 case "`$run ./try`" in
11175 echo "You have C99 variadic macros." >&4
11176 d_c99_variadic_macros="$define"
11179 echo "You don't have functional C99 variadic macros." >&4
11180 d_c99_variadic_macros="$undef"
11184 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11185 d_c99_variadic_macros="$undef"
11190 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11191 d_c99_variadic_macros="$undef"
11195 : see if signal is declared as pointer to function returning int or void
11197 xxx=`./findhdr signal.h`
11198 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11199 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11200 echo "You have int (*signal())() instead of void." >&4
11202 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11203 echo "You have void (*signal())()." >&4
11205 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11206 echo "You have int (*signal())() instead of void." >&4
11208 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11209 echo "You have void (*signal())()." >&4
11212 case "$d_voidsig" in
11214 echo "I can't determine whether signal handler returns void or int..." >&4
11216 rp="What type does your signal handler return?"
11219 v*) val="$define";;
11223 echo "As you already told me, signal handler returns void." >&4
11226 *) echo "As you already told me, signal handler returns int." >&4
11233 case "$d_voidsig" in
11234 "$define") signal_t="void";;
11235 *) signal_t="int";;
11239 : check for ability to cast large floats to 32-bit ints.
11241 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11242 if $test "$intsize" -ge 4; then
11249 #$i_stdlib I_STDLIB
11251 #include <stdlib.h>
11253 #include <sys/types.h>
11254 #include <signal.h>
11255 $signal_t blech(int s) { exit(3); }
11262 signal(SIGFPE, blech);
11264 /* Don't let compiler optimize the test away. Store the number
11265 in a writable string for gcc to pass to sscanf under HP-UX.
11267 sprintf(str, "2147483647");
11268 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11272 /* x86 processors will probably give 0x8000 0000, which is a
11273 sign change. We don't want that. We want to mimic SPARC
11274 behavior here, which is to preserve the sign and give
11277 if (i32 != ($xxx) f)
11283 if eval $compile_ok; then
11287 echo "(I can't seem to compile the test program--assuming it can't)"
11292 echo "Yup, it can."
11295 echo "Nope, it can't."
11302 : check for ability to cast negative floats to unsigned
11304 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11307 #$i_stdlib I_STDLIB
11309 #include <stdlib.h>
11311 #include <sys/types.h>
11312 #include <signal.h>
11313 $signal_t blech(int s) { exit(7); }
11314 $signal_t blech_in_list(int s) { exit(4); }
11315 unsigned long dummy_long(unsigned long p) { return p; }
11316 unsigned int dummy_int(unsigned int p) { return p; }
11317 unsigned short dummy_short(unsigned short p) { return p; }
11321 unsigned long along;
11323 unsigned short ashort;
11327 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11328 a direct f = -123. assignment. gcc-2.8.0 reportedly
11329 optimized the whole file away
11331 /* Store the number in a writable string for gcc to pass to
11332 sscanf under HP-UX.
11334 sprintf(str, "-123");
11335 sscanf(str, "%lf", &f); /* f = -123.; */
11337 signal(SIGFPE, blech);
11338 along = (unsigned long)f;
11339 aint = (unsigned int)f;
11340 ashort = (unsigned short)f;
11341 if (along != (unsigned long)-123)
11343 if (aint != (unsigned int)-123)
11345 if (ashort != (unsigned short)-123)
11347 sprintf(str, "1073741824.");
11348 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11351 along = (unsigned long)f;
11352 if (along != 0x80000000)
11356 along = (unsigned long)f;
11357 if (along != 0x7fffffff)
11361 along = (unsigned long)f;
11362 if (along != 0x80000001)
11366 signal(SIGFPE, blech_in_list);
11367 sprintf(str, "123.");
11368 sscanf(str, "%lf", &f); /* f = 123.; */
11369 along = dummy_long((unsigned long)f);
11370 aint = dummy_int((unsigned int)f);
11371 ashort = dummy_short((unsigned short)f);
11372 if (along != (unsigned long)123)
11374 if (aint != (unsigned int)123)
11376 if (ashort != (unsigned short)123)
11383 if eval $compile_ok; then
11387 echo "(I can't seem to compile the test program--assuming it can't)"
11390 case "$castflags" in
11392 echo "Yup, it can."
11395 echo "Nope, it can't."
11402 : see if vprintf exists
11404 if set vprintf val -f d_vprintf; eval $csym; $val; then
11405 echo 'vprintf() found.' >&4
11408 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11409 #$i_varargs I_VARARGS
11411 #$i_stdlib I_STDLIB
11412 #$i_unistd I_UNISTD
11415 # include <stdarg.h>
11416 #else /* I_VARARGS */
11417 # include <varargs.h>
11421 # include <unistd.h>
11425 # include <stdlib.h>
11428 #include <stdio.h> /* vsprintf prototype */
11431 void xxx(int n, ...)
11436 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11438 int main() { xxx(1, "foo"); }
11440 #else /* I_VARARGS */
11448 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11450 int main() { xxx("foo"); }
11456 if eval $compile_ok; then
11457 if $run ./try; then
11458 echo "Your vsprintf() returns (int)." >&4
11461 echo "Your vsprintf() returns (char*)." >&4
11465 echo 'I am unable to compile the vsprintf() test program.' >&4
11466 # We shouldn't get here. If we do, assume the standard signature,
11467 # not the old BSD one.
11468 echo 'Guessing that vsprintf() returns (int).' >&4
11472 echo 'vprintf() NOT found.' >&4
11483 : see if chown exists
11487 : see if chroot exists
11488 set chroot d_chroot
11491 : see if chsize exists
11492 set chsize d_chsize
11495 : see if class exists
11499 : see if clearenv exists
11500 set clearenv d_clearenv
11503 : Define hasstruct macro for Configure internal use
11504 hasstruct='varname=$1; struct=$2; shift; shift;
11505 while $test $# -ge 2; do
11507 $define) echo "#include <$2>";;
11511 echo "int main () { struct $struct foo; }" >> try.c;
11513 if eval $compile; then
11522 : see whether socket exists
11526 $echo $n "Hmm... $c" >&4
11527 if set socket val -f d_socket; eval $csym; $val; then
11528 echo "Looks like you have Berkeley networking support." >&4
11530 if set setsockopt val -f; eval $csym; $val; then
11533 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11534 d_oldsock="$define"
11537 if $contains socklib libc.list >/dev/null 2>&1; then
11538 echo "Looks like you have Berkeley networking support." >&4
11540 : we will have to assume that it supports the 4.2 BSD interface
11543 echo "You don't have Berkeley networking in libc$_a..." >&4
11544 if test "X$d_socket" = "X$define"; then
11545 echo "...but you seem to believe that you have sockets." >&4
11547 for net in net socket
11549 if test -f $sysroot/usr/lib/lib$net$_a; then
11550 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11551 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11552 if $contains socket libc.list >/dev/null 2>&1; then
11557 echo "...but the Wollongong group seems to have hacked it in." >&4
11558 sockethdr="-I$sysroot/usr/netinclude"
11561 echo "Found Berkeley sockets interface in lib$net." >&4
11562 if $contains setsockopt libc.list >/dev/null 2>&1; then
11565 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11566 d_oldsock="$define"
11572 if test "X$d_socket" != "X$define"; then
11573 echo "or anywhere else I see." >&4
11581 : see if socketpair exists
11582 set socketpair d_sockpair
11587 echo "Checking the availability sa_len in the sock struct ..." >&4
11589 #include <sys/types.h>
11590 #include <sys/socket.h>
11592 struct sockaddr sa;
11593 return (sa.sa_len);
11597 set try; if eval $compile; then
11600 set d_sockaddr_sa_len; eval $setvar
11604 echo "Checking the availability struct sockaddr_in6 ..." >&4
11606 #include <sys/types.h>
11607 #include <sys/socket.h>
11608 #include <netinet/in.h>
11610 struct sockaddr_in6 sin6;
11611 return (sin6.sin6_family);
11615 set try; if eval $compile; then
11618 set d_sockaddr_in6; eval $setvar
11622 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11624 #include <sys/types.h>
11625 #include <sys/socket.h>
11626 #include <netinet/in.h>
11628 struct sockaddr_in6 sin6;
11629 return (sin6.sin6_scope_id);
11633 set try; if eval $compile; then
11636 set d_sin6_scope_id; eval $setvar
11640 echo "Checking the availability struct ip_mreq ..." >&4
11642 #include <sys/types.h>
11643 #include <sys/socket.h>
11644 #include <netinet/in.h>
11646 struct ip_mreq mreq;
11647 return (mreq.imr_multiaddr.s_addr);
11651 set try; if eval $compile; then
11654 set d_ip_mreq; eval $setvar
11658 echo "Checking the availability struct ip_mreq_source ..." >&4
11660 #include <sys/types.h>
11661 #include <sys/socket.h>
11662 #include <netinet/in.h>
11664 struct ip_mreq_source mreq;
11665 return (mreq.imr_multiaddr.s_addr);
11669 set try; if eval $compile; then
11672 set d_ip_mreq_source; eval $setvar
11676 echo "Checking the availability struct ipv6_mreq ..." >&4
11678 #include <sys/types.h>
11679 #include <sys/socket.h>
11680 #include <netinet/in.h>
11682 struct ipv6_mreq mreq;
11683 return (mreq.ipv6mr_interface);
11687 set try; if eval $compile; then
11690 set d_ipv6_mreq; eval $setvar
11694 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11696 #include <sys/types.h>
11697 #include <sys/socket.h>
11698 #include <netinet/in.h>
11700 struct ipv6_mreq_source mreq;
11701 return (mreq.imr_multiaddr.s_addr);
11705 set try; if eval $compile; then
11708 set d_ipv6_mreq_source; eval $setvar
11712 echo "Checking the availability of certain socket constants..." >&4
11713 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11714 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11716 #include <sys/types.h>
11717 #include <sys/socket.h>
11723 set try; if eval $compile; then
11726 set d_${enum}; eval $setvar
11730 : see if this is a sys/uio.h system
11731 set sys/uio.h i_sysuio
11734 : Check for cmsghdr support
11736 echo "Checking to see if your system supports struct cmsghdr..." >&4
11737 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11739 case "$d_cmsghdr_s" in
11740 "$define") echo "Yes, it does." ;;
11741 *) echo "No, it doesn't." ;;
11745 : check for const keyword
11747 echo 'Checking to see if your C compiler knows about "const"...' >&4
11748 $cat >const.c <<'EOCP'
11749 typedef struct spug { int drokk; } spug;
11753 const spug y = { 0 };
11756 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11758 echo "Yup, it does."
11761 echo "Nope, it doesn't."
11766 : see if copysignl exists
11767 set copysignl d_copysignl
11770 : see if crypt exists
11775 $define) cryptlib='' ;;
11776 *) if set crypt val -f d_crypt; eval $csym; $val; then
11777 echo 'crypt() found.' >&4
11781 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11782 if $test -z "$cryptlib"; then
11783 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11787 if $test -z "$cryptlib"; then
11788 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11792 if $test -z "$cryptlib"; then
11793 cryptlib=`./loc libcrypt$_a "" $libpth`
11797 if $test -z "$cryptlib"; then
11798 echo 'crypt() NOT found.' >&4
11809 : see if this is a crypt.h system
11810 set crypt.h i_crypt
11813 : see if crypt_r exists
11814 set crypt_r d_crypt_r
11816 case "$d_crypt_r" in
11818 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11819 case "$d_crypt_r_proto:$usethreads" in
11820 ":define") d_crypt_r_proto=define
11821 set d_crypt_r_proto crypt_r $hdrs
11825 case "$d_crypt_r_proto" in
11827 case "$crypt_r_proto" in
11828 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11829 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11831 case "$crypt_r_proto" in
11832 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11833 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11835 case "$crypt_r_proto" in
11836 ''|0) d_crypt_r=undef
11838 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11839 * ) case "$crypt_r_proto" in
11840 REENTRANT_PROTO*) ;;
11841 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11843 echo "Prototype: $try" ;;
11846 *) case "$usethreads" in
11847 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11858 : get csh whereabouts
11860 'csh') val="$undef" ;;
11861 *) val="$define" ;;
11865 : Respect a hint or command line value for full_csh.
11866 case "$full_csh" in
11867 '') full_csh=$csh ;;
11870 : see if ctermid exists
11871 set ctermid d_ctermid
11874 : see if ctermid_r exists
11875 set ctermid_r d_ctermid_r
11877 case "$d_ctermid_r" in
11879 hdrs="$i_systypes sys/types.h define stdio.h "
11880 case "$d_ctermid_r_proto:$usethreads" in
11881 ":define") d_ctermid_r_proto=define
11882 set d_ctermid_r_proto ctermid_r $hdrs
11886 case "$d_ctermid_r_proto" in
11888 case "$ctermid_r_proto" in
11889 ''|0) try='char* ctermid_r(char*);'
11890 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11892 case "$ctermid_r_proto" in
11893 ''|0) d_ctermid_r=undef
11895 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11896 * ) case "$ctermid_r_proto" in
11897 REENTRANT_PROTO*) ;;
11898 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11900 echo "Prototype: $try" ;;
11903 *) case "$usethreads" in
11904 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11911 *) ctermid_r_proto=0
11915 : see if ctime_r exists
11916 set ctime_r d_ctime_r
11918 case "$d_ctime_r" in
11920 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11921 case "$d_ctime_r_proto:$usethreads" in
11922 ":define") d_ctime_r_proto=define
11923 set d_ctime_r_proto ctime_r $hdrs
11927 case "$d_ctime_r_proto" in
11929 case "$ctime_r_proto" in
11930 ''|0) try='char* ctime_r(const time_t*, char*);'
11931 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11933 case "$ctime_r_proto" in
11934 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11935 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11937 case "$ctime_r_proto" in
11938 ''|0) try='int ctime_r(const time_t*, char*);'
11939 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11941 case "$ctime_r_proto" in
11942 ''|0) try='int ctime_r(const time_t*, char*, int);'
11943 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11945 case "$ctime_r_proto" in
11946 ''|0) d_ctime_r=undef
11948 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11949 * ) case "$ctime_r_proto" in
11950 REENTRANT_PROTO*) ;;
11951 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11953 echo "Prototype: $try" ;;
11956 *) case "$usethreads" in
11957 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11968 : see if cuserid exists
11969 set cuserid d_cuserid
11972 : see if this is a limits.h system
11973 set limits.h i_limits
11976 : see if this is a float.h system
11977 set float.h i_float
11980 : See if number of significant digits in a double precision number is known
11982 $cat >dbl_dig.c <<EOM
11983 #$i_limits I_LIMITS
11986 #include <limits.h>
11992 printf("Contains DBL_DIG");
11995 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11996 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11997 echo "DBL_DIG found." >&4
12000 echo "DBL_DIG NOT found." >&4
12007 : see if dbm.h is available
12008 : see if dbmclose exists
12009 set dbmclose d_dbmclose
12012 case "$d_dbmclose" in
12022 *) set rpcsvc/dbm.h i_rpcsvcdbm
12027 *) echo "We won't be including <dbm.h>"
12037 : see if prototype for dbminit is available
12039 set d_dbminitproto dbminit $i_dbm dbm.h
12042 : see if difftime exists
12043 set difftime d_difftime
12046 : see if this is a dirent system
12048 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12050 echo "<dirent.h> found." >&4
12053 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12054 echo "<sys/dir.h> found." >&4
12057 xinc=`./findhdr sys/ndir.h`
12059 echo "<dirent.h> NOT found." >&4
12064 : Look for type of directory structure.
12066 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12068 case "$direntrytype" in
12070 case "$i_dirent" in
12071 $define) guess1='struct dirent' ;;
12072 *) guess1='struct direct' ;;
12075 *) guess1="$direntrytype"
12080 'struct dirent') guess2='struct direct' ;;
12081 *) guess2='struct dirent' ;;
12084 if $contains "$guess1" try.c >/dev/null 2>&1; then
12085 direntrytype="$guess1"
12086 echo "Your directory entries are $direntrytype." >&4
12087 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12088 direntrytype="$guess2"
12089 echo "Your directory entries seem to be $direntrytype." >&4
12091 echo "I don't recognize your system's directory entries." >&4
12092 rp="What type is used for directory entries on this system?"
12095 direntrytype="$ans"
12099 : see if the directory entry stores field length
12101 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12102 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12103 echo "Good, your directory entry keeps length information in d_namlen." >&4
12106 echo "Your directory entry does not know about the d_namlen field." >&4
12113 : Look for DIR.dd_fd
12114 case "$i_dirent" in
12116 echo "Checking to see if DIR has a dd_fd member variable" >&4
12118 #$i_stdlib I_STDLIB
12120 #include <stdlib.h>
12122 #include <dirent.h>
12132 if eval $compile; then
12133 echo "Yes, it does."
12136 echo "No, it does not."
12141 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12149 : see if this is an sysdir system
12150 set sys/dir.h i_sysdir
12153 : see if this is an sysndir system
12154 set sys/ndir.h i_sysndir
12159 $cat >dirfd.c <<EOM
12161 #$i_stdlib I_STDLIB
12163 #include <stdlib.h>
12165 #$i_dirent I_DIRENT /**/
12166 #$i_sysdir I_SYS_DIR /**/
12167 #$i_sysndir I_SYS_NDIR /**/
12168 #$i_systypes I_SYS_TYPES /**/
12169 #if defined(I_SYS_TYPES)
12170 #include <sys/types.h>
12172 #if defined(I_DIRENT)
12173 #include <dirent.h>
12174 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12175 #include <sys/dir.h>
12179 #include <sys/ndir.h>
12183 #include <ndir.h> /* may be wrong in the future */
12185 #include <sys/dir.h>
12191 DIR *dirp = opendir(".");
12192 if (dirfd(dirp) >= 0)
12200 if eval $compile; then
12204 $define) echo "dirfd() found." >&4 ;;
12205 *) echo "dirfd() NOT found." >&4 ;;
12211 : see if dlerror exists
12214 set dlerror d_dlerror
12218 : see if dlfcn is available
12219 set dlfcn.h i_dlfcn
12222 : Check what extension to use for shared libs
12227 On a few systems, the dynamically loaded modules that perl generates and uses
12228 will need a different extension than shared libs. The default will probably
12234 *) dflt="$dlext" ;;
12236 rp='What is the extension of dynamically loaded modules'
12245 : Check if dlsym need a leading underscore
12251 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12252 $cat >dyna.c <<'EOM'
12259 #$i_stdlib I_STDLIB
12261 #include <stdlib.h>
12265 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12267 #include <sys/types.h>
12272 extern int fred() ;
12281 int mode = RTLD_LAZY ;
12283 handle = dlopen("./dyna.$dlext", mode) ;
12284 if (handle == NULL) {
12289 symbol = dlsym(handle, "fred") ;
12290 if (symbol == NULL) {
12291 /* try putting a leading underscore */
12292 symbol = dlsym(handle, "_fred") ;
12293 if (symbol == NULL) {
12306 : Call the object file tmp-dyna.o in case dlext=o.
12307 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12308 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12309 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12310 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12313 1) echo "Test program failed using dlopen." >&4
12314 echo "Perhaps you should not use dynamic loading." >&4;;
12315 2) echo "Test program failed using dlsym." >&4
12316 echo "Perhaps you should not use dynamic loading." >&4;;
12317 3) echo "dlsym needs a leading underscore" >&4
12319 4) echo "dlsym doesn't need a leading underscore." >&4;;
12322 echo "I can't compile and run the test program." >&4
12323 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12328 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12333 : see if drand48_r exists
12334 set drand48_r d_drand48_r
12336 case "$d_drand48_r" in
12338 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12339 case "$d_drand48_r_proto:$usethreads" in
12340 ":define") d_drand48_r_proto=define
12341 set d_drand48_r_proto drand48_r $hdrs
12345 case "$d_drand48_r_proto" in
12347 case "$drand48_r_proto" in
12348 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12349 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12351 case "$drand48_r_proto" in
12352 ''|0) d_drand48_r=undef
12354 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12355 * ) case "$drand48_r_proto" in
12356 REENTRANT_PROTO*) ;;
12357 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12359 echo "Prototype: $try" ;;
12362 *) case "$usethreads" in
12363 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12370 *) drand48_r_proto=0
12374 : see if prototype for drand48 is available
12376 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12379 : see if dup2 exists
12383 : see if eaccess exists
12384 set eaccess d_eaccess
12387 : see if endgrent exists
12388 set endgrent d_endgrent
12391 : see if this is an grp system
12397 xxx=`./findhdr grp.h`
12398 $cppstdin $cppflags $cppminus < $xxx >$$.h
12400 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12412 set d_grpasswd; eval $setvar
12416 : see if endgrent_r exists
12417 set endgrent_r d_endgrent_r
12419 case "$d_endgrent_r" in
12421 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12422 case "$d_endgrent_r_proto:$usethreads" in
12423 ":define") d_endgrent_r_proto=define
12424 set d_endgrent_r_proto endgrent_r $hdrs
12428 case "$d_endgrent_r_proto" in
12430 case "$endgrent_r_proto" in
12431 ''|0) try='int endgrent_r(FILE**);'
12432 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12434 case "$endgrent_r_proto" in
12435 ''|0) try='void endgrent_r(FILE**);'
12436 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12438 case "$endgrent_r_proto" in
12439 ''|0) d_endgrent_r=undef
12441 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12442 * ) case "$endgrent_r_proto" in
12443 REENTRANT_PROTO*) ;;
12444 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12446 echo "Prototype: $try" ;;
12449 *) case "$usethreads" in
12450 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12457 *) endgrent_r_proto=0
12461 : see if endhostent exists
12462 set endhostent d_endhent
12465 : see if this is a netdb.h system
12466 set netdb.h i_netdb
12469 : see if endhostent_r exists
12470 set endhostent_r d_endhostent_r
12472 case "$d_endhostent_r" in
12474 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12475 case "$d_endhostent_r_proto:$usethreads" in
12476 ":define") d_endhostent_r_proto=define
12477 set d_endhostent_r_proto endhostent_r $hdrs
12481 case "$d_endhostent_r_proto" in
12483 case "$endhostent_r_proto" in
12484 ''|0) try='int endhostent_r(struct hostent_data*);'
12485 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12487 case "$endhostent_r_proto" in
12488 ''|0) try='void endhostent_r(struct hostent_data*);'
12489 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12491 case "$endhostent_r_proto" in
12492 ''|0) d_endhostent_r=undef
12493 endhostent_r_proto=0
12494 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12495 * ) case "$endhostent_r_proto" in
12496 REENTRANT_PROTO*) ;;
12497 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12499 echo "Prototype: $try" ;;
12502 *) case "$usethreads" in
12503 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12505 d_endhostent_r=undef
12506 endhostent_r_proto=0
12510 *) endhostent_r_proto=0
12514 : see if endnetent exists
12515 set endnetent d_endnent
12518 : see if endnetent_r exists
12519 set endnetent_r d_endnetent_r
12521 case "$d_endnetent_r" in
12523 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12524 case "$d_endnetent_r_proto:$usethreads" in
12525 ":define") d_endnetent_r_proto=define
12526 set d_endnetent_r_proto endnetent_r $hdrs
12530 case "$d_endnetent_r_proto" in
12532 case "$endnetent_r_proto" in
12533 ''|0) try='int endnetent_r(struct netent_data*);'
12534 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12536 case "$endnetent_r_proto" in
12537 ''|0) try='void endnetent_r(struct netent_data*);'
12538 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12540 case "$endnetent_r_proto" in
12541 ''|0) d_endnetent_r=undef
12542 endnetent_r_proto=0
12543 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12544 * ) case "$endnetent_r_proto" in
12545 REENTRANT_PROTO*) ;;
12546 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12548 echo "Prototype: $try" ;;
12551 *) case "$usethreads" in
12552 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12554 d_endnetent_r=undef
12555 endnetent_r_proto=0
12559 *) endnetent_r_proto=0
12563 : see if endprotoent exists
12564 set endprotoent d_endpent
12567 : see if endprotoent_r exists
12568 set endprotoent_r d_endprotoent_r
12570 case "$d_endprotoent_r" in
12572 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12573 case "$d_endprotoent_r_proto:$usethreads" in
12574 ":define") d_endprotoent_r_proto=define
12575 set d_endprotoent_r_proto endprotoent_r $hdrs
12579 case "$d_endprotoent_r_proto" in
12581 case "$endprotoent_r_proto" in
12582 ''|0) try='int endprotoent_r(struct protoent_data*);'
12583 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12585 case "$endprotoent_r_proto" in
12586 ''|0) try='void endprotoent_r(struct protoent_data*);'
12587 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12589 case "$endprotoent_r_proto" in
12590 ''|0) d_endprotoent_r=undef
12591 endprotoent_r_proto=0
12592 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12593 * ) case "$endprotoent_r_proto" in
12594 REENTRANT_PROTO*) ;;
12595 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12597 echo "Prototype: $try" ;;
12600 *) case "$usethreads" in
12601 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12603 d_endprotoent_r=undef
12604 endprotoent_r_proto=0
12608 *) endprotoent_r_proto=0
12612 : see if endpwent exists
12613 set endpwent d_endpwent
12616 : see if this is a pwd.h system
12622 xxx=`./findhdr pwd.h`
12623 $cppstdin $cppflags $cppminus < $xxx >$$.h
12625 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12633 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12641 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12649 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12657 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12665 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12673 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12681 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12693 set d_pwquota; eval $setvar
12694 set d_pwage; eval $setvar
12695 set d_pwchange; eval $setvar
12696 set d_pwclass; eval $setvar
12697 set d_pwexpire; eval $setvar
12698 set d_pwcomment; eval $setvar
12699 set d_pwgecos; eval $setvar
12700 set d_pwpasswd; eval $setvar
12704 : see if endpwent_r exists
12705 set endpwent_r d_endpwent_r
12707 case "$d_endpwent_r" in
12709 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12710 case "$d_endpwent_r_proto:$usethreads" in
12711 ":define") d_endpwent_r_proto=define
12712 set d_endpwent_r_proto endpwent_r $hdrs
12716 case "$d_endpwent_r_proto" in
12718 case "$endpwent_r_proto" in
12719 ''|0) try='int endpwent_r(FILE**);'
12720 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12722 case "$endpwent_r_proto" in
12723 ''|0) try='void endpwent_r(FILE**);'
12724 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12726 case "$endpwent_r_proto" in
12727 ''|0) d_endpwent_r=undef
12729 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12730 * ) case "$endpwent_r_proto" in
12731 REENTRANT_PROTO*) ;;
12732 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12734 echo "Prototype: $try" ;;
12737 *) case "$usethreads" in
12738 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12745 *) endpwent_r_proto=0
12749 : see if endservent exists
12750 set endservent d_endsent
12753 : see if endservent_r exists
12754 set endservent_r d_endservent_r
12756 case "$d_endservent_r" in
12758 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12759 case "$d_endservent_r_proto:$usethreads" in
12760 ":define") d_endservent_r_proto=define
12761 set d_endservent_r_proto endservent_r $hdrs
12765 case "$d_endservent_r_proto" in
12767 case "$endservent_r_proto" in
12768 ''|0) try='int endservent_r(struct servent_data*);'
12769 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12771 case "$endservent_r_proto" in
12772 ''|0) try='void endservent_r(struct servent_data*);'
12773 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12775 case "$endservent_r_proto" in
12776 ''|0) d_endservent_r=undef
12777 endservent_r_proto=0
12778 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12779 * ) case "$endservent_r_proto" in
12780 REENTRANT_PROTO*) ;;
12781 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12783 echo "Prototype: $try" ;;
12786 *) case "$usethreads" in
12787 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12789 d_endservent_r=undef
12790 endservent_r_proto=0
12794 *) endservent_r_proto=0
12798 : Locate the flags for 'open()'
12801 #include <sys/types.h>
12806 #include <sys/file.h>
12808 #$i_stdlib I_STDLIB
12810 #include <stdlib.h>
12821 : check sys/file.h first to get FREAD on Sun
12822 if $test `./findhdr sys/file.h` && \
12823 set try -DI_SYS_FILE && eval $compile; then
12825 echo "<sys/file.h> defines the O_* constants..." >&4
12826 if $run ./try; then
12827 echo "and you have the 3 argument form of open()." >&4
12830 echo "but not the 3 argument form of open(). Oh, well." >&4
12833 elif $test `./findhdr fcntl.h` && \
12834 set try -DI_FCNTL && eval $compile; then
12836 echo "<fcntl.h> defines the O_* constants..." >&4
12837 if $run ./try; then
12838 echo "and you have the 3 argument form of open()." >&4
12841 echo "but not the 3 argument form of open(). Oh, well." >&4
12846 echo "I can't find the O_* constant definitions! You got problems." >&4
12852 : see if this is a sys/file.h system
12857 : do we need to include sys/file.h ?
12861 if $h_sysfile; then
12863 echo "We'll be including <sys/file.h>." >&4
12866 echo "We won't be including <sys/file.h>." >&4
12876 : see if fcntl.h is there
12881 : see if we can include fcntl.h
12887 echo "We'll be including <fcntl.h>." >&4
12890 if $h_sysfile; then
12891 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12893 echo "We won't be including <fcntl.h>." >&4
12905 : see if fork exists
12909 : see if pipe exists
12913 : check for non-blocking I/O stuff
12914 case "$h_sysfile" in
12915 true) echo "#include <sys/file.h>" > head.c;;
12918 true) echo "#include <fcntl.h>" > head.c;;
12919 *) echo "#include <sys/fcntl.h>" > head.c;;
12924 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12925 case "$o_nonblock" in
12927 $cat head.c > try.c
12928 $cat >>try.c <<EOCP
12930 #$i_stdlib I_STDLIB
12932 #include <stdlib.h>
12940 printf("O_NONBLOCK\n");
12944 printf("O_NDELAY\n");
12948 printf("FNDELAY\n");
12955 if eval $compile_ok; then
12956 o_nonblock=`$run ./try`
12957 case "$o_nonblock" in
12958 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12959 *) echo "Seems like we can use $o_nonblock.";;
12962 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12965 *) echo "Using $hint value $o_nonblock.";;
12970 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12973 case "$d_fork:$d_pipe" in
12975 $cat head.c > try.c
12976 $cat >>try.c <<EOCP
12978 #include <sys/types.h>
12979 #include <signal.h>
12981 #$i_stdlib I_STDLIB
12983 #include <stdlib.h>
12989 #define MY_O_NONBLOCK $o_nonblock
12990 #ifndef errno /* XXX need better Configure test */
12993 #$i_unistd I_UNISTD
12995 #include <unistd.h>
12997 #$i_string I_STRING
12999 #include <string.h>
13001 #include <strings.h>
13003 $signal_t blech(int x) { exit(3); }
13005 $cat >> try.c <<'EOCP'
13013 pipe(pd); /* Down: child -> parent */
13014 pipe(pu); /* Up: parent -> child */
13017 close(pd[1]); /* Parent reads from pd[0] */
13018 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13020 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13025 signal(SIGALRM, blech);
13027 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13029 sprintf(string, "%d\n", ret);
13030 write(2, string, strlen(string));
13033 if (errno == EAGAIN) {
13034 printf("EAGAIN\n");
13039 if (errno == EWOULDBLOCK)
13040 printf("EWOULDBLOCK\n");
13043 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13044 sleep(2); /* Give it time to close our pipe */
13046 ret = read(pd[0], buf, 1); /* Should read EOF */
13048 sprintf(string, "%d\n", ret);
13049 write(4, string, strlen(string));
13053 close(pd[0]); /* We write to pd[1] */
13054 close(pu[1]); /* We read from pu[0] */
13055 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13056 close(pd[1]); /* Pipe pd is now fully closed! */
13057 exit(0); /* Bye bye, thank you for playing! */
13061 if eval $compile_ok; then
13062 echo "$startsh" >mtry
13063 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13065 $run ./mtry >/dev/null 2>&1
13067 0) eagain=`$cat try.out`;;
13068 1) echo "Could not perform non-blocking setting!";;
13069 2) echo "I did a successful read() for something that was not there!";;
13070 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13071 4) echo "Could not find F_SETFL!";;
13072 *) echo "Something terribly wrong happened during testing.";;
13074 rd_nodata=`$cat try.ret`
13075 echo "A read() system call with no data present returns $rd_nodata."
13076 case "$rd_nodata" in
13079 echo "(That's peculiar, fixing that to be -1.)"
13085 echo "Forcing errno EAGAIN on read() with no data available."
13089 echo "Your read() sets errno to $eagain when no data is available."
13092 status=`$cat try.err`
13094 0) echo "And it correctly returns 0 to signal EOF.";;
13095 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13096 *) echo "However, your read() returns '$status' on EOF??";;
13099 if test "$status" = "$rd_nodata"; then
13100 echo "WARNING: you can't distinguish between EOF and no data!"
13104 echo "I can't compile the test program--assuming errno EAGAIN will do."
13108 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13117 echo "Using $hint value $eagain."
13118 echo "Your read() returns $rd_nodata when no data is present."
13119 case "$d_eofnblk" in
13120 "$define") echo "And you can see EOF because read() returns 0.";;
13121 "$undef") echo "But you can't see EOF status from read() returned value.";;
13123 echo "(Assuming you can't see EOF status from read anyway.)"
13129 $rm_try head.c mtry
13131 : see if _ptr and _cnt from stdio act std
13134 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13135 echo "(Looks like you have stdio.h from BSD.)"
13136 case "$stdio_ptr" in
13137 '') stdio_ptr='((fp)->_p)'
13140 *) ptr_lval=$d_stdio_ptr_lval;;
13142 case "$stdio_cnt" in
13143 '') stdio_cnt='((fp)->_r)'
13146 *) cnt_lval=$d_stdio_cnt_lval;;
13148 case "$stdio_base" in
13149 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13151 case "$stdio_bufsiz" in
13152 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13154 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13155 echo "(Looks like you have stdio.h from Linux.)"
13156 case "$stdio_ptr" in
13157 '') stdio_ptr='((fp)->_IO_read_ptr)'
13160 *) ptr_lval=$d_stdio_ptr_lval;;
13162 case "$stdio_cnt" in
13163 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13166 *) cnt_lval=$d_stdio_cnt_lval;;
13168 case "$stdio_base" in
13169 '') stdio_base='((fp)->_IO_read_base)';;
13171 case "$stdio_bufsiz" in
13172 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13175 case "$stdio_ptr" in
13176 '') stdio_ptr='((fp)->_ptr)'
13179 *) ptr_lval=$d_stdio_ptr_lval;;
13181 case "$stdio_cnt" in
13182 '') stdio_cnt='((fp)->_cnt)'
13185 *) cnt_lval=$d_stdio_cnt_lval;;
13187 case "$stdio_base" in
13188 '') stdio_base='((fp)->_base)';;
13190 case "$stdio_bufsiz" in
13191 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13195 : test whether _ptr and _cnt really work
13196 echo "Checking how std your stdio is..." >&4
13199 #$i_stdlib I_STDLIB
13201 #include <stdlib.h>
13203 #define FILE_ptr(fp) $stdio_ptr
13204 #define FILE_cnt(fp) $stdio_cnt
13206 FILE *fp = fopen("try.c", "r");
13209 18 <= FILE_cnt(fp) &&
13210 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13218 if eval $compile && $to try.c; then
13219 if $run ./try; then
13220 echo "Your stdio acts pretty std."
13223 echo "Your stdio isn't very std."
13226 echo "Your stdio doesn't appear very std."
13230 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13231 # direct buffer manipulation no longer works. The Configure tests
13232 # should be changed to correctly detect this, but until then,
13233 # the following check should at least let perl compile and run.
13234 # (This quick fix should be updated before 5.8.1.)
13235 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13236 # A. Dougherty, June 3, 2002.
13237 case "$d_gnulibc" in
13239 case "$gnulibc_version" in
13243 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13252 : Can _ptr be used as an lvalue?
13253 case "$d_stdstdio$ptr_lval" in
13254 $define$define) val=$define ;;
13257 set d_stdio_ptr_lval
13260 : Can _cnt be used as an lvalue?
13261 case "$d_stdstdio$cnt_lval" in
13262 $define$define) val=$define ;;
13265 set d_stdio_cnt_lval
13269 : test whether setting _ptr sets _cnt as a side effect
13270 d_stdio_ptr_lval_sets_cnt="$undef"
13271 d_stdio_ptr_lval_nochange_cnt="$undef"
13272 case "$d_stdio_ptr_lval$d_stdstdio" in
13274 echo "Checking to see what happens if we set the stdio ptr..." >&4
13277 /* Can we scream? */
13278 /* Eat dust sed :-) */
13279 /* In the buffer space, no one can hear you scream. */
13280 #$i_stdlib I_STDLIB
13282 #include <stdlib.h>
13284 #define FILE_ptr(fp) $stdio_ptr
13285 #define FILE_cnt(fp) $stdio_cnt
13286 #include <sys/types.h>
13288 FILE *fp = fopen("try.c", "r");
13293 puts("Fail even to read");
13296 c = getc(fp); /* Read away the first # */
13298 puts("Fail even to read");
13302 18 <= FILE_cnt(fp) &&
13303 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13305 puts("Fail even to read");
13308 ptr = (char*) FILE_ptr(fp);
13309 cnt = (size_t)FILE_cnt(fp);
13311 FILE_ptr(fp) += 42;
13313 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13314 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13317 if (FILE_cnt(fp) <= 20) {
13318 printf ("Fail (<20 chars to test)");
13321 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13322 puts("Fail compare");
13325 if (cnt == FILE_cnt(fp)) {
13326 puts("Pass_unchanged");
13329 if (FILE_cnt(fp) == (cnt - 42)) {
13330 puts("Pass_changed");
13333 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13339 if eval $compile && $to try.c; then
13340 case `$run ./try` in
13342 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13343 d_stdio_ptr_lval_sets_cnt="$define" ;;
13345 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13346 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13348 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13350 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13353 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13359 : see if _base is also standard
13361 case "$d_stdstdio" in
13365 #$i_stdlib I_STDLIB
13367 #include <stdlib.h>
13369 #define FILE_base(fp) $stdio_base
13370 #define FILE_bufsiz(fp) $stdio_bufsiz
13372 FILE *fp = fopen("try.c", "r");
13375 19 <= FILE_bufsiz(fp) &&
13376 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13383 if eval $compile && $to try.c; then
13384 if $run ./try; then
13385 echo "And its _base field acts std."
13388 echo "But its _base field isn't std."
13391 echo "However, it seems to be lacking the _base field."
13399 : see if fast_stdio exists
13401 case "$d_stdstdio:$d_stdio_ptr_lval" in
13403 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13405 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13416 : see if fchdir exists
13417 set fchdir d_fchdir
13420 : see if fchmod exists
13421 set fchmod d_fchmod
13424 : see if fchown exists
13425 set fchown d_fchown
13428 : see if this is an fcntl system
13432 : See if fcntl-based locking works.
13435 #$i_stdlib I_STDLIB
13437 #include <stdlib.h>
13439 #include <unistd.h>
13441 #include <signal.h>
13442 $signal_t blech(int x) { exit(3); }
13444 #if defined(F_SETLK) && defined(F_SETLKW)
13445 struct flock flock;
13447 fd = open("try.c", O_RDONLY);
13448 flock.l_type = F_RDLCK;
13449 flock.l_whence = SEEK_SET;
13450 flock.l_start = flock.l_len = 0;
13451 signal(SIGALRM, blech);
13453 retval = fcntl(fd, F_SETLK, &flock);
13455 (retval < 0 ? exit(2) : exit(0));
13461 echo "Checking if fcntl-based file locking works... "
13465 if eval $compile_ok; then
13466 if $run ./try; then
13467 echo "Yes, it seems to work."
13470 echo "Nope, it didn't work."
13475 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13476 *** This is (almost) impossible.
13477 *** If your NFS lock daemons are not feeling well, something like
13478 *** this may happen, please investigate. Cannot continue, aborting.
13486 echo "I'm unable to compile the test program, so I'll assume not."
13491 echo "Nope, since you don't even have fcntl()."
13494 set d_fcntl_can_lock
13498 : check for fd_set items
13501 Checking to see how well your C compiler handles fd_set and friends ...
13504 #$i_stdlib I_STDLIB
13506 #include <stdlib.h>
13508 #$i_systime I_SYS_TIME
13509 #$i_sysselct I_SYS_SELECT
13510 #$d_socket HAS_SOCKET
13511 #include <sys/types.h>
13513 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13516 #include <sys/time.h>
13518 #ifdef I_SYS_SELECT
13519 #include <sys/select.h>
13528 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13536 if eval $compile; then
13537 d_fds_bits="$define"
13539 echo "Well, your system knows about the normal fd_set typedef..." >&4
13540 if $run ./try; then
13541 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13542 d_fd_macros="$define"
13545 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13547 d_fd_macros="$undef"
13551 Hmm, your compiler has some difficulty with fd_set. Checking further...
13554 if eval $compile; then
13555 d_fds_bits="$undef"
13557 echo "Well, your system has some sort of fd_set available..." >&4
13558 if $run ./try; then
13559 echo "and you have the normal fd_set macros." >&4
13560 d_fd_macros="$define"
13563 but not the normal fd_set macros! Gross! More work for me...
13565 d_fd_macros="$undef"
13568 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13570 d_fds_bits="$undef"
13571 d_fd_macros="$undef"
13576 : see if fgetpos exists
13577 set fgetpos d_fgetpos
13580 : see if finite exists
13581 set finite d_finite
13584 : see if finitel exists
13585 set finitel d_finitel
13588 : see if flock exists
13592 : see if prototype for flock is available
13594 set d_flockproto flock $i_sysfile sys/file.h
13597 : see if fp_class exists
13598 set fp_class d_fp_class
13601 : see if pathconf exists
13602 set pathconf d_pathconf
13605 : see if fpathconf exists
13606 set fpathconf d_fpathconf
13609 : see if fpclass exists
13610 set fpclass d_fpclass
13613 : see if fpclassify exists
13614 set fpclassify d_fpclassify
13617 : see if fpclassl exists
13618 set fpclassl d_fpclassl
13621 : check for fpos64_t
13623 echo "Checking to see if you have fpos64_t..." >&4
13626 int main() { fpos64_t x = 7; }
13629 if eval $compile; then
13631 echo "You have fpos64_t."
13634 echo "You do not have fpos64_t."
13635 case "$fpossize" in
13636 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13643 : see if frexpl exists
13644 set frexpl d_frexpl
13647 : see if this is a sys/param system
13648 set sys/param.h i_sysparam
13651 : see if this is a sys/mount.h system
13652 set sys/mount.h i_sysmount
13655 : Check for fs_data_s
13657 echo "Checking to see if your system supports struct fs_data..." >&4
13658 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13660 case "$d_fs_data_s" in
13661 "$define") echo "Yes, it does." ;;
13662 *) echo "No, it doesn't." ;;
13665 : see if fseeko exists
13666 set fseeko d_fseeko
13668 case "$longsize" in
13669 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13672 : see if fsetpos exists
13673 set fsetpos d_fsetpos
13676 : see if fstatfs exists
13677 set fstatfs d_fstatfs
13680 : see if statvfs exists
13681 set statvfs d_statvfs
13684 : see if fstatvfs exists
13685 set fstatvfs d_fstatvfs
13689 : see if fsync exists
13693 : see if ftello exists
13694 set ftello d_ftello
13696 case "$longsize" in
13697 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13700 : check for a working futimes
13703 echo "Checking if you have a working futimes()" >&4
13706 #include <sys/time.h>
13713 fd = open ("try.c", O_RDWR);
13714 if (-1 == fd) exit (1);
13715 rv = futimes (fd, NULL);
13716 exit (rv == -1 ? errno : 0);
13720 if eval $compile; then
13724 0) echo "Yes, you have" >&4
13725 d_futimes="$define"
13727 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13731 echo "No, it does not (probably harmless)" >&4
13735 : see if ndbm.h is available
13738 : Compatibility location for RedHat 7.1
13739 set gdbm/ndbm.h i_gdbmndbm
13741 : Compatibility location for Debian 4.0
13742 set gdbm-ndbm.h i_gdbm_ndbm
13746 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13747 : see if dbm_open exists
13748 set dbm_open d_dbm_open
13750 case "$d_dbm_open" in
13753 i_gdbmndbm="$undef"
13754 i_gdbm_ndbm="$undef"
13755 echo "We won't be including <ndbm.h>"
13765 ndbm_hdr_protochk='name=$1; hdr=$2;
13766 eval "ihdr=\$""i_$name";
13768 if $test "$ihdr" = "$define"; then
13769 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13770 case "$d_cplusplus" in
13771 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13772 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13775 $define) $echo "Your <$hdr> seems to have prototypes";;
13776 *) $echo "Your <$hdr> does not seem to have prototypes";;
13779 set "d_${name}_h_uses_prototypes";
13783 eval $ndbm_hdr_protochk
13784 set gdbmndbm gdbm/ndbm.h
13785 eval $ndbm_hdr_protochk
13786 set gdbm_ndbm gdbm-ndbm.h
13787 eval $ndbm_hdr_protochk
13789 : see if getaddrinfo exists
13790 set getaddrinfo d_getaddrinfo
13793 : see if getcwd exists
13794 set getcwd d_getcwd
13797 : see if getespwnam exists
13798 set getespwnam d_getespwnam
13801 : see if getfsstat exists
13802 set getfsstat d_getfsstat
13805 : see if getgrent exists
13806 set getgrent d_getgrent
13809 : see if getgrent_r exists
13810 set getgrent_r d_getgrent_r
13812 case "$d_getgrent_r" in
13814 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13815 case "$d_getgrent_r_proto:$usethreads" in
13816 ":define") d_getgrent_r_proto=define
13817 set d_getgrent_r_proto getgrent_r $hdrs
13821 case "$d_getgrent_r_proto" in
13823 case "$getgrent_r_proto" in
13824 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13825 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13827 case "$getgrent_r_proto" in
13828 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13829 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13831 case "$getgrent_r_proto" in
13832 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13833 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13835 case "$getgrent_r_proto" in
13836 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13837 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13839 case "$getgrent_r_proto" in
13840 ''|0) try='int getgrent_r(struct group*, char*, int);'
13841 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13843 case "$getgrent_r_proto" in
13844 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13845 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13847 case "$getgrent_r_proto" in
13848 ''|0) d_getgrent_r=undef
13850 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13851 * ) case "$getgrent_r_proto" in
13852 REENTRANT_PROTO*) ;;
13853 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13855 echo "Prototype: $try" ;;
13858 *) case "$usethreads" in
13859 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13866 *) getgrent_r_proto=0
13870 : see if getgrgid_r exists
13871 set getgrgid_r d_getgrgid_r
13873 case "$d_getgrgid_r" in
13875 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13876 case "$d_getgrgid_r_proto:$usethreads" in
13877 ":define") d_getgrgid_r_proto=define
13878 set d_getgrgid_r_proto getgrgid_r $hdrs
13882 case "$d_getgrgid_r_proto" in
13884 case "$getgrgid_r_proto" in
13885 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13886 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13888 case "$getgrgid_r_proto" in
13889 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13890 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13892 case "$getgrgid_r_proto" in
13893 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13894 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13896 case "$getgrgid_r_proto" in
13897 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13898 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13900 case "$getgrgid_r_proto" in
13901 ''|0) d_getgrgid_r=undef
13903 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13904 * ) case "$getgrgid_r_proto" in
13905 REENTRANT_PROTO*) ;;
13906 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13908 echo "Prototype: $try" ;;
13911 *) case "$usethreads" in
13912 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13919 *) getgrgid_r_proto=0
13923 : see if getgrnam_r exists
13924 set getgrnam_r d_getgrnam_r
13926 case "$d_getgrnam_r" in
13928 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13929 case "$d_getgrnam_r_proto:$usethreads" in
13930 ":define") d_getgrnam_r_proto=define
13931 set d_getgrnam_r_proto getgrnam_r $hdrs
13935 case "$d_getgrnam_r_proto" in
13937 case "$getgrnam_r_proto" in
13938 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13939 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13941 case "$getgrnam_r_proto" in
13942 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13943 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13945 case "$getgrnam_r_proto" in
13946 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13947 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13949 case "$getgrnam_r_proto" in
13950 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13951 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13953 case "$getgrnam_r_proto" in
13954 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13955 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13957 case "$getgrnam_r_proto" in
13958 ''|0) d_getgrnam_r=undef
13960 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13961 * ) case "$getgrnam_r_proto" in
13962 REENTRANT_PROTO*) ;;
13963 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13965 echo "Prototype: $try" ;;
13968 *) case "$usethreads" in
13969 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13976 *) getgrnam_r_proto=0
13980 : see if gethostbyaddr exists
13981 set gethostbyaddr d_gethbyaddr
13984 : see if gethostbyname exists
13985 set gethostbyname d_gethbyname
13988 : see if gethostent exists
13989 set gethostent d_gethent
13992 : see how we will look up host name
13995 if set gethostname val -f d_gethname; eval $csym; $val; then
13996 echo 'gethostname() found.' >&4
13997 d_gethname="$define"
14000 if set uname val -f d_uname; eval $csym; $val; then
14003 uname() was found, but you're running xenix, and older versions of xenix
14004 have a broken uname(). If you don't really know whether your xenix is old
14005 enough to have a broken system call, use the default answer.
14010 "$define") dflt=n;;
14012 rp='Is your uname() broken?'
14015 n*) d_uname="$define"; call=uname;;
14018 echo 'uname() found.' >&4
14025 case "$d_gethname" in
14026 '') d_gethname="$undef";;
14029 '') d_uname="$undef";;
14031 case "$d_uname$d_gethname" in
14036 Every now and then someone has a $call() that lies about the hostname
14037 but can't be fixed for political or economic reasons. If you wish, I can
14038 pretend $call() isn't there and maybe compute hostname at run-time
14039 thanks to the '$phostname' command.
14042 rp="Shall I ignore $call() from now on?"
14045 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14048 case "$phostname" in
14049 '') aphostname='';;
14050 *) case "$aphostname" in
14052 *) set X $phostname
14056 file=`./loc $file $file $pth`
14057 aphostname=`echo $file $*`
14062 case "$d_uname$d_gethname" in
14065 case "$phostname" in
14067 echo "There will be no way for $package to get your hostname." >&4;;
14069 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14073 case "$d_phostname" in
14074 '') d_phostname="$undef";;
14077 : see if gethostbyaddr_r exists
14078 set gethostbyaddr_r d_gethostbyaddr_r
14080 case "$d_gethostbyaddr_r" in
14082 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14083 case "$d_gethostbyaddr_r_proto:$usethreads" in
14084 ":define") d_gethostbyaddr_r_proto=define
14085 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14089 case "$d_gethostbyaddr_r_proto" in
14091 case "$gethostbyaddr_r_proto" in
14092 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14093 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14095 case "$gethostbyaddr_r_proto" in
14096 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14097 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14099 case "$gethostbyaddr_r_proto" in
14100 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14101 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14103 case "$gethostbyaddr_r_proto" in
14104 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14105 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14107 case "$gethostbyaddr_r_proto" in
14108 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14109 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14111 case "$gethostbyaddr_r_proto" in
14112 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14113 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14115 case "$gethostbyaddr_r_proto" in
14116 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14117 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14119 case "$gethostbyaddr_r_proto" in
14120 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14121 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14123 case "$gethostbyaddr_r_proto" in
14124 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14125 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14127 case "$gethostbyaddr_r_proto" in
14128 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14129 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14131 case "$gethostbyaddr_r_proto" in
14132 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14133 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14135 case "$gethostbyaddr_r_proto" in
14136 ''|0) d_gethostbyaddr_r=undef
14137 gethostbyaddr_r_proto=0
14138 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14139 * ) case "$gethostbyaddr_r_proto" in
14140 REENTRANT_PROTO*) ;;
14141 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14143 echo "Prototype: $try" ;;
14146 *) case "$usethreads" in
14147 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14149 d_gethostbyaddr_r=undef
14150 gethostbyaddr_r_proto=0
14154 *) gethostbyaddr_r_proto=0
14158 : see if gethostbyname_r exists
14159 set gethostbyname_r d_gethostbyname_r
14161 case "$d_gethostbyname_r" in
14163 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14164 case "$d_gethostbyname_r_proto:$usethreads" in
14165 ":define") d_gethostbyname_r_proto=define
14166 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14170 case "$d_gethostbyname_r_proto" in
14172 case "$gethostbyname_r_proto" in
14173 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14174 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14176 case "$gethostbyname_r_proto" in
14177 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14178 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14180 case "$gethostbyname_r_proto" in
14181 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14182 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14184 case "$gethostbyname_r_proto" in
14185 ''|0) d_gethostbyname_r=undef
14186 gethostbyname_r_proto=0
14187 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14188 * ) case "$gethostbyname_r_proto" in
14189 REENTRANT_PROTO*) ;;
14190 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14192 echo "Prototype: $try" ;;
14195 *) case "$usethreads" in
14196 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14198 d_gethostbyname_r=undef
14199 gethostbyname_r_proto=0
14203 *) gethostbyname_r_proto=0
14207 : see if gethostent_r exists
14208 set gethostent_r d_gethostent_r
14210 case "$d_gethostent_r" in
14212 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14213 case "$d_gethostent_r_proto:$usethreads" in
14214 ":define") d_gethostent_r_proto=define
14215 set d_gethostent_r_proto gethostent_r $hdrs
14219 case "$d_gethostent_r_proto" in
14221 case "$gethostent_r_proto" in
14222 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14223 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14225 case "$gethostent_r_proto" in
14226 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14227 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14229 case "$gethostent_r_proto" in
14230 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14231 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14233 case "$gethostent_r_proto" in
14234 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14235 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14237 case "$gethostent_r_proto" in
14238 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14239 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14241 case "$gethostent_r_proto" in
14242 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14243 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14245 case "$gethostent_r_proto" in
14246 ''|0) d_gethostent_r=undef
14247 gethostent_r_proto=0
14248 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14249 * ) case "$gethostent_r_proto" in
14250 REENTRANT_PROTO*) ;;
14251 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14253 echo "Prototype: $try" ;;
14256 *) case "$usethreads" in
14257 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14259 d_gethostent_r=undef
14260 gethostent_r_proto=0
14264 *) gethostent_r_proto=0
14268 : see if prototypes for various gethostxxx netdb.h functions are available
14270 set d_gethostprotos gethostent $i_netdb netdb.h
14273 : see if getitimer exists
14274 set getitimer d_getitimer
14277 : see if getlogin exists
14278 set getlogin d_getlogin
14281 : see if getlogin_r exists
14282 set getlogin_r d_getlogin_r
14284 case "$d_getlogin_r" in
14286 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14287 case "$d_getlogin_r_proto:$usethreads" in
14288 ":define") d_getlogin_r_proto=define
14289 set d_getlogin_r_proto getlogin_r $hdrs
14293 case "$d_getlogin_r_proto" in
14295 case "$getlogin_r_proto" in
14296 ''|0) try='int getlogin_r(char*, size_t);'
14297 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14299 case "$getlogin_r_proto" in
14300 ''|0) try='int getlogin_r(char*, int);'
14301 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14303 case "$getlogin_r_proto" in
14304 ''|0) try='char* getlogin_r(char*, size_t);'
14305 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14307 case "$getlogin_r_proto" in
14308 ''|0) try='char* getlogin_r(char*, int);'
14309 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14311 case "$getlogin_r_proto" in
14312 ''|0) d_getlogin_r=undef
14314 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14315 * ) case "$getlogin_r_proto" in
14316 REENTRANT_PROTO*) ;;
14317 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14319 echo "Prototype: $try" ;;
14322 *) case "$usethreads" in
14323 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14330 *) getlogin_r_proto=0
14334 : see if getmnt exists
14335 set getmnt d_getmnt
14338 : see if getmntent exists
14339 set getmntent d_getmntent
14342 : see if getnameinfo exists
14343 set getnameinfo d_getnameinfo
14346 : see if getnetbyaddr exists
14347 set getnetbyaddr d_getnbyaddr
14350 : see if getnetbyname exists
14351 set getnetbyname d_getnbyname
14354 : see if getnetent exists
14355 set getnetent d_getnent
14358 : see if getnetbyaddr_r exists
14359 set getnetbyaddr_r d_getnetbyaddr_r
14361 case "$d_getnetbyaddr_r" in
14363 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14364 case "$d_getnetbyaddr_r_proto:$usethreads" in
14365 ":define") d_getnetbyaddr_r_proto=define
14366 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14370 case "$d_getnetbyaddr_r_proto" in
14372 case "$getnetbyaddr_r_proto" in
14373 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14374 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14376 case "$getnetbyaddr_r_proto" in
14377 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14378 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14380 case "$getnetbyaddr_r_proto" in
14381 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14382 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14384 case "$getnetbyaddr_r_proto" in
14385 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14386 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14388 case "$getnetbyaddr_r_proto" in
14389 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14390 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14392 case "$getnetbyaddr_r_proto" in
14393 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14394 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14396 case "$getnetbyaddr_r_proto" in
14397 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14398 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14400 case "$getnetbyaddr_r_proto" in
14401 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14402 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14404 case "$getnetbyaddr_r_proto" in
14405 ''|0) d_getnetbyaddr_r=undef
14406 getnetbyaddr_r_proto=0
14407 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14408 * ) case "$getnetbyaddr_r_proto" in
14409 REENTRANT_PROTO*) ;;
14410 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14412 echo "Prototype: $try" ;;
14415 *) case "$usethreads" in
14416 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14418 d_getnetbyaddr_r=undef
14419 getnetbyaddr_r_proto=0
14423 *) getnetbyaddr_r_proto=0
14427 : see if getnetbyname_r exists
14428 set getnetbyname_r d_getnetbyname_r
14430 case "$d_getnetbyname_r" in
14432 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14433 case "$d_getnetbyname_r_proto:$usethreads" in
14434 ":define") d_getnetbyname_r_proto=define
14435 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14439 case "$d_getnetbyname_r_proto" in
14441 case "$getnetbyname_r_proto" in
14442 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14443 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14445 case "$getnetbyname_r_proto" in
14446 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14447 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14449 case "$getnetbyname_r_proto" in
14450 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14451 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14453 case "$getnetbyname_r_proto" in
14454 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14455 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14457 case "$getnetbyname_r_proto" in
14458 ''|0) d_getnetbyname_r=undef
14459 getnetbyname_r_proto=0
14460 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14461 * ) case "$getnetbyname_r_proto" in
14462 REENTRANT_PROTO*) ;;
14463 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14465 echo "Prototype: $try" ;;
14468 *) case "$usethreads" in
14469 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14471 d_getnetbyname_r=undef
14472 getnetbyname_r_proto=0
14476 *) getnetbyname_r_proto=0
14480 : see if getnetent_r exists
14481 set getnetent_r d_getnetent_r
14483 case "$d_getnetent_r" in
14485 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14486 case "$d_getnetent_r_proto:$usethreads" in
14487 ":define") d_getnetent_r_proto=define
14488 set d_getnetent_r_proto getnetent_r $hdrs
14492 case "$d_getnetent_r_proto" in
14494 case "$getnetent_r_proto" in
14495 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14496 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14498 case "$getnetent_r_proto" in
14499 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14500 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14502 case "$getnetent_r_proto" in
14503 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14504 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14506 case "$getnetent_r_proto" in
14507 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14508 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14510 case "$getnetent_r_proto" in
14511 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14512 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14514 case "$getnetent_r_proto" in
14515 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14516 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14518 case "$getnetent_r_proto" in
14519 ''|0) d_getnetent_r=undef
14520 getnetent_r_proto=0
14521 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14522 * ) case "$getnetent_r_proto" in
14523 REENTRANT_PROTO*) ;;
14524 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14526 echo "Prototype: $try" ;;
14529 *) case "$usethreads" in
14530 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14532 d_getnetent_r=undef
14533 getnetent_r_proto=0
14537 *) getnetent_r_proto=0
14541 : see if prototypes for various getnetxxx netdb.h functions are available
14543 set d_getnetprotos getnetent $i_netdb netdb.h
14546 : see if getpagesize exists
14547 set getpagesize d_getpagsz
14550 : Optional checks for getprotobyname and getprotobynumber
14552 : see if getprotobyname exists
14553 set getprotobyname d_getpbyname
14556 : see if getprotobynumber exists
14557 set getprotobynumber d_getpbynumber
14560 : see if getprotoent exists
14561 set getprotoent d_getpent
14564 : see if getpgid exists
14565 set getpgid d_getpgid
14568 : see if getpgrp2 exists
14569 set getpgrp2 d_getpgrp2
14572 : see if getppid exists
14573 set getppid d_getppid
14576 : see if getpriority exists
14577 set getpriority d_getprior
14580 : see if getprotobyname_r exists
14581 set getprotobyname_r d_getprotobyname_r
14583 case "$d_getprotobyname_r" in
14585 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14586 case "$d_getprotobyname_r_proto:$usethreads" in
14587 ":define") d_getprotobyname_r_proto=define
14588 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14592 case "$d_getprotobyname_r_proto" in
14594 case "$getprotobyname_r_proto" in
14595 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14596 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14598 case "$getprotobyname_r_proto" in
14599 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14600 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14602 case "$getprotobyname_r_proto" in
14603 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14604 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14606 case "$getprotobyname_r_proto" in
14607 ''|0) d_getprotobyname_r=undef
14608 getprotobyname_r_proto=0
14609 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14610 * ) case "$getprotobyname_r_proto" in
14611 REENTRANT_PROTO*) ;;
14612 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14614 echo "Prototype: $try" ;;
14617 *) case "$usethreads" in
14618 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14620 d_getprotobyname_r=undef
14621 getprotobyname_r_proto=0
14625 *) getprotobyname_r_proto=0
14629 : see if getprotobynumber_r exists
14630 set getprotobynumber_r d_getprotobynumber_r
14632 case "$d_getprotobynumber_r" in
14634 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14635 case "$d_getprotobynumber_r_proto:$usethreads" in
14636 ":define") d_getprotobynumber_r_proto=define
14637 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14641 case "$d_getprotobynumber_r_proto" in
14643 case "$getprotobynumber_r_proto" in
14644 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14645 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14647 case "$getprotobynumber_r_proto" in
14648 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14649 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14651 case "$getprotobynumber_r_proto" in
14652 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14653 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14655 case "$getprotobynumber_r_proto" in
14656 ''|0) d_getprotobynumber_r=undef
14657 getprotobynumber_r_proto=0
14658 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14659 * ) case "$getprotobynumber_r_proto" in
14660 REENTRANT_PROTO*) ;;
14661 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14663 echo "Prototype: $try" ;;
14666 *) case "$usethreads" in
14667 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14669 d_getprotobynumber_r=undef
14670 getprotobynumber_r_proto=0
14674 *) getprotobynumber_r_proto=0
14678 : see if getprotoent_r exists
14679 set getprotoent_r d_getprotoent_r
14681 case "$d_getprotoent_r" in
14683 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14684 case "$d_getprotoent_r_proto:$usethreads" in
14685 ":define") d_getprotoent_r_proto=define
14686 set d_getprotoent_r_proto getprotoent_r $hdrs
14690 case "$d_getprotoent_r_proto" in
14692 case "$getprotoent_r_proto" in
14693 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14694 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14696 case "$getprotoent_r_proto" in
14697 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14698 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14700 case "$getprotoent_r_proto" in
14701 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14702 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14704 case "$getprotoent_r_proto" in
14705 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14706 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14708 case "$getprotoent_r_proto" in
14709 ''|0) d_getprotoent_r=undef
14710 getprotoent_r_proto=0
14711 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14712 * ) case "$getprotoent_r_proto" in
14713 REENTRANT_PROTO*) ;;
14714 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14716 echo "Prototype: $try" ;;
14719 *) case "$usethreads" in
14720 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14722 d_getprotoent_r=undef
14723 getprotoent_r_proto=0
14727 *) getprotoent_r_proto=0
14731 : see if prototypes for various getprotoxxx netdb.h functions are available
14733 set d_getprotoprotos getprotoent $i_netdb netdb.h
14736 : see if getprpwnam exists
14737 set getprpwnam d_getprpwnam
14740 : see if getpwent exists
14741 set getpwent d_getpwent
14744 : see if getpwent_r exists
14745 set getpwent_r d_getpwent_r
14747 case "$d_getpwent_r" in
14749 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14750 case "$d_getpwent_r_proto:$usethreads" in
14751 ":define") d_getpwent_r_proto=define
14752 set d_getpwent_r_proto getpwent_r $hdrs
14756 case "$d_getpwent_r_proto" in
14758 case "$getpwent_r_proto" in
14759 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14760 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14762 case "$getpwent_r_proto" in
14763 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14764 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14766 case "$getpwent_r_proto" in
14767 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14768 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14770 case "$getpwent_r_proto" in
14771 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14772 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14774 case "$getpwent_r_proto" in
14775 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14776 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14778 case "$getpwent_r_proto" in
14779 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14780 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14782 case "$getpwent_r_proto" in
14783 ''|0) d_getpwent_r=undef
14785 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14786 * ) case "$getpwent_r_proto" in
14787 REENTRANT_PROTO*) ;;
14788 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14790 echo "Prototype: $try" ;;
14793 *) case "$usethreads" in
14794 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14801 *) getpwent_r_proto=0
14805 : see if getpwnam_r exists
14806 set getpwnam_r d_getpwnam_r
14808 case "$d_getpwnam_r" in
14810 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14811 case "$d_getpwnam_r_proto:$usethreads" in
14812 ":define") d_getpwnam_r_proto=define
14813 set d_getpwnam_r_proto getpwnam_r $hdrs
14817 case "$d_getpwnam_r_proto" in
14819 case "$getpwnam_r_proto" in
14820 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14821 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14823 case "$getpwnam_r_proto" in
14824 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14825 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14827 case "$getpwnam_r_proto" in
14828 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14829 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14831 case "$getpwnam_r_proto" in
14832 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14833 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14835 case "$getpwnam_r_proto" in
14836 ''|0) d_getpwnam_r=undef
14838 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14839 * ) case "$getpwnam_r_proto" in
14840 REENTRANT_PROTO*) ;;
14841 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14843 echo "Prototype: $try" ;;
14846 *) case "$usethreads" in
14847 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14854 *) getpwnam_r_proto=0
14858 : see if getpwuid_r exists
14859 set getpwuid_r d_getpwuid_r
14861 case "$d_getpwuid_r" in
14863 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14864 case "$d_getpwuid_r_proto:$usethreads" in
14865 ":define") d_getpwuid_r_proto=define
14866 set d_getpwuid_r_proto getpwuid_r $hdrs
14870 case "$d_getpwuid_r_proto" in
14872 case "$getpwuid_r_proto" in
14873 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14874 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14876 case "$getpwuid_r_proto" in
14877 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14878 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14880 case "$getpwuid_r_proto" in
14881 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14882 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14884 case "$getpwuid_r_proto" in
14885 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14886 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14888 case "$getpwuid_r_proto" in
14889 ''|0) d_getpwuid_r=undef
14891 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14892 * ) case "$getpwuid_r_proto" in
14893 REENTRANT_PROTO*) ;;
14894 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14896 echo "Prototype: $try" ;;
14899 *) case "$usethreads" in
14900 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14907 *) getpwuid_r_proto=0
14911 : Optional checks for getsbyname and getsbyport
14913 : see if getservbyname exists
14914 set getservbyname d_getsbyname
14917 : see if getservbyport exists
14918 set getservbyport d_getsbyport
14921 : see if getservent exists
14922 set getservent d_getsent
14925 : see if getservbyname_r exists
14926 set getservbyname_r d_getservbyname_r
14928 case "$d_getservbyname_r" in
14930 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14931 case "$d_getservbyname_r_proto:$usethreads" in
14932 ":define") d_getservbyname_r_proto=define
14933 set d_getservbyname_r_proto getservbyname_r $hdrs
14937 case "$d_getservbyname_r_proto" in
14939 case "$getservbyname_r_proto" in
14940 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14941 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14943 case "$getservbyname_r_proto" in
14944 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14945 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14947 case "$getservbyname_r_proto" in
14948 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14949 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14951 case "$getservbyname_r_proto" in
14952 ''|0) d_getservbyname_r=undef
14953 getservbyname_r_proto=0
14954 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14955 * ) case "$getservbyname_r_proto" in
14956 REENTRANT_PROTO*) ;;
14957 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14959 echo "Prototype: $try" ;;
14962 *) case "$usethreads" in
14963 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14965 d_getservbyname_r=undef
14966 getservbyname_r_proto=0
14970 *) getservbyname_r_proto=0
14974 : see if getservbyport_r exists
14975 set getservbyport_r d_getservbyport_r
14977 case "$d_getservbyport_r" in
14979 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14980 case "$d_getservbyport_r_proto:$usethreads" in
14981 ":define") d_getservbyport_r_proto=define
14982 set d_getservbyport_r_proto getservbyport_r $hdrs
14986 case "$d_getservbyport_r_proto" in
14988 case "$getservbyport_r_proto" in
14989 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14990 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14992 case "$getservbyport_r_proto" in
14993 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14994 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14996 case "$getservbyport_r_proto" in
14997 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14998 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15000 case "$getservbyport_r_proto" in
15001 ''|0) d_getservbyport_r=undef
15002 getservbyport_r_proto=0
15003 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15004 * ) case "$getservbyport_r_proto" in
15005 REENTRANT_PROTO*) ;;
15006 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15008 echo "Prototype: $try" ;;
15011 *) case "$usethreads" in
15012 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15014 d_getservbyport_r=undef
15015 getservbyport_r_proto=0
15019 *) getservbyport_r_proto=0
15023 : see if getservent_r exists
15024 set getservent_r d_getservent_r
15026 case "$d_getservent_r" in
15028 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15029 case "$d_getservent_r_proto:$usethreads" in
15030 ":define") d_getservent_r_proto=define
15031 set d_getservent_r_proto getservent_r $hdrs
15035 case "$d_getservent_r_proto" in
15037 case "$getservent_r_proto" in
15038 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15039 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15041 case "$getservent_r_proto" in
15042 ''|0) try='int getservent_r(struct servent*, char*, int);'
15043 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15045 case "$getservent_r_proto" in
15046 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15047 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15049 case "$getservent_r_proto" in
15050 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15051 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15053 case "$getservent_r_proto" in
15054 ''|0) d_getservent_r=undef
15055 getservent_r_proto=0
15056 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15057 * ) case "$getservent_r_proto" in
15058 REENTRANT_PROTO*) ;;
15059 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15061 echo "Prototype: $try" ;;
15064 *) case "$usethreads" in
15065 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15067 d_getservent_r=undef
15068 getservent_r_proto=0
15072 *) getservent_r_proto=0
15076 : see if prototypes for various getservxxx netdb.h functions are available
15078 set d_getservprotos getservent $i_netdb netdb.h
15081 : see if getspnam exists
15082 set getspnam d_getspnam
15085 : see if this is a shadow.h system
15086 set shadow.h i_shadow
15089 : see if getspnam_r exists
15090 set getspnam_r d_getspnam_r
15092 case "$d_getspnam_r" in
15094 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15095 case "$d_getspnam_r_proto:$usethreads" in
15096 ":define") d_getspnam_r_proto=define
15097 set d_getspnam_r_proto getspnam_r $hdrs
15101 case "$d_getspnam_r_proto" in
15103 case "$getspnam_r_proto" in
15104 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15105 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15107 case "$getspnam_r_proto" in
15108 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15109 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15111 case "$getspnam_r_proto" in
15112 ''|0) d_getspnam_r=undef
15114 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15115 * ) case "$getspnam_r_proto" in
15116 REENTRANT_PROTO*) ;;
15117 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15119 echo "Prototype: $try" ;;
15122 *) case "$usethreads" in
15123 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15130 *) getspnam_r_proto=0
15134 : see if gettimeofday or ftime exists
15135 set gettimeofday d_gettimeod
15137 case "$d_gettimeod" in
15143 val="$undef"; set d_ftime; eval $setvar
15146 case "$d_gettimeod$d_ftime" in
15149 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15153 : see if gmtime_r exists
15154 set gmtime_r d_gmtime_r
15156 case "$d_gmtime_r" in
15158 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15159 case "$d_gmtime_r_proto:$usethreads" in
15160 ":define") d_gmtime_r_proto=define
15161 set d_gmtime_r_proto gmtime_r $hdrs
15165 case "$d_gmtime_r_proto" in
15167 case "$gmtime_r_proto" in
15168 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15169 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15171 case "$gmtime_r_proto" in
15172 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15173 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15175 case "$gmtime_r_proto" in
15176 ''|0) d_gmtime_r=undef
15178 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15179 * ) case "$gmtime_r_proto" in
15180 REENTRANT_PROTO*) ;;
15181 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15183 echo "Prototype: $try" ;;
15186 *) case "$usethreads" in
15187 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15194 *) gmtime_r_proto=0
15198 : see if hasmntopt exists
15199 set hasmntopt d_hasmntopt
15202 : see if this is a netinet/in.h or sys/in.h system
15203 set netinet/in.h i_niin sys/in.h i_sysin
15206 : see if arpa/inet.h has to be included
15207 set arpa/inet.h i_arpainet
15210 : see if htonl --and friends-- exists
15215 : Maybe they are macros.
15218 $cat >htonl.c <<EOM
15220 #include <sys/types.h>
15221 #$i_niin I_NETINET_IN
15223 #$i_arpainet I_ARPA_INET
15224 #ifdef I_NETINET_IN
15225 #include <netinet/in.h>
15228 #include <sys/in.h>
15231 #include <arpa/inet.h>
15234 printf("Defined as a macro.");
15237 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15238 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15240 echo "But it seems to be defined as a macro." >&4
15248 : see if ilogbl exists
15249 set ilogbl d_ilogbl
15254 if set index val -f; eval $csym; $val; then
15255 if set strchr val -f d_strchr; eval $csym; $val; then
15256 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15259 echo "strchr() found." >&4
15263 echo "index() found." >&4
15268 echo "index() found." >&4
15271 if set strchr val -f d_strchr; eval $csym; $val; then
15274 echo "strchr() found." >&4
15276 echo "No index() or strchr() found!" >&4
15281 set d_strchr; eval $setvar
15283 set d_index; eval $setvar
15285 : check whether inet_aton exists
15286 set inet_aton d_inetaton
15289 : see if inet_ntop exists
15290 set inet_ntop d_inetntop
15293 : see if inet_pton exists
15294 set inet_pton d_inetpton
15299 $cat >isascii.c <<EOCP
15302 #$i_stdlib I_STDLIB
15304 #include <stdlib.h>
15315 if eval $compile; then
15316 echo "isascii() found." >&4
15319 echo "isascii() NOT found." >&4
15328 $cat >isblank.c <<'EOCP'
15339 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15340 echo "isblank() found." >&4
15343 echo "isblank() NOT found." >&4
15350 : see if isfinite exists
15351 set isfinite d_isfinite
15354 : see if isinf exists
15358 : see if isnan exists
15362 : see if isnanl exists
15363 set isnanl d_isnanl
15366 : see if killpg exists
15367 set killpg d_killpg
15370 : see if lchown exists
15372 $cat > try.c <<'EOCP'
15373 /* System header to define __stub macros and hopefully few prototypes,
15374 which can conflict with char lchown(); below. */
15375 #include <assert.h>
15376 /* Override any gcc2 internal prototype to avoid an error. */
15377 /* We use char because int might match the return type of a gcc2
15378 builtin and then its argument prototype would still apply. */
15381 /* The GNU C library defines this for functions which it implements
15382 to always fail with ENOSYS. Some functions are actually named
15383 something starting with __ and the normal name is an alias. */
15384 #if defined (__stub_lchown) || defined (__stub___lchown)
15392 if eval $compile; then
15393 $echo "lchown() found." >&4
15396 $echo "lchown() NOT found." >&4
15402 : See if number of significant digits in a double precision number is known
15404 $cat >ldbl_dig.c <<EOM
15405 #$i_limits I_LIMITS
15408 #include <limits.h>
15414 printf("Contains LDBL_DIG");
15417 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15418 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15419 echo "LDBL_DIG found." >&4
15422 echo "LDBL_DIG NOT found." >&4
15429 : see if this is a math.h system
15433 : check to see if math.h defines _LIB_VERSION
15434 d_libm_lib_version="$undef"
15438 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15440 #include <unistd.h>
15442 int main (int argc, char *argv[])
15444 printf ("%d\n", _LIB_VERSION);
15449 if eval $compile; then
15451 echo "Yes, it does ($foo)" >&4
15452 d_libm_lib_version="$define"
15454 echo "No, it does not (probably harmless)" >&4
15461 : see if link exists
15465 : see if localtime_r exists
15466 set localtime_r d_localtime_r
15468 case "$d_localtime_r" in
15470 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15471 case "$d_localtime_r_proto:$usethreads" in
15472 ":define") d_localtime_r_proto=define
15473 set d_localtime_r_proto localtime_r $hdrs
15477 case "$d_localtime_r_proto" in
15479 case "$localtime_r_proto" in
15480 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15481 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15483 case "$localtime_r_proto" in
15484 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15485 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15487 case "$localtime_r_proto" in
15488 ''|0) d_localtime_r=undef
15489 localtime_r_proto=0
15490 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15491 * ) case "$localtime_r_proto" in
15492 REENTRANT_PROTO*) ;;
15493 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15495 echo "Prototype: $try" ;;
15498 *) case "$usethreads" in
15499 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15501 d_localtime_r=undef
15502 localtime_r_proto=0
15506 *) localtime_r_proto=0
15510 : see if localtime_r calls tzset
15511 case "$localtime_r_proto" in
15514 /* Does our libc's localtime_r call tzset ?
15515 * return 0 if so, 1 otherwise.
15517 #$i_systypes I_SYS_TYPES
15518 #$i_unistd I_UNISTD
15520 #$i_stdlib I_STDLIB
15521 #$i_string I_STRING
15522 #$i_malloc I_MALLOC
15524 # include <sys/types.h>
15527 # include <unistd.h>
15533 #include <stdlib.h>
15536 # include <string.h>
15538 # include <strings.h>
15541 # include <malloc.h>
15545 time_t t = time(0L);
15546 char w_tz[]="TZ" "=GMT+5",
15547 e_tz[]="TZ" "=GMT-5",
15548 *tz_e = (char*)malloc(16),
15549 *tz_w = (char*)malloc(16);
15550 struct tm tm_e, tm_w;
15551 memset(&tm_e,'\0',sizeof(struct tm));
15552 memset(&tm_w,'\0',sizeof(struct tm));
15557 localtime_r(&t, &tm_e);
15560 localtime_r(&t, &tm_w);
15562 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15568 if eval $compile; then
15569 if $run ./try; then
15570 d_localtime_r_needs_tzset=undef;
15572 d_localtime_r_needs_tzset=define;
15575 d_localtime_r_needs_tzset=undef;
15579 d_localtime_r_needs_tzset=undef;
15584 : see if localeconv exists
15585 set localeconv d_locconv
15588 : see if lockf exists
15592 : see if prototype for lseek is available
15594 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15597 : see if lstat exists
15601 : see if madvise exists
15602 set madvise d_madvise
15605 : see if malloc_size exists
15606 set malloc_size d_malloc_size
15609 : see if malloc_size_good exists
15610 set malloc_good_size d_malloc_good_size
15613 : see if mblen exists
15617 : see if mbstowcs exists
15618 set mbstowcs d_mbstowcs
15621 : see if mbtowc exists
15622 set mbtowc d_mbtowc
15625 : see if memchr exists
15626 set memchr d_memchr
15629 : see if memcmp exists
15630 set memcmp d_memcmp
15633 : see if memcpy exists
15634 set memcpy d_memcpy
15637 : see if memmove exists
15638 set memmove d_memmove
15641 : see if memset exists
15642 set memset d_memset
15645 : see if mkdir exists
15649 : see if mkdtemp exists
15650 set mkdtemp d_mkdtemp
15653 : see if mkfifo exists
15654 set mkfifo d_mkfifo
15657 : see if mkstemp exists
15658 set mkstemp d_mkstemp
15661 : see if mkstemps exists
15662 set mkstemps d_mkstemps
15665 : see if mktime exists
15666 set mktime d_mktime
15669 : see if this is a sys/mman.h system
15670 set sys/mman.h i_sysmman
15673 : see if mmap exists
15676 : see what shmat returns
15677 : default to something harmless
15679 case "$i_sysmman$d_mmap" in
15681 $cat >mmap.c <<'END'
15682 #include <sys/mman.h>
15685 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15690 echo "and it returns ($mmaptype)." >&4
15696 : see if sqrtl exists
15700 : see if scalbnl exists
15701 set scalbnl d_scalbnl
15704 : see if modfl exists
15708 : see if prototype for modfl is available
15710 set d_modflproto modfl $i_math math.h
15713 d_modfl_pow32_bug="$undef"
15715 case "$d_longdbl$d_modfl" in
15718 Checking to see whether your modfl() is okay for large values...
15724 if $test "X$d_modflproto" != "X$define"; then
15725 $cat >>try.c <<EOCP
15726 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15727 long double modfl (long double, long double *);
15730 $cat >>try.c <<EOCP
15732 long double nv = 4294967303.15;
15738 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15742 case "$osname:$gccversion" in
15743 aix:) saveccflags="$ccflags"
15744 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15747 if eval $compile; then
15750 *" 4294967303.150000 1.150000 4294967302.000000")
15751 echo >&4 "Your modfl() is broken for large values."
15752 d_modfl_pow32_bug="$define"
15754 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15758 *" 4294967303.150000 0.150000 4294967303.000000")
15759 echo >&4 "Your modfl() seems okay for large values."
15761 *) echo >&4 "I don't understand your modfl() at all."
15767 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15770 case "$osname:$gccversion" in
15771 aix:) ccflags="$saveccflags" ;; # restore
15776 if $test "$uselongdouble" = "$define"; then
15778 if $test "$d_sqrtl" != "$define"; then
15779 message="$message sqrtl"
15781 if $test "$d_modfl" != "$define"; then
15782 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15783 echo "You have both aintl and copysignl, so I can emulate modfl."
15785 message="$message modfl"
15788 if $test "$d_frexpl" != "$define"; then
15789 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15790 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15792 message="$message frexpl"
15796 if $test "$message" != ""; then
15799 *** You requested the use of long doubles but you do not seem to have
15800 *** the following mathematical functions needed for long double support:
15802 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15803 *** Cannot continue, aborting.
15811 : see if mprotect exists
15812 set mprotect d_mprotect
15815 : see if msgctl exists
15816 set msgctl d_msgctl
15819 : see if msgget exists
15820 set msgget d_msgget
15823 : see if msgsnd exists
15824 set msgsnd d_msgsnd
15827 : see if msgrcv exists
15828 set msgrcv d_msgrcv
15831 : see how much of the 'msg*(2)' library is present.
15834 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15835 *"$undef"*) h_msg=false;;
15839 case "`ipcs 2>&1`" in
15840 "SVID messages"*"not configured"*)
15841 echo "Your $osname does not have the msg*(2) configured." >&4
15844 set msgctl d_msgctl
15846 set msgget d_msgget
15848 set msgsnd d_msgsnd
15850 set msgrcv d_msgrcv
15856 : we could also check for sys/ipc.h ...
15857 if $h_msg && $test `./findhdr sys/msg.h`; then
15858 echo "You have the full msg*(2) library." >&4
15861 echo "You don't have the full msg*(2) library." >&4
15867 : Check for msghdr_s
15869 echo "Checking to see if your system supports struct msghdr..." >&4
15870 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15872 case "$d_msghdr_s" in
15873 "$define") echo "Yes, it does." ;;
15874 *) echo "No, it doesn't." ;;
15878 : see if msync exists
15882 : see if munmap exists
15883 set munmap d_munmap
15886 : see if nice exists
15890 : see if this is a langinfo.h system
15891 set langinfo.h i_langinfo
15894 : see if nl_langinfo exists
15895 set nl_langinfo d_nl_langinfo
15898 : check for volatile keyword
15900 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15901 $cat >try.c <<'EOCP'
15904 typedef struct _goo_struct goo_struct;
15905 goo_struct * volatile goo = ((goo_struct *)0);
15906 struct _goo_struct {
15911 typedef unsigned short foo_t;
15912 char *volatile foo;
15914 volatile foo_t blech;
15918 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15920 echo "Yup, it does."
15923 echo "Nope, it doesn't."
15929 : Check basic sizes
15931 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15933 case "$use64bitint:$d_quad:$quadtype" in
15936 uvtype="$uquadtype"
15941 uvtype="unsigned long"
15947 case "$uselongdouble:$d_longdbl" in
15949 nvtype="long double"
15950 nvsize=$longdblsize
15957 $echo "(IV will be "$ivtype", $ivsize bytes)"
15958 $echo "(UV will be "$uvtype", $uvsize bytes)"
15959 $echo "(NV will be "$nvtype", $nvsize bytes)"
15962 #$i_inttypes I_INTTYPES
15964 #include <inttypes.h>
15969 int8_t i = INT8_MAX;
15970 uint8_t u = UINT8_MAX;
15971 printf("int8_t\n");
15974 int16_t i = INT16_MAX;
15975 uint16_t u = UINT16_MAX;
15976 printf("int16_t\n");
15979 int32_t i = INT32_MAX;
15980 uint32_t u = UINT32_MAX;
15981 printf("int32_t\n");
15986 i8type="signed char"
15987 u8type="unsigned char"
15992 '') case "$shortsize" in
15994 u16type="unsigned short"
16002 '') set try -DINT16
16003 if eval $compile; then
16004 case "`$run ./try`" in
16016 '') if $test $shortsize -ge 2; then
16018 u16type="unsigned short"
16026 '') case "$longsize" in
16028 u32type="unsigned long"
16032 *) case "$intsize" in
16034 u32type="unsigned int"
16044 '') set try -DINT32
16045 if eval $compile; then
16046 case "`$run ./try`" in
16058 '') if $test $intsize -ge 4; then
16060 u32type="unsigned int"
16068 '') case "$d_quad:$quadtype" in
16070 i64type="$quadtype"
16071 u64type="$uquadtype"
16079 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16080 : volatile so that the compiler has to store it out to memory.
16081 if test X"$d_volatile" = X"$define"; then
16086 #$i_stdlib I_STDLIB
16088 #include <stdlib.h>
16090 #include <sys/types.h>
16091 #include <signal.h>
16093 $volatile int bletched = 0;
16094 $signal_t blech(int s) { bletched = 1; }
16099 int n = 8 * $uvsize;
16102 signal(SIGFPE, blech);
16105 for (i = 0; i < n; i++) {
16106 u = u << 1 | ($uvtype)1;
16108 if (($uvtype)d != u)
16112 d = ($nvtype)(u - 1);
16113 if (($uvtype)d != (u - 1))
16120 printf("%d\n", ((i == n) ? -n : i));
16126 d_nv_preserves_uv="$undef"
16127 if eval $compile; then
16128 nv_preserves_uv_bits="`$run ./try`"
16130 case "$nv_preserves_uv_bits" in
16132 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16133 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16134 d_nv_preserves_uv="$define"
16136 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16137 d_nv_preserves_uv="$undef" ;;
16138 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16139 nv_preserves_uv_bits="0" ;;
16143 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16144 : volatile so that the compiler has to store it out to memory.
16145 if test X"$d_volatile" = X"$define"; then
16151 typedef $nvtype NV;
16158 while(count < 256) {
16159 $volatile NV up = value + 1.0;
16160 $volatile NV negated = -value;
16161 $volatile NV down = negated - 1.0;
16162 $volatile NV got_up = up - value;
16163 int up_good = got_up == 1.0;
16164 int got_down = down - negated;
16165 int down_good = got_down == -1.0;
16167 if (down_good != up_good) {
16169 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16170 up_good, (double) got_up, down_good, (double) got_down,
16171 count, (double) value);
16178 fputs("256.0", stdout);
16181 fputs("2.0", stdout);
16187 fputs("*", stdout);
16193 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16194 count, (double) value);
16200 nv_overflows_integers_at='0'
16201 if eval $compile; then
16207 The largest integer your NVs can preserve is equal to $xxx
16209 nv_overflows_integers_at="$xxx"
16212 Cannot determine the largest integer value your NVs can hold, unexpected output
16219 Cannot determine the largest integer value your NVs can hold
16226 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16227 : volatile so that the compiler has to store it out to memory.
16228 if test X"$d_volatile" = X"$define"; then
16233 #$i_stdlib I_STDLIB
16235 #include <stdlib.h>
16237 #$i_string I_STRING
16239 # include <string.h>
16241 # include <strings.h>
16243 #include <sys/types.h>
16244 #include <signal.h>
16246 $volatile int bletched = 0;
16247 $signal_t blech(int s) { bletched = 1; }
16250 int checkit($nvtype d, char *where) {
16251 unsigned char *p = (char *)&d;
16252 unsigned char *end = p + sizeof(d);
16262 printf("No - %s: 0x", where);
16264 printf ("%02X", *p++);
16269 int main(int argc, char **argv) {
16272 fail += checkit(d, "0.0");
16274 /* The compiler shouldn't be assuming that bletched is 0 */
16277 fail += checkit(d, "bleched");
16280 signal(SIGFPE, blech);
16283 /* Paranoia - the compiler should have no way of knowing that ANSI says
16284 that argv[argc] will always be NULL. Actually, if it did assume this it
16285 would be buggy, as this is C and main() can be called from elsewhere in
16287 d = argv[argc] ? 1 : 0;
16290 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16293 fail += checkit(d, "ternary");
16295 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16298 printf("No - memset doesn't give 0.0\n");
16299 /* This might just blow up: */
16300 printf("(gives %g)\n", d);
16306 printf("No - something bleched\n");
16311 printf("No - %d fail(s)\n", fail);
16320 d_nv_zero_is_allbits_zero="$undef"
16321 if eval $compile; then
16327 0.0 is represented as all bits zero in memory
16329 d_nv_zero_is_allbits_zero="$define"
16332 0.0 is not represented as all bits zero in memory
16334 d_nv_zero_is_allbits_zero="$undef"
16339 0.0 is not represented as all bits zero in memory
16341 d_nv_zero_is_allbits_zero="$undef"
16347 : check for off64_t
16349 echo "Checking to see if you have off64_t..." >&4
16351 #include <sys/types.h>
16352 #include <unistd.h>
16353 int main() { off64_t x = 7; }
16356 if eval $compile; then
16358 echo "You have off64_t."
16361 echo "You do not have off64_t."
16362 case "$lseeksize" in
16363 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16370 : how to create joinable pthreads
16371 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16373 echo "Checking what constant to use for creating joinable pthreads..." >&4
16374 $cat >try.c <<'EOCP'
16375 #include <pthread.h>
16377 int detachstate = JOINABLE;
16380 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16381 if eval $compile; then
16382 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16383 val="$undef" # Yes, undef.
16384 set d_old_pthread_create_joinable
16387 set old_pthread_create_joinable
16390 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16391 if eval $compile; then
16392 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16394 set d_old_pthread_create_joinable
16396 val=PTHREAD_CREATE_UNDETACHED
16397 set old_pthread_create_joinable
16400 set try -DJOINABLE=__UNDETACHED
16401 if eval $compile; then
16402 echo "You seem to use __UNDETACHED." >&4
16404 set d_old_pthread_create_joinable
16407 set old_pthread_create_joinable
16410 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16412 set d_old_pthread_create_joinable
16415 set old_pthread_create_joinable
16422 d_old_pthread_create_joinable="$undef"
16423 old_pthread_create_joinable=""
16426 : see if pause exists
16430 : see if poll exists
16434 : see if prctl exists
16438 : see if prctl supports PR_SET_NAME
16439 d_prctl_set_name=$undef
16443 #include <sys/prctl.h>
16445 int main (int argc, char *argv[])
16447 return (prctl (PR_SET_NAME, "Test"));
16451 if eval $compile_ok && $run ./try; then
16452 echo "Your prctl (PR_SET_NAME, ...) works"
16453 d_prctl_set_name=$define
16459 : see if readlink exists
16460 set readlink d_readlink
16463 : Check if exe is symlink to abs path of executing program
16467 case "$d_readlink" in
16469 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16470 : more tidy to avoid an extra level of symlink
16471 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16472 while test $# -gt 0; do
16475 if $issymlink $try; then
16476 $ls -l $try > reflect
16477 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16478 echo "You have $type-like $try."
16479 procselfexe='"'$try'"'
16481 : This will break out of the loop
16492 : backward compatibility for d_hvfork
16493 if test X$d_hvfork != X; then
16494 d_vfork="$d_hvfork"
16497 : see if there is a vfork
16502 d_pseudofork=$undef
16504 : Ok, but do we want to use it. vfork is reportedly unreliable in
16505 : perl on Solaris 2.x, and probably elsewhere.
16509 case "$usevfork" in
16515 Perl can only use a vfork() that doesn't suffer from strict
16516 restrictions on calling functions or modifying global data in
16517 the child. For example, glibc-2.1 contains such a vfork()
16518 that is unsuitable. If your system provides a proper fork()
16519 call, chances are that you do NOT want perl to use vfork().
16522 rp="Do you still want to use vfork()?"
16527 echo "Ok, we won't use vfork()."
16536 $define) usevfork='true';;
16537 *) usevfork='false';;
16540 : see whether the pthread_atfork exists
16542 #include <pthread.h>
16545 #ifdef PTHREAD_ATFORK
16546 pthread_atfork(NULL,NULL,NULL);
16551 : see if pthread_atfork exists
16552 set try -DPTHREAD_ATFORK
16553 if eval $compile; then
16558 case "$usethreads" in
16561 $define) echo 'pthread_atfork found.' >&4 ;;
16562 *) echo 'pthread_atfork NOT found.' >&4 ;;
16565 set d_pthread_atfork
16568 : see if pthread_attr_setscope exists
16569 set pthread_attr_setscope d_pthread_attr_setscope
16572 : see whether the various POSIXish _yields exist
16574 #include <pthread.h>
16580 #ifdef PTHREAD_YIELD
16583 #ifdef PTHREAD_YIELD_NULL
16584 pthread_yield(NULL);
16590 : see if sched_yield exists
16591 set try -DSCHED_YIELD
16592 if eval $compile; then
16594 sched_yield='sched_yield()'
16598 case "$usethreads" in
16601 $define) echo 'sched_yield() found.' >&4 ;;
16602 *) echo 'sched_yield() NOT found.' >&4 ;;
16608 : see if pthread_yield exists
16609 set try -DPTHREAD_YIELD
16610 if eval $compile; then
16612 case "$sched_yield" in
16613 '') sched_yield='pthread_yield()' ;;
16616 set try -DPTHREAD_YIELD_NULL
16617 if eval $compile; then
16619 case "$sched_yield" in
16620 '') sched_yield='pthread_yield(NULL)' ;;
16626 case "$usethreads" in
16629 $define) echo 'pthread_yield() found.' >&4 ;;
16630 *) echo 'pthread_yield() NOT found.' >&4 ;;
16634 set d_pthread_yield
16636 case "$sched_yield" in
16637 '') sched_yield=undef ;;
16641 : see if random_r exists
16642 set random_r d_random_r
16644 case "$d_random_r" in
16646 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16647 case "$d_random_r_proto:$usethreads" in
16648 ":define") d_random_r_proto=define
16649 set d_random_r_proto random_r $hdrs
16653 case "$d_random_r_proto" in
16655 case "$random_r_proto" in
16656 ''|0) try='int random_r(int*, struct random_data*);'
16657 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16659 case "$random_r_proto" in
16660 ''|0) try='int random_r(long*, struct random_data*);'
16661 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16663 case "$random_r_proto" in
16664 ''|0) try='int random_r(struct random_data*, int32_t*);'
16665 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16667 case "$random_r_proto" in
16668 ''|0) d_random_r=undef
16670 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16671 * ) case "$random_r_proto" in
16672 REENTRANT_PROTO*) ;;
16673 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16675 echo "Prototype: $try" ;;
16678 *) case "$usethreads" in
16679 define) echo "random_r has no prototype, not using it." >&4 ;;
16686 *) random_r_proto=0
16690 : see if readdir and friends exist
16691 set readdir d_readdir
16693 set seekdir d_seekdir
16695 set telldir d_telldir
16697 set rewinddir d_rewinddir
16700 : see if readdir64_r exists
16701 set readdir64_r d_readdir64_r
16703 case "$d_readdir64_r" in
16705 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16706 case "$d_readdir64_r_proto:$usethreads" in
16707 ":define") d_readdir64_r_proto=define
16708 set d_readdir64_r_proto readdir64_r $hdrs
16712 case "$d_readdir64_r_proto" in
16714 case "$readdir64_r_proto" in
16715 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16716 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16718 case "$readdir64_r_proto" in
16719 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16720 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16722 case "$readdir64_r_proto" in
16723 ''|0) d_readdir64_r=undef
16724 readdir64_r_proto=0
16725 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16726 * ) case "$readdir64_r_proto" in
16727 REENTRANT_PROTO*) ;;
16728 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16730 echo "Prototype: $try" ;;
16733 *) case "$usethreads" in
16734 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16736 d_readdir64_r=undef
16737 readdir64_r_proto=0
16741 *) readdir64_r_proto=0
16745 : see if readdir_r exists
16746 set readdir_r d_readdir_r
16748 case "$d_readdir_r" in
16750 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16751 case "$d_readdir_r_proto:$usethreads" in
16752 ":define") d_readdir_r_proto=define
16753 set d_readdir_r_proto readdir_r $hdrs
16757 case "$d_readdir_r_proto" in
16759 case "$readdir_r_proto" in
16760 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16761 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16763 case "$readdir_r_proto" in
16764 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16765 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16767 case "$readdir_r_proto" in
16768 ''|0) d_readdir_r=undef
16770 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16771 * ) case "$readdir_r_proto" in
16772 REENTRANT_PROTO*) ;;
16773 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16775 echo "Prototype: $try" ;;
16778 *) case "$usethreads" in
16779 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16786 *) readdir_r_proto=0
16790 : see if readv exists
16794 : see if recvmsg exists
16795 set recvmsg d_recvmsg
16798 : see if rename exists
16799 set rename d_rename
16802 : see if rmdir exists
16806 : see if memory.h is available.
16811 : See if it conflicts with string.h
16817 $cppstdin $cppflags $cppminus < $strings > mem.h
16818 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16820 echo "We won't be including <memory.h>."
16830 : can bcopy handle overlapping blocks?
16833 case "$d_memmove" in
16834 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16835 *) case "$d_bcopy" in
16837 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16839 #$i_memory I_MEMORY
16840 #$i_stdlib I_STDLIB
16841 #$i_string I_STRING
16842 #$i_unistd I_UNISTD
16844 $cat >>try.c <<'EOCP'
16847 # include <memory.h>
16850 # include <stdlib.h>
16853 # include <string.h>
16855 # include <strings.h>
16858 # include <unistd.h> /* Needed for NetBSD */
16862 char buf[128], abc[128];
16868 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16869 try to store the string in read-only memory. */
16870 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16872 for (align = 7; align >= 0; align--) {
16873 for (len = 36; len; len--) {
16875 bcopy(abc, b, len);
16876 for (off = 1; off <= len; off++) {
16877 bcopy(b, b+off, len);
16878 bcopy(b+off, b, len);
16879 if (bcmp(b, abc, len))
16888 if eval $compile_ok; then
16889 if $run ./try 2>/dev/null; then
16890 echo "Yes, it can."
16893 echo "It can't, sorry."
16896 echo "(I can't compile the test program, so we'll assume not...)"
16906 : can memcpy handle overlapping blocks?
16909 case "$d_memmove" in
16910 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16911 *) case "$d_memcpy" in
16913 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16915 #$i_memory I_MEMORY
16916 #$i_stdlib I_STDLIB
16917 #$i_string I_STRING
16918 #$i_unistd I_UNISTD
16920 $cat >>try.c <<'EOCP'
16923 # include <memory.h>
16926 # include <stdlib.h>
16929 # include <string.h>
16931 # include <strings.h>
16934 # include <unistd.h> /* Needed for NetBSD */
16938 char buf[128], abc[128];
16944 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16945 try to store the string in read-only memory. */
16946 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16948 for (align = 7; align >= 0; align--) {
16949 for (len = 36; len; len--) {
16951 memcpy(b, abc, len);
16952 for (off = 1; off <= len; off++) {
16953 memcpy(b+off, b, len);
16954 memcpy(b, b+off, len);
16955 if (memcmp(b, abc, len))
16964 if eval $compile_ok; then
16965 if $run ./try 2>/dev/null; then
16966 echo "Yes, it can."
16969 echo "It can't, sorry."
16972 echo "(I can't compile the test program, so we'll assume not...)"
16982 : can memcmp be trusted to compare relative magnitude?
16984 case "$d_memcmp" in
16987 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16989 #$i_memory I_MEMORY
16990 #$i_stdlib I_STDLIB
16991 #$i_string I_STRING
16992 #$i_unistd I_UNISTD
16994 $cat >>try.c <<'EOCP'
16997 # include <memory.h>
17000 # include <stdlib.h>
17003 # include <string.h>
17005 # include <strings.h>
17008 # include <unistd.h> /* Needed for NetBSD */
17014 if ((a < b) && memcmp(&a, &b, 1) < 0)
17020 if eval $compile_ok; then
17021 if $run ./try 2>/dev/null; then
17022 echo "Yes, it can."
17025 echo "No, it can't (it uses signed chars)."
17028 echo "(I can't compile the test program, so we'll assume not...)"
17036 : see if prototype for sbrk is available
17038 set d_sbrkproto sbrk $i_unistd unistd.h
17041 : see if select exists
17042 set select d_select
17045 : see if semctl exists
17046 set semctl d_semctl
17049 : see if semget exists
17050 set semget d_semget
17053 : see if semop exists
17057 : see how much of the 'sem*(2)' library is present.
17060 case "$d_semctl$d_semget$d_semop" in
17061 *"$undef"*) h_sem=false;;
17065 case "`ipcs 2>&1`" in
17066 "SVID messages"*"not configured"*)
17067 echo "Your $osname does not have the sem*(2) configured." >&4
17070 set semctl d_semctl
17072 set semget d_semget
17080 : we could also check for sys/ipc.h ...
17081 if $h_sem && $test `./findhdr sys/sem.h`; then
17082 echo "You have the full sem*(2) library." >&4
17085 echo "You don't have the full sem*(2) library." >&4
17091 : see whether sys/sem.h defines union semun
17093 $cat > try.c <<'END'
17094 #include <sys/types.h>
17095 #include <sys/ipc.h>
17096 #include <sys/sem.h>
17097 int main () { union semun semun; semun.buf = 0; }
17100 if eval $compile; then
17101 echo "You have union semun in <sys/sem.h>." >&4
17104 echo "You do not have union semun in <sys/sem.h>." >&4
17111 : see how to do semctl IPC_STAT
17115 $cat > tryh.h <<END
17118 # define S_IRUSR S_IREAD
17119 # define S_IWUSR S_IWRITE
17120 # define S_IXUSR S_IEXEC
17122 # define S_IRUSR 0400
17123 # define S_IWUSR 0200
17124 # define S_IXUSR 0100
17126 # define S_IRGRP (S_IRUSR>>3)
17127 # define S_IWGRP (S_IWUSR>>3)
17128 # define S_IXGRP (S_IXUSR>>3)
17129 # define S_IROTH (S_IRUSR>>6)
17130 # define S_IWOTH (S_IWUSR>>6)
17131 # define S_IXOTH (S_IXUSR>>6)
17134 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17135 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17136 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17139 : see whether semctl IPC_STAT can use union semun
17140 case "$d_semctl_semun" in
17144 #include <sys/types.h>
17145 #include <sys/ipc.h>
17146 #include <sys/sem.h>
17147 #include <sys/stat.h>
17154 #$d_union_semun HAS_UNION_SEMUN
17157 #ifndef HAS_UNION_SEMUN
17160 struct semid_ds *buf;
17161 unsigned short *array;
17167 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17168 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17170 struct semid_ds argbuf;
17173 st = semctl(sem, 0, IPC_STAT, arg);
17177 # endif /* IPC_STAT */
17178 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17180 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17181 # endif /* IPC_RMID */
17182 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17184 #endif /* IPC_PRIVATE && ... */
17185 printf("semget failed: errno = %d\n", errno);
17190 if eval $compile; then
17193 semun) val="$define" ;;
17201 case "$d_semctl_semun" in
17203 echo "You can use union semun for semctl IPC_STAT." >&4
17206 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17211 : see whether semctl IPC_STAT can use struct semid_ds pointer
17212 case "$d_semctl_semid_ds" in
17215 $cat > try.c <<'END'
17216 #include <sys/types.h>
17217 #include <sys/ipc.h>
17218 #include <sys/sem.h>
17219 #include <sys/stat.h>
17227 struct semid_ds arg;
17230 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17231 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17234 st = semctl(sem, 0, IPC_STAT, &arg);
17236 printf("semid_ds\n");
17238 # endif /* IPC_STAT */
17239 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17241 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17242 # endif /* IPC_RMID */
17243 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17245 #endif /* IPC_PRIVATE && ... */
17246 printf("semget failed: errno = %d\n", errno);
17252 if eval $compile; then
17255 semid_ds) val="$define" ;;
17259 set d_semctl_semid_ds
17263 case "$d_semctl_semid_ds" in
17265 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17267 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17273 # We do not have the full sem*(2) library, so assume we can not
17279 set d_semctl_semid_ds
17285 : see if sendmsg exists
17286 set sendmsg d_sendmsg
17289 : see if setegid exists
17290 set setegid d_setegid
17293 : see if seteuid exists
17294 set seteuid d_seteuid
17297 : see if setgrent exists
17298 set setgrent d_setgrent
17301 : see if setgrent_r exists
17302 set setgrent_r d_setgrent_r
17304 case "$d_setgrent_r" in
17306 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17307 case "$d_setgrent_r_proto:$usethreads" in
17308 ":define") d_setgrent_r_proto=define
17309 set d_setgrent_r_proto setgrent_r $hdrs
17313 case "$d_setgrent_r_proto" in
17315 case "$setgrent_r_proto" in
17316 ''|0) try='int setgrent_r(FILE**);'
17317 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17319 case "$setgrent_r_proto" in
17320 ''|0) try='void setgrent_r(FILE**);'
17321 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17323 case "$setgrent_r_proto" in
17324 ''|0) d_setgrent_r=undef
17326 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17327 * ) case "$setgrent_r_proto" in
17328 REENTRANT_PROTO*) ;;
17329 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17331 echo "Prototype: $try" ;;
17334 *) case "$usethreads" in
17335 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17342 *) setgrent_r_proto=0
17346 : see if sethostent exists
17347 set sethostent d_sethent
17350 : see if sethostent_r exists
17351 set sethostent_r d_sethostent_r
17353 case "$d_sethostent_r" in
17355 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17356 case "$d_sethostent_r_proto:$usethreads" in
17357 ":define") d_sethostent_r_proto=define
17358 set d_sethostent_r_proto sethostent_r $hdrs
17362 case "$d_sethostent_r_proto" in
17364 case "$sethostent_r_proto" in
17365 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17366 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17368 case "$sethostent_r_proto" in
17369 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17370 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17372 case "$sethostent_r_proto" in
17373 ''|0) d_sethostent_r=undef
17374 sethostent_r_proto=0
17375 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17376 * ) case "$sethostent_r_proto" in
17377 REENTRANT_PROTO*) ;;
17378 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17380 echo "Prototype: $try" ;;
17383 *) case "$usethreads" in
17384 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17386 d_sethostent_r=undef
17387 sethostent_r_proto=0
17391 *) sethostent_r_proto=0
17395 : see if setitimer exists
17396 set setitimer d_setitimer
17399 : see if setlinebuf exists
17400 set setlinebuf d_setlinebuf
17403 : see if setlocale exists
17404 set setlocale d_setlocale
17407 : see if locale.h is available
17408 set locale.h i_locale
17411 : see if setlocale_r exists
17412 set setlocale_r d_setlocale_r
17414 case "$d_setlocale_r" in
17416 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17417 case "$d_setlocale_r_proto:$usethreads" in
17418 ":define") d_setlocale_r_proto=define
17419 set d_setlocale_r_proto setlocale_r $hdrs
17423 case "$d_setlocale_r_proto" in
17425 case "$setlocale_r_proto" in
17426 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17427 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17429 case "$setlocale_r_proto" in
17430 ''|0) d_setlocale_r=undef
17431 setlocale_r_proto=0
17432 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17433 * ) case "$setlocale_r_proto" in
17434 REENTRANT_PROTO*) ;;
17435 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17437 echo "Prototype: $try" ;;
17440 *) case "$usethreads" in
17441 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17443 d_setlocale_r=undef
17444 setlocale_r_proto=0
17448 *) setlocale_r_proto=0
17452 : see if setnetent exists
17453 set setnetent d_setnent
17456 : see if setnetent_r exists
17457 set setnetent_r d_setnetent_r
17459 case "$d_setnetent_r" in
17461 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17462 case "$d_setnetent_r_proto:$usethreads" in
17463 ":define") d_setnetent_r_proto=define
17464 set d_setnetent_r_proto setnetent_r $hdrs
17468 case "$d_setnetent_r_proto" in
17470 case "$setnetent_r_proto" in
17471 ''|0) try='int setnetent_r(int, struct netent_data*);'
17472 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17474 case "$setnetent_r_proto" in
17475 ''|0) try='void setnetent_r(int, struct netent_data*);'
17476 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17478 case "$setnetent_r_proto" in
17479 ''|0) d_setnetent_r=undef
17480 setnetent_r_proto=0
17481 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17482 * ) case "$setnetent_r_proto" in
17483 REENTRANT_PROTO*) ;;
17484 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17486 echo "Prototype: $try" ;;
17489 *) case "$usethreads" in
17490 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17492 d_setnetent_r=undef
17493 setnetent_r_proto=0
17497 *) setnetent_r_proto=0
17501 : see if setprotoent exists
17502 set setprotoent d_setpent
17505 : see if setpgid exists
17506 set setpgid d_setpgid
17509 : see if setpgrp2 exists
17510 set setpgrp2 d_setpgrp2
17513 : see if setpriority exists
17514 set setpriority d_setprior
17517 : see if setproctitle exists
17518 set setproctitle d_setproctitle
17521 : see if setprotoent_r exists
17522 set setprotoent_r d_setprotoent_r
17524 case "$d_setprotoent_r" in
17526 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17527 case "$d_setprotoent_r_proto:$usethreads" in
17528 ":define") d_setprotoent_r_proto=define
17529 set d_setprotoent_r_proto setprotoent_r $hdrs
17533 case "$d_setprotoent_r_proto" in
17535 case "$setprotoent_r_proto" in
17536 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17537 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17539 case "$setprotoent_r_proto" in
17540 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17541 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17543 case "$setprotoent_r_proto" in
17544 ''|0) d_setprotoent_r=undef
17545 setprotoent_r_proto=0
17546 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17547 * ) case "$setprotoent_r_proto" in
17548 REENTRANT_PROTO*) ;;
17549 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17551 echo "Prototype: $try" ;;
17554 *) case "$usethreads" in
17555 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17557 d_setprotoent_r=undef
17558 setprotoent_r_proto=0
17562 *) setprotoent_r_proto=0
17566 : see if setpwent exists
17567 set setpwent d_setpwent
17570 : see if setpwent_r exists
17571 set setpwent_r d_setpwent_r
17573 case "$d_setpwent_r" in
17575 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17576 case "$d_setpwent_r_proto:$usethreads" in
17577 ":define") d_setpwent_r_proto=define
17578 set d_setpwent_r_proto setpwent_r $hdrs
17582 case "$d_setpwent_r_proto" in
17584 case "$setpwent_r_proto" in
17585 ''|0) try='int setpwent_r(FILE**);'
17586 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17588 case "$setpwent_r_proto" in
17589 ''|0) try='void setpwent_r(FILE**);'
17590 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17592 case "$setpwent_r_proto" in
17593 ''|0) d_setpwent_r=undef
17595 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17596 * ) case "$setpwent_r_proto" in
17597 REENTRANT_PROTO*) ;;
17598 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17600 echo "Prototype: $try" ;;
17603 *) case "$usethreads" in
17604 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17611 *) setpwent_r_proto=0
17615 : see if setregid exists
17616 set setregid d_setregid
17618 set setresgid d_setresgid
17621 : see if setreuid exists
17622 set setreuid d_setreuid
17624 set setresuid d_setresuid
17627 : see if setrgid exists
17628 set setrgid d_setrgid
17631 : see if setruid exists
17632 set setruid d_setruid
17635 : see if setservent exists
17636 set setservent d_setsent
17639 : see if setservent_r exists
17640 set setservent_r d_setservent_r
17642 case "$d_setservent_r" in
17644 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17645 case "$d_setservent_r_proto:$usethreads" in
17646 ":define") d_setservent_r_proto=define
17647 set d_setservent_r_proto setservent_r $hdrs
17651 case "$d_setservent_r_proto" in
17653 case "$setservent_r_proto" in
17654 ''|0) try='int setservent_r(int, struct servent_data*);'
17655 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17657 case "$setservent_r_proto" in
17658 ''|0) try='void setservent_r(int, struct servent_data*);'
17659 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17661 case "$setservent_r_proto" in
17662 ''|0) d_setservent_r=undef
17663 setservent_r_proto=0
17664 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17665 * ) case "$setservent_r_proto" in
17666 REENTRANT_PROTO*) ;;
17667 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17669 echo "Prototype: $try" ;;
17672 *) case "$usethreads" in
17673 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17675 d_setservent_r=undef
17676 setservent_r_proto=0
17680 *) setservent_r_proto=0
17684 : see if setsid exists
17685 set setsid d_setsid
17688 : see if setvbuf exists
17689 set setvbuf d_setvbuf
17692 : see if shmctl exists
17693 set shmctl d_shmctl
17696 : see if shmget exists
17697 set shmget d_shmget
17700 : see if shmat exists
17703 : see what shmat returns
17706 $cat >shmat.c <<'END'
17707 #include <sys/shm.h>
17710 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17715 echo "and it returns ($shmattype)." >&4
17716 : see if a prototype for shmat is available
17717 xxx=`./findhdr sys/shm.h`
17718 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17719 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17730 set d_shmatprototype
17733 : see if shmdt exists
17737 : see how much of the 'shm*(2)' library is present.
17740 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17741 *"$undef"*) h_shm=false;;
17745 case "`ipcs 2>&1`" in
17746 "SVID shared memory"*"not configured"*)
17747 echo "Your $osname does not have the shm*(2) configured." >&4
17750 set shmctl d_shmctl
17752 set shmget d_shmget
17762 : we could also check for sys/ipc.h ...
17763 if $h_shm && $test `./findhdr sys/shm.h`; then
17764 echo "You have the full shm*(2) library." >&4
17767 echo "You don't have the full shm*(2) library." >&4
17773 : see if we have sigaction
17775 if set sigaction val -f d_sigaction; eval $csym; $val; then
17776 echo 'sigaction() found.' >&4
17779 #include <sys/types.h>
17780 #include <signal.h>
17781 #$i_stdlib I_STDLIB
17783 #include <stdlib.h>
17787 struct sigaction act, oact;
17789 oact.sa_handler = 0;
17790 /* so that act and oact are used */
17791 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17795 if eval $compile_ok; then
17798 echo "But you don't seem to have a usable struct sigaction." >&4
17802 echo 'sigaction NOT found.' >&4
17805 set d_sigaction; eval $setvar
17808 : see if this is a sunmath.h system
17809 set sunmath.h i_sunmath
17812 : see if signbit exists
17813 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17816 #$i_sunmath I_SUNMATH
17820 #ifdef I_SUNMATH /* Solaris special math library */
17821 # include <sunmath.h>
17824 int main(int argc, char **argv)
17828 if ((signbit(x) == 0) && (signbit(y) != 0))
17836 if eval $compile; then
17837 if $run ./try; then
17841 $echo "Signbit seems to be available, but doesn't work as I expected."
17842 $echo "I won't use it." >&4
17853 : see if sigprocmask exists
17854 set sigprocmask d_sigprocmask
17857 : see if sigsetjmp exists
17859 case "$d_sigsetjmp" in
17862 #include <setjmp.h>
17863 #$i_stdlib I_STDLIB
17865 #include <stdlib.h>
17871 if (sigsetjmp(env,1))
17874 siglongjmp(env, 1);
17879 if eval $compile; then
17880 if $run ./try >/dev/null 2>&1; then
17881 echo "POSIX sigsetjmp found." >&4
17885 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17891 echo "sigsetjmp not found." >&4
17895 *) val="$d_sigsetjmp"
17896 case "$d_sigsetjmp" in
17897 $define) echo "POSIX sigsetjmp found." >&4;;
17898 $undef) echo "sigsetjmp not found." >&4;;
17906 : see if snprintf exists
17907 set snprintf d_snprintf
17910 : see if vsnprintf exists
17911 set vsnprintf d_vsnprintf
17914 case "$d_snprintf-$d_vsnprintf" in
17917 Checking whether your snprintf() and vsnprintf() work okay...
17919 $cat >try.c <<'EOCP'
17920 /* v?snprintf testing logic courtesy of Russ Allbery.
17921 * According to C99:
17922 * - if the buffer is too short it still must be \0-terminated
17923 * - if the buffer is too short the potentially required length
17924 * must be returned and not -1
17925 * - if the buffer is NULL the potentially required length
17926 * must be returned and not -1 or core dump
17929 #include <stdarg.h>
17933 int test (char *format, ...)
17938 va_start (args, format);
17939 count = vsnprintf (buf, sizeof buf, format, args);
17946 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17947 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17951 if eval $compile; then
17954 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17956 Your snprintf() and snprintf() don't seem to be working okay.
17958 d_snprintf="$undef"
17959 d_vsnprintf="$undef"
17963 echo "(I can't seem to compile the test program--assuming they don't)"
17964 d_snprintf="$undef"
17965 d_vsnprintf="$undef"
17971 : see if sockatmark exists
17972 set sockatmark d_sockatmark
17975 : see if prototype for sockatmark is available
17977 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17980 : see if socks5_init exists
17981 set socks5_init d_socks5_init
17984 : see if sprintf returns the length of the string in the buffer as per ANSI
17985 $echo "Checking whether sprintf returns the length of the string..." >&4
17988 #$i_stdlib I_STDLIB
17990 #include <stdlib.h>
17992 #$i_string I_STRING
17994 # include <string.h>
17996 # include <strings.h>
18005 int check (size_t expect, int test) {
18006 size_t got = strlen(buffer);
18010 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18015 int main(int argc, char **argv) {
18018 check(sprintf(buffer, ""), ++test);
18019 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18020 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18027 if eval $compile; then
18031 sprintf returns the length of the string (as ANSI says it should)
18033 d_sprintf_returns_strlen="$define"
18036 sprintf does not return the length of the string (how old is this system?)
18038 d_sprintf_returns_strlen="$undef"
18042 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18043 d_sprintf_returns_strlen="$undef"
18047 : see if srand48_r exists
18048 set srand48_r d_srand48_r
18050 case "$d_srand48_r" in
18052 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18053 case "$d_srand48_r_proto:$usethreads" in
18054 ":define") d_srand48_r_proto=define
18055 set d_srand48_r_proto srand48_r $hdrs
18059 case "$d_srand48_r_proto" in
18061 case "$srand48_r_proto" in
18062 ''|0) try='int srand48_r(long, struct drand48_data*);'
18063 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18065 case "$srand48_r_proto" in
18066 ''|0) d_srand48_r=undef
18068 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18069 * ) case "$srand48_r_proto" in
18070 REENTRANT_PROTO*) ;;
18071 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18073 echo "Prototype: $try" ;;
18076 *) case "$usethreads" in
18077 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18084 *) srand48_r_proto=0
18088 : see if srandom_r exists
18089 set srandom_r d_srandom_r
18091 case "$d_srandom_r" in
18093 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18094 case "$d_srandom_r_proto:$usethreads" in
18095 ":define") d_srandom_r_proto=define
18096 set d_srandom_r_proto srandom_r $hdrs
18100 case "$d_srandom_r_proto" in
18102 case "$srandom_r_proto" in
18103 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18104 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18106 case "$srandom_r_proto" in
18107 ''|0) d_srandom_r=undef
18109 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18110 * ) case "$srandom_r_proto" in
18111 REENTRANT_PROTO*) ;;
18112 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18114 echo "Prototype: $try" ;;
18117 *) case "$usethreads" in
18118 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18125 *) srandom_r_proto=0
18129 : see if prototype for setresgid is available
18131 set d_sresgproto setresgid $i_unistd unistd.h
18134 : see if prototype for setresuid is available
18136 set d_sresuproto setresuid $i_unistd unistd.h
18139 : see if sys/stat.h is available
18140 set sys/stat.h i_sysstat
18143 : see if stat knows about block sizes
18145 echo "Checking to see if your struct stat has st_blocks field..." >&4
18146 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18149 : see if this is a sys/vfs.h system
18150 set sys/vfs.h i_sysvfs
18153 : see if this is a sys/statfs.h system
18154 set sys/statfs.h i_sysstatfs
18157 : Check for statfs_s
18159 echo "Checking to see if your system supports struct statfs..." >&4
18160 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
18162 case "$d_statfs_s" in
18163 "$define") echo "Yes, it does." ;;
18164 *) echo "No, it doesn't." ;;
18168 : see if struct statfs knows about f_flags
18169 case "$d_statfs_s" in
18172 echo "Checking to see if your struct statfs has f_flags field..." >&4
18173 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
18177 set d_statfs_f_flags
18181 case "$d_statfs_f_flags" in
18182 "$define") echo "Yes, it does." ;;
18183 *) echo "No, it doesn't." ;;
18186 : see what flavor, if any, of static inline is supported
18188 echo "Checking to see if your system supports static inline..."
18189 $cat > try.c <<'EOCP'
18190 #include <stdlib.h>
18191 extern int f_via_a(int x);
18192 extern int f_via_b(int x);
18193 int main(int argc, char **argv)
18202 return EXIT_SUCCESS;
18205 return EXIT_FAILURE;
18209 $cat > a.c <<'EOCP'
18210 static INLINE int f(int x) {
18221 $cat > b.c <<'EOCP'
18222 extern int f(int x);
18230 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18231 case "$perl_static_inline" in
18232 '') # Check the various possibilities, and break out on success.
18233 # For gcc, prefer __inline__, which will still permit
18234 # cflags.SH to add in -ansi.
18235 case "$gccversion" in
18236 '') xxx="inline __inline__ __inline _inline";;
18237 *) xxx="__inline__ inline __inline _inline";;
18239 for inline in $xxx; do
18240 set try -DINLINE=$inline a.c
18241 if eval $compile && $run ./try; then
18242 # Now make sure there is no external linkage of static
18244 set try -DINLINE=$inline -DUSE_B a.c b.c
18245 if eval $compile && $run ./try; then
18246 $echo "Your compiler supports static $inline, " >&4
18247 $echo "but it also creates an external definition," >&4
18248 $echo "so I won't use it." >&4
18251 $echo "Your compiler supports static $inline." >&4
18253 perl_static_inline="static $inline";
18257 $echo "Your compiler does NOT support static $inline." >&4
18262 *inline*) # Some variant of inline exists.
18263 echo "Keeping your $hint value of $perl_static_inline."
18266 static) # No inline capabilities
18267 echo "Keeping your $hint value of $perl_static_inline."
18270 *) # Unrecognized previous value -- blindly trust the supplied
18271 # value and hope it makes sense. Use old value for
18272 # d_static_inline, if there is one.
18273 echo "Keeping your $hint value of $perl_static_inline."
18274 case "$d_static_inline" in
18276 *) val=$d_static_inline ;;
18280 # Fallback to plain 'static' if nothing worked.
18281 case "$perl_static_inline" in
18283 perl_static_inline="static"
18287 set d_static_inline
18289 $rm -f a.[co] b.[co]
18292 : Check stream access
18294 Checking how to access stdio streams by file descriptor number...
18296 case "$stdio_stream_array" in
18297 '') $cat >try.c <<EOCP
18300 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18304 for s in _iob __iob __sF
18306 set try -DSTDIO_STREAM_ARRAY=$s
18307 if eval $compile; then
18308 case "`$run ./try`" in
18309 yes) stdio_stream_array=$s; break ;;
18315 case "$stdio_stream_array" in
18317 I can't figure out how to access stdio streams by file descriptor number.
18319 d_stdio_stream_array="$undef"
18322 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18324 d_stdio_stream_array="$define"
18328 : see if strcoll exists
18329 set strcoll d_strcoll
18332 : check for structure copying
18334 echo "Checking to see if your C compiler can copy structs..." >&4
18335 $cat >try.c <<'EOCP'
18345 if $cc -c try.c >/dev/null 2>&1 ; then
18347 echo "Yup, it can."
18350 echo "Nope, it can't."
18356 : see if strerror and/or sys_errlist[] exist
18358 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18359 if set strerror val -f d_strerror; eval $csym; $val; then
18360 echo 'strerror() found.' >&4
18361 d_strerror="$define"
18362 d_strerrm='strerror(e)'
18363 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18364 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18365 d_syserrlst="$define"
18367 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18368 d_syserrlst="$undef"
18370 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18371 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18372 echo 'strerror() found in string header.' >&4
18373 d_strerror="$define"
18374 d_strerrm='strerror(e)'
18375 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18376 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18377 d_syserrlst="$define"
18379 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18380 d_syserrlst="$undef"
18382 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18383 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18384 d_strerror="$undef"
18385 d_syserrlst="$define"
18386 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18388 echo 'strerror() and sys_errlist[] NOT found.' >&4
18389 d_strerror="$undef"
18390 d_syserrlst="$undef"
18391 d_strerrm='"unknown"'
18395 : see if strerror_r exists
18396 set strerror_r d_strerror_r
18398 case "$d_strerror_r" in
18400 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18401 case "$d_strerror_r_proto:$usethreads" in
18402 ":define") d_strerror_r_proto=define
18403 set d_strerror_r_proto strerror_r $hdrs
18407 case "$d_strerror_r_proto" in
18409 case "$strerror_r_proto" in
18410 ''|0) try='int strerror_r(int, char*, size_t);'
18411 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18413 case "$strerror_r_proto" in
18414 ''|0) try='int strerror_r(int, char*, int);'
18415 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18417 case "$strerror_r_proto" in
18418 ''|0) try='char* strerror_r(int, char*, size_t);'
18419 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18421 case "$strerror_r_proto" in
18422 ''|0) d_strerror_r=undef
18424 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18425 * ) case "$strerror_r_proto" in
18426 REENTRANT_PROTO*) ;;
18427 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18429 echo "Prototype: $try" ;;
18432 *) case "$usethreads" in
18433 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18440 *) strerror_r_proto=0
18444 : see if strftime exists
18445 set strftime d_strftime
18448 : see if strlcat exists
18449 set strlcat d_strlcat
18452 : see if strlcpy exists
18453 set strlcpy d_strlcpy
18456 : see if strtod exists
18457 set strtod d_strtod
18460 : see if strtol exists
18461 set strtol d_strtol
18464 : see if strtold exists
18465 set strtold d_strtold
18468 : see if strtoll exists
18469 set strtoll d_strtoll
18472 case "$d_longlong-$d_strtoll" in
18475 Checking whether your strtoll() works okay...
18477 $cat >try.c <<'EOCP'
18480 #define strtoll __strtoll
18483 #define strtoll _strtoll
18486 extern long long int strtoll(char *s, char **, int);
18487 static int bad = 0;
18488 int check(char *s, long long ell, int een) {
18491 gll = strtoll(s, 0, 10);
18492 if (!((gll == ell) && (errno == een)))
18496 check(" 1", 1LL, 0);
18497 check(" 0", 0LL, 0);
18498 check("-1", -1LL, 0);
18499 check("-9223372036854775808", -9223372036854775808LL, 0);
18500 check("-9223372036854775808", -9223372036854775808LL, 0);
18501 check(" 9223372036854775807", 9223372036854775807LL, 0);
18502 check("-9223372036854775808", -9223372036854775808LL, 0);
18503 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18504 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18510 if eval $compile; then
18513 ok) echo "Your strtoll() seems to be working okay." ;;
18515 Your strtoll() doesn't seem to be working okay.
18521 echo "(I can't seem to compile the test program--assuming it doesn't)"
18527 : see if strtoq exists
18528 set strtoq d_strtoq
18531 : see if strtoul exists
18532 set strtoul d_strtoul
18535 case "$d_strtoul" in
18538 Checking whether your strtoul() works okay...
18540 $cat >try.c <<'EOCP'
18543 extern unsigned long int strtoul(char *s, char **, int);
18544 static int bad = 0;
18545 void check(char *s, unsigned long eul, int een) {
18548 gul = strtoul(s, 0, 10);
18549 if (!((gul == eul) && (errno == een)))
18553 check(" 1", 1L, 0);
18554 check(" 0", 0L, 0);
18556 case "$longsize" in
18558 $cat >>try.c <<'EOCP'
18559 check("18446744073709551615", 18446744073709551615UL, 0);
18560 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18561 #if 0 /* strtoul() for /^-/ strings is undefined. */
18562 check("-1", 18446744073709551615UL, 0);
18563 check("-18446744073709551614", 2, 0);
18564 check("-18446744073709551615", 1, 0);
18565 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18566 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18571 $cat >>try.c <<'EOCP'
18572 check("4294967295", 4294967295UL, 0);
18573 check("4294967296", 4294967295UL, ERANGE);
18574 #if 0 /* strtoul() for /^-/ strings is undefined. */
18575 check("-1", 4294967295UL, 0);
18576 check("-4294967294", 2, 0);
18577 check("-4294967295", 1, 0);
18578 check("-4294967296", 4294967295UL, ERANGE);
18579 check("-4294967297", 4294967295UL, ERANGE);
18584 : Should we write these tests to be more portable by sprintf-ing
18585 : ~0 and then manipulating that char string as input for strtol?
18588 $cat >>try.c <<'EOCP'
18595 if eval $compile; then
18596 case "`$run ./try`" in
18597 ok) echo "Your strtoul() seems to be working okay." ;;
18599 Your strtoul() doesn't seem to be working okay.
18605 echo "(I can't seem to compile the test program--assuming it doesn't)"
18611 : see if strtoull exists
18612 set strtoull d_strtoull
18615 case "$d_longlong-$d_strtoull" in
18618 Checking whether your strtoull() works okay...
18620 $cat >try.c <<'EOCP'
18623 #define strtoull __strtoull
18626 extern unsigned long long int strtoull(char *s, char **, int);
18627 static int bad = 0;
18628 int check(char *s, long long eull, int een) {
18631 gull = strtoull(s, 0, 10);
18632 if (!((gull == eull) && (errno == een)))
18636 check(" 1", 1LL, 0);
18637 check(" 0", 0LL, 0);
18638 check("18446744073709551615", 18446744073709551615ULL, 0);
18639 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18640 #if 0 /* strtoull() for /^-/ strings is undefined. */
18641 check("-1", 18446744073709551615ULL, 0);
18642 check("-18446744073709551614", 2LL, 0);
18643 check("-18446744073709551615", 1LL, 0);
18644 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18645 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18652 if eval $compile; then
18653 case "`$run ./try`" in
18654 ok) echo "Your strtoull() seems to be working okay." ;;
18656 Your strtoull() doesn't seem to be working okay.
18658 d_strtoull="$undef"
18662 echo "(I can't seem to compile the test program--assuming it doesn't)"
18663 d_strtoull="$undef"
18668 : see if strtouq exists
18669 set strtouq d_strtouq
18672 case "$d_strtouq" in
18675 Checking whether your strtouq() works okay...
18677 $cat >try.c <<'EOCP'
18680 extern unsigned long long int strtouq(char *s, char **, int);
18681 static int bad = 0;
18682 void check(char *s, unsigned long long eull, int een) {
18683 unsigned long long gull;
18685 gull = strtouq(s, 0, 10);
18686 if (!((gull == eull) && (errno == een)))
18690 check(" 1", 1LL, 0);
18691 check(" 0", 0LL, 0);
18692 check("18446744073709551615", 18446744073709551615ULL, 0);
18693 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18694 #if 0 /* strtouq() for /^-/ strings is undefined. */
18695 check("-1", 18446744073709551615ULL, 0);
18696 check("-18446744073709551614", 2LL, 0);
18697 check("-18446744073709551615", 1LL, 0);
18698 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18699 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18707 if eval $compile; then
18708 case "`$run ./try`" in
18709 ok) echo "Your strtouq() seems to be working okay." ;;
18711 Your strtouq() doesn't seem to be working okay.
18717 echo "(I can't seem to compile the test program--assuming it doesn't)"
18723 : see if strxfrm exists
18724 set strxfrm d_strxfrm
18727 : see if symlink exists
18728 set symlink d_symlink
18731 : see if syscall exists
18732 set syscall d_syscall
18735 : see if prototype for syscall is available
18737 set d_syscallproto syscall $i_unistd unistd.h
18740 : see if sysconf exists
18741 set sysconf d_sysconf
18744 : see if system exists
18745 set system d_system
18748 : see if tcgetpgrp exists
18749 set tcgetpgrp d_tcgetpgrp
18752 : see if tcsetpgrp exists
18753 set tcsetpgrp d_tcsetpgrp
18756 : see if prototype for telldir is available
18758 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18761 : see if time exists
18763 if test "X$d_time" = X -o X"$timetype" = X; then
18764 if set time val -f d_time; eval $csym; $val; then
18765 echo 'time() found.' >&4
18767 rp="What is the type returned by time() on this system?"
18768 set time_t timetype long stdio.h sys/types.h
18771 echo 'time() not found, hope that will do.' >&4
18779 : see if timegm exists
18780 set timegm d_timegm
18783 : see if this is a sys/times.h system
18784 set sys/times.h i_systimes
18787 : see if times exists
18789 if set times val -f d_times; eval $csym; $val; then
18790 echo 'times() found.' >&4
18793 case "$i_systimes" in
18794 "$define") inc='sys/times.h';;
18796 rp="What is the type returned by times() on this system?"
18797 set clock_t clocktype long stdio.h sys/types.h $inc
18800 echo 'times() NOT found, hope that will do.' >&4
18805 : see if tmpnam_r exists
18806 set tmpnam_r d_tmpnam_r
18808 case "$d_tmpnam_r" in
18810 hdrs="$i_systypes sys/types.h define stdio.h "
18811 case "$d_tmpnam_r_proto:$usethreads" in
18812 ":define") d_tmpnam_r_proto=define
18813 set d_tmpnam_r_proto tmpnam_r $hdrs
18817 case "$d_tmpnam_r_proto" in
18819 case "$tmpnam_r_proto" in
18820 ''|0) try='char* tmpnam_r(char*);'
18821 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18823 case "$tmpnam_r_proto" in
18824 ''|0) d_tmpnam_r=undef
18826 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18827 * ) case "$tmpnam_r_proto" in
18828 REENTRANT_PROTO*) ;;
18829 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18831 echo "Prototype: $try" ;;
18834 *) case "$usethreads" in
18835 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18842 *) tmpnam_r_proto=0
18846 : see if truncate exists
18847 set truncate d_truncate
18850 : see if ttyname_r exists
18851 set ttyname_r d_ttyname_r
18853 case "$d_ttyname_r" in
18855 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18856 case "$d_ttyname_r_proto:$usethreads" in
18857 ":define") d_ttyname_r_proto=define
18858 set d_ttyname_r_proto ttyname_r $hdrs
18862 case "$d_ttyname_r_proto" in
18864 case "$ttyname_r_proto" in
18865 ''|0) try='int ttyname_r(int, char*, size_t);'
18866 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18868 case "$ttyname_r_proto" in
18869 ''|0) try='int ttyname_r(int, char*, int);'
18870 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18872 case "$ttyname_r_proto" in
18873 ''|0) try='char* ttyname_r(int, char*, int);'
18874 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18876 case "$ttyname_r_proto" in
18877 ''|0) d_ttyname_r=undef
18879 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18880 * ) case "$ttyname_r_proto" in
18881 REENTRANT_PROTO*) ;;
18882 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18884 echo "Prototype: $try" ;;
18887 *) case "$usethreads" in
18888 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18895 *) ttyname_r_proto=0
18899 : see if tzname[] exists
18901 if set tzname val -a d_tzname; eval $csym; $val; then
18903 echo 'tzname[] found.' >&4
18906 echo 'tzname[] NOT found.' >&4
18911 : Check if is a multiplatform env
18913 next|darwin) multiarch="$define" ;;
18915 case "$multiarch" in
18916 ''|[nN]*) multiarch="$undef" ;;
18919 : check for ordering of bytes in a UV
18921 case "$multiarch" in
18924 You seem to be doing a multiarchitecture build,
18925 skipping the byteorder check.
18931 case "$byteorder" in
18934 In the following, larger digits indicate more significance. A big-endian
18935 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18936 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18937 machines may have weird orders like 3412. A Cray will report 87654321,
18938 an Alpha will report 12345678. If the test program works the default is
18940 I'm now running the test program...
18944 #$i_stdlib I_STDLIB
18946 #include <stdlib.h>
18948 #include <sys/types.h>
18949 typedef $uvtype UV;
18959 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18961 u.l = (UV)0x04030201;
18962 for (i = 0; i < $uvsize; i++)
18963 printf("%c", u.c[i]+'0');
18970 if eval $compile && $run ./try > /dev/null; then
18973 [1-4][1-4][1-4][1-4]|12345678|87654321)
18974 echo "(The test program ran ok.)"
18975 echo "byteorder=$dflt"
18978 ????|????????) echo "(The test program ran ok.)" ;;
18979 *) echo "(The test program didn't run right for some reason.)" ;;
18984 (I can't seem to compile the test program. Guessing big-endian...)
18987 case "$xxx_prompt" in
18989 rp="What is the order of bytes in $uvtype?"
19002 : Checking 32bit alignedness
19005 Checking to see whether you can access character data unalignedly...
19007 case "$d_u32align" in
19008 '') $cat >try.c <<EOCP
19010 #$i_stdlib I_STDLIB
19012 #include <stdlib.h>
19014 #define U32 $u32type
19015 #define BYTEORDER 0x$byteorder
19017 #include <signal.h>
19019 $signal_t bletch(int s) { exit(4); }
19022 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19023 volatile U8 buf[8];
19027 if (sizeof(U32) != 4) {
19028 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19035 signal(SIGBUS, bletch);
19047 for (i = 0; i < 4; i++) {
19048 up = (U32*)(buf + i);
19049 if (! ((*up == 1 << (8*i)) || /* big-endian */
19050 (*up == 1 << (8*(3-i))) /* little-endian */
19054 printf("read failed (%x)\n", *up);
19060 for (i = 0; i < 4; i++) {
19061 up = (U32*)(buf + i);
19063 if (*up != 0xBeef) {
19064 printf("write failed (%x)\n", *up);
19078 if eval $compile_ok; then
19079 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19080 $run ./try 2>&1 >/dev/null
19083 You can access character data pretty unalignedly.
19085 d_u32align="$undef"
19088 It seems that you must access character data in an aligned manner.
19090 d_u32align="$define"
19094 rp='Can you access character data at unaligned addresses?'
19098 [yY]*) d_u32align="$undef" ;;
19099 *) d_u32align="$define" ;;
19106 : see if ualarm exists
19107 set ualarm d_ualarm
19110 : see if umask exists
19114 : see if unordered exists
19115 set unordered d_unordered
19118 : see if unsetenv exists
19119 set unsetenv d_unsetenv
19122 : see if usleep exists
19123 set usleep d_usleep
19126 : see if prototype for usleep is available
19128 set d_usleepproto usleep $i_unistd unistd.h
19131 : see if ustat exists
19135 : see if closedir exists
19136 set closedir d_closedir
19139 case "$d_closedir" in
19142 echo "Checking whether closedir() returns a status..." >&4
19144 #$i_dirent I_DIRENT /**/
19145 #$i_sysdir I_SYS_DIR /**/
19146 #$i_sysndir I_SYS_NDIR /**/
19147 #$i_systypes I_SYS_TYPES /**/
19149 #if defined(I_SYS_TYPES)
19150 #include <sys/types.h>
19152 #if defined(I_DIRENT)
19153 #include <dirent.h>
19154 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19155 #include <sys/dir.h>
19159 #include <sys/ndir.h>
19163 #include <ndir.h> /* may be wrong in the future */
19165 #include <sys/dir.h>
19170 int main() { return closedir(opendir(".")); }
19173 if eval $compile_ok; then
19174 if $run ./try > /dev/null 2>&1 ; then
19175 echo "Yes, it does."
19178 echo "No, it doesn't."
19182 echo "(I can't seem to compile the test program--assuming it doesn't)"
19190 set d_void_closedir
19194 : see if there is a wait4
19198 : see if waitpid exists
19199 set waitpid d_waitpid
19202 : see if wcstombs exists
19203 set wcstombs d_wcstombs
19206 : see if wctomb exists
19207 set wctomb d_wctomb
19210 : see if writev exists
19211 set writev d_writev
19214 : preserve RCS keywords in files with variable substitution, grrr
19219 Revision='$Revision'
19221 : check for alignment requirements
19223 case "$alignbytes" in
19224 '') echo "Checking alignment constraints..." >&4
19225 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19226 $cat >try.c <<'EOCP'
19227 typedef long double NV;
19230 $cat >try.c <<'EOCP'
19234 $cat >>try.c <<'EOCP'
19242 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19247 if eval $compile_ok; then
19251 echo "(I can't seem to compile the test program...)"
19253 case "$multiarch" in
19255 : The usual safe value is 8, but Darwin with -Duselongdouble
19256 : needs 16. Hence, we will take 8 as a minimum, but allow
19257 : Configure to pick a larger value if needed.
19258 if $test "$dflt" -lt 8; then
19260 echo "Setting alignment to 8 for multiarch support.">&4
19265 *) dflt="$alignbytes"
19268 rp="Doubles must be aligned on a how-many-byte boundary?"
19273 : set the base revision
19276 : Determine if this is an EBCDIC system
19278 echo "Determining whether or not we are on an EBCDIC system..." >&4
19279 $cat >try.c <<'EOM'
19282 if ('M'==0xd4) return 0;
19287 case "$BOOTSTRAP_CHARSET" in
19288 Y|y|define) bootstrap_charset=$define ;;
19289 *) bootstrap_charset=$undef ;;
19294 if eval $compile_ok; then
19295 if $run ./try; then
19296 echo "You seem to speak EBCDIC." >&4
19299 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19302 echo "I'm unable to compile the test program." >&4
19303 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19309 : length of character in bytes. Is always 1, otherwise it is not C
19310 : This used to be a test using sizeof
19313 : Check for the number of bits in a character
19314 case "$charbits" in
19315 '') echo "Checking how long a character is (in bits)..." >&4
19322 for (c = 1, n = 0; c; c <<= 1, n++) ;
19323 printf ("%d\n", n);
19328 if eval $compile_ok; then
19332 echo "(I can't seem to compile the test program. Guessing...)"
19339 rp="What is the length of a character (in bits)?"
19343 case "$charbits" in
19346 Your system has an unsigned character size of $charbits bits, which
19347 is rather unusual (normally it is 8 bits). Perl likely will not work
19348 correctly on your system, with subtle bugs in various places.
19350 rp='Do you really want to continue?'
19354 [yY]) echo >&4 "Okay, continuing." ;;
19359 : how do we concatenate cpp tokens here?
19361 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19362 $cat >cpp_stuff.c <<'EOCP'
19363 #define RCAT(a,b)a/**/b
19364 #define ACAT(a,b)a ## b
19368 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19369 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19370 echo "Oh! Smells like ANSI's been here." >&4
19371 echo "We can catify or stringify, separately or together!"
19373 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19374 echo "Ah, yes! The good old days!" >&4
19375 echo "However, in the good old days we don't know how to stringify and"
19376 echo "catify at the same time."
19380 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19381 You're going to have to edit the values of CAT[2-5] in config.h...
19383 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19387 : see if this is a db.h system
19393 : Check db version.
19395 echo "Checking Berkeley DB version ..." >&4
19401 #include <sys/types.h>
19403 #$i_stdlib I_STDLIB
19405 #include <stdlib.h>
19408 int main(int argc, char *argv[])
19410 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19411 int Major, Minor, Patch ;
19412 unsigned long Version ;
19413 (void)db_version(&Major, &Minor, &Patch) ;
19415 printf("%d %d %d %d %d %d\n",
19416 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19417 Major, Minor, Patch);
19420 printf("You have Berkeley DB Version 2 or greater.\n");
19422 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19423 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19424 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19425 Major, Minor, Patch) ;
19427 /* check that db.h & libdb are compatible */
19428 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19429 printf("db.h and libdb are incompatible.\n") ;
19433 printf("db.h and libdb are compatible.\n") ;
19435 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19436 + DB_VERSION_PATCH ;
19438 /* needs to be >= 2.3.4 */
19439 if (Version < 2003004) {
19440 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19441 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19447 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19452 printf("You have Berkeley DB Version 1.\n");
19453 exit(0); /* DB version < 2: the coast is clear. */
19455 exit(1); /* <db.h> not Berkeley DB? */
19461 if eval $compile_ok && $run ./try; then
19462 echo 'Looks OK.' >&4
19464 db_version_major=$1
19465 db_version_minor=$2
19466 db_version_patch=$3
19468 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19472 : Remove db from list of libraries to use
19473 echo "Removing unusable -ldb from library list" >&4
19474 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19477 echo "libs = $libs" >&4
19487 : Check the return type needed for hash
19489 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19495 #include <sys/types.h>
19498 #ifndef DB_VERSION_MAJOR
19499 u_int32_t hash_cb (ptr, size)
19507 info.hash = hash_cb;
19511 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19512 if $contains warning try.out >>/dev/null 2>&1 ; then
19515 db_hashtype='u_int32_t'
19518 : XXX Maybe we should just give up here.
19519 db_hashtype=u_int32_t
19521 echo "Help: I can't seem to compile the db test program." >&4
19522 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19525 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19527 *) db_hashtype=u_int32_t
19532 : Check the return type needed for prefix
19534 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19540 #include <sys/types.h>
19543 #ifndef DB_VERSION_MAJOR
19544 size_t prefix_cb (key1, key2)
19552 info.prefix = prefix_cb;
19556 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19557 if $contains warning try.out >>/dev/null 2>&1 ; then
19558 db_prefixtype='int'
19560 db_prefixtype='size_t'
19563 db_prefixtype='size_t'
19564 : XXX Maybe we should just give up here.
19566 echo "Help: I can't seem to compile the db test program." >&4
19567 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19570 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19572 *) db_prefixtype='size_t'
19576 : How can we generate normalized random numbers ?
19578 echo "Using our internal random number implementation..." >&4
19581 *-Dmy_rand=*|*-Dmy_srand=*)
19582 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19583 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19584 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19585 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19589 randfunc=Perl_drand48
19590 drand01="Perl_drand48()"
19591 seedfunc="Perl_drand48_init"
19595 : Check how to flush
19598 Checking how to flush all pending stdio output...
19600 # I only know how to find the first 32 possibly open files on SunOS.
19601 # See also hints/sunos_4_1.sh and util.c --AD
19603 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19605 $cat >>try.c <<EOCP
19607 #$i_stdlib I_STDLIB
19609 #include <stdlib.h>
19611 #$i_unistd I_UNISTD
19613 # include <unistd.h>
19615 #$d_sysconf HAS_SYSCONF
19616 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19617 #ifdef HAS_STDIO_STREAM_ARRAY
19618 # define STDIO_STREAM_ARRAY $stdio_stream_array
19623 p = fopen("try.out", "w");
19627 # ifdef TRY_FPRINTF
19631 #ifdef TRY_FFLUSH_NULL
19634 #ifdef TRY_FFLUSH_ALL
19636 long open_max = -1;
19637 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19638 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19640 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19641 open_max = sysconf(_SC_OPEN_MAX);
19644 open_max = FOPEN_MAX;
19647 open_max = OPEN_MAX;
19656 # ifdef HAS_STDIO_STREAM_ARRAY
19657 if (open_max > 0) {
19659 for (i = 0; i < open_max; i++)
19660 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19661 STDIO_STREAM_ARRAY[i]._file < open_max &&
19662 STDIO_STREAM_ARRAY[i]._flag)
19663 fflush(&STDIO_STREAM_ARRAY[i]);
19671 : first we have to find out how _not_ to flush
19673 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19675 set try -DTRY_FPUTC
19676 if eval $compile; then
19677 $run ./try 2>/dev/null
19680 if $test ! -s try.out -a "X$code" = X42; then
19686 set try -DTRY_FPRINTF
19687 if eval $compile; then
19688 $run ./try 2>/dev/null
19691 if $test ! -s try.out -a "X$code" = X42; then
19692 output=-DTRY_FPRINTF
19698 : check for fflush NULL behavior
19699 case "$fflushNULL" in
19700 '') set try -DTRY_FFLUSH_NULL $output
19701 if eval $compile; then
19702 $run ./try 2>/dev/null
19705 if $test -s try.out -a "X$code" = X42; then
19706 fflushNULL="`$cat try.out`"
19708 if $test "X$code" != X42; then
19710 (If this test failed, don't worry, we'll try another method shortly.)
19715 $rm -f core try.core core.try.*
19716 case "$fflushNULL" in
19718 Your fflush(NULL) works okay for output streams.
19719 Let's see if it clobbers input pipes...
19721 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19722 # bug that improperly flushes the input end of pipes. So we avoid the
19723 # autoflush on fork/system/exec support for now. :-(
19724 $cat >tryp.c <<EOCP
19727 main(int argc, char **argv)
19733 while ((i = getc(stdin)) != -1
19734 && (*bp++ = i) != '\n'
19735 && bp < &buf[1024])
19738 fprintf(stdout, "%s", buf);
19746 fflushNULL="$define"
19748 if eval $compile; then
19750 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19751 if $test "X$targethost" != X; then
19754 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19756 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19758 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19760 fflush(NULL) seems to behave okay with input streams.
19762 fflushNULL="$define"
19765 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19767 fflushNULL="$undef"
19770 $rm -f core tryp.c tryp.core core.tryp.*
19773 Your fflush(NULL) isn't working (contrary to ANSI C).
19775 fflushNULL="$undef"
19778 Cannot figure out whether your fflush(NULL) works or not.
19779 I'm assuming it doesn't (contrary to ANSI C).
19781 fflushNULL="$undef"
19785 $define|true|[yY]*)
19786 fflushNULL="$define"
19789 fflushNULL="$undef"
19792 : check explicit looping only if NULL did not work, and if the pipe
19793 : bug does not show up on an explicit flush too
19794 case "$fflushNULL" in
19796 $cat >tryp.c <<EOCP
19799 main(int argc, char **argv)
19805 while ((i = getc(stdin)) != -1
19806 && (*bp++ = i) != '\n'
19807 && bp < &buf[1024])
19810 fprintf(stdout, "%s", buf);
19819 if eval $compile; then
19821 if $test "X$targethost" != X; then
19824 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19826 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19828 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19830 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19832 : now check for fflushall behaviour
19833 case "$fflushall" in
19834 '') set try -DTRY_FFLUSH_ALL $output
19835 if eval $compile; then
19837 (Now testing the other method--but note that this also may fail.)
19839 $run ./try 2>/dev/null
19842 if $test -s try.out -a "X$code" = X42; then
19843 fflushall="`$cat try.out`"
19847 case "$fflushall" in
19849 Whew. Flushing explicitly all the stdio streams works.
19851 fflushall="$define"
19854 Sigh. Flushing explicitly all the stdio streams doesn't work.
19859 Cannot figure out whether flushing stdio streams explicitly works or not.
19860 I'm assuming it doesn't.
19866 "$define"|true|[yY]*)
19867 fflushall="$define"
19875 All is futile. Even fflush(stdin) clobbers input pipes!
19882 $rm -f core tryp.c tryp.core core.tryp.*
19884 *) fflushall="$undef"
19888 case "$fflushNULL$fflushall" in
19891 OK, I give up. I cannot figure out how to flush pending stdio output.
19892 We won't be flushing handles at all before fork/exec/popen.
19898 : Store the full pathname to the ar program for use in the C program
19899 : Respect a hint or command line value for full_ar.
19904 : Store the full pathname to the sed program for use in the C program
19907 : see what type gids are declared as in the kernel
19909 echo "Looking for the type for group ids returned by getgid()."
19910 set gid_t gidtype xxx stdio.h sys/types.h
19914 xxx=`./findhdr sys/user.h`
19915 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19917 unsigned) dflt="$1 $2" ;;
19921 *) dflt="$gidtype";;
19924 gid_t) echo "gid_t found." ;;
19925 *) rp="What is the type for group ids returned by getgid()?"
19931 : Check the size of GID
19934 *_t) zzz="$gidtype" ;;
19937 echo "Checking the size of $zzz..." >&4
19939 #include <sys/types.h>
19941 #$i_stdlib I_STDLIB
19943 #include <stdlib.h>
19946 printf("%d\n", (int)sizeof($gidtype));
19951 if eval $compile_ok; then
19955 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19958 echo "Your $zzz is $gidsize bytes long."
19963 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19967 : Check if GID is signed
19970 *_t) zzz="$gidtype" ;;
19973 echo "Checking the sign of $zzz..." >&4
19975 #include <sys/types.h>
19986 if eval $compile; then
19990 echo "(I can't execute the test program--guessing unsigned.)" >&4
19994 1) echo "Your $zzz is unsigned." ;;
19995 -1) echo "Your $zzz is signed." ;;
20001 echo "(I can't compile the test program--guessing unsigned.)" >&4
20005 : Check 64bit sizes
20008 if $test X"$quadtype" != X; then
20010 echo "Checking how to print 64-bit integers..." >&4
20012 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20013 $cat >try.c <<'EOCP'
20014 #include <sys/types.h>
20017 int q = 12345678901;
20018 printf("%ld\n", q);
20022 if eval $compile; then
20026 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20027 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20028 echo "We will use %d."
20034 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20035 $cat >try.c <<'EOCP'
20036 #include <sys/types.h>
20039 long q = 12345678901;
20040 printf("%ld\n", q);
20044 if eval $compile; then
20048 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20049 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20050 echo "We will use %ld."
20056 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20057 $cat >try.c <<'EOCP'
20058 #include <sys/types.h>
20059 #include <inttypes.h>
20062 int64_t q = 12345678901;
20063 printf("%" PRId64 "\n", q);
20067 if eval $compile; then
20071 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20072 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20073 echo "We will use the C9X style."
20079 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20081 #include <sys/types.h>
20084 $quadtype q = 12345678901;
20085 printf("%Ld\n", q);
20089 if eval $compile; then
20093 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20094 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20095 echo "We will use %Ld."
20101 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20102 $cat >try.c <<'EOCP'
20103 #include <sys/types.h>
20106 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20107 printf("%lld\n", q);
20111 if eval $compile; then
20115 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20116 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20117 echo "We will use the %lld style."
20123 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20125 #include <sys/types.h>
20128 $quadtype q = 12345678901;
20129 printf("%qd\n", q);
20133 if eval $compile; then
20137 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20138 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20139 echo "We will use %qd."
20145 if $test X"$sPRId64" = X; then
20146 echo "Cannot figure out how to print 64-bit integers." >&4
20153 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20154 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20156 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20157 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20161 : Check format strings for internal types
20163 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20165 if $test X"$ivsize" = X8; then
20166 ivdformat="$sPRId64"
20167 uvuformat="$sPRIu64"
20168 uvoformat="$sPRIo64"
20169 uvxformat="$sPRIx64"
20170 uvXUformat="$sPRIXU64"
20172 if $test X"$ivsize" = X"$longsize"; then
20179 if $test X"$ivsize" = X"$intsize"; then
20187 if $test X"$ivsize" = X"$shortsize"; then
20198 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20199 nveformat="$sPRIeldbl"
20200 nvfformat="$sPRIfldbl"
20201 nvgformat="$sPRIgldbl"
20202 nvEUformat="$sPRIEUldbl"
20203 nvFUformat="$sPRIFUldbl"
20204 nvGUformat="$sPRIGUldbl"
20214 case "$ivdformat" in
20215 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20220 : Check format string for GID
20223 $echo "Checking the format string to be used for gids..." >&4
20226 -1) if $test X"$gidsize" = X"$ivsize"; then
20227 gidformat="$ivdformat"
20229 if $test X"$gidsize" = X"$longsize"; then
20232 if $test X"$gidsize" = X"$intsize"; then
20235 if $test X"$gidsize" = X"$shortsize"; then
20242 *) if $test X"$gidsize" = X"$uvsize"; then
20243 gidformat="$uvuformat"
20245 if $test X"$gidsize" = X"$longsize"; then
20248 if $test X"$gidsize" = X"$intsize"; then
20251 if $test X"$gidsize" = X"$shortsize"; then
20260 : see if getgroups exists
20261 set getgroups d_getgrps
20264 : see if setgroups exists
20265 set setgroups d_setgrps
20268 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20270 case "$d_getgrps$d_setgrps" in
20272 case "$groupstype" in
20273 '') dflt="$gidtype" ;;
20274 *) dflt="$groupstype" ;;
20277 What type of pointer is the second argument to getgroups() and setgroups()?
20278 Usually this is the same as group ids, $gidtype, but not always.
20281 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20285 *) groupstype="$gidtype";;
20288 : MAD = Misc Attribute Definition
20290 if $test $patchlevel -lt 9; then
20291 : MAD is not available in 5.8.x or earlier.
20295 $define|true|[yY]*) dflt='y' ;;
20300 Would you like to build with Misc Attribute Decoration? This is development
20301 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20302 overhead on the interpreter.
20304 If this doesn't make any sense to you, just accept the default '$dflt'.
20306 rp='Build Perl with MAD?'
20311 madlyh='madly.h madly.act madly.tab'
20313 madlyobj="madly$_o" ;;
20322 : check whether make sets MAKE
20324 echo "Checking if your $make program sets \$(MAKE)..." >&4
20325 case "$make_set_make" in
20327 $sed 's/^X //' > testmake.mak << 'EOF'
20329 X @echo 'maketemp="$(MAKE)"'
20331 case "`$make -f testmake.mak 2>/dev/null`" in
20332 *maketemp=*) make_set_make='#' ;;
20333 *) make_set_make="MAKE=$make" ;;
20335 $rm -f testmake.mak
20338 case "$make_set_make" in
20339 '#') echo "Yup, it does.";;
20340 *) echo "Nope, it doesn't.";;
20343 : see what type is used for mode_t
20344 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20345 set mode_t modetype int stdio.h sys/types.h
20348 : see if we need va_copy
20350 case "$i_stdarg" in
20353 #include <stdarg.h>
20355 #$i_stdlib I_STDLIB
20357 #include <stdlib.h>
20359 #include <signal.h>
20362 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20364 return vfprintf(f, fmt, *valp);
20368 myvfprintf(FILE *f, const char *fmt, va_list val)
20370 return ivfprintf(f, fmt, &val);
20374 myprintf(char *fmt, ...)
20377 va_start(val, fmt);
20378 return myvfprintf(stdout, fmt, val);
20382 main(int ac, char **av)
20384 signal(SIGSEGV, exit);
20386 myprintf("%s%cs all right, then\n", "that", '\'');
20391 if eval $compile && $run ./try 2>&1 >/dev/null; then
20392 case "`$run ./try`" in
20393 "that's all right, then")
20399 yes) echo "It seems that you don't need va_copy()." >&4
20400 need_va_copy="$undef"
20402 *) echo "It seems that va_copy() or similar will be needed." >&4
20403 need_va_copy="$define"
20408 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20409 need_va_copy="$undef"
20413 : see what type is used for size_t
20414 rp="What is the type used for the length parameter for string functions?"
20415 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20418 : check for type of arguments to gethostbyaddr.
20419 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20420 case "$d_gethbyaddr" in
20424 Checking to see what type of arguments are accepted by gethostbyaddr().
20426 hdrs="$define sys/types.h
20427 $d_socket sys/socket.h
20428 $i_niin netinet/in.h
20430 $i_unistd unistd.h"
20431 : The first arg can 'char *' or 'void *'
20432 : The second arg is some of integral type
20433 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20434 for yyy in size_t long int; do
20435 case "$netdb_host_type" in
20436 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20437 if ./protochk "$try" $hdrs; then
20438 echo "Your system accepts $xxx for the first arg."
20439 echo "...and $yyy for the second arg."
20440 netdb_host_type="$xxx"
20441 netdb_hlen_type="$yyy"
20447 : In case none of those worked, prompt the user.
20448 case "$netdb_host_type" in
20449 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20452 netdb_host_type=$ans
20453 rp='What is the type for the 2nd argument to gethostbyaddr?'
20456 netdb_hlen_type=$ans
20460 *) : no gethostbyaddr, so pick harmless defaults
20461 netdb_host_type='char *'
20462 netdb_hlen_type="$sizetype"
20465 # Remove the "const" if needed. -- but then we'll have a
20467 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20470 : check for type of argument to gethostbyname.
20471 if test "X$netdb_name_type" = X ; then
20472 case "$d_gethbyname" in
20476 Checking to see what type of argument is accepted by gethostbyname().
20478 hdrs="$define sys/types.h
20479 $d_socket sys/socket.h
20480 $i_niin netinet/in.h
20482 $i_unistd unistd.h"
20483 for xxx in "const char *" "char *"; do
20484 case "$netdb_name_type" in
20485 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20486 if ./protochk "$try" $hdrs; then
20487 echo "Your system accepts $xxx."
20488 netdb_name_type="$xxx"
20493 : In case none of those worked, prompt the user.
20494 case "$netdb_name_type" in
20495 '') rp='What is the type for the 1st argument to gethostbyname?'
20498 netdb_name_type=$ans
20502 *) : no gethostbyname, so pick harmless default
20503 netdb_name_type='char *'
20508 : check for type of 1st argument to getnetbyaddr.
20509 if test "X$netdb_net_type" = X ; then
20510 case "$d_getnbyaddr" in
20514 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20516 hdrs="$define sys/types.h
20517 $d_socket sys/socket.h
20518 $i_niin netinet/in.h
20520 $i_unistd unistd.h"
20521 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20522 case "$netdb_net_type" in
20523 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20524 if ./protochk "$try" $hdrs; then
20525 echo "Your system accepts $xxx."
20526 netdb_net_type="$xxx"
20531 : In case none of those worked, prompt the user.
20532 case "$netdb_net_type" in
20533 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20536 netdb_net_type=$ans
20540 *) : no getnetbyaddr, so pick harmless default
20541 netdb_net_type='long'
20545 : locate the preferred pager for this system
20552 [a-zA-Z]:/*) dflt=$pg;;
20556 [a-zA-Z]:/*) dflt=$more;;
20560 [a-zA-Z]:/*) dflt=$less;;
20563 '') dflt=/usr/ucb/more;;
20571 rp='What pager is used on your system?'
20575 : see what type pids are declared as in the kernel
20576 rp="What is the type of process ids on this system?"
20577 set pid_t pidtype int stdio.h sys/types.h
20580 : see if ar generates random libraries by itself
20582 echo "Checking how to generate random libraries on your machine..." >&4
20583 echo 'int bar1() { return bar2(); }' > bar1.c
20584 echo 'int bar2() { return 2; }' > bar2.c
20586 #$i_stdlib I_STDLIB
20588 #include <stdlib.h>
20590 int main() { printf("%d\n", bar1()); exit(0); }
20592 $cc $ccflags -c bar1.c >/dev/null 2>&1
20593 $cc $ccflags -c bar2.c >/dev/null 2>&1
20594 $cc $ccflags -c foo.c >/dev/null 2>&1
20595 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20596 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20597 $run ./foobar >/dev/null 2>&1; then
20598 echo "$ar appears to generate random libraries itself."
20600 if [ "X$ranlib" = "X" ]; then
20603 elif $ar s bar$_a >/dev/null 2>&1 &&
20604 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20605 $run ./foobar >/dev/null 2>&1; then
20606 echo "a table of contents needs to be added with '$ar s'."
20609 elif $ar ts bar$_a >/dev/null 2>&1 &&
20610 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20611 $run ./foobar >/dev/null 2>&1; then
20612 echo "a table of contents needs to be added with '$ar ts'."
20619 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20620 $test -f $ranlib || ranlib=''
20623 if $test -n "$ranlib"; then
20624 echo "your system has '$ranlib'; we'll use that."
20627 echo "your system doesn't seem to support random libraries"
20628 echo "so we'll use lorder and tsort to order the libraries."
20635 : see if this is a values.h system
20636 set values.h i_values
20639 : Check the max offset that gmtime and localtime accept
20640 echo "Checking max offsets that gmtime () accepts"
20643 define) yyy="#include <values.h>" ;;
20647 case "$sGMTIME_min/$sGMTIME_max" in
20650 #include <sys/types.h>
20659 void gm_check (time_t t, int min_year, int max_year)
20662 if ( tmp == NULL ||
20663 /* Check tm_year overflow */
20664 tmp->tm_year < min_year || tmp->tm_year > max_year)
20675 gm_check (MAXLONG, 69, 0x7fffffff);
20677 if (tmp == NULL || tmp->tm_year < 0) {
20678 for (i = 63; i >= 0; i--) {
20679 time_t x = pt | ((time_t)1 << i);
20680 if (x < 0 || x < pt) continue;
20681 gm_check (x, 69, 0x7fffffff);
20684 printf ("sGMTIME_max=%ld\n", pt);
20693 gm_check (MINLONG, -1900, 70);
20696 for (i = 36; i >= 0; i--) {
20697 time_t x = pt - ((time_t)1 << i);
20698 if (x > 0) continue;
20699 gm_check (x, -1900, 70);
20702 printf ("sGMTIME_min=%ld\n", pt);
20706 int main (int argc, char *argv[])
20708 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20715 if eval $compile; then
20718 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20724 echo "Checking max offsets that localtime () accepts"
20726 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20729 #include <sys/types.h>
20738 void local_check (time_t t, int min_year, int max_year)
20740 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20743 tmp = localtime (&t);
20744 if ( tmp == NULL ||
20745 /* Check tm_year overflow */
20746 tmp->tm_year < min_year || tmp->tm_year > max_year)
20750 } /* local_check */
20757 local_check (MAXLONG, 69, 0x7fffffff);
20759 if (tmp == NULL || tmp->tm_year < 0) {
20760 for (i = 63; i >= 0; i--) {
20761 time_t x = pt | ((time_t)1 << i);
20762 if (x < 0 || x < pt) continue;
20763 local_check (x, 69, 0x7fffffff);
20766 printf ("sLOCALTIME_max=%ld\n", pt);
20775 local_check (MINLONG, -1900, 70);
20778 for (i = 36; i >= 0; i--) {
20779 time_t x = pt - ((time_t)1 << i);
20780 if (x > 0) continue;
20781 local_check (x, -1900, 70);
20784 printf ("sLOCALTIME_min=%ld\n", pt);
20788 int main (int argc, char *argv[])
20796 if eval $compile; then
20799 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20805 : check for type of arguments to select.
20806 case "$selecttype" in
20807 '') case "$d_select" in
20811 Checking to see what type of arguments are accepted by select().
20813 hdrs="$define sys/types.h
20814 $i_systime sys/time.h
20815 $i_sysselct sys/select.h
20816 $d_socket sys/socket.h"
20817 : The first arg can be int, unsigned, or size_t
20818 : The last arg may or may not be 'const'
20820 : void pointer has been seen but using that
20821 : breaks the selectminbits test
20822 for xxx in 'fd_set *' 'int *'; do
20823 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20824 for tmo in 'struct timeval *' 'const struct timeval *'; do
20826 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20827 if ./protochk "$try" $hdrs; then
20828 echo "Your system accepts $xxx."
20837 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20838 case "$d_fd_set" in
20839 $define) dflt="fd_set *" ;;
20848 *) : no select, so pick a harmless default
20855 : check for the select 'width'
20856 case "$selectminbits" in
20857 '') safebits=`expr $ptrsize \* 8`
20858 case "$d_select" in
20862 Checking to see on how many bits at a time your select() operates...
20865 #include <sys/types.h>
20867 #$i_systime I_SYS_TIME
20868 #$i_systimek I_SYS_TIME_KERNEL
20873 # ifdef I_SYS_TIME_KERNEL
20876 # include <sys/time.h>
20877 # ifdef I_SYS_TIME_KERNEL
20881 #$i_sysselct I_SYS_SELECT
20882 #ifdef I_SYS_SELECT
20883 #include <sys/select.h>
20885 #$d_socket HAS_SOCKET
20887 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20890 #$i_stdlib I_STDLIB
20892 #include <stdlib.h>
20895 #define S sizeof(*(b))
20897 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20898 #define NBITS (NBYTES * 8)
20900 char *s = (char *)malloc(NBYTES);
20909 fp = fopen("try.c", "r");
20915 b = ($selecttype)s;
20916 for (i = 0; i < NBITS; i++)
20920 select(fd + 1, b, 0, 0, &t);
20921 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20923 printf("%d\n", i + 1);
20928 if eval $compile_ok; then
20929 selectminbits=`$run ./try`
20930 case "$selectminbits" in
20932 Cannot figure out on how many bits at a time your select() operates.
20933 I'll play safe and guess it is $safebits bits.
20935 selectminbits=$safebits
20936 bits="$safebits bits"
20939 *) bits="$selectminbits bits" ;;
20941 echo "Your select() operates on $bits at a time." >&4
20943 rp='What is the minimum number of bits your select() operates on?'
20944 case "$byteorder" in
20945 12345678) dflt=64 ;;
20951 selectminbits="$val"
20955 *) : no select, so pick a harmless default
20956 selectminbits=$safebits
20962 : Trace out the files included by signal.h, then look for SIGxxx names.
20963 if [ "X$fieldn" = X ]; then
20964 : Just make some guesses. We check them later.
20965 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
20967 xxx=`echo '#include <signal.h>' |
20968 $cppstdin $cppminus $cppflags 2>/dev/null |
20969 $grep '^[ ]*#.*include' |
20970 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20971 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20974 for xx in $xxx /dev/null ; do
20975 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20977 case "$xxxfiles" in
20978 '') xxxfiles=`./findhdr signal.h` ;;
20981 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20982 print substr($2, 4, 20)
20984 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20985 print substr($3, 4, 20)
20987 : Append some common names just in case the awk scan failed.
20988 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20989 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20990 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20991 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20992 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20994 : generate a few handy files for later
20995 $cat > signal.c <<EOCP
20996 #include <sys/types.h>
20997 #include <signal.h>
20998 #$i_stdlib I_STDLIB
21000 #include <stdlib.h>
21005 /* Strange style to avoid deeply-nested #if/#else/#endif */
21008 # define NSIG (_NSIG)
21014 # define NSIG (SIGMAX+1)
21020 # define NSIG (SIG_MAX+1)
21026 # define NSIG (_SIG_MAX+1)
21032 # define NSIG (MAXSIG+1)
21038 # define NSIG (MAX_SIG+1)
21043 # ifdef SIGARRAYSIZE
21044 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21050 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21054 /* Default to some arbitrary number that's big enough to get most
21055 of the common signals.
21061 printf("NSIG %d\n", NSIG);
21067 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21069 printf "#ifdef SIG"; printf $1; printf "\n"
21070 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21071 printf $1; printf ");\n"
21075 printf "#endif /* JUST_NSIG */\n";
21076 printf "exit(0);\n}\n";
21079 $cat >signal.awk <<'EOP'
21080 BEGIN { ndups = 0 }
21081 $1 ~ /^NSIG$/ { nsig = $2 }
21082 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21083 if ($2 > maxsig) { maxsig = $2 }
21084 if (sig_name[$2]) {
21085 dup_name[ndups] = $1
21086 dup_num[ndups] = $2
21098 printf("NSIG %d\n", nsig);
21099 for (n = 1; n < nsig; n++) {
21101 printf("%s %d\n", sig_name[n], sig_num[n])
21104 printf("NUM%d %d\n", n, n)
21107 for (n = 0; n < ndups; n++) {
21108 printf("%s %d\n", dup_name[n], dup_num[n])
21112 $cat >signal_cmd <<EOS
21114 if $test -s signal.lst; then
21115 echo "Using your existing signal.lst file"
21120 $cat >>signal_cmd <<'EOS'
21123 if eval $compile_ok; then
21124 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21125 $uniq | $awk -f signal.awk >signal.lst
21127 echo "(I can't seem be able to compile the whole test program)" >&4
21128 echo "(I'll try it in little pieces.)" >&4
21129 set signal -DJUST_NSIG
21130 if eval $compile_ok; then
21131 $run ./signal$_exe > signal.nsg
21134 echo "I can't seem to figure out how many signals you have." >&4
21135 echo "Guessing 50." >&4
21136 echo 'NSIG 50' > signal.nsg
21138 : Now look at all the signal names, one at a time.
21139 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21140 $cat > signal.c <<EOCP
21141 #include <sys/types.h>
21142 #include <signal.h>
21145 printf("$xx %d\n", SIG${xx});
21150 if eval $compile; then
21151 echo "SIG${xx} found."
21152 $run ./signal$_exe >> signal.ls1
21154 echo "SIG${xx} NOT found."
21157 if $test -s signal.ls1; then
21158 $cat signal.nsg signal.ls1 |
21159 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21163 if $test -s signal.lst; then
21166 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21167 echo 'kill -l' >signal
21168 set X `csh -f <signal`
21172 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21174 echo $@ | $tr ' ' $trnl | \
21175 $awk '{ printf "%s %d\n", $1, ++s; }
21176 END { printf "NSIG %d\n", ++s }' >signal.lst
21178 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21180 chmod a+x signal_cmd
21181 $eunicefix signal_cmd
21183 : generate list of signal names
21185 case "$sig_name_init" in
21187 *) case "$sig_num_init" in
21188 ''|*,*) doinit=yes ;;
21193 echo "Generating a list of signal names and numbers..." >&4
21195 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21196 sig_name=`$awk 'BEGIN { printf "ZERO " }
21197 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21198 sig_num=`$awk 'BEGIN { printf "0 " }
21199 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21200 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21201 !/^NSIG/ { printf "\"%s\", ", $1 }
21202 END { printf "0\n" }' signal.lst`
21203 sig_num_init=`$awk 'BEGIN { printf "0, " }
21204 !/^NSIG/ { printf "%d, ", $2}
21205 END { printf "0\n"}' signal.lst`
21208 echo "The following $sig_count signals are available:"
21210 echo $sig_name | $awk \
21211 'BEGIN { linelen = 0 }
21213 for (i = 1; i <= NF; i++) {
21214 name = "SIG" $i " "
21215 linelen = linelen + length(name)
21216 if (linelen > 70) {
21218 linelen = length(name)
21224 sig_size=`echo $sig_name | awk '{print NF}'`
21225 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21227 : Check size of size
21229 case "$sizetype" in
21230 *_t) zzz="$sizetype" ;;
21231 *) zzz="filesize" ;;
21233 echo "Checking the size of $zzz..." >&4
21235 #include <sys/types.h>
21237 #$i_stdlib I_STDLIB
21239 #include <stdlib.h>
21242 printf("%d\n", (int)sizeof($sizetype));
21247 if eval $compile_ok; then
21251 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21254 echo "Your $zzz size is $sizesize bytes."
21259 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21263 : check for socklen_t
21265 echo "Checking to see if you have socklen_t..." >&4
21267 #include <sys/types.h>
21268 #$d_socket HAS_SOCKET
21270 #include <sys/socket.h>
21272 int main() { socklen_t x = 16; }
21275 if eval $compile; then
21277 echo "You have socklen_t."
21280 echo "You do not have socklen_t."
21281 case "$sizetype" in
21282 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21289 : see if this is a socks.h system
21290 set socks.h i_socks
21293 : check for type of the size argument to socket calls
21294 case "$d_socket" in
21298 Checking to see what type is the last argument of accept().
21301 case "$d_socklen_t" in
21302 "$define") yyy="$yyy socklen_t"
21304 yyy="$yyy $sizetype int long unsigned"
21305 for xxx in $yyy; do
21306 case "$socksizetype" in
21307 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21308 case "$usesocks" in
21310 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21311 echo "Your system accepts '$xxx *' for the last argument of accept()."
21312 socksizetype="$xxx"
21315 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21316 echo "Your system accepts '$xxx *' for the last argument of accept()."
21317 socksizetype="$xxx"
21324 : In case none of those worked, prompt the user.
21325 case "$socksizetype" in
21326 '') rp='What is the type for socket address structure sizes?'
21333 *) : no sockets, so pick relatively harmless default
21338 : see what type is used for signed size_t
21339 set ssize_t ssizetype int stdio.h sys/types.h
21344 #$i_stdlib I_STDLIB
21346 #include <stdlib.h>
21348 #include <sys/types.h>
21349 #define Size_t $sizetype
21350 #define SSize_t $dflt
21353 if (sizeof(Size_t) == sizeof(SSize_t))
21355 else if (sizeof(Size_t) == sizeof(int))
21364 if eval $compile_ok && $run ./try > /dev/null; then
21365 ssizetype=`$run ./try`
21366 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21369 Help! I can't compile and run the ssize_t test program: please enlighten me!
21370 (This is probably a misconfiguration in your system or libraries, and
21371 you really ought to fix it. Still, I'll try anyway.)
21373 I need a type that is the same size as $sizetype, but is guaranteed to
21374 be signed. Common values are ssize_t, int and long.
21377 rp="What signed type is the same size as $sizetype?"
21383 : Check the size of st_ino
21385 $echo "Checking the size of st_ino..." >&4
21386 $cat > try.c <<EOCP
21387 #include <sys/stat.h>
21389 #$i_stdlib I_STDLIB
21391 #include <stdlib.h>
21395 printf("%d\n", (int)sizeof(st.st_ino));
21400 if eval $compile_ok; then
21404 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21406 *) st_ino_size=$val
21407 $echo "Your st_ino is $st_ino_size bytes long."
21412 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21416 : Check if st_ino is signed
21418 $echo "Checking the sign of st_ino..." >&4
21419 $cat > try.c <<EOCP
21420 #include <sys/stat.h>
21425 if (foo.st_ino < 0)
21432 if eval $compile; then
21436 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21438 *) st_ino_sign=$val
21439 case "$st_ino_sign" in
21440 1) $echo "Your st_ino is unsigned." ;;
21441 -1) $echo "Your st_ino is signed." ;;
21447 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21451 : see what type of char stdio uses.
21453 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21454 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21455 echo "Your stdio uses unsigned chars." >&4
21456 stdchar="unsigned char"
21458 echo "Your stdio uses signed chars." >&4
21463 : see what type uids are declared as in the kernel
21465 echo "Looking for the type for user ids returned by getuid()."
21466 set uid_t uidtype xxx stdio.h sys/types.h
21470 xxx=`./findhdr sys/user.h`
21471 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21473 unsigned) dflt="$1 $2" ;;
21477 *) dflt="$uidtype";;
21480 uid_t) echo "uid_t found." ;;
21481 *) rp="What is the type for user ids returned by getuid()?"
21487 : Check size of UID
21490 *_t) zzz="$uidtype" ;;
21493 echo "Checking the size of $zzz..." >&4
21495 #include <sys/types.h>
21497 #$i_stdlib I_STDLIB
21499 #include <stdlib.h>
21502 printf("%d\n", (int)sizeof($uidtype));
21507 if eval $compile_ok; then
21511 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21514 echo "Your $zzz is $uidsize bytes long."
21519 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21522 : Check if UID is signed
21525 *_t) zzz="$uidtype" ;;
21528 echo "Checking the sign of $zzz..." >&4
21530 #include <sys/types.h>
21541 if eval $compile; then
21545 echo "(I can't execute the test program--guessing unsigned.)" >&4
21549 1) echo "Your $zzz is unsigned." ;;
21550 -1) echo "Your $zzz is signed." ;;
21556 echo "(I can't compile the test program--guessing unsigned.)" >&4
21560 : Check format string for UID
21562 $echo "Checking the format string to be used for uids..." >&4
21565 -1) if $test X"$uidsize" = X"$ivsize"; then
21566 uidformat="$ivdformat"
21568 if $test X"$uidsize" = X"$longsize"; then
21571 if $test X"$uidsize" = X"$intsize"; then
21574 if $test X"$uidsize" = X"$shortsize"; then
21581 *) if $test X"$uidsize" = X"$uvsize"; then
21582 uidformat="$uvuformat"
21584 if $test X"$uidsize" = X"$longsize"; then
21587 if $test X"$uidsize" = X"$intsize"; then
21590 if $test X"$uidsize" = X"$shortsize"; then
21599 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21601 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21602 $cat >try.c <<'EOM'
21603 /* Intentionally a long probe as I'd like to sanity check that the exact
21604 approach is going to work, as thinking it will work, but only having it
21605 part working at runtime is worse than not having it. */
21607 #include <sys/types.h>
21608 #include <sys/sysctl.h>
21609 #include <sys/param.h>
21611 #include <string.h>
21612 #include <stdlib.h>
21613 #include <unistd.h>
21616 main(int argc, char **argv) {
21618 char *argv_leaf = strrchr(argv[0], '/');
21624 mib[1] = KERN_PROC;
21625 mib[2] = KERN_PROC_PATHNAME;
21629 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21633 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21638 if (size < strlen(argv_leaf) + 1) {
21639 fprintf(stderr, "size %lu is too short for a path\n",
21640 (unsigned long) size);
21644 if (size > MAXPATHLEN * MAXPATHLEN) {
21645 fprintf(stderr, "size %lu is too long for a path\n",
21646 (unsigned long) size);
21650 buffer = malloc(size);
21656 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21661 if (strlen(buffer) + 1 != size) {
21662 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21663 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21668 if (*buffer != '/') {
21669 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21673 if (strstr(buffer, "/./")) {
21674 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21678 if (strstr(buffer, "/../")) {
21679 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21683 buffer_leaf = strrchr(buffer, '/');
21684 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21685 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21697 if eval $compile; then
21698 if $run ./try; then
21699 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21702 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21706 echo "I'm unable to compile the test program." >&4
21707 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21711 set usekernprocpathname
21714 : Determine if we can use _NSGetExecutablePath to find executing program
21716 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21717 $cat >try.c <<'EOM'
21718 /* Intentionally a long probe as I'd like to sanity check that the exact
21719 approach is going to work, as thinking it will work, but only having it
21720 part working at runtime is worse than not having it. */
21721 #include <mach-o/dyld.h>
21723 #include <stdlib.h>
21724 #include <sys/param.h>
21725 #include <string.h>
21728 main(int argc, char **argv) {
21730 uint32_t size = sizeof(buf);
21734 char *argv_leaf = strrchr(argv[0], '/');
21738 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21742 _NSGetExecutablePath(buf, &size);
21743 if (size > MAXPATHLEN * MAXPATHLEN) {
21744 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21745 (unsigned int) size);
21749 buffer = malloc(size);
21755 result = _NSGetExecutablePath(buffer, &size);
21757 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21758 result, (unsigned int) size);
21762 tidied = realpath(buffer, NULL);
21764 perror("realpath");
21770 if (*tidied != '/') {
21771 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21775 if (strstr(tidied, "/./")) {
21776 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21780 if (strstr(tidied, "/../")) {
21781 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21785 tidied_leaf = strrchr(tidied, '/');
21786 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21787 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21799 if eval $compile; then
21800 if $run ./try; then
21801 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21804 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21807 echo "I'm unable to compile the test program." >&4
21808 echo "I'll assume no _NSGetExecutablePath here." >&4
21811 set usensgetexecutablepath
21814 : Check if site customization support was requested
21815 case "$usesitecustomize" in
21816 $define|true|[Yy]*)
21817 usesitecustomize="$define"
21820 usesitecustomize="$undef"
21824 : see if prototypes support variable argument declarations
21826 case "$prototype$i_stdarg" in
21828 echo "It appears we'll be able to prototype varargs functions." >&4
21832 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21839 : determine compiler compiler
21848 if $test -f "$byacc$_exe"; then
21850 comp="byacc or $comp"
21852 if $test -f "$bison$_exe"; then
21853 comp="$comp or bison -y"
21855 rp="Which compiler compiler ($comp) shall I use?"
21864 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21870 : see if this is a assert.h system
21871 set assert.h i_assert
21874 : see if this is a fp.h system
21878 : see if this is a fp_class.h system
21879 set fp_class.h i_fp_class
21882 : see if gdbm.h is available
21887 : see if gdbm_open exists
21888 set gdbm_open d_gdbm_open
21890 case "$d_gdbm_open" in
21893 echo "We won't be including <gdbm.h>"
21902 : see if this is a ieeefp.h system
21903 case "$i_ieeefp" in
21904 '' ) set ieeefp.h i_ieeefp
21909 : see if this is a libutil.h system
21910 set libutil.h i_libutil
21913 : see if mach cthreads are available
21914 if test "X$usethreads" = "X$define"; then
21915 set mach/cthreads.h i_machcthr
21918 i_machcthr="$undef"
21921 : see if this is a mntent.h system
21922 set mntent.h i_mntent
21925 : see if net/errno.h is available
21927 set net/errno.h val
21930 : Unfortunately, it causes problems on some systems. Arrgh.
21933 cat > try.c <<'EOM'
21936 #include <net/errno.h>
21942 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21943 echo "We'll be including <net/errno.h>." >&4
21945 echo "We won't be including <net/errno.h>." >&4
21954 : see if netinet/tcp.h is available
21955 set netinet/tcp.h i_netinettcp
21958 : see if this is a poll.h system
21962 : see if this is a prot.h system
21966 : Preprocessor symbols
21968 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21969 $cat <<'EOSH' > Cppsym.know
21970 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21971 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21972 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21973 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21974 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21975 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21976 bull c cadmus clipper CMU COFF COMPILER_VERSION
21977 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21978 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21979 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21980 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21982 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21983 H3050R H3050RX hbullx20 hcx host_mips
21984 hp200 hp300 hp700 HP700 hp800 hp9000
21985 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21986 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21987 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21988 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21989 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21990 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21991 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21992 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21993 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21994 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21995 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21996 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21997 MATH_HAS_NO_SIDE_EFFECTS
21998 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21999 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
22000 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
22001 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
22002 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
22003 NetBSD news1500 news1700 news1800 news1900 news3700
22004 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
22005 ns32016 ns32332 ns32k nsc32000
22006 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22007 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
22008 pc532 pdp11 PGC PIC plexus PORTAR posix
22009 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22010 POSIX_C_SOURCE POSIX_SOURCE POWER
22011 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
22012 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
22013 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
22014 sony sony_news sonyrisc sparc sparclite spectrum
22015 stardent stdc STDC_EXT stratos sun sun3 sun386
22016 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
22017 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
22018 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
22019 sysV68 sysV88 Tek4132 Tek4300 titan
22020 TM3200 TM5400 TM5600
22021 tower tower32 tower32_200 tower32_600 tower32_700
22022 tower32_800 tower32_850 tss
22023 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22024 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22025 unix UNIX95 UNIX99 unixpc unos
22026 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22027 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22028 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22030 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22031 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22032 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22035 # Maybe put other stuff here too.
22036 cat <<EOSH >>Cppsym.know
22039 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22040 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22041 $cat Cppsym.know > Cppsym.c
22042 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22043 $rm -f Cppsym.a Cppsym.b Cppsym.c
22044 cat <<EOSH > Cppsym
22046 if $test \$# -gt 0; then
22047 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22048 if $test -s Cppsym.got; then
22055 $tr " " "$trnl" | ./Cppsym.try
22061 cat <<EOSH > Cppsym.try
22063 cat <<'EOCP' > try.c
22066 #define STRINGIFY(a) "a"
22068 #if cpp_stuff == 42
22069 #define StGiFy(a) #a
22070 #define STRINGIFY(a) StGiFy(a)
22072 #if $cpp_stuff != 1 && $cpp_stuff != 42
22073 # include "Bletch: How does this C preprocessor stringify macros?"
22079 cat <<'EOSH' >> Cppsym.try
22081 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22082 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22083 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22084 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22086 echo 'return 0;}' >> try.c
22088 cat <<EOSH >> Cppsym.try
22090 case "$osname-$gccversion" in
22091 irix-) ccflags="\$ccflags -woff 1178" ;;
22092 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22094 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22096 chmod +x Cppsym.try
22097 $eunicefix Cppsym.try
22098 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22099 : Add in any Linux cpp "predefined macros":
22100 case "$osname::$gccversion" in
22101 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22103 rm -f $tHdrH'.h' $tHdrH
22105 # Filter out macro arguments, such as Linux's __INT8_C(c)
22106 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22107 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22108 if [ -s $tHdrH'_cppsym.real' ]; then
22109 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22112 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22115 : now check the C compiler for additional symbols
22116 postprocess_cc_v=''
22118 aix) postprocess_cc_v="|$tr , ' '" ;;
22125 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22128 -D*) echo "\$i" | $sed 's/^-D//';;
22129 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22134 postprocess_cc_v=''
22137 ./ccsym > ccsym1.raw
22138 if $test -s ccsym1.raw; then
22139 $sort ccsym1.raw | $uniq >ccsym.raw
22141 mv ccsym1.raw ccsym.raw
22144 $awk '/\=/ { print $0; next }
22145 { print $0"=1" }' ccsym.raw >ccsym.list
22146 $comm -13 Cppsym.true ccsym.list >ccsym.own
22147 $comm -12 Cppsym.true ccsym.list >ccsym.com
22148 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22150 if $test -z ccsym.raw; then
22151 echo "Your C compiler doesn't seem to define any symbols!" >&4
22153 echo "However, your C preprocessor defines the following symbols:"
22156 cppsymbols=`$cat Cppsym.true`
22157 cppsymbols=`echo $cppsymbols`
22158 cppccsymbols="$cppsymbols"
22160 if $test -s ccsym.com; then
22161 echo "Your C compiler and pre-processor define these symbols:"
22162 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22165 cppccsymbols=`$cat ccsym.com`
22166 cppccsymbols=`echo $cppccsymbols`
22167 $test "$silent" || sleep 1
22169 if $test -s ccsym.cpp; then
22170 $test "$also" && echo " "
22171 echo "Your C pre-processor ${also}defines the following symbols:"
22172 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22174 cppsymbols=`$cat ccsym.cpp`
22175 cppsymbols=`echo $cppsymbols`
22176 $test "$silent" || sleep 1
22178 if $test -s ccsym.own; then
22179 $test "$also" && echo " "
22180 echo "Your C compiler ${also}defines the following cpp symbols:"
22181 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22182 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22183 ccsymbols=`$cat ccsym.own`
22184 ccsymbols=`echo $ccsymbols`
22185 $test "$silent" || sleep 1
22189 : see if this is a termio system
22193 if $test `./findhdr termios.h`; then
22194 set tcsetattr i_termios
22200 "$define") echo "You have POSIX termios.h... good!" >&4;;
22201 *) if ./Cppsym pyr; then
22202 case "`$run /bin/universe`" in
22203 ucb) if $test `./findhdr sgtty.h`; then
22205 echo "<sgtty.h> found." >&4
22207 echo "System is pyramid with BSD universe."
22208 ./warn "<sgtty.h> not found--you could have problems."
22210 *) if $test `./findhdr termio.h`; then
22212 echo "<termio.h> found." >&4
22214 echo "System is pyramid with USG universe."
22215 ./warn "<termio.h> not found--you could have problems."
22219 if $test `./findhdr termio.h`; then
22220 echo "<termio.h> found." >&4
22222 elif $test `./findhdr sgtty.h`; then
22223 echo "<sgtty.h> found." >&4
22226 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22229 if $test `./findhdr sgtty.h`; then
22230 echo "<sgtty.h> found." >&4
22232 elif $test `./findhdr termio.h`; then
22233 echo "<termio.h> found." >&4
22236 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22240 set i_termio; eval $setvar
22241 val=$val2; set i_sgtty; eval $setvar
22242 val=$val3; set i_termios; eval $setvar
22244 : see if stdbool is available
22245 : we want a real compile instead of Inhdr because some Solaris systems
22246 : have stdbool.h, but it can only be used if the compiler indicates it
22247 : is sufficiently c99-compliant.
22251 #include <stdbool.h>
22256 int main(int argc, char **argv)
22262 if eval $compile; then
22263 echo "<stdbool.h> found." >&4
22266 echo "<stdbool.h> NOT found." >&4
22273 : see if stddef is available
22274 set stddef.h i_stddef
22277 : see if sys/access.h is available
22278 set sys/access.h i_sysaccess
22281 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22282 set sys/filio.h i_sysfilio
22285 if $test `./findhdr sys/ioctl.h`; then
22287 echo '<sys/ioctl.h> found.' >&4
22290 if $test $i_sysfilio = "$define"; then
22291 echo '<sys/ioctl.h> NOT found.' >&4
22293 $test $i_sgtty = "$define" && xxx="sgtty.h"
22294 $test $i_termio = "$define" && xxx="termio.h"
22295 $test $i_termios = "$define" && xxx="termios.h"
22296 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22302 : see if socket ioctl defs are in sys/sockio.h
22304 xxx=`./findhdr sys/sockio.h`
22305 if $test "$xxx"; then
22306 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22308 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22311 echo "No socket ioctls found in <sys/sockio.h>." >&4
22316 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22322 : see if this is a syslog.h system
22323 set syslog.h i_syslog
22326 : see if this is a sys/mode.h system
22327 set sys/mode.h i_sysmode
22330 : see if there is a sys/poll.h file
22331 set sys/poll.h i_syspoll
22334 : see if sys/resource.h has to be included
22335 set sys/resource.h i_sysresrc
22338 : see if sys/security.h is available
22339 set sys/security.h i_syssecrt
22342 : see if this is a sys/statvfs.h system
22343 set sys/statvfs.h i_sysstatvfs
22346 : see if this is a sys/un.h system
22347 set sys/un.h i_sysun
22350 : see if this is a sys/utsname.h system
22351 set sys/utsname.h i_sysutsname
22354 : see if this is a syswait system
22355 set sys/wait.h i_syswait
22358 : see if this is a ustat.h system
22359 set ustat.h i_ustat
22362 : see if this is an utime system
22363 set utime.h i_utime
22366 : see if this is a vfork system
22369 set vfork.h i_vfork
22379 echo "Looking for extensions..." >&4
22380 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22381 : contain old or inaccurate or duplicate values.
22382 nonxs_extensions=''
22384 : We do not use find because it might not be available.
22385 : We do not just use MANIFEST because the user may have dropped
22386 : some additional extensions into the source tree and expect them
22389 : Function to recursively find available extensions, ignoring DynaLoader
22390 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22391 : In 5.10.1 and later, extensions are stored in directories
22392 : like File-Glob instead of the older File/Glob/.
22396 DynaLoader|dynaload) ;;
22398 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22399 case "$this_ext" in
22400 Scalar/List/Utils) this_ext="List/Util" ;;
22401 PathTools) this_ext="Cwd" ;;
22403 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22404 if $contains " $this_ext " $$.tmp; then
22406 echo "Duplicate directories detected for extension $xxx" >&4;
22407 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22408 case "$knowitall" in
22416 echo "Ok. Stopping Configure." >&4;
22417 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22420 echo "Ok. You will need to correct config.sh before running make." >&4;
22422 $ls -1 $xxx > $$.tmp;
22423 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22424 xs_extensions="$xs_extensions $this_ext";
22425 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22426 xs_extensions="$xs_extensions $this_ext";
22427 elif $test -d $xxx; then
22428 nonxs_extensions="$nonxs_extensions $this_ext";
22438 eval $find_extensions
22442 eval $find_extensions
22446 eval $find_extensions
22447 set X $xs_extensions
22449 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22450 set X $nonxs_extensions
22452 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22454 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22456 : Now see which are supported on this system.
22458 for xxx in $xs_extensions ; do
22462 $define) avail_ext="$avail_ext $xxx" ;;
22465 GDBM_File|gdbm_fil)
22467 $define) avail_ext="$avail_ext $xxx" ;;
22470 I18N/Langinfo|i18n_lan)
22471 case "$i_langinfo$d_nl_langinfo" in
22472 $define$define) avail_ext="$avail_ext $xxx" ;;
22476 : XXX Do we need a useipcsysv variable here
22477 case "${d_msg}${d_sem}${d_shm}" in
22478 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22481 NDBM_File|ndbm_fil)
22484 case "$osname-$use64bitint" in
22487 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22490 *) avail_ext="$avail_ext $xxx" ;;
22495 ODBM_File|odbm_fil)
22496 case "${i_dbm}${i_rpcsvcdbm}" in
22498 case "$d_cplusplus" in
22499 define) ;; # delete as a function name will not work
22500 *) case "$osname-$use64bitint" in
22503 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22506 *) avail_ext="$avail_ext $xxx" ;;
22514 case "$useopcode" in
22515 true|define|y) avail_ext="$avail_ext $xxx" ;;
22519 case "$useposix" in
22520 true|define|y) avail_ext="$avail_ext $xxx" ;;
22524 case "$d_socket" in
22525 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22528 Sys/Syslog|sys/syslog)
22529 : XXX syslog requires socket
22530 case "$d_socket" in
22531 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22535 case "$usethreads" in
22537 case "$use5005threads" in
22538 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22542 threads|threads/shared)
22543 # threads and threads::shared are special cases.
22544 # To stop people from asking "Perl 5.8.0 was supposed
22545 # to have this new fancy threads implementation but my
22546 # perl doesn't have it" and from people trying to
22547 # (re)install the threads module using CPAN.pm and
22548 # CPAN.pm then offering to reinstall Perl 5.8.0,
22549 # the threads.pm and threads/shared.pm will always be
22550 # there, croaking informatively ("you need to rebuild
22551 # all of Perl with threads, sorry") when threads haven't
22552 # been compiled in.
22554 avail_ext="$avail_ext $xxx"
22560 cygwin) avail_ext="$avail_ext $xxx" ;;
22563 XS/APItest|xs/apitest)
22564 # This is just for testing. Skip it unless we have dynamic loading.
22567 $define) avail_ext="$avail_ext $xxx" ;;
22570 XS/Typemap|xs/typemap)
22571 # This is just for testing. Skip it unless we have dynamic loading.
22573 $define) avail_ext="$avail_ext $xxx" ;;
22576 *) avail_ext="$avail_ext $xxx"
22585 case "$onlyextensions" in
22587 *) keepextensions=''
22588 echo "You have requested that only certain extensions be included..." >&4
22589 for i in $onlyextensions; do
22590 case " $avail_ext " in
22592 echo "Keeping extension $i."
22593 keepextensions="$keepextensions $i"
22595 *) echo "Ignoring extension $i." ;;
22598 avail_ext="$keepextensions"
22602 case "$noextensions" in
22604 *) keepextensions=''
22605 echo "You have requested that certain extensions be ignored..." >&4
22606 for i in $avail_ext; do
22607 case " $noextensions " in
22608 *" $i "*) echo "Ignoring extension $i." ;;
22609 *) echo "Keeping extension $i.";
22610 keepextensions="$keepextensions $i"
22614 avail_ext="$keepextensions"
22618 : Now see which nonxs extensions are supported on this system.
22619 : For now assume all are.
22621 for xxx in $nonxs_extensions ; do
22625 *) nonxs_ext="$nonxs_ext $xxx"
22637 A number of extensions are supplied with $package. You may choose to
22638 compile these extensions for dynamic loading (the default), compile
22639 them into the $package executable (static loading), or not include
22640 them at all. Answer "none" to include no extensions.
22641 Note that DynaLoader is always built and need not be mentioned here.
22644 case "$dynamic_ext" in
22646 : Exclude those listed in static_ext
22648 for xxx in $avail_ext; do
22649 case " $static_ext " in
22651 *) dflt="$dflt $xxx" ;;
22658 *) dflt="$dynamic_ext"
22659 # Perhaps we are reusing an old out-of-date config.sh.
22662 if test X"$dynamic_ext" != X"$avail_ext"; then
22664 NOTICE: Your previous config.sh list may be incorrect.
22665 The extensions now available to you are
22667 but the default list from your previous config.sh is
22679 rp="What extensions do you wish to load dynamically?"
22682 none) dynamic_ext=' ' ;;
22683 *) dynamic_ext="$ans" ;;
22686 case "$static_ext" in
22688 : Exclude those already listed in dynamic linking
22690 for xxx in $avail_ext; do
22691 case " $dynamic_ext " in
22693 *) dflt="$dflt $xxx" ;;
22700 *) dflt="$static_ext"
22707 rp="What extensions do you wish to load statically?"
22710 none) static_ext=' ' ;;
22711 *) static_ext="$ans" ;;
22716 A number of extensions are supplied with $package. Answer "none"
22717 to include no extensions.
22718 Note that DynaLoader is always built and need not be mentioned here.
22721 case "$static_ext" in
22722 '') dflt="$avail_ext" ;;
22723 *) dflt="$static_ext"
22724 # Perhaps we are reusing an old out-of-date config.sh.
22727 if test X"$static_ext" != X"$avail_ext"; then
22729 NOTICE: Your previous config.sh list may be incorrect.
22730 The extensions now available to you are
22732 but the default list from your previous config.sh is
22741 : Exclude those that are not xs extensions
22745 rp="What extensions do you wish to include?"
22748 none) static_ext=' ' ;;
22749 *) static_ext="$ans" ;;
22754 # Encode is a special case. If we are building Encode as a static
22755 # extension, we need to explicitly list its subextensions as well.
22756 # For other nested extensions, this is handled automatically by
22757 # the appropriate Makefile.PL.
22758 case " $static_ext " in
22759 *" Encode "*) # Add the subextensions of Encode
22761 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22762 static_ext="$static_ext Encode/$xxx"
22763 known_extensions="$known_extensions Encode/$xxx"
22769 set X $dynamic_ext $static_ext $nonxs_ext
22773 # Sanity check: We require an extension suitable for use with
22774 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22775 # should show up as failures in the test suite, but it's helpful to
22776 # catch them now.) The 'extensions' list is normally sorted
22777 # alphabetically, so we need to accept either
22778 # DB_File ... Fcntl ... IO ....
22779 # or something like
22780 # Fcntl ... NDBM_File ... IO ....
22781 case " $extensions" in
22782 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22783 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22784 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22785 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22786 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22790 : Remove libraries needed only for extensions
22791 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22792 : The exception is SunOS 4.x, which needs them.
22793 case "${osname}X${osvers}" in
22797 *) case "$usedl" in
22798 $define|true|[yY]*)
22799 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22803 *) perllibs="$libs"
22809 : Remove build directory name from cppstdin so it can be used from
22810 : either the present location or the final installed location.
22812 : Get out of the UU directory to get correct path name.
22814 case "$cppstdin" in
22816 echo "Stripping down cppstdin path name"
22822 : end of configuration questions
22824 echo "End of configuration questions."
22827 : back to where it started
22828 if test -d ../UU; then
22832 : configuration may be unconditionally patched via a 'config.arch' file
22833 if $test -f config.arch; then
22834 echo "I see a config.arch file, loading it." >&4
22838 : configuration may be patched via a 'config.over' file
22839 if $test -f config.over; then
22842 rp='I see a config.over file. Do you wish to load it?'
22845 n*) echo "OK, I'll ignore it.";;
22847 echo "Configuration override changes have been loaded."
22852 : in case they want portability, strip down executable paths
22853 case "$d_portable" in
22856 echo "Stripping down executable paths..." >&4
22857 for file in $loclist $trylist; do
22859 eval $file=`basename $temp`
22864 : create config.sh file
22866 echo "Creating config.sh..." >&4
22867 $spitshell <<EOT >config.sh
22870 # This file was produced by running the Configure script. It holds all the
22871 # definitions figured out by Configure. Should you modify one of these values,
22872 # do not forget to propagate your changes by running "Configure -der". You may
22873 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22876 # Package name : $package
22877 # Source directory : $src
22878 # Configuration time: $cf_time
22879 # Configured by : $cf_by
22880 # Target system : $myuname
22883 : Add in command line options if available
22884 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22886 $spitshell <<EOT >>config.sh
22895 Revision='$Revision'
22903 alignbytes='$alignbytes'
22904 ansi2knr='$ansi2knr'
22905 aphostname='$aphostname'
22906 api_revision='$api_revision'
22907 api_subversion='$api_subversion'
22908 api_version='$api_version'
22909 api_versionstring='$api_versionstring'
22912 archlibexp='$archlibexp'
22913 archname64='$archname64'
22914 archname='$archname'
22915 archobjs='$archobjs'
22916 asctime_r_proto='$asctime_r_proto'
22924 bootstrap_charset='$bootstrap_charset'
22926 byteorder='$byteorder'
22928 castflags='$castflags'
22931 cccdlflags='$cccdlflags'
22932 ccdlflags='$ccdlflags'
22934 ccflags_uselargefiles='$ccflags_uselargefiles'
22936 ccsymbols='$ccsymbols'
22937 ccversion='$ccversion'
22939 cf_email='$cf_email'
22941 charbits='$charbits'
22942 charsize='$charsize'
22946 clocktype='$clocktype'
22948 compress='$compress'
22949 contains='$contains'
22953 cpp_stuff='$cpp_stuff'
22954 cppccsymbols='$cppccsymbols'
22955 cppflags='$cppflags'
22957 cppminus='$cppminus'
22959 cppstdin='$cppstdin'
22960 cppsymbols='$cppsymbols'
22961 crypt_r_proto='$crypt_r_proto'
22962 cryptlib='$cryptlib'
22964 ctermid_r_proto='$ctermid_r_proto'
22965 ctime_r_proto='$ctime_r_proto'
22966 d_Gconvert='$d_Gconvert'
22967 d_PRIEUldbl='$d_PRIEUldbl'
22968 d_PRIFUldbl='$d_PRIFUldbl'
22969 d_PRIGUldbl='$d_PRIGUldbl'
22970 d_PRIXU64='$d_PRIXU64'
22971 d_PRId64='$d_PRId64'
22972 d_PRIeldbl='$d_PRIeldbl'
22973 d_PRIfldbl='$d_PRIfldbl'
22974 d_PRIgldbl='$d_PRIgldbl'
22975 d_PRIi64='$d_PRIi64'
22976 d_PRIo64='$d_PRIo64'
22977 d_PRIu64='$d_PRIu64'
22978 d_PRIx64='$d_PRIx64'
22979 d_SCNfldbl='$d_SCNfldbl'
22980 d__fwalk='$d__fwalk'
22981 d_access='$d_access'
22982 d_accessx='$d_accessx'
22985 d_archlib='$d_archlib'
22986 d_asctime64='$d_asctime64'
22987 d_asctime_r='$d_asctime_r'
22990 d_attribute_deprecated='$d_attribute_deprecated'
22991 d_attribute_format='$d_attribute_format'
22992 d_attribute_malloc='$d_attribute_malloc'
22993 d_attribute_nonnull='$d_attribute_nonnull'
22994 d_attribute_noreturn='$d_attribute_noreturn'
22995 d_attribute_pure='$d_attribute_pure'
22996 d_attribute_unused='$d_attribute_unused'
22997 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23001 d_bsdgetpgrp='$d_bsdgetpgrp'
23002 d_bsdsetpgrp='$d_bsdsetpgrp'
23003 d_builtin_choose_expr='$d_builtin_choose_expr'
23004 d_builtin_expect='$d_builtin_expect'
23006 d_c99_variadic_macros='$d_c99_variadic_macros'
23007 d_casti32='$d_casti32'
23008 d_castneg='$d_castneg'
23009 d_charvspr='$d_charvspr'
23011 d_chroot='$d_chroot'
23012 d_chsize='$d_chsize'
23014 d_clearenv='$d_clearenv'
23015 d_closedir='$d_closedir'
23016 d_cmsghdr_s='$d_cmsghdr_s'
23018 d_copysignl='$d_copysignl'
23019 d_cplusplus='$d_cplusplus'
23021 d_crypt_r='$d_crypt_r'
23023 d_ctermid='$d_ctermid'
23024 d_ctermid_r='$d_ctermid_r'
23025 d_ctime64='$d_ctime64'
23026 d_ctime_r='$d_ctime_r'
23027 d_cuserid='$d_cuserid'
23028 d_dbl_dig='$d_dbl_dig'
23029 d_dbminitproto='$d_dbminitproto'
23030 d_difftime64='$d_difftime64'
23031 d_difftime='$d_difftime'
23032 d_dir_dd_fd='$d_dir_dd_fd'
23034 d_dirnamlen='$d_dirnamlen'
23035 d_dlerror='$d_dlerror'
23036 d_dlopen='$d_dlopen'
23037 d_dlsymun='$d_dlsymun'
23038 d_dosuid='$d_dosuid'
23039 d_drand48_r='$d_drand48_r'
23040 d_drand48proto='$d_drand48proto'
23042 d_eaccess='$d_eaccess'
23043 d_endgrent='$d_endgrent'
23044 d_endgrent_r='$d_endgrent_r'
23045 d_endhent='$d_endhent'
23046 d_endhostent_r='$d_endhostent_r'
23047 d_endnent='$d_endnent'
23048 d_endnetent_r='$d_endnetent_r'
23049 d_endpent='$d_endpent'
23050 d_endprotoent_r='$d_endprotoent_r'
23051 d_endpwent='$d_endpwent'
23052 d_endpwent_r='$d_endpwent_r'
23053 d_endsent='$d_endsent'
23054 d_endservent_r='$d_endservent_r'
23055 d_eofnblk='$d_eofnblk'
23056 d_eunice='$d_eunice'
23057 d_faststdio='$d_faststdio'
23058 d_fchdir='$d_fchdir'
23059 d_fchmod='$d_fchmod'
23060 d_fchown='$d_fchown'
23062 d_fcntl_can_lock='$d_fcntl_can_lock'
23063 d_fd_macros='$d_fd_macros'
23064 d_fd_set='$d_fd_set'
23065 d_fds_bits='$d_fds_bits'
23066 d_fgetpos='$d_fgetpos'
23067 d_finite='$d_finite'
23068 d_finitel='$d_finitel'
23069 d_flexfnam='$d_flexfnam'
23071 d_flockproto='$d_flockproto'
23073 d_fp_class='$d_fp_class'
23074 d_fpathconf='$d_fpathconf'
23075 d_fpclass='$d_fpclass'
23076 d_fpclassify='$d_fpclassify'
23077 d_fpclassl='$d_fpclassl'
23078 d_fpos64_t='$d_fpos64_t'
23079 d_frexpl='$d_frexpl'
23080 d_fs_data_s='$d_fs_data_s'
23081 d_fseeko='$d_fseeko'
23082 d_fsetpos='$d_fsetpos'
23083 d_fstatfs='$d_fstatfs'
23084 d_fstatvfs='$d_fstatvfs'
23086 d_ftello='$d_ftello'
23088 d_futimes='$d_futimes'
23089 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23090 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23091 d_getaddrinfo='$d_getaddrinfo'
23092 d_getcwd='$d_getcwd'
23093 d_getespwnam='$d_getespwnam'
23094 d_getfsstat='$d_getfsstat'
23095 d_getgrent='$d_getgrent'
23096 d_getgrent_r='$d_getgrent_r'
23097 d_getgrgid_r='$d_getgrgid_r'
23098 d_getgrnam_r='$d_getgrnam_r'
23099 d_getgrps='$d_getgrps'
23100 d_gethbyaddr='$d_gethbyaddr'
23101 d_gethbyname='$d_gethbyname'
23102 d_gethent='$d_gethent'
23103 d_gethname='$d_gethname'
23104 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23105 d_gethostbyname_r='$d_gethostbyname_r'
23106 d_gethostent_r='$d_gethostent_r'
23107 d_gethostprotos='$d_gethostprotos'
23108 d_getitimer='$d_getitimer'
23109 d_getlogin='$d_getlogin'
23110 d_getlogin_r='$d_getlogin_r'
23111 d_getmnt='$d_getmnt'
23112 d_getmntent='$d_getmntent'
23113 d_getnameinfo='$d_getnameinfo'
23114 d_getnbyaddr='$d_getnbyaddr'
23115 d_getnbyname='$d_getnbyname'
23116 d_getnent='$d_getnent'
23117 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23118 d_getnetbyname_r='$d_getnetbyname_r'
23119 d_getnetent_r='$d_getnetent_r'
23120 d_getnetprotos='$d_getnetprotos'
23121 d_getpagsz='$d_getpagsz'
23122 d_getpbyname='$d_getpbyname'
23123 d_getpbynumber='$d_getpbynumber'
23124 d_getpent='$d_getpent'
23125 d_getpgid='$d_getpgid'
23126 d_getpgrp2='$d_getpgrp2'
23127 d_getpgrp='$d_getpgrp'
23128 d_getppid='$d_getppid'
23129 d_getprior='$d_getprior'
23130 d_getprotobyname_r='$d_getprotobyname_r'
23131 d_getprotobynumber_r='$d_getprotobynumber_r'
23132 d_getprotoent_r='$d_getprotoent_r'
23133 d_getprotoprotos='$d_getprotoprotos'
23134 d_getprpwnam='$d_getprpwnam'
23135 d_getpwent='$d_getpwent'
23136 d_getpwent_r='$d_getpwent_r'
23137 d_getpwnam_r='$d_getpwnam_r'
23138 d_getpwuid_r='$d_getpwuid_r'
23139 d_getsbyname='$d_getsbyname'
23140 d_getsbyport='$d_getsbyport'
23141 d_getsent='$d_getsent'
23142 d_getservbyname_r='$d_getservbyname_r'
23143 d_getservbyport_r='$d_getservbyport_r'
23144 d_getservent_r='$d_getservent_r'
23145 d_getservprotos='$d_getservprotos'
23146 d_getspnam='$d_getspnam'
23147 d_getspnam_r='$d_getspnam_r'
23148 d_gettimeod='$d_gettimeod'
23149 d_gmtime64='$d_gmtime64'
23150 d_gmtime_r='$d_gmtime_r'
23151 d_gnulibc='$d_gnulibc'
23152 d_grpasswd='$d_grpasswd'
23153 d_hasmntopt='$d_hasmntopt'
23155 d_ilogbl='$d_ilogbl'
23156 d_inc_version_list='$d_inc_version_list'
23158 d_inetaton='$d_inetaton'
23159 d_inetntop='$d_inetntop'
23160 d_inetpton='$d_inetpton'
23161 d_int64_t='$d_int64_t'
23162 d_ip_mreq='$d_ip_mreq'
23163 d_ip_mreq_source='$d_ip_mreq_source'
23164 d_ipv6_mreq='$d_ipv6_mreq'
23165 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23166 d_isascii='$d_isascii'
23167 d_isblank='$d_isblank'
23168 d_isfinite='$d_isfinite'
23171 d_isnanl='$d_isnanl'
23172 d_killpg='$d_killpg'
23173 d_lchown='$d_lchown'
23174 d_ldbl_dig='$d_ldbl_dig'
23175 d_libm_lib_version='$d_libm_lib_version'
23176 d_libname_unique='$d_libname_unique'
23178 d_localtime64='$d_localtime64'
23179 d_localtime_r='$d_localtime_r'
23180 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23181 d_locconv='$d_locconv'
23183 d_longdbl='$d_longdbl'
23184 d_longlong='$d_longlong'
23185 d_lseekproto='$d_lseekproto'
23187 d_madvise='$d_madvise'
23188 d_malloc_good_size='$d_malloc_good_size'
23189 d_malloc_size='$d_malloc_size'
23191 d_mbstowcs='$d_mbstowcs'
23192 d_mbtowc='$d_mbtowc'
23193 d_memchr='$d_memchr'
23194 d_memcmp='$d_memcmp'
23195 d_memcpy='$d_memcpy'
23196 d_memmove='$d_memmove'
23197 d_memset='$d_memset'
23199 d_mkdtemp='$d_mkdtemp'
23200 d_mkfifo='$d_mkfifo'
23201 d_mkstemp='$d_mkstemp'
23202 d_mkstemps='$d_mkstemps'
23203 d_mktime64='$d_mktime64'
23204 d_mktime='$d_mktime'
23207 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23208 d_modflproto='$d_modflproto'
23209 d_mprotect='$d_mprotect'
23211 d_msg_ctrunc='$d_msg_ctrunc'
23212 d_msg_dontroute='$d_msg_dontroute'
23213 d_msg_oob='$d_msg_oob'
23214 d_msg_peek='$d_msg_peek'
23215 d_msg_proxy='$d_msg_proxy'
23216 d_msgctl='$d_msgctl'
23217 d_msgget='$d_msgget'
23218 d_msghdr_s='$d_msghdr_s'
23219 d_msgrcv='$d_msgrcv'
23220 d_msgsnd='$d_msgsnd'
23222 d_munmap='$d_munmap'
23223 d_mymalloc='$d_mymalloc'
23225 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23227 d_nl_langinfo='$d_nl_langinfo'
23228 d_nv_preserves_uv='$d_nv_preserves_uv'
23229 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23230 d_off64_t='$d_off64_t'
23231 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23232 d_oldpthreads='$d_oldpthreads'
23233 d_oldsock='$d_oldsock'
23235 d_pathconf='$d_pathconf'
23237 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23238 d_phostname='$d_phostname'
23241 d_portable='$d_portable'
23243 d_prctl_set_name='$d_prctl_set_name'
23244 d_printf_format_null='$d_printf_format_null'
23245 d_procselfexe='$d_procselfexe'
23246 d_pseudofork='$d_pseudofork'
23247 d_pthread_atfork='$d_pthread_atfork'
23248 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23249 d_pthread_yield='$d_pthread_yield'
23251 d_pwchange='$d_pwchange'
23252 d_pwclass='$d_pwclass'
23253 d_pwcomment='$d_pwcomment'
23254 d_pwexpire='$d_pwexpire'
23255 d_pwgecos='$d_pwgecos'
23256 d_pwpasswd='$d_pwpasswd'
23257 d_pwquota='$d_pwquota'
23260 d_random_r='$d_random_r'
23261 d_readdir64_r='$d_readdir64_r'
23262 d_readdir='$d_readdir'
23263 d_readdir_r='$d_readdir_r'
23264 d_readlink='$d_readlink'
23266 d_recvmsg='$d_recvmsg'
23267 d_rename='$d_rename'
23268 d_rewinddir='$d_rewinddir'
23270 d_safebcpy='$d_safebcpy'
23271 d_safemcpy='$d_safemcpy'
23272 d_sanemcmp='$d_sanemcmp'
23273 d_sbrkproto='$d_sbrkproto'
23274 d_scalbnl='$d_scalbnl'
23275 d_sched_yield='$d_sched_yield'
23276 d_scm_rights='$d_scm_rights'
23277 d_seekdir='$d_seekdir'
23278 d_select='$d_select'
23280 d_semctl='$d_semctl'
23281 d_semctl_semid_ds='$d_semctl_semid_ds'
23282 d_semctl_semun='$d_semctl_semun'
23283 d_semget='$d_semget'
23285 d_sendmsg='$d_sendmsg'
23286 d_setegid='$d_setegid'
23287 d_seteuid='$d_seteuid'
23288 d_setgrent='$d_setgrent'
23289 d_setgrent_r='$d_setgrent_r'
23290 d_setgrps='$d_setgrps'
23291 d_sethent='$d_sethent'
23292 d_sethostent_r='$d_sethostent_r'
23293 d_setitimer='$d_setitimer'
23294 d_setlinebuf='$d_setlinebuf'
23295 d_setlocale='$d_setlocale'
23296 d_setlocale_r='$d_setlocale_r'
23297 d_setnent='$d_setnent'
23298 d_setnetent_r='$d_setnetent_r'
23299 d_setpent='$d_setpent'
23300 d_setpgid='$d_setpgid'
23301 d_setpgrp2='$d_setpgrp2'
23302 d_setpgrp='$d_setpgrp'
23303 d_setprior='$d_setprior'
23304 d_setproctitle='$d_setproctitle'
23305 d_setprotoent_r='$d_setprotoent_r'
23306 d_setpwent='$d_setpwent'
23307 d_setpwent_r='$d_setpwent_r'
23308 d_setregid='$d_setregid'
23309 d_setresgid='$d_setresgid'
23310 d_setresuid='$d_setresuid'
23311 d_setreuid='$d_setreuid'
23312 d_setrgid='$d_setrgid'
23313 d_setruid='$d_setruid'
23314 d_setsent='$d_setsent'
23315 d_setservent_r='$d_setservent_r'
23316 d_setsid='$d_setsid'
23317 d_setvbuf='$d_setvbuf'
23320 d_shmatprototype='$d_shmatprototype'
23321 d_shmctl='$d_shmctl'
23323 d_shmget='$d_shmget'
23324 d_sigaction='$d_sigaction'
23325 d_signbit='$d_signbit'
23326 d_sigprocmask='$d_sigprocmask'
23327 d_sigsetjmp='$d_sigsetjmp'
23328 d_sin6_scope_id='$d_sin6_scope_id'
23329 d_sitearch='$d_sitearch'
23330 d_snprintf='$d_snprintf'
23331 d_sockaddr_in6='$d_sockaddr_in6'
23332 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23333 d_sockatmark='$d_sockatmark'
23334 d_sockatmarkproto='$d_sockatmarkproto'
23335 d_socket='$d_socket'
23336 d_socklen_t='$d_socklen_t'
23337 d_sockpair='$d_sockpair'
23338 d_socks5_init='$d_socks5_init'
23339 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23341 d_srand48_r='$d_srand48_r'
23342 d_srandom_r='$d_srandom_r'
23343 d_sresgproto='$d_sresgproto'
23344 d_sresuproto='$d_sresuproto'
23345 d_statblks='$d_statblks'
23346 d_statfs_f_flags='$d_statfs_f_flags'
23347 d_statfs_s='$d_statfs_s'
23348 d_static_inline='$d_static_inline'
23349 d_statvfs='$d_statvfs'
23350 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23351 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23352 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23353 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23354 d_stdio_stream_array='$d_stdio_stream_array'
23355 d_stdiobase='$d_stdiobase'
23356 d_stdstdio='$d_stdstdio'
23357 d_strchr='$d_strchr'
23358 d_strcoll='$d_strcoll'
23359 d_strctcpy='$d_strctcpy'
23360 d_strerrm='$d_strerrm'
23361 d_strerror='$d_strerror'
23362 d_strerror_r='$d_strerror_r'
23363 d_strftime='$d_strftime'
23364 d_strlcat='$d_strlcat'
23365 d_strlcpy='$d_strlcpy'
23366 d_strtod='$d_strtod'
23367 d_strtol='$d_strtol'
23368 d_strtold='$d_strtold'
23369 d_strtoll='$d_strtoll'
23370 d_strtoq='$d_strtoq'
23371 d_strtoul='$d_strtoul'
23372 d_strtoull='$d_strtoull'
23373 d_strtouq='$d_strtouq'
23374 d_strxfrm='$d_strxfrm'
23375 d_suidsafe='$d_suidsafe'
23376 d_symlink='$d_symlink'
23377 d_syscall='$d_syscall'
23378 d_syscallproto='$d_syscallproto'
23379 d_sysconf='$d_sysconf'
23380 d_sysernlst='$d_sysernlst'
23381 d_syserrlst='$d_syserrlst'
23382 d_system='$d_system'
23383 d_tcgetpgrp='$d_tcgetpgrp'
23384 d_tcsetpgrp='$d_tcsetpgrp'
23385 d_telldir='$d_telldir'
23386 d_telldirproto='$d_telldirproto'
23388 d_timegm='$d_timegm'
23390 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23391 d_tm_tm_zone='$d_tm_tm_zone'
23392 d_tmpnam_r='$d_tmpnam_r'
23393 d_truncate='$d_truncate'
23394 d_ttyname_r='$d_ttyname_r'
23395 d_tzname='$d_tzname'
23396 d_u32align='$d_u32align'
23397 d_ualarm='$d_ualarm'
23400 d_union_semun='$d_union_semun'
23401 d_unordered='$d_unordered'
23402 d_unsetenv='$d_unsetenv'
23403 d_usleep='$d_usleep'
23404 d_usleepproto='$d_usleepproto'
23406 d_vendorarch='$d_vendorarch'
23407 d_vendorbin='$d_vendorbin'
23408 d_vendorlib='$d_vendorlib'
23409 d_vendorscript='$d_vendorscript'
23411 d_void_closedir='$d_void_closedir'
23412 d_voidsig='$d_voidsig'
23413 d_voidtty='$d_voidtty'
23414 d_volatile='$d_volatile'
23415 d_vprintf='$d_vprintf'
23416 d_vsnprintf='$d_vsnprintf'
23418 d_waitpid='$d_waitpid'
23419 d_wcstombs='$d_wcstombs'
23420 d_wctomb='$d_wctomb'
23421 d_writev='$d_writev'
23424 db_hashtype='$db_hashtype'
23425 db_prefixtype='$db_prefixtype'
23426 db_version_major='$db_version_major'
23427 db_version_minor='$db_version_minor'
23428 db_version_patch='$db_version_patch'
23429 direntrytype='$direntrytype'
23432 doublesize='$doublesize'
23434 drand48_r_proto='$drand48_r_proto'
23436 dynamic_ext='$dynamic_ext'
23442 endgrent_r_proto='$endgrent_r_proto'
23443 endhostent_r_proto='$endhostent_r_proto'
23444 endnetent_r_proto='$endnetent_r_proto'
23445 endprotoent_r_proto='$endprotoent_r_proto'
23446 endpwent_r_proto='$endpwent_r_proto'
23447 endservent_r_proto='$endservent_r_proto'
23448 eunicefix='$eunicefix'
23451 extensions='$extensions'
23452 extern_C='$extern_C'
23454 fflushNULL='$fflushNULL'
23455 fflushall='$fflushall'
23457 firstmakefile='$firstmakefile'
23459 fpossize='$fpossize'
23460 fpostype='$fpostype'
23461 freetype='$freetype'
23464 full_csh='$full_csh'
23465 full_sed='$full_sed'
23466 gccansipedantic='$gccansipedantic'
23467 gccosandvers='$gccosandvers'
23468 gccversion='$gccversion'
23469 getgrent_r_proto='$getgrent_r_proto'
23470 getgrgid_r_proto='$getgrgid_r_proto'
23471 getgrnam_r_proto='$getgrnam_r_proto'
23472 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23473 gethostbyname_r_proto='$gethostbyname_r_proto'
23474 gethostent_r_proto='$gethostent_r_proto'
23475 getlogin_r_proto='$getlogin_r_proto'
23476 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23477 getnetbyname_r_proto='$getnetbyname_r_proto'
23478 getnetent_r_proto='$getnetent_r_proto'
23479 getprotobyname_r_proto='$getprotobyname_r_proto'
23480 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23481 getprotoent_r_proto='$getprotoent_r_proto'
23482 getpwent_r_proto='$getpwent_r_proto'
23483 getpwnam_r_proto='$getpwnam_r_proto'
23484 getpwuid_r_proto='$getpwuid_r_proto'
23485 getservbyname_r_proto='$getservbyname_r_proto'
23486 getservbyport_r_proto='$getservbyport_r_proto'
23487 getservent_r_proto='$getservent_r_proto'
23488 getspnam_r_proto='$getspnam_r_proto'
23489 gidformat='$gidformat'
23495 gmtime_r_proto='$gmtime_r_proto'
23496 gnulibc_version='$gnulibc_version'
23498 groupcat='$groupcat'
23499 groupstype='$groupstype'
23502 h_sysfile='$h_sysfile'
23505 hostgenerate='$hostgenerate'
23506 hostosname='$hostosname'
23507 hostperl='$hostperl'
23508 html1dir='$html1dir'
23509 html1direxp='$html1direxp'
23510 html3dir='$html3dir'
23511 html3direxp='$html3direxp'
23520 i_arpainet='$i_arpainet'
23521 i_assert='$i_assert'
23522 i_bsdioctl='$i_bsdioctl'
23526 i_dirent='$i_dirent'
23531 i_fp_class='$i_fp_class'
23533 i_gdbm_ndbm='$i_gdbm_ndbm'
23534 i_gdbmndbm='$i_gdbmndbm'
23536 i_ieeefp='$i_ieeefp'
23537 i_inttypes='$i_inttypes'
23538 i_langinfo='$i_langinfo'
23539 i_libutil='$i_libutil'
23540 i_limits='$i_limits'
23541 i_locale='$i_locale'
23542 i_machcthr='$i_machcthr'
23543 i_malloc='$i_malloc'
23544 i_mallocmalloc='$i_mallocmalloc'
23546 i_memory='$i_memory'
23547 i_mntent='$i_mntent'
23550 i_neterrno='$i_neterrno'
23551 i_netinettcp='$i_netinettcp'
23555 i_pthread='$i_pthread'
23557 i_rpcsvcdbm='$i_rpcsvcdbm'
23559 i_shadow='$i_shadow'
23561 i_stdarg='$i_stdarg'
23562 i_stdbool='$i_stdbool'
23563 i_stddef='$i_stddef'
23564 i_stdlib='$i_stdlib'
23565 i_string='$i_string'
23566 i_sunmath='$i_sunmath'
23567 i_sysaccess='$i_sysaccess'
23568 i_sysdir='$i_sysdir'
23569 i_sysfile='$i_sysfile'
23570 i_sysfilio='$i_sysfilio'
23572 i_sysioctl='$i_sysioctl'
23573 i_syslog='$i_syslog'
23574 i_sysmman='$i_sysmman'
23575 i_sysmode='$i_sysmode'
23576 i_sysmount='$i_sysmount'
23577 i_sysndir='$i_sysndir'
23578 i_sysparam='$i_sysparam'
23579 i_syspoll='$i_syspoll'
23580 i_sysresrc='$i_sysresrc'
23581 i_syssecrt='$i_syssecrt'
23582 i_sysselct='$i_sysselct'
23583 i_syssockio='$i_syssockio'
23584 i_sysstat='$i_sysstat'
23585 i_sysstatfs='$i_sysstatfs'
23586 i_sysstatvfs='$i_sysstatvfs'
23587 i_systime='$i_systime'
23588 i_systimek='$i_systimek'
23589 i_systimes='$i_systimes'
23590 i_systypes='$i_systypes'
23591 i_sysuio='$i_sysuio'
23593 i_sysutsname='$i_sysutsname'
23594 i_sysvfs='$i_sysvfs'
23595 i_syswait='$i_syswait'
23596 i_termio='$i_termio'
23597 i_termios='$i_termios'
23599 i_unistd='$i_unistd'
23602 i_values='$i_values'
23603 i_varargs='$i_varargs'
23604 i_varhdr='$i_varhdr'
23606 ignore_versioned_solibs='$ignore_versioned_solibs'
23607 inc_version_list='$inc_version_list'
23608 inc_version_list_init='$inc_version_list_init'
23612 initialinstalllocation='$initialinstalllocation'
23613 installarchlib='$installarchlib'
23614 installbin='$installbin'
23615 installhtml1dir='$installhtml1dir'
23616 installhtml3dir='$installhtml3dir'
23617 installman1dir='$installman1dir'
23618 installman3dir='$installman3dir'
23619 installprefix='$installprefix'
23620 installprefixexp='$installprefixexp'
23621 installprivlib='$installprivlib'
23622 installscript='$installscript'
23623 installsitearch='$installsitearch'
23624 installsitebin='$installsitebin'
23625 installsitehtml1dir='$installsitehtml1dir'
23626 installsitehtml3dir='$installsitehtml3dir'
23627 installsitelib='$installsitelib'
23628 installsiteman1dir='$installsiteman1dir'
23629 installsiteman3dir='$installsiteman3dir'
23630 installsitescript='$installsitescript'
23631 installstyle='$installstyle'
23632 installusrbinperl='$installusrbinperl'
23633 installvendorarch='$installvendorarch'
23634 installvendorbin='$installvendorbin'
23635 installvendorhtml1dir='$installvendorhtml1dir'
23636 installvendorhtml3dir='$installvendorhtml3dir'
23637 installvendorlib='$installvendorlib'
23638 installvendorman1dir='$installvendorman1dir'
23639 installvendorman3dir='$installvendorman3dir'
23640 installvendorscript='$installvendorscript'
23642 issymlink='$issymlink'
23643 ivdformat='$ivdformat'
23646 known_extensions='$known_extensions'
23649 ld_can_script='$ld_can_script'
23650 lddlflags='$lddlflags'
23652 ldflags_uselargefiles='$ldflags_uselargefiles'
23653 ldlibpthname='$ldlibpthname'
23660 libsdirs='$libsdirs'
23661 libsfiles='$libsfiles'
23662 libsfound='$libsfound'
23663 libspath='$libspath'
23664 libswanted='$libswanted'
23665 libswanted_uselargefiles='$libswanted_uselargefiles'
23671 localtime_r_proto='$localtime_r_proto'
23672 locincpth='$locincpth'
23673 loclibpth='$loclibpth'
23674 longdblsize='$longdblsize'
23675 longlongsize='$longlongsize'
23676 longsize='$longsize'
23680 lseeksize='$lseeksize'
23681 lseektype='$lseektype'
23684 madlyobj='$madlyobj'
23685 madlysrc='$madlysrc'
23689 make_set_make='$make_set_make'
23690 mallocobj='$mallocobj'
23691 mallocsrc='$mallocsrc'
23692 malloctype='$malloctype'
23694 man1direxp='$man1direxp'
23697 man3direxp='$man3direxp'
23699 mips_type='$mips_type'
23700 mistrustnm='$mistrustnm'
23702 mmaptype='$mmaptype'
23703 modetype='$modetype'
23705 multiarch='$multiarch'
23707 myarchname='$myarchname'
23708 mydomain='$mydomain'
23709 myhostname='$myhostname'
23712 need_va_copy='$need_va_copy'
23713 netdb_hlen_type='$netdb_hlen_type'
23714 netdb_host_type='$netdb_host_type'
23715 netdb_name_type='$netdb_name_type'
23716 netdb_net_type='$netdb_net_type'
23719 nm_so_opt='$nm_so_opt'
23720 nonxs_ext='$nonxs_ext'
23722 nvEUformat='$nvEUformat'
23723 nvFUformat='$nvFUformat'
23724 nvGUformat='$nvGUformat'
23725 nv_overflows_integers_at='$nv_overflows_integers_at'
23726 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23727 nveformat='$nveformat'
23728 nvfformat='$nvfformat'
23729 nvgformat='$nvgformat'
23732 o_nonblock='$o_nonblock'
23734 old_pthread_create_joinable='$old_pthread_create_joinable'
23735 optimize='$optimize'
23736 orderlib='$orderlib'
23739 otherlibdirs='$otherlibdirs'
23743 patchlevel='$patchlevel'
23744 path_sep='$path_sep'
23747 perl_patchlevel='$perl_patchlevel'
23748 perl_static_inline='$perl_static_inline'
23749 perladmin='$perladmin'
23750 perllibs='$perllibs'
23751 perlpath='$perlpath'
23753 phostname='$phostname'
23759 prefixexp='$prefixexp'
23761 privlibexp='$privlibexp'
23762 procselfexe='$procselfexe'
23763 prototype='$prototype'
23765 quadkind='$quadkind'
23766 quadtype='$quadtype'
23767 randbits='$randbits'
23768 randfunc='$randfunc'
23769 random_r_proto='$random_r_proto'
23770 randseedtype='$randseedtype'
23772 rd_nodata='$rd_nodata'
23773 readdir64_r_proto='$readdir64_r_proto'
23774 readdir_r_proto='$readdir_r_proto'
23775 revision='$revision'
23781 sGMTIME_max='$sGMTIME_max'
23782 sGMTIME_min='$sGMTIME_min'
23783 sLOCALTIME_max='$sLOCALTIME_max'
23784 sLOCALTIME_min='$sLOCALTIME_min'
23785 sPRIEUldbl='$sPRIEUldbl'
23786 sPRIFUldbl='$sPRIFUldbl'
23787 sPRIGUldbl='$sPRIGUldbl'
23788 sPRIXU64='$sPRIXU64'
23790 sPRIeldbl='$sPRIeldbl'
23791 sPRIfldbl='$sPRIfldbl'
23792 sPRIgldbl='$sPRIgldbl'
23797 sSCNfldbl='$sSCNfldbl'
23798 sched_yield='$sched_yield'
23799 scriptdir='$scriptdir'
23800 scriptdirexp='$scriptdirexp'
23802 seedfunc='$seedfunc'
23803 selectminbits='$selectminbits'
23804 selecttype='$selecttype'
23805 sendmail='$sendmail'
23806 setgrent_r_proto='$setgrent_r_proto'
23807 sethostent_r_proto='$sethostent_r_proto'
23808 setlocale_r_proto='$setlocale_r_proto'
23809 setnetent_r_proto='$setnetent_r_proto'
23810 setprotoent_r_proto='$setprotoent_r_proto'
23811 setpwent_r_proto='$setpwent_r_proto'
23812 setservent_r_proto='$setservent_r_proto'
23815 sharpbang='$sharpbang'
23816 shmattype='$shmattype'
23817 shortsize='$shortsize'
23820 sig_count='$sig_count'
23821 sig_name='$sig_name'
23822 sig_name_init='$sig_name_init'
23824 sig_num_init='$sig_num_init'
23825 sig_size='$sig_size'
23826 signal_t='$signal_t'
23827 sitearch='$sitearch'
23828 sitearchexp='$sitearchexp'
23830 sitebinexp='$sitebinexp'
23831 sitehtml1dir='$sitehtml1dir'
23832 sitehtml1direxp='$sitehtml1direxp'
23833 sitehtml3dir='$sitehtml3dir'
23834 sitehtml3direxp='$sitehtml3direxp'
23836 sitelib_stem='$sitelib_stem'
23837 sitelibexp='$sitelibexp'
23838 siteman1dir='$siteman1dir'
23839 siteman1direxp='$siteman1direxp'
23840 siteman3dir='$siteman3dir'
23841 siteman3direxp='$siteman3direxp'
23842 siteprefix='$siteprefix'
23843 siteprefixexp='$siteprefixexp'
23844 sitescript='$sitescript'
23845 sitescriptexp='$sitescriptexp'
23846 sizesize='$sizesize'
23847 sizetype='$sizetype'
23851 sockethdr='$sockethdr'
23852 socketlib='$socketlib'
23853 socksizetype='$socksizetype'
23855 spackage='$spackage'
23856 spitshell='$spitshell'
23857 srand48_r_proto='$srand48_r_proto'
23858 srandom_r_proto='$srandom_r_proto'
23860 ssizetype='$ssizetype'
23861 st_ino_sign='$st_ino_sign'
23862 st_ino_size='$st_ino_size'
23863 startperl='$startperl'
23865 static_ext='$static_ext'
23867 stdio_base='$stdio_base'
23868 stdio_bufsiz='$stdio_bufsiz'
23869 stdio_cnt='$stdio_cnt'
23870 stdio_filbuf='$stdio_filbuf'
23871 stdio_ptr='$stdio_ptr'
23872 stdio_stream_array='$stdio_stream_array'
23873 strerror_r_proto='$strerror_r_proto'
23876 subversion='$subversion'
23881 targetarch='$targetarch'
23882 targetdir='$targetdir'
23883 targetenv='$targetenv'
23884 targethost='$targethost'
23885 targetmkdir='$targetmkdir'
23886 targetport='$targetport'
23887 targetsh='$targetsh'
23891 timeincl='$timeincl'
23892 timetype='$timetype'
23893 tmpnam_r_proto='$tmpnam_r_proto'
23899 ttyname_r_proto='$ttyname_r_proto'
23908 uidformat='$uidformat'
23914 uquadtype='$uquadtype'
23915 use5005threads='$use5005threads'
23916 use64bitall='$use64bitall'
23917 use64bitint='$use64bitint'
23918 usecrosscompile='$usecrosscompile'
23919 usedevel='$usedevel'
23921 usedtrace='$usedtrace'
23922 usefaststdio='$usefaststdio'
23923 useithreads='$useithreads'
23924 usekernprocpathname='$usekernprocpathname'
23925 uselargefiles='$uselargefiles'
23926 uselongdouble='$uselongdouble'
23927 usemallocwrap='$usemallocwrap'
23928 usemorebits='$usemorebits'
23929 usemultiplicity='$usemultiplicity'
23930 usemymalloc='$usemymalloc'
23932 usensgetexecutablepath='$usensgetexecutablepath'
23933 useopcode='$useopcode'
23934 useperlio='$useperlio'
23935 useposix='$useposix'
23936 usereentrant='$usereentrant'
23937 userelocatableinc='$userelocatableinc'
23938 useshrplib='$useshrplib'
23939 usesitecustomize='$usesitecustomize'
23940 usesocks='$usesocks'
23941 usethreads='$usethreads'
23942 usevendorprefix='$usevendorprefix'
23943 useversionedarchname='$useversionedarchname'
23944 usevfork='$usevfork'
23947 uvXUformat='$uvXUformat'
23948 uvoformat='$uvoformat'
23951 uvuformat='$uvuformat'
23952 uvxformat='$uvxformat'
23954 vendorarch='$vendorarch'
23955 vendorarchexp='$vendorarchexp'
23956 vendorbin='$vendorbin'
23957 vendorbinexp='$vendorbinexp'
23958 vendorhtml1dir='$vendorhtml1dir'
23959 vendorhtml1direxp='$vendorhtml1direxp'
23960 vendorhtml3dir='$vendorhtml3dir'
23961 vendorhtml3direxp='$vendorhtml3direxp'
23962 vendorlib='$vendorlib'
23963 vendorlib_stem='$vendorlib_stem'
23964 vendorlibexp='$vendorlibexp'
23965 vendorman1dir='$vendorman1dir'
23966 vendorman1direxp='$vendorman1direxp'
23967 vendorman3dir='$vendorman3dir'
23968 vendorman3direxp='$vendorman3direxp'
23969 vendorprefix='$vendorprefix'
23970 vendorprefixexp='$vendorprefixexp'
23971 vendorscript='$vendorscript'
23972 vendorscriptexp='$vendorscriptexp'
23974 version_patchlevel_string='$version_patchlevel_string'
23975 versiononly='$versiononly'
23979 yaccflags='$yaccflags'
23984 : add special variables
23985 $test -f $src/patchlevel.h && \
23986 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23987 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23988 echo "PERL_CONFIG_SH=true" >>config.sh
23990 : propagate old symbols
23991 if $test -f UU/config.sh; then
23992 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23993 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23994 config.sh config.sh UU/oldconfig.sh |\
23995 $sort | $uniq -u >UU/oldsyms
23996 set X `$cat UU/oldsyms`
24002 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24004 echo ": Variables propagated from previous config.sh file." >>config.sh
24005 for sym in `$cat UU/oldsyms`; do
24006 echo " Propagating $hint variable "'$'"$sym..."
24007 eval 'tmp="$'"${sym}"'"'
24009 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24015 : Finish up by extracting the .SH files
24019 echo "Extraction done."
24029 If you'd like to make any changes to the config.sh file before I begin
24030 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24033 rp="Press return or use a shell escape to edit config.sh:"
24038 *) : in case they cannot read
24039 sh 1>&4 -c "$ans";;
24044 : if this fails, just run all the .SH files by hand
24053 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24060 Now you need to generate make dependencies by running "$make depend".
24061 You might prefer to run it in background: "$make depend > makedepend.out &"
24062 It can take a while, so you might not want to run it right now.
24067 rp="Run $make depend now?"
24071 $make depend && echo "Now you must run '$make'."
24074 echo "You must run '$make depend' then '$make'."
24077 elif test -f [Mm]akefile; then
24079 echo "Now you must run a $make."
24081 echo "Configure done."
24084 if $test -f Policy.sh; then
24087 If you compile $package on a different machine or from a different object
24088 directory, copy the Policy.sh file from this object directory to the
24089 new one before you run Configure -- this will help you with most of
24090 the policy defaults.
24094 if $test -f config.msg; then
24095 echo "Hmm. I also noted the following information while running:"
24097 $cat config.msg >&4
24100 $rm -f kit*isdone ark*isdone